diff mbox series

[v3,2/3] arm: dts: rk3288-tinker.dtsi: Enable WiFi

Message ID 20190309153923.22806-2-beagleboard@davidjohnsummers.uk (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] arm: dts: rk3288-tinker.dtsi: Fix SD card detection | expand

Commit Message

David Summers March 9, 2019, 3:39 p.m. UTC
This patch adds wifi support to the ASUS Tinker Board (S) machines.

This is provided by an wifi card (RTL8723BS) wired into the sdio interface.

It requires certain pins pulled, to enable the WiFi.

The schematics for these board do not show the WiFi connection, so the
connections have been taken from:

https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/rk3288-miniarm.dts

In particular the pulling of two pins.

This patch is almost identical to v1. A few additional line breaks for
readability. On Armbian, they did not use sd-uhs-ddr50, so this has
been removed. It does not change functionality. The ASUS patch set
sd-uhs-sdr104;.

Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Tested-by: Tony McKahan <tonymckahan@gmail.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com> 
Test-by: TheSaint @ ArchLinux ARM 

---
 arch/arm/boot/dts/rk3288-tinker.dtsi | 40 +++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

Comments

Robin Murphy March 11, 2019, 10:18 p.m. UTC | #1
On 2019-03-09 3:39 pm, David Summers wrote:
> This patch adds wifi support to the ASUS Tinker Board (S) machines.
> 
> This is provided by an wifi card (RTL8723BS) wired into the sdio interface.
> 
> It requires certain pins pulled, to enable the WiFi.
> 
> The schematics for these board do not show the WiFi connection, so the
> connections have been taken from:
> 
> https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/rk3288-miniarm.dts
> 
> In particular the pulling of two pins.
> 
> This patch is almost identical to v1. A few additional line breaks for
> readability. On Armbian, they did not use sd-uhs-ddr50, so this has
> been removed. It does not change functionality. The ASUS patch set
> sd-uhs-sdr104;.
> 
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Tested-by: Tony McKahan <tonymckahan@gmail.com>
> Reviewed-by: Robin Murphy <robin.murphy@arm.com>

Erm, I don't think I did... :(

Please see section 13 of Documentation/process/submitting-patches.rst 
for what that tag means.

FWIW this is the kind of patch I might have considered formally 
reviewing if I had enough first-hand experience of the Tinker Board or 
Realtek SDIO modules to judge correctness, but sadly I have zero of either.

Robin.

> Test-by: TheSaint @ ArchLinux ARM
> 
> ---
>   arch/arm/boot/dts/rk3288-tinker.dtsi | 40 +++++++++++++++++++++++++++-
>   1 file changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
> index ef653c3209bc..0ffab1b7c940 100644
> --- a/arch/arm/boot/dts/rk3288-tinker.dtsi
> +++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
> @@ -5,6 +5,7 @@
>   
>   #include "rk3288.dtsi"
>   #include <dt-bindings/input/input.h>
> +#include <dt-bindings/clock/rockchip,rk808.h>
>   
>   / {
>   	chosen {
> @@ -96,6 +97,17 @@
>   		startup-delay-us = <100000>;
>   		vin-supply = <&vcc_io>;
>   	};
> +
> +	sdio_pwrseq: sdio-pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		clocks = <&rk808 RK808_CLKOUT1>;
> +		clock-names = "ext_clock";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wifi_enable>;
> +		reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>,
> +			<&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
> +	};
> +
>   };
>   
>   &cpu0 {
> @@ -336,7 +348,7 @@
>   
>   &io_domains {
>   	status = "okay";
> -
> +	wifi-supply = <&vcc_18>;
>   	sdcard-supply = <&vccio_sd>;
>   };
>   
> @@ -416,6 +428,13 @@
>   			rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
>   		};
>   	};
> +
> +	sdio {
> +		wifi_enable: wifi-enable {
> +			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,
> +				<4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
> +		};
> +	};
>   };
>   
>   &pwm0 {
> @@ -440,6 +459,25 @@
>   	vqmmc-supply = <&vccio_sd>;
>   };
>   
> +&sdio0 {
> +	bus-width = <4>;
> +	cap-sd-highspeed;
> +	cap-sdio-irq;
> +	keep-power-in-suspend;
> +	mmc-pwrseq = <&sdio_pwrseq>;
> +	non-removable;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
> +	max-frequency = <50000000>;
> +	sd-uhs-sdr12;
> +	sd-uhs-sdr25;
> +	sd-uhs-sdr50;
> +	vmmc-supply = <&vcc_io>;
> +	vqmmc-supply = <&vcc_18>;
> +	status = "okay";
> +};
> +
> +
>   &tsadc {
>   	rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
>   	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
>
Heiko Stuebner March 12, 2019, 2:18 p.m. UTC | #2
Am Samstag, 9. März 2019, 16:39:22 CET schrieb David Summers:
> This patch adds wifi support to the ASUS Tinker Board (S) machines.
> 
> This is provided by an wifi card (RTL8723BS) wired into the sdio interface.
> 
> It requires certain pins pulled, to enable the WiFi.
> 
> The schematics for these board do not show the WiFi connection, so the
> connections have been taken from:
> 
> https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/rk3288-miniarm.dts
> 
> In particular the pulling of two pins.
> 
> This patch is almost identical to v1. A few additional line breaks for
> readability. On Armbian, they did not use sd-uhs-ddr50, so this has
> been removed. It does not change functionality. The ASUS patch set
> sd-uhs-sdr104;.
> 
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

trying to understand the relationship here, is that a
"Co-developed-by: Stefan Wahren <...>" case?

Because individual Signed-off-bys would be (1) author, (2) sender
and (3) me and Stefan obviously didn't send the patch :-)

> Tested-by: Tony McKahan <tonymckahan@gmail.com>
> Reviewed-by: Robin Murphy <robin.murphy@arm.com> 
> Test-by: TheSaint @ ArchLinux ARM 

Same comment about Tested-by with an actual name+mail please.

Other than that bit of bureaucracy this looks good, minus some
reordering. If you need to resend for whatever reason, please try to
order devicetree nodes and properties alphabetical if they don't have
an address in the name (otherwise obviously by address).

But I can do that reordering myself and also drop the Review-tag naming
Robin above, if you clear up the "paperwork" above :-).

