aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/am33xx/board.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-05-21 12:57:21 -0400
committerTom Rini <trini@ti.com>2014-06-06 17:46:14 -0400
commit87acf194a298f65a40c659036a5e413613d458e6 (patch)
tree0e6d0ca73c9252ec14a4e755bc4389016d7af07a /arch/arm/cpu/armv7/am33xx/board.c
parentce3cc8ecf52f798cc980a2c49bdc5cbca6b3be29 (diff)
downloadu-boot-87acf194a298f65a40c659036a5e413613d458e6.zip
u-boot-87acf194a298f65a40c659036a5e413613d458e6.tar.gz
u-boot-87acf194a298f65a40c659036a5e413613d458e6.tar.bz2
arm:am33xx: Make dram_init call sdram_init() in some contexts
We have two contexts for booting these platforms. One is SPL which is roughly: reset, cpu_init_crit, lowlevel_init, s_init, sdram_init, _main, board_init_f from SPL, ... then U-Boot loads. The other is a memory-mapped XIP case (NOR or QSPI) where we do not run an SPL. In this case we go, roughly: reset, cpu_init_crit, lowlevel_init, s_init, _main, regular board_init_f. In the first case s_init will set a valid gd and then be able to call sdram_init which in many cases will need i2c (which needs a valid gd for gd->cur_i2c_bus). In this second case we must (and are able to and should) defer sdram_init() into dram_init() called by board_init_f as gd will have been set in _main and cleared in board_init_f. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm/cpu/armv7/am33xx/board.c')
-rw-r--r--arch/arm/cpu/armv7/am33xx/board.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
index e5c922a..9a69b6c 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -238,7 +238,9 @@ void s_init(void)
/* Enable RTC32K clock */
rtc32k_enable();
#endif
+#ifdef CONFIG_SPL_BUILD
sdram_init();
+#endif
}
#endif