Skip to contentSkip to conversation

imx28/imx6q: add usb support

PATCH Superseded Richard Zhao 4 participants 19 messages Jul 11, 2012 – Jul 12, 2012

Subsystems (5)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover imx28/imx6q: add usb support

This is platform part to add imx28/imx6q driver support. The dirver part has been mostly merged to usb-next.

The last pinctrl patch also needs imx6q pinctrl driver fix that Aisheng is working on. Of course it can pass build, and only effect usb gadget function.

Richard Zhao (7):
ARM: imx6q: correct device name of usbphy and usb controller clock
export
ARM: imx6q: add usbphy clocks
ARM: imx6q: disable usb charger detector
ARM: dts: imx6q-sabrelite: add usb devices
ARM: mxs: clk_register_clkdev mx28 usb clocks
ARM: dts: imx28-evk: add usb devices
ARM: dts: imx6q-sabrelite: add usbotg pinctrl support

 arch/arm/boot/dts/imx28-evk.dts       |   36 ++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi          |   12 ++++++++--
 arch/arm/boot/dts/imx6q-sabrelite.dts |   30 +++++++++++++++++++++++
 arch/arm/boot/dts/imx6q.dtsi          |   42 +++++++++++++++++++++++++++++++--
 arch/arm/mach-imx/clk-imx6q.c         |   11 ++++++++-
 arch/arm/mach-imx/mach-imx6q.c        |   41 ++++++++++++++++++++++++++++++++
 drivers/clk/mxs/clk-imx28.c           |    4 ++++
 7 files changed, 171 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v6 1/7 ARM: imx6q: correct device name of usbphy and usb controller clock export

---
 arch/arm/mach-imx/clk-imx6q.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/clk-imx6q.c +4 -0
index cabbbb7..3f5b9d6 100644
@@ -398,6 +398,10 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[gpmi_bch], "gpmi_bch", "112000.gpmi-nand");
 	clk_register_clkdev(clk[gpmi_apb], "gpmi_apb", "112000.gpmi-nand");
 	clk_register_clkdev(clk[gpmi_io], "gpmi_io", "112000.gpmi-nand");
+	clk_register_clkdev(clk[usboh3], NULL, "2184000.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v6 1/7 ARM: imx6q: correct device name of usbphy and usb controller clock export

It seems that the patch subject does not match the content.

Regards,
Shawn

Quoted 24 lines · Richard Zhao
---
 arch/arm/mach-imx/clk-imx6q.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/clk-imx6q.c +4 -0
index cabbbb7..3f5b9d6 100644
@@ -398,6 +398,10 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[gpmi_bch], "gpmi_bch", "112000.gpmi-nand");
 	clk_register_clkdev(clk[gpmi_apb], "gpmi_apb", "112000.gpmi-nand");
 	clk_register_clkdev(clk[gpmi_io], "gpmi_io", "112000.gpmi-nand");
+	clk_register_clkdev(clk[usboh3], NULL, "2184000.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v6 1/7 ARM: imx6q: correct device name of usbphy and usb controller clock export

Quoted 1 line · Shawn Guo

It seems that the patch subject does not match the content.

The name correct is fixed by your patch:
commit 1d818efd2949b5874eaf2531585e1f0735a7db91

Author: Shawn Guo <[email protected]>
Date:   Tue Jun 5 15:16:42 2012 +0800

ARM: imx6q: remove unneeded clkdev lookups

There are a number of clkdev lookups left over from commit b0286f2 (ARM: imx6q: prepare and enable init on clks directly instead of clk_get first), remove them since they are not needed now.

I'll correct the title.

Thanks
Richard

Quoted 29 lines

Regards,
Shawn

Quoted 24 lines · Richard Zhao
---
 arch/arm/mach-imx/clk-imx6q.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/clk-imx6q.c +4 -0
index cabbbb7..3f5b9d6 100644
@@ -398,6 +398,10 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[gpmi_bch], "gpmi_bch", "112000.gpmi-nand");
 	clk_register_clkdev(clk[gpmi_apb], "gpmi_apb", "112000.gpmi-nand");
 	clk_register_clkdev(clk[gpmi_io], "gpmi_io", "112000.gpmi-nand");
