7c449ae6adc11d7ab1e8eac296d2d6d431d28688
[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         CVG834G_E15R3921)
61                 status_led="CVG834G:green:power"
62                 ifname=eth0
63                 ;;
64         GW6000)
65                 brcm63xx_has_reset_button="true"
66                 ifname=eth1
67                 ;;
68         GW6200)
69                 status_led="GW6200:green:line1"
70                 status_led2="GW6200:green:tel"
71                 brcm63xx_has_reset_button="true"
72                 ifname=eth1
73                 ;;
74         HW556*)
75                 status_led="HW556:red:power"
76                 brcm63xx_has_reset_button="true"
77                 ifname=eth0
78                 ;;
79         96348GW-11)
80                 status_led="96348GW-11:green:power"
81                 brcm63xx_has_reset_button="true"
82                 ifname=eth1
83                 ;;
84         CT536_CT5621)
85                 status_led="CT536_CT5621:green:power"
86                 brcm63xx_has_reset_button="true"
87                 ifname=eth0
88                 ;;
89         SPW500V)
90                 status_led="SPW500V:green:power"
91                 brcm63xx_has_reset_button="true"
92                 ifname=eth0
93                 ;;
94         AW4139 |\
95         AW4339U)
96                 status_led="dsl-274xb:green:power"
97                 brcm63xx_has_reset_button="true"
98                 ifname=eth0
99                 ;;
100         96358-502V)
101                 status_led="spw303v:green:power+adsl"
102                 brcm63xx_has_reset_button="true"
103                 ifname=eth0
104                 ;;
105         V2110)
106                 status_led="V2110:power:green"
107                 brcm63xx_has_reset_button="true"
108                 ifname=eth0
109                 ;;
110         CPVA642)
111                 status_led="CPVA642:green:power:"
112                 brcm63xx_has_reset_button="true"
113                 ifname=eth0
114                 ;;
115         D-4P-W)
116                 status_led="D-4P-W:green:power"
117                 brcm63xx_has_reset_button="true"
118                 ifname=eth0
119                 ;;
120         NB6)
121                 brcm63xx_has_reset_button="true"
122                 ifname=eth0
123                 ;;
124         *)
125                 ;;
126         esac
127 }
128
129 brcm63xx_detect