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
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:
29
target/linux/bcm4908/Makefile
Normal file
29
target/linux/bcm4908/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
ARCH:=aarch64
|
||||
BOARD:=bcm4908
|
||||
BOARDNAME:=Broadcom BCM4908 (ARMv8A CPUs Brahma-B53)
|
||||
FEATURES:=squashfs nand usb gpio
|
||||
CPU_TYPE:=cortex-a53
|
||||
SUBTARGETS:=generic
|
||||
|
||||
KERNEL_PATCHVER:=6.1
|
||||
KERNEL_TESTING_PATCHVER:=6.6
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Broadcom BCM4908 SoC family routers.
|
||||
endef
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
KERNELNAME:=Image dtbs
|
||||
|
||||
DEFAULT_PACKAGES += \
|
||||
bcm4908img fdt-utils uboot-envtools \
|
||||
kmod-gpio-button-hotplug \
|
||||
kmod-usb-ohci kmod-usb2 kmod-usb3 \
|
||||
kmod-usb-ledtrig-usbport
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
25
target/linux/bcm4908/base-files/etc/board.d/02_network
Normal file
25
target/linux/bcm4908/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
|
||||
|
||||
. /lib/functions/system.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
bcm4908_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
asus,gt-ac5300)
|
||||
ucidef_set_interface_lan "lan1 lan2 lan5 lan6 sw"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
board_config_update
|
||||
board=$(board_name)
|
||||
bcm4908_setup_interfaces "$board"
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
uci set network.@globals[0].packet_steering="1"
|
||||
73
target/linux/bcm4908/base-files/lib/functions/bcm4908.sh
Normal file
73
target/linux/bcm4908/base-files/lib/functions/bcm4908.sh
Normal file
@@ -0,0 +1,73 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
|
||||
|
||||
FS_STATE_READY=2
|
||||
|
||||
# $(1): file to read from
|
||||
# $(2): offset in bytes
|
||||
get_hex_u32_le() {
|
||||
dd if="$1" skip=$2 bs=1 count=4 2>/dev/null | hexdump -v -e '1/4 "%02x"'
|
||||
}
|
||||
|
||||
# Setup /tmp/env.config to provide "metadata" UBI volume access
|
||||
#
|
||||
# It can be used with "fw_printenv -c /tmp/env.config"
|
||||
bcm4908_pkgtb_setup_env_config() {
|
||||
local size=$((0x$(get_hex_u32_le /dev/ubi0_1 4)))
|
||||
|
||||
dd if=/dev/ubi0_1 of=/tmp/env.head count=8 iflag=count_bytes
|
||||
dd if=/dev/ubi0_1 of=/tmp/env.body skip=8 iflag=skip_bytes
|
||||
printf "%s\t0x%x\t0x%x\t0x%x" "/tmp/env.body" 0x0 $size $size > /tmp/env.config
|
||||
}
|
||||
|
||||
bcm4908_committed_image_seq() {
|
||||
bcm4908_pkgtb_setup_env_config
|
||||
|
||||
commited="$(fw_printenv -n -c /tmp/env.config COMMITTED)"
|
||||
[ -n "$commited" ] && {
|
||||
seq=$(fw_printenv -n -c /tmp/env.config SEQ | cut -d ',' -f $commited)
|
||||
[ -n "$seq" ] && {
|
||||
echo $seq
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
echo "Failed to read COMMITED and SEQ from metadata1" >&2
|
||||
}
|
||||
|
||||
# Make sure "rootfs_data" UBI volume matches currently flashed image
|
||||
#
|
||||
# On mismatch "rootfs_data" will be wiped and assigned
|
||||
#
|
||||
# $1: UBI volume of "rootfs_data" (e.g. ubi0_123)
|
||||
bcm4908_verify_rootfs_data() {
|
||||
local ubivol="$1"
|
||||
local dir=/tmp/rootfs_data
|
||||
local seq="$(bcm4908_committed_image_seq)"
|
||||
|
||||
[ -z "$seq" ] && return
|
||||
|
||||
mkdir $dir
|
||||
if ! mount -t ubifs /dev/$ubivol $dir; then
|
||||
echo "Failed to mount $ubivol UBI volume" >&2
|
||||
rmdir $dir
|
||||
return
|
||||
fi
|
||||
|
||||
# Wipe rootfs_data if it doesn't belong to us
|
||||
[ "$(readlink $dir/.openwrt-image-seq)" != "$seq" ] && {
|
||||
echo "Removing \"rootfs_data\" content"
|
||||
rm -rf $dir/..?* $dir/.[!.]* $dir/*
|
||||
}
|
||||
|
||||
# If rootfs_data is clean (or was just wiped) claim it
|
||||
[ -z "$(ls -A $dir)" ] && {
|
||||
echo "Assigning \"rootfs_data\" to the current firmware"
|
||||
# Claim this "rootfs_data"
|
||||
ln -s $seq $dir/.openwrt-image-seq
|
||||
# Mark it ready to avoid "mount_root" wiping it again
|
||||
ln -s $FS_STATE_READY $dir/.fs_state
|
||||
}
|
||||
|
||||
umount $dir
|
||||
rmdir $dir
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
|
||||
|
||||
. /lib/functions/bcm4908.sh
|
||||
|
||||
rootfs_create() {
|
||||
local blocks
|
||||
|
||||
blocks=$(cat /sys/class/ubi/ubi0/avail_eraseblocks)
|
||||
[ -z "$blocks" ] && {
|
||||
echo "Failed to read amount of available erase blocks" >&2
|
||||
return
|
||||
}
|
||||
|
||||
# Use 80% of remaining flash size for "rootfs_data"
|
||||
ubimkvol /dev/ubi0 -n 20 -N rootfs_data --lebs $((blocks / 100 * 80))
|
||||
mknod -m 0600 /dev/ubi0_20 c 252 21
|
||||
|
||||
bcm4908_verify_rootfs_data ubi0_20
|
||||
}
|
||||
|
||||
rootfs_prepare() {
|
||||
# Do nothing on CFE devices
|
||||
ubinfo /dev/ubi0 -N metadata1 > /dev/null 2>&1 || return
|
||||
|
||||
# Find UBI volume device (e.g. ubi0_123)
|
||||
local ubivol="$(grep rootfs_data /sys/class/ubi/ubi*/name | sed -n 's/.*\(ubi\d*_\d*\).*/\1/p')"
|
||||
if [ -n "$ubivol" ]; then
|
||||
bcm4908_verify_rootfs_data $ubivol
|
||||
else
|
||||
echo "Creating \"rootfs_data\" UBI volume"
|
||||
rootfs_create
|
||||
fi
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main rootfs_prepare
|
||||
439
target/linux/bcm4908/base-files/lib/upgrade/platform.sh
Normal file
439
target/linux/bcm4908/base-files/lib/upgrade/platform.sh
Normal file
@@ -0,0 +1,439 @@
|
||||
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
|
||||
|
||||
. /lib/functions/bcm4908.sh
|
||||
|
||||
RAMFS_COPY_BIN="bcm4908img expr grep ln fdtget fw_printenv fw_setenv readlink tr"
|
||||
|
||||
PART_NAME=firmware
|
||||
|
||||
BCM4908_FW_FORMAT=
|
||||
BCM4908_FW_BOARD_ID=
|
||||
BCM4908_FW_INT_IMG_FORMAT=
|
||||
|
||||
# $(1): file to read from
|
||||
# $(2): offset in bytes
|
||||
# $(3): length in bytes
|
||||
get_content() {
|
||||
dd if="$1" skip=$2 bs=1 count=$3 2>/dev/null
|
||||
}
|
||||
|
||||
# $(1): file to read from
|
||||
# $(2): offset in bytes
|
||||
get_hex_u32_le() {
|
||||
dd if="$1" skip=$2 bs=1 count=4 2>/dev/null | hexdump -v -e '1/4 "%02x"'
|
||||
}
|
||||
|
||||
# $(1): file to read from
|
||||
# $(2): offset in bytes
|
||||
get_hex_u32_be() {
|
||||
dd if="$1" skip=$2 bs=1 count=4 2>/dev/null | hexdump -v -e '1/1 "%02x"'
|
||||
}
|
||||
|
||||
platform_expected_image() {
|
||||
local machine=$(board_name)
|
||||
|
||||
case "$machine" in
|
||||
asus,gt-ac5300) echo "asus GT-AC5300";;
|
||||
netgear,r8000p) echo "chk U12H359T00_NETGEAR";;
|
||||
tplink,archer-c2300-v1) echo "";;
|
||||
esac
|
||||
}
|
||||
|
||||
platform_identify() {
|
||||
local magic
|
||||
local size
|
||||
|
||||
magic=$(get_hex_u32_be "$1" 0)
|
||||
case "$magic" in
|
||||
d00dfeed)
|
||||
BCM4908_FW_FORMAT="pkgtb"
|
||||
return
|
||||
;;
|
||||
2a23245e)
|
||||
local header_len=$((0x$(get_hex_u32_be "$1" 4)))
|
||||
local board_id_len=$(($header_len - 40))
|
||||
|
||||
BCM4908_FW_FORMAT="chk"
|
||||
BCM4908_FW_BOARD_ID=$(dd if="$1" skip=40 bs=1 count=$board_id_len 2>/dev/null | hexdump -v -e '1/1 "%c"')
|
||||
magic=$(get_hex_u32_be "$1" "$header_len")
|
||||
[ "$magic" = "d00dfeed" ] && {
|
||||
BCM4908_FW_INT_IMG_FORMAT="pkgtb"
|
||||
} || {
|
||||
BCM4908_FW_INT_IMG_FORMAT="bcm4908img"
|
||||
}
|
||||
BCM4908_FW_INT_IMG_EXTRACT_CMD="dd skip=$header_len iflag=skip_bytes"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
size=$(wc -c "$1" | cut -d ' ' -f 1)
|
||||
|
||||
magic=$(get_content "$1" $((size - 20 - 64 + 8)) 12)
|
||||
case "$magic" in
|
||||
GT-AC5300)
|
||||
local size=$(wc -c "$1" | cut -d ' ' -f 1)
|
||||
|
||||
BCM4908_FW_FORMAT="asus"
|
||||
BCM4908_FW_BOARD_ID=$(get_content "$1" $((size - 20 - 64 + 8)) 12)
|
||||
BCM4908_FW_INT_IMG_FORMAT="bcm4908img"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
# Detecting native format is a bit complex (it may start with CFE or
|
||||
# JFFS2) so just use bcm4908img instead of bash hacks.
|
||||
# Make it the last attempt as bcm4908img detects also vendor formats.
|
||||
bcm4908img info -i "$1" > /dev/null && {
|
||||
BCM4908_FW_FORMAT="bcm4908img"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# pkgtb helpers
|
||||
#
|
||||
|
||||
platform_pkgtb_get_image_name() {
|
||||
local configuration=$($2 < $1 | fdtget - /configurations default)
|
||||
[ -z "$configuration" ] && {
|
||||
echo "Failed to read default configuration from pkgtb" >&2
|
||||
return
|
||||
}
|
||||
|
||||
local image_name=$($2 < $1 | fdtget - /configurations/$configuration $3)
|
||||
[ -z "$image_name" ] && {
|
||||
echo "Failed to read $3 from pkgtb configuration \"$configuration\"" >&2
|
||||
return
|
||||
}
|
||||
|
||||
echo "$image_name"
|
||||
}
|
||||
|
||||
platform_pkgtb_get_image() {
|
||||
local cmd="${2:-cat}"
|
||||
|
||||
local image_name=$(platform_pkgtb_get_image_name "$1" "$cmd" "$3")
|
||||
|
||||
$cmd < $1 | fdtget -p - /images/$image_name | grep -Eq "^data$" && {
|
||||
$cmd < $1 | fdtget -t r - /images/$image_name data
|
||||
return
|
||||
}
|
||||
|
||||
$cmd < $1 | fdtget -p - /images/$image_name | grep -Eq "^data-position$" && {
|
||||
local data_position=$($cmd < $1 | fdtget - /images/$image_name data-position)
|
||||
local data_size=$($cmd < $1 | fdtget - /images/$image_name data-size)
|
||||
$cmd < $1 2>/dev/null | dd skip=$data_position count=$data_size iflag=skip_bytes,count_bytes
|
||||
return
|
||||
}
|
||||
|
||||
$cmd < $1 | fdtget -p - /images/$image_name | grep -Eq "^data-offset" && {
|
||||
local data_offset=$($cmd < $1 | fdtget - /images/$image_name data-offset)
|
||||
local totalsize=$(get_hex_u32_be "$1" 4)
|
||||
local data_position=$(((0x$totalsize + data_offset + 3) & ~3))
|
||||
local data_size=$($cmd < $1 | fdtget - /images/$image_name data-size)
|
||||
$cmd < $1 2>/dev/null | dd skip=$data_position count=$data_size iflag=skip_bytes,count_bytes
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
platform_pkgtb_get_upgrade_index() {
|
||||
case "$(fw_printenv -l /tmp -n -c /tmp/env.config COMMITTED)" in
|
||||
1) echo 2;;
|
||||
2) echo 1;;
|
||||
*) echo 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
platform_pkgtb_commit() {
|
||||
local size=$((0x$(get_hex_u32_le /dev/ubi0_1 4)))
|
||||
local valid1=0
|
||||
local valid2=0
|
||||
local seq1
|
||||
local seq2
|
||||
local tmp
|
||||
|
||||
# Read current values
|
||||
for valid in $(fw_printenv -l /tmp -n -c /tmp/env.config VALID | tr ',' ' '); do
|
||||
case "$valid" in
|
||||
1) valid0=1;;
|
||||
2) valid1=2;;
|
||||
esac
|
||||
done
|
||||
seq0=$(fw_printenv -l /tmp -n -c /tmp/env.config SEQ | cut -d ',' -f 1)
|
||||
seq1=$(fw_printenv -l /tmp -n -c /tmp/env.config SEQ | cut -d ',' -f 2)
|
||||
|
||||
# Calculate values
|
||||
case "$1" in
|
||||
1) valid0=1; seq0=$(((seq1 + 1) % 1000));;
|
||||
2) valid1=2; seq1=$(((seq0 + 1) % 1000));;
|
||||
esac
|
||||
|
||||
# Update variables
|
||||
fw_setenv -l /tmp -c /tmp/env.config COMMITTED "$1"
|
||||
fw_setenv -l /tmp -c /tmp/env.config VALID "$valid0,$valid1"
|
||||
fw_setenv -l /tmp -c /tmp/env.config SEQ "$seq0,$seq1"
|
||||
|
||||
# Write
|
||||
tmp=$(cat /tmp/env.head /tmp/env.body | wc -c)
|
||||
cat /tmp/env.head /tmp/env.body | ubiupdatevol /dev/ubi0_1 -s $tmp -
|
||||
}
|
||||
|
||||
#
|
||||
# check
|
||||
#
|
||||
|
||||
platform_check_pkgtb() {
|
||||
local cmd="${2:-cat}"
|
||||
|
||||
[ -n "$(platform_pkgtb_get_image_name "$1" "$cmd" "bootfs")" -a -n "$(platform_pkgtb_get_image_name "$1" "$cmd" "rootfs")" ]
|
||||
}
|
||||
|
||||
platform_check_image() {
|
||||
[ "$#" -gt 1 ] && return 1
|
||||
|
||||
local expected_image=$(platform_expected_image)
|
||||
local error=0
|
||||
|
||||
platform_identify "$1"
|
||||
[ -z "$BCM4908_FW_FORMAT" ] && {
|
||||
echo "Invalid image type. Please use firmware specific for this device."
|
||||
notify_firmware_broken
|
||||
return 1
|
||||
}
|
||||
echo "Found $BCM4908_FW_FORMAT firmware for device ${BCM4908_FW_BOARD_ID:----}"
|
||||
|
||||
local expected_image="$(platform_expected_image)"
|
||||
[ -n "$expected_image" -a -n "$BCM4908_FW_BOARD_ID" -a "$BCM4908_FW_FORMAT $BCM4908_FW_BOARD_ID" != "$expected_image" ] && {
|
||||
echo "Firmware doesn't match device ($expected_image)"
|
||||
error=1
|
||||
}
|
||||
|
||||
case "$BCM4908_FW_FORMAT" in
|
||||
"bcm4908img")
|
||||
bcm4908img info -i "$1" > /dev/null || {
|
||||
echo "Failed to validate BCM4908 image" >&2
|
||||
notify_firmware_broken
|
||||
return 1
|
||||
}
|
||||
|
||||
bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" || {
|
||||
# OpenWrt images have 1-openwrt dummy file in the bootfs.
|
||||
# Don't allow backup if it's missing
|
||||
notify_firmware_no_backup
|
||||
}
|
||||
;;
|
||||
"pkgtb")
|
||||
platform_check_pkgtb "$1" || {
|
||||
echo "Failed to validate pkgtb firmware" >&2
|
||||
notify_firmware_broken
|
||||
return 1
|
||||
}
|
||||
;;
|
||||
*)
|
||||
case "$BCM4908_FW_INT_IMG_FORMAT" in
|
||||
"bcm4908img")
|
||||
bcm4908img info -i "$1" > /dev/null || {
|
||||
echo "Failed to validate BCM4908 image" >&2
|
||||
notify_firmware_broken
|
||||
return 1
|
||||
}
|
||||
|
||||
bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" || {
|
||||
# OpenWrt images have 1-openwrt dummy file in the bootfs.
|
||||
# Don't allow backup if it's missing
|
||||
notify_firmware_no_backup
|
||||
}
|
||||
;;
|
||||
"pkgtb")
|
||||
platform_check_pkgtb "$1" "$BCM4908_FW_INT_IMG_EXTRACT_CMD" || {
|
||||
echo "Failed to validate pkgtb firmware" >&2
|
||||
notify_firmware_broken
|
||||
return 1
|
||||
}
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return $error
|
||||
}
|
||||
|
||||
#
|
||||
# upgrade
|
||||
#
|
||||
|
||||
platform_pkgtb_clean_rootfs_data() {
|
||||
local ubidev=$(nand_find_ubi $CI_UBIPART)
|
||||
local ubivol="$(nand_find_volume $ubidev rootfs_data)"
|
||||
|
||||
bcm4908_verify_rootfs_data "$ubivol"
|
||||
}
|
||||
|
||||
platform_do_upgrade_pkgtb() {
|
||||
local cmd="${2:-cat}"
|
||||
local size
|
||||
local idx bootfs_id rootfs_id
|
||||
|
||||
bcm4908_pkgtb_setup_env_config
|
||||
|
||||
idx=$(platform_pkgtb_get_upgrade_index)
|
||||
case "$idx" in
|
||||
1) bootfs_id=3; rootfs_id=4;;
|
||||
2) bootfs_id=5; rootfs_id=6;;
|
||||
esac
|
||||
|
||||
size=$(platform_pkgtb_get_image "$1" "$cmd" "bootfs" | wc -c)
|
||||
ubirmvol /dev/ubi0 -N bootfs$idx
|
||||
ubimkvol /dev/ubi0 -n $bootfs_id -N bootfs$idx -t static -s $size
|
||||
platform_pkgtb_get_image "$1" "$cmd" "bootfs" | ubiupdatevol /dev/ubi0_$bootfs_id -s $size -
|
||||
|
||||
size=$(platform_pkgtb_get_image "$1" "$cmd" "rootfs" | wc -c)
|
||||
ubirmvol /dev/ubi0 -N rootfs$idx
|
||||
ubimkvol /dev/ubi0 -n $rootfs_id -N rootfs$idx -t dynamic -s $size
|
||||
platform_pkgtb_get_image "$1" "$cmd" "rootfs" | ubiupdatevol /dev/ubi0_$rootfs_id -s $size -
|
||||
|
||||
platform_pkgtb_commit $idx
|
||||
|
||||
CI_UBIPART="image"
|
||||
platform_pkgtb_clean_rootfs_data
|
||||
nand_do_upgrade_success
|
||||
}
|
||||
|
||||
# $1: cferam index increment value
|
||||
platform_calc_new_cferam() {
|
||||
local inc="$1"
|
||||
local dir="/tmp/sysupgrade-bcm4908"
|
||||
|
||||
local mtd=$(find_mtd_part bootfs)
|
||||
[ -z "$mtd" ] && {
|
||||
echo "Failed to find bootfs partition" >&2
|
||||
return
|
||||
}
|
||||
|
||||
rm -fR $dir
|
||||
mkdir -p $dir
|
||||
mount -t jffs2 -o ro $mtd $dir || {
|
||||
echo "Failed to mount bootfs partition $mtd" >&2
|
||||
rm -fr $dir
|
||||
return
|
||||
}
|
||||
|
||||
local idx=$(ls $dir/cferam.??? | sed -n 's/.*cferam\.\(\d\d\d\)/\1/p')
|
||||
[ -z "$idx" ] && {
|
||||
echo "Failed to find cferam current index" >&2
|
||||
rm -fr $dir
|
||||
return
|
||||
}
|
||||
|
||||
umount $dir
|
||||
rm -fr $dir
|
||||
|
||||
idx=$(($(expr $idx + $inc) % 1000))
|
||||
|
||||
echo $(printf "cferam.%03d" $idx)
|
||||
}
|
||||
|
||||
platform_do_upgrade_ubi() {
|
||||
local dir="/tmp/sysupgrade-bcm4908"
|
||||
local inc=1
|
||||
|
||||
# Verify new bootfs size
|
||||
local mtd_bootfs_size=$(grep "\"bootfs\"" /proc/mtd | sed "s/mtd[0-9]*:[ \t]*\([^ \t]*\).*/\1/")
|
||||
[ -z "$mtd_bootfs_size" ] && {
|
||||
echo "Unable to find \"bootfs\" partition size"
|
||||
return
|
||||
}
|
||||
mtd_bootfs_size=$((0x$mtd_bootfs_size))
|
||||
local img_bootfs_size=$(bcm4908img extract -i "$1" -t bootfs | wc -c)
|
||||
[ $img_bootfs_size -gt $mtd_bootfs_size ] && {
|
||||
echo "New bootfs doesn't fit MTD partition."
|
||||
return
|
||||
}
|
||||
|
||||
# Find cferam name for new firmware
|
||||
# For UBI we always flash "firmware" so don't increase cferam index if
|
||||
# there is "fallback". That could result in cferam.999 & cferam.001
|
||||
[ -n "$(find_mtd_index backup)" -o -n "$(find_mtd_index fallback)" ] && inc=0
|
||||
local cferam=$(platform_calc_new_cferam $inc)
|
||||
[ -z "$cferam" ] && exit 1
|
||||
|
||||
# Prepare new firmware
|
||||
bcm4908img bootfs -i "$1" mv cferam.000 $cferam || {
|
||||
echo "Failed to rename cferam.000 to $cferam" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Extract rootfs for further flashing
|
||||
rm -fr $dir
|
||||
mkdir -p $dir
|
||||
bcm4908img extract -i "$1" -t rootfs > $dir/root || {
|
||||
echo "Failed to extract rootfs" >&2
|
||||
rm -fr $dir
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Flash bootfs MTD partition with new one
|
||||
mtd erase bootfs || {
|
||||
echo "Failed to erase bootfs" >&2
|
||||
rm -fr $dir
|
||||
exit 1
|
||||
}
|
||||
bcm4908img extract -i "$1" -t bootfs | mtd write - bootfs || {
|
||||
echo "Failed to flash bootfs" >&2
|
||||
rm -fr $dir
|
||||
exit 1
|
||||
}
|
||||
|
||||
nand_do_upgrade $dir/root
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
platform_identify "$1"
|
||||
|
||||
# Try NAND aware UBI upgrade for OpenWrt images
|
||||
case "$BCM4908_FW_FORMAT" in
|
||||
"bcm4908img")
|
||||
bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" && platform_do_upgrade_ubi "$1"
|
||||
;;
|
||||
"pkgtb")
|
||||
platform_do_upgrade_pkgtb "$1"
|
||||
;;
|
||||
*)
|
||||
case "$BCM4908_FW_INT_IMG_FORMAT" in
|
||||
"bcm4908img")
|
||||
bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" && platform_do_upgrade_ubi "$1"
|
||||
;;
|
||||
"pkgtb")
|
||||
platform_do_upgrade_pkgtb "$1" "$BCM4908_FW_INT_IMG_EXTRACT_CMD"
|
||||
;;
|
||||
*)
|
||||
echo "NAND aware sysupgrade is unsupported for $BCM4908_FW_FORMAT format"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# Above calls exit on success.
|
||||
# If we got here it isn't OpenWrt image or something went wrong.
|
||||
[ "$BCM4908_FW_FORMAT" = "pkgtb" -o "$BCM4908_FW_INT_IMG_FORMAT" = "pkgtb" ] && {
|
||||
echo "Failed to upgrade pkgtb. Fallback to raw flashing is impossible for this format." >&2
|
||||
exit 1
|
||||
}
|
||||
echo "Writing whole image to NAND flash. All erase counters will be lost."
|
||||
|
||||
# Find cferam name for new firmware
|
||||
local cferam=$(platform_calc_new_cferam 1)
|
||||
[ -z "$cferam" ] && exit 1
|
||||
|
||||
# Prepare new firmware
|
||||
bcm4908img bootfs -i "$1" mv cferam.000 $cferam || {
|
||||
echo "Failed to rename cferam.000 to $cferam" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Jush flash firmware partition as is
|
||||
[ -n "$(find_mtd_index backup)" ] && PART_NAME=backup
|
||||
[ -n "$(find_mtd_index fallback)" ] && PART_NAME=fallback
|
||||
mtd erase $PART_NAME
|
||||
default_do_upgrade "$1" "bcm4908img extract -t firmware"
|
||||
}
|
||||
29
target/linux/bcm4908/base-files/usr/libexec/platform/packet-steering.sh
Executable file
29
target/linux/bcm4908/base-files/usr/libexec/platform/packet-steering.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
packet_steering="$(uci -q get network.@globals[0].packet_steering)"
|
||||
num_cpus="$(grep -c "^processor.*:" /proc/cpuinfo)"
|
||||
flow_offloading="$(uci -q get firewall.@defaults[0].flow_offloading)"
|
||||
flow_offloading_hw="$(uci -q get firewall.@defaults[0].flow_offloading_hw)"
|
||||
rps_eth0=0
|
||||
rps_br_lan=0
|
||||
|
||||
[ "$packet_steering" = 1 ] && {
|
||||
if [ ${flow_offloading_hw:-0} -gt 0 ]; then
|
||||
# HW offloading
|
||||
# Not implemented
|
||||
:
|
||||
elif [ ${flow_offloading:-0} -gt 0 ]; then
|
||||
# SW offloading
|
||||
# BCM4908 always reaches ~940 Mb/s
|
||||
:
|
||||
else
|
||||
# Default
|
||||
case "$num_cpus" in
|
||||
2) rps_eth0=2; rps_br_lan=2;;
|
||||
4) rps_eth0=e; rps_br_lan=e;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
echo $rps_eth0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
|
||||
echo $rps_br_lan > /sys/class/net/br-lan/queues/rx-0/rps_cpus
|
||||
245
target/linux/bcm4908/config-6.1
Normal file
245
target/linux/bcm4908/config-6.1
Normal file
@@ -0,0 +1,245 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCMBCA=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_B53=y
|
||||
CONFIG_BCM4908_ENET=y
|
||||
CONFIG_BCM7038_WDT=y
|
||||
CONFIG_BCM7XXX_PHY=y
|
||||
CONFIG_BCM_NET_PHYLIB=y
|
||||
CONFIG_BCM_PMB=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLK_BCM_63XX=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMDLINE="earlycon=bcm63xx_uart,0xff800640 console=ttyS0,115200"
|
||||
CONFIG_CMDLINE_FROM_BOOTLOADER=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_GHASH_ARM64_CE=y
|
||||
CONFIG_CRYPTO_HASH_INFO=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_CRYPTO_ZSTD=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_BRCMSTB=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_LEDS_BCM63138=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LZO_COMPRESS=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
# CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not set
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MTD_BRCM_U_BOOT=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_NAND_BRCMNAND=y
|
||||
CONFIG_MTD_NAND_BRCMNAND_BCMBCA=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
|
||||
CONFIG_MTD_OF_PARTS_BCM4908=y
|
||||
# CONFIG_MTD_OF_PARTS_LINKSYS_NS is not set
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_SPLIT_CFE_BOOTFS=y
|
||||
# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_BCM_SF2=y
|
||||
CONFIG_NET_DSA_TAG_BRCM=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_LEGACY=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_NVMEM_U_BOOT_ENV=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
# CONFIG_PHY_BRCM_SATA is not set
|
||||
CONFIG_PHY_BRCM_USB=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_BCM4908=y
|
||||
# CONFIG_PINCTRL_SINGLE is not set
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_SYSCON=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RELOCATABLE=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
# CONFIG_SERIAL_8250 is not set
|
||||
CONFIG_SERIAL_BCM63XX=y
|
||||
CONFIG_SERIAL_BCM63XX_CONSOLE=y
|
||||
CONFIG_SGL_ALLOC=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XXHASH=y
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
CONFIG_ZONE_DMA32=y
|
||||
CONFIG_ZSTD_COMPRESS=y
|
||||
CONFIG_ZSTD_DECOMPRESS=y
|
||||
281
target/linux/bcm4908/config-6.6
Normal file
281
target/linux/bcm4908/config-6.6
Normal file
@@ -0,0 +1,281 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCMBCA=y
|
||||
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
|
||||
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
|
||||
CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_FORCE_MAX_ORDER=10
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_B53=y
|
||||
CONFIG_BCM4908_ENET=y
|
||||
CONFIG_BCM7038_WDT=y
|
||||
CONFIG_BCM7XXX_PHY=y
|
||||
CONFIG_BCM_NET_PHYLIB=y
|
||||
CONFIG_BCM_PMB=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y
|
||||
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CLK_BCM_63XX=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMDLINE="earlycon=bcm63xx_uart,0xff800640 console=ttyS0,115200"
|
||||
CONFIG_CMDLINE_FROM_BOOTLOADER=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_IPROC=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_GHASH_ARM64_CE=y
|
||||
CONFIG_CRYPTO_HASH_INFO=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_GF128MUL=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
CONFIG_CRYPTO_ZSTD=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FUNCTION_ALIGNMENT=4
|
||||
CONFIG_FUNCTION_ALIGNMENT_4B=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y
|
||||
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IOREMAP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_BRCMSTB=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_LEDS_BCM63138=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LZO_COMPRESS=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
# CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not set
|
||||
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MTD_BRCM_U_BOOT=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_NAND_BRCMNAND=y
|
||||
CONFIG_MTD_NAND_BRCMNAND_BCMBCA=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
|
||||
CONFIG_MTD_OF_PARTS_BCM4908=y
|
||||
# CONFIG_MTD_OF_PARTS_LINKSYS_NS is not set
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_SPLIT_CFE_BOOTFS=y
|
||||
# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_BCM_SF2=y
|
||||
CONFIG_NET_DSA_TAG_BRCM=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_LEGACY=y
|
||||
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
|
||||
CONFIG_NET_DSA_TAG_NONE=y
|
||||
CONFIG_NET_EGRESS=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_INGRESS=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NET_XGRESS=y
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_NVMEM_U_BOOT_ENV=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PER_VMA_LOCK=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLIB_LEDS=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
# CONFIG_PHY_BRCM_SATA is not set
|
||||
CONFIG_PHY_BRCM_USB=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_BCM4908=y
|
||||
# CONFIG_PINCTRL_SINGLE is not set
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_SYSCON=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RELOCATABLE=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
# CONFIG_SERIAL_8250 is not set
|
||||
CONFIG_SERIAL_BCM63XX=y
|
||||
CONFIG_SERIAL_BCM63XX_CONSOLE=y
|
||||
CONFIG_SGL_ALLOC=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XXHASH=y
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
CONFIG_ZONE_DMA32=y
|
||||
CONFIG_ZSTD_COMMON=y
|
||||
CONFIG_ZSTD_COMPRESS=y
|
||||
CONFIG_ZSTD_DECOMPRESS=y
|
||||
1
target/linux/bcm4908/generic/target.mk
Normal file
1
target/linux/bcm4908/generic/target.mk
Normal file
@@ -0,0 +1 @@
|
||||
BOARDNAME:=Generic
|
||||
138
target/linux/bcm4908/image/Makefile
Normal file
138
target/linux/bcm4908/image/Makefile
Normal file
@@ -0,0 +1,138 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
DEVICE_VARS += ASUS_PRODUCTID ASUS_BUILD_NO ASUS_FW_REV ASUS_EXT_NO
|
||||
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION
|
||||
DEVICE_VARS += SOC
|
||||
|
||||
define Image/Prepare
|
||||
cp bootfs*.its* $(KDIR)/
|
||||
sed -i "s=\$$$${images_dir}=$(STAGING_DIR_IMAGE)=" $(KDIR)/bootfs*.its*
|
||||
sed -i "s=\$$$${dts_dir}=$(DTS_DIR)=" $(KDIR)/bootfs*.its*
|
||||
endef
|
||||
|
||||
define Build/bootfs
|
||||
cat $@ | $(STAGING_DIR_HOST)/bin/lzma e -eos -si -so > $@.tmp
|
||||
mv $@.tmp $@
|
||||
sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs*.its*
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4908.its $(KDIR)/bootfs-bcm4908.itb
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4912.its $(KDIR)/bootfs-bcm4912.itb
|
||||
endef
|
||||
|
||||
define Build/bcm4908asus
|
||||
$(STAGING_DIR_HOST)/bin/bcm4908asus create -i $@ \
|
||||
-p $(ASUS_PRODUCTID) -b $(ASUS_BUILD_NO) -f $(ASUS_FW_REV) \
|
||||
-e $(ASUS_EXT_NO)
|
||||
endef
|
||||
|
||||
define Build/bcm4908img
|
||||
rm -fr $@-bootfs
|
||||
mkdir -p $@-bootfs
|
||||
cp -r $(DEVICE_NAME)/* $@-bootfs/
|
||||
touch $@-bootfs/1-openwrt
|
||||
cp $(DTS_DIR)/$(firstword $(DEVICE_DTS)).dtb $@-bootfs/94908.dtb
|
||||
cp $(KDIR)/bcm63xx-cfe/$(subst _,$(comma),$(DEVICE_NAME))/cferam.000 $@-bootfs/
|
||||
cp $(IMAGE_KERNEL) $@-bootfs/vmlinux.lz
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 --pad=0x800000 --little-endian --squash-uids \
|
||||
-v -e 128KiB -o $@-bootfs.jffs2 -d $@-bootfs -m none -n
|
||||
$(STAGING_DIR_HOST)/bin/bcm4908img create $@.new -f $@-bootfs.jffs2 \
|
||||
-a 0x20000 -f $@
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/bcm4908kernel
|
||||
$(STAGING_DIR_HOST)/bin/bcm4908kernel -i $@ -o $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/bcm4908lzma
|
||||
$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 -d22 $@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/pkgtb
|
||||
mv $@ $@.rootfs
|
||||
cp pkgtb-$(SOC).its $@.its
|
||||
sed -i "s=\$${bootfs}=$(KDIR)/bootfs-$(SOC).itb=" $@.its
|
||||
sed -i "s=\$${rootfs}=$@.rootfs=" $@.its
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@
|
||||
endef
|
||||
|
||||
define Device/Default
|
||||
KERNEL := kernel-bin | bcm4908lzma | bcm4908kernel
|
||||
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
|
||||
KERNEL_INITRAMFS_SUFFIX := .bin
|
||||
KERNEL_INITRAMFS := kernel-bin | bcm4908lzma | bcm4908kernel
|
||||
FILESYSTEMS := squashfs
|
||||
KERNEL_NAME := Image
|
||||
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
IMAGE/bin := append-ubi | bcm4908img
|
||||
endef
|
||||
|
||||
define Device/asus_gt-ac5300
|
||||
DEVICE_VENDOR := ASUS
|
||||
DEVICE_MODEL := GT-AC5300
|
||||
DEVICE_DTS := broadcom/bcmbca/bcm4908-asus-gt-ac5300
|
||||
IMAGES := bin
|
||||
IMAGE/bin := append-ubi | bcm4908img | bcm4908asus
|
||||
ASUS_PRODUCTID := GT-AC5300
|
||||
ASUS_BUILD_NO := 384
|
||||
ASUS_FW_REV := 3.0.0.4
|
||||
ASUS_EXT_NO := 21140
|
||||
endef
|
||||
TARGET_DEVICES += asus_gt-ac5300
|
||||
|
||||
define Device/asus_gt-ax6000
|
||||
DEVICE_VENDOR := ASUS
|
||||
DEVICE_MODEL := GT-AX6000
|
||||
DEVICE_DTS := broadcom/bcmbca/bcm4912-asus-gt-ax6000
|
||||
IMAGES := pkgtb
|
||||
IMAGE/pkgtb := append-rootfs | pkgtb
|
||||
SOC := bcm4912
|
||||
endef
|
||||
# TARGET_DEVICES += asus_gt-ax6000
|
||||
|
||||
define Device/netgear_r8000p
|
||||
DEVICE_VENDOR := Netgear
|
||||
DEVICE_MODEL := R8000P
|
||||
DEVICE_DTS := broadcom/bcmbca/bcm4906-netgear-r8000p
|
||||
IMAGES := bin
|
||||
IMAGE/chk := append-ubi | bcm4908img | netgear-chk
|
||||
NETGEAR_BOARD_ID := U12H359T00_NETGEAR
|
||||
NETGEAR_REGION := 1
|
||||
endef
|
||||
TARGET_DEVICES += netgear_r8000p
|
||||
|
||||
define Device/tplink_archer-c2300-v1
|
||||
DEVICE_VENDOR := TP-Link
|
||||
DEVICE_MODEL := Archer C2300
|
||||
DEVICE_VARIANT := v1
|
||||
DEVICE_DTS := broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1
|
||||
IMAGES := bin
|
||||
IMAGE/bin := append-ubi | bcm4908img
|
||||
BROKEN := y
|
||||
endef
|
||||
TARGET_DEVICES += tplink_archer-c2300-v1
|
||||
|
||||
define Device/netgear
|
||||
DEVICE_VENDOR := NETGEAR
|
||||
KERNEL := kernel-bin | bootfs
|
||||
IMAGES := chk
|
||||
IMAGE/chk := append-rootfs | pkgtb | netgear-chk
|
||||
NETGEAR_REGION := 1
|
||||
endef
|
||||
|
||||
define Device/netgear_raxe500
|
||||
DEVICE_MODEL := RAXE500
|
||||
$(Device/netgear)
|
||||
SOC := bcm4908
|
||||
NETGEAR_BOARD_ID := U12H449T00_NETGEAR
|
||||
endef
|
||||
# TARGET_DEVICES += netgear_raxe500
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
@@ -0,0 +1,2 @@
|
||||
@(#) $imageversion: HND1731918 $
|
||||
@(#) $imageversion: HND1731918 $
|
||||
@@ -0,0 +1 @@
|
||||
HND1731918
|
||||
48
target/linux/bcm4908/image/bootfs-bcm4908.its
Normal file
48
target/linux/bcm4908/image/bootfs-bcm4908.its
Normal file
@@ -0,0 +1,48 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/include/ "bootfs.itsi"
|
||||
|
||||
/ {
|
||||
images {
|
||||
uboot {
|
||||
data = /incbin/("${images_dir}/u-boot/u-boot-bcm4908.bin");
|
||||
};
|
||||
|
||||
fdt_uboot {
|
||||
data = /incbin/("${images_dir}/u-boot/u-boot-bcm4908.dtb");
|
||||
};
|
||||
|
||||
fdt_uboot_RAX220 {
|
||||
description = "dtb";
|
||||
data = /incbin/("${images_dir}/u-boot/RAX220.dtb");
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
fdt_linux_RAX220 {
|
||||
description = "dtb";
|
||||
data = /incbin/("${dts_dir}/broadcom/bcmbca/bcm4908-netgear-raxe500.dtb");
|
||||
arch = "arm64";
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
conf_ub_RAX220 {
|
||||
description = "RAX220";
|
||||
fdt = "fdt_uboot_RAX220";
|
||||
loadables = "atf", "uboot";
|
||||
};
|
||||
|
||||
conf_lx_RAX220 {
|
||||
description = "BRCM 63xxx linux";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt_linux_RAX220";
|
||||
};
|
||||
};
|
||||
};
|
||||
65
target/linux/bcm4908/image/bootfs-bcm4912.its
Normal file
65
target/linux/bcm4908/image/bootfs-bcm4912.its
Normal file
@@ -0,0 +1,65 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/include/ "bootfs.itsi"
|
||||
|
||||
/ {
|
||||
images {
|
||||
uboot {
|
||||
data = /incbin/("${images_dir}/u-boot/u-boot-bcm4912.bin");
|
||||
};
|
||||
|
||||
fdt_uboot {
|
||||
data = /incbin/("${images_dir}/u-boot/u-boot-bcm4912.dtb");
|
||||
};
|
||||
|
||||
fdt_uboot_GTAX6000 {
|
||||
description = "dtb";
|
||||
data = /incbin/("${images_dir}/u-boot/GTAX6000.dtb");
|
||||
arch = "arm64";
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
fdt_linux_GTAX6000 {
|
||||
description = "dtb";
|
||||
data = /incbin/("${dts_dir}/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dtb");
|
||||
arch = "arm64";
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
conf_ub_GTAX6000 {
|
||||
description = "GTAX6000";
|
||||
fdt = "fdt_uboot_GTAX6000";
|
||||
loadables = "atf", "uboot";
|
||||
};
|
||||
|
||||
conf_lx_GTAX6000 {
|
||||
description = "BRCM 63xxx linux";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt_linux_GTAX6000";
|
||||
};
|
||||
|
||||
conf_ub_GTAX6000_50991 {
|
||||
description = "GTAX6000_50991";
|
||||
fdt = "fdt_uboot_GTAX6000";
|
||||
loadables = "atf", "uboot";
|
||||
};
|
||||
|
||||
conf_lx_GTAX6000_50991 {
|
||||
description = "BRCM 63xxx linux";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt_linux_GTAX6000";
|
||||
};
|
||||
};
|
||||
};
|
||||
73
target/linux/bcm4908/image/bootfs.itsi
Normal file
73
target/linux/bcm4908/image/bootfs.itsi
Normal file
@@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "OpenWrt bootfs image";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
atf {
|
||||
description = "ATF";
|
||||
data = /incbin/("${images_dir}/bl31.bin");
|
||||
type = "firmware";
|
||||
arch = "arm64";
|
||||
os = "arm-trusted-firmware";
|
||||
compression = "none";
|
||||
load = <0x4000>;
|
||||
entry = <0x4000>;
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
uboot {
|
||||
description = "U-Boot";
|
||||
os = "U-Boot";
|
||||
arch = "arm64";
|
||||
compression = "none";
|
||||
load = <0x1000000>;
|
||||
entry = <0x1000000>;
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
kernel {
|
||||
description = "Linux kernel";
|
||||
data = /incbin/("${kernel}");
|
||||
type = "kernel";
|
||||
os = "linux";
|
||||
arch = "arm64";
|
||||
compression = "lzma";
|
||||
load = <0x80000>;
|
||||
entry = <0x80000>;
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
fdt_uboot {
|
||||
description = "dtb";
|
||||
type = "flat_dt";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf_uboot";
|
||||
|
||||
conf_uboot {
|
||||
description = "BRCM 63xxx with uboot";
|
||||
fdt = "fdt_uboot";
|
||||
loadables = "atf", "uboot";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
@(#) $imageversion: 5024HNDrc11R8000P2602103 $
|
||||
@(#) $imageversion: 5024HNDrc11R8000P2602103 $
|
||||
@(#) $changelist: Changelist: REL_502HND04rc11_BISON04T_REL_7_14_170_34Revision: 765096 $
|
||||
@(#) $changelist: Changelist: REL_502HND04rc11_BISON04T_REL_7_14_170_34Revision: 765096 $
|
||||
@@ -0,0 +1 @@
|
||||
5024HNDrc11R8000P2602103
|
||||
43
target/linux/bcm4908/image/pkgtb-bcm4908.its
Normal file
43
target/linux/bcm4908/image/pkgtb-bcm4908.its
Normal file
@@ -0,0 +1,43 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "Broadcom image upgrade package tree binary";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
bootfs_4908_a0+ {
|
||||
description = "bootfs";
|
||||
data = /incbin/("${bootfs}");
|
||||
type = "multi";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
nand_squashfs {
|
||||
description = "rootfs";
|
||||
data = /incbin/("${rootfs}");
|
||||
type = "filesystem";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf_4908_a0+_nand_squashfs";
|
||||
|
||||
conf_4908_a0+_nand_squashfs {
|
||||
description = "Brcm Image Bundle";
|
||||
bootfs = "bootfs_4908_a0+";
|
||||
rootfs = "nand_squashfs";
|
||||
compatible = "flash=nand;chip=4908;rev=a0+;ip=ipv6,ipv4;ddr=ddr3;fstype=squashfs";
|
||||
};
|
||||
};
|
||||
};
|
||||
43
target/linux/bcm4908/image/pkgtb-bcm4912.its
Normal file
43
target/linux/bcm4908/image/pkgtb-bcm4912.its
Normal file
@@ -0,0 +1,43 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "Broadcom image upgrade package tree binary";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
bootfs_4912_a0+ {
|
||||
description = "bootfs";
|
||||
data = /incbin/("${bootfs}");
|
||||
type = "multi";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
|
||||
nand_squashfs {
|
||||
description = "rootfs";
|
||||
data = /incbin/("${rootfs}");
|
||||
type = "filesystem";
|
||||
compression = "none";
|
||||
|
||||
hash-1 {
|
||||
algo = "sha256";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf_4912_a0+_nand_squashfs";
|
||||
|
||||
conf_4912_a0+_nand_squashfs {
|
||||
description = "Brcm Image Bundle";
|
||||
bootfs = "bootfs_4912_a0+";
|
||||
rootfs = "nand_squashfs";
|
||||
compatible = "flash=nand;chip=4912;rev=a0+;ip=ipv6,ipv4;ddr=ddr3,ddr4;fstype=squashfs";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
5022HNDrc7HND2221446
|
||||
BIN
target/linux/bcm4908/image/tplink_archer-c2300-v1/nvram.nvm
Executable file
BIN
target/linux/bcm4908/image/tplink_archer-c2300-v1/nvram.nvm
Executable file
Binary file not shown.
@@ -0,0 +1,31 @@
|
||||
From 68064196cffea33f090bd2e8d81cd5e20107ecf1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 3 Nov 2022 11:53:16 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add TWD block timer
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 TWD contains block with 4 timers. Add binding for it.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/r/20221103105316.21294-1-zajec5@gmail.com
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -280,6 +280,11 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
+ timer@0 {
|
||||
+ compatible = "brcm,bcm63138-timer";
|
||||
+ reg = <0x0 0x28>;
|
||||
+ };
|
||||
+
|
||||
watchdog@28 {
|
||||
compatible = "brcm,bcm6345-wdt";
|
||||
reg = <0x28 0x8>;
|
||||
@@ -0,0 +1,46 @@
|
||||
From 4f9fb09175e87a233787a2dee1e5dabb14deb022 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 3 Nov 2022 12:00:15 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm6858: add TWD block
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM6858 contains TWD block with timers, watchdog, and reset subblocks.
|
||||
Describe it.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/r/20221103110015.21761-1-zajec5@gmail.com
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
|
||||
@@ -109,6 +109,25 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0x0 0xff800000 0x62000>;
|
||||
|
||||
+ twd: timer-mfd@400 {
|
||||
+ compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon";
|
||||
+ reg = <0x400 0x4c>;
|
||||
+ ranges = <0x0 0x400 0x4c>;
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ timer@0 {
|
||||
+ compatible = "brcm,bcm63138-timer";
|
||||
+ reg = <0x0 0x28>;
|
||||
+ };
|
||||
+
|
||||
+ watchdog@28 {
|
||||
+ compatible = "brcm,bcm6345-wdt";
|
||||
+ reg = <0x28 0x8>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
uart0: serial@640 {
|
||||
compatible = "brcm,bcm6345-uart";
|
||||
reg = <0x640 0x18>;
|
||||
@@ -0,0 +1,134 @@
|
||||
From e567e58d6819adc002c57b81e16b88da24d3b4aa Mon Sep 17 00:00:00 2001
|
||||
From: Pierre Gondois <pierre.gondois@arm.com>
|
||||
Date: Tue, 22 Nov 2022 17:32:07 +0100
|
||||
Subject: [PATCH] arm64: dts: Update cache properties for broadcom
|
||||
|
||||
The DeviceTree Specification v0.3 specifies that the cache node
|
||||
'compatible' and 'cache-level' properties are 'required'. Cf.
|
||||
s3.8 Multi-level and Shared Cache Nodes
|
||||
The 'cache-unified' property should be present if one of the
|
||||
properties for unified cache is present ('cache-size', ...).
|
||||
|
||||
Update the Device Trees accordingly.
|
||||
|
||||
Acked-by: William Zhang <william.zhang@broadcom.com>
|
||||
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
|
||||
Link: https://lore.kernel.org/r/20221122163208.3810985-3-pierre.gondois@arm.com
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | 1 +
|
||||
arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | 4 ++++
|
||||
9 files changed, 12 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -63,6 +63,7 @@
|
||||
|
||||
l2: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
L2_0: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
L2_0: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
L2_0: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
L2_0: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
L2_0: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
|
||||
@@ -50,6 +50,7 @@
|
||||
};
|
||||
L2_0: l2-cache0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi
|
||||
@@ -79,6 +79,7 @@
|
||||
|
||||
CLUSTER0_L2: l2-cache@0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi
|
||||
@@ -108,18 +108,22 @@
|
||||
|
||||
CLUSTER0_L2: l2-cache@0 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
|
||||
CLUSTER1_L2: l2-cache@100 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
|
||||
CLUSTER2_L2: l2-cache@200 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
|
||||
CLUSTER3_L2: l2-cache@300 {
|
||||
compatible = "cache";
|
||||
+ cache-level = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
From f5d83b714e304d5f3229da434af2eeea033c4f5d Mon Sep 17 00:00:00 2001
|
||||
From: William Zhang <william.zhang@broadcom.com>
|
||||
Date: Mon, 6 Feb 2023 22:58:15 -0800
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: Add spi controller node
|
||||
|
||||
Add support for HSSPI controller in ARMv8 chip dts files.
|
||||
|
||||
Signed-off-by: William Zhang <william.zhang@broadcom.com>
|
||||
Link: https://lore.kernel.org/r/20230207065826.285013-5-william.zhang@broadcom.com
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 18 +++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm4912.dtsi | 20 +++++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm63146.dtsi | 19 ++++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm63158.dtsi | 19 ++++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm6813.dtsi | 20 +++++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm6856.dtsi | 18 +++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 18 +++++++++++++++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm94908.dts | 4 ++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm94912.dts | 4 ++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm963146.dts | 4 ++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm963158.dts | 4 ++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm96813.dts | 4 ++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm96856.dts | 4 ++++
|
||||
.../boot/dts/broadcom/bcmbca/bcm96858.dts | 4 ++++
|
||||
14 files changed, 160 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -107,6 +107,12 @@
|
||||
clock-frequency = <50000000>;
|
||||
clock-output-names = "periph";
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <400000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
soc {
|
||||
@@ -528,6 +534,18 @@
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
+ hsspi: spi@1000{
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm4908-hsspi", "brcm,bcmbca-hsspi-v1.0";
|
||||
+ reg = <0x1000 0x600>;
|
||||
+ interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
nand-controller@1800 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi
|
||||
@@ -79,6 +79,7 @@
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <200000000>;
|
||||
};
|
||||
+
|
||||
uart_clk: uart-clk {
|
||||
compatible = "fixed-factor-clock";
|
||||
#clock-cells = <0>;
|
||||
@@ -86,6 +87,12 @@
|
||||
clock-div = <4>;
|
||||
clock-mult = <1>;
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <200000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
psci {
|
||||
@@ -117,6 +124,19 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0x0 0xff800000 0x800000>;
|
||||
|
||||
+ hsspi: spi@1000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm4912-hsspi", "brcm,bcmbca-hsspi-v1.1";
|
||||
+ reg = <0x1000 0x600>, <0x2610 0x4>;
|
||||
+ reg-names = "hsspi", "spim-ctrl";
|
||||
+ interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
uart0: serial@12000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x12000 0x1000>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi
|
||||
@@ -60,6 +60,7 @@
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <200000000>;
|
||||
};
|
||||
+
|
||||
uart_clk: uart-clk {
|
||||
compatible = "fixed-factor-clock";
|
||||
#clock-cells = <0>;
|
||||
@@ -67,6 +68,12 @@
|
||||
clock-div = <4>;
|
||||
clock-mult = <1>;
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <200000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
psci {
|
||||
@@ -99,6 +106,18 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0x0 0xff800000 0x800000>;
|
||||
|
||||
+ hsspi: spi@1000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm63146-hsspi", "brcm,bcmbca-hsspi-v1.0";
|
||||
+ reg = <0x1000 0x600>;
|
||||
+ interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
uart0: serial@12000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x12000 0x1000>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi
|
||||
@@ -79,6 +79,7 @@
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <200000000>;
|
||||
};
|
||||
+
|
||||
uart_clk: uart-clk {
|
||||
compatible = "fixed-factor-clock";
|
||||
#clock-cells = <0>;
|
||||
@@ -86,6 +87,12 @@
|
||||
clock-div = <4>;
|
||||
clock-mult = <1>;
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <400000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
psci {
|
||||
@@ -117,6 +124,18 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0x0 0xff800000 0x800000>;
|
||||
|
||||
+ hsspi: spi@1000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm63158-hsspi", "brcm,bcmbca-hsspi-v1.0";
|
||||
+ reg = <0x1000 0x600>;
|
||||
+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
uart0: serial@12000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x12000 0x1000>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi
|
||||
@@ -79,6 +79,7 @@
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <200000000>;
|
||||
};
|
||||
+
|
||||
uart_clk: uart-clk {
|
||||
compatible = "fixed-factor-clock";
|
||||
#clock-cells = <0>;
|
||||
@@ -86,6 +87,12 @@
|
||||
clock-div = <4>;
|
||||
clock-mult = <1>;
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <200000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
psci {
|
||||
@@ -117,6 +124,19 @@
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0x0 0xff800000 0x800000>;
|
||||
|
||||
+ hsspi: spi@1000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm6813-hsspi", "brcm,bcmbca-hsspi-v1.1";
|
||||
+ reg = <0x1000 0x600>, <0x2610 0x4>;
|
||||
+ reg-names = "hsspi", "spim-ctrl";
|
||||
+ interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
uart0: serial@12000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x12000 0x1000>;
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi
|
||||
@@ -60,6 +60,12 @@
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <200000000>;
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <400000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
psci {
|
||||
@@ -100,5 +106,17 @@
|
||||
clock-names = "refclk";
|
||||
status = "disabled";
|
||||
};
|
||||
+
|
||||
+ hsspi: spi@1000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm6856-hsspi", "brcm,bcmbca-hsspi-v1.0";
|
||||
+ reg = <0x1000 0x600>;
|
||||
+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
};
|
||||
};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
|
||||
@@ -78,6 +78,12 @@
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <200000000>;
|
||||
};
|
||||
+
|
||||
+ hsspi_pll: hsspi-pll {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <400000000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
psci {
|
||||
@@ -137,5 +143,17 @@
|
||||
clock-names = "refclk";
|
||||
status = "disabled";
|
||||
};
|
||||
+
|
||||
+ hsspi: spi@1000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "brcm,bcm6858-hsspi", "brcm,bcmbca-hsspi-v1.0";
|
||||
+ reg = <0x1000 0x600>;
|
||||
+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&hsspi_pll &hsspi_pll>;
|
||||
+ clock-names = "hsspi", "pll";
|
||||
+ num-cs = <8>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
};
|
||||
};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts
|
||||
@@ -28,3 +28,7 @@
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&hsspi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
@@ -0,0 +1,81 @@
|
||||
From 477cad715de1dfc256a20da3ed83b62f3cb2944d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 28 Feb 2023 15:45:18 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add on-SoC USB ports
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BCM4908 has 3 USB controllers each with 2 USB ports. Home routers often
|
||||
have LEDs indicating state of selected USB ports. Describe those SoC USB
|
||||
ports to allow using them as LED trigger sources.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/all/20230228144520.21816-1-zajec5@gmail.com/
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 39 +++++++++++++++++++
|
||||
1 file changed, 39 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -148,6 +148,19 @@
|
||||
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&usb_phy PHY_TYPE_USB2>;
|
||||
status = "disabled";
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ ehci_port1: port@1 {
|
||||
+ reg = <1>;
|
||||
+ #trigger-source-cells = <0>;
|
||||
+ };
|
||||
+
|
||||
+ ehci_port2: port@2 {
|
||||
+ reg = <2>;
|
||||
+ #trigger-source-cells = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
ohci: usb@c400 {
|
||||
@@ -156,6 +169,19 @@
|
||||
interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&usb_phy PHY_TYPE_USB2>;
|
||||
status = "disabled";
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ ohci_port1: port@1 {
|
||||
+ reg = <1>;
|
||||
+ #trigger-source-cells = <0>;
|
||||
+ };
|
||||
+
|
||||
+ ohci_port2: port@2 {
|
||||
+ reg = <2>;
|
||||
+ #trigger-source-cells = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
xhci: usb@d000 {
|
||||
@@ -164,6 +190,19 @@
|
||||
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
|
||||
phys = <&usb_phy PHY_TYPE_USB3>;
|
||||
status = "disabled";
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ xhci_port1: port@1 {
|
||||
+ reg = <1>;
|
||||
+ #trigger-source-cells = <0>;
|
||||
+ };
|
||||
+
|
||||
+ xhci_port2: port@2 {
|
||||
+ reg = <2>;
|
||||
+ #trigger-source-cells = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
bus@80000 {
|
||||
@@ -0,0 +1,38 @@
|
||||
From 889e53ccccc29ff4bf8d4c89cca34e8768845747 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 28 Feb 2023 15:45:19 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add Netgear R8000P USB
|
||||
LED triggers
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This device has 2 USB LEDs meant to be triggered by devices in relevant
|
||||
USB ports.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/all/20230228144520.21816-2-zajec5@gmail.com/
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts
|
||||
@@ -58,12 +58,16 @@
|
||||
function = "usb2";
|
||||
color = <LED_COLOR_ID_WHITE>;
|
||||
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
|
||||
+ trigger-sources = <&ohci_port1>, <&ehci_port1>;
|
||||
+ linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
led-usb3 {
|
||||
function = "usb3";
|
||||
color = <LED_COLOR_ID_WHITE>;
|
||||
gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
|
||||
+ trigger-sources = <&ohci_port2>, <&ehci_port2>, <&xhci_port2>;
|
||||
+ linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
led-wifi {
|
||||
@@ -0,0 +1,41 @@
|
||||
From e6d356b146b75f1f77621aab7950a1eb550859f9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 28 Feb 2023 15:45:20 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add TP-Link C2300 USB
|
||||
LED triggers
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This device has 2 USB LEDs meant to be triggered by devices in relevant
|
||||
USB ports.
|
||||
|
||||
While at it fix typo in USB LED name.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/all/20230228144520.21816-3-zajec5@gmail.com/
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
.../dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts
|
||||
@@ -64,12 +64,16 @@
|
||||
function = "usb2";
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
|
||||
+ trigger-sources = <&ohci_port1>, <&ehci_port1>;
|
||||
+ linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
led-usb3 {
|
||||
- function = "usbd3";
|
||||
+ function = "usb3";
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
|
||||
+ trigger-sources = <&ohci_port2>, <&ehci_port2>, <&xhci_port2>;
|
||||
+ linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
led-brightness {
|
||||
@@ -0,0 +1,152 @@
|
||||
From 3a1cc23a75abcd9cea585eb84846507363d58397 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 25 Oct 2022 15:22:45 +0200
|
||||
Subject: [PATCH] net: broadcom: bcm4908_enet: use build_skb()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RX code can be more efficient with the build_skb(). Allocating actual
|
||||
SKB around eth packet buffer - right before passing it up - results in
|
||||
a better cache usage.
|
||||
|
||||
Without RPS (echo 0 > rps_cpus) BCM4908 NAT masq performance "jumps"
|
||||
between two speeds: ~900 Mbps and 940 Mbps (it's a 4 CPUs SoC). This
|
||||
change bumps the lower speed from 905 Mb/s to 918 Mb/s (tested using
|
||||
single stream iperf 2.0.5 traffic).
|
||||
|
||||
There are more optimizations to consider. One obvious to try is GRO
|
||||
however as BCM4908 doesn't do hw csum is may actually lower performance.
|
||||
Sometimes. Some early testing:
|
||||
|
||||
┌─────────────────────────────────┬─────────────────────┬────────────────────┐
|
||||
│ │ netif_receive_skb() │ napi_gro_receive() │
|
||||
├─────────────────────────────────┼─────────────────────┼────────────────────┤
|
||||
│ netdev_alloc_skb() │ 905 Mb/s │ 892 Mb/s │
|
||||
│ napi_alloc_frag() + build_skb() │ 918 Mb/s │ 917 Mb/s │
|
||||
└─────────────────────────────────┴─────────────────────┴────────────────────┘
|
||||
|
||||
Another ideas:
|
||||
1. napi_build_skb()
|
||||
2. skb_copy_from_linear_data() for small packets
|
||||
|
||||
Those need proper testing first though. That can be done later.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/r/20221025132245.22871-1-zajec5@gmail.com
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bcm4908_enet.c | 53 +++++++++++++-------
|
||||
1 file changed, 36 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
|
||||
@@ -36,13 +36,24 @@
|
||||
#define ENET_MAX_ETH_OVERHEAD (ETH_HLEN + BRCM_MAX_TAG_LEN + VLAN_HLEN + \
|
||||
ETH_FCS_LEN + 4) /* 32 */
|
||||
|
||||
+#define ENET_RX_SKB_BUF_SIZE (NET_SKB_PAD + NET_IP_ALIGN + \
|
||||
+ ETH_HLEN + BRCM_MAX_TAG_LEN + VLAN_HLEN + \
|
||||
+ ENET_MTU_MAX + ETH_FCS_LEN + 4)
|
||||
+#define ENET_RX_SKB_BUF_ALLOC_SIZE (SKB_DATA_ALIGN(ENET_RX_SKB_BUF_SIZE) + \
|
||||
+ SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
|
||||
+#define ENET_RX_BUF_DMA_OFFSET (NET_SKB_PAD + NET_IP_ALIGN)
|
||||
+#define ENET_RX_BUF_DMA_SIZE (ENET_RX_SKB_BUF_SIZE - ENET_RX_BUF_DMA_OFFSET)
|
||||
+
|
||||
struct bcm4908_enet_dma_ring_bd {
|
||||
__le32 ctl;
|
||||
__le32 addr;
|
||||
} __packed;
|
||||
|
||||
struct bcm4908_enet_dma_ring_slot {
|
||||
- struct sk_buff *skb;
|
||||
+ union {
|
||||
+ void *buf; /* RX */
|
||||
+ struct sk_buff *skb; /* TX */
|
||||
+ };
|
||||
unsigned int len;
|
||||
dma_addr_t dma_addr;
|
||||
};
|
||||
@@ -260,22 +271,21 @@ static int bcm4908_enet_dma_alloc_rx_buf
|
||||
u32 tmp;
|
||||
int err;
|
||||
|
||||
- slot->len = ENET_MTU_MAX + ENET_MAX_ETH_OVERHEAD;
|
||||
-
|
||||
- slot->skb = netdev_alloc_skb(enet->netdev, slot->len);
|
||||
- if (!slot->skb)
|
||||
+ slot->buf = napi_alloc_frag(ENET_RX_SKB_BUF_ALLOC_SIZE);
|
||||
+ if (!slot->buf)
|
||||
return -ENOMEM;
|
||||
|
||||
- slot->dma_addr = dma_map_single(dev, slot->skb->data, slot->len, DMA_FROM_DEVICE);
|
||||
+ slot->dma_addr = dma_map_single(dev, slot->buf + ENET_RX_BUF_DMA_OFFSET,
|
||||
+ ENET_RX_BUF_DMA_SIZE, DMA_FROM_DEVICE);
|
||||
err = dma_mapping_error(dev, slot->dma_addr);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to map DMA buffer: %d\n", err);
|
||||
- kfree_skb(slot->skb);
|
||||
- slot->skb = NULL;
|
||||
+ skb_free_frag(slot->buf);
|
||||
+ slot->buf = NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
- tmp = slot->len << DMA_CTL_LEN_DESC_BUFLENGTH_SHIFT;
|
||||
+ tmp = ENET_RX_BUF_DMA_SIZE << DMA_CTL_LEN_DESC_BUFLENGTH_SHIFT;
|
||||
tmp |= DMA_CTL_STATUS_OWN;
|
||||
if (idx == enet->rx_ring.length - 1)
|
||||
tmp |= DMA_CTL_STATUS_WRAP;
|
||||
@@ -315,11 +325,11 @@ static void bcm4908_enet_dma_uninit(stru
|
||||
|
||||
for (i = rx_ring->length - 1; i >= 0; i--) {
|
||||
slot = &rx_ring->slots[i];
|
||||
- if (!slot->skb)
|
||||
+ if (!slot->buf)
|
||||
continue;
|
||||
dma_unmap_single(dev, slot->dma_addr, slot->len, DMA_FROM_DEVICE);
|
||||
- kfree_skb(slot->skb);
|
||||
- slot->skb = NULL;
|
||||
+ skb_free_frag(slot->buf);
|
||||
+ slot->buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,6 +585,7 @@ static int bcm4908_enet_poll_rx(struct n
|
||||
while (handled < weight) {
|
||||
struct bcm4908_enet_dma_ring_bd *buf_desc;
|
||||
struct bcm4908_enet_dma_ring_slot slot;
|
||||
+ struct sk_buff *skb;
|
||||
u32 ctl;
|
||||
int len;
|
||||
int err;
|
||||
@@ -598,16 +609,24 @@ static int bcm4908_enet_poll_rx(struct n
|
||||
|
||||
if (len < ETH_ZLEN ||
|
||||
(ctl & (DMA_CTL_STATUS_SOP | DMA_CTL_STATUS_EOP)) != (DMA_CTL_STATUS_SOP | DMA_CTL_STATUS_EOP)) {
|
||||
- kfree_skb(slot.skb);
|
||||
+ skb_free_frag(slot.buf);
|
||||
enet->netdev->stats.rx_dropped++;
|
||||
break;
|
||||
}
|
||||
|
||||
- dma_unmap_single(dev, slot.dma_addr, slot.len, DMA_FROM_DEVICE);
|
||||
+ dma_unmap_single(dev, slot.dma_addr, ENET_RX_BUF_DMA_SIZE, DMA_FROM_DEVICE);
|
||||
+
|
||||
+ skb = build_skb(slot.buf, ENET_RX_SKB_BUF_ALLOC_SIZE);
|
||||
+ if (unlikely(!skb)) {
|
||||
+ skb_free_frag(slot.buf);
|
||||
+ enet->netdev->stats.rx_dropped++;
|
||||
+ break;
|
||||
+ }
|
||||
+ skb_reserve(skb, ENET_RX_BUF_DMA_OFFSET);
|
||||
+ skb_put(skb, len - ETH_FCS_LEN);
|
||||
+ skb->protocol = eth_type_trans(skb, enet->netdev);
|
||||
|
||||
- skb_put(slot.skb, len - ETH_FCS_LEN);
|
||||
- slot.skb->protocol = eth_type_trans(slot.skb, enet->netdev);
|
||||
- netif_receive_skb(slot.skb);
|
||||
+ netif_receive_skb(skb);
|
||||
|
||||
enet->netdev->stats.rx_packets++;
|
||||
enet->netdev->stats.rx_bytes += len;
|
||||
@@ -0,0 +1,45 @@
|
||||
From 471ef777ec79baadc5cd9773d08f95f49cf5e2b1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 31 Oct 2022 11:48:56 +0100
|
||||
Subject: [PATCH] net: broadcom: bcm4908_enet: report queued and transmitted
|
||||
bytes
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This allows BQL to operate avoiding buffer bloat and reducing latency.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/r/20221031104856.32388-1-zajec5@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bcm4908_enet.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
|
||||
@@ -505,6 +505,7 @@ static int bcm4908_enet_stop(struct net_
|
||||
netif_carrier_off(netdev);
|
||||
napi_disable(&rx_ring->napi);
|
||||
napi_disable(&tx_ring->napi);
|
||||
+ netdev_reset_queue(netdev);
|
||||
|
||||
bcm4908_enet_dma_rx_ring_disable(enet, &enet->rx_ring);
|
||||
bcm4908_enet_dma_tx_ring_disable(enet, &enet->tx_ring);
|
||||
@@ -564,6 +565,8 @@ static netdev_tx_t bcm4908_enet_start_xm
|
||||
if (ring->write_idx + 1 == ring->length - 1)
|
||||
tmp |= DMA_CTL_STATUS_WRAP;
|
||||
|
||||
+ netdev_sent_queue(enet->netdev, skb->len);
|
||||
+
|
||||
buf_desc->addr = cpu_to_le32((uint32_t)slot->dma_addr);
|
||||
buf_desc->ctl = cpu_to_le32(tmp);
|
||||
|
||||
@@ -671,6 +674,7 @@ static int bcm4908_enet_poll_tx(struct n
|
||||
tx_ring->read_idx = 0;
|
||||
}
|
||||
|
||||
+ netdev_completed_queue(enet->netdev, handled, bytes);
|
||||
enet->netdev->stats.tx_packets += handled;
|
||||
enet->netdev->stats.tx_bytes += bytes;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 28 Mar 2024 10:24:34 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: set
|
||||
brcm,wp-not-connected
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Every described BCM4908 board has WP pin not connected. This caused
|
||||
problems for drivers since day 0 but there was no property to describe
|
||||
that properly. Projects like OpenWrt were modifying Linux driver to deal
|
||||
with it.
|
||||
|
||||
It's not clear if that is hardware limitation or just reference design
|
||||
being copied over and over but this applies to all known / supported
|
||||
BCM4908 boards. Handle it by marking WP as not connected by default.
|
||||
|
||||
Fixes: 2961f69f151c ("arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -593,6 +593,7 @@
|
||||
reg-names = "nand", "nand-int-base";
|
||||
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "nand_ctlrdy";
|
||||
+ brcm,wp-not-connected;
|
||||
status = "okay";
|
||||
|
||||
nandcs: nand@0 {
|
||||
@@ -0,0 +1,32 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 14 Jul 2023 08:28:41 +0200
|
||||
Subject: [PATCH] leds: bcm63138: rename dependency symbol ARCH_BCM4908 to
|
||||
ARCH_BCMBCA
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Symbol ARCH_BCM4908 has been merged/removed without updating leds
|
||||
Kconfig.
|
||||
|
||||
Fixes: dd5c672d7ca9 ("arm64: bcmbca: Merge ARCH_BCM4908 to ARCH_BCMBCA")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/leds/blink/Kconfig | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/leds/blink/Kconfig
|
||||
+++ b/drivers/leds/blink/Kconfig
|
||||
@@ -1,10 +1,10 @@
|
||||
config LEDS_BCM63138
|
||||
tristate "LED Support for Broadcom BCM63138 SoC"
|
||||
depends on LEDS_CLASS
|
||||
- depends on ARCH_BCM4908 || ARCH_BCM_5301X || BCM63XX || COMPILE_TEST
|
||||
+ depends on ARCH_BCMBCA || ARCH_BCM_5301X || BCM63XX || COMPILE_TEST
|
||||
depends on HAS_IOMEM
|
||||
depends on OF
|
||||
- default ARCH_BCM4908
|
||||
+ default ARCH_BCMBCA
|
||||
help
|
||||
This option enables support for LED controller that is part of
|
||||
BCM63138 SoC. The same hardware block is known to be also used
|
||||
@@ -0,0 +1,23 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 15 Feb 2021 22:01:03 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: limit amount of GPIOs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Linux driver can't handle more than 64 GPIOs
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -340,7 +340,7 @@
|
||||
gpio0: gpio-controller@500 {
|
||||
compatible = "brcm,bcm6345-gpio";
|
||||
reg-names = "dirout", "dat";
|
||||
- reg = <0x500 0x28>, <0x528 0x28>;
|
||||
+ reg = <0x500 0x8>, <0x528 0x8>;
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
@@ -0,0 +1,30 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Aug 2021 11:52:42 +0200
|
||||
Subject: [PATCH] arm64: don't issue HVC on boot
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Broadcom's CFE loader seems to miss setting SCR_EL3.HCE which results in
|
||||
generating an UNDEF and kernel panic on the first HVC.
|
||||
|
||||
HVC gets issued by kernels 5.12+ while booting, by kexec and KVM. Until
|
||||
someone finds a workaround we have to avoid all above.
|
||||
|
||||
Workarounds: 0c93df9622d4 ("arm64: Initialise as nVHE before switching to VHE")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
arch/arm64/kernel/hyp-stub.S | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/kernel/hyp-stub.S
|
||||
+++ b/arch/arm64/kernel/hyp-stub.S
|
||||
@@ -301,7 +301,7 @@ SYM_FUNC_START(finalise_el2)
|
||||
b.ne 1f
|
||||
|
||||
mov x0, #HVC_FINALISE_EL2
|
||||
- hvc #0
|
||||
+// hvc #0
|
||||
1:
|
||||
ret
|
||||
SYM_FUNC_END(finalise_el2)
|
||||
@@ -0,0 +1,46 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 15 Feb 2021 23:59:26 +0100
|
||||
Subject: [PATCH] net: dsa: bcm_sf2: enable GPHY for switch probing
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
GPHY needs to be enabled to succesfully probe & setup switch port
|
||||
connected to it. Otherwise hardcoding PHY OUI would be required.
|
||||
|
||||
Before:
|
||||
brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch wan (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 7
|
||||
|
||||
After:
|
||||
brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch wan (uninitialized): PHY [800c05c0.mdio--1:0c] driver [Generic PHY] (irq=POLL)
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/dsa/bcm_sf2.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1522,10 +1522,14 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
rev = reg_readl(priv, REG_PHY_REVISION);
|
||||
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
|
||||
|
||||
+ bcm_sf2_gphy_enable_set(priv->dev->ds, true);
|
||||
+
|
||||
ret = b53_switch_register(dev);
|
||||
if (ret)
|
||||
goto out_mdio;
|
||||
|
||||
+ bcm_sf2_gphy_enable_set(priv->dev->ds, false);
|
||||
+
|
||||
dev_info(&pdev->dev,
|
||||
"Starfighter 2 top: %x.%02x, core: %x.%02x, IRQs: %d, %d\n",
|
||||
priv->hw_params.top_rev >> 8, priv->hw_params.top_rev & 0xff,
|
||||
@@ -0,0 +1,30 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 16 Feb 2021 00:06:35 +0100
|
||||
Subject: [PATCH] net: dsa: bcm_sf2: keep GPHY enabled on the BCM4908
|
||||
|
||||
Trying to access disabled PHY results in MDIO_READ_FAIL and:
|
||||
[ 11.962886] brcm-sf2 80080000.switch wan: configuring for phy/internal link mode
|
||||
[ 11.972500] 8021q: adding VLAN 0 to HW filter on device wan
|
||||
[ 11.980205] ------------[ cut here ]------------
|
||||
[ 11.984885] WARNING: CPU: 0 PID: 7 at phy_error+0x10/0x58
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/dsa/bcm_sf2.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1536,6 +1536,12 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
|
||||
priv->irq0, priv->irq1);
|
||||
|
||||
+ /* BCM4908 has 5 GPHYs which means bcm_sf2_port_setup() will not enable
|
||||
+ * GPHY when needed. Leave it enabled here.
|
||||
+ */
|
||||
+ if (priv->type == BCM4908_DEVICE_ID)
|
||||
+ bcm_sf2_gphy_enable_set(priv->dev->ds, true);
|
||||
+
|
||||
return 0;
|
||||
|
||||
out_mdio:
|
||||
@@ -0,0 +1,31 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 28 Mar 2024 10:24:34 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: set
|
||||
brcm,wp-not-connected
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Every described BCM4908 board has WP pin not connected. This caused
|
||||
problems for drivers since day 0 but there was no property to describe
|
||||
that properly. Projects like OpenWrt were modifying Linux driver to deal
|
||||
with it.
|
||||
|
||||
It's not clear if that is hardware limitation or just reference design
|
||||
being copied over and over but this applies to all known / supported
|
||||
BCM4908 boards. Handle it by marking WP as not connected by default.
|
||||
|
||||
Fixes: 2961f69f151c ("arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -594,6 +594,7 @@
|
||||
reg-names = "nand", "nand-int-base";
|
||||
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "nand_ctlrdy";
|
||||
+ brcm,wp-not-connected;
|
||||
status = "okay";
|
||||
|
||||
nandcs: nand@0 {
|
||||
@@ -0,0 +1,23 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 15 Feb 2021 22:01:03 +0100
|
||||
Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: limit amount of GPIOs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Linux driver can't handle more than 64 GPIOs
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -341,7 +341,7 @@
|
||||
gpio0: gpio-controller@500 {
|
||||
compatible = "brcm,bcm6345-gpio";
|
||||
reg-names = "dirout", "dat";
|
||||
- reg = <0x500 0x28>, <0x528 0x28>;
|
||||
+ reg = <0x500 0x8>, <0x528 0x8>;
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
@@ -0,0 +1,30 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Aug 2021 11:52:42 +0200
|
||||
Subject: [PATCH] arm64: don't issue HVC on boot
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Broadcom's CFE loader seems to miss setting SCR_EL3.HCE which results in
|
||||
generating an UNDEF and kernel panic on the first HVC.
|
||||
|
||||
HVC gets issued by kernels 5.12+ while booting, by kexec and KVM. Until
|
||||
someone finds a workaround we have to avoid all above.
|
||||
|
||||
Workarounds: 0c93df9622d4 ("arm64: Initialise as nVHE before switching to VHE")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
arch/arm64/kernel/hyp-stub.S | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/kernel/hyp-stub.S
|
||||
+++ b/arch/arm64/kernel/hyp-stub.S
|
||||
@@ -252,7 +252,7 @@ SYM_FUNC_START(finalise_el2)
|
||||
b.ne 1f
|
||||
|
||||
mov x0, #HVC_FINALISE_EL2
|
||||
- hvc #0
|
||||
+// hvc #0
|
||||
1:
|
||||
ret
|
||||
SYM_FUNC_END(finalise_el2)
|
||||
@@ -0,0 +1,46 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 15 Feb 2021 23:59:26 +0100
|
||||
Subject: [PATCH] net: dsa: bcm_sf2: enable GPHY for switch probing
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
GPHY needs to be enabled to succesfully probe & setup switch port
|
||||
connected to it. Otherwise hardcoding PHY OUI would be required.
|
||||
|
||||
Before:
|
||||
brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch wan (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 7
|
||||
|
||||
After:
|
||||
brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
|
||||
brcm-sf2 80080000.switch wan (uninitialized): PHY [800c05c0.mdio--1:0c] driver [Generic PHY] (irq=POLL)
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/dsa/bcm_sf2.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1522,10 +1522,14 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
rev = reg_readl(priv, REG_PHY_REVISION);
|
||||
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
|
||||
|
||||
+ bcm_sf2_gphy_enable_set(priv->dev->ds, true);
|
||||
+
|
||||
ret = b53_switch_register(dev);
|
||||
if (ret)
|
||||
goto out_mdio;
|
||||
|
||||
+ bcm_sf2_gphy_enable_set(priv->dev->ds, false);
|
||||
+
|
||||
dev_info(&pdev->dev,
|
||||
"Starfighter 2 top: %x.%02x, core: %x.%02x, IRQs: %d, %d\n",
|
||||
priv->hw_params.top_rev >> 8, priv->hw_params.top_rev & 0xff,
|
||||
@@ -0,0 +1,30 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 16 Feb 2021 00:06:35 +0100
|
||||
Subject: [PATCH] net: dsa: bcm_sf2: keep GPHY enabled on the BCM4908
|
||||
|
||||
Trying to access disabled PHY results in MDIO_READ_FAIL and:
|
||||
[ 11.962886] brcm-sf2 80080000.switch wan: configuring for phy/internal link mode
|
||||
[ 11.972500] 8021q: adding VLAN 0 to HW filter on device wan
|
||||
[ 11.980205] ------------[ cut here ]------------
|
||||
[ 11.984885] WARNING: CPU: 0 PID: 7 at phy_error+0x10/0x58
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/dsa/bcm_sf2.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1536,6 +1536,12 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
|
||||
priv->irq0, priv->irq1);
|
||||
|
||||
+ /* BCM4908 has 5 GPHYs which means bcm_sf2_port_setup() will not enable
|
||||
+ * GPHY when needed. Leave it enabled here.
|
||||
+ */
|
||||
+ if (priv->type == BCM4908_DEVICE_ID)
|
||||
+ bcm_sf2_gphy_enable_set(priv->dev->ds, true);
|
||||
+
|
||||
return 0;
|
||||
|
||||
out_mdio:
|
||||
Reference in New Issue
Block a user