u-boot: adjust root for eMMC boot

Adjust the bootscript so that if U-Boot is loaded from the eMMC, then
kernel "root" parameter is set to use eMMC second partition.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
This commit is contained in:
Diego Rondini 2017-04-13 13:03:46 +00:00
parent 54bc239a3f
commit febf35474a

View File

@ -1,4 +1,11 @@
setenv bootargs console=${console} console=tty1 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
# Default to (primary) SD
rootdev=mmcblk0p2
if itest.b *0x28 == 0x02 ; then
# U-Boot loaded from eMMC or secondary SD so use it for rootfs too
echo "U-boot loaded from eMMC or secondary SD"
rootdev=mmcblk1p2
fi
setenv bootargs console=${console} console=tty1 root=/dev/${rootdev} rootwait panic=10 ${extra}
load mmc 0:1 ${fdt_addr_r} ${fdtfile} || load mmc 0:1 ${fdt_addr_r} boot/${fdtfile}
load mmc 0:1 ${kernel_addr_r} zImage || load mmc 0:1 ${kernel_addr_r} boot/zImage || load mmc 0:1 ${kernel_addr_r} uImage || load mmc 0:1 ${kernel_addr_r} boot/uImage
bootz ${kernel_addr_r} - ${fdt_addr_r} || bootm ${kernel_addr_r} - ${fdt_addr_r}