ARM: dts: imx51-babbage: Add USB Host1 support
Subsystems (2)
Fabio Estevam
reviewerPATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
From: Fabio Estevam <[email protected]>
Signed-off by: Dave Ebright <[email protected]>
--- arch/arm/boot/dts/imx51-babbage.dts | 42 +++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/imx51.dtsi | 8 +++++++ 2 files changed, 50 insertions(+)
arch/arm/boot/dts/imx51-babbage.dts +42 -0
@@ -119,6 +119,23 @@ gpios = <&gpio4 26 GPIO_ACTIVE_LOW>; }; }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + + reg_usb_vbus: regulator at 0 { + compatible = "regulator-fixed"; + reg = <0>; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio2 5 0>; + enable-active-high; + }; + }; + }; &esdhc1 {
@@ -461,6 +478,23 @@ MX51_PAD_EIM_D24__UART3_CTS 0x1c5 >; }; + + pinctrl_usbh1: usbh1grp { + fsl,pins = < + MX51_PAD_USBH1_CLK__USBH1_CLK 0x80000000 + MX51_PAD_USBH1_DIR__USBH1_DIR 0x80000000 + MX51_PAD_USBH1_NXT__USBH1_NXT 0x80000000 + MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x80000000 + MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x80000000 + MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x80000000 + MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x80000000 + MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x80000000 + MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x80000000 + MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x80000000 + MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x80000000 + MX51_PAD_EIM_D21__GPIO2_5 0x80000000 + >; + }; }; };
@@ -529,3 +563,11 @@ >; status = "okay"; }; + +&usbh1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; + vbus-supply = <®_usb_vbus>; + phy_type = "ulpi"; + status = "okay"; +};
arch/arm/boot/dts/imx51.dtsi +8 -0
@@ -100,6 +100,13 @@ clocks = <&clks IMX5_CLK_USB_PHY_GATE>; clock-names = "main_clk"; }; + + usbphy1: usbphy at 1 { + compatible = "usb-nop-xceiv"; + reg = <1>; + clocks = <&clks IMX5_CLK_USB_PHY_GATE>; + clock-names = "main_clk"; + }; }; soc {
@@ -239,6 +246,7 @@ interrupts = <14>; clocks = <&clks IMX5_CLK_USBOH3_GATE>; fsl,usbmisc = <&usbmisc 1>; + fsl,usbphy = <&usbphy1>; status = "disabled"; };
Signature · 1 line
1.8.1.2
Fabio Estevam
reviewerPATCH 2/2 ARM: dts: imx51-babbage: Add USB OTG support
From: Fabio Estevam <[email protected]>
Tested by pinging from the host PC to the imx51-babbage via a g_ether connection.
Signed-off by: Dave Ebright <[email protected]>
---
For USB OTG to work on mx51 the following driver patch is needed:
http://marc.info/?l=linux-usb&m=139571614508749&w=2
arch/arm/boot/dts/imx51-babbage.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/imx51-babbage.dts +7 -0
@@ -571,3 +571,10 @@ phy_type = "ulpi"; status = "okay"; }; + +&usbotg { + dr_mode = "peripheral"; + disable-over-current; + phy_type = "utmi"; + status = "okay"; +};
Signature · 1 line
1.8.1.2
PATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
In reply to Fabio EstevamQuoted 74 lines
arch/arm/boot/dts/imx51-babbage.dts +42
-0@@ -119,6 +119,23 @@ gpios = <&gpio4 26 GPIO_ACTIVE_LOW>; }; }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + + reg_usb_vbus: regulator at 0 { + compatible = "regulator-fixed"; + reg = <0>; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio2 5 0>; + enable-active-high; + }; + }; + }; &esdhc1 {@@ -461,6 +478,23 @@ MX51_PAD_EIM_D24__UART3_CTS 0x1c5 >; }; + + pinctrl_usbh1: usbh1grp { + fsl,pins = < + MX51_PAD_USBH1_CLK__USBH1_CLK 0x80000000 + MX51_PAD_USBH1_DIR__USBH1_DIR 0x80000000 + MX51_PAD_USBH1_NXT__USBH1_NXT 0x80000000 + MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x80000000 + MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x80000000 + MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x80000000 + MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x80000000 + MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x80000000 + MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x80000000 + MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x80000000 + MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x80000000 + MX51_PAD_EIM_D21__GPIO2_5 0x80000000 + >; + }; }; };@@ -529,3 +563,11 @@ >; status = "okay"; }; + +&usbh1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; + vbus-supply = <®_usb_vbus>; + phy_type = "ulpi"; + status = "okay"; +};arch/arm/boot/dts/imx51.dtsi +0
-0@@ -100,6 +100,13 @@ clocks = <&clks IMX5_CLK_USB_PHY_GATE>; clock-names = "main_clk";
arch/arm/boot/dts/imx51.dtsi line 111
Quoted 10 lines
arch/arm/boot/dts/imx51.dtsi +7
-0}; + + usbphy1: usbphy at 1 { + compatible = "usb-nop-xceiv"; + reg = <1>; + clocks = <&clks IMX5_CLK_USB_PHY_GATE>; + clock-names = "main_clk"; + }; };
You are using usb nop phy driver (phy-generic.c) for ulpi phy, Are you sure your phy doesn't need any configurations from viewport?
Peter
Quoted 18 lines
arch/arm/boot/dts/imx51.dtsi +1
-1soc {@@ -239,6 +246,7 @@ interrupts = <14>; clocks = <&clks IMX5_CLK_USBOH3_GATE>; fsl,usbmisc = <&usbmisc 1>; + fsl,usbphy = <&usbphy1>; status = "disabled"; }; --1.8.1.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Fabio Estevam
reviewerPATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
Hi Peter,
Quoted 10 lines · Peter Chen
arch/arm/boot/dts/imx51.dtsi line 110
Quoted 9 lines
arch/arm/boot/dts/imx51.dtsi +7
-0+ + usbphy1: usbphy at 1 { + compatible = "usb-nop-xceiv"; + reg = <1>; + clocks = <&clks IMX5_CLK_USB_PHY_GATE>; + clock-names = "main_clk"; + }; };
Quoted 2 lines
You are using usb nop phy driver (
phy-generic.c) for ulpi phy, Are you sure your phy doesn't need any configurations from viewport?
I am not sure I understood your comment.
This node is the same like we do on mx53 and other i.mx SoCs.
Both USB host and OTG are functional.
Could you please explain your concern?
Regards,
Fabio Estevam
PATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
Quoted 16 lines
Quoted 10 lines · Peter Chen
Quoted 9 lines
arch/arm/boot/dts/imx51.dtsi +7
-0+ + usbphy1: usbphy at 1 { + compatible = "usb-nop-xceiv"; + reg = <1>; + clocks = <&clks IMX5_CLK_USB_PHY_GATE>; + clock-names = "main_clk"; + }; };
Quoted 7 lines
Quoted 2 lines
You are using usb nop phy driver (
phy-generic.c) for ulpi phy, Are you sure your phy doesn't need any configurations from viewport?I am not sure I understood your comment.
This node is the same like we do on mx53 and other i.mx SoCs.
For imx53, it can work since both usbotg and host 1 use utmi internal phy. But for SoCs before than imx53 (including imx51), the host1 uses external phy. At non-dt version, they should use ulpi phy driver.
Peter
Quoted 8 lines
Both USB host and OTG are functional.
Could you please explain your concern?
Regards,
Fabio Estevam
PATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
Peter,
Yes for the i.MX51 EVK the USB host 1 has an external PHY (USB3317 HS ULPI USB transceiver) which has an integrated 3.3V regulator. It is used in host only mode. In the older versions (pre device tree) of the code, the isp1504 driver was used for the USB3317. For the device tree in the usbphy1 node it is defined as usb-nop-xceiv, but in the usbh1 node phy_type is ulpi. The reason the usb-nop-xceiv was used is because we could not find any other specific "compatible" value in the PHY drivers for the USB3317 external PHY (HS ULPI USB transceiver) for the USB host 1 port, thus using the generic driver. Could not find an isp1504 or USB3317 driver. Again it is a host only port and thus the generic phy driver is working at least on the i.MX51 EVK. The hub attached to the host port comes up and have successfully attached several types of USB devices to the two ports on the attached hub.
The phy_type of ulpi is needed by the ChipIdea drivers for PHY initialization. So it is using ulpi PHY init.
I looked for all references to ulpi_viewport_access_ops and did find that imx_otg_ulpi_create() references it, but this function is not called from any i.MX51 code (does not use ulpi viewport). For the i.MX51 the external PHY/transceiver is not used for OTG, it is only used as a host port.
Dave
-----Original Message-----
From: Peter Chen [mailto:Peter.Chen at freescale.com]
Sent: Wednesday, March 26, 2014 1:36 AM
To: Fabio Estevam
Cc: Shawn Guo; linux-arm-kernel at lists.infradead.org; Fabio.Estevam at freescale.com; Ebright, Dave
Subject: RE: [PATCH 1/2] ARM: dts: imx51-babbage: Add USB Host1 support
Quoted 15 lines
Quoted 10 lines · Peter Chen
Quoted 9 lines
arch/arm/boot/dts/imx51.dtsi +7
-0+ + usbphy1: usbphy at 1 { + compatible = "usb-nop-xceiv"; + reg = <1>; + clocks = <&clks IMX5_CLK_USB_PHY_GATE>; + clock-names = "main_clk"; + }; };
Quoted 7 lines
Quoted 2 lines
You are using usb nop phy driver (
phy-generic.c) for ulpi phy, Are you sure your phy doesn't need any configurations from viewport?I am not sure I understood your comment.
This node is the same like we do on mx53 and other i.mx SoCs.
For imx53, it can work since both usbotg and host 1 use utmi internal phy.
But for SoCs before than imx53 (including imx51), the host1 uses external phy. At non-dt version, they should use ulpi phy driver.
Peter
Quoted 8 lines
Both USB host and OTG are functional.
Could you please explain your concern?
Regards,
Fabio Estevam
Fabio Estevam
reviewerPATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
In reply to Peter ChenQuoted 3 lines · Peter Chen
For imx53, it can work since both usbotg and host 1 use utmi internal phy. But for SoCs before than imx53 (including imx51), the host1 uses external phy. At non-dt version, they should use ulpi phy driver.
Ok, got it. Please check v2.
Regards,
Fabio Estevam
PATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
In reply to Ebright, DaveQuoted 19 lines
Peter,
Yes for the i.MX51 EVK the USB host 1 has an external PHY (USB3317 HS ULPI USB transceiver) which has an integrated 3.3V regulator. It is used in host only mode. In the older versions (pre device tree) of the code, the isp1504 driver was used for the USB3317. For the device tree in the usbphy1 node it is defined as usb-nop-xceiv, but in the usbh1 node
phy_typeis ulpi. The reason the usb-nop-xceiv was used is because we could not find any other specific "compatible" value in the PHY drivers for the USB3317 external PHY (HS ULPI USB transceiver) for the USB host 1 port, thus using the generic driver. Could not find an isp1504 or USB3317 driver. Again it is a host only port and thus the generic phy driver is working at least on the i.MX51 EVK. The hub attached to the host port comes up and have successfully attached several types of USB devices to the two ports on the attached hub.
Quoted 9 lines
The
phy_typeof ulpi is needed by the ChipIdea drivers for PHY initialization. So it is using ulpi PHY init.I looked for all references to
ulpi_viewport_access_opsand did find thatimx_otg_ulpi_create()references it, but this function is not called from any i.MX51 code (does not use ulpi viewport). For the i.MX51 the external PHY/transceiver is not used for OTG, it is only used as a host port.
The ulpi phy driver still has not device tree version, so you can't find related driver.
So, the default ulpi configuration at imx5-bbg board (3317 ulpi phy on it) works fine according to you and Fabio's test.
The current situation is: nop phy driver can be used due to default configuration can be used. But in fact, your phy at host 1 is ulpi, but ulpi driver is lack of device tree support.
Let Shawn decide whether it can be accept or not.
Peter
Quoted 49 lines
Dave
-----Original Message-----
From: Peter Chen [mailto:Peter.Chen at freescale.com]
Sent: Wednesday, March 26, 2014 1:36 AM
To: Fabio Estevam
Cc: Shawn Guo; linux-arm-kernel at lists.infradead.org; Fabio.Estevam at freescale.com; Ebright, Dave
Subject: RE: [PATCH 1/2] ARM: dts: imx51-babbage: Add USB Host1 supportQuoted 15 lines
Quoted 10 lines · Peter Chen
Quoted 9 lines
arch/arm/boot/dts/imx51.dtsi +7
-0+ + usbphy1: usbphy at 1 { + compatible = "usb-nop-xceiv"; + reg = <1>; + clocks = <&clks IMX5_CLK_USB_PHY_GATE>; + clock-names = "main_clk"; + }; };Quoted 7 lines
Quoted 2 lines
You are using usb nop phy driver (
phy-generic.c) for ulpi phy, Are you sure your phy doesn't need any configurations from viewport?I am not sure I understood your comment.
This node is the same like we do on mx53 and other i.mx SoCs.
For imx53, it can work since both usbotg and host 1 use utmi internal phy. But for SoCs before than imx53 (including imx51), the host1 uses external phy. At non-dt version, they should use ulpi phy driver.
Peter
Quoted 8 lines
Both USB host and OTG are functional.
Could you please explain your concern?
Regards,
Fabio Estevam
Fabio Estevam
reviewerPATCH 1/2 ARM: dts: imx51-babbage: Add USB Host1 support
Hi Peter,
Quoted 9 lines · Peter Chen
The ulpi phy driver still has not device tree version, so you can't find related driver.
So, the default ulpi configuration at imx5-bbg board (3317 ulpi phy on it) works fine according to you and Fabio's test.
The current situation is: nop phy driver can be used due to default configuration can be used. But in fact, your phy at host 1 is ulpi, but ulpi driver is lack of device tree support.
Quoted 3 lines
Let Shawn decide whether it can be accept or not.
From
drivers/usb/phy/phy-generic.c:
" * NOP USB transceiver for all USB transceiver which are either built-in
* into USB IP or which are mostly autonomous."
The USB PHY 3317 falls into the 'mostly automous', so that's why it works fine with this driver.
mx27 also uses 'usb-nop-xceiv' on the ULPI PHY, so I don't see any issue in doing the same for mx51.
I have sent a v2 for this series.
Regards,
Fabio Estevam