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