linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate
@ 2014-04-16 17:53 Fabio Estevam
  2014-04-16 17:53 ` [PATCH v2 2/3] ARM: dts: imx27: Place the usb phy nodes in the board dts files Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-04-16 17:53 UTC (permalink / raw)
  To: linux-arm-kernel

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

USB Host1, Host2 and OTG are gated via 'usb_ipg_gate' clock, so fix it in order
to avoid the following kernel oops:

usbcore: registered new interface driver usb-storage
10024000.usb supply vbus not found, using dummy regulator
Unhandled fault: external abort on non-linefetch (0x808) at 0xf4424184
Internal error: : 808 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 3.15.0-rc1-26325-g971f9fd-dirty #64
task: c7829aa0 ti: c7836000 task.ti: c7836000
PC is at ci_hdrc_probe+0x3a4/0x634
LR is at ci_hdrc_probe+0x100/0x634
pc : [<c036cc78>]    lr : [<c036c9d4>]    psr: 60000013
sp : c7837d48  ip : 00000001  fp : 00000000
r10: 00000000  r9 : 00000000  r8 : c791b6c0
r7 : c7945000  r6 : f4424000  r5 : c7945010  r4 : c794e010
r3 : f4424184  r2 : 00000000  r1 : 8c000004  r0 : 0c000004
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: a0004000  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc78361c0)
Stack: (0xc7837d48 to 0xc7838000)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- None

 arch/arm/boot/dts/imx27.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 00cf66c..948354e 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -465,7 +465,7 @@
 				compatible = "fsl,imx27-usb";
 				reg = <0x10024000 0x200>;
 				interrupts = <56>;
-				clocks = <&clks 15>;
+				clocks = <&clks 75>;
 				fsl,usbmisc = <&usbmisc 0>;
 				fsl,usbphy = <&usbphy0>;
 				status = "disabled";
@@ -475,7 +475,7 @@
 				compatible = "fsl,imx27-usb";
 				reg = <0x10024200 0x200>;
 				interrupts = <54>;
-				clocks = <&clks 15>;
+				clocks = <&clks 75>;
 				fsl,usbmisc = <&usbmisc 1>;
 				status = "disabled";
 			};
@@ -484,7 +484,7 @@
 				compatible = "fsl,imx27-usb";
 				reg = <0x10024400 0x200>;
 				interrupts = <55>;
-				clocks = <&clks 15>;
+				clocks = <&clks 75>;
 				fsl,usbmisc = <&usbmisc 2>;
 				fsl,usbphy = <&usbphy2>;
 				status = "disabled";
-- 
1.8.3.2

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

* [PATCH v2 2/3] ARM: dts: imx27: Place the usb phy nodes in the board dts files
  2014-04-16 17:53 [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Fabio Estevam
@ 2014-04-16 17:53 ` Fabio Estevam
  2014-04-16 17:53 ` [PATCH v2 3/3] ARM: dts: imx27-pdk: Add USB OTG support Fabio Estevam
  2014-04-17  4:36 ` [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Shawn Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-04-16 17:53 UTC (permalink / raw)
  To: linux-arm-kernel

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

It is not a good approach to have the USB PHY nodes inside imx27.dtsi since
the USB PHYs on mx27 are not internal to the SoC.

Place the USB PHY nodes in the board dts files instead.

Also, each board may have a different clock source for the USB PHY, so do not
hardcode it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Applies on top of "[PATCH] ARM: dts: imx27-phytec-phycore-som: Move PMIC IRQ GPIO into a separate pin group"

Changes since v1:
- Use a dummy clock for USB PHY
- Put usbphy2 into the rdk dts file

 arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts  | 19 +++++++++++++++----
 arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi | 19 +++++++++++++++----
 arch/arm/boot/dts/imx27.dtsi                    | 22 ----------------------
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts b/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
index 8b4181b..0875327 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
+++ b/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
@@ -37,6 +37,20 @@
 			};
 		};
 	};
