[U-Boot] [PATCH] powerpc/usb: fix bug of CPU hang when missing USB PHY clock

Anatolij Gustschin agust at denx.de
Fri Oct 19 22:13:55 CEST 2012


Hi,

On Thu, 18 Oct 2012 06:21:56 +0200
Marek Vasut <marex at denx.de> wrote:

> Dear Shengzhou Liu,
> 
> > when missing USB PHY clock, u-boot will hang during USB
> > initialization when issuing "usb start". We should check
> > USBGP[PHY_CLK_VALID] bit to avoid CPU hanging in this case.
> > 
> > Signed-off-by: Shengzhou Liu <Shengzhou.Liu at freescale.com>
> 
> CCing PPC experts.
...
> > @@ -82,18 +94,16 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr,
> > struct ehci_hcor **hcor) udelay(1000); /* delay required for PHY Clk to
> > appear */
> >  #endif
> >  		out_le32(&(*hcor)->or_portsc[0], PORT_PTS_UTMI);
> > +		setbits_be32(&ehci->control, USB_EN);
> >  	} else {
> > -#if defined(CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY)
> > -		clrbits_be32(&ehci->control, UTMI_PHY_EN);
> >  		setbits_be32(&ehci->control, PHY_CLK_SEL_ULPI);
> > +		clrsetbits_be32(&ehci->control, UTMI_PHY_EN, USB_EN);
> >  		udelay(1000); /* delay required for PHY Clk to appear */
> > -#endif
> > +		if (!usb_phy_clk_valid(ehci))
> > +			return -EINVAL;
> >  		out_le32(&(*hcor)->or_portsc[0], PORT_PTS_ULPI);
> >  	}
> > 
> > -	/* Enable interface. */
> > -	setbits_be32(&ehci->control, USB_EN);

you moved the USB interface enabling before the PHY CLK check but the
commit description doesn't mention why it is needed. It would be good
to mention the reason in the commit log.

Thanks,
Anatolij


More information about the U-Boot mailing list