On 8/28/24 3:45 AM, 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 <[email protected]>
---
common/spl/spl_mmc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 3fd81608e9f..c0e8d407e5d 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -50,6 +50,7 @@ int mmc_load_image_raw_sector(struct spl_image_info
*spl_image,
ret = spl_load(spl_image, bootdev, &load, 0, sector << bd->log2blksz);
if (ret) {
puts("mmc_load_image_raw_sector: mmc block read error\n");
+ log_debug("(error=%d)\n", ret);
return ret;
}
@@ -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);
@@ -91,6 +98,10 @@ static int spl_mmc_find_device(struct mmc **mmcp, int
mmc_dev)
mmc_dev, ret);
return ret;
}
+#if CONFIG_IS_ENABLED(DM_MMC)
if (CONFIG_IS_ENABLED(...)) ?