Skip to contentSkip to conversation

arm64: dts: allwinner: orangepi-zero2/zero3: Read the SPI NOR over two lines

PATCH Applied Arun Iyengar 3 participants 5 messages Nov 20 – Nov 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover arm64: dts: allwinner: orangepi-zero2/zero3: Read the SPI NOR over two lines

Andre Przywara reviewed v1 and suggested labelling the flash node (patch
1) and setting spi-rx-bus-width in the dtsi shared with the Zero3 (patch 2).

spi-rx-bus-width = <2> needs the binding patch of [1] (acked, not applied yet) to pass dtbs_check.
Without the driver patch of [1] the driver ignores the setting.

Tested on an Orange Pi Zero2, with [1]: 1-1-2 reads (opcode 0x3b), two 2 MiB reads identical to an earlier dump.

[1] https://lore.kernel.org/r/[email protected]

Developed with Claude (Anthropic), which wrote the patches and commit messages. I reviewed them.

---
Changes in v3:
- Label renamed to spi_flash (Andre)
- Zero3 flash supply added (Andre): reg_dldo1, see the note in patch 1
- Zero2 &spi_flash moved after &pio (sorted)
- Dropped Suggested-by on patch 2, added Andre's tags
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Label the flash node, no nested &spi0 override (Andre)
- spi-rx-bus-width moved to the shared dtsi, Zero3 included (Andre;
he read 16 MB on a Zero3 in 1.8 s instead of 3.5 s)
- Dropped the driver dependency (Andre); the binding is still needed for dtbs_check
- Link to v1: https://patch.msgid.link/[email protected]

---
Arun Iyengar (2):
arm64: dts: allwinner: orangepi-zero2/zero3: Set the SPI NOR supply by label
arm64: dts: allwinner: orangepi-zero2/zero3: Read the SPI NOR over two lines

 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi | 3 ++-
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 6 ++----
 arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts | 4 ++++
 3 files changed, 8 insertions(+), 5 deletions(-)

---
base-commit: 90e0d3fd460ec365617982b56bd7ea5179b36197
change-id: 20261115-zero2-spi-nor-dual-read-645a6de25e81
prerequisite-patch-id: 28b145097d0f859e5bd27bcc5028d0915f3ba4bd

Best regards,

Signature · 1 line
Arun Iyengar <[email protected]>
#1 lore raw

PATCH v3 1/2 arm64: dts: allwinner: orangepi-zero2/zero3: Set the SPI NOR supply by label

Label the flash node in the shared dtsi, so each board sets its supply through the label. The Zero2 keeps reg_aldo1. On the Zero3 the flash VDD is on the 3.3V rail from the AXP313A DLDO1 pin (schematic v1.2), so it gets reg_dldo1.

---
Andre: reg_dldo1 instead of reg_aldo1 on the Zero3. Schematic v1.2 sheet 4 labels the 3.3V net "ALDO1", but it comes from AXP313A pin 12 (DLDO1, VCC33-DLDO); pin 15 (ALDO1) is the 1.8V VCC18-ALDO. The flash VDD (U61 pin 8, net DCDCE) is on that 3.3V net. Not tested, no Zero3 here.

---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 6 ++----
 arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts | 4 ++++
 3 files changed, 7 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi +1 -1
index 0d3e761f6466..cd1f67ad7c2b 100644
@@ -104,7 +104,7 @@ &spi0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
 
