Skip to contentSkip to conversation

USB: phy: phy-nop: Manage RESET GPIO in the driver

PATCH In review Roger Quadros 4 participants 25 messages Sep 24, 2013 – Nov 26, 2013

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

v3 cover USB: phy: phy-nop: Manage RESET GPIO in the driver

Hi,

Modelling the RESET line as a regulator supply wasn't a good idea as it abuses the regulator framework and makes adaptation code/data more complex.

Instead, manage the RESET gpio line directly in the driver.

This also makes us easy to migrate to a dedicated GPIO RESET controller whenever it becomes available.

Apart from RESET line changes this series also adds USB host support fro beagle-xm and fixes USB OTG port on beagle.

The full series is avilable at
git://github.com/rogerq/linux.git
in branch
phy-reset

*NOTE:* As there are changes to platform data, Patch 1 needs to be shared between the arm-soc tree and usb tree.

Patch 1 is available at repo
git://github.com/rogerq/linux.git
in branch
phy-reset-common

Patch 2 contains the phy-nop driver changes
Patches 3 and 4 adapt legacy boot code to the phy-nop driver changes. Patches 5, 6 and 7 adapt DT data to the binding changes. Patch 8 is cleanup of omap3-beagle DT.
Patch 9 adds USB host support to omap3-beagle-xm using the new binding. Patch 10 fixes USB OTG port on beagle.

Patches are based on v3.12-rc1

Tested leacy boot on omap3-beagle and omap3-beagle-xm Tested DT boot on omap3-beagle, omap3-beagle-xm and omap4-panda-es

v3:
- Fix the Initial state of RESET line at probe time.
- Update hsusb3_reset line on omap5-uevm as well.
- Add patch 10 that fixes USB OTG port on beagle.

v2:
- Added RESET GPIO polarity feature
- Changed to gpio_set_value_cansleep()

cheers,
-roger

Roger Quadros (10):
usb: phy: generic: Add gpio_reset to platform data
usb: phy: generic: Don't use regulator framework for RESET line
ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct
usbhs_phy_data
ARM: OMAP2+: usb-host: Adapt to USB phy-nop RESET line changes
ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset
ARM: dts: omap4-panda: Use reset-gpios for hsusb1_reset
ARM: dts: omap5-uevm: Use reset-gpios for hsusb2/3_reset
ARM: dts: omap3-beagle: Make USB host pin naming consistent
ARM: dts: omap3-beagle-xm: Add USB Host support
ARM: dts: omap3-beagle: Add USB OTG PHY details

 .../devicetree/bindings/usb/usb-nop-xceiv.txt      |    7 +-
 arch/arm/boot/dts/omap3-beagle-xm.dts              |   65 +++++++++++++--
 arch/arm/boot/dts/omap3-beagle.dts                 |   44 +++++------
 arch/arm/boot/dts/omap4-panda-common.dtsi          |   18 +----
 arch/arm/boot/dts/omap5-uevm.dts                   |   26 +------
 arch/arm/mach-omap2/board-omap3beagle.c            |    6 --
 arch/arm/mach-omap2/usb-host.c                     |   18 ++--
 arch/arm/mach-omap2/usb.h                          |    1 -
 drivers/usb/phy/phy-am335x.c                       |    2 +-
 drivers/usb/phy/phy-generic.c                      |   84 +++++++++++++-------
 drivers/usb/phy/phy-generic.h                      |    6 +-
 include/linux/usb/usb_phy_gen_xceiv.h              |    3 +-
 12 files changed, 153 insertions(+), 127 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v3 1/10 usb: phy: generic: Add gpio_reset to platform data

The GPIO number of the RESET line can be passed to the driver using the gpio_reset member.

---
 include/linux/usb/usb_phy_gen_xceiv.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/usb/usb_phy_gen_xceiv.h +2 -1
index f9a7e7b..42f3b71 100644
@@ -9,7 +9,8 @@ struct usb_phy_gen_xceiv_platform_data {
 
 	/* if set fails with -EPROBE_DEFER if can't get regulator */
 	unsigned int needs_vcc:1;
-	unsigned int needs_reset:1;
+	unsigned int needs_reset:1;	/* deprecated */
+	int gpio_reset;
 };
 
 #if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH v3 2/10 usb: phy: generic: Don't use regulator framework for RESET line

In reply to Roger Quadros

Modelling the RESET line as a regulator supply wasn't a good idea as it kind of abuses the regulator framework and also makes adaptation code more complex.

Instead, manage the RESET gpio line directly in the driver. Update the device tree binding information.

This also makes us easy to migrate to a dedicated GPIO RESET controller whenever it becomes available.

---
 .../devicetree/bindings/usb/usb-nop-xceiv.txt      |    7 +-
 drivers/usb/phy/phy-am335x.c                       |    2 +-
 drivers/usb/phy/phy-generic.c                      |   84 +++++++++++++-------
 drivers/usb/phy/phy-generic.h                      |    6 +-
 4 files changed, 63 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt +3 -4
index d7e2726..1bd37fa 100644
@@ -15,7 +15,7 @@ Optional properties:
 
 - vcc-supply: phandle to the regulator that provides RESET to the PHY.
 
-- reset-supply: phandle to the regulator that provides power to the PHY.
+- reset-gpios: Should specify the GPIO for reset.
 
 Example:
 
@@ -25,10 +25,9 @@ Example:
 		clocks = <&osc 0>;
 		clock-names = "main_clk";
 		vcc-supply = <&hsusb1_vcc_regulator>;
-		reset-supply = <&hsusb1_reset_regulator>;
+		reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
 	};
 
 hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator
 and expects that clock to be configured to 19.2MHz by the NOP PHY driver.
