When only sdhci1 IP is enabled and SD_MODE1 bootmode is selected
U-Boot using sdboot1 variable which refers to mmc dev 1.
But this device doesn't exist because only one controller is available.

This patch fix logic around sdboot mode with using sdbootdev internal
variable.

Reported-by: Chris Kohn <ck...@xilinx.com>
Acked-by: Siva Durga Prasad Paladugu <siva...@xilinx.com>
Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c    | 5 ++++-
 include/configs/xilinx_zynqmp.h | 6 ++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index a1d3fef24e8e..ac2362532590 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -103,7 +103,10 @@ int board_late_init(void)
                break;
        case SD_MODE1:
                puts("SD_MODE1\n");
-               setenv("modeboot", "sdboot1");
+#if defined(CONFIG_ZYNQ_SDHCI0) && defined(CONFIG_ZYNQ_SDHCI1)
+               setenv("sdbootdev", "1");
+#endif
+               setenv("modeboot", "sdboot");
                break;
        case NAND_MODE:
                puts("NAND_MODE\n");
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 03f74508efea..2d9f020f50d7 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -156,8 +156,10 @@
        "kernel_addr=0x80000\0" \
        "fdt_addr=0x7000000\0" \
        "fdt_high=0x10000000\0" \
-       "sdboot=mmcinfo && load mmc 0:0 $fdt_addr system.dtb && " \
-               "load mmc 0:0 $kernel_addr Image && booti $kernel_addr - 
$fdt_addr\0" \
+       "sdbootdev=0\0"\
+       "sdboot=mmc dev $sdbootdev && mmcinfo && load mmc $sdbootdev:$partid 
$fdt_addr system.dtb && " \
+               "load mmc $sdbootdev:$partid $kernel_addr Image && " \
+               "booti $kernel_addr - $fdt_addr\0" \
        DFU_ALT_INFO
 
 #define CONFIG_BOOTARGS                "setenv bootargs 
console=ttyPS0,${baudrate} " \
-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to