6a0256c568d586582036c50ad6ac0655b6f8f313
[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,snr-cpe-me2-sfp|\
89 snr,cpe-w4n-mt)
90 idx="$(find_mtd_index uboot-env)"
91 [ -n "$idx" ] && \
92 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
93 ;;
94 tplink,ec330-g5u-v1)
95 idx="$(find_mtd_index u-boot-env)"
96 [ -n "$idx" ] && \
97 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
98 ;;
99 xiaomi,mi-router-3g-v2|\
100 xiaomi,mi-router-4a-gigabit|\
101 xiaomi,miwifi-3c)
102 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
103 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
104 ;;
105 xiaomi,mi-router-3g|\
106 xiaomi,mi-router-3-pro|\
107 xiaomi,mi-router-4|\
108 xiaomi,mi-router-ac2100|\
109 xiaomi,redmi-router-ac2100)
110 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
111 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
112 ;;
113 zyxel,lte3301-plus)
114 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
115 ;;
116 zyxel,nr7101)
117 idx="$(find_mtd_index Config)"
118 [ -n "$idx" ] && \
119 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
120 ;;
121 bolt,arion|\
122 xiaomi,mi-router-cr6606|\
123 xiaomi,mi-router-cr6608|\
124 xiaomi,mi-router-cr6609)
125 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
126 ;;
127 esac
128
129 config_load ubootenv
130 config_foreach ubootenv_add_app_config
131
132 exit 0