Skip to contentSkip to conversation

rockchip: Ensure env in SPI Flash can work correctly

PATCH In review Jonas Karlman 3 participants 5 messages Jul 12, 2025 – Nov 1, 2025 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: Ensure env in SPI Flash can work correctly

Ensure that the spi/sfc node for SPI flash is aviliable during pre-reloc phase so that env can successfully be loaded from SPI Flash.

No boards with these SoCs seem to be affected as there is no default use of ENV_IS_IN_SPI_FLASH=y.

---
 arch/arm/dts/rk3328-u-boot.dtsi  | 4 ++++
 arch/arm/dts/rk356x-u-boot.dtsi  | 1 +
 arch/arm/dts/rk3588s-u-boot.dtsi | 1 +
 3 files changed, 6 insertions(+)
arch/arm/dts/rk3328-u-boot.dtsi +4 -0
index b0e50a973a88..8ffc9ed3d573 100644
@@ -132,6 +132,10 @@
 	bootph-pre-ram;
 };
 
+&spi0 {
+	bootph-some-ram;
+};
+
 &uart2 {
 	bootph-all;
 	clock-frequency = <24000000>;
arch/arm/dts/rk356x-u-boot.dtsi +1 -0
index 871869739536..738b9673d352 100644
@@ -157,6 +157,7 @@
 };
 
 &sfc {
+	bootph-some-ram;
 	u-boot,spl-sfc-no-dma;
 };
 
arch/arm/dts/rk3588s-u-boot.dtsi +1 -0
index 5eeb138f3513..71fd352f640e 100644
@@ -140,6 +140,7 @@
 };
 
 &sfc {
+	bootph-some-ram;
 	u-boot,spl-sfc-no-dma;
 };
 
Signature · 1 line
2.49.0
#1 lore raw

Hi Jonas,

Quoted 3 lines · Jonas Karlman

Ensure that the spi/sfc node for SPI flash is aviliable during pre-reloc phase so that env can successfully be loaded from SPI Flash.

Shouldn't the pinmux nodes be added as well? Or are you planning on having those part of the individual board's DTS rather than in the SoC DTSI?

Cheers,
Quentin

#2 lore raw

Hi Quentin,

Quoted 9 lines · Quentin Schulz

Hi Jonas,

Quoted 3 lines · Jonas Karlman

Ensure that the spi/sfc node for SPI flash is aviliable during pre-reloc phase so that env can successfully be loaded from SPI Flash.

Shouldn't the pinmux nodes be added as well? Or are you planning on having those part of the individual board's DTS rather than in the SoC DTSI?

The boards that come with SPI flash should already have those added in the SoC or individual board's DTs, to my knowledge.

However, when I was testing env in SPI flash on odroid-go2 I noticed that env would not load unless we explicitly include the sfc/spi node in pre-reloc phase. And the recent added propagation of bootph- props in binman did not seem to really affect use of multiple FDTs in FIT.

With this patch I try to add this explicit bootph-some-ram prop so that if anyone enable the ENV_IN_SPI_FLASH option it actually works as intended on boards that already support booting from SPI flash.

Basically this fixes something I missed in old patches/series ;-)

Regards,
Jonas

Quoted 3 lines

Cheers,
Quentin

#3 lore raw
In reply to Jonas Karlman

Hi Kever,

Please consider this patch for v2026.01.

Also found at https://patchwork.ozlabs.org/patch/2110369/

Regards,
Jonas

Quoted 52 lines · Jonas Karlman

Ensure that the spi/sfc node for SPI flash is aviliable during pre-reloc phase so that env can successfully be loaded from SPI Flash.

No boards with these SoCs seem to be affected as there is no default use of ENV_IS_IN_SPI_FLASH=y.

---
 arch/arm/dts/rk3328-u-boot.dtsi  | 4 ++++
 arch/arm/dts/rk356x-u-boot.dtsi  | 1 +
 arch/arm/dts/rk3588s-u-boot.dtsi | 1 +
 3 files changed, 6 insertions(+)
arch/arm/dts/rk3328-u-boot.dtsi +4 -0
index b0e50a973a88..8ffc9ed3d573 100644
@@ -132,6 +132,10 @@
 	bootph-pre-ram;
 };
 
+&spi0 {
+	bootph-some-ram;
+};
+
 &uart2 {
 	bootph-all;
 	clock-frequency = <24000000>;
arch/arm/dts/rk356x-u-boot.dtsi +1 -0
index 871869739536..738b9673d352 100644
@@ -157,6 +157,7 @@
 };
 
 &sfc {
+	bootph-some-ram;
 	u-boot,spl-sfc-no-dma;
 };
 
arch/arm/dts/rk3588s-u-boot.dtsi +1 -0
index 5eeb138f3513..71fd352f640e 100644
@@ -140,6 +140,7 @@
 };
 
 &sfc {
+	bootph-some-ram;
 	u-boot,spl-sfc-no-dma;
 };
 
Reviewed-by on v1 1/1
#4 lore raw
In reply to Jonas Karlman
Quoted 7 lines · Jonas Karlman

Ensure that the spi/sfc node for SPI flash is aviliable during pre-reloc phase so that env can successfully be loaded from SPI Flash.

No boards with these SoCs seem to be affected as there is no default use of ENV_IS_IN_SPI_FLASH=y.

Thanks,
- Kever

Quoted 45 lines
---
  arch/arm/dts/rk3328-u-boot.dtsi  | 4 ++++
  arch/arm/dts/rk356x-u-boot.dtsi  | 1 +
  arch/arm/dts/rk3588s-u-boot.dtsi | 1 +
  3 files changed, 6 insertions(+)
arch/arm/dts/rk3328-u-boot.dtsi +4 -0
index b0e50a973a88..8ffc9ed3d573 100644
@@ -132,6 +132,10 @@
  	bootph-pre-ram;
  };
 
+&spi0 {
+	bootph-some-ram;
+};
+
  &uart2 {
  	bootph-all;
  	clock-frequency = <24000000>;
arch/arm/dts/rk356x-u-boot.dtsi +1 -0
index 871869739536..738b9673d352 100644
@@ -157,6 +157,7 @@
  };
 
  &sfc {
+	bootph-some-ram;
  	u-boot,spl-sfc-no-dma;
  };
 
arch/arm/dts/rk3588s-u-boot.dtsi +1 -0
index 5eeb138f3513..71fd352f640e 100644
@@ -140,6 +140,7 @@
  };
 
  &sfc {
+	bootph-some-ram;
  	u-boot,spl-sfc-no-dma;
  };