1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2018 Google, Inc
7 #include <debug_uart.h>
11 #include <asm/processor.h>
12 #include <asm-generic/sections.h>
14 DECLARE_GLOBAL_DATA_PTR;
16 __weak int arch_cpu_init_dm(void)
21 static int x86_tpl_init(void)
25 debug("%s starting\n", __func__);
28 debug("%s: spl_init() failed\n", __func__);
31 ret = arch_cpu_init();
33 debug("%s: arch_cpu_init() failed\n", __func__);
36 ret = arch_cpu_init_dm();
38 debug("%s: arch_cpu_init_dm() failed\n", __func__);
41 preloader_console_init();
42 ret = print_cpuinfo();
44 debug("%s: print_cpuinfo() failed\n", __func__);
51 void board_init_f(ulong flags)
57 debug("Error %d\n", ret);
61 /* Uninit CAR and jump to board_init_f_r() */
65 void board_init_f_r(void)
67 /* Not used since we never call board_init_f_r_trampoline() */
71 u32 spl_boot_device(void)
73 return IS_ENABLED(CONFIG_CHROMEOS) ? BOOT_DEVICE_CROS_VBOOT :
77 int spl_start_uboot(void)
82 void spl_board_announce_boot_device(void)
87 static int spl_board_load_image(struct spl_image_info *spl_image,
88 struct spl_boot_device *bootdev)
90 spl_image->size = CONFIG_SYS_MONITOR_LEN; /* We don't know SPL size */
91 spl_image->entry_point = CONFIG_SPL_TEXT_BASE;
92 spl_image->load_addr = CONFIG_SPL_TEXT_BASE;
93 spl_image->os = IH_OS_U_BOOT;
94 spl_image->name = "U-Boot";
96 debug("Loading to %lx\n", spl_image->load_addr);
100 SPL_LOAD_IMAGE_METHOD("SPI", 0, BOOT_DEVICE_BOARD, spl_board_load_image);
102 int spl_spi_load_image(void)
107 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
109 printf("Jumping to U-Boot SPL at %lx\n", (ulong)spl_image->entry_point);
110 jump_to_spl(spl_image->entry_point);
115 void spl_board_init(void)
117 preloader_console_init();