* [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
@ 2026-10-17 18:01 ` Hung-Chun Tseng
0 siblings, 0 replies; 23+ messages in thread
From: Hung-Chun Tseng @ 2026-10-17 18:01 UTC (permalink / raw)
To: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
E Shattow, devicetree, linux-riscv, spacemit, linux-kernel
On K1 boards an SPL reads the board EEPROM (0x50 on i2c2) to identify
the board, and before DRAM training it programs the P1 PMIC (0x41 on
i2c8) rails buck1, buck3 and aldo1. Boards that boot from SPI NOR also
need the flash on QSPI.
Mark these board peripherals bootph-pre-ram on the boards that have
them, together with i2c2 where the EEPROM sits. i2c8 is tagged in
k1.dtsi, as every K1 board connects the PMIC there.
Assisted-by: claude-opus-5-5 dtbs_check
Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
---
arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi | 6 ++++++
arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 6 ++++++
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 7 +++++++
arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts | 7 +++++++
arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts | 4 ++++
arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 5 +++++
6 files changed, 35 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
index 81c40df2a..acb8fa2e6 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
@@ -64,6 +64,7 @@ &pdma {
};
&i2c2 {
+ bootph-pre-ram;
pinctrl-names = "default";
pinctrl-0 = <&i2c2_0_cfg>;
status = "okay";
@@ -71,6 +72,7 @@ &i2c2 {
eeprom@50 {
compatible = "atmel,24c02";
reg = <0x50>;
+ bootph-pre-ram;
vcc-supply = <&buck3_1v8>;
pagesize = <16>;
read-only;
@@ -100,6 +102,7 @@ &i2c8 {
pmic@41 {
compatible = "spacemit,p1";
reg = <0x41>;
+ bootph-pre-ram;
interrupts = <64>;
vin1-supply = <®_vcc_4v>;
vin2-supply = <®_vcc_4v>;
@@ -113,6 +116,7 @@ pmic@41 {
regulators {
buck1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1050000>;
regulator-ramp-delay = <5000>;
@@ -127,6 +131,7 @@ buck2 {
};
buck3_1v8: buck3 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-ramp-delay = <5000>;
@@ -155,6 +160,7 @@ buck6 {
};
aldo1: aldo1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index 58035d886..b91db3204 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -187,6 +187,7 @@ &qspi {
};
&i2c2 {
+ bootph-pre-ram;
pinctrl-0 = <&i2c2_0_cfg>;
pinctrl-names = "default";
status = "okay";
@@ -194,6 +195,7 @@ &i2c2 {
eeprom@50 {
compatible = "atmel,24c02";
reg = <0x50>;
+ bootph-pre-ram;
vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
pagesize = <16>;
read-only;
@@ -223,6 +225,7 @@ &i2c8 {
pmic@41 {
compatible = "spacemit,p1";
reg = <0x41>;
+ bootph-pre-ram;
interrupts = <64>;
vin1-supply = <®_vcc_4v>;
vin2-supply = <®_vcc_4v>;
@@ -236,6 +239,7 @@ pmic@41 {
regulators {
buck1_0v9: buck1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1050000>;
regulator-ramp-delay = <5000>;
@@ -250,6 +254,7 @@ buck2 {
};
buck3_1v8: buck3 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-ramp-delay = <5000>;
@@ -278,6 +283,7 @@ buck6 {
};
aldo1: aldo1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
diff --git a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
index 635e95aad..d2a39cf55 100644
--- a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
@@ -201,6 +201,7 @@ &pdma {
};
&i2c2 {
+ bootph-pre-ram;
pinctrl-0 = <&i2c2_0_cfg>;
pinctrl-names = "default";
status = "okay";
@@ -208,6 +209,7 @@ &i2c2 {
eeprom@50 {
compatible = "atmel,24c04";
reg = <0x50>;
+ bootph-pre-ram;
vcc-supply = <&buck3_1v8>; /* EEPROM_VCC18 */
pagesize = <16>;
read-only;
@@ -230,6 +232,7 @@ &i2c8 {
pmic@41 {
compatible = "spacemit,p1";
reg = <0x41>;
+ bootph-pre-ram;
interrupts = <64>;
vin1-supply = <®_vcc_4v>;
vin2-supply = <®_vcc_4v>;
@@ -243,6 +246,7 @@ pmic@41 {
regulators {
buck1_0v9: buck1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1050000>;
regulator-ramp-delay = <5000>;
@@ -257,6 +261,7 @@ buck2 {
};
buck3_1v8: buck3 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-ramp-delay = <5000>;
@@ -285,6 +290,7 @@ buck6 {
};
aldo1: aldo1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
@@ -386,6 +392,7 @@ &qspi {
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
+ bootph-pre-ram;
spi-max-frequency = <26500000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
diff --git a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
index 23f32a8a3..a3d0e38ac 100644
--- a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
@@ -160,6 +160,7 @@ &pdma {
};
&i2c2 {
+ bootph-pre-ram;
pinctrl-0 = <&i2c2_0_cfg>;
pinctrl-names = "default";
status = "okay";
@@ -167,6 +168,7 @@ &i2c2 {
eeprom@50 {
compatible = "atmel,24c02";
reg = <0x50>;
+ bootph-pre-ram;
vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
pagesize = <8>;
read-only;
@@ -199,6 +201,7 @@ &i2c8 {
pmic@41 {
compatible = "spacemit,p1";
reg = <0x41>;
+ bootph-pre-ram;
interrupts = <64>;
vin1-supply = <®_vcc_4v>;
vin2-supply = <®_vcc_4v>;
@@ -212,6 +215,7 @@ pmic@41 {
regulators {
buck1_0v9: buck1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1050000>;
regulator-ramp-delay = <5000>;
@@ -226,6 +230,7 @@ buck2 {
};
buck3_1v8: buck3 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-ramp-delay = <5000>;
@@ -254,6 +259,7 @@ buck6 {
};
aldo1: aldo1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
@@ -353,6 +359,7 @@ &qspi {
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
+ bootph-pre-ram;
spi-max-frequency = <26500000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
index eb77aae9d..5e2fde8be 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
@@ -187,6 +187,7 @@ &i2c8 {
pmic@41 {
compatible = "spacemit,p1";
reg = <0x41>;
+ bootph-pre-ram;
interrupts = <64>;
vin1-supply = <&vcc4v0>;
vin2-supply = <&vcc4v0>;
@@ -200,6 +201,7 @@ pmic@41 {
regulators {
buck1_0v9: buck1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1050000>;
regulator-ramp-delay = <5000>;
@@ -214,6 +216,7 @@ buck2 {
};
buck3_1v8: buck3 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-ramp-delay = <5000>;
@@ -242,6 +245,7 @@ buck6 {
};
aldo1_3v3: aldo1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 790234f35..d4adfc5b7 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -214,6 +214,7 @@ &i2c8 {
pmic@41 {
compatible = "spacemit,p1";
reg = <0x41>;
+ bootph-pre-ram;
interrupts = <64>;
vin1-supply = <&vcc4v0>;
vin2-supply = <&vcc4v0>;
@@ -227,6 +228,7 @@ pmic@41 {
regulators {
buck1_0v9: buck1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1050000>;
regulator-ramp-delay = <5000>;
@@ -241,6 +243,7 @@ buck2 {
};
buck3_1v8: buck3 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1800000>;
regulator-ramp-delay = <5000>;
@@ -269,6 +272,7 @@ buck6 {
};
aldo1: aldo1 {
+ bootph-pre-ram;
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
@@ -366,6 +370,7 @@ &qspi {
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
+ bootph-pre-ram;
spi-max-frequency = <26500000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 23+ messages in thread* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
2026-10-17 18:01 ` Hung-Chun Tseng
(?)
@ 2026-10-17 18:07 ` sashiko-bot
-1 siblings, 0 replies; 23+ messages in thread
From: sashiko-bot @ 2026-10-17 18:07 UTC (permalink / raw)
To: Hung-Chun Tseng; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] riscv: dts: spacemit: missing bootph-pre-ram on i2c2/eeprom@50 for OrangePi
--
commit 5b0574f2bdfb9fa217393dc3ab5d437d4cba162a
Author: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
This commit marks the board EEPROM, i2c2, the P1 PMIC, and QSPI NOR flash
nodes with bootph-pre-ram across SpacemiT K1 board device trees so that
pre-RAM SPL can access them.
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> index eb77aae9d6008..5e2fde8be7692 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> @@ -187,6 +187,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <&vcc4v0>;
> vin2-supply = <&vcc4v0>;
[ ... ]
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> index 790234f3550a3..d4adfc5b74374 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> @@ -214,6 +214,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <&vcc4v0>;
> vin2-supply = <&vcc4v0>;
[Severity: Medium]
Should &i2c2 and eeprom@50 also be marked with bootph-pre-ram in
arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts and
arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts?
The commit message notes that the SPL reads the board EEPROM at 0x50 on i2c2
to identify the board, and marks both i2c2 and eeprom@50 on the other K1
boards. Both k1-orangepi-r2s.dts and k1-orangepi-rv2.dts also enable &i2c2
and define the board identification EEPROM right above &i2c8:
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_0_cfg>;
status = "okay";
eeprom@50 {
compatible = "atmel,24c02";
reg = <0x50>;
...
};
};
Since i2c2 in arch/riscv/boot/dts/spacemit/k1.dtsi is not tagged with
bootph-pre-ram either, won't an SPL build that filters for bootph-pre-ram
strip both i2c2 and eeprom@50 on OrangePi R2S and OrangePi RV2?
(Alternatively, since every K1 board in the tree connects eeprom@50 on i2c2,
could i2c2 be tagged in k1.dtsi just like i2c8?)
[ ... ]
>
>
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261017180141.3477743-1-alan.tseng.cs@gmail.com?part=2
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
2026-10-17 18:01 ` Hung-Chun Tseng
@ 2026-10-17 21:44 ` E Shattow
-1 siblings, 0 replies; 23+ messages in thread
From: E Shattow @ 2026-10-17 21:44 UTC (permalink / raw)
To: Hung-Chun Tseng, Yixun Lan, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Hung-Chun,
On 10/17/26 11:01, Hung-Chun Tseng wrote:
> On K1 boards an SPL reads the board EEPROM (0x50 on i2c2) to identify
> the board, and before DRAM training it programs the P1 PMIC (0x41 on
> i2c8) rails buck1, buck3 and aldo1. Boards that boot from SPI NOR also
> need the flash on QSPI.
I think this statement is too much a description of software. It is not
interesting what the user-provided SPL does of some other software
project here for the hardware description in Linux device tree.
If the BootROM does this EEPROM configuration, then we could reasonably
extend bootph-pre-ram tags with the understanding that any SPL will need
those same interfaces. Does BootROM configure the EEPROM peripheral for
access? If not, I think the justification is weak here to include this.
Ask vendor-employed developer(s) to give us a flow chart of the BootROM
boot flows and list of configured peripherals in each boot flow. At a
minimum we should have those peripherals configured and refer to that
correspondance for justification. Additional to this we should identify
what is not configured by the BootROM.
>
> Mark these board peripherals bootph-pre-ram on the boards that have
> them, together with i2c2 where the EEPROM sits. i2c8 is tagged in
> k1.dtsi, as every K1 board connects the PMIC there.
>
> Assisted-by: claude-opus-5-5 dtbs_check
> Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> ---
> arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi | 6 ++++++
> arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 6 ++++++
> arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 7 +++++++
> arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts | 7 +++++++
> arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts | 4 ++++
> arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 5 +++++
> 6 files changed, 35 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
> index 81c40df2a..acb8fa2e6 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
> @@ -64,6 +64,7 @@ &pdma {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-names = "default";
> pinctrl-0 = <&i2c2_0_cfg>;
> status = "okay";
> @@ -71,6 +72,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c02";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>;
> pagesize = <16>;
> read-only;
> @@ -100,6 +102,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -113,6 +116,7 @@ pmic@41 {
>
> regulators {
> buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -127,6 +131,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -155,6 +160,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> index 58035d886..b91db3204 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> @@ -187,6 +187,7 @@ &qspi {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-0 = <&i2c2_0_cfg>;
> pinctrl-names = "default";
> status = "okay";
> @@ -194,6 +195,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c02";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
> pagesize = <16>;
> read-only;
> @@ -223,6 +225,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -236,6 +239,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -250,6 +254,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -278,6 +283,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> index 635e95aad..d2a39cf55 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> @@ -201,6 +201,7 @@ &pdma {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-0 = <&i2c2_0_cfg>;
> pinctrl-names = "default";
> status = "okay";
> @@ -208,6 +209,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c04";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>; /* EEPROM_VCC18 */
> pagesize = <16>;
> read-only;
> @@ -230,6 +232,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -243,6 +246,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -257,6 +261,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -285,6 +290,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -386,6 +392,7 @@ &qspi {
> flash@0 {
> compatible = "jedec,spi-nor";
> reg = <0>;
> + bootph-pre-ram;
> spi-max-frequency = <26500000>;
> spi-rx-bus-width = <4>;
> spi-tx-bus-width = <4>;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> index 23f32a8a3..a3d0e38ac 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> @@ -160,6 +160,7 @@ &pdma {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-0 = <&i2c2_0_cfg>;
> pinctrl-names = "default";
> status = "okay";
> @@ -167,6 +168,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c02";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
> pagesize = <8>;
> read-only;
> @@ -199,6 +201,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -212,6 +215,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -226,6 +230,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -254,6 +259,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -353,6 +359,7 @@ &qspi {
> flash@0 {
> compatible = "jedec,spi-nor";
> reg = <0>;
> + bootph-pre-ram;
> spi-max-frequency = <26500000>;
> spi-rx-bus-width = <4>;
> spi-tx-bus-width = <4>;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> index eb77aae9d..5e2fde8be 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> @@ -187,6 +187,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <&vcc4v0>;
> vin2-supply = <&vcc4v0>;
> @@ -200,6 +201,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -214,6 +216,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -242,6 +245,7 @@ buck6 {
> };
>
> aldo1_3v3: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> index 790234f35..d4adfc5b7 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> @@ -214,6 +214,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <&vcc4v0>;
> vin2-supply = <&vcc4v0>;
> @@ -227,6 +228,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -241,6 +243,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -269,6 +272,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -366,6 +370,7 @@ &qspi {
> flash@0 {
> compatible = "jedec,spi-nor";
> reg = <0>;
> + bootph-pre-ram;
> spi-max-frequency = <26500000>;
> spi-rx-bus-width = <4>;
> spi-tx-bus-width = <4>;
I do not agree with the "trust me, bro, I need this to boot" approach to
device tree upstream if it is at all avoidable. However it is difficult
to know without a listing of the BootROM.
With that, and having no visibility into the workings of BootROM myself,
the shape of this appears good. I'd like to see that discussion happen
about what BootROM is doing and more specifically what it is not doing
that we are amending for the benefit of software in this description of
hardware.
Reviewed-by: E Shattow <e@freeshell.de>
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
@ 2026-10-17 21:44 ` E Shattow
0 siblings, 0 replies; 23+ messages in thread
From: E Shattow @ 2026-10-17 21:44 UTC (permalink / raw)
To: Hung-Chun Tseng, Yixun Lan, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Hung-Chun,
On 10/17/26 11:01, Hung-Chun Tseng wrote:
> On K1 boards an SPL reads the board EEPROM (0x50 on i2c2) to identify
> the board, and before DRAM training it programs the P1 PMIC (0x41 on
> i2c8) rails buck1, buck3 and aldo1. Boards that boot from SPI NOR also
> need the flash on QSPI.
I think this statement is too much a description of software. It is not
interesting what the user-provided SPL does of some other software
project here for the hardware description in Linux device tree.
If the BootROM does this EEPROM configuration, then we could reasonably
extend bootph-pre-ram tags with the understanding that any SPL will need
those same interfaces. Does BootROM configure the EEPROM peripheral for
access? If not, I think the justification is weak here to include this.
Ask vendor-employed developer(s) to give us a flow chart of the BootROM
boot flows and list of configured peripherals in each boot flow. At a
minimum we should have those peripherals configured and refer to that
correspondance for justification. Additional to this we should identify
what is not configured by the BootROM.
>
> Mark these board peripherals bootph-pre-ram on the boards that have
> them, together with i2c2 where the EEPROM sits. i2c8 is tagged in
> k1.dtsi, as every K1 board connects the PMIC there.
>
> Assisted-by: claude-opus-5-5 dtbs_check
> Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> ---
> arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi | 6 ++++++
> arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 6 ++++++
> arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 7 +++++++
> arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts | 7 +++++++
> arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts | 4 ++++
> arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 5 +++++
> 6 files changed, 35 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
> index 81c40df2a..acb8fa2e6 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi
> @@ -64,6 +64,7 @@ &pdma {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-names = "default";
> pinctrl-0 = <&i2c2_0_cfg>;
> status = "okay";
> @@ -71,6 +72,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c02";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>;
> pagesize = <16>;
> read-only;
> @@ -100,6 +102,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -113,6 +116,7 @@ pmic@41 {
>
> regulators {
> buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -127,6 +131,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -155,6 +160,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> index 58035d886..b91db3204 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> @@ -187,6 +187,7 @@ &qspi {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-0 = <&i2c2_0_cfg>;
> pinctrl-names = "default";
> status = "okay";
> @@ -194,6 +195,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c02";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
> pagesize = <16>;
> read-only;
> @@ -223,6 +225,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -236,6 +239,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -250,6 +254,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -278,6 +283,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> index 635e95aad..d2a39cf55 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> @@ -201,6 +201,7 @@ &pdma {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-0 = <&i2c2_0_cfg>;
> pinctrl-names = "default";
> status = "okay";
> @@ -208,6 +209,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c04";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>; /* EEPROM_VCC18 */
> pagesize = <16>;
> read-only;
> @@ -230,6 +232,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -243,6 +246,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -257,6 +261,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -285,6 +290,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -386,6 +392,7 @@ &qspi {
> flash@0 {
> compatible = "jedec,spi-nor";
> reg = <0>;
> + bootph-pre-ram;
> spi-max-frequency = <26500000>;
> spi-rx-bus-width = <4>;
> spi-tx-bus-width = <4>;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> index 23f32a8a3..a3d0e38ac 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> @@ -160,6 +160,7 @@ &pdma {
> };
>
> &i2c2 {
> + bootph-pre-ram;
> pinctrl-0 = <&i2c2_0_cfg>;
> pinctrl-names = "default";
> status = "okay";
> @@ -167,6 +168,7 @@ &i2c2 {
> eeprom@50 {
> compatible = "atmel,24c02";
> reg = <0x50>;
> + bootph-pre-ram;
> vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
> pagesize = <8>;
> read-only;
> @@ -199,6 +201,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <®_vcc_4v>;
> vin2-supply = <®_vcc_4v>;
> @@ -212,6 +215,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -226,6 +230,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -254,6 +259,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -353,6 +359,7 @@ &qspi {
> flash@0 {
> compatible = "jedec,spi-nor";
> reg = <0>;
> + bootph-pre-ram;
> spi-max-frequency = <26500000>;
> spi-rx-bus-width = <4>;
> spi-tx-bus-width = <4>;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> index eb77aae9d..5e2fde8be 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> @@ -187,6 +187,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <&vcc4v0>;
> vin2-supply = <&vcc4v0>;
> @@ -200,6 +201,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -214,6 +216,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -242,6 +245,7 @@ buck6 {
> };
>
> aldo1_3v3: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> index 790234f35..d4adfc5b7 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> @@ -214,6 +214,7 @@ &i2c8 {
> pmic@41 {
> compatible = "spacemit,p1";
> reg = <0x41>;
> + bootph-pre-ram;
> interrupts = <64>;
> vin1-supply = <&vcc4v0>;
> vin2-supply = <&vcc4v0>;
> @@ -227,6 +228,7 @@ pmic@41 {
>
> regulators {
> buck1_0v9: buck1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1050000>;
> regulator-ramp-delay = <5000>;
> @@ -241,6 +243,7 @@ buck2 {
> };
>
> buck3_1v8: buck3 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <1800000>;
> regulator-ramp-delay = <5000>;
> @@ -269,6 +272,7 @@ buck6 {
> };
>
> aldo1: aldo1 {
> + bootph-pre-ram;
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -366,6 +370,7 @@ &qspi {
> flash@0 {
> compatible = "jedec,spi-nor";
> reg = <0>;
> + bootph-pre-ram;
> spi-max-frequency = <26500000>;
> spi-rx-bus-width = <4>;
> spi-tx-bus-width = <4>;
I do not agree with the "trust me, bro, I need this to boot" approach to
device tree upstream if it is at all avoidable. However it is difficult
to know without a listing of the BootROM.
With that, and having no visibility into the workings of BootROM myself,
the shape of this appears good. I'd like to see that discussion happen
about what BootROM is doing and more specifically what it is not doing
that we are amending for the benefit of software in this description of
hardware.
Reviewed-by: E Shattow <e@freeshell.de>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
2026-10-17 21:44 ` E Shattow
@ 2026-10-19 14:17 ` Hung-Chun Tseng
-1 siblings, 0 replies; 23+ messages in thread
From: Hung-Chun Tseng @ 2026-10-19 14:17 UTC (permalink / raw)
To: E Shattow
Cc: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi E,
E Shattow wrote:
> Does BootROM configure the EEPROM peripheral for access? If not, I
> think the justification is weak here to include this.
As far as I know it does not. The EEPROM is only read to tell the
boards apart, so I will drop the i2c2 and EEPROM tags in v3 and keep
the PMIC, whose rails are set before DRAM can be brought up, and the
SPI NOR flash, which the BootROM can boot from.
Yixun, is there a public description of the BootROM boot flows, or of
which peripherals it sets up in each? That would give a clear basis
for which nodes to tag.
Thanks,
Hung-Chun
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
@ 2026-10-19 14:17 ` Hung-Chun Tseng
0 siblings, 0 replies; 23+ messages in thread
From: Hung-Chun Tseng @ 2026-10-19 14:17 UTC (permalink / raw)
To: E Shattow
Cc: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi E,
E Shattow wrote:
> Does BootROM configure the EEPROM peripheral for access? If not, I
> think the justification is weak here to include this.
As far as I know it does not. The EEPROM is only read to tell the
boards apart, so I will drop the i2c2 and EEPROM tags in v3 and keep
the PMIC, whose rails are set before DRAM can be brought up, and the
SPI NOR flash, which the BootROM can boot from.
Yixun, is there a public description of the BootROM boot flows, or of
which peripherals it sets up in each? That would give a clear basis
for which nodes to tag.
Thanks,
Hung-Chun
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
2026-10-19 14:17 ` Hung-Chun Tseng
@ 2026-10-21 8:34 ` Yixun Lan
-1 siblings, 0 replies; 23+ messages in thread
From: Yixun Lan @ 2026-10-21 8:34 UTC (permalink / raw)
To: Hung-Chun Tseng
Cc: E Shattow, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Hung-Chun,
On 22:17 Mon 19 Oct , Hung-Chun Tseng wrote:
> Hi E,
>
> E Shattow wrote:
> > Does BootROM configure the EEPROM peripheral for access? If not, I
> > think the justification is weak here to include this.
>
> As far as I know it does not. The EEPROM is only read to tell the
> boards apart, so I will drop the i2c2 and EEPROM tags in v3 and keep
> the PMIC, whose rails are set before DRAM can be brought up, and the
> SPI NOR flash, which the BootROM can boot from.
>
I've confirmed with vendor, the EEPROM isn't configured or accessed in
BootROM phase
> Yixun, is there a public description of the BootROM boot flows, or of
> which peripherals it sets up in each? That would give a clear basis
> for which nodes to tag.
>
The ever closest docs is
https://spacemit.com/community/document/info?lang=zh&nodepath=software/SDK/buildroot/k3_buildroot/device/boot.md
but for bootph-pre-ram, isn't it about the DT nodes which needed before DDR
initialization in SPL stage, and should have nothing to do with BootROM?
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/bootph.yaml#L70
--
Yixun Lan (dlan)
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
@ 2026-10-21 8:34 ` Yixun Lan
0 siblings, 0 replies; 23+ messages in thread
From: Yixun Lan @ 2026-10-21 8:34 UTC (permalink / raw)
To: Hung-Chun Tseng
Cc: E Shattow, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Hung-Chun,
On 22:17 Mon 19 Oct , Hung-Chun Tseng wrote:
> Hi E,
>
> E Shattow wrote:
> > Does BootROM configure the EEPROM peripheral for access? If not, I
> > think the justification is weak here to include this.
>
> As far as I know it does not. The EEPROM is only read to tell the
> boards apart, so I will drop the i2c2 and EEPROM tags in v3 and keep
> the PMIC, whose rails are set before DRAM can be brought up, and the
> SPI NOR flash, which the BootROM can boot from.
>
I've confirmed with vendor, the EEPROM isn't configured or accessed in
BootROM phase
> Yixun, is there a public description of the BootROM boot flows, or of
> which peripherals it sets up in each? That would give a clear basis
> for which nodes to tag.
>
The ever closest docs is
https://spacemit.com/community/document/info?lang=zh&nodepath=software/SDK/buildroot/k3_buildroot/device/boot.md
but for bootph-pre-ram, isn't it about the DT nodes which needed before DDR
initialization in SPL stage, and should have nothing to do with BootROM?
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/bootph.yaml#L70
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
2026-10-21 8:34 ` Yixun Lan
@ 2026-10-21 10:59 ` Hung-Chun Tseng
-1 siblings, 0 replies; 23+ messages in thread
From: Hung-Chun Tseng @ 2026-10-21 10:59 UTC (permalink / raw)
To: Yixun Lan
Cc: E Shattow, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Yixun,
Yixun Lan wrote:
> but for bootph-pre-ram, isn't it about the DT nodes which needed before DDR
> initialization in SPL stage, and should have nothing to do with BootROM?
Thanks for checking with the vendor. I agree, the schema defines it as
"the phase that sets up SDRAM".
I also need to correct what I said earlier: the EEPROM is not only
used to tell the boards apart. It also holds the board's DRAM
configuration (number of chip selects, data rate and DDR type), which
has to be read before DRAM can be trained [1].
So in v3 I'd like to keep the i2c2 and EEPROM tags, and also tag the
EEPROM on the OrangePi RV2 and R2S, which I missed in v2.
E, does that address your concern?
[1] board/spacemit/k1/spl.c in U-Boot, ddr_early_init() -> read_ddr_info()
Thanks,
Hung-Chun
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
@ 2026-10-21 10:59 ` Hung-Chun Tseng
0 siblings, 0 replies; 23+ messages in thread
From: Hung-Chun Tseng @ 2026-10-21 10:59 UTC (permalink / raw)
To: Yixun Lan
Cc: E Shattow, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Yixun,
Yixun Lan wrote:
> but for bootph-pre-ram, isn't it about the DT nodes which needed before DDR
> initialization in SPL stage, and should have nothing to do with BootROM?
Thanks for checking with the vendor. I agree, the schema defines it as
"the phase that sets up SDRAM".
I also need to correct what I said earlier: the EEPROM is not only
used to tell the boards apart. It also holds the board's DRAM
configuration (number of chip selects, data rate and DDR type), which
has to be read before DRAM can be trained [1].
So in v3 I'd like to keep the i2c2 and EEPROM tags, and also tag the
EEPROM on the OrangePi RV2 and R2S, which I missed in v2.
E, does that address your concern?
[1] board/spacemit/k1/spl.c in U-Boot, ddr_early_init() -> read_ddr_info()
Thanks,
Hung-Chun
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
2026-10-21 10:59 ` Hung-Chun Tseng
@ 2026-10-21 11:07 ` E Shattow
-1 siblings, 0 replies; 23+ messages in thread
From: E Shattow @ 2026-10-21 11:07 UTC (permalink / raw)
To: Hung-Chun Tseng, Yixun Lan
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, devicetree,
linux-riscv, spacemit, linux-kernel
On 10/21/26 03:59, Hung-Chun Tseng wrote:
> Hi Yixun,
>
> Yixun Lan wrote:
>> but for bootph-pre-ram, isn't it about the DT nodes which needed before DDR
>> initialization in SPL stage, and should have nothing to do with BootROM?
>
> Thanks for checking with the vendor. I agree, the schema defines it as
> "the phase that sets up SDRAM".
>
> I also need to correct what I said earlier: the EEPROM is not only
> used to tell the boards apart. It also holds the board's DRAM
> configuration (number of chip selects, data rate and DDR type), which
> has to be read before DRAM can be trained [1].
>
> So in v3 I'd like to keep the i2c2 and EEPROM tags, and also tag the
> EEPROM on the OrangePi RV2 and R2S, which I missed in v2.
>
> E, does that address your concern?
Yes, as based on published documentation and confirmed by vendor, that
sounds good to me.
>
> [1] board/spacemit/k1/spl.c in U-Boot, ddr_early_init() -> read_ddr_info()
>
> Thanks,
> Hung-Chun
Thank you Hung-Chun and Yixun,
-E
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
@ 2026-10-21 11:07 ` E Shattow
0 siblings, 0 replies; 23+ messages in thread
From: E Shattow @ 2026-10-21 11:07 UTC (permalink / raw)
To: Hung-Chun Tseng, Yixun Lan
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, devicetree,
linux-riscv, spacemit, linux-kernel
On 10/21/26 03:59, Hung-Chun Tseng wrote:
> Hi Yixun,
>
> Yixun Lan wrote:
>> but for bootph-pre-ram, isn't it about the DT nodes which needed before DDR
>> initialization in SPL stage, and should have nothing to do with BootROM?
>
> Thanks for checking with the vendor. I agree, the schema defines it as
> "the phase that sets up SDRAM".
>
> I also need to correct what I said earlier: the EEPROM is not only
> used to tell the boards apart. It also holds the board's DRAM
> configuration (number of chip selects, data rate and DDR type), which
> has to be read before DRAM can be trained [1].
>
> So in v3 I'd like to keep the i2c2 and EEPROM tags, and also tag the
> EEPROM on the OrangePi RV2 and R2S, which I missed in v2.
>
> E, does that address your concern?
Yes, as based on published documentation and confirmed by vendor, that
sounds good to me.
>
> [1] board/spacemit/k1/spl.c in U-Boot, ddr_early_init() -> read_ddr_info()
>
> Thanks,
> Hung-Chun
Thank you Hung-Chun and Yixun,
-E
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 23+ messages in thread