siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace

The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't
match up with the rest of the EERPOM related defines in U-Boot.  Move
these out of the CONFIG namespace rather than make complex Kconfig
logic.

Cc: Samuel Egli <samuel.egli@siemens.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
This commit is contained in:
Tom Rini 2021-08-17 17:59:40 -04:00
parent d64d1536b8
commit 433eb4affc
3 changed files with 10 additions and 9 deletions

View File

@ -70,6 +70,7 @@ void sdram_init(void)
#endif /* #ifdef CONFIG_SPL_BUILD */ #endif /* #ifdef CONFIG_SPL_BUILD */
#ifndef CONFIG_SPL_BUILD #ifndef CONFIG_SPL_BUILD
#define FACTORYSET_EEPROM_ADDR 0x50
/* /*
* Basic board specific setup. Pinmux has been handled already. * Basic board specific setup. Pinmux has been handled already.
*/ */
@ -87,7 +88,7 @@ int board_init(void)
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
#ifdef CONFIG_FACTORYSET #ifdef CONFIG_FACTORYSET
factoryset_read_eeprom(CONFIG_SYS_I2C_EEPROM_ADDR); factoryset_read_eeprom(FACTORYSET_EEPROM_ADDR);
#endif #endif
gpmc_init(); gpmc_init();

View File

@ -132,12 +132,16 @@ struct am335x_nand_geometry {
u8 nand_bus; u8 nand_bus;
}; };
#define EEPROM_ADDR 0x50
#define EEPROM_ADDR_DDR3 0x90
#define EEPROM_ADDR_CHIP 0x120
static int draco_read_nand_geometry(void) static int draco_read_nand_geometry(void)
{ {
struct am335x_nand_geometry geo; struct am335x_nand_geometry geo;
/* Read NAND geometry */ /* Read NAND geometry */
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x80, 2, if (i2c_read(EEPROM_ADDR, 0x80, 2,
(uchar *)&geo, sizeof(struct am335x_nand_geometry))) { (uchar *)&geo, sizeof(struct am335x_nand_geometry))) {
printf("Could not read the NAND geomtery; something fundamentally wrong on the I2C bus.\n"); printf("Could not read the NAND geomtery; something fundamentally wrong on the I2C bus.\n");
return -EIO; return -EIO;
@ -160,20 +164,20 @@ static int draco_read_nand_geometry(void)
static int read_eeprom(void) static int read_eeprom(void)
{ {
/* Check if baseboard eeprom is available */ /* Check if baseboard eeprom is available */
if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) { if (i2c_probe(EEPROM_ADDR)) {
printf("Could not probe the EEPROM; something fundamentally wrong on the I2C bus.\n"); printf("Could not probe the EEPROM; something fundamentally wrong on the I2C bus.\n");
return 1; return 1;
} }
#ifdef CONFIG_SPL_BUILD #ifdef CONFIG_SPL_BUILD
/* Read Siemens eeprom data (DDR3) */ /* Read Siemens eeprom data (DDR3) */
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_DDR3, 2, if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_DDR3, 2,
(uchar *)&settings.ddr3, sizeof(struct ddr3_data))) { (uchar *)&settings.ddr3, sizeof(struct ddr3_data))) {
printf("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\nUse default DDR3 timings\n"); printf("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\nUse default DDR3 timings\n");
set_default_ddr3_timings(); set_default_ddr3_timings();
} }
/* Read Siemens eeprom data (CHIP) */ /* Read Siemens eeprom data (CHIP) */
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_CHIP, 2, if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_CHIP, 2,
(uchar *)&settings.chip, sizeof(settings.chip))) (uchar *)&settings.chip, sizeof(settings.chip)))
printf("Could not read chip settings\n"); printf("Could not read chip settings\n");

View File

@ -32,10 +32,6 @@
/* I2C Configuration */ /* I2C Configuration */
#define CONFIG_SYS_I2C_SPEED 100000 #define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
#define EEPROM_ADDR_DDR3 0x90
#define EEPROM_ADDR_CHIP 0x120
#define CONFIG_FACTORYSET #define CONFIG_FACTORYSET
/* Define own nand partitions */ /* Define own nand partitions */