From: Vladimir Vid Date: Fri, 7 Jun 2019 13:58:15 +0000 (+0200) Subject: mvebu: image: fix generic-arm64.bootscript mmc selection X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=008b41b9b0ddd4c5c877a769a85d27eb9c4e21a4;p=openwrt%2Fstaging%2Fluka.git mvebu: image: fix generic-arm64.bootscript mmc selection 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 Signed-off-by: Vladimir Vid --- diff --git a/target/linux/mvebu/image/generic-arm64.bootscript b/target/linux/mvebu/image/generic-arm64.bootscript index f395590f84..bb78948253 100644 --- a/target/linux/mvebu/image/generic-arm64.bootscript +++ b/target/linux/mvebu/image/generic-arm64.bootscript @@ -4,7 +4,13 @@ if test -n "${console}"; then 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}