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