Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | a7e2d4d | 2016-07-04 11:57:51 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Google, Inc |
Simon Glass | a7e2d4d | 2016-07-04 11:57:51 -0600 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __asm_spl_h |
| 7 | #define __asm_spl_h |
| 8 | |
Simon Glass | 3661115 | 2024-08-07 16:47:21 -0600 | [diff] [blame] | 9 | struct spl_image_info; |
| 10 | |
Simon Glass | a7e2d4d | 2016-07-04 11:57:51 -0600 | [diff] [blame] | 11 | enum { |
Simon Glass | 4aa6a9b | 2022-10-20 18:23:01 -0600 | [diff] [blame] | 12 | BOOT_DEVICE_MMC1, |
| 13 | BOOT_DEVICE_MMC2, |
| 14 | BOOT_DEVICE_MMC2_2, |
Simon Glass | a7e2d4d | 2016-07-04 11:57:51 -0600 | [diff] [blame] | 15 | BOOT_DEVICE_BOARD, |
Simon Glass | d78aa75 | 2022-10-20 18:23:10 -0600 | [diff] [blame] | 16 | BOOT_DEVICE_VBE, |
Sean Anderson | c4f86c0 | 2023-10-14 16:48:03 -0400 | [diff] [blame] | 17 | BOOT_DEVICE_CPGMAC, |
Sean Anderson | 430e4aa | 2023-10-14 16:48:04 -0400 | [diff] [blame] | 18 | BOOT_DEVICE_NOR, |
Sean Anderson | 8734d6f | 2023-10-14 16:48:05 -0400 | [diff] [blame] | 19 | BOOT_DEVICE_SPI, |
Sean Anderson | 765dc6a | 2023-11-04 16:37:53 -0400 | [diff] [blame] | 20 | BOOT_DEVICE_NAND, |
Simon Glass | 6056e5a | 2024-08-07 16:47:38 -0600 | [diff] [blame] | 21 | BOOT_DEVICE_UPL, |
Simon Glass | a7e2d4d | 2016-07-04 11:57:51 -0600 | [diff] [blame] | 22 | }; |
| 23 | |
Simon Glass | 1cd0600 | 2021-07-05 16:32:45 -0600 | [diff] [blame] | 24 | /** |
| 25 | * sandbox_find_next_phase() - Find the next phase of U-Boot |
| 26 | * |
| 27 | * This function is intended to be called from within sandbox SPL. It uses |
| 28 | * a few rules to find the filename of the next U-Boot phase. See also |
| 29 | * os_find_u_boot(). |
| 30 | * |
| 31 | * @fname: place to put full path to U-Boot |
| 32 | * @maxlen: maximum size of @fname |
| 33 | * @use_img: select the 'u-boot.img' file instead of the 'u-boot' ELF file |
| 34 | */ |
| 35 | int sandbox_find_next_phase(char *fname, int maxlen, bool use_img); |
| 36 | |
Simon Glass | 3661115 | 2024-08-07 16:47:21 -0600 | [diff] [blame] | 37 | /** |
| 38 | * sandbox_spl_load_fit() - Load the next phase from a FIT |
| 39 | * |
| 40 | * Loads a FIT containing the next phase and sets it up for booting |
| 41 | * |
| 42 | * @fname: Returns filename loaded |
| 43 | * @maxlen: Maximum length for @fname including \0 |
| 44 | * @image: Place to put SPL-image information |
| 45 | * Return: 0 if OK, -ve on error |
| 46 | */ |
| 47 | int sandbox_spl_load_fit(char *fname, int maxlen, struct spl_image_info *image); |
| 48 | |
Simon Glass | a7e2d4d | 2016-07-04 11:57:51 -0600 | [diff] [blame] | 49 | #endif |