2013-05-24 14:49:08

by Johannes Thumshirn

[permalink] [raw]
Subject: Freescale P1022 SoC hangs when initializing USB

Hi list,

I'm experiencing problems while booting on a Freescale P1013 based board. It hangs on USB initialization:
[ 3.763584] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 3.770519] ehci-pci: EHCI PCI platform driver
[ 3.775116] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 3.781972] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
[ 3.788812] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1

The corresponding device-tree:
usb@22000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl-usb2-dr";
reg = <0x22000 0x1000>;
interrupt-parent = <&mpic>;
interrupts = <28 0x2 0 0>;
phy_type = "ulpi";
};

usb@23000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl-usb2-dr";
reg = <0x23000 0x1000>;
interrupt-parent = <&mpic>;
interrupts = <46 0x2 0 0>;
phy_type = "ulpi";
};

It also seems I'm not the only one having this problem:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2013-January/103344.html
though my configuration uses ULPI instead of UTMI mode and a warm reset doesn't
get it up as well.

I can verify that the 1st write to ehci->regs->port_status[0] in ehci_fsl_setup_phy()
causes the hang and the P1022 Datasheet states:
"A write to registers in the USB controller memory map may cause the
system to hang if PORTSC[PHCD]=0 when no USB PHY clock is applied."
- (Ch. 18.2 - p. 1098).
Setting PORTSC[PHCD]=1 solves the hang for exactly one write.
I can verify it on 3.4.18 as well as on 3.10-rc2.

A hardware problem can be eliminated as U-Boot and VxWorks have no trouble initializing the EHCI.
Does anyone have similar problems or a solution to this?

Copying U-Boot's PHY initialization routine to enable the ULPI clock did not get it up either.

Thanks in advance,
Johannes


2013-05-24 17:05:47

by Anatolij Gustschin

[permalink] [raw]
Subject: Re: Freescale P1022 SoC hangs when initializing USB

On Fri, 24 May 2013 14:42:46 +0000
"Thumshirn, Johannes Tobias" <[email protected]> wrote:

> Hi list,
>
> I'm experiencing problems while booting on a Freescale P1013 based board. It hangs on USB initialization:
> [ 3.763584] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [ 3.770519] ehci-pci: EHCI PCI platform driver
> [ 3.775116] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> [ 3.781972] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
> [ 3.788812] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
>
> The corresponding device-tree:
> usb@22000 {
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "fsl-usb2-dr";
> reg = <0x22000 0x1000>;
> interrupt-parent = <&mpic>;
> interrupts = <28 0x2 0 0>;
> phy_type = "ulpi";
> };
>
> usb@23000 {
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "fsl-usb2-dr";
> reg = <0x23000 0x1000>;
> interrupt-parent = <&mpic>;
> interrupts = <46 0x2 0 0>;
> phy_type = "ulpi";
> };

please change compatible property in both nodes to

compatible = "fsl-usb2-dr-v1.6", "fsl-usb2-dr";

and try again to see if it helps.

Thanks,

Anatolij

2013-05-27 08:54:18

by Johannes Thumshirn

[permalink] [raw]
Subject: AW: Freescale P1022 SoC hangs when initializing USB


> Hi list,
>
> I'm experiencing problems while booting on a Freescale P1013 based board. It hangs on USB initialization:
> [ 3.763584] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [ 3.770519] ehci-pci: EHCI PCI platform driver
> [ 3.775116] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> [ 3.781972] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
> [ 3.788812] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
>
> The corresponding device-tree:
> usb@22000 {
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "fsl-usb2-dr";
> reg = <0x22000 0x1000>;
> interrupt-parent = <&mpic>;
> interrupts = <28 0x2 0 0>;
> phy_type = "ulpi"; };
>
> usb@23000 {
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "fsl-usb2-dr";
> reg = <0x23000 0x1000>;
> interrupt-parent = <&mpic>;
> interrupts = <46 0x2 0 0>;
> phy_type = "ulpi"; };

please change compatible property in both nodes to

compatible = "fsl-usb2-dr-v1.6", "fsl-usb2-dr";

and try again to see if it helps.

Thanks,

Anatolij

This solves the boot hang, thanks a lot

Johannes