87b2063dbdb1a1f14f5e3288ba0352b3d1ad194a
[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" ] && [ -n "$(swconfig dev eth1 help 2>/dev/null)" ]; 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-1241N)
26                 brcm63xx_has_reset_button="true"
27                 status_led="96328A-1241N:green:power"
28                 ifname=eth0
29                 ;;
30         RTA770BW)
31                 brcm63xx_has_reset_button="true"
32                 status_led="RTA770BW:green:diag"
33                 ifname=eth0
34                 ;;
35         RTA770W)
36                 brcm63xx_has_reset_button="true"
37                 status_led="RTA770W:green:diag"
38                 ifname=eth0
39                 ;;
40         96328A-1441N1)
41                 brcm63xx_has_reset_button="true"
42                 status_led="96328A-1441N1:green:power"
43                 ifname=eth0
44                 ;;
45         963281TAN)
46                 status_led="963281TAN::power"
47                 ifname=eth0
48                 ;;
49         963281T_TEF)
50                 brcm63xx_has_reset_button="true"
51                 status_led="963281T_TEF:green:power"
52                 ifname=eth0
53                 ;;
54         96348GW)
55                 status_led="power"
56                 brcm63xx_has_reset_button="true"
57                 ifname=eth1
58                 ;;
59         GW6000)
60                 brcm63xx_has_reset_button="true"
61                 ifname=eth1
62                 ;;
63         GW6200)
64                 status_led="line1"
65                 status_led2="tel"
66                 brcm63xx_has_reset_button="true"
67                 ifname=eth1
68                 ;;
69         HW556*)
70                 status_led="HW556:red:power"
71                 brcm63xx_has_reset_button="true"
72                 ifname=eth0
73                 ;;
74         96348GW-11)
75                 status_led="power"
76                 brcm63xx_has_reset_button="true"
77                 ifname=eth1
78                 ;;
79         CT536_CT5621)
80                 status_led="power"
81                 brcm63xx_has_reset_button="true"
82                 ifname=eth0
83                 ;;
84         SPW500V)
85                 status_led="power:green"
86                 brcm63xx_has_reset_button="true"
87                 ifname=eth0
88                 ;;
89         AW4139 |\
90         AW4339U)
91                 status_led="dsl-274xb:green:power"
92                 brcm63xx_has_reset_button="true"
93                 ifname=eth0
94                 ;;
95         96358-502V)
96                 status_led="spw303v:green:power+adsl"
97                 brcm63xx_has_reset_button="true"
98                 ifname=eth0
99                 ;;
100         V2110)
101                 status_led="V2110:power:green"
102                 brcm63xx_has_reset_button="true"
103                 ifname=eth0
104                 ;;
105         CPVA642)
106                 status_led="power:green"
107                 brcm63xx_has_reset_button="true"
108                 ifname=eth0
109                 ;;
110         D-4P-W)
111                 status_led="power:green"
112                 brcm63xx_has_reset_button="true"
113                 ifname=eth0
114                 ;;
115         NB6)
116                 brcm63xx_has_reset_button="true"
117                 ifname=eth0
118                 ;;
119         *)
120                 ;;
121         esac
122 }
123
124 brcm63xx_detect