-hsusb1_vcc_regulator provides power to the PHY and hsusb1_reset_regulator
-controls RESET.
+hsusb1_vcc_regulator provides power to the PHY and GPIO 7 controls RESET.
drivers/usb/phy/phy-am335x.c +1 -1
index c4d614d..fb4bf28 100644
@@ -53,7 +53,7 @@ static int am335x_phy_probe(struct platform_device *pdev)
 	}
 
 	ret = usb_phy_gen_create_phy(dev, &am_phy->usb_phy_gen,
-			USB_PHY_TYPE_USB2, 0, false, false);
+			USB_PHY_TYPE_USB2, 0, false);
 	if (ret)
 		return ret;
 
drivers/usb/phy/phy-generic.c +56 -28

141 lines not on this page · raw message

drivers/usb/phy/phy-generic.h +3 -3
index 61687d5..6c3a2e1 100644
@@ -6,15 +6,15 @@ struct usb_phy_gen_xceiv {
 	struct device *dev;
 	struct clk *clk;
 	struct regulator *vcc;
-	struct regulator *reset;
+	int gpio_reset;
+	bool reset_active_low;
 };
 
 int usb_gen_phy_init(struct usb_phy *phy);
 void usb_gen_phy_shutdown(struct usb_phy *phy);
 
 int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
-		enum usb_phy_type type, u32 clk_rate, bool needs_vcc,
-		bool needs_reset);
+		enum usb_phy_type type, u32 clk_rate, bool needs_vcc);
 void usb_phy_gen_cleanup_phy(struct usb_phy_gen_xceiv *nop);
 
 #endif
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v3 3/10 ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct usbhs_phy_data

In reply to Roger Quadros

The platform data bits can be inferred from the other members of struct usbhs_phy_data. So get rid of the platform_data member.

Build the platform data for the PHY device in usbhs_init_phys() instead.

---
 arch/arm/mach-omap2/board-omap3beagle.c |    6 ------
 arch/arm/mach-omap2/usb-host.c          |   11 ++++++++++-
 arch/arm/mach-omap2/usb.h               |    1 -
 3 files changed, 10 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +0 -6
index f269184..8b9cd06 100644
@@ -289,18 +289,12 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
 
 static struct gpio_led gpio_leds[];
 
-/* PHY's VCC regulator might be added later, so flag that we need it */
-static struct usb_phy_gen_xceiv_platform_data hsusb2_phy_data = {
-	.needs_vcc = true,
-};
-
 static struct usbhs_phy_data phy_data[] = {
 	{
 		.port = 2,
 		.reset_gpio = 147,
 		.vcc_gpio = -1,		/* updated in beagle_twl_gpio_setup */
 		.vcc_polarity = 1,	/* updated in beagle_twl_gpio_setup */
-		.platform_data = &hsusb2_phy_data,
 	},
 };
 
arch/arm/mach-omap2/usb-host.c +10 -1
index e83a6a4..78ac1c2 100644
@@ -435,6 +435,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 	struct platform_device *pdev;
 	char *phy_id;
 	struct platform_device_info pdevinfo;
+	struct usb_phy_gen_xceiv_platform_data nop_pdata;
 
 	for (i = 0; i < num_phys; i++) {
 
@@ -455,11 +456,19 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 			return -ENOMEM;
 		}
 
+		/* set platform data */
+		memset(&nop_pdata, 0, sizeof(nop_pdata));
+		if (gpio_is_valid(phy->vcc_gpio))
+			nop_pdata.needs_vcc = true;
+		if (gpio_is_valid(phy->reset_gpio))
+			nop_pdata.needs_reset = true;
+		nop_pdata.type = USB_PHY_TYPE_USB2;
+
 		/* create a NOP PHY device */
 		memset(&pdevinfo, 0, sizeof(pdevinfo));
 		pdevinfo.name = nop_name;
 		pdevinfo.id = phy->port;
