brcm63xx: switch to board_name based configuration

Board IDs are not unique, so in preparation for depricating them, always
use board_name for any (default) configuration decisions.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 44836
lede-17.01
Jonas Gorski 2015-03-16 11:52:42 +00:00
parent 52ffc6faa7
commit 098377af25
4 changed files with 94 additions and 92 deletions

View File

@ -26,12 +26,12 @@ rt2x00_eeprom_extract() {
. /lib/brcm63xx.sh . /lib/brcm63xx.sh
board=$board_id board=$(brcm63xx_board_name)
case "$FIRMWARE" in case "$FIRMWARE" in
"rt2x00.eeprom" ) "rt2x00.eeprom" )
case $board in case $board in
HW556_C) hg556a_c)
rt2x00_eeprom_extract "cal_data" 130560 512 rt2x00_eeprom_extract "cal_data" 130560 512
;; ;;
*) *)

View File

@ -6,15 +6,15 @@
. /lib/functions/uci-defaults.sh . /lib/functions/uci-defaults.sh
. /lib/brcm63xx.sh . /lib/brcm63xx.sh
case "$board_id" in case "$(brcm63xx_board_name)" in
963281T_TEF) a4001n1)
ucidef_set_led_netdev "lan" "LAN" "A4001N1:green:eth" "eth0" ucidef_set_led_netdev "lan" "LAN" "A4001N1:green:eth" "eth0"
ucidef_set_led_usbdev "usb" "USB" "A4001N1:green:3g" "1-1" ucidef_set_led_usbdev "usb" "USB" "A4001N1:green:3g" "1-1"
;; ;;
96328dg2x2) a4001n)
ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1" ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1"
;; ;;
DGND3700v1_3800B) dgnd3700v1_dgnd3800b)
ucidef_set_led_netdev "lan" "LAN" "DGND3700v1_3800B:green:lan" "eth0.1" ucidef_set_led_netdev "lan" "LAN" "DGND3700v1_3800B:green:lan" "eth0.1"
ucidef_set_led_netdev "wan" "WAN" "DGND3700v1_3800B:green:inet" "eth0.2" ucidef_set_led_netdev "wan" "WAN" "DGND3700v1_3800B:green:inet" "eth0.2"
ucidef_set_led_netdev "wlan0" "WIFI2G" "DGND3700v1_3800B:green:wifi2g" "wlan0" ucidef_set_led_netdev "wlan0" "WIFI2G" "DGND3700v1_3800B:green:wifi2g" "wlan0"
@ -22,15 +22,15 @@ DGND3700v1_3800B)
ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" "1-1" ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" "1-2" ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" "1-2"
;; ;;
'F@ST2704V2') fast2704v2)
ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1" ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1"
;; ;;
HW553) hg553)
ucidef_set_led_netdev "lan" "LAN" "HW553:blue:lan" "eth0" ucidef_set_led_netdev "lan" "LAN" "HW553:blue:lan" "eth0"
ucidef_set_led_usbdev "usb1" "USB1" "HW553:red:hspa" "1-1" ucidef_set_led_usbdev "usb1" "USB1" "HW553:red:hspa" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "HW553:blue:hspa" "1-2" ucidef_set_led_usbdev "usb2" "USB2" "HW553:blue:hspa" "1-2"
;; ;;
HW556*) hg556a_*)
ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0" ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0"
ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2" ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2"
;; ;;

View File

