diff mbox

[09/10] arm64: dts: allwinner: a64: NanoPi-A64: Add Wifi/Bluetooth chip

Message ID 20180706085210.17952-10-andre.przywara@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andre Przywara July 6, 2018, 8:52 a.m. UTC
The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
to the usual MMC1 and UART1. The power is provided by the always-on
VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.

Add the respective nodes to the DT to make it usable.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Icenowy Zheng July 6, 2018, 9:04 a.m. UTC | #1
于 2018年7月6日 GMT+08:00 下午4:52:09, Andre Przywara <andre.przywara@arm.com> 写到:
>The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
>to the usual MMC1 and UART1. The power is provided by the always-on
>VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.
>
>Add the respective nodes to the DT to make it usable.
>
>Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>---
>.../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33
>++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
>diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>index 0439cff685d6..bb3ba7709dee 100644
>--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>@@ -53,11 +53,18 @@
> 	aliases {
> 		ethernet0 = &emac;
> 		serial0 = &uart0;
>+		serial1 = &uart1;
> 	};
> 
> 	chosen {
> 		stdout-path = "serial0:115200n8";
> 	};
>+
>+        wifi_pwrseq: wifi_pwrseq {
>+                compatible = "mmc-pwrseq-simple";
>+                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>+        };
>+
> };
> 
> &ehci0 {
>@@ -105,6 +112,25 @@
> 	status = "okay";
> };
> 
>+&mmc1 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&mmc1_pins>;
>+	vmmc-supply = <&reg_dcdc1>;
>+	vqmmc-supply = <&reg_dldo4>;
>+	mmc-pwrseq = <&wifi_pwrseq>;
>+	bus-width = <4>;
>+	non-removable;
>+	status = "okay";
>+
>+	brcmf: wifi@1 {
>+		reg = <1>;
>+		compatible = "brcm,bcm4329-fmac";
>+		interrupt-parent = <&r_pio>;
>+		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>+		interrupt-names = "host-wake";
>+	};
>+};
>+
> &ohci0 {
> 	status = "okay";
> };
>@@ -229,6 +255,13 @@
> 	status = "okay";
> };
> 
>+/* Connected to the Bluetooth UART, with hardware handshake pins */
>+&uart1 {
>+	pinctrl-names = "default";
>+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>+	status = "okay";

Do you consider to enable serdev driver for it?

>+};
>+
> &usbphy {
> 	status = "okay";
> };
Andre Przywara July 6, 2018, 9:38 a.m. UTC | #2
Hi,