+	clk_register_clkdev(clk[usboh3], NULL, "2184000.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
+	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v6 2/7 ARM: imx6q: add usbphy clocks

In reply to Richard Zhao
---
 arch/arm/mach-imx/clk-imx6q.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-imx/clk-imx6q.c +6 -1
index 3f5b9d6..ea89520 100644
@@ -152,7 +152,7 @@ enum mx6q_clks {
 	ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3,
 	usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
 	pll4_audio, pll5_video, pll6_mlb, pll7_usb_host, pll8_enet, ssi1_ipg,
-	ssi2_ipg, ssi3_ipg, rom,
+	ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2,
 	clk_max
 };
 
@@ -198,6 +198,9 @@ int __init mx6q_clocks_init(void)
 	clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB,	"pll7_usb_host","osc", base + 0x20, 0x2000,   0x3);
 	clk[pll8_enet]     = imx_clk_pllv3(IMX_PLLV3_ENET,	"pll8_enet",	"osc", base + 0xe0, 0x182000, 0x3);
 
+	clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6);
+	clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6);
+
 	/*                                name              parent_name        reg       idx */
 	clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
 	clk[pll2_pfd1_594m] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);
@@ -402,6 +405,8 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
 	clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
 	clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
+	clk_register_clkdev(clk[usbphy1], NULL, "20c9000.usbphy");
+	clk_register_clkdev(clk[usbphy2], NULL, "20ca000.usbphy");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v6 3/7 ARM: imx6q: disable usb charger detector

In reply to Richard Zhao

The external charger detector needs to be disabled, or the signal at DP will be poor

---
 arch/arm/mach-imx/mach-imx6q.c |   41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
arch/arm/mach-imx/mach-imx6q.c +41 -0
index 1c18d3c..63fe5d6 100644
@@ -25,6 +25,7 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/phy.h>
 #include <linux/micrel_phy.h>
+#include <linux/mfd/anatop.h>
 #include <asm/cpuidle.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -117,6 +118,45 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_usb_init(void)
