mvebu: add initial support for Globalscale ESPRESSObin-Ultra
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / mvebu
1 #!/bin/sh
2 #
3 # Copyright (C) 2014-2016 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
5 #
6
7 [ -e /etc/config/ubootenv ] && exit 0
8
9 touch /etc/config/ubootenv
10
11 . /lib/uboot-envtools.sh
12 . /lib/functions.sh
13
14 board=$(board_name)
15
16 case "$board" in
17 cznic,turris-omnia)
18 if grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
19 ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
20 else
21 ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
22 fi
23 ;;
24 glinet,gl-mv1000)
25 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
26 ;;
27 globalscale,espressobin|\
28 globalscale,espressobin-emmc|\
29 globalscale,espressobin-ultra|\
30 globalscale,espressobin-v7|\
31 globalscale,espressobin-v7-emmc)
32 idx="$(find_mtd_index u-boot-env)"
33 if [ -n "$idx" ]; then
34 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
35 else
36 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
37 fi
38 ;;
39 marvell,armada8040-mcbin-doubleshot|\
40 marvell,armada8040-mcbin-singleshot)
41 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
42 ;;
43 linksys,wrt1200ac|\
44 linksys,wrt1900ac-v2|\
45 linksys,wrt1900acs)
46 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
47 ;;
48 linksys,wrt1900ac-v1)
49 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
50 ;;
51 linksys,wrt3200acm|\
52 linksys,wrt32x)
53 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
54 ;;
55 methode,udpu)
56 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
57 ;;
58 esac
59
60 config_load ubootenv
61 config_foreach ubootenv_add_app_config ubootenv
62
63 exit 0