Skip to contentSkip to conversation

ARM: dts: Add USB host support for Panda and Beagle-xm

PATCH Superseded Roger Quadros 2 participants 9 messages Apr 19, 2013 – Apr 29, 2013 Device tree bindings

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover ARM: dts: Add USB host support for Panda and Beagle-xm

Hi Benoit/Tony

I've consolidated all the USB host device tree patches for Panda and Beagles to one place and addressed Tony's comments.

NOTE: patch 1 depends on OMAP clock binding introduced in
https://lkml.org/lkml/2013/4/12/407

v3:
- updated mux mode to use pulldowns on panda as non-DT boot uses pulldowns.
- fixed usb pin naming for panda, beagle and beagle-xm

The following changes since commit 1fac4fffa719a98ec1047eaece236244333c9afe:

ARM: dts: Add OMAP3430 SDP NOR flash memory binding (2013-04-09 00:21:35 +0200)

are available in the git repository at:
git://github.com/rogerq/linux.git usbhost-omap-dts

Roger Quadros (4):
ARM: dts: omap4-panda: Add USB Host support
ARM: dts: omap3-beagle: Make USB host pin naming consistent
ARM: dts: omap3-beagle-xm: Add USB Host support
ARM: dts: omap3-beagle-xm: Add USB host supprot for Rev. Ax/Bx

 arch/arm/boot/dts/omap3-beagle-xm-ab.dts  |   19 ++++++++
 arch/arm/boot/dts/omap3-beagle-xm.dts     |   65 ++++++++++++++++++++++++++++-
 arch/arm/boot/dts/omap3-beagle.dts        |   25 ++++++-----
 arch/arm/boot/dts/omap4-panda-common.dtsi |   58 +++++++++++++++++++++++++
 arch/arm/boot/dts/omap4.dtsi              |    5 ++
 5 files changed, 158 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3-beagle-xm-ab.dts
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v3 1/4 ARM: dts: omap4-panda: Add USB Host support

Provide the RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device.

The USB PHY needs AUXCLK3 to operate. Provide this information as well.

Also provide pin multiplexer information for the USB host pins.

CC Benoît Cousson <[email protected]>
---
 arch/arm/boot/dts/omap4-panda-common.dtsi |   58 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/omap4.dtsi              |    5 ++
 2 files changed, 63 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4-panda-common.dtsi +58 -0
index 03bd60d..52b8d89 100644
@@ -54,6 +54,38 @@
 			"AFML", "Line In",
 			"AFMR", "Line In";
 	};
