[U-Boot] [PATCH 4/4] net: fec: add fuse check
Joe Hershberger
joe.hershberger at ni.com
Tue Jul 23 03:27:16 UTC 2019
On Thu, Jul 18, 2019 at 10:24 PM Peng Fan <peng.fan at nxp.com> wrote:
>
> Add fuse check for fec. If the fuse indicate the module
> not work in the SoC, let's fail the initialization.
"indicates the module will not work"
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
> drivers/net/fec_mxc.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index d7c080943a..602b655455 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("Ethernet at 0x%x is fused, disable it\n", addr);
Please reword this. Something like "SoC fuse indicates Ethernet at 0x%x
is unavailable."
> + return -ENODEV;
> + }
> + }
> +
> #ifdef CONFIG_FEC_MXC_MDIO_BASE
> /*
> * The i.MX28 has two ethernet interfaces, but they are not equal.
> @@ -1323,6 +1330,14 @@ 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("Ethernet at 0x%x is fused, disable it\n",
Same.
> + (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
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
More information about the U-Boot
mailing list