1 // SPDX-License-Identifier: GPL-2.0+
13 #include <asm/global_data.h>
15 #include <asm/armv7m.h>
17 DECLARE_GLOBAL_DATA_PTR;
21 #ifndef CONFIG_SUPPORT_SPL
25 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
27 debug("DRAM init failed: %d\n", rv);
32 return fdtdec_setup_mem_size_base();
35 int dram_init_banksize(void)
37 return fdtdec_setup_memory_banksize();
40 #ifdef CONFIG_SPL_BUILD
41 #ifdef CONFIG_SPL_OS_BOOT
42 int spl_start_uboot(void)
44 debug("SPL: booting kernel\n");
45 /* break into full u-boot on 'c' */
46 return serial_tstc() && serial_getc() == 'c';
50 int spl_dram_init(void)
55 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
57 debug("DRAM init failed: %d\n", rv);
61 void spl_board_init(void)
64 preloader_console_init();
65 arch_cpu_init(); /* to configure mpu for sdram rw permissions */
68 u32 spl_boot_device(void)
70 return BOOT_DEVICE_MMC1;
74 u32 get_board_rev(void)
81 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;