bcm63xx: move the board name workaround to /lib/brcm63xx.sh
[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" ] && [ -e /proc/switch/eth1/enable ]; then
17                 board_name="DVAG3810BN"
18         fi
19
20         case "$board_name" in
21         96348GW)
22                 status_led="power"
23                 brcm63xx_has_reset_button="true"
24                 ifname=eth1
25                 ;;
26         GW6000)
27                 brcm63xx_has_reset_button="true"
28                 ifname=eth1
29                 ;;
30         GW6200)
31                 status_led="line1"
32                 status_led2="tel"
33                 brcm63xx_has_reset_button="true"
34                 ifname=eth1
35                 ;;
36         96348GW-11)
37                 status_led="power"
38                 brcm63xx_has_reset_button="true"
39                 ifname=eth1
40                 ;;
41         CT536_CT5621)
42                 status_led="power"
43                 brcm63xx_has_reset_button="true"
44                 ifname=eth0
45                 ;;
46         SPW500V)
47                 status_led="power:green"
48                 brcm63xx_has_reset_button="true"
49                 ifname=eth0
50                 ;;
51         AW4139)
52                 status_led="dsl-274xb:green:power"
53                 brcm63xx_has_reset_button="true"
54                 ifname=eth0
55                 ;;
56         96358-502V)
57                 status_led="spw303v:green:power+adsl"
58                 brcm63xx_has_reset_button="true"
59                 ifname=eth0
60                 ;;
61         V2110)
62                 status_led="V2110:power:green"
63                 brcm63xx_has_reset_button="true"
64                 ifname=eth0
65                 ;;
66         CPVA642)
67                 status_led="power:green"
68                 brcm63xx_has_reset_button="true"
69                 ifname=eth0
70                 ;;
71         D-4P-W)
72                 status_led="power:green"
73                 brcm63xx_has_reset_button="true"
74                 ifname=eth0
75                 ;;
76         *)
77                 ;;
78         esac
79 }
80
81 brcm63xx_detect