2017-07-04 08:13:00

by Frank Wang

[permalink] [raw]
Subject: [PATCH 0/6] add and enable some device nodes for rk3229-evb board

These series add and enable regulators, gpio-keys, eMMC and other device
nodes support for rk3229-evb board.

David Wu (1):
ARM: dts: rockchip: enable io-domain for rk3229-evb

Finley Xiao (1):
ARM: dts: rockchip: add cpu-supply property for cpu node of rk3229-evb

Frank Wang (4):
ARM: dts: rockchip: add regulator nodes for rk3229-evb
ARM: dts: rockchip: enable eMMC for rk3229-evb
ARM: dts: rockchip: enable tsadc for rk3229-evb
ARM: dts: rockchip: add gpio power-key for rk3229-evb

arch/arm/boot/dts/rk3229-evb.dts | 106 +++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)

--
2.0.0



2017-07-04 08:13:04

by Frank Wang

[permalink] [raw]
Subject: [PATCH 2/6] ARM: dts: rockchip: add cpu-supply property for cpu node of rk3229-evb

From: Finley Xiao <[email protected]>

This patch adds the cpu-supply property so that cpu can do dvfs
on rk3229-evb board.

Signed-off-by: Finley Xiao <[email protected]>
---
arch/arm/boot/dts/rk3229-evb.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/rk3229-evb.dts b/arch/arm/boot/dts/rk3229-evb.dts
index 8b10c64..cfa7baa 100644
--- a/arch/arm/boot/dts/rk3229-evb.dts
+++ b/arch/arm/boot/dts/rk3229-evb.dts
@@ -126,6 +126,10 @@
};
};

+&cpu0 {
+ cpu-supply = <&vdd_arm>;
+};
+
&gmac {
assigned-clocks = <&cru SCLK_MAC_EXTCLK>, <&cru SCLK_MAC>;
assigned-clock-parents = <&ext_gmac>, <&cru SCLK_MAC_EXTCLK>;
--
2.0.0


2017-07-04 08:13:09

by Frank Wang

[permalink] [raw]
Subject: [PATCH 3/6] ARM: dts: rockchip: enable io-domain for rk3229-evb

From: David Wu <[email protected]>

This patch enables io-domain support for rk3229-evb board.

The power domain of VCCIO3 is selected from maskrom, so we do not
need to configure it.

Signed-off-by: David Wu <[email protected]>
Signed-off-by: Frank Wang <[email protected]>
---
arch/arm/boot/dts/rk3229-evb.dts | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/rk3229-evb.dts b/arch/arm/boot/dts/rk3229-evb.dts
index cfa7baa..b64f86c 100644
--- a/arch/arm/boot/dts/rk3229-evb.dts
+++ b/arch/arm/boot/dts/rk3229-evb.dts
@@ -146,6 +146,14 @@
status = "okay";
};

