ipq40xx: add support for Linksys WHW01 v1
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / mvebu
1 #
2 # Copyright (C) 2014-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-Project.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 buffalo,ls421de)
17 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
18 ;;
19 cznic,turris-omnia)
20 idx="$(find_mtd_index u-boot-env)"
21 if [ -n "$idx" ]; then
22 ubootenv_add_uci_config "/dev/mtd${idx}" "0x0" "0x10000" "0x10000"
23 elif grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
24 ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
25 else
26 ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
27 fi
28 ;;
29 glinet,gl-mv1000)
30 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
31 ;;
32 globalscale,espressobin|\
33 globalscale,espressobin-emmc|\
34 globalscale,espressobin-ultra|\
35 globalscale,espressobin-v7|\
36 globalscale,espressobin-v7-emmc|\
37 globalscale,mochabin)
38 idx="$(find_mtd_index u-boot-env)"
39 if [ -n "$idx" ]; then
40 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
41 else
42 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
43 fi
44 ;;
45 marvell,armada8040-mcbin-doubleshot|\
46 marvell,armada8040-mcbin-singleshot)
47 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
48 ;;
49 linksys,wrt1200ac|\
50 linksys,wrt1900ac-v2|\
51 linksys,wrt1900acs)
52 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
53 ;;
54 linksys,wrt1900ac-v1)
55 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
56 ;;
57 linksys,wrt3200acm|\
58 linksys,wrt32x)
59 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
60 ;;
61 methode,udpu)
62 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
63 ;;
64 esac
65
66 config_load ubootenv
67 config_foreach ubootenv_add_app_config ubootenv
68
69 exit 0