-		pdevinfo.data = phy->platform_data;
+		pdevinfo.data = &nop_pdata;
 		pdevinfo.size_data =
 			sizeof(struct usb_phy_gen_xceiv_platform_data);
 		scnprintf(phy_id, MAX_STR, "usb_phy_gen_xceiv.%d",
arch/arm/mach-omap2/usb.h +0 -1
index e7261eb..4ba2ae7 100644
@@ -58,7 +58,6 @@ struct usbhs_phy_data {
 	int reset_gpio;
 	int vcc_gpio;
 	bool vcc_polarity;	/* 1 active high, 0 active low */
-	void *platform_data;
 };
 
 extern void usb_musb_init(struct omap_musb_board_data *board_data);
Signature · 1 line
1.7.4.1
#4 lore raw

Re: [PATCH v3 03/10] ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct usbhs_phy_data

Hi Tony,

Quoted 6 lines · Roger Quadros

The platform data bits can be inferred from the other members of struct usbhs_phy_data. So get rid of the platform_data member.

Build the platform data for the PHY device in usbhs_init_phys() instead.

Could you please Ack this if OK?

cheers,
-roger

Quoted 75 lines
---
 arch/arm/mach-omap2/board-omap3beagle.c |    6 ------
 arch/arm/mach-omap2/usb-host.c          |   11 ++++++++++-
 arch/arm/mach-omap2/usb.h               |    1 -
 3 files changed, 10 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +0 -6
index f269184..8b9cd06 100644
@@ -289,18 +289,12 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
 
 static struct gpio_led gpio_leds[];
 
-/* PHY's VCC regulator might be added later, so flag that we need it */
-static struct usb_phy_gen_xceiv_platform_data hsusb2_phy_data = {
-	.needs_vcc = true,
-};
-
 static struct usbhs_phy_data phy_data[] = {
 	{
 		.port = 2,
 		.reset_gpio = 147,
 		.vcc_gpio = -1,		/* updated in beagle_twl_gpio_setup */
 		.vcc_polarity = 1,	/* updated in beagle_twl_gpio_setup */
-		.platform_data = &hsusb2_phy_data,
 	},
 };
 
arch/arm/mach-omap2/usb-host.c +10 -1
index e83a6a4..78ac1c2 100644
@@ -435,6 +435,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 	struct platform_device *pdev;
 	char *phy_id;
 	struct platform_device_info pdevinfo;
+	struct usb_phy_gen_xceiv_platform_data nop_pdata;
 
 	for (i = 0; i < num_phys; i++) {
 
@@ -455,11 +456,19 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 			return -ENOMEM;
 		}
 
+		/* set platform data */
+		memset(&nop_pdata, 0, sizeof(nop_pdata));
+		if (gpio_is_valid(phy->vcc_gpio))
+			nop_pdata.needs_vcc = true;
+		if (gpio_is_valid(phy->reset_gpio))
+			nop_pdata.needs_reset = true;
+		nop_pdata.type = USB_PHY_TYPE_USB2;
+
 		/* create a NOP PHY device */
 		memset(&pdevinfo, 0, sizeof(pdevinfo));
 		pdevinfo.name = nop_name;
 		pdevinfo.id = phy->port;
-		pdevinfo.data = phy->platform_data;
+		pdevinfo.data = &nop_pdata;
 		pdevinfo.size_data =
 			sizeof(struct usb_phy_gen_xceiv_platform_data);
 		scnprintf(phy_id, MAX_STR, "usb_phy_gen_xceiv.%d",
arch/arm/mach-omap2/usb.h +0 -1
index e7261eb..4ba2ae7 100644
@@ -58,7 +58,6 @@ struct usbhs_phy_data {
 	int reset_gpio;
 	int vcc_gpio;
 	bool vcc_polarity;	/* 1 active high, 0 active low */
-	void *platform_data;
 };
 
 extern void usb_musb_init(struct omap_musb_board_data *board_data);
maintainer Acked-by
#5 lore raw

Re: [PATCH v3 03/10] ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct usbhs_phy_data

Quoted 11 lines · Roger Quadros

Hi Tony,

Quoted 6 lines · Roger Quadros

The platform data bits can be inferred from the other members of struct usbhs_phy_data. So get rid of the platform_data member.

Build the platform data for the PHY device in usbhs_init_phys() instead.

Could you please Ack this if OK?

This should be OK for you guys to queue. You should coordinate the .dts changes with Benoit though. It might be best to have this branch as an immutable branch against -rc3 that we can all merge in as needed.

For this patch:

#6 lore raw

PATCH v3 4/10 ARM: OMAP2+: usb-host: Adapt to USB phy-nop RESET line changes

In reply to Roger Quadros

The USB phy-nop nop driver expects the RESET line information to be sent as a GPIO number via platform data. Adapt to that.

---
 arch/arm/mach-omap2/usb-host.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/usb-host.c +1 -10
index 78ac1c2..10855eb 100644
@@ -460,8 +460,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 		memset(&nop_pdata, 0, sizeof(nop_pdata));
 		if (gpio_is_valid(phy->vcc_gpio))
 			nop_pdata.needs_vcc = true;
-		if (gpio_is_valid(phy->reset_gpio))
-			nop_pdata.needs_reset = true;
+		nop_pdata.gpio_reset = phy->reset_gpio;
 		nop_pdata.type = USB_PHY_TYPE_USB2;
 
 		/* create a NOP PHY device */
@@ -483,14 +482,6 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 
 		usb_bind_phy("ehci-omap.0", phy->port - 1, phy_id);
 
-		/* Do we need RESET regulator ? */
-		if (gpio_is_valid(phy->reset_gpio)) {
-			scnprintf(rail_name, MAX_STR,
-					"hsusb%d_reset", phy->port);
-			usbhs_add_regulator(rail_name, phy_id, "reset",
-						phy->reset_gpio, 1);
-		}
-
 		/* Do we need VCC regulator ? */
 		if (gpio_is_valid(phy->vcc_gpio)) {
 			scnprintf(rail_name, MAX_STR, "hsusb%d_vcc", phy->port);
Signature · 1 line
1.7.4.1
#7 lore raw

Re: [PATCH v3 04/10] ARM: OMAP2+: usb-host: Adapt to USB phy-nop RESET line changes

Hi Tony,

Quoted 4 lines · Roger Quadros

The USB phy-nop nop driver expects the RESET line information to be sent as a GPIO number via platform data. Adapt to that.

Need your Ack on this one as well.

cheers,
-roger

Quoted 34 lines
---
 arch/arm/mach-omap2/usb-host.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/usb-host.c +1 -10
index 78ac1c2..10855eb 100644
@@ -460,8 +460,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 		memset(&nop_pdata, 0, sizeof(nop_pdata));
 		if (gpio_is_valid(phy->vcc_gpio))
 			nop_pdata.needs_vcc = true;
-		if (gpio_is_valid(phy->reset_gpio))
-			nop_pdata.needs_reset = true;
+		nop_pdata.gpio_reset = phy->reset_gpio;
 		nop_pdata.type = USB_PHY_TYPE_USB2;
 
 		/* create a NOP PHY device */
@@ -483,14 +482,6 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
 
 		usb_bind_phy("ehci-omap.0", phy->port - 1, phy_id);
 
-		/* Do we need RESET regulator ? */
-		if (gpio_is_valid(phy->reset_gpio)) {
-			scnprintf(rail_name, MAX_STR,
-					"hsusb%d_reset", phy->port);
-			usbhs_add_regulator(rail_name, phy_id, "reset",
-						phy->reset_gpio, 1);
-		}
-
 		/* Do we need VCC regulator ? */
 		if (gpio_is_valid(phy->vcc_gpio)) {
 			scnprintf(rail_name, MAX_STR, "hsusb%d_vcc", phy->port);
maintainer Acked-by
#8 lore raw

Re: [PATCH v3 04/10] ARM: OMAP2+: usb-host: Adapt to USB phy-nop RESET line changes

Quoted 9 lines · Roger Quadros

Hi Tony,

Quoted 4 lines · Roger Quadros

The USB phy-nop nop driver expects the RESET line information to be sent as a GPIO number via platform data. Adapt to that.

Need your Ack on this one as well.

#9 lore raw

PATCH v3 5/10 ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset

In reply to Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
 arch/arm/boot/dts/omap3-beagle.dts |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +1 -12
index dfd8310..71bde47 100644
@@ -44,17 +44,6 @@
 		};
 	};
 
-	/* 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";
@@ -68,7 +57,7 @@
 	/* HS USB Host PHY on PORT 2 */
 	hsusb2_phy: hsusb2_phy {
 		compatible = "usb-nop-xceiv";
-		reset-supply = <&hsusb2_reset>;
+		reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;	/* gpio_147 */
 		vcc-supply = <&hsusb2_power>;
 	};
 
Signature · 1 line
1.7.4.1
#10 lore raw

Re: [PATCH v3 05/10] ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset

Hi Benoit,

Could you please take the device tree related patches [5 to 10] in this series? Thanks.

cheers,
-roger

Quoted 40 lines · Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
 arch/arm/boot/dts/omap3-beagle.dts |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +1 -12
index dfd8310..71bde47 100644
@@ -44,17 +44,6 @@
 		};
 	};
 