+&io_domains {
+ status = "okay";
+
+ vccio1-supply = <&vccio_3v3_reg>;
+ vccio2-supply = <&vccio_1v8_reg>;
+ vccio4-supply = <&vccio_3v3_reg>;
+};
+
&pinctrl {
usb {
host_vbus_drv: host-vbus-drv {
--
2.0.0


2017-07-04 08:13:17

by Frank Wang

[permalink] [raw]
Subject: [PATCH 4/6] ARM: dts: rockchip: enable eMMC for rk3229-evb

This patch enables eMMC support for rk3229-evb board.

Signed-off-by: Frank Wang <[email protected]>
---
arch/arm/boot/dts/rk3229-evb.dts | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/rk3229-evb.dts b/arch/arm/boot/dts/rk3229-evb.dts
index b64f86c..bae0dbf 100644
--- a/arch/arm/boot/dts/rk3229-evb.dts
+++ b/arch/arm/boot/dts/rk3229-evb.dts
@@ -130,6 +130,17 @@
cpu-supply = <&vdd_arm>;
};

+&emmc {
+ broken-cd;
+ bus-width = <8>;
+ cap-mmc-highspeed;
+ supports-emmc;
+ disable-wp;
+ non-removable;
+ num-slots = <1>;
+ status = "okay";
+};
+
&gmac {
assigned-clocks = <&cru SCLK_MAC_EXTCLK>, <&cru SCLK_MAC>;
assigned-clock-parents = <&ext_gmac>, <&cru SCLK_MAC_EXTCLK>;
--
2.0.0


2017-07-04 08:13:43

by Frank Wang

[permalink] [raw]
Subject: [PATCH 1/6] ARM: dts: rockchip: add regulator nodes for rk3229-evb

This patch adds vcc_io, vdd_arm and vdd_log regulator nodes
for rk3229-evb board.

Signed-off-by: Frank Wang <[email protected]>
---
arch/arm/boot/dts/rk3229-evb.dts | 54 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

diff --git a/arch/arm/boot/dts/rk3229-evb.dts b/arch/arm/boot/dts/rk3229-evb.dts
index 82e8a53..8b10c64 100644
--- a/arch/arm/boot/dts/rk3229-evb.dts
+++ b/arch/arm/boot/dts/rk3229-evb.dts
@@ -78,6 +78,52 @@
regulator-always-on;
regulator-boot-on;
};
+
+ vdd_arm: vdd-arm-regulator {
+ compatible = "pwm-regulator";
+ rockchip,pwm_id = <1>;
+ rockchip,pwm_voltage = <1100000>;
+ pwms = <&pwm1 0 25000 1>;
+ regulator-name = "vdd_arm";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_log: vdd-log-regulator {
+ compatible = "pwm-regulator";
+ rockchip,pwm_id = <2>;
+ rockchip,pwm_voltage = <1200000>;
+ pwms = <&pwm2 0 25000 1>;
+ regulator-name = "vdd_log";
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ vccio_1v8_reg: regulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "vccio_1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ vccio_3v3_reg: regulator@1 {
+ compatible = "regulator-fixed";
+ regulator-name = "vccio_3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+ };
};

&gmac {
@@ -104,6 +150,14 @@
};
};

+&pwm1 {
+ status = "okay";
+};
+
+&pwm2 {
+ status = "okay";
+};
+
&uart2 {
status = "okay";
};
--
2.0.0


2017-07-04 08:14:50

by Frank Wang

[permalink] [raw]
Subject: [PATCH 5/6] ARM: dts: rockchip: enable tsadc for rk3229-evb

This patch enables the tsadc for rk3229-evb board.

The rk3229 evb board uses the CRU to reset the chip since it has not
the PMIC to connect it, and TSHUT is low active on evb board.

Signed-off-by: Frank Wang <[email protected]>
---
arch/arm/boot/dts/rk3229-evb.dts | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/rk3229-evb.dts b/arch/arm/boot/dts/rk3229-evb.dts
index bae0dbf..43c3ad2 100644
--- a/arch/arm/boot/dts/rk3229-evb.dts
+++ b/arch/arm/boot/dts/rk3229-evb.dts
@@ -181,6 +181,11 @@
status = "okay";
};

+&tsadc {
+ rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
+ status = "okay";
+};
+
&uart2 {
status = "okay";
};
--
2.0.0


2017-07-04 08:15:10

by Frank Wang

[permalink] [raw]
Subject: [PATCH 6/6] ARM: dts: rockchip: add gpio power-key for rk3229-evb

This patch adds gpio power-key support for rk3229-evb board.

Signed-off-by: Frank Wang <[email protected]>
---
arch/arm/boot/dts/rk3229-evb.dts | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/rk3229-evb.dts b/arch/arm/boot/dts/rk3229-evb.dts
index 43c3ad2..7cfe893 100644
--- a/arch/arm/boot/dts/rk3229-evb.dts
+++ b/arch/arm/boot/dts/rk3229-evb.dts
@@ -124,6 +124,24 @@
regulator-always-on;
};
};
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ autorepeat;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwr_key>;
+
+ power_key: power-key {
+ label = "GPIO Key Power";
+ gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
+ linux,code = <116>;
+ debounce-interval = <100>;
+ wakeup-source;
+ };
+ };
};

