summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2007-07-03 13:46:32 -0500
committerKim Phillips <kim.phillips@freescale.com>2007-08-10 01:12:03 -0500
commite739bc95797aac4fefc4c75b55c7c78e59d3ea9c (patch)
treed5952cca055ef3f319d69b2c7b14ac6cb70b6f4e
parentdf33f6b4d6d63693dd9200808b242de1b86cb8e8 (diff)
downloadu-boot-imx-e739bc95797aac4fefc4c75b55c7c78e59d3ea9c.zip
u-boot-imx-e739bc95797aac4fefc4c75b55c7c78e59d3ea9c.tar.gz
u-boot-imx-e739bc95797aac4fefc4c75b55c7c78e59d3ea9c.tar.bz2
FSL I2C driver programs the two I2C busses differently
The i2c_init() function in fsl_i2c.c programs the two I2C busses differently. The second I2C bus has its slave address programmed incorrectly and is missing a 5-us delay. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
-rw-r--r--drivers/fsl_i2c.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/fsl_i2c.c b/drivers/fsl_i2c.c
index ebae5af..22485ea 100644
--- a/drivers/fsl_i2c.c
+++ b/drivers/fsl_i2c.c
@@ -69,9 +69,10 @@ i2c_init(int speed, int slaveadd)
dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C2_OFFSET);
writeb(0, &dev->cr); /* stop I2C controller */
+ udelay(5); /* let it shutdown in peace */
writeb(0x3F, &dev->fdr); /* set bus speed */
writeb(0x3F, &dev->dfsrr); /* set default filter */
- writeb(slaveadd, &dev->adr); /* write slave address */
+ writeb(slaveadd << 1, &dev->adr); /* write slave address */
writeb(0x0, &dev->sr); /* clear status register */
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
#endif /* CFG_I2C2_OFFSET */