-	/* 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";
@@ -68,7 +57,7 @@
 	/* HS USB Host PHY on PORT 2 */
 	hsusb2_phy: hsusb2_phy {
 		compatible = "usb-nop-xceiv";
-		reset-supply = <&hsusb2_reset>;
+		reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;	/* gpio_147 */
 		vcc-supply = <&hsusb2_power>;
 	};
 
#11 lore raw

Re: [PATCH v3 05/10] ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset

Hi Roger,

Yes, I will. I've been waiting for these ones for so long :-)

Thanks,
Benoit

Quoted 50 lines · Roger Quadros

Hi Benoit,

Could you please take the device tree related patches [5 to 10] in this series? Thanks.

cheers,
-roger

Quoted 40 lines · Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
  arch/arm/boot/dts/omap3-beagle.dts |   13 +------------
  1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +1 -12
index dfd8310..71bde47 100644
@@ -44,17 +44,6 @@
  		};
  	};
 
-	/* 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";
@@ -68,7 +57,7 @@
  	/* HS USB Host PHY on PORT 2 */
  	hsusb2_phy: hsusb2_phy {
  		compatible = "usb-nop-xceiv";
-		reset-supply = <&hsusb2_reset>;
+		reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;	/* gpio_147 */
  		vcc-supply = <&hsusb2_power>;
  	};
 
#12 lore raw

Re: [PATCH v3 05/10] ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset

Quoted 3 lines · Benoit Cousson

Hi Roger,

Yes, I will. I've been waiting for these ones for so long :-)

In fact it does not apply correctly on my for_3.13/dts branch :-(

error: arch/arm/boot/dts/omap3-beagle.dts: patch does not apply Patch failed at 0004 ARM: dts: omap3-beagle: Make USB host pin naming consistent

Could you rebase it?

Thanks,
Benoit

Quoted 58 lines

Thanks,
Benoit

Quoted 52 lines · Roger Quadros

Hi Benoit,

Could you please take the device tree related patches [5 to 10] in this series?
Thanks.

cheers,
-roger

Quoted 41 lines · Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
  arch/arm/boot/dts/omap3-beagle.dts |   13 +------------
  1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +1 -12
index dfd8310..71bde47 100644
@@ -44,17 +44,6 @@
          };
      };
 
-    /* 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";
@@ -68,7 +57,7 @@
      /* HS USB Host PHY on PORT 2 */
      hsusb2_phy: hsusb2_phy {
          compatible = "usb-nop-xceiv";
-        reset-supply = <&hsusb2_reset>;
+        reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;    /* gpio_147 */
          vcc-supply = <&hsusb2_power>;
      };
 
#13 lore raw

Re: [PATCH v3 05/10] ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset

Hi Benoit,

Quoted 11 lines · Benoit Cousson
Quoted 3 lines · Benoit Cousson

Hi Roger,

Yes, I will. I've been waiting for these ones for so long :-)

In fact it does not apply correctly on my for_3.13/dts branch :-(

error: arch/arm/boot/dts/omap3-beagle.dts: patch does not apply Patch failed at 0004 ARM: dts: omap3-beagle: Make USB host pin naming consistent

Could you rebase it?

Looks like it was already applied before. Could you please skip that and use the rest? I've checked that the remaining patches apply fine on top of your for_3.13/dts branch.

cheers,
-roger

Quoted 56 lines
Quoted 55 lines · Roger Quadros
Quoted 52 lines

Hi Benoit,

Could you please take the device tree related patches [5 to 10] in this series?
Thanks.

cheers,
-roger

Quoted 41 lines · Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
  arch/arm/boot/dts/omap3-beagle.dts |   13 +------------
  1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +1 -12
index dfd8310..71bde47 100644
@@ -44,17 +44,6 @@
          };
      };
 
