8ed1f87ead4660438389858b1427cb5c250f9463
[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 glinet,gl-mv1000)
21 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
22 ;;
23 globalscale,espressobin|\
24 globalscale,espressobin-emmc|\
25 globalscale,espressobin-v7|\
26 globalscale,espressobin-v7-emmc|\
27 marvell,armada8040-mcbin-doubleshot|\
28 marvell,armada8040-mcbin-singleshot)
29 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
30 ;;
31 linksys,wrt1200ac|\
32 linksys,wrt1900ac-v2|\
33 linksys,wrt1900acs)
34 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
35 ;;
36 linksys,wrt1900ac-v1)
37 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
38 ;;
39 linksys,wrt3200acm|\
40 linksys,wrt32x)
41 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
42 ;;
43 methode,udpu)
44 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
45 ;;
46 esac
47
48 config_load ubootenv
49 config_foreach ubootenv_add_app_config ubootenv
50
51 exit 0