Skip to contentSkip to conversation

orange-pi-zero: minor updates for peripherals

PATCH Superseded Sergey Matyukevich 3 participants 10 messages May 24, 2017 – May 25, 2017

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover orange-pi-zero: minor updates for peripherals

These two patches simplify the use of orange-pi-zero board right out of the box:
- specify interrupts for the on-board XR819 SDIO WiFi chip
- add node on-board SPI NOR

Changes from v1:
- update commit messages: drop links to wiki at linux-sunxi.org
- disable SPI NOR flash by default
- drop description of the flash partitions
- add compatible property for XR819 wifi node

sun8i-h2-plus-orangepi-zero.dts | 16 ++++++++++++++++

1 file changed, 16 insertions(+)
#1 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

The orange-pi-zero board has Allwinner XR819 SDIO wifi chip. The board dts file provides a node enabling mmc1 controller. Together with an out-of-tree driver https://github.com/fifteenhex/xradio this node enables using the wifi chip.

This commit specifies XR819 interrupt configuration for the driver.

---
 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +3 -0
index 9e8b082c134f..e97dfd1775d1 100644
@@ -128,6 +128,9 @@
 	 */
 	xr819: sdio_wifi at 1 {
 		reg = <1>;
+		compatible = "xradio,xr819";
+		interrupt-parent = <&pio>;
+		interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;
 	};
 };
 
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

Quoted 17 lines · Sergey Matyukevich

The orange-pi-zero board has Allwinner XR819 SDIO wifi chip. The board dts file provides a node enabling mmc1 controller. Together with an out-of-tree driver https://github.com/fifteenhex/xradio this node enables using the wifi chip.

This commit specifies XR819 interrupt configuration for the driver.

---
 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +0 -0
index 9e8b082c134f..e97dfd1775d1 100644

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 131

Quoted 4 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +1 -0
@@ -128,6 +128,9 @@
         */
        xr819: sdio_wifi at 1 {
                reg = <1>;
+               compatible = "xradio,xr819";

You should submit device tree bindings first. See:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/net/wireless

for examples.

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 133

Quoted 2 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +2 -0
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;

Are these optional or required properties? AFAIK SDIO supports in-band interrupts with a bit of overhead, so they should be optional.

ChenYu

Quoted 6 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +0 -1
        };
 };
 
--

2.11.0

#3 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

Quoted 12 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 131

