Not all versions of ESPRESSObin require SD card, but can
be booted from the internal emmc flash (mmc dev 1) instead.
Add a simple check in the bootscript to see which mmc device
is detected and boot from it using mmcdev variable.
Tested-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
(cherry picked from commit
008b41b9b0ddd4c5c877a769a85d27eb9c4e21a4)
setenv bootargs "${bootargs} ${console}"
fi
-load mmc 0:1 ${fdt_addr} @DTB@.dtb
-load mmc 0:1 ${kernel_addr} Image
+if mmc dev 0; then
+ setenv mmcdev 0
+elif mmc dev 1; then
+ setenv mmcdev 1
+fi
+
+load mmc ${mmcdev}:1 ${fdt_addr} @DTB@.dtb
+load mmc ${mmcdev}:1 ${kernel_addr} Image
booti ${kernel_addr} - ${fdt_addr}