i2c, multibus, keymile: get rid of EEprom_ivm envvariable
authorHeiko Schocher <hs@denx.de>
Thu, 25 Oct 2012 09:07:00 +0000 (11:07 +0200)
committerHeiko Schocher <hs@denx.de>
Tue, 23 Jul 2013 06:34:54 +0000 (08:34 +0200)
as the keymile boards use now the new i2c multibus/multiadapter
framework, remove the EEprom_ivm Environmentvar, as not longer
needed.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Holger Brunck <holger.brunck@keymile.com>
Tested-By: Holger Brunck <holger.brunck@keymile.com>
board/keymile/common/ivm.c
include/configs/km/km83xx-common.h
include/configs/km/km_arm.h
include/configs/km82xx.h
include/configs/km_kirkwood.h

index a14496f5fbf8fba98f7bd947f68789268f907c74..ac3cc9c8399119ca729657fa6aef318cecdba900 100644 (file)
@@ -315,16 +315,13 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
 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");
index a6f8ebd9de58cf4365be7fc69f65aa9fea7416aa..8f97f679bbeddff4d6bada05e8d752527bfeda58 100644 (file)
                {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"                             \
index c2c67c15823dd137b793b2a5da808143a877c0c4..ebbfa840d4d72e9c82825976af21e3fb6d0f15fc 100644 (file)
@@ -309,7 +309,6 @@ int get_scl(void);
        CONFIG_KM_DEF_ENV                                               \
        CONFIG_KM_NEW_ENV                                               \
        "arch=arm\0"                                                    \
-       "EEprom_ivm=" __stringify(KM_IVM_BUS) "\0"                      \
        ""
 
 #if defined(CONFIG_SYS_NO_FLASH)
index 54041f357441f3a5bc83c173126c653150d8f4a7..4278be26e2c03096cae4a97f93b02f9e83d97ea8 100644 (file)
 #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
  */
index a0ad47e73a213026cbbecb030048e49dfeec2fcf..5f3e4449baaf7e2c09581fd22cccb3d07376a9b8 100644 (file)
 #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
@@ -69,7 +69,7 @@
 #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
@@ -81,7 +81,7 @@
 /* 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
@@ -95,7 +95,7 @@
 #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 */