[10/31] ARM: Use Kconfig for board EEPROM's I2C bus and chip address

Message ID 20170302190435.23212-11-fcooper@ti.com
State New
Headers show
Series
  • [01/31] ti: common: board_detect: Allow settings board detection variables manually
Related show

Commit Message

Franklin S Cooper Jr March 2, 2017, 7:04 p.m.
From: Roger Quadros <rogerq@ti.com>

In stead of defining the board EEPROM address in the board headers
let's define them in the board config files and make them
configurable by Kconfig.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 board/ti/common/Kconfig      | 20 +++++++++++++++++---
 board/ti/ks2_evm/Kconfig     |  2 ++
 include/configs/am57xx_evm.h |  4 ----
 include/configs/dra7xx_evm.h |  4 ----
 4 files changed, 19 insertions(+), 11 deletions(-)

Patch

diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig
index 4980a04..162248c 100644
--- a/board/ti/common/Kconfig
+++ b/board/ti/common/Kconfig
@@ -1,12 +1,24 @@ 
-config SPL_ENV_SUPPORT
-	default y
-
 config TI_I2C_BOARD_DETECT
 	bool "Support for Board detection for TI platforms"
 	help
 	   Support for detection board information on Texas Instrument's
 	   Evaluation Boards which have I2C based EEPROM detection
 
+config EEPROM_BUS_ADDRESS
+	int "Board EEPROM's I2C bus address"
+	range 0 8
+	default 0
+
+config EEPROM_CHIP_ADDRESS
+	hex "Board EEPROM's I2C chip address"
+	range 0 0xff
+	default 0x50
+
+if ARCH_OMAP2
+
+config SPL_ENV_SUPPORT
+	default y
+
 config SPL_EXT_SUPPORT
 	default y
 
@@ -39,3 +51,5 @@  config SPL_POWER_SUPPORT
 
 config SPL_SERIAL_SUPPORT
 	default y
+
+endif
diff --git a/board/ti/ks2_evm/Kconfig b/board/ti/ks2_evm/Kconfig
index c0568ec..9477f53 100644
--- a/board/ti/ks2_evm/Kconfig
+++ b/board/ti/ks2_evm/Kconfig
@@ -49,3 +49,5 @@  config SYS_CONFIG_NAME
 	default "k2g_evm"
 
 endif
+
+source "board/ti/common/Kconfig"
diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index 3d8b996..40a3bbd 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -103,10 +103,6 @@ 
 #define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
 						CONFIG_SYS_SCSI_MAX_LUN)
 
-/* EEPROM */
-#define CONFIG_EEPROM_CHIP_ADDRESS 0x50
-#define CONFIG_EEPROM_BUS_ADDRESS 0
-
 /*
  * Default to using SPI for environment, etc.
  * 0x000000 - 0x040000 : QSPI.SPL (256KiB)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 549439e..2996807 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -261,8 +261,4 @@ 
 #endif
 #endif  /* NOR support */
 
-/* EEPROM */
-#define CONFIG_EEPROM_CHIP_ADDRESS 0x50
-#define CONFIG_EEPROM_BUS_ADDRESS 0
-
 #endif /* __CONFIG_DRA7XX_EVM_H */