ARM: tegra: fix ulpi regression on tegra20
PATCH v2 1/1 ARM: tegra: fix ulpi regression on tegra20
From: Marcel Ziswiler <[email protected]>
Since commit f8f8f1d04494 ("clk: Don't touch hardware when reparenting during registration") ULPI has been broken on Tegra20 leading to the following error message during boot:
[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error -110
Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin muxing actually the PLL_P_OUT4 clock is in use. It looks like so far it just worked by chance of that one having been enabled which Stephen's commit now changed when reparenting sclk away from pll_p_out4 leaving that one disabled. Fix this by properly assigning the PLL_P_OUT4 clock as the ULPI PHY clock.
---
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt | 4 +++- arch/arm/boot/dts/tegra20.dtsi | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt +3 -1
@@ -21,7 +21,9 @@ Required properties : - timer: The timeout clock (clk_m). Present if phy_type == utmi. - utmi-pads: The clock needed to access the UTMI pad control registers. Present if phy_type == utmi. - - ulpi-link: The clock Tegra provides to the ULPI PHY (cdev2). + - ulpi-link: The clock Tegra provides to the ULPI PHY (usually pad DAP_MCLK2 + with pad group aka "nvidia,pins" cdev2 and pin mux option config aka + "nvidia,function" pllp_out4). Present if phy_type == ulpi, and ULPI link mode is in use. - resets : Must contain an entry for each entry in reset-names. See ../reset/reset.txt for details.
arch/arm/boot/dts/tegra20.dtsi +1 -1
@@ -741,7 +741,7 @@ phy_type = "ulpi"; clocks = <&tegra_car TEGRA20_CLK_USB2>, <&tegra_car TEGRA20_CLK_PLL_U>, - <&tegra_car TEGRA20_CLK_CDEV2>; + <&tegra_car TEGRA20_CLK_PLL_P_OUT4>; clock-names = "reg", "pll_u", "ulpi-link"; resets = <&tegra_car 58>, <&tegra_car 22>; reset-names = "usb", "utmi-pads";
Signature · 1 line
2.14.3
Quoted 18 lines · Marcel Ziswiler
From: Marcel Ziswiler <[email protected]>
Since commit
f8f8f1d04494("clk: Don't touch hardware when reparenting during registration") ULPI has been broken on Tegra20 leading to the following error message during boot:[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error -110Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin muxing actually the
PLL_P_OUT4clock is in use. It looks like so far it just worked by chance of that one having been enabled which Stephen's commit now changed when reparenting sclk away frompll_p_out4leaving that one disabled. Fix this by properly assigning thePLL_P_OUT4clock as the ULPI PHY clock.
Quoted 1 line
Signed-off-by Marcel Ziswiler <[email protected]>
Indeed CDEV2 clock doesn't exist on Tegra, but there is a CDEV2 pinmux pad group. Looks like another clk-related relic from downstream driver that was borrowed to upstream and stayed unnoticed for a long time.
I think in practice all T20 boards have CDEV2 configured to PLL_P_OUT4, so this patch is correct to me. Probably it would also worth to set CDEV2 parent to PLL_P_OUT4 in the clk driver for DT backwards compatibility or even make clk driver to read the CDEV2 pinmux config and set the proper parent based on it. CC'ed Peter.
Quoted 39 lines
---
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt | 4 +++- arch/arm/boot/dts/tegra20.dtsi | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt +3
-1@@ -21,7 +21,9 @@ Required properties : - timer: The timeout clock (clk_m). Present if phy_type == utmi. - utmi-pads: The clock needed to access the UTMI pad control registers. Present if phy_type == utmi. - - ulpi-link: The clock Tegra provides to the ULPI PHY (cdev2). + - ulpi-link: The clock Tegra provides to the ULPI PHY (usually pad DAP_MCLK2 + with pad group aka "nvidia,pins" cdev2 and pin mux option config aka + "nvidia,function" pllp_out4). Present if phy_type == ulpi, and ULPI link mode is in use. - resets : Must contain an entry for each entry in reset-names. See ../reset/reset.txt for details.arch/arm/boot/dts/tegra20.dtsi +1
-1@@ -741,7 +741,7 @@ phy_type = "ulpi"; clocks = <&tegra_car TEGRA20_CLK_USB2>, <&tegra_car TEGRA20_CLK_PLL_U>, - <&tegra_car TEGRA20_CLK_CDEV2>; + <&tegra_car TEGRA20_CLK_PLL_P_OUT4>; clock-names = "reg", "pll_u", "ulpi-link"; resets = <&tegra_car 58>, <&tegra_car 22>; reset-names = "usb", "utmi-pads";
Quoted 25 lines · Dmitry Osipenko
Quoted 3 lines · Marcel Ziswiler
From: Marcel Ziswiler <[email protected]>
Since commit
f8f8f1d04494("clk: Don't touch hardware whenreparenting
Quoted 6 lines
during registration") ULPI has been broken on Tegra20 leading to the following error message during boot:
[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error-110
Quoted 4 lines
Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin muxing actually the
PLL_P_OUT4clock is in use. It looks like so farit
Quoted 3 lines
just worked by chance of that one having been enabled which Stephen's commit now changed when reparenting sclk away from
pll_p_out4leaving that one disabled. Fix this by properly assigning thePLL_P_OUT4clock
Quoted 3 lines
as the ULPI PHY clock.
Signed-off-by Marcel Ziswiler <[email protected]>
Quoted 7 lines
Indeed CDEV2 clock doesn't exist on Tegra, but there is a CDEV2 pinmux pad
group. Looks like another clk-related relic from downstream driver that was
borrowed to upstream and stayed unnoticed for a long time.I think in practice all T20 boards have CDEV2 configured to
PLL_P_OUT4,
Exactly.
Quoted 4 lines
so this
patch is correct to me. Probably it would also worth to set CDEV2 parent toPLL_P_OUT4in the clk driver for DT backwards compatibility
I guess that might work but what the original designer(s) probably meant by that strange otherwise nonexistent cdev2 clock might be the other configuration of that pad group called OSC which would allow outputting the base Oscillator frequency even with a separate divider allowing by 2, 4 or even 8 as far as I remember from glancing at the TRM. However like you correctly noted no design ever made use of any such as far as I can tell.
Quoted 4 lines
or even
make clk
driver to read the CDEV2 pinmux config and set the proper parent based on it.
Sounds a little too fancy to me but might work if device tree backwards compatibility is required at utmost importance.
Quoted 3 lines
CC'ed Peter.
Reviewed-by Dmitry Osipenko <[email protected]>
Thanks Dmitry.
Quoted 48 lines
Quoted 7 lines
---
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt | 4+++-
Quoted 1 line
arch/arm/boot/dts/tegra20.dtsi | 2+- > 2 files changed, 4 insertions(+), 2 deletions(-)Quoted 2 lines
diff --git
a/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txtb/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txtQuoted 2 lines
index
a9aa79fb90ed..1aa6f2674af5100644
---
a/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txtQuoted 1 line
+++
b/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txtReview Required properties : · line 22
Quoted 3 lines
(quoted diff) +0
-0@@ -21,7 +21,9 @@ Required properties : - timer: The timeout clock (clk_m). Present if phy_type == utmi. - utmi-pads: The clock needed to access the UTMI pad controlregisters.
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt Required properties :
Quoted 3 lines
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt +1
-1Present if phy_type == utmi. - - ulpi-link: The clock Tegra provides to the ULPI PHY (cdev2). + - ulpi-link: The clock Tegra provides to the ULPI PHY (usuallypad
DAP_MCLK2Review Required properties : · line 25
Quoted 1 line
(quoted diff) +1
-0+ with pad group aka "nvidia,pins" cdev2 and pin mux optionconfig aka
Review
Quoted 5 lines
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt +1
-0+ "nvidia,function" pllp_out4). Present if phy_type == ulpi, and ULPI link mode is in use. - resets : Must contain an entry for each entry in reset-names. See ../reset/reset.txt for details.(quoted diff) +0
-0
b/arch/arm/boot/dts/tegra20.dtsiQuoted 12 lines
index
864a95872b8d..e05b6bb2599f100644arch/arm/boot/dts/tegra20.dtsi +1
-1@@ -741,7 +741,7 @@ phy_type = "ulpi"; clocks = <&tegra_car TEGRA20_CLK_USB2>, <&tegra_car TEGRA20_CLK_PLL_U>, - <&tegra_car TEGRA20_CLK_CDEV2>; + <&tegra_car TEGRA20_CLK_PLL_P_OUT4>; clock-names = "reg", "pll_u", "ulpi-link"; resets = <&tegra_car 58>, <&tegra_car 22>; reset-names = "usb", "utmi-pads";
Quoted 22 lines · Marcel Ziswiler
From: Marcel Ziswiler <[email protected]>
Since commit
f8f8f1d04494("clk: Don't touch hardware when reparenting during registration") ULPI has been broken on Tegra20 leading to the following error message during boot:[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error -110Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin muxing actually the
PLL_P_OUT4clock is in use. It looks like so far it just worked by chance of that one having been enabled which Stephen's commit now changed when reparenting sclk away frompll_p_out4leaving that one disabled. Fix this by properly assigning thePLL_P_OUT4clock as the ULPI PHY clock.Signed-off-by Marcel Ziswiler <[email protected]>---
Quoted 7 lines
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt | 4 +++- arch/arm/boot/dts/tegra20.dtsi | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)
Thierry Reding
AppliedQuoted 22 lines · Marcel Ziswiler
From: Marcel Ziswiler <[email protected]>
Since commit
f8f8f1d04494("clk: Don't touch hardware when reparenting during registration") ULPI has been broken on Tegra20 leading to the following error message during boot:[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error -110Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin muxing actually the
PLL_P_OUT4clock is in use. It looks like so far it just worked by chance of that one having been enabled which Stephen's commit now changed when reparenting sclk away frompll_p_out4leaving that one disabled. Fix this by properly assigning thePLL_P_OUT4clock as the ULPI PHY clock.Signed-off-by Marcel Ziswiler <[email protected]>---
Quoted 7 lines
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt | 4 +++- arch/arm/boot/dts/tegra20.dtsi | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)
Applied, though I've split this into two separate patches, one going into for-4.17/dt-bindings and the other going into for-4.17/arm/dt.
Thanks,
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180308/b764d6d2/attachment.sig>
Quoted 35 lines · Thierry Reding
Quoted 34 lines · Marcel Ziswiler
From: Marcel Ziswiler <[email protected]>
Since commit
f8f8f1d04494("clk: Don't touch hardware when reparenting
during registration") ULPI has been broken on Tegra20 leading to the
following error message during boot:[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error-110
Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin
muxing actually thePLL_P_OUT4clock is in use. It looks like so far it
just worked by chance of that one having been enabled which Stephen's
commit now changed when reparenting sclk away frompll_p_out4leaving
that one disabled. Fix this by properly assigning thePLL_P_OUT4clock
as the ULPI PHY clock.Signed-off-by Marcel Ziswiler <[email protected]>---
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.
Quoted 8 lines
Quoted 5 lines
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt|
4 +++-
arch/arm/boot/dts/tegra20.dtsi|
2 +-2 files changed, 4 insertions(+), 2 deletions(-)Applied, though I've split this into two separate patches, one going into for-4.17/dt-bindings and the other going into for-4.17/arm/dt.
Thanks, Thierry!
BTW: Do you know what is happening with my T30 USB patch? Is there anything I may do about it?
Quoted 2 lines
Thanks,
Thierry
Quoted 42 lines · Marcel Ziswiler
Quoted 41 lines · Thierry Reding
Quoted 39 lines · Marcel Ziswiler
From: Marcel Ziswiler <[email protected]>
Since commit
f8f8f1d04494("clk: Don't touch hardware when reparenting
during registration") ULPI has been broken on Tegra20 leading to the
following error message during boot:[ 1.974698] ulpi_phy_power_on: ulpi write failed [ 1.979384] tegra-ehci c5004000.usb: Failed to power on the phy [ 1.985434] tegra-ehci: probe of c5004000.usb failed with error-110
Debugging through the changes and finally also consulting the TRM revealed that rather than the CDEV2 clock off OSC requiring such pin
muxing actually thePLL_P_OUT4clock is in use. It looks like so far it
just worked by chance of that one having been enabled which Stephen's
commit now changed when reparenting sclk away frompll_p_out4leaving
that one disabled. Fix this by properly assigning thePLL_P_OUT4clock
as the ULPI PHY clock.Signed-off-by Marcel Ziswiler <[email protected]>---
Changes in v2:
- Updated device tree binding documentation as well.
- CCing Dmitry as well.
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt|
4 +++-
arch/arm/boot/dts/tegra20.dtsi|
2 +-2 files changed, 4 insertions(+), 2 deletions(-)
Quoted 7 lines
Quoted 2 lines
Applied, though I've split this into two separate patches, one going into for-4.17/dt-bindings and the other going into for-4.17/arm/dt.
Thanks, Thierry!
BTW: Do you know what is happening with my T30 USB patch? Is there anything I may do about it?
I just took care of that.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180308/5f75670d/attachment.sig>