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

Message ID 20261118-zero2-spi-nor-dual-read-v1-1-bcdcbf785be0@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: orangepi-zero2: Read the SPI NOR over two lines |

Commit Message

Arun Iyengar via B4 Relay Nov. 18, 2026, 3:55 a.m. UTC
From: Arun Iyengar <aiyengar1990@gmail.com>

WP# and HOLD# are tied to VCC (schematic v1.3), so read over two lines.

Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
Needs the spi-sun6i H616 dual read series v2 (prerequisite below).
Tested on an Orange Pi Zero2 with it: 1-1-2 reads (opcode 0x3b), 2 MiB in
0.28 s instead of 0.52 s, identical data.

Developed with Claude (Anthropic), which wrote the commit message. I
reviewed it.
---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: a203a4bac3316451a3036653657c8b250dea2055
change-id: 20261115-zero2-spi-nor-dual-read-645a6de25e81
prerequisite-message-id: <20261116-spi-sun6i-h616-dual-read-v2-0-e0c66eb71e20@gmail.com>
prerequisite-patch-id: 28b145097d0f859e5bd27bcc5028d0915f3ba4bd
prerequisite-patch-id: fb47570beb53613acb42c518fd1999e05e0c54fb

Best regards,
--  
Arun Iyengar <aiyengar1990@gmail.com>
  

Comments

Andre Przywara Nov. 18, 2026, 11:19 a.m. UTC | #1
Hi,

On 11/18/26 04:55, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@gmail.com>
> 
> WP# and HOLD# are tied to VCC (schematic v1.3), so read over two lines.
> 
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
> Needs the spi-sun6i H616 dual read series v2 (prerequisite below).

I don't think it does, and this dependency wouldn't be legal anyway: the 
DT and Linux driver code are independent, even though they live in the 
same repository.
So as it stands: if you specify a 2 bit wide bus, but the driver doesn't 
support this (older kernels), the driver will just ignore this, though 
you get a message:
[    4.226908] spi spi0.0: setup: ignoring unsupported mode bits 400

So there is not hard dependency, functionality-wise, though it will be 
faster only if you have both the driver and the DT changes.

> Tested on an Orange Pi Zero2 with it: 1-1-2 reads (opcode 0x3b), 2 MiB in
> 0.28 s instead of 0.52 s, identical data.
> 
> Developed with Claude (Anthropic), which wrote the commit message. I
> reviewed it.
> ---
>   arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> index 90c25e12e189..fb117116002e 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> @@ -150,6 +150,7 @@ &pio {
>   
>   &spi0 {
>   	flash@0 {

This double reference looks odd. Why not just add a label to the flash 
node, and skip the spi0 reference altogether? Should have been done on 
the patch adding the supply (which has been already merged), but maybe 
we can still rectify this.

> +		spi-rx-bus-width = <2>;

Please note that this is true for the OrangePi Zero3 as well, so this 
property should be moved into sun50i-h616-orangepi-zero.dtsi.
Tested this on my Zero3 board, it works and reads the entire 16MB flash 
in 1.8 instead of 3.5 seconds.

Cheers,
Andre

>   		vcc-supply = <&reg_aldo1>;
>   	};
>   };
> 
> ---
> base-commit: a203a4bac3316451a3036653657c8b250dea2055
> change-id: 20261115-zero2-spi-nor-dual-read-645a6de25e81
> prerequisite-message-id: <20261116-spi-sun6i-h616-dual-read-v2-0-e0c66eb71e20@gmail.com>
> prerequisite-patch-id: 28b145097d0f859e5bd27bcc5028d0915f3ba4bd
> prerequisite-patch-id: fb47570beb53613acb42c518fd1999e05e0c54fb
> 
> Best regards,
> --
> Arun Iyengar <aiyengar1990@gmail.com>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
index 90c25e12e189..fb117116002e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
@@ -150,6 +150,7 @@  &pio {
 
 &spi0 {
 	flash@0 {
+		spi-rx-bus-width = <2>;
 		vcc-supply = <&reg_aldo1>;
 	};
 };