mvebu: add support for WRT32X (venom)
[openwrt/openwrt.git] / target / linux / mvebu / base-files / lib / mvebu.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2013-2015 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
5 #
6
7 MVEBU_BOARD_NAME=
8 MVEBU_MODEL=
9
10 mvebu_board_detect() {
11 local machine
12 local name
13
14 machine=$(cat /proc/device-tree/model)
15
16 case "$machine" in
17 *"Marvell Armada 370 Evaluation Board")
18 name="armada-370-db"
19 ;;
20 *"Globalscale Marvell ESPRESSOBin Board")
21 name="globalscale,espressobin"
22 ;;
23 *"Marvell 8040 MACHIATOBin")
24 name="marvell,armada8040-mcbin"
25 ;;
26 *"Globalscale Mirabox")
27 name="mirabox"
28 ;;
29 *"Marvell Armada 370 Reference Design")
30 name="armada-370-rd"
31 ;;
32 *"Marvell Armada XP Evaluation Board")
33 name="armada-xp-db"
34 ;;
35 *"PlatHome OpenBlocks AX3-4 board")
36 name="openblocks-ax3-4"
37 ;;
38 *"Marvell Armada XP GP Board")
39 name="armada-xp-gp"
40 ;;
41 *"Linksys WRT1200AC")
42 name="armada-385-linksys-caiman"
43 ;;
44 *"Linksys WRT1900AC")
45 name="armada-xp-linksys-mamba"
46 ;;
47 *"Linksys WRT1900ACv2")
48 name="armada-385-linksys-cobra"
49 ;;
50 *"Linksys WRT1900ACS")
51 name="armada-385-linksys-shelby"
52 ;;
53 *"Linksys WRT3200ACM")
54 name="armada-385-linksys-rango"
55 ;;
56 *"Linksys WRT32X")
57 name="armada-385-linksys-venom"
58 ;;
59 *"Marvell Armada 385 Access Point Development Board")
60 name="armada-385-db-ap"
61 ;;
62 *"Marvell Armada XP Development Board DB-MV784MP-GP")
63 name="armada-xp-gp"
64 ;;
65 *"SolidRun Clearfog Pro A1")
66 name="armada-388-clearfog-pro"
67 ;;
68 *"SolidRun Clearfog Base A1")
69 name="armada-388-clearfog-base"
70 ;;
71 *"Turris Omnia")
72 name="armada-385-turris-omnia"
73 ;;
74 esac
75
76 [ -z "$name" ] && name="unknown"
77
78 [ -z "$MVEBU_BOARD_NAME" ] && MVEBU_BOARD_NAME="$name"
79 [ -z "$MVEBU_MODEL" ] && MVEBU_MODEL="$machine"
80
81 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
82
83 echo "$MVEBU_BOARD_NAME" > /tmp/sysinfo/board_name
84 echo "$MVEBU_MODEL" > /tmp/sysinfo/model
85 }