imx6: use device-tree compatible for board name
[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 gw,imx6dl-gw51xx |\
18 gw,imx6dl-gw52xx |\
19 gw,imx6dl-gw53xx |\
20 gw,imx6dl-gw54xx |\
21 gw,imx6dl-gw551x |\
22 gw,imx6dl-gw552x |\
23 gw,imx6dl-gw553x |\
24 gw,imx6dl-gw5904 |\
25 gw,imx6dl-gw5907 |\
26 gw,imx6dl-gw5910 |\
27 gw,imx6dl-gw5912 |\
28 gw,imx6dl-gw5913 |\
29 gw,imx6q-gw51xx |\
30 gw,imx6q-gw52xx |\
31 gw,imx6q-gw53xx |\
32 gw,imx6q-gw5400-a |\
33 gw,imx6q-gw54xx |\
34 gw,imx6q-gw551x |\
35 gw,imx6q-gw552x |\
36 gw,imx6q-gw553x |\
37 gw,imx6q-gw5904 |\
38 gw,imx6q-gw5907 |\
39 gw,imx6q-gw5910 |\
40 gw,imx6q-gw5912 |\
41 gw,imx6q-gw5913 )
42 if [ -c /dev/mtd1 ]; then
43 # board boots from NAND
44 ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000
45 ubootenv_add_uci_config /dev/mtd1 0x80000 0x20000 0x40000
46 else
47 # board boots from microSD
48 ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x20000
49 ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000
50 fi
51 ;;
52 toradex,apalis_imx6q-eval |\
53 toradex,apalis_imx6q-ixora |\
54 toradex,apalis_imx6q-ixora-v1.1 )
55 ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
56 ;;
57 wand,imx6dl-wandboard)
58 ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
59 ;;
60 esac
61
62 config_load ubootenv
63 config_foreach ubootenv_add_app_config ubootenv
64
65 exit 0