]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: versal: Fix emmc boot mode boot_target issue
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Mon, 16 Dec 2019 11:44:26 +0000 (04:44 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 14 Jan 2020 08:05:52 +0000 (09:05 +0100)
Emmc boot devcie is mounted to sdhci@f1050000 controller on versal, while
in emmc boot mode, boot tragets are set to mmc0. So removed mmc0 and using
the dev seq number from the sdhci@f1050000 controller.
Dev seq number is setup based on DT aliases that's why needs to be setup at
run time.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/versal/board.c

index 23bb6b96238795b2eb2068b8d333a2e1f6abadcd..45724478a25e7f88eba85dd368ab5fdb240b466d 100644 (file)
@@ -130,7 +130,14 @@ int board_late_init(void)
                break;
        case EMMC_MODE:
                puts("EMMC_MODE\n");
-               mode = "mmc0";
+               if (uclass_get_device_by_name(UCLASS_MMC,
+                                             "sdhci@f1050000", &dev)) {
+                       puts("Boot from EMMC but without SD1 enabled!\n");
+                       return -1;
+               }
+               debug("mmc1 device found at %p, seq %d\n", dev, dev->seq);
+               mode = "mmc";
+               bootseq = dev->seq;
                break;
        case SD_MODE:
                puts("SD_MODE\n");