@ -12,124 +12,128 @@ touch /etc/config/network
ucidef_set_interface_loopback ucidef_set_interface_loopback
case "$board_id" in case "$(brcm63xx_board_name)" in
96348W3 |\ cvg834g |\
96358-502V |\ rta770bw |\
CVG834G_E15R3921 |\ rta770w |\
RTA770BW |\ spw303v |\
RTA770W |\ spw500v)
SPW500V)
ucidef_set_interface_lan "eth0" ucidef_set_interface_lan "eth0"
;; ;;
96338GW |\ ar1004g |\
96338W |\ bcm96338gw |\
96338W2_E7T |\ bcm96338w |\
96348A-122 |\ cpva642 |\
96348W3 |\ ct-5365 |\
AR1004G |\ ct-536p_5621t |\
CPVA642 |\ ct-6373 |\
CT536_CT5621 |\ dg834g_v4 |\
CT6373-1 |\ dsl-2640b-b |\
D-4P-W |\ dsl-2640u |\
"F@ST2604" |\ fast2604 |\
RTA1320_16M |\ rta1320 |\
V2110) v2110)
ucidef_set_interface_lan "eth0" ucidef_set_interface_lan "eth0"
ucidef_add_switch "eth0" "1" "1" ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
;; ;;
96348GW |\ agpf-s0 |\
96348GW-10 |\ bcm96348gw |\
96348GW-11 |\ bcm96348gw-10 |\
96348GW-A |\ bcm96348gw-11 |\
96358VW |\ bcm96358vw |\
96358VW2 |\ bcm96358vw2 |\
AGPF-S0 |\ cpva502p |\
"CPVA502+" |\ dg834gt |\
DV201AMR |\ dmv-s0 |\
DWV-S0 |\ dsl-2650u |\
"F@ST2404" |\ dv-201amr |\
MAGIC |\ f5d7633 |\
RTA1025W_16 |\ fast2404 |\
V2500V_BB) magic |\
rg100a |\
rta1025W |\
td-w8900gb |\
usr9108 |\
v2500v_bb)
ucidef_set_interfaces_lan_wan "eth1" "eth0" ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "eth1" "1" "1" ucidef_add_switch "eth1" "1" "1"
ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5" ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
;; ;;
AW4139 |\ dsl-274xb-c |\
HW553 |\ hg553 |\
HW556*) hg556a_*)
ucidef_set_interface_lan "eth0.1" ucidef_set_interface_lan "eth0.1"
ucidef_add_switch "eth0" "1" "1" ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t"
;; ;;
NB4-* |\ dva-g3810bn |\
DVG3810BN |\ hg520 |\
HW6358GW_B) neufbox4)
ucidef_set_interfaces_lan_wan "eth1.1" "eth0" ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
ucidef_add_switch "eth1" "1" "1" ucidef_add_switch "eth1" "1" "1"
ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5t" ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5t"
;; ;;
96328avng |\ a4001n1 |\
96328A-1241N |\ a4001n |\
96328A-1441N1 |\ ar-5381u |\
963281TAN |\ ar-5387un |\
963281T_TEF |\ bcm963281tan |\
96328dg2x2 |\ bcm96328avng |\
96368M-1341N |\ bcm96368mvngr |\
96368M-1541N |\ dsl-274xb-f |\
96368MVNgr |\ dsl-275xb-d |\
AW4339U |\ fast2504n |\
AW5200B |\ fast2704v2 |\
"F@ST2504n" |\ p870hw-51a_v2 |\
"F@ST2704V2" |\ vr-3025un |\
P870HW-51a_v2) vr-3025u)
ucidef_set_interface_lan "eth0.1" ucidef_set_interface_lan "eth0.1"
ucidef_add_switch "eth0" "1" "1" ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
;; ;;
96368MVWG) bcm96368mvwg)
ucidef_set_interface_lan "eth0.1" ucidef_set_interface_lan "eth0.1"
ucidef_add_switch "eth0" "1" "1" ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "1 2 4 5 8t" ucidef_add_switch_vlan "eth0" "1" "1 2 4 5 8t"
;; ;;
96369R-1231N) wap-5831n)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "eth0" "1" "1" ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 5t" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 5t"
ucidef_add_switch_vlan "eth0" "2" "4 5t" ucidef_add_switch_vlan "eth0" "2" "4 5t"
;; ;;
DGND3700v1_3800B) dgnd3700v1_dgnd3800b)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "eth0" "1" "1" ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t" ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t"
ucidef_add_switch_vlan "eth0" "2" "0 8t" ucidef_add_switch_vlan "eth0" "2" "0 8t"
;; ;;
NB6) neufbox6)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1" ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t" ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
ucidef_add_switch_vlan "switch0" "2" "0 9t" ucidef_add_switch_vlan "switch0" "2" "0 9t"
;; ;;
VW6339GU) vg50)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1" ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t" ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t"
ucidef_add_switch_vlan "switch0" "2" "4 8t" ucidef_add_switch_vlan "switch0" "2" "4 8t"
;; ;;
963268BU_P300) bcm963268bu_p300)
ucidef_set_interface_lan "eth0.1" ucidef_set_interface_lan "eth0.1"
ucidef_add_switch "switch0" "1" "1" ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "0 3 4 5 6 7 8t" ucidef_add_switch_vlan "switch0" "1" "0 3 4 5 6 7 8t"

View File

@ -10,29 +10,27 @@ do_fixcrc() {
mtd fixtrx linux mtd fixtrx linux
} }
brcm63xx_detect case "$(brcm63xx_board_name)" in
a4001n |\
case "$board_id" in a4001n1 |\
96328avng |\ ar-5381u |\
96328A-1241N |\ ar-5387un |\
96328A-1441N1 |\ bcm96328avng |\
963281TAN |\ bcm963281tan |\
963281T_TEF |\ cpva502p |\
96328dg2x2 |\ cpva642 |\
96358-502V |\ ct-6373 |\
96368M-1341N |\ dsl-274xb-f |\
96368M-1541N |\ magic |\
96369R-1231N |\ p870hw-51a_v2 |\
AW4339U |\ rta770bw |\
"CPVA502+" |\ rta770w |\
CPVA642 |\ spw303v |\
CT6373-1 |\ v2110 |\
MAGIC |\ v2500v_bb |\
P870HW-51a_v2 |\ vr-3025u |\
RTA770BW |\ vr-3025un |\
RTA770W |\ wap-5813n)
V2110 |\
V2500V_BB)
do_fixcrc do_fixcrc
;; ;;
esac esac