reset:
b save_boot_params
bl cpu_init_cp15
bl cpu_init_crit
bl _main
/*
* Set up initial C runtime environment and call board_init_f(0).
*/
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
ldr sp, =(CONFIG_SPL_STACK)
#else
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
#endif
bl board_init_f
spl_init();
preloader_console_init();
sunxi_board_init();
sunxi_dram_init();//初始化DDR
struct dram_para para = {
.read_delays = 0x00007878, /* dram_tpr12 */
.write_delays = 0x6a440000, /* dram_tpr11 */
.dual_rank = 0,
.bus_width = 32,
.row_bits = 15,
.bank_bits = 3,
.page_size = 4096,
};
mctl_sys_init(¶);
ldr pc, =board_init_r /* this is auto-relocated! */
memset(&spl_image, '\0', sizeof(spl_image));
board_boot_order(spl_boot_list);
spl_boot_list[0] = spl_boot_device();//根据配置获得启动介质
boot_source = readb(SPL_ADDR + 0x28);
switch (boot_source) {
case SUNXI_BOOTED_FROM_MMC0:
return BOOT_DEVICE_MMC1;
case SUNXI_BOOTED_FROM_NAND:
return BOOT_DEVICE_NAND;
case SUNXI_BOOTED_FROM_MMC2:
return BOOT_DEVICE_MMC2;
case SUNXI_BOOTED_FROM_SPI:
return BOOT_DEVICE_SPI;
}
boot_from_devices(&spl_image, spl_boot_list,ARRAY_SIZE(spl_boot_list))
for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {
struct spl_image_loader *loader;
loader = spl_ll_find_loader(spl_boot_list[i]);
if (loader && !spl_load_image(spl_image, loader))
return 0;
}
switch (spl_image.os) {
case IH_OS_U_BOOT:
debug("Jumping to U-Boot\n");
break;
#ifdef CONFIG_SPL_OS_BOOT//直接启动linux内核
case IH_OS_LINUX:
debug("Jumping to Linux\n");
spl_board_prepare_for_linux();
jump_to_image_linux(&spl_image,(void *)CONFIG_SYS_SPL_ARGS_ADDR);
#endif
default:
debug("Unsupported OS image.. Jumping nevertheless..\n");
}
spl_board_prepare_for_boot();
jump_to_image_no_args(&spl_image);
uboot spl (lichee zero)
猜你喜欢
转载自blog.csdn.net/w356877795/article/details/120014612
今日推荐
周排行