70d70dfed05778861898f6b99e4777a79ebcb95a
[openwrt/staging/noltari.git] / package / boot / uboot-envtools / files / ramips
1 #
2 # Copyright (C) 2011-2012 OpenWrt.org
3 #
4
5 [ -e /etc/config/ubootenv ] && exit 0
6
7 touch /etc/config/ubootenv
8
9 . /lib/uboot-envtools.sh
10 . /lib/functions.sh
11
12 board=$(board_name)
13
14 case "$board" in
15 alfa-network,ac1200rm|\
16 alfa-network,awusfree1|\
17 alfa-network,quad-e4g|\
18 alfa-network,r36m-e4g|\
19 alfa-network,tube-e4g|\
20 engenius,esr600h|\
21 sitecom,wlr-4100-v1-002)
22 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
23 ;;
24 allnet,all0256n-4m|\
25 allnet,all0256n-8m|\
26 allnet,all5002|\
27 yuncore,ax820)
28 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
29 ;;
30 ampedwireless,ally-00x19k|\
31 ampedwireless,ally-r1900k)
32 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
33 ;;
34 beeline,smartbox-giga|\
35 beeline,smartbox-turbo)
36 ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
37 ;;
38 buffalo,wsr-1166dhp|\
39 buffalo,wsr-600dhp|\
40 kroks,kndrt31r16|\
41 kroks,kndrt31r19|\
42 mediatek,linkit-smart-7688|\
43 samknows,whitebox-v8|\
44 xiaomi,mi-router-4c|\
45 xiaomi,miwifi-nano|\
46 zbtlink,zbt-wg2626|\
47 zte,mf283plus)
48 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
49 ;;
50 belkin,rt1800|\
51 h3c,tx1800-plus|\
52 h3c,tx1801-plus|\
53 h3c,tx1806|\
54 jcg,q20|\
55 linksys,e7350|\
56 netgear,wax202)
57 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
58 ;;
59 haier,har-20s2u1|\
60 sim,simax1800t)
61 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
62 ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
63 ;;
64 hootoo,ht-tm05|\
65 ravpower,rp-wd03)
66 idx="$(find_mtd_index u-boot-env)"
67 [ -n "$idx" ] && \
68 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
69 ;;
70 beeline,smartbox-flash|\
71 linksys,ea6350-v4|\
72 linksys,ea7300-v1|\
73 linksys,ea7300-v2|\
74 linksys,ea7500-v2|\
75 linksys,ea8100-v1|\
76 linksys,ea8100-v2|\
77 mts,wg430223)
78 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
79 ;;
80 xiaomi,mi-router-3g-v2|\
81 xiaomi,mi-router-4a-gigabit|\
82 xiaomi,miwifi-3c)
83 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
84 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
85 ;;
86 xiaomi,mi-router-3g|\
87 xiaomi,mi-router-3-pro|\
88 xiaomi,mi-router-4|\
89 xiaomi,mi-router-ac2100|\
90 xiaomi,redmi-router-ac2100)
91 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
92 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
93 ;;
94 zyxel,lte3301-plus)
95 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
96 ;;
97 zyxel,nr7101)
98 idx="$(find_mtd_index Config)"
99 [ -n "$idx" ] && \
100 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
101 ;;
102 bolt,arion|\
103 xiaomi,mi-router-cr6606|\
104 xiaomi,mi-router-cr6608|\
105 xiaomi,mi-router-cr6609)
106 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
107 ;;
108 esac
109
110 config_load ubootenv
111 config_foreach ubootenv_add_app_config
112
113 exit 0