]> git.sur5r.net Git - u-boot/commitdiff
omap: am335x_evm: enable i2c1 channel
authorSteve Sakoman <steve@sakoman.com>
Fri, 22 Jun 2012 07:45:57 +0000 (07:45 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 1 Sep 2012 12:58:10 +0000 (14:58 +0200)
This patch sets up pinmux, enables fclk, and
defines CONFIG_I2C_MULTI_BUS

Signed-off-by: Steve Sakoman <steve@sakoman.com>
arch/arm/cpu/armv7/am33xx/clock.c
board/ti/am335x/evm.c
board/ti/am335x/mux.c
include/configs/am335x_evm.h

index ddce2138c63976110ff5377c5af5b53c27ef193c..16beb4ff3ef48eee38c8aa220d5e42f6e02a0f34 100644 (file)
@@ -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)
index f2e355c7966ae050277f53ae37010292b236ed2d..0d0affa83322e8b9ec1dcc4d557d93ecdd563366 100644 (file)
@@ -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
 
index 9ccb43642b38cc44960a7893f7af8de161f52539..c696c0fe95352cf8ba5bafdaf9033d9ec72952b7 100644 (file)
@@ -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);
+}
index 89e2aa07b7536e90521cbf0743912d23e9eb60cf..2b41c1c9d5188d21c1d5d16f3e18d807a71ba7ff 100644 (file)
 #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