Quoted 9 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +1 -0
index 9e8b082c134f..e97dfd1775d1 100644
@@ -128,6 +128,9 @@
         */
        xr819: sdio_wifi at 1 {
                reg = <1>;
+               compatible = "xradio,xr819";

You should submit device tree bindings first. See:

Quoted 3 lines

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/net/wireless

for examples.

Does it make sense for the out-of-tree driver ?

Quoted 5 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 133

Quoted 2 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +2 -0
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;

Are these optional or required properties? AFAIK SDIO supports in-band interrupts with a bit of overhead, so they should be optional.

Those properties are optional. Driver works anyway, though it complains about missing interrupts. IIUC xradio driver falls back to polling mode only if xr819 interrupt configuraton is not specified.

Regards,
Sergey

#4 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

Quoted 12 lines · Sergey Matyukevich
Quoted 12 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 131

Quoted 9 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +1 -0
index 9e8b082c134f..e97dfd1775d1 100644
@@ -128,6 +128,9 @@
         */
        xr819: sdio_wifi at 1 {
                reg = <1>;
+               compatible = "xradio,xr819";

You should submit device tree bindings first. See:

Quoted 5 lines
Quoted 3 lines

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/net/wireless

for examples.

Does it make sense for the out-of-tree driver ?

There is already a binding for ESP8089, which is supported out of tree. There are also bindings for Mali GPUs which are, again, supported out of tree.

AFAIK there was some discussion about this during the submission of the Mali bindings. A set of stable bindings allows the vendor to create stable device trees. Given that the binding for this WiFi chip is relatively simple, and it might be compatible or similar to an existing chip already supported in kernel (but without a binding), it should be straight forward.

Quoted 10 lines
Quoted 6 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 133

Quoted 3 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +2 -0
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;

Are these optional or required properties? AFAIK SDIO supports in-band interrupts with a bit of overhead, so they should be optional.

Those properties are optional. Driver works anyway, though it complains about missing interrupts. IIUC xradio driver falls back to polling mode only if xr819 interrupt configuraton is not specified.

So it doesn't support in-band SDIO interrupts right now. Is that a hardware or driver limitation?

ChenYu

#5 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

? 2017?5?25? GMT+08:00 ??3:21:44, Chen-Yu Tsai <[email protected]> ??:

Quoted 44 lines
Quoted 1 line · Sergey Matyukevich
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

index 9e8b082c134f..e97dfd1775d1 100644

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +0 -0
@@ -128,6 +128,9 @@
Quoted 8 lines
Quoted 8 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 131

Quoted 4 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +1 -0
         */
        xr819: sdio_wifi at 1 {
                reg = <1>;
+               compatible = "xradio,xr819";

You should submit device tree bindings first. See:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/net/wireless

Quoted 4 lines
Quoted 2 lines

for examples.

Does it make sense for the out-of-tree driver ?

There is already a binding for ESP8089, which is supported out of tree. There are also bindings for Mali GPUs which are, again, supported out of tree.

AFAIK there was some discussion about this during the submission of the Mali bindings. A set of stable bindings allows the vendor to create stable
device trees. Given that the binding for this WiFi chip is relatively simple,
and it might be compatible or similar to an existing chip already supported
in kernel (but without a binding), it should be straight forward.

Quoted 5 lines
Quoted 5 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 133

Quoted 3 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +2 -0
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;

Are these optional or required properties? AFAIK SDIO supports

in-band

Quoted 3 lines
Quoted 1 line

interrupts with a bit of overhead, so they should be optional.

Those properties are optional. Driver works anyway, though it

Quoted 8 lines

complains about

Quoted 1 line

missing interrupts. IIUC xradio driver falls back to polling mode

only if

Quoted 1 line

xr819 interrupt configuraton is not specified.

So it doesn't support in-band SDIO interrupts right now. Is that a hardware
or driver limitation?

The original driver code modified by me to mainline uses in-band interrupts.

But dgp modified it to use out-of-band interrupts.

Quoted 2 lines

ChenYu

#6 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Those properties are optional. Driver works anyway, though it

complains about

Quoted 1 line

missing interrupts. IIUC xradio driver falls back to polling mode

only if

Quoted 1 line

xr819 interrupt configuraton is not specified.

Quoted 7 lines
Quoted 3 lines

So it doesn't support in-band SDIO interrupts right now. Is that a hardware
or driver limitation?

The original driver code modified by me to mainline uses in-band interrupts.

But dgp modified it to use out-of-band interrupts.

Current patch was intended to simplify using out of the box the following out-of-tree driver: https://github.com/fifteenhex/xradio.

Could you please share a bit more details about the drivers you mention here. Is there any xr819 mainlining efforts ongoing ?

Regards,
Sergey

#7 lore raw

PATCH v2 1/2 ARM: dts: orange-pi-zero: specify wifi interrupts

In reply to Chen-Yu Tsai
Quoted 11 lines
Quoted 1 line

Does it make sense for the out-of-tree driver ?

There is already a binding for ESP8089, which is supported out of tree. There are also bindings for Mali GPUs which are, again, supported out of tree.

AFAIK there was some discussion about this during the submission of the Mali bindings. A set of stable bindings allows the vendor to create stable device trees. Given that the binding for this WiFi chip is relatively simple, and it might be compatible or similar to an existing chip already supported in kernel (but without a binding), it should be straight forward.

Thanks for pointing at these examples! According to linux-sunxi.org wiki this wireless chip might be related to ST cw1200 (drivers/net/wireless/st/cw1200). I will check if it has any bindings as well.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 133

Quoted 4 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +2 -0
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;

Are these optional or required properties? AFAIK SDIO supports in-band interrupts with a bit of overhead, so they should be optional.

Quoted 6 lines
Quoted 3 lines

Those properties are optional. Driver works anyway, though it complains about missing interrupts. IIUC xradio driver falls back to polling mode only if xr819 interrupt configuraton is not specified.

So it doesn't support in-band SDIO interrupts right now. Is that a hardware or driver limitation?

I have no idea. I haven't yet had a chance to hack around this driver:
only basic testing
and brief comparison with cw1200 driver.

Regards,
Sergey

#8 lore raw

PATCH v2 2/2 ARM: dts: orange-pi-zero: add node for SPI NOR

In reply to Sergey Matyukevich

SPI NOR flash was optional in the first production batch in Dec 2016. In later batches flash chip was pre-populated. However there should be quite a few boards around which do not have flash chip.

Add node for SPI NOR flash on orange-pi-zero board. Disable this node by default and leave it to users to enable it if their board has SPI NOR flash chip populated.

---
 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +13 -0
index e97dfd1775d1..bbbd8c656914 100644
@@ -138,6 +138,19 @@
 	bias-pull-up;
 };
 
+&spi0 {
+	/* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
+	status = "disabled";
+
+	flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "mxicy,mx25l1606e", "winbond,w25q128";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
 &ohci0 {
 	status = "okay";
 };
Signature · 1 line
2.11.0
#9 lore raw

PATCH v2 2/2 ARM: dts: orange-pi-zero: add node for SPI NOR

Quoted 25 lines · Sergey Matyukevich

SPI NOR flash was optional in the first production batch in Dec 2016. In later batches flash chip was pre-populated. However there should be quite a few boards around which do not have flash chip.

Add node for SPI NOR flash on orange-pi-zero board. Disable this node by default and leave it to users to enable it if their board has SPI NOR flash chip populated.

---
 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +4 -0
index e97dfd1775d1..bbbd8c656914 100644
@@ -138,6 +138,19 @@
        bias-pull-up;
 };
 
+&spi0 {
+       /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
+       status = "disabled";
+

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts line 154

Quoted 10 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +9 -0
+       flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mxicy,mx25l1606e", "winbond,w25q128";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+       };
+};
+
 &ohci0 {

Please sort the node references in alphabetical order.

ChenYu

Quoted 5 lines
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +0 -1
        status = "okay";
 };
--

2.11.0