]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board/BuR/common: move I2C initialization from common part to board-specific
authorHannes Petermaier <hannes.petermaier@br-automation.com>
Thu, 19 Mar 2015 09:43:15 +0000 (10:43 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 28 Mar 2015 16:07:44 +0000 (12:07 -0400)
At this time I2C and responsible pin-mux is setup during PMIC initialziation
within common.c, this is possible because today PMIC is always connected on
I2C0.

In Future this will be changed, PMIC isn't anymore connected to bus0 in call
cases.

So we do following:
- rename enable_i2c_pin_mux0 to enable_i2c_pin_mux to be generic for enabling
  pin-mux on different or more busses.
- move the call to i2c_pin_mux and i2c_init from common.c to the specific
  board.c

Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com>
Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
board/BuR/common/bur_common.h
board/BuR/common/common.c
board/BuR/kwb/board.c
board/BuR/kwb/mux.c
board/BuR/tseries/board.c
board/BuR/tseries/mux.c

index 39afbba7db9308193eecdc88ae0d8f68a10a277e..3061e4ca00fc9183a8b07e43d5e2de0762b7b098 100644 (file)
@@ -19,7 +19,7 @@ void br_summaryscreen(void);
 void blink(u32 blinks, u32 intervall, u32 pin);
 void pmicsetup(u32 mpupll);
 void enable_uart0_pin_mux(void);
-void enable_i2c0_pin_mux(void);
+void enable_i2c_pin_mux(void);
 void enable_board_pin_mux(void);
 int board_eth_init(bd_t *bis);
 
index 5ff8a7e0ae967d0679931ff91f74f47784c10931..91834eb7564216ddec1837f95d7891bfe5221373 100644 (file)
@@ -461,10 +461,6 @@ void pmicsetup(u32 mpupll)
        int mpu_vdd;
        int usb_cur_lim;
 
-       /* setup I2C */
-       enable_i2c0_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-
        if (i2c_probe(TPS65217_CHIP_PM)) {
                puts("PMIC (0x24) not found! skip further initalization.\n");
                return;
index 892311e6eeb943e6f903f7c9493a905f60566139..6eed7e0d7f689b9808124af8fc5a4e31bce4b626 100644 (file)
@@ -124,7 +124,8 @@ void am33xx_spl_board_init(void)
        gpio_direction_output(LCD_PWR, 0);
 
        /* setup I2C */
-       enable_i2c0_pin_mux();
+       enable_i2c_pin_mux();
+       i2c_set_bus_num(0);
        i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 
        /* power-ON  3V3 via Resetcontroller */
index 9f89b5e53dc06f331b983bfa6ba9d0ea236a901a..2b1d8d3b1db458006a0e2bd99b5672649d575f04 100644 (file)
@@ -180,7 +180,7 @@ void enable_uart0_pin_mux(void)
        configure_module_pin_mux(uart0_pin_mux);
 }
 
-void enable_i2c0_pin_mux(void)
+void enable_i2c_pin_mux(void)
 {
        configure_module_pin_mux(i2c0_pin_mux);
 }
index 9402aa4205038341faa3ff805039747cf7b0a446..89e989f2467411341f34d3f437ee5f3d595f319a 100644 (file)
@@ -123,6 +123,10 @@ void am33xx_spl_board_init(void)
        /* setup LCD-Pixel Clock */
        writel(0x2, &cmdpll->clklcdcpixelclk);  /* clock comes from perPLL M2 */
 
+       /* setup I2C */
+       enable_i2c_pin_mux();
+       i2c_set_bus_num(0);
+       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
        pmicsetup(0);
 }
 
index 2c87a63b85e45117144846dc1c4dca252248e872..ac7e885f61589391a8569cd71f4b970bb9a0e9ea 100644 (file)
@@ -226,7 +226,7 @@ void enable_uart0_pin_mux(void)
        configure_module_pin_mux(uart0_pin_mux);
 }
 
-void enable_i2c0_pin_mux(void)
+void enable_i2c_pin_mux(void)
 {
        configure_module_pin_mux(i2c0_pin_mux);
 }