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