linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port
@ 2020-05-28 20:47 Diego Rondini
  2020-05-28 20:47 ` [PATCH 2/2] ARM: dts: orange-pi-zero-plus2: add leds configuration Diego Rondini
  2020-06-15  8:12 ` [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port Maxime Ripard
  0 siblings, 2 replies; 4+ messages in thread
From: Diego Rondini @ 2020-05-28 20:47 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Rob Herring, Chen-Yu Tsai, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, Diego Rondini

Enable support for USB OTG port on Orange Pi Zero Plus 2 (both H3 and H5
variants). As, according to the board schematics, the USB OTG port cannot
provide power to external devices, we set dr_mode to peripheral.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
---
 .../boot/dts/sun8i-h3-orangepi-zero-plus2.dts | 23 +++++++++++++++++++
 .../sun50i-h5-orangepi-zero-plus2.dts         | 23 +++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
index b8f46e2802fd3..4376767699a47 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
@@ -137,3 +137,26 @@ &uart0 {
 	pinctrl-0 = <&uart0_pa_pins>;
 	status = "okay";
 };
+
+&usbphy {
+	status = "okay";
+};
+
+&usb_otg {
+	/*
+	 * According to schematics CN1 MicroUSB port can be used to take
+	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
+	 * port cannot provide power externally even if the board is powered
+	 * via GPIO pins. It thus makes sense to force peripheral mode.
+	 */
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index c95a68541309c..d8192a7483e9e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -103,3 +103,26 @@ &uart1 {
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
 	status = "okay";
 };
+
+&usbphy {
+	status = "okay";
+};
+
+&usb_otg {
+	/*
+	 * According to schematics CN1 MicroUSB port can be used to take
+	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
+	 * port cannot provide power externally even if the board is powered
+	 * via GPIO pins. It thus makes sense to force peripheral mode.
+	 */
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ARM: dts: orange-pi-zero-plus2: add leds configuration
  2020-05-28 20:47 [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port Diego Rondini
@ 2020-05-28 20:47 ` Diego Rondini
  2020-06-15  8:14   ` Maxime Ripard
  2020-06-15  8:12 ` [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port Maxime Ripard
  1 sibling, 1 reply; 4+ messages in thread
From: Diego Rondini @ 2020-05-28 20:47 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Rob Herring, Chen-Yu Tsai, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, Diego Rondini

Add pwr and status leds configuration and turn on pwr led by default for Orange
Pi Zero Plus 2 (both H3 and H5 variants).

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
---
 .../boot/dts/sun8i-h3-orangepi-zero-plus2.dts    | 16 ++++++++++++++++
 .../allwinner/sun50i-h5-orangepi-zero-plus2.dts  | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
index 4376767699a47..4cd0ac706bd2c 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
@@ -82,6 +82,22 @@ wifi_pwrseq: wifi_pwrseq {
 		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
 		post-power-on-delay-ms = <200>;
 	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		pwr_led {
+			label = "orangepi:green:pwr";
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		status_led {
+			label = "orangepi:red:status";
+			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+		};
+
+	};
 };
 
 &de {
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index d8192a7483e9e..517d53e1b0ff1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -42,6 +42,22 @@ wifi_pwrseq: wifi_pwrseq {
 		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
 		post-power-on-delay-ms = <200>;
 	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		pwr_led {
+			label = "orangepi:green:pwr";
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		status_led {
+			label = "orangepi:red:status";
+			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+		};
+
+	};
 };
 
 &de {
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port
  2020-05-28 20:47 [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port Diego Rondini
  2020-05-28 20:47 ` [PATCH 2/2] ARM: dts: orange-pi-zero-plus2: add leds configuration Diego Rondini
@ 2020-06-15  8:12 ` Maxime Ripard
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2020-06-15  8:12 UTC (permalink / raw)
  To: Diego Rondini
  Cc: Rob Herring, Chen-Yu Tsai, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 2704 bytes --]

Hi Diego,

On Thu, May 28, 2020 at 10:47:11PM +0200, Diego Rondini wrote:
> Enable support for USB OTG port on Orange Pi Zero Plus 2 (both H3 and H5
> variants). As, according to the board schematics, the USB OTG port cannot
> provide power to external devices, we set dr_mode to peripheral.
> 
> Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>

Sorry for the time it took to review it. I initially thought it was ok
and wanted to wait until -rc1 was out to apply it, but...

> ---
>  .../boot/dts/sun8i-h3-orangepi-zero-plus2.dts | 23 +++++++++++++++++++
>  .../sun50i-h5-orangepi-zero-plus2.dts         | 23 +++++++++++++++++++
>  2 files changed, 46 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
> index b8f46e2802fd3..4376767699a47 100644
> --- a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
> +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
> @@ -137,3 +137,26 @@ &uart0 {
>  	pinctrl-0 = <&uart0_pa_pins>;
>  	status = "okay";
>  };
> +
> +&usbphy {
> +	status = "okay";
> +};
> +
> +&usb_otg {
> +	/*
> +	 * According to schematics CN1 MicroUSB port can be used to take
> +	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
> +	 * port cannot provide power externally even if the board is powered
> +	 * via GPIO pins. It thus makes sense to force peripheral mode.
> +	 */
> +	dr_mode = "peripheral";
> +	status = "okay";
> +};
> +
> +&ehci0 {
> +	status = "okay";
> +};
> +
> +&ohci0 {
> +	status = "okay";
> +};

Nodes should be ordered alphabetically here.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> index c95a68541309c..d8192a7483e9e 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> @@ -103,3 +103,26 @@ &uart1 {
>  	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>  	status = "okay";
>  };
> +
> +&usbphy {
> +	status = "okay";
> +};
> +
> +&usb_otg {
> +	/*
> +	 * According to schematics CN1 MicroUSB port can be used to take
> +	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
> +	 * port cannot provide power externally even if the board is powered
> +	 * via GPIO pins. It thus makes sense to force peripheral mode.
> +	 */
> +	dr_mode = "peripheral";
> +	status = "okay";
> +};
> +
> +&ehci0 {
> +	status = "okay";
> +};
> +
> +&ohci0 {
> +	status = "okay";
> +};

And here too.

Sorry for not spotting this earlier.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ARM: dts: orange-pi-zero-plus2: add leds configuration
  2020-05-28 20:47 ` [PATCH 2/2] ARM: dts: orange-pi-zero-plus2: add leds configuration Diego Rondini
@ 2020-06-15  8:14   ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2020-06-15  8:14 UTC (permalink / raw)
  To: Diego Rondini
  Cc: Rob Herring, Chen-Yu Tsai, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

On Thu, May 28, 2020 at 10:47:12PM +0200, Diego Rondini wrote:
> Add pwr and status leds configuration and turn on pwr led by default for Orange
> Pi Zero Plus 2 (both H3 and H5 variants).
> 
> Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
> ---
>  .../boot/dts/sun8i-h3-orangepi-zero-plus2.dts    | 16 ++++++++++++++++
>  .../allwinner/sun50i-h5-orangepi-zero-plus2.dts  | 16 ++++++++++++++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
> index 4376767699a47..4cd0ac706bd2c 100644
> --- a/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
> +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-zero-plus2.dts
> @@ -82,6 +82,22 @@ wifi_pwrseq: wifi_pwrseq {
>  		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
>  		post-power-on-delay-ms = <200>;
>  	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +
> +		pwr_led {
> +			label = "orangepi:green:pwr";
> +			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
> +			default-state = "on";
> +		};
> +
> +		status_led {

Having an underscore in the node name will trigger a DTC warning. What
about using pwr and status as nodenames?

> +			label = "orangepi:red:status";
> +			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
> +		};
> +

There's an extra line here that you should remove

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-15  8:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 20:47 [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port Diego Rondini
2020-05-28 20:47 ` [PATCH 2/2] ARM: dts: orange-pi-zero-plus2: add leds configuration Diego Rondini
2020-06-15  8:14   ` Maxime Ripard
2020-06-15  8:12 ` [PATCH 1/2] ARM: dts: orange-pi-zero-plus2: enable USB OTG port Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).