oxnas: drop target
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / mvebu
1 #
2 # Copyright (C) 2014-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-Project.org
4 #
5
6 [ -e /etc/config/ubootenv ] && exit 0
7
8 touch /etc/config/ubootenv
9
10 . /lib/uboot-envtools.sh
11 . /lib/functions.sh
12
13 board=$(board_name)
14
15 case "$board" in
16 buffalo,ls220de|\
17 buffalo,ls421de)
18 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
19 ;;
20 cznic,turris-omnia)
21 idx="$(find_mtd_index u-boot-env)"
22 if [ -n "$idx" ]; then
23 ubootenv_add_uci_config "/dev/mtd${idx}" "0x0" "0x10000" "0x10000"
24 elif grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
25 ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
26 else
27 ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
28 fi
29 ;;
30 glinet,gl-mv1000)
31 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
32 ;;
33 globalscale,espressobin|\
34 globalscale,espressobin-emmc|\
35 globalscale,espressobin-ultra|\
36 globalscale,espressobin-v7|\
37 globalscale,espressobin-v7-emmc|\
38 globalscale,mochabin)
39 idx="$(find_mtd_index u-boot-env)"
40 if [ -n "$idx" ]; then
41 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
42 else
43 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
44 fi
45 ;;
46 marvell,armada8040-mcbin-doubleshot|\
47 marvell,armada8040-mcbin-singleshot)
48 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
49 ;;
50 linksys,wrt1200ac|\
51 linksys,wrt1900ac-v2|\
52 linksys,wrt1900acs)
53 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
54 ;;
55 linksys,wrt1900ac-v1)
56 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
57 ;;
58 linksys,wrt3200acm|\
59 linksys,wrt32x)
60 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
61 ;;
62 methode,udpu|\
63 methode,edpu)
64 idx="$(find_mtd_index u-boot-env)"
65 if [ -n "$idx" ]; then
66 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
67 else
68 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
69 fi
70 ;;
71 synology,ds213j)
72 idx="$(find_mtd_index u-boot-env)"
73 [ -n "$idx" ] && ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
74 ;;
75 esac
76
77 config_load ubootenv
78 config_foreach ubootenv_add_app_config ubootenv
79
80 exit 0