summaryrefslogtreecommitdiff
path: root/arch/m68k
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/m68k
parent385c9ef5a7215b2b0c22836fee6c692dfc8559d7 (diff)
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/m68k')
-rw-r--r--arch/m68k/lib/board.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index efc9fccc1bc..582f47b50e5 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -56,7 +56,7 @@
#include <version.h>
#if defined(CONFIG_HARD_I2C) || \
- defined(CONFIG_SOFT_I2C)
+ defined(CONFIG_SOFT_I2C)
#include <i2c.h>
#endif
@@ -142,11 +142,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);
}
@@ -178,7 +183,8 @@ init_fnc_t *init_sequence[] = {
display_options,
checkcpu,
checkboard,
-#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)
@@ -501,6 +507,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
spi_init_r ();
#endif
+#if defined(CONFIG_SYS_I2C)
+ /* Adjust I2C subsystem pointers after relocation */
+ i2c_reloc_fixup();
+#endif
+
/* relocate environment function pointers etc. */
env_relocate ();