+
+	/* HS USB Port 1 RESET */
+	hsusb1_reset: hsusb1_reset_reg {
+		compatible = "regulator-fixed";
+		regulator-name = "hsusb1_reset";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio2 30 0>;	/* gpio_62 */
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
+
+	/* HS USB Port 1 Power */
+	hsusb1_power: hsusb1_power_reg {
+		compatible = "regulator-fixed";
+		regulator-name = "hsusb1_vbus";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio1 1 0>;	/* gpio_1 */
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
+
+	/* HS USB Host PHY on PORT 1 */
+	hsusb1_phy: hsusb1_phy {
+		compatible = "usb-nop-xceiv";
+		reset-supply = <&hsusb1_reset>;
+		vcc-supply = <&hsusb1_power>;
+		clocks = <&auxclk3>;
+		clock-names = "main_clk";
+		clock-frequency = <19200000>;
+	};
 };
 
 &omap4_pmx_core {
@@ -64,6 +96,7 @@
 			&mcbsp1_pins
 			&dss_hdmi_pins
 			&tpd12s015_pins
+			&hsusbb1_pins
 	>;
 
 	twl6040_pins: pinmux_twl6040_pins {
@@ -108,6 +141,23 @@
 		>;
 	};
 
+	hsusbb1_pins: pinmux_hsusbb1_pins {
+		pinctrl-single,pins = <
+			0x82 0x10c	/* usbb1_ulpitll_clk.usbb1_ulpiphy_clk INPUT_PULLDOWN | MODE4 */
+			0x84 0x4	/* usbb1_ulpitll_stp.usbb1_ulpiphy_stp OUTPUT | MODE4 */
+			0x86 0x10c	/* usbb1_ulpitll_dir.usbb1_ulpiphy_dir INPUT_PULLDOWN | MODE4 */
+			0x88 0x10c	/* usbb1_ulpitll_nxt.usbb1_ulpiphy_nxt INPUT_PULLDOWN | MODE4 */
+			0x8a 0x10c	/* usbb1_ulpitll_dat0.usbb1_ulpiphy_dat0 INPUT_PULLDOWN | MODE4 */
+			0x8c 0x10c	/* usbb1_ulpitll_dat1.usbb1_ulpiphy_dat1 INPUT_PULLDOWN | MODE4 */
+			0x8e 0x10c	/* usbb1_ulpitll_dat2.usbb1_ulpiphy_dat2 INPUT_PULLDOWN | MODE4 */
+			0x90 0x10c	/* usbb1_ulpitll_dat3.usbb1_ulpiphy_dat3 INPUT_PULLDOWN | MODE4 */
+			0x92 0x10c	/* usbb1_ulpitll_dat4.usbb1_ulpiphy_dat4 INPUT_PULLDOWN | MODE4 */
+			0x94 0x10c	/* usbb1_ulpitll_dat5.usbb1_ulpiphy_dat5 INPUT_PULLDOWN | MODE4 */
+			0x96 0x10c	/* usbb1_ulpitll_dat6.usbb1_ulpiphy_dat6 INPUT_PULLDOWN | MODE4 */
+			0x98 0x10c	/* usbb1_ulpitll_dat7.usbb1_ulpiphy_dat7 INPUT_PULLDOWN | MODE4 */
+		>;
+	};
+
 	i2c1_pins: pinmux_i2c1_pins {
 		pinctrl-single,pins = <
 			0xe2 0x118        /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
@@ -249,3 +299,11 @@
 	mode = <3>;
 	power = <50>;
 };
+
+&usbhshost {
+	port1-mode = "ehci-phy";
+};
+
+&usbhsehci {
+	phys = <&hsusb1_phy>;
+};
arch/arm/boot/dts/omap4.dtsi +5 -0
index 2a56428..bd6036e 100644
@@ -660,5 +660,10 @@
 			ram-bits = <12>;
 			ti,has-mailbox;
 		};
+
+		auxclk3: auxclk3 {
+			#clock-cells = <0>;
+			compatible = "ti,omap-clock";
+		};
 	};
 };
Signature · 6 lines
1.7.4.1

_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss
#2 lore raw

PATCH v3 2/4 ARM: dts: omap3-beagle: Make USB host pin naming consistent

In reply to Roger Quadros

Use a common naming scheme "mode0name.modename flags" for the USB host pins to be consistent.

---
 arch/arm/boot/dts/omap3-beagle.dts |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +13 -12
index 6eec699..ce7a7be 100644
@@ -81,18 +81,19 @@
 
 	hsusbb2_pins: pinmux_hsusbb2_pins {
 		pinctrl-single,pins = <
-			0x5c0 0x3  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */
-			0x5c2 0x3  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */
-			0x5c4 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */
-			0x5c6 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */
-			0x5c8 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */
-			0x5cA 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */
-			0x1a4 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */
-			0x1a6 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */
-			0x1a8 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */
-			0x1aa 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */
-			0x1ac 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */
-			0x1ae 0x10b  /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */
+			0x5c0 0x3	/* etk_d10.hsusb2_clk OUTPUT | MODE3 */
+			0x5c2 0x3	/* etk_d11.hsusb2_stp OUTPUT | MODE3 */
+			0x5c4 0x10b	/* etk_d12.hsusb2_dir INPUT_PULLDOWN | MODE3 */
+			0x5c6 0x10b	/* etk_d13.hsusb2_nxt INPUT_PULLDOWN | MODE3 */
+			0x5c8 0x10b	/* etk_d14.hsusb2_data0 INPUT_PULLDOWN | MODE3*/
+			0x5cA 0x10b	/* etk_d15.hsusb2_data1 INPUT_PULLDOWN | MODE3 */
+			0x1a4 0x10b	/* mcspi1_cs3.hsusb2_data2 INPUT_PULLDOWN | MODE3 */
+			0x1a6 0x10b	/* mcspi2_cs1.hsusb2_data3 INPUT_PULLDOWN | MODE3 */
+			0x1a8 0x10b	/* mcspi2_simo.hsusb2_data4 INPUT_PULLDOWN | MODE3 */
+			0x1aa 0x10b	/* mcspi2_somi.hsusb2_data5 INPUT_PULLDOWN | MODE3 */
+			0x1ac 0x10b	/* mcspi2_cs0.hsusb2_data6 INPUT_PULLDOWN | MODE3 */
+			0x1ae 0x10b	/* mcspi2_clk.hsusb2_data7 INPUT_PULLDOWN | MODE3 */
+
 		>;
 	};
 };
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v3 3/4 ARM: dts: omap3-beagle-xm: Add USB Host support

