Skip to contentSkip to conversation

Device Tree for ASUS Tinker Board S [v3]

PATCH New David Summers 3 participants 9 messages Sep 22, 2018 – Oct 15, 2018

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

cover Device Tree for ASUS Tinker Board S [v3]

So third try on these patches, hope these work, git commands are difficult So I hope these work.

The ASUS Tinker Board S : https://www.asus.com/uk/Single-Board-Computer/Tinker-Board-S/

Is a variant on the original ASUS Tinker Board, the main difference being that the "S" has eMMC.

This patchset sets up the device tree for the "S". It is based on the patches used with the debian distribution which ships with the device : https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/rk3288-miniarm.dts

So this is really just mainlining the support.

I've split the changed into three parts:

. This part - just creates a new dts file that is a copy of the tinker board, with just a name change . Changes needed to add the eMMC
It is based on: https://github.com/TinkerBoard/debian_kernel/commit/dc7d4eb4140b4e5ff23aaf2864a56d5c8634f3d0

With the speed change from

https://github.com/TinkerBoard/debian_kernel/commit/4b52627037958bc95ed3f67ff96bbbadbb2bfe07

The patch is relatively straight forward. Only oddity that it seems to be on the sd card slot at &sdmmc; when booting from eMMC and there is no card in the sd slot - then the kernel keeps scanning the sd slot. So it looks like card detect isn't functioning correctly on &sdmmc. This probably wasn't noted on the original Tinker Board, as that had to have a sd card in order to boot. Alas the schematic for the tinker board doesn't show how the sd card is wired ...:

http://dlcdnet.asus.com/pub/ASUS/mb/Linux/Tinker_Board_2GB/Tinker_Board_Schematics.zip
. Changes needed to enable wifi
Its based on: https://github.com/TinkerBoard/debian_kernel/commit/6a3128ade33f758887048578ada61a4b7ab8e678

The changes here are more extensive, basic communication is via sdio0, but can also be seen that connections are set up to the RK808 e.g. the power management chip.

This is the first patch I've done for linux - so if I've got anything wrong, just let me know and I'll correct.

Also any comments you have.

Regards,

David Summers

David Summers (3):
Add the tinker board S to the device tree - just an outline This patch add the eMMC to the ASUS tinker board S This patch adds wifi to asus tinker board S

 .../devicetree/bindings/arm/rockchip.txt      |   4 +
 arch/arm/boot/dts/Makefile                    |   1 +
 arch/arm/boot/dts/rk3288-tinker-s.dts         | 120 +++++
 arch/arm/boot/dts/rk3288-tinker.dts           | 498 +----------------
 arch/arm/boot/dts/rk3288-tinker.dtsi          | 504 ++++++++++++++++++
 5 files changed, 631 insertions(+), 496 deletions(-)
 create mode 100644 arch/arm/boot/dts/rk3288-tinker-s.dts
 create mode 100644 arch/arm/boot/dts/rk3288-tinker.dtsi
Signature · 1 line
David Summers <[email protected]>
#1 lore raw

PATCH 1/3 Add the tinker board S to the device tree - just an outline

---
 .../devicetree/bindings/arm/rockchip.txt      |   4 +
 arch/arm/boot/dts/Makefile                    |   1 +
 arch/arm/boot/dts/rk3288-tinker-s.dts         |  13 +
 arch/arm/boot/dts/rk3288-tinker.dts           | 498 +----------------
 arch/arm/boot/dts/rk3288-tinker.dtsi          | 504 ++++++++++++++++++
 5 files changed, 524 insertions(+), 496 deletions(-)
 create mode 100644 arch/arm/boot/dts/rk3288-tinker-s.dts
 create mode 100644 arch/arm/boot/dts/rk3288-tinker.dtsi
