aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/base-files/etc
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/brcm63xx/base-files/etc')
-rw-r--r--target/linux/brcm63xx/base-files/etc/diag.sh137
-rw-r--r--target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom45
-rw-r--r--target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds53
-rw-r--r--target/linux/brcm63xx/base-files/etc/uci-defaults/02_network154
-rw-r--r--target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc38
5 files changed, 427 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
new file mode 100644
index 0000000..7826fad
--- /dev/null
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -0,0 +1,137 @@
+#!/bin/sh
+# Copyright (C) 2007-2013 OpenWrt.org
+
+. /lib/functions/leds.sh
+. /lib/brcm63xx.sh
+
+set_state() {
+ case "$(brcm63xx_board_name)" in
+ a4001n1)
+ status_led="A4001N1:green:power"
+ ;;
+ a4001n)
+ status_led="A4001N:green:power"
+ ;;
+ ar-5381u)
+ status_led="AR-5381u:green:power"
+ ;;
+ ar-5387un)
+ status_led="AR-5387un:green:power"
+ ;;
+ bcm96348gw)
+ status_led="96348GW:green:power"
+ ;;
+ bcm963281tan)
+ status_led="963281TAN::power"
+ ;;
+ bcm96328avng)
+ status_led="96328avng::power"
+ ;;
+ bcm96348gw-11)
+ status_led="96348GW-11:green:power"
+ ;;
+ spw303v)
+ status_led="spw303v:green:power+adsl"
+ ;;
+ vr-3025un)
+ status_led="VR-3025un:green:power"
+ ;;
+ vr-3025u)
+ status_led="VR-3025u:green:power"
+ ;;
+ vr-3026e)
+ status_led="VR-3026e:green:power"
+ ;;
+ wap-5813n)
+ status_led="WAP-5813n:green:power"
+ ;;
+ ar1004g)
+ status_led="AR1004G:green:power"
+ ;;
+ dsl-274xb-c|\
+ dsl-274xb-f)
+ status_led="dsl-274xb:green:power"
+ ;;
+ dsl-275xb-d)
+ status_led="dsl-275xb:green:power"
+ ;;
+ cpva642)
+ status_led="CPVA642:green:power:"
+ ;;
+ ct536_ct5621)
+ status_led="CT536_CT5621:green:power"
+ ;;
+ cvg834g)
+ status_led="CVG834G:green:power"
+ ;;
+ dsl-2640b-b)
+ status_led="D-4P-W:green:power"
+ ;;
+ dgnd3700v1_dgnd3800b)
+ status_led="DGND3700v1_3800B:green:power"
+ ;;
+ fast2504n)
+ status_led="fast2504n:green:ok"
+ ;;
+ fast2704n)
+ status_led2="F@ST2704N:red:power"
+ ;;
+ fast2704v2)
+ status_led="F@ST2704V2:green:power"
+ ;;
+ homehub2a)
+ status_led="HOMEHUB2A:green:upgrading"
+ status_led2="HOMEHUB2A:blue:upgrading"
+ ;;
+ gw6200)
+ status_led="GW6200:green:line1"
+ status_led2="GW6200:green:tel"
+ ;;
+ hg553)
+ status_led="HW553:blue:power"
+ ;;
+ hg556a_*)
+ status_led="HW556:red:power"
+ ;;
+ hg520)
+ status_led="HW520:green:net"
+ ;;
+ hg655b)
+ status_led="HW65x:green:power"
+ ;;
+ p870hw-51a_v2)
+ status_led="P870HW-51a:green:power"
+ ;;
+ rta770bw)
+ status_led="RTA770BW:green:diag"
+ ;;
+ rta770w)
+ status_led="RTA770W:green:diag"
+ ;;
+ spw500v)
+ status_led="SPW500V:green:power"
+ ;;
+ v2110)
+ status_led="V2110:power:green"
+ ;;
+ esac
+
+ case "$1" in
+ preinit)
+ status_led_set_timer 200 200
+ ;;
+ failsafe)
+ status_led_set_timer 50 50
+ ;;
+ preinit_regular)
+ status_led_set_timer 500 500
+ ;;
+ done)
+ if [ "${status_led/power}" != "$status_led" ]; then
+ status_led_on
+ else
+ status_led_off
+ fi
+ ;;
+ esac
+}
diff --git a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
new file mode 100644
index 0000000..4347485
--- /dev/null
+++ b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Based on gabors ralink wisoc implementation.
+
+rt2x00_eeprom_die() {
+ echo "rt2x00 eeprom: " "$*"
+ exit 1
+}
+
+rt2x00_eeprom_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ . /lib/functions.sh
+
+ mtd=$(find_mtd_part $part)
+ [ -n "$mtd" ] || \
+ rt2x00_eeprom_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \
+ rt2x00_eeprom_die "failed to extract from $mtd"
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/brcm63xx.sh
+
+board=$(brcm63xx_board_name)
+
+case "$FIRMWARE" in
+"rt2x00.eeprom" )
+ case $board in
+ hg556a_c)
+ rt2x00_eeprom_extract "cal_data" 130560 512
+ ;;
+ hg655b)
+ rt2x00_eeprom_extract "cal_data" 0 512
+ ;;
+ *)
+ rt2x00_eeprom_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+esac
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
new file mode 100644
index 0000000..bdb3dad
--- /dev/null
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Copyright (C) 2013-2014 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/brcm63xx.sh
+
+case "$(brcm63xx_board_name)" in
+a4001n1)
+ ucidef_set_led_netdev "lan" "LAN" "A4001N1:green:eth" "eth0"
+ ucidef_set_led_usbdev "usb" "USB" "A4001N1:green:3g" "1-1"
+ ;;
+a4001n)
+ ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1"
+ ;;
+dgnd3700v1_dgnd3800b)
+ 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 "wlan0" "WIFI2G" "DGND3700v1_3800B:green:wifi2g" "wlan0"
+ ucidef_set_led_netdev "wlan1" "WIFI5G" "DGND3700v1_3800B:blue:wifi5g" "wlan1"
+ 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"
+ ;;
+fast2704n)
+ ucidef_set_led_netdev "wan" "WAN" "F@ST2704N:green:inet" "eth0.2"
+ ;;
+fast2704v2)
+ ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1"
+ ;;
+hg553)
+ 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 "usb2" "USB2" "HW553:blue:hspa" "1-2"
+ ;;
+hg556a_*)
+ ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0"
+ ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2"
+ ;;
+hg655b)
+ ucidef_set_led_usbdev "usb" "USB" "HW65x:green:usb" "1-2"
+ ;;
+homehub2a)
+ ucidef_set_led_netdev "lan" "LAN" "HOMEHUB2A:blue:broadband" "eth0.1"
+ ucidef_set_led_netdev "wlan0" "WIFI" "HOMEHUB2A:green:wireless" "wlan0"
+ ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
+ ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
+ ;;
+esac
+
+ucidef_commit_leds
+
+exit 0
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
new file mode 100644
index 0000000..129514b
--- /dev/null
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -0,0 +1,154 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
+. /lib/functions/uci-defaults.sh
+. /lib/brcm63xx.sh
+
+ucidef_set_interface_loopback
+
+case "$(brcm63xx_board_name)" in
+
+cvg834g |\
+rta770bw |\
+rta770w |\
+spw303v |\
+spw500v)
+ ucidef_set_interface_lan "eth0"
+ ;;
+
+ar1004g |\
+bcm96338gw |\
+bcm96338w |\
+cpva642 |\
+ct-5365 |\
+ct-536p_5621t |\
+ct-6373 |\
+dg834g_v4 |\
+dsl-2640b-b |\
+dsl-2640u |\
+fast2604 |\
+rta1320 |\
+v2110)
+ ucidef_set_interface_lan "eth0"
+ ucidef_add_switch "eth0" "1" "1"
+ ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
+ ;;
+
+agpf-s0 |\
+bcm96348gw |\
+bcm96348gw-10 |\
+bcm96348gw-11 |\
+bcm96358vw |\
+bcm96358vw2 |\
+cpva502p |\
+dg834gt |\
+dmv-s0 |\
+dsl-2650u |\
+dv-201amr |\
+f5d7633 |\
+fast2404 |\
+magic |\
+rg100a |\
+rta1025W |\
+td-w8900gb |\
+usr9108 |\
+v2500v_bb)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ucidef_add_switch "eth1" "1" "1"
+ ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
+ ;;
+
+dsl-274xb-c |\
+hg553 |\
+hg556a_* |\
+homehub2a)
+ ucidef_set_interface_lan "eth0.1"
+ ucidef_add_switch "eth0" "1" "1"
+ ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t"
+ ;;
+
+dva-g3810bn |\
+hg520 |\
+neufbox4)
+ ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+ ucidef_add_switch "eth1" "1" "1"
+ ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5t"
+ ;;
+
+a4001n1 |\
+a4001n |\
+ar-5381u |\
+ar-5387un |\
+bcm963281tan |\
+bcm96328avng |\
+bcm96368mvngr |\
+dsl-274xb-f |\
+dsl-275xb-d |\
+fast2504n |\
+fast2704v2 |\
+hg655b |\
+p870hw-51a_v2 |\
+vr-3025un |\
+vr-3025u |\
+vr-3026e)
+ ucidef_set_interface_lan "eth0.1"
+ ucidef_add_switch "eth0" "1" "1"
+ ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
+ ;;
+
+bcm96368mvwg)
+ ucidef_set_interface_lan "eth0.1"
+ ucidef_add_switch "eth0" "1" "1"
+ ucidef_add_switch_vlan "eth0" "1" "1 2 4 5 8t"
+ ;;
+
+wap-5813n)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "eth0" "1" "1"
+ ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 5t"
+ ucidef_add_switch_vlan "eth0" "2" "4 5t"
+ ;;
+
+fast2704n |\
+dgnd3700v1_dgnd3800b)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "eth0" "1" "1"
+ ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t"
+ ucidef_add_switch_vlan "eth0" "2" "0 8t"
+ ;;
+
+neufbox6)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
+ ucidef_add_switch_vlan "switch0" "2" "0 9t"
+ ;;
+
+vg50)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t"
+ ucidef_add_switch_vlan "switch0" "2" "4 8t"
+ ;;
+
+bcm963268bu_p300)
+ ucidef_set_interface_lan "eth0.1"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 3 4 5 6 7 8t"
+ ;;
+
+*)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ;;
+
+esac
+
+uci commit network
+
+exit 0
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
new file mode 100644
index 0000000..f307a4c
--- /dev/null
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+#
+
+. /lib/brcm63xx.sh
+
+do_fixcrc() {
+ mtd fixtrx linux
+}
+
+case "$(brcm63xx_board_name)" in
+ a4001n |\
+ a4001n1 |\
+ ar-5381u |\
+ ar-5387un |\
+ bcm96328avng |\
+ bcm963281tan |\
+ cpva502p |\
+ cpva642 |\
+ ct-6373 |\
+ dsl-274xb-f |\
+ magic |\
+ p870hw-51a_v2 |\
+ rta770bw |\
+ rta770w |\
+ spw303v |\
+ v2110 |\
+ v2500v_bb |\
+ vr-3025u |\
+ vr-3025un |\
+ vr-3026e |\
+ wap-5813n)
+ do_fixcrc
+ ;;
+esac
+