7b348ddc9bb1b9e4d45dd3edac92f1091e2b53cb
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / ar71xx
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/ar71xx.sh
11 . /lib/uboot-envtools.sh
12 . /lib/functions.sh
13
14 board=$(ar71xx_board_name)
15
16 case "$board" in
17 a40|\
18 a60|\
19 alfa-ap120c|\
20 all0258n|\
21 ap90q|\
22 cap324|\
23 cap4200ag|\
24 carambola2|\
25 cpe830|\
26 cpe870|\
27 cr3000|\
28 cr5000|\
29 eap300v2|\
30 gl-ar300m|\
31 hornet-ub|\
32 hornet-ub-x2|\
33 jwap230|\
34 mr1750|\
35 mr1750v2|\
36 mr600|\
37 mr600v2|\
38 mr900|\
39 mr900v2|\
40 nbg6716|\
41 om5p|\
42 om5p-ac|\
43 om5p-acv2|\
44 om5p-an|\
45 sr3200|\
46 tube2h|\
47 wndr3700|\
48 xd3200)
49 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
50 ;;
51 alfa-ap96|\
52 all0315n|\
53 om2p|\
54 om2p-hs|\
55 om2p-hsv2|\
56 om2p-hsv3|\
57 om2p-hsv4|\
58 om2p-lc|\
59 om2pv2|\
60 om2pv4)
61 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
62 ;;
63 dap-2695-a1|\
64 wzr-hp-ag300h)
65 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
66 ;;
67 dr531)
68 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
69 ;;
70 rambutan)
71 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
72 ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000"
73 ;;
74 qihoo-c301)
75 ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
76 ;;
77 esac
78
79 config_load ubootenv
80 config_foreach ubootenv_add_app_config ubootenv
81
82 exit 0