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