diff --git a/iopsys-brcm63xx-arm/base-files/lib/db/boards/FT-P3410B b/iopsys-brcm63xx-arm/base-files/lib/db/boards/FT-P3410B index 87cf241ef38e3d298f40b04dafd313fb3019d267..1986affdd78a822eb3bba55c78aeedda226398b6 100644 --- a/iopsys-brcm63xx-arm/base-files/lib/db/boards/FT-P3410B +++ b/iopsys-brcm63xx-arm/base-files/lib/db/boards/FT-P3410B @@ -59,32 +59,81 @@ config gpio_led gpio_leds list leds pon_green list leds power_on_green list leds alarm_red + list leds lan1_green + list leds lan1_yellow + list leds lan2_green + list leds lan2_yellow + list leds lan3_green + list leds lan3_yellow + list leds lan4_green + list leds lan4_yellow config gpio_led catv_green - option addr 6 - option active high - option mode sr + option active high + option sysfs_attr 29s + option mode led_linux config gpio_led pon_green - option addr 5 - option active high - option mode sr + option active high + option sysfs_attr 28s + option mode led_linux config gpio_led power_on_green - option addr 1 - option active high - option mode sr + option active high + option sysfs_attr 27s + option mode led_linux config gpio_led alarm_red - option addr 0 - option active high - option mode sr + option active high + option sysfs_attr 26s + option mode led_linux + +config gpio_led lan1_yellow + option active high + option sysfs_attr 24s + option mode led_linux + +config gpio_led lan1_green + option active high + option sysfs_attr 25s + option mode led_linux + +config gpio_led lan2_yellow + option active high + option sysfs_attr 22s + option mode led_linux + +config gpio_led lan2_green + option active high + option sysfs_attr 23s + option mode led_linux + +config gpio_led lan3_yellow + option active high + option sysfs_attr 20s + option mode led_linux + +config gpio_led lan3_green + option active high + option sysfs_attr 21s + option mode led_linux + +config gpio_led lan4_yellow + option active high + option sysfs_attr 18s + option mode led_linux + +config gpio_led lan4_green + option active high + option sysfs_attr 19s + option mode led_linux ############### mapping led function to driver led config led_map led_map list functions status list functions internet list functions wan_speed + list functions lan config led_map led_status @@ -112,3 +161,21 @@ config led_map led_catv list led_action_notice catv_green=FLASH_SLOW list led_action_alert catv_green=FLASH_SLOW list led_action_error catv_green=FLASH_FAST + +config led_map led_lan + list led_action_ok lan1_green=ON + list led_action_ok lan1_yellow=ON + list led_action_ok lan2_green=ON + list led_action_ok lan2_yellow=ON + list led_action_ok lan3_green=ON + list led_action_ok lan3_yellow=ON + list led_action_ok lan4_green=ON + list led_action_ok lan4_yellow=ON + list led_action_off lan1_green=OFF + list led_action_off lan1_yellow=OFF + list led_action_off lan2_green=OFF + list led_action_off lan2_yellow=OFF + list led_action_off lan3_green=OFF + list led_action_off lan3_yellow=OFF + list led_action_off lan4_green=OFF + list led_action_off lan4_yellow=OFF diff --git a/iopsys-brcm63xx-arm/base-files/lib/db/boards/XG6846B b/iopsys-brcm63xx-arm/base-files/lib/db/boards/XG6846B index eeb5d62338fb6938f2d000c4a36b5e0ffcd55b7a..7bd57a62d14746d888bb6a745696529440b06c20 100644 --- a/iopsys-brcm63xx-arm/base-files/lib/db/boards/XG6846B +++ b/iopsys-brcm63xx-arm/base-files/lib/db/boards/XG6846B @@ -51,43 +51,91 @@ config gpio_led gpio_leds list leds usb_green list leds power_on_green list leds alarm_red + list leds lan1_green + list leds lan1_yellow + list leds lan2_green + list leds lan2_yellow + list leds lan3_green + list leds lan3_yellow + list leds lan4_green + list leds lan4_yellow list leds ext_green list leds ext_yellow config gpio_led wan_yellow - option addr 0 - option active high - option mode sr + option active high + option sysfs_attr 3s + option mode led_linux config gpio_led wan_green - option addr 1 - option active high - option mode sr + option active high + option sysfs_attr 4s + option mode led_linux config gpio_led usb_green - option addr 8 - option active high - option mode sr + option active high + option sysfs_attr 15s + option mode led_linux config gpio_led power_on_green - option addr 5 - option active high - option mode sr + option active high + option sysfs_attr 5s + option mode led_linux config gpio_led alarm_red - option addr 6 - option active high - option mode sr + option active high + option sysfs_attr 6s + option mode led_linux + +config gpio_led lan1_yellow + option active high + option sysfs_attr 7s + option mode led_linux + +config gpio_led lan1_green + option active high + option sysfs_attr 8s + option mode led_linux + +config gpio_led lan2_yellow + option active high + option sysfs_attr 9s + option mode led_linux + +config gpio_led lan2_green + option active high + option sysfs_attr 10s + option mode led_linux + +config gpio_led lan3_yellow + option active high + option sysfs_attr 11s + option mode led_linux + +config gpio_led lan3_green + option active high + option sysfs_attr 12s + option mode led_linux + +config gpio_led lan4_yellow + option active high + option sysfs_attr 13s + option mode led_linux + +config gpio_led lan4_green + option active high + option sysfs_attr 14s + option mode led_linux config gpio_led ext_green - option addr 2 - option active high - option mode sr + option active high + option sysfs_attr 0s + option mode led_linux config gpio_led ext_yellow - option addr 3 - option active high - option mode sr + option active high + option sysfs_attr 1s + option mode led_linux ############### mapping led function to driver led @@ -96,6 +144,7 @@ config led_map led_map list functions usb list functions wan_speed list functions ext + list functions lan config led_map led_status @@ -132,3 +181,21 @@ config led_map led_ext list led_action_off ext_yellow=OFF list led_action_notice ext_green=OFF list led_action_notice ext_yellow=ON + +config led_map led_lan + list led_action_ok lan1_green=ON + list led_action_ok lan1_yellow=ON + list led_action_ok lan2_green=ON + list led_action_ok lan2_yellow=ON + list led_action_ok lan3_green=ON + list led_action_ok lan3_yellow=ON + list led_action_ok lan4_green=ON + list led_action_ok lan4_yellow=ON + list led_action_off lan1_green=OFF + list led_action_off lan1_yellow=OFF + list led_action_off lan2_green=OFF + list led_action_off lan2_yellow=OFF + list led_action_off lan3_green=OFF + list led_action_off lan3_yellow=OFF + list led_action_off lan4_green=OFF + list led_action_off lan4_yellow=OFF diff --git a/iopsys-brcm63xx-arm/panther/base-files/etc/hotplug.d/usb/00-led b/iopsys-brcm63xx-arm/panther/base-files/etc/hotplug.d/usb/00-led new file mode 100644 index 0000000000000000000000000000000000000000..80ea911c3e7e1939ccad95ab3a31a6380e3e61a2 --- /dev/null +++ b/iopsys-brcm63xx-arm/panther/base-files/etc/hotplug.d/usb/00-led @@ -0,0 +1,17 @@ +#!/bin/sh + +readonly BASENAME="$(basename "$DEVPATH")" +[ "${BASENAME:0:3}" = "usb" -a "$ACTION" = "add" ] && exit 0 +[ "${BASENAME:0:3}" = "usb" ] && ACTION="notice" # A root-hub disappeared, this SHOULD NOT happen! + +case "$ACTION" in + add) + ubus call led.usb set '{ "state": "ok" }' + ;; + notice) + ubus call led.usb set '{ "state": "notice" }' + ;; + *) + ubus call led.usb set '{ "state": "off" }' + ;; +esac diff --git a/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/fiber_wan b/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/fiber_wan new file mode 100755 index 0000000000000000000000000000000000000000..9e4749b2944a6940c0bffd42111346ee633ffec3 --- /dev/null +++ b/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/fiber_wan @@ -0,0 +1,32 @@ +#!/bin/sh /etc/rc.common + +START=21 +STOP=90 +USE_PROCD=1 + +FIBER_WAN=$(which fiber_wan) + +start_service() { + [ -n "$FIBER_WAN" ] && { + procd_open_instance + procd_set_param command "$FIBER_WAN" + procd_set_param respawn + procd_close_instance + } +} + +stop_service() { + [ -n "$FIBER_WAN" ] && service_stop "$FIBER_WAN" +} + +boot() { + # Only run for XG6846B board + [ "$(db -q get hw.board.model_name)" != "XG6846B" ] && exit 0 + + start +} + +reload_service() { + stop + start +} diff --git a/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/idone b/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/idone new file mode 100755 index 0000000000000000000000000000000000000000..3fba14720397bee9792503da9eb74967009564be --- /dev/null +++ b/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/idone @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=9 + + +boot() { + # steady status led to indicate boot process is complete + ubus call led.status set '{"state":"ok"}' 2>/dev/null + + echo "All init.d scripts started." | tee /dev/console + # Cold plug trigger - USB LED etc.. + udevtrigger +} diff --git a/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/marvell b/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/marvell index 6eee5a227e3ff7b8850820e7ecd58ed071186b4d..7f902aa12ab68816029021e1533befd3dba56130 100755 --- a/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/marvell +++ b/iopsys-brcm63xx-arm/panther/base-files/etc/init.d/marvell @@ -16,7 +16,4 @@ boot() { # and enable port forwarding. port_forwarding activate_phys - - # Continously probe for link on 100 and 1000 Mbps. - /usr/sbin/fiber_wan & } diff --git a/iopsys-brcm63xx-arm/panther/base-files/usr/sbin/fiber_wan b/iopsys-brcm63xx-arm/panther/base-files/usr/sbin/fiber_wan index 26464dec6bc5acecd5f7715bc45862c34834844e..645dc96e7dc6b4fc572397658782b6f03784f6b0 100755 --- a/iopsys-brcm63xx-arm/panther/base-files/usr/sbin/fiber_wan +++ b/iopsys-brcm63xx-arm/panther/base-files/usr/sbin/fiber_wan @@ -46,7 +46,6 @@ get_link() { else ubus call led.wan_speed set {\"state\":\"OFF\"} fi - sleep 5 else #wan copper mode disable_ext_led @@ -60,8 +59,8 @@ get_link() { else ubus call led.wan_speed set {\"state\":\"OFF\"} fi - sleep 5 fi + sleep 5 done }