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