From ea818dbbcd59300b56014ac2d67798a54994eb9b Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Tue, 29 Jan 2013 08:53:15 +0100 Subject: i2c, soft-i2c: switch to new multibus/multiadapter support - added to soft_i2c driver new multibus/multiadpater support - adapted all config files, which uses this driver Signed-off-by: Heiko Schocher Cc: Simon Glass Cc: Stephen Warren --- include/configs/km/keymile-common.h | 3 --- include/configs/km/km83xx-common.h | 3 +++ include/configs/km/km_arm.h | 24 ++++++++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) (limited to 'include/configs/km') diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index 3b15c4e..6182e81 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -78,10 +78,7 @@ #define CONFIG_LOADS_ECHO #define CONFIG_SYS_LOADS_BAUD_CHANGE -#define CONFIG_I2C_MULTI_BUS -#define CONFIG_SYS_MAX_I2C_BUS 1 #define CONFIG_SYS_I2C_INIT_BOARD -#define CONFIG_I2C_MUX /* Support the IVM EEprom */ #define CONFIG_SYS_IVM_EEPROM_ADR 0x50 diff --git a/include/configs/km/km83xx-common.h b/include/configs/km/km83xx-common.h index eb0e5b6..5a430ed 100644 --- a/include/configs/km/km83xx-common.h +++ b/include/configs/km/km83xx-common.h @@ -209,6 +209,9 @@ #define CONFIG_SYS_I2C_SPEED 200000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_OFFSET 0x3000 +#define CONFIG_I2C_MULTI_BUS +#define CONFIG_SYS_MAX_I2C_BUS 1 +#define CONFIG_I2C_MUX /* I2C SYSMON (LM75, AD7414 is almost compatible) */ #define CONFIG_DTT_LM75 /* ON Semi's LM75 */ diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h index 766d76e..c2c67c1 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -58,7 +58,6 @@ #define CONFIG_CMD_NAND #define CONFIG_CMD_SF -#define CONFIG_SOFT_I2C /* I2C bit-banged */ /* SPI NOR Flash default params, used by sf commands */ #define CONFIG_SF_DEFAULT_SPEED 8100000 @@ -187,8 +186,23 @@ /* * I2C related stuff */ +#undef CONFIG_I2C_MVTWSI +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ + #define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ -#if defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_SYS_I2C_SOFT) + +#define CONFIG_SYS_NUM_I2C_BUSES 6 +#define CONFIG_SYS_I2C_MAX_HOPS 1 +#define CONFIG_SYS_I2C_BUSES { {0, {I2C_NULL_HOP} }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 3} } }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 4} } }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 5} } }, \ + } + #ifndef __ASSEMBLY__ #include extern void __set_direction(unsigned pin, int high); @@ -211,6 +225,8 @@ int get_scl(void); #define I2C_DELAY udelay(1) #define I2C_SOFT_DECLARATIONS +#define CONFIG_SYS_I2C_SOFT_SLAVE 0x0 +#define CONFIG_SYS_I2C_SOFT_SPEED 100000 #endif /* EEprom support 24C128, 24C256 valid for environment eeprom */ @@ -240,7 +256,7 @@ int get_scl(void); #define CONFIG_SYS_EEPROM_WREN #define CONFIG_ENV_OFFSET 0x0 /* no bracets! */ #define CONFIG_ENV_SIZE (0x2000 - CONFIG_ENV_OFFSET) -#define CONFIG_I2C_ENV_EEPROM_BUS KM_ENV_BUS "\0" +#define CONFIG_I2C_ENV_EEPROM_BUS KM_ENV_BUS #define CONFIG_ENV_OFFSET_REDUND 0x2000 /* no bracets! */ #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE) #endif @@ -293,7 +309,7 @@ int get_scl(void); CONFIG_KM_DEF_ENV \ CONFIG_KM_NEW_ENV \ "arch=arm\0" \ - "EEprom_ivm=" KM_IVM_BUS "\0" \ + "EEprom_ivm=" __stringify(KM_IVM_BUS) "\0" \ "" #if defined(CONFIG_SYS_NO_FLASH) -- cgit v1.1 From 00f792e0df9ae942427e44595a0f4379582accee Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Wed, 24 Oct 2012 13:48:22 +0200 Subject: i2c, fsl_i2c: switch to new multibus/multiadapter support - added to fsl_i2c driver new multibus/multiadpater support - adapted all config files, which uses this driver Signed-off-by: Heiko Schocher Cc: Simon Glass Cc: Stephen Warren --- include/configs/km/km83xx-common.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'include/configs/km') diff --git a/include/configs/km/km83xx-common.h b/include/configs/km/km83xx-common.h index 5a430ed..a6f8ebd 100644 --- a/include/configs/km/km83xx-common.h +++ b/include/configs/km/km83xx-common.h @@ -204,14 +204,21 @@ #endif /* CFG_SYS_RAMBOOT */ /* I2C */ -#define CONFIG_HARD_I2C /* I2C with hardware support */ -#define CONFIG_FSL_I2C -#define CONFIG_SYS_I2C_SPEED 200000 /* I2C speed and slave address */ -#define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_OFFSET 0x3000 -#define CONFIG_I2C_MULTI_BUS -#define CONFIG_SYS_MAX_I2C_BUS 1 -#define CONFIG_I2C_MUX +#define CONFIG_SYS_I2C +#define CONFIG_SYS_NUM_I2C_BUSES 4 +#define CONFIG_SYS_I2C_MAX_HOPS 1 +#define CONFIG_SYS_I2C_FSL +#define CONFIG_SYS_FSL_I2C_SPEED 200000 +#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F +#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 +#define CONFIG_SYS_I2C_OFFSET 0x3000 +#define CONFIG_SYS_FSL_I2C2_SPEED 200000 +#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F +#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100 +#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \ + {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \ + {1, {I2C_NULL_HOP} } } /* I2C SYSMON (LM75, AD7414 is almost compatible) */ #define CONFIG_DTT_LM75 /* ON Semi's LM75 */ @@ -219,7 +226,7 @@ #define CONFIG_SYS_DTT_MAX_TEMP 70 #define CONFIG_SYS_DTT_LOW_TEMP -30 #define CONFIG_SYS_DTT_HYSTERESIS 3 -#define CONFIG_SYS_DTT_BUS_NUM (CONFIG_SYS_MAX_I2C_BUS) +#define CONFIG_SYS_DTT_BUS_NUM 1 #if defined(CONFIG_CMD_NAND) #define CONFIG_NAND_KMETER1 @@ -315,7 +322,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_KM_DEF_ENV \ CONFIG_KM_DEF_ARCH \ - "EEprom_ivm=pca9547:70:9\0" \ + "EEprom_ivm=2\0" \ "newenv=" \ "prot off 0xF00C0000 +0x40000 && " \ "era 0xF00C0000 +0x40000\0" \ -- cgit v1.1 From f3e9361771af69b12699c8e58b174d72f0bb545e Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 25 Oct 2012 11:07:00 +0200 Subject: i2c, multibus, keymile: get rid of EEprom_ivm envvariable 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 Cc: Holger Brunck Tested-By: Holger Brunck --- include/configs/km/km83xx-common.h | 3 ++- include/configs/km/km_arm.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/configs/km') 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) -- cgit v1.1 From 67bfae36fa365f911fa258b44eb65ca29d1bad03 Mon Sep 17 00:00:00 2001 From: Holger Brunck Date: Mon, 6 May 2013 02:54:38 +0000 Subject: arm/km: fix u-boot update functionality Due to the new I2C framework we need to adapt the u-boot update function. Due to the new framework all i2c leafs behind a mux are present in the system and not only those who are defined and used. So it is bus number 5 after the rework. Signed-off-by: Holger Brunck cc: Heiko Schocher cc: Prafulla Wadaskar --- include/configs/km/km_arm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/configs/km') diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h index ebbfa84..4da54d5 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -295,7 +295,8 @@ int get_scl(void); #else #define CONFIG_KM_NEW_ENV \ "newenv=setenv addr 0x100000 && " \ - "i2c dev 1; mw.b ${addr} 0 4 && " \ + "i2c dev " __stringify(CONFIG_I2C_ENV_EEPROM_BUS) "; " \ + "mw.b ${addr} 0 4 && " \ "eeprom write " __stringify(CONFIG_SYS_DEF_EEPROM_ADDR) \ " ${addr} " __stringify(CONFIG_ENV_OFFSET) " 4 && " \ "eeprom write " __stringify(CONFIG_SYS_DEF_EEPROM_ADDR) \ -- cgit v1.1