diff options
author | Rainer Boschung <rainer.boschung@keymile.com> | 2014-02-03 08:45:40 +0100 |
---|---|---|
committer | York Sun <yorksun@freescale.com> | 2014-02-03 08:38:50 -0800 |
commit | f3e74d0a9fd8cdcbdc59b7c5a702aacc51908dca (patch) | |
tree | b8334cbaabc11390c8f8c925c4ec3072b56aeb57 /include/configs | |
parent | 87ea2c0ff345ad59280bdf4702c3450a81e3c265 (diff) | |
download | u-boot-imx-f3e74d0a9fd8cdcbdc59b7c5a702aacc51908dca.zip u-boot-imx-f3e74d0a9fd8cdcbdc59b7c5a702aacc51908dca.tar.gz u-boot-imx-f3e74d0a9fd8cdcbdc59b7c5a702aacc51908dca.tar.bz2 |
kmp204x: I2C deblocking support
This patch adds support for using some GPIOs that are connected to the
I2C bus to force the bus lines state and perform some bus deblocking
sequences.
The KM common deblocking algorithm from board/keymile/common/common.c is
used. The GPIO lines used for deblocking the I2C bus are some external
GPIOs provided by the QRIO CPLD:
- SCL = GPIOA_20
- SDA = GPIOA_21
The QRIO GPIOs act in an open-drain-like manner, for 0 the line is
driven low and for 1 the GPIO is set as input and the line gets
pulled-up.
Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'include/configs')
-rw-r--r-- | include/configs/km/kmp204x-common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h index 0461815..afb2246 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -210,6 +210,7 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_EARLY_INIT_R /* call board_early_init_r function */ +#define CONFIG_MISC_INIT_F #define CONFIG_MISC_INIT_R #define CONFIG_LAST_STAGE_INIT @@ -265,7 +266,10 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */ /* I2C */ + #define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_INIT_BOARD +#define CONFIG_SYS_I2C_SPEED 100000 /* deblocking */ #define CONFIG_SYS_NUM_I2C_BUSES 3 #define CONFIG_SYS_I2C_MAX_HOPS 1 #define CONFIG_SYS_I2C_FSL /* Use FSL I2C driver */ @@ -278,6 +282,12 @@ unsigned long get_board_sys_clk(unsigned long dummy); {0, {{I2C_MUX_PCA9547, 0x70, 1 } } }, \ {0, {{I2C_MUX_PCA9547, 0x70, 2 } } }, \ } +#ifndef __ASSEMBLY__ +void set_sda(int state); +void set_scl(int state); +int get_sda(void); +int get_scl(void); +#endif #define CONFIG_KM_IVM_BUS 1 /* I2C1 (Mux-Port 1)*/ |