In reply to Roger Quadros

Provide RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device.

Also provide pin multiplexer information for USB host pins.

CC Benoît Cousson <[email protected]>
---
 arch/arm/boot/dts/omap3-beagle-xm.dts |   61 +++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap3-beagle-xm.dts +61 -0
index 5a31964..19a8ccb 100644
@@ -57,6 +57,59 @@
 		ti,mcbsp = <&mcbsp2>;
 		ti,codec = <&twl_audio>;
 	};
+
+	/* HS USB Port 2 RESET */
+	hsusb2_reset: hsusb2_reset_reg {
+		compatible = "regulator-fixed";
+		regulator-name = "hsusb2_reset";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio5 19 0>;	/* gpio_147 */
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
+
+	/* HS USB Port 2 Power */
+	hsusb2_power: hsusb2_power_reg {
+		compatible = "regulator-fixed";
+		regulator-name = "hsusb2_vbus";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&twl_gpio 18 0>;	/* GPIO LEDA */
+		startup-delay-us = <70000>;
+	};
+
+	/* HS USB Host PHY on PORT 2 */
+	hsusb2_phy: hsusb2_phy {
+		compatible = "usb-nop-xceiv";
+		reset-supply = <&hsusb2_reset>;
+		vcc-supply = <&hsusb2_power>;
+	};
+
+};
+
+&omap3_pmx_core {
+	pinctrl-names = "default";
+	pinctrl-0 = <
+			&hsusbb2_pins
+	>;
+
+	hsusbb2_pins: pinmux_hsusbb2_pins {
+		pinctrl-single,pins = <
+			0x5c0 0x3	/* etk_d10.hsusb2_clk OUTPUT | MODE3 */
+			0x5c2 0x3	/* etk_d11.hsusb2_stp OUTPUT | MODE3 */
+			0x5c4 0x10b	/* etk_d12.hsusb2_dir INPUT_PULLDOWN | MODE3 */
+			0x5c6 0x10b	/* etk_d13.hsusb2_nxt INPUT_PULLDOWN | MODE3 */
+			0x5c8 0x10b	/* etk_d14.hsusb2_data0 INPUT_PULLDOWN | MODE3*/
+			0x5cA 0x10b	/* etk_d15.hsusb2_data1 INPUT_PULLDOWN | MODE3 */
+			0x1a4 0x10b	/* mcspi1_cs3.hsusb2_data2 INPUT_PULLDOWN | MODE3 */
+			0x1a6 0x10b	/* mcspi2_cs1.hsusb2_data3 INPUT_PULLDOWN | MODE3 */
+			0x1a8 0x10b	/* mcspi2_simo.hsusb2_data4 INPUT_PULLDOWN | MODE3 */
+			0x1aa 0x10b	/* mcspi2_somi.hsusb2_data5 INPUT_PULLDOWN | MODE3 */
+			0x1ac 0x10b	/* mcspi2_cs0.hsusb2_data6 INPUT_PULLDOWN | MODE3 */
+			0x1ae 0x10b	/* mcspi2_clk.hsusb2_data7 INPUT_PULLDOWN | MODE3 */
+		>;
+	};
 };
 
 &i2c1 {
@@ -125,3 +178,11 @@
 	mode = <3>;
 	power = <50>;
 };