-    /* 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";
@@ -68,7 +57,7 @@
      /* HS USB Host PHY on PORT 2 */
      hsusb2_phy: hsusb2_phy {
          compatible = "usb-nop-xceiv";
-        reset-supply = <&hsusb2_reset>;
+        reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;    /* gpio_147 */
          vcc-supply = <&hsusb2_power>;
      };
 
#14 lore raw

Re: [PATCH v3 05/10] ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset

Quoted 10 lines · Roger Quadros

Hi Benoit,

Quoted 7 lines · Benoit Cousson
Quoted 3 lines · Benoit Cousson

Hi Roger,

Yes, I will. I've been waiting for these ones for so long :-)

In fact it does not apply correctly on my for_3.13/dts branch :-(

Quoted 8 lines
Quoted 4 lines

error: arch/arm/boot/dts/omap3-beagle.dts: patch does not apply Patch failed at 0004 ARM: dts: omap3-beagle: Make USB host pin naming consistent

Could you rebase it?

Looks like it was already applied before. Could you please skip that and use the rest? I've checked that the remaining patches apply fine on top of your for_3.13/dts branch.

Indeed, it was already there :-)

Sorry for the noise.

Benoit

Quoted 61 lines

cheers,
-roger

Quoted 56 lines
Quoted 55 lines · Roger Quadros
Quoted 52 lines

Hi Benoit,

Could you please take the device tree related patches [5 to 10] in this series?
Thanks.

cheers,
-roger

Quoted 41 lines · Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
   arch/arm/boot/dts/omap3-beagle.dts |   13 +------------
   1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +1 -12
index dfd8310..71bde47 100644
@@ -44,17 +44,6 @@
           };
       };
 
-    /* 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";
@@ -68,7 +57,7 @@
       /* HS USB Host PHY on PORT 2 */
       hsusb2_phy: hsusb2_phy {
           compatible = "usb-nop-xceiv";
-        reset-supply = <&hsusb2_reset>;
+        reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;    /* gpio_147 */
           vcc-supply = <&hsusb2_power>;
       };
 
#15 lore raw

PATCH v3 6/10 ARM: dts: omap4-panda: Use reset-gpios for hsusb1_reset

In reply to Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
 arch/arm/boot/dts/omap4-panda-common.dtsi |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)
arch/arm/boot/dts/omap4-panda-common.dtsi +1 -17
index faa95b5..c60ebd0 100644
@@ -60,22 +60,6 @@
 			"AFMR", "Line In";
 	};
 
-	/*
-	 * Temp hack: Need to be replaced with the proper gpio-controlled
-	 * reset driver as soon it will be merged.
-	 * http://thread.gmane.org/gmane.linux.drivers.devicetree/36830
-	 */
-	/* 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";
@@ -97,7 +81,7 @@
 	/* HS USB Host PHY on PORT 1 */
 	hsusb1_phy: hsusb1_phy {
 		compatible = "usb-nop-xceiv";
-		reset-supply = <&hsusb1_reset>;
+		reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>;   /* gpio_62 */
 		vcc-supply = <&hsusb1_power>;
 	/**
 	 * FIXME:
Signature · 1 line
1.7.4.1
#16 lore raw

PATCH v3 7/10 ARM: dts: omap5-uevm: Use reset-gpios for hsusb2/3_reset

In reply to Roger Quadros

We no longer need to model the RESET line as a regulator since the USB phy-nop driver accepts "reset-gpios" property.

---
 arch/arm/boot/dts/omap5-uevm.dts |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)
arch/arm/boot/dts/omap5-uevm.dts +2 -24
index 65d7b60..506bdc2 100644
@@ -27,21 +27,10 @@
 		regulator-max-microvolt = <3000000>;
 	};
 
-	/* 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 = <&gpio3 16 GPIO_ACTIVE_HIGH>; /* gpio3_80 HUB_NRESET */
-		startup-delay-us = <70000>;
-		enable-active-high;
-	};
-
 	/* HS USB Host PHY on PORT 2 */
 	hsusb2_phy: hsusb2_phy {
 		compatible = "usb-nop-xceiv";
-		reset-supply = <&hsusb2_reset>;
+		reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */
 	/**
 	  * FIXME
 	  * Put the right clock phandle here when available
@@ -51,21 +40,10 @@
 		clock-frequency = <19200000>;
 	};
 
-	/* HS USB Port 3 RESET */
-	hsusb3_reset: hsusb3_reset_reg {
-		compatible = "regulator-fixed";
-		regulator-name = "hsusb3_reset";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		gpio = <&gpio3 15 GPIO_ACTIVE_HIGH>; /* gpio3_79 ETH_NRESET */
-		startup-delay-us = <70000>;
-		enable-active-high;
-	};
-
 	/* HS USB Host PHY on PORT 3 */
 	hsusb3_phy: hsusb3_phy {
 		compatible = "usb-nop-xceiv";
-		reset-supply = <&hsusb3_reset>;
+		reset-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>; /* gpio3_79 ETH_NRESET */
 	};
 
 	leds {
Signature · 1 line
1.7.4.1
#17 lore raw

PATCH v3 8/10 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 |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +12 -12
index 71bde47..1237822 100644
@@ -90,18 +90,18 @@
 
 	hsusbb2_pins: pinmux_hsusbb2_pins {
 		pinctrl-single,pins = <
-			0x5c0 (PIN_OUTPUT | MUX_MODE3)		/* usbb2_ulpitll_clk.usbb1_ulpiphy_clk */
-			0x5c2 (PIN_OUTPUT | MUX_MODE3)		/* usbb2_ulpitll_clk.usbb1_ulpiphy_stp */
-			0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dir */
-			0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_nxt */
-			0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat0 */
-			0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat1 */
-			0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat2 */
-			0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat3 */
-			0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat4 */
-			0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat5 */
-			0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat6 */
-			0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* usbb2_ulpitll_clk.usbb1_ulpiphy_dat7 */
+			0x5c0 (PIN_OUTPUT | MUX_MODE3)		/* etk_d10.hsusb2_clk */
+			0x5c2 (PIN_OUTPUT | MUX_MODE3)		/* etk_d11.hsusb2_stp */
+			0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d12.hsusb2_dir */
+			0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d13.hsusb2_nxt */
+			0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d14.hsusb2_data0 */
+			0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d15.hsusb2_data1 */
+			0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi1_cs3.hsusb2_data2 */
+			0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_clk.hsusb2_data7 */
+			0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_simo.hsusb2_data4 */
+			0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_somi.hsusb2_data5 */
+			0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs0.hsusb2_data6 */
+			0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs1.hsusb2_data3 */
 		>;
 	};
 
Signature · 1 line
1.7.4.1
#18 lore raw

PATCH v3 9/10 ARM: dts: omap3-beagle-xm: Add USB Host support

In reply to Roger Quadros

Provide RESET GPIO and Power regulator for the USB PHY, the USB Host port mode and the PHY device for the controller. Also provide pin multiplexer information for USB host pins.

We also relocate omap3_pmx_core pin definations so that they are close to omap3_pmx_wkup pin definations.

---
 arch/arm/boot/dts/omap3-beagle-xm.dts |   65 ++++++++++++++++++++++++++++-----
 1 files changed, 56 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap3-beagle-xm.dts +56 -9
index afdb164..b081f5a 100644
@@ -69,6 +69,23 @@
 		};
 
 	};
