aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2020-09-12 09:32:41 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2020-10-28 23:22:44 +0100
commit7fbee0c7b2f6eebced44fd2060fbaac6fc5fd9e5 (patch)
tree56d228595031e761695e95647948050433a42857
parent14903d9d8cb2da2d3c2b793bdad51561dc7bb930 (diff)
downloadupstream-7fbee0c7b2f6eebced44fd2060fbaac6fc5fd9e5.tar.gz
upstream-7fbee0c7b2f6eebced44fd2060fbaac6fc5fd9e5.tar.bz2
upstream-7fbee0c7b2f6eebced44fd2060fbaac6fc5fd9e5.zip
mvebu: Add bootscript for espressobin to support mainline firmware
The generic bootscript is tailored around a downstream firmware and doesn't work on a firmware built from mainline components. Add a bootscript which: * sets $console since mainline u-boot doesn't do that * uses distro boot variables, so OpenWRT can be booted off any supported device when using a mainline firmware * sets missing distro boot variables for the downstream firmware Booting with a downstream firmware is unchanged. Booting with a mainline firmware now works. Signed-off-by: Andre Heider <a.heider@gmail.com> (cherry picked from commit c43b45863e38fb18a486601c1601f1485d649c0b)
-rw-r--r--target/linux/mvebu/image/cortex-a53.mk4
-rw-r--r--target/linux/mvebu/image/espressobin.bootscript34
2 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk
index d7014d6f02..7b3bcba06d 100644
--- a/target/linux/mvebu/image/cortex-a53.mk
+++ b/target/linux/mvebu/image/cortex-a53.mk
@@ -4,6 +4,7 @@ define Device/globalscale_espressobin
$(call Device/Default-arm64)
DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
DEVICE_DTS := armada-3720-espressobin
+ BOOT_SCRIPT := espressobin
endef
TARGET_DEVICES += globalscale_espressobin
@@ -11,6 +12,7 @@ define Device/globalscale_espressobin-emmc
$(call Device/Default-arm64)
DEVICE_TITLE := ESPRESSObin eMMC (Marvell Armada 3700 Community Board)
DEVICE_DTS := armada-3720-espressobin-emmc
+ BOOT_SCRIPT := espressobin
endef
TARGET_DEVICES += globalscale_espressobin-emmc
@@ -18,6 +20,7 @@ define Device/globalscale_espressobin-v7
$(call Device/Default-arm64)
DEVICE_TITLE := ESPRESSObin V7 (Marvell Armada 3700 Community Board)
DEVICE_DTS := armada-3720-espressobin-v7
+ BOOT_SCRIPT := espressobin
endef
TARGET_DEVICES += globalscale_espressobin-v7
@@ -25,6 +28,7 @@ define Device/globalscale_espressobin-v7-emmc
$(call Device/Default-arm64)
DEVICE_TITLE := ESPRESSObin V7 eMMC (Marvell Armada 3700 Community Board)
DEVICE_DTS := armada-3720-espressobin-v7-emmc
+ BOOT_SCRIPT := espressobin
endef
TARGET_DEVICES += globalscale_espressobin-v7-emmc
diff --git a/target/linux/mvebu/image/espressobin.bootscript b/target/linux/mvebu/image/espressobin.bootscript
new file mode 100644
index 0000000000..07765df979
--- /dev/null
+++ b/target/linux/mvebu/image/espressobin.bootscript
@@ -0,0 +1,34 @@
+# Bootscript for Globalscale ESPRESSOBin Board
+
+# Set distro variables if necessary for compability with downstream firmware
+if test -z "${kernel_addr_r}"; then
+ setenv kernel_addr_r 0x7000000
+fi
+
+if test -z "${fdt_add_r}"; then
+ setenv fdt_addr_r 0x6f00000
+fi
+
+if test -z "${devtype}"; then
+ setenv devtype mmc
+fi
+
+if test -z "${devnum}"; then
+ if mmc dev 0; then
+ setenv devnum 0
+ elif mmc dev 1; then
+ setenv devnum 1
+ fi
+fi
+
+# figure out partition uuid to pass to the kernel as root=
+part uuid ${devtype} ${devnum}:2 uuid
+
+setenv console "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
+setenv bootargs "root=PARTUUID=${uuid} rw rootwait ${console}"
+
+echo "Booting Linux from ${devtype} ${devnum} with args: ${bootargs}"
+load ${devtype} ${devnum}:1 ${fdt_addr_r} @DTB@.dtb
+load ${devtype} ${devnum}:1 ${kernel_addr_r} Image
+
+booti ${kernel_addr_r} - ${fdt_addr_r}