+{
+	struct device_node *np;
+	struct platform_device *pdev = NULL;
+	struct anatop *adata = NULL;
+
+	np = of_find_node_by_path("/soc/aips-bus at 02000000/anatop at 020c8000");
+	if (np)
+		pdev = of_find_device_by_node(np);
+	if (pdev)
+		adata = platform_get_drvdata(pdev);
+	if (!adata) {
+		if (np)
+			of_node_put(np);
+		return;
+	}
+
+#define HW_ANADIG_USB1_CHRG_DETECT		0x000001b0
+#define HW_ANADIG_USB2_CHRG_DETECT		0x00000210
+
+#define BM_ANADIG_USB_CHRG_DETECT_EN_B		0x00100000
+#define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B	0x00080000
+
+	/*
+	 * The external charger detector needs to be disabled,
+	 * or the signal at DP will be poor
+	 */
+	anatop_write_reg(adata, HW_ANADIG_USB1_CHRG_DETECT,
+			BM_ANADIG_USB_CHRG_DETECT_EN_B
+			| BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B,
+			~0);
+	anatop_write_reg(adata, HW_ANADIG_USB2_CHRG_DETECT,
+			BM_ANADIG_USB_CHRG_DETECT_EN_B |
+			BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B,
+			~0);
+
+	of_node_put(np);
+}
+
 static void __init imx6q_init_machine(void)
 {
 	/*
@@ -131,6 +171,7 @@ static void __init imx6q_init_machine(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
 	imx6q_pm_init();
+	imx6q_usb_init();
 }
 
 static struct cpuidle_driver imx6q_cpuidle_driver = {
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH v6 3/7 ARM: imx6q: disable usb charger detector

Quoted 2 lines · Richard Zhao

The external charger detector needs to be disabled, or the signal at DP will be poor

Something as this needs to be applied, no?

arch/arm/mach-imx/Kconfig +3 -0
index eff4db5..93695e0 100644
@@ -832,6 +832,9 @@ config SOC_IMX6Q
        select HAVE_SMP
        select PINCTRL
        select PINCTRL_IMX6Q
+       select MFD_ANATOP
+       select REGULATOR
+       select REGULATOR_ANATOP
        select USE_OF
 
        help

I sent this patch some time ago but I don't recall to get an ack/nack for it. I can resend it.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#7 lore raw

PATCH v6 3/7 ARM: imx6q: disable usb charger detector

Quoted 12 lines · Otavio Salvador
Quoted 2 lines · Richard Zhao

The external charger detector needs to be disabled, or the signal at DP will be poor

Something as this needs to be applied, no?

arch/arm/mach-imx/Kconfig +0 -0
index eff4db5..93695e0 100644

arch/arm/mach-imx/Kconfig config SOC_IMX6Q · line 835

Quoted 4 lines
arch/arm/mach-imx/Kconfig +1 -0
@@ -832,6 +832,9 @@ config SOC_IMX6Q
        select HAVE_SMP
        select PINCTRL
        select PINCTRL_IMX6Q
+       select MFD_ANATOP

This is needed.

arch/arm/mach-imx/Kconfig config SOC_IMX6Q · line 837

Quoted 2 lines
arch/arm/mach-imx/Kconfig +2 -0
+       select REGULATOR
+       select REGULATOR_ANATOP

but why these two?

Thanks
Richard

Quoted 16 lines
arch/arm/mach-imx/Kconfig +0 -0
        select USE_OF
 
        help

I sent this patch some time ago but I don't recall to get an ack/nack for it. I can resend it.

Signature · 8 lines
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#8 lore raw

PATCH v6 3/7 ARM: imx6q: disable usb charger detector

Quoted 18 lines · Richard Zhao
Quoted 12 lines · Otavio Salvador
Quoted 2 lines · Richard Zhao

The external charger detector needs to be disabled, or the signal at DP will be poor

Something as this needs to be applied, no?

arch/arm/mach-imx/Kconfig +0 -0
index eff4db5..93695e0 100644

arch/arm/mach-imx/Kconfig config SOC_IMX6Q · line 835

Quoted 4 lines
arch/arm/mach-imx/Kconfig +1 -0
@@ -832,6 +832,9 @@ config SOC_IMX6Q
        select HAVE_SMP
        select PINCTRL
        select PINCTRL_IMX6Q
+       select MFD_ANATOP

This is needed.

Quoted 3 lines

arch/arm/mach-imx/Kconfig config SOC_IMX6Q · line 837

Quoted 2 lines
arch/arm/mach-imx/Kconfig +2 -0
+       select REGULATOR
+       select REGULATOR_ANATOP

but why these two?

I did it some time ago and ended up adding it ... don't recall why but MFD only does fix the build failure ... I sent a patch with that.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#9 lore raw

PATCH v6 3/7 ARM: imx6q: disable usb charger detector

In reply to Richard Zhao
Quoted 21 lines · Richard Zhao

The external charger detector needs to be disabled, or the signal at DP will be poor

---
 arch/arm/mach-imx/mach-imx6q.c |   41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
arch/arm/mach-imx/mach-imx6q.c +1 -0
index 1c18d3c..63fe5d6 100644
@@ -25,6 +25,7 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/phy.h>
 #include <linux/micrel_phy.h>
+#include <linux/mfd/anatop.h>
 #include <asm/cpuidle.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/cache-l2x0.h>

arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_sabrelite_init(void) · line 127

Quoted 10 lines
arch/arm/mach-imx/mach-imx6q.c +7 -0
@@ -117,6 +118,45 @@ static void __init imx6q_sabrelite_init(void)
 	imx6q_sabrelite_cko1_setup();
 }
 
+static void __init imx6q_usb_init(void)
+{
+	struct device_node *np;
+	struct platform_device *pdev = NULL;
+	struct anatop *adata = NULL;
+
+	np = of_find_node_by_path("/soc/aips-bus at 02000000/anatop at 020c8000");

I would suggest use of_find_compatible_node to save the open-coding of such path.

Regards,
Shawn

Quoted 47 lines
arch/arm/mach-imx/mach-imx6q.c +33 -0
+	if (np)
+		pdev = of_find_device_by_node(np);
+	if (pdev)
+		adata = platform_get_drvdata(pdev);
+	if (!adata) {
+		if (np)
+			of_node_put(np);
+		return;
+	}
+
+#define HW_ANADIG_USB1_CHRG_DETECT		0x000001b0
+#define HW_ANADIG_USB2_CHRG_DETECT		0x00000210
+
+#define BM_ANADIG_USB_CHRG_DETECT_EN_B		0x00100000
+#define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B	0x00080000
+
+	/*
+	 * The external charger detector needs to be disabled,
+	 * or the signal at DP will be poor
+	 */
+	anatop_write_reg(adata, HW_ANADIG_USB1_CHRG_DETECT,
+			BM_ANADIG_USB_CHRG_DETECT_EN_B
+			| BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B,
+			~0);
+	anatop_write_reg(adata, HW_ANADIG_USB2_CHRG_DETECT,
+			BM_ANADIG_USB_CHRG_DETECT_EN_B |
+			BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B,
+			~0);
+
+	of_node_put(np);
+}
+
 static void __init imx6q_init_machine(void)
 {
 	/*
@@ -131,6 +171,7 @@ static void __init imx6q_init_machine(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
 	imx6q_pm_init();
+	imx6q_usb_init();
 }
 
 static struct cpuidle_driver imx6q_cpuidle_driver = {
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH v6 3/7 ARM: imx6q: disable usb charger detector

On Wed, Jul 11, 2012 at 11:06 PM, Shawn Guo <[email protected]> wrote:
...

Quoted 4 lines
Quoted 1 line

+ np = of_find_node_by_path("/soc/aips-bus at 02000000/anatop at 020c8000");

I would suggest use of_find_compatible_node to save the open-coding of such path.

...

Nice catch!

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#11 lore raw

PATCH v6 4/7 ARM: dts: imx6q-sabrelite: add usb devices

In reply to Richard Zhao

- add usbphy devices
- add usb host controller and otg devices
- add on-board hub reset gpio pinctrl
- add usb h1 vbus regulator

---
 arch/arm/boot/dts/imx6q-sabrelite.dts |   28 +++++++++++++++++++++++++
 arch/arm/boot/dts/imx6q.dtsi          |   36 +++++++++++++++++++++++++++++++--
 2 files changed, 62 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx6q-sabrelite.dts +28 -0
index e0ec929..5bba0d1 100644
@@ -41,10 +41,29 @@
 					status = "okay";
 				};
 			};
+			iomuxc at 020e0000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_gpio_hog>;
 
+				gpios {
+					pinctrl_gpio_hog: gpiohog {
+						fsl,pins = <1044 0x80000000	/* MX6Q_PAD_GPIO_17__GPIO_7_12 */
+							   144  0x80000000>;	/* MX6Q_PAD_EIM_D22__GPIO_3_22 */
+					};
+				};
+			};
 		};
 
 		aips-bus at 02100000 { /* AIPS2 */
+			usb at 02184000 { /* USB OTG */
+				vbus-supply = <&reg_usb_otg_vbus>;
+				status = "okay";
+			};
+
+			usb at 02184200 { /* USB1 */
+				status = "okay";
+			};
+
 			ethernet at 02188000 {
 				phy-mode = "rgmii";
 				phy-reset-gpios = <&gpio3 23 0>;
@@ -111,6 +130,15 @@
 			regulator-max-microvolt = <3300000>;
 			regulator-always-on;
 		};
+
+		reg_usb_otg_vbus: usb_otg_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 22 0>;
+			enable-active-high;
+		};
 	};
 
 	sound {
arch/arm/boot/dts/imx6q.dtsi +34 -2
index 16a3884..5e4f100 100644
@@ -461,12 +461,14 @@
 				};
 			};
 
