3 # Copyright (C) 2007 OpenWrt.org
9 brcm63xx_has_reset_button=""
12 brcm63xx_dt_detect() {
31 "Broadcom 96348R reference board")
32 board_name="bcm96348r"
34 "Broadcom bcm963281TAN reference board")
35 board_name="bcm963281tan"
37 "Broadcom BCM96328avng reference board")
38 board_name="bcm6328avng"
40 "Broadcom BCM96345GW2 reference board")
41 board_name="bcm96345gw2"
43 "Broadcom BCM96348GW-10 reference board")
44 board_name="bcm96348gw-10"
46 "Broadcom BCM96348GW-11 reference board")
47 board_name="bcm96348gw-11"
49 "Broadcom BCM96348GW reference board")
50 board_name="bcm96358gw"
52 "Broadcom BCM96358VW reference board")
53 board_name="bcm96358vw"
55 "Broadcom BCM96358VW2 reference board")
56 board_name="bcm96358vw2"
58 "Broadcom BCM96368MVNgr reference board")
59 board_name="bcm96368mvngr"
61 "Broadcom BCM96368MVWG reference board")
62 board_name="bcm96368mvwg"
71 board_name="ar-5387un"
76 "Comtrend CT-536+/CT-5621T")
77 board_name="ct-536p_5621t"
86 board_name="vr-3025un"
89 board_name="wap-5813n"
92 board_name="dv-201amr"
94 "D-Link DSL-2640B rev B2")
95 board_name="dsl-2640b-b"
98 board_name="dsl-2650u"
100 "D-Link DSL-2740B/DSL-2741B rev C2/3")
101 board_name="dsl-274xb-c"
103 "D-Link DSL-2740B/DSL-2741B rev F1")
104 board_name="dsl-274xb-f"
106 "D-Link DVA-G3810BN/TL")
107 board_name="dva-g3810bn"
110 board_name="rta1025w"
115 "Huawei EchoLife HG520v")
118 "Huawei EchoLife HG553")
121 "Huawei EchoLife HG556a (version A)")
122 board_name="hg556a_a"
124 "Huawei EchoLife HG556a (version B)")
125 board_name="hg556a_b"
127 "Huawei EchoLife HG556a (version C)")
128 board_name="hg556a_c"
130 "Inventel Livebox 1")
131 board_name="livebox1"
136 "Netgear DG834GT/PN")
139 "Netgear DGND3700v1/DGND3800B")
140 board_name="dgnd3700v1_dgnd3800b"
149 board_name="a226m-fwb"
151 "Pirelli Alice Gate AGPF-S0")
155 board_name="fast2404"
158 board_name="fast2504n"
161 board_name="fast2604"
164 board_name="fast2704v2"
167 board_name="neufbox4"
169 "SFR neufbox 6 (Sercomm)")
170 board_name="neufbox6"
172 "T-Com Speedport W303 V")
175 "T-Com Speedport W500 V")
184 "Telsey CPVA642-type (CPA-ZNTE60T)")
187 "TP-Link TD-W8900GB")
188 board_name="td-w8900gb"
193 "Zyxel P870HW-51a v2")
194 board_name="p870hw-51a_v2"
204 brcm63xx_legacy_detect() {
209 board_name="bcm963268bu_p300"
212 board_name="dsl-2640u"
215 board_name="dg834g_v4"
218 board_name="cpva502p"
224 board_name="rta770bw"
233 board_name="v2500v_bb"
247 local board_name model
249 board_id=$(awk 'BEGIN{FS="[ \t:/]+"} /system type/ {print $4}' /proc/cpuinfo)
251 if [ -e /proc/device-tree ]; then
252 model=$(cat /proc/device-tree/model)
253 board_name=$(brcm63xx_dt_detect "$model")
255 model="Unknown bcm63xx board"
256 board_name=$(brcm63xx_legacy_detect "$board_id")
259 case "$board_name" in
264 brcm63xx_has_reset_button="true"
271 brcm63xx_has_reset_button="true"
275 brcm63xx_has_reset_button="true"
279 brcm63xx_has_reset_button="true"
283 brcm63xx_has_reset_button="true"
287 brcm63xx_has_reset_button="true"
291 brcm63xx_has_reset_button="true"
295 brcm63xx_has_reset_button="true"
299 brcm63xx_has_reset_button="true"
303 brcm63xx_has_reset_button="true"
307 brcm63xx_has_reset_button="true"
310 brcm63xx_has_reset_button="true"
314 brcm63xx_has_reset_button="true"
318 brcm63xx_has_reset_button="true"
322 brcm63xx_has_reset_button="true"
329 brcm63xx_has_reset_button="true"
332 dgnd3700v1_dgnd3800b)
333 brcm63xx_has_reset_button="true"
337 brcm63xx_has_reset_button="true"
341 brcm63xx_has_reset_button="true"
345 brcm63xx_has_reset_button="true"
349 brcm63xx_has_reset_button="true"
353 brcm63xx_has_reset_button="true"
357 brcm63xx_has_reset_button="true"
361 brcm63xx_has_reset_button="true"
365 brcm63xx_has_reset_button="true"
369 brcm63xx_has_reset_button="true"
373 brcm63xx_has_reset_button="true"
377 brcm63xx_has_reset_button="true"
381 brcm63xx_has_reset_button="true"
385 brcm63xx_has_reset_button="true"
390 [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
392 echo "$board_name" > /tmp/sysinfo/board_name
393 echo "$model" > /tmp/sysinfo/model
396 brcm63xx_board_name() {
399 [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
400 [ -n "$name" ] || name="unknown"