On 06/07/18 10:04, Icenowy Zheng wrote:
> 
> 
> 于 2018年7月6日 GMT+08:00 下午4:52:09, Andre Przywara <andre.przywara@arm.com> 写到:
>> The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
>> to the usual MMC1 and UART1. The power is provided by the always-on
>> VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.
>>
>> Add the respective nodes to the DT to make it usable.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>> .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33
>> ++++++++++++++++++++++
>> 1 file changed, 33 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> index 0439cff685d6..bb3ba7709dee 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> @@ -53,11 +53,18 @@
>> 	aliases {
>> 		ethernet0 = &emac;
>> 		serial0 = &uart0;
>> +		serial1 = &uart1;
>> 	};
>>
>> 	chosen {
>> 		stdout-path = "serial0:115200n8";
>> 	};
>> +
>> +        wifi_pwrseq: wifi_pwrseq {
>> +                compatible = "mmc-pwrseq-simple";
>> +                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> +        };
>> +
>> };
>>
>> &ehci0 {
>> @@ -105,6 +112,25 @@
>> 	status = "okay";
>> };
>>
>> +&mmc1 {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&mmc1_pins>;
>> +	vmmc-supply = <&reg_dcdc1>;
>> +	vqmmc-supply = <&reg_dldo4>;
>> +	mmc-pwrseq = <&wifi_pwrseq>;
>> +	bus-width = <4>;
>> +	non-removable;
>> +	status = "okay";
>> +
>> +	brcmf: wifi@1 {
>> +		reg = <1>;
>> +		compatible = "brcm,bcm4329-fmac";
>> +		interrupt-parent = <&r_pio>;
>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>> +		interrupt-names = "host-wake";
>> +	};
>> +};
>> +
>> &ohci0 {
>> 	status = "okay";
>> };
>> @@ -229,6 +255,13 @@
>> 	status = "okay";
>> };
>>
>> +/* Connected to the Bluetooth UART, with hardware handshake pins */
>> +&uart1 {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>> +	status = "okay";
> 
> Do you consider to enable serdev driver for it?

Have you tried this before?
I remember I hacked Bluetooth to work on a Pine64, but this was quite
dodgy with some userland tools needed from somewhere, I am pretty sure
this was just using /dev/ttySx (because this was ages ago, before the
introduction of serdev, I believe).

Basically I just wanted to mark those pins as "used", because they are
hardwired to this Bluetooth chip.

Cheers,
Andre.

>> +};
>> +
>> &usbphy {
>> 	status = "okay";
>> };
Sergey Suloev July 6, 2018, 2:23 p.m. UTC | #3
On 07/06/2018 11:52 AM, Andre Przywara wrote:
> The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
> to the usual MMC1 and UART1. The power is provided by the always-on
> VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.
>
> Add the respective nodes to the DT to make it usable.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>   .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33 ++++++++++++++++++++++
>   1 file changed, 33 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
> index 0439cff685d6..bb3ba7709dee 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
> @@ -53,11 +53,18 @@
>   	aliases {
>   		ethernet0 = &emac;
>   		serial0 = &uart0;
> +		serial1 = &uart1;
>   	};
>   
>   	chosen {
>   		stdout-path = "serial0:115200n8";
>   	};
> +
> +        wifi_pwrseq: wifi_pwrseq {
> +                compatible = "mmc-pwrseq-simple";
> +                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> +        };
> +
>   };
>   
>   &ehci0 {
> @@ -105,6 +112,25 @@
>   	status = "okay";
>   };
>   
> +&mmc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +	vmmc-supply = <&reg_dcdc1>;
> +	vqmmc-supply = <&reg_dldo4>;
> +	mmc-pwrseq = <&wifi_pwrseq>;
> +	bus-width = <4>;
> +	non-removable;
> +	status = "okay";
> +
> +	brcmf: wifi@1 {
> +		reg = <1>;
> +		compatible = "brcm,bcm4329-fmac";
> +		interrupt-parent = <&r_pio>;
> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> +		interrupt-names = "host-wake";
> +	};
> +};
> +
>   &ohci0 {
>   	status = "okay";
>   };
> @@ -229,6 +255,13 @@
>   	status = "okay";
>   };
>   
> +/* Connected to the Bluetooth UART, with hardware handshake pins */
> +&uart1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> +	status = "okay";
> +};
> +
>   &usbphy {
>   	status = "okay";
>   };

NanoPi A64 has rtl8189 Ethernet chip.
Andre Przywara July 6, 2018, 2:49 p.m. UTC | #4
Hi,

On 06/07/18 15:23, Sergey Suloev wrote:
> On 07/06/2018 11:52 AM, Andre Przywara wrote:
>> The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
>> to the usual MMC1 and UART1. The power is provided by the always-on
>> VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.
>>
>> Add the respective nodes to the DT to make it usable.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>>   .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33
>> ++++++++++++++++++++++
>>   1 file changed, 33 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> index 0439cff685d6..bb3ba7709dee 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> @@ -53,11 +53,18 @@
>>       aliases {
>>           ethernet0 = &emac;
>>           serial0 = &uart0;
>> +        serial1 = &uart1;
>>       };
>>         chosen {
>>           stdout-path = "serial0:115200n8";
>>       };
>> +
>> +        wifi_pwrseq: wifi_pwrseq {
>> +                compatible = "mmc-pwrseq-simple";
>> +                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> +        };
>> +
>>   };
>>     &ehci0 {
>> @@ -105,6 +112,25 @@
>>       status = "okay";
>>   };
>>   +&mmc1 {
>> +    pinctrl-names = "default";
>> +    pinctrl-0 = <&mmc1_pins>;
>> +    vmmc-supply = <&reg_dcdc1>;
>> +    vqmmc-supply = <&reg_dldo4>;
>> +    mmc-pwrseq = <&wifi_pwrseq>;
>> +    bus-width = <4>;
>> +    non-removable;
>> +    status = "okay";
>> +
>> +    brcmf: wifi@1 {
>> +        reg = <1>;
>> +        compatible = "brcm,bcm4329-fmac";
>> +        interrupt-parent = <&r_pio>;
>> +        interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>> +        interrupt-names = "host-wake";
>> +    };
>> +};
>> +
>
> NanoPi A64 has rtl8189 Ethernet chip.
Good point, thanks for mentioning it (though I guess you mean WiFi chip).
Do you have the board? Do you have WiFi working?
From a very brief look over the tree I don't see any explicit driver for
an SDIO based 8189 variant, but other boards claiming to have a 8189
seem to just not provide a compatible at all. Does that actually work?
It would be great if you could share some insight here!

