2010/11/17 Stefano Babic <sba...@denx.de>: > On 11/17/2010 03:22 AM, Jason Liu wrote: > >> It's OK, I think. But there will change a lot of code for the platform >> other than i.mx51. > > You have already posted changes for the whole i.MX family we currently > support. > > However, I understand you do not want to specify the whole layout for > all processors, that means more effort. At least you must specify in the > structure where we cann access the mac address. > > You could do in this way > > typedef union fuse_bank { > struct { > u32 fuses_0[..] > u32 mac_addr[6]; > u32 other_fuses[...]; > u32 reserved_filled[..]; /* to fill the 0x80-0xFF*/ > }; > /* > * If we do not want to set now the layout, we can distinguish > * only between real register and reserved addresses > * as you already did > */ > struct { > u32 fuse_regs[0x20]; > u32 reserved[0xe0]; > } > } > > This still allows to have an array of fuse_banks in the iim structure.
what about the following code snip which consider you and Wolfgang's proposal. +struct fuse_bank { + u32 used[0x20]; + u32 resv[0xe0]; +}; + +struct fuse_bank1 { + u32 fuse_prot; + u32 srk_hash; + u32 sjc_resp[7]; + u32 mac_addr[6]; + u32 other_fuse[...] + u32 reserved_filled[...]; +}; + +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]; + struct fuse_bank fuse_banks[4]; +}; + > > When someone will implement functions to manage the fuses, he will > change the fuse_bank structure naming all fields as specified in the > i.MX manuals. OK, agree. > >> In fact, the rule of my every commit patch is to solve one problem or >> add one feature with the minimum code change to the exist code base. > > To solve one single problem, yes. With minimum code change, no. This > rule does not apply. Changing code searching for the best solution, yes. > Even if we have to change much more code. This is different with my working style. OK, I will take care later. > >> If need some code clean-up or restructure, then use another commit to >> fix it. This will give us a clear track of the code change. If you >> insist on changing it in this patch, I will follow your rule to change >> it. > > Check my proposal. I think you need to change slightly the code. OK, thanks for your proposal. > > 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: off...@denx.de > ===================================================================== > _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot