diff options
author | Heiko Schocher <hs@denx.de> | 2009-07-09 12:04:26 +0200 |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2009-07-21 07:06:26 +0200 |
commit | 39df00d9aecfb465b9eec9af593f9b763fb5209a (patch) | |
tree | 65392eb84672e4f25379bf65a4e9a20fb41e27c6 /drivers/i2c/fsl_i2c.c | |
parent | 1bc1538613d66cef3cbce680fc8d7c3561a0fbd0 (diff) | |
download | u-boot-imx-39df00d9aecfb465b9eec9af593f9b763fb5209a.zip u-boot-imx-39df00d9aecfb465b9eec9af593f9b763fb5209a.tar.gz u-boot-imx-39df00d9aecfb465b9eec9af593f9b763fb5209a.tar.bz2 |
i2c, mpc83xx: add CONFIG_SYS_I2C_INIT_BOARD for fsl_i2c
This patch adds the possibility to call a board specific
i2c bus reset routine for the fsl_i2c bus driver, and adds
this option for the keymile kmeter1 board.
The deblock sequence for this board is implemented and
tested in the following way:
CR = 0x20 (release SDA and SCL pin)
CR = 0xa0 (start read)
dummy read
dummy read
if 2. dummy read == 0x00
3. dummy read
CR = 0x80 (SDA and SCL now 1 SR = 0x86)
CR = 0x00 (Modul reset SR=0x81)
CR = 0x80 (SDA and SCL = 1, SR = 0x81)
Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/i2c/fsl_i2c.c')
-rw-r--r-- | drivers/i2c/fsl_i2c.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index 6ab7d3d..ce0f301 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -178,6 +178,12 @@ i2c_init(int speed, int slaveadd) struct fsl_i2c *dev; unsigned int temp; +#ifdef CONFIG_SYS_I2C_INIT_BOARD + /* call board specific i2c bus reset routine before accessing the */ + /* environment, which might be in a chip on that bus. For details */ + /* about this problem see doc/I2C_Edge_Conditions. */ + i2c_init_board(); +#endif dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET); writeb(0, &dev->cr); /* stop I2C controller */ |