summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-02-15 22:21:17 +0100
committerWolfgang Denk <wd@denx.de>2009-02-15 22:21:17 +0100
commitf8eab9c3e15db68d20cad8e257da228b518cde85 (patch)
tree33b0e4ebcc0e32d448e54794089b31ada9f8b91f /drivers
parent6b67962fd69ac0bcdf1a982669a029c2f0a7bcc1 (diff)
parente7de18afe8ecf96a51ef981d06066eeb6b1254e7 (diff)
downloadu-boot-imx-f8eab9c3e15db68d20cad8e257da228b518cde85.zip
u-boot-imx-f8eab9c3e15db68d20cad8e257da228b518cde85.tar.gz
u-boot-imx-f8eab9c3e15db68d20cad8e257da228b518cde85.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-i2c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/mxc_i2c.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index eedad06..8e10fbb 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -49,10 +49,13 @@
#ifdef CONFIG_SYS_I2C_MX31_PORT1
#define I2C_BASE 0x43f80000
+#define I2C_CLK_OFFSET 26
#elif defined (CONFIG_SYS_I2C_MX31_PORT2)
#define I2C_BASE 0x43f98000
+#define I2C_CLK_OFFSET 28
#elif defined (CONFIG_SYS_I2C_MX31_PORT3)
#define I2C_BASE 0x43f84000
+#define I2C_CLK_OFFSET 30
#else
#error "define CONFIG_SYS_I2C_MX31_PORTx to use the mx31 I2C driver"
#endif
@@ -72,6 +75,9 @@ void i2c_init(int speed, int unused)
int freq = mx31_get_ipg_clk();
int i;
+ /* start the required I2C clock */
+ __REG(CCM_CGR0) = __REG(CCM_CGR0) | (3 << I2C_CLK_OFFSET);
+
for (i = 0; i < 0x1f; i++)
if (freq / div[i] <= speed)
break;