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