fb05f13346dc9a74d62208ee36f55807f367ab40
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / imx6
1 #!/bin/sh
2 #
3 # Copyright (C) 2013-2014 OpenWrt.org
4 #
5
6 [ -e /etc/config/ubootenv ] && exit 0
7
8 touch /etc/config/ubootenv
9
10 . /lib/imx6.sh
11 . /lib/uboot-envtools.sh
12 . /lib/functions.sh
13
14 board=$(board_name)
15
16 case "$board" in
17 apalis*)
18 ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
19 ;;
20 *gw5*)
21 if [ -c /dev/mtd1 ]; then
22 # board boots from NAND
23 ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000
24 ubootenv_add_uci_config /dev/mtd1 0x80000 0x20000 0x40000
25 else
26 # board boots from microSD
27 ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x20000 0x20000
28 ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 0x20000
29 fi
30 ;;
31 wandboard)
32 ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
33 ;;
34 esac
35
36 config_load ubootenv
37 config_foreach ubootenv_add_app_config ubootenv
38
39 exit 0