Some architectures, such as omap3, need BOOT_DEVICE_* values that match their boot ROM. RISC-V does not: U-Boot works out the boot device itself and returns the matching BOOT_DEVICE_$dev, so the values are only used inside SPL.
Move the list to include/asm-generic/spl.h and include it from asm/spl.h, so that new devices only have to be added in one place. Other architectures in the same situation can switch to it later. No functional change. Suggested-by: Tom Rini <[email protected]> Signed-off-by: Urvashi Sharma <[email protected]> --- arch/riscv/include/asm/spl.h | 22 +-------------------- include/asm-generic/spl.h | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 21 deletions(-) create mode 100644 include/asm-generic/spl.h diff --git a/arch/riscv/include/asm/spl.h b/arch/riscv/include/asm/spl.h index 9c0bf9755c9..1e0dfafc281 100644 --- a/arch/riscv/include/asm/spl.h +++ b/arch/riscv/include/asm/spl.h @@ -8,27 +8,7 @@ #ifndef _ASM_RISCV_SPL_H_ #define _ASM_RISCV_SPL_H_ -enum { - BOOT_DEVICE_RAM, - BOOT_DEVICE_MMC1, - BOOT_DEVICE_MMC2, - BOOT_DEVICE_MMC2_2, - BOOT_DEVICE_NAND, - BOOT_DEVICE_ONENAND, - BOOT_DEVICE_NOR, - BOOT_DEVICE_UART, - BOOT_DEVICE_SPI, - BOOT_DEVICE_USB, - BOOT_DEVICE_SATA, - BOOT_DEVICE_NVME, - BOOT_DEVICE_I2C, - BOOT_DEVICE_BOARD, - BOOT_DEVICE_DFU, - BOOT_DEVICE_XIP, - BOOT_DEVICE_BOOTROM, - BOOT_DEVICE_SMH, - BOOT_DEVICE_NONE -}; +#include <asm-generic/spl.h> /** * spl_board_init_f() - initialize board in the SPL phase diff --git a/include/asm-generic/spl.h b/include/asm-generic/spl.h new file mode 100644 index 00000000000..7b4789596a2 --- /dev/null +++ b/include/asm-generic/spl.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Based on arch/riscv/include/asm/spl.h. + * + * (C) Copyright 2012 + * Texas Instruments, <www.ti.com> + */ +#ifndef _ASM_GENERIC_SPL_H_ +#define _ASM_GENERIC_SPL_H_ + +/* + * SPL boot device IDs. + * Add new entries before BOOT_DEVICE_NONE, which must stay last. + */ +enum { + BOOT_DEVICE_RAM, + BOOT_DEVICE_MMC1, + BOOT_DEVICE_MMC2, + BOOT_DEVICE_MMC2_2, + BOOT_DEVICE_NAND, + BOOT_DEVICE_ONENAND, + BOOT_DEVICE_NOR, + BOOT_DEVICE_UART, + BOOT_DEVICE_SPI, + BOOT_DEVICE_USB, + BOOT_DEVICE_SATA, + BOOT_DEVICE_NVME, + BOOT_DEVICE_I2C, + BOOT_DEVICE_BOARD, + BOOT_DEVICE_DFU, + BOOT_DEVICE_XIP, + BOOT_DEVICE_BOOTROM, + BOOT_DEVICE_SMH, + BOOT_DEVICE_NONE +}; + +#endif -- 2.34.1
