[U-Boot] [PATCH v2 3/6] cm-t35: add EEPROM module and pass Linux a serial number
Nikita Kiryanov
nikita at compulab.co.il
Mon Jan 9 09:30:19 CET 2012
On 01/05/2012 04:56 PM, Wolfgang Denk wrote:
> Dear Igor Grinberg,
>
> In message<1325764937-7342-1-git-send-email-grinberg at compulab.co.il> you wrote:
>> From: Nikita Kiryanov<nikita at compulab.co.il>
>>
>> Add board specific EEPROM handling module,
>> read the serial number from the EEPROM and pass it to Linux.
> ...
>
>> * Fix strange linker warning: ".bss section overlaps previous sections"
>> by changing the type of the eeprom_layout static global variable to int
>> (probably this is a compiler bug).
> Probably it is now. Did you inspect the linke rmap?
u-boot.map shows the bss section aligning perfectly with the start of
rel.dyn.
The difference between the original "working" version and the version
with the warning
was an additional byte added by uchar eeprom_layout to the size of
libcm_t35.o.
This shouldn't be a problem because the bss section is followed by an
ALIGN(4), but
we decided to try changing eeprom_layout to an int and the problem went
away.
When we tried to define 4 uchars the problem reappeared.
This suggests that this might be a compiler bug.
There's been some discussion about this in the following threads:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/114646
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/90723
and we're not aware of any fix to the issue.
>> +static int cm_t3x_eeprom_read(uint offset, uchar *buf, int len)
>> +{
>> + return i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, offset,
>> + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, buf, len);
>> +}
> Is there any specific reason why you cannot use the standard
> eeprom_read() function here?
The inclusion of the entire eeprom library for this one function will just
increase the image size needlessly. Moreover we don't want to add
eeprom commands, because the eeprom on this module is for internal
use only.
>> --- /dev/null
>> +++ b/board/cm_t35/eeprom.h
> ...
>> +#ifndef CONFIG_DRIVER_OMAP34XX_I2C
>> +void get_board_serial(struct tag_serialnr *serialnr)
>> +{
>> + /*
>> + * This corresponds to what happens when we can communicate with the
>> + * eeprom but don't get a valid board serial value.
>> + */
>> + serialnr->low = 0;
>> + serialnr->high = 0;
>> +};
>> +#endif /* CONFIG_DRIVER_OMAP34XX_I2C */
> Please do NOT place code into header files.
Will be fixed in the next version.
> Best regards,
>
> Wolfgang Denk
>
More information about the U-Boot
mailing list