Initial commit
This commit is contained in:
25
target/linux/layerscape/base-files/etc/board.d/01_led
Executable file
25
target/linux/layerscape/base-files/etc/board.d/01_led
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ls1043v)
|
||||
ucidef_set_led_netdev "wan" "WAN LED" "ls1043v:yellow:wan" "eth4"
|
||||
;;
|
||||
traverse,ls1043s)
|
||||
ucidef_set_led_netdev "wan" "WAN LED" "ls1043s:yellow:wan" "eth4"
|
||||
ucidef_set_led_netdev "xgact" "10G Activity" "ls1043s:yellow:10gact" "eth6"
|
||||
ucidef_set_led_netdev "xglink" "10G Link" "ls1043s:green:10glink" "eth6"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
21
target/linux/layerscape/base-files/etc/board.d/02_network
Executable file
21
target/linux/layerscape/base-files/etc/board.d/02_network
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/system.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
traverse,ls1043v)
|
||||
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
|
||||
ucidef_set_interface_wan "eth4"
|
||||
;;
|
||||
traverse,ls1043s)
|
||||
ucidef_set_interface_lan "eth0 eth1 eth2 eth3 eth6"
|
||||
ucidef_set_interface_wan "eth4"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
28
target/linux/layerscape/base-files/etc/board.d/03_gpio_switches
Executable file
28
target/linux/layerscape/base-files/etc/board.d/03_gpio_switches
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ls1043v)
|
||||
ucidef_add_gpio_switch "lte_reset" "LTE Reset" "377"
|
||||
ucidef_add_gpio_switch "lte_disable" "LTE Airplane mode" "378"
|
||||
;;
|
||||
traverse,ls1043s)
|
||||
ucidef_add_gpio_switch "tensfp_txdisable" "SFP+ TX Disable" "378"
|
||||
ucidef_add_gpio_switch "gigsfp_txdisable" "SFP TX Disable" "381"
|
||||
ucidef_add_gpio_switch "lte_reset" "LTE Reset" "502"
|
||||
ucidef_add_gpio_switch "lte_disable" "LTE Airplane Mode" "394"
|
||||
ucidef_add_gpio_switch "lte_power" "LTE Power" "395"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
reorder_layerscape_interfaces() {
|
||||
if [ ! -f /tmp/sysinfo/board_name ]; then
|
||||
echo "No board name found, not doing reorder_layerscape_interfaces"
|
||||
return 0
|
||||
fi
|
||||
|
||||
board=$(cat /tmp/sysinfo/board_name)
|
||||
case "$board" in
|
||||
"traverse,ls1043v" | \
|
||||
"traverse,ls1043s")
|
||||
|
||||
# Reorder ethernet interfaces to match the physical order
|
||||
ip link set eth2 name fm1-mac3
|
||||
ip link set eth4 name eth2
|
||||
ip link set eth3 name fm1-mac4
|
||||
ip link set eth5 name eth3
|
||||
ip link set fm1-mac3 name eth4
|
||||
ip link set fm1-mac4 name eth5
|
||||
;;
|
||||
default)
|
||||
echo "Unknown board $board"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main reorder_layerscape_interfaces
|
||||
59
target/linux/layerscape/base-files/lib/upgrade/platform.sh
Normal file
59
target/linux/layerscape/base-files/lib/upgrade/platform.sh
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2015-2019 Traverse Technologies
|
||||
#
|
||||
platform_do_upgrade_traverse_nandubi() {
|
||||
bootsys=$(fw_printenv bootsys | awk -F= '{{print $2}}')
|
||||
newbootsys=2
|
||||
if [ "$bootsys" -eq "2" ]; then
|
||||
newbootsys=1
|
||||
fi
|
||||
|
||||
# If nand_do_upgrade succeeds, we don't have an opportunity to add any actions of
|
||||
# our own, so do it here and set back on failure
|
||||
echo "Setting bootsys to #${newbootsys}"
|
||||
fw_setenv bootsys $newbootsys
|
||||
CI_UBIPART="nandubi"
|
||||
CI_KERNPART="kernel${newbootsys}"
|
||||
CI_ROOTPART="rootfs${newbootsys}"
|
||||
nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys)
|
||||
|
||||
}
|
||||
platform_check_image() {
|
||||
local board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ls1043v | \
|
||||
traverse,ls1043s)
|
||||
nand_do_platform_check "traverse-ls1043" $1
|
||||
return $?
|
||||
;;
|
||||
*)
|
||||
echo "Sysupgrade is not currently supported on $board"
|
||||
;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
}
|
||||
platform_do_upgrade() {
|
||||
local board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ls1043v | \
|
||||
traverse,ls1043s)
|
||||
platform_do_upgrade_traverse_nandubi "$1"
|
||||
;;
|
||||
*)
|
||||
echo "Sysupgrade is not currently supported on $board"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
platform_pre_upgrade() {
|
||||
# Force the creation of fw_printenv.lock
|
||||
mkdir -p /var/lock
|
||||
touch /var/lock/fw_printenv.lock
|
||||
|
||||
export RAMFS_COPY_BIN="/usr/sbin/fw_printenv /usr/sbin/fw_setenv /usr/sbin/ubinfo /bin/echo ${RAMFS_COPY_BIN}"
|
||||
export RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock ${RAMFS_COPY_DATA}"
|
||||
}
|
||||
Reference in New Issue
Block a user