+
+	/* 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-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */
+		vcc-supply = <&hsusb2_power>;
+	};
 };
 
 &omap3_pmx_wkup {
@@ -79,6 +96,37 @@
 	};
 };
 
+&omap3_pmx_core {
+	pinctrl-names = "default";
+	pinctrl-0 = <
+			&hsusbb2_pins
+	>;
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
+		>;
+	};
+
+	hsusbb2_pins: pinmux_hsusbb2_pins {
+		pinctrl-single,pins = <
+			0x5c0 (PIN_OUTPUT | MUX_MODE3)		/* etk_d10.hsusb2_clk */
+			0x5c2 (PIN_OUTPUT | MUX_MODE3)		/* etk_d11.hsusb2_stp */
+			0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d12.hsusb2_dir */
+			0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d13.hsusb2_nxt */
+			0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d14.hsusb2_data0 */
+			0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d15.hsusb2_data1 */
+			0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi1_cs3.hsusb2_data2 */
+			0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_clk.hsusb2_data7 */
+			0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_simo.hsusb2_data4 */
+			0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_somi.hsusb2_data5 */
+			0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs0.hsusb2_data6 */
+			0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs1.hsusb2_data3 */
+		>;
+	};
+};
+
 &i2c1 {
 	clock-frequency = <2600000>;
 
@@ -148,15 +196,6 @@
 	power = <50>;
 };
 
-&omap3_pmx_core {
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
-			0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
-		>;
-	};
-};
-
 &uart3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart3_pins>;
@@ -166,3 +205,11 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&gpio1_pins>;
 };
+
+&usbhshost {
+	port2-mode = "ehci-phy";
+};
+
+&usbhsehci {
+	phys = <0 &hsusb2_phy>;
+};
Signature · 1 line
1.7.4.1
#19 lore raw

Re: [PATCH v3 09/10] ARM: dts: omap3-beagle-xm: Add USB Host support

Quoted 9 lines · Roger Quadros

Provide RESET GPIO and Power regulator for the USB PHY, the USB Host port mode and the PHY device for the controller. Also provide pin multiplexer information for USB host pins.

We also relocate omap3_pmx_core pin definations so that they are close to omap3_pmx_wkup pin definations.

---

just using this thread, but a question ->

I am kernel * master dec8e46 Merge
tag 'arc-v3.13-rc1-part2' of
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

and I see that VAUX2 which supplies USB_1V8[1] is not enabled -> I did a quick patch and it did seem to work (Usb keyboard, networking, mouse etc on my ehci ports seems to come up good) - any suggestions how we'd like to handle this?

arch/arm/boot/dts/omap3-beagle-xm.dts +8 -0
@@ -169,6 +169,14 @@
        bus-width = <8>;
 };
 
+&vaux2 {
+       regulator-name = "HubPower";
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-always-on;
+};
+
+
 

[1]
https://github.com/CircuitCo/BeagleBoard-xM-RevC/blob/master/BeagleBoard-xM_revC_SCH.pdf?raw=true

Quoted 98 lines
 arch/arm/boot/dts/omap3-beagle-xm.dts |   65 ++++++++++++++++++++++++++++-----
 1 files changed, 56 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap3-beagle-xm.dts +56 -9
index afdb164..b081f5a 100644
@@ -69,6 +69,23 @@
 		};
 
 	};
+
+	/* 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-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */
+		vcc-supply = <&hsusb2_power>;
+	};
 };
 
 &omap3_pmx_wkup {
@@ -79,6 +96,37 @@
 	};
 };
 
+&omap3_pmx_core {
+	pinctrl-names = "default";
+	pinctrl-0 = <
+			&hsusbb2_pins
+	>;
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
+		>;
+	};
+
+	hsusbb2_pins: pinmux_hsusbb2_pins {
+		pinctrl-single,pins = <
+			0x5c0 (PIN_OUTPUT | MUX_MODE3)		/* etk_d10.hsusb2_clk */
+			0x5c2 (PIN_OUTPUT | MUX_MODE3)		/* etk_d11.hsusb2_stp */
+			0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d12.hsusb2_dir */
+			0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d13.hsusb2_nxt */
+			0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d14.hsusb2_data0 */
+			0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d15.hsusb2_data1 */
+			0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi1_cs3.hsusb2_data2 */
+			0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_clk.hsusb2_data7 */
+			0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_simo.hsusb2_data4 */
+			0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_somi.hsusb2_data5 */
+			0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs0.hsusb2_data6 */
+			0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs1.hsusb2_data3 */
+		>;
+	};
+};
+
 &i2c1 {
 	clock-frequency = <2600000>;
 
@@ -148,15 +196,6 @@
 	power = <50>;
 };
 
