ramips: Add support for RT5350F-OLinuXino V2
[15.05/openwrt.git] / target / linux / ramips / base-files / lib / ramips.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2010-2013 OpenWrt.org
4 #
5
6 RAMIPS_BOARD_NAME=
7 RAMIPS_MODEL=
8
9 ramips_board_detect() {
10         local machine
11         local name
12
13         machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
14
15         case "$machine" in
16         *"7Links PX-4885")
17                 name="px4885"
18                 ;;
19         *"8devices Carambola")
20                 name="carambola"
21                 ;;
22         *"Edimax 3g-6200n")
23                 name="3g-6200n"
24                 ;;
25         *"Edimax 3g-6200nl")
26                 name="3g-6200nl"
27                 ;;
28         *"A5-V11")
29                 name="a5-v11"
30                 ;;
31         *"Aigale Ai-BR100")
32                 name="ai-br100"
33                 ;;
34         *"Airlink101 AR670W")
35                 name="ar670w"
36                 ;;
37         *"Airlink101 AR725W")
38                 name="ar725w"
39                 ;;
40         *"AirLive Air3GII")
41                 name="air3gii"
42                 ;;
43         *"Edimax BR-6425")
44                 name="br6425"
45                 ;;
46         *"Allnet ALL0239-3G")
47                 name="all0239-3g"
48                 ;;
49         *"Allnet ALL0256N")
50                 name="all0256n"
51                 ;;
52         *"Allnet ALL5002")
53                 name="all5002"
54                 ;;
55         *"Allnet ALL5003")
56                 name="all5003"
57                 ;;
58         *"ARC FreeStation5")
59                 name="freestation5"
60                 ;;
61         *"Archer C20i")
62                 name="c20i"
63                 ;;
64         *"Argus ATP-52B")
65                 name="argus-atp52b"
66                 ;;
67         *"AsiaRF AWM002 EVB")
68                 name="awm002-evb"
69                 ;;
70         *"AsiaRF AWM003 EVB")
71                 name="awm003-evb"
72                 ;;
73         *"AsiaRF AWAPN2403")
74                 name="awapn2403"
75                 ;;
76         *"Asus WL-330N")
77                 name="wl-330n"
78                 ;;
79         *"Asus WL-330N3G")
80                 name="wl-330n3g"
81                 ;;
82         *"Alpha ASL26555")
83                 name="asl26555"
84                 ;;
85         *"Aztech HW550-3G")
86                 name="hw550-3g"
87                 ;;
88         *"AXIMCom MR-102N")
89                 name="mr-102n"
90                 ;;
91         *"Buffalo WSR-600DHP")
92                 name="wsr-600"
93                 ;;
94         *"Buffalo WSR-1166DHP")
95                 name="wsr-1166"
96                 ;;
97         *"Comfast CF-WR800N")
98                 name="cf-wr800n"
99                 ;;
100         *"Firefly FireWRT")
101                 name="firewrt"
102                 ;;
103         *"CY-SWR1100")
104                 name="cy-swr1100"
105                 ;;
106         *"DCS-930")
107                 name="dcs-930"
108                 ;;
109         *"DIR-300 B1")
110                 name="dir-300-b1"
111                 ;;
112         *"DIR-300 B7")
113                 name="dir-300-b7"
114                 ;;
115         *"DIR-320 B1")
116                 name="dir-320-b1"
117                 ;;
118         *"DIR-600 B1")
119                 name="dir-600-b1"
120                 ;;
121         *"DIR-600 B2")
122                 name="dir-600-b2"
123                 ;;
124         *"DIR-610 A1")
125                 name="dir-610-a1"
126                 ;;
127         *"DIR-620 A1")
128                 name="dir-620-a1"
129                 ;;
130         *"DIR-620 D1")
131                 name="dir-620-d1"
132                 ;;
133         *"DIR-615 H1")
134                 name="dir-615-h1"
135                 ;;
136         *"DIR-615 D")
137                 name="dir-615-d"
138                 ;;
139         *"DIR-645")
140                 name="dir-645"
141                 ;;
142         *"DIR-810L")
143                 name="dir-810l"
144                 ;;
145         *"DIR-860L B1")
146                 name="dir-860l-b1"
147                 ;;
148         *"DAP-1350")
149                 name="dap-1350"
150                 ;;
151         *"ESR-9753")
152                 name="esr-9753"
153                 ;;
154         *"EASYACC WI-STOR WIZARD 8800")
155                 name="wizard8800"
156                 ;;
157         *"Edimax BR-6475nD")
158                 name="br-6475nd"
159                 ;;
160         *"F7C027")
161                 name="f7c027"
162                 ;;
163         *"F5D8235 v1")
164                 name="f5d8235-v1"
165                 ;;
166         *"F5D8235 v2")
167                 name="f5d8235-v2"
168                 ;;
169         *"Hauppauge Broadway")
170                 name="broadway"
171                 ;;
172         *"Huawei D105")
173                 name="d105"
174                 ;;
175         *"La Fonera 2.0N")
176                 name="fonera20n"
177                 ;;
178         *"Asus RT-N14U")
179                 name="rt-n14u"
180                 ;;
181         *"Asus RT-N13U")
182                 name="rt-n13u"
183                 ;;
184         *"MoFi Network MOFI3500-3GN")
185                 name="mofi3500-3gn"
186                 ;;
187         *"HILINK HLK-RM04")
188                 name="hlk-rm04"
189                 ;;
190         *"HooToo HT-TM02")
191                 name="ht-tm02"
192                 ;;
193         *"HAME MPR-A1")
194                 name="mpr-a1"
195                 ;;
196         *"HAME MPR-A2")
197                 name="mpr-a2"
198                 ;;
199         *"Kingston MLW221")
200                 name="mlw221"
201                 ;;
202         *"Kingston MLWG2")
203                 name="mlwg2"
204                 ;;
205         *"Linksys E1700")
206                 name="e1700"
207                 ;;
208         *"Planex MZK-750DHP")
209                 name="mzk-750dhp"
210                 ;;
211         *"Microduino MicroWRT")
212                 name="microwrt"
213                 ;;
214         *"NBG-419N")
215                 name="nbg-419n"
216                 ;;
217         *"Netgear WNCE2001")
218                 name="wnce2001"
219                 ;;
220         *"NexAira BC2")
221                 name="bc2"
222                 ;;
223         *"Nexx WT1520")
224                 name="wt1520"
225                 ;;
226         *"Nexx WT3020")
227                 name="wt3020"
228                 ;;
229         *"NW718")
230                 name="nw718"
231                 ;;
232         *"Intenso Memory 2 Move")
233                 name="m2m"
234                 ;;
235         *"Omnima EMB HPM")
236                 name="omni-emb-hpm"
237                 ;;
238         *"Omnima MiniEMBWiFi")
239                 name="omni-emb"
240                 ;;
241         *"Omnima MiniPlug")
242                 name="omni-plug"
243                 ;;
244         *"OLinuXino-RT5350F")
245                 name="olinuxino-rt5350f"
246                 ;;
247         *"OLinuXino-RT5350F-EVB")
248                 name="olinuxino-rt5350f-evb"
249                 ;;
250         *"Petatel PSR-680W"*)
251                 name="psr-680w"
252                 ;;
253         *"Planex MZK-W300NH2"*)
254                 name="mzk-w300nh2"
255                 ;;
256         *"Poray IP2202")
257                 name="ip2202"
258                 ;;
259         *"Poray M3")
260                 name="m3"
261                 ;;
262         *"Poray M4")
263                 name="m4"
264                 ;;
265         *"Poray X5")
266                 name="x5"
267                 ;;
268         *"Poray X8")
269                 name="x8"
270                 ;;
271         *"PWH2004")
272                 name="pwh2004"
273                 ;;
274         *"Asus RP-N53")
275                 name="rp-n53"
276                 ;;
277         *"Ralink MT7620a + MT7530 evaluation board")
278                 name="mt7620a_mt7530"
279                 ;;
280         *"RT-G32 B1")
281                 name="rt-g32-b1"
282                 ;;
283         *"RT-N10+")
284                 name="rt-n10-plus"
285                 ;;
286         *"RT-N15")
287                 name="rt-n15"
288                 ;;
289         *"RT-N56U")
290                 name="rt-n56u"
291                 ;;
292         *"RUT5XX")
293                 name="rut5xx"
294                 ;;
295         *"Skyline SL-R7205"*)
296                 name="sl-r7205"
297                 ;;
298         *"Sparklan WCR-150GN")
299                 name="wcr-150gn"
300                 ;;
301         *"V22RW-2X2")
302                 name="v22rw-2x2"
303                 ;;
304         *"VoCore")
305                 name="vocore"
306                 ;;
307         *"W502U")
308                 name="w502u"
309                 ;;
310         *"WMR-300")
311                 name="wmr300"
312                 ;;
313         *"WHR-300HP2")
314                 name="whr-300hp2"
315                 ;;
316         *"WHR-600D")
317                 name="whr-600d"
318                 ;;
319         *"WHR-1166D")
320                 name="whr-1166d"
321                 ;;
322         *"WHR-G300N")
323                 name="whr-g300n"
324                 ;;
325         *"Sitecom WL-341 v3")
326                 name="wl341v3"
327                 ;;
328         *"Sitecom WL-351 v1 002")
329                 name="wl-351"
330                 ;;
331         *"Tenda 3G300M")
332                 name="3g300m"
333                 ;;
334         *"Tenda 3G150B")
335                 name="3g150b"
336                 ;;
337         *"Tenda W306R V2.0")
338                 name="w306r-v20"
339                 ;;
340         *"Tenda W150M")
341                 name="w150m"
342                 ;;
343         *"TEW-691GR")
344                 name="tew-691gr"
345                 ;;
346         *"TEW-692GR")
347                 name="tew-692gr"
348                 ;;
349         *"Ralink V11ST-FE")
350                 name="v11st-fe"
351                 ;;
352         *"WLI-TX4-AG300N")
353                 name="wli-tx4-ag300n"
354                 ;;
355         *"WZR-AGL300NH")
356                 name="wzr-agl300nh"
357                 ;;
358         *"WR512-3GN-like router")
359                 name="wr512-3gn"
360                 ;;
361         *"UR-326N4G Wireless N router")
362                 name="ur-326n4g"
363                 ;;
364         *"UR-336UN Wireless N router")
365                 name="ur-336un"
366                 ;;
367         *"AWB WR6202")
368                 name="wr6202"
369                 ;;
370         *"XDX RN502J")
371                 name="xdxrn502j"
372                 ;;
373         *"HG255D")
374                 name="hg255d"
375                 ;;
376         *"V22SG")
377                 name="v22sg"
378                 ;;
379         *"WRTNODE")
380                 name="wrtnode"
381                 ;;
382         *"Wansview NCS601W")
383                 name="ncs601w"
384                 ;;
385         *"Xiaomi MiWiFi Mini")
386                 name="xiaomi-miwifi-mini"
387                 ;;
388         *"Sercomm NA930")
389                 name="na930"
390                 ;;
391         *"Zbtlink ZBT-WA05")
392                 name="zbt-wa05"
393                 ;;
394         *"ZBT WR8305RT")
395                 name="wr8305rt"
396                 ;;
397         *"ZTE Q7")
398                 name="zte-q7"
399                 ;;
400         *"Lenovo Y1")
401                 name="y1"
402                 ;;
403         *"Lenovo Y1S")
404                 name="y1s"
405                 ;;
406         *"Mediatek MT7621 evaluation board")
407                 name="mt7621"
408                 ;;
409         *"Mediatek MT7628AN evaluation board")
410                 name="mt7628"
411                 ;;
412         *)
413                 name="generic"
414                 ;;
415         esac
416
417         [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name"
418         [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine"
419
420         [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
421
422         echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name
423         echo "$RAMIPS_MODEL" > /tmp/sysinfo/model
424 }
425
426 ramips_board_name() {
427         local name
428
429         [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
430         [ -z "$name" ] && name="unknown"
431
432         echo "$name"
433 }