Documentation/devicetree/bindings/arm/rockchip.txt +4 -0
index acfd3c773dd0..037ce94c3a73 100644
@@ -13,6 +13,10 @@ Rockchip platforms device tree bindings
     Required root node properties:
       - compatible = "asus,rk3288-tinker", "rockchip,rk3288";
 
+- Asus Tinker board S
+    Required root node properties:
+      - compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
 - Kylin RK3036 board:
     Required root node properties:
       - compatible = "rockchip,kylin-rk3036", "rockchip,rk3036";
arch/arm/boot/dts/Makefile +1 -0
index b5bd3de87c33..65c75265adfa 100644
@@ -864,6 +864,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 	rk3288-r89.dtb \
 	rk3288-rock2-square.dtb \
 	rk3288-tinker.dtb \
+	rk3288-tinker-s.dtb \	
 	rk3288-veyron-brain.dtb \
 	rk3288-veyron-jaq.dtb \
 	rk3288-veyron-jerry.dtb \
arch/arm/boot/dts/rk3288-tinker-s.dts new file +13 -0
new file mode 100644
index 000000000000..5e1078c6a784
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+
+#include "rk3288-tinker.dtsi"
+
+/ {
+	model = "Rockchip RK3288 Asus Tinker Board S";
+	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+};
arch/arm/boot/dts/rk3288-tinker.dts +2 -496

505 lines not on this page · raw message

arch/arm/boot/dts/rk3288-tinker.dtsi new file +504 -0

504 lines not on this page · raw message

Signature · 1 line
David Summers <[email protected]>
maintainer
#2 lore raw

PATCH 1/3 Add the tinker board S to the device tree - just an outline

On Sat, Sep 22, 2018 at 06:02:34PM +0100, David Summers wrote:

Commit message needed.

Use subject prefixes that match the subsystem. 'dt-bindings: ...' for binding docs. 'ARM: dts: ...' for ARM dts files.

Quoted 3 lines
---
 .../devicetree/bindings/arm/rockchip.txt      |   4 +

Bindings should be a separate patch.

Quoted 7 lines
 arch/arm/boot/dts/Makefile                    |   1 +
 arch/arm/boot/dts/rk3288-tinker-s.dts         |  13 +
 arch/arm/boot/dts/rk3288-tinker.dts           | 498 +----------------
 arch/arm/boot/dts/rk3288-tinker.dtsi          | 504 ++++++++++++++++++
 5 files changed, 524 insertions(+), 496 deletions(-)
 create mode 100644 arch/arm/boot/dts/rk3288-tinker-s.dts
 create mode 100644 arch/arm/boot/dts/rk3288-tinker.dtsi

Would be better to split the dts changes into 2 patches: restructuring and add Tinker S board. Then we're not re-reviewing the existing stuff.

Quoted 36 lines
Documentation/devicetree/bindings/arm/rockchip.txt +4 -0
index acfd3c773dd0..037ce94c3a73 100644
@@ -13,6 +13,10 @@ Rockchip platforms device tree bindings
     Required root node properties:
       - compatible = "asus,rk3288-tinker", "rockchip,rk3288";
 
+- Asus Tinker board S
+    Required root node properties:
+      - compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
 - Kylin RK3036 board:
     Required root node properties:
       - compatible = "rockchip,kylin-rk3036", "rockchip,rk3036";
arch/arm/boot/dts/Makefile +1 -0
index b5bd3de87c33..65c75265adfa 100644
@@ -864,6 +864,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 	rk3288-r89.dtb \
 	rk3288-rock2-square.dtb \
 	rk3288-tinker.dtb \
+	rk3288-tinker-s.dtb \	
 	rk3288-veyron-brain.dtb \
 	rk3288-veyron-jaq.dtb \
 	rk3288-veyron-jerry.dtb \
arch/arm/boot/dts/rk3288-tinker-s.dts new file +2 -0
new file mode 100644
index 000000000000..5e1078c6a784
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*

