Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eca6fc6ea0 | ||
|
|
2853b6d652 | ||
|
|
f579b8538b | ||
|
|
4b5bd15091 | ||
|
|
977f6f36a0 | ||
|
|
562894b39d | ||
|
|
ce59843662 | ||
|
|
3d2be75b0c | ||
|
|
0c8425bf11 | ||
|
|
2c49ad36fb | ||
|
|
f04515e7bd | ||
|
|
a91f391b59 | ||
|
|
25747a4c04 | ||
|
|
23d23038dd | ||
|
|
1ff2993edb | ||
|
|
d30ddfbac4 | ||
|
|
ed905fce58 | ||
|
|
e5ab159fbf | ||
|
|
938ae92675 | ||
|
|
8f72f5e4c0 | ||
|
|
4ad6925a9e | ||
|
|
65bd632069 | ||
|
|
b0622d1221 | ||
|
|
d1a6c35591 | ||
|
|
24cf766dfe | ||
|
|
18a88668b8 | ||
|
|
29927e347a | ||
|
|
cd117f0596 | ||
|
|
9dc46d6549 | ||
|
|
0cb3a616e4 | ||
|
|
463fe05d9e | ||
|
|
25d8b9cad6 | ||
|
|
74eeee1698 | ||
|
|
dafac183f3 | ||
|
|
7707b47c72 | ||
|
|
f3ffb04a43 | ||
|
|
2a6346725a | ||
|
|
700f5d2990 | ||
|
|
acc78a9cf6 | ||
|
|
b472753d79 | ||
|
|
c0b7b2049e | ||
|
|
7c459ac1d5 | ||
|
|
d004110ef7 | ||
|
|
0755c18ff1 | ||
|
|
7a26f40217 | ||
|
|
f54d4ea0bb | ||
|
|
a28ccd58ed | ||
|
|
2419546cee | ||
|
|
420a86436f | ||
|
|
40610c5322 | ||
|
|
26cd0c1ee9 | ||
|
|
b5665a0045 | ||
|
|
cd0283788f | ||
|
|
a2d251573b | ||
|
|
7366ee86ef | ||
|
|
ba6c780acb | ||
|
|
745d3cd4aa | ||
|
|
a3f9b42789 | ||
|
|
29c5d5d3da | ||
|
|
d10352917b | ||
|
|
0c9833d0e0 | ||
|
|
be4abbd84a | ||
|
|
4e05e7dddf | ||
|
|
1b0db300cb | ||
|
|
bf65d2dcba | ||
|
|
e7ef88ff1d | ||
|
|
81388f74b5 | ||
|
|
b8cbca8ac8 | ||
|
|
340b138932 | ||
|
|
b5e39355e4 | ||
|
|
b531611f57 | ||
|
|
542447b93e | ||
|
|
4c795af58b | ||
|
|
a352e30b8f | ||
|
|
b3fa0241e2 | ||
|
|
94372ab6e4 | ||
|
|
cae4d089bc | ||
|
|
308f0831f7 | ||
|
|
b317d3dbfb | ||
|
|
fff797d26e | ||
|
|
18f77ef2d6 | ||
|
|
8ff1d27e48 | ||
|
|
25a041f50b | ||
|
|
daf1fdc6ad | ||
|
|
47ba7cdfc3 | ||
|
|
da7b26dfb8 | ||
|
|
ab61232b0a | ||
|
|
39c115028a | ||
|
|
03c251ac14 | ||
|
|
4efa0b70d5 | ||
|
|
8835da4d90 | ||
|
|
510f0628c7 |
2
Makefile
2
Makefile
@@ -14,7 +14,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
|
||||
|
||||
world:
|
||||
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep -E '\/usr' | head -n 1)
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' | head -n 1)
|
||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||
|
||||
ifneq ($(OPENWRT_BUILD),1)
|
||||
|
||||
@@ -58,6 +58,10 @@ menu "Global build settings"
|
||||
bool "Enable signature checking in opkg"
|
||||
default SIGNED_PACKAGES
|
||||
|
||||
config DOWNLOAD_CHECK_CERTIFICATE
|
||||
bool "Enable TLS certificate verification during package download"
|
||||
default y
|
||||
|
||||
comment "General build options"
|
||||
|
||||
config TESTING_KERNEL
|
||||
@@ -160,7 +164,6 @@ menu "Global build settings"
|
||||
|
||||
choice
|
||||
prompt "Binary stripping method"
|
||||
default USE_STRIP if EXTERNAL_TOOLCHAIN
|
||||
default USE_STRIP if USE_GLIBC
|
||||
default USE_SSTRIP
|
||||
help
|
||||
|
||||
@@ -422,6 +422,11 @@ config KERNEL_KPROBE_EVENTS
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_BPF_KPROBE_OVERRIDE
|
||||
bool
|
||||
depends on KERNEL_KPROBES
|
||||
default n
|
||||
|
||||
config KERNEL_AIO
|
||||
bool "Compile the kernel with asynchronous IO support"
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
src-git-full packages https://git.openwrt.org/feed/packages.git^426ccd2e0cf56394017d32b864cd66a570852706
|
||||
src-git-full luci https://git.openwrt.org/project/luci.git^487e58a0a61f8d2396893bd9fa6695269b1fd1d3
|
||||
src-git-full routing https://git.openwrt.org/feed/routing.git^8872359011eee64981804f7ed42d5d6b54add6d8
|
||||
src-git-full packages https://git.openwrt.org/feed/packages.git^088222c39da9c20f5c93769d009443d7bbf294c7
|
||||
src-git-full luci https://git.openwrt.org/project/luci.git^709d48b72657084a27db1fb6fc0a4a4e8939552f
|
||||
src-git-full routing https://git.openwrt.org/feed/routing.git^85028704f688a6768d3f10d5d3c10a799a121e0d
|
||||
src-git-full telephony https://git.openwrt.org/feed/telephony.git^1d2031a5c82816483c51bca15649e2957fbe2bc2
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .138
|
||||
LINUX_KERNEL_HASH-5.10.138 = 29a003bb8e0e3a45942f703370fb0b3460e6fdcbbad37424423c9cf831ab5ba8
|
||||
LINUX_VERSION-5.10 = .146
|
||||
LINUX_KERNEL_HASH-5.10.146 = 7bbd97f3278eadb73c19a1ca8c1a655c60afcee9f487b910063cdd15e9ee6dc1
|
||||
|
||||
@@ -202,7 +202,10 @@ $(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
|
||||
mkdir -p $(dir $@)
|
||||
$(CC) -O2 -I$(TOPDIR)/tools/include -o $@ $<
|
||||
|
||||
prereq: $(STAGING_DIR_HOST)/bin/mkhash
|
||||
$(STAGING_DIR_HOST)/bin/xxd: $(SCRIPT_DIR)/xxdi.pl
|
||||
$(LN) $< $@
|
||||
|
||||
prereq: $(STAGING_DIR_HOST)/bin/mkhash $(STAGING_DIR_HOST)/bin/xxd
|
||||
|
||||
# Install ldconfig stub
|
||||
$(eval $(call TestHostCommand,ldconfig-stub,Failed to install stub, \
|
||||
|
||||
@@ -68,7 +68,7 @@ endif
|
||||
|
||||
target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
|
||||
ifeq ($(DUMP),)
|
||||
PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
|
||||
PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD)))
|
||||
SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
|
||||
else
|
||||
PLATFORM_DIR:=${CURDIR}
|
||||
|
||||
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),22.03.0)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),22.03.1)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r19685-512e76967f)
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r19777-2853b6d652)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/22.03.0)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/22.03.1)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
|
||||
@@ -183,7 +183,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "https://downloads.openwrt.org/releases/22.03.0"
|
||||
default "https://downloads.openwrt.org/releases/22.03.1"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
|
||||
@@ -89,6 +89,6 @@ xiaomi,mi-router-cr6609)
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
config_foreach ubootenv_add_app_config
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 82a6da13c3a113eefdb378ff53635f32a6184d6f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
|
||||
Date: Thu, 8 Sep 2022 16:59:36 +0200
|
||||
Subject: [PATCH] tools: termios_linux.h: Fix compilation on non-glibc systems
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
TCGETS2 is defined in header file asm/ioctls.h provided by linux kernel.
|
||||
On glib systems it is automatically included by some other glibc include
|
||||
header file and therefore TCGETS2 is present in termios_linux.h when
|
||||
linux kernel provides it.
|
||||
|
||||
On non-glibc systems (e.g. musl) asm/ioctls.h is not automatically included
|
||||
which results in the strange error that BOTHER is supported, TCGETS2 not
|
||||
defined and struct termios does not provide c_ispeed member.
|
||||
|
||||
tools/kwboot.c: In function 'kwboot_tty_change_baudrate':
|
||||
tools/kwboot.c:662:6: error: 'struct termios' has no member named 'c_ospeed'
|
||||
662 | tio.c_ospeed = tio.c_ispeed = baudrate;
|
||||
| ^
|
||||
|
||||
Fix this issue by explicitly including asm/ioctls.h file which provides
|
||||
TCGETS2 macro (if supported on selected architecture) to not depending on
|
||||
glibc auto-include behavior and because termios_linux.h requires it.
|
||||
|
||||
With this change it is possible compile kwboot with musl libc.
|
||||
|
||||
Reported-by: Michal Vasilek <michal.vasilek@nic.cz>
|
||||
Signed-off-by: Pali Rohár <pali@kernel.org>
|
||||
---
|
||||
tools/termios_linux.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/tools/termios_linux.h
|
||||
+++ b/tools/termios_linux.h
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
+#include <asm/ioctls.h>
|
||||
#include <asm/termbits.h>
|
||||
|
||||
#if defined(BOTHER) && defined(TCGETS2)
|
||||
@@ -0,0 +1,28 @@
|
||||
From aed6107ae96870cd190b23d6da34a7e616799ed3 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Vasilek <michal.vasilek@nic.cz>
|
||||
Date: Fri, 22 Jul 2022 19:55:53 +0200
|
||||
Subject: [PATCH 1/2] tools: mkimage: fix build with LibreSSL
|
||||
|
||||
RSA_get0_* functions are not available in LibreSSL
|
||||
|
||||
Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
tools/sunxi_toc0.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/tools/sunxi_toc0.c
|
||||
+++ b/tools/sunxi_toc0.c
|
||||
@@ -34,6 +34,12 @@
|
||||
#define pr_warn(fmt, args...) fprintf(stderr, pr_fmt(fmt), "warning", ##args)
|
||||
#define pr_info(fmt, args...) fprintf(stderr, pr_fmt(fmt), "info", ##args)
|
||||
|
||||
+#if defined(LIBRESSL_VERSION_NUMBER)
|
||||
+#define RSA_get0_n(key) (key)->n
|
||||
+#define RSA_get0_e(key) (key)->e
|
||||
+#define RSA_get0_d(key) (key)->d
|
||||
+#endif
|
||||
+
|
||||
struct __packed toc0_key_item {
|
||||
__le32 vendor_id;
|
||||
__le32 key0_n_len;
|
||||
@@ -0,0 +1,27 @@
|
||||
From 16b94d211b18ae0204c4f850fdf23573b19170ec Mon Sep 17 00:00:00 2001
|
||||
From: Mark Kettenis <kettenis@openbsd.org>
|
||||
Date: Mon, 29 Aug 2022 13:34:01 +0200
|
||||
Subject: [PATCH 2/2] tools: mkimage: fix build with recent LibreSSL
|
||||
|
||||
LibreSSL 3.5.0 and later (also shipped as part of OpenBSD 7.1 and
|
||||
and later) have an opaque RSA object and do provide the
|
||||
RSA_get0_* functions that OpenSSL provides.
|
||||
|
||||
Fixes: 2ecc354b8e46 ("tools: mkimage: fix build with LibreSSL")
|
||||
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
|
||||
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
|
||||
---
|
||||
tools/sunxi_toc0.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/tools/sunxi_toc0.c
|
||||
+++ b/tools/sunxi_toc0.c
|
||||
@@ -34,7 +34,7 @@
|
||||
#define pr_warn(fmt, args...) fprintf(stderr, pr_fmt(fmt), "warning", ##args)
|
||||
#define pr_info(fmt, args...) fprintf(stderr, pr_fmt(fmt), "info", ##args)
|
||||
|
||||
-#if defined(LIBRESSL_VERSION_NUMBER)
|
||||
+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3050000fL
|
||||
#define RSA_get0_n(key) (key)->n
|
||||
#define RSA_get0_e(key) (key)->e
|
||||
#define RSA_get0_d(key) (key)->d
|
||||
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=intel-microcode
|
||||
PKG_VERSION:=20220510
|
||||
PKG_VERSION:=20220809
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz
|
||||
PKG_SOURCE_URL:=@DEBIAN/pool/non-free/i/intel-microcode/
|
||||
PKG_HASH:=49752447c1b905dd130699cdef09fb2bba47b6f413d27787c98a5569273e283e
|
||||
PKG_HASH:=4cf6c3638bb52d9d45c1916af866fd0929628a6f459daac3edfd369149e9c665
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1
|
||||
|
||||
PKG_BUILD_DEPENDS:=iucode-tool/host
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wireless-regdb
|
||||
PKG_VERSION:=2022.06.06
|
||||
PKG_VERSION:=2022.08.12
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
|
||||
PKG_HASH:=ac00f97efecce5046ed069d1d93f3365fdf994c7c7854a8fc50831e959537230
|
||||
PKG_HASH:=59c8f7d17966db71b27f90e735ee8f5b42ca3527694a8c5e6e9b56bd379c3b84
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
||||
@@ -12,7 +12,9 @@ PKG_NAME:=kernel
|
||||
PKG_FLAGS:=hold
|
||||
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
|
||||
SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/include/netfilter.mk
|
||||
SUBTARGETS = $(sort $(filter-out feeds,$(notdir $(wildcard $(TOPDIR)/target/linux/* $(TOPDIR)/target/linux/feeds/*))))
|
||||
SUBTARGET_MODULES = $(foreach t,$(SUBTARGETS),$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(t)/modules.mk $(TOPDIR)/target/linux/$(t)/modules.mk)))
|
||||
SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter.mk
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
@@ -63,4 +65,4 @@ endef
|
||||
$(eval $(if $(DUMP),,$(call BuildPackage,kernel)))
|
||||
|
||||
include $(sort $(wildcard ./modules/*.mk))
|
||||
-include $(TOPDIR)/target/linux/*/modules.mk
|
||||
-include $(SUBTARGET_MODULES)
|
||||
|
||||
@@ -237,6 +237,18 @@ endef
|
||||
$(eval $(call KernelPackage,crypto-echainiv))
|
||||
|
||||
|
||||
define KernelPackage/crypto-essiv
|
||||
TITLE:=ESSIV support for block encryption
|
||||
DEPENDS:=+kmod-crypto-authenc
|
||||
KCONFIG:=CONFIG_CRYPTO_ESSIV
|
||||
FILES:= $(LINUX_DIR)/crypto/essiv.ko
|
||||
AUTOLOAD:=$(call AutoLoad,10,essiv)
|
||||
$(call AddDepends/crypto)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,crypto-essiv))
|
||||
|
||||
|
||||
define KernelPackage/crypto-fcrypt
|
||||
TITLE:=FCRYPT cipher CryptoAPI module
|
||||
KCONFIG:=CONFIG_CRYPTO_FCRYPT
|
||||
@@ -619,7 +631,8 @@ define KernelPackage/crypto-md5
|
||||
DEPENDS:=+kmod-crypto-hash
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_MD5 \
|
||||
CONFIG_CRYPTO_MD5_OCTEON
|
||||
CONFIG_CRYPTO_MD5_OCTEON \
|
||||
CONFIG_CRYPTO_MD5_PPC
|
||||
FILES:=$(LINUX_DIR)/crypto/md5.ko
|
||||
AUTOLOAD:=$(call AutoLoad,09,md5)
|
||||
$(call AddDepends/crypto)
|
||||
@@ -630,6 +643,11 @@ define KernelPackage/crypto-md5/octeon
|
||||
AUTOLOAD+=$(call AutoLoad,09,octeon-md5)
|
||||
endef
|
||||
|
||||
define KernelPackage/crypto-md5/mpc85xx
|
||||
FILES+=$(LINUX_DIR)/arch/powerpc/crypto/md5-ppc.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,md5-ppc)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,crypto-md5))
|
||||
|
||||
|
||||
@@ -829,6 +847,7 @@ define KernelPackage/crypto-sha1
|
||||
CONFIG_CRYPTO_SHA1_ARM \
|
||||
CONFIG_CRYPTO_SHA1_ARM_NEON \
|
||||
CONFIG_CRYPTO_SHA1_OCTEON \
|
||||
CONFIG_CRYPTO_SHA1_PPC_SPE \
|
||||
CONFIG_CRYPTO_SHA1_SSSE3
|
||||
FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko
|
||||
AUTOLOAD:=$(call AutoLoad,09,sha1_generic)
|
||||
@@ -857,6 +876,11 @@ endef
|
||||
|
||||
KernelPackage/crypto-sha1/tegra=$(KernelPakcage/crypto-sha1/arm)
|
||||
|
||||
define KernelPackage/crypto-sha1/mpc85xx
|
||||
FILES+=$(LINUX_DIR)/arch/powerpc/crypto/sha1-ppc-spe.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha1-ppc-spe)
|
||||
endef
|
||||
|
||||
define KernelPackage/crypto-sha1/x86/64
|
||||
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3)
|
||||
@@ -871,6 +895,7 @@ define KernelPackage/crypto-sha256
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_SHA256 \
|
||||
CONFIG_CRYPTO_SHA256_OCTEON \
|
||||
CONFIG_CRYPTO_SHA256_PPC_SPE \
|
||||
CONFIG_CRYPTO_SHA256_SSSE3
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/crypto/sha256_generic.ko \
|
||||
@@ -884,6 +909,11 @@ define KernelPackage/crypto-sha256/octeon
|
||||
AUTOLOAD+=$(call AutoLoad,09,octeon-sha256)
|
||||
endef
|
||||
|
||||
define KernelPackage/crypto-sha256/mpc85xx
|
||||
FILES+=$(LINUX_DIR)/arch/powerpc/crypto/sha256-ppc-spe.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha256-ppc-spe)
|
||||
endef
|
||||
|
||||
define KernelPackage/crypto-sha256/x86/64
|
||||
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha256-ssse3)
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From patchwork Sat Sep 17 20:26:27 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979242
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:26:27 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 01/16] rt2x00: define RF5592 in init_eeprom routine
|
||||
Message-ID:
|
||||
<d7eccb2c7b8ec4cd360fa2007796abffc35abb0d.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Fix incorrect RF value encoded in EEPROM on devices with Ralink Rt5592
|
||||
PCIe radio (a single chip 2T2R 802.11abgn solution).
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -9435,6 +9435,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
rf = RF3853;
|
||||
else if (rt2x00_rt(rt2x00dev, RT5350))
|
||||
rf = RF5350;
|
||||
+ else if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
+ rf = RF5592;
|
||||
else
|
||||
rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
From patchwork Sat Sep 17 20:26:40 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979243
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:26:40 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 02/16] rt2x00: add throughput LED trigger
|
||||
Message-ID:
|
||||
<73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
|
||||
This adds a (currently missing) throughput LED trigger for the rt2x00
|
||||
driver. Previously, LED triggers had to be assigned to the netdev, which
|
||||
was limited to a single VAP.
|
||||
|
||||
Tested-by: Christoph Krapp <achterin@googlemail.com>
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1093,6 +1093,19 @@ static void rt2x00lib_remove_hw(struct r
|
||||
kfree(rt2x00dev->spec.channels_info);
|
||||
}
|
||||
|
||||
+static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
|
||||
+ { .throughput = 0 * 1024, .blink_time = 334 },
|
||||
+ { .throughput = 1 * 1024, .blink_time = 260 },
|
||||
+ { .throughput = 2 * 1024, .blink_time = 220 },
|
||||
+ { .throughput = 5 * 1024, .blink_time = 190 },
|
||||
+ { .throughput = 10 * 1024, .blink_time = 170 },
|
||||
+ { .throughput = 25 * 1024, .blink_time = 150 },
|
||||
+ { .throughput = 54 * 1024, .blink_time = 130 },
|
||||
+ { .throughput = 120 * 1024, .blink_time = 110 },
|
||||
+ { .throughput = 265 * 1024, .blink_time = 80 },
|
||||
+ { .throughput = 586 * 1024, .blink_time = 50 },
|
||||
+};
|
||||
+
|
||||
static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct hw_mode_spec *spec = &rt2x00dev->spec;
|
||||
@@ -1174,6 +1187,11 @@ static int rt2x00lib_probe_hw(struct rt2
|
||||
|
||||
#undef RT2X00_TASKLET_INIT
|
||||
|
||||
+ ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
|
||||
+ IEEE80211_TPT_LEDTRIG_FL_RADIO,
|
||||
+ rt2x00_tpt_blink,
|
||||
+ ARRAY_SIZE(rt2x00_tpt_blink));
|
||||
+
|
||||
/*
|
||||
* Register HW.
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
From patchwork Thu Dec 27 14:05:26 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Tom Psyborg <pozega.tomislav@gmail.com>
|
||||
X-Patchwork-Id: 10743707
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
From: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
To: linux-wireless@vger.kernel.org
|
||||
Cc: kvalo@codeaurora.org, hauke@hauke-m.de, nbd@nbd.name,
|
||||
john@phrozen.org, sgruszka@redhat.com, daniel@makrotopia.org
|
||||
Subject: [PATCH 2/2] rt2x00: define RF5592 in init_eeprom routine
|
||||
Date: Thu, 27 Dec 2018 15:05:26 +0100
|
||||
Message-Id: <1545919526-4074-2-git-send-email-pozega.tomislav@gmail.com>
|
||||
X-Mailer: git-send-email 1.7.0.4
|
||||
In-Reply-To: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com>
|
||||
References: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com>
|
||||
MIME-Version: 1.0
|
||||
Sender: linux-wireless-owner@vger.kernel.org
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
This patch fixes following crash on Linksys EA2750 during 5GHz wifi
|
||||
init:
|
||||
|
||||
[ 7.955153] rt2800pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
|
||||
[ 7.962259] rt2800pci 0000:01:00.0: loaded eeprom from mtd device "Factory"
|
||||
[ 7.969435] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected
|
||||
[ 7.977348] ieee80211 phy0: rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected
|
||||
[ 7.985793] ieee80211 phy0: rt2x00lib_probe_dev: Error - Failed to allocate device
|
||||
[ 7.993569] CPU 0 Unable to handle kernel paging request at virtual address 00000024, epc == 800c8f54, ra == 80249ff8
|
||||
[ 8.004408] Oops[#1]:
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++
|
||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -9435,6 +9435,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
rf = RF3853;
|
||||
else if (rt2x00_rt(rt2x00dev, RT5350))
|
||||
rf = RF5350;
|
||||
+ else if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
+ rf = RF5592;
|
||||
else
|
||||
rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
|
||||
|
||||
@@ -1,22 +1,42 @@
|
||||
From 9782a7f7488443568fa4d6088b73c9aff7eb8510 Mon Sep 17 00:00:00 2001
|
||||
From patchwork Sat Sep 17 20:26:55 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979244
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:26:55 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 19 Apr 2017 16:14:53 +0200
|
||||
Subject: [PATCH] rt2x00: add support for external PA on MT7620
|
||||
To: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
Cc: Helmut Schaa <helmut.schaa@googlemail.com>,
|
||||
linux-wireless@vger.kernel.org,
|
||||
Kalle Valo <kvalo@codeaurora.org>
|
||||
Content-Type: text/plain; charset="UTF-8"
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 03/16] rt2x00: add support for external PA on MT7620
|
||||
Message-ID:
|
||||
<af2c68ff831816a86fc39b0c10911c129a1f03dc.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
Implement support for external PA connected to MT7620A.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
[pozega.tomislav@gmail.com: use chanreg and dccal helpers.]
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 +
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 70 +++++++++++++++++++++++++-
|
||||
2 files changed, 70 insertions(+), 1 deletion(-)
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 +
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 52 ++++++++++++++++++-
|
||||
2 files changed, 52 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
@@ -24,21 +44,19 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
#define EEPROM_NIC_CONF2_RX_STREAM FIELD16(0x000f)
|
||||
#define EEPROM_NIC_CONF2_TX_STREAM FIELD16(0x00f0)
|
||||
#define EEPROM_NIC_CONF2_CRYSTAL FIELD16(0x0600)
|
||||
+#define EEPROM_NIC_CONF2_EXTERNAL_PA FIELD16(0xc000)
|
||||
+#define EEPROM_NIC_CONF2_EXTERNAL_PA FIELD16(0x8000)
|
||||
|
||||
/*
|
||||
* EEPROM LNA
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -4369,6 +4369,45 @@ static void rt2800_config_channel(struct
|
||||
@@ -4368,6 +4368,43 @@ static void rt2800_config_channel(struct
|
||||
rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
}
|
||||
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
+ &rt2x00dev->cap_flags)) {
|
||||
+ rt2x00_warn(rt2x00dev, "Using incomplete support for " \
|
||||
+ "external PA\n");
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
@@ -76,7 +94,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 4);
|
||||
rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf));
|
||||
rt2800_bbp_write(rt2x00dev, 4, bbp);
|
||||
@@ -9578,7 +9617,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -9566,7 +9603,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
*/
|
||||
eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);
|
||||
|
||||
@@ -86,19 +104,19 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
if (rt2x00_get_field16(eeprom,
|
||||
EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
|
||||
__set_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
@@ -9589,6 +9629,18 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -9577,6 +9615,18 @@ static int rt2800_init_eeprom(struct rt2
|
||||
&rt2x00dev->cap_flags);
|
||||
}
|
||||
|
||||
+ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF2);
|
||||
+
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352) && eeprom != 0 && eeprom != 0xffff) {
|
||||
+ if (rt2x00_get_field16(eeprom,
|
||||
+ EEPROM_NIC_CONF2_EXTERNAL_PA)) {
|
||||
+ __set_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ __set_bit(CAPABILITY_EXTERNAL_PA_TX1,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ if (!rt2x00_get_field16(eeprom,
|
||||
+ EEPROM_NIC_CONF2_EXTERNAL_PA)) {
|
||||
+ __clear_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ __clear_bit(CAPABILITY_EXTERNAL_PA_TX1,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -0,0 +1,178 @@
|
||||
From patchwork Sat Sep 17 20:27:10 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979245
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:10 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 04/16] rt2x00: move up and reuse busy wait functions
|
||||
Message-ID:
|
||||
<3fdb9dc15e76a9f9c1948b4a3a1308a7a5677bb8.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Move bbp_ready and rf_ready busy wait functions up in the code so they
|
||||
can more easily be used. Allow specifying register mask in rf_ready
|
||||
function which is useful for calibration routines which will be added
|
||||
in follow-up commits.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 99 +++++++++----------
|
||||
1 file changed, 46 insertions(+), 53 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -2143,6 +2143,48 @@ void rt2800_config_erp(struct rt2x00_dev
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800_config_erp);
|
||||
|
||||
+static int rt2800_wait_bbp_rf_ready(struct rt2x00_dev *rt2x00dev,
|
||||
+ const struct rt2x00_field32 mask)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+ u32 reg;
|
||||
+
|
||||
+ for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
+ reg = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (!rt2x00_get_field32(reg, mask))
|
||||
+ return 0;
|
||||
+
|
||||
+ udelay(REGISTER_BUSY_DELAY);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_err(rt2x00dev, "BBP/RF register access failed, aborting\n");
|
||||
+ return -EACCES;
|
||||
+}
|
||||
+
|
||||
+static int rt2800_wait_bbp_ready(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+ u8 value;
|
||||
+
|
||||
+ /*
|
||||
+ * BBP was enabled after firmware was loaded,
|
||||
+ * but we need to reactivate it now.
|
||||
+ */
|
||||
+ rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
|
||||
+ rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
|
||||
+ msleep(1);
|
||||
+
|
||||
+ for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 0);
|
||||
+ if ((value != 0xff) && (value != 0x00))
|
||||
+ return 0;
|
||||
+ udelay(REGISTER_BUSY_DELAY);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_err(rt2x00dev, "BBP register access failed, aborting\n");
|
||||
+ return -EACCES;
|
||||
+}
|
||||
+
|
||||
static void rt2800_config_3572bt_ant(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
u32 reg;
|
||||
@@ -3799,10 +3841,9 @@ static void rt2800_config_alc(struct rt2
|
||||
struct ieee80211_channel *chan,
|
||||
int power_level) {
|
||||
u16 eeprom, target_power, max_power;
|
||||
- u32 mac_sys_ctrl, mac_status;
|
||||
+ u32 mac_sys_ctrl;
|
||||
u32 reg;
|
||||
u8 bbp;
|
||||
- int i;
|
||||
|
||||
/* hardware unit is 0.5dBm, limited to 23.5dBm */
|
||||
power_level *= 2;
|
||||
@@ -3838,16 +3879,8 @@ static void rt2800_config_alc(struct rt2
|
||||
/* Disable Tx/Rx */
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0);
|
||||
/* Check MAC Tx/Rx idle */
|
||||
- for (i = 0; i < 10000; i++) {
|
||||
- mac_status = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
- if (mac_status & 0x3)
|
||||
- usleep_range(50, 200);
|
||||
- else
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (i == 10000)
|
||||
- rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n");
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
|
||||
|
||||
if (chan->center_freq > 2457) {
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 30);
|
||||
@@ -6249,46 +6282,6 @@ static int rt2800_init_registers(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int rt2800_wait_bbp_rf_ready(struct rt2x00_dev *rt2x00dev)
|
||||
-{
|
||||
- unsigned int i;
|
||||
- u32 reg;
|
||||
-
|
||||
- for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
- reg = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
- if (!rt2x00_get_field32(reg, MAC_STATUS_CFG_BBP_RF_BUSY))
|
||||
- return 0;
|
||||
-
|
||||
- udelay(REGISTER_BUSY_DELAY);
|
||||
- }
|
||||
-
|
||||
- rt2x00_err(rt2x00dev, "BBP/RF register access failed, aborting\n");
|
||||
- return -EACCES;
|
||||
-}
|
||||
-
|
||||
-static int rt2800_wait_bbp_ready(struct rt2x00_dev *rt2x00dev)
|
||||
-{
|
||||
- unsigned int i;
|
||||
- u8 value;
|
||||
-
|
||||
- /*
|
||||
- * BBP was enabled after firmware was loaded,
|
||||
- * but we need to reactivate it now.
|
||||
- */
|
||||
- rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
|
||||
- rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
|
||||
- msleep(1);
|
||||
-
|
||||
- for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
- value = rt2800_bbp_read(rt2x00dev, 0);
|
||||
- if ((value != 0xff) && (value != 0x00))
|
||||
- return 0;
|
||||
- udelay(REGISTER_BUSY_DELAY);
|
||||
- }
|
||||
-
|
||||
- rt2x00_err(rt2x00dev, "BBP register access failed, aborting\n");
|
||||
- return -EACCES;
|
||||
-}
|
||||
|
||||
static void rt2800_bbp4_mac_if_ctrl(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -9110,7 +9103,7 @@ int rt2800_enable_radio(struct rt2x00_de
|
||||
/*
|
||||
* Wait BBP/RF to wake up.
|
||||
*/
|
||||
- if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev)))
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
return -EIO;
|
||||
|
||||
/*
|
||||
@@ -1,6 +1,48 @@
|
||||
From patchwork Sat Sep 17 20:27:26 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979246
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:26 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 05/16] rt2x00: add RF self TXDC calibration for MT7620
|
||||
Message-ID:
|
||||
<dbb6e5a0c12d6101477bd09e83253091d21512c9.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add TX self calibration based on mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
v2: use ++i instead of i = i + 1 in loops
|
||||
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 48 +++++++++++++++++++
|
||||
1 file changed, 48 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8438,6 +8438,56 @@ static void rt2800_init_rfcsr_5592(struc
|
||||
@@ -8428,6 +8428,53 @@ static void rt2800_init_rfcsr_5592(struc
|
||||
rt2800_led_open_drain_enable(rt2x00dev);
|
||||
}
|
||||
|
||||
@@ -10,7 +52,6 @@
|
||||
+ u32 mac0518, mac051c, mac0528, mac052c;
|
||||
+ u8 i;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "RF Tx self calibration start\n");
|
||||
+ mac0518 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
+ mac051c = rt2800_register_read(rt2x00dev, RF_BYPASS0);
|
||||
+ mac0528 = rt2800_register_read(rt2x00dev, RF_CONTROL2);
|
||||
@@ -27,19 +68,19 @@
|
||||
+ rfb7r1_org = rt2800_rfcsr_read_bank(rt2x00dev, 7, 1);
|
||||
+
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 5, 1, 0x4);
|
||||
+ for (i = 0; i < 100; i = i + 1) {
|
||||
+ udelay(50);
|
||||
+ for (i = 0; i < 100; ++i) {
|
||||
+ usleep_range(50, 100);
|
||||
+ rfvalue = rt2800_rfcsr_read_bank(rt2x00dev, 5, 1);
|
||||
+ if((rfvalue & 0x04) != 0x4)
|
||||
+ if ((rfvalue & 0x04) != 0x4)
|
||||
+ break;
|
||||
+ }
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 5, 1, rfb5r1_org);
|
||||
+
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 1, 0x4);
|
||||
+ for (i = 0; i < 100; i = i + 1) {
|
||||
+ udelay(50);
|
||||
+ for (i = 0; i < 100; ++i) {
|
||||
+ usleep_range(50, 100);
|
||||
+ rfvalue = rt2800_rfcsr_read_bank(rt2x00dev, 7, 1);
|
||||
+ if((rfvalue & 0x04) != 0x4)
|
||||
+ if ((rfvalue & 0x04) != 0x4)
|
||||
+ break;
|
||||
+ }
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 1, rfb7r1_org);
|
||||
@@ -50,14 +91,12 @@
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS0, mac051c);
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL2, mac0528);
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS2, mac052c);
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "RF Tx self calibration end\n");
|
||||
+}
|
||||
+
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9045,6 +9095,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9035,6 +9082,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
@@ -1,14 +1,68 @@
|
||||
From patchwork Sat Sep 17 20:27:41 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979247
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:41 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 06/16] rt2x00: add r calibration for MT7620
|
||||
Message-ID:
|
||||
<e0c34f233089bec4eb73826bc4f512166ee25934.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add r calibration code as found in mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
v2: use rt2800_wait_bbp_rf_ready()
|
||||
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800.h | 2 +
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 133 ++++++++++++++++++
|
||||
2 files changed, 135 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
@@ -1016,6 +1016,8 @@
|
||||
*/
|
||||
#define MAC_STATUS_CFG 0x1200
|
||||
#define MAC_STATUS_CFG_BBP_RF_BUSY FIELD32(0x00000003)
|
||||
+#define MAC_STATUS_CFG_BBP_RF_BUSY_TX FIELD32(0x00000001)
|
||||
+#define MAC_STATUS_CFG_BBP_RF_BUSY_RX FIELD32(0x00000002)
|
||||
|
||||
/*
|
||||
* PWR_PIN_CFG:
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8488,6 +8488,155 @@ static void rt2800_rf_self_txdc_cal(stru
|
||||
rt2x00_info(rt2x00dev, "RF Tx self calibration end\n");
|
||||
@@ -8475,6 +8475,138 @@ static void rt2800_rf_self_txdc_cal(stru
|
||||
rt2800_register_write(rt2x00dev, RF_BYPASS2, mac052c);
|
||||
}
|
||||
|
||||
+static int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2)
|
||||
+{
|
||||
+ int calcode;
|
||||
+ calcode = ((d2 - d1) * 1000) / 43;
|
||||
+ if ((calcode%10) >= 5)
|
||||
+ int calcode = ((d2 - d1) * 1000) / 43;
|
||||
+
|
||||
+ if ((calcode % 10) >= 5)
|
||||
+ calcode += 10;
|
||||
+ calcode = (calcode / 10);
|
||||
+
|
||||
@@ -28,8 +82,7 @@
|
||||
+ char d1 = 0, d2 = 0;
|
||||
+ u8 rfvalue;
|
||||
+ u32 MAC_RF_BYPASS0, MAC_RF_CONTROL0, MAC_PWR_PIN_CFG;
|
||||
+ u32 maccfg, macstatus;
|
||||
+ int i;
|
||||
+ u32 maccfg;
|
||||
+
|
||||
+ saverfb0r1 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 1);
|
||||
+ saverfb0r34 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 34);
|
||||
@@ -53,30 +106,14 @@
|
||||
+ maccfg &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macstatus = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macstatus & 0x1)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 10000)
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n");
|
||||
+
|
||||
+ maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ maccfg &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macstatus = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macstatus & 0x2)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 10000)
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
+ rt2x00_warn(rt2x00dev, "Wait MAC Rx Status to MAX !!!\n");
|
||||
+
|
||||
+ rfvalue = (MAC_RF_BYPASS0 | 0x3004);
|
||||
@@ -98,7 +135,7 @@
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 47, 0x04);
|
||||
+ rt2800_bbp_write(rt2x00dev, 22, 0x80);
|
||||
+ udelay(100);
|
||||
+ usleep_range(100, 200);
|
||||
+ bytevalue = rt2800_bbp_read(rt2x00dev, 49);
|
||||
+ if (bytevalue > 128)
|
||||
+ d1 = bytevalue - 256;
|
||||
@@ -108,7 +145,7 @@
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 0, 35, 0x01);
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 22, 0x80);
|
||||
+ udelay(100);
|
||||
+ usleep_range(100, 200);
|
||||
+ bytevalue = rt2800_bbp_read(rt2x00dev, 49);
|
||||
+ if (bytevalue > 128)
|
||||
+ d2 = bytevalue - 256;
|
||||
@@ -156,7 +193,7 @@
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9095,6 +9244,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9082,6 +9214,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
@@ -1,13 +1,54 @@
|
||||
From patchwork Sat Sep 17 20:27:56 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979248
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:56 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 07/16] rt2x00: add RXDCOC calibration for MT7620
|
||||
Message-ID:
|
||||
<850b30f652e88de30d79e968af4eb47aa5bc2511.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add RXDCOC calibration code from mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
[fixed typo reported by Serge Vasilugin <vasilugin@yandex.ru>]
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 60 +++++++++++++++++++
|
||||
1 file changed, 60 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8637,6 +8637,70 @@ static void rt2800_r_calibration(struct
|
||||
@@ -8607,6 +8607,65 @@ static void rt2800_r_calibration(struct
|
||||
rt2800_register_write(rt2x00dev, PWR_PIN_CFG, MAC_PWR_PIN_CFG);
|
||||
}
|
||||
|
||||
+static void rt2800_rxdcoc_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ u8 bbpreg = 0;
|
||||
+ u32 macvalue = 0, macvalue1 = 0;
|
||||
+ u32 macvalue = 0;
|
||||
+ u8 saverfb0r2, saverfb5r4, saverfb7r4, rfvalue;
|
||||
+ int i;
|
||||
+
|
||||
@@ -24,15 +65,10 @@
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x8);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macvalue1 = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue1 & 0x1)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF TX busy in RX RXDCOC calibration\n");
|
||||
+
|
||||
+ saverfb5r4 = rt2800_rfcsr_read_bank(rt2x00dev, 5, 0);
|
||||
+ saverfb5r4 = rt2800_rfcsr_read_bank(rt2x00dev, 5, 4);
|
||||
+ saverfb7r4 = rt2800_rfcsr_read_bank(rt2x00dev, 7, 4);
|
||||
+ saverfb5r4 = saverfb5r4 & (~0x40);
|
||||
+ saverfb7r4 = saverfb7r4 & (~0x40);
|
||||
@@ -49,9 +85,9 @@
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ bbpreg = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ if ((bbpreg & 0x40)==0)
|
||||
+ if ((bbpreg & 0x40) == 0)
|
||||
+ break;
|
||||
+ udelay(50);
|
||||
+ usleep_range(50, 100);
|
||||
+ }
|
||||
+
|
||||
+ bbpreg = rt2800_bbp_read(rt2x00dev, 159);
|
||||
@@ -71,7 +107,7 @@
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9246,6 +9310,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9216,6 +9275,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
@@ -1,17 +1,62 @@
|
||||
From patchwork Sat Sep 17 20:28:10 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979249
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:10 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 08/16] rt2x00: add RXIQ calibration for MT7620
|
||||
Message-ID:
|
||||
<033a39a697d51f6df258acea4c33608e0944fe4c.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add RXIQ calibration found in mtk driver. With old openwrt builds this
|
||||
gets us ~8Mbps more of RX bandwidth (test with iPA/eLNA layout).
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
v2: use rt2800_wait_bbp_rf_ready(), fix indentation
|
||||
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 375 ++++++++++++++++++
|
||||
1 file changed, 375 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8701,6 +8701,384 @@ static void rt2800_rxdcoc_calibration(st
|
||||
@@ -8666,6 +8666,380 @@ static void rt2800_rxdcoc_calibration(st
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, saverfb0r2);
|
||||
}
|
||||
|
||||
+static u32 rt2800_do_sqrt_accumulation(u32 si) {
|
||||
+static u32 rt2800_do_sqrt_accumulation(u32 si)
|
||||
+{
|
||||
+ u32 root, root_pre, bit;
|
||||
+ char i;
|
||||
+
|
||||
+ bit = 1 << 15;
|
||||
+ root = 0;
|
||||
+ for (i = 15; i >= 0; i = i - 1) {
|
||||
+ root_pre = root + bit;
|
||||
+ if ((root_pre*root_pre) <= si)
|
||||
+ if ((root_pre * root_pre) <= si)
|
||||
+ root = root_pre;
|
||||
+ bit = bit >> 1;
|
||||
+ }
|
||||
@@ -19,7 +64,8 @@
|
||||
+ return root;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev) {
|
||||
+static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ u8 rfb0r1, rfb0r2, rfb0r42;
|
||||
+ u8 rfb4r0, rfb4r19;
|
||||
+ u8 rfb5r3, rfb5r4, rfb5r17, rfb5r18, rfb5r19, rfb5r20;
|
||||
@@ -43,8 +89,8 @@
|
||||
+ u32 orig_RF_BYPASS1 = 0;
|
||||
+ u32 orig_RF_CONTROL3 = 0;
|
||||
+ u32 orig_RF_BYPASS3 = 0;
|
||||
+ u32 macstatus, bbpval1 = 0;
|
||||
+ u8 rf_vga_table[] = {0x20, 0x21, 0x22, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f};
|
||||
+ u32 bbpval1 = 0;
|
||||
+ static const u8 rf_vga_table[] = {0x20, 0x21, 0x22, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f};
|
||||
+
|
||||
+ savemacsysctrl = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ orig_RF_CONTROL0 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
@@ -59,16 +105,8 @@
|
||||
+
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x0);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macstatus = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macstatus & 0x3)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 10000)
|
||||
+ rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n");
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
+ rt2x00_warn(rt2x00dev, "Timeout waiting for MAC status in RXIQ calibration\n");
|
||||
+
|
||||
+ bbpval = bbp4 & (~0x18);
|
||||
+ bbpval = bbp4 | 0x00;
|
||||
@@ -165,7 +203,7 @@
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00001006);
|
||||
+ udelay(1);
|
||||
+
|
||||
+ bbpval = bbp1 & (~ 0x18);
|
||||
+ bbpval = bbp1 & (~0x18);
|
||||
+ bbpval = bbpval | 0x00;
|
||||
+ rt2800_bbp_write(rt2x00dev, 1, bbpval);
|
||||
+
|
||||
@@ -184,132 +222,133 @@
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00002006);
|
||||
+ udelay(1);
|
||||
+
|
||||
+ bbpval = bbp1 & (~ 0x18);
|
||||
+ bbpval = bbp1 & (~0x18);
|
||||
+ bbpval = bbpval | 0x08;
|
||||
+ rt2800_bbp_write(rt2x00dev, 1, bbpval);
|
||||
+
|
||||
+ rt2800_bbp_dcoc_write(rt2x00dev, 1, 0x01);
|
||||
+ }
|
||||
+ udelay(500);
|
||||
+ usleep_range(500, 1500);
|
||||
+
|
||||
+ vga_idx = 0;
|
||||
+ while (vga_idx < 11) {
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rf_vga_table[vga_idx]);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rf_vga_table[vga_idx]);
|
||||
+ while (vga_idx < 11) {
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rf_vga_table[vga_idx]);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rf_vga_table[vga_idx]);
|
||||
+
|
||||
+ rt2800_bbp_dcoc_write(rt2x00dev, 0, 0x93);
|
||||
+ rt2800_bbp_dcoc_write(rt2x00dev, 0, 0x93);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ bbpval = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ if ((bbpval & 0xff) == 0x93)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if ((bbpval & 0xff) == 0x93) {
|
||||
+ rt2x00_warn(rt2x00dev, "Fatal Error: Calibration doesn't finish");
|
||||
+ goto restore_value;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < 5; i++) {
|
||||
+ u32 bbptemp = 0;
|
||||
+ u8 value = 0;
|
||||
+ int result = 0;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1e);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, i);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x22);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 24);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x21);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 16);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x20);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 8);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1f);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + value;
|
||||
+
|
||||
+ if ((i < 2) && (bbptemp & 0x800000))
|
||||
+ result = (bbptemp & 0xffffff) - 0x1000000;
|
||||
+ else if (i == 4)
|
||||
+ result = bbptemp;
|
||||
+ else
|
||||
+ result = bbptemp;
|
||||
+
|
||||
+ if (i == 0)
|
||||
+ mi = result/4096;
|
||||
+ else if (i == 1)
|
||||
+ mq = result/4096;
|
||||
+ else if (i == 2)
|
||||
+ si = bbptemp/4096;
|
||||
+ else if (i == 3)
|
||||
+ sq = bbptemp/4096;
|
||||
+ else
|
||||
+ riq = result/4096;
|
||||
+ }
|
||||
+
|
||||
+ bbpval1 = si - mi*mi;
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ si=%d, sq=%d, riq=%d, bbpval %d, vga_idx %d", si, sq, riq, bbpval1, vga_idx);
|
||||
+
|
||||
+ if (bbpval1 >= (100*100))
|
||||
+ break;
|
||||
+
|
||||
+ if (bbpval1 <= 100)
|
||||
+ vga_idx = vga_idx + 9;
|
||||
+ else if (bbpval1 <= 158)
|
||||
+ vga_idx = vga_idx + 8;
|
||||
+ else if (bbpval1 <= 251)
|
||||
+ vga_idx = vga_idx + 7;
|
||||
+ else if (bbpval1 <= 398)
|
||||
+ vga_idx = vga_idx + 6;
|
||||
+ else if (bbpval1 <= 630)
|
||||
+ vga_idx = vga_idx + 5;
|
||||
+ else if (bbpval1 <= 1000)
|
||||
+ vga_idx = vga_idx + 4;
|
||||
+ else if (bbpval1 <= 1584)
|
||||
+ vga_idx = vga_idx + 3;
|
||||
+ else if (bbpval1 <= 2511)
|
||||
+ vga_idx = vga_idx + 2;
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ bbpval = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ if ((bbpval & 0xff) == 0x93)
|
||||
+ usleep_range(50, 100);
|
||||
+ else
|
||||
+ vga_idx = vga_idx + 1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if ((bbpval & 0xff) == 0x93) {
|
||||
+ rt2x00_warn(rt2x00dev, "Fatal Error: Calibration doesn't finish");
|
||||
+ goto restore_value;
|
||||
+ }
|
||||
+ for (i = 0; i < 5; i++) {
|
||||
+ u32 bbptemp = 0;
|
||||
+ u8 value = 0;
|
||||
+ int result = 0;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1e);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, i);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x22);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 24);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x21);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 16);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x20);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 8);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1f);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + value;
|
||||
+
|
||||
+ if (i < 2 && (bbptemp & 0x800000))
|
||||
+ result = (bbptemp & 0xffffff) - 0x1000000;
|
||||
+ else if (i == 4)
|
||||
+ result = bbptemp;
|
||||
+ else
|
||||
+ result = bbptemp;
|
||||
+
|
||||
+ if (i == 0)
|
||||
+ mi = result / 4096;
|
||||
+ else if (i == 1)
|
||||
+ mq = result / 4096;
|
||||
+ else if (i == 2)
|
||||
+ si = bbptemp / 4096;
|
||||
+ else if (i == 3)
|
||||
+ sq = bbptemp / 4096;
|
||||
+ else
|
||||
+ riq = result / 4096;
|
||||
+ }
|
||||
+
|
||||
+ sigma_i = rt2800_do_sqrt_accumulation(100*(si - mi*mi));
|
||||
+ sigma_q = rt2800_do_sqrt_accumulation(100*(sq - mq*mq));
|
||||
+ r_iq = 10*(riq-(mi*mq));
|
||||
+ bbpval1 = si - mi * mi;
|
||||
+ rt2x00_dbg(rt2x00dev,
|
||||
+ "RXIQ si=%d, sq=%d, riq=%d, bbpval %d, vga_idx %d",
|
||||
+ si, sq, riq, bbpval1, vga_idx);
|
||||
+
|
||||
+ if (bbpval1 >= (100 * 100))
|
||||
+ break;
|
||||
+
|
||||
+ if (bbpval1 <= 100)
|
||||
+ vga_idx = vga_idx + 9;
|
||||
+ else if (bbpval1 <= 158)
|
||||
+ vga_idx = vga_idx + 8;
|
||||
+ else if (bbpval1 <= 251)
|
||||
+ vga_idx = vga_idx + 7;
|
||||
+ else if (bbpval1 <= 398)
|
||||
+ vga_idx = vga_idx + 6;
|
||||
+ else if (bbpval1 <= 630)
|
||||
+ vga_idx = vga_idx + 5;
|
||||
+ else if (bbpval1 <= 1000)
|
||||
+ vga_idx = vga_idx + 4;
|
||||
+ else if (bbpval1 <= 1584)
|
||||
+ vga_idx = vga_idx + 3;
|
||||
+ else if (bbpval1 <= 2511)
|
||||
+ vga_idx = vga_idx + 2;
|
||||
+ else
|
||||
+ vga_idx = vga_idx + 1;
|
||||
+ }
|
||||
+
|
||||
+ sigma_i = rt2800_do_sqrt_accumulation(100 * (si - mi * mi));
|
||||
+ sigma_q = rt2800_do_sqrt_accumulation(100 * (sq - mq * mq));
|
||||
+ r_iq = 10 * (riq - (mi * mq));
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "Sigma_i=%d, Sigma_q=%d, R_iq=%d", sigma_i, sigma_q, r_iq);
|
||||
+
|
||||
+ if (((sigma_i <= 1400 ) && (sigma_i >= 1000))
|
||||
+ && ((sigma_i - sigma_q) <= 112)
|
||||
+ && ((sigma_i - sigma_q) >= -112)
|
||||
+ && ((mi <= 32) && (mi >= -32))
|
||||
+ && ((mq <= 32) && (mq >= -32))) {
|
||||
+ r_iq = 10*(riq-(mi*mq));
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n", sigma_i, sigma_q, r_iq);
|
||||
+ if (sigma_i <= 1400 && sigma_i >= 1000 &&
|
||||
+ (sigma_i - sigma_q) <= 112 &&
|
||||
+ (sigma_i - sigma_q) >= -112 &&
|
||||
+ mi <= 32 && mi >= -32 &&
|
||||
+ mq <= 32 && mq >= -32) {
|
||||
+ r_iq = 10 * (riq - (mi * mq));
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n",
|
||||
+ sigma_i, sigma_q, r_iq);
|
||||
+
|
||||
+ g_rx = (1000 * sigma_q) / sigma_i;
|
||||
+ g_imb = ((-2) * 128 * (1000 - g_rx)) / (1000 + g_rx);
|
||||
+ ph_rx = (r_iq * 2292) / (sigma_i * sigma_q);
|
||||
+ rt2x00_info(rt2x00dev, "RXIQ G_imb=%d, Ph_rx=%d\n", g_imb, ph_rx);
|
||||
+ g_rx = (1000 * sigma_q) / sigma_i;
|
||||
+ g_imb = ((-2) * 128 * (1000 - g_rx)) / (1000 + g_rx);
|
||||
+ ph_rx = (r_iq * 2292) / (sigma_i * sigma_q);
|
||||
+
|
||||
+ if ((ph_rx > 20) || (ph_rx < -20)) {
|
||||
+ ph_rx = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+
|
||||
+ if ((g_imb > 12) || (g_imb < -12)) {
|
||||
+ g_imb = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+ if (ph_rx > 20 || ph_rx < -20) {
|
||||
+ ph_rx = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+ else {
|
||||
+
|
||||
+ if (g_imb > 12 || g_imb < -12) {
|
||||
+ g_imb = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+ } else {
|
||||
+ g_imb = 0;
|
||||
+ ph_rx = 0;
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n", sigma_i, sigma_q, r_iq);
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n",
|
||||
+ sigma_i, sigma_q, r_iq);
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+
|
||||
@@ -385,7 +424,7 @@
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9313,6 +9691,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9278,6 +9652,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
@@ -0,0 +1,52 @@
|
||||
From patchwork Sat Sep 17 20:28:29 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979250
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:29 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 09/16] rt2x00: don't run Rt5592 IQ calibration on MT7620
|
||||
Message-ID:
|
||||
<31a1c34ddbd296b82f38c18c9ae7339059215fdc.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
The function rt2800_iq_calibrate is intended for Rt5592 only.
|
||||
Don't call it for MT7620 which has it's own calibration functions.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
v2: test for RT5592 instead of !RT6352
|
||||
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -4398,7 +4398,8 @@ static void rt2800_config_channel(struct
|
||||
reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
|
||||
|
||||
- rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
+ if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
+ rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
}
|
||||
|
||||
if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
@@ -1,10 +1,56 @@
|
||||
From patchwork Sat Sep 17 20:28:43 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979251
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:43 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 10/16] rt2x00: add TX LOFT calibration for MT7620
|
||||
Message-ID:
|
||||
<d9295a9138a1f552b648aacb84e1419d38f5c896.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add TX LOFT calibration from mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
v2: use helper functions, make tables static const, remove useless
|
||||
debug prints
|
||||
v3: don't export function not used anywhere else
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 902 ++++++++++++++++++
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.h | 10 +
|
||||
2 files changed, 912 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -9079,6 +9079,943 @@ restore_value:
|
||||
@@ -9041,6 +9041,907 @@ restore_value:
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl);
|
||||
}
|
||||
|
||||
+static void rt2800_rf_configstore(struct rt2x00_dev *rt2x00dev, rf_reg_pair rf_reg_record[][13], u8 chain)
|
||||
+static void rt2800_rf_configstore(struct rt2x00_dev *rt2x00dev,
|
||||
+ struct rf_reg_pair rf_reg_record[][13], u8 chain)
|
||||
+{
|
||||
+ u8 rfvalue = 0;
|
||||
+
|
||||
@@ -116,13 +162,11 @@
|
||||
+ rf_reg_record[CHAIN_1][12].value = rfvalue;
|
||||
+ } else {
|
||||
+ rt2x00_warn(rt2x00dev, "Unknown chain = %u\n", chain);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_rf_configrecover(struct rt2x00_dev *rt2x00dev, rf_reg_pair rf_record[][13])
|
||||
+static void rt2800_rf_configrecover(struct rt2x00_dev *rt2x00dev,
|
||||
+ struct rf_reg_pair rf_record[][13])
|
||||
+{
|
||||
+ u8 chain_index = 0, record_index = 0;
|
||||
+ u8 bank = 0, rf_register = 0, value = 0;
|
||||
@@ -133,11 +177,10 @@
|
||||
+ rf_register = rf_record[chain_index][record_index].reg;
|
||||
+ value = rf_record[chain_index][record_index].value;
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, bank, rf_register, value);
|
||||
+ rt2x00_dbg(rt2x00dev, "bank: %d, rf_register: %d, value: %x\n", bank, rf_register, value);
|
||||
+ rt2x00_dbg(rt2x00dev, "bank: %d, rf_register: %d, value: %x\n",
|
||||
+ bank, rf_register, value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_setbbptonegenerator(struct rt2x00_dev *rt2x00dev)
|
||||
@@ -155,15 +198,13 @@
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x3F);
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 244, 0x40);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static u32 rt2800_do_fft_accumulation(struct rt2x00_dev *rt2x00dev, u8 tidx, u8 read_neg)
|
||||
+{
|
||||
+ u32 macvalue = 0;
|
||||
+ int fftout_i = 0, fftout_q = 0;
|
||||
+ u32 ptmp=0, pint = 0;
|
||||
+ u32 ptmp = 0, pint = 0;
|
||||
+ u8 bbp = 0;
|
||||
+ u8 tidxi;
|
||||
+
|
||||
@@ -173,7 +214,7 @@
|
||||
+ bbp = 0x9b;
|
||||
+
|
||||
+ while (bbp == 0x9b) {
|
||||
+ udelay(10);
|
||||
+ usleep_range(10, 50);
|
||||
+ bbp = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbp = bbp & 0xff;
|
||||
+ }
|
||||
@@ -218,10 +259,11 @@
|
||||
+ return pint;
|
||||
+}
|
||||
+
|
||||
+static u32 rt2800_read_fft_accumulation(struct rt2x00_dev *rt2x00dev, u8 tidx) {
|
||||
+static u32 rt2800_read_fft_accumulation(struct rt2x00_dev *rt2x00dev, u8 tidx)
|
||||
+{
|
||||
+ u32 macvalue = 0;
|
||||
+ int fftout_i = 0, fftout_q = 0;
|
||||
+ u32 ptmp=0, pint = 0;
|
||||
+ u32 ptmp = 0, pint = 0;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0xBA);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, tidx);
|
||||
@@ -237,7 +279,6 @@
|
||||
+ ptmp = (fftout_i * fftout_i);
|
||||
+ ptmp = ptmp + (fftout_q * fftout_q);
|
||||
+ pint = ptmp;
|
||||
+ rt2x00_info(rt2x00dev, "I = %d, Q = %d, power = %x\n", fftout_i, fftout_q, pint);
|
||||
+
|
||||
+ return pint;
|
||||
+}
|
||||
@@ -251,18 +292,17 @@
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, bbp);
|
||||
+
|
||||
+ if (ch_idx == 0)
|
||||
+ bbp = (iorq == 0) ? 0xb1: 0xb2;
|
||||
+ bbp = (iorq == 0) ? 0xb1 : 0xb2;
|
||||
+ else
|
||||
+ bbp = (iorq == 0) ? 0xb8: 0xb9;
|
||||
+ bbp = (iorq == 0) ? 0xb8 : 0xb9;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ bbp = dc;
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, bbp);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_loft_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx, u8 alc_idx, u8 dc_result[][RF_ALC_NUM][2])
|
||||
+static void rt2800_loft_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx,
|
||||
+ u8 alc_idx, u8 dc_result[][RF_ALC_NUM][2])
|
||||
+{
|
||||
+ u32 p0 = 0, p1 = 0, pf = 0;
|
||||
+ char idx0 = 0, idx1 = 0;
|
||||
@@ -276,8 +316,6 @@
|
||||
+
|
||||
+ for (bidx = 5; bidx >= 0; bidx--) {
|
||||
+ for (iorq = 0; iorq <= 1; iorq++) {
|
||||
+ rt2x00_dbg(rt2x00dev, "\n========================================================\n");
|
||||
+
|
||||
+ if (idxf[iorq] == 0x20) {
|
||||
+ idx0 = 0x20;
|
||||
+ p0 = pf;
|
||||
@@ -288,16 +326,17 @@
|
||||
+ p0 = rt2800_do_fft_accumulation(rt2x00dev, 0x0A, 0);
|
||||
+ }
|
||||
+
|
||||
+ idx1 = idxf[iorq] + ((bidx == 5) ? 0 : ibit);
|
||||
+ idx1 = idxf[iorq] + (bidx == 5 ? 0 : ibit);
|
||||
+ idx1 = idx1 & 0x3F;
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, iorq, idx1);
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x0A, 0);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "alc=%u, IorQ=%u, idx_final=%2x\n", alc_idx, iorq, idxf[iorq]);
|
||||
+ rt2x00_dbg(rt2x00dev, "p0=%x, p1=%x, pf=%x, idx_0=%x, idx_1=%x, ibit=%x !\n", p0, p1, pf, idx0, idx1, ibit);
|
||||
+ rt2x00_dbg(rt2x00dev, "alc=%u, IorQ=%u, idx_final=%2x\n",
|
||||
+ alc_idx, iorq, idxf[iorq]);
|
||||
+ rt2x00_dbg(rt2x00dev, "p0=%x, p1=%x, pf=%x, idx_0=%x, idx_1=%x, ibit=%x\n",
|
||||
+ p0, p1, pf, idx0, idx1, ibit);
|
||||
+
|
||||
+ if ((bidx != 5) && (pf <= p0) && (pf < p1)) {
|
||||
+ pf = pf;
|
||||
+ if (bidx != 5 && pf <= p0 && pf < p1) {
|
||||
+ idxf[iorq] = idxf[iorq];
|
||||
+ } else if (p0 < p1) {
|
||||
+ pf = p0;
|
||||
@@ -306,17 +345,15 @@
|
||||
+ pf = p1;
|
||||
+ idxf[iorq] = idx1 & 0x3F;
|
||||
+ }
|
||||
+ rt2x00_dbg(rt2x00dev, "IorQ=%u, idx_final[%u]:%x, pf:%8x\n", iorq, iorq, idxf[iorq], pf);
|
||||
+ rt2x00_dbg(rt2x00dev, "IorQ=%u, idx_final[%u]:%x, pf:%8x\n",
|
||||
+ iorq, iorq, idxf[iorq], pf);
|
||||
+
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, iorq, idxf[iorq]);
|
||||
+
|
||||
+ }
|
||||
+ ibit = ibit >> 1;
|
||||
+ }
|
||||
+ dc_result[ch_idx][alc_idx][0] = idxf[0];
|
||||
+ dc_result[ch_idx][alc_idx][1] = idxf[1];
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_iq_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx, u8 *ges, u8 *pes)
|
||||
@@ -334,26 +371,25 @@
|
||||
+ u8 bbp = 0;
|
||||
+ char bidx;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "IQCalibration Start!\n");
|
||||
+ for (bidx = 5; bidx >= 1; bidx--) {
|
||||
+ for (gop = 0; gop < 2; gop++) {
|
||||
+ rt2x00_dbg(rt2x00dev, "\n========================================================\n");
|
||||
+
|
||||
+ if ((gop == 1) || (bidx < 4)) {
|
||||
+ if (gop == 1 || bidx < 4) {
|
||||
+ if (gop == 0)
|
||||
+ iq_err = gerr;
|
||||
+ else
|
||||
+ iq_err = perr;
|
||||
+
|
||||
+ first_search = (gop == 0) ? (bidx == 3) : (bidx == 5);
|
||||
+ touch_neg_max = (gop) ? ((iq_err & 0x0F) == 0x08) : ((iq_err & 0x3F) == 0x20);
|
||||
+ touch_neg_max = (gop) ? ((iq_err & 0x0F) == 0x08) :
|
||||
+ ((iq_err & 0x3F) == 0x20);
|
||||
+
|
||||
+ if (touch_neg_max) {
|
||||
+ p0 = pf;
|
||||
+ idx0 = iq_err;
|
||||
+ } else {
|
||||
+ idx0 = iq_err - ibit;
|
||||
+ bbp = (ch_idx == 0) ? ((gop == 0) ? 0x28 : 0x29): ((gop == 0) ? 0x46 : 0x47);
|
||||
+ bbp = (ch_idx == 0) ? ((gop == 0) ? 0x28 : 0x29) :
|
||||
+ ((gop == 0) ? 0x46 : 0x47);
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, idx0);
|
||||
@@ -364,26 +400,30 @@
|
||||
+ idx1 = iq_err + (first_search ? 0 : ibit);
|
||||
+ idx1 = (gop == 0) ? (idx1 & 0x0F) : (idx1 & 0x3F);
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 : (gop == 0) ? 0x46 : 0x47;
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
|
||||
+ (gop == 0) ? 0x46 : 0x47;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, idx1);
|
||||
+
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "p0=%x, p1=%x, pwer_final=%x, idx0=%x, idx1=%x, iq_err=%x, gop=%d, ibit=%x !\n", p0, p1, pf, idx0, idx1, iq_err, gop, ibit);
|
||||
+ rt2x00_dbg(rt2x00dev,
|
||||
+ "p0=%x, p1=%x, pwer_final=%x, idx0=%x, idx1=%x, iq_err=%x, gop=%d, ibit=%x\n",
|
||||
+ p0, p1, pf, idx0, idx1, iq_err, gop, ibit);
|
||||
+
|
||||
+ if ((!first_search) && (pf <= p0) && (pf < p1)) {
|
||||
+ pf = pf;
|
||||
+ } else if (p0 < p1) {
|
||||
+ pf = p0;
|
||||
+ iq_err = idx0;
|
||||
+ } else {
|
||||
+ pf = p1;
|
||||
+ iq_err = idx1;
|
||||
+ if (!(!first_search && pf <= p0 && pf < p1)) {
|
||||
+ if (p0 < p1) {
|
||||
+ pf = p0;
|
||||
+ iq_err = idx0;
|
||||
+ } else {
|
||||
+ pf = p1;
|
||||
+ iq_err = idx1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 : (gop == 0) ? 0x46 : 0x47;
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
|
||||
+ (gop == 0) ? 0x46 : 0x47;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, iq_err);
|
||||
@@ -393,8 +433,8 @@
|
||||
+ else
|
||||
+ perr = iq_err;
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "IQCalibration pf=%8x (%2x, %2x) !\n", pf, gerr & 0x0F, perr & 0x3F);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "IQCalibration pf=%8x (%2x, %2x) !\n",
|
||||
+ pf, gerr & 0x0F, perr & 0x3F);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -423,25 +463,21 @@
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, pef & 0x3F);
|
||||
+
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
|
||||
+ if ((gef == gsta) && (pef == psta)) {
|
||||
+ if (gef == gsta && pef == psta) {
|
||||
+ pf = p1;
|
||||
+ gerr = gef;
|
||||
+ perr = pef;
|
||||
+ } else if (pf > p1) {
|
||||
+ pf = p1;
|
||||
+ gerr = gef;
|
||||
+ perr = pef;
|
||||
+ }
|
||||
+ else if (pf > p1){
|
||||
+ pf = p1;
|
||||
+ gerr = gef;
|
||||
+ perr = pef;
|
||||
+ }
|
||||
+ rt2x00_dbg(rt2x00dev, "Fine IQCalibration p1=%8x pf=%8x (%2x, %2x) !\n", p1, pf, gef & 0x0F, pef & 0x3F);
|
||||
+ rt2x00_dbg(rt2x00dev, "Fine IQCalibration p1=%8x pf=%8x (%2x, %2x) !\n",
|
||||
+ p1, pf, gef & 0x0F, pef & 0x3F);
|
||||
+ }
|
||||
+
|
||||
+ ges[ch_idx] = gerr & 0x0F;
|
||||
+ pes[ch_idx] = perr & 0x3F;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "IQCalibration Done! CH = %u, (gain=%2x, phase=%2x)\n", ch_idx, gerr & 0x0F, perr & 0x3F);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_rf_aux_tx0_loopback(struct rt2x00_dev *rt2x00dev)
|
||||
@@ -478,9 +514,9 @@
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 20, 0x20);
|
||||
+}
|
||||
+
|
||||
+void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+static void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ rf_reg_pair rf_store[CHAIN_NUM][13];
|
||||
+ struct rf_reg_pair rf_store[CHAIN_NUM][13];
|
||||
+ u32 macorg1 = 0;
|
||||
+ u32 macorg2 = 0;
|
||||
+ u32 macorg3 = 0;
|
||||
@@ -489,7 +525,7 @@
|
||||
+ u32 orig528 = 0;
|
||||
+ u32 orig52c = 0;
|
||||
+
|
||||
+ u32 savemacsysctrl = 0, mtxcycle = 0;
|
||||
+ u32 savemacsysctrl = 0;
|
||||
+ u32 macvalue = 0;
|
||||
+ u32 mac13b8 = 0;
|
||||
+ u32 p0 = 0, p1 = 0;
|
||||
@@ -498,11 +534,8 @@
|
||||
+ u8 rfvalue;
|
||||
+ u8 loft_dc_search_result[CHAIN_NUM][RF_ALC_NUM][2];
|
||||
+ u8 ger[CHAIN_NUM], per[CHAIN_NUM];
|
||||
+ u8 rf_gain[] = {0x00, 0x01, 0x02, 0x04, 0x08, 0x0c};
|
||||
+ u8 rfvga_gain_table[] = {0x24, 0x25, 0x26, 0x27, 0x28, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3F};
|
||||
+
|
||||
+ u8 vga_gain[] = {14, 14};
|
||||
+ u8 bbp_2324gain[] = {0x16, 0x14, 0x12, 0x10, 0x0c, 0x08};
|
||||
+ u8 bbp = 0, ch_idx = 0, rf_alc_idx = 0, idx = 0;
|
||||
+ u8 bbpr30, rfb0r39, rfb0r42;
|
||||
+ u8 bbpr1;
|
||||
@@ -510,6 +543,11 @@
|
||||
+ u8 bbpr241, bbpr242;
|
||||
+ u8 count_step;
|
||||
+
|
||||
+ static const u8 rf_gain[] = {0x00, 0x01, 0x02, 0x04, 0x08, 0x0c};
|
||||
+ static const u8 rfvga_gain_table[] = {0x24, 0x25, 0x26, 0x27, 0x28, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
|
||||
+ 0x31, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3F};
|
||||
+ static const u8 bbp_2324gain[] = {0x16, 0x14, 0x12, 0x10, 0x0c, 0x08};
|
||||
+
|
||||
+ savemacsysctrl = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macorg1 = rt2800_register_read(rt2x00dev, TX_PIN_CFG);
|
||||
+ macorg2 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
@@ -524,29 +562,18 @@
|
||||
+ macvalue &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x01)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF TX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macvalue &= (~0x08);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x02)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF RX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++)
|
||||
+ rt2800_rf_configstore(rt2x00dev, rf_store, ch_idx);
|
||||
+ }
|
||||
+
|
||||
+ bbpr30 = rt2800_bbp_read(rt2x00dev, 30);
|
||||
+ rfb0r39 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 39);
|
||||
@@ -561,7 +588,7 @@
|
||||
+
|
||||
+ rt2800_setbbptonegenerator(rt2x00dev);
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx ++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 23, 0x00);
|
||||
+ rt2800_bbp_write(rt2x00dev, 24, 0x00);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x00);
|
||||
@@ -571,18 +598,17 @@
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, 0x10);
|
||||
+ udelay(1);
|
||||
+
|
||||
+ if (ch_idx == 0) {
|
||||
+ if (ch_idx == 0)
|
||||
+ rt2800_rf_aux_tx0_loopback(rt2x00dev);
|
||||
+ } else {
|
||||
+ else
|
||||
+ rt2800_rf_aux_tx1_loopback(rt2x00dev);
|
||||
+ }
|
||||
+
|
||||
+ udelay(1);
|
||||
+
|
||||
+ if (ch_idx == 0) {
|
||||
+ if (ch_idx == 0)
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00001004);
|
||||
+ } else {
|
||||
+ else
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00002004);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x05);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x00);
|
||||
@@ -608,7 +634,8 @@
|
||||
+
|
||||
+ if (rf_alc_idx == 0) {
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 1, 0x21);
|
||||
+ for (;vga_gain[ch_idx] > 0;vga_gain[ch_idx] = vga_gain[ch_idx] - 2) {
|
||||
+ for (; vga_gain[ch_idx] > 0;
|
||||
+ vga_gain[ch_idx] = vga_gain[ch_idx] - 2) {
|
||||
+ rfvalue = rfvga_gain_table[vga_gain[ch_idx]];
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rfvalue);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rfvalue);
|
||||
@@ -618,19 +645,19 @@
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 0, 0x21);
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x0A, 0);
|
||||
+ rt2x00_dbg(rt2x00dev, "LOFT AGC %d %d\n", p0, p1);
|
||||
+ if ((p0 < 7000*7000) && (p1 < (7000*7000))) {
|
||||
+ if ((p0 < 7000 * 7000) && (p1 < (7000 * 7000)))
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 0, 0x00);
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 1, 0x00);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n",vga_gain[ch_idx], rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n", vga_gain[ch_idx],
|
||||
+ rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+
|
||||
+ if (vga_gain[ch_idx] < 0)
|
||||
+ vga_gain[ch_idx] = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ rfvalue = rfvga_gain_table[vga_gain[ch_idx]];
|
||||
+
|
||||
@@ -644,7 +671,7 @@
|
||||
+ for (rf_alc_idx = 0; rf_alc_idx < 3; rf_alc_idx++) {
|
||||
+ for (idx = 0; idx < 4; idx++) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0xB0);
|
||||
+ bbp = (idx<<2) + rf_alc_idx;
|
||||
+ bbp = (idx << 2) + rf_alc_idx;
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, bbp);
|
||||
+ rt2x00_dbg(rt2x00dev, " ALC %2x,", bbp);
|
||||
+
|
||||
@@ -705,8 +732,6 @@
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS2, orig52c);
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, mac13b8);
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "LOFT Calibration Done!\n");
|
||||
+
|
||||
+ savemacsysctrl = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macorg1 = rt2800_register_read(rt2x00dev, TX_PIN_CFG);
|
||||
+ macorg2 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
@@ -723,24 +748,16 @@
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macvalue &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x01)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF TX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macvalue &= (~0x08);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x02)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF RX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x00000101);
|
||||
@@ -776,9 +793,8 @@
|
||||
+
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, 0x00000010);
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++)
|
||||
+ rt2800_rf_configstore(rt2x00dev, rf_store, ch_idx);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, 0x3B);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, 0x3B);
|
||||
@@ -788,7 +804,7 @@
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0xB0);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x80);
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx ++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 23, 0x00);
|
||||
+ rt2800_bbp_write(rt2x00dev, 24, 0x00);
|
||||
+
|
||||
@@ -831,7 +847,7 @@
|
||||
+ count_step = 2;
|
||||
+ }
|
||||
+
|
||||
+ for (;vga_gain[ch_idx] < 19; vga_gain[ch_idx]=(vga_gain[ch_idx] + count_step)) {
|
||||
+ for (; vga_gain[ch_idx] < 19; vga_gain[ch_idx] = (vga_gain[ch_idx] + count_step)) {
|
||||
+ rfvalue = rfvga_gain_table[vga_gain[ch_idx]];
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rfvalue);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rfvalue);
|
||||
@@ -840,37 +856,35 @@
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x00);
|
||||
+ p0 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 0);
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags))
|
||||
+ p0_idx10 = rt2800_read_fft_accumulation(rt2x00dev, 0x0A);
|
||||
+ }
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? 0x29 : 0x47;
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x21);
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 0);
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags))
|
||||
+ p1_idx10 = rt2800_read_fft_accumulation(rt2x00dev, 0x0A);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "IQ AGC %d %d\n", p0, p1);
|
||||
+
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ rt2x00_dbg(rt2x00dev, "IQ AGC IDX 10 %d %d\n", p0_idx10, p1_idx10);
|
||||
+ if ((p0_idx10 > 7000*7000) || (p1_idx10 > 7000*7000)) {
|
||||
+ if (vga_gain[ch_idx]!=0)
|
||||
+ vga_gain[ch_idx] = vga_gain[ch_idx]-1;
|
||||
+ if ((p0_idx10 > 7000 * 7000) || (p1_idx10 > 7000 * 7000)) {
|
||||
+ if (vga_gain[ch_idx] != 0)
|
||||
+ vga_gain[ch_idx] = vga_gain[ch_idx] - 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ((p0 > 2500*2500) || (p1 > 2500*2500)) {
|
||||
+ if ((p0 > 2500 * 2500) || (p1 > 2500 * 2500))
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (vga_gain[ch_idx] > 18)
|
||||
+ vga_gain[ch_idx] = 18;
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n",vga_gain[ch_idx], rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n", vga_gain[ch_idx],
|
||||
+ rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? 0x29 : 0x47;
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
@@ -915,9 +929,8 @@
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 0, 39, rfb0r39);
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 0, 42, rfb0r42);
|
||||
+
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags))
|
||||
+ rt2800_bbp_write(rt2x00dev, 4, bbpr4);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 21, 0x01);
|
||||
+ udelay(1);
|
||||
@@ -935,16 +948,12 @@
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, macorg5);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl);
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, mac13b8);
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "TX IQ Calibration Done!\n");
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9691,6 +10628,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9653,6 +10554,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
@@ -963,11 +972,11 @@
|
||||
+#define RF_ALC_NUM 6
|
||||
+#define CHAIN_NUM 2
|
||||
+
|
||||
+typedef struct rf_reg_pair {
|
||||
+struct rf_reg_pair {
|
||||
+ u8 bank;
|
||||
+ u8 reg;
|
||||
+ u8 value;
|
||||
+} rf_reg_pair;
|
||||
+};
|
||||
|
||||
/* RT2800 driver data structure */
|
||||
struct rt2800_drv_data {
|
||||
@@ -0,0 +1,94 @@
|
||||
From patchwork Sat Sep 17 20:28:58 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979252
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:58 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 11/16] rt2x00: move helper functions up in file
|
||||
Message-ID:
|
||||
<c27baa8efd5c29e2bcb2432925d9cdc5c913a125.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Move register access helper functions up to the head of the file so
|
||||
they can be used in all functions.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 40 +++++++++----------
|
||||
1 file changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -198,6 +198,26 @@ static void rt2800_rfcsr_write_dccal(str
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 7, reg, value);
|
||||
}
|
||||
|
||||
+static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev,
|
||||
+ const u8 reg, const u8 value)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, value);
|
||||
+}
|
||||
+
|
||||
+static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
+ return rt2800_bbp_read(rt2x00dev, 159);
|
||||
+}
|
||||
+
|
||||
+static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev,
|
||||
+ const u8 reg, const u8 value)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, reg);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, value);
|
||||
+}
|
||||
+
|
||||
static u8 rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int word)
|
||||
{
|
||||
@@ -6947,26 +6967,6 @@ static void rt2800_init_bbp_5592(struct
|
||||
rt2800_bbp_write(rt2x00dev, 103, 0xc0);
|
||||
}
|
||||
|
||||
-static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev,
|
||||
- const u8 reg, const u8 value)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 195, reg);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, value);
|
||||
-}
|
||||
-
|
||||
-static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev,
|
||||
- const u8 reg, const u8 value)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
- rt2800_bbp_write(rt2x00dev, 159, value);
|
||||
-}
|
||||
-
|
||||
-static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
- return rt2800_bbp_read(rt2x00dev, 159);
|
||||
-}
|
||||
-
|
||||
static void rt2800_init_bbp_6352(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
u8 bbp;
|
||||
@@ -0,0 +1,56 @@
|
||||
From patchwork Sat Sep 17 20:29:13 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979253
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:13 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 12/16] rt2x00: fix HT20/HT40 bandwidth switch on MT7620
|
||||
Message-ID:
|
||||
<1664d89ba149f7b0bcec18b2a2abaedf49654507.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Add missing configuration of the channel bandwidth filter to the
|
||||
channel setup function for MT7620.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3855,6 +3855,14 @@ static void rt2800_config_channel_rf7620
|
||||
rfcsr |= tx_agc_fc;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr);
|
||||
}
|
||||
+
|
||||
+ if (conf_is_ht40(conf)) {
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10);
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f);
|
||||
+ } else {
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a);
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev,
|
||||
@@ -0,0 +1,52 @@
|
||||
From patchwork Sat Sep 17 20:29:26 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979254
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:26 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 13/16] rt2x00: set correct TX_SW_CFG1 MAC register for
|
||||
MT7620
|
||||
Message-ID:
|
||||
<4be38975ce600a34249e12d09a3cb758c6e71071.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Set correct TX_SW_CFG1 MAC register as it is done also in v3 of the
|
||||
vendor driver[1].
|
||||
|
||||
[1]: https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
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
|
||||
@@ -5966,7 +5966,7 @@ static int rt2800_init_registers(struct
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@@ -0,0 +1,50 @@
|
||||
From patchwork Sat Sep 17 20:29:40 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979255
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:40 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 14/16] rt2x00: set VGC gain for both chains of MT7620
|
||||
Message-ID:
|
||||
<29e161397e5c9d9399da0fe87d44458aa2b90a78.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Set bbp66 for all chains of the MT7620.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -5743,7 +5743,8 @@ static inline void rt2800_set_vgc(struct
|
||||
if (qual->vgc_level != vgc_level) {
|
||||
if (rt2x00_rt(rt2x00dev, RT3572) ||
|
||||
rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
- rt2x00_rt(rt2x00dev, RT3883)) {
|
||||
+ rt2x00_rt(rt2x00dev, RT3883) ||
|
||||
+ rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66,
|
||||
vgc_level);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5592)) {
|
||||
@@ -0,0 +1,70 @@
|
||||
From patchwork Sat Sep 17 20:29:55 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979256
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:55 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 15/16] rt2x00: set SoC wmac clock register
|
||||
Message-ID:
|
||||
<3e275d259f476f597dab91a9c395015ef3fe3284.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Instead of using the default value 33 (pci), set US_CYC_CNT init based
|
||||
on Programming guide:
|
||||
If available, set chipset bus clock with fallback to cpu clock/3.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 21 +++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -6229,6 +6229,27 @@ static int rt2800_init_registers(struct
|
||||
reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, 125);
|
||||
rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
+ } else if (rt2x00_is_soc(rt2x00dev)) {
|
||||
+ struct clk *clk = clk_get_sys("bus", NULL);
|
||||
+ int rate;
|
||||
+
|
||||
+ if (IS_ERR(clk)) {
|
||||
+ clk = clk_get_sys("cpu", NULL);
|
||||
+
|
||||
+ if (IS_ERR(clk)) {
|
||||
+ rate = 125;
|
||||
+ } else {
|
||||
+ rate = clk_get_rate(clk) / 3000000;
|
||||
+ clk_put(clk);
|
||||
+ }
|
||||
+ } else {
|
||||
+ rate = clk_get_rate(clk) / 1000000;
|
||||
+ clk_put(clk);
|
||||
+ }
|
||||
+
|
||||
+ reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
+ rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, rate);
|
||||
+ rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
}
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, HT_FBK_CFG0);
|
||||
@@ -0,0 +1,79 @@
|
||||
From patchwork Sat Sep 17 20:30:09 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979257
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id E9118ECAAA1
|
||||
for <linux-wireless@archiver.kernel.org>;
|
||||
Sat, 17 Sep 2022 20:30:22 +0000 (UTC)
|
||||
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||
id S229639AbiIQUaV (ORCPT
|
||||
<rfc822;linux-wireless@archiver.kernel.org>);
|
||||
Sat, 17 Sep 2022 16:30:21 -0400
|
||||
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53912 "EHLO
|
||||
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||
with ESMTP id S229628AbiIQUaT (ORCPT
|
||||
<rfc822;linux-wireless@vger.kernel.org>);
|
||||
Sat, 17 Sep 2022 16:30:19 -0400
|
||||
Received: from fudo.makrotopia.org (fudo.makrotopia.org
|
||||
[IPv6:2a07:2ec0:3002::71])
|
||||
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AEA822B27
|
||||
for <linux-wireless@vger.kernel.org>;
|
||||
Sat, 17 Sep 2022 13:30:16 -0700 (PDT)
|
||||
Received: from local
|
||||
by fudo.makrotopia.org with esmtpsa
|
||||
(TLS1.3:TLS_AES_256_GCM_SHA384:256)
|
||||
(Exim 4.96)
|
||||
(envelope-from <daniel@makrotopia.org>)
|
||||
id 1oZeS7-0003ra-0k;
|
||||
Sat, 17 Sep 2022 22:30:15 +0200
|
||||
Date: Sat, 17 Sep 2022 21:30:09 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 16/16] rt2x00: correctly set BBP register 86 for MT7620
|
||||
Message-ID:
|
||||
<257267247ee4fa7ebc6a5d0c4948b3f8119c0d77.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Instead of 0 set the correct value for BBP register 86 for MT7620.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -4225,7 +4225,10 @@ static void rt2800_config_channel(struct
|
||||
rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
|
||||
- rt2800_bbp_write(rt2x00dev, 86, 0);
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352))
|
||||
+ rt2800_bbp_write(rt2x00dev, 86, 0x38);
|
||||
+ else
|
||||
+ rt2800_bbp_write(rt2x00dev, 86, 0);
|
||||
}
|
||||
|
||||
if (rf->channel <= 14) {
|
||||
@@ -48,7 +48,7 @@
|
||||
obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
@@ -37,6 +37,8 @@ struct rt2800_drv_data {
|
||||
@@ -47,6 +47,8 @@ struct rt2800_drv_data {
|
||||
struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
|
||||
};
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
struct rt2800_ops {
|
||||
u32 (*register_read)(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset);
|
||||
@@ -135,6 +137,15 @@ static inline int rt2800_read_eeprom(str
|
||||
@@ -145,6 +147,15 @@ static inline int rt2800_read_eeprom(str
|
||||
{
|
||||
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
DECLARE_KFIFO_PTR(txstatus_fifo, u32);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1401,6 +1401,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
|
||||
@@ -1419,6 +1419,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
|
||||
INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
|
||||
INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep);
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
/*
|
||||
* Let the driver probe the device to detect the capabilities.
|
||||
*/
|
||||
@@ -1541,6 +1545,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
|
||||
@@ -1559,6 +1563,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
|
||||
* Free the driver data.
|
||||
*/
|
||||
kfree(rt2x00dev->drv_data);
|
||||
@@ -193,7 +193,7 @@
|
||||
+ if (pdata && pdata->eeprom_file_name)
|
||||
+ return pdata->eeprom_file_name;
|
||||
+
|
||||
+ return NULL
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "rt2x00.h"
|
||||
#include "rt2x00lib.h"
|
||||
@@ -34,11 +35,21 @@ static const char *
|
||||
@@ -34,10 +35,20 @@ static const char *
|
||||
rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
|
||||
@@ -20,14 +20,12 @@
|
||||
if (pdata && pdata->eeprom_file_name)
|
||||
return pdata->eeprom_file_name;
|
||||
|
||||
- return NULL
|
||||
+#ifdef CONFIG_OF
|
||||
+ np = rt2x00dev->dev->of_node;
|
||||
+ if (np && of_property_read_string(np, "ralink,eeprom", &eep) == 0)
|
||||
+ return eep;
|
||||
+#endif
|
||||
+
|
||||
+ return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "rt2x00.h"
|
||||
#include "rt2800lib.h"
|
||||
@@ -9549,6 +9550,17 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -11131,6 +11132,17 @@ static int rt2800_init_eeprom(struct rt2
|
||||
rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
|
||||
rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1340,7 +1340,7 @@ static inline void rt2x00lib_set_if_comb
|
||||
@@ -1358,7 +1358,7 @@ static inline void rt2x00lib_set_if_comb
|
||||
*/
|
||||
if_limit = &rt2x00dev->if_limits_ap;
|
||||
if_limit->max = rt2x00dev->ops->max_ap_intf;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Mon, 16 Dec 2019 20:47:06 +0100
|
||||
Subject: [PATCH] rt2x00: add throughput LED trigger
|
||||
|
||||
This adds a (currently missing) throughput LED trigger for the rt2x00
|
||||
driver. Previously, LED triggers had to be assigned to the netdev, which
|
||||
was limited to a single VAP.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
Tested-by: Christoph Krapp <achterin@googlemail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1125,6 +1125,19 @@ static void rt2x00lib_remove_hw(struct r
|
||||
kfree(rt2x00dev->spec.channels_info);
|
||||
}
|
||||
|
||||
+static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
|
||||
+ { .throughput = 0 * 1024, .blink_time = 334 },
|
||||
+ { .throughput = 1 * 1024, .blink_time = 260 },
|
||||
+ { .throughput = 2 * 1024, .blink_time = 220 },
|
||||
+ { .throughput = 5 * 1024, .blink_time = 190 },
|
||||
+ { .throughput = 10 * 1024, .blink_time = 170 },
|
||||
+ { .throughput = 25 * 1024, .blink_time = 150 },
|
||||
+ { .throughput = 54 * 1024, .blink_time = 130 },
|
||||
+ { .throughput = 120 * 1024, .blink_time = 110 },
|
||||
+ { .throughput = 265 * 1024, .blink_time = 80 },
|
||||
+ { .throughput = 586 * 1024, .blink_time = 50 },
|
||||
+};
|
||||
+
|
||||
static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct hw_mode_spec *spec = &rt2x00dev->spec;
|
||||
@@ -1206,6 +1219,10 @@ static int rt2x00lib_probe_hw(struct rt2
|
||||
|
||||
#undef RT2X00_TASKLET_INIT
|
||||
|
||||
+ ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
|
||||
+ IEEE80211_TPT_LEDTRIG_FL_RADIO, rt2x00_tpt_blink,
|
||||
+ ARRAY_SIZE(rt2x00_tpt_blink));
|
||||
+
|
||||
/*
|
||||
* Register HW.
|
||||
*/
|
||||
@@ -0,0 +1,161 @@
|
||||
From 0fce1109f894ec7fcd72cb098843a1eff786716a Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Fri, 16 Sep 2022 20:49:42 +0100
|
||||
Subject: [PATCH 16/16] rt2x00: import support for external LNA on MT7620
|
||||
To: linux-wireless@vger.kernel.org,
|
||||
Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
David S. Miller <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
In order to carry out calibration on boards with ePA or eLNA the PA pin
|
||||
needs to be switch to GPIO mode on MT7620. Implement that by selecting
|
||||
pinctrl state "pa_gpio" which should be defined for MT7620 boards with
|
||||
eLNA or ePA beside the "default" state.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 58 +++++++++++++++++++
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 5 ++
|
||||
.../net/wireless/ralink/rt2x00/rt2x00soc.c | 15 +++++
|
||||
3 files changed, 78 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -304,6 +304,24 @@ static void rt2800_rf_write(struct rt2x0
|
||||
mutex_unlock(&rt2x00dev->csr_mutex);
|
||||
}
|
||||
|
||||
+void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
|
||||
+{
|
||||
+ if (!rt2x00dev->pinctrl)
|
||||
+ return;
|
||||
+
|
||||
+ if (enable) {
|
||||
+ if (!rt2x00dev->pins_default)
|
||||
+ return;
|
||||
+
|
||||
+ pinctrl_select_state(rt2x00dev->pinctrl, rt2x00dev->pins_default);
|
||||
+ } else {
|
||||
+ if (!rt2x00dev->pins_pa_gpio)
|
||||
+ return;
|
||||
+
|
||||
+ pinctrl_select_state(rt2x00dev->pinctrl, rt2x00dev->pins_pa_gpio);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
|
||||
[EEPROM_CHIP_ID] = 0x0000,
|
||||
[EEPROM_VERSION] = 0x0001,
|
||||
@@ -4469,6 +4487,29 @@ static void rt2800_config_channel(struct
|
||||
rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN,
|
||||
0x6C6C6B6C);
|
||||
}
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
+
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
+
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in
|
||||
+ * config channel function in dependence of channel and
|
||||
+ * HT20/HT40 so don't touch it
|
||||
+ */
|
||||
+ }
|
||||
}
|
||||
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 4);
|
||||
@@ -10583,6 +10624,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 0);
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
@@ -10590,6 +10632,22 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
rt2800_loft_iq_calibration(rt2x00dev);
|
||||
rt2800_rxiq_calibration(rt2x00dev);
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 1);
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in config
|
||||
+ * channel function in dependence of channel and HT20/HT40,
|
||||
+ * so don't touch them here.
|
||||
+ */
|
||||
+ }
|
||||
}
|
||||
|
||||
static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <linux/average.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/clk.h>
|
||||
+#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/rt2x00_platform.h>
|
||||
|
||||
#include <net/mac80211.h>
|
||||
@@ -1029,6 +1030,11 @@ struct rt2x00_dev {
|
||||
|
||||
/* Clock for System On Chip devices. */
|
||||
struct clk *clk;
|
||||
+
|
||||
+ /* pinctrl and states for System On Chip devices with PA/LNA. */
|
||||
+ struct pinctrl *pinctrl;
|
||||
+ struct pinctrl_state *pins_default;
|
||||
+ struct pinctrl_state *pins_pa_gpio;
|
||||
};
|
||||
|
||||
struct rt2x00_bar_list_entry {
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
|
||||
@@ -97,6 +97,21 @@ int rt2x00soc_probe(struct platform_devi
|
||||
if (retval)
|
||||
goto exit_free_reg;
|
||||
|
||||
+ rt2x00dev->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||
+ if (IS_ERR(rt2x00dev->pinctrl)) {
|
||||
+ rt2x00dev->pinctrl = NULL;
|
||||
+ rt2x00dev->pins_default = NULL;
|
||||
+ rt2x00dev->pins_pa_gpio = NULL;
|
||||
+ } else {
|
||||
+ rt2x00dev->pins_default = pinctrl_lookup_state(rt2x00dev->pinctrl, "default");
|
||||
+ if (IS_ERR(rt2x00dev->pins_default))
|
||||
+ rt2x00dev->pins_default = NULL;
|
||||
+
|
||||
+ rt2x00dev->pins_pa_gpio = pinctrl_lookup_state(rt2x00dev->pinctrl, "pa_gpio");
|
||||
+ if (IS_ERR(rt2x00dev->pins_pa_gpio))
|
||||
+ rt2x00dev->pins_pa_gpio = NULL;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
|
||||
exit_free_reg:
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
@@ -1042,6 +1042,11 @@
|
||||
@@ -1044,6 +1044,11 @@
|
||||
#define MIMO_PS_CFG_RX_STBY_POL FIELD32(0x00000010)
|
||||
#define MIMO_PS_CFG_RX_RX_STBY0 FIELD32(0x00000020)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3698,14 +3698,16 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3778,14 +3778,16 @@ static void rt2800_config_channel_rf7620
|
||||
rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4);
|
||||
rt2800_rfcsr_write(rt2x00dev, 19, rfcsr);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
|
||||
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620,
|
||||
@@ -3739,18 +3741,23 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3819,18 +3821,23 @@ static void rt2800_config_channel_rf7620
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20);
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
|
||||
if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) {
|
||||
if (conf_is_ht40(conf)) {
|
||||
@@ -3850,25 +3857,29 @@ static void rt2800_config_alc(struct rt2
|
||||
if (i == 10000)
|
||||
rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n");
|
||||
@@ -3929,25 +3936,29 @@ static void rt2800_config_alc(struct rt2
|
||||
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
|
||||
|
||||
- if (chan->center_freq > 2457) {
|
||||
- bbp = rt2800_bbp_read(rt2x00dev, 30);
|
||||
@@ -121,12 +121,12 @@
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl);
|
||||
|
||||
rt2800_vco_calibration(rt2x00dev);
|
||||
@@ -5906,18 +5917,33 @@ static int rt2800_init_registers(struct
|
||||
@@ -6011,18 +6022,33 @@ static int rt2800_init_registers(struct
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5350)) {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
- rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
- rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@@ -150,7 +150,7 @@
|
||||
+ 0x00550055);
|
||||
+ } else {
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
+ rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@@ -167,7 +167,7 @@
|
||||
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1);
|
||||
rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg);
|
||||
@@ -7061,14 +7087,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
@@ -7127,14 +7153,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
rt2800_bbp_write(rt2x00dev, 188, 0x00);
|
||||
rt2800_bbp_write(rt2x00dev, 189, 0x00);
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
|
||||
/* BBP for G band GLRT function (BBP_128 ~ BBP_221) */
|
||||
rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00);
|
||||
@@ -10407,31 +10435,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10408,31 +10436,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write(rt2x00dev, 42, 0x5B);
|
||||
rt2800_rfcsr_write(rt2x00dev, 43, 0x00);
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
/* Initialize RF channel register to default value */
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03);
|
||||
@@ -10497,63 +10530,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10498,63 +10531,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5);
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
|
||||
/* Initialize RF DC calibration register to default value */
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47);
|
||||
@@ -10616,12 +10657,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10617,12 +10658,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00);
|
||||
|
||||
@@ -404,5 +404,5 @@
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
+ }
|
||||
|
||||
rt6352_enable_pa_pin(rt2x00dev, 0);
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
@@ -0,0 +1,38 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 26 Mar 2022 23:58:35 +0100
|
||||
Subject: [PATCH] mac80211: do not wake queues on a vif that is being stopped
|
||||
|
||||
When a vif is being removed and sdata->bss is cleared, __ieee80211_wake_txqs
|
||||
can still be called on it, which crashes as soon as sdata->bss is being
|
||||
dereferenced.
|
||||
To fix this properly, check for SDATA_STATE_RUNNING before waking queues,
|
||||
and take the fq lock when setting it (to ensure that __ieee80211_wake_txqs
|
||||
observes the change when running on a different CPU
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -377,7 +377,9 @@ static void ieee80211_do_stop(struct iee
|
||||
bool cancel_scan;
|
||||
struct cfg80211_nan_func *func;
|
||||
|
||||
+ spin_lock_bh(&local->fq.lock);
|
||||
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
|
||||
+ spin_unlock_bh(&local->fq.lock);
|
||||
|
||||
cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata;
|
||||
if (cancel_scan)
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -301,6 +301,9 @@ static void __ieee80211_wake_txqs(struct
|
||||
local_bh_disable();
|
||||
spin_lock(&fq->lock);
|
||||
|
||||
+ if (!test_bit(SDATA_STATE_RUNNING, &sdata->state))
|
||||
+ goto out;
|
||||
+
|
||||
if (sdata->vif.type == NL80211_IFTYPE_AP)
|
||||
ps = &sdata->bss->ps;
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From aa40d5a43526cca9439a2b45fcfdcd016594dece Mon Sep 17 00:00:00 2001
|
||||
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
|
||||
Date: Sun, 17 Jul 2022 21:21:52 +0900
|
||||
Subject: [PATCH] wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
lockdep complains use of uninitialized spinlock at ieee80211_do_stop() [1],
|
||||
for commit f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif
|
||||
that is being stopped") guards clear_bit() using fq.lock even before
|
||||
fq_init() from ieee80211_txq_setup_flows() initializes this spinlock.
|
||||
|
||||
According to discussion [2], Toke was not happy with expanding usage of
|
||||
fq.lock. Since __ieee80211_wake_txqs() is called under RCU read lock, we
|
||||
can instead use synchronize_rcu() for flushing ieee80211_wake_txqs().
|
||||
|
||||
Link: https://syzkaller.appspot.com/bug?extid=eceab52db7c4b961e9d6 [1]
|
||||
Link: https://lkml.kernel.org/r/874k0zowh2.fsf@toke.dk [2]
|
||||
Reported-by: syzbot <syzbot+eceab52db7c4b961e9d6@syzkaller.appspotmail.com>
|
||||
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
|
||||
Fixes: f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif that is being stopped")
|
||||
Tested-by: syzbot <syzbot+eceab52db7c4b961e9d6@syzkaller.appspotmail.com>
|
||||
Acked-by: Toke Høiland-Jørgensen <toke@kernel.org>
|
||||
Signed-off-by: Kalle Valo <kvalo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/9cc9b81d-75a3-3925-b612-9d0ad3cab82b@I-love.SAKURA.ne.jp
|
||||
[ pick up commit 3598cb6e1862 ("wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop()") from -next]
|
||||
Link: https://lore.kernel.org/all/87o7xcq6qt.fsf@kernel.org/
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
net/mac80211/iface.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -377,9 +377,8 @@ static void ieee80211_do_stop(struct iee
|
||||
bool cancel_scan;
|
||||
struct cfg80211_nan_func *func;
|
||||
|
||||
- spin_lock_bh(&local->fq.lock);
|
||||
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
|
||||
- spin_unlock_bh(&local->fq.lock);
|
||||
+ synchronize_rcu(); /* flush _ieee80211_wake_txqs() */
|
||||
|
||||
cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata;
|
||||
if (cancel_scan)
|
||||
@@ -0,0 +1,40 @@
|
||||
From: Alexander Wetzel <alexander@wetzel-home.de>
|
||||
Date: Thu, 15 Sep 2022 14:41:20 +0200
|
||||
Subject: [PATCH] mac80211: Fix deadlock: Don't start TX while holding
|
||||
fq->lock
|
||||
|
||||
ieee80211_txq_purge() calls fq_tin_reset() and
|
||||
ieee80211_purge_tx_queue(); Both are then calling
|
||||
ieee80211_free_txskb(). Which can decide to TX the skb again.
|
||||
|
||||
There are at least two ways to get a deadlock:
|
||||
|
||||
1) When we have a TDLS teardown packet queued in either tin or frags
|
||||
ieee80211_tdls_td_tx_handle() will call ieee80211_subif_start_xmit()
|
||||
while we still hold fq->lock. ieee80211_txq_enqueue() will thus
|
||||
deadlock.
|
||||
|
||||
2) A variant of the above happens if aggregation is up and running:
|
||||
In that case ieee80211_iface_work() will deadlock with the original
|
||||
task: The original tasks already holds fq->lock and tries to get
|
||||
sta->lock after kicking off ieee80211_iface_work(). But the worker
|
||||
can get sta->lock prior to the original task and will then spin for
|
||||
fq->lock.
|
||||
|
||||
Avoid these deadlocks by not sending out any skbs when called via
|
||||
ieee80211_free_txskb().
|
||||
|
||||
Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/status.c
|
||||
+++ b/net/mac80211/status.c
|
||||
@@ -698,7 +698,7 @@ static void ieee80211_report_used_skb(st
|
||||
|
||||
if (!sdata) {
|
||||
skb->dev = NULL;
|
||||
- } else {
|
||||
+ } else if (!dropped) {
|
||||
unsigned int hdr_size =
|
||||
ieee80211_hdrlen(hdr->frame_control);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From: Alexander Wetzel <alexander@wetzel-home.de>
|
||||
Date: Thu, 15 Sep 2022 15:09:46 +0200
|
||||
Subject: [PATCH] mac80211: Ensure vif queues are operational after start
|
||||
|
||||
Make sure local->queue_stop_reasons and vif.txqs_stopped stay in sync.
|
||||
|
||||
When a new vif is created the queues may end up in an inconsistent state
|
||||
and be inoperable:
|
||||
Communication not using iTXQ will work, allowing to e.g. complete the
|
||||
association. But the 4-way handshake will time out. The sta will not
|
||||
send out any skbs queued in iTXQs.
|
||||
|
||||
All normal attempts to start the queues will fail when reaching this
|
||||
state.
|
||||
local->queue_stop_reasons will have marked all queues as operational but
|
||||
vif.txqs_stopped will still be set, creating an inconsistent internal
|
||||
state.
|
||||
|
||||
In reality this seems to be race between the mac80211 function
|
||||
ieee80211_do_open() setting SDATA_STATE_RUNNING and the wake_txqs_tasklet:
|
||||
Depending on the driver and the timing the queues may end up to be
|
||||
operational or not.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: f856373e2f31 ("wifi: mac80211: do not wake queues on a vif that is being stopped")
|
||||
Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -301,14 +301,14 @@ static void __ieee80211_wake_txqs(struct
|
||||
local_bh_disable();
|
||||
spin_lock(&fq->lock);
|
||||
|
||||
+ sdata->vif.txqs_stopped[ac] = false;
|
||||
+
|
||||
if (!test_bit(SDATA_STATE_RUNNING, &sdata->state))
|
||||
goto out;
|
||||
|
||||
if (sdata->vif.type == NL80211_IFTYPE_AP)
|
||||
ps = &sdata->bss->ps;
|
||||
|
||||
- sdata->vif.txqs_stopped[ac] = false;
|
||||
-
|
||||
list_for_each_entry_rcu(sta, &local->sta_list, list) {
|
||||
if (sdata != sta->sdata)
|
||||
continue;
|
||||
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-08-26
|
||||
PKG_SOURCE_VERSION:=5ec78e1ec43d1e39edfea1efb9fd4541fa004af0
|
||||
PKG_MIRROR_HASH:=b96ec5199d423dc27e4fe7f0e94c8d5970f6db812237816235f3b735a5cb216a
|
||||
PKG_SOURCE_DATE:=2022-09-06
|
||||
PKG_SOURCE_VERSION:=d70546462b7b51ebc2bcdd5c534fdf3465be62a4
|
||||
PKG_MIRROR_HASH:=3d6b68d70a78c0072ed10ab2548344b6b3a70ad99e4edc258fafa16886f4abf9
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ustream-ssl
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wolfssl
|
||||
PKG_VERSION:=5.4.0-stable
|
||||
PKG_VERSION:=5.5.1-stable
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=dc36cc19dad197253e5c2ecaa490c7eef579ad448706e55d73d79396e814098b
|
||||
PKG_HASH:=97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3
|
||||
|
||||
PKG_FIXUP:=libtool libtool-abiver
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/wolfssl/wolfcrypt/settings.h
|
||||
+++ b/wolfssl/wolfcrypt/settings.h
|
||||
@@ -2442,7 +2442,7 @@ extern void uITRON4_free(void *p) ;
|
||||
@@ -2454,7 +2454,7 @@ extern void uITRON4_free(void *p) ;
|
||||
#endif
|
||||
|
||||
/* warning for not using harden build options (default with ./configure) */
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From dc92ec2aa9cb76b782bdba3fc5203267ebf39994 Mon Sep 17 00:00:00 2001
|
||||
From: Kareem <kareem@wolfssl.com>
|
||||
Date: Fri, 22 Jul 2022 11:07:46 -0700
|
||||
Subject: [PATCH] Update sp_rand_prime's preprocessor gating to match
|
||||
wolfSSL_BN_generate_prime_ex's.
|
||||
|
||||
---
|
||||
wolfcrypt/src/sp_int.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/wolfcrypt/src/sp_int.c
|
||||
+++ b/wolfcrypt/src/sp_int.c
|
||||
@@ -15647,8 +15647,8 @@ int sp_radix_size(sp_int* a, int radix,
|
||||
* Prime number generation and checking.
|
||||
***************************************/
|
||||
|
||||
-#if defined(WOLFSSL_KEY_GEN) && (!defined(NO_DH) || !defined(NO_DSA)) && \
|
||||
- !defined(WC_NO_RNG)
|
||||
+#if defined(WOLFSSL_KEY_GEN) && (!defined(NO_RSA) || !defined(NO_DH) || \
|
||||
+ !defined(NO_DSA)) && !defined(WC_NO_RNG)
|
||||
/* Generate a random prime for RSA only.
|
||||
*
|
||||
* @param [out] r SP integer to hold result.
|
||||
@@ -11,7 +11,7 @@ RNG regardless of the built settings for wolfssl.
|
||||
|
||||
--- a/wolfcrypt/src/ecc.c
|
||||
+++ b/wolfcrypt/src/ecc.c
|
||||
@@ -12288,21 +12288,21 @@ void wc_ecc_fp_free(void)
|
||||
@@ -12505,21 +12505,21 @@ void wc_ecc_fp_free(void)
|
||||
|
||||
#endif /* FP_ECC */
|
||||
|
||||
@@ -37,7 +37,7 @@ RNG regardless of the built settings for wolfssl.
|
||||
|
||||
--- a/wolfssl/wolfcrypt/ecc.h
|
||||
+++ b/wolfssl/wolfcrypt/ecc.h
|
||||
@@ -650,10 +650,8 @@ WOLFSSL_API
|
||||
@@ -656,10 +656,8 @@ WOLFSSL_ABI WOLFSSL_API
|
||||
void wc_ecc_fp_free(void);
|
||||
WOLFSSL_LOCAL
|
||||
void wc_ecc_fp_init(void);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_RELEASE:=$(AUTORELEASE).1
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
@@ -361,7 +361,7 @@ hostapd_common_add_bss_config() {
|
||||
config_add_array airtime_sta_weight
|
||||
config_add_int airtime_bss_weight airtime_bss_limit
|
||||
|
||||
config_add_boolean multicast_to_unicast proxy_arp per_sta_vif
|
||||
config_add_boolean multicast_to_unicast multicast_to_unicast_all proxy_arp per_sta_vif
|
||||
|
||||
config_add_array hostapd_bss_options
|
||||
config_add_boolean default_disabled
|
||||
@@ -545,7 +545,7 @@ hostapd_set_bss_options() {
|
||||
bss_load_update_period chan_util_avg_period sae_require_mfp sae_pwe \
|
||||
multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
|
||||
airtime_bss_weight airtime_bss_limit airtime_sta_weight \
|
||||
multicast_to_unicast proxy_arp per_sta_vif \
|
||||
multicast_to_unicast_all proxy_arp per_sta_vif \
|
||||
eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \
|
||||
vendor_elements fils
|
||||
|
||||
@@ -1096,9 +1096,9 @@ hostapd_set_bss_options() {
|
||||
[ -n "$server_id" ] && append bss_conf "server_id=$server_id" "$N"
|
||||
fi
|
||||
|
||||
set_default multicast_to_unicast 0
|
||||
if [ "$multicast_to_unicast" -gt 0 ]; then
|
||||
append bss_conf "multicast_to_unicast=$multicast_to_unicast" "$N"
|
||||
set_default multicast_to_unicast_all 0
|
||||
if [ "$multicast_to_unicast_all" -gt 0 ]; then
|
||||
append bss_conf "multicast_to_unicast=$multicast_to_unicast_all" "$N"
|
||||
fi
|
||||
set_default proxy_arp 0
|
||||
if [ "$proxy_arp" -gt 0 ]; then
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=px5g-wolfssl
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_RELEASE:=$(COMMITCOUNT).1
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uencrypt
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
|
||||
17
rules.mk
17
rules.mk
@@ -208,7 +208,6 @@ ifndef DUMP
|
||||
ifneq ($(TOOLCHAIN_LIB_DIRS),)
|
||||
TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS))
|
||||
endif
|
||||
TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -243,20 +242,13 @@ HOST_CXXFLAGS:=
|
||||
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
|
||||
HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
|
||||
|
||||
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||
TARGET_AR:=$(TARGET_CROSS)gcc-ar
|
||||
TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
|
||||
TARGET_NM:=$(TARGET_CROSS)gcc-nm
|
||||
else
|
||||
TARGET_AR:=$(TARGET_CROSS)ar
|
||||
TARGET_RANLIB:=$(TARGET_CROSS)ranlib
|
||||
TARGET_NM:=$(TARGET_CROSS)nm
|
||||
endif
|
||||
|
||||
BUILD_KEY=$(TOPDIR)/key-build
|
||||
|
||||
FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
|
||||
|
||||
TARGET_AR:=$(TARGET_CROSS)gcc-ar
|
||||
TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
|
||||
TARGET_NM:=$(TARGET_CROSS)gcc-nm
|
||||
TARGET_CC:=$(TARGET_CROSS)gcc
|
||||
TARGET_CXX:=$(TARGET_CROSS)g++
|
||||
KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh
|
||||
@@ -265,6 +257,9 @@ ESED:=$(STAGING_DIR_HOST)/bin/sed -E -i -e
|
||||
MKHASH:=$(STAGING_DIR_HOST)/bin/mkhash
|
||||
# MKHASH is used in /scripts, so we export it here.
|
||||
export MKHASH
|
||||
# DOWNLOAD_CHECK_CERTIFICATE is used in /scripts, so we export it here.
|
||||
DOWNLOAD_CHECK_CERTIFICATE:=$(CONFIG_DOWNLOAD_CHECK_CERTIFICATE)
|
||||
export DOWNLOAD_CHECK_CERTIFICATE
|
||||
CP:=cp -fpR
|
||||
LN:=ln -sf
|
||||
XARGS:=xargs -r
|
||||
|
||||
@@ -24,6 +24,8 @@ my $scriptdir = dirname($0);
|
||||
my @mirrors;
|
||||
my $ok;
|
||||
|
||||
my $check_certificate = $ENV{DOWNLOAD_CHECK_CERTIFICATE} eq "y";
|
||||
|
||||
$url_filename or $url_filename = $filename;
|
||||
|
||||
sub localmirrors {
|
||||
@@ -72,7 +74,7 @@ sub download_cmd($) {
|
||||
my $url = shift;
|
||||
my $have_curl = 0;
|
||||
|
||||
if (open CURL, '-|', 'curl', '--version') {
|
||||
if (open CURL, "curl --version 2>/dev/null |") {
|
||||
if (defined(my $line = readline CURL)) {
|
||||
$have_curl = 1 if $line =~ /^curl /;
|
||||
}
|
||||
@@ -80,8 +82,14 @@ sub download_cmd($) {
|
||||
}
|
||||
|
||||
return $have_curl
|
||||
? (qw(curl -f --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url)
|
||||
: (qw(wget --tries=5 --timeout=20 --no-check-certificate --output-document=-), shellwords($ENV{WGET_OPTIONS} || ''), $url)
|
||||
? (qw(curl -f --connect-timeout 20 --retry 5 --location),
|
||||
$check_certificate ? () : '--insecure',
|
||||
shellwords($ENV{CURL_OPTIONS} || ''),
|
||||
$url)
|
||||
: (qw(wget --tries=5 --timeout=20 --output-document=-),
|
||||
$check_certificate ? () : '--no-check-certificate',
|
||||
shellwords($ENV{WGET_OPTIONS} || ''),
|
||||
$url)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ BIN_SPECS="
|
||||
gdbserver: gdbserver
|
||||
"
|
||||
|
||||
OVERWRITE_CONFIG=""
|
||||
|
||||
test_c() {
|
||||
cat <<-EOT | "${CC:-false}" $CFLAGS -o /dev/null -x c - 2>/dev/null
|
||||
@@ -281,8 +282,11 @@ print_config() {
|
||||
local mksubtarget
|
||||
|
||||
local target="$("$CC" $CFLAGS -dumpmachine)"
|
||||
local version="$("$CC" $CFLAGS -dumpversion)"
|
||||
local cpuarch="${target%%-*}"
|
||||
local prefix="${CC##*/}"; prefix="${prefix%-*}-"
|
||||
|
||||
# get CC; strip version; strip gcc and add - suffix
|
||||
local prefix="${CC##*/}"; prefix="${prefix%-$version}"; prefix="${prefix%-*}-"
|
||||
local config="${0%/scripts/*}/.config"
|
||||
|
||||
# if no target specified, print choice list and exit
|
||||
@@ -317,9 +321,13 @@ print_config() {
|
||||
fi
|
||||
|
||||
# bail out if there is a .config already
|
||||
if [ -f "${0%/scripts/*}/.config" ]; then
|
||||
echo "There already is a .config file, refusing to overwrite!" >&2
|
||||
return 1
|
||||
if [ -f "$config" ]; then
|
||||
if [ "$OVERWRITE_CONFIG" == "" ]; then
|
||||
echo "There already is a .config file, refusing to overwrite!" >&2
|
||||
return 1
|
||||
else
|
||||
echo "There already is a .config file, trying to overwrite!"
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$mktarget" in */*)
|
||||
@@ -327,8 +335,11 @@ print_config() {
|
||||
mktarget="${mktarget%/*}"
|
||||
;; esac
|
||||
|
||||
if [ ! -f "$config" ]; then
|
||||
touch "$config"
|
||||
fi
|
||||
|
||||
echo "CONFIG_TARGET_${mktarget}=y" > "$config"
|
||||
echo "CONFIG_TARGET_${mktarget}=y" >> "$config"
|
||||
|
||||
if [ -n "$mksubtarget" ]; then
|
||||
echo "CONFIG_TARGET_${mktarget}_${mksubtarget}=y" >> "$config"
|
||||
@@ -358,8 +369,18 @@ print_config() {
|
||||
echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config"
|
||||
echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config"
|
||||
|
||||
if [ "$LIBC_TYPE" != glibc ]; then
|
||||
echo "CONFIG_TOOLCHAIN_LIBC=\"$LIBC_TYPE\"" >> "$config"
|
||||
if [ -f "$config" ]; then
|
||||
sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL/d' "$config"
|
||||
sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC/d' "$config"
|
||||
fi
|
||||
|
||||
if [ "$LIBC_TYPE" == glibc ]; then
|
||||
echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC=y" >> "$config"
|
||||
elif [ "$LIBC_TYPE" == musl ]; then
|
||||
echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL=y" >> "$config"
|
||||
else
|
||||
echo "Can't detect LIBC type. Aborting!" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local lib
|
||||
@@ -452,6 +473,13 @@ probe_cpp() {
|
||||
}
|
||||
|
||||
probe_libc() {
|
||||
if [ -f $TOOLCHAIN/info.mk ]; then
|
||||
LIBC_TYPE=$(grep LIBC_TYPE $TOOLCHAIN/info.mk | sed 's/LIBC_TYPE=//')
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Warning! Can't find info.mk, trying to detect with alternative way."
|
||||
|
||||
if [ -z "$LIBC_TYPE" ]; then
|
||||
if test_uclibc; then
|
||||
LIBC_TYPE="uclibc"
|
||||
@@ -529,8 +557,13 @@ while [ -n "$1" ]; do
|
||||
exit $?
|
||||
;;
|
||||
|
||||
--overwrite-config)
|
||||
OVERWRITE_CONFIG=y
|
||||
;;
|
||||
|
||||
--config)
|
||||
if probe_cc; then
|
||||
probe_libc
|
||||
print_config "$1"
|
||||
exit $?
|
||||
fi
|
||||
@@ -570,6 +603,8 @@ while [ -n "$1" ]; do
|
||||
echo -e " is used to specify C flags to be passed to the " >&2
|
||||
echo -e " cross compiler when performing tests." >&2
|
||||
echo -e " This parameter may be repeated multiple times." >&2
|
||||
echo -e " Use --overwrite-config before --config to overwrite" >&2
|
||||
echo -e " an already present config with the required changes.">&2
|
||||
exit 1
|
||||
;;
|
||||
|
||||
|
||||
66
scripts/xxdi.pl
Executable file
66
scripts/xxdi.pl
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# xxdi.pl - perl implementation of 'xxd -i' mode
|
||||
#
|
||||
# Copyright 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
# Copyright 2013 Linux Foundation
|
||||
#
|
||||
# Released under the GPLv2.
|
||||
#
|
||||
# Implements the "basic" functionality of 'xxd -i' in perl to keep build
|
||||
# systems from having to build/install/rely on vim-core, which not all
|
||||
# distros want to do. But everyone has perl, so use it instead.
|
||||
#
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $indata;
|
||||
my $var_name = "stdin";
|
||||
my $full_output = (@ARGV > 0 && $ARGV[0] eq '-i') ? shift @ARGV : undef;
|
||||
|
||||
{
|
||||
local $/;
|
||||
my $fh;
|
||||
|
||||
if (@ARGV) {
|
||||
$var_name = $ARGV[0];
|
||||
open($fh, '<:raw', $var_name) || die("xxdi.pl: Unable to open $var_name: $!\n");
|
||||
} elsif (! -t STDIN) {
|
||||
$fh = \*STDIN;
|
||||
undef $full_output;
|
||||
} else {
|
||||
die "usage: xxdi.pl [-i] [infile]\n";
|
||||
}
|
||||
|
||||
$indata = readline $fh;
|
||||
|
||||
close $fh;
|
||||
}
|
||||
|
||||
my $len_data = length($indata);
|
||||
my $num_digits_per_line = 12;
|
||||
my $outdata = "";
|
||||
|
||||
# Use the variable name of the file we read from, converting '/' and '.
|
||||
# to '_', or, if this is stdin, just use "stdin" as the name.
|
||||
$var_name =~ s/\//_/g;
|
||||
$var_name =~ s/\./_/g;
|
||||
$var_name = "__$var_name" if $var_name =~ /^\d/;
|
||||
|
||||
$outdata = "unsigned char $var_name\[] = { " if $full_output;
|
||||
|
||||
for (my $key= 0; $key < $len_data; $key++) {
|
||||
if ($key % $num_digits_per_line == 0) {
|
||||
$outdata = substr($outdata, 0, -1)."\n ";
|
||||
}
|
||||
$outdata .= sprintf("0x%.2x, ", ord(substr($indata, $key, 1)));
|
||||
}
|
||||
|
||||
$outdata = substr($outdata, 0, -2);
|
||||
$outdata .= "\n";
|
||||
|
||||
$outdata .= "};\nunsigned int $var_name\_len = $len_data;\n" if $full_output;
|
||||
|
||||
binmode STDOUT;
|
||||
print $outdata;
|
||||
@@ -8,4 +8,4 @@ include $(INCLUDE_DIR)/target.mk
|
||||
export TARGET_BUILD=1
|
||||
|
||||
prereq clean download prepare compile install oldconfig menuconfig nconfig xconfig update refresh: FORCE
|
||||
@+$(NO_TRACE_MAKE) -C $(BOARD) $@
|
||||
@+$(NO_TRACE_MAKE) -C $(firstword $(wildcard feeds/$(BOARD) $(BOARD))) $@
|
||||
|
||||
@@ -23,7 +23,7 @@ produce a noisy warning.
|
||||
xhci->quirks |= XHCI_RESET_ON_RESUME;
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -425,10 +425,14 @@ static int xhci_try_enable_msi(struct us
|
||||
@@ -427,10 +427,14 @@ static int xhci_try_enable_msi(struct us
|
||||
free_irq(hcd->irq, hcd);
|
||||
hcd->irq = 0;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
|
||||
--- a/drivers/regulator/core.c
|
||||
+++ b/drivers/regulator/core.c
|
||||
@@ -2987,7 +2987,8 @@ static int _regulator_list_voltage(struc
|
||||
@@ -2992,7 +2992,8 @@ static int _regulator_list_voltage(struc
|
||||
return rdev->desc->fixed_uV;
|
||||
|
||||
if (ops->list_voltage) {
|
||||
@@ -30,7 +30,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
return -EINVAL;
|
||||
if (lock)
|
||||
regulator_lock(rdev);
|
||||
@@ -3138,7 +3139,8 @@ int regulator_list_hardware_vsel(struct
|
||||
@@ -3143,7 +3144,8 @@ int regulator_list_hardware_vsel(struct
|
||||
struct regulator_dev *rdev = regulator->rdev;
|
||||
const struct regulator_ops *ops = rdev->desc->ops;
|
||||
|
||||
@@ -40,7 +40,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
return -EINVAL;
|
||||
if (ops->set_voltage_sel != regulator_set_voltage_sel_regmap)
|
||||
return -EOPNOTSUPP;
|
||||
@@ -4061,6 +4063,9 @@ int regulator_set_voltage_time(struct re
|
||||
@@ -4066,6 +4068,9 @@ int regulator_set_voltage_time(struct re
|
||||
|
||||
for (i = 0; i < rdev->desc->n_voltages; i++) {
|
||||
/* We only look for exact voltage matches here */
|
||||
|
||||
@@ -14,7 +14,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
|
||||
--- a/drivers/regulator/core.c
|
||||
+++ b/drivers/regulator/core.c
|
||||
@@ -4066,6 +4066,9 @@ int regulator_set_voltage_time(struct re
|
||||
@@ -4071,6 +4071,9 @@ int regulator_set_voltage_time(struct re
|
||||
if (i < rdev->desc->linear_min_sel)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
|
||||
--- a/drivers/regulator/core.c
|
||||
+++ b/drivers/regulator/core.c
|
||||
@@ -2987,9 +2987,10 @@ static int _regulator_list_voltage(struc
|
||||
@@ -2992,9 +2992,10 @@ static int _regulator_list_voltage(struc
|
||||
return rdev->desc->fixed_uV;
|
||||
|
||||
if (ops->list_voltage) {
|
||||
@@ -34,7 +34,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
if (lock)
|
||||
regulator_lock(rdev);
|
||||
ret = ops->list_voltage(rdev, selector);
|
||||
@@ -3139,9 +3140,10 @@ int regulator_list_hardware_vsel(struct
|
||||
@@ -3144,9 +3145,10 @@ int regulator_list_hardware_vsel(struct
|
||||
struct regulator_dev *rdev = regulator->rdev;
|
||||
const struct regulator_ops *ops = rdev->desc->ops;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
||||
|
||||
--- a/drivers/clk/clk.c
|
||||
+++ b/drivers/clk/clk.c
|
||||
@@ -3106,7 +3106,10 @@ static int clk_rate_get(void *data, u64
|
||||
@@ -3105,7 +3105,10 @@ static int clk_rate_get(void *data, u64
|
||||
{
|
||||
struct clk_core *core = data;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
/ {
|
||||
compatible = "extreme-networks,ws-ap3805i", "qca,qca9557";
|
||||
model = "Extreme Networks AP3805i";
|
||||
model = "Extreme Networks WS-AP3805i";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_power_green;
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
pinctrl-names = "default";
|
||||
/* GPIO1 (poe_pass) and GPIO2 (watchdog) requires jtag disabled */
|
||||
pinctrl-0 = <&jtag_disable_pins>;
|
||||
|
||||
reset {
|
||||
label = "Reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
|
||||
275
target/linux/ath79/dts/qca9563_zte_mf281.dts
Normal file
275
target/linux/ath79/dts/qca9563_zte_mf281.dts
Normal file
@@ -0,0 +1,275 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
// Copyright (c) 2021 Cezary Jackiewicz
|
||||
// Copyright (c) 2021, 2022 Lech Perczak
|
||||
// Copyright (c) 2022 David Bauer <mail@david-bauer.net>
|
||||
|
||||
#include "qca956x.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
model = "ZTE MF281";
|
||||
compatible = "zte,mf281", "qca,qca9563";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_debug;
|
||||
led-failsafe = &led_debug;
|
||||
led-running = &led_debug;
|
||||
led-upgrade = &led_debug;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&enable_wlan_led_gpio>;
|
||||
|
||||
/* Hidden SMD LED below signal strength LEDs.
|
||||
* Visible through slits underside of the case.
|
||||
*/
|
||||
led_debug: debug {
|
||||
label = "green:debug";
|
||||
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
/* This GPIO is used to reset whole board _including_ the modem */
|
||||
gpio-restart {
|
||||
compatible = "gpio-restart";
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
active-delay = <3000>;
|
||||
inactive-delay = <1000>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0xa0000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@80000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0xa0000 0x20000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flash@1 {
|
||||
compatible = "spi-nand";
|
||||
reg = <1>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "fota-flag";
|
||||
reg = <0x000000 0xa0000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a0000 {
|
||||
label = "art";
|
||||
reg = <0xa0000 0x80000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_caldata_1000: cal@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
cal_caldata_5000: cal@5000 {
|
||||
reg = <0x5000 0x2f20>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@120000 {
|
||||
label = "mac";
|
||||
reg = <0x120000 0x80000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_mac_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@1a0000 {
|
||||
label = "reserved2";
|
||||
reg = <0x1a0000 0xc0000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@260000 {
|
||||
label = "cfg-param";
|
||||
reg = <0x260000 0x400000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@660000 {
|
||||
label = "log";
|
||||
reg = <0x660000 0x400000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a60000 {
|
||||
label = "oops";
|
||||
reg = <0xa60000 0xa0000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@b00000 {
|
||||
label = "reserved3";
|
||||
reg = <0xb00000 0x500000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@1000000 {
|
||||
label = "web";
|
||||
reg = <0x1000000 0x800000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@1800000 {
|
||||
label = "firmware";
|
||||
reg = <0x1800000 0x1d00000>;
|
||||
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "kernel";
|
||||
reg = <0x0 0x600000>;
|
||||
};
|
||||
|
||||
partition@600000 {
|
||||
label = "ubi";
|
||||
reg = <0x600000 0x1700000>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@3500000 {
|
||||
label = "data";
|
||||
reg = <0x3500000 0x1900000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@4e00000 {
|
||||
label = "fota";
|
||||
reg = <0x4e00000 0x3200000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
phy-mode = "sgmii";
|
||||
|
||||
qca,ar8327-initvals = <
|
||||
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
|
||||
0x7c 0x0000007e /* PORT0_STATUS */
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
phy-mode = "sgmii";
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
nvmem-cells = <&macaddr_mac_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
|
||||
wifi@0,0 {
|
||||
compatible = "qcom,ath10k";
|
||||
reg = <0x0 0 0 0 0>;
|
||||
|
||||
nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>;
|
||||
nvmem-cell-names = "mac-address", "pre-calibration";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinmux {
|
||||
enable_wlan_led_gpio: pinmux_wlan_led_gpio {
|
||||
pinctrl-single,bits = <0x10 0x0 0xff000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
};
|
||||
|
||||
&usb_phy0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -432,19 +432,11 @@ ubnt,powerbeam-5ac-gen2)
|
||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "blue:rssi2" "wlan0" "51" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "blue:rssi3" "wlan0" "76" "100"
|
||||
;;
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,bullet-m-xw|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-loco-m-xw|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,nanostation-m-xw|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbeam-m2-xw|\
|
||||
ubnt,powerbeam-m5-xw|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m)
|
||||
ubnt,powerbeam-m5-xw)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "RSSILOW" "red:link1" "wlan0" "1" "100"
|
||||
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "orange:link2" "wlan0" "26" "100"
|
||||
|
||||
@@ -89,25 +89,18 @@ ath79_setup_interfaces()
|
||||
tplink,tl-wa1201-v2|\
|
||||
tplink,tl-wr902ac-v1|\
|
||||
ubnt,bullet-ac|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,bullet-m-xw|\
|
||||
ubnt,lap-120|\
|
||||
ubnt,litebeam-ac-gen2|\
|
||||
ubnt,nanobeam-ac|\
|
||||
ubnt,nanobeam-ac-xc|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-ac-loco|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-loco-m-xw|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbeam-5ac-500|\
|
||||
ubnt,powerbeam-5ac-gen2|\
|
||||
ubnt,powerbeam-m2-xw|\
|
||||
ubnt,powerbeam-m5-xw|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-5ac-lite|\
|
||||
ubnt,rocket-m|\
|
||||
ubnt,unifiac-lite|\
|
||||
ubnt,unifiac-lr|\
|
||||
ubnt,unifiac-mesh|\
|
||||
@@ -177,8 +170,7 @@ ath79_setup_interfaces()
|
||||
tplink,archer-c60-v3|\
|
||||
tplink,tl-wdr3500-v1|\
|
||||
tplink,tl-wr842n-v1|\
|
||||
tplink,tl-wr842n-v3|\
|
||||
ubnt,airrouter)
|
||||
tplink,tl-wr842n-v3)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
@@ -213,7 +205,6 @@ ath79_setup_interfaces()
|
||||
tplink,wbs210-v2|\
|
||||
tplink,wbs510-v1|\
|
||||
tplink,wbs510-v2|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,routerstation)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
@@ -713,15 +704,6 @@ ath79_setup_macs()
|
||||
wan_mac=$(mtd_get_mac_text mac 0x18)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m|\
|
||||
ubnt,unifi)
|
||||
label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
|
||||
;;
|
||||
|
||||
@@ -119,16 +119,7 @@ case "$FIRMWARE" in
|
||||
netgear,wnr2200-16m|\
|
||||
pcs,cap324|\
|
||||
tplink,tl-wr2543-v1|\
|
||||
tplink,tl-wr842n-v1|\
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m)
|
||||
tplink,tl-wr842n-v1)
|
||||
caldata_extract "art" 0x1000 0x1000
|
||||
;;
|
||||
openmesh,mr600-v1|\
|
||||
|
||||
@@ -97,6 +97,7 @@ endif
|
||||
ifeq ($(SUBTARGET),tiny)
|
||||
include tiny-netgear.mk
|
||||
include tiny-tp-link.mk
|
||||
include tiny-ubnt.mk
|
||||
endif
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
|
||||
142
target/linux/ath79/image/common-ubnt.mk
Normal file
142
target/linux/ath79/image/common-ubnt.mk
Normal file
@@ -0,0 +1,142 @@
|
||||
DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE UBNT_VERSION UBNT_REVISION
|
||||
|
||||
# On M (XW) devices the U-Boot as of version 1.1.4-s1039 doesn't like
|
||||
# VERSION_DIST being on the place of major(?) version number, so we need to
|
||||
# use some number.
|
||||
UBNT_REVISION := $(VERSION_DIST)-$(REVISION)
|
||||
|
||||
# mkubntimage is using the kernel image direct
|
||||
# routerboard creates partitions out of the ubnt header
|
||||
define Build/mkubntimage
|
||||
-$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
|
||||
-v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
|
||||
-k $(IMAGE_KERNEL) -r $@ -o $@
|
||||
endef
|
||||
|
||||
define Build/mkubntimage2
|
||||
-$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
|
||||
-v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
|
||||
-p jffs2:0x50000:0xf60000:0:0:$@ \
|
||||
-o $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
# all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
|
||||
# booting the image, the size doesn't matter.
|
||||
define Build/mkubntimage-split
|
||||
-[ -f $@ ] && ( \
|
||||
dd if=$@ of=$@.old1 bs=1024k count=1; \
|
||||
dd if=$@ of=$@.old2 bs=1024k skip=1; \
|
||||
$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
|
||||
-v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
|
||||
-k $@.old1 -r $@.old2 -o $@; \
|
||||
rm $@.old1 $@.old2 )
|
||||
endef
|
||||
|
||||
# UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
|
||||
# UBNT_TYPE e.g. one of (BZ, XM, XW)
|
||||
# UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
|
||||
# UBNT_VERSION e.g. one of (6.0.0, 8.5.3)
|
||||
define Device/ubnt
|
||||
DEVICE_VENDOR := Ubiquiti
|
||||
DEVICE_PACKAGES := kmod-usb2
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
|
||||
append-rootfs | pad-rootfs | check-size | mkubntimage-split
|
||||
endef
|
||||
|
||||
define Device/ubnt-bz
|
||||
$(Device/ubnt)
|
||||
SOC := ar7241
|
||||
IMAGE_SIZE := 7448k
|
||||
UBNT_BOARD := XM
|
||||
UBNT_CHIP := ar7240
|
||||
UBNT_TYPE := BZ
|
||||
UBNT_VERSION := 6.0.0
|
||||
endef
|
||||
|
||||
define Device/ubnt-sw
|
||||
$(Device/ubnt)
|
||||
SOC := ar7242
|
||||
DEVICE_PACKAGES += kmod-usb-ohci
|
||||
IMAGE_SIZE := 7552k
|
||||
UBNT_BOARD := SW
|
||||
UBNT_CHIP := ar7240
|
||||
UBNT_TYPE := SW
|
||||
UBNT_VERSION := 1.4.1
|
||||
KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
|
||||
endef
|
||||
|
||||
define Device/ubnt-2wa
|
||||
$(Device/ubnt)
|
||||
SOC := ar9342
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := WA
|
||||
UBNT_CHIP := ar934x
|
||||
UBNT_TYPE := 2WA
|
||||
UBNT_VERSION := 8.5.3
|
||||
endef
|
||||
|
||||
define Device/ubnt-wa
|
||||
$(Device/ubnt)
|
||||
SOC := ar9342
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := WA
|
||||
UBNT_CHIP := ar934x
|
||||
UBNT_TYPE := WA
|
||||
UBNT_VERSION := 8.5.3
|
||||
endef
|
||||
|
||||
define Device/ubnt-xc
|
||||
$(Device/ubnt)
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := XC
|
||||
UBNT_CHIP := qca955x
|
||||
UBNT_TYPE := XC
|
||||
UBNT_VERSION := 8.5.3
|
||||
endef
|
||||
|
||||
define Device/ubnt-xm
|
||||
$(Device/ubnt)
|
||||
DEVICE_VARIANT := XM
|
||||
DEVICE_PACKAGES += kmod-usb-ohci
|
||||
IMAGE_SIZE := 7448k
|
||||
UBNT_BOARD := XM
|
||||
UBNT_CHIP := ar7240
|
||||
UBNT_REVISION := 42.$(UBNT_REVISION)
|
||||
UBNT_TYPE := XM
|
||||
UBNT_VERSION := 6.0.0
|
||||
KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
|
||||
endef
|
||||
|
||||
define Device/ubnt-xw
|
||||
$(Device/ubnt)
|
||||
SOC := ar9342
|
||||
DEVICE_VARIANT := XW
|
||||
IMAGE_SIZE := 7552k
|
||||
UBNT_BOARD := XM
|
||||
UBNT_CHIP := ar934x
|
||||
UBNT_REVISION := 42.$(UBNT_REVISION)
|
||||
UBNT_TYPE := XW
|
||||
UBNT_VERSION := 6.0.4
|
||||
endef
|
||||
|
||||
define Device/ubnt-unifi-jffs2
|
||||
$(Device/ubnt)
|
||||
KERNEL_SIZE := 3072k
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_TYPE := BZ
|
||||
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0
|
||||
IMAGES := sysupgrade.bin factory.bin
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\
|
||||
pad-rootfs | check-size | append-metadata
|
||||
IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
|
||||
endef
|
||||
|
||||
define Device/ubnt-acb
|
||||
$(Device/ubnt)
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := ACB
|
||||
UBNT_TYPE := ACB
|
||||
UBNT_VERSION := 2.5.0
|
||||
endef
|
||||
@@ -1,145 +1,4 @@
|
||||
DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE UBNT_VERSION UBNT_REVISION
|
||||
|
||||
# On M (XW) devices the U-Boot as of version 1.1.4-s1039 doesn't like
|
||||
# VERSION_DIST being on the place of major(?) version number, so we need to
|
||||
# use some number.
|
||||
UBNT_REVISION := $(VERSION_DIST)-$(REVISION)
|
||||
|
||||
# mkubntimage is using the kernel image direct
|
||||
# routerboard creates partitions out of the ubnt header
|
||||
define Build/mkubntimage
|
||||
-$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
|
||||
-v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
|
||||
-k $(IMAGE_KERNEL) -r $@ -o $@
|
||||
endef
|
||||
|
||||
define Build/mkubntimage2
|
||||
-$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
|
||||
-v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
|
||||
-p jffs2:0x50000:0xf60000:0:0:$@ \
|
||||
-o $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
# all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
|
||||
# booting the image, the size doesn't matter.
|
||||
define Build/mkubntimage-split
|
||||
-[ -f $@ ] && ( \
|
||||
dd if=$@ of=$@.old1 bs=1024k count=1; \
|
||||
dd if=$@ of=$@.old2 bs=1024k skip=1; \
|
||||
$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
|
||||
-v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
|
||||
-k $@.old1 -r $@.old2 -o $@; \
|
||||
rm $@.old1 $@.old2 )
|
||||
endef
|
||||
|
||||
# UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
|
||||
# UBNT_TYPE e.g. one of (BZ, XM, XW)
|
||||
# UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
|
||||
# UBNT_VERSION e.g. one of (6.0.0, 8.5.3)
|
||||
define Device/ubnt
|
||||
DEVICE_VENDOR := Ubiquiti
|
||||
DEVICE_PACKAGES := kmod-usb2
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
|
||||
append-rootfs | pad-rootfs | check-size | mkubntimage-split
|
||||
endef
|
||||
|
||||
define Device/ubnt-bz
|
||||
$(Device/ubnt)
|
||||
SOC := ar7241
|
||||
IMAGE_SIZE := 7448k
|
||||
UBNT_BOARD := XM
|
||||
UBNT_CHIP := ar7240
|
||||
UBNT_TYPE := BZ
|
||||
UBNT_VERSION := 6.0.0
|
||||
endef
|
||||
|
||||
define Device/ubnt-sw
|
||||
$(Device/ubnt)
|
||||
SOC := ar7242
|
||||
DEVICE_PACKAGES += kmod-usb-ohci
|
||||
IMAGE_SIZE := 7552k
|
||||
UBNT_BOARD := SW
|
||||
UBNT_CHIP := ar7240
|
||||
UBNT_TYPE := SW
|
||||
UBNT_VERSION := 1.4.1
|
||||
KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
|
||||
endef
|
||||
|
||||
define Device/ubnt-2wa
|
||||
$(Device/ubnt)
|
||||
SOC := ar9342
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := WA
|
||||
UBNT_CHIP := ar934x
|
||||
UBNT_TYPE := 2WA
|
||||
UBNT_VERSION := 8.5.3
|
||||
endef
|
||||
|
||||
define Device/ubnt-wa
|
||||
$(Device/ubnt)
|
||||
SOC := ar9342
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := WA
|
||||
UBNT_CHIP := ar934x
|
||||
UBNT_TYPE := WA
|
||||
UBNT_VERSION := 8.5.3
|
||||
endef
|
||||
|
||||
define Device/ubnt-xc
|
||||
$(Device/ubnt)
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := XC
|
||||
UBNT_CHIP := qca955x
|
||||
UBNT_TYPE := XC
|
||||
UBNT_VERSION := 8.5.3
|
||||
endef
|
||||
|
||||
define Device/ubnt-xm
|
||||
$(Device/ubnt)
|
||||
DEVICE_VARIANT := XM
|
||||
DEVICE_PACKAGES += kmod-usb-ohci
|
||||
IMAGE_SIZE := 7448k
|
||||
UBNT_BOARD := XM
|
||||
UBNT_CHIP := ar7240
|
||||
UBNT_REVISION := 42.$(UBNT_REVISION)
|
||||
UBNT_TYPE := XM
|
||||
UBNT_VERSION := 6.0.0
|
||||
KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
|
||||
endef
|
||||
|
||||
define Device/ubnt-xw
|
||||
$(Device/ubnt)
|
||||
SOC := ar9342
|
||||
DEVICE_VARIANT := XW
|
||||
IMAGE_SIZE := 7552k
|
||||
UBNT_BOARD := XM
|
||||
UBNT_CHIP := ar934x
|
||||
UBNT_REVISION := 42.$(UBNT_REVISION)
|
||||
UBNT_TYPE := XW
|
||||
UBNT_VERSION := 6.0.4
|
||||
endef
|
||||
|
||||
define Device/ubnt-unifi-jffs2
|
||||
$(Device/ubnt)
|
||||
KERNEL_SIZE := 3072k
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_TYPE := BZ
|
||||
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0
|
||||
IMAGES := sysupgrade.bin factory.bin
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\
|
||||
pad-rootfs | check-size | append-metadata
|
||||
IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
|
||||
endef
|
||||
|
||||
define Device/ubnt-acb
|
||||
$(Device/ubnt)
|
||||
IMAGE_SIZE := 15744k
|
||||
UBNT_BOARD := ACB
|
||||
UBNT_TYPE := ACB
|
||||
UBNT_VERSION := 2.5.0
|
||||
endef
|
||||
include ./common-ubnt.mk
|
||||
|
||||
define Device/ubnt_aircube-ac
|
||||
$(Device/ubnt-acb)
|
||||
@@ -159,14 +18,6 @@ define Device/ubnt_aircube-isp
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_aircube-isp
|
||||
|
||||
define Device/ubnt_airrouter
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := AirRouter
|
||||
SUPPORTED_DEVICES += airrouter
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_airrouter
|
||||
|
||||
define Device/ubnt_bullet-ac
|
||||
$(Device/ubnt-2wa)
|
||||
DEVICE_MODEL := Bullet AC
|
||||
@@ -174,26 +25,6 @@ define Device/ubnt_bullet-ac
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_bullet-ac
|
||||
|
||||
define Device/ubnt_bullet-m-ar7240
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7240
|
||||
DEVICE_MODEL := Bullet M
|
||||
DEVICE_VARIANT := XM (AR7240)
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_bullet-m-ar7240
|
||||
|
||||
define Device/ubnt_bullet-m-ar7241
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Bullet M
|
||||
DEVICE_VARIANT := XM (AR7241)
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_bullet-m-ar7241
|
||||
|
||||
define Device/ubnt_bullet-m-xw
|
||||
$(Device/ubnt-xw)
|
||||
DEVICE_MODEL := Bullet M
|
||||
@@ -263,15 +94,6 @@ define Device/ubnt_nanobeam-m5-xw
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanobeam-m5-xw
|
||||
|
||||
define Device/ubnt_nanobridge-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := NanoBridge M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanobridge-m
|
||||
|
||||
define Device/ubnt_nanostation-ac
|
||||
$(Device/ubnt-wa)
|
||||
DEVICE_MODEL := Nanostation AC
|
||||
@@ -286,15 +108,6 @@ define Device/ubnt_nanostation-ac-loco
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-ac-loco
|
||||
|
||||
define Device/ubnt_nanostation-loco-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Nanostation Loco M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-loco-m
|
||||
|
||||
define Device/ubnt_nanostation-loco-m-xw
|
||||
$(Device/ubnt-xw)
|
||||
DEVICE_MODEL := Nanostation Loco M
|
||||
@@ -303,15 +116,6 @@ define Device/ubnt_nanostation-loco-m-xw
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-loco-m-xw
|
||||
|
||||
define Device/ubnt_nanostation-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Nanostation M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += nanostation-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-m
|
||||
|
||||
define Device/ubnt_nanostation-m-xw
|
||||
$(Device/ubnt-xw)
|
||||
DEVICE_MODEL := Nanostation M
|
||||
@@ -320,15 +124,6 @@ define Device/ubnt_nanostation-m-xw
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-m-xw
|
||||
|
||||
define Device/ubnt_picostation-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Picostation M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_picostation-m
|
||||
|
||||
define Device/ubnt_powerbeam-5ac-500
|
||||
$(Device/ubnt-xc)
|
||||
SOC := qca9558
|
||||
@@ -362,15 +157,6 @@ define Device/ubnt_powerbeam-m5-xw
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_powerbeam-m5-xw
|
||||
|
||||
define Device/ubnt_powerbridge-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := PowerBridge M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_powerbridge-m
|
||||
|
||||
define Device/ubnt_rocket-5ac-lite
|
||||
$(Device/ubnt-xc)
|
||||
SOC := qca9558
|
||||
@@ -380,15 +166,6 @@ define Device/ubnt_rocket-5ac-lite
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_rocket-5ac-lite
|
||||
|
||||
define Device/ubnt_rocket-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Rocket M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += rocket-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_rocket-m
|
||||
|
||||
define Device/ubnt_routerstation_common
|
||||
DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
|
||||
kmod-usb2 fconfig
|
||||
|
||||
@@ -3,6 +3,7 @@ include ./common-netgear.mk
|
||||
include ./common-senao.mk
|
||||
include ./common-tp-link.mk
|
||||
include ./common-yuncore.mk
|
||||
include ./common-ubnt.mk
|
||||
|
||||
DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
|
||||
DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
|
||||
|
||||
@@ -305,7 +305,7 @@ define Device/netgear_wndr4500-v3
|
||||
endef
|
||||
TARGET_DEVICES += netgear_wndr4500-v3
|
||||
|
||||
define Device/zte_mf286_common
|
||||
define Device/zte_mf28x_common
|
||||
SOC := qca9563
|
||||
DEVICE_VENDOR := ZTE
|
||||
DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct
|
||||
@@ -315,8 +315,21 @@ define Device/zte_mf286_common
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
|
||||
define Device/zte_mf281
|
||||
$(Device/zte_mf28x_common)
|
||||
DEVICE_MODEL := MF281
|
||||
KERNEL_SIZE := 6144k
|
||||
IMAGE_SIZE := 29696k
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
|
||||
check-size
|
||||
DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis \
|
||||
kmod-usb-acm comgt-ncm
|
||||
endef
|
||||
TARGET_DEVICES += zte_mf281
|
||||
|
||||
define Device/zte_mf286
|
||||
$(Device/zte_mf286_common)
|
||||
$(Device/zte_mf28x_common)
|
||||
DEVICE_MODEL := MF286
|
||||
DEVICE_PACKAGES += ath10k-firmware-qca988x-ct kmod-usb-net-qmi-wwan \
|
||||
kmod-usb-serial-option uqmi
|
||||
@@ -324,7 +337,7 @@ endef
|
||||
TARGET_DEVICES += zte_mf286
|
||||
|
||||
define Device/zte_mf286a
|
||||
$(Device/zte_mf286_common)
|
||||
$(Device/zte_mf28x_common)
|
||||
DEVICE_MODEL := MF286A
|
||||
DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-qmi-wwan \
|
||||
kmod-usb-serial-option uqmi
|
||||
@@ -332,7 +345,7 @@ endef
|
||||
TARGET_DEVICES += zte_mf286a
|
||||
|
||||
define Device/zte_mf286r
|
||||
$(Device/zte_mf286_common)
|
||||
$(Device/zte_mf28x_common)
|
||||
DEVICE_MODEL := MF286R
|
||||
DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis kmod-usb-acm \
|
||||
comgt-ncm
|
||||
|
||||
83
target/linux/ath79/image/tiny-ubnt.mk
Normal file
83
target/linux/ath79/image/tiny-ubnt.mk
Normal file
@@ -0,0 +1,83 @@
|
||||
include ./common-ubnt.mk
|
||||
|
||||
define Device/ubnt_airrouter
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := AirRouter
|
||||
SUPPORTED_DEVICES += airrouter
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_airrouter
|
||||
|
||||
define Device/ubnt_nanobridge-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := NanoBridge M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanobridge-m
|
||||
|
||||
define Device/ubnt_bullet-m-ar7240
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7240
|
||||
DEVICE_MODEL := Bullet M
|
||||
DEVICE_VARIANT := XM (AR7240)
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_bullet-m-ar7240
|
||||
|
||||
define Device/ubnt_bullet-m-ar7241
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Bullet M
|
||||
DEVICE_VARIANT := XM (AR7241)
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_bullet-m-ar7241
|
||||
|
||||
define Device/ubnt_picostation-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Picostation M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_picostation-m
|
||||
|
||||
define Device/ubnt_nanostation-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Nanostation M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += nanostation-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-m
|
||||
|
||||
define Device/ubnt_nanostation-loco-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Nanostation Loco M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_nanostation-loco-m
|
||||
|
||||
define Device/ubnt_powerbridge-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := PowerBridge M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += bullet-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_powerbridge-m
|
||||
|
||||
define Device/ubnt_rocket-m
|
||||
$(Device/ubnt-xm)
|
||||
SOC := ar7241
|
||||
DEVICE_MODEL := Rocket M
|
||||
DEVICE_PACKAGES += rssileds
|
||||
SUPPORTED_DEVICES += rocket-m
|
||||
endef
|
||||
TARGET_DEVICES += ubnt_rocket-m
|
||||
@@ -50,6 +50,10 @@ ath79_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
zte,mf281)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "5:lan"
|
||||
;;
|
||||
zte,mf286|\
|
||||
zte,mf286a|\
|
||||
zte,mf286r)
|
||||
|
||||
@@ -13,9 +13,9 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
|
||||
--- a/drivers/leds/Kconfig
|
||||
+++ b/drivers/leds/Kconfig
|
||||
@@ -931,6 +931,17 @@ config LEDS_ACER_A500
|
||||
|
||||
source "drivers/leds/blink/Kconfig"
|
||||
@@ -941,6 +941,17 @@ config LEDS_UBNT_LEDBAR
|
||||
To compile this driver as a module, choose M here: the module
|
||||
will be called leds-ubnt-ledbar.
|
||||
|
||||
+config LEDS_RESET
|
||||
+ tristate "LED support for reset-controller API"
|
||||
@@ -176,11 +176,11 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
+MODULE_ALIAS("platform:leds-reset");
|
||||
--- a/drivers/leds/Makefile
|
||||
+++ b/drivers/leds/Makefile
|
||||
@@ -93,6 +93,7 @@ obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds
|
||||
obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o
|
||||
obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o
|
||||
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
|
||||
@@ -80,6 +80,7 @@ obj-$(CONFIG_LEDS_PM8058) += leds-pm805
|
||||
obj-$(CONFIG_LEDS_POWERNV) += leds-powernv.o
|
||||
obj-$(CONFIG_LEDS_PWM) += leds-pwm.o
|
||||
obj-$(CONFIG_LEDS_REGULATOR) += leds-regulator.o
|
||||
+obj-$(CONFIG_LEDS_RESET) += leds-reset.o
|
||||
|
||||
# LED SPI Drivers
|
||||
obj-$(CONFIG_LEDS_CR0014114) += leds-cr0014114.o
|
||||
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
|
||||
obj-$(CONFIG_LEDS_SC27XX_BLTC) += leds-sc27xx-bltc.o
|
||||
obj-$(CONFIG_LEDS_SGM3140) += leds-sgm3140.o
|
||||
|
||||
@@ -34,7 +34,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
|
||||
mtd->type = MTD_NORFLASH;
|
||||
--- a/drivers/mtd/mtdcore.c
|
||||
+++ b/drivers/mtd/mtdcore.c
|
||||
@@ -788,6 +788,17 @@ out_error:
|
||||
@@ -849,6 +849,17 @@ out_error:
|
||||
*/
|
||||
static void mtd_set_dev_defaults(struct mtd_info *mtd)
|
||||
{
|
||||
|
||||
@@ -706,7 +706,7 @@
|
||||
EXPORT_SYMBOL(xfrm_parse_spi);
|
||||
--- a/net/ipv4/tcp_input.c
|
||||
+++ b/net/ipv4/tcp_input.c
|
||||
@@ -4093,14 +4093,16 @@ static bool tcp_parse_aligned_timestamp(
|
||||
@@ -4127,14 +4127,16 @@ static bool tcp_parse_aligned_timestamp(
|
||||
{
|
||||
const __be32 *ptr = (const __be32 *)(th + 1);
|
||||
|
||||
|
||||
@@ -110,6 +110,20 @@ tplink,tl-wr941nd-v6)
|
||||
tplink,tl-wr940n-v6)
|
||||
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
|
||||
;;
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "RSSILOW" "red:link1" "wlan0" "1" "100"
|
||||
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "orange:link2" "wlan0" "26" "100"
|
||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:link3" "wlan0" "51" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:link4" "wlan0" "76" "100"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
@@ -49,7 +49,14 @@ ath79_setup_interfaces()
|
||||
tplink,tl-wa901nd-v5|\
|
||||
tplink,tl-wr703n|\
|
||||
tplink,tl-wr802n-v1|\
|
||||
tplink,tl-wr802n-v2)
|
||||
tplink,tl-wr802n-v2|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
engenius,enh202-v1)
|
||||
@@ -96,6 +103,14 @@ ath79_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
|
||||
;;
|
||||
ubnt,airrouter)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
ubnt,nanostation-m)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
@@ -112,7 +127,16 @@ ath79_setup_macs()
|
||||
wan_mac=$(mtd_get_mac_ascii "nvram" "wan_mac")
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
engenius,enh202-v1)
|
||||
engenius,enh202-v1|\
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m)
|
||||
label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
|
||||
;;
|
||||
tplink,tl-wr941-v2|\
|
||||
|
||||
@@ -36,7 +36,16 @@ case "$FIRMWARE" in
|
||||
tplink,tl-wr740n-v3|\
|
||||
tplink,tl-wr741-v1|\
|
||||
tplink,tl-wr743nd-v1|\
|
||||
tplink,tl-wr841-v7)
|
||||
tplink,tl-wr841-v7|\
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,powerbridge-m|\
|
||||
ubnt,rocket-m)
|
||||
caldata_extract "art" 0x1000 0x1000
|
||||
;;
|
||||
pqi,air-pen)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
BOARDNAME:=Devices with small flash
|
||||
FEATURES += small_flash
|
||||
FEATURES += low_mem small_flash
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
* @dev: the device whose endpoint is being disabled
|
||||
--- a/include/linux/usb.h
|
||||
+++ b/include/linux/usb.h
|
||||
@@ -1838,6 +1838,8 @@ extern int usb_clear_halt(struct usb_dev
|
||||
@@ -1840,6 +1840,8 @@ extern int usb_clear_halt(struct usb_dev
|
||||
extern int usb_reset_configuration(struct usb_device *dev);
|
||||
extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
|
||||
extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr);
|
||||
|
||||
@@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -1494,6 +1494,103 @@ command_cleanup:
|
||||
@@ -1485,6 +1485,103 @@ command_cleanup:
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
* non-error returns are a promise to giveback() the urb later
|
||||
* we drop ownership so next owner (or urb unlink) can get it
|
||||
*/
|
||||
@@ -5400,6 +5497,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
@@ -5391,6 +5488,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
.endpoint_reset = xhci_endpoint_reset,
|
||||
.check_bandwidth = xhci_check_bandwidth,
|
||||
.reset_bandwidth = xhci_reset_bandwidth,
|
||||
|
||||
@@ -30,9 +30,9 @@ Changes since v1:
|
||||
|
||||
--- a/drivers/nvmem/Kconfig
|
||||
+++ b/drivers/nvmem/Kconfig
|
||||
@@ -270,4 +270,12 @@ config SPRD_EFUSE
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called nvmem-sprd-efuse.
|
||||
@@ -283,4 +283,13 @@ config NVMEM_U_BOOT_ENV
|
||||
|
||||
If compiled as module it will be called nvmem_u-boot-env.
|
||||
|
||||
+config NVMEM_RMEM
|
||||
+ tristate "Reserved Memory Based Driver Support"
|
||||
@@ -42,13 +42,14 @@ Changes since v1:
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called nvmem-rmem.
|
||||
+
|
||||
endif
|
||||
--- a/drivers/nvmem/Makefile
|
||||
+++ b/drivers/nvmem/Makefile
|
||||
@@ -55,3 +55,5 @@ obj-$(CONFIG_NVMEM_ZYNQMP) += nvmem_zynq
|
||||
nvmem_zynqmp_nvmem-y := zynqmp_nvmem.o
|
||||
obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_efuse.o
|
||||
@@ -57,3 +57,5 @@ obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_e
|
||||
nvmem_sprd_efuse-y := sprd-efuse.o
|
||||
obj-$(CONFIG_NVMEM_U_BOOT_ENV) += nvmem_u-boot-env.o
|
||||
nvmem_u-boot-env-y := u-boot-env.o
|
||||
+obj-$(CONFIG_NVMEM_RMEM) += nvmem-rmem.o
|
||||
+nvmem-rmem-y := rmem.o
|
||||
--- /dev/null
|
||||
|
||||
@@ -10,7 +10,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
|
||||
--- a/drivers/clk/bcm/clk-raspberrypi.c
|
||||
+++ b/drivers/clk/bcm/clk-raspberrypi.c
|
||||
@@ -271,6 +271,7 @@ static int raspberrypi_discover_clocks(s
|
||||
@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(s
|
||||
case RPI_FIRMWARE_CORE_CLK_ID:
|
||||
case RPI_FIRMWARE_M2MC_CLK_ID:
|
||||
case RPI_FIRMWARE_V3D_CLK_ID:
|
||||
|
||||
@@ -75,7 +75,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
/*** runtime pm ***/
|
||||
static int clk_pm_runtime_get(struct clk_core *core)
|
||||
{
|
||||
@@ -1431,10 +1439,14 @@ unsigned long clk_hw_round_rate(struct c
|
||||
@@ -1430,10 +1438,14 @@ unsigned long clk_hw_round_rate(struct c
|
||||
{
|
||||
int ret;
|
||||
struct clk_rate_request req;
|
||||
@@ -90,7 +90,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
ret = clk_core_round_rate_nolock(hw->core, &req);
|
||||
if (ret)
|
||||
return 0;
|
||||
@@ -1455,6 +1467,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate);
|
||||
@@ -1454,6 +1466,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate);
|
||||
long clk_round_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
struct clk_rate_request req;
|
||||
@@ -98,7 +98,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
int ret;
|
||||
|
||||
if (!clk)
|
||||
@@ -1468,6 +1481,9 @@ long clk_round_rate(struct clk *clk, uns
|
||||
@@ -1467,6 +1480,9 @@ long clk_round_rate(struct clk *clk, uns
|
||||
clk_core_get_boundaries(clk->core, &req.min_rate, &req.max_rate);
|
||||
req.rate = rate;
|
||||
|
||||
@@ -108,7 +108,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
ret = clk_core_round_rate_nolock(clk->core, &req);
|
||||
|
||||
if (clk->exclusive_count)
|
||||
@@ -1935,6 +1951,7 @@ static struct clk_core *clk_calc_new_rat
|
||||
@@ -1934,6 +1950,7 @@ static struct clk_core *clk_calc_new_rat
|
||||
unsigned long new_rate;
|
||||
unsigned long min_rate;
|
||||
unsigned long max_rate;
|
||||
@@ -116,7 +116,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
int p_index = 0;
|
||||
long ret;
|
||||
|
||||
@@ -1949,6 +1966,9 @@ static struct clk_core *clk_calc_new_rat
|
||||
@@ -1948,6 +1965,9 @@ static struct clk_core *clk_calc_new_rat
|
||||
|
||||
clk_core_get_boundaries(core, &min_rate, &max_rate);
|
||||
|
||||
@@ -126,7 +126,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
/* find the closest rate and parent clk/rate */
|
||||
if (clk_core_can_round(core)) {
|
||||
struct clk_rate_request req;
|
||||
@@ -2153,6 +2173,7 @@ static unsigned long clk_core_req_round_
|
||||
@@ -2152,6 +2172,7 @@ static unsigned long clk_core_req_round_
|
||||
{
|
||||
int ret, cnt;
|
||||
struct clk_rate_request req;
|
||||
@@ -134,7 +134,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
lockdep_assert_held(&prepare_lock);
|
||||
|
||||
@@ -2167,6 +2188,9 @@ static unsigned long clk_core_req_round_
|
||||
@@ -2166,6 +2187,9 @@ static unsigned long clk_core_req_round_
|
||||
clk_core_get_boundaries(core, &req.min_rate, &req.max_rate);
|
||||
req.rate = req_rate;
|
||||
|
||||
@@ -144,7 +144,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
ret = clk_core_round_rate_nolock(core, &req);
|
||||
|
||||
/* restore the protection */
|
||||
@@ -2260,6 +2284,9 @@ int clk_set_rate(struct clk *clk, unsign
|
||||
@@ -2259,6 +2283,9 @@ int clk_set_rate(struct clk *clk, unsign
|
||||
|
||||
ret = clk_core_set_rate_nolock(clk->core, rate);
|
||||
|
||||
@@ -154,7 +154,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
if (clk->exclusive_count)
|
||||
clk_core_rate_protect(clk->core);
|
||||
|
||||
@@ -2426,6 +2453,99 @@ int clk_set_max_rate(struct clk *clk, un
|
||||
@@ -2425,6 +2452,99 @@ int clk_set_max_rate(struct clk *clk, un
|
||||
EXPORT_SYMBOL_GPL(clk_set_max_rate);
|
||||
|
||||
/**
|
||||
@@ -254,7 +254,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
* clk_get_parent - return the parent of a clk
|
||||
* @clk: the clk whose parent gets returned
|
||||
*
|
||||
@@ -3875,6 +3995,7 @@ __clk_register(struct device *dev, struc
|
||||
@@ -3874,6 +3994,7 @@ __clk_register(struct device *dev, struc
|
||||
goto fail_parents;
|
||||
|
||||
INIT_HLIST_HEAD(&core->clks);
|
||||
|
||||
@@ -10,7 +10,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
--- a/drivers/clk/clk.c
|
||||
+++ b/drivers/clk/clk.c
|
||||
@@ -2522,6 +2522,9 @@ void clk_request_done(struct clk_request
|
||||
@@ -2521,6 +2521,9 @@ void clk_request_done(struct clk_request
|
||||
{
|
||||
struct clk_core *core = req->clk->core;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
--- a/drivers/clk/clk.c
|
||||
+++ b/drivers/clk/clk.c
|
||||
@@ -2520,10 +2520,11 @@ EXPORT_SYMBOL_GPL(clk_request_start);
|
||||
@@ -2519,10 +2519,11 @@ EXPORT_SYMBOL_GPL(clk_request_start);
|
||||
*/
|
||||
void clk_request_done(struct clk_request *req)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
--- a/drivers/clk/clk.c
|
||||
+++ b/drivers/clk/clk.c
|
||||
@@ -1334,6 +1334,8 @@ static int clk_core_determine_round_nolo
|
||||
@@ -1333,6 +1333,8 @@ static int clk_core_determine_round_nolo
|
||||
if (!core)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/kernel/cgroup/cgroup.c
|
||||
+++ b/kernel/cgroup/cgroup.c
|
||||
@@ -5744,6 +5744,9 @@ int __init cgroup_init_early(void)
|
||||
@@ -5785,6 +5785,9 @@ int __init cgroup_init_early(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
/**
|
||||
* cgroup_init - cgroup initialization
|
||||
*
|
||||
@@ -5782,6 +5785,12 @@ int __init cgroup_init(void)
|
||||
@@ -5823,6 +5826,12 @@ int __init cgroup_init(void)
|
||||
|
||||
mutex_unlock(&cgroup_mutex);
|
||||
|
||||
@@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
for_each_subsys(ss, ssid) {
|
||||
if (ss->early_init) {
|
||||
struct cgroup_subsys_state *css =
|
||||
@@ -6320,6 +6329,10 @@ static int __init cgroup_disable(char *s
|
||||
@@ -6361,6 +6370,10 @@ static int __init cgroup_disable(char *s
|
||||
strcmp(token, ss->legacy_name))
|
||||
continue;
|
||||
|
||||
@@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
static_branch_disable(cgroup_subsys_enabled_key[i]);
|
||||
pr_info("Disabling %s control group subsystem\n",
|
||||
ss->name);
|
||||
@@ -6329,6 +6342,31 @@ static int __init cgroup_disable(char *s
|
||||
@@ -6370,6 +6383,31 @@ static int __init cgroup_disable(char *s
|
||||
}
|
||||
__setup("cgroup_disable=", cgroup_disable);
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MTD_BRCM_U_BOOT=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_NAND_BRCMNAND=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
@@ -161,6 +162,9 @@ CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_NVMEM_U_BOOT_ENV=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
From 002181f5b150e60c77f21de7ad4dd10e4614cd91 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 11 Jul 2022 17:30:41 +0200
|
||||
Subject: [PATCH] mtd: parsers: add Broadcom's U-Boot parser
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Broadcom stores environment variables blocks inside U-Boot partition
|
||||
itself. This driver finds & registers them.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Link: https://lore.kernel.org/linux-mtd/20220711153041.6036-2-zajec5@gmail.com
|
||||
---
|
||||
drivers/mtd/parsers/Kconfig | 10 ++++
|
||||
drivers/mtd/parsers/Makefile | 1 +
|
||||
drivers/mtd/parsers/brcm_u-boot.c | 84 +++++++++++++++++++++++++++++++
|
||||
3 files changed, 95 insertions(+)
|
||||
create mode 100644 drivers/mtd/parsers/brcm_u-boot.c
|
||||
|
||||
--- a/drivers/mtd/parsers/Kconfig
|
||||
+++ b/drivers/mtd/parsers/Kconfig
|
||||
@@ -20,6 +20,16 @@ config MTD_BCM63XX_PARTS
|
||||
This provides partition parsing for BCM63xx devices with CFE
|
||||
bootloaders.
|
||||
|
||||
+config MTD_BRCM_U_BOOT
|
||||
+ tristate "Broadcom's U-Boot partition parser"
|
||||
+ depends on ARCH_BCM4908 || COMPILE_TEST
|
||||
+ help
|
||||
+ Broadcom uses a custom way of storing U-Boot environment variables.
|
||||
+ They are placed inside U-Boot partition itself at unspecified offset.
|
||||
+ It's possible to locate them by looking for a custom header with a
|
||||
+ magic value. This driver does that and creates subpartitions for
|
||||
+ each found environment variables block.
|
||||
+
|
||||
config MTD_CMDLINE_PARTS
|
||||
tristate "Command line partition table parsing"
|
||||
depends on MTD
|
||||
--- a/drivers/mtd/parsers/Makefile
|
||||
+++ b/drivers/mtd/parsers/Makefile
|
||||
@@ -2,6 +2,7 @@
|
||||
obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o
|
||||
obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o
|
||||
obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o
|
||||
+obj-$(CONFIG_MTD_BRCM_U_BOOT) += brcm_u-boot.o
|
||||
obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
|
||||
obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
|
||||
obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/mtd/parsers/brcm_u-boot.c
|
||||
@@ -0,0 +1,84 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+/*
|
||||
+ * Copyright © 2022 Rafał Miłecki <rafal@milecki.pl>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/mtd/mtd.h>
|
||||
+#include <linux/mtd/partitions.h>
|
||||
+
|
||||
+#define BRCM_U_BOOT_MAX_OFFSET 0x200000
|
||||
+#define BRCM_U_BOOT_STEP 0x1000
|
||||
+
|
||||
+#define BRCM_U_BOOT_MAX_PARTS 2
|
||||
+
|
||||
+#define BRCM_U_BOOT_MAGIC 0x75456e76 /* uEnv */
|
||||
+
|
||||
+struct brcm_u_boot_header {
|
||||
+ __le32 magic;
|
||||
+ __le32 length;
|
||||
+} __packed;
|
||||
+
|
||||
+static const char *names[BRCM_U_BOOT_MAX_PARTS] = {
|
||||
+ "u-boot-env",
|
||||
+ "u-boot-env-backup",
|
||||
+};
|
||||
+
|
||||
+static int brcm_u_boot_parse(struct mtd_info *mtd,
|
||||
+ const struct mtd_partition **pparts,
|
||||
+ struct mtd_part_parser_data *data)
|
||||
+{
|
||||
+ struct brcm_u_boot_header header;
|
||||
+ struct mtd_partition *parts;
|
||||
+ size_t bytes_read;
|
||||
+ size_t offset;
|
||||
+ int err;
|
||||
+ int i = 0;
|
||||
+
|
||||
+ parts = kcalloc(BRCM_U_BOOT_MAX_PARTS, sizeof(*parts), GFP_KERNEL);
|
||||
+ if (!parts)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ for (offset = 0;
|
||||
+ offset < min_t(size_t, mtd->size, BRCM_U_BOOT_MAX_OFFSET);
|
||||
+ offset += BRCM_U_BOOT_STEP) {
|
||||
+ err = mtd_read(mtd, offset, sizeof(header), &bytes_read, (uint8_t *)&header);
|
||||
+ if (err && !mtd_is_bitflip(err)) {
|
||||
+ pr_err("Failed to read from %s at 0x%zx: %d\n", mtd->name, offset, err);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (le32_to_cpu(header.magic) != BRCM_U_BOOT_MAGIC)
|
||||
+ continue;
|
||||
+
|
||||
+ parts[i].name = names[i];
|
||||
+ parts[i].offset = offset;
|
||||
+ parts[i].size = sizeof(header) + le32_to_cpu(header.length);
|
||||
+ i++;
|
||||
+ pr_info("offset:0x%zx magic:0x%08x BINGO\n", offset, header.magic);
|
||||
+
|
||||
+ if (i == BRCM_U_BOOT_MAX_PARTS)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ *pparts = parts;
|
||||
+
|
||||
+ return i;
|
||||
+};
|
||||
+
|
||||
+static const struct of_device_id brcm_u_boot_of_match_table[] = {
|
||||
+ { .compatible = "brcm,u-boot" },
|
||||
+ {},
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, brcm_u_boot_of_match_table);
|
||||
+
|
||||
+static struct mtd_part_parser brcm_u_boot_mtd_parser = {
|
||||
+ .parse_fn = brcm_u_boot_parse,
|
||||
+ .name = "brcm_u-boot",
|
||||
+ .of_match_table = brcm_u_boot_of_match_table,
|
||||
+};
|
||||
+module_mtd_part_parser(brcm_u_boot_mtd_parser);
|
||||
+
|
||||
+MODULE_LICENSE("GPL");
|
||||
@@ -1,5 +1,6 @@
|
||||
From ddeacc4f6494e07cbb6f033627926623f3e7a9d0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 22 Jun 2021 07:05:04 +0200
|
||||
Date: Tue, 22 Jun 2021 07:24:15 +0200
|
||||
Subject: [PATCH] net: broadcom: bcm4908_enet: reset DMA rings sw indexes
|
||||
properly
|
||||
MIME-Version: 1.0
|
||||
@@ -15,6 +16,7 @@ down & up sequence.
|
||||
|
||||
Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bcm4908_enet.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
@@ -0,0 +1,55 @@
|
||||
From e93a766da57fff3273bcb618edf5dfca1fb86b89 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 15 Sep 2022 15:30:13 +0200
|
||||
Subject: [PATCH] net: broadcom: bcm4908_enet: handle -EPROBE_DEFER when
|
||||
getting MAC
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Reading MAC from OF may return -EPROBE_DEFER if underlaying NVMEM device
|
||||
isn't ready yet. In such case pass that error code up and "wait" to be
|
||||
probed later.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Link: https://lore.kernel.org/r/20220915133013.2243-1-zajec5@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bcm4908_enet.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
|
||||
@@ -714,7 +714,9 @@ static int bcm4908_enet_probe(struct pla
|
||||
return err;
|
||||
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
- of_get_mac_address(dev->of_node, netdev->dev_addr);
|
||||
+ err = of_get_mac_address(dev->of_node, netdev->dev_addr);
|
||||
+ if (err == -EPROBE_DEFER)
|
||||
+ goto err_dma_free;
|
||||
if (!is_valid_ether_addr(netdev->dev_addr))
|
||||
eth_hw_addr_random(netdev);
|
||||
netdev->netdev_ops = &bcm4908_enet_netdev_ops;
|
||||
@@ -725,14 +727,17 @@ static int bcm4908_enet_probe(struct pla
|
||||
netif_napi_add(netdev, &enet->rx_ring.napi, bcm4908_enet_poll_rx, NAPI_POLL_WEIGHT);
|
||||
|
||||
err = register_netdev(netdev);
|
||||
- if (err) {
|
||||
- bcm4908_enet_dma_free(enet);
|
||||
- return err;
|
||||
- }
|
||||
+ if (err)
|
||||
+ goto err_dma_free;
|
||||
|
||||
platform_set_drvdata(pdev, enet);
|
||||
|
||||
return 0;
|
||||
+
|
||||
+err_dma_free:
|
||||
+ bcm4908_enet_dma_free(enet);
|
||||
+
|
||||
+ return err;
|
||||
}
|
||||
|
||||
static int bcm4908_enet_remove(struct platform_device *pdev)
|
||||
@@ -19,9 +19,9 @@ Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
|
||||
--- a/drivers/nvmem/Kconfig
|
||||
+++ b/drivers/nvmem/Kconfig
|
||||
@@ -270,4 +270,13 @@ config SPRD_EFUSE
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called nvmem-sprd-efuse.
|
||||
@@ -283,4 +283,13 @@ config NVMEM_U_BOOT_ENV
|
||||
|
||||
If compiled as module it will be called nvmem_u-boot-env.
|
||||
|
||||
+
|
||||
+config NVMEM_BRCM_NVRAM
|
||||
@@ -35,10 +35,10 @@ Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
endif
|
||||
--- a/drivers/nvmem/Makefile
|
||||
+++ b/drivers/nvmem/Makefile
|
||||
@@ -55,3 +55,5 @@ obj-$(CONFIG_NVMEM_ZYNQMP) += nvmem_zynq
|
||||
nvmem_zynqmp_nvmem-y := zynqmp_nvmem.o
|
||||
obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_efuse.o
|
||||
@@ -57,3 +57,5 @@ obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_e
|
||||
nvmem_sprd_efuse-y := sprd-efuse.o
|
||||
obj-$(CONFIG_NVMEM_U_BOOT_ENV) += nvmem_u-boot-env.o
|
||||
nvmem_u-boot-env-y := u-boot-env.o
|
||||
+obj-$(CONFIG_NVMEM_BRCM_NVRAM) += nvmem_brcm_nvram.o
|
||||
+nvmem_brcm_nvram-y := brcm_nvram.o
|
||||
--- /dev/null
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user