aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2020-05-01 22:08:36 +0800
committerStefano Babic <sbabic@denx.de>2020-05-10 13:21:27 +0200
commit0bd3d911df12816ab8e32d9245449aeca484b539 (patch)
tree0e5df8f7f25a537fc8a699cde2c10f10aa0f7bae /drivers/usb
parent7d1ee741d1367172eaf92c554ebf56b9cba13504 (diff)
downloadu-boot-0bd3d911df12816ab8e32d9245449aeca484b539.zip
u-boot-0bd3d911df12816ab8e32d9245449aeca484b539.tar.gz
u-boot-0bd3d911df12816ab8e32d9245449aeca484b539.tar.bz2
usb: mx6: add fuse check
Add fuse check for USB. If the fuse indicates the module will not work in the SoC, let's fail the initialization. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-mx6.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index f2ceb51..04eb3c0 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -380,6 +380,14 @@ int ehci_hcd_init(int index, enum usb_init_type init,
if (index > 3)
return -EINVAL;
+ if (CONFIG_IS_ENABLED(IMX_MODULE_FUSE)) {
+ if (usb_fused((ulong)ehci)) {
+ printf("SoC fuse indicates USB@0x%lx is unavailable.\n",
+ (ulong)ehci);
+ return -ENODEV;
+ }
+ }
+
ret = ehci_mx6_common_init(ehci, index);
if (ret)
return ret;
@@ -577,6 +585,14 @@ static int ehci_usb_probe(struct udevice *dev)
struct ehci_hcor *hcor;
int ret;
+ if (CONFIG_IS_ENABLED(IMX_MODULE_FUSE)) {
+ if (usb_fused((ulong)ehci)) {
+ printf("SoC fuse indicates USB@0x%lx is unavailable.\n",
+ (ulong)ehci);
+ return -ENODEV;
+ }
+ }
+
priv->ehci = ehci;
priv->portnr = dev->seq;
priv->init_type = type;