Skip to contentSkip to conversation

arm64: dts: allwinner: Cubie A5E: enable SPI flash

PATCH In review Andre Przywara 5 participants 9 messages May 11 – May 16

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

PATCH 1/1 arm64: dts: allwinner: Cubie A5E: enable SPI flash

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
 .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +15 -0
index bfdf1728cd14b..7ad22fc85d1fd 100644
@@ -344,6 +344,21 @@ &r_pio {
 	vcc-pm-supply = <&reg_aldo3>;
 };
 
+&spi0  {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+		    <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "winbond,w25q128", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;
Signature · 1 line
2.46.4
#2 lore raw
In reply to Andre Przywara
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] Missing `spi-rx-bus-width` and `spi-tx-bus-width` properties restrict the SPI flash to 1-bit…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing spi-rx-bus-width and spi-tx-bus-width properties restrict the SPI flash to 1-bit mode despite hardware Quad SPI configuration.
- [Low] Unnecessary #address-cells and #size-cells defined in the flash@0 node without child nodes.
--

commit 90d57abd1dc9fc1a77a15be6ce437a4b3378df17
Author: Andre Przywara <[email protected]>

arm64: dts: allwinner: Cubie A5E: enable SPI flash

This commit enables the SPI0 device tree node for the Cubie A5E board. It describes the configuration for the 16MiB SPI NOR flash connected to the SPI0 bus.

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +0 -0
@@ -344,6 +344,21 @@ &r_pio {
 	vcc-pm-supply = <&reg_aldo3>;
 };
 

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 356

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +10 -0
+&spi0  {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+		    <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "winbond,w25q128", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;

Since the pinctrl-0 configuration explicitly maps the hardware WP and HOLD pins to the SPI controller, should this node also include spi-rx-bus-width = <4> and spi-tx-bus-width = <4>?

Without these properties, the SPI driver defaults to standard 1-bit mode, failing to utilize the board's wired Quad SPI capabilities. Additionally, if the board lacks external pull-ups, could muxing the active-low WP and HOLD pins to the SPI controller in 1-bit mode leave the pins floating and risk unintended write-protect or hold states?

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 358

Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +2 -0
+		#address-cells = <1>;
+		#size-cells = <1>;

This isn't a bug, but since this flash node does not contain any child partition nodes, these #address-cells and #size-cells properties are unnecessary and trigger standard dtc warnings.

Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +2 -0
+	};
+};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#3 lore raw
In reply to Andre Przywara

Hi,

Quoted 15 lines · Andre Przywara

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
 .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +0 -0
index bfdf1728cd14b..7ad22fc85d1fd 100644

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 350

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +4 -0
@@ -344,6 +344,21 @@ &r_pio {
        vcc-pm-supply = <&reg_aldo3>;
 };
 
