blob: d50d9ad6b48348c10041fb851d08741028e58e06 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glassa7e2d4d2016-07-04 11:57:51 -06002/*
3 * Copyright (c) 2016 Google, Inc
Simon Glassa7e2d4d2016-07-04 11:57:51 -06004 */
5
6#ifndef __asm_spl_h
7#define __asm_spl_h
8
Simon Glass36611152024-08-07 16:47:21 -06009struct spl_image_info;
10
Simon Glassa7e2d4d2016-07-04 11:57:51 -060011enum {
Simon Glass4aa6a9b2022-10-20 18:23:01 -060012 BOOT_DEVICE_MMC1,
13 BOOT_DEVICE_MMC2,
14 BOOT_DEVICE_MMC2_2,
Simon Glassa7e2d4d2016-07-04 11:57:51 -060015 BOOT_DEVICE_BOARD,
Simon Glassd78aa752022-10-20 18:23:10 -060016 BOOT_DEVICE_VBE,
Sean Andersonc4f86c02023-10-14 16:48:03 -040017 BOOT_DEVICE_CPGMAC,
Sean Anderson430e4aa2023-10-14 16:48:04 -040018 BOOT_DEVICE_NOR,
Sean Anderson8734d6f2023-10-14 16:48:05 -040019 BOOT_DEVICE_SPI,
Sean Anderson765dc6a2023-11-04 16:37:53 -040020 BOOT_DEVICE_NAND,
Simon Glassa7e2d4d2016-07-04 11:57:51 -060021};
22
Simon Glass1cd06002021-07-05 16:32:45 -060023/**
24 * sandbox_find_next_phase() - Find the next phase of U-Boot
25 *
26 * This function is intended to be called from within sandbox SPL. It uses
27 * a few rules to find the filename of the next U-Boot phase. See also
28 * os_find_u_boot().
29 *
30 * @fname: place to put full path to U-Boot
31 * @maxlen: maximum size of @fname
32 * @use_img: select the 'u-boot.img' file instead of the 'u-boot' ELF file
33 */
34int sandbox_find_next_phase(char *fname, int maxlen, bool use_img);
35
Simon Glass36611152024-08-07 16:47:21 -060036/**
37 * sandbox_spl_load_fit() - Load the next phase from a FIT
38 *
39 * Loads a FIT containing the next phase and sets it up for booting
40 *
41 * @fname: Returns filename loaded
42 * @maxlen: Maximum length for @fname including \0
43 * @image: Place to put SPL-image information
44 * Return: 0 if OK, -ve on error
45 */
46int sandbox_spl_load_fit(char *fname, int maxlen, struct spl_image_info *image);
47
Simon Glassa7e2d4d2016-07-04 11:57:51 -060048#endif