From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc/usb: fix bug of CPU hang when missing USB PHY clock
Date: Fri, 19 Oct 2012 22:13:55 +0200 [thread overview]
Message-ID: <20121019221355.31d41e84@wker> (raw)
In-Reply-To: <201210180621.57010.marex@denx.de>
Hi,
On Thu, 18 Oct 2012 06:21:56 +0200
Marek Vasut <marex@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@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
next prev parent reply other threads:[~2012-10-19 20:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 2:40 [U-Boot] [PATCH] powerpc/usb: fix bug of CPU hang when missing USB PHY clock Shengzhou Liu
2012-10-18 4:21 ` Marek Vasut
2012-10-18 6:28 ` Liu Shengzhou-B36685
2012-10-18 7:15 ` Marek Vasut
2012-10-18 8:54 ` Liu Shengzhou-B36685
2012-10-18 9:04 ` Marek Vasut
2012-10-19 21:21 ` Andy Fleming
2012-10-22 4:51 ` Liu Shengzhou-B36685
2012-10-19 20:13 ` Anatolij Gustschin [this message]
2012-10-22 3:47 ` Liu Shengzhou-B36685
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121019221355.31d41e84@wker \
--to=agust@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox