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

Stefano Babic sbabic at denx.de
Thu Nov 18 14:38:01 CET 2010


On 11/18/2010 12:49 PM, Jason Liu wrote:
> The patch is to support getting FEC MAC address from fuse bank.
> 
> Signed-off-by: Jason Liu <r64343 at freescale.com>
> 

Hi Jason,

> diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
> index 0b6249a..d618bca 100644
> --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
> @@ -205,9 +205,13 @@
>  #define BOARD_REV_1_0           0x0
>  #define BOARD_REV_2_0           0x1
>  
> +#define IMX_IIM_BASE            (IIM_BASE_ADDR)
> +
>  #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
>  #include <asm/types.h>
>  
> +extern void imx_get_mac_from_fuse(unsigned char *mac);
> +
>  #define __REG(x)	(*((volatile u32 *)(x)))
>  #define __REG16(x)	(*((volatile u16 *)(x)))
>  #define __REG8(x)	(*((volatile u8 *)(x)))
> @@ -275,6 +279,36 @@ struct src {
>  	u32	sisr;
>  	u32	simr;
>  };
> +
> +struct iim_regs {
> +	u32 	stat;

Space before tabs:

+^Iu32 ^Istat;$

You should run checkpatch on your patch. It checks for such kind of
problems.

> +	u32 	statm;
           ^--- Space before tabs

The same for all fields in the structure.

I applied your patch and I tested on a i.MX27 Lite board. The result
does not seem correct. According to the manual, the mac address is store
at address 0x10028814. Rather there is no stored MAC at this address on
my board, but your patch read the MAC from address 0x10028810 (I traced
the address of fuse->mac_addr).

The reported address is what we can see at 0x10028810 (Word 4 of
fusebank 0):

md 0x10028804
10028804: 00000020 00000081 00000040 00000010     ....... at .......
10028814: 00000000 00000000 00000000 00000000    ................

And u-boot reports :
Address in SROM is         00:00:00:00:00:10
Address in environment is  00:aa:dd:cc:11:22

It seems you read at a wrong address.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list