Initial commit
This commit is contained in:
28
target/linux/mpc85xx/base-files/etc/board.d/02_network
Executable file
28
target/linux/mpc85xx/base-files/etc/board.d/02_network
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014-2015 OpenWrt.org
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
aerohive,hiveap-330)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
tplink,tl-wdr4900-v1)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
|
||||
ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 332)"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
38
target/linux/mpc85xx/base-files/etc/diag.sh
Normal file
38
target/linux/mpc85xx/base-files/etc/diag.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2013 OpenWrt.org
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/leds.sh
|
||||
|
||||
get_status_led() {
|
||||
case $(board_name) in
|
||||
aerohive,hiveap-330)
|
||||
status_led="hiveap-330:green:tricolor0"
|
||||
;;
|
||||
tplink,tl-wdr4900-v1)
|
||||
status_led="tp-link:blue:system"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_state() {
|
||||
get_status_led
|
||||
|
||||
case "$1" in
|
||||
preinit)
|
||||
status_led_blink_preinit
|
||||
;;
|
||||
|
||||
failsafe)
|
||||
status_led_blink_failsafe
|
||||
;;
|
||||
|
||||
preinit_regular)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
|
||||
done)
|
||||
status_led_on
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
|
||||
FW_FILE="/lib/firmware/$FIRMWARE"
|
||||
|
||||
ath9k_eeprom_die() {
|
||||
echo "ath9k eeprom: " "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
ath9k_eeprom_extract() {
|
||||
local part=$1
|
||||
local offset=$2
|
||||
local count=$3
|
||||
local mtd
|
||||
|
||||
mtd=$(find_mtd_chardev $part)
|
||||
[ -n "$mtd" ] || \
|
||||
ath9k_eeprom_die "no mtd device found for partition $part"
|
||||
|
||||
dd if=$mtd bs=$offset skip=1 count=1 2>/dev/null | dd of=$FW_FILE bs=$count count=1 2>/dev/null || \
|
||||
ath9k_eeprom_die "failed to extract from $mtd"
|
||||
}
|
||||
|
||||
tpl_set_wireless_mac()
|
||||
{
|
||||
local offset=$1
|
||||
local mac
|
||||
|
||||
mac=$(mtd_get_mac_binary u-boot 326656)
|
||||
mac=$(macaddr_add $mac $offset)
|
||||
|
||||
macaddr_2bin $mac | dd bs=1 count=6 seek=2 conv=notrunc of=$FW_FILE 2>/dev/null
|
||||
}
|
||||
|
||||
[ -e $FW_FILE ] && exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$FIRMWARE" in
|
||||
"pci_wmac0.eeprom")
|
||||
case $board in
|
||||
tplink,tl-wdr4900-v1)
|
||||
ath9k_eeprom_extract "caldata" 4096 2048
|
||||
tpl_set_wireless_mac 0
|
||||
;;
|
||||
*)
|
||||
ath9k_eeprom_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"pci_wmac1.eeprom")
|
||||
case $board in
|
||||
tplink,tl-wdr4900-v1)
|
||||
ath9k_eeprom_extract "caldata" 20480 2048
|
||||
tpl_set_wireless_mac -1
|
||||
;;
|
||||
*)
|
||||
ath9k_eeprom_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This must run before 10-wifi-detect
|
||||
|
||||
|
||||
[ "${ACTION}" = "add" ] || return
|
||||
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
|
||||
check_radio()
|
||||
{
|
||||
local cfg="$1" to="$2"
|
||||
|
||||
config_get path "$cfg" path
|
||||
|
||||
[ "$path" = "$to" ] && PATH_EXISTS=true
|
||||
}
|
||||
|
||||
do_migrate_radio()
|
||||
{
|
||||
local cfg="$1" from="$2" to="$3"
|
||||
|
||||
config_get path "$cfg" path
|
||||
|
||||
[ "$path" = "$from" ] || return
|
||||
|
||||
uci set "wireless.${cfg}.path=${to}"
|
||||
WIRELESS_CHANGED=true
|
||||
|
||||
logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
|
||||
}
|
||||
|
||||
migrate_radio()
|
||||
{
|
||||
local from="$1" to="$2"
|
||||
|
||||
config_load wireless
|
||||
|
||||
# Check if there is already a section with the target path: In this case, the system
|
||||
# was already upgraded to a version without this migration script before; better bail out,
|
||||
# as we can't be sure we don't break more than we fix.
|
||||
PATH_EXISTS=false
|
||||
config_foreach check_radio wifi-device "$to"
|
||||
$PATH_EXISTS && return
|
||||
|
||||
config_foreach do_migrate_radio wifi-device "$from" "$to"
|
||||
}
|
||||
|
||||
|
||||
WIRELESS_CHANGED=false
|
||||
|
||||
case "$(board_name)" in
|
||||
tplink,tl-wdr4900-v1)
|
||||
migrate_radio 'ffe09000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
|
||||
migrate_radio 'ffe0a000.pcie/pci0001:02/0001:02:00.0/0001:03:00.0' 'ffe0a000.pcie/pcia000:02/a000:02:00.0/a000:03:00.0'
|
||||
;;
|
||||
esac
|
||||
|
||||
$WIRELESS_CHANGED && uci commit wireless
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2013 OpenWrt.org
|
||||
#
|
||||
|
||||
mpc85xx_set_preinit_iface() {
|
||||
ifname=eth0
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main mpc85xx_set_preinit_iface
|
||||
12
target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
Executable file
12
target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# Copyright (C) 2011 OpenWrt.org
|
||||
#
|
||||
|
||||
PART_NAME=firmware
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
platform_check_image() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# use default for platform_do_upgrade()
|
||||
Reference in New Issue
Block a user