aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/xway/base-files/etc/board.d
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/lantiq/xway/base-files/etc/board.d')
-rwxr-xr-xtarget/linux/lantiq/xway/base-files/etc/board.d/01_leds44
-rwxr-xr-xtarget/linux/lantiq/xway/base-files/etc/board.d/02_network122
2 files changed, 166 insertions, 0 deletions
diff --git a/target/linux/lantiq/xway/base-files/etc/board.d/01_leds b/target/linux/lantiq/xway/base-files/etc/board.d/01_leds
new file mode 100755
index 0000000000..82a39f4648
--- /dev/null
+++ b/target/linux/lantiq/xway/base-files/etc/board.d/01_leds
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2015 OpenWrt.org
+#
+
+. /lib/functions/leds.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+led_wifi="$(get_dt_led wifi)"
+[ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"
+
+led_usb="$(get_dt_led usb)"
+[ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
+
+led_usb2="$(get_dt_led usb2)"
+[ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
+
+led_dsl="$(get_dt_led dsl)"
+[ -n "$led_dsl" ] && {
+ led_internet="$(get_dt_led internet)"
+ if [ -n "$led_internet" ]; then
+ ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0"
+ ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan"
+ else
+ ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0"
+ fi
+}
+
+board=$(board_name)
+
+case "$board" in
+arcadyan,arv7506pw11)
+ ucidef_set_led_wlan "wifi" "wifi" "arv7506pw11:green:wlan" "phy0radio"
+ ;;
+arcadyan,arv752dpw22)
+ ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/lantiq/xway/base-files/etc/board.d/02_network b/target/linux/lantiq/xway/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..b1b742bd1f
--- /dev/null
+++ b/target/linux/lantiq/xway/base-files/etc/board.d/02_network
@@ -0,0 +1,122 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/functions/system.sh
+. /lib/functions/lantiq.sh
+
+board_config_update
+
+annex="a"
+
+lan_mac=""
+wan_mac=""
+
+board=$(board_name)
+
+case "$board" in
+arcadyan,arv4510pw)
+ lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:4" "2:lan:2" "1:lan:3" "3:lan:1" "5t@eth0"
+ ;;
+arcadyan,arv4519pw|\
+arcadyan,arv7510pw22|\
+arcadyan,arv7518pw)
+ ucidef_add_switch "switch0" \
+ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan"
+ ;;
+arcadyan,arv7506pw11)
+ annex="b"
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 2)
+ ucidef_add_switch "switch0" \
+ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0"
+ ;;
+arcadyan,arv7519pw)
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0"
+ ;;
+arcadyan,arv7525pw|\
+arcadyan,arv752dpw)
+ annex="b"
+ ucidef_set_interface_lan 'eth0'
+ ;;
+arcadyan,arv752dpw22|\
+arcadyan,arv8539pw22)
+ annex="b"
+ ucidef_add_switch "switch0" \
+ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan"
+ ;;
+audiocodes,mp-252)
+ ucidef_add_switch "switch0" \
+ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0"
+ ;;
+avm,fritz7312|\
+avm,fritz7320)
+ annex="b"
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 0xa91)" 1)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+bt,homehub-v2b)
+ lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "1:lan" "2:lan" "3:lan" "4:lan" "5t@eth0"
+ ;;
+bt,homehub-v3a)
+ lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+buffalo,wbmr-hp-g300h)
+ ucidef_add_switch "switch0" \
+ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan"
+ ;;
+netgear,dgn3500|\
+netgear,dgn3500b)
+ lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0"
+ ;;
+siemens,gigaset-sx76x)
+ annex="b"
+ ucidef_add_switch "switch0" \
+ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0"
+ ;;
+zte,h201l)
+ annex="b"
+ ucidef_add_switch "switch0" \
+ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0"
+ ;;
+zyxel,p-2601hn)
+ ucidef_add_switch "switch0" \
+ "0:lan" "1:lan" "2:lan" "3:lan" "5t@eth0"
+ ;;
+*)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+esac
+
+ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \
+ ucidef_add_atm_bridge 1 32 "llc" "bridged" "dsl"
+
+if lantiq_is_vdsl_system; then
+ ucidef_add_vdsl_modem "$annex" "av"
+else
+ ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin"
+fi
+
+ucidef_set_interface_wan "dsl0" "pppoe"
+
+[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
+[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
+
+board_config_flush
+
+exit 0
+