Skip to contentSkip to conversation

vf610: Add USB support

PATCH RESEND Applied Stefan Agner 5 participants 14 messages Aug 18, 2014 – Sep 3, 2014

Subsystems (8)
lore
Share & tools
lore

Stefan Agner

author reviewer
#0 lore raw

v2 cover vf610: Add USB support

This patchset adds USB support for Vybrid VF610 SoC. It extends the clock framework to support the USB PHY cocks, extends the device tree files and adds support for the non-core registers in the usbmisc_imx driver.

This patchset needs the eSDHC registers length fix available in Shawn's for-next branch, since that overlapped by chance the USB areas.

The whole patchset proved to be working on a Colibri VF61 and Freescale Tower VF65GS10. The first USB controller runs in peripheral mode. I could successfully use RNDIS, however with some stability issues: Suddenly the other side was not reachable anymore and the interface needed to brought down and back up again. I'm still investigating this.

The second USB controller, running in USB host mode, showed errors when connecting devices behind a USB hub:

[  215.163507] usb usb1-port1: cannot reset (err = -32)
[  215.170498] usb usb1-port1: cannot reset (err = -32)
[  215.185120] usb usb1-port1: cannot reset (err = -32)
[  215.191345] usb usb1-port1: cannot reset (err = -32)
[  215.202487] usb usb1-port1: cannot reset (err = -32)
[  215.207718] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  215.219317] usb usb1-port1: unable to enumerate USB device

By extending the PHY driver with the MXS_PHY_NEED_IP_FIX flag, this issue is resolved.

Resend, also added Felipe Balbi this time, sorry about that. I think I only miss the Ack/Review from you here and then things should be fine.

Changes in v2:
- Extended usbmisc_imx to support multiple instances
- Update DT documentation and compatible strings where necessary
- Add USB PHY flag MXS_PHY_NEED_IP_FIX
- Added patches to enable USB on Tower

Stefan Agner (7):
ARM: dts: vf610: Add USB PHY and controller
ARM: imx: clk-vf610: Add USBPHY clocks
usb: phy: mxs: Add VF610 USB PHY support
ARM: dts: vf610: Add usbmisc for non-core registers
chipidea: usbmisc_imx: Add USB support for VF610 SoCs
ARM: dts: vf610-colibri: Add USB support
ARM: dts: vf610-twr: Add USB support

 Documentation/devicetree/bindings/usb/mxs-phy.txt  |  1 +
 .../devicetree/bindings/usb/usbmisc-imx.txt        |  1 +
 arch/arm/boot/dts/vf610-colibri.dts                | 10 ++++
 arch/arm/boot/dts/vf610-twr.dts                    | 10 ++++
 arch/arm/boot/dts/vf610.dtsi                       | 60 ++++++++++++++++++++--
 arch/arm/mach-imx/clk-vf610.c                      | 12 ++++-
 drivers/usb/chipidea/ci_hdrc_imx.c                 |  8 +++
 drivers/usb/chipidea/ci_hdrc_imx.h                 |  1 +
 drivers/usb/chipidea/usbmisc_imx.c                 | 52 +++++++++++++++----
 drivers/usb/phy/phy-mxs-usb.c                      |  6 +++
 include/dt-bindings/clock/vf610-clock.h            |  5 +-
 11 files changed, 149 insertions(+), 17 deletions(-)
Signature · 1 line
2.0.4
author reviewer
#1 lore raw

PATCH RESEND v2 1/7 ARM: dts: vf610: Add USB PHY and controller

This adds USB PHY and USB controller nodes. Vybrid SoCs have two independent USB cores which each supports DR (dual role). However, real OTG is not supported since the OTG ID pin is not available.

The PHYs are located within the anadig register range, hence we need to change the length of the anadig registers.

---
 arch/arm/boot/dts/vf610.dtsi | 46 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 3 deletions(-)
