[PATCH v2 13/18] mmc: Add more debugging for SPL

Tom Rini trini at konsulko.com
Thu Oct 3 23:57:24 CEST 2024


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 <sjg at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20241003/cfb5955b/attachment.sig>


More information about the U-Boot mailing list