linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
@ 2014-03-07 17:04 Denis Carikli
  2014-03-07 17:04 ` [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy Denis Carikli
                   ` (10 more replies)
  0 siblings, 11 replies; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 drivers/usb/chipidea/usbmisc_imx.c |   59 ++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index cd061ab..d956ad0 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -21,6 +21,26 @@
 #define MX25_USB_PHY_CTRL_OFFSET	0x08
 #define MX25_BM_EXTERNAL_VBUS_DIVIDER	BIT(23)
 
+#define MXC_EHCI_INTERFACE_SINGLE_UNI	(2 << 0)
+#define MXC_EHCI_INTERFACE_DIFF_UNI	(0 << 0)
+#define MXC_EHCI_INTERFACE_MASK		(0xf)
+
+#define MX25_OTG_SIC_SHIFT		29
+#define MX25_OTG_SIC_MASK		(0x3 << MX25_OTG_SIC_SHIFT)
+#define MX25_OTG_PM_BIT			BIT(24)
+#define MX25_OTG_PP_BIT			BIT(11)
+#define MX25_OTG_OCPOL_BIT		(1 << 3)
+
+#define MX25_H1_SIC_SHIFT		21
+#define MX25_H1_SIC_MASK		(0x3 << MX25_H1_SIC_SHIFT)
+#define MX25_H1_PP_BIT			BIT(18)
+#define MX25_H1_PM_BIT			BIT(16)
+#define MX25_H1_IPPUE_UP_BIT		BIT(7)
+#define MX25_H1_IPPUE_DOWN_BIT		BIT(6)
+#define MX25_H1_TLL_BIT			BIT(5)
+#define MX25_H1_USBTE_BIT		BIT(4)
+#define MX25_H1_OCPOL_BIT		(1 << 2)
+
 #define MX27_H1_PM_BIT			BIT(8)
 #define MX27_H2_PM_BIT			BIT(16)
 #define MX27_OTG_PM_BIT			BIT(24)
@@ -50,6 +70,40 @@ struct imx_usbmisc {
 
 static struct imx_usbmisc *usbmisc;
 
+static int usbmisc_imx25_init(struct imx_usbmisc_data *data)
+{
+	void __iomem *reg = NULL;
+	unsigned long flags;
+	u32 val = 0;
+
+	if (data->index > 1)
+		return -EINVAL;
+
+	spin_lock_irqsave(&usbmisc->lock, flags);
+	switch (data->index) {
+	case 0:
+		val = readl(usbmisc->base);
+		val &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PP_BIT);
+		val |= (MXC_EHCI_INTERFACE_DIFF_UNI & MXC_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT;
+		val |= (MX25_OTG_PM_BIT | MX25_OTG_OCPOL_BIT);
+		writel(val, usbmisc->base);
+		break;
+	case 1:
+		val = readl(usbmisc->base);
+		val &= ~(MX25_H1_SIC_MASK | MX25_H1_PP_BIT |  MX25_H1_IPPUE_UP_BIT);
+		val |= (MXC_EHCI_INTERFACE_SINGLE_UNI & MXC_EHCI_INTERFACE_MASK) << MX25_H1_SIC_SHIFT;
+		val |= (MX25_H1_PM_BIT | MX25_H1_OCPOL_BIT | MX25_H1_TLL_BIT |
+			MX25_H1_USBTE_BIT | MX25_H1_IPPUE_DOWN_BIT);
+
+		writel(val, usbmisc->base);
+
+		break;
+	}
+	spin_unlock_irqrestore(&usbmisc->lock, flags);
+
+	return 0;
+}
+
 static int usbmisc_imx25_post(struct imx_usbmisc_data *data)
 {
 	void __iomem *reg;
@@ -159,6 +213,7 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)
 }
 
 static const struct usbmisc_ops imx25_usbmisc_ops = {
+	.init = usbmisc_imx25_init,
 	.post = usbmisc_imx25_post,
 };
 
@@ -200,6 +255,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = {
 		.data = &imx25_usbmisc_ops,
 	},
 	{
+		.compatible = "fsl,imx35-usbmisc",
+		.data = &imx25_usbmisc_ops,
+	},
+	{
 		.compatible = "fsl,imx27-usbmisc",
 		.data = &imx27_usbmisc_ops,
 	},
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy.
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-10  0:52   ` Peter Chen
  2014-03-07 17:04 ` [PATCH 3/9] ARM: dts: mbimxsd51 baseboard: Add USB host support Denis Carikli
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 arch/arm/boot/dts/imx51.dtsi |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index e508e6f..917b6ed 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -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";
 			};
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 3/9] ARM: dts: mbimxsd51 baseboard: Add USB host support
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
  2014-03-07 17:04 ` [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-07 17:04 ` [PATCH 4/9] ARM: dts: imx25.dtsi: Fix USB support Denis Carikli
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 .../boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts  |   47 ++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
index 5cec4f3..4d970b3 100644
--- a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
+++ b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
@@ -151,6 +151,29 @@
 				MX51_PAD_CSI1_D9__GPIO3_13 0x1f5
 			>;
 		};
