mvebu: uDPU: add sysupgrade support
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / mvebu
1 #!/bin/sh
2 #
3 # Copyright (C) 2014-2016 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
5 #
6
7 [ -e /etc/config/ubootenv ] && exit 0
8
9 touch /etc/config/ubootenv
10
11 . /lib/uboot-envtools.sh
12 . /lib/functions.sh
13
14 board=$(board_name)
15
16 case "$board" in
17 cznic,turris-omnia)
18 ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
19 ;;
20 globalscale,espressobin|\
21 globalscale,espressobin-emmc|\
22 globalscale,espressobin-v7|\
23 globalscale,espressobin-v7-emmc|\
24 marvell,armada8040-mcbin)
25 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
26 ;;
27 linksys,caiman|\
28 linksys,cobra|\
29 linksys,shelby)
30 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
31 ;;
32 linksys,mamba)
33 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
34 ;;
35 linksys,rango|\
36 linksys,venom)
37 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
38 ;;
39 methode,udpu)
40 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
41 ;;
42 esac
43
44 config_load ubootenv
45 config_foreach ubootenv_add_app_config ubootenv
46
47 exit 0