diff options
author | Holger Brunck <holger.brunck@ch.abb.com> | 2020-02-19 19:55:14 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2020-03-03 22:11:36 +0100 |
commit | 468ba8d00b5af7828302e297736ae23d4873cfb0 (patch) | |
tree | 1a60a77e307bbd56fb4733807d3c8a2586f80508 /board/keymile/common | |
parent | 85f748ad953e92e62831bff24bfd2260ef23325c (diff) | |
download | u-boot-468ba8d00b5af7828302e297736ae23d4873cfb0.tar.gz u-boot-468ba8d00b5af7828302e297736ae23d4873cfb0.tar.xz u-boot-468ba8d00b5af7828302e297736ae23d4873cfb0.zip |
ARM: socfpga: Add initial support for the ABB SECU board
Add initial support for the ABB SECU board, which is an ArriaV-based
SoCFPGA system with ethernet and booting from Denali NAND.
Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Diffstat (limited to 'board/keymile/common')
-rw-r--r-- | board/keymile/common/ivm.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index fee7f03c8c..60b89fe348 100644 --- a/board/keymile/common/ivm.c +++ b/board/keymile/common/ivm.c @@ -328,7 +328,24 @@ 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 0x%02x\n", + CONFIG_SYS_I2C_EEPROM_ADDR); + 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 i2c_set_bus_num(CONFIG_KM_IVM_BUS); /* add deblocking here */ i2c_make_abort(); @@ -338,6 +355,6 @@ int ivm_read_eeprom(unsigned char *buf, int len, int mac_address_offset) printf("Error reading EEprom\n"); return -2; } - +#endif return ivm_populate_env(buf, len, mac_address_offset); } |