1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Google, Inc
11 #include <asm/state.h>
13 DECLARE_GLOBAL_DATA_PTR;
15 void board_init_f(ulong flag)
17 struct sandbox_state *state = state_get_current();
19 gd->arch.ram_buf = state->ram_buf;
20 gd->ram_size = state->ram_size;
23 u32 spl_boot_device(void)
25 return BOOT_DEVICE_BOARD;
28 static int spl_board_load_image(struct spl_image_info *spl_image,
29 struct spl_boot_device *bootdev)
34 ret = os_find_u_boot(fname, sizeof(fname));
36 printf("(%s not found, error %d)\n", fname, ret);
40 /* Set up spl_image to boot from jump_to_image_no_args() */
41 spl_image->arg = strdup(fname);
43 return log_msg_ret("Setup exec filename", -ENOMEM);
47 SPL_LOAD_IMAGE_METHOD("sandbox", 0, BOOT_DEVICE_BOARD, spl_board_load_image);
49 void spl_board_init(void)
51 struct sandbox_state *state = state_get_current();
54 preloader_console_init();
55 if (state->show_of_platdata) {
57 * Scan all the devices so that we can output their platform
58 * data. See sandbox_spl_probe().
60 printf("Scanning misc devices\n");
61 for (uclass_first_device(UCLASS_MISC, &dev);
63 uclass_next_device(&dev))
68 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
70 const char *fname = spl_image->arg;
74 os_spl_to_uboot(fname);
76 printf("No filename provided for U-Boot\n");