From: Valentin Longchamp Date: Wed, 28 Aug 2013 16:04:22 +0200 Subject: [U-Boot] [PATCH v2 04/11] KM: add CONFIG_KM_I2C_ABORT option In-Reply-To: <1377698669-6149-1-git-send-email-valentin.longchamp@keymile.com> References: <1377698669-6149-1-git-send-email-valentin.longchamp@keymile.com> Message-ID: <1377698669-6149-5-git-send-email-valentin.longchamp@keymile.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This must be defined for all the keymile boards that use the common i2c_abort function that is used to "reset" the I2C bus. These are currently km82xx and km_arm boards. This patch defines them for both architectures. The kmp204x and km83xx boards use other functions and thus do not define this. Signed-off-by: Valentin Longchamp --- Changes in v2: - Introduce CONFIG_KM_I2C_ABORT #define to avoid #if !defined in common.c board/keymile/common/common.c | 6 +----- include/configs/km/km_arm.h | 1 + include/configs/km82xx.h | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index ef93ed3..421ef8a 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -40,10 +40,6 @@ #include "common.h" #include -#if !defined(CONFIG_MPC83xx) -static void i2c_write_start_seq(void); -#endif - DECLARE_GLOBAL_DATA_PTR; /* @@ -94,7 +90,7 @@ int set_km_env(void) } #if defined(CONFIG_SYS_I2C_INIT_BOARD) -#if !defined(CONFIG_MPC83xx) +#if defined(CONFIG_KM_I2C_ABORT) static void i2c_write_start_seq(void) { set_sda(1); diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h index 766d76e..ac84e16 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -59,6 +59,7 @@ #define CONFIG_CMD_NAND #define CONFIG_CMD_SF #define CONFIG_SOFT_I2C /* I2C bit-banged */ +#define CONFIG_KM_I2C_ABORT /* SPI NOR Flash default params, used by sf commands */ #define CONFIG_SF_DEFAULT_SPEED 8100000 diff --git a/include/configs/km82xx.h b/include/configs/km82xx.h index ae36768..974b060 100644 --- a/include/configs/km82xx.h +++ b/include/configs/km82xx.h @@ -247,6 +247,7 @@ #define CONFIG_SOFT_I2C /* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 50000 /* I2C speed */ #define CONFIG_SYS_I2C_SLAVE 0x7F /* I2C slave address */ +#define CONFIG_KM_I2C_ABORT /* * Software (bit-bang) I2C driver configuration -- 1.8.0.1