ramips: add support for YunCore AX820/HWAP-AX820
[openwrt/staging/hauke.git] / package / boot / uboot-envtools / files / ramips
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2012 OpenWrt.org
4 #
5
6 [ -e /etc/config/ubootenv ] && exit 0
7
8 touch /etc/config/ubootenv
9
10 . /lib/uboot-envtools.sh
11 . /lib/functions.sh
12
13 board=$(board_name)
14
15 case "$board" in
16 alfa-network,ac1200rm|\
17 alfa-network,awusfree1|\
18 alfa-network,quad-e4g|\
19 alfa-network,r36m-e4g|\
20 alfa-network,tube-e4g|\
21 engenius,esr600h|\
22 sitecom,wlr-4100-v1-002)
23 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
24 ;;
25 allnet,all0256n-4m|\
26 allnet,all0256n-8m|\
27 allnet,all5002|\
28 yuncore,ax820)
29 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
30 ;;
31 ampedwireless,ally-00x19k|\
32 ampedwireless,ally-r1900k)
33 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
34 ;;
35 buffalo,wsr-1166dhp|\
36 buffalo,wsr-600dhp|\
37 mediatek,linkit-smart-7688|\
38 samknows,whitebox-v8|\
39 xiaomi,mi-router-3g-v2|\
40 xiaomi,mi-router-4a-gigabit|\
41 xiaomi,mi-router-4c|\
42 xiaomi,miwifi-nano|\
43 zbtlink,zbt-wg2626|\
44 zte,mf283plus)
45 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
46 ;;
47 hootoo,ht-tm05|\
48 ravpower,rp-wd03)
49 idx="$(find_mtd_index u-boot-env)"
50 [ -n "$idx" ] && \
51 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
52 ;;
53 jcg,q20)
54 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
55 ;;
56 linksys,ea7300-v1|\
57 linksys,ea7300-v2|\
58 linksys,ea7500-v2|\
59 linksys,ea8100-v1|\
60 xiaomi,mi-router-3g|\
61 xiaomi,mi-router-3-pro|\
62 xiaomi,mi-router-4|\
63 xiaomi,mi-router-ac2100|\
64 xiaomi,redmi-router-ac2100)
65 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
66 ;;
67 zyxel,nr7101)
68 idx="$(find_mtd_index Config)"
69 [ -n "$idx" ] && \
70 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
71 ;;
72 esac
73
74 config_load ubootenv
75 config_foreach ubootenv_add_app_config ubootenv
76
77 exit 0