summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2012-06-22 07:45:57 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-09-01 14:58:10 +0200
commitd3decdebdef6207939aa1995d7327822a0267ad4 (patch)
treed32d9b278a5a23b28a78f5b0e46cdcc8d35d1548
parent71a271c654305078737773b78239b546efe161e7 (diff)
downloadu-boot-imx-d3decdebdef6207939aa1995d7327822a0267ad4.zip
u-boot-imx-d3decdebdef6207939aa1995d7327822a0267ad4.tar.gz
u-boot-imx-d3decdebdef6207939aa1995d7327822a0267ad4.tar.bz2
omap: am335x_evm: enable i2c1 channel
This patch sets up pinmux, enables fclk, and defines CONFIG_I2C_MULTI_BUS Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--arch/arm/cpu/armv7/am33xx/clock.c5
-rw-r--r--board/ti/am335x/evm.c1
-rw-r--r--board/ti/am335x/mux.c13
-rw-r--r--include/configs/am335x_evm.h1
4 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/am33xx/clock.c b/arch/arm/cpu/armv7/am33xx/clock.c
index ddce213..16beb4f 100644
--- a/arch/arm/cpu/armv7/am33xx/clock.c
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -133,6 +133,11 @@ static void enable_per_clocks(void)
writel(PRCM_MOD_EN, &cmper->gpio3clkctrl);
while (readl(&cmper->gpio3clkctrl) != PRCM_MOD_EN)
;
+
+ /* i2c1 */
+ writel(PRCM_MOD_EN, &cmper->i2c1clkctrl);
+ while (readl(&cmper->i2c1clkctrl) != PRCM_MOD_EN)
+ ;
}
static void mpu_pll_config(void)
diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c
index f2e355c..0d0affa 100644
--- a/board/ti/am335x/evm.c
+++ b/board/ti/am335x/evm.c
@@ -30,6 +30,7 @@ int board_init(void)
#ifdef CONFIG_I2C
enable_i2c0_pin_mux();
+ enable_i2c1_pin_mux();
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif
diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
index 9ccb436..c696c0f 100644
--- a/board/ti/am335x/mux.c
+++ b/board/ti/am335x/mux.c
@@ -280,6 +280,14 @@ static struct module_pin_mux i2c0_pin_mux[] = {
{-1},
};
+static struct module_pin_mux i2c1_pin_mux[] = {
+ {OFFSET(spi0_d1), (MODE(2) | RXACTIVE |
+ PULLUDEN | SLEWCTRL)}, /* I2C_DATA */
+ {OFFSET(spi0_cs0), (MODE(2) | RXACTIVE |
+ PULLUDEN | SLEWCTRL)}, /* I2C_SCLK */
+ {-1},
+};
+
/*
* Configure the pin mux for the module
*/
@@ -310,3 +318,8 @@ void enable_i2c0_pin_mux(void)
{
configure_module_pin_mux(i2c0_pin_mux);
}
+
+void enable_i2c1_pin_mux(void)
+{
+ configure_module_pin_mux(i2c1_pin_mux);
+}
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 89e2aa0..2b41c1c 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -108,6 +108,7 @@
#define CONFIG_HARD_I2C
#define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_SYS_I2C_SLAVE 1
+#define CONFIG_I2C_MULTI_BUS
#define CONFIG_DRIVER_OMAP24XX_I2C
#define CONFIG_BAUDRATE 115200