devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
@ 2018-01-12  9:09 Jagan Teki
       [not found] ` <1515748144-25204-1-git-send-email-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2018-01-12  9:09 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-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, 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-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
Changes for v2:
- Change dr_mode to peripheral

 .../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 af43533..6511190 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 = "peripheral";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
+	status = "okay";
+};
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
       [not found] ` <1515748144-25204-1-git-send-email-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
@ 2018-01-15  8:01   ` Maxime Ripard
       [not found]     ` <20180115080139.k2vrczo3hnvdt3df-ZC1Zs529Oq4@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2018-01-15  8:01 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-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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

Hi,

On Fri, Jan 12, 2018 at 02:39:04PM +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-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
> ---
> Changes for v2:
> - Change dr_mode to peripheral
> 
>  .../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 af43533..6511190 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 = "peripheral";

If VBUS is always on, this can only operate safely in host mode, not
peripheral.

Maxime

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

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

* Re: [PATCH v2] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
       [not found]     ` <20180115080139.k2vrczo3hnvdt3df-ZC1Zs529Oq4@public.gmane.org>
@ 2018-01-15  8:05       ` Icenowy Zheng
  2018-01-15 15:33         ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: Icenowy Zheng @ 2018-01-15  8:05 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Maxime Ripard, Jagan Teki, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Catalin Marinas,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Will Deacon,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Chen-Yu Tsai, Rob Herring,
	Michael Trimarchi

在 2018年1月15日星期一 CST 下午4:01:39,Maxime Ripard 写道:
> Hi,
> 
> On Fri, Jan 12, 2018 at 02:39:04PM +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-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
> > ---
> > Changes for v2:
> > - Change dr_mode to peripheral
> > 
> >  .../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
> > af43533..6511190 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 = "peripheral";
> 
> If VBUS is always on, this can only operate safely in host mode, not
> peripheral.

I think this kind of device is designed to directly drain power from the host 
in peripheral mode.

> 
> Maxime


-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* Re: [PATCH v2] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg
  2018-01-15  8:05       ` Icenowy Zheng
@ 2018-01-15 15:33         ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2018-01-15 15:33 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Jagan Teki,
	Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Catalin Marinas,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Will Deacon,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Chen-Yu Tsai, Rob Herring,
	Michael Trimarchi

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

On Mon, Jan 15, 2018 at 04:05:07PM +0800, Icenowy Zheng wrote:
> 在 2018年1月15日星期一 CST 下午4:01:39,Maxime Ripard 写道:
> > Hi,
> > 
> > On Fri, Jan 12, 2018 at 02:39:04PM +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-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
> > > ---
> > > Changes for v2:
> > > - Change dr_mode to peripheral
> > > 
> > >  .../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
> > > af43533..6511190 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 = "peripheral";
> > 
> > If VBUS is always on, this can only operate safely in host mode, not
> > peripheral.
> 
> I think this kind of device is designed to directly drain power from the host 
> in peripheral mode.

Then the commit log has it backwards, VBUS is not connected through
DCIN, DCIN is VBUS.

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:[~2018-01-15 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12  9:09 [PATCH v2] arm64: allwinner: a64: orangepi-zero-plus2: add usb otg Jagan Teki
     [not found] ` <1515748144-25204-1-git-send-email-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2018-01-15  8:01   ` Maxime Ripard
     [not found]     ` <20180115080139.k2vrczo3hnvdt3df-ZC1Zs529Oq4@public.gmane.org>
2018-01-15  8:05       ` Icenowy Zheng
2018-01-15 15:33         ` 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).