-	flash@0 {
+	spi_flash: flash@0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "jedec,spi-nor";
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +2 -4
index 90c25e12e189..2f8a16d1c9aa 100644
@@ -148,8 +148,6 @@ &pio {
 	vcc-pi-supply = <&reg_aldo1>;
 };
 
-&spi0 {
-	flash@0 {
-		vcc-supply = <&reg_aldo1>;
-	};
+&spi_flash {
+	vcc-supply = <&reg_aldo1>;
 };
arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts +4 -0
index c51d4d9120de..afa753dead30 100644
@@ -103,3 +103,7 @@ &pio {
 	vcc-ph-supply = <&reg_dldo1>;
 	vcc-pi-supply = <&reg_dldo1>;
 };
+
+&spi_flash {
+	vcc-supply = <&reg_dldo1>;
+};
Signature · 1 line
2.55.0
Reviewed-by Tested-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] arm64: dts: allwinner: orangepi-zero2/zero3: Set the SPI NOR supply by label

On Fri, 20 Nov 2026 06:30:08 +0000
Arun Iyengar via B4 Relay <[email protected]> wrote:

Hi Arun,

Quoted 9 lines

From: Arun Iyengar <[email protected]>

Label the flash node in the shared dtsi, so each board sets its supply through the label. The Zero2 keeps reg_aldo1. On the Zero3 the flash VDD is on the 3.3V rail from the AXP313A DLDO1 pin (schematic v1.2), so it gets reg_dldo1.

Quoted 6 lines

---
Andre: reg_dldo1 instead of reg_aldo1 on the Zero3. Schematic v1.2 sheet 4 labels the 3.3V net "ALDO1", but it comes from AXP313A pin 12 (DLDO1, VCC33-DLDO); pin 15 (ALDO1) is the 1.8V VCC18-ALDO. The flash VDD (U61 pin 8, net DCDCE) is on that 3.3V net. Not tested, no Zero3 here.

Ah yeah, indeed, the schematic is super confusing in this respect. The flash chip uses DCDCE(!) as the supply label, which then goes on to connect to some unused label "ALDO1", but also to VCC33-DLDO, which is the actual PMIC connection. And the chip needs definitely more than 2.3V for its operation, according to its datasheet, so 3.3V is the right voltage.

So my bad, and thanks for checking this thoroughly.

Cheers,
Andre

Quoted 47 lines
---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 6 ++----
 arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts | 4 ++++
 3 files changed, 7 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi +1 -1
index 0d3e761f6466..cd1f67ad7c2b 100644
@@ -104,7 +104,7 @@ &spi0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
 
-	flash@0 {
+	spi_flash: flash@0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "jedec,spi-nor";
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +2 -4
index 90c25e12e189..2f8a16d1c9aa 100644
@@ -148,8 +148,6 @@ &pio {
 	vcc-pi-supply = <&reg_aldo1>;
 };
 
-&spi0 {
-	flash@0 {
-		vcc-supply = <&reg_aldo1>;
-	};
+&spi_flash {
+	vcc-supply = <&reg_aldo1>;
 };
arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts +4 -0
index c51d4d9120de..afa753dead30 100644
@@ -103,3 +103,7 @@ &pio {
 	vcc-ph-supply = <&reg_dldo1>;
 	vcc-pi-supply = <&reg_dldo1>;
 };
+
+&spi_flash {
+	vcc-supply = <&reg_dldo1>;
+};
#3 lore raw

PATCH v3 2/2 arm64: dts: allwinner: orangepi-zero2/zero3: Read the SPI NOR over two lines

In reply to Arun Iyengar

WP# and HOLD# are tied to VCC on the Zero2 (schematic v1.3), so read over two lines. Andre Przywara pointed out that the Zero3 is the same.

---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi +1 -0
index cd1f67ad7c2b..de05cbbd2cae 100644
@@ -110,6 +110,7 @@ spi_flash: flash@0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <40000000>;
+		spi-rx-bus-width = <2>;
 	};
 };
 
Signature · 1 line
2.55.0
maintainer Applied
#4 lore raw
In reply to Arun Iyengar
Quoted 8 lines · Arun Iyengar

Andre Przywara reviewed v1 and suggested labelling the flash node (patch
1) and setting spi-rx-bus-width in the dtsi shared with the Zero3 (patch 2).

spi-rx-bus-width = <2> needs the binding patch of [1] (acked, not applied yet) to pass dtbs_check.
Without the driver patch of [1] the driver ignores the setting.

[...]

Applied to sunxi/dt-for-7.5 in sunxi, thanks!

[1/2] arm64: dts: allwinner: orangepi-zero2/zero3: Set the SPI NOR supply by label

      https://git.kernel.org/sunxi/linux/c/ac59f8d79bde
[2/2] arm64: dts: allwinner: orangepi-zero2/zero3: Read the SPI NOR over two lines
      https://git.kernel.org/sunxi/linux/c/7b78b5603bb6

Best regards,

Signature · 1 line
Chen-Yu Tsai <[email protected]>