Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 12:51:15 +02:00
commit 27c9d80f51
10493 changed files with 1885777 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#
# Copyright (C) 2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
traverse,ten64)
ucidef_set_led_netdev "sfp1" "SFP 1" "ten64:green:sfp1:down" "eth8" "link tx rx"
ucidef_set_led_netdev "sfp2" "SFP 2" "ten64:green:sfp2:up" "eth9" "link tx rx"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,20 @@
. /lib/functions/system.sh
. /lib/functions/uci-defaults.sh
board_config_update
case "$(board_name)" in
fsl,ls1028a-rdb|\
fsl,ls1028a-rdb-sdboot)
ucidef_set_interfaces_lan_wan "swp0 swp1 swp2 swp3" "eth0"
;;
traverse,ten64)
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
ucidef_set_interface_wan "eth6"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,24 @@
#
# Copyright (C) 2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
traverse,ten64)
ucidef_add_gpio_switch "lte_reset" "Cell Modem Reset" "376"
ucidef_add_gpio_switch "lte_power" "Cell Modem Power" "377"
ucidef_add_gpio_switch "lte_disable" "Cell Modem Airplane mode" "378"
ucidef_add_gpio_switch "gnss_disable" "Cell Modem Disable GNSS receiver" "379"
ucidef_add_gpio_switch "lower_sfp_txidsable" "Lower SFP+ TX Disable" "369"
ucidef_add_gpio_switch "upper_sfp_txdisable" "Upper SFP+ TX Disable" "373"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,25 @@
#
# Copyright (C) 2020 OpenWrt.org
#
. /lib/functions.sh
case "$(board_name)" in
fsl,ls1012a-frwy-sdboot | \
fsl,ls1012a-rdb | \
fsl,ls1021a-iot-sdboot | \
fsl,ls1021a-twr | \
fsl,ls1021a-twr-sdboot | \
fsl,ls1043a-rdb | \
fsl,ls1043a-rdb-sdboot | \
fsl,ls1046a-rdb | \
fsl,ls1046a-rdb-sdboot | \
fsl,ls1088a-rdb | \
fsl,ls1088a-rdb-sdboot | \
fsl,ls2088a-rdb)
uci set system.@system[0].compat_version="2.0"
uci commit system
;;
esac
exit 0

View File

@@ -0,0 +1,13 @@
do_sysinfo_layerscape_fixup() {
[ -e /tmp/sysinfo/board_name ] || return
[ -e /proc/cmdline ] || return
cmdline=$(strings /proc/cmdline)
case "${cmdline}" in
*root=/dev/mmcblk*)
board="$(strings /tmp/sysinfo/board_name)-sdboot"
echo ${board} > /tmp/sysinfo/board_name
;;
esac
}
boot_hook_add preinit_main do_sysinfo_layerscape_fixup

View File

@@ -0,0 +1,28 @@
. /lib/functions.sh
. /lib/upgrade/common.sh
BOOTPART=/dev/mmcblk0p1
move_config() {
local board=$(board_name)
case "$board" in
fsl,ls1012a-frwy-sdboot | \
fsl,ls1021a-iot-sdboot | \
fsl,ls1021a-twr-sdboot | \
fsl,ls1028a-rdb-sdboot | \
fsl,ls1043a-rdb-sdboot | \
fsl,ls1046a-frwy-sdboot | \
fsl,ls1046a-rdb-sdboot | \
fsl,ls1088a-rdb-sdboot)
if [ -b $BOOTPART ]; then
mkdir -p /boot
mount -t ext4 -o rw,noatime $BOOTPART /boot 2>&1
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
umount /boot
fi
;;
esac
}
boot_hook_add preinit_mount_root move_config

View File

