devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: sun8i: nanopi-neo: Enable USB OTG
@ 2017-08-28  0:12 David Disseldorp
       [not found] ` <20170828001251.8440-1-ddiss-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: David Disseldorp @ 2017-08-28  0:12 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	icenowy-h8G6r0blFSE, David Disseldorp

From: David Disseldorp <ddiss-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>

The NanoPi NEO features a MicroUSB port that can work in both host mode
and peripheral mode. Switching is handled via GPIO PG12.

Signed-off-by: David Disseldorp <ddiss-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
---
 arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
index 78f6c24952dd..5abf430ac5a6 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
@@ -47,9 +47,36 @@
 	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ehci3 {
+	status = "okay";
+};
+
 &emac {
 	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
 	allwinner,leds-active-low;
 	status = "okay";
 };
+
+&ohci0 {
+	status = "okay";
+};
+
+&ohci3 {
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	/* USB Type-A port's VBUS is always on */
+	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+	status = "okay";
+};
-- 
2.13.5

--
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] 3+ messages in thread

* Re: [PATCH] arm: sun8i: nanopi-neo: Enable USB OTG
       [not found] ` <20170828001251.8440-1-ddiss-l3A5Bk7waGM@public.gmane.org>
@ 2017-08-28  2:37   ` icenowy-h8G6r0blFSE
       [not found]     ` <46910aa6a3f08e1628a5a23fb7751a61-h8G6r0blFSE@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: icenowy-h8G6r0blFSE @ 2017-08-28  2:37 UTC (permalink / raw)
  To: David Disseldorp
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	David Disseldorp

在 2017-08-28 08:12,David Disseldorp 写道:
> From: David Disseldorp <ddiss-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
> 
> The NanoPi NEO features a MicroUSB port that can work in both host mode
> and peripheral mode. Switching is handled via GPIO PG12.

How's the Vbus of the OTG handled?

> 
> Signed-off-by: David Disseldorp <ddiss-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
> ---
>  arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 27 
> +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> index 78f6c24952dd..5abf430ac5a6 100644
> --- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> @@ -47,9 +47,36 @@
>  	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
>  };
> 
> +&ehci0 {
> +	status = "okay";
> +};
> +
> +&ehci3 {
> +	status = "okay";
> +};

Why do you also enable ehci/ohci3 here?
I think they're already enabled in sun8i-h3-nanopi.dtsi .

> +
>  &emac {
>  	phy-handle = <&int_mii_phy>;
>  	phy-mode = "mii";
>  	allwinner,leds-active-low;
>  	status = "okay";
>  };
> +
> +&ohci0 {
> +	status = "okay";
> +};
> +
> +&ohci3 {
> +	status = "okay";
> +};
> +
> +&usb_otg {
> +	dr_mode = "otg";
> +	status = "okay";
> +};
> +
> +&usbphy {
> +	/* USB Type-A port's VBUS is always on */
> +	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
> +	status = "okay";
> +};
--
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	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm: sun8i: nanopi-neo: Enable USB OTG
       [not found]     ` <46910aa6a3f08e1628a5a23fb7751a61-h8G6r0blFSE@public.gmane.org>
@ 2017-08-28 23:41       ` David Disseldorp
  0 siblings, 0 replies; 3+ messages in thread
From: David Disseldorp @ 2017-08-28 23:41 UTC (permalink / raw)
  To: icenowy-h8G6r0blFSE
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
	David Disseldorp

On Mon, 28 Aug 2017 10:37:56 +0800, icenowy-h8G6r0blFSE@public.gmane.org wrote:

> 在 2017-08-28 08:12,David Disseldorp 写道:
> > From: David Disseldorp <ddiss-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
> > 
> > The NanoPi NEO features a MicroUSB port that can work in both host mode
> > and peripheral mode. Switching is handled via GPIO PG12.  
> 
> How's the Vbus of the OTG handled?

I don't know. Unlike the NanoPi NEO2[2], the NanoPi NEO schematics[1]
don't show a regulator connected to the Vbus pin. I've tested this
change with USB device mode only.

> > Signed-off-by: David Disseldorp <ddiss-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 27 
> > +++++++++++++++++++++++++++
> >  1 file changed, 27 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> > b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> > index 78f6c24952dd..5abf430ac5a6 100644
> > --- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> > +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
> > @@ -47,9 +47,36 @@
> >  	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
> >  };
> > 
> > +&ehci0 {
> > +	status = "okay";
> > +};
> > +
> > +&ehci3 {
> > +	status = "okay";
> > +};  
> 
> Why do you also enable ehci/ohci3 here?
> I think they're already enabled in sun8i-h3-nanopi.dtsi .

You're right. I'll drop the duplication here.

Cheers, David

1. NanoPi NEO schematics
   http://wiki.friendlyarm.com/wiki/images/1/1c/NanoPi-NEO-V1.2-1608-Schematic.pdf

2. NanoPi NEO2 schematics
   http://wiki.friendlyarm.com/wiki/images/a/a1/Schematic_NanoPi_NEO2-v1.0_1701.pdf
--
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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-28 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-28  0:12 [PATCH] arm: sun8i: nanopi-neo: Enable USB OTG David Disseldorp
     [not found] ` <20170828001251.8440-1-ddiss-l3A5Bk7waGM@public.gmane.org>
2017-08-28  2:37   ` icenowy-h8G6r0blFSE
     [not found]     ` <46910aa6a3f08e1628a5a23fb7751a61-h8G6r0blFSE@public.gmane.org>
2017-08-28 23:41       ` David Disseldorp

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).