[U-Boot] [PATCH v2 04/11] KM: add CONFIG_KM_I2C_ABORT option
Valentin Longchamp
valentin.longchamp at keymile.com
Wed Aug 28 16:04:22 CEST 2013
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 <valentin.longchamp at keymile.com>
---
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 <i2c.h>
-#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
More information about the U-Boot
mailing list