[U-Boot] [PATCH v3 2/2] ftsdmc021: add register definitions of ftsdmc021

Macpaul Lin macpaul at gmail.com
Tue Apr 26 09:20:24 CEST 2011


Hi Wolfgang,

2011/4/26 Wolfgang Denk <wd at denx.de>:
> Dear Macpaul Lin,
>> +#define FTSDMC021_OFFSET_BANK7_BSR   0x2C    /* External Bank Base/Size Reg 7 */
>
> Lines too long.  Please fix globally.
>
> I think it is generally wrong to manually define these offsets here.
> You should use a C struct instead, and auto-generate the offsets if
> needed using the asm-offsets approach (see top level Makefile for
> details).

Since this is a patch send before in old times, I will fix it soon and
send the next patch.

>> +#define FTSDMC021_BANK_SIZE_128M     0x7
>> +#define FTSDMC021_BANK_SIZE_256M     0x8
>> +#define FTSDMC021_BANK_SIZE_512M     0x9
>
> Why don't you use a generic macro here, like
>
>        #define FTSDMC021_BANK_SIZE(sz) (ffs(x) - 21)

Thanks for your suggestion.


-- 
Best regards,
Macpaul Lin


More information about the U-Boot mailing list