+
+		pinctrl_usbh1: usbh1grp {
+			fsl,pins = <
+				MX51_PAD_USBH1_CLK__USBH1_CLK     0x1e5
+				MX51_PAD_USBH1_DIR__USBH1_DIR     0x1e5
+				MX51_PAD_USBH1_NXT__USBH1_NXT     0x1e5
+				MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x1e5
+				MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x1e5
+				MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x1e5
+				MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x1e5
+				MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x1e5
+				MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x1e5
+				MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x1e5
+				MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x1e5
+				MX51_PAD_USBH1_STP__USBH1_STP     0x1e5
+			>;
+		};
+
+		pinctrl_usbh1_vbus: usbh1-vbusgrp {
+			fsl,pins = <
+				MX51_PAD_EIM_CS3__GPIO2_28 0x1f5
+			>;
+		};
 	};
 };
 
@@ -173,3 +196,27 @@
 	fsl,uart-has-rtscts;
 	status = "okay";
 };
+
+&usbh1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbh1>;
+	phy_type = "ulpi";
+	dr_mode = "host";
+	status = "okay";
+};
+
+&usbotg {
+	phy_type = "utmi_wide";
+	dr_mode = "host";
+	status = "okay";
+};
+
+&usbphy0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbh1_vbus>;
+	reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
+};
+
+&usbphy1 {
+	clock-frequency = <19200000>;
+};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 4/9] ARM: dts: imx25.dtsi: Fix USB support.
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
  2014-03-07 17:04 ` [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy Denis Carikli
  2014-03-07 17:04 ` [PATCH 3/9] ARM: dts: mbimxsd51 baseboard: Add USB host support Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-07 22:57   ` Fabio Estevam
  2014-03-07 17:04 ` [PATCH 5/9] ARM: dts: mbimxsd25 baseboard: Add USB host support Denis Carikli
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fabio Estevam <fabio.estevam@freescale.com>

This patch was adapted from the thread named
"USB Host support for mx25" on linux-usb at vger.kernel.org

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 arch/arm/boot/dts/imx25.dtsi |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index 77bb743..ab5c282 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -483,13 +483,11 @@
 			};
 
 			usbphy1: usbphy at 1 {
-				compatible = "nop-usbphy";
-				status = "disabled";
+				compatible = "usb-nop-xceiv";
 			};
 
 			usbphy2: usbphy at 2 {
-				compatible = "nop-usbphy";
-				status = "disabled";
+				compatible = "usb-nop-xceiv";
 			};
 
 			usbotg: usb at 53ff4000 {
@@ -499,6 +497,7 @@
 				clocks = <&clks 9>, <&clks 70>, <&clks 8>;
 				clock-names = "ipg", "ahb", "per";
 				fsl,usbmisc = <&usbmisc 0>;
+				fsl,usbphy = <&usbphy1>;
 				status = "disabled";
 			};
 
@@ -509,6 +508,7 @@
 				clocks = <&clks 9>, <&clks 70>, <&clks 8>;
 				clock-names = "ipg", "ahb", "per";
 				fsl,usbmisc = <&usbmisc 1>;
+				fsl,usbphy = <&usbphy2>;
 				status = "disabled";
 			};
 
@@ -518,7 +518,6 @@
 				clocks = <&clks 9>, <&clks 70>, <&clks 8>;
 				clock-names = "ipg", "ahb", "per";
 				reg = <0x53ff4600 0x00f>;
-				status = "disabled";
 			};
 
 			dryice at 53ffc000 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 5/9] ARM: dts: mbimxsd25 baseboard: Add USB host support
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (2 preceding siblings ...)
  2014-03-07 17:04 ` [PATCH 4/9] ARM: dts: imx25.dtsi: Fix USB support Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-07 17:04 ` [PATCH 6/9] ARM: dts: i.MX35: Add USB support Denis Carikli
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 .../boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts  |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
index 62fb3da..58c606f 100644
--- a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
+++ b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
@@ -172,3 +172,16 @@
 	fsl,uart-has-rtscts;
 	status = "okay";
 };
