riscv: dts: starfive: prune redundant jh7110-common overrides
v2 cover riscv: dts: starfive: prune redundant jh7110-common overrides
There are more than a few additional JH7110 CPU boards that may soon be upstreamed. Each new variant supported by U-Boot has the burden of adding a per-dts stub file for automatic dtsi inclusion by the build system. Also i.e. the JH7110S CPU board introduced by StarFive is to be supported by the same U-Boot starfive_visionfive2 target. Let's prepare for and clean out (remove) per-dts file -u-boot.dtsi automatic inclusion stubs for all dts that exist in dts/upstream/src subtree.
The (optional) last patch in this series anticipates additional CPU models for starfive_visionfive2 target and depends on adding CONFIG_SYS_CONFIG_NAME to automatic dtsi inclusion order [1]. 1: https://lore.kernel.org/u-boot/[email protected]/
Changes since v1:
- PATCH 1/1 "prune redundant jh7110-common overrides" update commit message
- Add patch "sync visionfive2 overrides with upstream Linux for-next"
- Add patch "visionfive2 depend on SYS_CPU automatic dtsi inclusion"
- Add patch "add CONFIG_SYS_CONFIG_NAME prefix to dtsi search"
- Add (optional) patch "visionfive2 depend on SYS_CONFIG_NAME automatic dtsi inclusion"
E Shattow (4):
riscv: dts: starfive: prune redundant jh7110-common overrides
riscv: dts: starfive: sync visionfive2 overrides with upstream Linux
for-next
riscv: dts: starfive: visionfive2 depend on SYS_CPU automatic dtsi
inclusion
riscv: dts: starfive: visionfive2 depend on SYS_CONFIG_NAME automatic
dtsi inclusion
arch/riscv/dts/jh7110-common-u-boot.dtsi | 99 -------------------
.../jh7110-deepcomputing-fml13v01-u-boot.dtsi | 7 --
arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 7 --
.../dts/jh7110-pine64-star64-u-boot.dtsi | 7 --
...10-starfive-visionfive-2-v1.2a-u-boot.dtsi | 7 --
...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 7 --
....dtsi => starfive-visionfive2-u-boot.dtsi} | 82 ++++++---------
7 files changed, 32 insertions(+), 184 deletions(-)
delete mode 100644 arch/riscv/dts/jh7110-common-u-boot.dtsi
delete mode 100644 arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi
delete mode 100644 arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi
delete mode 100644 arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi
delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi
delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi
rename arch/riscv/dts/{jh7110-u-boot.dtsi => starfive-visionfive2-u-boot.dtsi} (54%)base-commit: 76b8edbc732e327d1e56f08c641f51fdefdbff06
Signature · 1 line
2.50.0
PATCH v2 1/4 riscv: dts: starfive: prune redundant jh7110-common overrides
Prune jh7110-common-u-boot.dtsi (clocks, qspi flash, eeprom, and bootph-pre-ram hints now upstream since devicetree-rebasing v6.16).
In preparation for removal of per-dts jh7110-*-u-boot.dtsi replace include by next dependency jh7110-u-boot.dtsi in automatic dtsi inclusion order.
--- arch/riscv/dts/jh7110-common-u-boot.dtsi | 99 ------------------- .../jh7110-deepcomputing-fml13v01-u-boot.dtsi | 2 +- arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 2 +- .../dts/jh7110-pine64-star64-u-boot.dtsi | 2 +- ...10-starfive-visionfive-2-v1.2a-u-boot.dtsi | 2 +- ...10-starfive-visionfive-2-v1.3b-u-boot.dtsi | 2 +- 6 files changed, 5 insertions(+), 104 deletions(-) delete mode 100644 arch/riscv/dts/jh7110-common-u-boot.dtsi
arch/riscv/dts/jh7110-common-u-boot.dtsi deleted +0 -99
@@ -1,99 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2023 StarFive Technology Co., Ltd. - */ - -#include "jh7110-u-boot.dtsi" -/ { - aliases { - spi0 = &qspi; - }; - - chosen { - bootph-pre-ram; - }; - - firmware { - spi0 = &qspi; - bootph-pre-ram; - }; - - memory@40000000 { - bootph-pre-ram; - }; -}; - -&uart0 { - bootph-pre-ram; - reg-offset = <0>; - current-speed = <115200>; -}; - -&mmc0 { - bootph-pre-ram; -}; - -&mmc1 { - bootph-pre-ram; -}; - -&qspi { - bootph-pre-ram; - - flash@0 { - bootph-pre-ram; - cdns,read-delay = <2>; - 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>; - }; -};
arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi +1 -1
@@ -3,5 +3,5 @@ * Copyright (C) 2024 StarFive Technology Co., Ltd. */ -#include "jh7110-common-u-boot.dtsi" +#include "jh7110-u-boot.dtsi" #include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi +1 -1
@@ -3,5 +3,5 @@ * Copyright (C) 2024 StarFive Technology Co., Ltd. */ -#include "jh7110-common-u-boot.dtsi" +#include "jh7110-u-boot.dtsi" #include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi +1 -1
@@ -3,5 +3,5 @@ * Copyright (C) 2024 StarFive Technology Co., Ltd. */ -#include "jh7110-common-u-boot.dtsi" +#include "jh7110-u-boot.dtsi" #include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi +1 -1
@@ -3,5 +3,5 @@ * Copyright (C) 2024 StarFive Technology Co., Ltd. */ -#include "jh7110-common-u-boot.dtsi" +#include "jh7110-u-boot.dtsi" #include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi +1 -1
@@ -3,5 +3,5 @@ * Copyright (C) 2023 StarFive Technology Co., Ltd. */ -#include "jh7110-common-u-boot.dtsi" +#include "jh7110-u-boot.dtsi" #include "starfive-visionfive2-binman.dtsi"
Signature · 1 line
2.50.0
PATCH v2 2/4 riscv: dts: starfive: sync visionfive2 overrides with upstream Linux for-next
In reply to E ShattowSync automatic dtsi inclusion overrides for JH7110 CPU with upstream "riscv: dts: starfive: jh7110: bootph-pre-ram hinting needed by boot loader" from upstream Linux conor/riscv-dt-for-next commit 8181cc2f3f21
--- arch/riscv/dts/jh7110-u-boot.dtsi | 81 ++++++++++++------------------- 1 file changed, 31 insertions(+), 50 deletions(-)
arch/riscv/dts/jh7110-u-boot.dtsi +31 -50
@@ -3,36 +3,10 @@ * Copyright (C) 2022 StarFive Technology Co., Ltd. */ -#include <dt-bindings/reset/starfive,jh7110-crg.h> - -/ { - timer { - compatible = "riscv,timer"; - interrupts-extended = <&cpu0_intc 5>, - <&cpu1_intc 5>, - <&cpu2_intc 5>, - <&cpu3_intc 5>, - <&cpu4_intc 5>; - }; +// BEGIN "riscv: dts: starfive: jh7110: bootph-pre-ram hinting needed by boot loader" +// From upstream Linux conor/riscv-dt-for-next commit 8181cc2f3f21 - soc { - bootph-pre-ram; - - dmc: dmc@15700000 { - bootph-pre-ram; - compatible = "starfive,jh7110-dmc"; - reg = <0x0 0x15700000 0x0 0x10000>, - <0x0 0x13000000 0x0 0x10000>; - resets = <&syscrg JH7110_SYSRST_DDR_AXI>, - <&syscrg JH7110_SYSRST_DDR_OSC>, - <&syscrg JH7110_SYSRST_DDR_APB>; - reset-names = "axi", "osc", "apb"; - clocks = <&syscrg JH7110_PLLCLK_PLL1_OUT>; - clock-names = "pll1_out"; - clock-frequency = <2133>; - }; - }; -}; +#include <dt-bindings/reset/starfive,jh7110-crg.h> &clint { bootph-pre-ram;
@@ -58,22 +32,10 @@ bootph-pre-ram; }; -&cpus { - bootph-pre-ram; -}; - &osc { bootph-pre-ram; }; -&gmac0_rgmii_rxin { - bootph-pre-ram; -}; - -&gmac0_rmii_refin { - bootph-pre-ram; -}; - &gmac1_rgmii_rxin { bootph-pre-ram; };
@@ -82,23 +44,42 @@ bootph-pre-ram; }; -&aoncrg { - bootph-pre-ram; +/ { + soc { + memory-controller@15700000 { + compatible = "starfive,jh7110-dmc"; + reg = <0x0 0x15700000 0x0 0x10000>, + <0x0 0x13000000 0x0 0x10000>; + bootph-pre-ram; + clocks = <&syscrg JH7110_PLLCLK_PLL1_OUT>; + clock-names = "pll"; + resets = <&syscrg JH7110_SYSRST_DDR_AXI>, + <&syscrg JH7110_SYSRST_DDR_OSC>, + <&syscrg JH7110_SYSRST_DDR_APB>; + reset-names = "axi", "osc", "apb"; + }; + }; }; -&pllclk { +&syscrg { bootph-pre-ram; }; -&syscrg { - assigned-clock-rates = <0>; /* cpufreq not implemented, use defaults */ +&pllclk { bootph-pre-ram; }; -&stgcrg { - bootph-pre-ram; +// END "riscv: dts: starfive: jh7110: bootph-pre-ram hinting needed by boot loader" + +/ { + soc { + memory-controller@15700000 { + clock-frequency = <2133>; /* FIXME: delete property and implement CCF */ + }; + }; }; -&sys_syscon { - bootph-pre-ram; +&syscrg { + assigned-clock-rates = <0>; /* FIXME: delete property and implement cpufreq */ }; +
Signature · 1 line
2.50.0
PATCH v2 3/4 riscv: dts: starfive: visionfive2 depend on SYS_CPU automatic dtsi inclusion
In reply to E ShattowDrop visionfive2 per-board -u-boot.dtsi stubs and instead rely on automatic inclusion of jh7110-u-boot.dtsi
--- arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi | 7 ------- arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi | 7 ------- arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi | 7 ------- .../dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi | 7 ------- .../dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi | 7 ------- arch/riscv/dts/jh7110-u-boot.dtsi | 1 + 6 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi delete mode 100644 arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi
arch/riscv/dts/jh7110-deepcomputing-fml13v01-u-boot.dtsi deleted +0 -7
@@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2024 StarFive Technology Co., Ltd. - */ - -#include "jh7110-u-boot.dtsi" -#include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-milkv-mars-u-boot.dtsi deleted +0 -7
@@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2024 StarFive Technology Co., Ltd. - */ - -#include "jh7110-u-boot.dtsi" -#include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-pine64-star64-u-boot.dtsi deleted +0 -7
@@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2024 StarFive Technology Co., Ltd. - */ - -#include "jh7110-u-boot.dtsi" -#include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.2a-u-boot.dtsi deleted +0 -7
@@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2024 StarFive Technology Co., Ltd. - */ - -#include "jh7110-u-boot.dtsi" -#include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-starfive-visionfive-2-v1.3b-u-boot.dtsi deleted +0 -7
@@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 OR MIT -/* - * Copyright (C) 2023 StarFive Technology Co., Ltd. - */ - -#include "jh7110-u-boot.dtsi" -#include "starfive-visionfive2-binman.dtsi"
arch/riscv/dts/jh7110-u-boot.dtsi +1 -0
@@ -83,3 +83,4 @@ assigned-clock-rates = <0>; /* FIXME: delete property and implement cpufreq */ }; +#include "starfive-visionfive2-binman.dtsi"
Signature · 1 line
2.50.0
PATCH v2 4/4 riscv: dts: starfive: visionfive2 depend on SYS_CONFIG_NAME automatic dtsi inclusion
In reply to E ShattowRename visionfive2 per-cpu jh7110-u-boot.dtsi to starfive-visionfive2-u-boot.dtsi for inclusion by search order for whole starfive_visionfive2 target. There is expected to be support for multiple CPUs and boards, so let's use the automatic dtsi inclusion that is a better match for this.
Depends on patch: "scripts/Makefile.lib: add CONFIG_SYS_CONFIG_NAME prefix to dtsi search" [1].
1: https://lore.kernel.org/u-boot/[email protected]/
---
.../dts/{jh7110-u-boot.dtsi => starfive-visionfive2-u-boot.dtsi} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename arch/riscv/dts/{jh7110-u-boot.dtsi => starfive-visionfive2-u-boot.dtsi} (100%)arch/riscv/dts/starfive-visionfive2-u-boot.dtsi renamed from arch/riscv/dts/jh7110-u-boot.dtsi +0 -0
Signature · 1 line
2.50.0
Re: [PATCH v2 4/4] riscv: dts: starfive: visionfive2 depend on SYS_CONFIG_NAME automatic dtsi inclusion
arch/riscv/dts/starfive-visionfive2-u-boot.dtsi
Quoted 20 lines · E Shattow
Rename visionfive2 per-cpu
jh7110-u-boot.dtsitostarfive-visionfive2-u-boot.dtsifor inclusion by search order for wholestarfive_visionfive2target. There is expected to be support for multiple CPUs and boards, so let's use the automatic dtsi inclusion that is a better match for this.Depends on patch: "
scripts/Makefile.lib: addCONFIG_SYS_CONFIG_NAMEprefix to dtsi search" [1].
1: https://lore.kernel.org/u-boot/[email protected]/Signed-off-by E Shattow <[email protected]>--- .../dts/{jh7110-u-boot.dtsi => starfive-visionfive2-u-boot.dtsi} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename arch/riscv/dts/{jh7110-u-boot.dtsi => starfive-visionfive2-u-boot.dtsi} (100%)arch/riscv/dts/starfive-visionfive2-u-boot.dtsi renamed from arch/riscv/dts/jh7110-u-boot.dtsi +0
-0
N.B. I guessed wrong the SYS_CONFIG_NAME is not representative of any defconfig name. v3 replaces this patch 4/4 and refers to starfive-visionfive2-u-boot.dtsi via CONFIG_DEVICE_TREE_INCLUDES extra .dtsi include in defconfig. That unfortunately makes it less visible for DEVICE_TREE_DEBUG=1 so I am also having a look at improving the dtsi automatic inclusion and DEVICE_TREE_INCLUDES handling. Anyhow "config name" in context of SYS_CONFIG_NAME is perhaps referring to the Kconfig config fragment include '.h' file no relation to any defconfig.
-E