From: Peng Fan Date: Thu, 1 Aug 2019 08:45:52 +0000 Subject: [U-Boot] [PATCH v2 3/4] usb: mx6: add fuse check In-Reply-To: <20190801090117.24692-1-peng.fan@nxp.com> References: <20190801090117.24692-1-peng.fan@nxp.com> Message-ID: <20190801090117.24692-3-peng.fan@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- V2: Fix build for aarch64 drivers/usb/host/ehci-mx6.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index e9e6ed596d..4a298849c5 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -353,6 +353,14 @@ int ehci_hcd_init(int index, enum usb_init_type init, if (index > 3) return -EINVAL; + if (IS_ENABLED(CONFIG_IMX_MODULE_FUSE)) { + if (usb_fused((ulong)ehci)) { + printf("SoC fuse indicates USB at 0x%lx is unavailable.\n", + (ulong)ehci); + return -ENODEV; + } + } + ret = ehci_mx6_common_init(ehci, index); if (ret) return ret; @@ -549,6 +557,14 @@ static int ehci_usb_probe(struct udevice *dev) struct ehci_hcor *hcor; int ret; + if (IS_ENABLED(CONFIG_IMX_MODULE_FUSE)) { + if (usb_fused((ulong)ehci)) { + printf("SoC fuse indicates USB at 0x%lx is unavailable.\n", + (ulong)ehci); + return -ENODEV; + } + } + priv->ehci = ehci; priv->portnr = dev->seq; priv->init_type = type; -- 2.16.4