Skip to contentSkip to conversation

arm: sun8i: nanopi-neo: Enable USB OTG

PATCH In review David Disseldorp 2 participants 2 messages Sep 20, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: sun8i: nanopi-neo: Enable USB OTG

From: David Disseldorp <[email protected]>

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

---
Changes since v1
- remove duplicate ehci3/ohci3 definitions, which are already carried in sun8i-h3-nanopi.dtsi

 arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts +19 -0
index 78f6c24952dd..17b07c3df369 100644
@@ -47,9 +47,28 @@
 	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &emac {
 	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
 	allwinner,leds-active-low;
 	status = "okay";
 };
+
+&ohci0 {
+	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";
+};
Signature · 6 lines
2.13.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 34 lines · David Disseldorp

From: David Disseldorp <[email protected]>

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

---
Changes since v1
- remove duplicate ehci3/ohci3 definitions, which are already carried in sun8i-h3-nanopi.dtsi

 arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts +6 -0
index 78f6c24952dd..17b07c3df369 100644
@@ -47,9 +47,28 @@
 	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &emac {
 	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
 	allwinner,leds-active-low;
 	status = "okay";
 };
+
+&ohci0 {

arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts line 71

Quoted 10 lines
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts +10 -0
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	/* USB Type-A port's VBUS is always on */

I'm not sure what that comment is here for.

arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts line 72

Quoted 1 line
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts +1 -0
+	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */

And that means that you cannot switch VBUS on on the board?

In this case, it's not able to do proper OTG like advertised above.

Maxime

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