Thanks!
Andre.

>>   &ohci0 {
>>       status = "okay";
>>   };
>> @@ -229,6 +255,13 @@
>>       status = "okay";
>>   };
>>   +/* Connected to the Bluetooth UART, with hardware handshake pins */
>> +&uart1 {
>> +    pinctrl-names = "default";
>> +    pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>> +    status = "okay";
>> +};
>> +
>>   &usbphy {
>>       status = "okay";
>>   };
> 
> 
>
Icenowy Zheng July 6, 2018, 2:49 p.m. UTC | #5
于 2018年7月6日 GMT+08:00 下午10:49:05, Andre Przywara <andre.przywara@arm.com> 写到:
>Hi,
>
>On 06/07/18 15:23, Sergey Suloev wrote:
>> On 07/06/2018 11:52 AM, Andre Przywara wrote:
>>> The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
>>> to the usual MMC1 and UART1. The power is provided by the always-on
>>> VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.
>>>
>>> Add the respective nodes to the DT to make it usable.
>>>
>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>> ---
>>>   .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33
>>> ++++++++++++++++++++++
>>>   1 file changed, 33 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> index 0439cff685d6..bb3ba7709dee 100644
>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> @@ -53,11 +53,18 @@
>>>       aliases {
>>>           ethernet0 = &emac;
>>>           serial0 = &uart0;
>>> +        serial1 = &uart1;
>>>       };
>>>         chosen {
>>>           stdout-path = "serial0:115200n8";
>>>       };
>>> +
>>> +        wifi_pwrseq: wifi_pwrseq {
>>> +                compatible = "mmc-pwrseq-simple";
>>> +                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2
>*/
>>> +        };
>>> +
>>>   };
>>>     &ehci0 {
>>> @@ -105,6 +112,25 @@
>>>       status = "okay";
>>>   };
>>>   +&mmc1 {
>>> +    pinctrl-names = "default";
>>> +    pinctrl-0 = <&mmc1_pins>;
>>> +    vmmc-supply = <&reg_dcdc1>;
>>> +    vqmmc-supply = <&reg_dldo4>;
>>> +    mmc-pwrseq = <&wifi_pwrseq>;
>>> +    bus-width = <4>;
>>> +    non-removable;
>>> +    status = "okay";
>>> +
>>> +    brcmf: wifi@1 {
>>> +        reg = <1>;
>>> +        compatible = "brcm,bcm4329-fmac";
>>> +        interrupt-parent = <&r_pio>;
>>> +        interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>>> +        interrupt-names = "host-wake";
>>> +    };
>>> +};
>>> +
>>
>> NanoPi A64 has rtl8189 Ethernet chip.
>Good point, thanks for mentioning it (though I guess you mean WiFi
>chip).
>Do you have the board? Do you have WiFi working?
>From a very brief look over the tree I don't see any explicit driver
>for
>an SDIO based 8189 variant, but other boards claiming to have a 8189
>seem to just not provide a compatible at all. Does that actually work?

Work with out-of-tree drivers by Hans de Goede.

