On Fri, Sep 20, 2024 at 09:24:37AM +0200, Simon Glass wrote:

> When MMC booting fails it is sometimes hard to figure out what went
> wrong as there is no error code. It isn't even clear which MMC device
> was chosen, since SPL can have its own numbering.
> 
> Add some debugging to help with this.
> 
> Signed-off-by: Simon Glass <s...@chromium.org>
[snip]
> @@ -76,6 +77,12 @@ static int spl_mmc_find_device(struct mmc **mmcp, int 
> mmc_dev)
>       int ret;
>  
>  #if CONFIG_IS_ENABLED(DM_MMC)
> +     struct udevice *dev;
> +     struct uclass *uc;
> +
> +     log_debug("Selecting MMC dev %d; seqs:\n", mmc_dev);
> +     uclass_id_foreach_dev(UCLASS_MMC, dev, uc)
> +             log_debug("%d: %s\n", dev_seq(dev), dev->name);
>       ret = mmc_init_device(mmc_dev);
>  #else
>       ret = mmc_initialize(NULL);

For the record, this change, even with debugging not enabled (and LOG
not enabled) is not size change free and does not get optimized away by
the compiler. I'm not sure off-hand if there's a clever way to fix that,
so I'm not blocking the series on this.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to