+&spi0  {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+                   <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;

This whole thing needs to be an overlay. The HOLD and WP pins conflict with eMMC usage, so it seems that Radxa only populates one or the other.

If you look at the pictures on their official website, you'll see the SPI NOR chip populated, but not the eMMC chip. On the linux-sunxi wiki page, you'll see the opposite.

And you probably want to enable QSPI, like Sashiko mentioned.

ChenYu

Quoted 17 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +11 -1
+       status = "okay";
+
+       flash@0 {
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pb_pins>;
--

2.46.4

#4 lore raw

Hi Chen-Yu,

thanks for chipping in!

Quoted 30 lines · Chen-Yu Tsai

Hi,

Quoted 15 lines · Andre Przywara

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
  .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts  | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +0 -0
index bfdf1728cd14b..7ad22fc85d1fd 100644

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 350

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +4 -0
@@ -344,6 +344,21 @@ &r_pio {
         vcc-pm-supply = <&reg_aldo3>;
  };
 
+&spi0  {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+                   <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;

This whole thing needs to be an overlay. The HOLD and WP pins conflict with eMMC usage, so it seems that Radxa only populates one or the other.

Quoted 3 lines

If you look at the pictures on their official website, you'll see the SPI NOR chip populated, but not the eMMC chip. On the linux-sunxi wiki page, you'll see the opposite.

Well, I have a hard time spotting any actual eMMC SKUs in the shops anyway. But you are right, the hold and WP pins conflict with eMMC, whereas the other pins are not.

Quoted 1 line

And you probably want to enable QSPI, like Sashiko mentioned.

Well, in the interest of keeping this simple and enabling the usage of SPI flash for all the users out there, I'd rather drop the extra pins.
This is mostly really useful for booting the firmware, maybe loading a tiny kernel or other data once, so performance is not a big concern in this use case. The BootROM surely does not use QSPI.

And as you say, if people are really interested in the last bit of performance, they can use an overlay.

Cheers,
Andre

Quoted 23 lines

ChenYu

Quoted 17 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +11 -1
+       status = "okay";
+
+       flash@0 {
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
  &uart0 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart0_pb_pins>;
--

2.46.4

maintainer
#5 lore raw
Quoted 44 lines · Andre Przywara

Hi Chen-Yu,

thanks for chipping in!

Quoted 30 lines · Chen-Yu Tsai

Hi,

Quoted 15 lines · Andre Przywara

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
  .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts  | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +0 -0
index bfdf1728cd14b..7ad22fc85d1fd 100644

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 350

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +4 -0
@@ -344,6 +344,21 @@ &r_pio {
         vcc-pm-supply = <&reg_aldo3>;
  };
 
+&spi0  {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+                   <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;

This whole thing needs to be an overlay. The HOLD and WP pins conflict with eMMC usage, so it seems that Radxa only populates one or the other.

Quoted 3 lines

If you look at the pictures on their official website, you'll see the SPI NOR chip populated, but not the eMMC chip. On the linux-sunxi wiki page, you'll see the opposite.

Well, I have a hard time spotting any actual eMMC SKUs in the shops anyway. But you are right, the hold and WP pins conflict with eMMC, whereas the other pins are not.

Quoted 7 lines
Quoted 1 line

And you probably want to enable QSPI, like Sashiko mentioned.

Well, in the interest of keeping this simple and enabling the usage of SPI flash for all the users out there, I'd rather drop the extra pins. This is mostly really useful for booting the firmware, maybe loading a tiny kernel or other data once, so performance is not a big concern in this use case. The BootROM surely does not use QSPI.

Given that the pins are tied on physically, if someone then enables mmc2 for a potentially present eMMC, the two pins could be toggled by the MMC controller, causing the flash to misbehave. I'm slightly concerned about this possibility.

ChenYu

Quoted 30 lines

And as you say, if people are really interested in the last bit of performance, they can use an overlay.

Cheers,
Andre

Quoted 23 lines

ChenYu

Quoted 17 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +11 -1
+       status = "okay";
+
+       flash@0 {
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
  &uart0 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart0_pb_pins>;
--

2.46.4

#6 lore raw
Quoted 53 lines · On Sat, 16 May 2026 00:12:17 +0800 Chen-Yu Tsai <[email protected]> wrote:
Quoted 44 lines · Andre Przywara

Hi Chen-Yu,

thanks for chipping in!

Quoted 30 lines · Chen-Yu Tsai

Hi,

Quoted 15 lines · Andre Przywara

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
  .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts  | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +0 -0
index bfdf1728cd14b..7ad22fc85d1fd 100644

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 350

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +4 -0
@@ -344,6 +344,21 @@ &r_pio {
         vcc-pm-supply = <&reg_aldo3>;
  };
 
+&spi0  {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+                   <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;  

This whole thing needs to be an overlay. The HOLD and WP pins conflict with eMMC usage, so it seems that Radxa only populates one or the other.

Quoted 3 lines

If you look at the pictures on their official website, you'll see the SPI NOR chip populated, but not the eMMC chip. On the linux-sunxi wiki page, you'll see the opposite.

Well, I have a hard time spotting any actual eMMC SKUs in the shops anyway. But you are right, the hold and WP pins conflict with eMMC, whereas the other pins are not.

Quoted 7 lines
Quoted 1 line

And you probably want to enable QSPI, like Sashiko mentioned.

Well, in the interest of keeping this simple and enabling the usage of SPI flash for all the users out there, I'd rather drop the extra pins. This is mostly really useful for booting the firmware, maybe loading a tiny kernel or other data once, so performance is not a big concern in this use case. The BootROM surely does not use QSPI.

Quoted 4 lines

Given that the pins are tied on physically, if someone then enables mmc2 for a potentially present eMMC, the two pins could be toggled by the MMC controller, causing the flash to misbehave. I'm slightly concerned about this possibility.

That's a good point, but that means it's really a hardware design
issue: you cannot have SPI together with eMMC on this board.

I don't know if Radxa ships the eMMC SKUs without SPI flash, I will try to query Tom Cubie about this.

I would prefer to go with SPI flash, at least for now: I think that's what most users have, and the eMMC versions are rare so far? Since we don't have an eMMC node in the DT anyway, that should be fine for now. If someone adds eMMC support later, we would need to figure this out. We could mark one as disabled, and leave it up to users (or U-Boot) to decide which to enable.
On the H6 there is a similar problem: PC5 is both SPI0_CS and MMC2_CMD, so on the PineH64 we disable the SPI flash, in favour of eMMC, which is more useful for users (but sunxi-fel SPI access and U-Boot SPI loading work nevertheless). But given the apparent prevalence of SPI boards vs. those with eMMC for the Cubie A5E, I would go with SPI on this one.

Does that make sense? Any thoughts?

Cheers,
Andre

Quoted 31 lines
Quoted 30 lines

And as you say, if people are really interested in the last bit of performance, they can use an overlay.

Cheers,
Andre

Quoted 23 lines

ChenYu

Quoted 17 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +11 -1
+       status = "okay";
+
+       flash@0 {
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
  &uart0 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart0_pb_pins>;
--

2.46.4

maintainer
#7 lore raw
Quoted 80 lines · Andre Przywara
Quoted 53 lines · On Sat, 16 May 2026 00:12:17 +0800 Chen-Yu Tsai <[email protected]> wrote:
Quoted 44 lines · Andre Przywara

Hi Chen-Yu,

thanks for chipping in!

Quoted 30 lines · Chen-Yu Tsai

Hi,

Quoted 15 lines · Andre Przywara

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
  .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts  | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +0 -0
index bfdf1728cd14b..7ad22fc85d1fd 100644

arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts &r_pio { · line 350

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +4 -0
@@ -344,6 +344,21 @@ &r_pio {
         vcc-pm-supply = <&reg_aldo3>;
  };
 
+&spi0  {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+                   <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;

This whole thing needs to be an overlay. The HOLD and WP pins conflict with eMMC usage, so it seems that Radxa only populates one or the other.

Quoted 3 lines

If you look at the pictures on their official website, you'll see the SPI NOR chip populated, but not the eMMC chip. On the linux-sunxi wiki page, you'll see the opposite.

Well, I have a hard time spotting any actual eMMC SKUs in the shops anyway. But you are right, the hold and WP pins conflict with eMMC, whereas the other pins are not.

Quoted 7 lines
Quoted 1 line

And you probably want to enable QSPI, like Sashiko mentioned.

Well, in the interest of keeping this simple and enabling the usage of SPI flash for all the users out there, I'd rather drop the extra pins. This is mostly really useful for booting the firmware, maybe loading a tiny kernel or other data once, so performance is not a big concern in this use case. The BootROM surely does not use QSPI.

Quoted 4 lines

Given that the pins are tied on physically, if someone then enables mmc2 for a potentially present eMMC, the two pins could be toggled by the MMC controller, causing the flash to misbehave. I'm slightly concerned about this possibility.

That's a good point, but that means it's really a hardware design
issue: you cannot have SPI together with eMMC on this board.

I don't know if Radxa ships the eMMC SKUs without SPI flash, I will try to query Tom Cubie about this.

I would prefer to go with SPI flash, at least for now: I think that's what most users have, and the eMMC versions are rare so far? Since we don't have an eMMC node in the DT anyway, that should be fine for now. If someone adds eMMC support later, we would need to figure this out. We could mark one as disabled, and leave it up to users (or U-Boot) to decide which to enable.
On the H6 there is a similar problem: PC5 is both SPI0_CS and MMC2_CMD, so on the PineH64 we disable the SPI flash, in favour of eMMC, which is more useful for users (but sunxi-fel SPI access and U-Boot SPI loading work nevertheless). But given the apparent prevalence of SPI boards vs. those with eMMC for the Cubie A5E, I would go with SPI on this one.

Quoted 1 line

Does that make sense? Any thoughts?

In that case it might be better to enable it with full QSPI. The pin conflicts can also serve as a lockout against enabling both. Just need to document it properly.

ChenYu

Quoted 35 lines

Cheers,
Andre

Quoted 31 lines
Quoted 30 lines

And as you say, if people are really interested in the last bit of performance, they can use an overlay.

Cheers,
Andre

Quoted 23 lines

ChenYu

Quoted 17 lines
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +11 -1
+       status = "okay";
+
+       flash@0 {
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
  &uart0 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart0_pb_pins>;
--

2.46.4

#8 lore raw
In reply to Andre Przywara

Looks good.

--
Samet

Quoted 41 lines

2026. 5. 12. 오전 2:46, Andre Przywara <[email protected]> 작성:

The Cubie A5E board comes with 16MiB of SPI NOR flash.

Enable the SPI0 DT node and describe the configuration.

---
.../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 15 +++++++++++++++

1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +15 -1
index bfdf1728cd14b..7ad22fc85d1fd 100644
@@ -344,6 +344,21 @@ &r_pio {
   vcc-pm-supply = <&reg_aldo3>;
 };
 
+&spi0  {
+    pinctrl-names = "default";
+    pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>,
+            <&spi0_hold_pc_pin>, <&spi0_wp_pc_pin>;
+    status = "okay";
+
+    flash@0 {
+        compatible = "winbond,w25q128", "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <40000000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+    };
+};
+
 &uart0 {
   pinctrl-names = "default";
   pinctrl-0 = <&uart0_pb_pins>;
--

2.46.4