USB: phy: phy-nop: Use RESET controller for managing the reset line
Subsystems (2)
cover USB: phy: phy-nop: Use RESET controller for managing the reset line
Hi,
Till now we were modelling the RESET line as a voltage regulator and using the regulator framework to manage it.
[1] introduces a GPIO based reset controller driver. We use that to manage the PHY reset line, at least for DT boots. For legacy boots, will still need to use the regulator framework for reset lines.
Felipe,
The first patch is for you. The Kconfig change might conflict if you apply this on top of my PHY Kconfig cleanup series.
Benoit,
Patches 2 to 6 are for you.
NOTE: All patches depend on [1] which is yet to be merged in.
cheers,
-roger
[1] - http://thread.gmane.org/gmane.linux.drivers.devicetree/41348
Roger Quadros (6):
usb: phy-nop: Use RESET Controller for managing the reset line
ARM: dts: omap3-beagle: Use reset-gpio driver for hsusb2_reset
ARM: dts: omap4-panda: Use reset-gpio driver for hsusb1_reset
ARM: dts: omap5-uevm: Use reset-gpio driver for hsusb2_reset
ARM: dts: omap3-beagle-xm: Add USB Host support
ARM: dts: omap3-beagle: Make USB host pin naming consistent
.../devicetree/bindings/usb/usb-nop-xceiv.txt | 10 ++- arch/arm/boot/dts/omap3-beagle-xm.dts | 75 +++++++++++++++++--- arch/arm/boot/dts/omap3-beagle.dts | 41 +++++------ arch/arm/boot/dts/omap4-panda-common.dtsi | 22 ++---- arch/arm/boot/dts/omap5-uevm.dts | 17 ++--- drivers/usb/phy/Kconfig | 1 + drivers/usb/phy/phy-nop.c | 48 ++++++++++--- 7 files changed, 146 insertions(+), 68 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/6 usb: phy-nop: Use RESET Controller for managing the reset line
Till now we were modelling the RESET line as a voltage regulator and using the regulator framework to manage it.
[1] introduces a GPIO based reset controller driver. We use that to manage the PHY reset line, at least for DT boots. For legacy boots, will still need to use the regulator framework for reset lines.
[1] - http://thread.gmane.org/gmane.linux.drivers.devicetree/41348
--- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 10 +++-- drivers/usb/phy/Kconfig | 1 + drivers/usb/phy/phy-nop.c | 48 +++++++++++++++----- 3 files changed, 44 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt +6 -4
@@ -15,7 +15,9 @@ 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. +- resets: phandle to the reset controller. + +- reset-names: must be "reset" Example:
@@ -25,10 +27,10 @@ Example: clocks = <&osc 0>; clock-names = "main_clk"; vcc-supply = <&hsusb1_vcc_regulator>; - reset-supply = <&hsusb1_reset_regulator>; + resets = <&hsusb1_reset>; + reset-names = "reset" }; 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 hsusb1_reset controls RESET.
drivers/usb/phy/Kconfig +1 -0
@@ -58,6 +58,7 @@ config MV_U3D_PHY config NOP_USB_XCEIV tristate "NOP USB Transceiver Driver" + depends on RESET_CONTROLLER help This driver is to be used by all the usb transceiver which are either built-in with usb ip or which are autonomous and doesn't require any
drivers/usb/phy/phy-nop.c +37 -11
87 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 2/6 ARM: dts: omap3-beagle: Use reset-gpio driver for hsusb2_reset
In reply to Roger QuadrosWe no longer need to model a RESET line as a regulator since we have the reset-gpio driver available.
--- arch/arm/boot/dts/omap3-beagle.dts | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +8 -9
@@ -45,14 +45,12 @@ }; /* 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; + hsusb2_reset: hsusb2_reset { + compatible = "gpio-reset"; + reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */ + reset-delay-us = <70000>; + initially-in-reset; + #reset-cells = <0>; }; /* HS USB Port 2 Power */
@@ -68,7 +66,8 @@ /* HS USB Host PHY on PORT 2 */ hsusb2_phy: hsusb2_phy { compatible = "usb-nop-xceiv"; - reset-supply = <&hsusb2_reset>; + resets = <&hsusb2_reset>; + reset-names = "reset"; vcc-supply = <&hsusb2_power>; };
Signature · 1 line
1.7.4.1
PATCH 3/6 ARM: dts: omap4-panda: Use reset-gpio driver for hsusb1_reset
In reply to Roger QuadrosWe no longer need to model a RESET line as a regulator since we have the reset-gpio driver available.
--- arch/arm/boot/dts/omap4-panda-common.dtsi | 22 ++++++++-------------- 1 files changed, 8 insertions(+), 14 deletions(-)
arch/arm/boot/dts/omap4-panda-common.dtsi +8 -14
@@ -60,20 +60,13 @@ "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; + hsusb1_reset: hsusb1_reset { + compatible = "gpio-reset"; + reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio_62 */ + reset-delay-us = <70000>; + initially-in-reset; + #reset-cells = <0>; }; /* HS USB Port 1 Power */
@@ -97,7 +90,8 @@ /* HS USB Host PHY on PORT 1 */ hsusb1_phy: hsusb1_phy { compatible = "usb-nop-xceiv"; - reset-supply = <&hsusb1_reset>; + resets = <&hsusb1_reset>; + reset-names = "reset"; vcc-supply = <&hsusb1_power>; /** * FIXME:
Signature · 1 line
1.7.4.1
PATCH 4/6 ARM: dts: omap5-uevm: Use reset-gpio driver for hsusb2_reset
In reply to Roger QuadrosWe no longer need to model a RESET line as a regulator since we have the reset-gpio driver available.
--- arch/arm/boot/dts/omap5-uevm.dts | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap5-uevm.dts +8 -9
@@ -28,20 +28,19 @@ }; /* 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; + hsusb2_reset: hsusb2_reset { + compatible = "gpio-reset"; + reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */ + reset-delay-us = <70000>; + initially-in-reset; + #reset-cells = <0>; }; /* HS USB Host PHY on PORT 2 */ hsusb2_phy: hsusb2_phy { compatible = "usb-nop-xceiv"; - reset-supply = <&hsusb2_reset>; + resets = <&hsusb2_reset>; + reset_names = "reset"; /** * FIXME * Put the right clock phandle here when available
Signature · 1 line
1.7.4.1
PATCH 5/6 ARM: dts: omap3-beagle-xm: Add USB Host support
In reply to Roger QuadrosProvide RESET controller and Power regulator for the USB PHY, the USB Host port mode and the PHY device. 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 | 75 +++++++++++++++++++++++++++++---- 1 files changed, 66 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap3-beagle-xm.dts +66 -9
@@ -69,6 +69,33 @@ }; }; + + /* HS USB Port 2 RESET */ + hsusb2_reset: hsusb2_reset { + compatible = "gpio-reset"; + reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */ + reset-delay-us = <70000>; + initially-in-reset; + #reset-cells = <0>; + }; + + /* 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"; + resets = <&hsusb2_reset>; + reset-names = "reset"; + vcc-supply = <&hsusb2_power>; + }; }; &omap3_pmx_wkup {
@@ -79,6 +106,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 +206,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 +215,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
PATCH 6/6 ARM: dts: omap3-beagle: Make USB host pin naming consistent
In reply to Roger QuadrosUse 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
@@ -100,18 +100,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
Re: [PATCH 1/6] usb: phy-nop: Use RESET Controller for managing the reset line
In reply to Roger QuadrosQuoted 10 lines · Roger Quadros
Till now we were modelling the RESET line as a voltage regulator and using the regulator framework to manage it.
[1] introduces a GPIO based reset controller driver. We use that to manage the PHY reset line, at least for DT boots. For legacy boots, will still need to use the regulator framework for reset lines.
[1] - http://thread.gmane.org/gmane.linux.drivers.devicetree/41348
Signed-off-by Roger Quadros <[email protected]>
that's not in mainline yet, right ? Is it guaranteed that it will hit v3.12 merge window ?
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130725/fa2fd658/attachment.sig>
Re: [PATCH 1/6] usb: phy-nop: Use RESET Controller for managing the reset line
Quoted 8 lines · Felipe Balbi
Quoted 7 lines · Roger Quadros
Till now we were modelling the RESET line as a voltage regulator and using the regulator framework to manage it.
[1] introduces a GPIO based reset controller driver. We use that to manage the PHY reset line, at least for DT boots. For legacy boots, will still need to use the regulator framework for reset lines.
Quoted 7 lines
Quoted 3 lines
[1] - http://thread.gmane.org/gmane.linux.drivers.devicetree/41348
Signed-off-by Roger Quadros <[email protected]>that's not in mainline yet, right ? Is it guaranteed that it will hit v3.12 merge window ?
Right. It isn't yet. I'm not sure about 3.12. Let's ask Philipp.
Philipp, is your GPIO Reset driver scheduled for 3.12?
cheers,
-roger
Re: [PATCH 1/6] usb: phy-nop: Use RESET Controller for managing the reset line
In reply to Felipe BalbiHi Felipe,
Quoted 8 lines · Felipe Balbi
Quoted 7 lines · Roger Quadros
Till now we were modelling the RESET line as a voltage regulator and using the regulator framework to manage it.
[1] introduces a GPIO based reset controller driver. We use that to manage the PHY reset line, at least for DT boots. For legacy boots, will still need to use the regulator framework for reset lines.
Quoted 7 lines
Quoted 3 lines
[1] - http://thread.gmane.org/gmane.linux.drivers.devicetree/41348
Signed-off-by Roger Quadros <[email protected]>that's not in mainline yet, right ? Is it guaranteed that it will hit v3.12 merge window ?
Looks like the gpio reset driver might not make it into 3.12.
Now we have two options.
1) leave the nop-phy driver as it is
2) get rid of using regulator framework for reset line and handle the reset gpio directly in the nop-phy driver.
Is it already too late to get (2) into 3.12 if I send the patches in a day or 2?
cheers,
-roger