arch/arm/boot/dts/rk3288-tinker-s.dts line 12

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts new file +10 -0
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+
+#include "rk3288-tinker.dtsi"
+
+/ {
+	model = "Rockchip RK3288 Asus Tinker Board S";
+	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";

Perhaps you should have 'asus,rk3288-tinker' as a fallback?

Quoted 1 line
arch/arm/boot/dts/rk3288-tinker-s.dts new file +1 -0
+};
#3 lore raw

PATCH 1/3 Add the tinker board S to the device tree - just an outline

Quoted 60 lines · Rob Herring

On Sat, Sep 22, 2018 at 06:02:34PM +0100, David Summers wrote:

Commit message needed.

Use subject prefixes that match the subsystem. 'dt-bindings: ...' for binding docs. 'ARM: dts: ...' for ARM dts files.

Quoted 3 lines
---
  .../devicetree/bindings/arm/rockchip.txt      |   4 +

Bindings should be a separate patch.

Quoted 7 lines
  arch/arm/boot/dts/Makefile                    |   1 +
  arch/arm/boot/dts/rk3288-tinker-s.dts         |  13 +
  arch/arm/boot/dts/rk3288-tinker.dts           | 498 +----------------
  arch/arm/boot/dts/rk3288-tinker.dtsi          | 504 ++++++++++++++++++
  5 files changed, 524 insertions(+), 496 deletions(-)

create mode 100644 arch/arm/boot/dts/rk3288-tinker-s.dts create mode 100644 arch/arm/boot/dts/rk3288-tinker.dtsi

Would be better to split the dts changes into 2 patches: restructuring and add Tinker S board. Then we're not re-reviewing the existing stuff.

Quoted 38 lines
Documentation/devicetree/bindings/arm/rockchip.txt +4 -0
index acfd3c773dd0..037ce94c3a73 100644
@@ -13,6 +13,10 @@ Rockchip platforms device tree bindings
      Required root node properties:
        - compatible = "asus,rk3288-tinker", "rockchip,rk3288";
 
+- Asus Tinker board S
+    Required root node properties:
+      - compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
  - Kylin RK3036 board:
      Required root node properties:
        - compatible = "rockchip,kylin-rk3036", "rockchip,rk3036";
arch/arm/boot/dts/Makefile +1 -0
index b5bd3de87c33..65c75265adfa 100644
@@ -864,6 +864,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
  	rk3288-r89.dtb \
  	rk3288-rock2-square.dtb \
  	rk3288-tinker.dtb \
+	rk3288-tinker-s.dtb \	
  	rk3288-veyron-brain.dtb \
  	rk3288-veyron-jaq.dtb \
  	rk3288-veyron-jerry.dtb \
arch/arm/boot/dts/rk3288-tinker-s.dts new file +5 -0
new file mode 100644
index 000000000000..5e1078c6a784
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ */
+
Quoted 10 lines

arch/arm/boot/dts/rk3288-tinker-s.dts line 12

Quoted 7 lines
arch/arm/boot/dts/rk3288-tinker-s.dts new file +7 -0
+/dts-v1/;
+
+#include "rk3288-tinker.dtsi"
+
+/ {
+	model = "Rockchip RK3288 Asus Tinker Board S";
+	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";

Perhaps you should have 'asus,rk3288-tinker' as a fallback?

Quoted 1 line
arch/arm/boot/dts/rk3288-tinker-s.dts new file +1 -0
+};

Hi Rob,

Heiko already had many of the same thoughts, he respan the patch here:

http://lists.infradead.org/pipermail/linux-rockchip/2018-September/021766.html

Which you already reviewed ;)

This was my first attempt at a kernel patch, so your thoughts are appreciated.

David.

P.S. Heiko revised patch accepted into 4.20.

#4 lore raw

PATCH 2/3 This patch add the eMMC to the ASUS tinker board S

In reply to David Summers
---
 arch/arm/boot/dts/rk3288-tinker-s.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/rk3288-tinker-s.dts +14 -0