+
+&usbhost1 {
+	phy_type = "serial";
+	dr_mode = "host";
+	status = "okay";
+};
+
+&usbotg {
+	phy_type = "utmi";
+	dr_mode = "host";
+	external-vbus-divider;
+	status = "okay";
+};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 6/9] ARM: dts: i.MX35: Add USB support.
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (3 preceding siblings ...)
  2014-03-07 17:04 ` [PATCH 5/9] ARM: dts: mbimxsd25 baseboard: Add USB host support Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-10  1:34   ` Peter Chen
  2014-03-10  5:03   ` Shawn Guo
  2014-03-07 17:04 ` [PATCH 7/9] ARM: dts: mbimxsd35 baseboard: Add USB host support Denis Carikli
                   ` (5 subsequent siblings)
  10 siblings, 2 replies; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 arch/arm/boot/dts/imx35.dtsi |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi
index e59ccb4..1c15b56 100644
--- a/arch/arm/boot/dts/imx35.dtsi
+++ b/arch/arm/boot/dts/imx35.dtsi
@@ -292,6 +292,15 @@
 				status = "disabled";
 			};
 
+			usbphy0: usbphy at 0 {
+				compatible = "usb-nop-xceiv";
+			};
+
+			usbphy1: usbphy at 1 {
+				compatible = "usb-nop-xceiv";
+			};
+
+
 			usbotg: usb at 53ff4000 {
 				compatible = "fsl,imx35-usb", "fsl,imx27-usb";
 				reg = <0x53ff4000 0x0200>;
@@ -299,6 +308,7 @@
 				clocks = <&clks 9>, <&clks 73>, <&clks 28>;
 				clock-names = "ipg", "ahb", "per";
 				fsl,usbmisc = <&usbmisc 0>;
+				fsl,usbphy = <&usbphy0>;
 				status = "disabled";
 			};
 
@@ -309,6 +319,7 @@
 				clocks = <&clks 9>, <&clks 73>, <&clks 28>;
 				clock-names = "ipg", "ahb", "per";
 				fsl,usbmisc = <&usbmisc 1>;
+				fsl,usbphy = <&usbphy1>;
 				status = "disabled";
 			};
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 7/9] ARM: dts: mbimxsd35 baseboard: Add USB host support.
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (4 preceding siblings ...)
  2014-03-07 17:04 ` [PATCH 6/9] ARM: dts: i.MX35: Add USB support Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-07 17:04 ` [PATCH 8/9] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 .../boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts  |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts
index 71197b9..d27f02e 100644
--- a/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts
+++ b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts
@@ -150,3 +150,15 @@
 	fsl,uart-has-rtscts;
 	status = "okay";
 };
+
+&usbhost1 {
+	phy_type = "serial";
+	status = "okay";
+};
+
+&usbotg {
+	phy_type = "utmi";
+	dr_mode = "host";
+	external-vbus-divider;
+	status = "okay";
+};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 8/9] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support.
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (5 preceding siblings ...)
  2014-03-07 17:04 ` [PATCH 7/9] ARM: dts: mbimxsd35 baseboard: Add USB host support Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-10  1:36   ` Peter Chen
  2014-03-07 17:04 ` [PATCH 9/9] ARM: imx_v4_v5_defconfig: Enable drivers for i.MX25/i.MX35 " Denis Carikli
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 arch/arm/configs/imx_v6_v7_defconfig |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 09e9743..772f14f 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -209,8 +209,10 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_UDC=y
 CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_OTG_FSM=y
 CONFIG_NOP_USB_XCEIV=y
 CONFIG_USB_MXS_PHY=y
+CONFIG_USB_ULPI=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_ETH=m
 CONFIG_USB_MASS_STORAGE=m
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 9/9] ARM: imx_v4_v5_defconfig: Enable drivers for i.MX25/i.MX35 USB Host support.
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (6 preceding siblings ...)
  2014-03-07 17:04 ` [PATCH 8/9] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
@ 2014-03-07 17:04 ` Denis Carikli
  2014-03-10  1:35   ` Peter Chen
  2014-03-07 19:01 ` [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Sergei Shtylyov
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Denis Carikli @ 2014-03-07 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 arch/arm/configs/imx_v4_v5_defconfig |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index f1aeb7d..f7c4fbf 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -47,6 +47,7 @@ CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_FPE_NWFPE=y
 CONFIG_FPE_NWFPE_XP=y
 CONFIG_PM_DEBUG=y
+CONFIG_PM_RUNTIME=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -80,6 +81,7 @@ CONFIG_MTD_UBI=y
 CONFIG_EEPROM_AT24=y
 CONFIG_EEPROM_AT25=y
 CONFIG_ATA=y
+CONFIG_BLK_DEV_SD=y
 CONFIG_PATA_IMX=y
 CONFIG_NETDEVICES=y
 CONFIG_CS89x0=y
@@ -153,6 +155,12 @@ CONFIG_USB_HID=m
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MXC=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_CHIPIDEA=y
+CONFIG_USB_CHIPIDEA_UDC=y
+CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_OTG_FSM=y
+CONFIG_NOP_USB_XCEIV=y
 CONFIG_MMC=y
 CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_MMC_SDHCI=y
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (7 preceding siblings ...)
  2014-03-07 17:04 ` [PATCH 9/9] ARM: imx_v4_v5_defconfig: Enable drivers for i.MX25/i.MX35 " Denis Carikli
@ 2014-03-07 19:01 ` Sergei Shtylyov
  2014-03-08  5:32 ` Alexander Shiyan
  2014-03-10  1:21 ` Fabio Estevam
  10 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2014-03-07 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 03/07/2014 08:04 PM, Denis Carikli wrote:

> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>   drivers/usb/chipidea/usbmisc_imx.c |   59 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 59 insertions(+)

> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index cd061ab..d956ad0 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -21,6 +21,26 @@
>   #define MX25_USB_PHY_CTRL_OFFSET	0x08
>   #define MX25_BM_EXTERNAL_VBUS_DIVIDER	BIT(23)
>
> +#define MXC_EHCI_INTERFACE_SINGLE_UNI	(2 << 0)
> +#define MXC_EHCI_INTERFACE_DIFF_UNI	(0 << 0)
> +#define MXC_EHCI_INTERFACE_MASK		(0xf)
> +
> +#define MX25_OTG_SIC_SHIFT		29
> +#define MX25_OTG_SIC_MASK		(0x3 << MX25_OTG_SIC_SHIFT)
> +#define MX25_OTG_PM_BIT			BIT(24)
> +#define MX25_OTG_PP_BIT			BIT(11)
> +#define MX25_OTG_OCPOL_BIT		(1 << 3)

    Hm, why not BIT(3). Though frankly speaking, I don't think (x << n) macros 
go together well with BIT() ones.

> +
> +#define MX25_H1_SIC_SHIFT		21
> +#define MX25_H1_SIC_MASK		(0x3 << MX25_H1_SIC_SHIFT)
> +#define MX25_H1_PP_BIT			BIT(18)
> +#define MX25_H1_PM_BIT			BIT(16)
> +#define MX25_H1_IPPUE_UP_BIT		BIT(7)
> +#define MX25_H1_IPPUE_DOWN_BIT		BIT(6)
> +#define MX25_H1_TLL_BIT			BIT(5)
> +#define MX25_H1_USBTE_BIT		BIT(4)
> +#define MX25_H1_OCPOL_BIT		(1 << 2)

    BIT(2)?

WBR, Sergei

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 4/9] ARM: dts: imx25.dtsi: Fix USB support.
  2014-03-07 17:04 ` [PATCH 4/9] ARM: dts: imx25.dtsi: Fix USB support Denis Carikli
@ 2014-03-07 22:57   ` Fabio Estevam
  0 siblings, 0 replies; 28+ messages in thread
