aboutsummaryrefslogtreecommitdiffstats
path: root/board/ge/mx53ppd
diff options
context:
space:
mode:
authorDenis Zalevskiy <denis.zalevskiy@ge.com>2018-10-17 10:33:27 +0200
committerStefano Babic <sbabic@denx.de>2018-12-17 10:46:04 +0100
commit4c552083503f49f37412972a3b4ea895cffd948e (patch)
treed080bc2225f515675768c31882f1e5ec5bfd9718 /board/ge/mx53ppd
parent33a6c8d4e605311d59e45bc2a42fdc02d37254dd (diff)
downloadu-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/mx53ppd')
-rw-r--r--board/ge/mx53ppd/Kconfig2
-rw-r--r--board/ge/mx53ppd/mx53ppd.c14
2 files changed, 6 insertions, 10 deletions
diff --git a/board/ge/mx53ppd/Kconfig b/board/ge/mx53ppd/Kconfig
index 6dc3818cb7b..bebb2fab017 100644
--- a/board/ge/mx53ppd/Kconfig
+++ b/board/ge/mx53ppd/Kconfig
@@ -13,4 +13,6 @@ config SYS_SOC
config SYS_CONFIG_NAME
default "mx53ppd"
+source "board/ge/common/Kconfig"
+
endif
diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
index 62137f6b28f..3fa53ffe0af 100644
--- a/board/ge/mx53ppd/mx53ppd.c
+++ b/board/ge/mx53ppd/mx53ppd.c
@@ -40,13 +40,6 @@
DECLARE_GLOBAL_DATA_PTR;
-/* Index of I2C1, SEGMENT 1 (see CONFIG_SYS_I2C_BUSES). */
-#define VPD_EEPROM_BUS 2
-
-/* Address of 24C08 EEPROM. */
-#define VPD_EEPROM_ADDR 0x50
-#define VPD_EEPROM_ADDR_LEN 1
-
static u32 mx53_dram_size[2];
phys_size_t get_effective_memsize(void)
@@ -332,11 +325,11 @@ static int read_vpd(void)
{
struct vpd_cache vpd;
int res;
- int size = 1024;
+ static const int size = CONFIG_SYS_VPD_EEPROM_SIZE;
u8 *data;
unsigned int current_i2c_bus = i2c_get_bus_num();
- res = i2c_set_bus_num(VPD_EEPROM_BUS);
+ res = i2c_set_bus_num(CONFIG_SYS_VPD_EEPROM_I2C_BUS);
if (res < 0)
return res;
@@ -344,7 +337,8 @@ static int read_vpd(void)
if (!data)
return -ENOMEM;
- res = i2c_read(VPD_EEPROM_ADDR, 0, VPD_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));
vpd_reader(size, data, &vpd, vpd_callback);