sunxi: fix Lamobo R1 board detection
[openwrt/openwrt.git] / target / linux / sunxi / base-files / lib / sunxi.sh
1 #!/bin/sh
2
3 # defaults
4 SUNXI_BOARD_NAME="generic"
5 SUNXI_BOARD_MODEL="Generic sunxi board"
6
7 sunxi_board_detect() {
8 local board
9 local model
10
11 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
12
13 model="$( cat /proc/device-tree/model )"
14
15 case "$model" in
16 "Mele A1000")
17 board="a1000"
18 ;;
19
20 "BA10 tvbox")
21 board="ba10-tvbox"
22 ;;
23
24 "Cubietech Cubieboard")
25 board="cubieboard"
26 ;;
27
28 "Miniand Hackberry")
29 board="hackberry"
30 ;;
31
32 "INet-97F Rev 02")
33 board="inet97fv2"
34 ;;
35
36 "PineRiver Mini X-Plus")
37 board="mini-xplus"
38 ;;
39
40 "Olimex A10-OLinuXino-LIME")
41 board="olinuxino-lime"
42 ;;
43
44 "LinkSprite pcDuino")
45 board="pcduino"
46 ;;
47
48 "Olimex A10s-Olinuxino Micro")
49 board="olinuxino-micro"
50 ;;
51
52 "R7 A10s hdmi tv-stick")
53 board="r7-tv-dongle"
54 ;;
55
56 "HSG H702")
57 board="hsg-h702"
58 ;;
59
60 "Olimex A13-Olinuxino")
61 board="olinuxino"
62 ;;
63
64 "Olimex A13-Olinuxino Micro")
65 board="olinuxino-micro"
66 ;;
67
68 "Allwinner A31 APP4 EVB1 Evaluation Board")
69 board="app4-evb1"
70 ;;
71
72 "WITS A31 Colombus Evaluation Board")
73 board="colombus"
74 ;;
75
76 "Merrii A31 Hummingbird")
77 board="hummingbird"
78 ;;
79
80 "Mele M9 / A1000G Quad top set box")
81 board="m9"
82 ;;
83
84 "LeMaker Banana Pi")
85 board="bananapi"
86 ;;
87
88 "LeMaker Banana Pro")
89 board="bananapro"
90 ;;
91
92 "Cubietech Cubieboard2")
93 board="cubieboard2"
94 ;;
95
96 "Cubietech Cubietruck")
97 board="cubietruck"
98 ;;
99
100 "Merrii A20 Hummingbird")
101 board="hummingbird"
102 ;;
103
104 "I12 / Q5 / QT840A A20 tvbox")
105 board="i12-tvbox"
106 ;;
107
108 "Lamobo R1")
109 board="lamobo-r1"
110 ;;
111
112 "Olimex A20-OLinuXino-LIME")
113 board="olinuxino-lime"
114 ;;
115
116 "Olimex A20-Olinuxino Micro")
117 board="olinuxino-a20-micro"
118 ;;
119
120 "LinkSprite pcDuino3")
121 board="pcduino3"
122 ;;
123
124 "Ippo Q8H Dual Core Tablet (v5)")
125 board="ippo-q8h-v5"
126 ;;
127 esac
128
129 if [ "$board" != "" ]; then
130 SUNXI_BOARD_NAME="$board"
131 fi
132
133 if [ "$model" != "" ]; then
134 SUNXI_BOARD_MODEL="$model"
135 fi
136
137
138 echo "$SUNXI_BOARD_NAME" > /tmp/sysinfo/board_name
139 echo "$SUNXI_BOARD_MODEL" > /tmp/sysinfo/model
140 echo "Detected $SUNXI_BOARD_NAME // $SUNXI_BOARD_MODEL"
141 }
142
143 sunxi_board_name() {
144 local name
145
146 [ -f /tmp/sysinfo/board_name ] && name="$(cat /tmp/sysinfo/board_name)"
147 [ -z "$name" ] && name="unknown"
148
149 echo "$name"
150 }