Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
acb88c40ea
@ -87,11 +87,11 @@ define prepare_rootfs
|
||||
fi; \
|
||||
done || true \
|
||||
)
|
||||
awk -i inplace \
|
||||
$(if $(IB),,awk -i inplace \
|
||||
'/^Status:/ { \
|
||||
if ($$3 == "user") { $$3 = "ok" } \
|
||||
else { sub(/,\<user\>|\<user\>,/, "", $$3) } \
|
||||
}1' $(1)/usr/lib/opkg/status
|
||||
}1' $(1)/usr/lib/opkg/status)
|
||||
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status)
|
||||
@-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf
|
||||
rm -rf \
|
||||
|
||||
@ -4,26 +4,35 @@
|
||||
. /lib/functions/system.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# initialize defaults
|
||||
# File-local constants
|
||||
CONF_TAR=/tmp/sysupgrade.tgz
|
||||
ETCBACKUP_DIR=/etc/backup
|
||||
INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt
|
||||
COMMAND=/lib/upgrade/do_stage2
|
||||
|
||||
# File-local globals
|
||||
SAVE_OVERLAY=0
|
||||
SAVE_OVERLAY_PATH=
|
||||
SAVE_PARTITIONS=1
|
||||
SAVE_INSTALLED_PKGS=0
|
||||
SKIP_UNCHANGED=0
|
||||
CONF_IMAGE=
|
||||
CONF_BACKUP_LIST=0
|
||||
CONF_BACKUP=
|
||||
CONF_RESTORE=
|
||||
NEED_IMAGE=
|
||||
HELP=0
|
||||
TEST=0
|
||||
|
||||
# Globals accessed in other files
|
||||
export MTD_ARGS=""
|
||||
export MTD_CONFIG_ARGS=""
|
||||
export INTERACTIVE=0
|
||||
export VERBOSE=1
|
||||
export SAVE_CONFIG=1
|
||||
export SAVE_OVERLAY=0
|
||||
export SAVE_OVERLAY_PATH=
|
||||
export SAVE_PARTITIONS=1
|
||||
export SAVE_INSTALLED_PKGS=0
|
||||
export SKIP_UNCHANGED=0
|
||||
export CONF_IMAGE=
|
||||
export CONF_BACKUP_LIST=0
|
||||
export CONF_BACKUP=
|
||||
export CONF_RESTORE=
|
||||
export IGNORE_MINOR_COMPAT=0
|
||||
export NEED_IMAGE=
|
||||
export HELP=0
|
||||
export FORCE=0
|
||||
export TEST=0
|
||||
export CONFFILES=/tmp/sysupgrade.conffiles
|
||||
|
||||
# parse options
|
||||
while [ -n "$1" ]; do
|
||||
@ -32,18 +41,18 @@ while [ -n "$1" ]; do
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||
-n) export SAVE_CONFIG=0;;
|
||||
-c) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/etc;;
|
||||
-o) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;;
|
||||
-p) export SAVE_PARTITIONS=0;;
|
||||
-k) export SAVE_INSTALLED_PKGS=1;;
|
||||
-u) export SKIP_UNCHANGED=1;;
|
||||
-b|--create-backup) export CONF_BACKUP="$2" NEED_IMAGE=1; shift;;
|
||||
-r|--restore-backup) export CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
|
||||
-l|--list-backup) export CONF_BACKUP_LIST=1;;
|
||||
-f) export CONF_IMAGE="$2"; shift;;
|
||||
-c) SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/etc;;
|
||||
-o) SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;;
|
||||
-p) SAVE_PARTITIONS=0;;
|
||||
-k) SAVE_INSTALLED_PKGS=1;;
|
||||
-u) SKIP_UNCHANGED=1;;
|
||||
-b|--create-backup) CONF_BACKUP="$2" NEED_IMAGE=1; shift;;
|
||||
-r|--restore-backup) CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
|
||||
-l|--list-backup) CONF_BACKUP_LIST=1;;
|
||||
-f) CONF_IMAGE="$2"; shift;;
|
||||
-F|--force) export FORCE=1;;
|
||||
-T|--test) export TEST=1;;
|
||||
-h|--help) export HELP=1; break;;
|
||||
-T|--test) TEST=1;;
|
||||
-h|--help) HELP=1; break;;
|
||||
--ignore-minor-compat-version) export IGNORE_MINOR_COMPAT=1;;
|
||||
-*)
|
||||
echo "Invalid option: $1" >&2
|
||||
@ -54,14 +63,7 @@ while [ -n "$1" ]; do
|
||||
shift;
|
||||
done
|
||||
|
||||
export CONFFILES=/tmp/sysupgrade.conffiles
|
||||
export CONF_TAR=/tmp/sysupgrade.tgz
|
||||
export ETCBACKUP_DIR=/etc/backup
|
||||
export INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt
|
||||
|
||||
IMAGE="$1"
|
||||
|
||||
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 -o $HELP -gt 0 ] && {
|
||||
print_help() {
|
||||
cat <<EOF
|
||||
Usage: $0 [<upgrade-option>...] <image file or URL>
|
||||
$0 [-q] [-i] [-c] [-u] [-o] [-k] <backup-command> <file>
|
||||
@ -101,9 +103,20 @@ backup-command:
|
||||
sysupgrade -b. Does not create a backup file.
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
IMAGE="$1"
|
||||
|
||||
if [ $HELP -gt 0 ]; then
|
||||
print_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 ]; then
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -n "$IMAGE" -a -n "$NEED_IMAGE" ] && {
|
||||
cat <<-EOF
|
||||
-b|--create-backup and -r|--restore-backup do not perform a firmware upgrade.
|
||||
@ -142,7 +155,7 @@ list_static_conffiles() {
|
||||
\( -type f -o -type l \) $filter 2>/dev/null
|
||||
}
|
||||
|
||||
add_conffiles() {
|
||||
build_list_of_backup_config_files() {
|
||||
local file="$1"
|
||||
|
||||
( list_static_conffiles "$find_filter"; list_changed_conffiles ) |
|
||||
@ -150,7 +163,7 @@ add_conffiles() {
|
||||
return 0
|
||||
}
|
||||
|
||||
add_overlayfiles() {
|
||||
build_list_of_backup_overlay_files() {
|
||||
local file="$1"
|
||||
|
||||
local packagesfiles=$1.packagesfiles
|
||||
@ -202,12 +215,12 @@ add_overlayfiles() {
|
||||
|
||||
if [ $SAVE_OVERLAY = 1 ]; then
|
||||
[ ! -d /overlay/upper/etc ] && {
|
||||
echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2
|
||||
echo "Cannot find '/overlay/upper/etc', required for '-c' or '-o'" >&2
|
||||
exit 1
|
||||
}
|
||||
sysupgrade_init_conffiles="add_overlayfiles"
|
||||
sysupgrade_init_conffiles="build_list_of_backup_overlay_files"
|
||||
else
|
||||
sysupgrade_init_conffiles="add_conffiles"
|
||||
sysupgrade_init_conffiles="build_list_of_backup_config_files"
|
||||
fi
|
||||
|
||||
find_filter=""
|
||||
@ -221,10 +234,10 @@ fi
|
||||
|
||||
include /lib/upgrade
|
||||
|
||||
do_save_conffiles() {
|
||||
create_backup_archive() {
|
||||
local conf_tar="$1"
|
||||
local tmp
|
||||
local dir
|
||||
|
||||
local umount_etcbackup_dir=0
|
||||
|
||||
[ "$(rootfs_type)" = "tmpfs" ] && {
|
||||
echo "Cannot save config while running from ramdisk." >&2
|
||||
@ -235,54 +248,41 @@ do_save_conffiles() {
|
||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
||||
ask_bool 0 "Edit config file list" && vi "$CONFFILES"
|
||||
|
||||
# Mount root directory with temporary overlay on top of it.
|
||||
# This allows including extra (temporary) files in backup archive
|
||||
# without messing actual rootfs.
|
||||
tmp="$(mktemp -d -t overlay.XXXXXX)"
|
||||
mkdir -p "$tmp/upper" "$tmp/work" "$tmp/backup"
|
||||
dir="$tmp/backup"
|
||||
if ! mount -t overlay overlay -o lowerdir=/,upperdir="$tmp/upper",workdir="$tmp/work" "$dir"; then
|
||||
echo "Cannot mount backup overlay to $dir." >&2
|
||||
ask_bool 0 "Abort" && exit
|
||||
dir=""
|
||||
fi
|
||||
|
||||
if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
|
||||
echo "${INSTALLED_PACKAGES}" >> "$CONFFILES"
|
||||
mkdir -p "$dir/$ETCBACKUP_DIR"
|
||||
mkdir -p "$ETCBACKUP_DIR"
|
||||
# Avoid touching filesystem on each backup
|
||||
RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)"
|
||||
mkdir -p "$RAMFS/upper" "$RAMFS/work"
|
||||
mount -t overlay overlay -o lowerdir=$ETCBACKUP_DIR,upperdir=$RAMFS/upper,workdir=$RAMFS/work $ETCBACKUP_DIR &&
|
||||
umount_etcbackup_dir=1 || {
|
||||
echo "Cannot mount '$ETCBACKUP_DIR' as tmpfs to avoid touching disk while saving the list of installed packages." >&2
|
||||
ask_bool 0 "Abort" && exit
|
||||
}
|
||||
|
||||
# Format: pkg-name<TAB>{rom,overlay,unkown}
|
||||
# Format: pkg-name<TAB>{rom,overlay,unknown}
|
||||
# rom is used for pkgs in /rom, even if updated later
|
||||
find /usr/lib/opkg/info -name "*.control" \( \
|
||||
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
|
||||
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
||||
\( -exec echo {} unknown \; \) \
|
||||
\) | sed -e 's,.*/,,;s/\.control /\t/' > "$dir/${INSTALLED_PACKAGES}"
|
||||
\) | sed -e 's,.*/,,;s/\.control /\t/' > ${INSTALLED_PACKAGES}
|
||||
fi
|
||||
|
||||
mkdir -p $dir/etc/uci-defaults/
|
||||
touch $dir/etc/uci-defaults/10_disable_services
|
||||
for service in /etc/init.d/*; do
|
||||
if ! $service enabled; then
|
||||
echo "$service disable" >> $dir/etc/uci-defaults/10_disable_services
|
||||
fi
|
||||
done
|
||||
echo "exit 0" >> $dir/etc/uci-defaults/10_disable_services
|
||||
echo "/etc/uci-defaults/10_disable_services" >> "$CONFFILES"
|
||||
|
||||
v "Saving config files..."
|
||||
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
|
||||
sed -i -e 's,^/,,' "$CONFFILES"
|
||||
tar c${TAR_V}zf "$conf_tar" -C "${dir:-/}" -T "$CONFFILES"
|
||||
tar c${TAR_V}zf "$conf_tar" -C / -T "$CONFFILES"
|
||||
local err=$?
|
||||
if [ "$err" -ne 0 ]; then
|
||||
echo "Failed to create the configuration backup."
|
||||
rm -f "$conf_tar"
|
||||
fi
|
||||
|
||||
umount "$dir"
|
||||
rm -rf "$tmp"
|
||||
|
||||
[ "$umount_etcbackup_dir" -eq 1 ] && {
|
||||
umount "$ETCBACKUP_DIR"
|
||||
rm -rf "$RAMFS"
|
||||
}
|
||||
rm -f "$CONFFILES"
|
||||
|
||||
return "$err"
|
||||
@ -297,7 +297,7 @@ if [ $CONF_BACKUP_LIST -eq 1 ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$CONF_BACKUP" ]; then
|
||||
do_save_conffiles "$CONF_BACKUP"
|
||||
create_backup_archive "$CONF_BACKUP"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -367,7 +367,7 @@ if [ -n "$CONF_IMAGE" ]; then
|
||||
get_image "$CONF_IMAGE" "cat" > "$CONF_TAR"
|
||||
export SAVE_CONFIG=1
|
||||
elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then
|
||||
[ $TEST -eq 1 ] || do_save_conffiles "$CONF_TAR" || exit
|
||||
[ $TEST -eq 1 ] || create_backup_archive "$CONF_TAR" || exit
|
||||
export SAVE_CONFIG=1
|
||||
else
|
||||
[ $TEST -eq 1 ] || rm -f "$CONF_TAR"
|
||||
@ -381,8 +381,6 @@ fi
|
||||
install_bin /sbin/upgraded
|
||||
v "Commencing upgrade. Closing all shell sessions."
|
||||
|
||||
COMMAND='/lib/upgrade/do_stage2'
|
||||
|
||||
if [ -n "$FAILSAFE" ]; then
|
||||
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade
|
||||
lock -u /tmp/.failsafe
|
||||
|
||||
@ -38,6 +38,12 @@ define Trusted-Firmware-A/rk3399
|
||||
LOADER:=rk33/$(RK3399_LOADER)
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/rk3566
|
||||
BUILD_SUBTARGET:=armv8
|
||||
ATF:=rk35/$(RK3566_ATF)
|
||||
TPL:=rk35/$(RK3566_TPL)
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/rk3568
|
||||
BUILD_SUBTARGET:=armv8
|
||||
ATF:=rk35/$(RK3568_ATF)
|
||||
@ -53,6 +59,7 @@ endef
|
||||
TFA_TARGETS:= \
|
||||
rk3328 \
|
||||
rk3399 \
|
||||
rk3566 \
|
||||
rk3568 \
|
||||
rk3588
|
||||
|
||||
|
||||
@ -6,6 +6,9 @@ RK3399_ATF:=rk3399_bl31_v1.36.elf
|
||||
RK3399_TPL:=rk3399_ddr_800MHz_v1.30.bin
|
||||
RK3399_LOADER:=rk3399_miniloader_v1.30.bin
|
||||
|
||||
RK3566_ATF:=rk3568_bl31_v1.43.elf
|
||||
RK3566_TPL:=rk3566_ddr_1056MHz_v1.18.bin
|
||||
|
||||
RK3568_ATF:=rk3568_bl31_v1.43.elf
|
||||
RK3568_TPL:=rk3568_ddr_1560MHz_v1.18.bin
|
||||
|
||||
|
||||
22
package/boot/uboot-envtools/files/qualcommax_ipq60xx
Normal file
22
package/boot/uboot-envtools/files/qualcommax_ipq60xx
Normal file
@ -0,0 +1,22 @@
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
8devices,mango-dvk|\
|
||||
8devices,mango-dvk-sfp)
|
||||
idx="$(find_mtd_index 0:APPSBLENV)"
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config
|
||||
|
||||
exit 0
|
||||
@ -31,7 +31,8 @@ zte,mf269)
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
linksys,mx4200v1|\
|
||||
linksys,mx4200v2)
|
||||
linksys,mx4200v2|\
|
||||
linksys,mx5300)
|
||||
idx="$(find_mtd_index u_env)"
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"
|
||||
|
||||
@ -142,6 +142,23 @@ define U-Boot/rockpro64-rk3399
|
||||
endef
|
||||
|
||||
|
||||
# RK3566 boards
|
||||
|
||||
define U-Boot/Default/rk3566
|
||||
BUILD_SUBTARGET:=armv8
|
||||
DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3566
|
||||
ATF:=$(RK3566_ATF)
|
||||
TPL:=$(RK3566_TPL)
|
||||
endef
|
||||
|
||||
define U-Boot/radxa-cm3-io-rk3566
|
||||
$(U-Boot/Default/rk3566)
|
||||
NAME:=CM3 IO
|
||||
BUILD_DEVICES:= \
|
||||
radxa_cm3-io
|
||||
endef
|
||||
|
||||
|
||||
# RK3568 boards
|
||||
|
||||
define U-Boot/Default/rk3568
|
||||
@ -270,6 +287,7 @@ UBOOT_TARGETS := \
|
||||
roc-cc-rk3328 \
|
||||
rock-pi-e-rk3328 \
|
||||
rock64-rk3328 \
|
||||
radxa-cm3-io-rk3566 \
|
||||
fastrhino-r66s-rk3568 \
|
||||
fastrhino-r68s-rk3568 \
|
||||
mrkaio-m68s-rk3568 \
|
||||
|
||||
@ -11,7 +11,7 @@ PKG_NAME:=ath11k-firmware
|
||||
PKG_SOURCE_DATE:=2023-08-22
|
||||
PKG_SOURCE_VERSION:=d8f82a98ff1aef330d65d8b5660b46d1a9809ee3
|
||||
PKG_MIRROR_HASH:=3dba19449758c3b17f117990d7ad4086554e012b579f1de16e9d9196a7fbaaa7
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/quic/upstream-wifi-fw.git
|
||||
@ -32,6 +32,11 @@ define Package/ath11k-firmware-default
|
||||
DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-ipq6018
|
||||
$(Package/ath11k-firmware-default)
|
||||
TITLE:=IPQ6018 ath11k firmware
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-ipq8074
|
||||
$(Package/ath11k-firmware-default)
|
||||
TITLE:=IPQ8074 ath11k firmware
|
||||
@ -57,6 +62,28 @@ define Download/qcn9074-board
|
||||
endef
|
||||
$(eval $(call Download,qcn9074-board))
|
||||
|
||||
define Download/ath11k-firmware-old
|
||||
URL:=https://github.com/kvalo/ath11k-firmware.git
|
||||
VERSION:=540105aa5c0903b5f773d4e80b8501e8da5217e7
|
||||
PROTO:=git
|
||||
FILE:=ath11k-firmware-old.tar.xz
|
||||
SUBDIR:=ath11k-firmware-old
|
||||
MIRROR_HASH:=a35a164726fab2adc4ad447c974c06746355ba74deab9b849d39f06b5187bb6d
|
||||
endef
|
||||
$(eval $(call Download,ath11k-firmware-old))
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
xzcat $(DL_DIR)/ath11k-firmware-old.tar.xz | tar -C $(PKG_BUILD_DIR)/ -xf -
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-ipq6018/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/IPQ6018
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware-old/IPQ6018/hw1.0/2.4.0.1/WLAN.HK.2.4.0.1-01746-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(1)/lib/firmware/IPQ6018/
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-ipq8074/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/IPQ8074
|
||||
$(INSTALL_DATA) \
|
||||
@ -73,5 +100,6 @@ define Package/ath11k-firmware-qcn9074/install
|
||||
$(DL_DIR)/$(QCN9074_BOARD_FILE) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ath11k-firmware-ipq6018))
|
||||
$(eval $(call BuildPackage,ath11k-firmware-ipq8074))
|
||||
$(eval $(call BuildPackage,ath11k-firmware-qcn9074))
|
||||
|
||||
@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2024-01-06
|
||||
PKG_SOURCE_VERSION:=71f45cff8944405b7cc2bf5c19df2bd8fe7f2421
|
||||
PKG_MIRROR_HASH:=90c3c1659c54cdb4685d0a71633746c1000230e459801eb8ce12c805a994cc37
|
||||
PKG_SOURCE_DATE:=2024-02-23
|
||||
PKG_SOURCE_VERSION:=9f9d9ba9cd77043744dcd5235497a15eea51c375
|
||||
PKG_MIRROR_HASH:=38f6d15259a8e4d7d9d1f8043abe9981fc3ed03c57a909a8a484f59710f86815
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@ -28,6 +28,7 @@ endef
|
||||
# <https://wireless.wiki.kernel.org/en/users/drivers/ath10k/boardfiles>
|
||||
|
||||
ALLWIFIBOARDS:= \
|
||||
8devices_mango \
|
||||
arcadyan_aw1000 \
|
||||
buffalo_wxr-5950ax12 \
|
||||
cmcc_rm2-6 \
|
||||
@ -36,6 +37,7 @@ ALLWIFIBOARDS:= \
|
||||
edgecore_eap102 \
|
||||
edimax_cax1800 \
|
||||
linksys_mx4200 \
|
||||
linksys_mx5300 \
|
||||
netgear_rax120v2 \
|
||||
netgear_wax218 \
|
||||
netgear_wax620 \
|
||||
@ -85,12 +87,14 @@ define ipq-wifi-install-one
|
||||
$(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
|
||||
$(if $(filter $(suffix $(1)),.QCA99X0 .qca99x0),\
|
||||
$(call ipq-wifi-install-one-to,$(1),$(2),QCA99X0/hw2.0),\
|
||||
$(if $(filter $(suffix $(1)),.IPQ6018 .ipq6018),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ6018/hw1.0),\
|
||||
$(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074 .ipq8174),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\
|
||||
$(if $(filter $(suffix $(1)),.QCN9074 .qcn9074),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN9074/hw1.0),\
|
||||
$(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
|
||||
)))))))
|
||||
))))))))
|
||||
|
||||
endef
|
||||
# Blank line required at end of above define due to foreach context
|
||||
@ -140,6 +144,7 @@ endef
|
||||
# Board files should follow this name structure:
|
||||
# board-<devicename>.<qca4019|qca9888|qca9889|qca9984|qca99x0|ipq8074>
|
||||
|
||||
$(eval $(call generate-ipq-wifi-package,8devices_mango,8devices Mango))
|
||||
$(eval $(call generate-ipq-wifi-package,arcadyan_aw1000,Arcadyan AW1000))
|
||||
$(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
|
||||
$(eval $(call generate-ipq-wifi-package,cmcc_rm2-6,CMCC RM2-6))
|
||||
@ -148,6 +153,7 @@ $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
|
||||
$(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
|
||||
$(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
|
||||
$(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
|
||||
$(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300))
|
||||
$(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
|
||||
$(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))
|
||||
$(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620))
|
||||
|
||||
@ -10,14 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=6.5
|
||||
PKG_RELEASE:=2
|
||||
# PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
|
||||
PKG_VERSION:=6.6.15
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_HASH:=908c22dceba185eab83caa5a1e58ce6b3ebdc58f099c3fd3e11c7352ebfab2d7
|
||||
PKG_HASH:=3bbc461121134fda9089c084a5eed577d05e7837a157edf9a3797937172a3ece
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
@ -48,7 +47,13 @@ define KernelPackage/mac80211/Default
|
||||
MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
endef
|
||||
|
||||
config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
|
||||
# config_pacakge:
|
||||
# 1 = OpenWrt KernelPackage name
|
||||
# 2 = Optional list of variants for which the module may be selected:
|
||||
# If empty, the module is only selected with the first variant
|
||||
# Use $(ALL_VARIANTS) to allow module selection in all variants
|
||||
config_package=$(if $(and $(CONFIG_PACKAGE_kmod-$(1)),$(call mac80211_variant_check,$(2))),m)
|
||||
mac80211_variant_check=$(if $(ALL_VARIANTS),$(filter $(BUILD_VARIANT),$(if $(1),$(1),$(firstword $(ALL_VARIANTS)))),y)
|
||||
|
||||
config-y:= \
|
||||
WLAN \
|
||||
@ -73,10 +78,10 @@ config-y:= \
|
||||
WLAN_VENDOR_TI \
|
||||
WLAN_VENDOR_ZYDAS \
|
||||
|
||||
config-$(call config_package,cfg80211) += CFG80211
|
||||
config-$(call config_package,cfg80211,$(ALL_VARIANTS)) += CFG80211
|
||||
config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE
|
||||
|
||||
config-$(call config_package,mac80211) += MAC80211
|
||||
config-$(call config_package,mac80211,$(ALL_VARIANTS)) += MAC80211
|
||||
config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
|
||||
|
||||
include ath.mk
|
||||
|
||||
@ -37,7 +37,7 @@ ifdef CONFIG_PACKAGE_MAC80211_TRACING
|
||||
WIL6210_TRACING
|
||||
endif
|
||||
|
||||
config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
|
||||
config-$(call config_package,ath,regular smallbuffers) += ATH_CARDS ATH_COMMON
|
||||
config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH11K_DEBUG ATH9K_STATION_STATISTICS
|
||||
config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
|
||||
config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL ATH11K_SPECTRAL
|
||||
@ -58,8 +58,8 @@ config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
|
||||
config-$(CONFIG_ATH11K_THERMAL) += ATH11K_THERMAL
|
||||
|
||||
config-$(call config_package,ath9k-htc) += ATH9K_HTC
|
||||
config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
|
||||
config-$(call config_package,ath10k-smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS
|
||||
config-$(call config_package,ath10k,regular) += ATH10K ATH10K_PCI
|
||||
config-$(call config_package,ath10k-smallbuffers,smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS
|
||||
config-$(call config_package,ath11k) += ATH11K
|
||||
config-$(call config_package,ath11k-ahb) += ATH11K_AHB
|
||||
config-$(call config_package,ath11k-pci) += ATH11K_PCI
|
||||
|
||||
@ -71,7 +71,7 @@ Signed-off-by: Shiji Yang <yangshiji66@qq.com>
|
||||
/*
|
||||
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
|
||||
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
|
||||
@@ -665,7 +665,7 @@ ath5k_get_survey(struct ieee80211_hw *hw
|
||||
@@ -664,7 +664,7 @@ ath5k_get_survey(struct ieee80211_hw *hw
|
||||
ah->survey.time_rx += cc->rx_frame / div;
|
||||
ah->survey.time_tx += cc->tx_frame / div;
|
||||
}
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
From 72c8caf904aed2caed5d6e75233294b6159ddb5d Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Date: Wed, 26 Jul 2023 10:16:24 +0530
|
||||
Subject: [PATCH 1/5] wifi: ath11k: fix band selection for ppdu received in
|
||||
channel 177 of 5 GHz
|
||||
|
||||
5 GHz band channel 177 support was added with the commit e5e94d10c856 ("wifi:
|
||||
ath11k: add channel 177 into 5 GHz channel list"). However, during processing
|
||||
for the received ppdu in ath11k_dp_rx_h_ppdu(), channel number is checked only
|
||||
till 173. This leads to driver code checking for channel and then fetching the
|
||||
band from it which is extra effort since firmware has already given the channel
|
||||
number in the metadata.
|
||||
|
||||
Fix this issue by checking the channel number till 177 since we support
|
||||
it now.
|
||||
|
||||
Found via code review. Compile tested only.
|
||||
|
||||
Fixes: e5e94d10c856 ("wifi: ath11k: add channel 177 into 5 GHz channel list")
|
||||
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230726044624.20507-1-quic_adisi@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -2408,7 +2408,7 @@ static void ath11k_dp_rx_h_ppdu(struct a
|
||||
rx_status->freq = center_freq;
|
||||
} else if (channel_num >= 1 && channel_num <= 14) {
|
||||
rx_status->band = NL80211_BAND_2GHZ;
|
||||
- } else if (channel_num >= 36 && channel_num <= 173) {
|
||||
+ } else if (channel_num >= 36 && channel_num <= 177) {
|
||||
rx_status->band = NL80211_BAND_5GHZ;
|
||||
} else {
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
@ -1,38 +0,0 @@
|
||||
From 6f092c98dcfa1e4cf37d45f9b8e4d4a3cbeb79d4 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Antipov <dmantipov@yandex.ru>
|
||||
Date: Wed, 26 Jul 2023 12:21:02 +0300
|
||||
Subject: [PATCH 2/5] wifi: ath11k: simplify
|
||||
ath11k_mac_validate_vht_he_fixed_rate_settings()
|
||||
|
||||
In ath11k_mac_validate_vht_he_fixed_rate_settings() ar->ab->peers
|
||||
list is not altered so list_for_each_entry() should be safe.
|
||||
|
||||
Compile tested only.
|
||||
|
||||
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230726092113.78794-1-dmantipov@yandex.ru
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -8258,7 +8258,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se
|
||||
const struct cfg80211_bitrate_mask *mask)
|
||||
{
|
||||
bool he_fixed_rate = false, vht_fixed_rate = false;
|
||||
- struct ath11k_peer *peer, *tmp;
|
||||
+ struct ath11k_peer *peer;
|
||||
const u16 *vht_mcs_mask, *he_mcs_mask;
|
||||
struct ieee80211_link_sta *deflink;
|
||||
u8 vht_nss, he_nss;
|
||||
@@ -8281,7 +8281,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se
|
||||
|
||||
rcu_read_lock();
|
||||
spin_lock_bh(&ar->ab->base_lock);
|
||||
- list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
|
||||
+ list_for_each_entry(peer, &ar->ab->peers, list) {
|
||||
if (peer->sta) {
|
||||
deflink = &peer->sta->deflink;
|
||||
|
||||
@ -1,180 +0,0 @@
|
||||
From 011e5a3052a22d3758d17442bf0c04c68bf79bea Mon Sep 17 00:00:00 2001
|
||||
From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
Date: Wed, 26 Jul 2023 19:40:30 +0530
|
||||
Subject: [PATCH 3/5] wifi: ath11k: Split coldboot calibration hw_param
|
||||
|
||||
QCN9074 enables coldboot calibration only in Factory Test Mode (FTM).
|
||||
Hence, split cold_boot_calib to two hw_params for mission and FTM
|
||||
mode.
|
||||
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230726141032.3061-2-quic_rajkbhag@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ahb.c | 3 +--
|
||||
drivers/net/wireless/ath/ath11k/core.c | 36 ++++++++++++++++++++------
|
||||
drivers/net/wireless/ath/ath11k/core.h | 1 +
|
||||
drivers/net/wireless/ath/ath11k/hw.h | 3 ++-
|
||||
drivers/net/wireless/ath/ath11k/qmi.c | 6 ++---
|
||||
5 files changed, 35 insertions(+), 14 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -422,8 +422,7 @@ static int ath11k_ahb_fwreset_from_cold_
|
||||
{
|
||||
int timeout;
|
||||
|
||||
- if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done ||
|
||||
- ab->hw_params.cold_boot_calib == 0 ||
|
||||
+ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
|
||||
ab->hw_params.cbcal_restart_fw == 0)
|
||||
return 0;
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -86,7 +86,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = false,
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
- .cold_boot_calib = true,
|
||||
+ .coldboot_cal_mm = true,
|
||||
+ .coldboot_cal_ftm = true,
|
||||
.cbcal_restart_fw = true,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@@ -167,7 +168,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = false,
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
- .cold_boot_calib = true,
|
||||
+ .coldboot_cal_mm = true,
|
||||
+ .coldboot_cal_ftm = true,
|
||||
.cbcal_restart_fw = true,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@@ -248,7 +250,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = true,
|
||||
.idle_ps = true,
|
||||
.supports_sta_ps = true,
|
||||
- .cold_boot_calib = false,
|
||||
+ .coldboot_cal_mm = false,
|
||||
+ .coldboot_cal_ftm = false,
|
||||
.cbcal_restart_fw = false,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@@ -332,7 +335,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = false,
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
- .cold_boot_calib = false,
|
||||
+ .coldboot_cal_mm = false,
|
||||
+ .coldboot_cal_ftm = false,
|
||||
.cbcal_restart_fw = false,
|
||||
.fw_mem_mode = 2,
|
||||
.num_vdevs = 8,
|
||||
@@ -413,7 +417,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = true,
|
||||
.idle_ps = true,
|
||||
.supports_sta_ps = true,
|
||||
- .cold_boot_calib = false,
|
||||
+ .coldboot_cal_mm = false,
|
||||
+ .coldboot_cal_ftm = false,
|
||||
.cbcal_restart_fw = false,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@@ -495,7 +500,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = true,
|
||||
.idle_ps = true,
|
||||
.supports_sta_ps = true,
|
||||
- .cold_boot_calib = false,
|
||||
+ .coldboot_cal_mm = false,
|
||||
+ .coldboot_cal_ftm = false,
|
||||
.cbcal_restart_fw = false,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@@ -578,7 +584,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = true,
|
||||
.idle_ps = true,
|
||||
.supports_sta_ps = true,
|
||||
- .cold_boot_calib = true,
|
||||
+ .coldboot_cal_mm = true,
|
||||
+ .coldboot_cal_ftm = true,
|
||||
.cbcal_restart_fw = false,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@@ -667,7 +674,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_suspend = false,
|
||||
.hal_params = &ath11k_hw_hal_params_ipq8074,
|
||||
.single_pdev_only = false,
|
||||
- .cold_boot_calib = true,
|
||||
+ .coldboot_cal_mm = true,
|
||||
+ .coldboot_cal_ftm = true,
|
||||
.cbcal_restart_fw = true,
|
||||
.fix_l1ss = true,
|
||||
.supports_dynamic_smps_6ghz = false,
|
||||
@@ -749,6 +757,18 @@ void ath11k_fw_stats_free(struct ath11k_
|
||||
ath11k_fw_stats_bcn_free(&stats->bcn);
|
||||
}
|
||||
|
||||
+bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab)
|
||||
+{
|
||||
+ if (!ath11k_cold_boot_cal)
|
||||
+ return false;
|
||||
+
|
||||
+ if (ath11k_ftm_mode)
|
||||
+ return ab->hw_params.coldboot_cal_ftm;
|
||||
+
|
||||
+ else
|
||||
+ return ab->hw_params.coldboot_cal_mm;
|
||||
+}
|
||||
+
|
||||
int ath11k_core_suspend(struct ath11k_base *ab)
|
||||
{
|
||||
int ret;
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -1186,6 +1186,7 @@ void ath11k_core_halt(struct ath11k *ar)
|
||||
int ath11k_core_resume(struct ath11k_base *ab);
|
||||
int ath11k_core_suspend(struct ath11k_base *ab);
|
||||
void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
|
||||
+bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab);
|
||||
|
||||
const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
|
||||
const char *filename);
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -187,7 +187,8 @@ struct ath11k_hw_params {
|
||||
bool supports_shadow_regs;
|
||||
bool idle_ps;
|
||||
bool supports_sta_ps;
|
||||
- bool cold_boot_calib;
|
||||
+ bool coldboot_cal_mm;
|
||||
+ bool coldboot_cal_ftm;
|
||||
bool cbcal_restart_fw;
|
||||
int fw_mem_mode;
|
||||
u32 num_vdevs;
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2079,7 +2079,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- if (ath11k_cold_boot_cal && ab->hw_params.cold_boot_calib) {
|
||||
+ if (ath11k_core_coldboot_cal_support(ab)) {
|
||||
if (hremote_node) {
|
||||
ab->qmi.target_mem[idx].paddr =
|
||||
res.start + host_ddr_sz;
|
||||
@@ -3209,8 +3209,8 @@ static void ath11k_qmi_driver_event_work
|
||||
break;
|
||||
}
|
||||
|
||||
- if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 &&
|
||||
- ab->hw_params.cold_boot_calib) {
|
||||
+ if (ab->qmi.cal_done == 0 &&
|
||||
+ ath11k_core_coldboot_cal_support(ab)) {
|
||||
ath11k_qmi_process_coldboot_calibration(ab);
|
||||
} else {
|
||||
clear_bit(ATH11K_FLAG_CRASH_FLUSH,
|
||||
@ -1,176 +0,0 @@
|
||||
From bdfc967bf5fcd762473a01d39edb81f1165ba290 Mon Sep 17 00:00:00 2001
|
||||
From: Anilkumar Kolli <quic_akolli@quicinc.com>
|
||||
Date: Wed, 26 Jul 2023 19:40:31 +0530
|
||||
Subject: [PATCH 4/5] wifi: ath11k: Add coldboot calibration support for
|
||||
QCN9074
|
||||
|
||||
QCN9074 supports 6 GHz, which has increased number of channels
|
||||
compared to 5 GHz/2 GHz. So, to support coldboot calibration in
|
||||
QCN9074 ATH11K_COLD_BOOT_FW_RESET_DELAY extended to 60 seconds. To
|
||||
avoid code redundancy, fwreset_from_cold_boot moved to QMI and made
|
||||
common for both ahb and pci. Coldboot calibration is enabled only in
|
||||
FTM mode for QCN9074. QCN9074 requires firmware restart after coldboot,
|
||||
hence enable cbcal_restart_fw in hw_params.
|
||||
|
||||
This support can be enabled/disabled using hw params for different
|
||||
hardware. Currently it is not enabled for QCA6390.
|
||||
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
|
||||
Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230726141032.3061-3-quic_rajkbhag@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ahb.c | 28 ++------------------------
|
||||
drivers/net/wireless/ath/ath11k/core.c | 4 ++--
|
||||
drivers/net/wireless/ath/ath11k/pci.c | 2 ++
|
||||
drivers/net/wireless/ath/ath11k/qmi.c | 28 ++++++++++++++++++++++++++
|
||||
drivers/net/wireless/ath/ath11k/qmi.h | 3 ++-
|
||||
5 files changed, 36 insertions(+), 29 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "ahb.h"
|
||||
#include "debug.h"
|
||||
#include "hif.h"
|
||||
+#include "qmi.h"
|
||||
#include <linux/remoteproc.h>
|
||||
#include "pcic.h"
|
||||
#include <linux/soc/qcom/smem.h>
|
||||
@@ -418,31 +419,6 @@ static void ath11k_ahb_power_down(struct
|
||||
rproc_shutdown(ab_ahb->tgt_rproc);
|
||||
}
|
||||
|
||||
-static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab)
|
||||
-{
|
||||
- int timeout;
|
||||
-
|
||||
- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
|
||||
- ab->hw_params.cbcal_restart_fw == 0)
|
||||
- return 0;
|
||||
-
|
||||
- ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n");
|
||||
- timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
|
||||
- (ab->qmi.cal_done == 1),
|
||||
- ATH11K_COLD_BOOT_FW_RESET_DELAY);
|
||||
- if (timeout <= 0) {
|
||||
- ath11k_cold_boot_cal = 0;
|
||||
- ath11k_warn(ab, "Coldboot Calibration failed timed out\n");
|
||||
- }
|
||||
-
|
||||
- /* reset the firmware */
|
||||
- ath11k_ahb_power_down(ab);
|
||||
- ath11k_ahb_power_up(ab);
|
||||
-
|
||||
- ath11k_dbg(ab, ATH11K_DBG_AHB, "exited from cold boot mode\n");
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
|
||||
{
|
||||
struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
|
||||
@@ -1225,7 +1201,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
goto err_ce_free;
|
||||
}
|
||||
|
||||
- ath11k_ahb_fwreset_from_cold_boot(ab);
|
||||
+ ath11k_qmi_fwreset_from_cold_boot(ab);
|
||||
|
||||
return 0;
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -336,8 +336,8 @@ static const struct ath11k_hw_params ath
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
.coldboot_cal_mm = false,
|
||||
- .coldboot_cal_ftm = false,
|
||||
- .cbcal_restart_fw = false,
|
||||
+ .coldboot_cal_ftm = true,
|
||||
+ .cbcal_restart_fw = true,
|
||||
.fw_mem_mode = 2,
|
||||
.num_vdevs = 8,
|
||||
.num_peers = 128,
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "mhi.h"
|
||||
#include "debug.h"
|
||||
#include "pcic.h"
|
||||
+#include "qmi.h"
|
||||
|
||||
#define ATH11K_PCI_BAR_NUM 0
|
||||
#define ATH11K_PCI_DMA_MASK 32
|
||||
@@ -897,6 +898,7 @@ unsupported_wcn6855_soc:
|
||||
ath11k_err(ab, "failed to init core: %d\n", ret);
|
||||
goto err_irq_affinity_cleanup;
|
||||
}
|
||||
+ ath11k_qmi_fwreset_from_cold_boot(ab);
|
||||
return 0;
|
||||
|
||||
err_irq_affinity_cleanup:
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "qmi.h"
|
||||
#include "core.h"
|
||||
#include "debug.h"
|
||||
+#include "hif.h"
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/ioport.h>
|
||||
@@ -2839,6 +2840,33 @@ int ath11k_qmi_firmware_start(struct ath
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab)
|
||||
+{
|
||||
+ int timeout;
|
||||
+
|
||||
+ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
|
||||
+ ab->hw_params.cbcal_restart_fw == 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_QMI, "wait for cold boot done\n");
|
||||
+
|
||||
+ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
|
||||
+ (ab->qmi.cal_done == 1),
|
||||
+ ATH11K_COLD_BOOT_FW_RESET_DELAY);
|
||||
+
|
||||
+ if (timeout <= 0) {
|
||||
+ ath11k_warn(ab, "Coldboot Calibration timed out\n");
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+
|
||||
+ /* reset the firmware */
|
||||
+ ath11k_hif_power_down(ab);
|
||||
+ ath11k_hif_power_up(ab);
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_QMI, "exit wait for cold boot done\n");
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL(ath11k_qmi_fwreset_from_cold_boot);
|
||||
+
|
||||
static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab)
|
||||
{
|
||||
int timeout;
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#define QMI_WLANFW_MAX_DATA_SIZE_V01 6144
|
||||
#define ATH11K_FIRMWARE_MODE_OFF 4
|
||||
-#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ)
|
||||
+#define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ)
|
||||
|
||||
#define ATH11K_QMI_DEVICE_BAR_SIZE 0x200000
|
||||
|
||||
@@ -519,5 +519,6 @@ void ath11k_qmi_msg_recv_work(struct wor
|
||||
void ath11k_qmi_deinit_service(struct ath11k_base *ab);
|
||||
int ath11k_qmi_init_service(struct ath11k_base *ab);
|
||||
void ath11k_qmi_free_resource(struct ath11k_base *ab);
|
||||
+int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab);
|
||||
|
||||
#endif
|
||||
@ -1,33 +0,0 @@
|
||||
From 13329d0cb7212b058bd8451a99d215a8f97645ea Mon Sep 17 00:00:00 2001
|
||||
From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
Date: Wed, 26 Jul 2023 19:40:32 +0530
|
||||
Subject: [PATCH 5/5] wifi: ath11k: Remove cal_done check during probe
|
||||
|
||||
In some race conditions, calibration done QMI message is received even
|
||||
before host wait starts for calibration to be done.
|
||||
Due to this, resetting firmware was not performed after calibration.
|
||||
|
||||
Hence, remove cal_done check in ath11k_qmi_fwreset_from_cold_boot()
|
||||
as this is called only from probe.
|
||||
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230726141032.3061-4-quic_rajkbhag@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2844,7 +2844,7 @@ int ath11k_qmi_fwreset_from_cold_boot(st
|
||||
{
|
||||
int timeout;
|
||||
|
||||
- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
|
||||
+ if (!ath11k_core_coldboot_cal_support(ab) ||
|
||||
ab->hw_params.cbcal_restart_fw == 0)
|
||||
return 0;
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
From 400ece6c7f346b0a30867bd00b03b5b2563d4357 Mon Sep 17 00:00:00 2001
|
||||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Tue, 22 Aug 2023 16:42:24 +0300
|
||||
Subject: [PATCH] wifi: ath11k: Don't drop tx_status when peer cannot be found
|
||||
|
||||
When a station idles for a long time, hostapd will try to send a QoS Null
|
||||
frame to the station as "poll". NL80211_CMD_PROBE_CLIENT is used for this
|
||||
purpose. And the skb will be added to ack_status_frame - waiting for a
|
||||
completion via ieee80211_report_ack_skb().
|
||||
|
||||
But when the peer was already removed before the tx_complete arrives, the
|
||||
peer will be missing. And when using dev_kfree_skb_any (instead of going
|
||||
through mac80211), the entry will stay inside ack_status_frames. This IDR
|
||||
will therefore run full after 8K request were generated for such clients.
|
||||
At this point, the access point will then just stall and not allow any new
|
||||
clients because idr_alloc() for ack_status_frame will fail.
|
||||
|
||||
ieee80211_free_txskb() on the other hand will (when required) call
|
||||
ieee80211_report_ack_skb() and make sure that (when required) remove the
|
||||
entry from the ack_status_frame.
|
||||
|
||||
Tested-on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
|
||||
Fixes: 94739d45c388 ("ath11k: switch to using ieee80211_tx_status_ext()")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-1-c0af729d6229@narfation.org
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
@@ -369,7 +369,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
|
||||
"dp_tx: failed to find the peer with peer_id %d\n",
|
||||
ts->peer_id);
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
- dev_kfree_skb_any(msdu);
|
||||
+ ieee80211_free_txskb(ar->hw, msdu);
|
||||
return;
|
||||
}
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
@@ -624,7 +624,7 @@ static void ath11k_dp_tx_complete_msdu(s
|
||||
"dp_tx: failed to find the peer with peer_id %d\n",
|
||||
ts->peer_id);
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
- dev_kfree_skb_any(msdu);
|
||||
+ ieee80211_free_txskb(ar->hw, msdu);
|
||||
return;
|
||||
}
|
||||
arsta = (struct ath11k_sta *)peer->sta->drv_priv;
|
||||
@ -1,51 +0,0 @@
|
||||
From 29d15589f084d71a4ea8c544039c5839db0236e2 Mon Sep 17 00:00:00 2001
|
||||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Tue, 22 Aug 2023 16:42:24 +0300
|
||||
Subject: [PATCH] wifi: ath11k: Cleanup mac80211 references on failure during
|
||||
tx_complete
|
||||
|
||||
When a function is using functions from mac80211 to free an skb then it
|
||||
should do it consistently and not switch to the generic dev_kfree_skb_any
|
||||
(or similar functions). Otherwise (like in the error handlers), mac80211
|
||||
will will not be aware of the freed skb and thus not clean up related
|
||||
information in its internal data structures.
|
||||
|
||||
Not doing so lead in the past to filled up structure which then prevented
|
||||
new clients to connect.
|
||||
|
||||
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
|
||||
Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-2-c0af729d6229@narfation.org
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/dp_tx.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
@@ -344,7 +344,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
|
||||
dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
|
||||
|
||||
if (!skb_cb->vif) {
|
||||
- dev_kfree_skb_any(msdu);
|
||||
+ ieee80211_free_txskb(ar->hw, msdu);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -566,12 +566,12 @@ static void ath11k_dp_tx_complete_msdu(s
|
||||
dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
|
||||
|
||||
if (unlikely(!rcu_access_pointer(ab->pdevs_active[ar->pdev_idx]))) {
|
||||
- dev_kfree_skb_any(msdu);
|
||||
+ ieee80211_free_txskb(ar->hw, msdu);
|
||||
return;
|
||||
}
|
||||
|
||||
if (unlikely(!skb_cb->vif)) {
|
||||
- dev_kfree_skb_any(msdu);
|
||||
+ ieee80211_free_txskb(ar->hw, msdu);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1,316 +0,0 @@
|
||||
From 9476cda44c136089f14f8951ae5197d63e91735c Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Date: Mon, 21 Aug 2023 07:13:36 -0700
|
||||
Subject: [PATCH] wifi: ath11k: Consistently use ath11k_vif_to_arvif()
|
||||
|
||||
Helper function ath11k_vif_to_arvif() exists to retrieve a struct
|
||||
ath11k_vif from a struct ieee80211_vif. However, in multiple places
|
||||
this logic is open-coded with inline typecasting. Since the
|
||||
typecasting prevents the compiler from type-checking the source and
|
||||
destination, update the driver to consistently use the helper
|
||||
function.
|
||||
|
||||
No functional changes, compile tested only.
|
||||
|
||||
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230821-ath11k_vif_to_arvif-v1-1-fa2c3b60b5cf@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 64 +++++++++++-----------
|
||||
drivers/net/wireless/ath/ath11k/testmode.c | 2 +-
|
||||
2 files changed, 33 insertions(+), 33 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -566,7 +566,7 @@ static void ath11k_get_arvif_iter(void *
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath11k_vif_iter *arvif_iter = data;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
|
||||
if (arvif->vdev_id == arvif_iter->vdev_id)
|
||||
arvif_iter->arvif = arvif;
|
||||
@@ -1464,7 +1464,7 @@ static int ath11k_mac_setup_bcn_tmpl_ema
|
||||
u32 params = 0;
|
||||
u8 i = 0;
|
||||
|
||||
- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
|
||||
+ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
|
||||
|
||||
beacons = ieee80211_beacon_get_template_ema_list(tx_arvif->ar->hw,
|
||||
tx_arvif->vif, 0);
|
||||
@@ -1520,8 +1520,8 @@ static int ath11k_mac_setup_bcn_tmpl_mbs
|
||||
struct sk_buff *bcn;
|
||||
int ret;
|
||||
|
||||
- if (arvif->vif->mbssid_tx_vif) {
|
||||
- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
|
||||
+ if (vif->mbssid_tx_vif) {
|
||||
+ tx_arvif = ath11k_vif_to_arvif(vif->mbssid_tx_vif);
|
||||
if (tx_arvif != arvif) {
|
||||
ar = tx_arvif->ar;
|
||||
ab = ar->ab;
|
||||
@@ -1562,7 +1562,7 @@ static int ath11k_mac_setup_bcn_tmpl(str
|
||||
* non-transmitting interfaces, and results in a crash if sent.
|
||||
*/
|
||||
if (vif->mbssid_tx_vif &&
|
||||
- arvif != (void *)vif->mbssid_tx_vif->drv_priv && arvif->is_up)
|
||||
+ arvif != ath11k_vif_to_arvif(vif->mbssid_tx_vif) && arvif->is_up)
|
||||
return 0;
|
||||
|
||||
if (vif->bss_conf.ema_ap && vif->mbssid_tx_vif)
|
||||
@@ -1626,7 +1626,7 @@ static void ath11k_control_beaconing(str
|
||||
ether_addr_copy(arvif->bssid, info->bssid);
|
||||
|
||||
if (arvif->vif->mbssid_tx_vif)
|
||||
- tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
|
||||
+ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
|
||||
|
||||
ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
|
||||
arvif->bssid,
|
||||
@@ -1649,7 +1649,7 @@ static void ath11k_mac_handle_beacon_ite
|
||||
{
|
||||
struct sk_buff *skb = data;
|
||||
struct ieee80211_mgmt *mgmt = (void *)skb->data;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
|
||||
if (vif->type != NL80211_IFTYPE_STATION)
|
||||
return;
|
||||
@@ -1672,7 +1672,7 @@ static void ath11k_mac_handle_beacon_mis
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
u32 *vdev_id = data;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct ath11k *ar = arvif->ar;
|
||||
struct ieee80211_hw *hw = ar->hw;
|
||||
|
||||
@@ -1718,7 +1718,7 @@ static void ath11k_peer_assoc_h_basic(st
|
||||
struct ieee80211_sta *sta,
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
u32 aid;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -1746,7 +1746,7 @@ static void ath11k_peer_assoc_h_crypto(s
|
||||
struct ieee80211_bss_conf *info = &vif->bss_conf;
|
||||
struct cfg80211_chan_def def;
|
||||
struct cfg80211_bss *bss;
|
||||
- struct ath11k_vif *arvif = (struct ath11k_vif *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
const u8 *rsnie = NULL;
|
||||
const u8 *wpaie = NULL;
|
||||
|
||||
@@ -1804,7 +1804,7 @@ static void ath11k_peer_assoc_h_rates(st
|
||||
struct ieee80211_sta *sta,
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct wmi_rate_set_arg *rateset = &arg->peer_legacy_rates;
|
||||
struct cfg80211_chan_def def;
|
||||
const struct ieee80211_supported_band *sband;
|
||||
@@ -1867,7 +1867,7 @@ static void ath11k_peer_assoc_h_ht(struc
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct cfg80211_chan_def def;
|
||||
enum nl80211_band band;
|
||||
const u8 *ht_mcs_mask;
|
||||
@@ -2064,7 +2064,7 @@ static void ath11k_peer_assoc_h_vht(stru
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
const struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct cfg80211_chan_def def;
|
||||
enum nl80211_band band;
|
||||
u16 *vht_mcs_mask;
|
||||
@@ -2261,7 +2261,7 @@ static void ath11k_peer_assoc_h_he(struc
|
||||
struct ieee80211_sta *sta,
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct cfg80211_chan_def def;
|
||||
const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
|
||||
enum nl80211_band band;
|
||||
@@ -2584,7 +2584,7 @@ static void ath11k_peer_assoc_h_qos(stru
|
||||
struct ieee80211_sta *sta,
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
|
||||
switch (arvif->vdev_type) {
|
||||
case WMI_VDEV_TYPE_AP:
|
||||
@@ -2747,7 +2747,7 @@ static void ath11k_peer_assoc_h_phymode(
|
||||
struct ieee80211_sta *sta,
|
||||
struct peer_assoc_params *arg)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct cfg80211_chan_def def;
|
||||
enum nl80211_band band;
|
||||
const u8 *ht_mcs_mask;
|
||||
@@ -2933,7 +2933,7 @@ static bool ath11k_mac_vif_recalc_sta_he
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct ieee80211_he_cap_elem he_cap_elem = {0};
|
||||
struct ieee80211_sta_he_cap *cap_band = NULL;
|
||||
struct cfg80211_chan_def def;
|
||||
@@ -2995,7 +2995,7 @@ static void ath11k_bss_assoc(struct ieee
|
||||
struct ieee80211_bss_conf *bss_conf)
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct peer_assoc_params peer_arg;
|
||||
struct ieee80211_sta *ap_sta;
|
||||
struct ath11k_peer *peer;
|
||||
@@ -3111,7 +3111,7 @@ static void ath11k_bss_disassoc(struct i
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -3160,7 +3160,7 @@ static void ath11k_recalculate_mgmt_rate
|
||||
struct ieee80211_vif *vif,
|
||||
struct cfg80211_chan_def *def)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
const struct ieee80211_supported_band *sband;
|
||||
u8 basic_rate_idx;
|
||||
int hw_rate_code;
|
||||
@@ -4632,7 +4632,7 @@ static int ath11k_station_disassoc(struc
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
int ret = 0;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -5160,7 +5160,7 @@ static int ath11k_mac_op_sta_set_txpwr(s
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
int ret = 0;
|
||||
s16 txpwr;
|
||||
|
||||
@@ -5210,7 +5210,7 @@ static void ath11k_mac_op_sta_rc_update(
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct ath11k_peer *peer;
|
||||
u32 bw, smps;
|
||||
|
||||
@@ -5337,7 +5337,7 @@ static int ath11k_mac_op_conf_tx(struct
|
||||
const struct ieee80211_tx_queue_params *params)
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct wmi_wmm_params_arg *p = NULL;
|
||||
int ret;
|
||||
|
||||
@@ -6458,7 +6458,7 @@ static int ath11k_mac_setup_vdev_params_
|
||||
return 0;
|
||||
}
|
||||
|
||||
- tx_arvif = (void *)tx_vif->drv_priv;
|
||||
+ tx_arvif = ath11k_vif_to_arvif(tx_vif);
|
||||
|
||||
if (arvif->vif->bss_conf.nontransmitted) {
|
||||
if (ar->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy)
|
||||
@@ -7411,7 +7411,7 @@ ath11k_mac_update_vif_chan(struct ath11k
|
||||
/* TODO: Update ar->rx_channel */
|
||||
|
||||
for (i = 0; i < n_vifs; i++) {
|
||||
- arvif = (void *)vifs[i].vif->drv_priv;
|
||||
+ arvif = ath11k_vif_to_arvif(vifs[i].vif);
|
||||
|
||||
if (WARN_ON(!arvif->is_started))
|
||||
continue;
|
||||
@@ -7453,7 +7453,7 @@ ath11k_mac_update_vif_chan(struct ath11k
|
||||
|
||||
mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
|
||||
if (mbssid_tx_vif)
|
||||
- tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
|
||||
+ tx_arvif = ath11k_vif_to_arvif(mbssid_tx_vif);
|
||||
|
||||
ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
|
||||
arvif->bssid,
|
||||
@@ -7549,7 +7549,7 @@ static int ath11k_start_vdev_delay(struc
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
int ret;
|
||||
|
||||
if (WARN_ON(arvif->is_started))
|
||||
@@ -7599,7 +7599,7 @@ ath11k_mac_op_assign_vif_chanctx(struct
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
int ret;
|
||||
struct peer_create_params param;
|
||||
|
||||
@@ -7689,7 +7689,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct ath11k_peer *peer;
|
||||
int ret;
|
||||
|
||||
@@ -8310,7 +8310,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie
|
||||
struct ieee80211_vif *vif,
|
||||
const struct cfg80211_bitrate_mask *mask)
|
||||
{
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct cfg80211_chan_def def;
|
||||
struct ath11k_pdev_cap *cap;
|
||||
struct ath11k *ar = arvif->ar;
|
||||
@@ -8907,7 +8907,7 @@ static int ath11k_mac_op_remain_on_chann
|
||||
enum ieee80211_roc_type type)
|
||||
{
|
||||
struct ath11k *ar = hw->priv;
|
||||
- struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
|
||||
struct scan_req_params arg;
|
||||
int ret;
|
||||
u32 scan_time_msec;
|
||||
--- a/drivers/net/wireless/ath/ath11k/testmode.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/testmode.c
|
||||
@@ -350,7 +350,7 @@ static int ath11k_tm_cmd_wmi(struct ath1
|
||||
if (ar->ab->fw_mode != ATH11K_FIRMWARE_MODE_FTM &&
|
||||
(tag == WMI_TAG_VDEV_SET_PARAM_CMD || tag == WMI_TAG_UNIT_TEST_CMD)) {
|
||||
if (vif) {
|
||||
- arvif = (struct ath11k_vif *)vif->drv_priv;
|
||||
+ arvif = ath11k_vif_to_arvif(vif);
|
||||
*ptr = arvif->vdev_id;
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
@ -1,50 +0,0 @@
|
||||
From d68a283bfc39aeed2a51c67804e014bf4b35c7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Date: Tue, 22 Aug 2023 07:50:49 -0700
|
||||
Subject: [PATCH] wifi: ath11k: Fix a few spelling errors
|
||||
|
||||
Fix a few issues flagged by 'codespell'.
|
||||
|
||||
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Acked-by: Randy Dunlap <rdunlap@infradead.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230822-ath_spelling-v1-2-8e2698759564@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/dp.h | 2 +-
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
|
||||
drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp.h
|
||||
@@ -635,7 +635,7 @@ enum htt_ppdu_stats_tag_type {
|
||||
* b'24 - status_swap: 1 is to swap status TLV
|
||||
* b'25 - pkt_swap: 1 is to swap packet TLV
|
||||
* b'26:31 - rsvd1: reserved for future use
|
||||
- * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
|
||||
+ * dword1 - b'0:16 - ring_buffer_size: size of buffers referenced by rx ring,
|
||||
* in byte units.
|
||||
* Valid only for HW_TO_SW_RING and SW_TO_HW_RING
|
||||
* - b'16:31 - rsvd2: Reserved for future use
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -3423,7 +3423,7 @@ static int ath11k_dp_rx_h_defrag_reo_rei
|
||||
ath11k_hal_rx_buf_addr_info_set(msdu0, paddr, cookie,
|
||||
ab->hw_params.hal_params->rx_buf_rbm);
|
||||
|
||||
- /* Fill mpdu details into reo entrace ring */
|
||||
+ /* Fill mpdu details into reo entrance ring */
|
||||
srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id];
|
||||
|
||||
spin_lock_bh(&srng->lock);
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
@@ -238,7 +238,7 @@ tcl_ring_sel:
|
||||
spin_unlock_bh(&tcl_ring->lock);
|
||||
ret = -ENOMEM;
|
||||
|
||||
- /* Checking for available tcl descritors in another ring in
|
||||
+ /* Checking for available tcl descriptors in another ring in
|
||||
* case of failure due to full tcl ring now, is better than
|
||||
* checking this ring earlier for each pkt tx.
|
||||
* Restart ring selection if some rings are not checked yet.
|
||||
@ -1,36 +0,0 @@
|
||||
From 749a660b39030bfbacc366cd8670df2ee0e878b2 Mon Sep 17 00:00:00 2001
|
||||
From: Yang Yingliang <yangyingliang@huawei.com>
|
||||
Date: Fri, 4 Aug 2023 17:12:55 +0800
|
||||
Subject: [PATCH] wifi: ath11k: simplify the code with module_platform_driver
|
||||
|
||||
The init/exit() of driver only calls platform_driver_register/unregister,
|
||||
it can be simpilfied with module_platform_driver.
|
||||
|
||||
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230804091255.1347178-1-yangyingliang@huawei.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ahb.c | 12 +-----------
|
||||
1 file changed, 1 insertion(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -1306,17 +1306,7 @@ static struct platform_driver ath11k_ahb
|
||||
.shutdown = ath11k_ahb_shutdown,
|
||||
};
|
||||
|
||||
-static int ath11k_ahb_init(void)
|
||||
-{
|
||||
- return platform_driver_register(&ath11k_ahb_driver);
|
||||
-}
|
||||
-module_init(ath11k_ahb_init);
|
||||
-
|
||||
-static void ath11k_ahb_exit(void)
|
||||
-{
|
||||
- platform_driver_unregister(&ath11k_ahb_driver);
|
||||
-}
|
||||
-module_exit(ath11k_ahb_exit);
|
||||
+module_platform_driver(ath11k_ahb_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
@ -1,29 +0,0 @@
|
||||
From 6763ef191d672ff3c2db0622652d49b0c0a60c4a Mon Sep 17 00:00:00 2001
|
||||
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
|
||||
Date: Thu, 10 Aug 2023 11:12:23 +0200
|
||||
Subject: [PATCH] wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning
|
||||
|
||||
'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
|
||||
causes:
|
||||
|
||||
h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
|
||||
|
||||
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230810091224.70088-1-krzysztof.kozlowski@linaro.org
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -1096,7 +1096,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- hw_rev = (enum ath11k_hw_rev)of_id->data;
|
||||
+ hw_rev = (uintptr_t)of_id->data;
|
||||
|
||||
switch (hw_rev) {
|
||||
case ATH11K_HW_IPQ8074:
|
||||
@ -1,44 +0,0 @@
|
||||
From adb0b206709f4f2f1256a1ea20619ab98e99f2e7 Mon Sep 17 00:00:00 2001
|
||||
From: Yue Haibing <yuehaibing@huawei.com>
|
||||
Date: Fri, 11 Aug 2023 18:44:13 +0800
|
||||
Subject: [PATCH] wifi: ath11k: Remove unused declarations
|
||||
|
||||
Commit 2c3960c2253d ("ath11k: setup ce tasklet for control path")
|
||||
declared but never implemented ath11k_ce_map_service_to_pipe().
|
||||
Commit e3396b8bddd2 ("ath11k: ce: support different CE configurations")
|
||||
declared but never implemented ath11k_ce_attr_attach().
|
||||
Commit d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
|
||||
declared but never implemented ath11k_qmi_event_work()/ath11k_qmi_msg_recv_work().
|
||||
|
||||
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230811104413.33668-1-yuehaibing@huawei.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ce.h | 3 ---
|
||||
drivers/net/wireless/ath/ath11k/qmi.h | 2 --
|
||||
2 files changed, 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ce.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ce.h
|
||||
@@ -203,9 +203,6 @@ int ath11k_ce_alloc_pipes(struct ath11k_
|
||||
void ath11k_ce_free_pipes(struct ath11k_base *ab);
|
||||
int ath11k_ce_get_attr_flags(struct ath11k_base *ab, int ce_id);
|
||||
void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
|
||||
-int ath11k_ce_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
|
||||
- u8 *ul_pipe, u8 *dl_pipe);
|
||||
-int ath11k_ce_attr_attach(struct ath11k_base *ab);
|
||||
void ath11k_ce_get_shadow_config(struct ath11k_base *ab,
|
||||
u32 **shadow_cfg, u32 *shadow_cfg_len);
|
||||
void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab);
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
|
||||
@@ -514,8 +514,6 @@ struct qmi_wlanfw_wlan_ini_resp_msg_v01
|
||||
int ath11k_qmi_firmware_start(struct ath11k_base *ab,
|
||||
u32 mode);
|
||||
void ath11k_qmi_firmware_stop(struct ath11k_base *ab);
|
||||
-void ath11k_qmi_event_work(struct work_struct *work);
|
||||
-void ath11k_qmi_msg_recv_work(struct work_struct *work);
|
||||
void ath11k_qmi_deinit_service(struct ath11k_base *ab);
|
||||
int ath11k_qmi_init_service(struct ath11k_base *ab);
|
||||
void ath11k_qmi_free_resource(struct ath11k_base *ab);
|
||||
@ -1,103 +0,0 @@
|
||||
From 39564b475ac5a589e6c22c43a08cbd283c295d2c Mon Sep 17 00:00:00 2001
|
||||
From: Baochen Qiang <quic_bqiang@quicinc.com>
|
||||
Date: Thu, 7 Sep 2023 09:56:06 +0800
|
||||
Subject: [PATCH] wifi: ath11k: fix boot failure with one MSI vector
|
||||
|
||||
Commit 5b32b6dd96633 ("ath11k: Remove core PCI references from
|
||||
PCI common code") breaks with one MSI vector because it moves
|
||||
affinity setting after IRQ request, see below log:
|
||||
|
||||
[ 1417.278835] ath11k_pci 0000:02:00.0: failed to receive control response completion, polling..
|
||||
[ 1418.302829] ath11k_pci 0000:02:00.0: Service connect timeout
|
||||
[ 1418.302833] ath11k_pci 0000:02:00.0: failed to connect to HTT: -110
|
||||
[ 1418.303669] ath11k_pci 0000:02:00.0: failed to start core: -110
|
||||
|
||||
The detail is, if do affinity request after IRQ activated,
|
||||
which is done in request_irq(), kernel caches that request and
|
||||
returns success directly. Later when a subsequent MHI interrupt is
|
||||
fired, kernel will do the real affinity setting work, as a result,
|
||||
changs the MSI vector. However at that time host has configured
|
||||
old vector to hardware, so host never receives CE or DP interrupts.
|
||||
|
||||
Fix it by setting affinity before registering MHI controller
|
||||
where host is, for the first time, doing IRQ request.
|
||||
|
||||
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
|
||||
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
|
||||
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1
|
||||
|
||||
Fixes: 5b32b6dd9663 ("ath11k: Remove core PCI references from PCI common code")
|
||||
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230907015606.16297-1-quic_bqiang@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/pci.c | 24 ++++++++++++------------
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -852,10 +852,16 @@ unsupported_wcn6855_soc:
|
||||
if (ret)
|
||||
goto err_pci_disable_msi;
|
||||
|
||||
+ ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0));
|
||||
+ if (ret) {
|
||||
+ ath11k_err(ab, "failed to set irq affinity %d\n", ret);
|
||||
+ goto err_pci_disable_msi;
|
||||
+ }
|
||||
+
|
||||
ret = ath11k_mhi_register(ab_pci);
|
||||
if (ret) {
|
||||
ath11k_err(ab, "failed to register mhi: %d\n", ret);
|
||||
- goto err_pci_disable_msi;
|
||||
+ goto err_irq_affinity_cleanup;
|
||||
}
|
||||
|
||||
ret = ath11k_hal_srng_init(ab);
|
||||
@@ -876,12 +882,6 @@ unsupported_wcn6855_soc:
|
||||
goto err_ce_free;
|
||||
}
|
||||
|
||||
- ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0));
|
||||
- if (ret) {
|
||||
- ath11k_err(ab, "failed to set irq affinity %d\n", ret);
|
||||
- goto err_free_irq;
|
||||
- }
|
||||
-
|
||||
/* kernel may allocate a dummy vector before request_irq and
|
||||
* then allocate a real vector when request_irq is called.
|
||||
* So get msi_data here again to avoid spurious interrupt
|
||||
@@ -890,20 +890,17 @@ unsupported_wcn6855_soc:
|
||||
ret = ath11k_pci_config_msi_data(ab_pci);
|
||||
if (ret) {
|
||||
ath11k_err(ab, "failed to config msi_data: %d\n", ret);
|
||||
- goto err_irq_affinity_cleanup;
|
||||
+ goto err_free_irq;
|
||||
}
|
||||
|
||||
ret = ath11k_core_init(ab);
|
||||
if (ret) {
|
||||
ath11k_err(ab, "failed to init core: %d\n", ret);
|
||||
- goto err_irq_affinity_cleanup;
|
||||
+ goto err_free_irq;
|
||||
}
|
||||
ath11k_qmi_fwreset_from_cold_boot(ab);
|
||||
return 0;
|
||||
|
||||
-err_irq_affinity_cleanup:
|
||||
- ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);
|
||||
-
|
||||
err_free_irq:
|
||||
ath11k_pcic_free_irq(ab);
|
||||
|
||||
@@ -916,6 +913,9 @@ err_hal_srng_deinit:
|
||||
err_mhi_unregister:
|
||||
ath11k_mhi_unregister(ab_pci);
|
||||
|
||||
+err_irq_affinity_cleanup:
|
||||
+ ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);
|
||||
+
|
||||
err_pci_disable_msi:
|
||||
ath11k_pci_free_msi(ab_pci);
|
||||
|
||||
@ -22,7 +22,7 @@ Link: https://lore.kernel.org/r/20230824075121.121144-1-dmantipov@yandex.ru
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -5094,13 +5094,6 @@ static void ath11k_dp_rx_mon_dest_proces
|
||||
@@ -5100,13 +5100,6 @@ static void ath11k_dp_rx_mon_dest_proces
|
||||
|
||||
mon_dst_srng = &ar->ab->hal.srng_list[ring_id];
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com
|
||||
|
||||
switch (tag) {
|
||||
case HTT_PPDU_STATS_TAG_COMMON:
|
||||
@@ -4486,8 +4486,7 @@ int ath11k_dp_rx_monitor_link_desc_retur
|
||||
@@ -4492,8 +4492,7 @@ int ath11k_dp_rx_monitor_link_desc_retur
|
||||
src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng);
|
||||
|
||||
if (src_srng_desc) {
|
||||
@ -54,7 +54,7 @@ Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com
|
||||
|
||||
*src_desc = *((struct ath11k_buffer_addr *)p_last_buf_addr_info);
|
||||
} else {
|
||||
@@ -4506,8 +4505,7 @@ void ath11k_dp_rx_mon_next_link_desc_get
|
||||
@@ -4512,8 +4511,7 @@ void ath11k_dp_rx_mon_next_link_desc_get
|
||||
u8 *rbm,
|
||||
void **pp_buf_addr_info)
|
||||
{
|
||||
@ -64,7 +64,7 @@ Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com
|
||||
struct ath11k_buffer_addr *buf_addr_info;
|
||||
|
||||
buf_addr_info = (struct ath11k_buffer_addr *)&msdu_link->buf_addr_info;
|
||||
@@ -4548,7 +4546,7 @@ static void ath11k_hal_rx_msdu_list_get(
|
||||
@@ -4554,7 +4552,7 @@ static void ath11k_hal_rx_msdu_list_get(
|
||||
u32 first = FIELD_PREP(RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU, 1);
|
||||
u8 tmp = 0;
|
||||
|
||||
@ -73,7 +73,7 @@ Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com
|
||||
msdu_details = &msdu_link->msdu_link[0];
|
||||
|
||||
for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) {
|
||||
@@ -4645,8 +4643,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k
|
||||
@@ -4651,8 +4649,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k
|
||||
bool is_frag, is_first_msdu;
|
||||
bool drop_mpdu = false;
|
||||
struct ath11k_skb_rxcb *rxcb;
|
||||
|
||||
@ -26,9 +26,9 @@ Link: https://lore.kernel.org/r/20230912051857.2284-4-quic_adisi@quicinc.com
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -9060,6 +9060,14 @@ static int ath11k_mac_op_get_txpower(str
|
||||
if (ar->state != ATH11K_STATE_ON)
|
||||
goto err_fallback;
|
||||
@@ -9068,6 +9068,14 @@ static int ath11k_mac_op_get_txpower(str
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
+ /* Firmware doesn't provide Tx power during CAC hence no need to fetch
|
||||
+ * the stats.
|
||||
|
||||
@ -230,7 +230,7 @@ Link: https://lore.kernel.org/r/20231009-ath11k_sta_to_arsta-v1-1-1563e3a307e8@q
|
||||
|
||||
memset(&arsta->txrate, 0, sizeof(arsta->txrate));
|
||||
|
||||
@@ -5242,7 +5242,7 @@ int ath11k_dp_rx_process_mon_status(stru
|
||||
@@ -5248,7 +5248,7 @@ int ath11k_dp_rx_process_mon_status(stru
|
||||
goto next_skb;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From a3be23672b4a81256d275af31afc6edcce5c5a26 Mon Sep 17 00:00:00 2001
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Mon, 22 Jan 2024 11:38:28 +0200
|
||||
Subject: [PATCH] wifi: ath11k: disable coldboot for ipq6018
|
||||
|
||||
Coldboot calibration does not work at the moment and causes failure during
|
||||
wifi startup.
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/core.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -168,8 +168,8 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = false,
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
- .coldboot_cal_mm = true,
|
||||
- .coldboot_cal_ftm = true,
|
||||
+ .coldboot_cal_mm = false,
|
||||
+ .coldboot_cal_ftm = false,
|
||||
.cbcal_restart_fw = true,
|
||||
.fw_mem_mode = 0,
|
||||
.num_vdevs = 16 + 1,
|
||||
@ -109,7 +109,7 @@ drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++
|
||||
|
||||
/* debugfs: queues etc */
|
||||
|
||||
@@ -997,6 +1088,8 @@ ath5k_debug_init_device(struct ath5k_hw
|
||||
@@ -995,6 +1086,8 @@ ath5k_debug_init_device(struct ath5k_hw
|
||||
debugfs_create_file("queue", 0600, phydir, ah, &fops_queue);
|
||||
debugfs_create_bool("32khz_clock", 0600, phydir,
|
||||
&ah->ah_use_32khz_clock);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -1471,6 +1471,7 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
@@ -1431,6 +1431,7 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
|
||||
ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||
ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||
@ -82,7 +82,7 @@
|
||||
void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
|
||||
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
|
||||
@@ -519,6 +519,7 @@ int ath9k_htc_init_debug(struct ath_hw *
|
||||
@@ -514,6 +514,7 @@ int ath9k_htc_init_debug(struct ath_hw *
|
||||
|
||||
ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
|
||||
ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -1472,6 +1472,7 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
@@ -1432,6 +1432,7 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||
ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||
ath9k_cmn_debug_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||
@ -137,7 +137,7 @@
|
||||
+EXPORT_SYMBOL(ath9k_cmn_debug_chanbw);
|
||||
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
|
||||
@@ -520,6 +520,7 @@ int ath9k_htc_init_debug(struct ath_hw *
|
||||
@@ -515,6 +515,7 @@ int ath9k_htc_init_debug(struct ath_hw *
|
||||
ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
|
||||
ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah);
|
||||
ath9k_cmn_debug_eeprom(priv->debug.debugfs_phy, priv->ah);
|
||||
|
||||
@ -192,7 +192,7 @@
|
||||
#endif
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -128,6 +128,61 @@ static const struct file_operations fops
|
||||
@@ -123,6 +123,61 @@ static const struct file_operations fops
|
||||
|
||||
#define DMA_BUF_LEN 1024
|
||||
|
||||
@ -254,7 +254,7 @@
|
||||
|
||||
static ssize_t read_file_ani(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
@@ -1432,6 +1487,10 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
@@ -1392,6 +1447,10 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
ath9k_tx99_init_debug(sc);
|
||||
ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -1468,6 +1468,50 @@ void ath9k_deinit_debug(struct ath_softc
|
||||
@@ -1428,6 +1428,50 @@ void ath9k_deinit_debug(struct ath_softc
|
||||
ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
int ath9k_init_debug(struct ath_hw *ah)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
@@ -1491,6 +1535,8 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
@@ -1451,6 +1495,8 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
debugfs_create_file("gpio_led", S_IWUSR,
|
||||
sc->debug.debugfs_phy, sc, &fops_gpio_led);
|
||||
#endif
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -491,43 +491,6 @@ USB_VL600=
|
||||
@@ -493,43 +493,6 @@ USB_VL600=
|
||||
USB_NET_CH9200=
|
||||
USB_NET_AQC111=
|
||||
USB_RTL8153_ECM=
|
||||
@ -171,7 +171,7 @@
|
||||
depends on CORDIC
|
||||
--- a/Kconfig.local
|
||||
+++ b/Kconfig.local
|
||||
@@ -1477,117 +1477,6 @@ config BACKPORTED_USB_NET_AQC111
|
||||
@@ -1483,117 +1483,6 @@ config BACKPORTED_USB_NET_AQC111
|
||||
config BACKPORTED_USB_RTL8153_ECM
|
||||
tristate
|
||||
default USB_RTL8153_ECM
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
};
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -17509,7 +17509,9 @@ static struct genl_family nl80211_fam __
|
||||
@@ -17551,7 +17551,9 @@ static struct genl_family nl80211_fam __
|
||||
.n_ops = ARRAY_SIZE(nl80211_ops),
|
||||
.small_ops = nl80211_small_ops,
|
||||
.n_small_ops = ARRAY_SIZE(nl80211_small_ops),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -16400,8 +16400,7 @@ static u32 nl80211_internal_flags[] = {
|
||||
@@ -16442,8 +16442,7 @@ static u32 nl80211_internal_flags[] = {
|
||||
#undef SELECTOR
|
||||
};
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
struct genl_info *info)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = NULL;
|
||||
@@ -16502,8 +16501,7 @@ out_unlock:
|
||||
@@ -16544,8 +16543,7 @@ out_unlock:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@ -152,7 +152,7 @@ Signed-off-by: Pali Rohár <pali@kernel.org>
|
||||
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/main.h
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
|
||||
@@ -1100,6 +1100,8 @@ void mwifiex_cancel_all_pending_cmd(stru
|
||||
@@ -1086,6 +1086,8 @@ void mwifiex_cancel_all_pending_cmd(stru
|
||||
void mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter);
|
||||
void mwifiex_cancel_scan(struct mwifiex_adapter *adapter);
|
||||
|
||||
@ -177,7 +177,7 @@ Signed-off-by: Pali Rohár <pali@kernel.org>
|
||||
adapter->cmd_wait_q.status = -1;
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
|
||||
@@ -794,7 +794,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi
|
||||
@@ -802,7 +802,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi
|
||||
break;
|
||||
default:
|
||||
mwifiex_dbg(priv->adapter, ERROR,
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From 186f2432741f6d28d86ff723ac7830446affddfc Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Sat, 5 Aug 2023 17:17:28 +0800
|
||||
Subject: wifi: rt2x00: correct MAC_SYS_CTRL register RX mask in R-Calibration
|
||||
|
||||
For MAC_SYS_CTRL register, Bit[2] controls MAC_TX_EN and Bit[3]
|
||||
controls MAC_RX_EN (Bit index starts from 0). Therefore, 0x08 is
|
||||
the correct mask for RX.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/TYAP286MB03150B571B67B896A504AC34BC0EA@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8561,7 +8561,7 @@ static void rt2800_r_calibration(struct
|
||||
rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n");
|
||||
|
||||
maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
- maccfg &= (~0x04);
|
||||
+ maccfg &= (~0x08);
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
|
||||
|
||||
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
@ -1,115 +0,0 @@
|
||||
From 821b5192c955144bd2f0aeea6cd153e1aedd16e1 Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Fri, 11 Aug 2023 14:34:54 +0800
|
||||
Subject: wifi: rt2x00: limit MT7620 TX power based on eeprom calibration
|
||||
|
||||
In the vendor driver, the current channel power is queried from
|
||||
EEPROM_TXPOWER_BG1 and EEPROM_TXPOWER_BG2. And then the mixed value
|
||||
will be written into the low half-word of the TX_ALC_CFG_0 register.
|
||||
The high half-word of the TX_ALC_CFG_0 is a fixed value 0x2f2f.
|
||||
|
||||
We can't get the accurate TX power. Based on my tests and the new
|
||||
MediaTek mt76 driver source code, the real TX power is approximately
|
||||
equal to channel_power + (max) rate_power. Usually max rate_power is
|
||||
the gain of the OFDM 6M rate, which can be readed from the offset
|
||||
EEPROM_TXPOWER_BYRATE +1.
|
||||
|
||||
Based on these eeprom values, this patch adds basic TX power control
|
||||
for the MT7620 and limits its maximum TX power. This can avoid the
|
||||
link speed decrease caused by chip overheating. rt2800_config_alc()
|
||||
function has also been renamed to rt2800_config_alc_rt6352() because
|
||||
it's only used by RT6352 (MT7620).
|
||||
|
||||
Notice:
|
||||
It's still need some work to sync the max channel power to the user
|
||||
interface. This part is missing from the rt2x00 driver framework. If
|
||||
we set the power exceed the calibration value, it won't take effect.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/TYAP286MB03159090ED14044215E59FD6BC10A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 57 ++++++++++++++++++--------
|
||||
1 file changed, 40 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3865,28 +3865,51 @@ static void rt2800_config_channel_rf7620
|
||||
}
|
||||
}
|
||||
|
||||
-static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev,
|
||||
- struct ieee80211_channel *chan,
|
||||
- int power_level) {
|
||||
- u16 eeprom, target_power, max_power;
|
||||
+static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev,
|
||||
+ struct ieee80211_channel *chan,
|
||||
+ int power_level)
|
||||
+{
|
||||
+ int cur_channel = rt2x00dev->rf_channel;
|
||||
+ u16 eeprom, chan_power, rate_power, target_power;
|
||||
+ u16 tx_power[2];
|
||||
+ s8 *power_group[2];
|
||||
u32 mac_sys_ctrl;
|
||||
- u32 reg;
|
||||
+ u32 cnt, reg;
|
||||
u8 bbp;
|
||||
|
||||
- /* hardware unit is 0.5dBm, limited to 23.5dBm */
|
||||
- power_level *= 2;
|
||||
- if (power_level > 0x2f)
|
||||
- power_level = 0x2f;
|
||||
-
|
||||
- max_power = chan->max_power * 2;
|
||||
- if (max_power > 0x2f)
|
||||
- max_power = 0x2f;
|
||||
+ if (WARN_ON(cur_channel < 1 || cur_channel > 14))
|
||||
+ return;
|
||||
+
|
||||
+ /* get per chain power, 2 chains in total, unit is 0.5dBm */
|
||||
+ power_level = (power_level - 3) * 2;
|
||||
+
|
||||
+ /* We can't get the accurate TX power. Based on some tests, the real
|
||||
+ * TX power is approximately equal to channel_power + (max)rate_power.
|
||||
+ * Usually max rate_power is the gain of the OFDM 6M rate. The antenna
|
||||
+ * gain and externel PA gain are not included as we are unable to
|
||||
+ * obtain these values.
|
||||
+ */
|
||||
+ rate_power = rt2800_eeprom_read_from_array(rt2x00dev,
|
||||
+ EEPROM_TXPOWER_BYRATE, 1);
|
||||
+ rate_power &= 0x3f;
|
||||
+ power_level -= rate_power;
|
||||
+ if (power_level < 1)
|
||||
+ power_level = 1;
|
||||
+
|
||||
+ power_group[0] = rt2800_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG1);
|
||||
+ power_group[1] = rt2800_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG2);
|
||||
+ for (cnt = 0; cnt < 2; cnt++) {
|
||||
+ chan_power = power_group[cnt][cur_channel - 1];
|
||||
+ if (chan_power >= 0x20 || chan_power == 0)
|
||||
+ chan_power = 0x10;
|
||||
+ tx_power[cnt] = power_level < chan_power ? power_level : chan_power;
|
||||
+ }
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_0);
|
||||
- rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_0, power_level);
|
||||
- rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_1, power_level);
|
||||
- rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_0, max_power);
|
||||
- rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_1, max_power);
|
||||
+ rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_0, tx_power[0]);
|
||||
+ rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_1, tx_power[1]);
|
||||
+ rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_0, 0x2f);
|
||||
+ rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_1, 0x2f);
|
||||
|
||||
eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);
|
||||
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_INTERNAL_TX_ALC)) {
|
||||
@@ -5268,7 +5291,7 @@ static void rt2800_config_txpower_rt6352
|
||||
rt2x00_set_field32(&pwreg, TX_PWR_CFG_9B_STBC_MCS7, t);
|
||||
rt2800_register_write(rt2x00dev, TX_PWR_CFG_9, pwreg);
|
||||
|
||||
- rt2800_config_alc(rt2x00dev, chan, power_level);
|
||||
+ rt2800_config_alc_rt6352(rt2x00dev, chan, power_level);
|
||||
|
||||
/* TODO: temperature compensation code! */
|
||||
}
|
||||
@ -21,7 +21,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -350,6 +350,7 @@ RT2X00_LIB_FIRMWARE=
|
||||
@@ -352,6 +352,7 @@ RT2X00_LIB_FIRMWARE=
|
||||
RT2X00_LIB_CRYPTO=
|
||||
RT2X00_LIB_LEDS=
|
||||
RT2X00_LIB_DEBUGFS=
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
From ee0db868ee4d88493dfdc82f59e3b4e449ddddd5 Mon Sep 17 00:00:00 2001
|
||||
From: Oldřich Jedlička <oldium.pro@gmail.com>
|
||||
Date: Sat, 4 Nov 2023 15:13:33 +0100
|
||||
Subject: wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during
|
||||
flush
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ Upstream commit 3e3a2b645c043f7e3e488d5011478cefb69bbe8b ]
|
||||
|
||||
This fixes WARN_ONs when using AP_VLANs after station removal. The flush
|
||||
call passed AP_VLAN vif to driver, but because these vifs are virtual and
|
||||
not registered with drivers, we need to translate to the correct AP vif
|
||||
first.
|
||||
|
||||
Closes: https://github.com/openwrt/openwrt/issues/12420
|
||||
Fixes: 0b75a1b1e42e ("wifi: mac80211: flush queues on STA removal")
|
||||
Fixes: d00800a289c9 ("wifi: mac80211: add flush_sta method")
|
||||
Tested-by: Konstantin Demin <rockdrilla@gmail.com>
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
|
||||
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
|
||||
Link: https://lore.kernel.org/r/20231104141333.3710-1-oldium.pro@gmail.com
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
||||
---
|
||||
net/mac80211/driver-ops.h | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/net/mac80211/driver-ops.h
|
||||
+++ b/net/mac80211/driver-ops.h
|
||||
@@ -23,7 +23,7 @@
|
||||
static inline struct ieee80211_sub_if_data *
|
||||
get_bss_sdata(struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
|
||||
+ if (sdata && sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
|
||||
sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
|
||||
u.ap);
|
||||
|
||||
@@ -638,10 +638,13 @@ static inline void drv_flush(struct ieee
|
||||
struct ieee80211_sub_if_data *sdata,
|
||||
u32 queues, bool drop)
|
||||
{
|
||||
- struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
|
||||
+ struct ieee80211_vif *vif;
|
||||
|
||||
might_sleep();
|
||||
|
||||
+ sdata = get_bss_sdata(sdata);
|
||||
+ vif = sdata ? &sdata->vif : NULL;
|
||||
+
|
||||
if (sdata && !check_sdata_in_driver(sdata))
|
||||
return;
|
||||
|
||||
@@ -657,6 +660,8 @@ static inline void drv_flush_sta(struct
|
||||
{
|
||||
might_sleep();
|
||||
|
||||
+ sdata = get_bss_sdata(sdata);
|
||||
+
|
||||
if (sdata && !check_sdata_in_driver(sdata))
|
||||
return;
|
||||
|
||||
@ -9,7 +9,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -1632,7 +1632,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
@@ -1635,7 +1635,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
link_conf->bssid_indicator = 0;
|
||||
|
||||
__sta_info_flush(sdata, true);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/net/mac80211/main.c
|
||||
+++ b/net/mac80211/main.c
|
||||
@@ -1396,24 +1396,6 @@ int ieee80211_register_hw(struct ieee802
|
||||
@@ -1393,24 +1393,6 @@ int ieee80211_register_hw(struct ieee802
|
||||
debugfs_hw_add(local);
|
||||
rate_control_add_debugfs(local);
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey)
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -2843,6 +2843,8 @@ static int ieee80211_scan(struct wiphy *
|
||||
@@ -2847,6 +2847,8 @@ static int ieee80211_scan(struct wiphy *
|
||||
*/
|
||||
fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
|
||||
@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -558,6 +558,7 @@ __sta_info_alloc(struct ieee80211_sub_if
|
||||
@@ -561,6 +561,7 @@ __sta_info_alloc(struct ieee80211_sub_if
|
||||
INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
|
||||
INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
|
||||
mutex_init(&sta->ampdu_mlme.mtx);
|
||||
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -4059,7 +4059,7 @@ struct ieee80211_txq *ieee80211_next_txq
|
||||
@@ -4060,7 +4060,7 @@ struct ieee80211_txq *ieee80211_next_txq
|
||||
|
||||
if (deficit < 0)
|
||||
sta->airtime[txqi->txq.ac].deficit +=
|
||||
@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (deficit < 0 || !aql_check) {
|
||||
list_move_tail(&txqi->schedule_order,
|
||||
@@ -4202,7 +4202,8 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
@@ -4203,7 +4203,8 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
}
|
||||
sta = container_of(iter->txq.sta, struct sta_info, sta);
|
||||
if (ieee80211_sta_deficit(sta, ac) < 0)
|
||||
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
list_move_tail(&iter->schedule_order, &local->active_txqs[ac]);
|
||||
}
|
||||
|
||||
@@ -4210,7 +4211,7 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
@@ -4211,7 +4212,7 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
if (sta->airtime[ac].deficit >= 0)
|
||||
goto out;
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
struct ieee80211_fast_tx fast_tx;
|
||||
u8 hdr[sizeof(struct ieee80211s_hdr) + sizeof(rfc1042_header)];
|
||||
@@ -334,7 +358,8 @@ void mesh_path_tx_root_frame(struct ieee
|
||||
@@ -333,7 +357,8 @@ void mesh_path_tx_root_frame(struct ieee
|
||||
|
||||
bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
|
||||
struct ieee80211_mesh_fast_tx *
|
||||
@ -175,12 +175,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ ether_addr_copy(key.addr, addr);
|
||||
cache = &sdata->u.mesh.tx_cache;
|
||||
spin_lock_bh(&cache->walk_lock);
|
||||
- entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
|
||||
- entry = rhashtable_lookup_fast(&cache->rht, addr, fast_tx_rht_params);
|
||||
- if (entry)
|
||||
- mesh_fast_tx_entry_free(cache, entry);
|
||||
+ for (i = MESH_FAST_TX_TYPE_LOCAL; i < MESH_FAST_TX_TYPE_FORWARDED; i++) {
|
||||
+ key.type = i;
|
||||
+ entry = rhashtable_lookup(&cache->rht, &key, fast_tx_rht_params);
|
||||
+ entry = rhashtable_lookup_fast(&cache->rht, &key, fast_tx_rht_params);
|
||||
+ if (entry)
|
||||
+ mesh_fast_tx_entry_free(cache, entry);
|
||||
+ }
|
||||
@ -189,7 +189,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/rx.c
|
||||
+++ b/net/mac80211/rx.c
|
||||
@@ -2727,7 +2727,10 @@ ieee80211_rx_mesh_fast_forward(struct ie
|
||||
@@ -2726,7 +2726,10 @@ ieee80211_rx_mesh_fast_forward(struct ie
|
||||
struct sk_buff *skb, int hdrlen)
|
||||
{
|
||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||
@ -201,7 +201,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
struct ieee80211s_hdr *mesh_hdr;
|
||||
struct tid_ampdu_tx *tid_tx;
|
||||
struct sta_info *sta;
|
||||
@@ -2736,9 +2739,13 @@ ieee80211_rx_mesh_fast_forward(struct ie
|
||||
@@ -2735,9 +2738,13 @@ ieee80211_rx_mesh_fast_forward(struct ie
|
||||
|
||||
mesh_hdr = (struct ieee80211s_hdr *)(skb->data + sizeof(eth));
|
||||
if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 12 Sep 2023 15:09:27 +0200
|
||||
Subject: [PATCH] mac80211: fix mesh id corruption on 32 bit systems
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Since the changed field size was increased to u64, mesh_bss_info_changed
|
||||
pulls invalid bits from the first 3 bytes of the mesh id, clears them, and
|
||||
passes them on to ieee80211_link_info_change_notify, because
|
||||
ifmsh->mbss_changed was not updated to match its size.
|
||||
Fix this by turning into ifmsh->mbss_changed into an unsigned long array with
|
||||
64 bit size.
|
||||
|
||||
Fixes: 15ddba5f4311 ("wifi: mac80211: consistently use u64 for BSS changes")
|
||||
Reported-by: Thomas Hühn <thomas.huehn@hs-nordhausen.de>
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -678,7 +678,7 @@ struct ieee80211_if_mesh {
|
||||
struct timer_list mesh_path_root_timer;
|
||||
|
||||
unsigned long wrkq_flags;
|
||||
- unsigned long mbss_changed;
|
||||
+ unsigned long mbss_changed[64 / BITS_PER_LONG];
|
||||
|
||||
bool userspace_handles_dfs;
|
||||
|
||||
--- a/net/mac80211/mesh.c
|
||||
+++ b/net/mac80211/mesh.c
|
||||
@@ -1181,7 +1181,7 @@ void ieee80211_mbss_info_change_notify(s
|
||||
|
||||
/* if we race with running work, worst case this work becomes a noop */
|
||||
for_each_set_bit(bit, &bits, sizeof(changed) * BITS_PER_BYTE)
|
||||
- set_bit(bit, &ifmsh->mbss_changed);
|
||||
+ set_bit(bit, ifmsh->mbss_changed);
|
||||
set_bit(MESH_WORK_MBSS_CHANGED, &ifmsh->wrkq_flags);
|
||||
wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ void ieee80211_stop_mesh(struct ieee8021
|
||||
|
||||
/* clear any mesh work (for next join) we may have accrued */
|
||||
ifmsh->wrkq_flags = 0;
|
||||
- ifmsh->mbss_changed = 0;
|
||||
+ memset(ifmsh->mbss_changed, 0, sizeof(ifmsh->mbss_changed));
|
||||
|
||||
local->fif_other_bss--;
|
||||
atomic_dec(&local->iff_allmultis);
|
||||
@@ -1730,9 +1730,9 @@ static void mesh_bss_info_changed(struct
|
||||
u32 bit;
|
||||
u64 changed = 0;
|
||||
|
||||
- for_each_set_bit(bit, &ifmsh->mbss_changed,
|
||||
+ for_each_set_bit(bit, ifmsh->mbss_changed,
|
||||
sizeof(changed) * BITS_PER_BYTE) {
|
||||
- clear_bit(bit, &ifmsh->mbss_changed);
|
||||
+ clear_bit(bit, ifmsh->mbss_changed);
|
||||
changed |= BIT(bit);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
|
||||
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
|
||||
@@ -1075,8 +1075,8 @@ static void iwl_init_he_hw_capab(struct
|
||||
@@ -1078,8 +1078,8 @@ static void iwl_init_he_hw_capab(struct
|
||||
|
||||
memcpy(iftype_data, iwl_he_eht_capa, sizeof(iwl_he_eht_capa));
|
||||
|
||||
@ -70,7 +70,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
iwl_nvm_fixup_sband_iftd(trans, data, sband, &iftype_data[i],
|
||||
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
|
||||
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
|
||||
@@ -1119,8 +1119,7 @@ void mt7915_set_stream_he_caps(struct mt
|
||||
@@ -1127,8 +1127,7 @@ void mt7915_set_stream_he_caps(struct mt
|
||||
n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data);
|
||||
|
||||
band = &phy->mt76->sband_2g.sband;
|
||||
@ -80,7 +80,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
}
|
||||
|
||||
if (phy->mt76->cap.has_5ghz) {
|
||||
@@ -1128,8 +1127,7 @@ void mt7915_set_stream_he_caps(struct mt
|
||||
@@ -1136,8 +1135,7 @@ void mt7915_set_stream_he_caps(struct mt
|
||||
n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data);
|
||||
|
||||
band = &phy->mt76->sband_5g.sband;
|
||||
@ -90,7 +90,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
}
|
||||
|
||||
if (phy->mt76->cap.has_6ghz) {
|
||||
@@ -1137,8 +1135,7 @@ void mt7915_set_stream_he_caps(struct mt
|
||||
@@ -1145,8 +1143,7 @@ void mt7915_set_stream_he_caps(struct mt
|
||||
n = mt7915_init_he_caps(phy, NL80211_BAND_6GHZ, data);
|
||||
|
||||
band = &phy->mt76->sband_6g.sband;
|
||||
@ -133,7 +133,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
}
|
||||
--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
|
||||
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
|
||||
@@ -823,8 +823,7 @@ __mt7996_set_stream_he_eht_caps(struct m
|
||||
@@ -828,8 +828,7 @@ __mt7996_set_stream_he_eht_caps(struct m
|
||||
n++;
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
kfree(wiphy->bands[band]->channels);
|
||||
--- a/drivers/net/wireless/realtek/rtw89/core.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw89/core.c
|
||||
@@ -3328,8 +3328,7 @@ static void rtw89_init_he_cap(struct rtw
|
||||
@@ -3359,8 +3359,7 @@ static void rtw89_init_he_cap(struct rtw
|
||||
idx++;
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
}
|
||||
|
||||
static int rtw89_core_set_supported_band(struct rtw89_dev *rtwdev)
|
||||
@@ -3374,11 +3373,11 @@ err:
|
||||
@@ -3405,11 +3404,11 @@ err:
|
||||
hw->wiphy->bands[NL80211_BAND_5GHZ] = NULL;
|
||||
hw->wiphy->bands[NL80211_BAND_6GHZ] = NULL;
|
||||
if (sband_2ghz)
|
||||
@ -202,7 +202,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
kfree(sband_2ghz);
|
||||
kfree(sband_5ghz);
|
||||
kfree(sband_6ghz);
|
||||
@@ -3390,11 +3389,11 @@ static void rtw89_core_clr_supported_ban
|
||||
@@ -3421,11 +3420,11 @@ static void rtw89_core_clr_supported_ban
|
||||
struct ieee80211_hw *hw = rtwdev->hw;
|
||||
|
||||
if (hw->wiphy->bands[NL80211_BAND_2GHZ])
|
||||
@ -219,7 +219,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
kfree(hw->wiphy->bands[NL80211_BAND_6GHZ]);
|
||||
--- a/drivers/net/wireless/realtek/rtw89/regd.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw89/regd.c
|
||||
@@ -376,7 +376,7 @@ bottom:
|
||||
@@ -377,7 +377,7 @@ bottom:
|
||||
return;
|
||||
|
||||
wiphy->bands[NL80211_BAND_6GHZ] = NULL;
|
||||
@ -230,7 +230,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
@@ -4900,25 +4900,19 @@ static const struct ieee80211_sband_ifty
|
||||
@@ -4899,25 +4899,19 @@ static const struct ieee80211_sband_ifty
|
||||
|
||||
static void mac80211_hwsim_sband_capab(struct ieee80211_supported_band *sband)
|
||||
{
|
||||
@ -362,7 +362,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
}
|
||||
--- a/net/mac80211/main.c
|
||||
+++ b/net/mac80211/main.c
|
||||
@@ -1055,6 +1055,7 @@ int ieee80211_register_hw(struct ieee802
|
||||
@@ -1052,6 +1052,7 @@ int ieee80211_register_hw(struct ieee802
|
||||
supp_he = false;
|
||||
supp_eht = false;
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
@ -370,7 +370,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
struct ieee80211_supported_band *sband;
|
||||
|
||||
sband = local->hw.wiphy->bands[band];
|
||||
@@ -1101,11 +1102,7 @@ int ieee80211_register_hw(struct ieee802
|
||||
@@ -1098,11 +1099,7 @@ int ieee80211_register_hw(struct ieee802
|
||||
supp_ht = supp_ht || sband->ht_cap.ht_supported;
|
||||
supp_vht = supp_vht || sband->vht_cap.vht_supported;
|
||||
|
||||
@ -415,7 +415,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
@@ -817,6 +817,7 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
@@ -819,6 +819,7 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
|
||||
/* sanity check supported bands/channels */
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
@ -423,7 +423,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
u16 types = 0;
|
||||
bool have_he = false;
|
||||
|
||||
@@ -873,14 +874,11 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
@@ -875,14 +876,11 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
if (WARN_ON(types & iftd->types_mask))
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -1906,20 +1906,20 @@ static int nl80211_send_band_rateinfo(st
|
||||
@@ -1907,20 +1907,20 @@ static int nl80211_send_band_rateinfo(st
|
||||
struct nlattr *nl_iftype_data =
|
||||
nla_nest_start_noflag(msg,
|
||||
NL80211_BAND_ATTR_IFTYPE_DATA);
|
||||
|
||||
@ -79,7 +79,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
u32 center_freq, u32 bandwidth,
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -469,29 +469,12 @@ int cfg80211_scan(struct cfg80211_regist
|
||||
@@ -476,29 +476,12 @@ int cfg80211_scan(struct cfg80211_regist
|
||||
|
||||
extern struct work_struct cfg80211_disconnect_work;
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -911,6 +911,7 @@ static int sta_info_insert_finish(struct
|
||||
@@ -914,6 +914,7 @@ static int sta_info_insert_finish(struct
|
||||
|
||||
if (ieee80211_vif_is_mesh(&sdata->vif))
|
||||
mesh_accept_plinks_update(sdata);
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
out_remove:
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -3033,7 +3033,7 @@ void ieee80211_check_fast_xmit(struct st
|
||||
@@ -3034,7 +3034,7 @@ void ieee80211_check_fast_xmit(struct st
|
||||
sdata->vif.type == NL80211_IFTYPE_STATION)
|
||||
goto out;
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
{
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -474,6 +474,8 @@ void cfg80211_set_dfs_state(struct wiphy
|
||||
@@ -481,6 +481,8 @@ void cfg80211_set_dfs_state(struct wiphy
|
||||
enum nl80211_dfs_state dfs_state);
|
||||
|
||||
void cfg80211_dfs_channels_update_work(struct work_struct *work);
|
||||
@ -124,7 +124,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s
|
||||
@@ -930,6 +930,8 @@ void cfg80211_dfs_channels_update_work(s
|
||||
if (c->dfs_state == NL80211_DFS_UNAVAILABLE) {
|
||||
time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS;
|
||||
radar_event = NL80211_RADAR_NOP_FINISHED;
|
||||
@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
} else {
|
||||
if (regulatory_pre_cac_allowed(wiphy) ||
|
||||
cfg80211_any_wiphy_oper_chan(wiphy, c))
|
||||
@@ -922,11 +924,10 @@ void cfg80211_dfs_channels_update_work(s
|
||||
@@ -937,11 +939,10 @@ void cfg80211_dfs_channels_update_work(s
|
||||
|
||||
time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS;
|
||||
radar_event = NL80211_RADAR_PRE_CAC_EXPIRED;
|
||||
|
||||
@ -0,0 +1,226 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Fri, 9 Feb 2024 19:43:40 +0100
|
||||
Subject: [PATCH] mac80211: add AQL support for broadcast packets
|
||||
|
||||
Excessive broadcast traffic with little competing unicast traffic can easily
|
||||
flood hardware queues, leading to throughput issues. Additionally, filling
|
||||
the hardware queues with too many packets breaks FQ for broadcast data.
|
||||
Fix this by enabling AQL for broadcast packets.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -3324,6 +3324,7 @@ enum wiphy_params_flags {
|
||||
/* The per TXQ device queue limit in airtime */
|
||||
#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000
|
||||
#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000
|
||||
+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_BC 50000
|
||||
|
||||
/* The per interface airtime threshold to switch to lower queue limit */
|
||||
#define IEEE80211_AQL_THRESHOLD 24000
|
||||
--- a/net/mac80211/debugfs.c
|
||||
+++ b/net/mac80211/debugfs.c
|
||||
@@ -215,11 +215,13 @@ static ssize_t aql_pending_read(struct f
|
||||
"VI %u us\n"
|
||||
"BE %u us\n"
|
||||
"BK %u us\n"
|
||||
+ "BC/MC %u us\n"
|
||||
"total %u us\n",
|
||||
atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_VO]),
|
||||
atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_VI]),
|
||||
atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_BE]),
|
||||
atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_BK]),
|
||||
+ atomic_read(&local->aql_bc_pending_airtime),
|
||||
atomic_read(&local->aql_total_pending_airtime));
|
||||
return simple_read_from_buffer(user_buf, count, ppos,
|
||||
buf, len);
|
||||
@@ -245,7 +247,8 @@ static ssize_t aql_txq_limit_read(struct
|
||||
"VO %u %u\n"
|
||||
"VI %u %u\n"
|
||||
"BE %u %u\n"
|
||||
- "BK %u %u\n",
|
||||
+ "BK %u %u\n"
|
||||
+ "BC/MC %u\n",
|
||||
local->aql_txq_limit_low[IEEE80211_AC_VO],
|
||||
local->aql_txq_limit_high[IEEE80211_AC_VO],
|
||||
local->aql_txq_limit_low[IEEE80211_AC_VI],
|
||||
@@ -253,7 +256,8 @@ static ssize_t aql_txq_limit_read(struct
|
||||
local->aql_txq_limit_low[IEEE80211_AC_BE],
|
||||
local->aql_txq_limit_high[IEEE80211_AC_BE],
|
||||
local->aql_txq_limit_low[IEEE80211_AC_BK],
|
||||
- local->aql_txq_limit_high[IEEE80211_AC_BK]);
|
||||
+ local->aql_txq_limit_high[IEEE80211_AC_BK],
|
||||
+ local->aql_txq_limit_bc);
|
||||
return simple_read_from_buffer(user_buf, count, ppos,
|
||||
buf, len);
|
||||
}
|
||||
@@ -279,6 +283,11 @@ static ssize_t aql_txq_limit_write(struc
|
||||
else
|
||||
buf[count] = '\0';
|
||||
|
||||
+ if (sscanf(buf, "mcast %u", &q_limit_low) == 1) {
|
||||
+ local->aql_txq_limit_bc = q_limit_low;
|
||||
+ return count;
|
||||
+ }
|
||||
+
|
||||
if (sscanf(buf, "%u %u %u", &ac, &q_limit_low, &q_limit_high) != 3)
|
||||
return -EINVAL;
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1328,10 +1328,12 @@ struct ieee80211_local {
|
||||
spinlock_t handle_wake_tx_queue_lock;
|
||||
|
||||
u16 airtime_flags;
|
||||
+ u32 aql_txq_limit_bc;
|
||||
u32 aql_txq_limit_low[IEEE80211_NUM_ACS];
|
||||
u32 aql_txq_limit_high[IEEE80211_NUM_ACS];
|
||||
u32 aql_threshold;
|
||||
atomic_t aql_total_pending_airtime;
|
||||
+ atomic_t aql_bc_pending_airtime;
|
||||
atomic_t aql_ac_pending_airtime[IEEE80211_NUM_ACS];
|
||||
|
||||
const struct ieee80211_ops *ops;
|
||||
--- a/net/mac80211/main.c
|
||||
+++ b/net/mac80211/main.c
|
||||
@@ -788,6 +788,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
|
||||
spin_lock_init(&local->rx_path_lock);
|
||||
spin_lock_init(&local->queue_stop_reason_lock);
|
||||
|
||||
+ local->aql_txq_limit_bc = IEEE80211_DEFAULT_AQL_TXQ_LIMIT_BC;
|
||||
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
|
||||
INIT_LIST_HEAD(&local->active_txqs[i]);
|
||||
spin_lock_init(&local->active_txq_lock[i]);
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -2341,28 +2341,27 @@ void ieee80211_sta_update_pending_airtim
|
||||
struct sta_info *sta, u8 ac,
|
||||
u16 tx_airtime, bool tx_completed)
|
||||
{
|
||||
+ atomic_t *counter;
|
||||
int tx_pending;
|
||||
|
||||
if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL))
|
||||
return;
|
||||
|
||||
- if (!tx_completed) {
|
||||
- if (sta)
|
||||
- atomic_add(tx_airtime,
|
||||
- &sta->airtime[ac].aql_tx_pending);
|
||||
+ if (sta)
|
||||
+ counter = &sta->airtime[ac].aql_tx_pending;
|
||||
+ else
|
||||
+ counter = &local->aql_bc_pending_airtime;
|
||||
|
||||
+ if (!tx_completed) {
|
||||
+ atomic_add(tx_airtime, counter);
|
||||
atomic_add(tx_airtime, &local->aql_total_pending_airtime);
|
||||
atomic_add(tx_airtime, &local->aql_ac_pending_airtime[ac]);
|
||||
return;
|
||||
}
|
||||
|
||||
- if (sta) {
|
||||
- tx_pending = atomic_sub_return(tx_airtime,
|
||||
- &sta->airtime[ac].aql_tx_pending);
|
||||
- if (tx_pending < 0)
|
||||
- atomic_cmpxchg(&sta->airtime[ac].aql_tx_pending,
|
||||
- tx_pending, 0);
|
||||
- }
|
||||
+ tx_pending = atomic_sub_return(tx_airtime, counter);
|
||||
+ if (tx_pending < 0)
|
||||
+ atomic_cmpxchg(counter, tx_pending, 0);
|
||||
|
||||
atomic_sub(tx_airtime, &local->aql_total_pending_airtime);
|
||||
tx_pending = atomic_sub_return(tx_airtime,
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -3958,9 +3958,8 @@ begin:
|
||||
encap_out:
|
||||
IEEE80211_SKB_CB(skb)->control.vif = vif;
|
||||
|
||||
- if (tx.sta &&
|
||||
- wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) {
|
||||
- bool ampdu = txq->ac != IEEE80211_AC_VO;
|
||||
+ if (wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) {
|
||||
+ bool ampdu = txq->sta && txq->ac != IEEE80211_AC_VO;
|
||||
u32 airtime;
|
||||
|
||||
airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta,
|
||||
@@ -4026,6 +4025,7 @@ struct ieee80211_txq *ieee80211_next_txq
|
||||
struct ieee80211_txq *ret = NULL;
|
||||
struct txq_info *txqi = NULL, *head = NULL;
|
||||
bool found_eligible_txq = false;
|
||||
+ bool aql_check;
|
||||
|
||||
spin_lock_bh(&local->active_txq_lock[ac]);
|
||||
|
||||
@@ -4049,26 +4049,26 @@ struct ieee80211_txq *ieee80211_next_txq
|
||||
if (!head)
|
||||
head = txqi;
|
||||
|
||||
+ aql_check = ieee80211_txq_airtime_check(hw, &txqi->txq);
|
||||
+ if (aql_check)
|
||||
+ found_eligible_txq = true;
|
||||
+
|
||||
if (txqi->txq.sta) {
|
||||
struct sta_info *sta = container_of(txqi->txq.sta,
|
||||
struct sta_info, sta);
|
||||
- bool aql_check = ieee80211_txq_airtime_check(hw, &txqi->txq);
|
||||
- s32 deficit = ieee80211_sta_deficit(sta, txqi->txq.ac);
|
||||
-
|
||||
- if (aql_check)
|
||||
- found_eligible_txq = true;
|
||||
-
|
||||
- if (deficit < 0)
|
||||
+ if (ieee80211_sta_deficit(sta, txqi->txq.ac) < 0) {
|
||||
sta->airtime[txqi->txq.ac].deficit +=
|
||||
sta->airtime_weight << AIRTIME_QUANTUM_SHIFT;
|
||||
-
|
||||
- if (deficit < 0 || !aql_check) {
|
||||
- list_move_tail(&txqi->schedule_order,
|
||||
- &local->active_txqs[txqi->txq.ac]);
|
||||
- goto begin;
|
||||
+ aql_check = false;
|
||||
}
|
||||
}
|
||||
|
||||
+ if (!aql_check) {
|
||||
+ list_move_tail(&txqi->schedule_order,
|
||||
+ &local->active_txqs[txqi->txq.ac]);
|
||||
+ goto begin;
|
||||
+ }
|
||||
+
|
||||
if (txqi->schedule_round == local->schedule_round[ac])
|
||||
goto out;
|
||||
|
||||
@@ -4133,7 +4133,8 @@ bool ieee80211_txq_airtime_check(struct
|
||||
return true;
|
||||
|
||||
if (!txq->sta)
|
||||
- return true;
|
||||
+ return atomic_read(&local->aql_bc_pending_airtime) <
|
||||
+ local->aql_txq_limit_bc;
|
||||
|
||||
if (unlikely(txq->tid == IEEE80211_NUM_TIDS))
|
||||
return true;
|
||||
@@ -4182,15 +4183,15 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
|
||||
spin_lock_bh(&local->active_txq_lock[ac]);
|
||||
|
||||
- if (!txqi->txq.sta)
|
||||
- goto out;
|
||||
-
|
||||
if (list_empty(&txqi->schedule_order))
|
||||
goto out;
|
||||
|
||||
if (!ieee80211_txq_schedule_airtime_check(local, ac))
|
||||
goto out;
|
||||
|
||||
+ if (!txqi->txq.sta)
|
||||
+ goto out;
|
||||
+
|
||||
list_for_each_entry_safe(iter, tmp, &local->active_txqs[ac],
|
||||
schedule_order) {
|
||||
if (iter == txqi)
|
||||
@ -0,0 +1,25 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 21 Feb 2024 14:41:40 +0100
|
||||
Subject: [PATCH] wifi: mac80211: only call drv_sta_rc_update for uploaded
|
||||
stations
|
||||
|
||||
When a station has not been uploaded yet, receiving SMPS or channel width
|
||||
notification action frames can lead to rate_control_rate_update calling
|
||||
drv_sta_rc_update with uninitialized driver private data.
|
||||
Fix this by adding a missing check for sta->uploaded.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/rate.c
|
||||
+++ b/net/mac80211/rate.c
|
||||
@@ -119,7 +119,8 @@ void rate_control_rate_update(struct iee
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
- drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
|
||||
+ if (sta->uploaded)
|
||||
+ drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
|
||||
}
|
||||
|
||||
int ieee80211_rate_control_register(const struct rate_control_ops *ops)
|
||||
@ -16,7 +16,7 @@ and we should ignore this.
|
||||
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -649,21 +649,6 @@ static int wiphy_verify_combinations(str
|
||||
@@ -651,21 +651,6 @@ static int wiphy_verify_combinations(str
|
||||
c->limits[j].max > 1))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -2423,6 +2423,13 @@ static void sta_stats_decode_rate(struct
|
||||
@@ -2426,6 +2426,13 @@ static void sta_stats_decode_rate(struct
|
||||
|
||||
sband = local->hw.wiphy->bands[band];
|
||||
|
||||
|
||||
@ -0,0 +1,146 @@
|
||||
From 0116bb7359bd99c09bcad1b2051652cd1a04be3f Mon Sep 17 00:00:00 2001
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Mon, 12 Feb 2024 14:23:04 +0200
|
||||
Subject: [PATCH] qca-ssdk: support selecting PCS channel for PORT3 on IPQ6018
|
||||
|
||||
When QCA8072 is used in PSGMII mode with IPQ6018, PCS used for second
|
||||
PHY port would overlap with one used by SGMII+ port. SoC has register
|
||||
to select different PCS in such case.
|
||||
|
||||
Original code used PHY_ID for this decision, which also had other
|
||||
issues, but is no longer viable since we moved to upstream QCA807x
|
||||
driver.
|
||||
|
||||
Introduce DT property port3_pcs_channel to allow describing this in DT.
|
||||
Default value is <2>, and for some QCA8072 designs <4> would be needed.
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
include/init/ssdk_dts.h | 2 ++
|
||||
src/adpt/cppe/adpt_cppe_portctrl.c | 4 ++--
|
||||
src/adpt/hppe/adpt_hppe_uniphy.c | 7 +------
|
||||
src/init/ssdk_dts.c | 27 +++++++++++++++++++++++++++
|
||||
4 files changed, 32 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/include/init/ssdk_dts.h b/include/init/ssdk_dts.h
|
||||
index 00fa4c1..210c788 100755
|
||||
--- a/include/init/ssdk_dts.h
|
||||
+++ b/include/init/ssdk_dts.h
|
||||
@@ -101,6 +101,7 @@ typedef struct
|
||||
a_uint32_t emu_chip_ver; /*only valid when is_emulation is true*/
|
||||
a_uint32_t clk_mode;
|
||||
a_uint32_t pcie_hw_base;
|
||||
+ a_uint32_t port3_pcs_channel;
|
||||
} ssdk_dt_cfg;
|
||||
|
||||
#define SSDK_MAX_NR_ETH 6
|
||||
@@ -163,6 +164,7 @@ a_uint32_t ssdk_device_id_get(a_uint32_t index);
|
||||
struct device_node *ssdk_dts_node_get(a_uint32_t dev_id);
|
||||
struct clk *ssdk_dts_essclk_get(a_uint32_t dev_id);
|
||||
struct clk *ssdk_dts_cmnclk_get(a_uint32_t dev_id);
|
||||
+a_uint32_t ssdk_dts_port3_pcs_channel_get(a_uint32_t dev_id);
|
||||
|
||||
int ssdk_switch_device_num_init(void);
|
||||
void ssdk_switch_device_num_exit(void);
|
||||
diff --git a/src/adpt/cppe/adpt_cppe_portctrl.c b/src/adpt/cppe/adpt_cppe_portctrl.c
|
||||
index 00d0404..6b32f79 100755
|
||||
--- a/src/adpt/cppe/adpt_cppe_portctrl.c
|
||||
+++ b/src/adpt/cppe/adpt_cppe_portctrl.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "hsl_phy.h"
|
||||
#include "hsl_port_prop.h"
|
||||
#include "hppe_init.h"
|
||||
+#include "ssdk_dts.h"
|
||||
#include "adpt.h"
|
||||
#include "adpt_hppe.h"
|
||||
#include "adpt_cppe_portctrl.h"
|
||||
@@ -60,8 +61,7 @@ _adpt_cppe_port_mux_mac_set(a_uint32_t dev_id, fal_port_t port_id,
|
||||
case SSDK_PHYSICAL_PORT3:
|
||||
case SSDK_PHYSICAL_PORT4:
|
||||
if (mode0 == PORT_WRAPPER_PSGMII) {
|
||||
- if (hsl_port_phyid_get(dev_id,
|
||||
- SSDK_PHYSICAL_PORT3) == MALIBU2PORT_PHY) {
|
||||
+ if (ssdk_dts_port3_pcs_channel_get(dev_id) == 4) {
|
||||
cppe_port_mux_ctrl.bf.port3_pcs_sel =
|
||||
CPPE_PORT3_PCS_SEL_PCS0_CHANNEL4;
|
||||
cppe_port_mux_ctrl.bf.port4_pcs_sel =
|
||||
diff --git a/src/adpt/hppe/adpt_hppe_uniphy.c b/src/adpt/hppe/adpt_hppe_uniphy.c
|
||||
index 5e36602..bad1eab 100644
|
||||
--- a/src/adpt/hppe/adpt_hppe_uniphy.c
|
||||
+++ b/src/adpt/hppe/adpt_hppe_uniphy.c
|
||||
@@ -1122,9 +1122,6 @@ __adpt_hppe_uniphy_psgmii_mode_set(a_uint32_t dev_id, a_uint32_t uniphy_index)
|
||||
{
|
||||
a_uint32_t i;
|
||||
sw_error_t rv = SW_OK;
|
||||
-#if defined(CPPE)
|
||||
- a_uint32_t phy_type = 0;
|
||||
-#endif
|
||||
|
||||
union uniphy_mode_ctrl_u uniphy_mode_ctrl;
|
||||
|
||||
@@ -1134,9 +1131,7 @@ __adpt_hppe_uniphy_psgmii_mode_set(a_uint32_t dev_id, a_uint32_t uniphy_index)
|
||||
SSDK_DEBUG("uniphy %d is psgmii mode\n", uniphy_index);
|
||||
#if defined(CPPE)
|
||||
if (adpt_ppe_type_get(dev_id) == CPPE_TYPE) {
|
||||
- phy_type = hsl_port_phyid_get(dev_id,
|
||||
- SSDK_PHYSICAL_PORT3);
|
||||
- if (phy_type == MALIBU2PORT_PHY) {
|
||||
+ if (ssdk_dts_port3_pcs_channel_get(dev_id) == 4) {
|
||||
SSDK_INFO("cypress uniphy %d is qca8072 psgmii mode\n", uniphy_index);
|
||||
rv = __adpt_cppe_uniphy_mode_set(dev_id, uniphy_index,
|
||||
PORT_WRAPPER_PSGMII);
|
||||
diff --git a/src/init/ssdk_dts.c b/src/init/ssdk_dts.c
|
||||
index 686b6d2..70b0a09 100644
|
||||
--- a/src/init/ssdk_dts.c
|
||||
+++ b/src/init/ssdk_dts.c
|
||||
@@ -279,6 +279,13 @@ struct clk *ssdk_dts_cmnclk_get(a_uint32_t dev_id)
|
||||
return cfg->cmnblk_clk;
|
||||
}
|
||||
|
||||
+a_uint32_t ssdk_dts_port3_pcs_channel_get(a_uint32_t dev_id)
|
||||
+{
|
||||
+ ssdk_dt_cfg* cfg = ssdk_dt_global.ssdk_dt_switch_nodes[dev_id];
|
||||
+
|
||||
+ return cfg->port3_pcs_channel;
|
||||
+}
|
||||
+
|
||||
#ifndef BOARD_AR71XX
|
||||
#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
|
||||
static void ssdk_dt_parse_mac_mode(a_uint32_t dev_id,
|
||||
@@ -313,6 +320,25 @@ static void ssdk_dt_parse_mac_mode(a_uint32_t dev_id,
|
||||
|
||||
return;
|
||||
}
|
||||
+
|
||||
+static void ssdk_dt_parse_port3_pcs_channel(a_uint32_t dev_id,
|
||||
+ struct device_node *switch_node, ssdk_init_cfg *cfg)
|
||||
+{
|
||||
+ const __be32 *port3_pcs_channel;
|
||||
+ a_uint32_t len = 0;
|
||||
+
|
||||
+ port3_pcs_channel = of_get_property(switch_node, "port3_pcs_channel", &len);
|
||||
+ if (!port3_pcs_channel) {
|
||||
+ ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port3_pcs_channel = 2;
|
||||
+ }
|
||||
+ else {
|
||||
+ ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port3_pcs_channel =
|
||||
+ be32_to_cpup(port3_pcs_channel);
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
#ifdef IN_UNIPHY
|
||||
static void ssdk_dt_parse_uniphy(a_uint32_t dev_id)
|
||||
{
|
||||
@@ -1307,6 +1333,7 @@ sw_error_t ssdk_dt_parse(ssdk_init_cfg *cfg, a_uint32_t num, a_uint32_t *dev_id)
|
||||
rv = ssdk_dt_parse_access_mode(switch_node, ssdk_dt_priv);
|
||||
SW_RTN_ON_ERROR(rv);
|
||||
ssdk_dt_parse_mac_mode(*dev_id, switch_node, cfg);
|
||||
+ ssdk_dt_parse_port3_pcs_channel(*dev_id, switch_node, cfg);
|
||||
ssdk_dt_parse_mdio(*dev_id, switch_node, cfg);
|
||||
ssdk_dt_parse_port_bmp(*dev_id, switch_node, cfg);
|
||||
ssdk_dt_parse_interrupt(*dev_id, switch_node);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@ -432,9 +432,9 @@ mac80211_hostapd_setup_base() {
|
||||
he_bss_color:128 \
|
||||
he_bss_color_enabled:1
|
||||
|
||||
he_phy_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
|
||||
he_phy_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: .*AP/,$p' | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
|
||||
he_phy_cap=${he_phy_cap:2}
|
||||
he_mac_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1)
|
||||
he_mac_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: .*AP/,$p' | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1)
|
||||
he_mac_cap=${he_mac_cap:2}
|
||||
|
||||
append base_cfg "ieee80211ax=1" "$N"
|
||||
|
||||
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=dnsmasq
|
||||
PKG_UPSTREAM_VERSION:=2.89
|
||||
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
|
||||
PKG_RELEASE:=7
|
||||
PKG_RELEASE:=8
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
|
||||
|
||||
@ -1258,10 +1258,11 @@ nftables_clear()
|
||||
|
||||
add_interface_trigger()
|
||||
{
|
||||
local interface ignore
|
||||
local interface ifname ignore
|
||||
|
||||
config_get interface "$1" interface
|
||||
config_get_bool ignore "$1" ignore 0
|
||||
network_get_device ifname "$interface" || ignore=0
|
||||
|
||||
[ -n "$interface" ] && [ $ignore -eq 0 ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/dnsmasq reload
|
||||
}
|
||||
|
||||
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
|
||||
PKG_SOURCE_DATE:=2024-02-13
|
||||
PKG_SOURCE_VERSION:=3f9811d2f7b730f1f1d030872ae1def7e8349be6
|
||||
PKG_MIRROR_HASH:=b05cdaa6ecaf8c4b79e67551085c5580d09c5940304b5837a859324abbb26e94
|
||||
PKG_SOURCE_DATE:=2024-02-21
|
||||
PKG_SOURCE_VERSION:=ba3855ae3775197f3594fc2615cac539075bd2fb
|
||||
PKG_MIRROR_HASH:=82b8a73417575b58a234586354eba4d0b10180a80b441cd87a9a554227304d34
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
|
||||
@ -15,8 +15,8 @@ try_version() {
|
||||
}
|
||||
|
||||
try_git() {
|
||||
SOURCE_DATE_EPOCH=$(git -C "$SOURCE" log -1 --format=format:%ct \
|
||||
"$SOURCE" 2>/dev/null)
|
||||
SOURCE_DATE_EPOCH=$(git -C "$SOURCE" log -1 --no-show-signature \
|
||||
--format=format:%ct "$SOURCE" 2>/dev/null)
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,100 @@
|
||||
From 038ba1dc4e54d51d953f5618d8eb5dd39bd9de25 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 13 Feb 2024 14:35:51 +0100
|
||||
Subject: [PATCH] net: phy: aquantia: add AQR111 and AQR111B0 PHY ID
|
||||
|
||||
Add Aquantia AQR111 and AQR111B0 PHY ID. These PHY advertise 10G speed
|
||||
but actually supports up to 5G speed, hence some manual fixup is needed.
|
||||
|
||||
The Aquantia AQR111B0 PHY is just a variant of the AQR111 with smaller
|
||||
chip size.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Link: https://lore.kernel.org/r/20240213133558.1836-1-ansuelsmth@gmail.com
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 52 ++++++++++++++++++++++++
|
||||
1 file changed, 52 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -22,6 +22,8 @@
|
||||
#define PHY_ID_AQR107 0x03a1b4e0
|
||||
#define PHY_ID_AQCS109 0x03a1b5c2
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
+#define PHY_ID_AQR111 0x03a1b610
|
||||
+#define PHY_ID_AQR111B0 0x03a1b612
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
@@ -672,6 +674,16 @@ static int aqr107_probe(struct phy_devic
|
||||
return aqr_hwmon_probe(phydev);
|
||||
}
|
||||
|
||||
+static int aqr111_config_init(struct phy_device *phydev)
|
||||
+{
|
||||
+ /* AQR111 reports supporting speed up to 10G,
|
||||
+ * however only speeds up to 5G are supported.
|
||||
+ */
|
||||
+ phy_set_max_speed(phydev, SPEED_5000);
|
||||
+
|
||||
+ return aqr107_config_init(phydev);
|
||||
+}
|
||||
+
|
||||
static struct phy_driver aqr_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQ1202),
|
||||
@@ -746,6 +758,42 @@ static struct phy_driver aqr_driver[] =
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111),
|
||||
+ .name = "Aquantia AQR111",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0),
|
||||
+ .name = "Aquantia AQR111B0",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR405),
|
||||
.name = "Aquantia AQR405",
|
||||
.config_aneg = aqr_config_aneg,
|
||||
@@ -784,6 +832,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ }
|
||||
};
|
||||
@ -0,0 +1,59 @@
|
||||
From 71b605d32017e5b8d257db7344bc2f8e8fcc973e Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 15 Feb 2024 16:30:05 +0100
|
||||
Subject: [PATCH] net: phy: aquantia: add AQR113 PHY ID
|
||||
|
||||
Add Aquantia AQR113 PHY ID. Aquantia AQR113 is just a chip size variant of
|
||||
the already supported AQR133C where the only difference is the PHY ID
|
||||
and the hw chip size.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
#define PHY_ID_AQR111 0x03a1b610
|
||||
#define PHY_ID_AQR111B0 0x03a1b612
|
||||
+#define PHY_ID_AQR113 0x31c31c40
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
@@ -802,6 +803,24 @@ static struct phy_driver aqr_driver[] =
|
||||
.read_status = aqr_read_status,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
|
||||
+ .name = "Aquantia AQR113",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr107_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR113C),
|
||||
.name = "Aquantia AQR113C",
|
||||
.probe = aqr107_probe,
|
||||
@@ -834,6 +853,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ }
|
||||
};
|
||||
@ -0,0 +1,58 @@
|
||||
From 6d47302a3f0ba31445478d518d98bd55918bc8ab Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 15 Feb 2024 22:43:30 +0100
|
||||
Subject: [PATCH] net: phy: aquantia: add AQR813 PHY ID
|
||||
|
||||
Aquantia AQR813 is the Octal Port variant of the AQR113. Add PHY ID for
|
||||
it to provide support for it.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#define PHY_ID_AQR111B0 0x03a1b612
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
+#define PHY_ID_AQR813 0x31c31cb2
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -839,6 +840,24 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR813),
|
||||
+ .name = "Aquantia AQR813",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr107_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -855,6 +874,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
From 038ba1dc4e54d51d953f5618d8eb5dd39bd9de25 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 13 Feb 2024 14:35:51 +0100
|
||||
Subject: [PATCH] net: phy: aquantia: add AQR111 and AQR111B0 PHY ID
|
||||
|
||||
Add Aquantia AQR111 and AQR111B0 PHY ID. These PHY advertise 10G speed
|
||||
but actually supports up to 5G speed, hence some manual fixup is needed.
|
||||
|
||||
The Aquantia AQR111B0 PHY is just a variant of the AQR111 with smaller
|
||||
chip size.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Link: https://lore.kernel.org/r/20240213133558.1836-1-ansuelsmth@gmail.com
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 52 ++++++++++++++++++++++++
|
||||
1 file changed, 52 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -22,6 +22,8 @@
|
||||
#define PHY_ID_AQR107 0x03a1b4e0
|
||||
#define PHY_ID_AQCS109 0x03a1b5c2
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
+#define PHY_ID_AQR111 0x03a1b610
|
||||
+#define PHY_ID_AQR111B0 0x03a1b612
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
@@ -670,6 +672,16 @@ static int aqr107_probe(struct phy_devic
|
||||
return aqr_hwmon_probe(phydev);
|
||||
}
|
||||
|
||||
+static int aqr111_config_init(struct phy_device *phydev)
|
||||
+{
|
||||
+ /* AQR111 reports supporting speed up to 10G,
|
||||
+ * however only speeds up to 5G are supported.
|
||||
+ */
|
||||
+ phy_set_max_speed(phydev, SPEED_5000);
|
||||
+
|
||||
+ return aqr107_config_init(phydev);
|
||||
+}
|
||||
+
|
||||
static struct phy_driver aqr_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQ1202),
|
||||
@@ -744,6 +756,44 @@ static struct phy_driver aqr_driver[] =
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111),
|
||||
+ .name = "Aquantia AQR111",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .get_rate_matching = aqr107_get_rate_matching,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0),
|
||||
+ .name = "Aquantia AQR111B0",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .get_rate_matching = aqr107_get_rate_matching,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR405),
|
||||
.name = "Aquantia AQR405",
|
||||
.config_aneg = aqr_config_aneg,
|
||||
@@ -782,6 +832,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ }
|
||||
};
|
||||
@ -0,0 +1,60 @@
|
||||
From 71b605d32017e5b8d257db7344bc2f8e8fcc973e Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 15 Feb 2024 16:30:05 +0100
|
||||
Subject: [PATCH] net: phy: aquantia: add AQR113 PHY ID
|
||||
|
||||
Add Aquantia AQR113 PHY ID. Aquantia AQR113 is just a chip size variant of
|
||||
the already supported AQR133C where the only difference is the PHY ID
|
||||
and the hw chip size.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
#define PHY_ID_AQR111 0x03a1b610
|
||||
#define PHY_ID_AQR111B0 0x03a1b612
|
||||
+#define PHY_ID_AQR113 0x31c31c40
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
@@ -802,6 +803,25 @@ static struct phy_driver aqr_driver[] =
|
||||
.read_status = aqr_read_status,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
|
||||
+ .name = "Aquantia AQR113",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .get_rate_matching = aqr107_get_rate_matching,
|
||||
+ .config_init = aqr107_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR113C),
|
||||
.name = "Aquantia AQR113C",
|
||||
.probe = aqr107_probe,
|
||||
@@ -834,6 +854,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ }
|
||||
};
|
||||
@ -0,0 +1,59 @@
|
||||
From 6d47302a3f0ba31445478d518d98bd55918bc8ab Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 15 Feb 2024 22:43:30 +0100
|
||||
Subject: [PATCH] net: phy: aquantia: add AQR813 PHY ID
|
||||
|
||||
Aquantia AQR813 is the Octal Port variant of the AQR113. Add PHY ID for
|
||||
it to provide support for it.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#define PHY_ID_AQR111B0 0x03a1b612
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
+#define PHY_ID_AQR813 0x31c31cb2
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -840,6 +841,25 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR813),
|
||||
+ .name = "Aquantia AQR813",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .get_rate_matching = aqr107_get_rate_matching,
|
||||
+ .config_init = aqr107_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -856,6 +876,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -1,120 +0,0 @@
|
||||
From: Birger Koblitz <git@birger-koblitz.de>
|
||||
Date: Sun, 5 Sep 2021 15:13:10 +0200
|
||||
Subject: [PATCH] kernel: Add AQR113C and AQR813 support
|
||||
|
||||
This hack adds support for the Aquantia 4th generation, 10GBit
|
||||
PHYs AQR113C and AQR813.
|
||||
|
||||
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -23,6 +23,7 @@
|
||||
#define PHY_ID_AQCS109 0x03a1b5c2
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
+#define PHY_ID_AQR813 0x31c31cb2
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -360,6 +361,49 @@ static int aqr107_read_rate(struct phy_d
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int aqr113c_read_status(struct phy_device *phydev)
|
||||
+{
|
||||
+ int val, ret;
|
||||
+
|
||||
+ ret = aqr_read_status(phydev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE)
|
||||
+ return 0;
|
||||
+
|
||||
+ // On AQR113C, the speed returned by aqr_read_status is wrong
|
||||
+ aqr107_read_rate(phydev);
|
||||
+
|
||||
+ val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS);
|
||||
+ if (val < 0)
|
||||
+ return val;
|
||||
+
|
||||
+ switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) {
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_10GKR;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_10GBASER;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_USXGMII;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_SGMII;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
|
||||
+ break;
|
||||
+ default:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_NA;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* Read downshifted rate from vendor register */
|
||||
+ return aqr107_read_rate(phydev);
|
||||
+}
|
||||
+
|
||||
static int aqr107_read_status(struct phy_device *phydev)
|
||||
{
|
||||
int val, ret;
|
||||
@@ -499,7 +543,7 @@ static void aqr107_chip_info(struct phy_
|
||||
build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val);
|
||||
prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val);
|
||||
|
||||
- phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n",
|
||||
+ phydev_info(phydev, "FW %u.%u, Build %u, Provisioning %u\n",
|
||||
fw_major, fw_minor, build_id, prov_id);
|
||||
}
|
||||
|
||||
@@ -762,7 +806,7 @@ static struct phy_driver aqr_driver[] =
|
||||
.config_aneg = aqr_config_aneg,
|
||||
.config_intr = aqr_config_intr,
|
||||
.handle_interrupt = aqr_handle_interrupt,
|
||||
- .read_status = aqr107_read_status,
|
||||
+ .read_status = aqr113c_read_status,
|
||||
.get_tunable = aqr107_get_tunable,
|
||||
.set_tunable = aqr107_set_tunable,
|
||||
.suspend = aqr107_suspend,
|
||||
@@ -772,6 +816,24 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR813),
|
||||
+ .name = "Aquantia AQR813",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr107_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr113c_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -785,6 +847,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -15,8 +15,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -24,6 +24,8 @@
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
@@ -27,6 +27,8 @@
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
+#define PHY_ID_AQR112 0x03a1b662
|
||||
@ -24,7 +24,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -96,6 +98,29 @@
|
||||
@@ -99,6 +101,29 @@
|
||||
#define AQR107_OP_IN_PROG_SLEEP 1000
|
||||
#define AQR107_OP_IN_PROG_TIMEOUT 100000
|
||||
|
||||
@ -54,7 +54,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
struct aqr107_hw_stat {
|
||||
const char *name;
|
||||
int reg;
|
||||
@@ -227,6 +252,51 @@ static int aqr_config_aneg(struct phy_de
|
||||
@@ -230,6 +255,51 @@ static int aqr_config_aneg(struct phy_de
|
||||
return genphy_c45_check_and_restart_aneg(phydev, changed);
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
static int aqr_config_intr(struct phy_device *phydev)
|
||||
{
|
||||
bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED;
|
||||
@@ -834,6 +904,30 @@ static struct phy_driver aqr_driver[] =
|
||||
@@ -858,6 +928,30 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
@ -137,8 +137,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -848,6 +942,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
@@ -875,6 +969,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -285,10 +285,16 @@ static int aqr_config_aneg_set_prot(stru
|
||||
@@ -288,10 +288,16 @@ static int aqr_config_aneg_set_prot(stru
|
||||
phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE,
|
||||
aquantia_syscfg[if_type].start_rate);
|
||||
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From 2e677e4ae8f8330f68013163b060d0fda3a43095 Mon Sep 17 00:00:00 2001
|
||||
From: "Langer, Thomas" <tlanger@maxlinear.com>
|
||||
Date: Fri, 9 Jul 2021 17:36:46 +0200
|
||||
Subject: [PATCH] PONRTSYS-8842: aquantia: Add AQR113 driver support
|
||||
|
||||
Add a new entry for AQR113 PHY_ID
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
#define PHY_ID_AQR112 0x03a1b662
|
||||
#define PHY_ID_AQR412 0x03a1b712
|
||||
+#define PHY_ID_AQR113 0x31c31c40
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -923,6 +924,14 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
|
||||
+ .name = "Aquantia AQR113",
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR412),
|
||||
.name = "Aquantia AQR412",
|
||||
.probe = aqr107_probe,
|
||||
@@ -950,6 +959,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -12,17 +12,17 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -27,6 +27,8 @@
|
||||
@@ -29,6 +29,8 @@
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
#define PHY_ID_AQR112 0x03a1b662
|
||||
#define PHY_ID_AQR412 0x03a1b712
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
+#define PHY_ID_AQR112C 0x03a1b790
|
||||
+#define PHY_ID_AQR112R 0x31c31d12
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -924,6 +926,30 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
@@ -880,6 +882,30 @@ static struct phy_driver aqr_driver[] =
|
||||
.read_status = aqr_read_status,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR112C),
|
||||
@ -51,11 +51,11 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
|
||||
.name = "Aquantia AQR113",
|
||||
.config_aneg = aqr_config_aneg,
|
||||
@@ -960,6 +986,8 @@ static struct mdio_device_id __maybe_unu
|
||||
.probe = aqr107_probe,
|
||||
@@ -977,6 +1003,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) },
|
||||
{ }
|
||||
|
||||
@ -1,109 +0,0 @@
|
||||
Author: Thomas Kupper <thomas.kupper@gmail.com>
|
||||
Date: Wed May 24 21:14:17 2023 +0200
|
||||
|
||||
kernel: phy: add Aquantia PHY AQR111 & AQR111B0
|
||||
|
||||
Add the IDs for Aquantia PHY AQR111 and AQR111B0 as found in the GPL sources
|
||||
of the Netgear RAX120v2 firmware v1.2.8.40.
|
||||
|
||||
This is a 5GbE chip but it reports support for 10G. Implement config_init()
|
||||
to set max speed to 5G.
|
||||
|
||||
Signed-off-by: Thomas Kupper <thomas.kupper@gmail.com>
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -24,6 +24,8 @@
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
+#define PHY_ID_AQR111 0x03a1b610
|
||||
+#define PHY_ID_AQR111B0 0x03a1b612
|
||||
#define PHY_ID_AQR112 0x03a1b662
|
||||
#define PHY_ID_AQR412 0x03a1b712
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
@@ -676,6 +678,33 @@ static int aqcs109_config_init(struct ph
|
||||
return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
|
||||
}
|
||||
|
||||
+static int aqr111_config_init(struct phy_device *phydev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ /* Check that the PHY interface type is compatible */
|
||||
+ if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_2500BASEX &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_XGMII &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_USXGMII &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_10GKR &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_10GBASER)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII,
|
||||
+ "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n");
|
||||
+
|
||||
+ ret = aqr107_wait_reset_complete(phydev);
|
||||
+ if (!ret)
|
||||
+ aqr107_chip_info(phydev);
|
||||
+
|
||||
+ /* AQR111 reports supporting speed up to 10G, however only speeds up to 5G are supported. */
|
||||
+ ret = phy_set_max_speed(phydev, SPEED_5000);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
|
||||
+}
|
||||
static void aqr107_link_change_notify(struct phy_device *phydev)
|
||||
{
|
||||
u8 fw_major, fw_minor;
|
||||
@@ -914,6 +943,42 @@ static struct phy_driver aqr_driver[] =
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111),
|
||||
+ .name = "Aquantia AQR111",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0),
|
||||
+ .name = "Aquantia AQR111B0",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR112),
|
||||
.name = "Aquantia AQR112",
|
||||
.probe = aqr107_probe,
|
||||
@@ -983,6 +1048,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
@ -1,120 +0,0 @@
|
||||
From: Birger Koblitz <git@birger-koblitz.de>
|
||||
Date: Sun, 5 Sep 2021 15:13:10 +0200
|
||||
Subject: [PATCH] kernel: Add AQR113C and AQR813 support
|
||||
|
||||
This hack adds support for the Aquantia 4th generation, 10GBit
|
||||
PHYs AQR113C and AQR813.
|
||||
|
||||
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -23,6 +23,7 @@
|
||||
#define PHY_ID_AQCS109 0x03a1b5c2
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
+#define PHY_ID_AQR813 0x31c31cb2
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -360,6 +361,49 @@ static int aqr107_read_rate(struct phy_d
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int aqr113c_read_status(struct phy_device *phydev)
|
||||
+{
|
||||
+ int val, ret;
|
||||
+
|
||||
+ ret = aqr_read_status(phydev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE)
|
||||
+ return 0;
|
||||
+
|
||||
+ // On AQR113C, the speed returned by aqr_read_status is wrong
|
||||
+ aqr107_read_rate(phydev);
|
||||
+
|
||||
+ val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS);
|
||||
+ if (val < 0)
|
||||
+ return val;
|
||||
+
|
||||
+ switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) {
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_10GKR;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_10GBASER;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_USXGMII;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_SGMII;
|
||||
+ break;
|
||||
+ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
|
||||
+ break;
|
||||
+ default:
|
||||
+ phydev->interface = PHY_INTERFACE_MODE_NA;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* Read downshifted rate from vendor register */
|
||||
+ return aqr107_read_rate(phydev);
|
||||
+}
|
||||
+
|
||||
static int aqr107_read_status(struct phy_device *phydev)
|
||||
{
|
||||
int val, ret;
|
||||
@@ -499,7 +543,7 @@ static void aqr107_chip_info(struct phy_
|
||||
build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val);
|
||||
prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val);
|
||||
|
||||
- phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n",
|
||||
+ phydev_info(phydev, "FW %u.%u, Build %u, Provisioning %u\n",
|
||||
fw_major, fw_minor, build_id, prov_id);
|
||||
}
|
||||
|
||||
@@ -760,7 +804,7 @@ static struct phy_driver aqr_driver[] =
|
||||
.config_aneg = aqr_config_aneg,
|
||||
.config_intr = aqr_config_intr,
|
||||
.handle_interrupt = aqr_handle_interrupt,
|
||||
- .read_status = aqr107_read_status,
|
||||
+ .read_status = aqr113c_read_status,
|
||||
.get_tunable = aqr107_get_tunable,
|
||||
.set_tunable = aqr107_set_tunable,
|
||||
.suspend = aqr107_suspend,
|
||||
@@ -770,6 +814,24 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR813),
|
||||
+ .name = "Aquantia AQR813",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr107_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr113c_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -783,6 +845,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -15,8 +15,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -24,6 +24,8 @@
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
@@ -27,6 +27,8 @@
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
+#define PHY_ID_AQR112 0x03a1b662
|
||||
@ -24,7 +24,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -96,6 +98,29 @@
|
||||
@@ -99,6 +101,29 @@
|
||||
#define AQR107_OP_IN_PROG_SLEEP 1000
|
||||
#define AQR107_OP_IN_PROG_TIMEOUT 100000
|
||||
|
||||
@ -54,7 +54,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
struct aqr107_hw_stat {
|
||||
const char *name;
|
||||
int reg;
|
||||
@@ -227,6 +252,51 @@ static int aqr_config_aneg(struct phy_de
|
||||
@@ -230,6 +255,51 @@ static int aqr_config_aneg(struct phy_de
|
||||
return genphy_c45_check_and_restart_aneg(phydev, changed);
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
static int aqr_config_intr(struct phy_device *phydev)
|
||||
{
|
||||
bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED;
|
||||
@@ -832,6 +902,30 @@ static struct phy_driver aqr_driver[] =
|
||||
@@ -860,6 +930,30 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_stats = aqr107_get_stats,
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
@ -137,8 +137,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -846,6 +940,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
@@ -877,6 +971,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -285,10 +285,16 @@ static int aqr_config_aneg_set_prot(stru
|
||||
@@ -288,10 +288,16 @@ static int aqr_config_aneg_set_prot(stru
|
||||
phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE,
|
||||
aquantia_syscfg[if_type].start_rate);
|
||||
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From 2e677e4ae8f8330f68013163b060d0fda3a43095 Mon Sep 17 00:00:00 2001
|
||||
From: "Langer, Thomas" <tlanger@maxlinear.com>
|
||||
Date: Fri, 9 Jul 2021 17:36:46 +0200
|
||||
Subject: [PATCH] PONRTSYS-8842: aquantia: Add AQR113 driver support
|
||||
|
||||
Add a new entry for AQR113 PHY_ID
|
||||
---
|
||||
drivers/net/phy/aquantia/aquantia_main.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
#define PHY_ID_AQR112 0x03a1b662
|
||||
#define PHY_ID_AQR412 0x03a1b712
|
||||
+#define PHY_ID_AQR113 0x31c31c40
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -932,6 +933,14 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_strings = aqr107_get_strings,
|
||||
.get_stats = aqr107_get_stats,
|
||||
},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
|
||||
+ .name = "Aquantia AQR113",
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+},
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -948,6 +957,7 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -12,18 +12,18 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -27,6 +27,8 @@
|
||||
@@ -29,6 +29,8 @@
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
#define PHY_ID_AQR112 0x03a1b662
|
||||
#define PHY_ID_AQR412 0x03a1b712
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
+#define PHY_ID_AQR112C 0x03a1b790
|
||||
+#define PHY_ID_AQR112R 0x31c31d12
|
||||
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS 0xe812
|
||||
#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
|
||||
@@ -941,6 +943,30 @@ static struct phy_driver aqr_driver[] =
|
||||
.handle_interrupt = aqr_handle_interrupt,
|
||||
.read_status = aqr107_read_status,
|
||||
@@ -960,6 +962,30 @@ static struct phy_driver aqr_driver[] =
|
||||
.get_strings = aqr107_get_strings,
|
||||
.get_stats = aqr107_get_stats,
|
||||
},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR112C),
|
||||
@ -52,10 +52,10 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
};
|
||||
|
||||
module_phy_driver(aqr_driver);
|
||||
@@ -958,6 +984,8 @@ static struct mdio_device_id __maybe_unu
|
||||
@@ -979,6 +1005,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) },
|
||||
{ }
|
||||
|
||||
@ -1,110 +0,0 @@
|
||||
Author: Thomas Kupper <thomas.kupper@gmail.com>
|
||||
Date: Wed May 24 21:14:17 2023 +0200
|
||||
|
||||
kernel: phy: add Aquantia PHY AQR111 & AQR111B0
|
||||
|
||||
Add the IDs for Aquantia PHY AQR111 and AQR111B0 as found in the GPL sources
|
||||
of the Netgear RAX120v2 firmware v1.2.8.40.
|
||||
|
||||
This is a 5GbE chip but it reports support for 10G. Implement config_init()
|
||||
to set max speed to 5G.
|
||||
|
||||
Signed-off-by: Thomas Kupper <thomas.kupper@gmail.com>
|
||||
--- a/drivers/net/phy/aquantia/aquantia_main.c
|
||||
+++ b/drivers/net/phy/aquantia/aquantia_main.c
|
||||
@@ -24,6 +24,8 @@
|
||||
#define PHY_ID_AQR405 0x03a1b4b0
|
||||
#define PHY_ID_AQR113C 0x31c31c12
|
||||
#define PHY_ID_AQR813 0x31c31cb2
|
||||
+#define PHY_ID_AQR111 0x03a1b610
|
||||
+#define PHY_ID_AQR111B0 0x03a1b612
|
||||
#define PHY_ID_AQR112 0x03a1b662
|
||||
#define PHY_ID_AQR412 0x03a1b712
|
||||
#define PHY_ID_AQR113 0x31c31c40
|
||||
@@ -674,6 +676,34 @@ static int aqcs109_config_init(struct ph
|
||||
return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
|
||||
}
|
||||
|
||||
+static int aqr111_config_init(struct phy_device *phydev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ /* Check that the PHY interface type is compatible */
|
||||
+ if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_1000BASEKX &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_2500BASEX &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_XGMII &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_USXGMII &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_10GKR &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_10GBASER &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_XAUI &&
|
||||
+ phydev->interface != PHY_INTERFACE_MODE_RXAUI)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII,
|
||||
+ "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n");
|
||||
+
|
||||
+ ret = aqr107_wait_reset_complete(phydev);
|
||||
+ if (!ret)
|
||||
+ aqr107_chip_info(phydev);
|
||||
+
|
||||
+ /* AQR111 reports supporting speed up to 10G, however only speeds up to 5G are supported. */
|
||||
+ phy_set_max_speed(phydev, SPEED_5000);
|
||||
+
|
||||
+ return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
|
||||
+}
|
||||
static void aqr107_link_change_notify(struct phy_device *phydev)
|
||||
{
|
||||
u8 fw_major, fw_minor;
|
||||
@@ -912,6 +942,42 @@ static struct phy_driver aqr_driver[] =
|
||||
.link_change_notify = aqr107_link_change_notify,
|
||||
},
|
||||
{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111),
|
||||
+ .name = "Aquantia AQR111",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
+ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0),
|
||||
+ .name = "Aquantia AQR111B0",
|
||||
+ .probe = aqr107_probe,
|
||||
+ .config_init = aqr111_config_init,
|
||||
+ .config_aneg = aqr_config_aneg,
|
||||
+ .config_intr = aqr_config_intr,
|
||||
+ .handle_interrupt = aqr_handle_interrupt,
|
||||
+ .read_status = aqr107_read_status,
|
||||
+ .get_tunable = aqr107_get_tunable,
|
||||
+ .set_tunable = aqr107_set_tunable,
|
||||
+ .suspend = aqr107_suspend,
|
||||
+ .resume = aqr107_resume,
|
||||
+ .get_sset_count = aqr107_get_sset_count,
|
||||
+ .get_strings = aqr107_get_strings,
|
||||
+ .get_stats = aqr107_get_stats,
|
||||
+ .link_change_notify = aqr107_link_change_notify,
|
||||
+},
|
||||
+{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_AQR112),
|
||||
.name = "Aquantia AQR112",
|
||||
.probe = aqr107_probe,
|
||||
@@ -981,6 +1047,8 @@ static struct mdio_device_id __maybe_unu
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
|
||||
+ { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
|
||||
@ -14,6 +14,7 @@
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
label-mac-device = &gmac0;
|
||||
led-boot = &led_status_green;
|
||||
led-failsafe = &led_status_red;
|
||||
led-running = &led_status_green;
|
||||
@ -22,7 +23,7 @@
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
bootargs-override = "ubi.mtd=UBI_DEV";
|
||||
bootargs-override = "";
|
||||
};
|
||||
|
||||
memory {
|
||||
@ -89,6 +90,8 @@
|
||||
/* LAN */
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
@ -206,44 +209,87 @@
|
||||
pinctrl-0 = <&spi_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
spi_nand: spi_nand@0 {
|
||||
spi_nand: flash@0 {
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <20000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
|
||||
partitions: partitions {
|
||||
/*
|
||||
* ASUS bootloader tries to replace the partitions defined in
|
||||
* Device Tree and by that also deletes all additional properties
|
||||
* needed for UBI and NVMEM-on-UBI.
|
||||
* Prevent this from happening by tricking the loader to delete and
|
||||
* replace a bait node instead.
|
||||
*/
|
||||
partitions: dummy {
|
||||
compatible = "u-boot-dummy-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x0 0x0>;
|
||||
label = "remove_me";
|
||||
};
|
||||
};
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x400000>;
|
||||
label = "u-boot";
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
compatible = "linux,ubi";
|
||||
reg = <0x400000 0xfc00000>;
|
||||
label = "UBI_DEV";
|
||||
reg = <0x400000 0x7c00000>;
|
||||
|
||||
volumes {
|
||||
ubi_factory: ubi-volume-factory {
|
||||
volname = "Factory";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ubi_factory {
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1000>;
|
||||
};
|
||||
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
reg = <0x4 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "dbdc";
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||
pinctrl-1 = <&wf_dbdc_pins>;
|
||||
pinctrl-names = "default", "dbdc";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&trng {
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
label-mac-device = &gmac0;
|
||||
led-boot = &led_system;
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
@ -21,7 +22,7 @@
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
bootargs-override = "ubi.mtd=UBI_DEV";
|
||||
bootargs-override = "";
|
||||
};
|
||||
|
||||
memory {
|
||||
@ -101,6 +102,8 @@
|
||||
/* LAN */
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
@ -215,25 +218,66 @@
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
|
||||
partitions: partitions {
|
||||
/*
|
||||
* ASUS bootloader tries to replace the partitions defined in
|
||||
* Device Tree and by that also deletes all additional properties
|
||||
* needed for UBI and NVMEM-on-UBI.
|
||||
* Prevent this from happening by tricking the loader to delete and
|
||||
* replace a bait node instead.
|
||||
*/
|
||||
partitions: dummy {
|
||||
compatible = "u-boot-dummy-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x0 0x0>;
|
||||
label = "remove_me";
|
||||
};
|
||||
};
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "bootloader";
|
||||
reg = <0x0 0x400000>;
|
||||
label = "bootloader";
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
label = "UBI_DEV";
|
||||
compatible = "linux,ubi";
|
||||
reg = <0x400000 0xfc00000>;
|
||||
label = "UBI_DEV";
|
||||
|
||||
volumes {
|
||||
ubi_factory: ubi-volume-factory {
|
||||
volname = "Factory";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ubi_factory {
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1000>;
|
||||
};
|
||||
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
reg = <0x4 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&switch {
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
@ -340,10 +384,12 @@
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "dbdc";
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||
pinctrl-1 = <&wf_dbdc_pins>;
|
||||
pinctrl-names = "default", "dbdc";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&trng {
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
label-mac-device = &gmac0;
|
||||
led-boot = &led_system;
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
@ -21,7 +22,7 @@
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
bootargs-override = "ubi.mtd=UBI_DEV";
|
||||
bootargs-override = "";
|
||||
};
|
||||
|
||||
memory {
|
||||
@ -101,6 +102,8 @@
|
||||
/* LAN */
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
@ -219,33 +222,74 @@
|
||||
|
||||
spi_nand_flash: flash@0 {
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <20000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
|
||||
partitions: partitions {
|
||||
/*
|
||||
* ASUS bootloader tries to replace the partitions defined in
|
||||
* Device Tree and by that also deletes all additional properties
|
||||
* needed for UBI and NVMEM-on-UBI.
|
||||
* Prevent this from happening by tricking the loader to delete and
|
||||
* replace a bait node instead.
|
||||
*/
|
||||
partitions: dummy {
|
||||
compatible = "u-boot-dummy-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x0 0x0>;
|
||||
label = "remove_me";
|
||||
};
|
||||
};
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "bootloader";
|
||||
reg = <0x0 0x400000>;
|
||||
label = "bootloader";
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
label = "UBI_DEV";
|
||||
compatible = "linux,ubi";
|
||||
reg = <0x400000 0xfc00000>;
|
||||
label = "UBI_DEV";
|
||||
|
||||
volumes {
|
||||
ubi_factory: ubi-volume-factory {
|
||||
volname = "Factory";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ubi_factory {
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1000>;
|
||||
};
|
||||
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
reg = <0x4 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&switch {
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
@ -360,10 +404,12 @@
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
pinctrl-names = "default", "dbdc";
|
||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||
pinctrl-1 = <&wf_dbdc_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&trng {
|
||||
|
||||
@ -114,14 +114,6 @@ mediatek_setup_macs()
|
||||
local label_mac=""
|
||||
|
||||
case $board in
|
||||
asus,rt-ax59u|\
|
||||
asus,tuf-ax4200|\
|
||||
asus,tuf-ax6000)
|
||||
CI_UBIPART="UBI_DEV"
|
||||
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
|
||||
wan_mac="${addr}"
|
||||
lan_mac="${addr}"
|
||||
;;
|
||||
bananapi,bpi-r3)
|
||||
wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1)
|
||||
;;
|
||||
|
||||
@ -57,21 +57,8 @@ case "$FIRMWARE" in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"mediatek/mt7986_eeprom_mt7976_dbdc.bin")
|
||||
case "$board" in
|
||||
asus,rt-ax59u|\
|
||||
asus,tuf-ax4200)
|
||||
CI_UBIPART="UBI_DEV"
|
||||
caldata_extract_ubi "Factory" 0x0 0x1000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"mediatek/mt7986_eeprom_mt7976_dual.bin")
|
||||
case "$board" in
|
||||
asus,tuf-ax6000)
|
||||
CI_UBIPART="UBI_DEV"
|
||||
caldata_extract_ubi "Factory" 0x0 0x1000
|
||||
;;
|
||||
jdcloud,re-cp-03)
|
||||
caldata_extract_mmc "factory" 0x0 0x1000
|
||||
;;
|
||||
|
||||
@ -152,7 +152,7 @@ CONFIG_EINT_MTK=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FIT_PARTITION=y
|
||||
# CONFIG_FIT_PARTITION is not set
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
|
||||
@ -0,0 +1,360 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "ipq6018.dtsi"
|
||||
#include "ipq6018-cp-cpu.dtsi"
|
||||
#include "ipq6018-ess.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
model = "8devices Mango-DVK";
|
||||
compatible = "8devices,mango-dvk", "qcom,ipq6018";
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart3;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
wlan5g {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
function-enumerator = <0>;
|
||||
gpios = <&tlmm 66 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0radio";
|
||||
};
|
||||
|
||||
wlan2g {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
function-enumerator = <1>;
|
||||
gpios = <&tlmm 67 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy1radio";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
mdio_pins: mdio-pins {
|
||||
mdc {
|
||||
pins = "gpio64";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mdio {
|
||||
pins = "gpio65";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
spi_0_pins: spi-0-pins {
|
||||
pins = "gpio38", "gpio39", "gpio40", "gpio41";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_pins: led_pins {
|
||||
leds {
|
||||
pins = "gpio66", "gpio67";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
sd_pins: sd_pins {
|
||||
sd_cd {
|
||||
pins = "gpio62";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&blsp1_uart3 {
|
||||
pinctrl-0 = <&serial_3_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&blsp1_spi1 {
|
||||
pinctrl-0 = <&spi_0_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "jedec,spi-nor";
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "0:SBL1";
|
||||
reg = <0x00000000 0x000c0000>;
|
||||
};
|
||||
|
||||
partition@c0000 {
|
||||
label = "0:MIBIB";
|
||||
reg = <0x000c0000 0x00010000>;
|
||||
};
|
||||
|
||||
partition@d0000 {
|
||||
label = "0:QSEE";
|
||||
reg = <0x000d0000 0x001a0000>;
|
||||
};
|
||||
|
||||
partition@270000 {
|
||||
label = "0:DEVCFG";
|
||||
reg = <0x00270000 0x00010000>;
|
||||
};
|
||||
|
||||
partition@280000 {
|
||||
label = "0:RPM";
|
||||
reg = <0x00280000 0x00020000>;
|
||||
};
|
||||
|
||||
partition@2a0000 {
|
||||
label = "0:CDT";
|
||||
reg = <0x002a0000 0x00010000>;
|
||||
};
|
||||
|
||||
partition@2b0000 {
|
||||
label = "0:APPSBLENV";
|
||||
reg = <0x002b0000 0x00010000>;
|
||||
};
|
||||
|
||||
partition@2c0000 {
|
||||
label = "0:APPSBL";
|
||||
reg = <0x002c0000 0x000a0000>;
|
||||
};
|
||||
|
||||
partition@360000 {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
label = "0:ART";
|
||||
reg = <0x00360000 0x00040000>;
|
||||
|
||||
macaddr_eth0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
macaddr_eth1: macaddr@6 {
|
||||
reg = <0x6 0x6>;
|
||||
};
|
||||
|
||||
macaddr_eth2: macaddr@c {
|
||||
reg = <0xc 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@3a0000 {
|
||||
label = "config";
|
||||
reg = <0x003a0000 0x00040000>;
|
||||
};
|
||||
|
||||
partition@3e0000 {
|
||||
label = "data";
|
||||
reg = <0x003e0000 0x00100000>;
|
||||
};
|
||||
|
||||
partition@4e0000 {
|
||||
label = "firmware";
|
||||
compatible = "denx,fit";
|
||||
reg = <0x004e0000 0x1b20000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&dp3 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&qca8072_1>;
|
||||
nvmem-cells = <&macaddr_eth1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
&dp4 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&qca8072_0>;
|
||||
nvmem-cells = <&macaddr_eth0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
&dp5 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&qca8081>;
|
||||
nvmem-cells = <&macaddr_eth2>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
label = "wan";
|
||||
};
|
||||
|
||||
&edma {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
|
||||
reset-delay-us = <10000>;
|
||||
reset-post-delay-us = <50000>;
|
||||
|
||||
ethernet-phy-package@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "qcom,qca8075-package";
|
||||
reg = <0>;
|
||||
|
||||
qcom,package-mode = "psgmii";
|
||||
|
||||
qca8072_0: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
};
|
||||
|
||||
qca8072_1: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
qca8081: ethernet-phy@24 {
|
||||
compatible = "ethernet-phy-id004d.d101";
|
||||
reg = <24>;
|
||||
reset-gpios = <&tlmm 77 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&sdhc_1 {
|
||||
pinctrl-0 = <&sd_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
vqmmc-supply = <&ipq6018_l2>;
|
||||
cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&switch {
|
||||
status = "okay";
|
||||
|
||||
switch_lan_bmp = <(ESS_PORT3 | ESS_PORT4)>;
|
||||
switch_wan_bmp = <ESS_PORT5>;
|
||||
switch_mac_mode = <MAC_MODE_PSGMII>;
|
||||
switch_mac_mode1 = <MAC_MODE_SGMII_PLUS>;
|
||||
port3_pcs_channel = <4>;
|
||||
|
||||
qcom,port_phyinfo {
|
||||
port@3 {
|
||||
port_id = <3>;
|
||||
phy_address = <4>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
port@5 {
|
||||
port_id = <5>;
|
||||
phy_address = <24>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&qpic_bam {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qpic_nand {
|
||||
status = "okay";
|
||||
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
nand-bus-width = <8>;
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "nand_data";
|
||||
reg = <0x0000000 0x10000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
status = "okay";
|
||||
perst-gpio = <&tlmm 60 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
qcom,ath11k-calibration-variant = "8devices-Mango";
|
||||
};
|
||||
|
||||
&qusb_phy_1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qusb_phy_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&ssphy_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "okay";
|
||||
};
|
||||
@ -457,7 +457,7 @@
|
||||
reg = <0x0 0x3a001000 0x0 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
phy-mode = "psgmii";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -468,7 +468,7 @@
|
||||
reg = <0x0 0x3a001200 0x0 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
phy-mode = "psgmii";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -479,7 +479,7 @@
|
||||
reg = <0x0 0x3a001400 0x0 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
phy-mode = "psgmii";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -490,7 +490,7 @@
|
||||
reg = <0x0 0x3a001600 0x0 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
phy-mode = "psgmii";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
@ -0,0 +1,544 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "ipq8074.dtsi"
|
||||
#include "ipq8074-hk-cpu.dtsi"
|
||||
#include "ipq8074-ess.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
model = "Linksys MX5300";
|
||||
compatible = "linksys,mx5300", "qcom,ipq8074";
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart5;
|
||||
/*
|
||||
* Aliases as required by u-boot
|
||||
* to patch MAC addresses
|
||||
*/
|
||||
ethernet0 = &dp1;
|
||||
ethernet1 = &dp2;
|
||||
ethernet2 = &dp3;
|
||||
ethernet3 = &dp4;
|
||||
ethernet4 = &dp5;
|
||||
led-boot = &led_system_blue;
|
||||
led-running = &led_system_blue;
|
||||
led-failsafe = &led_system_red;
|
||||
led-upgrade = &led_system_green;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro";
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
reset-button {
|
||||
label = "reset";
|
||||
gpios = <&tlmm 67 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
|
||||
wps-button {
|
||||
label = "wps";
|
||||
gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
button_pins: button-state {
|
||||
pins = "gpio54", "gpio67";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mdio_pins: mdio-state {
|
||||
mdc-pins {
|
||||
pins = "gpio68";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mdio-pins {
|
||||
pins = "gpio69";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* QCA4024 is not currently supported, keep for documentation purposes
|
||||
*spi_3_pins: spi-3-state {
|
||||
* spi-pins {
|
||||
* pins = "gpio50", "gpio52", "gpio53";
|
||||
* function = "blsp3_spi";
|
||||
* drive-strength = <8>;
|
||||
* bias-disable;
|
||||
* };
|
||||
*
|
||||
* cs-pins {
|
||||
* pins = "gpio22";
|
||||
* function = "blsp3_spi2";
|
||||
* drive-strength = <8>;
|
||||
* bias-disable;
|
||||
* };
|
||||
*};
|
||||
*
|
||||
*quartz_pins: quartz-state {
|
||||
* interrupt-pins {
|
||||
* pins = "gpio48";
|
||||
* function = "gpio";
|
||||
* bias-disable;
|
||||
* input;
|
||||
* };
|
||||
*
|
||||
* reset-pins {
|
||||
* pins = "gpio21";
|
||||
* function = "gpio";
|
||||
* bias-disable;
|
||||
* output-high;
|
||||
* };
|
||||
*};
|
||||
*/
|
||||
};
|
||||
|
||||
&blsp1_uart5 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&prng {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&cryptobam {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qpic_bam {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qpic_nand {
|
||||
status = "okay";
|
||||
|
||||
/*
|
||||
* Bootloader will find the NAND DT node by the compatible and
|
||||
* then "fixup" it by adding the partitions from the SMEM table
|
||||
* using the legacy bindings thus making it impossible for us
|
||||
* to change the partition table or utilize NVMEM for calibration.
|
||||
* So add a dummy partitions node that bootloader will populate
|
||||
* and set it as disabled so the kernel ignores it instead of
|
||||
* printing warnings due to the broken way bootloader adds the
|
||||
* partitions.
|
||||
*/
|
||||
partitions {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
nand-bus-width = <8>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "0:sbl1";
|
||||
reg = <0x0 0x100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "0:mibib";
|
||||
reg = <0x100000 0x100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@200000 {
|
||||
label = "0:bootconfig";
|
||||
reg = <0x200000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@280000 {
|
||||
label = "0:bootconfig1";
|
||||
reg = <0x280000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@300000 {
|
||||
label = "0:qsee";
|
||||
reg = <0x300000 0x300000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@600000 {
|
||||
label = "0:qsee_1";
|
||||
reg = <0x600000 0x300000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@900000 {
|
||||
label = "0:devcfg";
|
||||
reg = <0x900000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@980000 {
|
||||
label = "0:devcfg_1";
|
||||
reg = <0x980000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a00000 {
|
||||
label = "0:apdp";
|
||||
reg = <0xa00000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a80000 {
|
||||
label = "0:apdp_1";
|
||||
reg = <0xa80000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@b00000 {
|
||||
label = "0:rpm";
|
||||
reg = <0xb00000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@b80000 {
|
||||
label = "0:rpm_1";
|
||||
reg = <0xb80000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@c00000 {
|
||||
label = "0:cdt";
|
||||
reg = <0xc00000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@c80000 {
|
||||
label = "0:cdt_1";
|
||||
reg = <0xc80000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@d00000 {
|
||||
label = "0:appsblenv";
|
||||
reg = <0xd00000 0x80000>;
|
||||
};
|
||||
|
||||
partition@d80000 {
|
||||
label = "0:appsbl";
|
||||
reg = <0xd80000 0x100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@e80000 {
|
||||
label = "0:appsbl_1";
|
||||
reg = <0xe80000 0x100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@f80000 {
|
||||
label = "0:art";
|
||||
reg = <0xf80000 0x80000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
caldata_qca9984: caldata@33000 {
|
||||
reg = <0x33000 0x2f20>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@1000000 {
|
||||
label = "u_env";
|
||||
reg = <0x1000000 0x40000>;
|
||||
};
|
||||
|
||||
partition@1040000 {
|
||||
label = "s_env";
|
||||
reg = <0x1040000 0x20000>;
|
||||
};
|
||||
|
||||
partition@1060000 {
|
||||
label = "devinfo";
|
||||
reg = <0x1060000 0x20000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@1080000 {
|
||||
label = "kernel";
|
||||
reg = <0x1080000 0x9600000>;
|
||||
};
|
||||
|
||||
partition@1680000 {
|
||||
label = "rootfs";
|
||||
reg = <0x1680000 0x9000000>;
|
||||
};
|
||||
|
||||
partition@a680000 {
|
||||
label = "alt_kernel";
|
||||
reg = <0xa680000 0x9600000>;
|
||||
};
|
||||
|
||||
partition@ac80000 {
|
||||
label = "alt_rootfs";
|
||||
reg = <0xac80000 0x9000000>;
|
||||
};
|
||||
partition@13c80000 {
|
||||
label = "sysdiag";
|
||||
reg = <0x13c80000 0x200000>;
|
||||
read-only;
|
||||
};
|
||||
partition@13e80000 {
|
||||
label = "0:ethphyfw";
|
||||
reg = <0x13e80000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
partition@13f00000 {
|
||||
label = "syscfg";
|
||||
reg = <0x13f00000 0xb800000>;
|
||||
read-only;
|
||||
};
|
||||
partition@1f700000 {
|
||||
label = "0:wififw";
|
||||
reg = <0x1f700000 0x900000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&blsp1_i2c2 {
|
||||
status = "okay";
|
||||
|
||||
led-controller@62 {
|
||||
compatible = "nxp,pca9633";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x62>;
|
||||
nxp,hw-blink;
|
||||
|
||||
led_system_red: led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
};
|
||||
|
||||
led_system_green: led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
};
|
||||
|
||||
led_system_blue: led@2 {
|
||||
reg = <2>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
};
|
||||
};
|
||||
|
||||
rtc@68 {
|
||||
compatible = "dallas,ds1307";
|
||||
reg = <0x68>;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* QCA4024 is not currently supported, keep for documentation purposes
|
||||
*&blsp1_spi4 {
|
||||
* status = "okay";
|
||||
*
|
||||
* pinctrl-0 = <&spi_3_pins &quartz_pins>;
|
||||
* pinctrl-names = "default";
|
||||
*
|
||||
* iot@3 {
|
||||
* compatible = "qca,qca4024";
|
||||
* reg = <0>;
|
||||
* spi-max-frequency = <24000000>;
|
||||
* };
|
||||
*};
|
||||
*/
|
||||
|
||||
&mdio {
|
||||
status = "okay";
|
||||
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
|
||||
|
||||
ethernet-phy-package@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "qcom,qca8075-package";
|
||||
reg = <0>;
|
||||
|
||||
qca8075_0: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
qca8075_1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
qca8075_2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
qca8075_3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
};
|
||||
|
||||
qca8075_4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&switch {
|
||||
status = "okay";
|
||||
|
||||
switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
|
||||
switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
|
||||
switch_mac_mode = <MAC_MODE_PSGMII>; /* mac mode for uniphy instance0*/
|
||||
|
||||
qcom,port_phyinfo {
|
||||
port@1 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
port@5 {
|
||||
port_id = <5>;
|
||||
phy_address = <4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&edma {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dp1 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_0>;
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
&dp2 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_1>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
&dp3 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_2>;
|
||||
label = "lan3";
|
||||
};
|
||||
|
||||
&dp4 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_3>;
|
||||
label = "lan4";
|
||||
};
|
||||
|
||||
&dp5 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_4>;
|
||||
label = "wan";
|
||||
};
|
||||
|
||||
&ssphy_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qusb_phy_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_qmp1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie1 {
|
||||
status = "okay";
|
||||
|
||||
perst-gpio = <&tlmm 58 GPIO_ACTIVE_LOW>;
|
||||
|
||||
bridge@0,0 {
|
||||
reg = <0x00000000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
wifi0: wifi@1,0 {
|
||||
status = "okay";
|
||||
|
||||
compatible = "qcom,ath10k";
|
||||
reg = <0x00010000 0 0 0 0>;
|
||||
|
||||
qcom,ath10k-calibration-variant = "Linksys-MX5300";
|
||||
nvmem-cell-names = "pre-calibration";
|
||||
nvmem-cells = <&caldata_qca9984>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
|
||||
qcom,ath11k-calibration-variant = "Linksys-MX5300";
|
||||
};
|
||||
@ -25,16 +25,15 @@ define Device/FitImageLzma
|
||||
endef
|
||||
|
||||
define Device/EmmcImage
|
||||
IMAGES := factory.bin sysupgrade.bin
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
|
||||
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
|
||||
endef
|
||||
|
||||
define Device/UbiFit
|
||||
KERNEL_IN_UBI := 1
|
||||
IMAGES := factory.ubi sysupgrade.bin
|
||||
IMAGES += factory.ubi
|
||||
IMAGE/factory.ubi := append-ubi
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
|
||||
include $(SUBTARGET).mk
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
define Device/8devices_mango-dvk
|
||||
$(call Device/FitImageLzma)
|
||||
DEVICE_VENDOR := 8devices
|
||||
DEVICE_MODEL := Mango-DVK
|
||||
IMAGE_SIZE := 27776k
|
||||
BLOCKSIZE := 64k
|
||||
SOC := ipq6010
|
||||
SUPPORTED_DEVICES += 8devices,mango
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | check-size | append-metadata
|
||||
DEVICE_PACKAGES := ipq-wifi-8devices_mango
|
||||
endef
|
||||
TARGET_DEVICES += 8devices_mango-dvk
|
||||
@ -30,8 +30,6 @@ define Device/buffalo_wxr-5950ax12
|
||||
PAGESIZE := 2048
|
||||
DEVICE_DTS_CONFIG := config@hk01
|
||||
SOC := ipq8074
|
||||
IMAGES := sysupgrade.bin
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
DEVICE_PACKAGES := ipq-wifi-buffalo_wxr-5950ax12
|
||||
endef
|
||||
TARGET_DEVICES += buffalo_wxr-5950ax12
|
||||
@ -45,7 +43,7 @@ define Device/cmcc_rm2-6
|
||||
PAGESIZE := 2048
|
||||
DEVICE_DTS_CONFIG := config@ac02
|
||||
SOC := ipq8070
|
||||
IMAGES := factory.bin sysupgrade.bin
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand
|
||||
DEVICE_PACKAGES := ipq-wifi-cmcc_rm2-6 kmod-hwmon-gpiofan
|
||||
endef
|
||||
@ -107,7 +105,6 @@ TARGET_DEVICES += edimax_cax1800
|
||||
|
||||
define Device/linksys_mx4200v1
|
||||
$(call Device/FitImage)
|
||||
$(call Device/UbiFit)
|
||||
DEVICE_VENDOR := Linksys
|
||||
DEVICE_MODEL := MX4200
|
||||
DEVICE_VARIANT := v1
|
||||
@ -116,7 +113,6 @@ define Device/linksys_mx4200v1
|
||||
KERNEL_SIZE := 6144k
|
||||
IMAGE_SIZE := 147456k
|
||||
NAND_SIZE := 512m
|
||||
KERNEL_IN_UBI :=
|
||||
SOC := ipq8174
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MX4200
|
||||
@ -130,6 +126,23 @@ define Device/linksys_mx4200v2
|
||||
endef
|
||||
TARGET_DEVICES += linksys_mx4200v2
|
||||
|
||||
define Device/linksys_mx5300
|
||||
$(call Device/FitImage)
|
||||
DEVICE_VENDOR := Linksys
|
||||
DEVICE_MODEL := MX5300
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
KERNEL_SIZE := 6144k
|
||||
IMAGE_SIZE := 147456k
|
||||
NAND_SIZE := 512m
|
||||
SOC := ipq8072
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MX5300
|
||||
DEVICE_PACKAGES := kmod-leds-pca963x kmod-rtc-ds1307 \
|
||||
ipq-wifi-linksys_mx5300 kmod-ath10k-ct ath10k-firmware-qca9984-ct
|
||||
endef
|
||||
TARGET_DEVICES += linksys_mx5300
|
||||
|
||||
define Device/netgear_rax120v2
|
||||
$(call Device/FitImage)
|
||||
$(call Device/UbiFit)
|
||||
@ -144,7 +157,7 @@ define Device/netgear_rax120v2
|
||||
NETGEAR_HW_ID := 29765589+0+512+1024+4x4+8x8
|
||||
DEVICE_PACKAGES := ipq-wifi-netgear_rax120v2 kmod-spi-gpio \
|
||||
kmod-spi-bitbang kmod-gpio-nxp-74hc164 kmod-hwmon-g761
|
||||
IMAGES := web-ui-factory.img sysupgrade.bin
|
||||
IMAGES += web-ui-factory.img
|
||||
IMAGE/web-ui-factory.img := append-image initramfs-uImage.itb | \
|
||||
pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | \
|
||||
netgear-dni
|
||||
@ -196,7 +209,7 @@ define Device/netgear_wax630
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
SOC := ipq8074
|
||||
IMAGES := ui-factory.tar factory.ubi sysupgrade.bin
|
||||
IMAGES += ui-factory.tar
|
||||
IMAGE/ui-factory.tar := append-ubi | wax6xx-netgear-tar
|
||||
DEVICE_PACKAGES := kmod-spi-gpio ipq-wifi-netgear_wax630
|
||||
endef
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
#
|
||||
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
ipq60xx_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
8devices,mango-dvk)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported hardware. Network interfaces not initialized"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
board_config_update
|
||||
board=$(board_name)
|
||||
ipq60xx_setup_interfaces $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
||||
|
||||
. /lib/functions/caldata.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$FIRMWARE" in
|
||||
"ath11k/IPQ6018/hw1.0/cal-ahb-c000000.wifi.bin")
|
||||
case "$board" in
|
||||
8devices,mango-dvk)
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@ -0,0 +1,17 @@
|
||||
PART_NAME=firmware
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
RAMFS_COPY_BIN='fw_printenv fw_setenv head'
|
||||
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
|
||||
|
||||
platform_check_image() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
case "$(board_name)" in
|
||||
*)
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -14,6 +14,7 @@ ipq807x_setup_interfaces()
|
||||
arcadyan,aw1000|\
|
||||
buffalo,wxr-5950ax12|\
|
||||
dynalink,dl-wrx36|\
|
||||
linksys,mx5300|\
|
||||
xiaomi,ax9000)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
||||
;;
|
||||
@ -23,6 +24,7 @@ ipq807x_setup_interfaces()
|
||||
compex,wpq873|\
|
||||
linksys,mx4200v1|\
|
||||
linksys,mx4200v2|\
|
||||
prpl,haze|\
|
||||
redmi,ax6|\
|
||||
redmi,ax6-stock|\
|
||||
xiaomi,ax3600|\
|
||||
@ -48,9 +50,6 @@ ipq807x_setup_interfaces()
|
||||
netgear,wax630)
|
||||
ucidef_set_interface_lan "lan1 lan2" "dhcp"
|
||||
;;
|
||||
prpl,haze)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
|
||||
;;
|
||||
qnap,301w)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g-2" "10g-1"
|
||||
;;
|
||||
|
||||
@ -18,6 +18,7 @@ case "$FIRMWARE" in
|
||||
edimax,cax1800|\
|
||||
linksys,mx4200v1|\
|
||||
linksys,mx4200v2|\
|
||||
linksys,mx5300|\
|
||||
netgear,rax120v2|\
|
||||
netgear,wax218|\
|
||||
netgear,wax620|\
|
||||
|
||||
@ -11,7 +11,8 @@ boot() {
|
||||
fw_setenv changed
|
||||
;;
|
||||
linksys,mx4200v1|\
|
||||
linksys,mx4200v2)
|
||||
linksys,mx4200v2|\
|
||||
linksys,mx5300)
|
||||
mtd resetbc s_env || true
|
||||
;;
|
||||
redmi,ax6-stock|\
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user