Device-tree improvements

This is for any ARMv7 device that we do not officially support.

Re: Device-tree improvements

Postby summers » Mon Feb 11, 2019 10:39 am

lgb3 worked! Changes bewteen lgb2 and lgb3 were very minor - I'll post this evening when I get home!

and so did dj2 - with the simplified power.

I'll post what the changes were when i get home - and also do a draft for submission to mainline, so lgb can review.

Think we may have cracked this as well as we can. Pity that bluetooth doesnt't work, think larry finger may be the man to contact ...
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby summers » Mon Feb 11, 2019 8:32 pm

the diff between lgb2 and lgb3 is:
$this->bbcode_second_pass_code('', '--- rk3288-tinker.dtsi.lgb2 2019-02-09 15:34:00.560361929 +0000
+++ rk3288-tinker.dtsi.lgb3 2019-02-09 16:39:23.694340303 +0000
@@ -104,7 +104,7 @@
clock-names = "ext_clock";
pinctrl-names = "default";
pinctrl-0 = <&wifi_enable>;
- reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
+ reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>, <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
};

vbat_wl: wifi-regulator {
@@ -353,6 +353,7 @@

&io_domains {
wifi-supply = <&vcc_18>;
+ status = "okay";
};

&pinctrl {
@@ -471,7 +472,7 @@
non-removable;
pinctrl-names = "default";
pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
- max-frequency = <50000000>;
+ clock-frequency = <50000000>;
sd-uhs-sdr12;
sd-uhs-sdr25;
sd-uhs-sdr50;
')
I don't think its the clock frequency (I'll revert that having read mmc docs - not that this is mmc).

Of the others io_domains in rk3288.dtsi is defined as disabled, asus patch doesn't mention it - but I thought I'd try enabling.

the reset-gpios is what asus has (with numbers). I'll try and check if its the two wins through to bluetooth and wifi reset? The datasheet says something about the chip is disabled if both pins are pulled ... This is the relevent patch https://github.com/TinkerBoard/debian_kernel/commit/33085685b4506e3b1a03c275a1eb9561249659c0
Last edited by summers on Tue Feb 12, 2019 11:00 am, edited 1 time in total.
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby summers » Mon Feb 11, 2019 8:37 pm

and the diff between lgb3 and djs2
$this->bbcode_second_pass_code('', '--- rk3288-tinker.dtsi.djs2 2019-02-09 17:05:49.974313799 +0000
+++ rk3288-tinker.dtsi.lgb3 2019-02-09 16:39:23.694340303 +0000
@@ -106,6 +106,14 @@
pinctrl-0 = <&wifi_enable>;
reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>, <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
};
+
+ vbat_wl: wifi-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vbat_wl";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&vcc_io>;
+ };
};

&cpu0 {
@@ -469,7 +477,7 @@
sd-uhs-sdr25;
sd-uhs-sdr50;
sd-uhs-ddr50;
- vmmc-supply = <&vcc_io>;
+ vmmc-supply = <&vbat_wl>;
vqmmc-supply = <&vcc_18>;
status = "okay";
};
')
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Tue Feb 12, 2019 12:56 pm

I still in love with tinkerS, but I may go for your newer dtb ;)
So what are the major differences between these two. Well, I suppose it's mostly the dtsi given by Asus.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Tue Feb 12, 2019 1:22 pm

I've a few more changes to make, minor on the whole - but necessary for mainlining. Hopefully do this evening.

I'll then do a final dtb for testing to check it works?

@TheSaint and @lgb - what do do with signing on the patch.

What I'd like to do is give @lgb a sign off line using us i2se email address. And give @TheSaint a TestedBy signoff, but use what email?

Now as when a patch goes out this makes your email go public, need to check if you are both happy with this. Let me know.
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby lategoodbye » Tue Feb 12, 2019 6:22 pm

Hi,

good job. Here are my comments about dts delta.

