uboot-envtools: mvebu: fix config for mainline u-boot
[openwrt/staging/dedeckeh.git] / package / boot / uboot-envtools / files / mvebu
index 590000aae75e8bcf3ff7b98d5f15a5b781f383fb..85101cf35be2a7195c76ac5fe8ad3783f7970c27 100644 (file)
@@ -15,7 +15,11 @@ board=$(board_name)
 
 case "$board" in
 cznic,turris-omnia)
-       ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
+       if grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
+               ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
+       else
+               ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
+       fi
        ;;
 glinet,gl-mv1000)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
@@ -23,8 +27,16 @@ glinet,gl-mv1000)
 globalscale,espressobin|\
 globalscale,espressobin-emmc|\
 globalscale,espressobin-v7|\
-globalscale,espressobin-v7-emmc|\
-marvell,armada8040-mcbin-doubleshot)
+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"
        ;;
 linksys,wrt1200ac|\