Add an SPL_BOARD_INIT hook and for OMAP3 have it turn on i2c. OMAP4 doesn't need i2c enabled in SPL. Enable SPL_BOARD_INIT on devkit8000.
Cc: Frederik Kriewitz <frede...@kriewitz.eu> Signed-off-by: Tom Rini <tr...@ti.com> --- arch/arm/cpu/armv7/omap-common/spl.c | 5 ++++- arch/arm/cpu/armv7/omap3/board.c | 5 +++++ arch/arm/include/asm/omap_common.h | 4 ++++ include/configs/devkit8000.h | 1 + 4 files changed, 14 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index d6d7d65..25f04ed 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -115,7 +115,10 @@ void board_init_r(gd_t *id, ulong dummy) CONFIG_SYS_SPL_MALLOC_SIZE); timer_init(); - i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); + +#ifdef CONFIG_SPL_BOARD_INIT + spl_board_init(); +#endif boot_device = omap_boot_device(); debug("boot device - %d\n", boot_device); diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c index a9fdb4f..4e3eb38 100644 --- a/arch/arm/cpu/armv7/omap3/board.c +++ b/arch/arm/cpu/armv7/omap3/board.c @@ -40,6 +40,7 @@ #include <asm/armv7.h> #include <asm/arch/gpio.h> #include <asm/omap_common.h> +#include <i2c.h> /* Declarations */ extern omap3_sysinfo sysinfo; @@ -89,6 +90,10 @@ u32 omap_boot_device(void) return omap3_boot_device; } +void spl_board_init(void) +{ + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +} #endif /* CONFIG_SPL_BUILD */ diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h index f1562ea..b6eb753 100644 --- a/arch/arm/include/asm/omap_common.h +++ b/arch/arm/include/asm/omap_common.h @@ -94,6 +94,10 @@ void spl_nand_load_image(void); /* MMC SPL functions */ void spl_mmc_load_image(void); +#ifdef CONFIG_SPL_BOARD_INIT +void spl_board_init(void); +#endif + /* * silicon revisions. * Moving this to common, so that most of code can be moved to common, diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h index e1743dc..ae45f95 100644 --- a/include/configs/devkit8000.h +++ b/include/configs/devkit8000.h @@ -317,6 +317,7 @@ #define CONFIG_SPL_LIBCOMMON_SUPPORT #define CONFIG_SPL_LIBDISK_SUPPORT +#define CONFIG_SPL_BOARD_INIT #define CONFIG_SPL_I2C_SUPPORT #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_SERIAL_SUPPORT -- 1.7.0.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot