On Mon, Sep 14, 2026 at 10:31:37AM +0200, Carlo Caione wrote:

> Boards may need to read boot metadata before choosing the partition
> containing U-Boot. The partition hook currently runs before the MMC
> device is initialized, so it cannot do this reliably.
> 
> Defer selection until the raw partition load and provide the initialized
> device to the existing hook. Explicit partition loads keep their supplied
> coordinates, and a successful Falcon boot needs no U-Boot selection.
> 
> Signed-off-by: Carlo Caione <[email protected]>
[snip]
> diff --git a/include/spl.h b/include/spl.h
> index 5078d7525ab..08a84536f51 100644
> --- a/include/spl.h
> +++ b/include/spl.h
> @@ -595,18 +595,20 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 
> boot_device);
>  
>  /**
>   * spl_mmc_boot_partition() - MMC partition to load U-Boot from.
> + * @mmc:             Initialized MMC device
>   * @boot_device:     ID of the device which the MMC driver wants to load
>   *                   U-Boot from.
>   *
> - * This function should return the partition number which the SPL
> - * should load U-Boot from (on the given boot_device) when
> - * CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is set.
> + * Called before loading U-Boot in raw partition mode, after any Falcon
> + * attempt. The hook may select the hardware area containing the image;
> + * it must leave that area selected. It may run for each MMC load attempt.
>   *
>   * If not overridden, it is weakly defined in common/spl/spl_mmc.c.
> + *
> + * Return: Partition number to load U-Boot from.
>   */
> -int spl_mmc_boot_partition(const u32 boot_device);
> +int spl_mmc_boot_partition(struct mmc *mmc, const u32 boot_device);
>  
> -struct mmc;

Have you thrown this through CI? We have that forward declaration
because it's not otherwise defined, and we wanted to avoid pulling in a
big header chain here to declare it. So I worry something is going to
fail to build now.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to