3f36cd6d6822131f5e51726988119cfe49ddd8dd
[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 allnet,all0256n-4m|\
25 allnet,all0256n-8m|\
26 allnet,all5002|\
27 yuncore,ax820)
28 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
29 ;;
30 ampedwireless,ally-00x19k|\
31 ampedwireless,ally-r1900k)
32 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
33 ;;
34 beeline,smartbox-giga|\
35 beeline,smartbox-turbo)
36 ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
37 ;;
38 buffalo,wsr-1166dhp|\
39 buffalo,wsr-600dhp|\
40 kroks,kndrt31r16|\
41 kroks,kndrt31r19|\
42 mediatek,linkit-smart-7688|\
43 samknows,whitebox-v8|\
44 xiaomi,mi-router-4c|\
45 xiaomi,miwifi-nano|\
46 zbtlink,zbt-wg2626|\
47 zte,mf283plus)
48 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
49 ;;
50 h3c,tx1800-plus|\
51 h3c,tx1801-plus|\
52 h3c,tx1806|\
53 jcg,q20|\
54 netgear,wax202)
55 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
56 ;;
57 hootoo,ht-tm05|\
58 ravpower,rp-wd03)
59 idx="$(find_mtd_index u-boot-env)"
60 [ -n "$idx" ] && \
61 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
62 ;;
63 beeline,smartbox-flash|\
64 linksys,ea6350-v4|\
65 linksys,ea7300-v1|\
66 linksys,ea7300-v2|\
67 linksys,ea7500-v2|\
68 linksys,ea8100-v1|\
69 linksys,ea8100-v2|\
70 mts,wg430223)
71 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
72 ;;
73 xiaomi,mi-router-3g-v2|\
74 xiaomi,mi-router-4a-gigabit|\
75 xiaomi,miwifi-3c)
76 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
77 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
78 ;;
79 xiaomi,mi-router-3g|\
80 xiaomi,mi-router-3-pro|\
81 xiaomi,mi-router-4|\
82 xiaomi,mi-router-ac2100|\
83 xiaomi,redmi-router-ac2100)
84 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
85 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
86 ;;
87 zyxel,lte3301-plus)
88 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
89 ;;
90 zyxel,nr7101)
91 idx="$(find_mtd_index Config)"
92 [ -n "$idx" ] && \
93 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
94 ;;
95 bolt,arion|\
96 xiaomi,mi-router-cr6606|\
97 xiaomi,mi-router-cr6608|\
98 xiaomi,mi-router-cr6609)
99 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
100 ;;
101 esac
102
103 config_load ubootenv
104 config_foreach ubootenv_add_app_config
105
106 exit 0