Skip to content

Instantly share code, notes, and snippets.

@imrehg
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imrehg/3843fc91b18a5dde9a7d to your computer and use it in GitHub Desktop.
Save imrehg/3843fc91b18a5dde9a7d to your computer and use it in GitHub Desktop.
Enabling SD-card booting on the VIA Springboard u-boot
--- bspinst/bspinst.cfg 2013-09-04 18:45:54.000000000 +0800
+++ bspinst/bspinst.cfg 2014-06-17 16:18:27.000000000 +0800
@@ -192,6 +192,13 @@
${bootargs-common} \
${bootargs-extra}
+# Set rootfs on the SD card
+setenv set-rfs-sd \
+ setenv bootargs mem=${memtotal} root=/dev/mmcblk0p2 rw \
+ rootfstype=ext4 noinitrd mbtotal=${mbsize} \
+ ${bootargs-common} \
+ ${bootargs-extra}
+
setenv boot-mmc-ram \
mmcinit ${mmcid}\; \
fatload mmc ${mmcid}:1 ${cfg.load-addr-kernel} bspinst/uzImage.bin\; \
@@ -262,6 +269,15 @@
bootm ${cfg.load-addr-kernel}\; \
fi
+# Try to boot from the SD card
+setenv boot-sd \
+ mmcinit ${mmcid}\; \
+ fatload mmc ${mmcid} ${cfg.load-addr-kernel} uzimage.bin\; \
+ if iminfo ${cfg.load-addr-kernel}\; then \
+ run set-rfs-sd\; \
+ bootm ${cfg.load-addr-kernel}\; \
+ fi
+
setenv boot-sf-nand \
if iminfo 0xffd00000\; then \
run set-rfs-nand\; \
@@ -289,6 +305,7 @@
setenv pre-boot \
run scriptcmd\; \
run scriptcmd-usb\; \
+ run boot-sd\; \
run boot-mmc-ram\; \
echo No MMC card found\; \
run boot-usb-ram\; \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment