uboot-envtools: ath79: add support for ALFA Network N2Q
[openwrt/staging/chunkeey.git] / package / boot / uboot-envtools / files / ath79
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2014 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,ap121f|\
17 alfa-network,ap121fe|\
18 alfa-network,n2q|\
19 alfa-network,r36a|\
20 allnet,all-wap02860ac|\
21 arduino,yun|\
22 buffalo,bhr-4grv2|\
23 devolo,magic-2-wifi|\
24 engenius,ecb1750|\
25 engenius,enh202-v1|\
26 engenius,ens202ext-v1|\
27 etactica,eg200|\
28 glinet,gl-ar750s-nor|\
29 glinet,gl-ar750s-nor-nand|\
30 librerouter,librerouter-v1|\
31 netgear,ex6400|\
32 netgear,ex7300|\
33 netgear,wndr4300-v2|\
34 netgear,wndr4500-v3|\
35 netgear,wnr1000-v2|\
36 netgear,wnr2000-v3|\
37 netgear,wnr2200-8m|\
38 netgear,wnr2200-16m|\
39 netgear,wnr612-v2|\
40 ocedo,koala|\
41 ocedo,raccoon|\
42 openmesh,om5p-ac-v2|\
43 samsung,wam250|\
44 ubnt,nanostation-m|\
45 yuncore,a770|\
46 yuncore,a782|\
47 yuncore,xd4200|\
48 zyxel,nbg6616)
49 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
50 ;;
51 buffalo,wzr-hp-ag300h)
52 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
53 ;;
54 domywifi,dw33d)
55 ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000"
56 ;;
57 glinet,gl-ar150)
58 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
59 ;;
60 glinet,gl-ar300m-lite|\
61 glinet,gl-ar300m-nand|\
62 glinet,gl-ar300m-nor|\
63 glinet,gl-ar300m16)
64 idx="$(find_mtd_index u-boot-env)"
65 [ -n "$idx" ] && \
66 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
67 ;;
68 netgear,wndr3700|\
69 netgear,wndr3700-v2|\
70 netgear,wndrmac-v1)
71 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
72 ;;
73 netgear,wndr3700-v4|\
74 netgear,wndr4300|\
75 netgear,wndr4300tn|\
76 netgear,wndr4300sw)
77 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
78 ;;
79 qihoo,c301)
80 ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
81 ;;
82 wallys,dr531)
83 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
84 ;;
85 esac
86
87 config_load ubootenv
88 config_foreach ubootenv_add_app_config ubootenv
89
90 exit 0