arch/arm/boot/dts/vf610.dtsi +43 -3
index 6a6190c..f36acb5 100644
@@ -25,6 +25,8 @@
 		gpio2 = &gpio3;
 		gpio3 = &gpio4;
 		gpio4 = &gpio5;
+		usbphy0 = &usbphy0;
+		usbphy1 = &usbphy1;
 	};
 
 	cpus {
@@ -285,9 +287,25 @@
 				gpio-ranges = <&iomuxc 0 128 7>;
 			};
 
-			anatop at 40050000 {
-				compatible = "fsl,vf610-anatop";
-				reg = <0x40050000 0x1000>;
+			anatop: anatop at 40050000 {
+				compatible = "fsl,vf610-anatop", "syscon";
+				reg = <0x40050000 0x400>;
+			};
+
+			usbphy0: usbphy at 40050800 {
+				compatible = "fsl,vf610-usbphy";
+				reg = <0x40050800 0x400>;
+				interrupts = <0 50 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks VF610_CLK_USBPHY0>;
+				fsl,anatop = <&anatop>;
+			};
+
+			usbphy1: usbphy at 40050c00 {
+				compatible = "fsl,vf610-usbphy";
+				reg = <0x40050c00 0x400>;
+				interrupts = <0 51 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks VF610_CLK_USBPHY1>;
+				fsl,anatop = <&anatop>;
 			};
 
 			i2c0: i2c at 40066000 {
@@ -309,6 +327,18 @@
 				reg = <0x4006b000 0x1000>;
 				#clock-cells = <1>;
 			};
+
+			usbdev0: usb at 40034000 {
+				compatible = "fsl,vf610-usb", "fsl,imx27-usb";
+				reg = <0x40034000 0x800>;
+				interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks VF610_CLK_USBC0>;
+				fsl,usbphy = <&usbphy0>;
+				dr_mode = "peripheral";
+				status = "disabled";
+			};
+
+
 		};
 
 		aips1: aips-bus at 40080000 {
@@ -371,6 +401,16 @@
 				status = "disabled";
 			};
 