$this->bbcode_second_pass_quote('', '
')I don't think its the clock frequency (I'll revert that having read mmc docs - not that this is mmc).


Please keep the max-frequency because it marks the interface to not use a higher frequency which could cause data loss.

$this->bbcode_second_pass_quote('', '
')Of the others io_domains in rk3288.dtsi is defined as disabled, asus patch doesn't mention it - but I thought I'd try enabling.


I didn't enabled io_domains in my patch because in my kernel version (mainline 4.20) it is already enabled in the rk3288-tinker.dtsi. What kernel tree / version did you use?

$this->bbcode_second_pass_quote('', '
')the reset-gpios is what asus has (with numbers). I'll try and check if its the two wins through to bluetooth and wifi reset? The datasheet says something about the chip is disabled if both pins are pulled ... This is the relevent patch https://github.com/TinkerBoard/debian_k ... 61249659c0


I've never see this second gpio, in the other ASUS patch. So i can assume this also never worked alone?

Before we can send patch for mainline support, we need to identify the node which actually enabled wifi (2nd GPIO, io-domains enabled or both of them). I'm fine to drop the vbat regulator.

@summers You could add my Sob, but keep in mind to add yours, too.
lategoodbye
 
Posts: 124
Joined: Sat Dec 29, 2018 1:24 am
Top

Re: Device-tree improvements

Postby summers » Tue Feb 12, 2019 8:10 pm

@lgb

thanks for the comments.

Yes reverting to max-frequency. Need to check where I got clock-frequency from - I certainly had a source!

OOps I must have deleted the original &io_domains in -tinker.dtsi, when I copied your code across. Thats my mistake - I've now corrected it.

I think this means we are almost 100% sure that its the second GPIO that needs enabling, so yes it suggests that the original patch didn't work. I found it by browsing the current miniarm.dts : https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/rk3288-miniarm.dts, then traced back to the patch that added. I going to add the other code in that patch as well - just to keep it consistent.

Yes I do a dtb with each of those two separately just to confirm its the GPIO problem.

Thanks for the signoff, as much as anything want you to get credit - as you've put as much effort into this as I!
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby summers » Tue Feb 12, 2019 8:22 pm

OK final patch against 4.20 is
$this->bbcode_second_pass_code('', '--- rk3288-tinker.dtsi.orig 2019-02-03 10:52:31.795533996 +0000
+++ rk3288-tinker.dtsi 2019-02-12 20:19:35.269839459 +0000
@@ -5,6 +5,7 @@

#include "rk3288.dtsi"
#include <dt-bindings/input/input.h>
+#include <dt-bindings/clock/rockchip,rk808.h>

/ {
chosen {
@@ -96,6 +97,15 @@
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 = <&chip_enable>, <&wifi_enable>;
+ reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>, <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
+ };
};

&cpu0 {
@@ -335,7 +345,7 @@

&io_domains {
status = "okay";
-
+ wifi-supply = <&vcc_18>;
sdcard-supply = <&vccio_sd>;
};

@@ -415,6 +425,16 @@
rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
+
+ sdio {
+ chip_enable: chip-enable {
+ rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ wifi_enable: wifi-enable {
+ rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
};

&pwm0 {
@@ -430,8 +450,8 @@
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
- card-detect-delay = <200>;
- disable-wp; /* wp not hooked up */
+ disable-wp;
+ broken-cd;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
status = "okay";
@@ -439,6 +459,26 @@
vqmmc-supply = <&vccio_sd>;
};

+&sdio0 {
+ bus-width = <4>;
+ cap-sd-highspeed;
+ cap-sdio-irq;
+ disable-wp;
+ 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;
+ sd-uhs-ddr50;
+ 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 */
@@ -447,6 +487,17 @@

&uart0 {
status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
+
+ bluetooth {
+ clocks = <&rk808 RK808_CLKOUT1>;
+ reset-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_LOW>;
+ device-wake-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+ host-wake-gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;
+ vcc-18-supply = <&vcc_18>;
+ vcc-io-supply = <&vcc_io>;
+ };
};

&uart1 {
')
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby summers » Tue Feb 12, 2019 8:39 pm

OK hopefully the final set of dtb to test: http://davidjohnsummers.uk/TBSnew3.tar.gz

The one without and ending is hopefuly the final one - its what the patch above gives.

no_chip doesn't pull the pin before enabling the wifi.

no-iod sets the io_domains to disabled.
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby lategoodbye » Tue Feb 12, 2019 10:19 pm

Just some notes to the devicetree patch before sending to the linux mailing list:
- try to avoid whitespace changes
- put the pinctrl for the enable pins into the same group wifi-enable
- avoid unrelated changes like this disable-wp stuff on the other mmc interface
- split bluetooth and wifi into separate patches this make review much easier
- keep the comment about the 2 wifi-enable pins from the ASUS patch
lategoodbye
 
Posts: 124
Joined: Sat Dec 29, 2018 1:24 am

PreviousNext

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 34 guests