[U-Boot] [PATCH] mx1: add mx1/l support for mxc_i2c

Eric Jarrige eric.jarrige at armadeus.org
Mon Aug 22 22:56:43 CEST 2011


Signed-off-by: Eric Jarrige <eric.jarrige at armadeus.org>
Cc: Stefano Babic <sbabic at denx.de>
Cc: Heiko Schocher <hs at denx.de>
---
 drivers/i2c/mxc_i2c.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 89d1973..597e9ee 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -27,7 +27,9 @@
 
 #if defined(CONFIG_HARD_I2C)
 
+#ifndef CONFIG_IMX
 #include <asm/arch/clock.h>
+#endif
 #include <asm/arch/imx-regs.h>
 
 #define IADR	0x00
@@ -63,6 +65,8 @@
 #define I2C_BASE        I2C2_BASE_ADDR
 #elif defined(CONFIG_SYS_I2C_MX35_PORT1)
 #define I2C_BASE	I2C_BASE_ADDR
+#elif defined(CONFIG_SYS_I2C_MX1_PORT1)
+#define I2C_BASE	IMX_I2C_BASE
 #else
 #error "define CONFIG_SYS_I2C_MX<Processor>_PORTx to use the mx I2C driver"
 #endif
@@ -94,6 +98,8 @@ void i2c_init(int speed, int unused)
 	/* start the required I2C clock */
 	writel(readl(&sc_regs->cgr0) | (3 << I2C_CLK_OFFSET),
 		&sc_regs->cgr0);
+#elif defined(CONFIG_IMX)
+	freq = get_HCLK();
 #else
 	freq = mxc_get_clock(MXC_IPG_PERCLK);
 #endif



More information about the U-Boot mailing list