+			usbh1: usb at 400b4000 {
+				compatible = "fsl,vf610-usb", "fsl,imx27-usb";
+				reg = <0x400b4000 0x800>;
+				interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks VF610_CLK_USBC1>;
+				fsl,usbphy = <&usbphy1>;
+				dr_mode = "host";
+				status = "disabled";
+			};
+
 			ftm: ftm at 400b8000 {
 				compatible = "fsl,ftm-timer";
 				reg = <0x400b8000 0x1000 0x400b9000 0x1000>;
Signature · 1 line
2.0.4
author reviewer
#2 lore raw

PATCH RESEND v2 2/7 ARM: imx: clk-vf610: Add USBPHY clocks

In reply to Stefan Agner

This commit adds PLL7 which is required for USBPHY1. It also adds the USB PHY and USB Controller clocks and the gates to enable them.

---
 arch/arm/mach-imx/clk-vf610.c           | 12 ++++++++++--
 include/dt-bindings/clock/vf610-clock.h |  5 ++++-
 2 files changed, 14 insertions(+), 3 deletions(-)
arch/arm/mach-imx/clk-vf610.c +10 -2
index 22dc3ee..159c5c4 100644
@@ -58,6 +58,8 @@
 #define PFD_PLL1_BASE		(anatop_base + 0x2b0)
 #define PFD_PLL2_BASE		(anatop_base + 0x100)
 #define PFD_PLL3_BASE		(anatop_base + 0xf0)
+#define PLL3_CTRL		(anatop_base + 0x10)
+#define PLL7_CTRL		(anatop_base + 0x20)
 
 static void __iomem *anatop_base;
 static void __iomem *ccm_base;
@@ -148,6 +150,9 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
 	clk[VF610_CLK_PLL5_MAIN] = imx_clk_fixed_factor("pll5_main", "fast_clk_sel", 125, 6);
 	/* pll6: default 960Mhz */
 	clk[VF610_CLK_PLL6_MAIN] = imx_clk_fixed_factor("pll6_main", "fast_clk_sel", 40, 1);
+	/* pll7: USB1 PLL at 480MHz */
+	clk[VF610_CLK_PLL7_MAIN] = imx_clk_pllv3(IMX_PLLV3_USB,	"pll7_main", "fast_clk_sel", PLL7_CTRL, 0x2);
+
 	clk[VF610_CLK_PLL1_PFD_SEL] = imx_clk_mux("pll1_pfd_sel", CCM_CCSR, 16, 3, pll1_sels, 5);
 	clk[VF610_CLK_PLL2_PFD_SEL] = imx_clk_mux("pll2_pfd_sel", CCM_CCSR, 19, 3, pll2_sels, 5);
 	clk[VF610_CLK_SYS_SEL] = imx_clk_mux("sys_sel", CCM_CCSR, 0, 3, sys_sels, ARRAY_SIZE(sys_sels));
@@ -160,8 +165,11 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
 	clk[VF610_CLK_PLL4_MAIN_DIV] = clk_register_divider_table(NULL, "pll4_main_div", "pll4_main", 0, CCM_CACRR, 6, 3, 0, pll4_main_div_table, &imx_ccm_lock);
 	clk[VF610_CLK_PLL6_MAIN_DIV] = imx_clk_divider("pll6_main_div", "pll6_main", CCM_CACRR, 21, 1);
 
-	clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "pll3_main", CCM_CCGR1, CCM_CCGRx_CGn(4));
-	clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "pll3_main", CCM_CCGR7, CCM_CCGRx_CGn(4));
+	clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_main", PLL3_CTRL, 6);
+	clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_main", PLL7_CTRL, 6);
+
+	clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(4));
+	clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(4));
 
 	clk[VF610_CLK_QSPI0_SEL] = imx_clk_mux("qspi0_sel", CCM_CSCMR1, 22, 2, qspi_sels, 4);
 	clk[VF610_CLK_QSPI0_EN] = imx_clk_gate("qspi0_en", "qspi0_sel", CCM_CSCDR3, 4);
include/dt-bindings/clock/vf610-clock.h +4 -1
index a916029..6593757 100644
@@ -164,6 +164,9 @@
 #define VF610_CLK_DMAMUX1		151
 #define VF610_CLK_DMAMUX2		152
 #define VF610_CLK_DMAMUX3		153
-#define VF610_CLK_END			154
+#define VF610_CLK_PLL7_MAIN		154
+#define VF610_CLK_USBPHY0		155
+#define VF610_CLK_USBPHY1		156
+#define VF610_CLK_END			157
 
 #endif /* __DT_BINDINGS_CLOCK_VF610_H */
Signature · 1 line
2.0.4
author reviewer
#3 lore raw

PATCH RESEND v2 3/7 usb: phy: mxs: Add VF610 USB PHY support

In reply to Stefan Agner

This adds support for the USB PHY in Vybrid VF610. We assume that the disconnection without VBUS is also needed for Vybrid.

Tests showed, without MXS_PHY_NEED_IP_FIX, enumeration of devices behind a USB Hub fails with errors:

[  215.163507] usb usb1-port1: cannot reset (err = -32)
[  215.170498] usb usb1-port1: cannot reset (err = -32)
[  215.185120] usb usb1-port1: cannot reset (err = -32)
[  215.191345] usb usb1-port1: cannot reset (err = -32)
[  215.202487] usb usb1-port1: cannot reset (err = -32)
[  215.207718] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  215.219317] usb usb1-port1: unable to enumerate USB device

Hence we also enable the MXS_PHY_NEED_IP_FIX flag.

---
 Documentation/devicetree/bindings/usb/mxs-phy.txt | 1 +
 drivers/usb/phy/phy-mxs-usb.c                     | 6 ++++++
 2 files changed, 7 insertions(+)
