OMAP3: Add SPL_BOARD_INIT hook
authorTom Rini <trini@ti.com>
Wed, 23 Nov 2011 05:13:06 +0000 (05:13 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 6 Dec 2011 22:59:39 +0000 (23:59 +0100)
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 <frederik@kriewitz.eu>
Signed-off-by: Tom Rini <trini@ti.com>
arch/arm/cpu/armv7/omap-common/spl.c
arch/arm/cpu/armv7/omap3/board.c
arch/arm/include/asm/omap_common.h
include/configs/devkit8000.h

index f72d389f3d99a76d12b3f28b89883679ed2dddf7..25f04edf112f331a436436ed83f1ac43eb962b25 100644 (file)
@@ -116,6 +116,10 @@ void board_init_r(gd_t *id, ulong dummy)
 
        timer_init();
 
+#ifdef CONFIG_SPL_BOARD_INIT
+       spl_board_init();
+#endif
+
        boot_device = omap_boot_device();
        debug("boot device - %d\n", boot_device);
        switch (boot_device) {
index cdf452dfbc7d346dd4e89e0809e5e772caab953f..1f33c6398c106776d6163eb2bac9a22e02523abd 100644 (file)
@@ -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 */
 
 
index 913231b29241d2ca41b561dd762a5fba2242871a..1ec651b353920d3e0dd8169689a61bdd6be92558 100644 (file)
@@ -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,
index 4b58dc3bcb9ed9b6fe962e99ae5a879207ebf668..c090d2b3865a794a4fe2a6f114464b04ccbe6ad3 100644 (file)
 
 #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