uboot-envtools: add u-boot env config for Xiaomi mi-mini
[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 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 beeline,smartbox-pro|\
49 tplink,ec330-g5u-v1|\
50 wifire,s1500-nbn)
51 idx="$(find_mtd_index u-boot-env)"
52 [ -n "$idx" ] && \
53 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
54 ;;
55 buffalo,wsr-1166dhp|\
56 buffalo,wsr-600dhp|\
57 kroks,kndrt31r16|\
58 kroks,kndrt31r19|\
59 mediatek,linkit-smart-7688|\
60 samknows,whitebox-v8|\
61 xiaomi,mi-router-4c|\
62 xiaomi,miwifi-nano|\
63 zbtlink,zbt-wg2626|\
64 zte,mf283plus)
65 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
66 ;;
67 asus,rt-ax53u|\
68 asus,rt-ax54|\
69 belkin,rt1800|\
70 h3c,tx1800-plus|\
71 h3c,tx1801-plus|\
72 h3c,tx1806|\
73 jcg,q20|\
74 linksys,e7350|\
75 netgear,eax12|\
76 netgear,wax202|\
77 zyxel,wsm20)
78 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
79 ;;
80 haier,har-20s2u1|\
81 sim,simax1800t)
82 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
83 ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
84 ;;
85 hootoo,ht-tm05|\
86 ravpower,rp-wd03)
87 idx="$(find_mtd_index u-boot-env)"
88 [ -n "$idx" ] && \
89 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
90 ;;
91 beeline,smartbox-flash|\
92 linksys,ea6350-v4|\
93 linksys,ea7300-v1|\
94 linksys,ea7300-v2|\
95 linksys,ea7500-v2|\
96 linksys,ea8100-v1|\
97 linksys,ea8100-v2|\
98 mts,wg430223)
99 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
100 ;;
101 snr,snr-cpe-me1|\
102 snr,snr-cpe-me2-sfp|\
103 snr,cpe-w4n-mt)
104 idx="$(find_mtd_index uboot-env)"
105 [ -n "$idx" ] && \
106 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
107 ;;
108 xiaomi,miwifi-mini)
109 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
110 ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
111 ;;
112 xiaomi,mi-router-3g-v2|\
113 xiaomi,mi-router-4a-gigabit|\
114 xiaomi,miwifi-3c)
115 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
116 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
117 ;;
118 xiaomi,mi-router-3g|\
119 xiaomi,mi-router-3-pro|\
120 xiaomi,mi-router-4|\
121 xiaomi,mi-router-ac2100|\
122 xiaomi,redmi-router-ac2100)
123 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
124 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
125 ;;
126 zyxel,lte3301-plus)
127 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
128 ;;
129 zyxel,nr7101)
130 idx="$(find_mtd_index Config)"
131 [ -n "$idx" ] && \
132 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
133 ;;
134 bolt,arion|\
135 xiaomi,mi-router-cr6606|\
136 xiaomi,mi-router-cr6608|\
137 xiaomi,mi-router-cr6609)
138 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
139 ;;
140 esac
141
142 config_load ubootenv
143 config_foreach ubootenv_add_app_config
144
145 exit 0