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