ARM: dts: imx27: Use the correct usb clock gate
Subsystems (2)
Fabio Estevam
reviewerPATCH v2 1/3 ARM: dts: imx27: Use the correct usb clock gate
From: Fabio Estevam <[email protected]>
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)
---
Changes since v1:
- None
arch/arm/boot/dts/imx27.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/imx27.dtsi +3 -3
@@ -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";
Signature · 1 line
1.8.3.2
Fabio Estevam
reviewerPATCH v2 2/3 ARM: dts: imx27: Place the usb phy nodes in the board dts files
From: Fabio Estevam <[email protected]>
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.
---
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(-)
arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts +15 -4
@@ -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 = <®_5v0>; + clocks = <&clks 0>; + clock-names = "main_clk"; + }; + }; }; &cspi1 {
@@ -268,14 +282,11 @@ dr_mode = "host"; phy_type = "ulpi"; vbus-supply = <®_5v0>; + fsl,usbphy = <&usbphy2>; disable-over-current; status = "okay"; }; -&usbphy2 { - vcc-supply = <®_5v0>; -}; - &weim { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_weim>;
arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi +15 -4
@@ -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";
arch/arm/boot/dts/imx27.dtsi +0 -22
@@ -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"; };
Signature · 1 line
1.8.3.2
Fabio Estevam
reviewerPATCH v2 3/3 ARM: dts: imx27-pdk: Add USB OTG support
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
---
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(+)
arch/arm/boot/dts/imx27-pdk.dts +39 -0
@@ -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 + >; + }; }; };
Signature · 1 line
1.8.3.2
Shawn Guo
AppliedPATCH v2 1/3 ARM: dts: imx27: Use the correct usb clock gate
In reply to Fabio EstevamQuoted 22 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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) at0xf4424184Internal 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: 60000013sp :
c7837d48ip : 00000001 fp : 00000000
r10: 00000000 r9 : 00000000 r8 :c791b6c0
r7 :c7945000r6 :f4424000r5 :c7945010r4 :c794e010r3 :f4424184r2 : 00000000 r1 :8c000004r0 :0c000004
Flags: nZCv IRQs on FIQs on ModeSVC_32ISA ARM Segment kernel
Control:0005317fTable:a0004000DAC: 00000017 Process swapper (pid: 1, stack limit =0xc78361c0)
Quoted 3 lines
Stack: (0xc7837d48 to 0xc7838000)Signed-off-by Fabio Estevam <[email protected]>
Applied all 3, thanks.