mbox series

[0/3] Device Tree for ASUS Tinker Board S [v3]

Message ID 20180922170236.8690-1-beagleboard@davidjohnsummers.uk
Headers show
Series Device Tree for ASUS Tinker Board S [v3] | expand

Message

David Summers Sept. 22, 2018, 5:02 p.m. UTC
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

Comments

Heiko Stuebner Oct. 8, 2018, 9:30 a.m. UTC | #1
Hi David,

Am Samstag, 22. September 2018, 19:02:36 CEST schrieb 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
> 
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> ---
>  arch/arm/boot/dts/rk3288-tinker-s.dts | 93 +++++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/rk3288-tinker-s.dts b/arch/arm/boot/dts/rk3288-tinker-s.dts
> index bc691e3f9c07..3d91924fd8db 100644
> --- a/arch/arm/boot/dts/rk3288-tinker-s.dts
> +++ b/arch/arm/boot/dts/rk3288-tinker-s.dts
> @@ -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";
> +	};

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.


> +	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>;
> +	};

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

> +
> +	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>;
> +	};

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.


> +};
> +
> +&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>;
> +		};
> +	};

not needed

> +};
> +
> +&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>;
> +};
> 

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