uboot-envtools: mvebu: update uci defaults for Turris Omnia
[librecmc/librecmc.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 globalscale,espressobin|\
25 globalscale,espressobin-emmc|\
26 globalscale,espressobin-v7|\
27 globalscale,espressobin-v7-emmc|\
28 marvell,armada8040-mcbin)
29         ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
30         ;;
31 linksys,caiman|\
32 linksys,cobra|\
33 linksys,shelby)
34         ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
35         ;;
36 linksys,mamba)
37         ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
38         ;;
39 linksys,rango|\
40 linksys,venom)
41         ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
42         ;;
43 esac
44
45 config_load ubootenv
46 config_foreach ubootenv_add_app_config ubootenv
47
48 exit 0