]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/mach-rockchip/rk3288-board-spl.c
spl: eMMC/SD: Provide one __weak spl_boot_mode() function
[people/ms/u-boot.git] / arch / arm / mach-rockchip / rk3288-board-spl.c
index 23af653454ebb04a51895410bd0083462e59370a..f3ea6242773a8872a5c67176b6655975ffcf1eb6 100644 (file)
@@ -19,7 +19,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
+#include <asm/arch/pmu_rk3288.h>
 #include <asm/arch/sdram.h>
+#include <asm/arch/sdram_common.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 #include <dm/pinctrl.h>
@@ -76,11 +78,6 @@ fallback:
        return BOOT_DEVICE_MMC1;
 }
 
-u32 spl_boot_mode(const u32 boot_device)
-{
-       return MMCSD_MODE_RAW;
-}
-
 #ifdef CONFIG_SPL_MMC_SUPPORT
 static int configure_emmc(struct udevice *pinctrl)
 {
@@ -204,14 +201,17 @@ void board_init_f(ulong dummy)
        }
 #endif
 
+#if !defined(CONFIG_SUPPORT_TPL)
        debug("\nspl:init dram\n");
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
        if (ret) {
                debug("DRAM init failed: %d\n", ret);
                return;
        }
+#endif
+
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
 }
 
@@ -278,7 +278,7 @@ void spl_board_init(void)
 
        preloader_console_init();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
        return;
 err:
@@ -287,3 +287,18 @@ err:
        /* No way to report error here */
        hang();
 }
+
+#ifdef CONFIG_SPL_OS_BOOT
+
+#define PMU_BASE               0xff730000
+int dram_init_banksize(void)
+{
+       struct rk3288_pmu *const pmu = (void *)PMU_BASE;
+       size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
+
+       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_dram[0].size = size;
+
+       return 0;
+}
+#endif