&cpu0 {
@@ -166,6 +184,12 @@
};

&pinctrl {
+ keys {
+ pwr_key: pwr-key {
+ rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
usb {
host_vbus_drv: host-vbus-drv {
rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
--
2.0.0


2017-07-04 08:34:15

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: dts: rockchip: add regulator nodes for rk3229-evb

Hi Frank,

Am Dienstag, 4. Juli 2017, 16:12:42 CEST schrieb Frank Wang:
> This patch adds vcc_io, vdd_arm and vdd_log regulator nodes
> for rk3229-evb board.
>
> Signed-off-by: Frank Wang <[email protected]>
> ---
> arch/arm/boot/dts/rk3229-evb.dts | 54
> ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
>
> diff --git a/arch/arm/boot/dts/rk3229-evb.dts
> b/arch/arm/boot/dts/rk3229-evb.dts index 82e8a53..8b10c64 100644
> --- a/arch/arm/boot/dts/rk3229-evb.dts
> +++ b/arch/arm/boot/dts/rk3229-evb.dts
> @@ -78,6 +78,52 @@
> regulator-always-on;
> regulator-boot-on;
> };
> +
> + vdd_arm: vdd-arm-regulator {
> + compatible = "pwm-regulator";
> + rockchip,pwm_id = <1>;
> + rockchip,pwm_voltage = <1100000>;

This doesn't look like a part of the mainline pwm-regulator binding
(both rockchip,* properties)

> + pwms = <&pwm1 0 25000 1>;
> + regulator-name = "vdd_arm";
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-always-on;
> + regulator-boot-on;
> + };

please also add supplies for regulators. Information on supplies
should be easily extractable from the board schematics.

This not only results in a nice tree in debugfs (regulator/regulator_summary)
but also makes sure supplying regulators are not accidentially turned off.
(pwm-supply for pwm-regulators, vin-supply for fixed regulators)


> +
> + vdd_log: vdd-log-regulator {
> + compatible = "pwm-regulator";
> + rockchip,pwm_id = <2>;
> + rockchip,pwm_voltage = <1200000>;
> + pwms = <&pwm2 0 25000 1>;
> + regulator-name = "vdd_log";
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1300000>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + regulators {
> + compatible = "simple-bus";

don't create a subnode/bus for regulators. Just add them
regularly. Take a look at all the other boards (like rk3399-firefly,
gru, veyron) for reference.

> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + vccio_1v8_reg: regulator@0 {

Same here, no regulator@0 please, just name this one
vccio_1v8: vccio-1v8-regulator {

(removed _reg from phandle and changed node name)

> + compatible = "regulator-fixed";
> + regulator-name = "vccio_1v8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-always-on;
> + };
> +
> + vccio_3v3_reg: regulator@1 {
> + compatible = "regulator-fixed";
> + regulator-name = "vccio_3v3";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-always-on;
> + };
> + };
> };


Thanks
Heiko

2017-07-04 08:35:53

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 4/6] ARM: dts: rockchip: enable eMMC for rk3229-evb

Am Dienstag, 4. Juli 2017, 16:12:45 CEST schrieb Frank Wang:
> This patch enables eMMC support for rk3229-evb board.
>
> Signed-off-by: Frank Wang <[email protected]>
> ---
> arch/arm/boot/dts/rk3229-evb.dts | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/boot/dts/rk3229-evb.dts
> b/arch/arm/boot/dts/rk3229-evb.dts index b64f86c..bae0dbf 100644
> --- a/arch/arm/boot/dts/rk3229-evb.dts
> +++ b/arch/arm/boot/dts/rk3229-evb.dts
> @@ -130,6 +130,17 @@
> cpu-supply = <&vdd_arm>;
> };
>
> +&emmc {
> + broken-cd;
> + bus-width = <8>;
> + cap-mmc-highspeed;
> + supports-emmc;
> + disable-wp;
> + non-removable;

non-removable should be enough, so you shouldn't need the broken-cd above?

> + num-slots = <1>;
> + status = "okay";
> +};
> +
> &gmac {
> assigned-clocks = <&cru SCLK_MAC_EXTCLK>, <&cru SCLK_MAC>;
> assigned-clock-parents = <&ext_gmac>, <&cru SCLK_MAC_EXTCLK>;


2017-07-04 09:37:44

by Frank Wang

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: dts: rockchip: add regulator nodes for rk3229-evb

Hi Heiko,

On 2017/7/4 16:34, Heiko Stübner wrote:
> Hi Frank,
>
> Am Dienstag, 4. Juli 2017, 16:12:42 CEST schrieb Frank Wang:
>> This patch adds vcc_io, vdd_arm and vdd_log regulator nodes
>> for rk3229-evb board.
>>
>> Signed-off-by: Frank Wang <[email protected]>
>> ---
>> arch/arm/boot/dts/rk3229-evb.dts | 54
>> ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/rk3229-evb.dts
>> b/arch/arm/boot/dts/rk3229-evb.dts index 82e8a53..8b10c64 100644
>> --- a/arch/arm/boot/dts/rk3229-evb.dts
>> +++ b/arch/arm/boot/dts/rk3229-evb.dts
>> @@ -78,6 +78,52 @@
>> regulator-always-on;
>> regulator-boot-on;
>> };
>> +
>> + vdd_arm: vdd-arm-regulator {
>> + compatible = "pwm-regulator";
>> + rockchip,pwm_id = <1>;
>> + rockchip,pwm_voltage = <1100000>;
> This doesn't look like a part of the mainline pwm-regulator binding
> (both rockchip,* properties)
>
>> + pwms = <&pwm1 0 25000 1>;
>> + regulator-name = "vdd_arm";
>> + regulator-min-microvolt = <950000>;
>> + regulator-max-microvolt = <1400000>;
>> + regulator-always-on;
>> + regulator-boot-on;
>> + };
> please also add supplies for regulators. Information on supplies
> should be easily extractable from the board schematics.
>
> This not only results in a nice tree in debugfs (regulator/regulator_summary)
> but also makes sure supplying regulators are not accidentially turned off.
> (pwm-supply for pwm-regulators, vin-supply for fixed regulators)
>
>
>> +
>> + vdd_log: vdd-log-regulator {
>> + compatible = "pwm-regulator";
>> + rockchip,pwm_id = <2>;
>> + rockchip,pwm_voltage = <1200000>;
>> + pwms = <&pwm2 0 25000 1>;
>> + regulator-name = "vdd_log";
>> + regulator-min-microvolt = <1000000>;
>> + regulator-max-microvolt = <1300000>;
>> + regulator-always-on;
>> + regulator-boot-on;
>> + };
>> +
>> + regulators {
>> + compatible = "simple-bus";
> don't create a subnode/bus for regulators. Just add them
> regularly. Take a look at all the other boards (like rk3399-firefly,
> gru, veyron) for reference.
>
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + vccio_1v8_reg: regulator@0 {
> Same here, no regulator@0 please, just name this one
> vccio_1v8: vccio-1v8-regulator {
>
> (removed _reg from phandle and changed node name)
>
>> + compatible = "regulator-fixed";
>> + regulator-name = "vccio_1v8";
>> + regulator-min-microvolt = <1800000>;
>> + regulator-max-microvolt = <1800000>;
>> + regulator-always-on;
>> + };
>> +
>> + vccio_3v3_reg: regulator@1 {
>> + compatible = "regulator-fixed";
>> + regulator-name = "vccio_3v3";
>> + regulator-min-microvolt = <3300000>;
>> + regulator-max-microvolt = <3300000>;
>> + regulator-always-on;
>> + };
>> + };
>> };

Thanks and noted your comments above. I will fix them (also include
another comment about eMMC in PATCH 4/6 ) and resend these series soon.


BR.
Frank

>
> Thanks
> Heiko
>
>