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