summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/board.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2012-01-16 21:12:24 +0000
committerHeiko Schocher <hs@denx.de>2013-07-23 05:54:28 +0200
commit3f4978c713255c8406875fbdf23ffed1129bc44b (patch)
treec27f00ba6219d75f772167b7630bb4ebb383a271 /arch/powerpc/lib/board.c
parent385c9ef5a7215b2b0c22836fee6c692dfc8559d7 (diff)
downloadblackbird-obmc-uboot-3f4978c713255c8406875fbdf23ffed1129bc44b.tar.gz
blackbird-obmc-uboot-3f4978c713255c8406875fbdf23ffed1129bc44b.zip
i2c: common changes for multibus/multiadapter support
Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org> Cc: Henrik Nordström <henrik@henriknordstrom.net>
Diffstat (limited to 'arch/powerpc/lib/board.c')
-rw-r--r--arch/powerpc/lib/board.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index fc4c1d5812..0c2e008e00 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -99,7 +99,7 @@ extern void sc3_read_eeprom(void);
void doc_init(void);
#endif
#if defined(CONFIG_HARD_I2C) || \
- defined(CONFIG_SOFT_I2C)
+ defined(CONFIG_SOFT_I2C)
#include <i2c.h>
#endif
#include <spi.h>
@@ -214,11 +214,16 @@ static int init_func_ram(void)
/***********************************************************************/
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
+ defined(CONFIG_SYS_I2C)
static int init_func_i2c(void)
{
puts("I2C: ");
+#ifdef CONFIG_SYS_I2C
+ i2c_init_all();
+#else
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
puts("ready\n");
return 0;
}
@@ -307,7 +312,8 @@ static init_fnc_t *init_sequence[] = {
misc_init_f,
#endif
INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
+ defined(CONFIG_SYS_I2C)
init_func_i2c,
#endif
#if defined(CONFIG_HARD_SPI)
OpenPOWER on IntegriCloud