diff options
| author | Pranav Tilak <[email protected]> | 2026-01-13 11:31:07 +0530 |
|---|---|---|
| committer | Michal Simek <[email protected]> | 2026-01-16 08:56:51 +0100 |
| commit | af5c2b759e71e152576597e44151abca97979d33 (patch) | |
| tree | ee2f2a32d26b5bf935d252b40d0e8c70430f4f65 | |
| parent | 6f58580391d9457c0dc1a47bc2c9dd3fde7d8d4d (diff) | |
arm64: versal2: Fix emmc boot mode boot_target issue
The eMMC boot device controller on Versal2 requires device pointer
initialization before accessing its sequence number. The EMMC_MODE case
was using dev_seq(dev) on an uninitialized pointer, causing corrupted
boot_targets entries (mmc7f7fbfbf instead of mmc0/mmc1).
Add uclass_get_device_by_name() call to properly initialize the device
pointer before reading the sequence number. The dev sequence number is
determined at runtime based on DT aliases.
Fix boot_targets corruption in eMMC boot mode, allowing proper boot
device selection instead of falling back to JTAG mode.
Signed-off-by: Pranav Tilak <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
| -rw-r--r-- | board/amd/versal2/board.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/board/amd/versal2/board.c b/board/amd/versal2/board.c index 1fd05a1157a..d8079c1cee0 100644 --- a/board/amd/versal2/board.c +++ b/board/amd/versal2/board.c @@ -253,6 +253,12 @@ static int boot_targets_setup(void) break; case EMMC_MODE: puts("EMMC_MODE\n"); + if (uclass_get_device_by_name(UCLASS_MMC, + "mmc@f1050000", &dev)) { + debug("SD1 driver for SD1 device is not present\n"); + break; + } + debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev)); mode = "mmc"; bootseq = dev_seq(dev); break; |