Documentation/devicetree/bindings/usb/mxs-phy.txt +1 -0
index cef181a..fe3eed8 100644
@@ -5,6 +5,7 @@ Required properties:
 	* "fsl,imx23-usbphy" for imx23 and imx28
 	* "fsl,imx6q-usbphy" for imx6dq and imx6dl
 	* "fsl,imx6sl-usbphy" for imx6sl
+	* "fsl,vf610-usbphy" for Vybrid vf610
   "fsl,imx23-usbphy" is still a fallback for other strings
 - reg: Should contain registers location and length
 - interrupts: Should contain phy interrupt
drivers/usb/phy/phy-mxs-usb.c +6 -0
index c42bdf0..8c2f23b 100644
@@ -125,10 +125,16 @@ static const struct mxs_phy_data imx6sl_phy_data = {
 		MXS_PHY_NEED_IP_FIX,
 };
 
+static const struct mxs_phy_data vf610_phy_data = {
+	.flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS |
+		MXS_PHY_NEED_IP_FIX,
+};
+
 static const struct of_device_id mxs_phy_dt_ids[] = {
 	{ .compatible = "fsl,imx6sl-usbphy", .data = &imx6sl_phy_data, },
 	{ .compatible = "fsl,imx6q-usbphy", .data = &imx6q_phy_data, },
 	{ .compatible = "fsl,imx23-usbphy", .data = &imx23_phy_data, },
+	{ .compatible = "fsl,vf610-usbphy", .data = &vf610_phy_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
Signature · 1 line
2.0.4
author reviewer
#4 lore raw

Re: [PATCH RESEND v2 3/7] usb: phy: mxs: Add VF610 USB PHY support

I think I still miss a Signed-Off-By Felipe Balbi here...

All the rest should make it into 3.18, but USB without PHY is no fun to use ;-)

Am 2014-08-19 01:37, schrieb Stefan Agner:

Quoted 57 lines

This adds support for the USB PHY in Vybrid VF610. We assume that the disconnection without VBUS is also needed for Vybrid.

Tests showed, without MXS_PHY_NEED_IP_FIX, enumeration of devices behind a USB Hub fails with errors:

[  215.163507] usb usb1-port1: cannot reset (err = -32)
[  215.170498] usb usb1-port1: cannot reset (err = -32)
[  215.185120] usb usb1-port1: cannot reset (err = -32)
[  215.191345] usb usb1-port1: cannot reset (err = -32)
[  215.202487] usb usb1-port1: cannot reset (err = -32)
[  215.207718] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  215.219317] usb usb1-port1: unable to enumerate USB device

Hence we also enable the MXS_PHY_NEED_IP_FIX flag.

---
 Documentation/devicetree/bindings/usb/mxs-phy.txt | 1 +
 drivers/usb/phy/phy-mxs-usb.c                     | 6 ++++++
 2 files changed, 7 insertions(+)
Documentation/devicetree/bindings/usb/mxs-phy.txt +1 -0
index cef181a..fe3eed8 100644
@@ -5,6 +5,7 @@ Required properties:
 	* "fsl,imx23-usbphy" for imx23 and imx28
 	* "fsl,imx6q-usbphy" for imx6dq and imx6dl
 	* "fsl,imx6sl-usbphy" for imx6sl
+	* "fsl,vf610-usbphy" for Vybrid vf610
   "fsl,imx23-usbphy" is still a fallback for other strings
 - reg: Should contain registers location and length
 - interrupts: Should contain phy interrupt
drivers/usb/phy/phy-mxs-usb.c +6 -0
index c42bdf0..8c2f23b 100644
@@ -125,10 +125,16 @@ static const struct mxs_phy_data imx6sl_phy_data = {
 		MXS_PHY_NEED_IP_FIX,
 };
 
