diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-11 13:43:00 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-11 13:43:00 +0200 |
commit | 3fcf4400a7b051bdbe9fc175b88336519099ff22 (patch) | |
tree | 59e47312f23697970b3defc010a15f367b8e5082 /drivers/usb | |
parent | b33c2913d747d3c55019a1d310427ca2697de6fc (diff) | |
parent | 22a073e3a9cdbc8034d5c58a6840e2567e5b3ddd (diff) | |
download | barebox-3fcf4400a7b051bdbe9fc175b88336519099ff22.tar.gz barebox-3fcf4400a7b051bdbe9fc175b88336519099ff22.tar.xz |
Merge branch 'for-next/imx'
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/imx/chipidea-imx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c index bf8b6f1eb8..f71cf80b7d 100644 --- a/drivers/usb/imx/chipidea-imx.c +++ b/drivers/usb/imx/chipidea-imx.c @@ -260,8 +260,6 @@ static int imx_chipidea_probe(struct device_d *dev) * devices which have only one. */ ci->clk = clk_get(dev, NULL); - if (!IS_ERR(ci->clk)) - clk_enable(ci->clk); /* Device trees are using both "phys" and "fsl,usbphy". Prefer the * more modern former one but fall back to the old one. @@ -302,6 +300,14 @@ static int imx_chipidea_probe(struct device_d *dev) ci->data.drvdata = ci; ci->data.usbphy = ci->usbphy; + /* + * Enable the clock after we ensured that all resources are available. + * This is crucial since the phy can be missing which and so the + * usb-controller <-> usb-phy communication is only partly initialized. + * This can trigger strange system hangs at least on i.MX8M SoCs. + */ + clk_enable(ci->clk); + if ((ci->flags & MXC_EHCI_PORTSC_MASK) == MXC_EHCI_MODE_HSIC) imx_chipidea_port_init(ci); |