On 2/18/20 1:54 AM, Tan, Ley Foon wrote: [...] >> diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c >> index fee7f03c8c..80dae73bb6 100644 >> --- a/board/keymile/common/ivm.c >> +++ b/board/keymile/common/ivm.c >> @@ -328,7 +328,23 @@ static int ivm_populate_env(unsigned char *buf, int >> len, int mac_address_offset) int ivm_read_eeprom(unsigned char *buf, int >> len, int mac_address_offset) { >> int ret; >> +#ifdef CONFIG_DM_I2C >> + struct udevice *eedev = NULL; >> + >> + ret = i2c_get_chip_for_busnum(CONFIG_KM_IVM_BUS, >> + CONFIG_SYS_I2C_EEPROM_ADDR, 1, >> &eedev); >> + if (ret) { >> + printf("failed to get device for EEPROM at address 0x50\n"); > Should change 0x50 to value of CONFIG_SYS_I2C_EEPROM_ADDR.
OK btw please trim the emails, I really had trouble finding this one line in the sea of quoted text. >> + return 1; >> + } >> >> + ret = dm_i2c_read(eedev, 0, buf, len); >> + if (ret != 0) { >> + printf("Error: Unable to read from I2C EEPROM at >> address %02X:%02X\n", >> + CONFIG_SYS_I2C_EEPROM_ADDR, 0); >> + return 1; >> + } >> +#else [...]