[openwrt/openwrt] mvebu: GL-MV1000: add custom boot script

LEDE Commits lede-commits at lists.infradead.org
Tue Aug 6 12:46:38 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2aa760acd688a22fa6a7c3c6a153ddd1099e92e4

commit 2aa760acd688a22fa6a7c3c6a153ddd1099e92e4
Author: Enrico Mioso <mrkiko.rs at gmail.com>
AuthorDate: Tue Jul 2 18:09:07 2024 +0200

    mvebu: GL-MV1000: add custom boot script
    
    This allows booting from internal eMMC or SD card just changing the
    U-Boot mmc_dev variable.
    In particular, setting mmc_dev to 1 will result in booting from the SD card.
    Setting the variable to 0 will result in internal eMMC boot (the default).
    Should the variable be unset or an error condition occur while reading
    from SD card, internal MMC booting will be tried.
    
    Signed-off-by: Enrico Mioso <mrkiko.rs at gmail.com>
---
 target/linux/mvebu/image/cortexa53.mk         |  1 +
 target/linux/mvebu/image/gl-mv1000.bootscript | 28 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/target/linux/mvebu/image/cortexa53.mk b/target/linux/mvebu/image/cortexa53.mk
index afe8d9ce21..2a3b5ee11e 100644
--- a/target/linux/mvebu/image/cortexa53.mk
+++ b/target/linux/mvebu/image/cortexa53.mk
@@ -3,6 +3,7 @@ define Device/glinet_gl-mv1000
   DEVICE_VENDOR := GL.iNet
   DEVICE_MODEL := GL-MV1000
   SOC := armada-3720
+  BOOT_SCRIPT := gl-mv1000
 endef
 TARGET_DEVICES += glinet_gl-mv1000
 
diff --git a/target/linux/mvebu/image/gl-mv1000.bootscript b/target/linux/mvebu/image/gl-mv1000.bootscript
new file mode 100644
index 0000000000..be93aa36a0
--- /dev/null
+++ b/target/linux/mvebu/image/gl-mv1000.bootscript
@@ -0,0 +1,28 @@
+# Boot script for GL.iNet GL-MV1000 to make it easier to boot from eMMC or SD
+# card.
+
+setenv bootargs "root=PARTUUID=@ROOT at -02 rw rootwait"
+
+if test -n "${console}"; then
+	setenv bootargs "${bootargs} ${console}"
+fi
+
+# Should mmc_dev not be present, default to internal MMC boot
+if test -z "${mmc_dev}"; then
+	setenv mmc_dev 0
+fi
+
+setenv mmcdev "${mmc_dev}"
+
+if test -n "${fdt_addr_r}"; then
+       setenv fdt_addr ${fdt_addr_r}
+fi
+
+if test -n "${kernel_addr_r}"; then
+       setenv kernel_addr ${kernel_addr_r}
+fi
+
+load mmc ${mmcdev}:1 ${fdt_addr} @DTB at .dtb
+load mmc ${mmcdev}:1 ${kernel_addr} Image
+
+booti ${kernel_addr} - ${fdt_addr}




More information about the lede-commits mailing list