@@ -0,0 +1,163 @@
#
# Copyright 2015-2019 Traverse Technologies
# Copyright 2020 NXP
#
RAMFS_COPY_BIN=""
RAMFS_COPY_DATA=""
REQUIRE_IMAGE_METADATA=1
platform_do_upgrade_sdboot() {
local diskdev partdev parttype=ext4
local tar_file="$1"
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/}
export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
return 1
}
if export_partdevice partdev 1; then
mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt 2>&1
echo "Writing kernel..."
tar xf $tar_file ${board_dir}/kernel -O > /mnt/fitImage
umount /mnt
fi
echo "Erasing rootfs..."
dd if=/dev/zero of=/dev/mmcblk0p2 bs=1M > /dev/null 2>&1
echo "Writing rootfs..."
tar xf $tar_file ${board_dir}/root -O | dd of=/dev/mmcblk0p2 bs=512k > /dev/null 2>&1
}
platform_do_upgrade_traverse_slotubi() {
part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
echo "Active boot slot: ${part}"
new_active_sys="b"
if [ ! -z "${part}" ]; then
if [ "${part}" = "ubia" ]; then
CI_UBIPART="ubib"
else
CI_UBIPART="ubia"
new_active_sys="a"
fi
fi
echo "Updating UBI part ${CI_UBIPART}"
fw_setenv "openwrt_active_sys" "${new_active_sys}"
nand_do_upgrade "$1"
return $?
}
platform_copy_config_sdboot() {
local diskdev partdev parttype=ext4
export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
return 1
}
if export_partdevice partdev 1; then
mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt 2>&1
echo "Saving config backup..."
cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
umount /mnt
fi
}
platform_copy_config() {
local board=$(board_name)
case "$board" in
fsl,ls1012a-frwy-sdboot | \
fsl,ls1021a-iot-sdboot | \
fsl,ls1021a-twr-sdboot | \
fsl,ls1028a-rdb-sdboot | \
fsl,ls1043a-rdb-sdboot | \
fsl,ls1046a-frwy-sdboot | \
fsl,ls1046a-rdb-sdboot | \
fsl,ls1088a-rdb-sdboot | \
fsl,lx2160a-rdb-sdboot)
platform_copy_config_sdboot
;;
esac
}
platform_check_image() {
local board=$(board_name)
case "$board" in
traverse,ten64)
nand_do_platform_check "ten64-mtd" $1
return $?
;;
fsl,ls1012a-frdm | \
fsl,ls1012a-frwy-sdboot | \
fsl,ls1012a-rdb | \
fsl,ls1021a-iot-sdboot | \
fsl,ls1021a-twr | \
fsl,ls1021a-twr-sdboot | \
fsl,ls1028a-rdb | \
fsl,ls1028a-rdb-sdboot | \
fsl,ls1043a-rdb | \
fsl,ls1043a-rdb-sdboot | \
fsl,ls1046a-frwy | \
fsl,ls1046a-frwy-sdboot | \
fsl,ls1046a-rdb | \
fsl,ls1046a-rdb-sdboot | \
fsl,ls1088a-rdb | \
fsl,ls1088a-rdb-sdboot | \
fsl,ls2088a-rdb | \
fsl,lx2160a-rdb | \
fsl,lx2160a-rdb-sdboot)
return 0
;;
*)
echo "Sysupgrade is not currently supported on $board"
;;
esac
return 1
}
platform_do_upgrade() {
local board=$(board_name)
# Force the creation of fw_printenv.lock
mkdir -p /var/lock
touch /var/lock/fw_printenv.lock
case "$board" in
traverse,ten64)
platform_do_upgrade_traverse_slotubi "${1}"
;;
fsl,ls1012a-frdm | \
fsl,ls1012a-rdb | \
fsl,ls1021a-twr | \
fsl,ls1028a-rdb | \
fsl,ls1043a-rdb | \
fsl,ls1046a-frwy | \
fsl,ls1046a-rdb | \
fsl,ls1088a-rdb | \
fsl,ls2088a-rdb | \
fsl,lx2160a-rdb)
PART_NAME=firmware
default_do_upgrade "$1"
;;
fsl,ls1012a-frwy-sdboot | \
fsl,ls1021a-iot-sdboot | \
fsl,ls1021a-twr-sdboot | \
fsl,ls1028a-rdb-sdboot | \
fsl,ls1043a-rdb-sdboot | \
fsl,ls1046a-frwy-sdboot | \
fsl,ls1046a-rdb-sdboot | \
fsl,ls1088a-rdb-sdboot | \
fsl,lx2160a-rdb-sdboot)
platform_do_upgrade_sdboot "$1"
return 0
;;
*)
echo "Sysupgrade is not currently supported on $board"
;;
esac
}