blob: 9201d4a4d4426ca2e2c2cbec093d0ee9dd5d8803 [file] [log] [blame]
Chia-Wei, Wang8f7f4902020-12-14 13:54:28 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (c) Aspeed Technology Inc.
4 */
5#include <common.h>
6#include <debug_uart.h>
7#include <dm.h>
8#include <spl.h>
9#include <init.h>
10#include <asm/io.h>
11#include <asm/arch/scu_ast2600.h>
12
13DECLARE_GLOBAL_DATA_PTR;
14
15void board_init_f(ulong dummy)
16{
17 spl_early_init();
18 preloader_console_init();
19 timer_init();
20 dram_init();
21}
22
23u32 spl_boot_device(void)
24{
25 return BOOT_DEVICE_RAM;
26}
27
28struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
29{
30 /*
31 * When boot from SPI, AST2600 already remap 0x00000000 ~ 0x0fffffff
32 * to BMC SPI memory space 0x20000000 ~ 0x2fffffff. The next stage BL
33 * has been located in SPI for XIP. In this case, the load buffer for
34 * SPL image loading will be set to the remapped address of the next
35 * BL instead of the DRAM space CONFIG_SYS_LOAD_ADDR
36 */
37 return (struct image_header *)(CONFIG_SYS_TEXT_BASE);
38}
39
40#ifdef CONFIG_SPL_OS_BOOT
41int spl_start_uboot(void)
42{
43 /* boot linux */
44 return 0;
45}
46#endif
47
48#ifdef CONFIG_SPL_LOAD_FIT
49int board_fit_config_name_match(const char *name)
50{
51 /* just empty function now - can't decide what to choose */
52 debug("%s: %s\n", __func__, name);
53 return 0;
54}
55#endif