a04c0616e57a85c74db2ee54b84dc3065f5233bc
[openwrt/openwrt.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,epg600|\
21 engenius,esr600h|\
22 linksys,re7000|\
23 sitecom,wlr-4100-v1-002|\
24 zyxel,keenetic-lite-iii-a)
25 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
26 ;;
27 alfa-network,ax1800rm|\
28 allnet,all0256n-4m|\
29 allnet,all0256n-8m|\
30 allnet,all5002|\
31 yuncore,ax820)
32 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
33 ;;
34 arcadyan,we420223-99|\
35 dlink,dir-806a-b1)
36 ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
37 ;;
38 ampedwireless,ally-00x19k|\
39 ampedwireless,ally-r1900k)
40 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
41 ;;
42 beeline,smartbox-giga|\
43 beeline,smartbox-turbo|\
44 beeline,smartbox-turbo-plus|\
45 etisalat,s3|\
46 rostelecom,rt-sf-1)
47 ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
48 ;;
49 beeline,smartbox-pro|\
50 tplink,ec330-g5u-v1|\
51 wifire,s1500-nbn)
52 idx="$(find_mtd_index u-boot-env)"
53 [ -n "$idx" ] && \
54 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
55 ;;
56 buffalo,wsr-1166dhp|\
57 buffalo,wsr-600dhp|\
58 kroks,kndrt31r16|\
59 kroks,kndrt31r19|\
60 mediatek,linkit-smart-7688|\
61 samknows,whitebox-v8|\
62 xiaomi,mi-router-4c|\
63 xiaomi,miwifi-nano|\
64 zbtlink,zbt-wg2626|\
65 zte,mf283plus)
66 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
67 ;;
68 asus,rt-ax53u|\
69 asus,rt-ax54|\
70 belkin,rt1800|\
71 h3c,tx1800-plus|\
72 h3c,tx1801-plus|\
73 h3c,tx1806|\
74 jcg,q20|\
75 linksys,e7350|\
76 netgear,eax12|\
77 netgear,wax202|\
78 zyxel,wsm20)
79 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
80 ;;
81 haier,har-20s2u1|\
82 sim,simax1800t)
83 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
84 ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
85 ;;
86 hootoo,ht-tm05|\
87 ravpower,rp-wd03)
88 idx="$(find_mtd_index u-boot-env)"
89 [ -n "$idx" ] && \
90 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
91 ;;
92 beeline,smartbox-flash|\
93 linksys,ea6350-v4|\
94 linksys,ea7300-v1|\
95 linksys,ea7300-v2|\
96 linksys,ea7500-v2|\
97 linksys,ea8100-v1|\
98 linksys,ea8100-v2|\
99 mts,wg430223)
100 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
101 ;;
102 snr,snr-cpe-me1|\
103 snr,snr-cpe-me2-sfp|\
104 snr,cpe-w4n-mt)
105 idx="$(find_mtd_index uboot-env)"
106 [ -n "$idx" ] && \
107 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
108 ;;
109 xiaomi,miwifi-mini)
110 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
111 ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
112 ;;
113 xiaomi,mi-router-3g-v2|\
114 xiaomi,mi-router-4a-gigabit|\
115 xiaomi,miwifi-3c)
116 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
117 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
118 ;;
119 xiaomi,mi-router-3g|\
120 xiaomi,mi-router-3-pro|\
121 xiaomi,mi-router-4|\
122 xiaomi,mi-router-ac2100|\
123 xiaomi,redmi-router-ac2100)
124 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
125 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
126 ;;
127 zyxel,lte3301-plus)
128 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
129 ;;
130 zyxel,nr7101)
131 idx="$(find_mtd_index Config)"
132 [ -n "$idx" ] && \
133 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
134 ;;
135 bolt,arion|\
136 xiaomi,mi-router-cr6606|\
137 xiaomi,mi-router-cr6608|\
138 xiaomi,mi-router-cr6609)
139 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
140 ;;
141 esac
142
143 config_load ubootenv
144 config_foreach ubootenv_add_app_config
145
146 exit 0