]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm:am33xx: Rework s_init and add board_early_init_f
authorTom Rini <trini@ti.com>
Wed, 21 May 2014 16:57:22 +0000 (12:57 -0400)
committerTom Rini <trini@ti.com>
Fri, 6 Jun 2014 21:46:14 +0000 (17:46 -0400)
With the changes to the i2c framework (and adopting the omap24xx_i2c
driver to them) we can no longer call i2c functions prior to gd having
been set and cleared.  When SPL booting, this is handled by setting gd
to point to SRAM in s_init.  However in the cases where we are loaded
directly by ROM (memory mapped NOR or QSPI) we need to make use of the
normal hooks to slightly delay these calls.

Signed-off-by: Tom Rini <trini@ti.com>
arch/arm/cpu/armv7/am33xx/board.c
include/configs/am43xx_evm.h
include/configs/ti_am335x_common.h

index 9a69b6ccfac4ff6197d8b6a214bbd8279a8fc587..7fe049e51312789532540d80232dcb1252ca0364 100644 (file)
@@ -143,6 +143,19 @@ int arch_misc_init(void)
 }
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
+/*
+ * In the case of non-SPL based booting we'll want to call these
+ * functions a tiny bit later as it will require gd to be set and cleared
+ * and that's not true in s_init in this case so we cannot do it there.
+ */
+int board_early_init_f(void)
+{
+       prcm_init();
+       set_mux_conf_regs();
+
+       return 0;
+}
+
 /*
  * This function is the place to do per-board things such as ramp up the
  * MPU clock frequency.
@@ -232,13 +245,12 @@ void s_init(void)
        gd = &gdata;
        preloader_console_init();
 #endif
-       prcm_init();
-       set_mux_conf_regs();
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
        /* Enable RTC32K clock */
        rtc32k_enable();
 #endif
 #ifdef CONFIG_SPL_BUILD
+       board_early_init_f();
        sdram_init();
 #endif
 }
index c1c0035d7125a1a2da3e3e7f560f4f3bf5ea880f..8473b0bf5a40eea0abdab800d932685faa68847f 100644 (file)
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
+/*
+ * When building U-Boot such that there is no previous loader
+ * we need to call board_early_init_f.  This is taken care of in
+ * s_init when we have SPL used.
+ */
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && !defined(CONFIG_SPL)
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
+
 /* Now bring in the rest of the common code. */
 #include <configs/ti_armv7_common.h>
 
index 128b66edef513edbff2c35d4afb852bd318f05bb..80976e7e3b84ecddc3ea767f3416763ce37b6eda 100644 (file)
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
+/*
+ * When building U-Boot such that there is no previous loader
+ * we need to call board_early_init_f.  This is taken care of in
+ * s_init when we have SPL used.
+ */
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && !defined(CONFIG_SPL)
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
+
 #ifdef CONFIG_NAND
 #define CONFIG_SPL_NAND_AM33XX_BCH     /* ELM support */
 #endif