Support OF_UPSTREAM for StarFive JH7110
Subsystems (7)
Hal Feng
maintainerv6 cover Support OF_UPSTREAM for StarFive JH7110
This patchset add OF_UPSTREAM 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. Support CONFIG_MULTI_DTB_FIT and the SPL selects the correct U-Boot dtb using the EEPROM information.
Note:
1. Mars CM (lite) are missing upstream dts and so are detected but not supported in this series. Users of Mars CM and Mars CM Lite may stay with U-Boot v2024.10 until this is resolved.
2. Property values of network phy0/1 for all JH7110 based boards now follow the upstream dts.
Changes since v5:
- In patch 2, drop the override of rx-internal-delay-ps on phy0 and phy1.
- In patch 5, drop "/delete-property/ motorcomm,tx-clk-10-inverted;" for Mars network phy0.
- In patch 8, rename fdt and conf based on the compatible identifier of boards.
Changes since v4:
- Merge patch 2, 3, 5 into patch 1, ensuring git bisect works.
- Add a new patch to sort the list of JH7110 imply statements.
- Drop the reparent of clock JH7110_AONCLK_APB_FUNC in patch 4, which is unnecessary and will cause errors in gmac0 initialization.
Changes since v3:
- Add detection for Milk-V Mars CM (lite) boards in patch 13.
Changes since v2:
- Drop patch 1, because the riscv of_upstream Makefile is created by Conor in commit 239e4705099c.
- Drop phy0 rx delay for milkv u-boot dtsi in patch 9.
- Add a Fixes tag for patch 13.
- In patch 14, the PCB version is only obtained when the product_id is VF7110. Improve the commit messages.
Changes since v1:
- Drop patch 12.
- Modify patch 11 and add three new patches to support CONFIG_MULTI_DTB_FIT. The SPL selects the correct U-Boot dtb using the EEPROM information.
History:
v5: https://lore.kernel.org/all/[email protected]/
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/
Hal Feng (11):
dts: starfive: Switch to using upstream DT
riscv: dts: jh7110: Make u-boot device trees adapting to upstream DT
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: Enable MULTI_DTB_FIT for JH7110 based board DT
riscv: dts: jh7110: Support multiple DTBs in a Fit image
board: starfive: spl: Fix the wrong use of CONFIG_IS_ENABLED()
board: starfive: spl: Support multiple DTBs for JH7110 based boards
riscv: cpu: jh7110: Sort the list of imply statements
arch/riscv/cpu/jh7110/Kconfig | 19 +- arch/riscv/dts/Makefile | 1 - arch/riscv/dts/jh7110-common-u-boot.dtsi | 198 +++++ arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 7 + .../dts/jh7110-pine64-star64-u-boot.dtsi | 6 + .../jh7110-starfive-visionfive-2-u-boot.dtsi | 117 --- ...10-starfive-visionfive-2-v1.2a-u-boot.dtsi | 6 + ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 6 + .../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 | 391 +-------- configs/starfive_visionfive2_defconfig | 4 +- drivers/clk/starfive/clk-jh7110-pll.c | 6 +- drivers/clk/starfive/clk-jh7110.c | 44 +- drivers/pci/pcie_starfive_jh7110.c | 59 +- .../dt-bindings/clock/starfive,jh7110-crg.h | 258 ------ .../dt-bindings/reset/starfive,jh7110-crg.h | 183 ----- 19 files changed, 358 insertions(+), 2135 deletions(-) create mode 100644 arch/riscv/dts/jh7110-common-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-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 delete mode 100644 include/dt-bindings/clock/starfive,jh7110-crg.h delete mode 100644 include/dt-bindings/reset/starfive,jh7110-crg.h
base-commit: 880fcc49eb40a78ed27ff575aa02034d7bd74e80
Signature · 1 line
2.43.2
Hal Feng
maintainerPATCH v6 1/11 dts: starfive: Switch to using upstream DT
Enable OF_UPSTREAM to use upstream DT and add starfive/ prefix to the DEFAULT_DEVICE_TREE. Rename jh7110-starfive-visionfive-2-u-boot.dtsi to jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi and set the v1.3b device tree as the default device tree.
Drop redundant DT files from arch/riscv/dts/ and redundant clock and reset definitions from include/dt-bindings/.
Since the old clock definitions is a little different from those in upstream Linux, update the clock definitions in clock drivers accordingly.
---
arch/riscv/cpu/jh7110/Kconfig | 1 +
arch/riscv/dts/Makefile | 1 -
...0-starfive-visionfive-2-v1.3b-u-boot.dtsi} | 0
.../dts/jh7110-starfive-visionfive-2.dts | 11 -
.../dts/jh7110-starfive-visionfive-2.dtsi | 380 ---------
arch/riscv/dts/jh7110-u-boot.dtsi | 2 +-
arch/riscv/dts/jh7110.dtsi | 761 ------------------
configs/starfive_visionfive2_defconfig | 2 +-
drivers/clk/starfive/clk-jh7110-pll.c | 6 +-
drivers/clk/starfive/clk-jh7110.c | 44 +-
.../dt-bindings/clock/starfive,jh7110-crg.h | 258 ------
.../dt-bindings/reset/starfive,jh7110-crg.h | 183 -----
12 files changed, 28 insertions(+), 1621 deletions(-)
rename arch/riscv/dts/{jh7110-starfive-visionfive-2-u-boot.dtsi => jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi} (100%)
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
delete mode 100644 include/dt-bindings/clock/starfive,jh7110-crg.h
delete mode 100644 include/dt-bindings/reset/starfive,jh7110-crg.harch/riscv/cpu/jh7110/Kconfig +1 -0
@@ -19,6 +19,7 @@ config STARFIVE_JH7110 imply MMC imply MMC_BROKEN_CD imply MMC_SPI + imply OF_UPSTREAM imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE) imply SIFIVE_CACHE imply SIFIVE_CCACHE
arch/riscv/dts/Makefile +0 -1
@@ -7,7 +7,6 @@ dtb-$(CONFIG_TARGET_OPENPITON_RISCV64) += openpiton-riscv64.dtb dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED) += hifive-unmatched-a00.dtb dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb -dtb-$(CONFIG_TARGET_STARFIVE_VISIONFIVE2) += jh7110-starfive-visionfive-2.dtb dtb-$(CONFIG_TARGET_TH1520_LPI4A) += th1520-lichee-pi-4a.dtb dtb-$(CONFIG_TARGET_XILINX_MBV) += xilinx-mbv32.dtb dtb-$(CONFIG_TARGET_XILINX_MBV) += xilinx-mbv64.dtb
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi renamed from arch/riscv/dts/jh7110-starfive-visionfive-2-u-boot.dtsi +0 -0
arch/riscv/dts/jh7110-starfive-visionfive-2.dts deleted +0 -11
@@ -1,11 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2023 StarFive Technology Co., Ltd. - */ - -/dts-v1/; -#include "jh7110-starfive-visionfive-2.dtsi" - -/ { - compatible = "starfive,visionfive-2-v1.3b", "starfive,jh7110"; -};
arch/riscv/dts/jh7110-starfive-visionfive-2.dtsi deleted +0 -380
380 lines not on this page · raw message
arch/riscv/dts/jh7110-u-boot.dtsi +1 -1
@@ -62,7 +62,7 @@ <&syscrg JH7110_SYSRST_DDR_OSC>, <&syscrg JH7110_SYSRST_DDR_APB>; reset-names = "axi", "osc", "apb"; - clocks = <&syscrg JH7110_SYSCLK_PLL1_OUT>; + clocks = <&syscrg JH7110_PLLCLK_PLL1_OUT>; clock-names = "pll1_out"; clock-frequency = <2133>; };
arch/riscv/dts/jh7110.dtsi deleted +0 -761
761 lines not on this page · raw message
configs/starfive_visionfive2_defconfig +1 -1
@@ -9,7 +9,7 @@ CONFIG_SF_DEFAULT_SPEED=100000000 CONFIG_ENV_SIZE=0x10000 CONFIG_ENV_OFFSET=0xf0000 CONFIG_SPL_DM_SPI=y -CONFIG_DEFAULT_DEVICE_TREE="jh7110-starfive-visionfive-2" +CONFIG_DEFAULT_DEVICE_TREE="starfive/jh7110-starfive-visionfive-2-v1.3b" CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_DM_RESET=y CONFIG_SPL_MMC=y
drivers/clk/starfive/clk-jh7110-pll.c +3 -3
@@ -374,13 +374,13 @@ static int jh7110_pll_clk_probe(struct udevice *dev)if (sysreg ==FDT_ADDR_T_NONE )return -EINVAL ; -clk_dm (JH7110_PLL_ID_TRANS (JH7110_SYSCLK_PLL0_OUT ), +clk_dm (JH7110_PLL_ID_TRANS (JH7110_PLLCLK_PLL0_OUT ),starfive_jh7110_pll ("pll0_out" ,"oscillator" , reg, (void __iomem *)sysreg, &starfive_jh7110_pll0)); -clk_dm (JH7110_PLL_ID_TRANS (JH7110_SYSCLK_PLL1_OUT ), +clk_dm (JH7110_PLL_ID_TRANS (JH7110_PLLCLK_PLL1_OUT ),starfive_jh7110_pll ("pll1_out" ,"oscillator" , reg, (void __iomem *)sysreg, &starfive_jh7110_pll1)); -clk_dm (JH7110_PLL_ID_TRANS (JH7110_SYSCLK_PLL2_OUT ), +clk_dm (JH7110_PLL_ID_TRANS (JH7110_PLLCLK_PLL2_OUT ),starfive_jh7110_pll ("pll2_out" ,"oscillator" , reg, (void __iomem *)sysreg, &starfive_jh7110_pll2));
drivers/clk/starfive/clk-jh7110.c +22 -22
83 lines not on this page · raw message
include/dt-bindings/clock/starfive,jh7110-crg.h deleted +0 -258
258 lines not on this page · raw message
include/dt-bindings/reset/starfive,jh7110-crg.h deleted +0 -183
183 lines not on this page · raw message
Signature · 1 line
2.43.2
Hal Feng
maintainerPATCH v6 2/11 riscv: dts: jh7110: Make u-boot device trees adapting to upstream DT
In reply to Hal FengAdd u-boot features to the U-Boot device tree.
--- ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 35 ++++++++++++++++--- arch/riscv/dts/jh7110-u-boot.dtsi | 34 ++++++++++++++++++ 2 files changed, 65 insertions(+), 4 deletions(-)
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi +31 -4
@@ -6,6 +6,10 @@ #include "binman.dtsi" #include "jh7110-u-boot.dtsi" / { + aliases { + spi0 = &qspi; + }; + chosen { bootph-pre-ram; };
@@ -27,42 +31,62 @@ &uart0 { bootph-pre-ram; + reg-offset = <0>; + current-speed = <115200>; + clock-frequency = <24000000>; }; &mmc0 { bootph-pre-ram; + compatible = "snps,dw-mshc"; }; &mmc1 { bootph-pre-ram; + compatible = "snps,dw-mshc"; }; &qspi { bootph-pre-ram; + spi-max-frequency = <250000000>; - nor-flash@0 { + flash@0 { bootph-pre-ram; + /delete-property/ cdns,read-delay; + spi-max-frequency = <100000000>; }; }; +&syscrg { + assigned-clocks = <&syscrg JH7110_SYSCLK_CPU_ROOT>, + <&syscrg JH7110_SYSCLK_BUS_ROOT>, + <&syscrg JH7110_SYSCLK_PERH_ROOT>, + <&syscrg JH7110_SYSCLK_QSPI_REF>; + assigned-clock-parents = <&pllclk JH7110_PLLCLK_PLL0_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&syscrg JH7110_SYSCLK_QSPI_REF_SRC>; + assigned-clock-rates = <0>, <0>, <0>, <0>; +}; + &sysgpio { bootph-pre-ram; }; &mmc0_pins { bootph-pre-ram; - mmc0-pins-rest { + rst-pins { bootph-pre-ram; }; }; &mmc1_pins { bootph-pre-ram; - mmc1-pins0 { + clk-pins { bootph-pre-ram; }; - mmc1-pins1 { + mmc-pins { bootph-pre-ram; }; };
@@ -78,6 +102,9 @@ bootph-pre-ram; eeprom@50 { bootph-pre-ram; + compatible = "atmel,24c04"; + reg = <0x50>; + pagesize = <16>; }; };
arch/riscv/dts/jh7110-u-boot.dtsi +34 -0
@@ -46,6 +46,15 @@ }; }; + timer { + compatible = "riscv,timer"; + interrupts-extended = <&cpu0_intc 5>, + <&cpu1_intc 5>, + <&cpu2_intc 5>, + <&cpu3_intc 5>, + <&cpu4_intc 5>; + }; + soc { bootph-pre-ram;
@@ -73,10 +82,35 @@ bootph-pre-ram; }; +&gmac0_rgmii_rxin { + bootph-pre-ram; +}; + &gmac0_rmii_refin { bootph-pre-ram; }; +&gmac1_rgmii_rxin { + bootph-pre-ram; +}; + +&gmac1_rmii_refin { + bootph-pre-ram; +}; + +&stmmac_axi_setup { + snps,wr_osr_lmt = <4>; + snps,rd_osr_lmt = <4>; +}; + +&gmac0 { + snps,perfect-filter-entries = <8>; +}; + +&gmac1 { + snps,perfect-filter-entries = <8>; +}; + &aoncrg { bootph-pre-ram; };
Signature · 1 line
2.43.2
Re: [PATCH v6 02/11] riscv: dts: jh7110: Make u-boot device trees adapting to upstream DT
Quoted 95 lines · Hal Feng
Add u-boot features to the U-Boot device tree.
Tested-by E Shattow <[email protected]>Acked-by Sumit Garg <[email protected]>Signed-off-by Hal Feng <[email protected]>--- ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 35 ++++++++++++++++--- arch/riscv/dts/jh7110-u-boot.dtsi | 34 ++++++++++++++++++ 2 files changed, 65 insertions(+), 4 deletions(-)arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi +28
-4@@ -6,6 +6,10 @@ #include "binman.dtsi" #include "jh7110-u-boot.dtsi" / { + aliases { + spi0 = &qspi; + }; + chosen { bootph-pre-ram; };@@ -27,42 +31,62 @@ &uart0 { bootph-pre-ram; + reg-offset = <0>; + current-speed = <115200>; + clock-frequency = <24000000>; }; &mmc0 { bootph-pre-ram; + compatible = "snps,dw-mshc"; }; &mmc1 { bootph-pre-ram; + compatible = "snps,dw-mshc"; }; &qspi { bootph-pre-ram; + spi-max-frequency = <250000000>; - nor-flash@0 { + flash@0 { bootph-pre-ram; + /delete-property/ cdns,read-delay; + spi-max-frequency = <100000000>; }; }; +&syscrg { + assigned-clocks = <&syscrg JH7110_SYSCLK_CPU_ROOT>, + <&syscrg JH7110_SYSCLK_BUS_ROOT>, + <&syscrg JH7110_SYSCLK_PERH_ROOT>, + <&syscrg JH7110_SYSCLK_QSPI_REF>; + assigned-clock-parents = <&pllclk JH7110_PLLCLK_PLL0_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&syscrg JH7110_SYSCLK_QSPI_REF_SRC>; + assigned-clock-rates = <0>, <0>, <0>, <0>; +}; + &sysgpio { bootph-pre-ram; }; &mmc0_pins { bootph-pre-ram; - mmc0-pins-rest { + rst-pins { bootph-pre-ram; }; }; &mmc1_pins { bootph-pre-ram; - mmc1-pins0 { + clk-pins { bootph-pre-ram; }; - mmc1-pins1 { + mmc-pins { bootph-pre-ram; }; };
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi line 109
Quoted 8 lines
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi +3
-0@@ -78,6 +102,9 @@ bootph-pre-ram; eeprom@50 { bootph-pre-ram; + compatible = "atmel,24c04"; + reg = <0x50>; + pagesize = <16>; }; };
In some configurations with RTC there is a conflict in the addressing with EEPROM, as in:
https://github.com/milkv-mars/mars-buildroot-sdk/commit/d381610c92827de01b25843786012351b3f35519
Okay to keep this for now, a conflict is the exception and not the normal situation. Refactor this out of U-Boot when EEPROM node is sent upstream to Linux.
Quoted 58 lines
arch/riscv/dts/jh7110-u-boot.dtsi +34
-1@@ -46,6 +46,15 @@ }; }; + timer { + compatible = "riscv,timer"; + interrupts-extended = <&cpu0_intc 5>, + <&cpu1_intc 5>, + <&cpu2_intc 5>, + <&cpu3_intc 5>, + <&cpu4_intc 5>; + }; + soc { bootph-pre-ram;@@ -73,10 +82,35 @@ bootph-pre-ram; }; +&gmac0_rgmii_rxin { + bootph-pre-ram; +}; + &gmac0_rmii_refin { bootph-pre-ram; }; +&gmac1_rgmii_rxin { + bootph-pre-ram; +}; + +&gmac1_rmii_refin { + bootph-pre-ram; +}; + +&stmmac_axi_setup { + snps,wr_osr_lmt = <4>; + snps,rd_osr_lmt = <4>; +}; + +&gmac0 { + snps,perfect-filter-entries = <8>; +}; + +&gmac1 { + snps,perfect-filter-entries = <8>; +}; + &aoncrg { bootph-pre-ram; }; --
Quoted 2 lines
2.43.2
Hal Feng
maintainerPATCH v6 3/11 pcie: starfive: Make the driver compatible with upstream DT
In reply to Hal FengThere are difference between upstream DT and the old DT in terms of reg base, reset gpio and syscon. Make the driver compatible with upstream DT.
--- drivers/pci/pcie_starfive_jh7110.c | 59 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 29 deletions(-)
drivers/pci/pcie_starfive_jh7110.c +30 -29
@@ -25,13 +25,19 @@#include "pcie_plda_common.h" /* system control */ -#define STG_SYSCON_K_RP_NEP_MASK BIT(8) +#define STG_SYSCON_PCIE0_BASE 0x48 +#define STG_SYSCON_PCIE1_BASE 0x1f8 + +#define STG_SYSCON_AR_OFFSET 0x78#define STG_SYSCON_AXI4_SLVL_ARFUNC_MASK GENMASK(22, 8)#define STG_SYSCON_AXI4_SLVL_ARFUNC_SHIFT 8 +#define STG_SYSCON_AW_OFFSET 0x7c#define STG_SYSCON_AXI4_SLVL_AWFUNC_MASK GENMASK(14, 0)#define STG_SYSCON_CLKREQ_MASK BIT(22)#define STG_SYSCON_CKREF_SRC_SHIFT 18#define STG_SYSCON_CKREF_SRC_MASK GENMASK(19, 18) +#define STG_SYSCON_RP_NEP_OFFSET 0xe8 +#define STG_SYSCON_K_RP_NEP_MASK BIT(8)DECLARE_GLOBAL_DATA_PTR ;
@@ -41,9 +47,7 @@ struct starfive_pcie {struct reset_ctl_bulk rsts;struct gpio_desc reset_gpio;struct regmap *regmap; -u32 stg_arfun; -u32 stg_awfun; -u32 stg_rp_nep; +unsigned int stg_pcie_base; };static int starfive_pcie_atr_init (struct starfive_pcie *priv)
@@ -92,7 +96,6 @@ static int starfive_pcie_get_syscon(struct udevice *dev)struct starfive_pcie *priv =dev_get_priv (dev);struct udevice *syscon;struct ofnode_phandle_args syscfg_phandle; -u32 cells[4 ];int ret;/* get corresponding syscon phandle */
@@ -117,20 +120,6 @@ static int starfive_pcie_get_syscon(struct udevice *dev)return -ENODEV ; } -/* get syscon register offset */ - ret =dev_read_u32_array (dev,"starfive,stg-syscon" , - cells,ARRAY_SIZE (cells)); -if (ret) { -dev_err (dev,"Get syscon register err %d\n" , ret); -return -EINVAL ; - } - -dev_dbg (dev,"Get syscon values: %x, %x, %x\n" , - cells[1 ], cells[2 ], cells[3 ]); - priv->stg_arfun = cells[1 ]; - priv->stg_awfun = cells[2 ]; - priv->stg_rp_nep = cells[3 ]; -return 0 ; }
@@ -138,8 +127,9 @@ static int starfive_pcie_parse_dt(struct udevice *dev) {struct starfive_pcie *priv =dev_get_priv (dev);int ret; +u32 domain_nr; - priv->plda.reg_base = (void *)dev_read_addr_name (dev,"reg" ); + priv->plda.reg_base = (void *)dev_read_addr_name (dev,"apb" );if (priv->plda.reg_base == (void __iomem *)FDT_ADDR_T_NONE ) {dev_err (dev,"Missing required reg address range\n" );return -EINVAL ;
@@ -147,7 +137,7 @@ static int starfive_pcie_parse_dt(struct udevice *dev) priv->plda.cfg_base = (void *)dev_read_addr_size_name (dev, -"config" , +"cfg" , &priv->plda.cfg_size);if (priv->plda.cfg_base == (void __iomem *)FDT_ADDR_T_NONE ) {dev_err (dev,"Missing required config address range" );
@@ -172,7 +162,18 @@ static int starfive_pcie_parse_dt(struct udevice *dev)return ret; } - ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &priv->reset_gpio, + ret =dev_read_u32 (dev,"linux,pci-domain" , &domain_nr); +if (ret) { +dev_err (dev,"Can't get pci domain: %d\n" , ret); +return ret; + } + +if (domain_nr ==0 ) + priv->stg_pcie_base =STG_SYSCON_PCIE0_BASE ; +else + priv->stg_pcie_base =STG_SYSCON_PCIE1_BASE ; + + ret =gpio_request_by_name (dev,"perst-gpios" ,0 , &priv->reset_gpio,GPIOD_IS_OUT );if (ret) {dev_err (dev,"Can't get reset-gpio: %d\n" , ret);
@@ -208,12 +209,12 @@ static int starfive_pcie_init_port(struct udevice *dev)/* Disable physical functions except #0 */ for (i =1 ; i <PLDA_FUNC_NUM ; i++) {regmap_update_bits (priv->regmap, - priv->stg_arfun, + priv->stg_pcie_base +STG_SYSCON_AR_OFFSET ,STG_SYSCON_AXI4_SLVL_ARFUNC_MASK , (i <<PLDA_PHY_FUNC_SHIFT ) <<STG_SYSCON_AXI4_SLVL_ARFUNC_SHIFT );regmap_update_bits (priv->regmap, - priv->stg_awfun, + priv->stg_pcie_base +STG_SYSCON_AW_OFFSET ,STG_SYSCON_AXI4_SLVL_AWFUNC_MASK , i <<PLDA_PHY_FUNC_SHIFT );
@@ -222,11 +223,11 @@ static int starfive_pcie_init_port(struct udevice *dev)/* Disable physical functions */ regmap_update_bits (priv->regmap, - priv->stg_arfun, + priv->stg_pcie_base +STG_SYSCON_AR_OFFSET ,STG_SYSCON_AXI4_SLVL_ARFUNC_MASK ,0 );regmap_update_bits (priv->regmap, - priv->stg_awfun, + priv->stg_pcie_base +STG_SYSCON_AW_OFFSET ,STG_SYSCON_AXI4_SLVL_AWFUNC_MASK ,0 );
@@ -273,17 +274,17 @@ static int starfive_pcie_probe(struct udevice *dev)return ret;regmap_update_bits (priv->regmap, - priv->stg_rp_nep, + priv->stg_pcie_base +STG_SYSCON_RP_NEP_OFFSET ,STG_SYSCON_K_RP_NEP_MASK ,STG_SYSCON_K_RP_NEP_MASK );regmap_update_bits (priv->regmap, - priv->stg_awfun, + priv->stg_pcie_base +STG_SYSCON_AW_OFFSET ,STG_SYSCON_CKREF_SRC_MASK ,2 <<STG_SYSCON_CKREF_SRC_SHIFT );regmap_update_bits (priv->regmap, - priv->stg_awfun, + priv->stg_pcie_base +STG_SYSCON_AW_OFFSET ,STG_SYSCON_CLKREQ_MASK ,STG_SYSCON_CLKREQ_MASK );
Signature · 1 line
2.43.2
Hal Feng
maintainerPATCH v6 4/11 riscv: dts: jh7110: Move common code to the new jh7110-common-u-boot.dtsi
In reply to Hal FengTo support JH7110 based boards besides v1.3B,
add a common dtsi and add common code to it.
--- arch/riscv/dts/jh7110-common-u-boot.dtsi | 144 ++++++++++++++++++ ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 140 +---------------- 2 files changed, 145 insertions(+), 139 deletions(-) create mode 100644 arch/riscv/dts/jh7110-common-u-boot.dtsi
arch/riscv/dts/jh7110-common-u-boot.dtsi new file +144 -0
@@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2023 StarFive Technology Co., Ltd. + */ + +#include "binman.dtsi" +#include "jh7110-u-boot.dtsi" +/ { + aliases { + spi0 = &qspi; + }; + + chosen { + bootph-pre-ram; + }; + + firmware { + spi0 = &qspi; + bootph-pre-ram; + }; + + config { + bootph-pre-ram; + u-boot,spl-payload-offset = <0x100000>; + }; + + memory@40000000 { + bootph-pre-ram; + }; +}; + +&uart0 { + bootph-pre-ram; + reg-offset = <0>; + current-speed = <115200>; + clock-frequency = <24000000>; +}; + +&mmc0 { + bootph-pre-ram; + compatible = "snps,dw-mshc"; +}; + +&mmc1 { + bootph-pre-ram; + compatible = "snps,dw-mshc"; +}; + +&qspi { + bootph-pre-ram; + spi-max-frequency = <250000000>; + + flash@0 { + bootph-pre-ram; + /delete-property/ cdns,read-delay; + spi-max-frequency = <100000000>; + }; +}; + +&syscrg { + assigned-clocks = <&syscrg JH7110_SYSCLK_CPU_ROOT>, + <&syscrg JH7110_SYSCLK_BUS_ROOT>, + <&syscrg JH7110_SYSCLK_PERH_ROOT>, + <&syscrg JH7110_SYSCLK_QSPI_REF>; + assigned-clock-parents = <&pllclk JH7110_PLLCLK_PLL0_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&syscrg JH7110_SYSCLK_QSPI_REF_SRC>; + assigned-clock-rates = <0>, <0>, <0>, <0>; +}; + +&sysgpio { + bootph-pre-ram; +}; + +&mmc0_pins { + bootph-pre-ram; + rst-pins { + bootph-pre-ram; + }; +}; + +&mmc1_pins { + bootph-pre-ram; + clk-pins { + bootph-pre-ram; + }; + + mmc-pins { + bootph-pre-ram; + }; +}; + +&i2c5_pins { + bootph-pre-ram; + i2c-pins { + bootph-pre-ram; + }; +}; + +&i2c5 { + bootph-pre-ram; + eeprom@50 { + bootph-pre-ram; + compatible = "atmel,24c04"; + reg = <0x50>; + pagesize = <16>; + }; +}; + +&binman { + itb { + fit { + images { + fdt-1 { + description = "NAME"; + load = <0x40400000>; + compression = "none"; + + uboot_fdt_blob: blob-ext { + filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + conf-1 { + fdt = "fdt-1"; + }; + }; + }; + }; + + spl-img { + filename = "spl/u-boot-spl.bin.normal.out"; + + mkimage { + args = "-T sfspl"; + + u-boot-spl { + }; + }; + }; +};
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi +1 -139
143 lines not on this page · raw message
Signature · 1 line
2.43.2
Re: [PATCH v6 04/11] riscv: dts: jh7110: Move common code to the new jh7110-common-u-boot.dtsi
Quoted 56 lines · Hal Feng
To support JH7110 based boards besides v1.3B,
add a common dtsi and add common code to it.Tested-by E Shattow <[email protected]>Signed-off-by Hal Feng <[email protected]>--- arch/riscv/dts/jh7110-common-u-boot.dtsi | 144 ++++++++++++++++++ ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 140 +---------------- 2 files changed, 145 insertions(+), 139 deletions(-) create mode 100644 arch/riscv/dts/jh7110-common-u-boot.dtsiarch/riscv/dts/jh7110-common-u-boot.dtsi new file +38
-0@@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2023 StarFive Technology Co., Ltd. + */ + +#include "binman.dtsi" +#include "jh7110-u-boot.dtsi" +/ { + aliases { + spi0 = &qspi; + }; + + chosen { + bootph-pre-ram; + }; + + firmware { + spi0 = &qspi; + bootph-pre-ram; + }; + + config { + bootph-pre-ram; + u-boot,spl-payload-offset = <0x100000>; + }; + + memory@40000000 { + bootph-pre-ram; + }; +}; + +&uart0 { + bootph-pre-ram; + reg-offset = <0>; + current-speed = <115200>; + clock-frequency = <24000000>; +}; +
arch/riscv/dts/jh7110-common-u-boot.dtsi line 47
Quoted 10 lines
arch/riscv/dts/jh7110-common-u-boot.dtsi new file +9
-0+&mmc0 { + bootph-pre-ram; + compatible = "snps,dw-mshc"; +}; + +&mmc1 { + bootph-pre-ram; + compatible = "snps,dw-mshc"; +};
Following this series being applied should be an enhancement to add the U-Boot JH7110 MMC driver wrapper and factor out this override. Okay for now.
Quoted 53 lines
arch/riscv/dts/jh7110-common-u-boot.dtsi new file +53
-0+ +&qspi { + bootph-pre-ram; + spi-max-frequency = <250000000>; + + flash@0 { + bootph-pre-ram; + /delete-property/ cdns,read-delay; + spi-max-frequency = <100000000>; + }; +}; + +&syscrg { + assigned-clocks = <&syscrg JH7110_SYSCLK_CPU_ROOT>, + <&syscrg JH7110_SYSCLK_BUS_ROOT>, + <&syscrg JH7110_SYSCLK_PERH_ROOT>, + <&syscrg JH7110_SYSCLK_QSPI_REF>; + assigned-clock-parents = <&pllclk JH7110_PLLCLK_PLL0_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&pllclk JH7110_PLLCLK_PLL2_OUT>, + <&syscrg JH7110_SYSCLK_QSPI_REF_SRC>; + assigned-clock-rates = <0>, <0>, <0>, <0>; +}; + +&sysgpio { + bootph-pre-ram; +}; + +&mmc0_pins { + bootph-pre-ram; + rst-pins { + bootph-pre-ram; + }; +}; + +&mmc1_pins { + bootph-pre-ram; + clk-pins { + bootph-pre-ram; + }; + + mmc-pins { + bootph-pre-ram; + }; +}; + +&i2c5_pins { + bootph-pre-ram; + i2c-pins { + bootph-pre-ram; + }; +}; +
arch/riscv/dts/jh7110-common-u-boot.dtsi line 109
Quoted 10 lines
arch/riscv/dts/jh7110-common-u-boot.dtsi new file +9
-0+&i2c5 { + bootph-pre-ram; + eeprom@50 { + bootph-pre-ram; + compatible = "atmel,24c04"; + reg = <0x50>; + pagesize = <16>; + }; +};
(repeating my comment from "[PATCH v6 02/11] riscv: dts: jh7110: Make u-boot device trees adapting to upstream DT")
In some configurations with RTC there is a conflict in the addressing with EEPROM, as in:
https://github.com/milkv-mars/mars-buildroot-sdk/commit/d381610c92827de01b25843786012351b3f35519
Okay to keep this for now, a conflict is the exception and not the normal situation. Refactor this out of U-Boot when EEPROM node is sent upstream to Linux.
Quoted 184 lines
arch/riscv/dts/jh7110-common-u-boot.dtsi new file +35
-0+ +&binman { + itb { + fit { + images { + fdt-1 { + description = "NAME"; + load = <0x40400000>; + compression = "none"; + + uboot_fdt_blob: blob-ext { + filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + conf-1 { + fdt = "fdt-1"; + }; + }; + }; + }; + + spl-img { + filename = "spl/u-boot-spl.bin.normal.out"; + + mkimage { + args = "-T sfspl"; + + u-boot-spl { + }; + }; + }; +};arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi +1
-140@@ -3,142 +3,4 @@ * Copyright (C) 2023 StarFive Technology Co., Ltd. */ -#include "binman.dtsi" -#include "jh7110-u-boot.dtsi" -/ { - aliases { - spi0 = &qspi; - }; - - chosen { - bootph-pre-ram; - }; - - firmware { - spi0 = &qspi; - bootph-pre-ram; - }; - - config { - bootph-pre-ram; - u-boot,spl-payload-offset = <0x100000>; - }; - - memory@40000000 { - bootph-pre-ram; - }; -}; - -&uart0 { - bootph-pre-ram; - reg-offset = <0>; - current-speed = <115200>; - clock-frequency = <24000000>; -}; - -&mmc0 { - bootph-pre-ram; - compatible = "snps,dw-mshc"; -}; - -&mmc1 { - bootph-pre-ram; - compatible = "snps,dw-mshc"; -}; - -&qspi { - bootph-pre-ram; - spi-max-frequency = <250000000>; - - flash@0 { - bootph-pre-ram; - /delete-property/ cdns,read-delay; - spi-max-frequency = <100000000>; - }; -}; - -&syscrg { - assigned-clocks = <&syscrg JH7110_SYSCLK_CPU_ROOT>, - <&syscrg JH7110_SYSCLK_BUS_ROOT>, - <&syscrg JH7110_SYSCLK_PERH_ROOT>, - <&syscrg JH7110_SYSCLK_QSPI_REF>; - assigned-clock-parents = <&pllclk JH7110_PLLCLK_PLL0_OUT>, - <&pllclk JH7110_PLLCLK_PLL2_OUT>, - <&pllclk JH7110_PLLCLK_PLL2_OUT>, - <&syscrg JH7110_SYSCLK_QSPI_REF_SRC>; - assigned-clock-rates = <0>, <0>, <0>, <0>; -}; - -&sysgpio { - bootph-pre-ram; -}; - -&mmc0_pins { - bootph-pre-ram; - rst-pins { - bootph-pre-ram; - }; -}; - -&mmc1_pins { - bootph-pre-ram; - clk-pins { - bootph-pre-ram; - }; - - mmc-pins { - bootph-pre-ram; - }; -}; - -&i2c5_pins { - bootph-pre-ram; - i2c-pins { - bootph-pre-ram; - }; -}; - -&i2c5 { - bootph-pre-ram; - eeprom@50 { - bootph-pre-ram; - compatible = "atmel,24c04"; - reg = <0x50>; - pagesize = <16>; - }; -}; - -&binman { - itb { - fit { - images { - fdt-1 { - description = "NAME"; - load = <0x40400000>; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - conf-1 { - fdt = "fdt-1"; - }; - }; - }; - }; - - spl-img { - filename = "spl/u-boot-spl.bin.normal.out"; - - mkimage { - args = "-T sfspl"; - - u-boot-spl { - }; - }; - }; -}; +#include "jh7110-common-u-boot.dtsi" --
Quoted 2 lines
2.43.2
Hal Feng
maintainerPATCH v6 5/11 riscv: dts: jh7110: Add u-boot device tree for JH7110 based boards
In reply to Hal FengTo support the other JH7110 based boards, add u-boot device tree for them.
--- arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 7 +++++++ arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi | 6 ++++++ .../dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi | 6 ++++++ 3 files changed, 19 insertions(+) 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
arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi new file +7 -0
@@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 StarFive Technology Co., Ltd. + */ + +#include "jh7110-common-u-boot.dtsi" +
arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi new file +6 -0
@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 StarFive Technology Co., Ltd. + */ + +#include "jh7110-common-u-boot.dtsi"
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi new file +6 -0
@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 StarFive Technology Co., Ltd. + */ + +#include "jh7110-common-u-boot.dtsi"
Signature · 1 line
2.43.2
Re: [PATCH v6 05/11] riscv: dts: jh7110: Add u-boot device tree for JH7110 based boards
Quoted 25 lines · Hal Feng
To support the other JH7110 based boards, add u-boot device tree for them.
Tested-by E Shattow <[email protected]>Reviewed-by E Shattow <[email protected]>Cc Heinrich Schuchardt <[email protected]>Cc H Bell <[email protected]>Signed-off-by Hal Feng <[email protected]>--- arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 7 +++++++ arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi | 6 ++++++ .../dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi | 6 ++++++ 3 files changed, 19 insertions(+) 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.dtsiarch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi new file +0
-0
arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi line 7
Quoted 7 lines
arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi new file +7
-0@@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 StarFive Technology Co., Ltd. + */ + +#include "jh7110-common-u-boot.dtsi" +
delete newline at end of file
Quoted 25 lines
arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi new file +6
-0@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 StarFive Technology Co., Ltd. + */ + +#include "jh7110-common-u-boot.dtsi"arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi new file +6
-1@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 StarFive Technology Co., Ltd. + */ + +#include "jh7110-common-u-boot.dtsi" --
Quoted 2 lines
2.43.2
Hal Feng
maintainerPATCH v6 6/11 board: starfive: spl: Drop the unneeded DT modification code
In reply to Hal FengAs OF_UPSTREAM is implemented, these code are redundant.
--- board/starfive/visionfive2/spl.c | 356 ------------------------------- 1 file changed, 356 deletions(-)
board/starfive/visionfive2/spl.c +0 -356
@@ -20,364 +20,8 @@ DECLARE_GLOBAL_DATA_PTR;#define JH7110_CLK_CPU_ROOT_SHIFT 24#define JH7110_CLK_CPU_ROOT_MASK GENMASK(29, 24) -struct starfive_vf2_pro { -const char *path; -const char *name; -const char *value; -}; - -static const struct starfive_vf2_pro milk_v_mars[] = { - {"/soc/ethernet@16030000" ,"starfive,tx-use-rgmii-clk" ,NULL }, - {"/soc/ethernet@16040000" ,"starfive,tx-use-rgmii-clk" ,NULL }, - - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-adj-enabled" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-100-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-1000-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,rx-clk-drv-microamp" ,"3970" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,rx-data-drv-microamp" ,"2910" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"rx-internal-delay-ps" ,"1500" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"tx-internal-delay-ps" ,"1500" }, -}; - -static const struct starfive_vf2_pro starfive_vera[] = { - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" ,"rx-internal-delay-ps" , -"1900" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" ,"tx-internal-delay-ps" , -"1350" } -}; - -static const struct starfive_vf2_pro starfive_verb[] = { - {"/soc/ethernet@16030000" ,"starfive,tx-use-rgmii-clk" ,NULL }, - {"/soc/ethernet@16040000" ,"starfive,tx-use-rgmii-clk" ,NULL }, - - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-adj-enabled" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-100-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-1000-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,rx-clk-drv-microamp" ,"3970" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,rx-data-drv-microamp" ,"2910" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"rx-internal-delay-ps" ,"1500" }, - - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,tx-clk-adj-enabled" ,NULL }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,tx-clk-100-inverted" ,NULL }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,rx-clk-drv-microamp" ,"3970" }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,rx-data-drv-microamp" ,"2910" }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"rx-internal-delay-ps" ,"0" }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"tx-internal-delay-ps" ,"0" }, -}; - -static const struct starfive_vf2_pro star64_pine64[] = { - {"/soc/ethernet@16030000" ,"starfive,tx-use-rgmii-clk" ,NULL }, - {"/soc/ethernet@16040000" ,"starfive,tx-use-rgmii-clk" ,NULL }, - - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-adj-enabled" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-10-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-100-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,tx-clk-1000-inverted" ,NULL }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,rx-clk-drv-microamp" ,"2910" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"motorcomm,rx-data-drv-microamp" ,"2910" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"rx-internal-delay-ps" ,"1900" }, - {"/soc/ethernet@16030000/mdio/ethernet-phy@0" , -"tx-internal-delay-ps" ,"1500" }, - - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,tx-clk-adj-enabled" ,NULL }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,tx-clk-10-inverted" ,NULL }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,tx-clk-100-inverted" ,NULL }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,rx-clk-drv-microamp" ,"2910" }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"motorcomm,rx-data-drv-microamp" ,"2910" }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"rx-internal-delay-ps" ,"0" }, - {"/soc/ethernet@16040000/mdio/ethernet-phy@1" , -"tx-internal-delay-ps" ,"300" }, -}; - -void spl_fdt_fixup_mars (void *fdt) -{ -static const char compat[] ="milkv,mars\0starfive,jh7110" ; -u32 phandle; -u8 i; -int offset; -int ret; - -fdt_setprop (fdt,fdt_path_offset (fdt,"/" ),"compatible" , compat,sizeof (compat)); -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/" ),"model" , -"Milk-V Mars" ); - -/* gmac0 */ - offset =fdt_path_offset (fdt,"/soc/clock-controller@17000000" ); - phandle =fdt_get_phandle (fdt, offset); - offset =fdt_path_offset (fdt,"/soc/ethernet@16030000" ); - -fdt_setprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_AONCLK_GMAC0_TX ); -fdt_setprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_AONCLK_GMAC0_RMII_RTX ); - -/* gmac1 */ -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/soc/ethernet@16040000" ), -"status" ,"disabled" ); - -for (i =0 ; i <ARRAY_SIZE (milk_v_mars); i++) { - offset =fdt_path_offset (fdt, milk_v_mars[i].path); - -if (milk_v_mars[i].value) - ret =fdt_setprop_u32 (fdt, offset, milk_v_mars[i].name, -dectoul (milk_v_mars[i].value,NULL )); -else - ret =fdt_setprop_empty (fdt, offset, milk_v_mars[i].name); - -if (ret) { -pr_err ("%s set prop %s fail.\n" , __func__, milk_v_mars[i].name); -break ; - } - } -} - -void spl_fdt_fixup_mars_cm (void *fdt) -{ -const char *compat; -const char *model; -int compat_size; - -spl_fdt_fixup_mars (fdt); - -if (!get_mmc_size_from_eeprom ()) { -int offset; -static const char - compat_cm_lite[] ="milkv,mars-cm-lite\0starfive,jh7110" ; - - model ="Milk-V Mars CM Lite" ; - compat = compat_cm_lite; - compat_size =sizeof (compat_cm_lite); - - offset =fdt_path_offset (fdt,"/soc/pinctrl/mmc0-pins/mmc0-pins-rest" ); -/* GPIOMUX(22, GPOUT_SYS_SDIO0_RST, GPOEN_ENABLE, GPI_NONE) */ -fdt_setprop_u32 (fdt, offset,"pinmux" ,0xff130016 ); - }else { -static const char - compat_cm[] ="milkv,mars-cm\0starfive,jh7110" ; - - model ="Milk-V Mars CM" ; - compat = compat_cm; - compat_size =sizeof (compat_cm); - } -fdt_setprop (fdt,fdt_path_offset (fdt,"/" ), -"compatible" , compat, compat_size); -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/" ),"model" , model); -} - -void spl_fdt_fixup_version_a (void *fdt) -{ -static const char compat[] ="starfive,visionfive-2-v1.2a\0starfive,jh7110" ; -u32 phandle; -u8 i; -int offset; -int ret; - -fdt_setprop (fdt,fdt_path_offset (fdt,"/" ),"compatible" , compat,sizeof (compat)); -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/" ),"model" , -"StarFive VisionFive 2 v1.2A" ); - - offset =fdt_path_offset (fdt,"/soc/clock-controller@13020000" ); - phandle =fdt_get_phandle (fdt, offset); - offset =fdt_path_offset (fdt,"/soc/ethernet@16040000" ); - -fdt_setprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_SYSCLK_GMAC1_TX ); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_SYSCLK_GMAC1_RX ); - -fdt_setprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_SYSCLK_GMAC1_RMII_RTX ); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_SYSCLK_GMAC1_RMII_RTX ); - -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/soc/ethernet@16040000" ), -"phy-mode" ,"rmii" ); - -for (i =0 ; i <ARRAY_SIZE (starfive_vera); i++) { - offset =fdt_path_offset (fdt, starfive_vera[i].path); - -if (starfive_vera[i].value) - ret =fdt_setprop_u32 (fdt, offset, starfive_vera[i].name, -dectoul (starfive_vera[i].value,NULL )); -else - ret =fdt_setprop_empty (fdt, offset, starfive_vera[i].name); - -if (ret) { -pr_err ("%s set prop %s fail.\n" , __func__, starfive_vera[i].name); -break ; - } - } -} - -void spl_fdt_fixup_version_b (void *fdt) -{ -static const char compat[] ="starfive,visionfive-2-v1.3b\0starfive,jh7110" ; -u32 phandle; -u8 i; -int offset; -int ret; - -fdt_setprop (fdt,fdt_path_offset (fdt,"/" ),"compatible" , compat,sizeof (compat)); -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/" ),"model" , -"StarFive VisionFive 2 v1.3B" ); - -/* gmac0 */ - offset =fdt_path_offset (fdt,"/soc/clock-controller@17000000" ); - phandle =fdt_get_phandle (fdt, offset); - offset =fdt_path_offset (fdt,"/soc/ethernet@16030000" ); - -fdt_setprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_AONCLK_GMAC0_TX ); -fdt_setprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_AONCLK_GMAC0_RMII_RTX ); - -/* gmac1 */ - offset =fdt_path_offset (fdt,"/soc/clock-controller@13020000" ); - phandle =fdt_get_phandle (fdt, offset); - offset =fdt_path_offset (fdt,"/soc/ethernet@16040000" ); - -fdt_setprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_SYSCLK_GMAC1_TX ); -fdt_setprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_SYSCLK_GMAC1_RMII_RTX ); - -for (i =0 ; i <ARRAY_SIZE (starfive_verb); i++) { - offset =fdt_path_offset (fdt, starfive_verb[i].path); - -if (starfive_verb[i].value) - ret =fdt_setprop_u32 (fdt, offset, starfive_verb[i].name, -dectoul (starfive_verb[i].value,NULL )); -else - ret =fdt_setprop_empty (fdt, offset, starfive_verb[i].name); - -if (ret) { -pr_err ("%s set prop %s fail.\n" , __func__, starfive_verb[i].name); -break ; - } - } -} - -void spl_fdt_fixup_star64 (void *fdt) -{ -static const char compat[] ="pine64,star64\0starfive,jh7110" ; -u32 phandle; -u8 i; -int offset; -int ret; - -fdt_setprop (fdt,fdt_path_offset (fdt,"/" ),"compatible" , compat,sizeof (compat)); -fdt_setprop_string (fdt,fdt_path_offset (fdt,"/" ),"model" , -"Pine64 Star64" ); - -/* gmac0 */ - offset =fdt_path_offset (fdt,"/soc/clock-controller@17000000" ); - phandle =fdt_get_phandle (fdt, offset); - offset =fdt_path_offset (fdt,"/soc/ethernet@16030000" ); - -fdt_setprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_AONCLK_GMAC0_TX ); -fdt_setprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_AONCLK_GMAC0_RMII_RTX ); - -/* gmac1 */ - offset =fdt_path_offset (fdt,"/soc/clock-controller@13020000" ); - phandle =fdt_get_phandle (fdt, offset); - offset =fdt_path_offset (fdt,"/soc/ethernet@16040000" ); - -fdt_setprop_u32 (fdt, offset,"assigned-clocks" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clocks" ,JH7110_SYSCLK_GMAC1_TX ); -fdt_setprop_u32 (fdt, offset,"assigned-clock-parents" , phandle); -fdt_appendprop_u32 (fdt, offset,"assigned-clock-parents" , -JH7110_SYSCLK_GMAC1_RMII_RTX ); - -for (i =0 ; i <ARRAY_SIZE (star64_pine64); i++) { - offset =fdt_path_offset (fdt, star64_pine64[i].path); - -if (star64_pine64[i].value) - ret =fdt_setprop_u32 (fdt, offset, star64_pine64[i].name, -dectoul (star64_pine64[i].value,NULL )); -else - ret =fdt_setprop_empty (fdt, offset, star64_pine64[i].name); - -if (ret) { -pr_err ("%s set prop %s fail.\n" , __func__, star64_pine64[i].name); -break ; - } - } -} -void spl_perform_fixups (struct spl_image_info *spl_image) { -u8 version; -const char *product_id; - - product_id =get_product_id_from_eeprom (); -if (!product_id) { -pr_err ("Can't read EEPROM\n" ); -return ; - } -if (!strncmp (product_id,"MARC" ,4 )) { -spl_fdt_fixup_mars_cm (spl_image->fdt_addr); - }else if (!strncmp (product_id,"MARS" ,4 )) { -spl_fdt_fixup_mars (spl_image->fdt_addr); - }else if (!strncmp (product_id,"VF7110" ,6 )) { - version =get_pcb_revision_from_eeprom (); -switch (version) { -case 'a' : -case 'A' : -spl_fdt_fixup_version_a (spl_image->fdt_addr); -break ; - -case 'b' : -case 'B' : -default : -spl_fdt_fixup_version_b (spl_image->fdt_addr); -break ; - }; - }else if (!strncmp (product_id,"STAR64" ,6 )) { -spl_fdt_fixup_star64 (spl_image->fdt_addr); - }else { -pr_err ("Unknown product %s\n" , product_id); - }; -/* Update the memory size which read from eeprom or DT */ fdt_fixup_memory (spl_image->fdt_addr,0x40000000 , gd->ram_size); }
Signature · 1 line
2.43.2
Hal Feng
maintainerPATCH v6 7/11 configs: visionfive2: Enable MULTI_DTB_FIT for JH7110 based board DT
In reply to Hal FengSo JH7110 based boards can select their own DT at runtime.
--- configs/starfive_visionfive2_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/starfive_visionfive2_defconfig +2 -0
@@ -79,6 +79,8 @@ CONFIG_CMD_WDT=y CONFIG_CMD_TFTPPUT=y CONFIG_CMD_BOOTSTAGE=y CONFIG_OF_BOARD=y +CONFIG_OF_LIST="starfive/jh7110-starfive-visionfive-2-v1.3b starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-milkv-mars starfive/jh7110-pine64-star64" +CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SECT_SIZE_AUTO=y
Signature · 1 line
2.43.2
Re: [PATCH v6 07/11] configs: visionfive2: Enable MULTI_DTB_FIT for JH7110 based board DT
Quoted 14 lines · Hal Feng
So JH7110 based boards can select their own DT at runtime.
Tested-by E Shattow <[email protected]>Signed-off-by Hal Feng <[email protected]>--- configs/starfive_visionfive2_defconfig | 2 ++ 1 file changed, 2 insertions(+)configs/starfive_visionfive2_defconfig +0
-0
configs/starfive_visionfive2_defconfig CONFIG_CMD_WDT=y · line 83
Quoted 5 lines
configs/starfive_visionfive2_defconfig +1
-0@@ -79,6 +79,8 @@ CONFIG_CMD_WDT=y CONFIG_CMD_TFTPPUT=y CONFIG_CMD_BOOTSTAGE=y CONFIG_OF_BOARD=y +CONFIG_OF_LIST="starfive/jh7110-starfive-visionfive-2-v1.3b starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-milkv-mars starfive/jh7110-pine64-star64"
Please sort as:
starfive/jh7110-milkv-mars starfive/jh7110-pine64-star64 starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-starfive-visionfive-2-v1.3b
Quoted 7 lines
configs/starfive_visionfive2_defconfig +1
-0+CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_ENV_SECT_SIZE_AUTO=y
--
2.43.2
With that,
Hal Feng
maintainerPATCH v6 8/11 riscv: dts: jh7110: Support multiple DTBs in a Fit image
In reply to Hal FengSupport multiple DTBs for JH7110 based boards, so they can select the correct DT at runtime.
--- arch/riscv/dts/jh7110-common-u-boot.dtsi | 66 +++++++++++++++++++++--- 1 file changed, 60 insertions(+), 6 deletions(-)
arch/riscv/dts/jh7110-common-u-boot.dtsi +60 -6
@@ -112,20 +112,74 @@ itb { fit { images { - fdt-1 { - description = "NAME"; + fdt-jh7110-starfive-visionfive-2-v1.3b { + description = "jh7110-starfive-visionfive-2-v1.3b"; load = <0x40400000>; compression = "none"; - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb"; + }; + }; + + fdt-jh7110-starfive-visionfive-2-v1.2a { + description = "jh7110-starfive-visionfive-2-v1.2a"; + load = <0x40400000>; + compression = "none"; + + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb"; + }; + }; + + fdt-jh7110-milkv-mars { + description = "jh7110-milkv-mars"; + load = <0x40400000>; + compression = "none"; + + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-milkv-mars.dtb"; + }; + }; + + fdt-jh7110-pine64-star64 { + description = "jh7110-pine64-star64"; + load = <0x40400000>; + compression = "none"; + + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-pine64-star64.dtb"; }; }; }; configurations { - conf-1 { - fdt = "fdt-1"; + conf-jh7110-starfive-visionfive-2-v1.3b { + description = "jh7110-starfive-visionfive-2-v1.3b"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-starfive-visionfive-2-v1.3b"; + }; + + conf-jh7110-starfive-visionfive-2-v1.2a { + description = "jh7110-starfive-visionfive-2-v1.2a"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-starfive-visionfive-2-v1.2a"; + }; + + conf-jh7110-milkv-mars { + description = "jh7110-milkv-mars"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-milkv-mars"; + }; + + conf-jh7110-pine64-star64 { + description = "jh7110-pine64-star64"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-pine64-star64"; }; }; };
Signature · 1 line
2.43.2
Re: [PATCH v6 08/11] riscv: dts: jh7110: Support multiple DTBs in a Fit image
Hi Hal, this is better than it was before, thank you.
Quoted 96 lines · Hal Feng
Support multiple DTBs for JH7110 based boards, so they can select the correct DT at runtime.
Tested-by E Shattow <[email protected]>Signed-off-by Hal Feng <[email protected]>--- arch/riscv/dts/jh7110-common-u-boot.dtsi | 66 +++++++++++++++++++++--- 1 file changed, 60 insertions(+), 6 deletions(-)arch/riscv/dts/jh7110-common-u-boot.dtsi +60
-7@@ -112,20 +112,74 @@ itb { fit { images { - fdt-1 { - description = "NAME"; + fdt-jh7110-starfive-visionfive-2-v1.3b { + description = "jh7110-starfive-visionfive-2-v1.3b"; load = <0x40400000>; compression = "none"; - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb"; + }; + }; + + fdt-jh7110-starfive-visionfive-2-v1.2a { + description = "jh7110-starfive-visionfive-2-v1.2a"; + load = <0x40400000>; + compression = "none"; + + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb"; + }; + }; + + fdt-jh7110-milkv-mars { + description = "jh7110-milkv-mars"; + load = <0x40400000>; + compression = "none"; + + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-milkv-mars.dtb"; + }; + }; + + fdt-jh7110-pine64-star64 { + description = "jh7110-pine64-star64"; + load = <0x40400000>; + compression = "none"; + + blob-ext { + filename = "dts/upstream/src/riscv/starfive/jh7110-pine64-star64.dtb"; }; }; }; configurations { - conf-1 { - fdt = "fdt-1"; + conf-jh7110-starfive-visionfive-2-v1.3b { + description = "jh7110-starfive-visionfive-2-v1.3b"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-starfive-visionfive-2-v1.3b"; + }; + + conf-jh7110-starfive-visionfive-2-v1.2a { + description = "jh7110-starfive-visionfive-2-v1.2a"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-starfive-visionfive-2-v1.2a"; + }; + + conf-jh7110-milkv-mars { + description = "jh7110-milkv-mars"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-milkv-mars"; + }; + + conf-jh7110-pine64-star64 { + description = "jh7110-pine64-star64"; + firmware = "opensbi"; + loadables = "uboot"; + fdt = "fdt-jh7110-pine64-star64"; }; }; }; --
Quoted 2 lines
2.43.2
Referring to the U-Boot documentation
https://docs.u-boot.org/en/v2024.10/usage/fit/howto.html
gives an example as you have it here unsorted with "images" before "configurations".
However, nodes in images{} and configurations{} should be sorted:
fdt-jh7110-milkv-mars
fdt-jh7110-pine64-star64
fdt-jh7110-starfive-visionfive-2-v1.2a
fdt-jh7110-starfive-visionfive-2-v1.3b
conf-jh7110-milkv-mars
conf-jh7110-pine64-star64
conf-jh7110-starfive-visionfive-2-v1.2a
conf-jh7110-starfive-visionfive-2-v1.3b
With that,
Hal Feng
maintainerPATCH v6 9/11 board: starfive: spl: Fix the wrong use of CONFIG_IS_ENABLED()
In reply to Hal FengThe prefix "SPL_" is not needed when using CONFIG_IS_ENABLED().
--- board/starfive/visionfive2/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/starfive/visionfive2/spl.c +1 -1
@@ -110,7 +110,7 @@ void board_init_f(ulong dummy) } } -#if CONFIG_IS_ENABLED (SPL_LOAD_FIT ) +#if CONFIG_IS_ENABLED (LOAD_FIT )int board_fit_config_name_match (const char *name) {/* boot using first FIT config */
Signature · 1 line
2.43.2
Hal Feng
maintainerPATCH v6 10/11 board: starfive: spl: Support multiple DTBs for JH7110 based boards
In reply to Hal FengGet product ID and the other information from EEPROM, use them to select the correct DTB.
--- board/starfive/visionfive2/spl.c | 33 ++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)
board/starfive/visionfive2/spl.c +31 -2
@@ -113,7 +113,36 @@ void board_init_f(ulong dummy)#if CONFIG_IS_ENABLED (LOAD_FIT )int board_fit_config_name_match (const char *name) { -/* boot using first FIT config */ -return 0 ; +const char *product_id; +u8 version; + + product_id =get_product_id_from_eeprom (); + +if (!strncmp (product_id,"VF7110" ,6 )) { + version =get_pcb_revision_from_eeprom (); +if ((version =='b' || version =='B' ) && + !strcmp (name,"jh7110-starfive-visionfive-2-v1.3b" )) +return 0 ; + +if ((version =='a' || version =='A' ) && + !strcmp (name,"jh7110-starfive-visionfive-2-v1.2a" )) +return 0 ; + }else if (!strncmp (product_id,"MARS" ,4 ) && + !strcmp (name,"jh7110-milkv-mars" )) { +return 0 ; + }else if (!strncmp (product_id,"MARC" ,4 )) { +if (!get_mmc_size_from_eeprom ()) { +if (!strcmp (name,"jh7110-milkv-mars-cm-lite" )) +return 0 ; + }else { +if (!strcmp (name,"jh7110-milkv-mars-cm" )) +return 0 ; + } + }else if (!strncmp (product_id,"STAR64" ,6 ) && + !strcmp (name,"jh7110-pine64-star64" )) { +return 0 ; + } + +return -EINVAL ; }#endif
Signature · 1 line
2.43.2
Hal Feng
maintainerPATCH v6 11/11 riscv: cpu: jh7110: Sort the list of imply statements
In reply to Hal FengThe imply statements should be sorted in the sequence of appearance in .config.
--- arch/riscv/cpu/jh7110/Kconfig | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
arch/riscv/cpu/jh7110/Kconfig +10 -10
@@ -16,17 +16,17 @@ config STARFIVE_JH7110 select SYS_CACHE_SHIFT_6 select SPL_ZERO_MEM_BEFORE_USE select PINCTRL_STARFIVE_JH7110 + imply SMP + imply SPL_RISCV_ACLINT + imply SIFIVE_CACHE + imply SPL_SYS_MALLOC_CLEAR_ON_INIT + imply SPL_LOAD_FIT + imply SPL_CPU + imply SPL_OPENSBI + imply OF_UPSTREAM + imply SIFIVE_CCACHE imply MMC imply MMC_BROKEN_CD imply MMC_SPI - imply OF_UPSTREAM - imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE) - imply SIFIVE_CACHE - imply SIFIVE_CCACHE - imply SMP imply SPI - imply SPL_CPU - imply SPL_LOAD_FIT - imply SPL_OPENSBI - imply SPL_RISCV_ACLINT - imply SPL_SYS_MALLOC_CLEAR_ON_INIT + imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE)
Signature · 1 line
2.43.2
Hi Hal Feng,
Quoted 7 lines · Hal Feng
This patchset add
OF_UPSTREAMsupport 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. SupportCONFIG_MULTI_DTB_FITand the SPL selects the correct U-Boot dtb using the EEPROM information.
Quoted 8 lines
Note:
1. Mars CM (lite) are missing upstream dts and so are detected but not supported in this series. Users of Mars CM and Mars CM Lite may stay with U-Boot v2024.10 until this is resolved.2. Property values of network phy0/1 for all JH7110 based boards now follow the upstream dts.
Please add my
Best Regards
-Anand
Quoted 88 lines
Changes since v5:
- In patch 2, drop the override of rx-internal-delay-ps on phy0 and phy1.
- In patch 5, drop "/delete-property/ motorcomm,tx-clk-10-inverted;" for Mars network phy0.
- In patch 8, rename fdt and conf based on the compatible identifier of boards.Changes since v4:
- Merge patch 2, 3, 5 into patch 1, ensuring git bisect works.
- Add a new patch to sort the list of JH7110 imply statements.
- Drop the reparent of clockJH7110_AONCLK_APB_FUNCin patch 4, which is unnecessary and will cause errors in gmac0 initialization.Changes since v3:
- Add detection for Milk-V Mars CM (lite) boards in patch 13.Changes since v2:
- Drop patch 1, because the riscvof_upstreamMakefileis created by Conor in commit239e4705099c.
- Drop phy0 rx delay for milkv u-boot dtsi in patch 9.
- Add a Fixes tag for patch 13.
- In patch 14, the PCB version is only obtained when theproduct_idis VF7110. Improve the commit messages.Changes since v1:
- Drop patch 12.
- Modify patch 11 and add three new patches to supportCONFIG_MULTI_DTB_FIT. The SPL selects the correct U-Boot dtb using the EEPROM information.History:
v5: https://lore.kernel.org/all/[email protected]/
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/Hal Feng (11):
dts: starfive: Switch to using upstream DT
riscv: dts: jh7110: Make u-boot device trees adapting to upstream DT
pcie: starfive: Make the driver compatible with upstream DT
riscv: dts: jh7110: Move common code to the newjh7110-common-u-boot.dtsiriscv: dts: jh7110: Add u-boot device tree for JH7110 based boards
board: starfive: spl: Drop the unneeded DT modification code
configs: visionfive2: EnableMULTI_DTB_FITfor JH7110 based board DT
riscv: dts: jh7110: Support multiple DTBs in a Fit image
board: starfive: spl: Fix the wrong use ofCONFIG_IS_ENABLED()
board: starfive: spl: Support multiple DTBs for JH7110 based boards
riscv: cpu: jh7110: Sort the list of imply statementsarch/riscv/cpu/jh7110/Kconfig | 19 +- arch/riscv/dts/Makefile | 1 - arch/riscv/dts/jh7110-common-u-boot.dtsi | 198 +++++ arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 7 + .../dts/jh7110-pine64-star64-u-boot.dtsi | 6 + .../jh7110-starfive-visionfive-2-u-boot.dtsi | 117 --- ...10-starfive-visionfive-2-v1.2a-u-boot.dtsi | 6 + ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 6 + .../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 | 391 +-------- configs/starfive_visionfive2_defconfig | 4 +- drivers/clk/starfive/clk-jh7110-pll.c | 6 +- drivers/clk/starfive/clk-jh7110.c | 44 +- drivers/pci/pcie_starfive_jh7110.c | 59 +- .../dt-bindings/clock/starfive,jh7110-crg.h | 258 ------ .../dt-bindings/reset/starfive,jh7110-crg.h | 183 ----- 19 files changed, 358 insertions(+), 2135 deletions(-) create mode 100644 arch/riscv/dts/jh7110-common-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi create mode 100644 arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-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 delete mode 100644 include/dt-bindings/clock/starfive,jh7110-crg.h delete mode 100644 include/dt-bindings/reset/starfive,jh7110-crg.hbase-commit:
880fcc49eb40a78ed27ff575aa02034d7bd74e80--
2.43.2