+
+	usbphy {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbphy2: usbphy at 2 {
+			compatible = "usb-nop-xceiv";
+			reg = <0>;
+			vcc-supply = <&reg_5v0>;
+			clocks = <&clks 0>;
+			clock-names = "main_clk";
+		};
+	};
 };
 
 &cspi1 {
@@ -268,14 +282,11 @@
 	dr_mode = "host";
 	phy_type = "ulpi";
 	vbus-supply = <&reg_5v0>;
+	fsl,usbphy = <&usbphy2>;
 	disable-over-current;
 	status = "okay";
 };
 
-&usbphy2 {
-	vcc-supply = <&reg_5v0>;
-};
-
 &weim {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_weim>;
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi b/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
index 33c5dc2..32cc7dac9a 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
+++ b/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
@@ -41,6 +41,20 @@
 			regulator-max-microvolt = <5000000>;
 		};
 	};
+
+	usbphy {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbphy0: usbphy at 0 {
+			compatible = "usb-nop-xceiv";
+			reg = <0>;
+			vcc-supply = <&sw3_reg>;
+			clocks = <&clks 0>;
+			clock-names = "main_clk";
+		};
+	};
 };
 
 &audmux {
@@ -307,14 +321,11 @@
 	pinctrl-0 = <&pinctrl_usbotg>;
 	dr_mode = "otg";
 	phy_type = "ulpi";
+	fsl,usbphy = <&usbphy0>;
 	vbus-supply = <&sw3_reg>;
 	status = "okay";
 };
 
-&usbphy0 {
-	vcc-supply = <&sw3_reg>;
-};
-
 &weim {
 	status = "okay";
 
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 948354e..b2c103e 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -72,26 +72,6 @@
 		};
 	};
 
-	usbphy {
-		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		usbphy0: usbphy at 0 {
-			compatible = "usb-nop-xceiv";
-			reg = <0>;
-			clocks = <&clks 75>;
-			clock-names = "main_clk";
-		};
-
-		usbphy2: usbphy at 2 {
-			compatible = "usb-nop-xceiv";
-			reg = <2>;
-			clocks = <&clks 75>;
-			clock-names = "main_clk";
-		};
-	};
-
 	soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -467,7 +447,6 @@
 				interrupts = <56>;
 				clocks = <&clks 75>;
 				fsl,usbmisc = <&usbmisc 0>;
-				fsl,usbphy = <&usbphy0>;
 				status = "disabled";
 			};
 
@@ -486,7 +465,6 @@
 				interrupts = <55>;
 				clocks = <&clks 75>;
 				fsl,usbmisc = <&usbmisc 2>;
-				fsl,usbphy = <&usbphy2>;
 				status = "disabled";
 			};
 
-- 
1.8.3.2

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

