summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-rockchip/spl.c
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko.stuebner@theobroma-systems.com>2020-05-25 19:57:24 +0200
committerKever Yang <kever.yang@rock-chips.com>2020-05-31 22:22:07 +0800
commitb6740fb116ebb02ecf6306e4a6234dcea03842e0 (patch)
tree838c41b86e34f1a3a292070cb598fbea359dca45 /arch/arm/mach-rockchip/spl.c
parent9fb8e24804ea65a0edead7d7d606da016a71fdd8 (diff)
downloadu-boot-b6740fb116ebb02ecf6306e4a6234dcea03842e0.tar.gz
u-boot-b6740fb116ebb02ecf6306e4a6234dcea03842e0.tar.xz
u-boot-b6740fb116ebb02ecf6306e4a6234dcea03842e0.zip
rockchip: spl: do full dram_init instead of only probing
Parts of later SPL may need RAM information as well, so do full dram_init() call, which includes the existing dram probing but also initializes the ram information in gd. dram_init() from sdram.c does the following steps: - uclass_get_device(UCLASS_RAM, ...) like the current code - ret = ram_get_info(dev, &ram); - gd->ram_size = ram.size; CONFIG_SPL_RAM already makes sure that sdram.c gets compiled and thus no other variant of dram_init() can exist. So it's the same functionality as before and only adds that the SPL now aquires knowledge about the amount of available ram, which it didn't know about before. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'arch/arm/mach-rockchip/spl.c')
-rw-r--r--arch/arm/mach-rockchip/spl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 46b32eb345..cddf4fd3d5 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -108,9 +108,6 @@ __weak int arch_cpu_init(void)
void board_init_f(ulong dummy)
{
int ret;
-#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_OS_BOOT)
- struct udevice *dev;
-#endif
#ifdef CONFIG_DEBUG_UART
/*
@@ -140,13 +137,15 @@ void board_init_f(ulong dummy)
/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
timer_init();
#endif
-#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_OS_BOOT)
+#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_RAM)
debug("\nspl:init dram\n");
- ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+ ret = dram_init();
if (ret) {
printf("DRAM init failed: %d\n", ret);
return;
}
+ gd->ram_top = gd->ram_base + get_effective_memsize();
+ gd->ram_top = board_get_usable_ram_top(gd->ram_size);
#endif
preloader_console_init();
}