linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
@ 2017-12-07 11:05 Jagan Teki
  2017-12-07 13:34 ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2017-12-07 11:05 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Icenowy Zheng, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, Michael Trimarchi,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Jagan Teki

Add usb otg support for orangepi-zero-plus2 board:
- Add usb_otg node with dr_mode as 'otg'
- USB0-IDDET connected to PA21
- VBUS connected through DCIN which always on

Tested mass storage function.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Note: Anyone please check vbus connection [1]
Since it is connected through DCIN of vcc-5v, I've added vcc-5v0
regulator for the same and attached to usb0_vbus-supply but it is
disabling during kernel boot.
[    1.887854] vcc5v0: disabling

[1] http://linux-sunxi.org/File:ORANGE_PI-ZERO-PLUS2_V1_0.pdf

 .../dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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 d349399..7f298ee 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
@@ -73,6 +73,10 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>;
@@ -111,6 +115,10 @@
 	status = "okay";
 };
 
+&ohci0 {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
@@ -122,3 +130,13 @@
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
 	status = "okay";
 };
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
+	status = "okay";
+};
-- 
2.7.4

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

* Re: [PATCH] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
  2017-12-07 11:05 [PATCH] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg Jagan Teki
@ 2017-12-07 13:34 ` Maxime Ripard
  2017-12-07 16:53   ` Jagan Teki
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2017-12-07 13:34 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Icenowy Zheng, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, Michael Trimarchi,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Jagan Teki

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

Hi,

On Thu, Dec 07, 2017 at 04:35:48PM +0530, Jagan Teki wrote:
> Add usb otg support for orangepi-zero-plus2 board:
> - Add usb_otg node with dr_mode as 'otg'
> - USB0-IDDET connected to PA21
> - VBUS connected through DCIN which always on
> 
> Tested mass storage function.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

Did you test the OTG or peripheral modes?

> Note: Anyone please check vbus connection [1]
> Since it is connected through DCIN of vcc-5v, I've added vcc-5v0
> regulator for the same and attached to usb0_vbus-supply but it is
> disabling during kernel boot.
> [    1.887854] vcc5v0: disabling

VBUS is the power line that is provided on the USB connector. In
peripheral, that power is provided by the host, therefore it needs to
be shutdown on the peripheral end. This is the expected behaviour.

Maxime

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

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

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

* Re: [PATCH] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
  2017-12-07 13:34 ` Maxime Ripard
@ 2017-12-07 16:53   ` Jagan Teki
  2017-12-08  7:57     ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2017-12-07 16:53 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Icenowy Zheng, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, Michael Trimarchi,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Jagan Teki

On Thu, Dec 7, 2017 at 7:04 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Thu, Dec 07, 2017 at 04:35:48PM +0530, Jagan Teki wrote:
>> Add usb otg support for orangepi-zero-plus2 board:
>> - Add usb_otg node with dr_mode as 'otg'
>> - USB0-IDDET connected to PA21
>> - VBUS connected through DCIN which always on
>>
>> Tested mass storage function.
>>
>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>
> Did you test the OTG or peripheral modes?

dr_mode with otg and I've tested mas storage gadget with mmc disk emulation.

>
>> Note: Anyone please check vbus connection [1]
>> Since it is connected through DCIN of vcc-5v, I've added vcc-5v0
>> regulator for the same and attached to usb0_vbus-supply but it is
>> disabling during kernel boot.
>> [    1.887854] vcc5v0: disabling
>
> VBUS is the power line that is provided on the USB connector. In
> peripheral, that power is provided by the host, therefore it needs to
> be shutdown on the peripheral end. This is the expected behaviour.

So, in my test with 'otg' host drive the vbus so-it is disabling at
target end is it?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

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

* Re: [PATCH] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
  2017-12-07 16:53   ` Jagan Teki
@ 2017-12-08  7:57     ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2017-12-08  7:57 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Icenowy Zheng, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, Michael Trimarchi,
	linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Jagan Teki

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

On Thu, Dec 07, 2017 at 10:23:18PM +0530, Jagan Teki wrote:
> On Thu, Dec 7, 2017 at 7:04 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Hi,
> >
> > On Thu, Dec 07, 2017 at 04:35:48PM +0530, Jagan Teki wrote:
> >> Add usb otg support for orangepi-zero-plus2 board:
> >> - Add usb_otg node with dr_mode as 'otg'
> >> - USB0-IDDET connected to PA21
> >> - VBUS connected through DCIN which always on
> >>
> >> Tested mass storage function.
> >>
> >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> >
> > Did you test the OTG or peripheral modes?
> 
> dr_mode with otg and I've tested mas storage gadget with mmc disk
> emulation.

So, peripheral, not OTG.

> >
> >> Note: Anyone please check vbus connection [1]
> >> Since it is connected through DCIN of vcc-5v, I've added vcc-5v0
> >> regulator for the same and attached to usb0_vbus-supply but it is
> >> disabling during kernel boot.
> >> [    1.887854] vcc5v0: disabling
> >
> > VBUS is the power line that is provided on the USB connector. In
> > peripheral, that power is provided by the host, therefore it needs to
> > be shutdown on the peripheral end. This is the expected behaviour.
> 
> So, in my test with 'otg' host drive the vbus so-it is disabling at
> target end is it?

You're not testing OTG, you're testing in peripheral mode. OTG is
switching between host and peripheral at runtime. And I'm pretty sure
this board cannot implement OTG at all, since its only source of power
seems to be USB.

Maxime

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

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

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

end of thread, other threads:[~2017-12-08  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07 11:05 [PATCH] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg Jagan Teki
2017-12-07 13:34 ` Maxime Ripard
2017-12-07 16:53   ` Jagan Teki
2017-12-08  7:57     ` 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).