-			usbphy at 020c9000 { /* USBPHY1 */
+			usbphy1: usbphy at 020c9000 {
+				compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
 				reg = <0x020c9000 0x1000>;
 				interrupts = <0 44 0x04>;
 			};
 
-			usbphy at 020ca000 { /* USBPHY2 */
+			usbphy2: usbphy at 020ca000 {
+				compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
 				reg = <0x020ca000 0x1000>;
 				interrupts = <0 45 0x04>;
 			};
@@ -614,6 +616,36 @@
 				reg = <0x0217c000 0x4000>;
 			};
 
+			usb at 02184000 { /* USB OTG */
+				compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
+				reg = <0x02184000 0x200>;
+				interrupts = <0 43 0x04>;
+				fsl,usbphy = <&usbphy1>;
+				status = "disabled";
+			};
+
+			usb at 02184200 { /* USB1 */
+				compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
+				reg = <0x02184200 0x200>;
+				interrupts = <0 40 0x04>;
+				fsl,usbphy = <&usbphy2>;
+				status = "disabled";
+			};
+
+			usb at 02184400 { /* USB2 */
+				compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
+				reg = <0x02184400 0x200>;
+				interrupts = <0 41 0x04>;
+				status = "disabled";
+			};
+
+			usb at 02184600 { /* USB3 */
+				compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
+				reg = <0x02184600 0x200>;
+				interrupts = <0 42 0x04>;
+				status = "disabled";
+			};
+
 			ethernet at 02188000 {
 				compatible = "fsl,imx6q-fec";
 				reg = <0x02188000 0x4000>;
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH v6 4/7 ARM: dts: imx6q-sabrelite: add usb devices

Quoted 16 lines · Richard Zhao

- add usbphy devices
- add usb host controller and otg devices
- add on-board hub reset gpio pinctrl
- add usb h1 vbus regulator

---
 arch/arm/boot/dts/imx6q-sabrelite.dts |   28 +++++++++++++++++++++++++
 arch/arm/boot/dts/imx6q.dtsi          |   36 +++++++++++++++++++++++++++++++--
 2 files changed, 62 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx6q-sabrelite.dts +0 -0
index e0ec929..5bba0d1 100644

arch/arm/boot/dts/imx6q-sabrelite.dts line 50

Quoted 10 lines
arch/arm/boot/dts/imx6q-sabrelite.dts +6 -0
@@ -41,10 +41,29 @@
 					status = "okay";
 				};
 			};
