uboot-envtools: mvebu: update uci defaults for Turris Omnia
[openwrt/staging/jow.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 idx="$(find_mtd_index u-boot-env)"
38 if [ -n "$idx" ]; then
39 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
40 else
41 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
42 fi
43 ;;
44 marvell,armada8040-mcbin-doubleshot|\
45 marvell,armada8040-mcbin-singleshot)
46 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
47 ;;
48 linksys,wrt1200ac|\
49 linksys,wrt1900ac-v2|\
50 linksys,wrt1900acs)
51 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
52 ;;
53 linksys,wrt1900ac-v1)
54 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
55 ;;
56 linksys,wrt3200acm|\
57 linksys,wrt32x)
58 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
59 ;;
60 methode,udpu)
61 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
62 ;;
63 esac
64
65 config_load ubootenv
66 config_foreach ubootenv_add_app_config ubootenv
67
68 exit 0