1 /*
2  * (C) Copyright ASPEED Technology Inc.
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 #include <common.h>
7 #include <debug_uart.h>
8 #include <spl.h>
9 
10 #include <asm/io.h>
11 #include <asm/spl.h>
12 
13 DECLARE_GLOBAL_DATA_PTR;
14 
board_init_f(ulong dummy)15 void board_init_f(ulong dummy)
16 {
17 	spl_early_init();
18 	preloader_console_init();
19 	dram_init();
20 }
21 
spl_boot_device(void)22 u32 spl_boot_device(void)
23 {
24 	return BOOT_DEVICE_RAM;
25 }
26 
spl_get_load_buffer(ssize_t offset,size_t size)27 struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
28 {
29     return (struct image_header *)(CONFIG_SYS_TEXT_BASE);
30 }
31 
32 #ifdef CONFIG_SPL_MMC_SUPPORT
spl_boot_mode(const u32 boot_device)33 u32 spl_boot_mode(const u32 boot_device)
34 {
35 	return MMCSD_MODE_RAW;
36 }
37 #endif
38 
39 #ifdef CONFIG_SPL_OS_BOOT
spl_start_uboot(void)40 int spl_start_uboot(void)
41 {
42 	/* boot linux */
43 	return 0;
44 }
45 #endif
46 
47 #ifdef CONFIG_SPL_LOAD_FIT
board_fit_config_name_match(const char * name)48 int board_fit_config_name_match(const char *name)
49 {
50 	/* Just empty function now - can't decide what to choose */
51 	debug("%s: %s\n", __func__, name);
52 
53 	return 0;
54 }
55 #endif
56