* [PATCH v2 3/3] ARM: dts: imx27-pdk: Add USB OTG support
  2014-04-16 17:53 [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Fabio Estevam
  2014-04-16 17:53 ` [PATCH v2 2/3] ARM: dts: imx27: Place the usb phy nodes in the board dts files Fabio Estevam
@ 2014-04-16 17:53 ` Fabio Estevam
  2014-04-17  4:36 ` [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Shawn Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-04-16 17:53 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
It applies on top of "[PATCH v3] ARM: dts: imx27-pdk: Add PMIC support"

Changes since v1:
- Use a dummy clock for the USB PHY

 arch/arm/boot/dts/imx27-pdk.dts | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/boot/dts/imx27-pdk.dts b/arch/arm/boot/dts/imx27-pdk.dts
index 37d7bde..f0d3145 100644
--- a/arch/arm/boot/dts/imx27-pdk.dts
+++ b/arch/arm/boot/dts/imx27-pdk.dts
@@ -19,6 +19,19 @@
 	memory {
 		reg = <0xa0000000 0x08000000>;
 	};
+
+	usbphy {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbphy0: usbphy at 0 {
+			compatible = "usb-nop-xceiv";
+			reg = <0>;
+			clocks = <&clks 0>;
+			clock-names = "main_clk";
+		};
+	};
 };
 
 &cspi2 {
@@ -80,6 +93,15 @@
 	status = "okay";
 };
 
+&usbotg {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbotg>;
+	dr_mode = "otg";
+	fsl,usbphy = <&usbphy0>;
+	phy_type = "ulpi";
+	status = "okay";
+};
+
 &iomuxc {
 	imx27-pdk {
 		pinctrl_cspi2: cspi2grp {
@@ -128,5 +150,22 @@
 				MX27_PAD_UART1_RTS__UART1_RTS 0x0
 			>;
 		};
+
+		pinctrl_usbotg: usbotggrp {
+			fsl,pins = <
+				MX27_PAD_USBOTG_NXT__USBOTG_NXT 0x0
+				MX27_PAD_USBOTG_STP__USBOTG_STP 0x0
+				MX27_PAD_USBOTG_DIR__USBOTG_DIR 0x0
+				MX27_PAD_USBOTG_CLK__USBOTG_CLK 0x0
+				MX27_PAD_USBOTG_DATA0__USBOTG_DATA0 0x0
+				MX27_PAD_USBOTG_DATA1__USBOTG_DATA1 0x0
+				MX27_PAD_USBOTG_DATA2__USBOTG_DATA2 0x0
+				MX27_PAD_USBOTG_DATA3__USBOTG_DATA3 0x0
+				MX27_PAD_USBOTG_DATA4__USBOTG_DATA4 0x0
+				MX27_PAD_USBOTG_DATA5__USBOTG_DATA5 0x0
+				MX27_PAD_USBOTG_DATA6__USBOTG_DATA6 0x0
+				MX27_PAD_USBOTG_DATA7__USBOTG_DATA7 0x0
+			>;
+		};
 	};
 };
-- 
1.8.3.2

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

* [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate
  2014-04-16 17:53 [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Fabio Estevam
  2014-04-16 17:53 ` [PATCH v2 2/3] ARM: dts: imx27: Place the usb phy nodes in the board dts files Fabio Estevam
  2014-04-16 17:53 ` [PATCH v2 3/3] ARM: dts: imx27-pdk: Add USB OTG support Fabio Estevam
@ 2014-04-17  4:36 ` Shawn Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2014-04-17  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 16, 2014 at 02:53:18PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> USB Host1, Host2 and OTG are gated via 'usb_ipg_gate' clock, so fix it in order
> to avoid the following kernel oops:
> 
> usbcore: registered new interface driver usb-storage
> 10024000.usb supply vbus not found, using dummy regulator
> Unhandled fault: external abort on non-linefetch (0x808) at 0xf4424184
> Internal error: : 808 [#1] PREEMPT ARM
> Modules linked in:
> CPU: 0 PID: 1 Comm: swapper Not tainted 3.15.0-rc1-26325-g971f9fd-dirty #64
> task: c7829aa0 ti: c7836000 task.ti: c7836000
> PC is at ci_hdrc_probe+0x3a4/0x634
> LR is at ci_hdrc_probe+0x100/0x634
> pc : [<c036cc78>]    lr : [<c036c9d4>]    psr: 60000013
> sp : c7837d48  ip : 00000001  fp : 00000000
> r10: 00000000  r9 : 00000000  r8 : c791b6c0
> r7 : c7945000  r6 : f4424000  r5 : c7945010  r4 : c794e010
> r3 : f4424184  r2 : 00000000  r1 : 8c000004  r0 : 0c000004
> Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 0005317f  Table: a0004000  DAC: 00000017
> Process swapper (pid: 1, stack limit = 0xc78361c0)
> Stack: (0xc7837d48 to 0xc7838000)
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied all 3, thanks.

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

end of thread, other threads:[~2014-04-17  4:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 17:53 [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Fabio Estevam
2014-04-16 17:53 ` [PATCH v2 2/3] ARM: dts: imx27: Place the usb phy nodes in the board dts files Fabio Estevam
2014-04-16 17:53 ` [PATCH v2 3/3] ARM: dts: imx27-pdk: Add USB OTG support Fabio Estevam
2014-04-17  4:36 ` [PATCH v2 1/3] ARM: dts: imx27: Use the correct usb clock gate Shawn Guo

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).