55e6796431fb008848247e43f3a76d7ae0e6b189
[openwrt/svn-archive/archive.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 ifname=""
13
14 brcm63xx_detect() {
15 board_name=$(awk 'BEGIN{FS="[ \t:/]+"} /system type/ {print $4}' /proc/cpuinfo)
16
17 if [ "$board_name" = "96358VW" ] && [ -n "$(swconfig dev eth1 help 2>/dev/null)" ]; then
18 board_name="DVAG3810BN"
19 fi
20
21 case "$board_name" in
22 963281TAN)
23 status_led="963281TAN::power"
24 ifname=eth0
25 ;;
26 963281T_TEF)
27 brcm63xx_has_reset_button="true"
28 status_led="A4001N1:green:power"
29 ifname=eth0
30 ;;
31 96328avng)
32 status_led="96328avng::power"
33 ifname=eth0
34 ;;
35 96328dg2x2)
36 brcm63xx_has_reset_button="true"
37 status_led="A4001N:green:power"
38 ifname="eth0"
39 ;;
40 96328A-1241N)
41 brcm63xx_has_reset_button="true"
42 status_led="AR-5381u:green:power"
43 ifname=eth0
44 ;;
45 96328A-1441N1)
46 brcm63xx_has_reset_button="true"
47 status_led="AR-5387un:green:power"
48 ifname=eth0
49 ;;
50 96348GW)
51 status_led="96348GW:green:power"
52 brcm63xx_has_reset_button="true"
53 ifname=eth1
54 ;;
55 96348GW-11)
56 status_led="96348GW-11:green:power"
57 brcm63xx_has_reset_button="true"
58 ifname=eth1
59 ;;
60 96358-502V)
61 status_led="spw303v:green:power+adsl"
62 brcm63xx_has_reset_button="true"
63 ifname=eth0
64 ;;
65 96368M-1341N)
66 brcm63xx_has_reset_button="true"
67 status_led="VR-3025un:green:power"
68 ifname="eth0"
69 ;;
70 96368M-1541N)
71 brcm63xx_has_reset_button="true"
72 status_led="VR-3025u:green:power"
73 ifname="eth0"
74 ;;
75 96369R-1231N)
76 brcm63xx_has_reset_button="true"
77 status_led="WAP-5813n:green:power"
78 ifname="eth0"
79 ;;
80 AR1004G)
81 status_led="AR1004G:green:power"
82 brcm63xx_has_reset_button="true"
83 ;;
84 AW4139 |\
85 AW4339U)
86 status_led="dsl-274xb:green:power"
87 brcm63xx_has_reset_button="true"
88 ifname=eth0
89 ;;
90 AW5200B)
91 status_led="dsl-275xb:green:power"
92 brcm63xx_has_reset_button="true"
93 ifname=eth0
94 ;;
95 CPVA642)
96 status_led="CPVA642:green:power:"
97 brcm63xx_has_reset_button="true"
98 ifname=eth0
99 ;;
100 CT536_CT5621)
101 status_led="CT536_CT5621:green:power"
102 brcm63xx_has_reset_button="true"
103 ifname=eth0
104 ;;
105 CVG834G_E15R3921)
106 status_led="CVG834G:green:power"
107 ifname=eth0
108 ;;
109 D-4P-W)
110 status_led="D-4P-W:green:power"
111 brcm63xx_has_reset_button="true"
112 ifname=eth0
113 ;;
114 DGND3700v1_3800B)
115 status_led="DGND3700v1_3800B:green:power"
116 brcm63xx_has_reset_button="true"
117 ifname="eth0"
118 ;;
119 "F@ST2504n")
120 status_led="fast2504n:green:ok"
121 brcm63xx_has_reset_button="true"
122 ifname=eth0
123 ;;
124 'F@ST2704V2')
125 status_led="F@ST2704V2:green:power"
126 brcm63xx_has_reset_button="true"
127 ifname=eth0
128 ;;
129 GW6000)
130 brcm63xx_has_reset_button="true"
131 ifname=eth1
132 ;;
133 GW6200)
134 status_led="GW6200:green:line1"
135 status_led2="GW6200:green:tel"
136 brcm63xx_has_reset_button="true"
137 ifname=eth1
138 ;;
139 HW553)
140 status_led="HW553:blue:power"
141 brcm63xx_has_reset_button="true"
142 ifname=eth0
143 ;;
144 HW556*)
145 status_led="HW556:red:power"
146 brcm63xx_has_reset_button="true"
147 ifname=eth0
148 ;;
149 HW6358GW_B)
150 status_led="HW520:green:net"
151 brcm63xx_has_reset_button="true"
152 ifname="eth0"
153 ;;
154 NB6)
155 brcm63xx_has_reset_button="true"
156 ifname=eth0
157 ;;
158 P870HW-51a_v2)
159 brcm63xx_has_reset_button="true"
160 status_led="P870HW-51a:green:power"
161 ifname="eth0"
162 ;;
163 RTA770BW)
164 brcm63xx_has_reset_button="true"
165 status_led="RTA770BW:green:diag"
166 ifname=eth0
167 ;;
168 RTA770W)
169 brcm63xx_has_reset_button="true"
170 status_led="RTA770W:green:diag"
171 ifname=eth0
172 ;;
173 SPW500V)
174 status_led="SPW500V:green:power"
175 brcm63xx_has_reset_button="true"
176 ifname=eth0
177 ;;
178 V2110)
179 status_led="V2110:power:green"
180 brcm63xx_has_reset_button="true"
181 ifname=eth0
182 ;;
183 *)
184 ;;
185 esac
186 }
187
188 brcm63xx_detect