[PATCH 0/8] ARM: dts: sun8i: Orangepi Plus dts improvements

131 views
Skip to first unread message

Hans de Goede

unread,
Mar 20, 2016, 12:00:47 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com
Hi Maxime and Chen-Yu,

Here is a series with various improvements for the Orangepi Plus dts.
Some (most) of these patches have been submitted before, esp. the USB
ones have multiple revisions before. But I lost count of their version,
so I'm posting this as a "new" set.

About the USB patches, these rely on the patches to add support for
multiple-reset controllers to ohci-platform / ehci-platform. These
patches are all acked up and will go upstream as soon as v4.6-rc1 is
released (they depend on changes which will go into v4.6-rc1).

The old ohci-platform / ehci-platform will only look at the first reset
specified in the dt and as such will fail to load with the new dt nodes
(because they cannot talk to the controller).

I've also included a v6 of Krzysztof Adamski <k...@japko.eu> leds / switches
patch, fixing the comments you had in your review of v5. I've done this
to avoid conflicts with my other patches.

Regards,

Hans

Hans de Goede

unread,
Mar 20, 2016, 12:00:49 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Hans de Goede
Add a pinctrl node for mmc2 in 8 bits mode on H3 SoCs.

Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
arch/arm/boot/dts/sun8i-h3.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index dadb7f6..d1be2f5 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -417,6 +417,16 @@
allwinner,drive = <SUN4I_PINCTRL_30_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
+
+ mmc2_8bit_pins: mmc2_8bit {
+ allwinner,pins = "PC5", "PC6", "PC8",
+ "PC9", "PC10", "PC11",
+ "PC12", "PC13", "PC14",
+ "PC15", "PC16";
+ allwinner,function = "mmc2";
+ allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
};

ahb_rst: reset@01c202c0 {
--
2.7.3

Hans de Goede

unread,
Mar 20, 2016, 12:00:53 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Reinder de Haan, Hans de Goede
From: Reinder de Haan <patch...@mveas.com>

Add a node describing the usb-clks found on the H3.

Signed-off-by: Reinder de Haan <patch...@mveas.com>
Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
arch/arm/boot/dts/sun8i-h3.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index d1be2f5..3a2e6e2 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -269,6 +269,18 @@
"mmc2_sample";
};

+ usb_clk: clk@01c200cc {
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ compatible = "allwinner,sun8i-h3-usb-clk";
+ reg = <0x01c200cc 0x4>;
+ clocks = <&osc24M>;
+ clock-output-names = "usb_phy0", "usb_phy1",
+ "usb_phy2", "usb_phy3",
+ "usb_ohci0", "usb_ohci1",
+ "usb_ohci2", "usb_ohci3";
+ };
+
mbus_clk: clk@01c2015c {
#clock-cells = <0>;
compatible = "allwinner,sun8i-a23-mbus-clk";
--
2.7.3

Hans de Goede

unread,
Mar 20, 2016, 12:00:57 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Reinder de Haan, Hans de Goede
From: Reinder de Haan <patch...@mveas.com>

Add nodes describing the H3's usbphy and usb host controller nodes.

Signed-off-by: Reinder de Haan <patch...@mveas.com>
Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
arch/arm/boot/dts/sun8i-h3.dtsi | 101 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 101 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index 3a2e6e2..4a4926b 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -389,6 +389,107 @@
#size-cells = <0>;
};