+
+&usbhshost {
+	port2-mode = "ehci-phy";
+};
+
+&usbhsehci {
+	phys = <0 &hsusb2_phy>;
+};
Signature · 6 lines
1.7.4.1

_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss
#4 lore raw

PATCH v3 4/4 ARM: dts: omap3-beagle-xm: Add USB host supprot for Rev. Ax/Bx

In reply to Roger Quadros

Rev. Ax/Bx boards have reversed polarity for USBHOST_PWR_ENable signal when compared to Rev. C boards.

We create a new dts file for Ax/Bx boards.

Also update model and compatible flags for Rev. C board.

CC Benoît Cousson <[email protected]>
---
 arch/arm/boot/dts/omap3-beagle-xm-ab.dts |   19 +++++++++++++++++++
 arch/arm/boot/dts/omap3-beagle-xm.dts    |    4 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3-beagle-xm-ab.dts
arch/arm/boot/dts/omap3-beagle-xm-ab.dts new file +19 -0
new file mode 100644
index 0000000..041b40e
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/include/ "omap3-beagle-xm.dts"
+
+/ {
+        model = "TI OMAP3 BeagleBoard xM Rev: Ax/Bx";
+        compatible = "ti,omap3-beagle-xm-ab", "ti,omap3-beagle", "ti,omap3";
+};
+
+/* On Rev A/B USBHOST_PWR_EN is active high */
+&hsusb2_power {
+	enable-active-high;
+};
arch/arm/boot/dts/omap3-beagle-xm.dts +2 -2
index 19a8ccb..49af2eb 100644
@@ -10,8 +10,8 @@
 /include/ "omap36xx.dtsi"
 
 / {
-	model = "TI OMAP3 BeagleBoard xM";
-	compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3";
+	model = "TI OMAP3 BeagleBoard xM Rev: C";
+	compatible = "ti,omap3-beagle-xm-c", "ti,omap3-beagle", "ti,omap3";
 
 	cpus {
 		cpu@0 {
Signature · 1 line
1.7.4.1
#5 lore raw
In reply to Roger Quadros
Quoted 11 lines · Roger Quadros

Hi Benoit/Tony

I've consolidated all the USB host device tree patches for Panda and Beagles to one place and addressed Tony's comments.

NOTE: patch 1 depends on OMAP clock binding introduced in
https://lkml.org/lkml/2013/4/12/407

v3:
- updated mux mode to use pulldowns on panda as non-DT boot uses pulldowns.
- fixed usb pin naming for panda, beagle and beagle-xm

Cool. Sounds like we should be able to make omap4 DT only for v3.11 then. For that we also need USB on 4430-sdp working, but it now does:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap 4a064c00.ehci: failed to get phys phandle in /ocp/usbhshost@4a064000/ehci@4a064c00 node ehci-omap 4a064c00.ehci: failed to get phys phandle in /ocp/usbhshost@4a064000/ehci@4a064c00 node
...

As I have mine in a rack I don't have anything plugged into the USB port there though, but sounds like the phy is not initialized?

Regards,

Tony

#6 lore raw
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Roger Quadros

Hi Benoit/Tony

I've consolidated all the USB host device tree patches for Panda and Beagles to one place and addressed Tony's comments.

Quoted 8 lines
Quoted 6 lines

NOTE: patch 1 depends on OMAP clock binding introduced in
https://lkml.org/lkml/2013/4/12/407

v3:
- updated mux mode to use pulldowns on panda as non-DT boot uses pulldowns.
- fixed usb pin naming for panda, beagle and beagle-xm

Cool. Sounds like we should be able to make omap4 DT only for v3.11

when we say DT only for 3.11, does this mean getting rid of hwmod dependency?

Quoted 7 lines

then. For that we also need USB on 4430-sdp working, but it now does:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap 4a064c00.ehci: failed to get phys phandle in /ocp/usbhshost@4a064000/ehci@4a064c00 node ehci-omap 4a064c00.ehci: failed to get phys phandle in /ocp/usbhshost@4a064000/ehci@4a064c00 node
...

4430-sdp (Blaze) does not have EHCI USB Host port. It should be using the MUSB OTG port.

Quoted 4 lines

As I have mine in a rack I don't have anything plugged into the USB port there though, but sounds like the phy is not initialized?

+Ravi B.
He might have some clues.

cheers,
-roger

#7 lore raw
Quoted 10 lines · Roger Quadros
Quoted 9 lines · Tony Lindgren
Quoted 8 lines · Roger Quadros

Hi Benoit/Tony

I've consolidated all the USB host device tree patches for Panda and Beagles to one place and addressed Tony's comments.

NOTE: patch 1 depends on OMAP clock binding introduced in
https://lkml.org/lkml/2013/4/12/407

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

v3:
- updated mux mode to use pulldowns on panda as non-DT boot uses pulldowns.
- fixed usb pin naming for panda, beagle and beagle-xm

Cool. Sounds like we should be able to make omap4 DT only for v3.11

when we say DT only for 3.11, does this mean getting rid of hwmod dependency?

That too, but mostly getting rid of the board-*.c files and platform data init for omap4 :) So a saving of about 5000 lines of code and data with the legacy mux data dropped. I have some patches to do that but have not yet posted them as we need to get the boards working well enough with DT first.

Quoted 11 lines
Quoted 7 lines

then. For that we also need USB on 4430-sdp working, but it now does:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap 4a064c00.ehci: failed to get phys phandle in /ocp/usbhshost@4a064000/ehci@4a064c00 node ehci-omap 4a064c00.ehci: failed to get phys phandle in /ocp/usbhshost@4a064000/ehci@4a064c00 node
...

4430-sdp (Blaze) does not have EHCI USB Host port. It should be using the MUSB OTG port.

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

As I have mine in a rack I don't have anything plugged into the USB port there though, but sounds like the phy is not initialized?

+Ravi B.
He might have some clues.

Yes please check.

Regards,

Tony

#8 lore raw
In reply to Roger Quadros
Quoted 7 lines · Roger Quadros

Hi Benoit/Tony

I've consolidated all the USB host device tree patches for Panda and Beagles to one place and addressed Tony's comments.

NOTE: patch 1 depends on OMAP clock binding introduced in
https://lkml.org/lkml/2013/4/12/407

Tony, Benoit,

Just FYI, the patch [1] that is needed will probably not get in until 3.10 rc1. However, this series need not wait till that happens.

[1] https://lkml.org/lkml/2013/4/12/407

cheers,
-roger

Quoted 26 lines

v3:
- updated mux mode to use pulldowns on panda as non-DT boot uses pulldowns.
- fixed usb pin naming for panda, beagle and beagle-xm

The following changes since commit 1fac4fffa719a98ec1047eaece236244333c9afe:

ARM: dts: Add OMAP3430 SDP NOR flash memory binding (2013-04-09 00:21:35 +0200)

are available in the git repository at:
git://github.com/rogerq/linux.git usbhost-omap-dts

Roger Quadros (4):
ARM: dts: omap4-panda: Add USB Host support
ARM: dts: omap3-beagle: Make USB host pin naming consistent
ARM: dts: omap3-beagle-xm: Add USB Host support
ARM: dts: omap3-beagle-xm: Add USB host supprot for Rev. Ax/Bx

 arch/arm/boot/dts/omap3-beagle-xm-ab.dts  |   19 ++++++++
 arch/arm/boot/dts/omap3-beagle-xm.dts     |   65 ++++++++++++++++++++++++++++-
 arch/arm/boot/dts/omap3-beagle.dts        |   25 ++++++-----
 arch/arm/boot/dts/omap4-panda-common.dtsi |   58 +++++++++++++++++++++++++
 arch/arm/boot/dts/omap4.dtsi              |    5 ++
 5 files changed, 158 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3-beagle-xm-ab.dts