Heiko
Heiko



> 
> ---
>  arch/arm/boot/dts/rk3288-tinker.dtsi | 40 +++++++++++++++++++++++++++-
>  1 file changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
> index ef653c3209bc..0ffab1b7c940 100644
> --- a/arch/arm/boot/dts/rk3288-tinker.dtsi
> +++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include "rk3288.dtsi"
>  #include <dt-bindings/input/input.h>
> +#include <dt-bindings/clock/rockchip,rk808.h>
>  
>  / {
>  	chosen {
> @@ -96,6 +97,17 @@
>  		startup-delay-us = <100000>;
>  		vin-supply = <&vcc_io>;
>  	};
> +
> +	sdio_pwrseq: sdio-pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		clocks = <&rk808 RK808_CLKOUT1>;
> +		clock-names = "ext_clock";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wifi_enable>;
> +		reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>,
> +			<&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
> +	};
> +
>  };
>  
>  &cpu0 {
> @@ -336,7 +348,7 @@
>  
>  &io_domains {
>  	status = "okay";
> -
> +	wifi-supply = <&vcc_18>;
>  	sdcard-supply = <&vccio_sd>;
>  };
>  
> @@ -416,6 +428,13 @@
>  			rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
>  		};
>  	};
> +
> +	sdio {
> +		wifi_enable: wifi-enable {
> +			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,
> +				<4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
> +		};
> +	};
>  };
>  
>  &pwm0 {
> @@ -440,6 +459,25 @@
>  	vqmmc-supply = <&vccio_sd>;
>  };
>  
> +&sdio0 {
> +	bus-width = <4>;
> +	cap-sd-highspeed;
> +	cap-sdio-irq;
> +	keep-power-in-suspend;
> +	mmc-pwrseq = <&sdio_pwrseq>;
> +	non-removable;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
> +	max-frequency = <50000000>;
> +	sd-uhs-sdr12;
> +	sd-uhs-sdr25;
> +	sd-uhs-sdr50;
> +	vmmc-supply = <&vcc_io>;
> +	vqmmc-supply = <&vcc_18>;
> +	status = "okay";
> +};
> +
> +
>  &tsadc {
>  	rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
>  	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
>
Stefan Wahren March 12, 2019, 2:21 p.m. UTC | #3
Hi Heiko,

Am 12.03.19 um 15:18 schrieb Heiko Stuebner:
> Am Samstag, 9. März 2019, 16:39:22 CET schrieb David Summers:
>> This patch adds wifi support to the ASUS Tinker Board (S) machines.
>>
>> This is provided by an wifi card (RTL8723BS) wired into the sdio interface.
>>
>> It requires certain pins pulled, to enable the WiFi.
>>
>> The schematics for these board do not show the WiFi connection, so the
>> connections have been taken from:
>>
>> https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/rk3288-miniarm.dts
>>
>> In particular the pulling of two pins.
>>
>> This patch is almost identical to v1. A few additional line breaks for
>> readability. On Armbian, they did not use sd-uhs-ddr50, so this has
>> been removed. It does not change functionality. The ASUS patch set
>> sd-uhs-sdr104;.
>>
>> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> trying to understand the relationship here, is that a
> "Co-developed-by: Stefan Wahren <...>" case?

yes it is.

Regards Stefan
David Summers March 12, 2019, 8:41 p.m. UTC | #4
On 11/03/2019 22:18, Robin Murphy wrote:
> On 2019-03-09 3:39 pm, David Summers wrote:
>>
>>
>> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Tested-by: Tony McKahan <tonymckahan@gmail.com>
>> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
>
> Erm, I don't think I did... :(
>
> Please see section 13 of Documentation/process/submitting-patches.rst 
> for what that tag means.
>
> FWIW this is the kind of patch I might have considered formally 
> reviewing if I had enough first-hand experience of the Tinker Board or 
> Realtek SDIO modules to judge correctness, but sadly I have zero of 
> either.
>
> Robin.
>
>> Test-by: TheSaint @ ArchLinux ARM

Apols Robin. I read to much into your understanding of the comments that 
were talked to be added....

Yes Stefan but at least as much, maybe more work into this patch than I 
did. He was the man that made it close to what we could mainline. I only 
added very little, but then again I was also the one pushing for mainlining.

So if only one sign off - Probably Stefan did most.

Heiko: Same question as before do you want me to resend which cleared up 
signoff? Just send me an email - and I'll do whatever is best for you.

David.
Heiko Stuebner March 12, 2019, 8:55 p.m. UTC | #5
Am Dienstag, 12. März 2019, 21:41:24 CET schrieb David Summers:
> On 11/03/2019 22:18, Robin Murphy wrote:
> > On 2019-03-09 3:39 pm, David Summers wrote:
> >> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> >> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> >> Tested-by: Tony McKahan <tonymckahan@gmail.com>
> >> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> > 
> > Erm, I don't think I did... :(
> > 
> > Please see section 13 of Documentation/process/submitting-patches.rst
> > for what that tag means.
> > 
> > FWIW this is the kind of patch I might have considered formally
> > reviewing if I had enough first-hand experience of the Tinker Board or
> > Realtek SDIO modules to judge correctness, but sadly I have zero of
> > either.
> > 
> > Robin.
> > 
> >> Test-by: TheSaint @ ArchLinux ARM
> 
> Apols Robin. I read to much into your understanding of the comments that
> were talked to be added....
> 
> Yes Stefan but at least as much, maybe more work into this patch than I
> did. He was the man that made it close to what we could mainline. I only
> added very little, but then again I was also the one pushing for mainlining.
> 
> So if only one sign off - Probably Stefan did most.

Nope, that was the reason for my Co-developed-by question.
If you look into the submitting patches document there is a special tag
Co-Developed-by to give credit to the author that is not the "patch-from".

And in this case all authors also get a signed-off-by line.

> 
> Heiko: Same question as before do you want me to resend which cleared up
> signoff? Just send me an email - and I'll do whatever is best for you.

As in the other mail, resending for things like that is not necessary in my
case. I just need to hunt down the relevant information as you can see :-D

Heiko
Heiko Stuebner March 13, 2019, 10:50 a.m. UTC | #6
Am Samstag, 9. März 2019, 16:39:22 CET schrieb David Summers:
> This patch adds wifi support to the ASUS Tinker Board (S) machines.
> 
> This is provided by an wifi card (RTL8723BS) wired into the sdio interface.
> 
> It requires certain pins pulled, to enable the WiFi.
> 
> The schematics for these board do not show the WiFi connection, so the
> connections have been taken from:
> 
> https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/
> rk3288-miniarm.dts
> 
> In particular the pulling of two pins.
> 
> This patch is almost identical to v1. A few additional line breaks for
> readability. On Armbian, they did not use sd-uhs-ddr50, so this has
> been removed. It does not change functionality. The ASUS patch set
> sd-uhs-sdr104;.
> 
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Tested-by: Tony McKahan <tonymckahan@gmail.com>
> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> Test-by: TheSaint @ ArchLinux ARM

applied for 5.2 with the following changes:
- adapted subject to match the subsystem
- updated received tags as negotiated yesterday
- reordered some nodes and properties to match general sorting
  (by @address first, otherwise largely alphabetical)

Thanks
Heiko
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index ef653c3209bc..0ffab1b7c940 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -5,6 +5,7 @@ 
 
 #include "rk3288.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/clock/rockchip,rk808.h>
 
 / {
 	chosen {
@@ -96,6 +97,17 @@ 
 		startup-delay-us = <100000>;
 		vin-supply = <&vcc_io>;
 	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk808 RK808_CLKOUT1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_enable>;
+		reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>,
+			<&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
+	};
+
 };
 
 &cpu0 {
@@ -336,7 +348,7 @@ 
 
 &io_domains {
 	status = "okay";
-
+	wifi-supply = <&vcc_18>;
 	sdcard-supply = <&vccio_sd>;
 };
 
@@ -416,6 +428,13 @@ 
 			rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	sdio {
+		wifi_enable: wifi-enable {
+			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,
+				<4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &pwm0 {
@@ -440,6 +459,25 @@ 
 	vqmmc-supply = <&vccio_sd>;
 };
 
+&sdio0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
+	max-frequency = <50000000>;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
+	vmmc-supply = <&vcc_io>;
+	vqmmc-supply = <&vcc_18>;
+	status = "okay";
+};
+
+
 &tsadc {
 	rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
 	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */