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