Patchwork [U-Boot,v3,6/9] i2c, multibus, keymile: get rid of EEprom_ivm envvariable

login
register
mail settings
Submitter Heiko Schocher
Date May 4, 2013, 12:01 p.m.
Message ID <1367668903-29653-7-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/241450/
State Superseded
Delegated to: Heiko Schocher
Headers show

Comments

Heiko Schocher - May 4, 2013, 12:01 p.m.
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>

---
- changes for v2:
  new in v2
---
 board/keymile/common/ivm.c         |  7 ++-----
 include/configs/km/km83xx-common.h |  3 ++-
 include/configs/km/km_arm.h        |  1 -
 include/configs/km82xx.h           |  3 ++-
 include/configs/km_kirkwood.h      | 12 ++++++------
 5 Dateien geändert, 12 Zeilen hinzugefügt(+), 14 Zeilen entfernt(-)
Holger Brunck - May 6, 2013, 12:24 p.m.
On 05/04/2013 02:01 PM, Heiko Schocher wrote:
> 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 on mgcoge (MPC8247) and km_kirkwood (Kirkwood), feel free to add my:

Tested-By: Holger Brunck <holger.brunck@keymile.com>

Regards
Holger
Heiko Schocher - May 6, 2013, 1:58 p.m.
Hello Holger,

Am 06.05.2013 14:24, schrieb Holger Brunck:
> On 05/04/2013 02:01 PM, Heiko Schocher wrote:
>> 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 on mgcoge (MPC8247) and km_kirkwood (Kirkwood), feel free to add my:
> 
> Tested-By: Holger Brunck <holger.brunck@keymile.com>

Thanks for testing!

bye,
Heiko

Patch

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index a14496f..ac3cc9c 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -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");
diff --git a/include/configs/km/km83xx-common.h b/include/configs/km/km83xx-common.h
index a6f8ebd..8f97f67 100644
--- a/include/configs/km/km83xx-common.h
+++ b/include/configs/km/km83xx-common.h
@@ -220,6 +220,8 @@ 
 		{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 */
@@ -322,7 +324,6 @@ 
 #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"				\
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index c2c67c1..ebbfa84 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -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)
diff --git a/include/configs/km82xx.h b/include/configs/km82xx.h
index 54041f3..4278be2 100644
--- a/include/configs/km82xx.h
+++ b/include/configs/km82xx.h
@@ -212,7 +212,6 @@ 
 #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 && "			\
@@ -253,6 +252,8 @@ 
 			{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
  */
diff --git a/include/configs/km_kirkwood.h b/include/configs/km_kirkwood.h
index a0ad47e..5f3e444 100644
--- a/include/configs/km_kirkwood.h
+++ b/include/configs/km_kirkwood.h
@@ -42,18 +42,18 @@ 
 #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 */