blob: e17c0ed0875e46c21dbc2b8ea4b3fffddea09fb5 [file] [log] [blame]
Simon Glasse961a662016-07-04 11:57:51 -06001/*
2 * Copyright (c) 2016 Google, Inc
3 * SPDX-License-Identifier: GPL-2.0+
4 */
5
6#include <common.h>
7#include <dm.h>
8#include <os.h>
9#include <asm/spl.h>
10#include <asm/state.h>
11
12DECLARE_GLOBAL_DATA_PTR;
13
14void board_init_f(ulong flag)
15{
16 struct sandbox_state *state = state_get_current();
17
18 gd->arch.ram_buf = state->ram_buf;
19 gd->ram_size = state->ram_size;
20}
21
22u32 spl_boot_device(void)
23{
24 return BOOT_DEVICE_BOARD;
25}
26
27void spl_board_announce_boot_device(void)
28{
29 char fname[256];
30 int ret;
31
32 ret = os_find_u_boot(fname, sizeof(fname));
33 if (ret) {
34 printf("(%s not found, error %d)\n", fname, ret);
35 return;
36 }
37 printf("%s\n", fname);
38}
39
40int spl_board_load_image(void)
41{
42 char fname[256];
43 int ret;
44
45 ret = os_find_u_boot(fname, sizeof(fname));
46 if (ret)
47 return ret;
48
49 /* Hopefully this will not return */
50 return os_spl_to_uboot(fname);
51}