[openwrt/openwrt] uboot-envtools: mvebu: fix config for mainline u-boot

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 11 11:08:39 EDT 2020


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/60c9a27cbcc6ba00d75b4b592f507237dbfb460f

commit 60c9a27cbcc6ba00d75b4b592f507237dbfb460f
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Sat Sep 12 10:28:21 2020 +0200

    uboot-envtools: mvebu: fix config for mainline u-boot
    
    Mainline u-boot dynamically passes the mtd partitions via devicetree:
    $ cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 003f0000 00001000 "firmware"
    mtd1: 00010000 00001000 "u-boot-env"
    
    Add support for this setup.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 package/boot/uboot-envtools/files/mvebu | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu
index 1d3b79b962..85101cf35b 100644
--- a/package/boot/uboot-envtools/files/mvebu
+++ b/package/boot/uboot-envtools/files/mvebu
@@ -27,7 +27,14 @@ glinet,gl-mv1000)
 globalscale,espressobin|\
 globalscale,espressobin-emmc|\
 globalscale,espressobin-v7|\
-globalscale,espressobin-v7-emmc|\
+globalscale,espressobin-v7-emmc)
+	idx="$(find_mtd_index u-boot-env)"
+	if [ -n "$idx" ]; then
+		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
+	else
+		ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
+	fi
+	;;
 marvell,armada8040-mcbin-doubleshot|\
 marvell,armada8040-mcbin-singleshot)
 	ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"



More information about the lede-commits mailing list