+static const struct mxs_phy_data vf610_phy_data = {
+	.flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS |
+		MXS_PHY_NEED_IP_FIX,
+};
+
 static const struct of_device_id mxs_phy_dt_ids[] = {
 	{ .compatible = "fsl,imx6sl-usbphy", .data = &imx6sl_phy_data, },
 	{ .compatible = "fsl,imx6q-usbphy", .data = &imx6q_phy_data, },
 	{ .compatible = "fsl,imx23-usbphy", .data = &imx23_phy_data, },
+	{ .compatible = "fsl,vf610-usbphy", .data = &vf610_phy_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
#5 lore raw

Re: [PATCH RESEND v2 3/7] usb: phy: mxs: Add VF610 USB PHY support

Hi,

Quoted 4 lines · Stefan Agner

I think I still miss a Signed-Off-By Felipe Balbi here...

All the rest should make it into 3.18, but USB without PHY is no fun to use ;-)

this is already in my testing/next

https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/commit/?h=testing/next&id=d0ee68b59e6aa33221445dc555efac3736b89026

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140903/7fffe03e/attachment.sig>
author reviewer
#6 lore raw

PATCH RESEND v2 4/7 ARM: dts: vf610: Add usbmisc for non-core registers

In reply to Stefan Agner

Add device tree node for usbmisc which controls the non-core USB registers. This is required to use the property to disable the over- current detection.

---
 arch/arm/boot/dts/vf610.dtsi | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
arch/arm/boot/dts/vf610.dtsi +15 -1
index f36acb5..a49d739 100644
@@ -334,11 +334,17 @@
 				interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks VF610_CLK_USBC0>;
 				fsl,usbphy = <&usbphy0>;
+				fsl,usbmisc = <&usbmisc0 0>;
 				dr_mode = "peripheral";
 				status = "disabled";
 			};
 
-
+			usbmisc0: usb at 40034800 {
+				#index-cells = <1>;
+				compatible = "fsl,vf610-usbmisc";
+				reg = <0x40034800 0x200>;
+				clocks = <&clks VF610_CLK_USBC0>;
+			};
 		};
 
 		aips1: aips-bus at 40080000 {
@@ -407,10 +413,18 @@
 				interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks VF610_CLK_USBC1>;
 				fsl,usbphy = <&usbphy1>;
+				fsl,usbmisc = <&usbmisc1 0>;
 				dr_mode = "host";
 				status = "disabled";
 			};
 