From: Fabio Estevam @ 2014-03-07 22:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Denis,

On Fri, Mar 7, 2014 at 2:04 PM, Denis Carikli <denis@eukrea.com> wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> This patch was adapted from the thread named
> "USB Host support for mx25" on linux-usb at vger.kernel.org

Good job, thanks for working on this series!

I will test it next week.

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (8 preceding siblings ...)
  2014-03-07 19:01 ` [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Sergei Shtylyov
@ 2014-03-08  5:32 ` Alexander Shiyan
  2014-03-10  0:40   ` Peter Chen
  2014-03-10  1:21 ` Fabio Estevam
  10 siblings, 1 reply; 28+ messages in thread
From: Alexander Shiyan @ 2014-03-08  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

???????,  7 ????? 2014, 18:04 +01:00 ?? Denis Carikli <denis@eukrea.com>:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>  drivers/usb/chipidea/usbmisc_imx.c |   59 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index cd061ab..d956ad0 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
...
> +		val = readl(usbmisc->base);
> +		val &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PP_BIT);
> +		val |= (MXC_EHCI_INTERFACE_DIFF_UNI & MXC_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT;
> +		val |= (MX25_OTG_PM_BIT | MX25_OTG_OCPOL_BIT);
> +		writel(val, usbmisc->base);

At the moment, we only enable/disable interface and manage overcurrent option
in the usbmisc driver.
Is it worth it to handle type of interface here?

---

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-08  5:32 ` Alexander Shiyan
@ 2014-03-10  0:40   ` Peter Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Chen @ 2014-03-10  0:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Mar 08, 2014 at 09:32:15AM +0400, Alexander Shiyan wrote:
> ???????,  7 ????? 2014, 18:04 +01:00 ?? Denis Carikli <denis@eukrea.com>:
> > Signed-off-by: Denis Carikli <denis@eukrea.com>
> > ---
> >  drivers/usb/chipidea/usbmisc_imx.c |   59 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> > 
> > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > index cd061ab..d956ad0 100644
> > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> ...
> > +		val = readl(usbmisc->base);
> > +		val &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PP_BIT);
> > +		val |= (MXC_EHCI_INTERFACE_DIFF_UNI & MXC_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT;
> > +		val |= (MX25_OTG_PM_BIT | MX25_OTG_OCPOL_BIT);
> > +		writel(val, usbmisc->base);
> 
> At the moment, we only enable/disable interface and manage overcurrent option
> in the usbmisc driver.
> Is it worth it to handle type of interface here?
> 

All usb related things which are not included at chipidea core can be in
usbmisc driver.

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy.
  2014-03-07 17:04 ` [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy Denis Carikli
@ 2014-03-10  0:52   ` Peter Chen
  2014-03-10  4:51     ` Alexander Shiyan
  0 siblings, 1 reply; 28+ messages in thread
From: Peter Chen @ 2014-03-10  0:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 07, 2014 at 06:04:16PM +0100, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>  arch/arm/boot/dts/imx51.dtsi |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
> index e508e6f..917b6ed 100644
> --- a/arch/arm/boot/dts/imx51.dtsi
> +++ b/arch/arm/boot/dts/imx51.dtsi
> @@ -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";
> +		};

Is this the ulpi phy for host1 controller? Why the clock is the same with utmi phy
clock for otg controller.

>  	};
>  
>  	soc {
> @@ -239,6 +246,7 @@
>  				interrupts = <14>;
>  				clocks = <&clks IMX5_CLK_USBOH3_GATE>;
>  				fsl,usbmisc = <&usbmisc 1>;
> +				fsl,usbphy = <&usbphy1>;
>  				status = "disabled";
>  			};
>  
> -- 
> 1.7.9.5
> 
> 
> 

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
                   ` (9 preceding siblings ...)
  2014-03-08  5:32 ` Alexander Shiyan
@ 2014-03-10  1:21 ` Fabio Estevam
  2014-03-10  4:58   ` Alexander Shiyan
  2014-03-10  5:55   ` Eric Bénard
  10 siblings, 2 replies; 28+ messages in thread
From: Fabio Estevam @ 2014-03-10  1:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Denis,

On Fri, Mar 7, 2014 at 2:04 PM, Denis Carikli <denis@eukrea.com> wrote:

> +static int usbmisc_imx25_init(struct imx_usbmisc_data *data)
> +{
> +       void __iomem *reg = NULL;

This variable is not used and causes a warning. Please remove it.

After applying this patch things go further when I boot with a USB
thumb connected to the USB Host1 port:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
53ff4400.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
....

usb 1-1: new full-speed USB device number 2 using ci_hdrc

(Not sure why it says full-speed device. When I connect the same
device to a PC it says high-speed)

usb 1-1: not running at top speed; connect to a high speed hub
usb-storage 1-1:1.0: USB Mass Storage device detected
usb-storage 1-1:1.0: Quirks match for vid 0457 pid 0151: 80
scsi0 : usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access     Ut163    USB2FlashStorage 0.00 PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 248000 512-byte logical blocks: (126 MB/121 MiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Asking for cache data failed
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Asking for cache data failed
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Asking for cache data failed
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
fec 50038000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 192.168.0.1, my address is 192.168.0.8
IP-Config: Complete:
     device=eth0, hwaddr=00:04:00:00:00:00, ipaddr=192.168.0.8, mask=255.255.251
     host=192.168.0.8, domain=, nis-domain=(none)
     bootserver=192.168.0.1, rootserver=192.168.0.2, rootpath=
     nameserver0=192.168.0.1
ALSA device list:
  No soundcards found.
VFS: Mounted root (nfs filesystem) readonly on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 276K (c0697000 - c06dc000)
starting pid 536, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
imx-sdma 53fd4000.sdma: firmware not found

(Then system hangs here).

If I boot without the USB thumb connected, then I reach the prompt,
however after inserting the USB pen drive into USBH1 there is no
detection.

Any ideas?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 6/9] ARM: dts: i.MX35: Add USB support.
  2014-03-07 17:04 ` [PATCH 6/9] ARM: dts: i.MX35: Add USB support Denis Carikli
@ 2014-03-10  1:34   ` Peter Chen
  2014-03-10  5:03   ` Shawn Guo
  1 sibling, 0 replies; 28+ messages in thread
From: Peter Chen @ 2014-03-10  1:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 07, 2014 at 06:04:20PM +0100, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>  arch/arm/boot/dts/imx35.dtsi |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi
> index e59ccb4..1c15b56 100644
> --- a/arch/arm/boot/dts/imx35.dtsi
> +++ b/arch/arm/boot/dts/imx35.dtsi
> @@ -292,6 +292,15 @@
>  				status = "disabled";
>  			};
>  
> +			usbphy0: usbphy at 0 {
> +				compatible = "usb-nop-xceiv";
> +			};
> +
> +			usbphy1: usbphy at 1 {
> +				compatible = "usb-nop-xceiv";
> +			};
> +
> +
>  			usbotg: usb at 53ff4000 {
>  				compatible = "fsl,imx35-usb", "fsl,imx27-usb";
>  				reg = <0x53ff4000 0x0200>;
> @@ -299,6 +308,7 @@
>  				clocks = <&clks 9>, <&clks 73>, <&clks 28>;
>  				clock-names = "ipg", "ahb", "per";
>  				fsl,usbmisc = <&usbmisc 0>;
> +				fsl,usbphy = <&usbphy0>;
>  				status = "disabled";
>  			};
>  
> @@ -309,6 +319,7 @@
>  				clocks = <&clks 9>, <&clks 73>, <&clks 28>;
>  				clock-names = "ipg", "ahb", "per";
>  				fsl,usbmisc = <&usbmisc 1>;
> +				fsl,usbphy = <&usbphy1>;
>  				status = "disabled";
>  			};
>  
> -- 
> 1.7.9.5
> 
> 
> 

Have you any other patches which are still not in mainline?
At ci_hdrc_imx.c, we only get one clk, but for imx soc before than imx6,
it needs three clks at our dts?

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 9/9] ARM: imx_v4_v5_defconfig: Enable drivers for i.MX25/i.MX35 USB Host support.
  2014-03-07 17:04 ` [PATCH 9/9] ARM: imx_v4_v5_defconfig: Enable drivers for i.MX25/i.MX35 " Denis Carikli
@ 2014-03-10  1:35   ` Peter Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Chen @ 2014-03-10  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 07, 2014 at 06:04:23PM +0100, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>  arch/arm/configs/imx_v4_v5_defconfig |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
> index f1aeb7d..f7c4fbf 100644
> --- a/arch/arm/configs/imx_v4_v5_defconfig
> +++ b/arch/arm/configs/imx_v4_v5_defconfig
> @@ -47,6 +47,7 @@ CONFIG_ZBOOT_ROM_BSS=0x0
>  CONFIG_FPE_NWFPE=y
>  CONFIG_FPE_NWFPE_XP=y
>  CONFIG_PM_DEBUG=y
> +CONFIG_PM_RUNTIME=y

Why it is needed?

>  CONFIG_NET=y
>  CONFIG_PACKET=y
>  CONFIG_UNIX=y
> @@ -80,6 +81,7 @@ CONFIG_MTD_UBI=y
>  CONFIG_EEPROM_AT24=y
>  CONFIG_EEPROM_AT25=y
>  CONFIG_ATA=y
> +CONFIG_BLK_DEV_SD=y
>  CONFIG_PATA_IMX=y
>  CONFIG_NETDEVICES=y
>  CONFIG_CS89x0=y
> @@ -153,6 +155,12 @@ CONFIG_USB_HID=m
>  CONFIG_USB=y
>  CONFIG_USB_EHCI_HCD=y
>  CONFIG_USB_EHCI_MXC=y
> +CONFIG_USB_STORAGE=y
> +CONFIG_USB_CHIPIDEA=y
> +CONFIG_USB_CHIPIDEA_UDC=y
> +CONFIG_USB_CHIPIDEA_HOST=y
> +CONFIG_USB_OTG_FSM=y

Why it is needed?

> +CONFIG_NOP_USB_XCEIV=y
>  CONFIG_MMC=y
>  CONFIG_MMC_UNSAFE_RESUME=y
>  CONFIG_MMC_SDHCI=y
> -- 
> 1.7.9.5
> 

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 8/9] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support.
  2014-03-07 17:04 ` [PATCH 8/9] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
@ 2014-03-10  1:36   ` Peter Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Chen @ 2014-03-10  1:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 07, 2014 at 06:04:22PM +0100, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>  arch/arm/configs/imx_v6_v7_defconfig |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
> index 09e9743..772f14f 100644
> --- a/arch/arm/configs/imx_v6_v7_defconfig
> +++ b/arch/arm/configs/imx_v6_v7_defconfig
> @@ -209,8 +209,10 @@ CONFIG_USB_STORAGE=y
>  CONFIG_USB_CHIPIDEA=y
>  CONFIG_USB_CHIPIDEA_UDC=y
>  CONFIG_USB_CHIPIDEA_HOST=y
> +CONFIG_USB_OTG_FSM=y

Why it is needed?

>  CONFIG_NOP_USB_XCEIV=y
>  CONFIG_USB_MXS_PHY=y
> +CONFIG_USB_ULPI=y
>  CONFIG_USB_GADGET=y
>  CONFIG_USB_ETH=m
>  CONFIG_USB_MASS_STORAGE=m
> -- 
> 1.7.9.5
> 
> 
> 

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy.
  2014-03-10  0:52   ` Peter Chen
@ 2014-03-10  4:51     ` Alexander Shiyan
  2014-03-10  5:50       ` Peter Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Alexander Shiyan @ 2014-03-10  4:51 UTC (permalink / raw)
  To: linux-arm-kernel

???????????, 10 ????? 2014, 8:52 +08:00 ?? Peter Chen <peter.chen@freescale.com>:
> On Fri, Mar 07, 2014 at 06:04:16PM +0100, Denis Carikli wrote:
> > Signed-off-by: Denis Carikli <denis@eukrea.com>
> > ---
> >  arch/arm/boot/dts/imx51.dtsi |    8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
> > index e508e6f..917b6ed 100644
> > --- a/arch/arm/boot/dts/imx51.dtsi
> > +++ b/arch/arm/boot/dts/imx51.dtsi
> > @@ -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";
> > +		};
> 
> Is this the ulpi phy for host1 controller? Why the clock is the same with utmi phy
> clock for otg controller.

As far as I know, for i.MX51 this is as it should be.

However, I doubt the usefulness of forcing "fsl,usbphy = <&usbphy1>" below.

> >  	soc {
> > @@ -239,6 +246,7 @@
> >  				interrupts = <14>;
> >  				clocks = <&clks IMX5_CLK_USBOH3_GATE>;
> >  				fsl,usbmisc = <&usbmisc 1>;
> > +				fsl,usbphy = <&usbphy1>;
> >  				status = "disabled";
> >  			};

---

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-10  1:21 ` Fabio Estevam
@ 2014-03-10  4:58   ` Alexander Shiyan
  2014-03-10 11:16     ` Fabio Estevam
  2014-03-10  5:55   ` Eric Bénard
  1 sibling, 1 reply; 28+ messages in thread
From: Alexander Shiyan @ 2014-03-10  4:58 UTC (permalink / raw)
  To: linux-arm-kernel

???????????,  9 ????? 2014, 22:21 -03:00 ?? Fabio Estevam <festevam@gmail.com>:
> Hi Denis,
> 
> On Fri, Mar 7, 2014 at 2:04 PM, Denis Carikli <denis@eukrea.com> wrote:
> 
> > +static int usbmisc_imx25_init(struct imx_usbmisc_data *data)
> > +{
> > +       void __iomem *reg = NULL;
> 
> This variable is not used and causes a warning. Please remove it.
> 
> After applying this patch things go further when I boot with a USB
> thumb connected to the USB Host1 port:
...
> (Not sure why it says full-speed device. When I connect the same
> device to a PC it says high-speed)
...
> (Then system hangs here).
> 
> If I boot without the USB thumb connected, then I reach the prompt,
> however after inserting the USB pen drive into USBH1 there is no
> detection.
> 
> Any ideas?

Fabio, start with to make work USB port on your board in the bootloader.
Then with the previous driver (ehci-mxc).
Most likely problem is a wrong (or missing) clock.
As I mentioned earlier, DTS has incorrect clock nodes.

---

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 6/9] ARM: dts: i.MX35: Add USB support.
  2014-03-07 17:04 ` [PATCH 6/9] ARM: dts: i.MX35: Add USB support Denis Carikli
  2014-03-10  1:34   ` Peter Chen
@ 2014-03-10  5:03   ` Shawn Guo
  1 sibling, 0 replies; 28+ messages in thread
From: Shawn Guo @ 2014-03-10  5:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 07, 2014 at 06:04:20PM +0100, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
>  arch/arm/boot/dts/imx35.dtsi |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi
> index e59ccb4..1c15b56 100644
> --- a/arch/arm/boot/dts/imx35.dtsi
> +++ b/arch/arm/boot/dts/imx35.dtsi
> @@ -292,6 +292,15 @@
>  				status = "disabled";
>  			};
>  
> +			usbphy0: usbphy at 0 {
> +				compatible = "usb-nop-xceiv";
> +			};
> +
> +			usbphy1: usbphy at 1 {
> +				compatible = "usb-nop-xceiv";
> +			};
> +
> +

Can we put these (also imx25.dtsi) in the same way that imx51.dtsi
organizes it?

Shawn

>  			usbotg: usb at 53ff4000 {
>  				compatible = "fsl,imx35-usb", "fsl,imx27-usb";
>  				reg = <0x53ff4000 0x0200>;
> @@ -299,6 +308,7 @@
>  				clocks = <&clks 9>, <&clks 73>, <&clks 28>;
>  				clock-names = "ipg", "ahb", "per";
>  				fsl,usbmisc = <&usbmisc 0>;
> +				fsl,usbphy = <&usbphy0>;
>  				status = "disabled";
>  			};
>  
> @@ -309,6 +319,7 @@
>  				clocks = <&clks 9>, <&clks 73>, <&clks 28>;
>  				clock-names = "ipg", "ahb", "per";
>  				fsl,usbmisc = <&usbmisc 1>;
> +				fsl,usbphy = <&usbphy1>;
>  				status = "disabled";
>  			};
>  
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy.
  2014-03-10  4:51     ` Alexander Shiyan
@ 2014-03-10  5:50       ` Peter Chen
  2014-03-10  5:58         ` Alexander Shiyan
  0 siblings, 1 reply; 28+ messages in thread
From: Peter Chen @ 2014-03-10  5:50 UTC (permalink / raw)
  To: linux-arm-kernel

 
> > >
> > > diff --git a/arch/arm/boot/dts/imx51.dtsi
> > > b/arch/arm/boot/dts/imx51.dtsi index e508e6f..917b6ed 100644
> > > --- a/arch/arm/boot/dts/imx51.dtsi
> > > +++ b/arch/arm/boot/dts/imx51.dtsi
> > > @@ -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";
> > > +		};
> >
> > Is this the ulpi phy for host1 controller? Why the clock is the same
> > with utmi phy clock for otg controller.
> 
> As far as I know, for i.MX51 this is as it should be.
> 