-&omap3_pmx_core {
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
-			0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
-		>;
-	};
-};
-
 &uart3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart3_pins>;
@@ -166,3 +205,11 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&gpio1_pins>;
 };
+
+&usbhshost {
+	port2-mode = "ehci-phy";
+};
+
+&usbhsehci {
+	phys = <0 &hsusb2_phy>;
+};
Signature · 2 lines
Regards,
Nishanth Menon
#20 lore raw

Re: [PATCH v3 09/10] ARM: dts: omap3-beagle-xm: Add USB Host support

Nishant,

Quoted 15 lines · Nishanth Menon
Quoted 9 lines · Roger Quadros

Provide RESET GPIO and Power regulator for the USB PHY, the USB Host port mode and the PHY device for the controller. Also provide pin multiplexer information for USB host pins.

We also relocate omap3_pmx_core pin definations so that they are close to omap3_pmx_wkup pin definations.

---

just using this thread, but a question ->

Quoted 8 lines

I am kernel * master dec8e46 Merge
tag 'arc-v3.13-rc1-part2' of
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

and I see that VAUX2 which supplies USB_1V8[1] is not enabled -> I did a quick patch and it did seem to work (Usb keyboard, networking, mouse etc on my ehci ports seems to come up good) - any suggestions how we'd like to handle this?

It worked for me without your patch. It could be that u-boot is enabling that regulator for me. I'm on u-boot-v2013.10.

In any case, your patch seems the right thing to do. We should take it in the rc cycle.

Quoted 16 lines
arch/arm/boot/dts/omap3-beagle-xm.dts +8 -0
@@ -169,6 +169,14 @@
        bus-width = <8>;
 };
 
+&vaux2 {
+       regulator-name = "HubPower";
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-always-on;
+};
+
+
 
Quoted 2 lines

[1]
https://github.com/CircuitCo/BeagleBoard-xM-RevC/blob/master/BeagleBoard-xM_revC_SCH.pdf?raw=true

cheers,
-roger

Quoted 101 lines
Quoted 99 lines
 arch/arm/boot/dts/omap3-beagle-xm.dts |   65 ++++++++++++++++++++++++++++-----
 1 files changed, 56 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap3-beagle-xm.dts +56 -9
index afdb164..b081f5a 100644
@@ -69,6 +69,23 @@
 		};
 
 	};
+
+	/* 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-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */
+		vcc-supply = <&hsusb2_power>;
+	};
 };
 
 &omap3_pmx_wkup {
@@ -79,6 +96,37 @@
 	};
 };
 
+&omap3_pmx_core {
+	pinctrl-names = "default";
+	pinctrl-0 = <
+			&hsusbb2_pins
+	>;
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
+		>;
+	};
+
+	hsusbb2_pins: pinmux_hsusbb2_pins {
+		pinctrl-single,pins = <
+			0x5c0 (PIN_OUTPUT | MUX_MODE3)		/* etk_d10.hsusb2_clk */
+			0x5c2 (PIN_OUTPUT | MUX_MODE3)		/* etk_d11.hsusb2_stp */
+			0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d12.hsusb2_dir */
+			0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d13.hsusb2_nxt */
+			0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d14.hsusb2_data0 */
+			0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d15.hsusb2_data1 */
+			0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi1_cs3.hsusb2_data2 */
+			0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_clk.hsusb2_data7 */
+			0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_simo.hsusb2_data4 */
+			0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_somi.hsusb2_data5 */
+			0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs0.hsusb2_data6 */
+			0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs1.hsusb2_data3 */
+		>;
+	};
+};
+
 &i2c1 {
 	clock-frequency = <2600000>;
 
@@ -148,15 +196,6 @@
 	power = <50>;
 };
 
-&omap3_pmx_core {
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
-			0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
-		>;
-	};
-};
-
 &uart3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart3_pins>;
@@ -166,3 +205,11 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&gpio1_pins>;
 };
+
+&usbhshost {
+	port2-mode = "ehci-phy";
+};
+
+&usbhsehci {
+	phys = <0 &hsusb2_phy>;
+};
maintainer
#21 lore raw

Re: [PATCH v3 09/10] ARM: dts: omap3-beagle-xm: Add USB Host support

Quoted 27 lines · Roger Quadros

Nishant,

Quoted 15 lines · Nishanth Menon
Quoted 9 lines · Roger Quadros

Provide RESET GPIO and Power regulator for the USB PHY, the USB Host port mode and the PHY device for the controller. Also provide pin multiplexer information for USB host pins.

We also relocate omap3_pmx_core pin definations so that they are close to omap3_pmx_wkup pin definations.

---

just using this thread, but a question ->

Quoted 8 lines

I am kernel * master dec8e46 Merge
tag 'arc-v3.13-rc1-part2' of
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

and I see that VAUX2 which supplies USB_1V8[1] is not enabled -> I did a quick patch and it did seem to work (Usb keyboard, networking, mouse etc on my ehci ports seems to come up good) - any suggestions how we'd like to handle this?

Quoted 5 lines

It worked for me without your patch. It could be that u-boot is enabling that regulator for me. I'm on u-boot-v2013.10.