+			iomuxc at 020e0000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_gpio_hog>;
 
+				gpios {
+					pinctrl_gpio_hog: gpiohog {
+						fsl,pins = <1044 0x80000000	/* MX6Q_PAD_GPIO_17__GPIO_7_12 */

I guess this one is used for on-board hub reset. Since you are using it nowhere, please drop it for now.

Regards,
Shawn

Quoted 5 lines
arch/arm/boot/dts/imx6q-sabrelite.dts +4 -0
+							   144  0x80000000>;	/* MX6Q_PAD_EIM_D22__GPIO_3_22 */
+					};
+				};
+			};
 		};
#13 lore raw

PATCH v6 5/7 ARM: mxs: clk_register_clkdev mx28 usb clocks

In reply to Richard Zhao
---
 drivers/clk/mxs/clk-imx28.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/clk/mxs/clk-imx28.c +4 -0
index 7fad6c8..a3bb644 100644
@@ -328,6 +328,10 @@ int __init mx28_clocks_init(void)
 	clk_register_clkdevs(clks[fec], fec_lookups, ARRAY_SIZE(fec_lookups));
 	clk_register_clkdevs(clks[can0], can0_lookups, ARRAY_SIZE(can0_lookups));
 	clk_register_clkdevs(clks[can1], can1_lookups, ARRAY_SIZE(can1_lookups));
+	clk_register_clkdev(clks[usb0_pwr], NULL, "8007c000.usbphy");
+	clk_register_clkdev(clks[usb1_pwr], NULL, "8007e000.usbphy");
+	clk_register_clkdev(clks[usb0], NULL, "80080000.usb");
+	clk_register_clkdev(clks[usb1], NULL, "80090000.usb");
 
 	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
 		clk_prepare_enable(clks[clks_init_on[i]]);
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH v6 5/7 ARM: mxs: clk_register_clkdev mx28 usb clocks

