blob: d780eb40988a056c43554a9b6aeabf67304daca5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
|
#!/bin/sh
#
# Copyright (C) 2007 OpenWrt.org
#
#
board_id=""
status_led=""
status_led2=""
sys_mtd_part=""
brcm63xx_has_reset_button=""
ifname=""
brcm63xx_dt_detect() {
local board_name
case "$1" in
"ADB P.DG A4001N")
board_name="a4001n"
;;
"ADB P.DG A4001N1")
board_name="a4001n1"
;;
"Alcatel RG100A")
board_name="rg100a"
;;
"ASMAX AR 1004g")
board_name="ar100g"
;;
"Belkin F5D7633")
board_name="f5d7633"
;;
"Broadcom 96348R reference board")
board_name="bcm96348r"
;;
"Broadcom bcm963281TAN reference board")
board_name="bcm963281tan"
;;
"Broadcom BCM96328avng reference board")
board_name="bcm6328avng"
;;
"Broadcom BCM96345GW2 reference board")
board_name="bcm96345gw2"
;;
"Broadcom BCM96348GW-10 reference board")
board_name="bcm96348gw-10"
;;
"Broadcom BCM96348GW-11 reference board")
board_name="bcm96348gw-11"
;;
"Broadcom BCM96348GW reference board")
board_name="bcm96358gw"
;;
"Broadcom BCM96358VW reference board")
board_name="bcm96358vw"
;;
"Broadcom BCM96358VW2 reference board")
board_name="bcm96358vw2"
;;
"Broadcom BCM96368MVNgr reference board")
board_name="bcm96368mvngr"
;;
"Broadcom BCM96368MVWG reference board")
board_name="bcm96368mvwg"
;;
"BT Voyager V2500V")
board_name="v2500v"
;;
"Comtrend AR-5381u")
board_name="ar-5381u"
;;
"Comtrend AR-5387un")
board_name="ar-5387un"
;;
"Comtrend CT-5365")
board_name="ct-5365"
;;
"Comtrend CT-536+/CT-5621T")
board_name="ct-536p_5621t"
;;
"Comtrend CT-6373")
board_name="ct-6373"
;;
"Comtrend VR-3025u")
board_name="vr-3025u"
;;
"Comtrend VR-3025un")
board_name="vr-3025un"
;;
"Comtrend WAP-5813n")
board_name="wap-5813n"
;;
"Davolink DV-201AMR")
board_name="dv-201amr"
;;
"D-Link DSL-2640B rev B2")
board_name="dsl-2640b-b"
;;
"D-Link DSL-2650U")
board_name="dsl-2650u"
;;
"D-Link DSL-2740B/DSL-2741B rev C2/3")
board_name="dsl-274xb-c"
;;
"D-Link DSL-2740B/DSL-2741B rev F1")
board_name="dsl-274xb-f"
;;
"D-Link DVA-G3810BN/TL")
board_name="dva-g3810bn"
;;
"Dynalink RTA1025W")
board_name="rta1025w"
;;
"Dynalink RTA1320")
board_name="rta1320"
;;
"Huawei EchoLife HG520v")
board_name="hg520v"
;;
"Huawei EchoLife HG553")
board_name="hg553"
;;
"Huawei EchoLife HG556a (version A)")
board_name="hg556a_a"
;;
"Huawei EchoLife HG556a (version B)")
board_name="hg556a_b"
;;
"Huawei EchoLife HG556a (version C)")
board_name="hg556a_c"
;;
"Inventel Livebox 1")
board_name="livebox1"
;;
"Netgear CVG834G")
board_name="cvg834g"
;;
"Netgear DG834GT/PN")
board_name="dg834gt"
;;
"Netgear DGND3700v1/DGND3800B")
board_name="dgnd3700v1_dgnd3800b"
;;
"Pirelli A226G")
board_name="a226g"
;;
"Pirelli A226M")
board_name="a226m"
;;
"Pirelli A226M-FWB")
board_name="a226m-fwb"
;;
"Pirelli Alice Gate AGPF-S0")
board_name="agpf-s0"
;;
"Sagem F@ST2404")
board_name="fast2404"
;;
"Sagem F@ST2504n")
board_name="fast2504n"
;;
"Sagem F@ST2604")
board_name="fast2604"
;;
"Sagem F@ST2704V2")
board_name="fast2704v2"
;;
"SFR Neuf Box 4"*)
board_name="neufbox4"
;;
"SFR neufbox 6 (Sercomm)")
board_name="neufbox6"
;;
"T-Com Speedport W303 V")
board_name="spw303v"
;;
"T-Com Speedport W500 V")
board_name="spw500v"
;;
"TECOM GW6000")
board_name="g6000"
;;
"TECOM GW6200")
board_name="g6200"
;;
"Telsey CPVA642-type (CPA-ZNTE60T)")
board_name="cpva642"
;;
"TP-Link TD-W8900GB")
board_name="td-w8900gb"
;;
"USRobotics 9108")
board_name="usr9108"
;;
"Zyxel P870HW-51a v2")
board_name="p870hw-51a_v2"
;;
*)
board_name="unknown"
;;
esac
echo "$board_name"
}
brcm63xx_legacy_detect() {
local board_name
case "$1" in
963268BU_P300)
board_name="bcm963268bu_p300"
;;
96338W2_E7T)
board_name="dsl-2640u"
;;
96348W3)
board_name="dg834g_v4"
;;
CPVA502+)
board_name="cpva502p"
;;
MAGIC)
board_name="magic"
;;
RTA770BW)
board_name="rta770bw"
;;
RTA770W)
board_name="rta770w"
;;
V2110)
board_name="v2110"
;;
V2500V_BB)
board_name="v2500v_bb"
;;
VW6339GU)
board_namge="vg50"
;;
*)
board_name="unknown"
;;
esac
echo "$board_name"
}
brcm63xx_detect() {
local board_name model
board_id=$(awk 'BEGIN{FS="[ \t:/]+"} /system type/ {print $4}' /proc/cpuinfo)
if [ -e /proc/device-tree ]; then
model=$(cat /proc/device-tree/model)
board_name=$(brcm63xx_dt_detect "$model")
else
model="Unknown bcm63xx board"
board_name=$(brcm63xx_legacy_detect "$board_id")
fi
case "$board_name" in
bcm963281tan)
status_led="963281TAN::power"
ifname=eth0
;;
a4001n1)
brcm63xx_has_reset_button="true"
status_led="A4001N1:green:power"
ifname=eth0
;;
bcm96328avng)
status_led="96328avng::power"
ifname=eth0
;;
a4001n)
brcm63xx_has_reset_button="true"
status_led="A4001N:green:power"
ifname="eth0"
;;
ar-5381u)
brcm63xx_has_reset_button="true"
status_led="AR-5381u:green:power"
ifname=eth0
;;
ar-5387un)
brcm63xx_has_reset_button="true"
status_led="AR-5387un:green:power"
ifname=eth0
;;
bcm96348gw)
status_led="96348GW:green:power"
brcm63xx_has_reset_button="true"
ifname=eth1
;;
bcm96348gw-11)
status_led="96348GW-11:green:power"
brcm63xx_has_reset_button="true"
ifname=eth1
;;
spw303v)
status_led="spw303v:green:power+adsl"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
vr-3025un)
brcm63xx_has_reset_button="true"
status_led="VR-3025un:green:power"
ifname="eth0"
;;
vr-3025u)
brcm63xx_has_reset_button="true"
status_led="VR-3025u:green:power"
ifname="eth0"
;;
wap-5813n)
brcm63xx_has_reset_button="true"
status_led="WAP-5813n:green:power"
ifname="eth0"
;;
ar1004g)
status_led="AR1004G:green:power"
brcm63xx_has_reset_button="true"
;;
dsl-274xb-c)
status_led="dsl-274xb:green:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
dsl-275xb-d)
status_led="dsl-275xb:green:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
cpva642)
status_led="CPVA642:green:power:"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
ct536_ct5621)
status_led="CT536_CT5621:green:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
cvg834g)
status_led="CVG834G:green:power"
ifname=eth0
;;
dsl-2640b-b)
status_led="D-4P-W:green:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
dgnd3700v1_dgnd3800b)
status_led="DGND3700v1_3800B:green:power"
brcm63xx_has_reset_button="true"
ifname="eth0"
;;
fast2504n)
status_led="fast2504n:green:ok"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
fast2704v2)
status_led="F@ST2704V2:green:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
gw6000)
brcm63xx_has_reset_button="true"
ifname=eth1
;;
gw6200)
status_led="GW6200:green:line1"
status_led2="GW6200:green:tel"
brcm63xx_has_reset_button="true"
ifname=eth1
;;
hg553)
status_led="HW553:blue:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
hg556a_*)
status_led="HW556:red:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
hg520)
status_led="HW520:green:net"
brcm63xx_has_reset_button="true"
ifname="eth0"
;;
neufbox6)
brcm63xx_has_reset_button="true"
ifname=eth0
;;
p870hw-51a_v2)
brcm63xx_has_reset_button="true"
status_led="P870HW-51a:green:power"
ifname="eth0"
;;
rta770bw)
brcm63xx_has_reset_button="true"
status_led="RTA770BW:green:diag"
ifname=eth0
;;
rta770w)
brcm63xx_has_reset_button="true"
status_led="RTA770W:green:diag"
ifname=eth0
;;
spw500v)
status_led="SPW500V:green:power"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
v2110)
status_led="V2110:power:green"
brcm63xx_has_reset_button="true"
ifname=eth0
;;
esac
[ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
echo "$board_name" > /tmp/sysinfo/board_name
echo "$model" > /tmp/sysinfo/model
}
brcm63xx_board_name() {
local name
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
[ -n "$name" ] || name="unknown"
echo $name
}
brcm63xx_detect
|