brcm63xx: Add support for ADB P.DG A4001N
[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 CPVA642)
91 status_led="CPVA642:green:power:"
92 brcm63xx_has_reset_button="true"
93 ifname=eth0
94 ;;
95 CT536_CT5621)
96 status_led="CT536_CT5621:green:power"
97 brcm63xx_has_reset_button="true"
98 ifname=eth0
99 ;;
100 CVG834G_E15R3921)
101 status_led="CVG834G:green:power"
102 ifname=eth0
103 ;;
104 D-4P-W)
105 status_led="D-4P-W:green:power"
106 brcm63xx_has_reset_button="true"
107 ifname=eth0
108 ;;
109 "F@ST2504n")
110 status_led="fast2504n:green:ok"
111 brcm63xx_has_reset_button="true"
112 ifname=eth0
113 ;;
114 'F@ST2704V2')
115 status_led="F@ST2704V2:green:power"
116 brcm63xx_has_reset_button="true"
117 ifname=eth0
118 ;;
119 GW6000)
120 brcm63xx_has_reset_button="true"
121 ifname=eth1
122 ;;
123 GW6200)
124 status_led="GW6200:green:line1"
125 status_led2="GW6200:green:tel"
126 brcm63xx_has_reset_button="true"
127 ifname=eth1
128 ;;
129 HW553)
130 status_led="HW553:blue:power"
131 brcm63xx_has_reset_button="true"
132 ifname=eth0
133 ;;
134 HW556*)
135 status_led="HW556:red:power"
136 brcm63xx_has_reset_button="true"
137 ifname=eth0
138 ;;
139 HW6358GW_B)
140 status_led="HW520:green:net"
141 brcm63xx_has_reset_button="true"
142 ifname="eth0"
143 ;;
144 NB6)
145 brcm63xx_has_reset_button="true"
146 ifname=eth0
147 ;;
148 P870HW-51a_v2)
149 brcm63xx_has_reset_button="true"
150 status_led="P870HW-51a:green:power"
151 ifname="eth0"
152 ;;
153 RTA770BW)
154 brcm63xx_has_reset_button="true"
155 status_led="RTA770BW:green:diag"
156 ifname=eth0
157 ;;
158 RTA770W)
159 brcm63xx_has_reset_button="true"
160 status_led="RTA770W:green:diag"
161 ifname=eth0
162 ;;
163 SPW500V)
164 status_led="SPW500V:green:power"
165 brcm63xx_has_reset_button="true"
166 ifname=eth0
167 ;;
168 V2110)
169 status_led="V2110:power:green"
170 brcm63xx_has_reset_button="true"
171 ifname=eth0
172 ;;
173 *)
174 ;;
175 esac
176 }
177
178 brcm63xx_detect