On Fri, Nov 06, 2026 at 09:28:06AM -0800, Urvashi Sharma wrote:

> common/spl/spl_ufs.c uses BOOT_DEVICE_UFS, which RISC-V does not
> define, so enabling CONFIG_SPL_UFS_SUPPORT fails to build:
> 
>    common/spl/spl_ufs.c:49:33: error: 'BOOT_DEVICE_UFS' undeclared here
>    (not in a function); did you mean 'BOOT_DEVICE_DFU'?
> 
> Add it before BOOT_DEVICE_NONE, which must stay last as the list
> terminator, and note this in a comment.
> 
> The BOOT_DEVICE_* values are SPL-internal and not passed to the next
> stage, so this is not an ABI change.
> 
> Signed-off-by: Urvashi Sharma <[email protected]>
> Cc: Rick Chen <[email protected]>
> Cc: Leo <[email protected]>
> Cc: Tom Rini <[email protected]>
> ---
> Changes for v2:
> - Add a comment documenting that BOOT_DEVICE_NONE must stay last
> - Update the commit message
> 
> Tested: qemu-riscv64_spl_defconfig with SPL_UFS_SUPPORT=y builds
> 
>  arch/riscv/include/asm/spl.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/riscv/include/asm/spl.h b/arch/riscv/include/asm/spl.h
> index 9c0bf9755c9..b3a7ee47bf7 100644
> --- a/arch/riscv/include/asm/spl.h
> +++ b/arch/riscv/include/asm/spl.h
> @@ -8,6 +8,10 @@
>  #ifndef _ASM_RISCV_SPL_H_
>  #define _ASM_RISCV_SPL_H_
>  
> +/*
> + * SPL boot device IDs.
> + * Add new entries before BOOT_DEVICE_NONE, which must stay last
> + */
>  enum {
>       BOOT_DEVICE_RAM,
>       BOOT_DEVICE_MMC1,
> @@ -27,6 +31,7 @@ enum {
>       BOOT_DEVICE_XIP,
>       BOOT_DEVICE_BOOTROM,
>       BOOT_DEVICE_SMH,
> +     BOOT_DEVICE_UFS,
>       BOOT_DEVICE_NONE
>  };

Is it too late to ask you to pick up and make include/asm-generic/spl.h
instead, and use that for at least RISC-V ? The history here is that we
have a few cases, such as arch/arm/include/asm/arch-omap3/spl.h where
the values matter as the values match up with some ROM. We also have
lots of cases, and it sounds like RISC-V is entirely one, where U-Boot
itself figures out it booted from $dev and so return BOOT_DEVICE_$dev.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to