各位好,
因为Ti 发布的SDK需要在不更改代码的情况下运行在Ti不同的EVM上,所以Ti在代码中会添加对EVM板上EEPROM内部ID的判断。对于不需要此功能的客户,第一次做软件移植时会带来一些麻烦。所以我写了一个简单的文档和patch来说明如何去掉eeprom,也欢迎大家讨论和完善。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
各位好,
因为Ti 发布的SDK需要在不更改代码的情况下运行在Ti不同的EVM上,所以Ti在代码中会添加对EVM板上EEPROM内部ID的判断。对于不需要此功能的客户,第一次做软件移植时会带来一些麻烦。所以我写了一个简单的文档和patch来说明如何去掉eeprom,也欢迎大家讨论和完善。
static int read_eeprom(struct am335x_baseboard_id *header)
{
puts("board/ti/am335x/board.c read_eeprom\n");
memcpy(header->name,"A335X_SK",HDR_NAME_LEN);
#if 0
/* Check if baseboard eeprom is available */
if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) {
puts("Could not probe the EEPROM; something fundamentally "
"wrong on the I2C bus.\n");
return -ENODEV;
}
/* read the eeprom using i2c */
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, (uchar *)header,
sizeof(struct am335x_baseboard_id))) {
puts("Could not read the EEPROM; something fundamentally"
" wrong on the I2C bus.\n");
return -EIO;
}
if (header->magic != 0xEE3355AA) {
/*
* read the eeprom using i2c again,
* but use only a 1 byte address
*/
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 1, (uchar *)header,
sizeof(struct am335x_baseboard_id))) {
puts("Could not read the EEPROM; something "
"fundamentally wrong on the I2C bus.\n");
return -EIO;
}
if (header->magic != 0xEE3355AA) {
printf("Incorrect magic number (0x%x) in EEPROM\n",
header->magic);
return -EINVAL;
}
}
#endif
return 0;
}
这么改不是更好么,改动小