diff options
author | Denis Zalevskiy <denis.zalevskiy@ge.com> | 2018-10-17 10:33:27 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2018-12-17 10:46:04 +0100 |
commit | 4c552083503f49f37412972a3b4ea895cffd948e (patch) | |
tree | d080bc2225f515675768c31882f1e5ec5bfd9718 /board/ge/bx50v3/bx50v3.c | |
parent | 33a6c8d4e605311d59e45bc2a42fdc02d37254dd (diff) | |
download | u-boot-4c552083503f49f37412972a3b4ea895cffd948e.tar.gz |
board: ge: Move VPD EEPROM configuration to the defconfig
Use standard configuration logic to define EEPROM constants.
Names are based on VPD_EEPROM_ prefix because EEPROM_ is already
used by i2c_eeprom driver.
Signed-off-by: Denis Zalevskiy <denis.zalevskiy@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Diffstat (limited to 'board/ge/bx50v3/bx50v3.c')
-rw-r--r-- | board/ge/bx50v3/bx50v3.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index 7f32af3c0f..13cc4c1ad7 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -38,15 +38,6 @@ struct vpd_cache; static int confidx = 3; /* Default to b850v3. */ static struct vpd_cache vpd; -#ifndef CONFIG_SYS_I2C_EEPROM_ADDR -# define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 -# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#endif - -#ifndef CONFIG_SYS_I2C_EEPROM_BUS -#define CONFIG_SYS_I2C_EEPROM_BUS 4 -#endif - #define NC_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ PAD_CTL_HYS) @@ -634,11 +625,11 @@ static void process_vpd(struct vpd_cache *vpd) static int read_vpd(void) { int res; - int size = 1024; + static const int size = CONFIG_SYS_VPD_EEPROM_SIZE; uint8_t *data; unsigned int current_i2c_bus = i2c_get_bus_num(); - res = i2c_set_bus_num(CONFIG_SYS_I2C_EEPROM_BUS); + res = i2c_set_bus_num(CONFIG_SYS_VPD_EEPROM_I2C_BUS); if (res < 0) return res; @@ -646,8 +637,8 @@ static int read_vpd(void) if (!data) return -ENOMEM; - res = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, - CONFIG_SYS_I2C_EEPROM_ADDR_LEN, data, size); + res = i2c_read(CONFIG_SYS_VPD_EEPROM_I2C_ADDR, 0, + CONFIG_SYS_VPD_EEPROM_I2C_ADDR_LEN, data, size); if (res == 0) { memset(&vpd, 0, sizeof(vpd)); |