The subject prefix needs to be "clk: mxs: ...", as we will have it go via clk tree.

Regards,
Shawn

Quoted 25 lines · Richard Zhao
---
 drivers/clk/mxs/clk-imx28.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/clk/mxs/clk-imx28.c +4 -0
index 7fad6c8..a3bb644 100644
@@ -328,6 +328,10 @@ int __init mx28_clocks_init(void)
 	clk_register_clkdevs(clks[fec], fec_lookups, ARRAY_SIZE(fec_lookups));
 	clk_register_clkdevs(clks[can0], can0_lookups, ARRAY_SIZE(can0_lookups));
 	clk_register_clkdevs(clks[can1], can1_lookups, ARRAY_SIZE(can1_lookups));
+	clk_register_clkdev(clks[usb0_pwr], NULL, "8007c000.usbphy");
+	clk_register_clkdev(clks[usb1_pwr], NULL, "8007e000.usbphy");
+	clk_register_clkdev(clks[usb0], NULL, "80080000.usb");
+	clk_register_clkdev(clks[usb1], NULL, "80090000.usb");
 
 	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
 		clk_prepare_enable(clks[clks_init_on[i]]);
Signature · 1 line
1.7.9.5
#15 lore raw

PATCH v6 6/7 ARM: dts: imx28-evk: add usb devices

In reply to Richard Zhao

- add usb phy devices
- add usb controller devices
- add usb vbus regulators

---
 arch/arm/boot/dts/imx28-evk.dts |   36 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi    |   12 ++++++++++--
 2 files changed, 46 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx28-evk.dts +36 -0
index 0d8739d..c27771d 100644
@@ -137,10 +137,28 @@
 				pinctrl-0 = <&auart3_pins_a>;
 				status = "okay";
 			};
+
+			usbphy0: usbphy at 8007c000 {
+				status = "okay";
+			};
+
+			usbphy1: usbphy at 8007e000 {
+				status = "okay";
+			};
 		};
 	};
 
 	ahb at 80080000 {
+		usb0: usb at 80080000 {
+			vbus-supply = <&reg_usb0_vbus>;
+			status = "okay";
+		};
+
+		usb1: usb at 80090000 {
+			vbus-supply = <&reg_usb1_vbus>;
+			status = "okay";
+		};
+
 		mac0: ethernet at 800f0000 {
 			phy-mode = "rmii";
 			pinctrl-names = "default";
@@ -185,6 +203,24 @@
 			regulator-max-microvolt = <3300000>;
 			gpio = <&gpio2 15 0>;
 		};
+
+		reg_usb0_vbus: usb0_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb0_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 9 0>;
+			enable-active-high;
+		};
+
+		reg_usb1_vbus: usb1_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb1_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 8 0>;
+			enable-active-high;
+		};
 	};
 
 	sound {
arch/arm/boot/dts/imx28.dtsi +10 -2
index adb5ffc..cc25a0f 100644
@@ -654,11 +654,13 @@
 			};
 
 			usbphy0: usbphy at 8007c000 {
+				compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
 				reg = <0x8007c000 0x2000>;
 				status = "disabled";
 			};
 
 			usbphy1: usbphy at 8007e000 {
+				compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
 				reg = <0x8007e000 0x2000>;
 				status = "disabled";
 			};
@@ -672,13 +674,19 @@
 		reg = <0x80080000 0x80000>;
 		ranges;
 
