summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Goger <klaus.goger@theobroma-systems.com>2015-07-30 16:56:59 +0200
committerKlaus Goger <klaus.goger@theobroma-systems.com>2015-07-30 17:00:33 +0200
commit8af27b76fce329f4f24a5397c392ed3309e14977 (patch)
tree9b18655db9df39121a51cd9baf525aec1d2d9c17
parentb36851f43e75fd94cac602a96c1664b201934c69 (diff)
detect bootdevice in u-boot boot script
with the emmcboot command we can detect the boot device and set the root device for the linux bootargs accordingly. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
-rw-r--r--boot.cmd3
1 files changed, 2 insertions, 1 deletions
diff --git a/boot.cmd b/boot.cmd
index 1995d2f..ff139a2 100644
--- a/boot.cmd
+++ b/boot.cmd
@@ -3,7 +3,8 @@
# Compile this file:
# mkimage -C none -A arm -T script -d boot.cmd boot.scr
-setenv bootargs console=ttyS2,115200 root=/dev/mmcblk0p1 rw rootwait
+if emmcboot; then rootdevice=mmcblk0p1; else rootdevice=mmcblk1p1; fi
+setenv bootargs console=ttyS2,115200 root=/dev/${rootdevice} rw rootwait
ext4load mmc 0:1 0x40008000 boot/uImage
ext4load mmc 0:1 0x40000000 boot/sun6i-a31-pangolin.dtb
bootm 0x40008000 - 0x40000000