From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Tue, 23 Jul 2019 07:19:38 +0000 Subject: [U-Boot] [PATCH V2 4/4] net: fec: add fuse check In-Reply-To: <20190723073445.23864-1-peng.fan@nxp.com> References: <20190723073445.23864-1-peng.fan@nxp.com> Message-ID: <20190723073445.23864-4-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 fec. If the fuse indicates the module will not work in the SoC, let's fail the initialization. Signed-off-by: Peng Fan --- V2: Update commit and debug info drivers/net/fec_mxc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 96e3ad9a1a..c666874b98 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1185,6 +1185,13 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr) #endif int ret; + if (IS_ENABLED(CONFIG_IMX_MODULE_FUSE)) { + if (enet_fused(addr)) { + printf("SoC fuse indicates Ethernet at 0x%x is unavailable.\n", addr); + return -ENODEV; + } + } + #ifdef CONFIG_FEC_MXC_MDIO_BASE /* * The i.MX28 has two ethernet interfaces, but they are not equal. @@ -1323,6 +1330,13 @@ static int fecmxc_probe(struct udevice *dev) uint32_t start; int ret; + if (IS_ENABLED(CONFIG_IMX_MODULE_FUSE)) { + if (enet_fused((u32)priv->eth)) { + printf("SoC fuse indicates Ethernet at 0x%x is unavailable.\n", (u32)priv->eth); + return -ENODEV; + } + } + if (IS_ENABLED(CONFIG_IMX8)) { ret = clk_get_by_name(dev, "ipg", &priv->ipg_clk); if (ret < 0) { -- 2.16.4