Are you sure? From clock file, they are different ccm clock gate.

> However, I doubt the usefulness of forcing "fsl,usbphy = <&usbphy1>"
> below.
> 

Yes, for ulpi phy, it should use ulpi phy driver (drivers/usb/phy/phy-ulpi.c),
not generic phy driver.

Peter

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-10  1:21 ` Fabio Estevam
  2014-03-10  4:58   ` Alexander Shiyan
@ 2014-03-10  5:55   ` Eric Bénard
  2014-03-10 11:19     ` Fabio Estevam
  1 sibling, 1 reply; 28+ messages in thread
From: Eric Bénard @ 2014-03-10  5:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabio,

Le Sun, 9 Mar 2014 22:21:59 -0300,
Fabio Estevam <festevam@gmail.com> a ?crit :
> On Fri, Mar 7, 2014 at 2:04 PM, Denis Carikli <denis@eukrea.com> wrote:
> 
> > +static int usbmisc_imx25_init(struct imx_usbmisc_data *data)
> > +{
> > +       void __iomem *reg = NULL;
> 
> This variable is not used and causes a warning. Please remove it.
> 
> After applying this patch things go further when I boot with a USB
> thumb connected to the USB Host1 port:
> 
> ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> usbcore: registered new interface driver usb-storage
> 53ff4400.usb supply vbus not found, using dummy regulator
> ci_hdrc ci_hdrc.0: EHCI Host Controller
> ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
> ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 1 port detected
> ....
> 
> usb 1-1: new full-speed USB device number 2 using ci_hdrc
> 
> (Not sure why it says full-speed device. When I connect the same
> device to a PC it says high-speed)
> 
because i.MX25 and i.MX35 only have a full speed phy on the host port.

Eric

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy.
  2014-03-10  5:50       ` Peter Chen
@ 2014-03-10  5:58         ` Alexander Shiyan
  2014-03-10  6:04           ` Peter Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Alexander Shiyan @ 2014-03-10  5:58 UTC (permalink / raw)
  To: linux-arm-kernel

???????????, 10 ????? 2014, 5:50 UTC ?? Peter Chen <Peter.Chen@freescale.com>:
>  
> > > >
> > > > diff --git a/arch/arm/boot/dts/imx51.dtsi
> > > > b/arch/arm/boot/dts/imx51.dtsi index e508e6f..917b6ed 100644
> > > > --- a/arch/arm/boot/dts/imx51.dtsi
> > > > +++ b/arch/arm/boot/dts/imx51.dtsi
> > > > @@ -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";
> > > > +		};
> > >
> > > Is this the ulpi phy for host1 controller? Why the clock is the same
> > > with utmi phy clock for otg controller.
> > 
> > As far as I know, for i.MX51 this is as it should be.
> > 
> 
> Are you sure? From clock file, they are different ccm clock gate.

clk-imx51-imx53.c ? I think you confuse with i.MX50/53.

---

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy.
  2014-03-10  5:58         ` Alexander Shiyan
@ 2014-03-10  6:04           ` Peter Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Chen @ 2014-03-10  6:04 UTC (permalink / raw)
  To: linux-arm-kernel

 
> >
> > > > >
> > > > > diff --git a/arch/arm/boot/dts/imx51.dtsi
> > > > > b/arch/arm/boot/dts/imx51.dtsi index e508e6f..917b6ed 100644
> > > > > --- a/arch/arm/boot/dts/imx51.dtsi
> > > > > +++ b/arch/arm/boot/dts/imx51.dtsi
> > > > > @@ -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";
> > > > > +		};
> > > >
> > > > Is this the ulpi phy for host1 controller? Why the clock is the
> > > > same with utmi phy clock for otg controller.
> > >
> > > As far as I know, for i.MX51 this is as it should be.
> > >
> >
> > Are you sure? From clock file, they are different ccm clock gate.
> 
> clk-imx51-imx53.c ? I think you confuse with i.MX50/53.
> 

Yes

341         clk[IMX5_CLK_USB_PHY1_GATE]     = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10);
342         clk[IMX5_CLK_USB_PHY2_GATE]     = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-10  4:58   ` Alexander Shiyan
@ 2014-03-10 11:16     ` Fabio Estevam
  2014-03-10 15:32       ` Fabio Estevam
  0 siblings, 1 reply; 28+ messages in thread
From: Fabio Estevam @ 2014-03-10 11:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Alexander,

On Mon, Mar 10, 2014 at 1:58 AM, Alexander Shiyan <shc_work@mail.ru> wrote:

> Fabio, start with to make work USB port on your board in the bootloader.
> Then with the previous driver (ehci-mxc).
> Most likely problem is a wrong (or missing) clock.
> As I mentioned earlier, DTS has incorrect clock nodes.

Yes, you are right, thanks.

If I change the usb host clocks as:

-                               clocks = <&clks 9>, <&clks 70>, <&clks 8>;
-                               clock-names = "ipg", "ahb", "per";
+                               clocks = <&clks 70>;

Then USB host1 works fine on my mx25pdk board.

Denis,

Could you please resend 4/9 by changing the clocks nodes in the OTG
and Host1 ports as shown above?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-10  5:55   ` Eric Bénard
@ 2014-03-10 11:19     ` Fabio Estevam
  0 siblings, 0 replies; 28+ messages in thread
From: Fabio Estevam @ 2014-03-10 11:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eric,

On Mon, Mar 10, 2014 at 2:55 AM, Eric B?nard <eric@eukrea.com> wrote:
> Hi Fabio,

>> (Not sure why it says full-speed device. When I connect the same
>> device to a PC it says high-speed)
>>
> because i.MX25 and i.MX35 only have a full speed phy on the host port.

This makes sense, thanks.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs
  2014-03-10 11:16     ` Fabio Estevam
@ 2014-03-10 15:32       ` Fabio Estevam
  0 siblings, 0 replies; 28+ messages in thread
From: Fabio Estevam @ 2014-03-10 15:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Denis,

On Mon, Mar 10, 2014 at 8:16 AM, Fabio Estevam <festevam@gmail.com> wrote:

> Denis,
>
> Could you please resend 4/9 by changing the clocks nodes in the OTG
> and Host1 ports as shown above?

Thinking more about it, it would be better to send the USB clock
change as a separate patch.

I can submit the dts changes to the linux-arm-kernel list later today.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2014-03-10 15:32 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 17:04 [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Denis Carikli
2014-03-07 17:04 ` [PATCH 2/9] ARM: dts: i.MX51: Add a second usbphy Denis Carikli
2014-03-10  0:52   ` Peter Chen
2014-03-10  4:51     ` Alexander Shiyan
2014-03-10  5:50       ` Peter Chen
2014-03-10  5:58         ` Alexander Shiyan
2014-03-10  6:04           ` Peter Chen
2014-03-07 17:04 ` [PATCH 3/9] ARM: dts: mbimxsd51 baseboard: Add USB host support Denis Carikli
2014-03-07 17:04 ` [PATCH 4/9] ARM: dts: imx25.dtsi: Fix USB support Denis Carikli
2014-03-07 22:57   ` Fabio Estevam
2014-03-07 17:04 ` [PATCH 5/9] ARM: dts: mbimxsd25 baseboard: Add USB host support Denis Carikli
2014-03-07 17:04 ` [PATCH 6/9] ARM: dts: i.MX35: Add USB support Denis Carikli
2014-03-10  1:34   ` Peter Chen
2014-03-10  5:03   ` Shawn Guo
2014-03-07 17:04 ` [PATCH 7/9] ARM: dts: mbimxsd35 baseboard: Add USB host support Denis Carikli
2014-03-07 17:04 ` [PATCH 8/9] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
2014-03-10  1:36   ` Peter Chen
2014-03-07 17:04 ` [PATCH 9/9] ARM: imx_v4_v5_defconfig: Enable drivers for i.MX25/i.MX35 " Denis Carikli
2014-03-10  1:35   ` Peter Chen
2014-03-07 19:01 ` [PATCH 1/9] usb: chipidea: usbmisc: Add USB Host support for i.MX25/i.MX35 CPUs Sergei Shtylyov
2014-03-08  5:32 ` Alexander Shiyan
2014-03-10  0:40   ` Peter Chen
2014-03-10  1:21 ` Fabio Estevam
2014-03-10  4:58   ` Alexander Shiyan
2014-03-10 11:16     ` Fabio Estevam
2014-03-10 15:32       ` Fabio Estevam
2014-03-10  5:55   ` Eric Bénard
2014-03-10 11:19     ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).