-		usbctrl0: usbctrl at 80080000 {
+		usb0: usb at 80080000 {
+			compatible = "fsl,imx28-usb", "fsl,imx27-usb";
 			reg = <0x80080000 0x10000>;
+			interrupts = <93>;
+			fsl,usbphy = <&usbphy0>;
 			status = "disabled";
 		};
 
-		usbctrl1: usbctrl at 80090000 {
+		usb1: usb at 80090000 {
+			compatible = "fsl,imx28-usb", "fsl,imx27-usb";
 			reg = <0x80090000 0x10000>;
+			interrupts = <92>;
+			fsl,usbphy = <&usbphy1>;
 			status = "disabled";
 		};
 
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH v6 6/7 ARM: dts: imx28-evk: add usb devices

arch/arm/boot/dts/imx28-evk.dts line 212

Quoted 11 lines · Richard Zhao
arch/arm/boot/dts/imx28-evk.dts +7 -0
@@ -185,6 +203,24 @@
 			regulator-max-microvolt = <3300000>;
 			gpio = <&gpio2 15 0>;
 		};
+
+		reg_usb0_vbus: usb0_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb0_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 9 0>;

Since we haven't got gpio API calling pinctrl to configure the pin into gpio mode automatically, we need to set it it with pinctrl "hog" node. This is the same thing you have done with imx6q.

arch/arm/boot/dts/imx28-evk.dts line 221

Quoted 9 lines
arch/arm/boot/dts/imx28-evk.dts +9 -0
+			enable-active-high;
+		};
+
+		reg_usb1_vbus: usb1_vbus {
+			compatible = "regulator-fixed";
+			regulator-name = "usb1_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 8 0>;

Ditto

Quoted 3 lines
arch/arm/boot/dts/imx28-evk.dts +2 -0
+			enable-active-high;
+		};
 	};
Signature · 2 lines
Regards,
Shawn
#17 lore raw

PATCH v6 7/7 ARM: dts: imx6q-sabrelite: add usbotg pinctrl support

In reply to Richard Zhao
---
 arch/arm/boot/dts/imx6q-sabrelite.dts |    2 ++
 arch/arm/boot/dts/imx6q.dtsi          |    6 ++++++
 2 files changed, 8 insertions(+)
arch/arm/boot/dts/imx6q-sabrelite.dts +2 -0
index 5bba0d1..de3cd2e 100644
@@ -57,6 +57,8 @@
 		aips-bus at 02100000 { /* AIPS2 */
 			usb at 02184000 { /* USB OTG */
 				vbus-supply = <&reg_usb_otg_vbus>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usbotg_1>;
 				status = "okay";
 			};
 
arch/arm/boot/dts/imx6q.dtsi +6 -0
index 5e4f100..64a24a0 100644
@@ -552,6 +552,12 @@
 					};
 				};
 
+				usbotg {
+					pinctrl_usbotg_1: usbotggrp-1 {
+						fsl,pins = <1591 0x17059>;	/* MX6Q_PAD_GPIO_1__USBOTG_ID */
+					};
+				};
+
 				usdhc3 {
 					pinctrl_usdhc3_1: usdhc3grp-1 {
 						fsl,pins = <1273 0x17059	/* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH v6 7/7 ARM: dts: imx6q-sabrelite: add usbotg pinctrl support

Quoted 6 lines · Richard Zhao
---
 arch/arm/boot/dts/imx6q-sabrelite.dts |    2 ++
 arch/arm/boot/dts/imx6q.dtsi          |    6 ++++++
 2 files changed, 8 insertions(+)

I haven't see usb driver that Greg applied calls pinctrl API to set up the pin. So I'm not going to apply this one.

Regards,
Shawn

Quoted 34 lines
arch/arm/boot/dts/imx6q-sabrelite.dts +2 -0
index 5bba0d1..de3cd2e 100644
@@ -57,6 +57,8 @@
 		aips-bus at 02100000 { /* AIPS2 */
 			usb at 02184000 { /* USB OTG */
 				vbus-supply = <&reg_usb_otg_vbus>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usbotg_1>;
 				status = "okay";
 			};
 
arch/arm/boot/dts/imx6q.dtsi +6 -0
index 5e4f100..64a24a0 100644
@@ -552,6 +552,12 @@
 					};
 				};
 
+				usbotg {
+					pinctrl_usbotg_1: usbotggrp-1 {
+						fsl,pins = <1591 0x17059>;	/* MX6Q_PAD_GPIO_1__USBOTG_ID */
+					};
+				};
+
 				usdhc3 {
 					pinctrl_usdhc3_1: usdhc3grp-1 {
 						fsl,pins = <1273 0x17059	/* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
Signature · 1 line
1.7.9.5