aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShengzhou Liu <Shengzhou.Liu@freescale.com>2012-02-01 22:23:14 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-02 15:46:36 -0500
commit529febeee680dc22416fca033151a5e8bc620447 (patch)
tree6ea05e6734be0b1699c5e96f6eba1912fd801a94
parented2833ac7ee86ee00f6dd3085a32752209fd8b6e (diff)
powerpc/usb: fix issue of CPU halt when missing USB PHY clock
when missing USB PHY clock, kernel booting up will halt during USB initialization. We should check USBGP[PHY_CLK_VALID] bit to avoid CPU hang in this case. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/ehci-fsl.c11
-rw-r--r--drivers/usb/host/ehci-fsl.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index b556a72264d1..c26a82e83f6e 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -239,7 +239,7 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci,
239 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); 239 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]);
240} 240}
241 241
242static void ehci_fsl_usb_setup(struct ehci_hcd *ehci) 242static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
243{ 243{
244 struct usb_hcd *hcd = ehci_to_hcd(ehci); 244 struct usb_hcd *hcd = ehci_to_hcd(ehci);
245 struct fsl_usb2_platform_data *pdata; 245 struct fsl_usb2_platform_data *pdata;
@@ -299,12 +299,19 @@ static void ehci_fsl_usb_setup(struct ehci_hcd *ehci)
299#endif 299#endif
300 out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001); 300 out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001);
301 } 301 }
302
303 if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & CTRL_PHY_CLK_VALID)) {
304 printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n");
305 return -ENODEV;
306 }
307 return 0;
302} 308}
303 309
304/* called after powerup, by probe or system-pm "wakeup" */ 310/* called after powerup, by probe or system-pm "wakeup" */
305static int ehci_fsl_reinit(struct ehci_hcd *ehci) 311static int ehci_fsl_reinit(struct ehci_hcd *ehci)
306{ 312{
307 ehci_fsl_usb_setup(ehci); 313 if (ehci_fsl_usb_setup(ehci))
314 return -ENODEV;
308 ehci_port_power(ehci, 0); 315 ehci_port_power(ehci, 0);
309 316
310 return 0; 317 return 0;
diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h
index 491806221165..bdf43e2adc51 100644
--- a/drivers/usb/host/ehci-fsl.h
+++ b/drivers/usb/host/ehci-fsl.h
@@ -45,5 +45,6 @@
45#define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */ 45#define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */
46#define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */ 46#define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */
47#define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */ 47#define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */
48#define CTRL_PHY_CLK_VALID (1 << 17)
48#define SNOOP_SIZE_2GB 0x1e 49#define SNOOP_SIZE_2GB 0x1e
49#endif /* _EHCI_FSL_H */ 50#endif /* _EHCI_FSL_H */