Re: [PATCH v1 00/12] Support OF_UPSTREAM for StarFive JH7110
Hi, On Thu, Oct 3, 2024 at 10:23 AM Hal Feng wrote: > > > On 01.10.24 01:56, Heinrich Schuchardt wrote: > > Another approach would be to build all device-trees into U-Boot and use the > > EEPROM information to select the correct one at runtime. > > > > This approach is selected by Wandboard defconfig and other boards by > > specifying CONFIG_MULTI_DTB_FIT and CONFIG_OF_LIST. The choice of the > > device-tree is made in board_fit_config_name_match(). > > > > The advantage from the standpoint of a Linux distro would be that one distro > > image can be provided that will run on all JH7110 boards. > > That is a good idea. I will try to do this after my five-day vacation. > By the way, I wanna know whether jh7110-milkv-mars-cm.dts and > jh7110-milkv-mars-cm-lite.dts are in the process of upstreaming? > I don't see them in the kernel mainline. > > Thanks for your suggestions. > > Best regards, > Hal There is not any jh7110-milkv-mars-cm.dts and jh7110-milkv-mars-cmlite.dts patch for Linux kernel upstream yet. Now may be a good time to do so, since Star64 was accepted and makes use of the common jh7110 dtsi that was introduced with devicetree of Milk-V Mars to Linux kernel. First this can go in U-Boot as the jh7110-milkv-mars.dts is good for Milk-V Mars CM and CM Lite, with addition of some GPIO assignments. This can be stubbed out by including jh7110-milkv-mars.dts until there are accepted upstream devicetree files for Mars CM and CM Lite. There are different GPIO assignments depending if it is U-Boot phase or Linux phase of the boot process; per the vendor sources. It is enough to pass a loaded jh7110-milkv-mars.dts to Linux on Mars CM and CM Lite hardware, if this GPIO assignment was done at U-Boot time and since then there is never any MMC reset while in Linux kernel: https://github.com/milkv-mars/mars-buildroot-sdk/commit/880a249518f72ecf1e2947dfeb2c66e5035fce90 https://github.com/milkv-mars/mars-buildroot-sdk/commit/042ea06598995db99dd252ee439c42b9c1a9 Much of the above diff listings can be ignored as already implemented or not needed, however, provided for reference what I am talking about for GPIO assignments 22 24 62 depending on the phase of boot process. -E
RE: [PATCH v1 00/12] Support OF_UPSTREAM for StarFive JH7110
> On 01.10.24 01:56, Heinrich Schuchardt wrote: > On 30.09.24 17:59, Hal Feng wrote: > > This patchset add OF_STREAM support for StarFive JH7110 based boards. > > All the JH7110 based boards can use the DT from upstreaming linux kernel. > > The v1.3b board device tree is set as the default device tree. > > > > This patchset should be applied after the DT from dts/upstream/ > > updating to the latest version. > > Hello Hal, > > Thanks a lot for making the move to upstream device-trees for JH7110 based > boards. > > With the current patchset you suggest to specify the relevant device-tree > when building, e.g. > > make > OPENSBI=$(opensbi_dir)/build/platform/generic/firmware/fw_dynamic.bin \ > DEVICE_TREE=starfive/jh7110-milkv-mars > > Another approach would be to build all device-trees into U-Boot and use the > EEPROM information to select the correct one at runtime. > > This approach is selected by Wandboard defconfig and other boards by > specifying CONFIG_MULTI_DTB_FIT and CONFIG_OF_LIST. The choice of the > device-tree is made in board_fit_config_name_match(). > > The advantage from the standpoint of a Linux distro would be that one distro > image can be provided that will run on all JH7110 boards. That is a good idea. I will try to do this after my five-day vacation. By the way, I wanna know whether jh7110-milkv-mars-cm.dts and jh7110-milkv-mars-cm-lite.dts are in the process of upstreaming? I don't see them in the kernel mainline. Thanks for your suggestions. Best regards, Hal
Re: [PATCH v1 00/12] Support OF_UPSTREAM for StarFive JH7110
On 30.09.24 17:59, Hal Feng wrote: This patchset add OF_STREAM support for StarFive JH7110 based boards. All the JH7110 based boards can use the DT from upstreaming linux kernel. The v1.3b board device tree is set as the default device tree. This patchset should be applied after the DT from dts/upstream/ updating to the latest version. Hello Hal, Thanks a lot for making the move to upstream device-trees for JH7110 based boards. With the current patchset you suggest to specify the relevant device-tree when building, e.g. make OPENSBI=$(opensbi_dir)/build/platform/generic/firmware/fw_dynamic.bin \ DEVICE_TREE=starfive/jh7110-milkv-mars Another approach would be to build all device-trees into U-Boot and use the EEPROM information to select the correct one at runtime. This approach is selected by Wandboard defconfig and other boards by specifying CONFIG_MULTI_DTB_FIT and CONFIG_OF_LIST. The choice of the device-tree is made in board_fit_config_name_match(). The advantage from the standpoint of a Linux distro would be that one distro image can be provided that will run on all JH7110 boards. Best regards Heinrich Hal Feng (12): Makefile: Add OF_UPSTREAM Makefile for RISC-V dts: starfive: Switch to using upstream DT riscv: dts: jh7110: Drop redundant devicetree files dt-bindings: Remove StarFive JH7110 clock and reset definitions riscv: dts: jh7110: Make u-boot device trees adapting to upstream DT clk: starfive: jh7110: Sync clock definitions with upstream dt-bindings pcie: starfive: Make the driver compatible with upstream DT riscv: dts: jh7110: Move common code to the new jh7110-common-u-boot.dtsi riscv: dts: jh7110: Add u-boot device tree for JH7110 based boards board: starfive: spl: Drop the unneeded DT modification code configs: visionfive2: Add OF_LIST for JH7110 based board DT doc: board: starfive: Update the building guide arch/riscv/cpu/jh7110/Kconfig | 1 + arch/riscv/dts/Makefile | 1 - ...-u-boot.dtsi => jh7110-common-u-boot.dtsi} | 41 +- arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 11 + .../dts/jh7110-pine64-star64-u-boot.dtsi | 6 + ...10-starfive-visionfive-2-v1.2a-u-boot.dtsi | 6 + ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 14 + .../dts/jh7110-starfive-visionfive-2.dts | 11 - .../dts/jh7110-starfive-visionfive-2.dtsi | 380 - arch/riscv/dts/jh7110-u-boot.dtsi | 36 +- arch/riscv/dts/jh7110.dtsi| 761 -- board/starfive/visionfive2/spl.c | 358 configs/starfive_visionfive2_defconfig| 3 +- doc/board/starfive/milk-v_mars.rst| 2 +- doc/board/starfive/milk-v_mars_cm.rst | 2 +- doc/board/starfive/pine64_star64.rst | 2 +- doc/board/starfive/visionfive2.rst| 11 +- drivers/clk/starfive/clk-jh7110-pll.c | 6 +- drivers/clk/starfive/clk-jh7110.c | 44 +- drivers/pci/pcie_starfive_jh7110.c| 59 +- dts/upstream/src/riscv/Makefile | 14 + .../dt-bindings/clock/starfive,jh7110-crg.h | 258 -- .../dt-bindings/reset/starfive,jh7110-crg.h | 183 - 23 files changed, 194 insertions(+), 2016 deletions(-) rename arch/riscv/dts/{jh7110-starfive-visionfive-2-u-boot.dtsi => jh7110-common-u-boot.dtsi} (56%) create mode 100644 arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2.dts delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2.dtsi delete mode 100644 arch/riscv/dts/jh7110.dtsi create mode 100644 dts/upstream/src/riscv/Makefile delete mode 100644 include/dt-bindings/clock/starfive,jh7110-crg.h delete mode 100644 include/dt-bindings/reset/starfive,jh7110-crg.h base-commit: 56b47b8b6a09c777e74fe6c52512c832691169aa