[U-Boot] [PATCH 1/2] imx: Get fec mac address from fuse

Shawn Guo shawn.gsc at gmail.com
Mon Oct 25 15:07:53 CEST 2010


I was not in the mail list when Jason posted the patch, so I emulated
the reply message.

> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 3f09c2b..e8d7b98 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -312,21 +312,17 @@ static void fec_rbd_clean(int last, struct fec_bd *pRbd)

> static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
> {
> -/*
> - * The MX27 can store the mac address in internal eeprom
> - * This mechanism is not supported now by MX51 or MX25
> - */
> -#if defined(CONFIG_MX51) || defined(CONFIG_MX25)
> -	return -1;
> -#else
> +	/*
> +	 * The MX27 can store the mac address in internal eeprom
> +	 * This mechanism is also supported now by MX51 or MX25
> +	 */
>
The comment was added to distinguish the MX27 support from MX51/25 on
mac fuse.  Since the support becomes common, can we just simply remove
the comment?  Also, the mac is implemented in fuse like the message
title tells than "eeprom".

>  	struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
>  	int i;
>
>  	for (i = 0; i < 6; i++)
> -		mac[6-1-i] = readl(&iim->iim_bank_area0[IIM0_MAC + i]);
> +		mac[6-1-i] = readl(&iim->iim_bank_area[IIM_MAC + i]);
>
There is a bug.  The fix could be as below (tested on mx51evk).

-               mac[6-1-i] = readl(&iim->iim_bank_area0[IIM0_MAC + i]);
+              mac[i] = readl(&iim->iim_bank_area[IIM_MAC + i]);

> 	return !is_valid_ether_addr(mac);
> -#endif
> }


-- 
Regards,
Shawn


More information about the U-Boot mailing list