All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 3/4] usb: mx6: add fuse check
Date: Tue, 23 Jul 2019 07:19:34 +0000	[thread overview]
Message-ID: <20190723073445.23864-3-peng.fan@nxp.com> (raw)
In-Reply-To: <20190723073445.23864-1-peng.fan@nxp.com>

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>
---

V2:
 Update commit and debug info

 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..60b4d1ceb3 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((u32)ehci)) {
+			printf("SoC fuse indicates USB at 0x%x is unavailable.\n",
+			       (u32)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((u32)ehci)) {
+			printf("SoC fuse indicates USB at 0x%x is unavailable.\n",
+			       (u32)ehci);
+			return -ENODEV;
+		}
+	}
+
 	priv->ehci = ehci;
 	priv->portnr = dev->seq;
 	priv->init_type = type;
-- 
2.16.4

  parent reply	other threads:[~2019-07-23  7:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  7:19 [U-Boot] [PATCH V2 1/4] imx: add module fuse support Peng Fan
2019-07-23  7:19 ` [U-Boot] [PATCH V2 2/4] i2c: mxc: add fuse check Peng Fan
2019-07-23  7:19 ` Peng Fan [this message]
2019-07-23  7:19 ` [U-Boot] [PATCH V2 4/4] net: fec: " Peng Fan
2019-07-23  7:36   ` Joe Hershberger
2019-08-01  8:45 [U-Boot] [PATCH v2 1/4] imx: add module fuse support Peng Fan
2019-08-01  8:45 ` [U-Boot] [PATCH v2 3/4] usb: mx6: add fuse check Peng Fan

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=20190723073445.23864-3-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.