In any case, your patch seems the right thing to do. We should take it in the rc cycle.

Can you guys post a proper fix for this? Meanwhile, I'll mark this thread as read to shrink my inbox a bit.

Regards,

Tony

#22 lore raw

Re: [PATCH v3 09/10] ARM: dts: omap3-beagle-xm: Add USB Host support

Quoted 28 lines · Tony Lindgren
Quoted 27 lines · Roger Quadros

Nishant,

Quoted 23 lines · Nishanth Menon
Quoted 9 lines · Roger Quadros

Provide RESET GPIO and Power regulator for the USB PHY, the USB Host port mode and the PHY device for the controller. Also provide pin multiplexer information for USB host pins.

We also relocate omap3_pmx_core pin definations so that they are close to omap3_pmx_wkup pin definations.

---

just using this thread, but a question ->

I am kernel * master dec8e46 Merge
tag 'arc-v3.13-rc1-part2' of
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

and I see that VAUX2 which supplies USB_1V8[1] is not enabled -> I did a quick patch and it did seem to work (Usb keyboard, networking, mouse etc on my ehci ports seems to come up good) - any suggestions how we'd like to handle this?

Quoted 8 lines
Quoted 5 lines

It worked for me without your patch. It could be that u-boot is enabling that regulator for me. I'm on u-boot-v2013.10.

In any case, your patch seems the right thing to do. We should take it in the rc cycle.

Can you guys post a proper fix for this? Meanwhile, I'll mark this thread as read to shrink my inbox a bit.

already done:
https://patchwork.kernel.org/patch/3231151/

#23 lore raw

PATCH v3 10/10 ARM: dts: omap3-beagle: Add USB OTG PHY details

In reply to Roger Quadros

Add information about the USB OTG PHY. Without this the OTG port on beagle will not work.

---
 arch/arm/boot/dts/omap3-beagle.dts |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +7 -0
index 1237822..7669c16 100644
@@ -169,3 +169,10 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&gpio1_pins>;
 };
+
+&usb_otg_hs {
+	interface-type = <0>;
+	usb-phy = <&usb2_phy>;
+	mode = <3>;
+	power = <50>;
+};
Signature · 1 line
1.7.4.1
#24 lore raw
In reply to Roger Quadros

Hi,

Quoted 11 lines · Roger Quadros

Hi,

Modelling the RESET line as a regulator supply wasn't a good idea as it abuses the regulator framework and makes adaptation code/data more complex.

Instead, manage the RESET gpio line directly in the driver.

This also makes us easy to migrate to a dedicated GPIO RESET controller whenever it becomes available.

Quoted 7 lines

Apart from RESET line changes this series also adds USB host support fro beagle-xm and fixes USB OTG port on beagle.

The full series is avilable at
git://github.com/rogerq/linux.git
in branch
phy-reset

The branch is now updated based on v3.12-rc3.

cheers,
-roger

Quoted 60 lines

*NOTE:* As there are changes to platform data, Patch 1 needs to be shared between the arm-soc tree and usb tree.

Patch 1 is available at repo
git://github.com/rogerq/linux.git
in branch
phy-reset-common

Patch 2 contains the phy-nop driver changes
Patches 3 and 4 adapt legacy boot code to the phy-nop driver changes. Patches 5, 6 and 7 adapt DT data to the binding changes. Patch 8 is cleanup of omap3-beagle DT.
Patch 9 adds USB host support to omap3-beagle-xm using the new binding. Patch 10 fixes USB OTG port on beagle.

Patches are based on v3.12-rc1

Tested leacy boot on omap3-beagle and omap3-beagle-xm Tested DT boot on omap3-beagle, omap3-beagle-xm and omap4-panda-es

v3:
- Fix the Initial state of RESET line at probe time.
- Update hsusb3_reset line on omap5-uevm as well.
- Add patch 10 that fixes USB OTG port on beagle.

v2:
- Added RESET GPIO polarity feature
- Changed to gpio_set_value_cansleep()

cheers,
-roger

Roger Quadros (10):
usb: phy: generic: Add gpio_reset to platform data
usb: phy: generic: Don't use regulator framework for RESET line
ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct
usbhs_phy_data
ARM: OMAP2+: usb-host: Adapt to USB phy-nop RESET line changes
ARM: dts: omap3-beagle: Use reset-gpios for hsusb2_reset
ARM: dts: omap4-panda: Use reset-gpios for hsusb1_reset
ARM: dts: omap5-uevm: Use reset-gpios for hsusb2/3_reset
ARM: dts: omap3-beagle: Make USB host pin naming consistent
ARM: dts: omap3-beagle-xm: Add USB Host support
ARM: dts: omap3-beagle: Add USB OTG PHY details

 .../devicetree/bindings/usb/usb-nop-xceiv.txt      |    7 +-
 arch/arm/boot/dts/omap3-beagle-xm.dts              |   65 +++++++++++++--
 arch/arm/boot/dts/omap3-beagle.dts                 |   44 +++++------
 arch/arm/boot/dts/omap4-panda-common.dtsi          |   18 +----
 arch/arm/boot/dts/omap5-uevm.dts                   |   26 +------
 arch/arm/mach-omap2/board-omap3beagle.c            |    6 --
 arch/arm/mach-omap2/usb-host.c                     |   18 ++--
 arch/arm/mach-omap2/usb.h                          |    1 -
 drivers/usb/phy/phy-am335x.c                       |    2 +-
 drivers/usb/phy/phy-generic.c                      |   84 +++++++++++++-------
 drivers/usb/phy/phy-generic.h                      |    6 +-
 include/linux/usb/usb_phy_gen_xceiv.h              |    3 +-
 12 files changed, 153 insertions(+), 127 deletions(-)