d3d1b02eadd6b0727ca3aa7d3395321eccccef5a
[openwrt/openwrt.git] / target / linux / brcm63xx / base-files / lib / brcm63xx.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2007 OpenWrt.org
4 #
5 #
6
7 board_name=""
8 status_led=""
9 status_led2=""
10 sys_mtd_part=""
11 brcm63xx_has_reset_button=""
12
13 brcm63xx_detect() {
14 board_name=$(awk 'BEGIN{FS="[ \t:/]+"} /system type/ {print $4}' /proc/cpuinfo)
15
16 if [ "$board_name" = "96358VW" ] && [ -e /proc/switch/eth1/enable ]; then
17 board_name="DVAG3810BN"
18 fi
19
20 case "$board_name" in
21 96328avng)
22 status_led="96328avng::power"
23 ifname=eth0
24 ;;
25 96328A-1441N1)
26 brcm63xx_has_reset_button="true"
27 status_led="96328A-1441N1:green:power"
28 ifname=eth0
29 ;;
30 963281TAN)
31 status_led="963281TAN::power"
32 ifname=eth0
33 ;;
34 963281T_TEF)
35 brcm63xx_has_reset_button="true"
36 status_led="963281T_TEF:green:power"
37 ifname=eth0
38 ;;
39 96348GW)
40 status_led="power"
41 brcm63xx_has_reset_button="true"
42 ifname=eth1
43 ;;
44 GW6000)
45 brcm63xx_has_reset_button="true"
46 ifname=eth1
47 ;;
48 GW6200)
49 status_led="line1"
50 status_led2="tel"
51 brcm63xx_has_reset_button="true"
52 ifname=eth1
53 ;;
54 96348GW-11)
55 status_led="power"
56 brcm63xx_has_reset_button="true"
57 ifname=eth1
58 ;;
59 CT536_CT5621)
60 status_led="power"
61 brcm63xx_has_reset_button="true"
62 ifname=eth0
63 ;;
64 SPW500V)
65 status_led="power:green"
66 brcm63xx_has_reset_button="true"
67 ifname=eth0
68 ;;
69 AW4139 |\
70 AW4339U)
71 status_led="dsl-274xb:green:power"
72 brcm63xx_has_reset_button="true"
73 ifname=eth0
74 ;;
75 96358-502V)
76 status_led="spw303v:green:power+adsl"
77 brcm63xx_has_reset_button="true"
78 ifname=eth0
79 ;;
80 V2110)
81 status_led="V2110:power:green"
82 brcm63xx_has_reset_button="true"
83 ifname=eth0
84 ;;
85 CPVA642)
86 status_led="power:green"
87 brcm63xx_has_reset_button="true"
88 ifname=eth0
89 ;;
90 D-4P-W)
91 status_led="power:green"
92 brcm63xx_has_reset_button="true"
93 ifname=eth0
94 ;;
95 NB6)
96 brcm63xx_has_reset_button="true"
97 ifname=eth0
98 ;;
99 *)
100 ;;
101 esac
102 }
103
104 brcm63xx_detect