index 5e1078c6a784..bc691e3f9c07 100644
@@ -11,3 +11,17 @@
 	model = "Rockchip RK3288 Asus Tinker Board S";
 	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
 };
+
+&emmc {
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	disable-wp;
+	non-removable;
+	num-slots = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
+	max-frequency = <150000000>;
+	mmc-hs200-1_8v;
+	mmc-ddr-1_8v;
+	status = "okay";
+};
Signature · 1 line
David Summers <[email protected]>
#5 lore raw

PATCH 3/3 This patch adds wifi to asus tinker board S

In reply to David Summers

Now as fair as I understand. the asus tinker board contains a wifi So should this patch be added to the tinker board dtsi ?

It also far move complex - it adds far more things, so consider

---
 arch/arm/boot/dts/rk3288-tinker-s.dts | 93 +++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)
arch/arm/boot/dts/rk3288-tinker-s.dts +93 -0
index bc691e3f9c07..3d91924fd8db 100644
@@ -10,6 +10,95 @@
 / {
 	model = "Rockchip RK3288 Asus Tinker Board S";
 	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
+	wireless-bluetooth {
+		compatible = "bluetooth-platdata";
+		uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default","rts_gpio";
+		pinctrl-0 = <&uart0_rts>;
+		pinctrl-1 = <&uart0_gpios>;
+		BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
+		BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};
+
+	wireless-wlan {
+		compatible = "wlan-platdata";
+		rockchip,grf = <&grf>;
+		wifi_chip_type = "ap6212";
+		sdio_vref = <1800>;
+		WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};
+
+	io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+		flash0-supply = <&vcc_flash>;
+		gpio30-supply = <&vcc_io>;
+		wifi-supply = <&vcc_18>;
+		sdcard-supply = <&vccio_sd>;
+	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk808 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&chip_enable_h>, <&wifi_enable_h>;
+
+		/*
+		 * On the module itself this is one of these (depending
+		 * on the actual card populated):
+		 * - SDIO_RESET_L_WL_REG_ON
+		 * - PDN (power down when low)
+		 */
+		reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>, <&gpio4 27 GPIO_ACTIVE_LOW>;
+	};
+
+	vcc_flash: flash-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_flash";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_io>;
+	};
+};
+
+&pinctrl {
+	sdio-pwrseq {
+		wifi_enable_h: wifi-enable-h {
+			rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		chip_enable_h: chip-enable-h {
+			rockchip,pins = <4 27 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	wireless-bluetooth {
+		uart0_gpios: uart0-gpios {
+			rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
+&sdio0 {
+	status = "okay";
+	clock-frequency = <50000000>;
+	clock-freq-min-max = <200000 50000000>;
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	disable-wp;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	num-slots = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+	sd-uhs-sdr104;
+	supports-sdio;
 };
 
 &emmc {
@@ -25,3 +114,7 @@
 	mmc-ddr-1_8v;
 	status = "okay";
 };
+
+&uart0 {
+	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
+};
Signature · 1 line
David Summers <[email protected]>
maintainer
#6 lore raw

PATCH 3/3 This patch adds wifi to asus tinker board S

Hi David,

Am Samstag, 22. September 2018, 19:02:36 CEST schrieb David Summers:

Quoted 20 lines

Now as fair as I understand. the asus tinker board contains a wifi So should this patch be added to the tinker board dtsi ?

It also far move complex - it adds far more things, so consider

---
 arch/arm/boot/dts/rk3288-tinker-s.dts | 93 +++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)
arch/arm/boot/dts/rk3288-tinker-s.dts +2 -0
index bc691e3f9c07..3d91924fd8db 100644
@@ -10,6 +10,95 @@
 / {
 	model = "Rockchip RK3288 Asus Tinker Board S";
 	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
+	wireless-bluetooth {

arch/arm/boot/dts/rk3288-tinker-s.dts line 24

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +10 -0
+		compatible = "bluetooth-platdata";
+		uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default","rts_gpio";
+		pinctrl-0 = <&uart0_rts>;
+		pinctrl-1 = <&uart0_gpios>;
+		BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
+		BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};

the basic problem here is, that all these nodes stem from the so called soc-vendor-tree. Devicetree bindings normally go through a review process while soc vendors often invent their own shortcut that is not and will not be supported by the mainline kernel.

Bluetooth-platdata and wlan-platdata are examples of that.

Additionally, the kernel now has the somewhat new "serdev" to manage the needed connection between bluetooth and uart. See
http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf
for an introduction.

Quoted 7 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +7 -0
+	wireless-wlan {
+		compatible = "wlan-platdata";
+		rockchip,grf = <&grf>;
+		wifi_chip_type = "ap6212";
+		sdio_vref = <1800>;
+		WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
+		status = "okay";

arch/arm/boot/dts/rk3288-tinker-s.dts line 42

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +10 -0
+	};
+
+	io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+		flash0-supply = <&vcc_flash>;
+		gpio30-supply = <&vcc_io>;
+		wifi-supply = <&vcc_18>;
+		sdcard-supply = <&vccio_sd>;
+	};

io-domains node is already present in rk3288-tinker.dtsi, so please add additional properties there (compatible + rockchip,grf are not needed)

Quoted 14 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +14 -0
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk808 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&chip_enable_h>, <&wifi_enable_h>;
+
+		/*
+		 * On the module itself this is one of these (depending
+		 * on the actual card populated):
+		 * - SDIO_RESET_L_WL_REG_ON
+		 * - PDN (power down when low)
+		 */

arch/arm/boot/dts/rk3288-tinker-s.dts line 66

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +10 -0
+		reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>, <&gpio4 27 GPIO_ACTIVE_LOW>;
+	};
+
+	vcc_flash: flash-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_flash";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_io>;
+	};

that is a supply for the emmc - so not related to wifi at all, and I don't think that is actually named that way in the device schematics. Please use supply-names as described in the schematics pdf - I'd think Asus should provide one for the dev-board somewhere.

Quoted 7 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +7 -0
+};
+
+&pinctrl {
+	sdio-pwrseq {
+		wifi_enable_h: wifi-enable-h {
+			rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
+		};

arch/arm/boot/dts/rk3288-tinker-s.dts line 83

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +10 -0
+		chip_enable_h: chip-enable-h {
+			rockchip,pins = <4 27 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	wireless-bluetooth {
+		uart0_gpios: uart0-gpios {
+			rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};

not needed

Quoted 23 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +18 -0
+};
+
+&sdio0 {
+	status = "okay";
+	clock-frequency = <50000000>;
+	clock-freq-min-max = <200000 50000000>;
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	disable-wp;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	num-slots = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+	sd-uhs-sdr104;
+	supports-sdio;
 };
 
 &emmc {

arch/arm/boot/dts/rk3288-tinker-s.dts line 120

Quoted 7 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +4 -0
@@ -25,3 +114,7 @@
 	mmc-ddr-1_8v;
 	status = "okay";
 };
+
+&uart0 {
+	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
+};

So ideally, take a look at other Rockchip boards on how they hook up wifi and start small by checking what the &sdio part above actually needs to function, then expand from there.

Heiko

#7 lore raw

Re: [PATCH 3/3] This patch adds wifi to asus tinker board S

Quoted 38 lines · Heiko Stuebner

Hi David,

Am Samstag, 22. September 2018, 19:02:36 CEST schrieb David Summers:

Quoted 20 lines

Now as fair as I understand. the asus tinker board contains a wifi So should this patch be added to the tinker board dtsi ?

It also far move complex - it adds far more things, so consider

---
  arch/arm/boot/dts/rk3288-tinker-s.dts | 93 +++++++++++++++++++++++++++
  1 file changed, 93 insertions(+)
arch/arm/boot/dts/rk3288-tinker-s.dts +2 -0
index bc691e3f9c07..3d91924fd8db 100644
@@ -10,6 +10,95 @@
  / {
  	model = "Rockchip RK3288 Asus Tinker Board S";
  	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
+	wireless-bluetooth {

arch/arm/boot/dts/rk3288-tinker-s.dts line 24

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +10 -0
+		compatible = "bluetooth-platdata";
+		uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default","rts_gpio";
+		pinctrl-0 = <&uart0_rts>;
+		pinctrl-1 = <&uart0_gpios>;
+		BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
+		BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};

the basic problem here is, that all these nodes stem from the so called soc-vendor-tree. Devicetree bindings normally go through a review process while soc vendors often invent their own shortcut that is not and will not be supported by the mainline kernel.

Quoted 6 lines

Bluetooth-platdata and wlan-platdata are examples of that.

Additionally, the kernel now has the somewhat new "serdev" to manage the needed connection between bluetooth and uart. See
http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf
for an introduction.

Sigh - this just got difficult:

https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btrtl.c

Which is the bluetooth driver for Realtek RTL8723BS neither contains the device tree tabs ("static const struct of_device_id") so it can't be referred to in the device tree, nor is it linked in with serdev, so it probably can't go as sub child of uart0.

I'll look at those changes first ...

David

maintainer
#8 lore raw

Re: [PATCH 3/3] This patch adds wifi to asus tinker board S

Am Donnerstag, 11. Oktober 2018, 12:09:51 CEST schrieb David Summers:

Quoted 48 lines · Heiko Stuebner
Quoted 38 lines

Hi David,

Am Samstag, 22. September 2018, 19:02:36 CEST schrieb David Summers:

Quoted 20 lines

Now as fair as I understand. the asus tinker board contains a wifi So should this patch be added to the tinker board dtsi ?

It also far move complex - it adds far more things, so consider

---
  arch/arm/boot/dts/rk3288-tinker-s.dts | 93 +++++++++++++++++++++++++++
  1 file changed, 93 insertions(+)
arch/arm/boot/dts/rk3288-tinker-s.dts +2 -0
index bc691e3f9c07..3d91924fd8db 100644
@@ -10,6 +10,95 @@
  / {
  	model = "Rockchip RK3288 Asus Tinker Board S";
  	compatible = "asus,rk3288-tinker-s", "rockchip,rk3288";
+
+	wireless-bluetooth {

arch/arm/boot/dts/rk3288-tinker-s.dts line 24

Quoted 10 lines
arch/arm/boot/dts/rk3288-tinker-s.dts +10 -0
+		compatible = "bluetooth-platdata";
+		uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default","rts_gpio";
+		pinctrl-0 = <&uart0_rts>;
+		pinctrl-1 = <&uart0_gpios>;
+		BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
+		BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};

the basic problem here is, that all these nodes stem from the so called soc-vendor-tree. Devicetree bindings normally go through a review process while soc vendors often invent their own shortcut that is not and will not be supported by the mainline kernel.

Quoted 6 lines

Bluetooth-platdata and wlan-platdata are examples of that.

Additionally, the kernel now has the somewhat new "serdev" to manage the needed connection between bluetooth and uart. See
http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf
for an introduction.

Sigh - this just got difficult:

Quoted 8 lines

https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btrtl.c

Which is the bluetooth driver for Realtek RTL8723BS neither contains the device tree tabs ("static const struct of_device_id") so it can't be referred to in the device tree, nor is it linked in with serdev, so it probably can't go as sub child of uart0.

I'll look at those changes first ...

or alternatively, take small steps and at first "simply" add the core sdio device that already does the wifi and then later add serdev stuff. I'm also only of limited help here, as while I know that it exists now, so far I haven't had to much contact with it.

Heiko