+ usbphy: phy@01c19400 {
+ compatible = "allwinner,sun8i-h3-usb-phy";
+ reg = <0x01c19400 0x2c>,
+ <0x01c1a800 0x4>,
+ <0x01c1b800 0x4>,
+ <0x01c1c800 0x4>,
+ <0x01c1d800 0x4>;
+ reg-names = "phy_ctrl",
+ "pmu0",
+ "pmu1",
+ "pmu2",
+ "pmu3";
+ clocks = <&usb_clk 8>,
+ <&usb_clk 9>,
+ <&usb_clk 10>,
+ <&usb_clk 11>;
+ clock-names = "usb0_phy",
+ "usb1_phy",
+ "usb2_phy",
+ "usb3_phy";
+ resets = <&usb_clk 0>,
+ <&usb_clk 1>,
+ <&usb_clk 2>,
+ <&usb_clk 3>;
+ reset-names = "usb0_reset",
+ "usb1_reset",
+ "usb2_reset",
+ "usb3_reset";
+ status = "disabled";
+ #phy-cells = <1>;
+ };
+
+ ehci1: usb@01c1b000 {
+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+ reg = <0x01c1b000 0x100>;
+ interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bus_gates 25>, <&bus_gates 29>;
+ resets = <&ahb_rst 25>, <&ahb_rst 29>;
+ phys = <&usbphy 1>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
+ ohci1: usb@01c1b400 {
+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+ reg = <0x01c1b400 0x100>;
+ interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bus_gates 29>, <&bus_gates 25>,
+ <&usb_clk 17>;
+ resets = <&ahb_rst 29>, <&ahb_rst 25>;
+ phys = <&usbphy 1>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
+ ehci2: usb@01c1c000 {
+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+ reg = <0x01c1c000 0x100>;
+ interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bus_gates 26>, <&bus_gates 30>;
+ resets = <&ahb_rst 26>, <&ahb_rst 30>;
+ phys = <&usbphy 2>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
+ ohci2: usb@01c1c400 {
+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+ reg = <0x01c1c400 0x100>;
+ interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bus_gates 30>, <&bus_gates 26>,
+ <&usb_clk 18>;
+ resets = <&ahb_rst 30>, <&ahb_rst 26>;
+ phys = <&usbphy 2>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
+ ehci3: usb@01c1d000 {
+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+ reg = <0x01c1d000 0x100>;
+ interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bus_gates 27>, <&bus_gates 31>;
+ resets = <&ahb_rst 27>, <&ahb_rst 31>;
+ phys = <&usbphy 3>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
+ ohci3: usb@01c1d400 {
+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+ reg = <0x01c1d400 0x100>;
+ interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bus_gates 31>, <&bus_gates 27>,
+ <&usb_clk 19>;
+ resets = <&ahb_rst 31>, <&ahb_rst 27>;
+ phys = <&usbphy 3>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
pio: pinctrl@01c20800 {
compatible = "allwinner,sun8i-h3-pinctrl";
reg = <0x01c20800 0x400>;
--
2.7.3

Hans de Goede

unread,
Mar 20, 2016, 12:01:02 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Jens Kuske, Reinder de Haan, Hans de Goede
From: Jens Kuske <jens...@gmail.com>

Enable the 2 USB host controllers used on the Orange Pi Plus
and add the necessary regulators.

Signed-off-by: Reinder de Haan <patch...@mveas.com>
Signed-off-by: Hans de Goede <hdeg...@redhat.com>
Signed-off-by: Jens Kuske <jens...@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 44 ++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
index e67df59..1cb6c66 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -58,6 +58,35 @@
chosen {
stdout-path = "serial0:115200n8";
};
+
+ reg_usb3_vbus: usb3-vbus {
+ compatible = "regulator-fixed";
+ pinctrl-names = "default";
+ pinctrl-0 = <&usb3_vbus_pin_a>;
+ regulator-name = "usb3-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ enable-active-high;
+ gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
+ };
+};
+
+&ehci1 {
+ status = "okay";
+};
+
+&ehci3 {
+ status = "okay";
+};
+
+&pio {
+ usb3_vbus_pin_a: usb3_vbus_pin@0 {
+ allwinner,pins = "PG11";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
};

&mmc0 {
@@ -70,8 +99,23 @@
status = "okay";
};

+&reg_usb1_vbus {
+ gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
};
+
+&usb1_vbus_pin_a {
+ allwinner,pins = "PG13";
+};
+
+&usbphy {
+ usb1_vbus-supply = <&reg_usb1_vbus>;
+ usb3_vbus-supply = <&reg_usb3_vbus>;
+ status = "okay";
+};
--
2.7.3

Hans de Goede

unread,
Mar 20, 2016, 12:01:06 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Hans de Goede
Enable the ir receiver found on the orangepi plus board.

Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
index 1cb6c66..a680b1f 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -80,6 +80,12 @@
status = "okay";
};

+&ir {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ir_pins_a>;
+ status = "okay";
+};
+
&pio {
usb3_vbus_pin_a: usb3_vbus_pin@0 {
allwinner,pins = "PG11";
--
2.7.3

Hans de Goede

unread,
Mar 20, 2016, 12:01:09 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Hans de Goede
From: Krzysztof Adamski <k...@japko.eu>

OrangePi Plus board has two leds - green ("pwr") and red ("status")
and two switches ("sw4" and "sw2"). This patch describes them in
devicetree.

Signed-off-by: Krzysztof Adamski <k...@japko.eu>
Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
Changes in v6 (hdegoede):
-Merge leds and r_leds nodes into one
-Fix led labels to be in <board>:<colour>:<role> form
-Alphabetically sort the added nodes
-Add support for sw2 (this is the small reset-like button)
---
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
index a680b1f..a7cdfd0 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -45,6 +45,7 @@
#include "sunxi-common-regulators.dtsi"

#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/sun4i-a10.h>

/ {
@@ -59,6 +60,43 @@
stdout-path = "serial0:115200n8";
};

+ gpio_keys {
+ compatible = "gpio-keys";
+ input-name = "sw4";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&sw_r_opc>;
+
+ sw2@0 {
+ label = "sw2";
+ linux,code = <BTN_1>;
+ gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>;
+ };
+
+ sw4@0 {
+ label = "sw4";
+ linux,code = <BTN_0>;
+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+ pinctrl-names = "default";
+ pinctrl-0 = <&leds_opc>, <&leds_r_opc>;
+
+ status_led {
+ label = "orangepi-plus:red:status";
+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
+ };
+
+ pwr_led {
+ label = "orangepi-plus:green:pwr";
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+ };
+
reg_usb3_vbus: usb3-vbus {
compatible = "regulator-fixed";
pinctrl-names = "default";
@@ -72,6 +110,31 @@
};
};

+&pio {
+ leds_opc: led_pins@0 {
+ allwinner,pins = "PA15";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+};
+
+&r_pio {
+ leds_r_opc: led_pins@0 {
+ allwinner,pins = "PL10";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+
+ sw_r_opc: key_pins@0 {
+ allwinner,pins = "PL03", "PL04";
+ allwinner,function = "gpio_in";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+};
+
&ehci1 {
status = "okay";
};
--
2.7.3

Hans de Goede

unread,
Mar 20, 2016, 12:01:13 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Hans de Goede
The Orangepi Plus and Orangepi Plus 2 have a realtek rtl8189etv sdio
wifi chip. This commit adds a device-tree node to power it up, so
that the mmc subsys can scan it, and enables the mmc controller which
is connected to it.

Note that this just makes the wifi controller show up as a sdio device.
In order for it to work a compatible sdio driver is necessary, an out
of tree driver is available here:
https://github.com/jwrdegoede/rtl8189ES_linux/

Binding the driver is not done through device tree, but through sdio
vendor- and device-id, so it can safely be enabled in devicetree
without having a driver upstream yet.

Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
index a7cdfd0..f5aa694 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -108,6 +108,13 @@
enable-active-high;
gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
};
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ pinctrl-names = "default";
+ pinctrl-0 = <&wifi_pwrseq_pin_orangepi>;
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 WIFI_EN */
+ };
};

&pio {
@@ -156,6 +163,13 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
+
+ wifi_pwrseq_pin_orangepi: wifi_pwrseq_pin@0 {
+ allwinner,pins = "PL7";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
};

&mmc0 {
@@ -168,6 +182,16 @@
status = "okay";
};

+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins_a>;
+ vmmc-supply = <&reg_vcc3v3>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+};
+
&reg_usb1_vbus {
gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;

Hans de Goede

unread,
Mar 20, 2016, 12:01:17 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Hans de Goede
The Orangepi Plus has a 16GB eMMC, the vcc, the lack of pull-ups and
the use of the hw-reset pin have all been verified with the board
schematic.

With this dts node for mmc2, the eMMC runs at the following ios settings:
clock: 52000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 3 (8 bits)
timing spec: 8 (mmc DDR52)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)

Note the mmcblk1boot0/boot1 partitions are unused as the BROM will load
the SPL from 8k from the start of the main blockdev, just as with a
regular sdcard in mmc0.

Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
index f5aa694..7129aff 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -192,6 +192,23 @@
status = "okay";
};

+&mmc2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc2_8bit_pins>;
+ vmmc-supply = <&reg_vcc3v3>;
+ bus-width = <8>;
+ non-removable;
+ cap-mmc-hw-reset;
+ status = "okay";
+};
+
+&mmc2_8bit_pins {
+ /* Increase drive strength for DDR modes */
+ allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+ /* eMMC is missing pull-ups */
+ allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;

Chen-Yu Tsai

unread,
Mar 20, 2016, 12:05:32 PM3/20/16
to Hans de Goede, Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-arm-kernel, devicetree, linux-sunxi
Hi,

On Mon, Mar 21, 2016 at 12:00 AM, Hans de Goede <hdeg...@redhat.com> wrote:
> Hi Maxime and Chen-Yu,
>
> Here is a series with various improvements for the Orangepi Plus dts.
> Some (most) of these patches have been submitted before, esp. the USB
> ones have multiple revisions before. But I lost count of their version,
> so I'm posting this as a "new" set.
>
> About the USB patches, these rely on the patches to add support for
> multiple-reset controllers to ohci-platform / ehci-platform. These
> patches are all acked up and will go upstream as soon as v4.6-rc1 is
> released (they depend on changes which will go into v4.6-rc1).

Does this mean you or I can send the Orange Pi PC DTS patch?

Thanks
ChenYu

Hans de Goede

unread,
Mar 20, 2016, 2:41:57 PM3/20/16
to Chen-Yu Tsai, Maxime Ripard, Krzysztof Adamski, linux-arm-kernel, devicetree, linux-sunxi
Hi,

On 20-03-16 17:05, Chen-Yu Tsai wrote:
> Hi,
>
> On Mon, Mar 21, 2016 at 12:00 AM, Hans de Goede <hdeg...@redhat.com> wrote:
>> Hi Maxime and Chen-Yu,
>>
>> Here is a series with various improvements for the Orangepi Plus dts.
>> Some (most) of these patches have been submitted before, esp. the USB
>> ones have multiple revisions before. But I lost count of their version,
>> so I'm posting this as a "new" set.
>>
>> About the USB patches, these rely on the patches to add support for
>> multiple-reset controllers to ohci-platform / ehci-platform. These
>> patches are all acked up and will go upstream as soon as v4.6-rc1 is
>> released (they depend on changes which will go into v4.6-rc1).
>
> Does this mean you or I can send the Orange Pi PC DTS patch?

Yes, I was planning on submitting a v2 of it shortly, with support
for IR and the LEDs / buttons added.

Regards,

Hans

p.s.

I just noticed a problem with the pinctrl node in
"Add leds and switches on Orangepi Plus boards"
patch, causing the following to show up in dmesg:

[ 1.569702] sun8i-h3-r-pinctrl 1f02c00.pinctrl: unknown pin PL03
[ 1.575741] sun8i-h3-r-pinctrl 1f02c00.pinctrl: unknown pin PL04

I'll submit a v7 soon, this replaces the one from this set, and should
be applied in the same order as the v6

Hans de Goede

unread,
Mar 20, 2016, 2:55:11 PM3/20/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com, Hans de Goede
From: Krzysztof Adamski <k...@japko.eu>

OrangePi Plus board has two leds - green ("pwr") and red ("status")
and two switches ("sw4" and "sw2"). This patch describes them in
devicetree.

Signed-off-by: Krzysztof Adamski <k...@japko.eu>
Signed-off-by: Hans de Goede <hdeg...@redhat.com>
---
Changes in v6 (hdegoede):
-Merge leds and r_leds nodes into one
-Fix led labels to be in <board>:<colour>:<role> form
-Alphabetically sort the added nodes
-Add support for sw2 (this is the small reset-like button)
Changes in v7 (hdegoede):
-Use PL3 / PL4 in the pinctrl node, not PL03 / PL04
---
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
index a680b1f..9d8c038 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
@@ -45,6 +45,7 @@
#include "sunxi-common-regulators.dtsi"

#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/sun4i-a10.h>

/ {
@@ -59,6 +60,43 @@
stdout-path = "serial0:115200n8";
};

+ gpio_keys {
+ compatible = "gpio-keys";
+ input-name = "sw4";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&sw_r_opc>;
+
+ sw2@0 {
+ label = "sw2";
+ linux,code = <BTN_1>;
+ gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>;
+ };
+
+ sw4@0 {
+ label = "sw4";
+ linux,code = <BTN_0>;
+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+ pinctrl-names = "default";
+ pinctrl-0 = <&leds_opc>, <&leds_r_opc>;
+
+ status_led {
+ label = "orangepi-plus:red:status";
+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
+ };
+
+ pwr_led {
+ label = "orangepi-plus:green:pwr";
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+ };
+
reg_usb3_vbus: usb3-vbus {
compatible = "regulator-fixed";
pinctrl-names = "default";
@@ -72,6 +110,31 @@
};
};

+&pio {
+ leds_opc: led_pins@0 {
+ allwinner,pins = "PA15";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+};
+
+&r_pio {
+ leds_r_opc: led_pins@0 {
+ allwinner,pins = "PL10";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+
+ sw_r_opc: key_pins@0 {
+ allwinner,pins = "PL3", "PL4";
+ allwinner,function = "gpio_in";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+};
+
&ehci1 {

Maxime Ripard

unread,
Mar 21, 2016, 3:59:32 AM3/21/16
to Hans de Goede, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com
Hi,

On Sun, Mar 20, 2016 at 07:55:02PM +0100, Hans de Goede wrote:
> From: Krzysztof Adamski <k...@japko.eu>
>
> OrangePi Plus board has two leds - green ("pwr") and red ("status")
> and two switches ("sw4" and "sw2"). This patch describes them in
> devicetree.
>
> Signed-off-by: Krzysztof Adamski <k...@japko.eu>
> Signed-off-by: Hans de Goede <hdeg...@redhat.com>

An earlier version has already been sent for 4.6, please base your
changes on top of this one.

And there's a bunch of things I didn't catch at that time :/
This is an undocumented (and apparently unused) property

> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&sw_r_opc>;
> +
> + sw2@0 {

You shouldn't have a unit-address here

> + label = "sw2";
> + linux,code = <BTN_1>;
> + gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>;
> + };
> +
> + sw4@0 {

Ditto.

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
signature.asc

Maxime Ripard

unread,
Mar 21, 2016, 4:03:50 AM3/21/16
to Hans de Goede, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com
Applied all but patch 6, which was in already.
signature.asc

Hans de Goede

unread,
Mar 21, 2016, 7:57:55 AM3/21/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com
Hi,

On 21-03-16 08:59, Maxime Ripard wrote:
> Hi,
>
> On Sun, Mar 20, 2016 at 07:55:02PM +0100, Hans de Goede wrote:
>> From: Krzysztof Adamski <k...@japko.eu>
>>
>> OrangePi Plus board has two leds - green ("pwr") and red ("status")
>> and two switches ("sw4" and "sw2"). This patch describes them in
>> devicetree.
>>
>> Signed-off-by: Krzysztof Adamski <k...@japko.eu>
>> Signed-off-by: Hans de Goede <hdeg...@redhat.com>
>
> An earlier version has already been sent for 4.6, please base your
> changes on top of this one.

Ah, I missed that one because it is not in your for-next branch!

It is only in sunxi-dt-for-4.6.

> And there's a bunch of things I didn't catch at that time :/

I'll cherry-pick the patch you've in sunxi-dt-for-4.6 into
my tree and send a fixup patch to apply on top.

Regards,

Hans

Hans de Goede

unread,
Mar 21, 2016, 6:16:17 PM3/21/16
to Maxime Ripard, Chen-Yu Tsai, Krzysztof Adamski, linux-ar...@lists.infradead.org, devicetree, linux...@googlegroups.com
Hi,

On 21-03-16 08:59, Maxime Ripard wrote:
> Hi,
>
> On Sun, Mar 20, 2016 at 07:55:02PM +0100, Hans de Goede wrote:
>> From: Krzysztof Adamski <k...@japko.eu>
>>
>> OrangePi Plus board has two leds - green ("pwr") and red ("status")
>> and two switches ("sw4" and "sw2"). This patch describes them in
>> devicetree.
>>
>> Signed-off-by: Krzysztof Adamski <k...@japko.eu>
>> Signed-off-by: Hans de Goede <hdeg...@redhat.com>
>
> An earlier version has already been sent for 4.6, please base your
> changes on top of this one.
>
> And there's a bunch of things I didn't catch at that time :/

As promised I will send a fixup patch for this, I was wondering
if you can push your current queue, where you've already merged
my other orangepi-plus patches somewhere, so that I can base this
fixup patch on top of it ?

Regards,

Hans
Reply all
Reply to author
Forward
0 new messages