imx6: Initial support for SolidRun CuBox-i devices based on i.MX6 processors (i1...
[openwrt/openwrt.git] / target / linux / imx6 / base-files / lib / imx6.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2010-2013 OpenWrt.org
4 #
5
6 IMX6_BOARD_NAME=
7 IMX6_MODEL=
8
9 imx6_board_detect() {
10 local machine
11 local name
12
13 machine=$(cat /proc/device-tree/model)
14
15 case "$machine" in
16 "Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\
17 "Gateworks Ventana i.MX6 Dual/Quad GW51XX")
18 name="gw51xx"
19 ;;
20
21 "Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\
22 "Gateworks Ventana i.MX6 Dual/Quad GW52XX")
23 name="gw52xx"
24 ;;
25
26 "Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\
27 "Gateworks Ventana i.MX6 Dual/Quad GW53XX")
28 name="gw53xx"
29 ;;
30
31 "Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\
32 "Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\
33 "Gateworks Ventana GW5400-A")
34 name="gw54xx"
35 ;;
36
37 "Gateworks Ventana i.MX6 Dual/Quad GW551X" |\
38 "Gateworks Ventana i.MX6 DualLite/Solo GW551X")
39 name="gw551x"
40 ;;
41
42 "Gateworks Ventana i.MX6 DualLite/Solo GW552X" |\
43 "Gateworks Ventana i.MX6 Dual/Quad GW552X")
44 name="gw552x"
45 ;;
46
47 "Gateworks Ventana i.MX6 DualLite/Solo GW553X" |\
48 "Gateworks Ventana i.MX6 Dual/Quad GW553X")
49 name="gw553x"
50 ;;
51
52 "Gateworks Ventana i.MX6 DualLite/Solo GW5904" |\
53 "Gateworks Ventana i.MX6 Dual/Quad GW5904")
54 name="gw5904"
55 ;;
56
57 "SolidRun Cubox-i Solo/DualLite" |\
58 "SolidRun Cubox-i Dual/Quad")
59 name="cubox-i"
60 ;;
61
62 "Wandboard i.MX6 Dual Lite Board")
63 name="wandboard"
64 ;;
65
66 *)
67 name="generic"
68 ;;
69 esac
70
71 [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name"
72 [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine"
73
74 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
75
76 echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name
77 echo "$IMX6_MODEL" > /tmp/sysinfo/model
78 }