>It would be great if you could share some insight here!
>
>Thanks!
>Andre.
>
>>>   &ohci0 {
>>>       status = "okay";
>>>   };
>>> @@ -229,6 +255,13 @@
>>>       status = "okay";
>>>   };
>>>   +/* Connected to the Bluetooth UART, with hardware handshake pins
>*/
>>> +&uart1 {
>>> +    pinctrl-names = "default";
>>> +    pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>>> +    status = "okay";
>>> +};
>>> +
>>>   &usbphy {
>>>       status = "okay";
>>>   };
>> 
>> 
>>
Sergey Suloev July 6, 2018, 9:33 p.m. UTC | #6
On 07/06/2018 05:49 PM, Andre Przywara wrote:
> Hi,
>
> On 06/07/18 15:23, Sergey Suloev wrote:
>> On 07/06/2018 11:52 AM, Andre Przywara wrote:
>>> The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected
>>> to the usual MMC1 and UART1. The power is provided by the always-on
>>> VCC_SYS_3.3V, but it uses pin L2 to enable the regulator.
>>>
>>> Add the respective nodes to the DT to make it usable.
>>>
>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>> ---
>>>    .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 33
>>> ++++++++++++++++++++++
>>>    1 file changed, 33 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> index 0439cff685d6..bb3ba7709dee 100644
>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>>> @@ -53,11 +53,18 @@
>>>        aliases {
>>>            ethernet0 = &emac;
>>>            serial0 = &uart0;
>>> +        serial1 = &uart1;
>>>        };
>>>          chosen {
>>>            stdout-path = "serial0:115200n8";
>>>        };
>>> +
>>> +        wifi_pwrseq: wifi_pwrseq {
>>> +                compatible = "mmc-pwrseq-simple";
>>> +                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>> +        };
>>> +
>>>    };
>>>      &ehci0 {
>>> @@ -105,6 +112,25 @@
>>>        status = "okay";
>>>    };
>>>    +&mmc1 {
>>> +    pinctrl-names = "default";
>>> +    pinctrl-0 = <&mmc1_pins>;
>>> +    vmmc-supply = <&reg_dcdc1>;
>>> +    vqmmc-supply = <&reg_dldo4>;
>>> +    mmc-pwrseq = <&wifi_pwrseq>;
>>> +    bus-width = <4>;
>>> +    non-removable;
>>> +    status = "okay";
>>> +
>>> +    brcmf: wifi@1 {
>>> +        reg = <1>;
>>> +        compatible = "brcm,bcm4329-fmac";
>>> +        interrupt-parent = <&r_pio>;
>>> +        interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>>> +        interrupt-names = "host-wake";
>>> +    };
>>> +};
>>> +
>> NanoPi A64 has rtl8189 Ethernet chip.
> Good point, thanks for mentioning it (though I guess you mean WiFi chip).
> Do you have the board? Do you have WiFi working?
>  From a very brief look over the tree I don't see any explicit driver for
> an SDIO based 8189 variant, but other boards claiming to have a 8189
> seem to just not provide a compatible at all. Does that actually work?
> It would be great if you could share some insight here!
>
> Thanks!
> Andre.
>
>>>    &ohci0 {
>>>        status = "okay";
>>>    };
>>> @@ -229,6 +255,13 @@
>>>        status = "okay";
>>>    };
>>>    +/* Connected to the Bluetooth UART, with hardware handshake pins */
>>> +&uart1 {
>>> +    pinctrl-names = "default";
>>> +    pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>>> +    status = "okay";
>>> +};
>>> +
>>>    &usbphy {
>>>        status = "okay";
>>>    };
>>
>>
yes, I meant WiFi of course.

I am using the following driver 
https://github.com/jwrdegoede/rtl8189ES_linux.git, branch master
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
index 0439cff685d6..bb3ba7709dee 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
@@ -53,11 +53,18 @@ 
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
 	};
 
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+        wifi_pwrseq: wifi_pwrseq {
+                compatible = "mmc-pwrseq-simple";
+                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+        };
+
 };
 
 &ehci0 {
@@ -105,6 +112,25 @@ 
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_dldo4>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	brcmf: wifi@1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+		interrupt-names = "host-wake";
+	};
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -229,6 +255,13 @@ 
 	status = "okay";
 };
 
+/* Connected to the Bluetooth UART, with hardware handshake pins */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};
+
 &usbphy {
 	status = "okay";
 };