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

Jason Liu liu.h.jason at gmail.com
Tue Nov 16 08:16:17 CET 2010


2010/11/16 Wolfgang Denk <wd at denx.de>:
> Dear Jason Liu,
>
> In message <AANLkTimXrZANNdroChBFpOhu13VUWXsBdOdBUUn5fBYj at mail.gmail.com> you wrote:
>>
>> Do you have any good method to put the mac address into one structure
>> and use that filed to access it?
>> Currently, we only use the MAC fuse, there is a lot of fuse not used?
>> if we defined as bellow,  what your comments?
>>
>> struct iim_regs {
>>         u32 stat;
>>         u32 statm;
>>         u32 err;
>>         u32 emask;
>>         u32 fctl;
>>         u32 ua;
>>         u32 la;
>>         u32 sdat;
>>         u32 prev;
>>         u32 srev;
>>         u32 preg_p;
>>         u32 scs0;
>>         u32 scs1;
>>         u32 scs2;
>>         u32 scs3;
>>         u32 res0[0x1f1];
>>         u32 iim_bank_area0_1[9];
>>         u32 mac_addr[6];
>>         u32 iim_bank_area0_2[0x11];
>>         u32 res1[0xe0];
>>         u32 iim_bank_area1[0x20];
>>         u32 res2[0xe0];
>>         u32 iim_bank_area2[0x20];
>>         u32 res3[0xe0];
>>         u32 iim_bank_area3[0x20];
>>         u32 res4[0xe0];
>> };
>
> This struct is supposed to describe some register layout defined by
> the hardware - but does the hardware know anything about teh special
> meaning "MAC address" of this specific field, or is this an
> interpretation that we just define as we like?

This is defined according to the IC spec and it should be hw layout.
We can read such kind of fuse just like read register.  But currently, uboot
require that all the register array should be included into one
structure and not
use the *(offset + base_addr) method, this is also stefano suggestion. But for
fuse support, there are many fuses but we only use FEC_MAC fuse
currently, this is why
I ask how to handle it better in uboot.

Stefano, what's your comments?

Thanks for your help.

>
> If this is not a hardware given thing, we should not define this in
> iim_regs; instead, we should define a separate struct that describes
> how we decided to use iim_bank_area0.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "It follows that any commander in chief who undertakes to carry out a
> plan which he considers defective is at fault; he must put forth  his
> reasons,  insist  of  the  plan being changed, and finally tender his
> resignation rather than be the instrument of his army's downfall."
> - Napoleon, "Military Maxims and Thought"
>


More information about the U-Boot mailing list