+			usbmisc1: usb at 400b4800 {
+				#index-cells = <1>;
+				compatible = "fsl,vf610-usbmisc";
+				reg = <0x400b4800 0x200>;
+				clocks = <&clks VF610_CLK_USBC1>;
+			};
+
 			ftm: ftm at 400b8000 {
 				compatible = "fsl,ftm-timer";
 				reg = <0x400b8000 0x1000 0x400b9000 0x1000>;
Signature · 1 line
2.0.4
author reviewer
#7 lore raw

PATCH RESEND v2 5/7 chipidea: usbmisc_imx: Add USB support for VF610 SoCs

In reply to Stefan Agner

This adds Vybrid VF610 SoC support. The IP is very similar to i.MX6, however, the non-core registers are spread in two different register areas. Hence we support multiple instances of the USB misc driver and add the driver instance to the imx_usbmisc_data structure.

---
 .../devicetree/bindings/usb/usbmisc-imx.txt        |  1 +
 drivers/usb/chipidea/ci_hdrc_imx.c                 |  8 ++++
 drivers/usb/chipidea/ci_hdrc_imx.h                 |  1 +
 drivers/usb/chipidea/usbmisc_imx.c                 | 52 +++++++++++++++++-----
 4 files changed, 51 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/usb/usbmisc-imx.txt +1 -0
index 97ce94e..c101a4b 100644
@@ -4,6 +4,7 @@ Required properties:
 - #index-cells: Cells used to descibe usb controller index. Should be <1>
 - compatible: Should be one of below:
 	"fsl,imx6q-usbmisc" for imx6q
+	"fsl,vf610-usbmisc" for Vybrid vf610
 - reg: Should contain registers location and length
 
 Examples:
drivers/usb/chipidea/ci_hdrc_imx.c +8 -0
index 2e58f8d..9af12b4 100644
@@ -54,6 +54,7 @@ struct ci_hdrc_imx_data {
 
 static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
 {
+	struct platform_device *misc_pdev;
 	struct device_node *np = dev->of_node;
 	struct of_phandle_args args;
 	struct imx_usbmisc_data *data;
@@ -79,8 +80,15 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
 	}
 
 	data->index = args.args[0];
+
+	misc_pdev = of_find_device_by_node(args.np);
 	of_node_put(args.np);
 
+	if (!misc_pdev)
+		return ERR_PTR(-EPROBE_DEFER);
+
+	data->dev = &misc_pdev->dev;
+
 	if (of_find_property(np, "disable-over-current", NULL))
 		data->disable_oc = 1;
 
drivers/usb/chipidea/ci_hdrc_imx.h +1 -0
index 996ec93..4ed828f 100644
@@ -13,6 +13,7 @@
 #define __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
 
 struct imx_usbmisc_data {
+	struct device *dev;
 	int index;
 
 	unsigned int disable_oc:1; /* over current detect disabled */
drivers/usb/chipidea/usbmisc_imx.c +41 -11

135 lines not on this page · raw message

Signature · 1 line
2.0.4
author reviewer
#8 lore raw

PATCH RESEND v2 6/7 ARM: dts: vf610-colibri: Add USB support

In reply to Stefan Agner

Add USB support for Colibri VF61 modules. The Colibri standard pinout defines a pin for USB over-current. However, due to lack of pinmux options, the USB hosts over-current protection signal of the Colibri standard could not be connected to the PHY's over-current protection. Hence we need to disable the over-current functionality of the USB controller.

---
 arch/arm/boot/dts/vf610-colibri.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/vf610-colibri.dts +10 -0
index aecc7db..f2a950d 100644
@@ -69,6 +69,16 @@
 	status = "okay";
 };
 
+&usbdev0 {
+	disable-over-current;
+	status = "okay";
+};
+
+&usbh1 {
+	disable-over-current;
+	status = "okay";
+};
+
 &iomuxc {
 	vf610-colibri {
 		pinctrl_esdhc1: esdhc1grp {
Signature · 1 line
2.0.4
author reviewer
#9 lore raw

PATCH RESEND v2 7/7 ARM: dts: vf610-twr: Add USB support

In reply to Stefan Agner

Add USB support for Freescale Vybrid tower. The USB hosts over-current protection signal is not connected is not connected to the PHY's over- current protection, hence we need to disable it.

---
 arch/arm/boot/dts/vf610-twr.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/vf610-twr.dts +10 -0
index 11d7334..c709dc3 100644
@@ -265,3 +265,13 @@
 	pinctrl-0 = <&pinctrl_uart1>;
 	status = "okay";
 };
+
+&usbdev0 {
+	disable-over-current;
+	status = "okay";
+};
+
+&usbh1 {
+	disable-over-current;
+	status = "okay";
+};
Signature · 1 line
2.0.4
#10 lore raw

Re: [PATCH RESEND v2 7/7] ARM: dts: vf610-twr: Add USB support

Hello.

Quoted 2 lines · Stefan Agner

Add USB support for Freescale Vybrid tower. The USB hosts over-current protection signal is not connected is not connected to the PHY's over-

Yes, we all understood that it's not connected, no need to repeat. ;-)

Quoted 3 lines

current protection, hence we need to disable it.

WBR, Sergei

#11 lore raw

Re: [PATCH RESEND v2 7/7] ARM: dts: vf610-twr: Add USB support

Quoted 8 lines · Sergei Shtylyov

Hello.

Quoted 2 lines · Stefan Agner

Add USB support for Freescale Vybrid tower. The USB hosts over-current protection signal is not connected is not connected to the PHY's over-

Yes, we all understood that it's not connected, no need to repeat. ;-)

I will fix it up when applying.

Shawn

#12 lore raw
In reply to Stefan Agner
Quoted 40 lines · Stefan Agner

This patchset adds USB support for Vybrid VF610 SoC. It extends the clock framework to support the USB PHY cocks, extends the device tree files and adds support for the non-core registers in the usbmisc_imx driver.

This patchset needs the eSDHC registers length fix available in Shawn's for-next branch, since that overlapped by chance the USB areas.

The whole patchset proved to be working on a Colibri VF61 and Freescale Tower VF65GS10. The first USB controller runs in peripheral mode. I could successfully use RNDIS, however with some stability issues: Suddenly the other side was not reachable anymore and the interface needed to brought down and back up again. I'm still investigating this.

The second USB controller, running in USB host mode, showed errors when connecting devices behind a USB hub:

[  215.163507] usb usb1-port1: cannot reset (err = -32)
[  215.170498] usb usb1-port1: cannot reset (err = -32)
[  215.185120] usb usb1-port1: cannot reset (err = -32)
[  215.191345] usb usb1-port1: cannot reset (err = -32)
[  215.202487] usb usb1-port1: cannot reset (err = -32)
[  215.207718] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  215.219317] usb usb1-port1: unable to enumerate USB device

By extending the PHY driver with the MXS_PHY_NEED_IP_FIX flag, this issue is resolved.

Resend, also added Felipe Balbi this time, sorry about that. I think I only miss the Ack/Review from you here and then things should be fine.

Changes in v2:
- Extended usbmisc_imx to support multiple instances
- Update DT documentation and compatible strings where necessary
- Add USB PHY flag MXS_PHY_NEED_IP_FIX
- Added patches to enable USB on Tower

Quoted 6 lines

Stefan Agner (7):
ARM: dts: vf610: Add USB PHY and controller
ARM: imx: clk-vf610: Add USBPHY clocks
usb: phy: mxs: Add VF610 USB PHY support
ARM: dts: vf610: Add usbmisc for non-core registers
chipidea: usbmisc_imx: Add USB support for VF610 SoCs

This driver change is already at my tree, but it is too late for 3.17-rc1 when you sent, so I sent it to greg for v3.18.

Peter

Quoted 19 lines

ARM: dts: vf610-colibri: Add USB support
ARM: dts: vf610-twr: Add USB support

 Documentation/devicetree/bindings/usb/mxs-phy.txt  |  1 +
 .../devicetree/bindings/usb/usbmisc-imx.txt        |  1 +
 arch/arm/boot/dts/vf610-colibri.dts                | 10 ++++
 arch/arm/boot/dts/vf610-twr.dts                    | 10 ++++
 arch/arm/boot/dts/vf610.dtsi                       | 60 ++++++++++++++++++++--
 arch/arm/mach-imx/clk-vf610.c                      | 12 ++++-
 drivers/usb/chipidea/ci_hdrc_imx.c                 |  8 +++
 drivers/usb/chipidea/ci_hdrc_imx.h                 |  1 +
 drivers/usb/chipidea/usbmisc_imx.c                 | 52 +++++++++++++++----
 drivers/usb/phy/phy-mxs-usb.c                      |  6 +++
 include/dt-bindings/clock/vf610-clock.h            |  5 +-
 11 files changed, 149 insertions(+), 17 deletions(-)
Signature · 1 line
2.0.4
Signature · 2 lines
Best Regards,
Peter Chen
Applied
#13 lore raw
In reply to Stefan Agner
Quoted 3 lines · Stefan Agner

Stefan Agner (7):
ARM: dts: vf610: Add USB PHY and controller
ARM: imx: clk-vf610: Add USBPHY clocks

...

Quoted 1 line

ARM: dts: vf610: Add usbmisc for non-core registers

...

Quoted 2 lines

ARM: dts: vf610-colibri: Add USB support
ARM: dts: vf610-twr: Add USB support

Applied these 5 patches, thanks.