int ivm_read_eeprom(void)
{
uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
- char *buf;
- unsigned long dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
int ret;
- buf = getenv("EEprom_ivm");
- i2c_set_bus_num(buf ? (int)simple_strtol(buf, NULL, 10) : 0);
+ i2c_set_bus_num(CONFIG_KM_IVM_BUS);
/* add deblocking here */
i2c_make_abort();
- ret = i2c_read(dev_addr, 0, 1, i2c_buffer,
+ ret = i2c_read(CONFIG_SYS_IVM_EEPROM_ADR, 0, 1, i2c_buffer,
CONFIG_SYS_IVM_EEPROM_MAX_LEN);
if (ret != 0) {
printf("Error reading EEprom\n");
{0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
{1, {I2C_NULL_HOP} } }
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
/* I2C SYSMON (LM75, AD7414 is almost compatible) */
#define CONFIG_DTT_LM75 /* ON Semi's LM75 */
#define CONFIG_DTT_SENSORS {0, 1, 2, 3} /* Sensor addresses */
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_KM_DEF_ENV \
CONFIG_KM_DEF_ARCH \
- "EEprom_ivm=2\0" \
"newenv=" \
"prot off 0xF00C0000 +0x40000 && " \
"era 0xF00C0000 +0x40000\0" \
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_KM_BOARD_EXTRA_ENV \
CONFIG_KM_DEF_ENV \
- "EEprom_ivm=1\0" \
"unlock=yes\0" \
"newenv=" \
"prot off 0xFE0C0000 +0x40000 && " \
{0, {{I2C_MUX_PCA9542, 0x70, 0} } }, \
{0, {{I2C_MUX_PCA9542, 0x70, 1} } } }
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+
/*
* Software (bit-bang) I2C driver configuration
*/
#define CONFIG_IDENT_STRING "\nKeymile Kirkwood"
#define CONFIG_HOSTNAME km_kirkwood
#define CONFIG_KM_DISABLE_PCIE
-#define KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
/* KM_KIRKWOOD_PCI */
#elif defined(CONFIG_KM_KIRKWOOD_PCI)
#define CONFIG_IDENT_STRING "\nKeymile Kirkwood PCI"
#define CONFIG_HOSTNAME km_kirkwood_pci
-#define KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
#define CONFIG_KM_FPGA_CONFIG
/* KM_NUSA */
#elif defined(CONFIG_KM_NUSA)
-#define KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
#define CONFIG_IDENT_STRING "\nKeymile NUSA"
#define CONFIG_HOSTNAME kmnusa
#undef CONFIG_SYS_KWD_CONFIG
#elif defined(CONFIG_KM_MGCOGE3UN)
#define CONFIG_IDENT_STRING "\nKeymile COGE3UN"
#define CONFIG_HOSTNAME mgcoge3un
-#define KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
#undef CONFIG_SYS_KWD_CONFIG
#define CONFIG_SYS_KWD_CONFIG \
$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-memphis.cfg
/* KMCOGE5UN */
#elif defined(CONFIG_KM_COGE5UN)
#define CONFIG_IDENT_STRING "\nKeymile COGE5UN"
-#define KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
#undef CONFIG_SYS_KWD_CONFIG
#define CONFIG_SYS_KWD_CONFIG \
$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_256M8_1.cfg
#elif defined(CONFIG_KM_PORTL2)
#define CONFIG_IDENT_STRING "\nKeymile Port-L2"
#define CONFIG_HOSTNAME portl2
-#define KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/
#define CONFIG_KM_PIGGY4_88E6061
/* KM_SUV31 */