Compare commits
263 Commits
master
...
v24.10.0-r
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b912a96ab4 | ||
![]() |
56e91d0bbe | ||
![]() |
975811921e | ||
![]() |
dd04edfba2 | ||
![]() |
8667ca841b | ||
![]() |
2d6c57397f | ||
![]() |
5289460fd0 | ||
![]() |
7c0f6f4d05 | ||
![]() |
f67ecd3baf | ||
![]() |
9f76cda378 | ||
![]() |
5415fb06d2 | ||
![]() |
21549dbf7b | ||
![]() |
ab4c83d4f9 | ||
![]() |
5a715cdbcd | ||
![]() |
e40367fa99 | ||
![]() |
f0ff244c69 | ||
![]() |
cc69be0c13 | ||
![]() |
6642ee73bc | ||
![]() |
f760f74209 | ||
![]() |
5dca1d6a41 | ||
![]() |
e109caeec4 | ||
![]() |
a964e96289 | ||
![]() |
acf52fed43 | ||
![]() |
b9eb5bc327 | ||
![]() |
25268f724b | ||
![]() |
6435025f9c | ||
![]() |
6d0d4ce72f | ||
![]() |
28602452df | ||
![]() |
28bde50c1d | ||
![]() |
efcb0ec713 | ||
![]() |
9af0e94fa6 | ||
![]() |
bf284ed4af | ||
![]() |
31335d165a | ||
![]() |
f3f8a8ea83 | ||
![]() |
ab3dee65f9 | ||
![]() |
aa1241e979 | ||
![]() |
610b73e8b6 | ||
![]() |
28de3ffefa | ||
![]() |
6c664135f9 | ||
![]() |
620aa80064 | ||
![]() |
24bddf68bd | ||
![]() |
d79a70542b | ||
![]() |
d48e499fc1 | ||
![]() |
b9df2d79b6 | ||
![]() |
5afd3daeba | ||
![]() |
1eba94e67b | ||
![]() |
8a4ce69eea | ||
![]() |
2b45e93113 | ||
![]() |
4bfe5ccd11 | ||
![]() |
863d1a634e | ||
![]() |
50ec871dc6 | ||
![]() |
45f9f15512 | ||
![]() |
f483de4767 | ||
![]() |
c995dd97c7 | ||
![]() |
66e76aa94f | ||
![]() |
ea17e958b9 | ||
![]() |
189865d080 | ||
![]() |
e91303616c | ||
![]() |
ed4f046c35 | ||
![]() |
5601274444 | ||
![]() |
41714984df | ||
![]() |
06513b1850 | ||
![]() |
260d5fbf9a | ||
![]() |
d276b4c91a | ||
![]() |
c981096416 | ||
![]() |
de8a1a1e3a | ||
![]() |
17bdccb4a5 | ||
![]() |
2c3d036fe7 | ||
![]() |
7eec852c06 | ||
![]() |
8c616ccf24 | ||
![]() |
9e73f794ad | ||
![]() |
c312295b56 | ||
![]() |
ba95a01cbf | ||
![]() |
fd7b1f60ea | ||
![]() |
0a0950614b | ||
![]() |
67269ae51e | ||
![]() |
1b2adb8000 | ||
![]() |
888e879d7f | ||
![]() |
2544e03d10 | ||
![]() |
005f086752 | ||
![]() |
4779e954fa | ||
![]() |
60e21548e5 | ||
![]() |
d491100f01 | ||
![]() |
fd0f608d66 | ||
![]() |
a07c241b81 | ||
![]() |
25973eab22 | ||
![]() |
0b4d831886 | ||
![]() |
1e0f790d23 | ||
![]() |
50ee6adc5a | ||
![]() |
1b513604c3 | ||
![]() |
35b7bbf355 | ||
![]() |
b2f3713801 | ||
![]() |
58f4667a37 | ||
![]() |
4eb85c47bd | ||
![]() |
e654d55446 | ||
![]() |
c584683a7f | ||
![]() |
27afd9e1ca | ||
![]() |
2f99171de3 | ||
![]() |
0f301db3ff | ||
![]() |
2950e189ce | ||
![]() |
956bb0c2a4 | ||
![]() |
72bf1db35c | ||
![]() |
c3db0cca0f | ||
![]() |
911b25d618 | ||
![]() |
d921c2db0b | ||
![]() |
fd9de585d7 | ||
![]() |
c93e7700d4 | ||
![]() |
480aed0c72 | ||
![]() |
fb4088cdec | ||
![]() |
8eb07120a2 | ||
![]() |
2d3ad35537 | ||
![]() |
7a945bf88b | ||
![]() |
f93bba30d7 | ||
![]() |
77de80d9db | ||
![]() |
b17413117d | ||
![]() |
ac2d91329e | ||
![]() |
7afbe22599 | ||
![]() |
9a09c54449 | ||
![]() |
57ac0965cf | ||
![]() |
69eecbef91 | ||
![]() |
908975850d | ||
![]() |
7142e35777 | ||
![]() |
4b9739a0f1 | ||
![]() |
2884aded40 | ||
![]() |
dae203bd94 | ||
![]() |
abf78dd5d8 | ||
![]() |
05989f69d8 | ||
![]() |
b1c01cd4b5 | ||
![]() |
16eb043062 | ||
![]() |
1eade612f9 | ||
![]() |
9591c1631d | ||
![]() |
d5e45df9c2 | ||
![]() |
4166aaf98a | ||
![]() |
d4a26ffd1a | ||
![]() |
994a95584a | ||
![]() |
4c22224bcc | ||
![]() |
be082a7c7e | ||
![]() |
7d4be068da | ||
![]() |
71d60c6983 | ||
![]() |
756c955a9c | ||
![]() |
f59c665660 | ||
![]() |
77af73050c | ||
![]() |
f2a40e1117 | ||
![]() |
7d9fc260a1 | ||
![]() |
2226546e1c | ||
![]() |
8f0d52d8c4 | ||
![]() |
2942ee0a8d | ||
![]() |
11d36818b9 | ||
![]() |
03984356bd | ||
![]() |
7424f58eb6 | ||
![]() |
9d44e00fc5 | ||
![]() |
655874713e | ||
![]() |
96ab90a9aa | ||
![]() |
25427d7942 | ||
![]() |
67da3d33f3 | ||
![]() |
62690e3b51 | ||
![]() |
2af51fbdab | ||
![]() |
69fd722edd | ||
![]() |
f05d49cfbd | ||
![]() |
68465e524b | ||
![]() |
79c711a035 | ||
![]() |
d582b369c3 | ||
![]() |
14880209d5 | ||
![]() |
1c934c7dc7 | ||
![]() |
a5efcbd327 | ||
![]() |
1fd7e5124e | ||
![]() |
c2cde63ae6 | ||
![]() |
4b9e9a0310 | ||
![]() |
c4c1bb523f | ||
![]() |
70ee25f70f | ||
![]() |
ec774fafe6 | ||
![]() |
e5a20b0f49 | ||
![]() |
0cf557876a | ||
![]() |
3451a70356 | ||
![]() |
fbe50c67c6 | ||
![]() |
9eb5a8552f | ||
![]() |
45d14bfbd2 | ||
![]() |
5233ff3698 | ||
![]() |
7ef734deac | ||
![]() |
39d6d318a6 | ||
![]() |
0de3c201b1 | ||
![]() |
634ac989e9 | ||
![]() |
1d612c33de | ||
![]() |
79dafe4ad1 | ||
![]() |
2152acb7da | ||
![]() |
141ccfd548 | ||
![]() |
d0d646abcb | ||
![]() |
a5b291116b | ||
![]() |
7402e7dd86 | ||
![]() |
610652090d | ||
![]() |
a2e7d8761b | ||
![]() |
d665be7c1e | ||
![]() |
b506c964a2 | ||
![]() |
c279ca8b79 | ||
![]() |
b89bad8523 | ||
![]() |
5331e3bc31 | ||
![]() |
1abaf051d2 | ||
![]() |
5ad5677067 | ||
![]() |
fafd6c4b57 | ||
![]() |
7503540810 | ||
![]() |
112adbee68 | ||
![]() |
3ecfc24c51 | ||
![]() |
585eb0d6c8 | ||
![]() |
8e62f8583f | ||
![]() |
63d27611ab | ||
![]() |
2d465fbf57 | ||
![]() |
8afe292cbc | ||
![]() |
faebcc61eb | ||
![]() |
3e094777e7 | ||
![]() |
1ee47119c9 | ||
![]() |
740052e84e | ||
![]() |
fe048b5e87 | ||
![]() |
13f166763f | ||
![]() |
c02af3fd85 | ||
![]() |
1fdc4b144b | ||
![]() |
6e7537a049 | ||
![]() |
a24c3500f3 | ||
![]() |
553324f247 | ||
![]() |
f13d5d7e2e | ||
![]() |
069987cf7b | ||
![]() |
6f52643bde | ||
![]() |
dc38100548 | ||
![]() |
31fabcbdb9 | ||
![]() |
e39f5d4b36 | ||
![]() |
b10dfedebb | ||
![]() |
d83ae23d08 | ||
![]() |
92eb867873 | ||
![]() |
4b413687e6 | ||
![]() |
7a1815f64d | ||
![]() |
1ba85d6ab7 | ||
![]() |
c0a50b1d59 | ||
![]() |
983a753f38 | ||
![]() |
f3359da4b8 | ||
![]() |
a82b097635 | ||
![]() |
0861ce7fb2 | ||
![]() |
49d8f4b833 | ||
![]() |
7763c5aabc | ||
![]() |
0d97e775ac | ||
![]() |
895f30e31a | ||
![]() |
5b7357e0a1 | ||
![]() |
ccd30b9ed7 | ||
![]() |
4b4e307a01 | ||
![]() |
de3dfe5714 | ||
![]() |
f4b62a6b28 | ||
![]() |
ab5c090077 | ||
![]() |
0f6aafcc24 | ||
![]() |
7c8bfc0be5 | ||
![]() |
4ec95518de | ||
![]() |
595aaa36fc | ||
![]() |
ec3c6d959b | ||
![]() |
54a586a5b7 | ||
![]() |
a923d1f9ec | ||
![]() |
de3d57a60c | ||
![]() |
547feaca2c | ||
![]() |
d92306d020 | ||
![]() |
6bc930c47d | ||
![]() |
92fd12e7fd | ||
![]() |
e3bbeabe92 | ||
![]() |
a4f3e17029 | ||
![]() |
9da8dfc1b9 | ||
![]() |
05b3adc0db | ||
![]() |
07e5dd4c4f | ||
![]() |
4ae45b1f4a |
@ -70,7 +70,8 @@ menu "Global build settings"
|
||||
|
||||
config USE_APK
|
||||
imply PACKAGE_apk-mbedtls
|
||||
bool "Use APK instead of OPKG to build distribution (EXPERIMENTAL)"
|
||||
bool "Use APK instead of OPKG to build distribution (BROKEN)"
|
||||
depends on BROKEN
|
||||
|
||||
comment "General build options"
|
||||
|
||||
@ -295,12 +296,22 @@ menu "Global build settings"
|
||||
Enable GCC Stack Smashing Protection (SSP) for userspace applications
|
||||
config PKG_CC_STACKPROTECTOR_NONE
|
||||
bool "None"
|
||||
help
|
||||
No stack smashing protection.
|
||||
config PKG_CC_STACKPROTECTOR_REGULAR
|
||||
bool "Regular"
|
||||
help
|
||||
Protects functions with vulnerable objects.
|
||||
This includes functions with buffers larger than 8 bytes or calls to alloca.
|
||||
config PKG_CC_STACKPROTECTOR_STRONG
|
||||
bool "Strong"
|
||||
help
|
||||
Like Regular, but also protects functions with
|
||||
local arrays or references to local frame addresses.
|
||||
config PKG_CC_STACKPROTECTOR_ALL
|
||||
bool "All"
|
||||
help
|
||||
Protects all functions.
|
||||
endchoice
|
||||
|
||||
choice
|
||||
@ -310,10 +321,18 @@ menu "Global build settings"
|
||||
Enable GCC Stack-Smashing Protection (SSP) for the kernel
|
||||
config KERNEL_CC_STACKPROTECTOR_NONE
|
||||
bool "None"
|
||||
help
|
||||
No stack smashing protection.
|
||||
config KERNEL_CC_STACKPROTECTOR_REGULAR
|
||||
bool "Regular"
|
||||
help
|
||||
Protects functions with vulnerable objects.
|
||||
This includes functions with buffers larger than 8 bytes or calls to alloca.
|
||||
config KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
bool "Strong"
|
||||
help
|
||||
Like Regular, but also protects functions with
|
||||
local arrays or references to local frame addresses.
|
||||
endchoice
|
||||
|
||||
config KERNEL_STACKPROTECTOR
|
||||
|
@ -333,6 +333,25 @@ if KERNEL_TASKSTATS
|
||||
|
||||
endif
|
||||
|
||||
config KERNEL_PSI
|
||||
bool "Compile the kernel with pressure stall information tracking"
|
||||
help
|
||||
Collect metrics that indicate how overcommitted the CPU, memory,
|
||||
and IO capacity are in the system.
|
||||
|
||||
If you say Y here, the kernel will create /proc/pressure/ with the
|
||||
pressure statistics files cpu, memory, and io. These will indicate
|
||||
the share of walltime in which some or all tasks in the system are
|
||||
delayed due to contention of the respective resource.
|
||||
|
||||
In kernels with cgroup support, cgroups (cgroup2 only) will
|
||||
have cpu.pressure, memory.pressure, and io.pressure files,
|
||||
which aggregate pressure stalls for the grouped tasks only.
|
||||
|
||||
For more details see Documentation/accounting/psi.rst.
|
||||
|
||||
Say N if unsure.
|
||||
|
||||
config KERNEL_KALLSYMS
|
||||
bool "Compile the kernel with symbol table information"
|
||||
default y if !SMALL_FLASH
|
||||
@ -563,6 +582,15 @@ config KERNEL_BPF_STREAM_PARSER
|
||||
depends on KERNEL_CGROUP_BPF
|
||||
default y if KERNEL_DEBUG_INFO_BTF
|
||||
|
||||
config KERNEL_NETKIT
|
||||
bool "Compile the kernel with BPF-programmable network device support"
|
||||
default y if KERNEL_DEBUG_INFO_BTF
|
||||
help
|
||||
The netkit device is a virtual networking device where BPF programs
|
||||
can be attached to the device(s) transmission routine in order to
|
||||
implement the driver's internal logic. The device can be configured
|
||||
to operate in L3 or L2 mode.
|
||||
|
||||
config KERNEL_AIO
|
||||
bool "Compile the kernel with asynchronous IO support"
|
||||
default y if !SMALL_FLASH
|
||||
@ -1195,9 +1223,11 @@ endif
|
||||
|
||||
config KERNEL_NET_L3_MASTER_DEV
|
||||
bool "L3 Master device support"
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
This module provides glue between core networking code and device
|
||||
drivers to support L3 master devices like VRF.
|
||||
Increases the compressed kernel size by ~4kB (as of Linux 6.6).
|
||||
|
||||
config KERNEL_XDP_SOCKETS
|
||||
bool "XDP sockets support"
|
||||
|
@ -1,8 +1,4 @@
|
||||
src-git packages https://github.com/immortalwrt/packages.git
|
||||
src-git luci https://github.com/immortalwrt/luci.git
|
||||
src-git routing https://github.com/openwrt/routing.git
|
||||
src-git telephony https://github.com/openwrt/telephony.git
|
||||
#src-git-full video https://github.com/openwrt/video.git
|
||||
#src-git-full targets https://github.com/openwrt/targets.git
|
||||
#src-git-full oldpackages http://git.openwrt.org/packages.git
|
||||
#src-link custom /usr/src/openwrt/custom-feed
|
||||
src-git packages https://github.com/immortalwrt/packages.git^4e64a5891e40dab3a2ec2949cc6c4eb111905d86
|
||||
src-git luci https://github.com/immortalwrt/luci.git^314b140efc5d6e9eec69155330d84962887e464d
|
||||
src-git routing https://github.com/openwrt/routing.git^84d97e684bcb6a63dbfdfbfd9ec7407192861239
|
||||
src-git telephony https://github.com/openwrt/telephony.git^fd605af7143165a2490681ec1752f259873b9147
|
||||
|
@ -97,7 +97,7 @@ define Build/Configure/Default
|
||||
-DCMAKE_SYSTEM_NAME=Linux \
|
||||
-DCMAKE_SYSTEM_VERSION=1 \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_BUILD_TYPE=$(if $(CONFIG_DEBUG),Debug,Release) \
|
||||
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
|
||||
|
@ -37,7 +37,7 @@ define FeedSourcesAppendOPKG
|
||||
echo 'src/gz %d_core %U/targets/%S/packages'; \
|
||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
echo 'src/gz %d_base %U/packages/%A/base'; \
|
||||
$(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \
|
||||
$(if $(CONFIG_BUILDBOT), \
|
||||
echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||
$(if $(CONFIG_FEED_$(feed)), \
|
||||
@ -51,7 +51,7 @@ define FeedSourcesAppendAPK
|
||||
echo '%U/targets/%S/packages/packages.adb'; \
|
||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
echo '%U/packages/%A/base/packages.adb'; \
|
||||
$(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \
|
||||
$(if $(CONFIG_BUILDBOT), \
|
||||
echo '%U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)/packages.adb';) \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||
$(if $(CONFIG_FEED_$(feed)), \
|
||||
|
@ -21,6 +21,11 @@ include $(INCLUDE_DIR)/rootfs.mk
|
||||
override MAKE:=$(_SINGLE)$(SUBMAKE)
|
||||
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
|
||||
|
||||
##@
|
||||
# @brief Convert size with unit postfix to unitless expression in bytes.
|
||||
#
|
||||
# @param 1: Size with unit. Possible unit postfix are `g`, `m`, `k`.
|
||||
##
|
||||
exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1))))
|
||||
|
||||
target_params = $(subst +,$(space),$*)
|
||||
@ -111,6 +116,12 @@ endef
|
||||
|
||||
PROFILE_SANITIZED := $(call tolower,$(subst DEVICE_,,$(subst $(space),-,$(PROFILE))))
|
||||
|
||||
##@
|
||||
# @brief Call function for each group of arguments.
|
||||
#
|
||||
# @param 1: List of lists of arguments. Lists are separated by `|`.
|
||||
# @param 2: Function to call for list of arguments.
|
||||
##
|
||||
define split_args
|
||||
$(foreach data, \
|
||||
$(subst |,$(space),\
|
||||
@ -118,12 +129,24 @@ $(foreach data, \
|
||||
$(call $(2),$(strip $(subst ^,$(space),$(data)))))
|
||||
endef
|
||||
|
||||
##@
|
||||
# @brief Call build function with arguments.
|
||||
#
|
||||
# @param 1: Function to call. Function name is prepended with `Build/`.
|
||||
# @param 2...: Function arguments.
|
||||
##
|
||||
define build_cmd
|
||||
$(if $(Build/$(word 1,$(1))),,$(error Missing Build/$(word 1,$(1))))
|
||||
$(call Build/$(word 1,$(1)),$(wordlist 2,$(words $(1)),$(1)))
|
||||
|
||||
endef
|
||||
|
||||
##@
|
||||
# @brief Call build functions from the list.
|
||||
#
|
||||
# @param 1: List of build functions with arguments, separated by `|`.
|
||||
# First word in each group is a build command without `Build/` prefix.
|
||||
##
|
||||
define concat_cmd
|
||||
$(call split_args,$(1),build_cmd)
|
||||
endef
|
||||
@ -163,6 +186,12 @@ DTC_WARN_FLAGS := \
|
||||
DTC_FLAGS += $(DTC_WARN_FLAGS)
|
||||
DTCO_FLAGS += $(DTC_WARN_FLAGS)
|
||||
|
||||
##@
|
||||
# @brief Pad file to specified size.
|
||||
#
|
||||
# @param 1: File.
|
||||
# @param 2: Padding.
|
||||
##
|
||||
define Image/pad-to
|
||||
dd if=$(1) of=$(1).new bs=$(2) conv=sync
|
||||
mv $(1).new $(1)
|
||||
@ -403,26 +432,53 @@ define Device/InitProfile
|
||||
DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
|
||||
endef
|
||||
|
||||
##@
|
||||
# @brief Image configuration variables.
|
||||
#
|
||||
# @param 1: Device name.
|
||||
##
|
||||
define Device/Init
|
||||
##@ Device name.
|
||||
DEVICE_NAME := $(1)
|
||||
##@ Commands to build kernel.
|
||||
# Commands with arguments are separated by `|`.
|
||||
##
|
||||
KERNEL:=
|
||||
##@ Commands to build initramfs.
|
||||
# Commands with arguments are separated by `|`.
|
||||
##
|
||||
KERNEL_INITRAMFS = $$(KERNEL)
|
||||
##@ Kernel command line.
|
||||
CMDLINE:=
|
||||
|
||||
##@ Images to build.
|
||||
IMAGES :=
|
||||
##@ Artifacts to build.
|
||||
ARTIFACTS :=
|
||||
##@ Device image prefix.
|
||||
DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
|
||||
##@ Device image name.
|
||||
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
|
||||
##@ Factory image name.
|
||||
FACTORY_IMG_NAME :=
|
||||
##@ Maximum image size. Optional.
|
||||
IMAGE_SIZE :=
|
||||
##@ Maximum image size. Optional.
|
||||
NAND_SIZE :=
|
||||
##@ Kernel image prefix.
|
||||
KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
|
||||
##@ Kernel image suffix.
|
||||
KERNEL_SUFFIX := -kernel.bin
|
||||
##@ Initramfs image suffix.
|
||||
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
|
||||
##@ Kernel image name.
|
||||
KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX)
|
||||
##@ Initramfs image prefix.
|
||||
KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs
|
||||
KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX)
|
||||
##@ Initramfs image name.
|
||||
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
|
||||
##@ Kernel install flag.
|
||||
KERNEL_INSTALL :=
|
||||
KERNEL_NAME := vmlinux
|
||||
KERNEL_DEPENDS :=
|
||||
|
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .58
|
||||
LINUX_KERNEL_HASH-6.6.58 = e7df81e588d70fab5ec3ec3bb04ac53d51f0860fc3b1ec45e0a4167a026899db
|
||||
LINUX_VERSION-6.6 = .66
|
||||
LINUX_KERNEL_HASH-6.6.66 = 9d757937c4661c2f512c62641b74ef74eff9bb13dc5dbcbaaa108c21152f1e52
|
||||
|
@ -124,7 +124,7 @@ define Build/Configure/Meson
|
||||
$(call Meson/CreateCrossFile,$(PKG_BUILD_DIR)/openwrt-cross.txt)
|
||||
$(call Meson, \
|
||||
setup \
|
||||
--buildtype plain \
|
||||
--buildtype $(if $(CONFIG_DEBUG),debug,plain) \
|
||||
--native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
|
||||
--cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
|
||||
-Ddefault_library=both \
|
||||
|
113
include/optee-os.mk
Normal file
113
include/optee-os.mk
Normal file
@ -0,0 +1,113 @@
|
||||
include $(INCLUDE_DIR)/prereq.mk
|
||||
|
||||
PKG_NAME ?= optee-os
|
||||
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL_FILE:=$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL = https://github.com/OP-TEE/optee_os/archive/refs/tags/
|
||||
TAR_OPTIONS+= --transform 's/optee_os/$(PKG_NAME)/'
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_TARGETS := bin
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PKG_LICENSE:=BSD 2-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_PARALLEL ?= 1
|
||||
|
||||
$(eval $(call TestHostCommand,python3-cryptography, \
|
||||
Please install the Python3 cryptography module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import cryptography'))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-pyelftools, \
|
||||
Please install the Python3 pyelftools module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import elftools'))
|
||||
|
||||
export GCC_HONOUR_COPTS=s
|
||||
|
||||
define Package/optee-os/install/default
|
||||
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/%,$(OPTEE_IMAGE)) $(1)/
|
||||
endef
|
||||
|
||||
Package/optee-os/install = $(Package/optee-os/install/default)
|
||||
|
||||
define Optee-os/Init
|
||||
BUILD_TARGET:=
|
||||
BUILD_SUBTARGET:=
|
||||
BUILD_DEVICES:=
|
||||
NAME:=
|
||||
DEPENDS:=
|
||||
HIDDEN:=
|
||||
DEFAULT:=
|
||||
VARIANT:=$(1)
|
||||
PLAT:=$(1)
|
||||
PLAT_FLAVOR:=
|
||||
OPTEE_IMAGE:=tee-header_v2.bin tee-pager_v2.bin tee-pageable_v2.bin
|
||||
endef
|
||||
|
||||
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
||||
|
||||
define Build/Optee-os/Target
|
||||
$(eval $(call Optee-os/Init,$(1)))
|
||||
$(eval $(call Optee-os/Default,$(1)))
|
||||
$(eval $(call Optee-os/$(1),$(1)))
|
||||
|
||||
define Package/optee-os-$(1)
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=OPTEE-OS for $(NAME)
|
||||
VARIANT:=$(VARIANT)
|
||||
DEPENDS:=@!IN_SDK $(DEPENDS)
|
||||
HIDDEN:=$(HIDDEN)
|
||||
ifneq ($(BUILD_TARGET),)
|
||||
DEPENDS += @$(TARGET_DEP)
|
||||
ifneq ($(BUILD_DEVICES),)
|
||||
DEFAULT := y if ($(TARGET_DEP)_Default \
|
||||
$(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
|
||||
$(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
|
||||
endif
|
||||
endif
|
||||
$(if $(DEFAULT),DEFAULT:=$(DEFAULT))
|
||||
URL:=https://optee.readthedocs.io
|
||||
endef
|
||||
|
||||
define Package/optee-os-$(1)/install
|
||||
$$(Package/optee-os/install)
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/Configure/Optee-os
|
||||
endef
|
||||
|
||||
define Build/Compile/Optee-os
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
||||
PATH=$(LINUX_DIR)/scripts/dtc/:$(PATH) \
|
||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
||||
CROSS_COMPILE_core="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)" \
|
||||
$(if $(CONFIG_ARCH_64BIT), CFG_ARM64_core=y CFG_USER_TA_TARGETS=ta_arm64, CFG_ARM32_core=y) \
|
||||
PLATFORM="$(PLAT)" \
|
||||
PLATFORM_FLAVOR="$(call qstrip,$(PLAT_FLAVOR))" \
|
||||
$(OPTEE_MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define BuildPackage/Optee-os/Defaults
|
||||
Build/Configure/Default = $$$$(Build/Configure/Optee-os)
|
||||
Build/Compile/Default = $$$$(Build/Compile/Optee-os)
|
||||
endef
|
||||
|
||||
define BuildPackage/Optee-os
|
||||
$(eval $(call BuildPackage/Optee-os/Defaults))
|
||||
$(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \
|
||||
$(eval $(call Build/Optee-os/Target,$(type)))
|
||||
)
|
||||
$(eval $(call Build/DefaultTargets))
|
||||
$(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \
|
||||
$(call BuildPackage,optee-os-$(type))
|
||||
)
|
||||
endef
|
@ -7,10 +7,17 @@ ifneq ($(__target_inc),1)
|
||||
__target_inc=1
|
||||
|
||||
|
||||
# default device type
|
||||
##@
|
||||
# @brief Default device type ( basic | nas | router ).
|
||||
##
|
||||
DEVICE_TYPE?=router
|
||||
|
||||
# Default packages - the really basic set
|
||||
##@
|
||||
# @brief Default packages.
|
||||
#
|
||||
# The really basic set. Additional packages are added based on @DEVICE_TYPE and
|
||||
# @CONFIG_* values.
|
||||
##
|
||||
DEFAULT_PACKAGES:=\
|
||||
base-files \
|
||||
ca-bundle \
|
||||
@ -27,15 +34,21 @@ DEFAULT_PACKAGES:=\
|
||||
urandom-seed \
|
||||
urngd
|
||||
|
||||
# For the basic set
|
||||
##@
|
||||
# @brief Default packages for @DEVICE_TYPE basic.
|
||||
##
|
||||
DEFAULT_PACKAGES.basic:=
|
||||
# For nas targets
|
||||
##@
|
||||
# @brief Default packages for @DEVICE_TYPE nas.
|
||||
##
|
||||
DEFAULT_PACKAGES.nas:=\
|
||||
block-mount \
|
||||
fdisk \
|
||||
lsblk \
|
||||
mdadm
|
||||
# For router targets
|
||||
##@
|
||||
# @brief Default packages for @DEVICE_TYPE router.
|
||||
##
|
||||
DEFAULT_PACKAGES.router:=\
|
||||
dnsmasq-full \
|
||||
firewall4 \
|
||||
@ -45,16 +58,16 @@ DEFAULT_PACKAGES.router:=\
|
||||
odhcpd-ipv6only \
|
||||
ppp \
|
||||
ppp-mod-pppoe
|
||||
# For easy usage
|
||||
##@
|
||||
# @brief For easy usage
|
||||
##
|
||||
DEFAULT_PACKAGES.tweak:=\
|
||||
autocore \
|
||||
block-mount \
|
||||
default-settings-chn \
|
||||
kmod-nf-nathelper \
|
||||
kmod-nf-nathelper-extra \
|
||||
luci-light \
|
||||
luci-app-cpufreq \
|
||||
luci-app-opkg \
|
||||
luci-app-package-manager \
|
||||
luci-compat \
|
||||
luci-lib-base \
|
||||
luci-lib-ipkg
|
||||
@ -135,9 +148,20 @@ endif
|
||||
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
|
||||
|
||||
# Add tweaked packages
|
||||
# DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak)
|
||||
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak)
|
||||
|
||||
##@
|
||||
# @brief Filter out packages, prepended with `-`.
|
||||
#
|
||||
# @param 1: Package list.
|
||||
##
|
||||
filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
|
||||
|
||||
##@
|
||||
# @brief Append extra package dependencies.
|
||||
#
|
||||
# @param 1: Package list.
|
||||
##
|
||||
extra_packages = $(if $(filter wpad wpad-% nas,$(1)),iwinfo)
|
||||
|
||||
define ProfileDefault
|
||||
|
@ -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),SNAPSHOT)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.0-rc2)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r32566-56e91d0bbea5)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/snapshots)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/24.10.0-rc2)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),ImmortalWrt)
|
||||
|
@ -251,6 +251,7 @@ ifneq ($(CONFIG_USE_APK),)
|
||||
$(VERSION_SED_SCRIPT) $(1)/etc/apk/repositories
|
||||
|
||||
rm -f $(1)/etc/uci-defaults/13_fix-group-user
|
||||
rm -f $(1)/sbin/pkg_check
|
||||
else
|
||||
$(if $(CONFIG_CLEAN_IPKG),, \
|
||||
mkdir -p $(1)/etc/opkg; \
|
||||
|
@ -24,6 +24,8 @@ boot() {
|
||||
chmod 1777 /var/lock
|
||||
mkdir -p /var/log
|
||||
mkdir -p /var/run
|
||||
ln -s /var/run /run
|
||||
ln -s /var/lock /run/lock
|
||||
mkdir -p /var/state
|
||||
mkdir -p /var/tmp
|
||||
mkdir -p /tmp/.uci
|
||||
@ -34,9 +36,9 @@ boot() {
|
||||
touch /tmp/resolv.conf.d/resolv.conf.auto
|
||||
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf.auto
|
||||
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf
|
||||
grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
|
||||
grep -q debugfs /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t debugfs debugfs /sys/kernel/debug
|
||||
grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf
|
||||
grep -q pstore /proc/filesystems && /bin/mount -o noatime -t pstore pstore /sys/fs/pstore
|
||||
grep -q pstore /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t pstore pstore /sys/fs/pstore
|
||||
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
|
||||
|
||||
touch /tmp/.config_pending
|
||||
|
@ -100,10 +100,6 @@ service_triggers() {
|
||||
return 0
|
||||
}
|
||||
|
||||
service_data() {
|
||||
return 0
|
||||
}
|
||||
|
||||
service_running() {
|
||||
local instance="${1:-*}"
|
||||
|
||||
|
@ -3,10 +3,16 @@
|
||||
json_init
|
||||
json_load "$(cat /etc/board.json)"
|
||||
|
||||
json_select credentials
|
||||
json_get_vars root_password_hash root_password_hash
|
||||
[ -z "$root_password_hash" ] || sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
|
||||
if json_is_a credentials object; then
|
||||
json_select credentials
|
||||
json_get_vars root_password_hash root_password_hash
|
||||
if [ -n "$root_password_hash" ]; then
|
||||
sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
|
||||
fi
|
||||
|
||||
json_get_vars root_password_plain root_password_plain
|
||||
[ -z "$root_password_plain" ] || { (echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root }
|
||||
json_select ..
|
||||
json_get_vars root_password_plain root_password_plain
|
||||
if [ -n "$root_password_plain" ]; then
|
||||
(echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
|
@ -190,7 +190,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "https://downloads.immortalwrt.org/snapshots"
|
||||
default "https://downloads.immortalwrt.org/releases/24.10.0-rc2"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
@ -266,7 +266,7 @@ if VERSIONOPT
|
||||
config VERSION_CODE_FILENAMES
|
||||
bool
|
||||
prompt "Revision code in filenames"
|
||||
default y
|
||||
default n
|
||||
help
|
||||
Enable this to include the revision identifier or the configured
|
||||
version code into the firmware image, SDK- and Image Builder archive
|
||||
|
@ -352,6 +352,15 @@ define Trusted-Firmware-A/mt7986-spim-nand-ddr3
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7986-spim-nand-ubi-ddr3
|
||||
NAME:=MediaTek MT7986 (SPI-NAND via SPIM using UBI, DDR3)
|
||||
BOOT_DEVICE:=spim-nand
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7986
|
||||
DDR_TYPE:=ddr3
|
||||
USE_UBI:=1
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7988-nor-ddr3
|
||||
NAME:=MediaTek MT7988 (SPI-NOR, DDR3)
|
||||
BOOT_DEVICE:=nor
|
||||
@ -531,6 +540,7 @@ TFA_TARGETS:= \
|
||||
mt7986-sdmmc-ddr3 \
|
||||
mt7986-snand-ddr3 \
|
||||
mt7986-spim-nand-ddr3 \
|
||||
mt7986-spim-nand-ubi-ddr3 \
|
||||
mt7986-ram-ddr4 \
|
||||
mt7986-emmc-ddr4 \
|
||||
mt7986-nor-ddr4 \
|
||||
@ -570,6 +580,7 @@ TFA_MAKE_FLAGS += \
|
||||
$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
|
||||
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \
|
||||
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7981,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x100000)) \
|
||||
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7986,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x200000)) \
|
||||
$(if $(RAM_BOOT_UART_DL),bl2,all)
|
||||
|
||||
define Package/trusted-firmware-a-ram/install
|
||||
|
63
package/boot/arm-trusted-firmware-stm32/Makefile
Normal file
63
package/boot/arm-trusted-firmware-stm32/Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
#
|
||||
# Copyright (C) 2024 Bootlin
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201
|
||||
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/trusted-firmware-a.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Trusted-Firmware-A/Default
|
||||
BUILD_TARGET:=stm32
|
||||
BUILD_DEVICES:=$(1)
|
||||
DEPENDS:=+u-boot-$(1) +optee-os-$(1)
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/stm32mp1
|
||||
BUILD_SUBTARGET:=stm32mp1
|
||||
PLAT:=stm32mp1
|
||||
MAKE_ARGS += BL32_EXTRA2=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pageable_v2.bin \
|
||||
STM32MP_USB_PROGRAMMER=1 \
|
||||
STM32MP1_OPTEE_IN_SYSRAM=1 \
|
||||
ARM_ARCH_MAJOR=7
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/stm32mp135f-dk
|
||||
$(call Trusted-Firmware-A/stm32mp1)
|
||||
NAME:=STM32MP135F-DK
|
||||
DTB_FILE_NAME=stm32mp135f-dk.dtb
|
||||
endef
|
||||
|
||||
TFA_TARGETS := stm32mp135f-dk
|
||||
|
||||
TFA_MAKE_FLAGS += \
|
||||
ARCH=aarch32 AARCH32_SP=optee \
|
||||
BL32=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-header_v2.bin \
|
||||
BL32_EXTRA1=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pager_v2.bin \
|
||||
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \
|
||||
BL33_CFG=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.dtb \
|
||||
DTB_FILE_NAME=$(DTB_FILE_NAME) \
|
||||
STM32MP_SDMMC=1 \
|
||||
TARGET_BOARD="" \
|
||||
$(MAKE_ARGS) \
|
||||
all fip
|
||||
|
||||
define Package/trusted-firmware-a/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/tf-a-$(BUILD_VARIANT).stm32 \
|
||||
$(STAGING_DIR_IMAGE)/tf-a-$(BUILD_VARIANT).stm32
|
||||
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \
|
||||
$(STAGING_DIR_IMAGE)/fip-$(BUILD_VARIANT).bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/Trusted-Firmware-A))
|
49
package/boot/optee-os-stm32/Makefile
Normal file
49
package/boot/optee-os-stm32/Makefile
Normal file
@ -0,0 +1,49 @@
|
||||
#
|
||||
# Copyright (C) 2024 Bootlin
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=4.3.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=390b271905c828d6def9fa6a77bbaa425f3b434d733c8eb18f582ccbc6896096
|
||||
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
|
||||
|
||||
OPTEE_USE_INTREE_DTC:=1
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/optee-os.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Optee-os/Default
|
||||
BUILD_TARGET:=stm32
|
||||
endef
|
||||
|
||||
define Optee-os/stm32mp1
|
||||
BUILD_SUBTARGET:=stm32mp1
|
||||
PLAT:=stm32mp1
|
||||
endef
|
||||
|
||||
define Optee-os/stm32mp135f-dk
|
||||
$(call Optee-os/stm32mp1)
|
||||
NAME:=STM32MP135F-DK
|
||||
PLAT_FLAVOR:=135F_DK
|
||||
endef
|
||||
|
||||
OPTEE_TARGETS := stm32mp135f-dk
|
||||
|
||||
define Package/optee-os/install/default
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(foreach img,$(OPTEE_IMAGE), \
|
||||
$(CP) $(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \
|
||||
)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/Optee-os))
|
@ -163,6 +163,7 @@ ruckus,zf7372)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x40000" "0x10000"
|
||||
;;
|
||||
sophos,ap15|\
|
||||
sophos,ap15c|\
|
||||
sophos,ap55|\
|
||||
sophos,ap55c|\
|
||||
sophos,ap100|\
|
||||
|
@ -40,9 +40,11 @@ h3c,magic-nx30-pro|\
|
||||
imou,lc-hx3001|\
|
||||
jcg,q30-pro|\
|
||||
livinet,zr-3020-ubootmod|\
|
||||
mercusys,mr90x-v1-ubi|\
|
||||
netcore,n60|\
|
||||
nokia,ea0326gmp|\
|
||||
qihoo,360t7|\
|
||||
routerich,ax3000-ubootmod|\
|
||||
tplink,tl-xdr4288|\
|
||||
tplink,tl-xdr6086|\
|
||||
tplink,tl-xdr6088|\
|
||||
@ -53,6 +55,16 @@ xiaomi,redmi-router-ax6000-ubootmod|\
|
||||
zyxel,ex5601-t0-ubootmod)
|
||||
ubootenv_add_ubi_default
|
||||
;;
|
||||
acer,predator-w6|\
|
||||
acer,predator-w6d|\
|
||||
acer,vero-w6m|\
|
||||
glinet,gl-mt2500|\
|
||||
glinet,gl-mt6000|\
|
||||
glinet,gl-x3000|\
|
||||
glinet,gl-xe3000)
|
||||
local envdev=$(find_mmc_part "u-boot-env")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
|
||||
;;
|
||||
asus,rt-ax59u)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000"
|
||||
;;
|
||||
@ -92,12 +104,8 @@ comfast,cf-e393ax)
|
||||
dlink,aquila-pro-ai-m30-a1)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
|
||||
;;
|
||||
glinet,gl-x3000|\
|
||||
glinet,gl-xe3000|\
|
||||
glinet,gl-mt2500|\
|
||||
glinet,gl-mt6000)
|
||||
local envdev=$(find_mmc_part "u-boot-env")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
|
||||
gatonetworks,gdsp)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
glinet,gl-mt3000)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
|
||||
|
@ -449,13 +449,26 @@ define U-Boot/mt7981_rfb-emmc
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_gatonetworks_gdsp
|
||||
NAME:=GatoNetworks GDSP
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=gatonetworks_gdsp
|
||||
UBOOT_CONFIG:=mt7981_gatonetworks_gdsp
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=nor
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3
|
||||
FIP_COMPRESS:=1
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-nor
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7981-rfb
|
||||
UBOOT_CONFIG:=mt7981_nor_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_BOOTDEV:=nor
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3
|
||||
@ -485,6 +498,18 @@ define U-Boot/mt7981_rfb-snfi
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-snand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_routerich_ax3000
|
||||
NAME:=Routerich AX3000
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=routerich_ax3000-ubootmod
|
||||
UBOOT_CONFIG:=mt7981_routerich_ax3000
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_qihoo_360t7
|
||||
NAME:=Qihoo 360T7
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -630,6 +655,18 @@ define U-Boot/mt7986_jdcloud_re-cp-03
|
||||
DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7986_mercusys_mr90x-v1
|
||||
NAME:=MERCUSYS MR90X v1
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mercusys_mr90x-v1-ubi
|
||||
UBOOT_CONFIG:=mt7986_mercusys_mr90x-v1
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand-ubi
|
||||
BL2_SOC:=mt7986
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ubi-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7986_netcore_n60
|
||||
NAME:=Netcore N60
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -714,6 +751,18 @@ define U-Boot/mt7986_zyxel_ex5601-t0
|
||||
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-4k-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_arcadyan_mozart
|
||||
NAME:=Arcadyan Mozart
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=arcadyan_mozart
|
||||
UBOOT_CONFIG:=mt7988a_arcadyan_mozart
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=emmc
|
||||
BL2_SOC:=mt7988
|
||||
BL2_DDRTYPE:=comb
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-emmc-comb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_bananapi_bpi-r4-emmc
|
||||
NAME:=BananaPi BPi-R4
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -872,6 +921,7 @@ UBOOT_TARGETS := \
|
||||
mt7981_cmcc_a10 \
|
||||
mt7981_cmcc_rax3000m-emmc \
|
||||
mt7981_cmcc_rax3000m-nand \
|
||||
mt7981_gatonetworks_gdsp \
|
||||
mt7981_glinet_gl-x3000 \
|
||||
mt7981_glinet_gl-xe3000 \
|
||||
mt7981_h3c_magic-nx30-pro \
|
||||
@ -889,6 +939,7 @@ UBOOT_TARGETS := \
|
||||
mt7981_rfb-nor \
|
||||
mt7981_rfb-sd \
|
||||
mt7981_rfb-snfi \
|
||||
mt7981_routerich_ax3000 \
|
||||
mt7981_qihoo_360t7 \
|
||||
mt7981_xiaomi_mi-router-ax3000t \
|
||||
mt7981_xiaomi_mi-router-wr30u \
|
||||
@ -900,6 +951,7 @@ UBOOT_TARGETS := \
|
||||
mt7986_bananapi_bpi-r3-mini-snand \
|
||||
mt7986_glinet_gl-mt6000 \
|
||||
mt7986_jdcloud_re-cp-03 \
|
||||
mt7986_mercusys_mr90x-v1 \
|
||||
mt7986_netcore_n60 \
|
||||
mt7986_tplink_tl-xdr4288 \
|
||||
mt7986_tplink_tl-xdr6086 \
|
||||
@ -908,6 +960,7 @@ UBOOT_TARGETS := \
|
||||
mt7986_xiaomi_redmi-router-ax6000 \
|
||||
mt7986_zyxel_ex5601-t0 \
|
||||
mt7986_rfb \
|
||||
mt7988_arcadyan_mozart \
|
||||
mt7988_bananapi_bpi-r4-emmc \
|
||||
mt7988_bananapi_bpi-r4-sdmmc \
|
||||
mt7988_bananapi_bpi-r4-snand \
|
||||
@ -923,7 +976,8 @@ UBOOT_TARGETS := \
|
||||
UBOOT_CUSTOMIZE_CONFIG := \
|
||||
--disable TOOLS_KWBIMAGE \
|
||||
--disable TOOLS_LIBCRYPTO \
|
||||
--disable TOOLS_MKEFICAPSULE
|
||||
--disable TOOLS_MKEFICAPSULE \
|
||||
--enable SERIAL_RX_BUFFER
|
||||
|
||||
ifdef CONFIG_TARGET_mediatek
|
||||
UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE:.fip=.bin)
|
||||
|
@ -0,0 +1,63 @@
|
||||
From 72b4ba8417d33516b8489bac3c90dbbbf781a3d2 Mon Sep 17 00:00:00 2001
|
||||
From: Weijie Gao <weijie.gao@mediatek.com>
|
||||
Date: Tue, 29 Oct 2024 17:47:10 +0800
|
||||
Subject: [PATCH 1/3] menu: fix the logic checking whether ESC key is pressed
|
||||
|
||||
It's observed that the bootmenu on a serial console sometimes
|
||||
incorrectly quitted with superfluous characters filled to command
|
||||
line input:
|
||||
|
||||
> *** U-Boot Boot Menu ***
|
||||
>
|
||||
> 1. Startup system (Default)
|
||||
> 2. Upgrade firmware
|
||||
> 3. Upgrade ATF BL2
|
||||
> 4. Upgrade ATF FIP
|
||||
> 5. Load image
|
||||
> 0. U-Boot console
|
||||
>
|
||||
>
|
||||
> Press UP/DOWN to move, ENTER to select, ESC to quit
|
||||
>MT7988> [B
|
||||
|
||||
Analysis shows it was caused by the wrong logic of bootmenu_loop:
|
||||
|
||||
At first the bootmenu_loop received the first ESC char correctly.
|
||||
|
||||
However, during the second call to bootmenu_loop, there's no data
|
||||
in the UART Rx FIFO. Due to the low baudrate, the second char of
|
||||
the down array key sequence hasn't be fully received.
|
||||
|
||||
But bootmenu_loop just did a mdelay(10), and then treated it as a
|
||||
single ESC key press event. It didn't even try tstc() again after
|
||||
the 10ms timeout.
|
||||
|
||||
This patch fixes this issue by letting bootmenu_loop check tstc()
|
||||
twice.
|
||||
|
||||
Tested-By: E Shattow <lucent@gmail.com>
|
||||
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
---
|
||||
common/menu.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/common/menu.c
|
||||
+++ b/common/menu.c
|
||||
@@ -525,14 +525,15 @@ enum bootmenu_key bootmenu_loop(struct b
|
||||
struct cli_ch_state *cch)
|
||||
{
|
||||
enum bootmenu_key key;
|
||||
- int c;
|
||||
+ int c, errchar = 0;
|
||||
|
||||
c = cli_ch_process(cch, 0);
|
||||
if (!c) {
|
||||
while (!c && !tstc()) {
|
||||
schedule();
|
||||
mdelay(10);
|
||||
- c = cli_ch_process(cch, -ETIMEDOUT);
|
||||
+ c = cli_ch_process(cch, errchar);
|
||||
+ errchar = -ETIMEDOUT;
|
||||
}
|
||||
if (!c) {
|
||||
c = getchar();
|
@ -0,0 +1,112 @@
|
||||
From f1cbdd3330f0055dfbff0ef7d86276c4cc3cff2a Mon Sep 17 00:00:00 2001
|
||||
From: Weijie Gao <weijie.gao@mediatek.com>
|
||||
Date: Tue, 29 Oct 2024 17:47:16 +0800
|
||||
Subject: [PATCH 2/3] menu: add support to check if menu needs to be reprinted
|
||||
|
||||
This patch adds a new callback named need_reprint for menu.
|
||||
The need_reprint will be called before printing the menu. If the
|
||||
callback exists and returns FALSE, menu printing will be canceled.
|
||||
|
||||
This is very useful if the menu was not changed. It can save time
|
||||
for serial-based menu to handle more input data.
|
||||
|
||||
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
---
|
||||
boot/pxe_utils.c | 2 +-
|
||||
cmd/bootmenu.c | 2 +-
|
||||
cmd/eficonfig.c | 2 +-
|
||||
common/menu.c | 11 +++++++++++
|
||||
include/menu.h | 1 +
|
||||
5 files changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/boot/pxe_utils.c
|
||||
+++ b/boot/pxe_utils.c
|
||||
@@ -1449,7 +1449,7 @@ static struct menu *pxe_menu_to_menu(str
|
||||
* Create a menu and add items for all the labels.
|
||||
*/
|
||||
m = menu_create(cfg->title, DIV_ROUND_UP(cfg->timeout, 10),
|
||||
- cfg->prompt, NULL, label_print, NULL, NULL);
|
||||
+ cfg->prompt, NULL, label_print, NULL, NULL, NULL);
|
||||
if (!m)
|
||||
return NULL;
|
||||
|
||||
--- a/cmd/bootmenu.c
|
||||
+++ b/cmd/bootmenu.c
|
||||
@@ -506,7 +506,7 @@ static enum bootmenu_ret bootmenu_show(i
|
||||
|
||||
menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
|
||||
bootmenu_print_entry, bootmenu_choice_entry,
|
||||
- bootmenu);
|
||||
+ NULL, bootmenu);
|
||||
if (!menu) {
|
||||
bootmenu_destroy(bootmenu);
|
||||
return BOOTMENU_RET_FAIL;
|
||||
--- a/cmd/eficonfig.c
|
||||
+++ b/cmd/eficonfig.c
|
||||
@@ -443,7 +443,7 @@ efi_status_t eficonfig_process_common(st
|
||||
efi_menu->menu_desc = menu_desc;
|
||||
|
||||
menu = menu_create(NULL, 0, 1, display_statusline, item_data_print,
|
||||
- item_choice, efi_menu);
|
||||
+ item_choice, NULL, efi_menu);
|
||||
if (!menu)
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
||||
--- a/common/menu.c
|
||||
+++ b/common/menu.c
|
||||
@@ -43,6 +43,7 @@ struct menu {
|
||||
void (*display_statusline)(struct menu *);
|
||||
void (*item_data_print)(void *);
|
||||
char *(*item_choice)(void *);
|
||||
+ bool (*need_reprint)(void *);
|
||||
void *item_choice_data;
|
||||
struct list_head items;
|
||||
int item_cnt;
|
||||
@@ -117,6 +118,11 @@ static inline void *menu_item_destroy(st
|
||||
*/
|
||||
static inline void menu_display(struct menu *m)
|
||||
{
|
||||
+ if (m->need_reprint) {
|
||||
+ if (!m->need_reprint(m->item_choice_data))
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (m->title) {
|
||||
puts(m->title);
|
||||
putc('\n');
|
||||
@@ -362,6 +368,9 @@ int menu_item_add(struct menu *m, char *
|
||||
* item. Returns a key string corresponding to the chosen item or NULL if
|
||||
* no item has been selected.
|
||||
*
|
||||
+ * need_reprint - If not NULL, will be called before printing the menu.
|
||||
+ * Returning FALSE means the menu does not need reprint.
|
||||
+ *
|
||||
* item_choice_data - Will be passed as the argument to the item_choice function
|
||||
*
|
||||
* Returns a pointer to the menu if successful, or NULL if there is
|
||||
@@ -371,6 +380,7 @@ struct menu *menu_create(char *title, in
|
||||
void (*display_statusline)(struct menu *),
|
||||
void (*item_data_print)(void *),
|
||||
char *(*item_choice)(void *),
|
||||
+ bool (*need_reprint)(void *),
|
||||
void *item_choice_data)
|
||||
{
|
||||
struct menu *m;
|
||||
@@ -386,6 +396,7 @@ struct menu *menu_create(char *title, in
|
||||
m->display_statusline = display_statusline;
|
||||
m->item_data_print = item_data_print;
|
||||
m->item_choice = item_choice;
|
||||
+ m->need_reprint = need_reprint;
|
||||
m->item_choice_data = item_choice_data;
|
||||
m->item_cnt = 0;
|
||||
|
||||
--- a/include/menu.h
|
||||
+++ b/include/menu.h
|
||||
@@ -13,6 +13,7 @@ struct menu *menu_create(char *title, in
|
||||
void (*display_statusline)(struct menu *),
|
||||
void (*item_data_print)(void *),
|
||||
char *(*item_choice)(void *),
|
||||
+ bool (*need_reprint)(void *),
|
||||
void *item_choice_data);
|
||||
int menu_default_set(struct menu *m, char *item_key);
|
||||
int menu_get_choice(struct menu *m, void **choice);
|
@ -0,0 +1,75 @@
|
||||
From 702752cfae954648d6133bdff19283343b3339ef Mon Sep 17 00:00:00 2001
|
||||
From: Weijie Gao <weijie.gao@mediatek.com>
|
||||
Date: Tue, 29 Oct 2024 17:47:22 +0800
|
||||
Subject: [PATCH 3/3] bootmenu: add reprint check
|
||||
|
||||
Record the last active menu item and check if it equals to the
|
||||
current selected item before reprint.
|
||||
|
||||
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
---
|
||||
cmd/bootmenu.c | 16 +++++++++++++++-
|
||||
include/menu.h | 1 +
|
||||
2 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/cmd/bootmenu.c
|
||||
+++ b/cmd/bootmenu.c
|
||||
@@ -103,11 +103,13 @@ static char *bootmenu_choice_entry(void
|
||||
|
||||
switch (key) {
|
||||
case BKEY_UP:
|
||||
+ menu->last_active = menu->active;
|
||||
if (menu->active > 0)
|
||||
--menu->active;
|
||||
/* no menu key selected, regenerate menu */
|
||||
return NULL;
|
||||
case BKEY_DOWN:
|
||||
+ menu->last_active = menu->active;
|
||||
if (menu->active < menu->count - 1)
|
||||
++menu->active;
|
||||
/* no menu key selected, regenerate menu */
|
||||
@@ -133,6 +135,17 @@ static char *bootmenu_choice_entry(void
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+static bool bootmenu_need_reprint(void *data)
|
||||
+{
|
||||
+ struct bootmenu_data *menu = data;
|
||||
+ bool need_reprint;
|
||||
+
|
||||
+ need_reprint = menu->last_active != menu->active;
|
||||
+ menu->last_active = menu->active;
|
||||
+
|
||||
+ return need_reprint;
|
||||
+}
|
||||
+
|
||||
static void bootmenu_destroy(struct bootmenu_data *menu)
|
||||
{
|
||||
struct bootmenu_entry *iter = menu->first;
|
||||
@@ -332,6 +345,7 @@ static struct bootmenu_data *bootmenu_cr
|
||||
|
||||
menu->delay = delay;
|
||||
menu->active = 0;
|
||||
+ menu->last_active = -1;
|
||||
menu->first = NULL;
|
||||
|
||||
default_str = env_get("bootmenu_default");
|
||||
@@ -506,7 +520,7 @@ static enum bootmenu_ret bootmenu_show(i
|
||||
|
||||
menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
|
||||
bootmenu_print_entry, bootmenu_choice_entry,
|
||||
- NULL, bootmenu);
|
||||
+ bootmenu_need_reprint, bootmenu);
|
||||
if (!menu) {
|
||||
bootmenu_destroy(bootmenu);
|
||||
return BOOTMENU_RET_FAIL;
|
||||
--- a/include/menu.h
|
||||
+++ b/include/menu.h
|
||||
@@ -40,6 +40,7 @@ int menu_show(int bootdelay);
|
||||
struct bootmenu_data {
|
||||
int delay; /* delay for autoboot */
|
||||
int active; /* active menu entry */
|
||||
+ int last_active; /* last active menu entry */
|
||||
int count; /* total count of menu entries */
|
||||
struct bootmenu_entry *first; /* first menu entry */
|
||||
};
|
@ -35,7 +35,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
@@ -112,6 +113,12 @@ static char *bootmenu_choice_entry(void
|
||||
@@ -114,6 +115,12 @@ static char *bootmenu_choice_entry(void
|
||||
++menu->active;
|
||||
/* no menu key selected, regenerate menu */
|
||||
return NULL;
|
||||
@ -48,7 +48,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
case BKEY_SELECT:
|
||||
iter = menu->first;
|
||||
for (i = 0; i < menu->active; ++i)
|
||||
@@ -169,6 +176,9 @@ static int prepare_bootmenu_entry(struct
|
||||
@@ -182,6 +189,9 @@ static int prepare_bootmenu_entry(struct
|
||||
unsigned short int i = *index;
|
||||
struct bootmenu_entry *entry = NULL;
|
||||
struct bootmenu_entry *iter = *current;
|
||||
@ -58,7 +58,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
while ((option = bootmenu_getoption(i))) {
|
||||
|
||||
@@ -183,11 +193,24 @@ static int prepare_bootmenu_entry(struct
|
||||
@@ -196,11 +206,24 @@ static int prepare_bootmenu_entry(struct
|
||||
if (!entry)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -84,15 +84,15 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
entry->command = strdup(sep + 1);
|
||||
if (!entry->command) {
|
||||
@@ -333,6 +356,7 @@ static struct bootmenu_data *bootmenu_cr
|
||||
menu->delay = delay;
|
||||
@@ -347,6 +370,7 @@ static struct bootmenu_data *bootmenu_cr
|
||||
menu->active = 0;
|
||||
menu->last_active = -1;
|
||||
menu->first = NULL;
|
||||
+ menu->last_choiced = false;
|
||||
|
||||
default_str = env_get("bootmenu_default");
|
||||
if (default_str)
|
||||
@@ -368,9 +392,9 @@ static struct bootmenu_data *bootmenu_cr
|
||||
@@ -382,9 +406,9 @@ static struct bootmenu_data *bootmenu_cr
|
||||
|
||||
/* Add Quit entry if exiting bootmenu is disabled */
|
||||
if (!IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE))
|
||||
@ -106,7 +106,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
free(entry);
|
||||
--- a/common/menu.c
|
||||
+++ b/common/menu.c
|
||||
@@ -48,6 +48,33 @@ struct menu {
|
||||
@@ -49,6 +49,33 @@ struct menu {
|
||||
int item_cnt;
|
||||
};
|
||||
|
||||
@ -140,7 +140,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
/*
|
||||
* An iterator function for menu items. callback will be called for each item
|
||||
* in m, with m, a pointer to the item, and extra being passed to callback. If
|
||||
@@ -426,7 +453,7 @@ int menu_destroy(struct menu *m)
|
||||
@@ -437,7 +464,7 @@ int menu_destroy(struct menu *m)
|
||||
}
|
||||
|
||||
enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
|
||||
@ -149,7 +149,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
{
|
||||
enum bootmenu_key key = BKEY_NONE;
|
||||
int i, c;
|
||||
@@ -461,6 +488,19 @@ enum bootmenu_key bootmenu_autoboot_loop
|
||||
@@ -472,6 +499,19 @@ enum bootmenu_key bootmenu_autoboot_loop
|
||||
break;
|
||||
default:
|
||||
key = BKEY_NONE;
|
||||
@ -169,7 +169,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -481,7 +521,8 @@ enum bootmenu_key bootmenu_autoboot_loop
|
||||
@@ -492,7 +532,8 @@ enum bootmenu_key bootmenu_autoboot_loop
|
||||
return key;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
{
|
||||
enum bootmenu_key key;
|
||||
|
||||
@@ -513,6 +554,20 @@ enum bootmenu_key bootmenu_conv_key(int
|
||||
@@ -524,6 +565,20 @@ enum bootmenu_key bootmenu_conv_key(int
|
||||
case ' ':
|
||||
key = BKEY_SPACE;
|
||||
break;
|
||||
@ -200,15 +200,16 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
default:
|
||||
key = BKEY_NONE;
|
||||
break;
|
||||
@@ -522,11 +577,16 @@ enum bootmenu_key bootmenu_conv_key(int
|
||||
@@ -533,11 +588,17 @@ enum bootmenu_key bootmenu_conv_key(int
|
||||
}
|
||||
|
||||
enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
|
||||
- struct cli_ch_state *cch)
|
||||
+ struct cli_ch_state *cch, int *choice)
|
||||
+ struct cli_ch_state *cch,
|
||||
+ int *choice)
|
||||
{
|
||||
enum bootmenu_key key;
|
||||
int c;
|
||||
int c, errchar = 0;
|
||||
|
||||
+ if (menu->last_choiced) {
|
||||
+ menu->last_choiced = false;
|
||||
@ -218,7 +219,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
c = cli_ch_process(cch, 0);
|
||||
if (!c) {
|
||||
while (!c && !tstc()) {
|
||||
@@ -540,7 +600,7 @@ enum bootmenu_key bootmenu_loop(struct b
|
||||
@@ -552,7 +613,7 @@ enum bootmenu_key bootmenu_loop(struct b
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +239,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
struct cli_ch_state;
|
||||
struct menu;
|
||||
|
||||
@@ -19,6 +21,8 @@ int menu_get_choice(struct menu *m, void
|
||||
@@ -20,6 +22,8 @@ int menu_get_choice(struct menu *m, void
|
||||
int menu_item_add(struct menu *m, char *item_key, void *item_data);
|
||||
int menu_destroy(struct menu *m);
|
||||
int menu_default_choice(struct menu *m, void **choice);
|
||||
@ -247,15 +248,15 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
/**
|
||||
* menu_show() Show a boot menu
|
||||
@@ -41,6 +45,7 @@ struct bootmenu_data {
|
||||
int active; /* active menu entry */
|
||||
@@ -43,6 +47,7 @@ struct bootmenu_data {
|
||||
int last_active; /* last active menu entry */
|
||||
int count; /* total count of menu entries */
|
||||
struct bootmenu_entry *first; /* first menu entry */
|
||||
+ bool last_choiced;
|
||||
};
|
||||
|
||||
/** enum bootmenu_key - keys that can be returned by the bootmenu */
|
||||
@@ -51,6 +56,7 @@ enum bootmenu_key {
|
||||
@@ -53,6 +58,7 @@ enum bootmenu_key {
|
||||
BKEY_SELECT,
|
||||
BKEY_QUIT,
|
||||
BKEY_SAVE,
|
||||
@ -263,7 +264,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
/* 'extra' keys, which are used by menus but not cedit */
|
||||
BKEY_PLUS,
|
||||
@@ -81,7 +87,7 @@ enum bootmenu_key {
|
||||
@@ -83,7 +89,7 @@ enum bootmenu_key {
|
||||
* anything else: KEY_NONE
|
||||
*/
|
||||
enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
|
||||
@ -272,7 +273,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
/**
|
||||
* bootmenu_loop() - handle waiting for a keypress when autoboot is disabled
|
||||
@@ -107,7 +113,7 @@ enum bootmenu_key bootmenu_autoboot_loop
|
||||
@@ -109,7 +115,7 @@ enum bootmenu_key bootmenu_autoboot_loop
|
||||
* Space: BKEY_SPACE
|
||||
*/
|
||||
enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
|
||||
@ -281,7 +282,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
/**
|
||||
* bootmenu_conv_key() - Convert a U-Boot keypress into a menu key
|
||||
@@ -115,6 +121,7 @@ enum bootmenu_key bootmenu_loop(struct b
|
||||
@@ -117,6 +123,7 @@ enum bootmenu_key bootmenu_loop(struct b
|
||||
* @ichar: Keypress to convert (ASCII, including control characters)
|
||||
* Returns: Menu key that corresponds to @ichar, or BKEY_NONE if none
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/cmd/bootmenu.c
|
||||
+++ b/cmd/bootmenu.c
|
||||
@@ -451,7 +451,11 @@ static void menu_display_statusline(stru
|
||||
@@ -465,7 +465,11 @@ static void menu_display_statusline(stru
|
||||
printf(ANSI_CURSOR_POSITION, 1, 1);
|
||||
puts(ANSI_CLEAR_LINE);
|
||||
printf(ANSI_CURSOR_POSITION, 2, 3);
|
||||
@ -13,7 +13,7 @@
|
||||
puts(ANSI_CLEAR_LINE_TO_END);
|
||||
printf(ANSI_CURSOR_POSITION, 3, 1);
|
||||
puts(ANSI_CLEAR_LINE);
|
||||
@@ -536,6 +540,7 @@ static enum bootmenu_ret bootmenu_show(i
|
||||
@@ -550,6 +554,7 @@ static enum bootmenu_ret bootmenu_show(i
|
||||
return BOOTMENU_RET_FAIL;
|
||||
}
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
goto cleanup;
|
||||
--- a/include/menu.h
|
||||
+++ b/include/menu.h
|
||||
@@ -45,6 +45,7 @@ struct bootmenu_data {
|
||||
int active; /* active menu entry */
|
||||
@@ -47,6 +47,7 @@ struct bootmenu_data {
|
||||
int last_active; /* last active menu entry */
|
||||
int count; /* total count of menu entries */
|
||||
struct bootmenu_entry *first; /* first menu entry */
|
||||
+ char *mtitle; /* custom menu title */
|
||||
|
@ -0,0 +1,308 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7988a_arcadyan_mozart_defconfig
|
||||
@@ -0,0 +1,119 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_ENV_SIZE=0x40000
|
||||
+CONFIG_ENV_OFFSET=0x400000
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7988a-arcadyan-mozart"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7988=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_DEBUG_UART_BASE=0x11000000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_ENV_OFFSET_REDUND=0x440000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x50000000
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_AHCI=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_OF_SYSTEM_SETUP=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7988a-arcadyan-mozart.dtb"
|
||||
+CONFIG_SYS_CBSIZE=512
|
||||
+CONFIG_SYS_PBSIZE=1049
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="MT7988> "
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_PWM=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="arcadyan_mozart_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SUPPORT_EMMC_BOOT=y
|
||||
+CONFIG_MMC_HS200_SUPPORT=y
|
||||
+CONFIG_MMC_MTK=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7988=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_SCSI=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/arcadyan_mozart_env
|
||||
@@ -0,0 +1,55 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x50000000
|
||||
+bootargs=console=ttyS0,115200n1 pci=pcie_bus_perf root=/dev/fit0 rootwait
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
|
||||
+bootconf=config-1
|
||||
+bootconf_extra=
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-arcadyan_mozart-initramfs.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-arcadyan_mozart-emmc-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-arcadyan_mozart-emmc-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-arcadyan_mozart-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=blue:status
|
||||
+bootled_rec=red:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) ) [0;36m[eMMC][0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to eMMC.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to eMMC.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf#$bootconf_extra ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf#$bootconf_extra ; led $bootled_rec off
|
||||
+boot_emmc=run boot_production ; run boot_recovery
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf#$bootconf_extra ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
|
||||
+mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=eraseenv && reset
|
||||
+emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
|
||||
+emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
|
||||
+emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
|
||||
+emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
|
||||
+emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
|
||||
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
|
||||
+_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7988a-arcadyan-mozart.dts
|
||||
@@ -0,0 +1,125 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7988.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "MediaTek / Arcadyan - Mozart";
|
||||
+ compatible = "arcadyan,mozart", "mediatek,mt7988";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0 0x40000000 0 0x40000000>;
|
||||
+ };
|
||||
+
|
||||
+ reg_3p3v: regulator-3p3v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-3.3V";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ reg_1p8v: regulator-1p8v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-1.8V";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ wps {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 143 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-red {
|
||||
+ label = "red:status";
|
||||
+ gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ led-green {
|
||||
+ label = "blue:status";
|
||||
+ gpios = <&gpio 30 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ led-blue {
|
||||
+ label = "blue:status";
|
||||
+ gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "usxgmii";
|
||||
+ mediatek,switch = "mt7988";
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <1000>;
|
||||
+ full-duplex;
|
||||
+ pause;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ mmc0_pins_default: mmc0default {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "emmc_51";
|
||||
+ };
|
||||
+
|
||||
+ conf-cmd-dat {
|
||||
+ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
|
||||
+ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
|
||||
+ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
|
||||
+ input-enable;
|
||||
+ };
|
||||
+
|
||||
+ conf-clk {
|
||||
+ pins = "EMMC_CK";
|
||||
+ };
|
||||
+
|
||||
+ conf-dsl {
|
||||
+ pins = "EMMC_DSL";
|
||||
+ };
|
||||
+
|
||||
+ conf-rst {
|
||||
+ pins = "EMMC_RSTB";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc0_pins_default>;
|
||||
+ max-frequency = <52000000>;
|
||||
+ bus-width = <8>;
|
||||
+ cap-mmc-highspeed;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ vmmc-supply = <®_3p3v>;
|
||||
+ vqmmc-supply = <®_1p8v>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+};
|
@ -0,0 +1,54 @@
|
||||
From 9c1ad8a18ac1a20aee7a617964bcae3e90dac700 Mon Sep 17 00:00:00 2001
|
||||
From: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:46:35 +0200
|
||||
Subject: [PATCH] uboot-mediatek: initialized the watchdog subsystem later
|
||||
|
||||
Initialize the watchdog subsystem later during initialization, to allow for
|
||||
the gpio-wdt driver to work.
|
||||
|
||||
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
---
|
||||
common/board_r.c | 11 ++++-------
|
||||
1 file changed, 4 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/common/board_r.c
|
||||
+++ b/common/board_r.c
|
||||
@@ -663,19 +663,13 @@ static init_fnc_t init_sequence_r[] = {
|
||||
serial_initialize,
|
||||
initr_announce,
|
||||
dm_announce,
|
||||
-#if CONFIG_IS_ENABLED(WDT)
|
||||
- initr_watchdog,
|
||||
-#endif
|
||||
- INIT_FUNC_WATCHDOG_RESET
|
||||
arch_initr_trap,
|
||||
#if defined(CONFIG_BOARD_EARLY_INIT_R)
|
||||
board_early_init_r,
|
||||
#endif
|
||||
- INIT_FUNC_WATCHDOG_RESET
|
||||
#ifdef CONFIG_POST
|
||||
post_output_backlog,
|
||||
#endif
|
||||
- INIT_FUNC_WATCHDOG_RESET
|
||||
#if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT)
|
||||
/*
|
||||
* Do early PCI configuration _before_ the flash gets initialised,
|
||||
@@ -690,7 +684,6 @@ static init_fnc_t init_sequence_r[] = {
|
||||
#ifdef CONFIG_MTD_NOR_FLASH
|
||||
initr_flash,
|
||||
#endif
|
||||
- INIT_FUNC_WATCHDOG_RESET
|
||||
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
|
||||
/* initialize higher level parts of CPU like time base and timers */
|
||||
cpu_init_r,
|
||||
@@ -719,6 +712,10 @@ static init_fnc_t init_sequence_r[] = {
|
||||
#ifdef CONFIG_PVBLOCK
|
||||
initr_pvblock,
|
||||
#endif
|
||||
+#if CONFIG_IS_ENABLED(WDT)
|
||||
+ initr_watchdog,
|
||||
+#endif
|
||||
+ INIT_FUNC_WATCHDOG_RESET
|
||||
initr_env,
|
||||
#ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
|
||||
initr_malloc_bootparams,
|
@ -0,0 +1,406 @@
|
||||
From 57d0f608d925cb688b5c9b71512fca7d228f07f6 Mon Sep 17 00:00:00 2001
|
||||
From: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 20:39:28 +0200
|
||||
Subject: [PATCH] add GatoNetworks GDSP
|
||||
|
||||
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
---
|
||||
arch/arm/dts/mt7981-gatonetworks_gdsp.dts | 200 +++++++++++++++++++++
|
||||
configs/mt7981_gatonetworks_gdsp_defconfig | 144 +++++++++++++++
|
||||
gatonetworks_gdsp_env | 38 ++++
|
||||
3 files changed, 382 insertions(+)
|
||||
create mode 100644 arch/arm/dts/mt7981-gatonetworks_gdsp.dts
|
||||
create mode 100644 configs/mt7981_gatonetworks_gdsp_defconfig
|
||||
create mode 100644 gatonetworks_gdsp_env
|
||||
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-gatonetworks_gdsp.dts
|
||||
@@ -0,0 +1,200 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "GatoNetworks GDSP";
|
||||
+ compatible = "gatonetworks,gdsp", "mediatek,mt7981";
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ reset {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ sim1 {
|
||||
+ label = "sim1";
|
||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sim2 {
|
||||
+ label = "sim2";
|
||||
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sg1 {
|
||||
+ label = "sg1";
|
||||
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sg2 {
|
||||
+ label = "sg2";
|
||||
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sg3 {
|
||||
+ label = "sg3";
|
||||
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sg4 {
|
||||
+ label = "sg4";
|
||||
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sg5 {
|
||||
+ label = "sg5";
|
||||
+ gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ sg6 {
|
||||
+ label = "sg6";
|
||||
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+ gpio-watchdog {
|
||||
+ compatible = "linux,wdt-gpio";
|
||||
+ gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
|
||||
+ hw_algo = "toggle";
|
||||
+ hw_margin_ms = <25000>;
|
||||
+ always-running;
|
||||
+ u-boot,autostart;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi2_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ support_quad;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ flash@0 {
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@00000 {
|
||||
+ label = "BL2";
|
||||
+ reg = <0x00000 0x0040000>;
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ partition@40000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x40000 0x0010000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@50000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x50000 0x00B0000>;
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "FIP";
|
||||
+ reg = <0x100000 0x0080000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@180000 {
|
||||
+ label = "firmware";
|
||||
+ reg = <0x180000 0x1E80000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ uart1_pins: uart1-pins {
|
||||
+ mux {
|
||||
+ function = "uart";
|
||||
+ groups = "uart1_0";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ uart2_pins: uart2-pins {
|
||||
+ mux {
|
||||
+ function = "uart";
|
||||
+ groups = "uart2_0_tx_rx";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ spi2_flash_pins: spi2-pins {
|
||||
+ mux {
|
||||
+ function = "spi";
|
||||
+ groups = "spi2", "spi2_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart2_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_gatonetworks_gdsp_defconfig
|
||||
@@ -0,0 +1,144 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_ENV_SIZE=0x10000
|
||||
+CONFIG_ENV_OFFSET=0x0
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-gatonetworks_gdsp"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_WATCHDOG_TIMEOUT_MSECS=25000
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_USE_PREBOOT=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mt7981-gatonetworks_gdsp"
|
||||
+CONFIG_SYS_CBSIZE=512
|
||||
+CONFIG_SYS_PBSIZE=1049
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_CONSOLE_MUX=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="GDSP> "
|
||||
+CONFIG_SYS_MAXARGS=16
|
||||
+CONFIG_CMD_BDINFO_EXTRA=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_HISTORY=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+# CONFIG_BOOTM_NETBSD is not set
|
||||
+# CONFIG_BOOTM_PLAN9 is not set
|
||||
+# CONFIG_BOOTM_RTEMS is not set
|
||||
+# CONFIG_BOOTM_VXWORKS is not set
|
||||
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_CALLBACK=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CRC32_VERIFY=y
|
||||
+CONFIG_LOOPW=y
|
||||
+CONFIG_CMD_MEMINFO=y
|
||||
+CONFIG_CMD_MEMTEST=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+# CONFIG_CMD_UNLZ4 is not set
|
||||
+# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPIO_READ=y
|
||||
+CONFIG_CMD_PWM=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+# CONFIG_CMD_NAND_EXT is not set
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_CAT=y
|
||||
+CONFIG_CMD_SETEXPR_FMT=y
|
||||
+CONFIG_CMD_XXD=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_TFTPPUT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+# CONFIG_CMD_EFICONFIG is not set
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MTD=y
|
||||
+CONFIG_ENV_MTD_NAME="u-boot-env"
|
||||
+CONFIG_ENV_SIZE_REDUND=0x0
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="gatonetworks_gdsp_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_DM_SPI_FLASH=y
|
||||
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
|
||||
+CONFIG_SPI_FLASH_EON=y
|
||||
+CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
+CONFIG_SPI_FLASH_ISSI=y
|
||||
+CONFIG_SPI_FLASH_MACRONIX=y
|
||||
+CONFIG_SPI_FLASH_SPANSION=y
|
||||
+CONFIG_SPI_FLASH_STMICRO=y
|
||||
+CONFIG_SPI_FLASH_WINBOND=y
|
||||
+CONFIG_SPI_FLASH_XMC=y
|
||||
+CONFIG_SPI_FLASH_XTX=y
|
||||
+CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_UBI_SILENCE_MSG=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_MTK=y
|
||||
+CONFIG_USB_STORAGE=y
|
||||
+CONFIG_WDT=y
|
||||
+CONFIG_WDT_GPIO=y
|
||||
+CONFIG_UBIFS_SILENCE_MSG=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/gatonetworks_gdsp_env
|
||||
@@ -0,0 +1,38 @@
|
||||
+load_factory_data=if env exists factory_data_present ; then else mtd read Factory $loadaddr 0x0 0x1000 ; setenv factory_data_present 1 ; fi
|
||||
+lan_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x2a ; env readmem -b lan_mac $macoffs 0x6 ; setenv lan_mac_factory ; setenv macoffs
|
||||
+wan_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x24 ; env readmem -b wan_mac $macoffs 0x6 ; setenv wan_mac_factory ; setenv macoffs
|
||||
+label_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x4 ; env readmem -b label_mac $macoffs 0x6 ; setenv label_mac_factory ; setenv macoffs
|
||||
+ethaddr_factory=setenv ethaddr $lan_mac ; setenv ethaddr_factory
|
||||
+wifi_mac_factory=setenv wifi_mac $label_mac ; setenv wifi_mac_factory
|
||||
+env_cleanup=setenv load_factory_data ; setenv factory_data_present ; setenv env_cleanup
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.10
|
||||
+loadaddr=0x46000000
|
||||
+bootcmd=run boot_nor
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin
|
||||
+bootfile_upg=openwrt-mediatek-filogic-gatonetworks_gdsp-squashfs-sysupgrade.bin
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )[0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot system from flash.=run boot_nor ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Load system via TFTP then write to flash.=run boot_tftp_sysupgrade ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+bootmenu_5=Reboot.=reset
|
||||
+boot_first=if button reset ; then run boot_tftp ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_tftp_forever
|
||||
+boot_nor=mtd read firmware ${loadaddr} ; bootm $loadaddr
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
|
||||
+boot_tftp_forever=while true ; do run boot_tftp ; sleep 1 ; done
|
||||
+boot_tftp_sysupgrade=tftpboot $loadaddr $bootfile_upg && iminfo $loadaddr && run nor_write_production
|
||||
+reset_factory=env default -a && saveenv && reset
|
||||
+nor_pad_size=setexpr image_eb $filesize / 0x1000 ; setexpr tmp1 image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb $image_eb + 1 ; setexpr image_eb $image_eb * 0x1000
|
||||
+nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x1e80000 && mtd erase firmware 0x0 0x$image_eb && mtd write firmware $loadaddr 0x0 $filesize
|
||||
+_init_env=setenv _init_env ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run lan_mac_factory ; run wan_mac_factory ; run label_mac_factory ; run env_cleanup ; run ethaddr_factory ; run wifi_mac_factory ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
@ -0,0 +1,343 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7986_mercusys_mr90x-v1_defconfig
|
||||
@@ -0,0 +1,107 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7986b-mercusys_mr90x-v1"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7986=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007ef00
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986b-mercusys_mr90x-v1.dtb"
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="MT7986> "
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="mercusys_mr90x-v1_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+# CONFIG_I2C is not set
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7986=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7986b-mercusys_mr90x-v1.dts
|
||||
@@ -0,0 +1,174 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2024
|
||||
+ * Author: Mikhail Zhilkin <csharper2005@gmail.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7986.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "MERCUSYS MR90X v1";
|
||||
+ compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ reset {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-0 {
|
||||
+ label = "green:lan2";
|
||||
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-1 {
|
||||
+ label = "green:lan1";
|
||||
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-2 {
|
||||
+ label = "green:lan0";
|
||||
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-3 {
|
||||
+ label = "green:wan";
|
||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-4 {
|
||||
+ label = "amber:status";
|
||||
+ gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ led_status_green: led-5 {
|
||||
+ label = "green:status";
|
||||
+ gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_pins>;
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ spic_pins: spi1-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "spi";
|
||||
+ groups = "spi1_2";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ uart1_pins: spi1-pins-func-3 {
|
||||
+ mux {
|
||||
+ function = "uart";
|
||||
+ groups = "uart1_2";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ spi_nand@1 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <1>;
|
||||
+ spi-max-frequency = <20000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ label = "bl2";
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ reg = <0x100000 0x100000>;
|
||||
+ label = "factory";
|
||||
+ };
|
||||
+
|
||||
+ partition@200000 {
|
||||
+ reg = <0x200000 0x7e00000>;
|
||||
+ label = "ubi";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/mercusys_mr90x-v1_env
|
||||
@@ -0,0 +1,53 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootargs=console=ttyS0,115200n8 console_msg_format=syslog
|
||||
+bootcmd=run check_buttons ; run boot_production ; run boot_recovery
|
||||
+bootconf=config-1
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-squashfs-sysupgrade.itb
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) ) [0;36m[SPI-NAND][0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=noboot=1 ; replacevol=1 ; run boot_tftp_production ; noboot= ; replacevol= ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=noboot=1 ; replacevol=1 ; run boot_tftp_recovery ; noboot= ; replacevol= ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_default=run led_boot ; run bootcmd ; run boot_recovery ; replacevol=1 ; run boot_tftp_forever
|
||||
+boot_production=run led_boot ; run ubi_read_production && bootm $loadaddr#$bootconf
|
||||
+boot_recovery=run led_boot ; run ubi_read_recovery && bootm $loadaddr#$bootconf
|
||||
+boot_tftp=run led_boot ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_forever=run led_boot ; while true ; do run boot_tftp ; sleep 1 ; done
|
||||
+boot_tftp_production=run led_boot ; tftpboot $loadaddr $bootfile_upg && test $replacevol = 1 && iminfo $loadaddr && run ubi_write_production ; if test $noboot = 1 ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=run led_boot ; tftpboot $loadaddr $bootfile && test $replacevol = 1 && iminfo $loadaddr && run ubi_write_recovery ; if test $noboot = 1 ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_write_fip=run led_boot ; tftpboot $loadaddr $bootfile_fip && run ubi_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=run led_boot ; tftpboot $loadaddr $bootfile_bl2 && run snand_write_bl2
|
||||
+check_buttons=if button reset ; then run boot_tftp ; fi
|
||||
+ethaddr_factory=mtd read factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x40088000 0x6 ; setenv ethaddr_factory
|
||||
+led_boot=led green:status off ; led amber:status on
|
||||
+reset_factory=mw $loadaddr 0xff 0x1f000 ; ubi write $loadaddr ubootenv 0x1f000 ; ubi write $loadaddr ubootenv2 0x1f000 ; ubi remove rootfs_data
|
||||
+snand_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr 0x0 0x40000
|
||||
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x1f000 dynamic ; ubi check ubootenv2 || ubi create ubootenv2 0x1f000 dynamic
|
||||
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
|
||||
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
|
||||
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
|
||||
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
|
||||
+ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip $filesize static && ubi write $loadaddr fip $filesize
|
||||
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
|
||||
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
|
||||
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; bootmenu
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
@ -0,0 +1,362 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_routerich_ax3000_defconfig
|
||||
@@ -0,0 +1,107 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-routerich_ax3000"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007ef00
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-routerich_ax3000.dtb"
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="routerich_ax3000_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-routerich_ax3000.dts
|
||||
@@ -0,0 +1,187 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2022 MediaTek Inc.
|
||||
+ * Author: Sam Shih <sam.shih@mediatek.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "Routerich AX3000";
|
||||
+ compatible = "routerich,ax3000", "mediatek,mt7981";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ button-0 {
|
||||
+ label = "mesh";
|
||||
+ linux,code = <BTN_0>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ button-1 {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-0 {
|
||||
+ label = "red:wlan5g";
|
||||
+ gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-1 {
|
||||
+ label = "red:wan";
|
||||
+ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ led-2 {
|
||||
+ label = "blue:power";
|
||||
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-3 {
|
||||
+ label = "blue:lan1";
|
||||
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-4 {
|
||||
+ label = "blue:lan2";
|
||||
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-5 {
|
||||
+ label = "blue:lan3";
|
||||
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-6 {
|
||||
+ label = "blue:wan";
|
||||
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-7 {
|
||||
+ label = "blue:wlan2g";
|
||||
+ gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-8 {
|
||||
+ label = "blue:mesh";
|
||||
+ gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ support_quad;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ spi_nand@0 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "bl2";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "uboot-env-orig";
|
||||
+ reg = <0x100000 0x80000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@160000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x180000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "fip";
|
||||
+ reg = <0x380000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x7a80000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/routerich_ax3000_env
|
||||
@@ -0,0 +1,58 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootcmd=run check_buttons ; if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
|
||||
+bootconf=config-1
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=blue:power
|
||||
+bootled_rec=blue:power
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
|
||||
+check_buttons=if button reset ; then run boot_tftp ; fi
|
||||
+ethaddr_factory=mtd read Factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x40080004 0x6 ; setenv ethaddr_factory
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
|
||||
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
|
||||
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
|
||||
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format
|
||||
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
|
||||
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
|
||||
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
|
||||
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
|
||||
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
|
||||
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
|
||||
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
|
||||
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
51
package/boot/uboot-stm32/Makefile
Normal file
51
package/boot/uboot-stm32/Makefile
Normal file
@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2024 Bootlin
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2024.07
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f
|
||||
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
|
||||
|
||||
UBOOT_USE_INTREE_DTC:=1
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define U-Boot/Default
|
||||
BUILD_TARGET:=stm32
|
||||
UBOOT_IMAGE:=u-boot.bin u-boot.dtb
|
||||
endef
|
||||
|
||||
define U-Boot/stm32mp13
|
||||
BUILD_SUBTARGET:=stm32mp1
|
||||
UBOOT_CONFIG:=stm32mp13
|
||||
endef
|
||||
|
||||
define U-Boot/stm32mp135f-dk
|
||||
$(call U-Boot/stm32mp13)
|
||||
NAME:=STM32MP135F-DK
|
||||
DEVICE_TREE:=stm32mp135f-dk
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := stm32mp135f-dk
|
||||
|
||||
UBOOT_MAKE_FLAGS += DEVICE_TREE=$(DEVICE_TREE)
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(foreach img,$(UBOOT_IMAGE), \
|
||||
$(CP) $(PKG_BUILD_DIR)/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/u-boot/install/default
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/U-Boot))
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gdb
|
||||
PKG_VERSION:=15.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
@ -37,7 +37,7 @@ $(call Package/gdb/Default)
|
||||
endef
|
||||
|
||||
define Package/gdb/description
|
||||
GDB, the GNU Project debugger, allows you to see what is going on `inside'
|
||||
GDB, the GNU Project debugger, allows you to see what is going on 'inside'
|
||||
another program while it executes -- or what another program was doing at the
|
||||
moment it crashed.
|
||||
endef
|
||||
|
@ -12,7 +12,8 @@ PKG_FLAGS:=nonshared
|
||||
PKG_RELEASE:=10
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_TARGET_ramips
|
||||
CONFIG_TARGET_ramips \
|
||||
CONFIG_USB_SUPPORT
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -22,9 +23,9 @@ define Package/automount
|
||||
DEPENDS:= \
|
||||
+block-mount \
|
||||
+e2fsprogs \
|
||||
+kmod-usb-storage \
|
||||
+kmod-usb-storage-extras \
|
||||
+!TARGET_ramips:kmod-usb-storage-uas \
|
||||
+USB_SUPPORT:kmod-usb-storage \
|
||||
+USB_SUPPORT:kmod-usb-storage-extras \
|
||||
+(!TARGET_ramips&&USB_SUPPORT):kmod-usb-storage-uas \
|
||||
+kmod-fs-ext4 \
|
||||
+kmod-fs-exfat \
|
||||
+kmod-fs-vfat \
|
||||
|
@ -40,7 +40,7 @@ define Package/dsl-vrx200-firmware-xdsl-a
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=VRX200 / VR9 CPE xDSL Annex A firmware
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@TARGET_lantiq_xrx200
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
|
||||
endef
|
||||
|
||||
define Package/dsl-vrx200-firmware-xdsl-a/description
|
||||
@ -52,7 +52,7 @@ define Package/dsl-vrx200-firmware-xdsl-b
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=VRX200 / VR9 CPE xDSL Annex B firmware
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@TARGET_lantiq_xrx200
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
|
||||
endef
|
||||
|
||||
define Package/dsl-vrx200-firmware-xdsl-b/description
|
||||
@ -64,7 +64,7 @@ define Package/dsl-vrx200-firmware-xdsl-a-patch
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=VRX200 / VR9 CPE xDSL Annex B to Annex A firmware patch
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-b +bspatch
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +dsl-vrx200-firmware-xdsl-b +bspatch
|
||||
endef
|
||||
|
||||
define Package/dsl-vrx200-firmware-xdsl-a-patch/description
|
||||
@ -76,7 +76,7 @@ define Package/dsl-vrx200-firmware-xdsl-b-patch
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=VRX200 / VR9 CPE xDSL Annex A to Annex B firmware patch
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-a +bspatch
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +dsl-vrx200-firmware-xdsl-a +bspatch
|
||||
endef
|
||||
|
||||
define Package/dsl-vrx200-firmware-xdsl-b-patch/description
|
||||
|
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=linux-firmware
|
||||
PKG_VERSION:=20241017
|
||||
PKG_VERSION:=20241110
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=a26c38ef5a83272f2b98ce8bf8ca1865a852a3deea49ce5a8dd804b914351273
|
||||
PKG_HASH:=32e6d3eb5c7fcb69fe5d58976c6deafa0d6552719c6e74835064aff049d25bd7
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
@ -199,6 +199,14 @@ define Package/iwlwifi-firmware-ax210/install
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax210))
|
||||
|
||||
Package/iwlwifi-firmware-ax411 = $(call Package/firmware-default,Intel AX411 firmware)
|
||||
define Package/iwlwifi-firmware-ax411/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0-89.ucode $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0.pnvm $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax411))
|
||||
|
||||
Package/iwlwifi-firmware-be200 = $(call Package/firmware-default,Intel BE200 firmware)
|
||||
define Package/iwlwifi-firmware-be200/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
@ -216,29 +224,49 @@ define Package/e100-firmware/install
|
||||
endef
|
||||
$(eval $(call BuildPackage,e100-firmware))
|
||||
|
||||
Package/intel-igpu-firmware-dmc = $(call Package/firmware-default,Intel iGPU DMC Display MC firmware)
|
||||
define Package/intel-igpu-firmware-dmc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/i915/*_dmc_*.bin* \
|
||||
$(1)/lib/firmware/i915/
|
||||
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc
|
||||
Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915)
|
||||
define Package/i915-firmware/install
|
||||
true
|
||||
endef
|
||||
$(eval $(call BuildPackage,intel-igpu-firmware-dmc))
|
||||
$(eval $(call BuildPackage,i915-firmware))
|
||||
|
||||
Package/intel-igpu-firmware-guc = $(call Package/firmware-default,Intel iGPU GUC Graphics MC firmware)
|
||||
define Package/intel-igpu-firmware-guc/install
|
||||
Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-dmc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/i915/*_guc_*.bin* \
|
||||
$(1)/lib/firmware/i915/
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,intel-igpu-firmware-guc))
|
||||
$(eval $(call BuildPackage,i915-firmware-dmc))
|
||||
|
||||
Package/intel-igpu-firmware-huc = $(call Package/firmware-default,Intel iGPU HUC H.265 MC firmware)
|
||||
define Package/intel-igpu-firmware-huc/install
|
||||
Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-guc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/i915/*_huc_*.bin* \
|
||||
$(1)/lib/firmware/i915/
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,intel-igpu-firmware-huc))
|
||||
$(eval $(call BuildPackage,i915-firmware-guc))
|
||||
|
||||
Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-huc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware-huc))
|
||||
|
||||
Package/i915-firmware-gsc = $(call Package/firmware-default,Intel I915 GSC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-gsc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_gsc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = gsc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware-gsc))
|
||||
|
8
package/firmware/linux-firmware/mali.mk
Normal file
8
package/firmware/linux-firmware/mali.mk
Normal file
@ -0,0 +1,8 @@
|
||||
Package/panthor-firmware = $(call Package/firmware-default,Gen10 Arm Mali GPUs firmware)
|
||||
define Package/panthor-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/arm/mali/arch10.8
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/arm/mali/arch10.8/mali_csffw.bin \
|
||||
$(1)/lib/firmware/arm/mali/arch10.8/
|
||||
endef
|
||||
$(eval $(call BuildPackage,panthor-firmware))
|
@ -10,7 +10,11 @@ Package/ath11k-firmware-wcn6750 = $(call Package/firmware-default,WCN6750 ath11k
|
||||
define Package/ath11k-firmware-wcn6750/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6750/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/* $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/board-2.bin $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/Notice.txt $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/wpss.mbn $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath11k-firmware-wcn6750))
|
||||
|
||||
|
@ -140,6 +140,20 @@ define Package/rtl8761bu-firmware/install
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8761bu-firmware))
|
||||
|
||||
Package/rtl8812a-firmware = $(call Package/firmware-default,RealTek RTL8812AU firmware)
|
||||
define Package/rtl8812a-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8812a_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8812a-firmware))
|
||||
|
||||
Package/rtl8821a-firmware = $(call Package/firmware-default,RealTek RTL8821AU firmware)
|
||||
define Package/rtl8821a-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8821a_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8821a-firmware))
|
||||
|
||||
Package/rtl8821ae-firmware = $(call Package/firmware-default,RealTek RTL8821AE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8821ae-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
|
57
package/firmware/murata-firmware/Makefile
Normal file
57
package/firmware/murata-firmware/Makefile
Normal file
@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2024 Bootlin
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=murata-firmware
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-09-12
|
||||
PKG_SOURCE_URL:=https://github.com/murata-wireless/cyw-fmac-fw.git
|
||||
PKG_MIRROR_HASH:=26f8a2df800666daab183b2842e5b3d591b1e5b31769d5429f9d70527f43d152
|
||||
PKG_SOURCE_VERSION:=50ac17bb65b2342cd954d49d9bc492709d431c3c
|
||||
|
||||
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
|
||||
PKG_LICENSE_FILES:=LICENCE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/murata-firmware-default
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=https://community.murata.com/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/murata-firmware-43430-sdio
|
||||
$(Package/murata-firmware-default)
|
||||
TITLE:=BCM43430 FullMac SDIO firmware
|
||||
CONFLICTS:=cypress-firmware-43430-sdio
|
||||
endef
|
||||
|
||||
define Package/murata-firmware-43430-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/murata
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/cyfmac43430-sdio.bin \
|
||||
$(1)/lib/firmware/murata/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/cyfmac43430-sdio.1DX.clm_blob \
|
||||
$(1)/lib/firmware/murata/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(LN) \
|
||||
../murata/cyfmac43430-sdio.bin \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin
|
||||
$(LN) \
|
||||
../murata/cyfmac43430-sdio.1DX.clm_blob \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,murata-firmware-43430-sdio))
|
||||
|
48
package/firmware/murata-nvram/Makefile
Normal file
48
package/firmware/murata-nvram/Makefile
Normal file
@ -0,0 +1,48 @@
|
||||
#
|
||||
# Copyright (C) 2024 Bootlin
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=murata-nvram
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-09-28
|
||||
PKG_SOURCE_URL:=https://github.com/murata-wireless/cyw-fmac-nvram.git
|
||||
PKG_MIRROR_HASH:=e2fc6f1f9898edfd67f5495e615882700f03b42a75efa2e3f4e2d524aed0efb8
|
||||
PKG_SOURCE_VERSION:=255819aab07572d87576a13329ef9d4c654167aa
|
||||
|
||||
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
|
||||
PKG_LICENSE_FILES:=LICENCE.cypress
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/murata-nvram-default
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=https://community.murata.com/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/murata-nvram-43430-sdio
|
||||
$(Package/murata-nvram-default)
|
||||
TITLE:=BCM43430 SDIO NVRAM
|
||||
CONFLICTS:=brcmfmac-nvram-43430-sdio
|
||||
endef
|
||||
|
||||
define Package/murata-nvram-43430-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) ./files/cyfmac43430-sdio.1DX.stm32.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
cyfmac43430-sdio.1DX.stm32.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp135f-dk.txt
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,murata-nvram-43430-sdio))
|
47
package/firmware/murata-nvram/files/cyfmac43430-sdio.1DX.stm32.txt
Executable file
47
package/firmware/murata-nvram/files/cyfmac43430-sdio.1DX.stm32.txt
Executable file
@ -0,0 +1,47 @@
|
||||
# This NVRAM file is based on cyfmac43430-sdio.1DX.txt, except that the muxenab
|
||||
# parameter was unset to enable IB IRQ (OOB IRQ is not stable on STM32
|
||||
# platforms).
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
manfid=0x2d0
|
||||
prodid=0x0726
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0726
|
||||
boardrev=0x1202
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=0
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
#pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
pa2ga0=-145,6667,-751
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=2
|
||||
maxp2ga0=74
|
||||
#txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x88888888
|
||||
mcsbw202gpo=0xaaaaaaaa
|
||||
propbw202gpo=0xdd
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=48
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
# muxenab defined to enable OOB IRQ. Level sensitive interrupt via WL_HOST_WAKE line.
|
||||
# muxenab=0x10
|
||||
#BT COEX deferral limit setting
|
||||
#btc_params 8 45000
|
||||
#btc_params 10 20000
|
||||
#spurconfig=0x3
|
||||
# End of NVRAM - do not remove this line #
|
@ -29,7 +29,6 @@ define Package/omnia-mcu-firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=https://gitlab.nic.cz/turris/hw/$(PKG_DISTNAME)/-/releases
|
||||
TITLE:=CZ.NIC Turris Omnia MCU firmware
|
||||
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia
|
||||
endef
|
||||
|
||||
define Package/omnia-mcu-firmware/description
|
||||
|
@ -4,7 +4,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=bcm27xx-gpu-fw
|
||||
PKG_VERSION:=2024.10.08
|
||||
PKG_VERSION_REAL:=1.$(subst .,,$(PKG_VERSION))
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=raspi-firmware_$(PKG_VERSION_REAL).orig.tar.xz
|
||||
PKG_SOURCE_URL:=https://github.com/raspberrypi/firmware/releases/download/$(PKG_VERSION_REAL)
|
||||
@ -33,6 +33,10 @@ define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/bcm27xx-gpu-fw/install
|
||||
true
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(CP) $(PKG_BUILD_DIR)/boot/bootcode.bin $(KERNEL_BUILD_DIR)
|
||||
$(CP) $(PKG_BUILD_DIR)/boot/LICENCE.broadcom $(KERNEL_BUILD_DIR)
|
||||
|
@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define KernelPackage/cryptodev
|
||||
SUBMENU:=Cryptographic API modules
|
||||
TITLE:=Driver for cryptographic acceleration
|
||||
URL:=http://cryptodev-linux.org/
|
||||
URL:=https://github.com/cryptodev-linux/cryptodev-linux
|
||||
DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash
|
||||
FILES:=$(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX)
|
||||
AUTOLOAD:=$(call AutoLoad,50,cryptodev)
|
||||
@ -36,8 +36,9 @@ define KernelPackage/cryptodev
|
||||
endef
|
||||
|
||||
define KernelPackage/cryptodev/description
|
||||
This is a driver for that allows to use the Linux kernel supported
|
||||
hardware ciphers by user-space applications.
|
||||
This driver allows use of the Linux kernel supported hardware-based
|
||||
cryptographic and hash accelerators by user-space applications,
|
||||
via a "/dev/crypto" device.
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
|
@ -302,7 +302,7 @@ struct gpio_keys_button_dev {
|
||||
|
||||
struct device *dev;
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_data data[0];
|
||||
struct gpio_keys_button_data data[];
|
||||
};
|
||||
|
||||
static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev)
|
||||
@ -693,7 +693,6 @@ static struct platform_driver gpio_keys_driver = {
|
||||
.remove = gpio_keys_remove,
|
||||
.driver = {
|
||||
.name = "gpio-keys",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(gpio_keys_of_match),
|
||||
},
|
||||
};
|
||||
@ -703,7 +702,6 @@ static struct platform_driver gpio_keys_polled_driver = {
|
||||
.remove = gpio_keys_remove,
|
||||
.driver = {
|
||||
.name = "gpio-keys-polled",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(gpio_keys_polled_of_match),
|
||||
},
|
||||
};
|
||||
|
@ -366,7 +366,6 @@ err:
|
||||
|
||||
static struct platform_driver nct5104d_gpio_driver = {
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRVNAME,
|
||||
},
|
||||
.probe = nct5104d_gpio_probe,
|
||||
|
@ -2807,7 +2807,6 @@ static struct platform_driver ltq_mei_driver = {
|
||||
.remove = ltq_mei_remove,
|
||||
.driver = {
|
||||
.name = "lantiq,mei-xway",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ltq_mei_match,
|
||||
},
|
||||
};
|
||||
|
@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
#ifndef _lint
|
||||
@@ -1159,8 +1159,30 @@ module_param(debug_level, byte, 0);
|
||||
@@ -1159,8 +1159,29 @@ module_param(debug_level, byte, 0);
|
||||
MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
|
||||
#endif /* #ifndef DSL_DEBUG_DISABLE*/
|
||||
|
||||
@ -59,7 +59,6 @@
|
||||
+ .remove = __devexit_p(ltq_adsl_remove),
|
||||
+ .driver = {
|
||||
+ .name = "adsl",
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .of_match_table = ltq_adsl_match,
|
||||
+ },
|
||||
+};
|
||||
|
@ -33,7 +33,7 @@ endef
|
||||
KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
|
||||
KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway)
|
||||
KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase)
|
||||
KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200)
|
||||
KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy))
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
@ -1894,7 +1894,6 @@ static struct platform_driver ltq_atm_driver = {
|
||||
.remove = ltq_atm_remove,
|
||||
.driver = {
|
||||
.name = "atm",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ltq_atm_match,
|
||||
},
|
||||
};
|
||||
|
@ -21,14 +21,14 @@ define KernelPackage/ltq-deu-template
|
||||
TITLE:=deu driver for $(1)
|
||||
URL:=http://www.lantiq.com/
|
||||
VARIANT:=$(1)
|
||||
DEPENDS:=@TARGET_lantiq_$(2) +kmod-crypto-manager +kmod-crypto-des
|
||||
DEPENDS:=@$(2) +kmod-crypto-manager +kmod-crypto-des
|
||||
FILES:=$(PKG_BUILD_DIR)/ltq_deu_$(1).ko
|
||||
AUTOLOAD:=$(call AutoProbe,ltq_deu_$(1))
|
||||
endef
|
||||
|
||||
KernelPackage/ltq-deu-danube=$(call KernelPackage/ltq-deu-template,danube,xway)
|
||||
KernelPackage/ltq-deu-ar9=$(call KernelPackage/ltq-deu-template,ar9,xway)
|
||||
KernelPackage/ltq-deu-vr9=$(call KernelPackage/ltq-deu-template,vr9,xrx200)
|
||||
KernelPackage/ltq-deu-danube=$(call KernelPackage/ltq-deu-template,danube,TARGET_lantiq_xway)
|
||||
KernelPackage/ltq-deu-ar9=$(call KernelPackage/ltq-deu-template,ar9,TARGET_lantiq_xway)
|
||||
KernelPackage/ltq-deu-vr9=$(call KernelPackage/ltq-deu-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy))
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
@ -196,7 +196,6 @@ static struct platform_driver ltq_deu_driver = {
|
||||
.remove = ltq_deu_remove,
|
||||
.driver = {
|
||||
.name = "deu",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ltq_deu_match,
|
||||
},
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ define KernelPackage/ltq-ptm-template
|
||||
TITLE:=ptm driver for $(1)
|
||||
URL:=http://www.lantiq.com/
|
||||
VARIANT:=$(1)
|
||||
DEPENDS:=@TARGET_lantiq_$(2)
|
||||
DEPENDS:=@$(2)
|
||||
ifeq ($(1),vr9)
|
||||
DEPENDS+= +PACKAGE_kmod-ltq-ptm-$(1):kmod-ltq-vdsl-vr9-mei
|
||||
else
|
||||
@ -34,10 +34,10 @@ endif
|
||||
FILES:=$(PKG_BUILD_DIR)/ltq_ptm_$(1).ko
|
||||
endef
|
||||
|
||||
KernelPackage/ltq-ptm-danube=$(call KernelPackage/ltq-ptm-template,danube,xway)
|
||||
KernelPackage/ltq-ptm-ar9=$(call KernelPackage/ltq-ptm-template,ar9,xway)
|
||||
KernelPackage/ltq-ptm-ase=$(call KernelPackage/ltq-ptm-template,ase,ase)
|
||||
KernelPackage/ltq-ptm-vr9=$(call KernelPackage/ltq-ptm-template,vr9,xrx200)
|
||||
KernelPackage/ltq-ptm-danube=$(call KernelPackage/ltq-ptm-template,danube,TARGET_lantiq_xway)
|
||||
KernelPackage/ltq-ptm-ar9=$(call KernelPackage/ltq-ptm-template,ar9,TARGET_lantiq_xway)
|
||||
KernelPackage/ltq-ptm-ase=$(call KernelPackage/ltq-ptm-template,ase,TARGET_lantiq_ase)
|
||||
KernelPackage/ltq-ptm-vr9=$(call KernelPackage/ltq-ptm-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy))
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
@ -1600,7 +1600,6 @@ static struct platform_driver ltq_ptm_driver = {
|
||||
.remove = ltq_ptm_remove,
|
||||
.driver = {
|
||||
.name = "ptm",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ltq_ptm_match,
|
||||
},
|
||||
};
|
||||
|
@ -1138,7 +1138,6 @@ static struct platform_driver ltq_ptm_driver = {
|
||||
.remove = ltq_ptm_remove,
|
||||
.driver = {
|
||||
.name = "ptm",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ltq_ptm_match,
|
||||
},
|
||||
};
|
||||
|
@ -19,7 +19,7 @@ define Package/ltq-vdsl-vr9-vectoring-fw-installer
|
||||
TITLE:=VDSL2 Vectoring Firmware installer
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vdsl-vr9
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
|
@ -29,7 +29,7 @@ define KernelPackage/ltq-vdsl-vr9-mei
|
||||
TITLE:=mei driver for vdsl
|
||||
SECTION:=sys
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-ifxos +kmod-ltq-vectoring
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-ifxos +kmod-ltq-vectoring
|
||||
FILES:=$(PKG_BUILD_DIR)/src/drv_mei_cpe.ko
|
||||
AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe)
|
||||
endef
|
||||
@ -44,7 +44,7 @@ define Package/ltq-vdsl-vr9-mei-test
|
||||
CATEGORY:=Network
|
||||
TITLE:=Lantiq mei driver test tool
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@TARGET_lantiq_xrx200
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
|
||||
endef
|
||||
|
||||
define Package/ltq-vdsl-vr9-mei-test/description
|
||||
|
@ -29,7 +29,7 @@ define KernelPackage/ltq-vdsl-vr9
|
||||
TITLE:=vdsl driver
|
||||
SECTION:=sys
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9-mei
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vdsl-vr9-mei
|
||||
FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
|
||||
endef
|
||||
|
@ -20,7 +20,7 @@ define KernelPackage/ltq-vectoring
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=driver for sending vectoring error samples
|
||||
DEPENDS:=@TARGET_lantiq_xrx200
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
|
||||
FILES:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/ltq_vectoring.ko
|
||||
AUTOLOAD:=$(call AutoLoad,49,ltq_vectoring)
|
||||
endef
|
||||
@ -38,7 +38,7 @@ define KernelPackage/ltq-vectoring-test
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=driver for testing the vectoring driver
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vectoring
|
||||
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vectoring
|
||||
FILES:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/ltq_vectoring_test.ko
|
||||
endef
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 3983dc1674fec43beb8ce9d9bfdd6302fef86eae Mon Sep 17 00:00:00 2001
|
||||
From: Andrew MacIntyre <andymac@pcug.org.au>
|
||||
Date: Mon, 4 Nov 2024 22:41:25 +1100
|
||||
Subject: [PATCH] vrx518_tc: allow larger MTU to support RFC4638
|
||||
|
||||
vrx518_tc currently sets the interface maximum MTU to the ethernet default
|
||||
of 1500 bytes by default via ether_setup() called from ptm_setup().
|
||||
|
||||
To support 1508 byte baby jumbo frames (RFC4638) for PPPoE connections
|
||||
over VDSL links as already supported by the VR9 ltq_ptm driver ([1], [2])
|
||||
set the interface maximum MTU to MAX_MTU.
|
||||
|
||||
MAX_MTU is defined in dcdp/inc/tc_common.h to 2002 bytes and this value is
|
||||
used in ptm_change_mtu() and elsewhere as the maximum MTU, however this is
|
||||
short circuited by checks against the interface maximum MTU.
|
||||
|
||||
[1]: https://forum.openwrt.org/t/fritzbox-7530-and-rfc4638-baby-jumbo-frames/181327
|
||||
[2]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=8a2a20e71e2909f84dab47e51dfda9e292a6c1ae
|
||||
|
||||
Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
|
||||
---
|
||||
dcdp/ptm_tc.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/dcdp/ptm_tc.c 2023-12-17 16:11:22.503500398 +1100
|
||||
+++ b/dcdp/ptm_tc.c 2024-01-26 16:48:49.881623474 +1100
|
||||
@@ -657,6 +657,7 @@ static void ptm_setup(struct net_device
|
||||
ether_setup(dev);
|
||||
dev->watchdog_timeo = 10 * HZ;
|
||||
dev->netdev_ops = &g_ptm_netdev_ops;
|
||||
+ dev->max_mtu = MAX_MTU;
|
||||
}
|
||||
|
||||
static int ptm_dev_init(struct tc_priv *tc_priv, u32 id,
|
@ -245,6 +245,25 @@ endef
|
||||
$(eval $(call KernelPackage,can-usb-esd))
|
||||
|
||||
|
||||
define KernelPackage/can-usb-gs
|
||||
TITLE:=Geschwister Schneider UG interfaces
|
||||
KCONFIG:=CONFIG_CAN_GS_USB
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/net/can/usb/gs_usb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,gs_usb)
|
||||
$(call AddDepends/can,+kmod-usb-core)
|
||||
endef
|
||||
|
||||
define KernelPackage/can-usb-gsr/description
|
||||
This driver supports the Geschwister Schneider and
|
||||
bytewerk.org candleLight compatible
|
||||
(https://github.com/candle-usb/candleLight_fw) USB/CAN
|
||||
interfaces.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,can-usb-gs))
|
||||
|
||||
|
||||
define KernelPackage/can-usb-kvaser
|
||||
TITLE:=Kvaser CAN/USB interface
|
||||
KCONFIG:=CONFIG_CAN_KVASER_USB
|
||||
|
@ -249,6 +249,15 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,crypto-echainiv))
|
||||
|
||||
define KernelPackage/crypto-engine
|
||||
TITLE:=Crypto engine
|
||||
KCONFIG:=CONFIG_CRYPTO_ENGINE
|
||||
FILES:=$(LINUX_DIR)/crypto/crypto_engine.ko
|
||||
AUTOLOAD:=$(call AutoLoad,09,crypto_engine)
|
||||
$(call AddDepends/crypto, +kmod-crypto-rsa +kmod-crypto-kpp)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,crypto-engine))
|
||||
|
||||
define KernelPackage/crypto-essiv
|
||||
TITLE:=ESSIV support for block encryption
|
||||
|
@ -46,6 +46,38 @@ endef
|
||||
$(eval $(call KernelPackage,iio-kfifo-buf))
|
||||
|
||||
|
||||
define KernelPackage/industrialio-hw-consumer
|
||||
TITLE:=Provides a bonding way to an other device in hardware
|
||||
KCONFIG:=CONFIG_IIO_BUFFER_HW_CONSUMER
|
||||
FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-hw-consumer.ko
|
||||
AUTOLOAD:=$(call AutoLoad,55,industrialio-hw-consumer)
|
||||
$(call AddDepends/iio,+kmod-iio-kfifo-buf)
|
||||
endef
|
||||
|
||||
define KernelPackage/industrialio-hw-consumer/description
|
||||
Provides a way to bonding when an IIO device has a direct connection
|
||||
to another device in hardware. In this case buffers for data transfers
|
||||
are handled by hardware.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,industrialio-hw-consumer))
|
||||
|
||||
|
||||
define KernelPackage/industrialio-buffer-cb
|
||||
TITLE:=Provides callback buffer used for push in-kernel interfaces
|
||||
KCONFIG:=CONFIG_IIO_BUFFER_CB
|
||||
FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-buffer-cb.ko
|
||||
AUTOLOAD:=$(call AutoLoad,55,industrialio-triggered-buffer-cb)
|
||||
$(call AddDepends/iio)
|
||||
endef
|
||||
|
||||
define KernelPackage/industrialio-buffer-cb/description
|
||||
Should be selected by any drivers that do in-kernel push usage.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,industrialio-buffer-cb))
|
||||
|
||||
|
||||
define KernelPackage/industrialio-triggered-buffer
|
||||
TITLE:=Provides helper functions for setting up triggered buffers.
|
||||
DEPENDS:=+kmod-iio-kfifo-buf
|
||||
|
@ -42,6 +42,24 @@ endef
|
||||
$(eval $(call KernelPackage,atmtcp))
|
||||
|
||||
|
||||
define KernelPackage/appletalk
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Appletalk protocol support
|
||||
KCONFIG:= \
|
||||
CONFIG_ATALK \
|
||||
CONFIG_DEV_APPLETALK \
|
||||
CONFIG_IPDDP=n
|
||||
FILES:=$(LINUX_DIR)/net/appletalk/appletalk.ko
|
||||
AUTOLOAD:=$(call AutoLoad,40,appletalk)
|
||||
endef
|
||||
|
||||
define KernelPackage/appletalk/description
|
||||
Kernel module for AppleTalk protocol.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,appletalk))
|
||||
|
||||
|
||||
define KernelPackage/bonding
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Ethernet bonding driver
|
||||
|
@ -962,6 +962,7 @@ define KernelPackage/thermal
|
||||
CONFIG_THERMAL=y \
|
||||
CONFIG_THERMAL_OF=y \
|
||||
CONFIG_CPU_THERMAL=y \
|
||||
CONFIG_DEVFREQ_THERMAL=n \
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y \
|
||||
CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE=n \
|
||||
CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE=n \
|
||||
|
@ -314,6 +314,17 @@ endef
|
||||
$(eval $(call KernelPackage,sound-soc-spdif))
|
||||
|
||||
|
||||
define KernelPackage/sound-soc-dmic
|
||||
TITLE:=Generic Digital Microphone CODEC
|
||||
KCONFIG:=CONFIG_SND_SOC_DMIC
|
||||
FILES:=$(LINUX_DIR)/sound/soc/codecs/snd-soc-dmic.ko
|
||||
AUTOLOAD:=$(call AutoProbe,snd-soc-dmic)
|
||||
$(call AddDepends/sound,+kmod-sound-soc-core)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,sound-soc-dmic))
|
||||
|
||||
|
||||
define KernelPackage/pcspkr
|
||||
DEPENDS:=@TARGET_x86 +kmod-input-core
|
||||
TITLE:=PC speaker support
|
||||
|
@ -576,6 +576,7 @@ define KernelPackage/usb-audio
|
||||
CONFIG_SND_USB_AUDIO
|
||||
$(call AddDepends/usb)
|
||||
$(call AddDepends/sound)
|
||||
DEPENDS+=+kmod-media-controller
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \
|
||||
$(LINUX_DIR)/sound/usb/snd-usb-audio.ko
|
||||
|
@ -12,6 +12,28 @@ V4L2_DIR=v4l2-core
|
||||
V4L2_USB_DIR=usb
|
||||
V4L2_MEM2MEM_DIR=platform
|
||||
|
||||
#
|
||||
# Media
|
||||
#
|
||||
define KernelPackage/media-controller
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=Media Controller API
|
||||
KCONFIG:= \
|
||||
CONFIG_MEDIA_SUPPORT \
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/media/mc/mc.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mc)
|
||||
endef
|
||||
|
||||
define KernelPackage/media-controller/description
|
||||
Kernel modules for media controller API used to query media devices
|
||||
internal topology and configure it dynamically.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,media-controller))
|
||||
|
||||
|
||||
#
|
||||
# Video Display
|
||||
#
|
||||
@ -336,7 +358,7 @@ $(eval $(call KernelPackage,drm-exec))
|
||||
define KernelPackage/drm-gem-shmem-helper
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=GEM shmem helper functions
|
||||
DEPENDS:=@DISPLAY_SUPPORT +kmod-drm @!LINUX_5_15
|
||||
DEPENDS:=@DISPLAY_SUPPORT +kmod-drm
|
||||
KCONFIG:=CONFIG_DRM_GEM_SHMEM_HELPER
|
||||
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_shmem_helper.ko
|
||||
AUTOLOAD:=$(call AutoProbe,drm_shmem_helper)
|
||||
@ -345,6 +367,38 @@ endef
|
||||
$(eval $(call KernelPackage,drm-gem-shmem-helper))
|
||||
|
||||
|
||||
define KernelPackage/drm-dma-helper
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
HIDDEN:=1
|
||||
TITLE:=GEM DMA helper functions
|
||||
DEPENDS:=@DISPLAY_SUPPORT +kmod-drm-kms-helper
|
||||
KCONFIG:=CONFIG_DRM_GEM_DMA_HELPER
|
||||
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_dma_helper.ko
|
||||
AUTOLOAD:=$(call AutoProbe,drm_dma_helper)
|
||||
endef
|
||||
|
||||
define KernelPackage/drm-dma-helper/description
|
||||
GEM DMA helper functions.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,drm-dma-helper))
|
||||
|
||||
define KernelPackage/drm-mipi-dbi
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
HIDDEN:=1
|
||||
TITLE:=MIPI DBI helpers
|
||||
DEPENDS:=@DISPLAY_SUPPORT +kmod-backlight +kmod-drm-kms-helper
|
||||
KCONFIG:=CONFIG_DRM_MIPI_DBI
|
||||
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_mipi_dbi.ko
|
||||
AUTOLOAD:=$(call AutoProbe,drm_mipi_dbi)
|
||||
endef
|
||||
|
||||
define KernelPackage/drm-mipi-dbi/description
|
||||
MIPI Display Bus Interface (DBI) LCD controller support.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,drm-mipi-dbi))
|
||||
|
||||
define KernelPackage/drm-ttm
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=GPU memory management subsystem
|
||||
@ -440,6 +494,49 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,drm-amdgpu))
|
||||
|
||||
define KernelPackage/drm-i915
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=Intel i915 DRM support
|
||||
DEPENDS:=@(TARGET_x86_64||TARGET_x86_generic||TARGET_x86_legacy) \
|
||||
@DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \
|
||||
+kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +i915-firmware-dmc \
|
||||
+kmod-drm-display-helper +kmod-drm-buddy +kmod-acpi-video \
|
||||
+kmod-drm-exec +kmod-drm-suballoc-helper
|
||||
KCONFIG:=CONFIG_DRM_I915 \
|
||||
CONFIG_DRM_I915_CAPTURE_ERROR=y \
|
||||
CONFIG_DRM_I915_COMPRESS_ERROR=y \
|
||||
CONFIG_DRM_I915_DEBUG=n \
|
||||
CONFIG_DRM_I915_DEBUG_GUC=n \
|
||||
CONFIG_DRM_I915_DEBUG_MMIO=n \
|
||||
CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n \
|
||||
CONFIG_DRM_I915_DEBUG_VBLANK_EVADE=n \
|
||||
CONFIG_DRM_I915_FENCE_TIMEOUT=10000 \
|
||||
CONFIG_DRM_I915_FORCE_PROBE="" \
|
||||
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 \
|
||||
CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=n \
|
||||
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 \
|
||||
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 \
|
||||
CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 \
|
||||
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 \
|
||||
CONFIG_DRM_I915_SELFTEST=n \
|
||||
CONFIG_DRM_I915_STOP_TIMEOUT=100 \
|
||||
CONFIG_DRM_I915_SW_FENCE_CHECK_DAG=n \
|
||||
CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS=n \
|
||||
CONFIG_DRM_I915_TIMESLICE_DURATION=1 \
|
||||
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 \
|
||||
CONFIG_DRM_I915_USERPTR=y \
|
||||
CONFIG_DRM_I915_WERROR=n \
|
||||
CONFIG_FB_INTEL=n
|
||||
FILES:=$(LINUX_DIR)/drivers/gpu/drm/i915/i915.ko
|
||||
AUTOLOAD:=$(call AutoProbe,i915)
|
||||
endef
|
||||
|
||||
define KernelPackage/drm-i915/description
|
||||
Direct Rendering Manager (DRM) support for Intel GPU
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,drm-i915))
|
||||
|
||||
|
||||
define KernelPackage/drm-imx
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
@ -521,7 +618,7 @@ $(eval $(call KernelPackage,drm-imx-ldb))
|
||||
define KernelPackage/drm-lima
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=Mali-4xx GPU support
|
||||
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +!LINUX_5_15:kmod-drm-gem-shmem-helper
|
||||
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +kmod-drm-gem-shmem-helper
|
||||
KCONFIG:= \
|
||||
CONFIG_DRM_VGEM \
|
||||
CONFIG_DRM_GEM_CMA_HELPER=y \
|
||||
@ -542,7 +639,7 @@ $(eval $(call KernelPackage,drm-lima))
|
||||
define KernelPackage/drm-panfrost
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=DRM support for ARM Mali Midgard/Bifrost GPUs
|
||||
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +!LINUX_5_15:kmod-drm-gem-shmem-helper
|
||||
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +kmod-drm-gem-shmem-helper
|
||||
KCONFIG:=CONFIG_DRM_PANFROST
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/gpu/drm/panfrost/panfrost.ko \
|
||||
@ -560,7 +657,8 @@ $(eval $(call KernelPackage,drm-panfrost))
|
||||
define KernelPackage/drm-panthor
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=DRM support for ARM Mali CSF-based GPUs
|
||||
DEPENDS:=@TARGET_rockchip +kmod-drm +kmod-drm-exec +kmod-drm-gem-shmem-helper
|
||||
DEPENDS:=@TARGET_rockchip +kmod-drm +kmod-drm-exec +kmod-drm-gem-shmem-helper \
|
||||
panthor-firmware
|
||||
KCONFIG:= \
|
||||
CONFIG_DRM_GPUVM \
|
||||
CONFIG_DRM_PANTHOR
|
||||
@ -577,6 +675,24 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,drm-panthor))
|
||||
|
||||
define KernelPackage/drm-panel-mipi-dbi
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=Generic MIPI DBI LCD panel
|
||||
DEPENDS:=+kmod-drm-mipi-dbi +kmod-drm-dma-helper
|
||||
KCONFIG:=CONFIG_DRM_PANEL_MIPI_DBI \
|
||||
CONFIG_DRM_FBDEV_EMULATION=y \
|
||||
CONFIG_DRM_FBDEV_OVERALLOC=100
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/gpu/drm/tiny/panel-mipi-dbi.ko
|
||||
AUTOLOAD:=$(call AutoProbe,panel-mipi-dbi)
|
||||
endef
|
||||
|
||||
define KernelPackage/drm-panel-mipi-dbi/description
|
||||
Generic driver for MIPI Alliance Display Bus Interface
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,drm-panel-mipi-dbi))
|
||||
|
||||
define KernelPackage/drm-radeon
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=Radeon DRM support
|
||||
@ -601,9 +717,8 @@ $(eval $(call KernelPackage,drm-radeon))
|
||||
define KernelPackage/video-core
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE=Video4Linux support
|
||||
DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core
|
||||
DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core +kmod-media-controller
|
||||
KCONFIG:= \
|
||||
CONFIG_MEDIA_SUPPORT \
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y \
|
||||
CONFIG_VIDEO_DEV \
|
||||
CONFIG_V4L_PLATFORM_DRIVERS=y \
|
||||
@ -659,6 +774,25 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,video-videobuf2))
|
||||
|
||||
define KernelPackage/video-async
|
||||
TITLE:=V4L2 ASYNC support
|
||||
KCONFIG:=CONFIG_V4L2_ASYNC
|
||||
FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-async.ko
|
||||
$(call AddDepends/video)
|
||||
AUTOLOAD:=$(call AutoProbe,v4l2-async)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,video-async))
|
||||
|
||||
define KernelPackage/video-fwnode
|
||||
TITLE:=V4L2 FWNODE support
|
||||
KCONFIG:=CONFIG_V4L2_FWNODE
|
||||
FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-fwnode.ko
|
||||
$(call AddDepends/video,+kmod-video-async)
|
||||
AUTOLOAD:=$(call AutoProbe,v4l2-fwnode)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,video-fwnode))
|
||||
|
||||
define KernelPackage/video-cpia2
|
||||
TITLE:=CPIA2 video driver
|
||||
|
@ -437,6 +437,7 @@ define KernelPackage/brcmfmac/config
|
||||
default y if TARGET_starfive
|
||||
default y if TARGET_rockchip
|
||||
default y if TARGET_sunxi
|
||||
default y if TARGET_stm32
|
||||
default n
|
||||
help
|
||||
Enable support for cards attached to an SDIO bus.
|
||||
|
@ -121,7 +121,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
};
|
||||
|
||||
static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
|
||||
@@ -2363,7 +2365,10 @@ int ath12k_wmi_send_scan_start_cmd(struc
|
||||
@@ -2364,7 +2366,10 @@ int ath12k_wmi_send_scan_start_cmd(struc
|
||||
cmd->scan_id = cpu_to_le32(arg->scan_id);
|
||||
cmd->scan_req_id = cpu_to_le32(arg->scan_req_id);
|
||||
cmd->vdev_id = cpu_to_le32(arg->vdev_id);
|
||||
@ -133,7 +133,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
cmd->notify_scan_events = cpu_to_le32(arg->notify_scan_events);
|
||||
|
||||
ath12k_wmi_copy_scan_event_cntrl_flags(cmd, arg);
|
||||
@@ -3083,6 +3088,110 @@ out:
|
||||
@@ -3084,6 +3089,110 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
int
|
||||
ath12k_wmi_send_twt_enable_cmd(struct ath12k *ar, u32 pdev_id)
|
||||
{
|
||||
@@ -5668,6 +5777,50 @@ static void ath12k_wmi_op_ep_tx_credits(
|
||||
@@ -5669,6 +5778,50 @@ static void ath12k_wmi_op_ep_tx_credits(
|
||||
wake_up(&ab->wmi_ab.tx_credits_wq);
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
static void ath12k_wmi_htc_tx_complete(struct ath12k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
@@ -7269,6 +7422,9 @@ static void ath12k_wmi_op_rx(struct ath1
|
||||
@@ -7270,6 +7423,9 @@ static void ath12k_wmi_op_rx(struct ath1
|
||||
case WMI_GTK_OFFLOAD_STATUS_EVENTID:
|
||||
ath12k_wmi_gtk_offload_status_event(ab, skb);
|
||||
break;
|
||||
@ -307,7 +307,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id);
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -3859,6 +3859,28 @@ struct wmi_init_country_cmd {
|
||||
@@ -3860,6 +3860,28 @@ struct wmi_init_country_cmd {
|
||||
} cc_info;
|
||||
} __packed;
|
||||
|
||||
@ -336,7 +336,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
struct wmi_delba_send_cmd {
|
||||
__le32 tlv_header;
|
||||
__le32 vdev_id;
|
||||
@@ -3944,6 +3966,16 @@ struct ath12k_wmi_eht_rate_set_params {
|
||||
@@ -3945,6 +3967,16 @@ struct ath12k_wmi_eht_rate_set_params {
|
||||
#define MAX_6G_REG_RULES 5
|
||||
#define REG_US_5G_NUM_REG_RULES 4
|
||||
|
||||
@ -353,7 +353,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
enum wmi_start_event_param {
|
||||
WMI_VDEV_START_RESP_EVENT = 0,
|
||||
WMI_VDEV_RESTART_RESP_EVENT,
|
||||
@@ -5546,11 +5578,17 @@ int ath12k_wmi_send_bcn_offload_control_
|
||||
@@ -5547,11 +5579,17 @@ int ath12k_wmi_send_bcn_offload_control_
|
||||
u32 vdev_id, u32 bcn_ctrl_op);
|
||||
int ath12k_wmi_send_init_country_cmd(struct ath12k *ar,
|
||||
struct ath12k_wmi_init_country_arg *arg);
|
||||
@ -485,7 +485,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
u32 fw_crash_counter;
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -2947,6 +2947,11 @@ static void ath12k_bss_assoc(struct ath1
|
||||
@@ -2946,6 +2946,11 @@ static void ath12k_bss_assoc(struct ath1
|
||||
if (ret)
|
||||
ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n",
|
||||
arvif->vdev_id, ret);
|
||||
@ -497,7 +497,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
}
|
||||
|
||||
static void ath12k_bss_disassoc(struct ath12k *ar,
|
||||
@@ -3522,7 +3527,7 @@ void __ath12k_mac_scan_finish(struct ath
|
||||
@@ -3521,7 +3526,7 @@ void __ath12k_mac_scan_finish(struct ath
|
||||
ar->scan_channel = NULL;
|
||||
ar->scan.roc_freq = 0;
|
||||
cancel_delayed_work(&ar->scan.timeout);
|
||||
@ -506,7 +506,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3783,7 +3788,12 @@ scan:
|
||||
@@ -3782,7 +3787,12 @@ scan:
|
||||
|
||||
ret = ath12k_start_scan(ar, &arg);
|
||||
if (ret) {
|
||||
@ -520,7 +520,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
ar->scan.state = ATH12K_SCAN_IDLE;
|
||||
spin_unlock_bh(&ar->data_lock);
|
||||
@@ -3802,6 +3812,11 @@ exit:
|
||||
@@ -3801,6 +3811,11 @@ exit:
|
||||
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
|
||||
@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5986,7 +6001,7 @@ static int ath12k_mac_start(struct ath12
|
||||
@@ -5985,7 +6000,7 @@ static int ath12k_mac_start(struct ath12
|
||||
|
||||
/* TODO: Do we need to enable ANI? */
|
||||
|
||||
@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
|
||||
ar->num_started_vdevs = 0;
|
||||
ar->num_created_vdevs = 0;
|
||||
@@ -6166,6 +6181,9 @@ static void ath12k_mac_stop(struct ath12
|
||||
@@ -6165,6 +6180,9 @@ static void ath12k_mac_stop(struct ath12
|
||||
cancel_delayed_work_sync(&ar->scan.timeout);
|
||||
cancel_work_sync(&ar->regd_update_work);
|
||||
cancel_work_sync(&ar->ab->rfkill_work);
|
||||
@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
|
||||
@@ -6412,6 +6430,117 @@ static void ath12k_mac_op_update_vif_off
|
||||
@@ -6411,6 +6429,117 @@ static void ath12k_mac_op_update_vif_off
|
||||
ath12k_mac_update_vif_offload(arvif);
|
||||
}
|
||||
|
||||
@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath12k_hw *ah = ar->ah;
|
||||
@@ -6526,6 +6655,7 @@ static int ath12k_mac_vdev_create(struct
|
||||
@@ -6525,6 +6654,7 @@ static int ath12k_mac_vdev_create(struct
|
||||
arvif->vdev_id, ret);
|
||||
goto err_peer_del;
|
||||
}
|
||||
@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
case WMI_VDEV_TYPE_STA:
|
||||
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
|
||||
@@ -6564,6 +6694,13 @@ static int ath12k_mac_vdev_create(struct
|
||||
@@ -6563,6 +6693,13 @@ static int ath12k_mac_vdev_create(struct
|
||||
arvif->vdev_id, ret);
|
||||
goto err_peer_del;
|
||||
}
|
||||
@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -6904,6 +7041,11 @@ static void ath12k_mac_op_remove_interfa
|
||||
@@ -6903,6 +7040,11 @@ static void ath12k_mac_op_remove_interfa
|
||||
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
|
||||
arvif->vdev_id);
|
||||
|
||||
@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
|
||||
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
|
||||
if (ret)
|
||||
@@ -7744,6 +7886,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
|
||||
@@ -7743,6 +7885,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
|
||||
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
|
||||
ath12k_mac_monitor_stop(ar);
|
||||
|
||||
@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
}
|
||||
|
||||
@@ -8282,6 +8432,14 @@ ath12k_mac_op_reconfig_complete(struct i
|
||||
@@ -8281,6 +8431,14 @@ ath12k_mac_op_reconfig_complete(struct i
|
||||
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
|
||||
ar->pdev->pdev_id);
|
||||
|
||||
@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
if (ab->is_reset) {
|
||||
recovery_count = atomic_inc_return(&ab->recovery_count);
|
||||
|
||||
@@ -9331,6 +9489,9 @@ static void ath12k_mac_setup(struct ath1
|
||||
@@ -9330,6 +9488,9 @@ static void ath12k_mac_setup(struct ath1
|
||||
|
||||
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
|
||||
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
|
||||
|
@ -0,0 +1,169 @@
|
||||
From e0f83d268974dab0361d11904dfc9acec53f96a6 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Dumazet <edumazet@google.com>
|
||||
Date: Fri, 11 Oct 2024 17:12:17 +0000
|
||||
Subject: [PATCH] genetlink: hold RCU in genlmsg_mcast()
|
||||
|
||||
[ Upstream commit 56440d7ec28d60f8da3bfa09062b3368ff9b16db ]
|
||||
|
||||
While running net selftests with CONFIG_PROVE_RCU_LIST=y I saw
|
||||
one lockdep splat [1].
|
||||
|
||||
genlmsg_mcast() uses for_each_net_rcu(), and must therefore hold RCU.
|
||||
|
||||
Instead of letting all callers guard genlmsg_multicast_allns()
|
||||
with a rcu_read_lock()/rcu_read_unlock() pair, do it in genlmsg_mcast().
|
||||
|
||||
This also means the @flags parameter is useless, we need to always use
|
||||
GFP_ATOMIC.
|
||||
|
||||
[1]
|
||||
[10882.424136] =============================
|
||||
[10882.424166] WARNING: suspicious RCU usage
|
||||
[10882.424309] 6.12.0-rc2-virtme #1156 Not tainted
|
||||
[10882.424400] -----------------------------
|
||||
[10882.424423] net/netlink/genetlink.c:1940 RCU-list traversed in non-reader section!!
|
||||
[10882.424469]
|
||||
other info that might help us debug this:
|
||||
|
||||
[10882.424500]
|
||||
rcu_scheduler_active = 2, debug_locks = 1
|
||||
[10882.424744] 2 locks held by ip/15677:
|
||||
[10882.424791] #0: ffffffffb6b491b0 (cb_lock){++++}-{3:3}, at: genl_rcv (net/netlink/genetlink.c:1219)
|
||||
[10882.426334] #1: ffffffffb6b49248 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg (net/netlink/genetlink.c:61 net/netlink/genetlink.c:57 net/netlink/genetlink.c:1209)
|
||||
[10882.426465]
|
||||
stack backtrace:
|
||||
[10882.426805] CPU: 14 UID: 0 PID: 15677 Comm: ip Not tainted 6.12.0-rc2-virtme #1156
|
||||
[10882.426919] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
|
||||
[10882.427046] Call Trace:
|
||||
[10882.427131] <TASK>
|
||||
[10882.427244] dump_stack_lvl (lib/dump_stack.c:123)
|
||||
[10882.427335] lockdep_rcu_suspicious (kernel/locking/lockdep.c:6822)
|
||||
[10882.427387] genlmsg_multicast_allns (net/netlink/genetlink.c:1940 (discriminator 7) net/netlink/genetlink.c:1977 (discriminator 7))
|
||||
[10882.427436] l2tp_tunnel_notify.constprop.0 (net/l2tp/l2tp_netlink.c:119) l2tp_netlink
|
||||
[10882.427683] l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:253) l2tp_netlink
|
||||
[10882.427748] genl_family_rcv_msg_doit (net/netlink/genetlink.c:1115)
|
||||
[10882.427834] genl_rcv_msg (net/netlink/genetlink.c:1195 net/netlink/genetlink.c:1210)
|
||||
[10882.427877] ? __pfx_l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:186) l2tp_netlink
|
||||
[10882.427927] ? __pfx_genl_rcv_msg (net/netlink/genetlink.c:1201)
|
||||
[10882.427959] netlink_rcv_skb (net/netlink/af_netlink.c:2551)
|
||||
[10882.428069] genl_rcv (net/netlink/genetlink.c:1220)
|
||||
[10882.428095] netlink_unicast (net/netlink/af_netlink.c:1332 net/netlink/af_netlink.c:1357)
|
||||
[10882.428140] netlink_sendmsg (net/netlink/af_netlink.c:1901)
|
||||
[10882.428210] ____sys_sendmsg (net/socket.c:729 (discriminator 1) net/socket.c:744 (discriminator 1) net/socket.c:2607 (discriminator 1))
|
||||
|
||||
Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners")
|
||||
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
||||
Cc: James Chapman <jchapman@katalix.com>
|
||||
Cc: Tom Parkin <tparkin@katalix.com>
|
||||
Cc: Johannes Berg <johannes.berg@intel.com>
|
||||
Link: https://patch.msgid.link/20241011171217.3166614-1-edumazet@google.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
||||
---
|
||||
drivers/target/target_core_user.c | 2 +-
|
||||
include/net/genetlink.h | 3 +--
|
||||
net/l2tp/l2tp_netlink.c | 4 ++--
|
||||
net/netlink/genetlink.c | 28 ++++++++++++++--------------
|
||||
net/wireless/nl80211.c | 8 ++------
|
||||
5 files changed, 20 insertions(+), 25 deletions(-)
|
||||
|
||||
--- a/backport-include/net/genetlink.h
|
||||
+++ b/backport-include/net/genetlink.h
|
||||
@@ -150,7 +150,7 @@ int genlmsg_multicast(const struct genl_
|
||||
#define genlmsg_multicast_allns LINUX_BACKPORT(genlmsg_multicast_allns)
|
||||
int backport_genlmsg_multicast_allns(const struct genl_family *family,
|
||||
struct sk_buff *skb, u32 portid,
|
||||
- unsigned int group, gfp_t flags);
|
||||
+ unsigned int group);
|
||||
|
||||
#define genl_family_attrbuf LINUX_BACKPORT(genl_family_attrbuf)
|
||||
static inline struct nlattr **genl_family_attrbuf(struct genl_family *family)
|
||||
--- a/compat/backport-genetlink.c
|
||||
+++ b/compat/backport-genetlink.c
|
||||
@@ -198,23 +198,23 @@ int genlmsg_multicast(const struct genl_
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(genlmsg_multicast);
|
||||
|
||||
-static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
|
||||
- gfp_t flags)
|
||||
+static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group)
|
||||
{
|
||||
struct sk_buff *tmp;
|
||||
struct net *net, *prev = NULL;
|
||||
bool delivered = false;
|
||||
int err;
|
||||
|
||||
+ rcu_read_lock();
|
||||
for_each_net_rcu(net) {
|
||||
if (prev) {
|
||||
- tmp = skb_clone(skb, flags);
|
||||
+ tmp = skb_clone(skb, GFP_ATOMIC);
|
||||
if (!tmp) {
|
||||
err = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
err = nlmsg_multicast(prev->genl_sock, tmp,
|
||||
- portid, group, flags);
|
||||
+ portid, group, GFP_ATOMIC);
|
||||
if (!err)
|
||||
delivered = true;
|
||||
else if (err != -ESRCH)
|
||||
@@ -223,25 +223,29 @@ static int genlmsg_mcast(struct sk_buff
|
||||
|
||||
prev = net;
|
||||
}
|
||||
+ err = nlmsg_multicast(prev->genl_sock, skb, portid, group, GFP_ATOMIC);
|
||||
+
|
||||
+ rcu_read_unlock();
|
||||
|
||||
- err = nlmsg_multicast(prev->genl_sock, skb, portid, group, flags);
|
||||
if (!err)
|
||||
delivered = true;
|
||||
else if (err != -ESRCH)
|
||||
return err;
|
||||
return delivered ? 0 : -ESRCH;
|
||||
error:
|
||||
+ rcu_read_unlock();
|
||||
+
|
||||
kfree_skb(skb);
|
||||
return err;
|
||||
}
|
||||
|
||||
int backport_genlmsg_multicast_allns(const struct genl_family *family,
|
||||
struct sk_buff *skb, u32 portid,
|
||||
- unsigned int group, gfp_t flags)
|
||||
+ unsigned int group)
|
||||
{
|
||||
group = __backport_genl_group(family, group);
|
||||
if (group == INVALID_GROUP)
|
||||
return -EINVAL;
|
||||
- return genlmsg_mcast(skb, portid, group, flags);
|
||||
+ return genlmsg_mcast(skb, portid, group);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(backport_genlmsg_multicast_allns);
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -17956,10 +17956,8 @@ void nl80211_common_reg_change_event(enu
|
||||
|
||||
genlmsg_end(msg, hdr);
|
||||
|
||||
- rcu_read_lock();
|
||||
genlmsg_multicast_allns(&nl80211_fam, msg, 0,
|
||||
- NL80211_MCGRP_REGULATORY, GFP_ATOMIC);
|
||||
- rcu_read_unlock();
|
||||
+ NL80211_MCGRP_REGULATORY);
|
||||
|
||||
return;
|
||||
|
||||
@@ -18692,10 +18690,8 @@ void nl80211_send_beacon_hint_event(stru
|
||||
|
||||
genlmsg_end(msg, hdr);
|
||||
|
||||
- rcu_read_lock();
|
||||
genlmsg_multicast_allns(&nl80211_fam, msg, 0,
|
||||
- NL80211_MCGRP_REGULATORY, GFP_ATOMIC);
|
||||
- rcu_read_unlock();
|
||||
+ NL80211_MCGRP_REGULATORY);
|
||||
|
||||
return;
|
||||
|
@ -0,0 +1,30 @@
|
||||
From 8fbcaa308591b91e9037ab6a8d733873b749a70d Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Sat, 6 Jul 2024 01:40:58 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Set efuse->ext_lna_5g - fix typo
|
||||
|
||||
efuse->ext_lna_2g is set twice and efuse->ext_lna_5g is not set at all.
|
||||
Set each one once.
|
||||
|
||||
Nothing uses these members right now. They will be used by the RTL8821AU
|
||||
and RTL8812AU drivers.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/8ccc9e13-0d45-417d-8f88-93a0ad294f77@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -2006,7 +2006,7 @@ static int rtw_chip_efuse_info_setup(str
|
||||
efuse->ext_pa_2g = efuse->pa_type_2g & BIT(4) ? 1 : 0;
|
||||
efuse->ext_lna_2g = efuse->lna_type_2g & BIT(3) ? 1 : 0;
|
||||
efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0;
|
||||
- efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
|
||||
+ efuse->ext_lna_5g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
|
||||
|
||||
if (!is_valid_ether_addr(efuse->addr)) {
|
||||
eth_random_addr(efuse->addr);
|
@ -0,0 +1,284 @@
|
||||
From 315c23a64e99552502dd4d18d6ddc073fad9a7c3 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Thu, 11 Jul 2024 01:11:33 +0300
|
||||
Subject: [PATCH] wifi: rtw88: usb: Support USB 3 with RTL8822CU/RTL8822BU
|
||||
|
||||
The Realtek wifi 5 devices which support USB 3 are weird: when first
|
||||
plugged in, they pretend to be USB 2. The driver needs to send some
|
||||
commands to the device, which make it disappear and come back as a
|
||||
USB 3 device.
|
||||
|
||||
Implement the required commands in rtw88.
|
||||
|
||||
When a USB 3 device is plugged into a USB 2 port, rtw88 will try to
|
||||
switch it to USB 3 mode only once. The device will disappear and come
|
||||
back still in USB 2 mode, of course.
|
||||
|
||||
Some people experience heavy interference in the 2.4 GHz band in
|
||||
USB 3 mode, so add a module parameter switch_usb_mode with the
|
||||
default value 1 to let people disable the switching.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/77906c62-5674-426f-bde1-1b2a12a0339d@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/debug.h | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 2 +
|
||||
drivers/net/wireless/realtek/rtw88/reg.h | 11 +++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.h | 4 +-
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.h | 24 +++---
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 84 +++++++++++++++++++
|
||||
8 files changed, 116 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/debug.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.h
|
||||
@@ -25,6 +25,7 @@ enum rtw_debug_mask {
|
||||
RTW_DBG_HW_SCAN = 0x00010000,
|
||||
RTW_DBG_STATE = 0x00020000,
|
||||
RTW_DBG_SDIO = 0x00040000,
|
||||
+ RTW_DBG_USB = 0x00080000,
|
||||
|
||||
RTW_DBG_UNEXP = 0x80000000,
|
||||
RTW_DBG_ALL = 0xffffffff
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1785,6 +1785,8 @@ struct rtw_efuse {
|
||||
bool share_ant;
|
||||
u8 bt_setting;
|
||||
|
||||
+ u8 usb_mode_switch;
|
||||
+
|
||||
struct {
|
||||
u8 hci;
|
||||
u8 bw;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/reg.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#define BIT_WLOCK_1C_B6 BIT(5)
|
||||
#define REG_SYS_PW_CTRL 0x0004
|
||||
#define BIT_PFM_WOWL BIT(3)
|
||||
+#define BIT_APFM_OFFMAC BIT(9)
|
||||
#define REG_SYS_CLK_CTRL 0x0008
|
||||
#define BIT_CPU_CLK_EN BIT(14)
|
||||
|
||||
@@ -133,6 +134,14 @@
|
||||
#define REG_PMC_DBG_CTRL1 0xa8
|
||||
#define BITS_PMC_BT_IQK_STS GENMASK(22, 21)
|
||||
|
||||
+#define REG_PAD_CTRL2 0x00C4
|
||||
+#define BIT_RSM_EN_V1 BIT(16)
|
||||
+#define BIT_NO_PDN_CHIPOFF_V1 BIT(17)
|
||||
+#define BIT_MASK_USB23_SW_MODE_V1 GENMASK(19, 18)
|
||||
+#define BIT_USB3_USB2_TRANSITION BIT(20)
|
||||
+#define BIT_USB_MODE_U2 1
|
||||
+#define BIT_USB_MODE_U3 2
|
||||
+
|
||||
#define REG_EFUSE_ACCESS 0x00CF
|
||||
#define EFUSE_ACCESS_ON 0x69
|
||||
#define EFUSE_ACCESS_OFF 0x00
|
||||
@@ -568,6 +577,8 @@
|
||||
#define BIT_WL_SECURITY_CLK BIT(15)
|
||||
#define BIT_DDMA_EN BIT(8)
|
||||
|
||||
+#define REG_SW_MDIO 0x10C0
|
||||
+
|
||||
#define REG_H2C_PKT_READADDR 0x10D0
|
||||
#define REG_H2C_PKT_WRITEADDR 0x10D4
|
||||
#define REG_FW_DBG6 0x10F8
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -46,6 +46,7 @@ static int rtw8822b_read_efuse(struct rt
|
||||
|
||||
map = (struct rtw8822b_efuse *)log_map;
|
||||
|
||||
+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7));
|
||||
efuse->rfe_option = map->rfe_option;
|
||||
efuse->rf_board_option = map->rf_board_option;
|
||||
efuse->crystal_cap = map->xtal_k;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
|
||||
@@ -72,7 +72,9 @@ struct rtw8822bs_efuse {
|
||||
|
||||
struct rtw8822b_efuse {
|
||||
__le16 rtl_id;
|
||||
- u8 res0[0x0e];
|
||||
+ u8 res0[4];
|
||||
+ u8 usb_mode;
|
||||
+ u8 res1[0x09];
|
||||
|
||||
/* power index for four RF paths */
|
||||
struct rtw_txpwr_idx txpwr_idx_table[4];
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -49,6 +49,7 @@ static int rtw8822c_read_efuse(struct rt
|
||||
|
||||
map = (struct rtw8822c_efuse *)log_map;
|
||||
|
||||
+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7));
|
||||
efuse->rfe_option = map->rfe_option;
|
||||
efuse->rf_board_option = map->rf_board_option;
|
||||
efuse->crystal_cap = map->xtal_k & XCAP_MASK;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.h
|
||||
@@ -59,16 +59,18 @@ struct rtw8822ce_efuse {
|
||||
|
||||
struct rtw8822c_efuse {
|
||||
__le16 rtl_id;
|
||||
- u8 res0[0x0e];
|
||||
+ u8 res0[4];
|
||||
+ u8 usb_mode;
|
||||
+ u8 res1[0x09];
|
||||
|
||||
/* power index for four RF paths */
|
||||
struct rtw_txpwr_idx txpwr_idx_table[4];
|
||||
|
||||
u8 channel_plan; /* 0xb8 */
|
||||
u8 xtal_k;
|
||||
- u8 res1;
|
||||
+ u8 res2;
|
||||
u8 iqk_lck;
|
||||
- u8 res2[5]; /* 0xbc */
|
||||
+ u8 res3[5]; /* 0xbc */
|
||||
u8 rf_board_option;
|
||||
u8 rf_feature_option;
|
||||
u8 rf_bt_setting;
|
||||
@@ -80,21 +82,21 @@ struct rtw8822c_efuse {
|
||||
u8 rf_antenna_option; /* 0xc9 */
|
||||
u8 rfe_option;
|
||||
u8 country_code[2];
|
||||
- u8 res3[3];
|
||||
+ u8 res4[3];
|
||||
u8 path_a_thermal; /* 0xd0 */
|
||||
u8 path_b_thermal;
|
||||
- u8 res4[2];
|
||||
+ u8 res5[2];
|
||||
u8 rx_gain_gap_2g_ofdm;
|
||||
- u8 res5;
|
||||
- u8 rx_gain_gap_2g_cck;
|
||||
u8 res6;
|
||||
- u8 rx_gain_gap_5gl;
|
||||
+ u8 rx_gain_gap_2g_cck;
|
||||
u8 res7;
|
||||
- u8 rx_gain_gap_5gm;
|
||||
+ u8 rx_gain_gap_5gl;
|
||||
u8 res8;
|
||||
- u8 rx_gain_gap_5gh;
|
||||
+ u8 rx_gain_gap_5gm;
|
||||
u8 res9;
|
||||
- u8 res10[0x42];
|
||||
+ u8 rx_gain_gap_5gh;
|
||||
+ u8 res10;
|
||||
+ u8 res11[0x42];
|
||||
union {
|
||||
struct rtw8822ce_efuse e;
|
||||
struct rtw8822cu_efuse u;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -14,6 +14,11 @@
|
||||
#include "ps.h"
|
||||
#include "usb.h"
|
||||
|
||||
+static bool rtw_switch_usb_mode = true;
|
||||
+module_param_named(switch_usb_mode, rtw_switch_usb_mode, bool, 0644);
|
||||
+MODULE_PARM_DESC(switch_usb_mode,
|
||||
+ "Set to N to disable switching to USB 3 mode to avoid potential interference in the 2.4 GHz band (default: Y)");
|
||||
+
|
||||
#define RTW_USB_MAX_RXQ_LEN 512
|
||||
|
||||
struct rtw_usb_txcb {
|
||||
@@ -841,6 +846,77 @@ static void rtw_usb_intf_deinit(struct r
|
||||
usb_set_intfdata(intf, NULL);
|
||||
}
|
||||
|
||||
+static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev)
|
||||
+{
|
||||
+ enum usb_device_speed cur_speed;
|
||||
+ u8 id = rtwdev->chip->id;
|
||||
+ bool can_switch;
|
||||
+ u32 pad_ctrl2;
|
||||
+
|
||||
+ if (rtw_read8(rtwdev, REG_SYS_CFG2 + 3) == 0x20)
|
||||
+ cur_speed = USB_SPEED_SUPER;
|
||||
+ else
|
||||
+ cur_speed = USB_SPEED_HIGH;
|
||||
+
|
||||
+ if (cur_speed == USB_SPEED_SUPER)
|
||||
+ return 0;
|
||||
+
|
||||
+ pad_ctrl2 = rtw_read32(rtwdev, REG_PAD_CTRL2);
|
||||
+
|
||||
+ can_switch = !!(pad_ctrl2 & (BIT_MASK_USB23_SW_MODE_V1 |
|
||||
+ BIT_USB3_USB2_TRANSITION));
|
||||
+
|
||||
+ if (!can_switch) {
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_USB,
|
||||
+ "Switching to USB 3 mode unsupported by the chip\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* At this point cur_speed is USB_SPEED_HIGH. If we already tried
|
||||
+ * to switch don't try again - it's a USB 2 port.
|
||||
+ */
|
||||
+ if (u32_get_bits(pad_ctrl2, BIT_MASK_USB23_SW_MODE_V1) == BIT_USB_MODE_U3)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Enable IO wrapper timeout */
|
||||
+ if (id == RTW_CHIP_TYPE_8822B || id == RTW_CHIP_TYPE_8821C)
|
||||
+ rtw_write8_clr(rtwdev, REG_SW_MDIO + 3, BIT(0));
|
||||
+
|
||||
+ u32p_replace_bits(&pad_ctrl2, BIT_USB_MODE_U3, BIT_MASK_USB23_SW_MODE_V1);
|
||||
+ pad_ctrl2 |= BIT_RSM_EN_V1;
|
||||
+
|
||||
+ rtw_write32(rtwdev, REG_PAD_CTRL2, pad_ctrl2);
|
||||
+ rtw_write8(rtwdev, REG_PAD_CTRL2 + 1, 4);
|
||||
+
|
||||
+ rtw_write16_set(rtwdev, REG_SYS_PW_CTRL, BIT_APFM_OFFMAC);
|
||||
+ usleep_range(1000, 1001);
|
||||
+ rtw_write32_set(rtwdev, REG_PAD_CTRL2, BIT_NO_PDN_CHIPOFF_V1);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int rtw_usb_switch_mode(struct rtw_dev *rtwdev)
|
||||
+{
|
||||
+ u8 id = rtwdev->chip->id;
|
||||
+
|
||||
+ if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!rtwdev->efuse.usb_mode_switch) {
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_USB,
|
||||
+ "Switching to USB 3 mode disabled by chip's efuse\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (!rtw_switch_usb_mode) {
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_USB,
|
||||
+ "Switching to USB 3 mode disabled by module parameter\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return rtw_usb_switch_mode_new(rtwdev);
|
||||
+}
|
||||
+
|
||||
int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
{
|
||||
struct rtw_dev *rtwdev;
|
||||
@@ -896,6 +972,14 @@ int rtw_usb_probe(struct usb_interface *
|
||||
goto err_destroy_rxwq;
|
||||
}
|
||||
|
||||
+ ret = rtw_usb_switch_mode(rtwdev);
|
||||
+ if (ret) {
|
||||
+ /* Not a fail, but we do need to skip rtw_register_hw. */
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_USB, "switching to USB 3 mode\n");
|
||||
+ ret = 0;
|
||||
+ goto err_destroy_rxwq;
|
||||
+ }
|
||||
+
|
||||
ret = rtw_register_hw(rtwdev, rtwdev->hw);
|
||||
if (ret) {
|
||||
rtw_err(rtwdev, "failed to register hw\n");
|
@ -0,0 +1,454 @@
|
||||
From 8db6c1ca64664ef9b071e6eeb646023ac5b240a8 Mon Sep 17 00:00:00 2001
|
||||
From: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Date: Thu, 18 Jul 2024 14:41:55 +0800
|
||||
Subject: [PATCH] wifi: rtw88: debugfs: support multiple adapters debugging
|
||||
|
||||
Originally in order to read partial registers from large area, we write
|
||||
a range value stored into a static variable and read registers according
|
||||
to the static variable.
|
||||
|
||||
However, if we install more than one adapters supported by this driver,
|
||||
the static variables will be overwritten by latter adapters. To resolve
|
||||
the problem, move the static variables to struct rtw_dev for each adapter.
|
||||
|
||||
With changes, smatch spends too much time to parse rtw_debugfs_init():
|
||||
debug.c:1289 rtw_debugfs_init() parse error: turning off implications
|
||||
after 60 seconds
|
||||
Move stuffs of adding debugfs entries to three rtw_debugfs_add_xxx()
|
||||
functions.
|
||||
|
||||
Reported-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Closes: https://lore.kernel.org/linux-wireless/cd6a2acf3c2c36d938b40140b52a779516f446a9.camel@realtek.com/T/#m27662022c70d9f893ba96f6c6a8dd8fce2434dfe
|
||||
Tested-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/20240718064155.38955-1-pkshih@realtek.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/debug.c | 303 ++++++++++++---------
|
||||
drivers/net/wireless/realtek/rtw88/debug.h | 2 +
|
||||
drivers/net/wireless/realtek/rtw88/main.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 3 +-
|
||||
4 files changed, 180 insertions(+), 129 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/debug.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
|
||||
@@ -43,6 +43,62 @@ struct rtw_debugfs_priv {
|
||||
};
|
||||
};
|
||||
|
||||
+struct rtw_debugfs {
|
||||
+ struct rtw_debugfs_priv mac_0;
|
||||
+ struct rtw_debugfs_priv mac_1;
|
||||
+ struct rtw_debugfs_priv mac_2;
|
||||
+ struct rtw_debugfs_priv mac_3;
|
||||
+ struct rtw_debugfs_priv mac_4;
|
||||
+ struct rtw_debugfs_priv mac_5;
|
||||
+ struct rtw_debugfs_priv mac_6;
|
||||
+ struct rtw_debugfs_priv mac_7;
|
||||
+ struct rtw_debugfs_priv mac_10;
|
||||
+ struct rtw_debugfs_priv mac_11;
|
||||
+ struct rtw_debugfs_priv mac_12;
|
||||
+ struct rtw_debugfs_priv mac_13;
|
||||
+ struct rtw_debugfs_priv mac_14;
|
||||
+ struct rtw_debugfs_priv mac_15;
|
||||
+ struct rtw_debugfs_priv mac_16;
|
||||
+ struct rtw_debugfs_priv mac_17;
|
||||
+ struct rtw_debugfs_priv bb_8;
|
||||
+ struct rtw_debugfs_priv bb_9;
|
||||
+ struct rtw_debugfs_priv bb_a;
|
||||
+ struct rtw_debugfs_priv bb_b;
|
||||
+ struct rtw_debugfs_priv bb_c;
|
||||
+ struct rtw_debugfs_priv bb_d;
|
||||
+ struct rtw_debugfs_priv bb_e;
|
||||
+ struct rtw_debugfs_priv bb_f;
|
||||
+ struct rtw_debugfs_priv bb_18;
|
||||
+ struct rtw_debugfs_priv bb_19;
|
||||
+ struct rtw_debugfs_priv bb_1a;
|
||||
+ struct rtw_debugfs_priv bb_1b;
|
||||
+ struct rtw_debugfs_priv bb_1c;
|
||||
+ struct rtw_debugfs_priv bb_1d;
|
||||
+ struct rtw_debugfs_priv bb_1e;
|
||||
+ struct rtw_debugfs_priv bb_1f;
|
||||
+ struct rtw_debugfs_priv bb_2c;
|
||||
+ struct rtw_debugfs_priv bb_2d;
|
||||
+ struct rtw_debugfs_priv bb_40;
|
||||
+ struct rtw_debugfs_priv bb_41;
|
||||
+ struct rtw_debugfs_priv rf_dump;
|
||||
+ struct rtw_debugfs_priv tx_pwr_tbl;
|
||||
+ struct rtw_debugfs_priv write_reg;
|
||||
+ struct rtw_debugfs_priv h2c;
|
||||
+ struct rtw_debugfs_priv rf_write;
|
||||
+ struct rtw_debugfs_priv rf_read;
|
||||
+ struct rtw_debugfs_priv read_reg;
|
||||
+ struct rtw_debugfs_priv fix_rate;
|
||||
+ struct rtw_debugfs_priv dump_cam;
|
||||
+ struct rtw_debugfs_priv rsvd_page;
|
||||
+ struct rtw_debugfs_priv phy_info;
|
||||
+ struct rtw_debugfs_priv coex_enable;
|
||||
+ struct rtw_debugfs_priv coex_info;
|
||||
+ struct rtw_debugfs_priv edcca_enable;
|
||||
+ struct rtw_debugfs_priv fw_crash;
|
||||
+ struct rtw_debugfs_priv force_lowest_basic_rate;
|
||||
+ struct rtw_debugfs_priv dm_cap;
|
||||
+};
|
||||
+
|
||||
static const char * const rtw_dm_cap_strs[] = {
|
||||
[RTW_DM_CAP_NA] = "NA",
|
||||
[RTW_DM_CAP_TXGAPK] = "TXGAPK",
|
||||
@@ -524,7 +580,7 @@ static int rtw_debug_get_bb_page(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int rtw_debug_get_rf_dump(struct seq_file *m, void *v)
|
||||
+static int rtw_debugfs_get_rf_dump(struct seq_file *m, void *v)
|
||||
{
|
||||
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
||||
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
||||
@@ -1074,139 +1130,102 @@ static int rtw_debugfs_get_dm_cap(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#define rtw_debug_impl_mac(page, addr) \
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_mac_ ##page = { \
|
||||
+#define rtw_debug_priv_mac(addr) \
|
||||
+{ \
|
||||
.cb_read = rtw_debug_get_mac_page, \
|
||||
.cb_data = addr, \
|
||||
}
|
||||
|
||||
-rtw_debug_impl_mac(0, 0x0000);
|
||||
-rtw_debug_impl_mac(1, 0x0100);
|
||||
-rtw_debug_impl_mac(2, 0x0200);
|
||||
-rtw_debug_impl_mac(3, 0x0300);
|
||||
-rtw_debug_impl_mac(4, 0x0400);
|
||||
-rtw_debug_impl_mac(5, 0x0500);
|
||||
-rtw_debug_impl_mac(6, 0x0600);
|
||||
-rtw_debug_impl_mac(7, 0x0700);
|
||||
-rtw_debug_impl_mac(10, 0x1000);
|
||||
-rtw_debug_impl_mac(11, 0x1100);
|
||||
-rtw_debug_impl_mac(12, 0x1200);
|
||||
-rtw_debug_impl_mac(13, 0x1300);
|
||||
-rtw_debug_impl_mac(14, 0x1400);
|
||||
-rtw_debug_impl_mac(15, 0x1500);
|
||||
-rtw_debug_impl_mac(16, 0x1600);
|
||||
-rtw_debug_impl_mac(17, 0x1700);
|
||||
-
|
||||
-#define rtw_debug_impl_bb(page, addr) \
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_bb_ ##page = { \
|
||||
+#define rtw_debug_priv_bb(addr) \
|
||||
+{ \
|
||||
.cb_read = rtw_debug_get_bb_page, \
|
||||
.cb_data = addr, \
|
||||
}
|
||||
|
||||
-rtw_debug_impl_bb(8, 0x0800);
|
||||
-rtw_debug_impl_bb(9, 0x0900);
|
||||
-rtw_debug_impl_bb(a, 0x0a00);
|
||||
-rtw_debug_impl_bb(b, 0x0b00);
|
||||
-rtw_debug_impl_bb(c, 0x0c00);
|
||||
-rtw_debug_impl_bb(d, 0x0d00);
|
||||
-rtw_debug_impl_bb(e, 0x0e00);
|
||||
-rtw_debug_impl_bb(f, 0x0f00);
|
||||
-rtw_debug_impl_bb(18, 0x1800);
|
||||
-rtw_debug_impl_bb(19, 0x1900);
|
||||
-rtw_debug_impl_bb(1a, 0x1a00);
|
||||
-rtw_debug_impl_bb(1b, 0x1b00);
|
||||
-rtw_debug_impl_bb(1c, 0x1c00);
|
||||
-rtw_debug_impl_bb(1d, 0x1d00);
|
||||
-rtw_debug_impl_bb(1e, 0x1e00);
|
||||
-rtw_debug_impl_bb(1f, 0x1f00);
|
||||
-rtw_debug_impl_bb(2c, 0x2c00);
|
||||
-rtw_debug_impl_bb(2d, 0x2d00);
|
||||
-rtw_debug_impl_bb(40, 0x4000);
|
||||
-rtw_debug_impl_bb(41, 0x4100);
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_rf_dump = {
|
||||
- .cb_read = rtw_debug_get_rf_dump,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_tx_pwr_tbl = {
|
||||
- .cb_read = rtw_debugfs_get_tx_pwr_tbl,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_write_reg = {
|
||||
- .cb_write = rtw_debugfs_set_write_reg,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_h2c = {
|
||||
- .cb_write = rtw_debugfs_set_h2c,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_rf_write = {
|
||||
- .cb_write = rtw_debugfs_set_rf_write,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_rf_read = {
|
||||
- .cb_write = rtw_debugfs_set_rf_read,
|
||||
- .cb_read = rtw_debugfs_get_rf_read,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_read_reg = {
|
||||
- .cb_write = rtw_debugfs_set_read_reg,
|
||||
- .cb_read = rtw_debugfs_get_read_reg,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_fix_rate = {
|
||||
- .cb_write = rtw_debugfs_set_fix_rate,
|
||||
- .cb_read = rtw_debugfs_get_fix_rate,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_dump_cam = {
|
||||
- .cb_write = rtw_debugfs_set_single_input,
|
||||
- .cb_read = rtw_debugfs_get_dump_cam,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_rsvd_page = {
|
||||
- .cb_write = rtw_debugfs_set_rsvd_page,
|
||||
- .cb_read = rtw_debugfs_get_rsvd_page,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_phy_info = {
|
||||
- .cb_read = rtw_debugfs_get_phy_info,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_coex_enable = {
|
||||
- .cb_write = rtw_debugfs_set_coex_enable,
|
||||
- .cb_read = rtw_debugfs_get_coex_enable,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_coex_info = {
|
||||
- .cb_read = rtw_debugfs_get_coex_info,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_edcca_enable = {
|
||||
- .cb_write = rtw_debugfs_set_edcca_enable,
|
||||
- .cb_read = rtw_debugfs_get_edcca_enable,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_fw_crash = {
|
||||
- .cb_write = rtw_debugfs_set_fw_crash,
|
||||
- .cb_read = rtw_debugfs_get_fw_crash,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_force_lowest_basic_rate = {
|
||||
- .cb_write = rtw_debugfs_set_force_lowest_basic_rate,
|
||||
- .cb_read = rtw_debugfs_get_force_lowest_basic_rate,
|
||||
-};
|
||||
-
|
||||
-static struct rtw_debugfs_priv rtw_debug_priv_dm_cap = {
|
||||
- .cb_write = rtw_debugfs_set_dm_cap,
|
||||
- .cb_read = rtw_debugfs_get_dm_cap,
|
||||
+#define rtw_debug_priv_get(name) \
|
||||
+{ \
|
||||
+ .cb_read = rtw_debugfs_get_ ##name, \
|
||||
+}
|
||||
+
|
||||
+#define rtw_debug_priv_set(name) \
|
||||
+{ \
|
||||
+ .cb_write = rtw_debugfs_set_ ##name, \
|
||||
+}
|
||||
+
|
||||
+#define rtw_debug_priv_set_and_get(name) \
|
||||
+{ \
|
||||
+ .cb_write = rtw_debugfs_set_ ##name, \
|
||||
+ .cb_read = rtw_debugfs_get_ ##name, \
|
||||
+}
|
||||
+
|
||||
+#define rtw_debug_priv_set_single_and_get(name) \
|
||||
+{ \
|
||||
+ .cb_write = rtw_debugfs_set_single_input, \
|
||||
+ .cb_read = rtw_debugfs_get_ ##name, \
|
||||
+}
|
||||
+
|
||||
+static const struct rtw_debugfs rtw_debugfs_templ = {
|
||||
+ .mac_0 = rtw_debug_priv_mac(0x0000),
|
||||
+ .mac_1 = rtw_debug_priv_mac(0x0100),
|
||||
+ .mac_2 = rtw_debug_priv_mac(0x0200),
|
||||
+ .mac_3 = rtw_debug_priv_mac(0x0300),
|
||||
+ .mac_4 = rtw_debug_priv_mac(0x0400),
|
||||
+ .mac_5 = rtw_debug_priv_mac(0x0500),
|
||||
+ .mac_6 = rtw_debug_priv_mac(0x0600),
|
||||
+ .mac_7 = rtw_debug_priv_mac(0x0700),
|
||||
+ .mac_10 = rtw_debug_priv_mac(0x1000),
|
||||
+ .mac_11 = rtw_debug_priv_mac(0x1100),
|
||||
+ .mac_12 = rtw_debug_priv_mac(0x1200),
|
||||
+ .mac_13 = rtw_debug_priv_mac(0x1300),
|
||||
+ .mac_14 = rtw_debug_priv_mac(0x1400),
|
||||
+ .mac_15 = rtw_debug_priv_mac(0x1500),
|
||||
+ .mac_16 = rtw_debug_priv_mac(0x1600),
|
||||
+ .mac_17 = rtw_debug_priv_mac(0x1700),
|
||||
+ .bb_8 = rtw_debug_priv_bb(0x0800),
|
||||
+ .bb_9 = rtw_debug_priv_bb(0x0900),
|
||||
+ .bb_a = rtw_debug_priv_bb(0x0a00),
|
||||
+ .bb_b = rtw_debug_priv_bb(0x0b00),
|
||||
+ .bb_c = rtw_debug_priv_bb(0x0c00),
|
||||
+ .bb_d = rtw_debug_priv_bb(0x0d00),
|
||||
+ .bb_e = rtw_debug_priv_bb(0x0e00),
|
||||
+ .bb_f = rtw_debug_priv_bb(0x0f00),
|
||||
+ .bb_18 = rtw_debug_priv_bb(0x1800),
|
||||
+ .bb_19 = rtw_debug_priv_bb(0x1900),
|
||||
+ .bb_1a = rtw_debug_priv_bb(0x1a00),
|
||||
+ .bb_1b = rtw_debug_priv_bb(0x1b00),
|
||||
+ .bb_1c = rtw_debug_priv_bb(0x1c00),
|
||||
+ .bb_1d = rtw_debug_priv_bb(0x1d00),
|
||||
+ .bb_1e = rtw_debug_priv_bb(0x1e00),
|
||||
+ .bb_1f = rtw_debug_priv_bb(0x1f00),
|
||||
+ .bb_2c = rtw_debug_priv_bb(0x2c00),
|
||||
+ .bb_2d = rtw_debug_priv_bb(0x2d00),
|
||||
+ .bb_40 = rtw_debug_priv_bb(0x4000),
|
||||
+ .bb_41 = rtw_debug_priv_bb(0x4100),
|
||||
+ .rf_dump = rtw_debug_priv_get(rf_dump),
|
||||
+ .tx_pwr_tbl = rtw_debug_priv_get(tx_pwr_tbl),
|
||||
+ .write_reg = rtw_debug_priv_set(write_reg),
|
||||
+ .h2c = rtw_debug_priv_set(h2c),
|
||||
+ .rf_write = rtw_debug_priv_set(rf_write),
|
||||
+ .rf_read = rtw_debug_priv_set_and_get(rf_read),
|
||||
+ .read_reg = rtw_debug_priv_set_and_get(read_reg),
|
||||
+ .fix_rate = rtw_debug_priv_set_and_get(fix_rate),
|
||||
+ .dump_cam = rtw_debug_priv_set_single_and_get(dump_cam),
|
||||
+ .rsvd_page = rtw_debug_priv_set_and_get(rsvd_page),
|
||||
+ .phy_info = rtw_debug_priv_get(phy_info),
|
||||
+ .coex_enable = rtw_debug_priv_set_and_get(coex_enable),
|
||||
+ .coex_info = rtw_debug_priv_get(coex_info),
|
||||
+ .edcca_enable = rtw_debug_priv_set_and_get(edcca_enable),
|
||||
+ .fw_crash = rtw_debug_priv_set_and_get(fw_crash),
|
||||
+ .force_lowest_basic_rate = rtw_debug_priv_set_and_get(force_lowest_basic_rate),
|
||||
+ .dm_cap = rtw_debug_priv_set_and_get(dm_cap),
|
||||
};
|
||||
|
||||
#define rtw_debugfs_add_core(name, mode, fopname, parent) \
|
||||
do { \
|
||||
- rtw_debug_priv_ ##name.rtwdev = rtwdev; \
|
||||
+ struct rtw_debugfs_priv *priv = &rtwdev->debugfs->name; \
|
||||
+ priv->rtwdev = rtwdev; \
|
||||
if (IS_ERR(debugfs_create_file(#name, mode, \
|
||||
- parent, &rtw_debug_priv_ ##name,\
|
||||
+ parent, priv, \
|
||||
&file_ops_ ##fopname))) \
|
||||
pr_debug("Unable to initialize debugfs:%s\n", \
|
||||
#name); \
|
||||
@@ -1219,12 +1238,9 @@ static struct rtw_debugfs_priv rtw_debug
|
||||
#define rtw_debugfs_add_r(name) \
|
||||
rtw_debugfs_add_core(name, S_IFREG | 0444, single_r, debugfs_topdir)
|
||||
|
||||
-void rtw_debugfs_init(struct rtw_dev *rtwdev)
|
||||
+static
|
||||
+void rtw_debugfs_add_basic(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir)
|
||||
{
|
||||
- struct dentry *debugfs_topdir;
|
||||
-
|
||||
- debugfs_topdir = debugfs_create_dir("rtw88",
|
||||
- rtwdev->hw->wiphy->debugfsdir);
|
||||
rtw_debugfs_add_w(write_reg);
|
||||
rtw_debugfs_add_rw(read_reg);
|
||||
rtw_debugfs_add_w(rf_write);
|
||||
@@ -1236,6 +1252,17 @@ void rtw_debugfs_init(struct rtw_dev *rt
|
||||
rtw_debugfs_add_r(coex_info);
|
||||
rtw_debugfs_add_rw(coex_enable);
|
||||
rtw_debugfs_add_w(h2c);
|
||||
+ rtw_debugfs_add_r(rf_dump);
|
||||
+ rtw_debugfs_add_r(tx_pwr_tbl);
|
||||
+ rtw_debugfs_add_rw(edcca_enable);
|
||||
+ rtw_debugfs_add_rw(fw_crash);
|
||||
+ rtw_debugfs_add_rw(force_lowest_basic_rate);
|
||||
+ rtw_debugfs_add_rw(dm_cap);
|
||||
+}
|
||||
+
|
||||
+static
|
||||
+void rtw_debugfs_add_sec0(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir)
|
||||
+{
|
||||
rtw_debugfs_add_r(mac_0);
|
||||
rtw_debugfs_add_r(mac_1);
|
||||
rtw_debugfs_add_r(mac_2);
|
||||
@@ -1252,6 +1279,11 @@ void rtw_debugfs_init(struct rtw_dev *rt
|
||||
rtw_debugfs_add_r(bb_d);
|
||||
rtw_debugfs_add_r(bb_e);
|
||||
rtw_debugfs_add_r(bb_f);
|
||||
+}
|
||||
+
|
||||
+static
|
||||
+void rtw_debugfs_add_sec1(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir)
|
||||
+{
|
||||
rtw_debugfs_add_r(mac_10);
|
||||
rtw_debugfs_add_r(mac_11);
|
||||
rtw_debugfs_add_r(mac_12);
|
||||
@@ -1274,14 +1306,29 @@ void rtw_debugfs_init(struct rtw_dev *rt
|
||||
rtw_debugfs_add_r(bb_40);
|
||||
rtw_debugfs_add_r(bb_41);
|
||||
}
|
||||
- rtw_debugfs_add_r(rf_dump);
|
||||
- rtw_debugfs_add_r(tx_pwr_tbl);
|
||||
- rtw_debugfs_add_rw(edcca_enable);
|
||||
- rtw_debugfs_add_rw(fw_crash);
|
||||
- rtw_debugfs_add_rw(force_lowest_basic_rate);
|
||||
- rtw_debugfs_add_rw(dm_cap);
|
||||
}
|
||||
|
||||
+void rtw_debugfs_init(struct rtw_dev *rtwdev)
|
||||
+{
|
||||
+ struct dentry *debugfs_topdir;
|
||||
+
|
||||
+ rtwdev->debugfs = kmemdup(&rtw_debugfs_templ, sizeof(rtw_debugfs_templ),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!rtwdev->debugfs)
|
||||
+ return;
|
||||
+
|
||||
+ debugfs_topdir = debugfs_create_dir("rtw88",
|
||||
+ rtwdev->hw->wiphy->debugfsdir);
|
||||
+
|
||||
+ rtw_debugfs_add_basic(rtwdev, debugfs_topdir);
|
||||
+ rtw_debugfs_add_sec0(rtwdev, debugfs_topdir);
|
||||
+ rtw_debugfs_add_sec1(rtwdev, debugfs_topdir);
|
||||
+}
|
||||
+
|
||||
+void rtw_debugfs_deinit(struct rtw_dev *rtwdev)
|
||||
+{
|
||||
+ kfree(rtwdev->debugfs);
|
||||
+}
|
||||
#endif /* CPTCFG_RTW88_DEBUGFS */
|
||||
|
||||
#ifdef CPTCFG_RTW88_DEBUG
|
||||
--- a/drivers/net/wireless/realtek/rtw88/debug.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.h
|
||||
@@ -34,11 +34,13 @@ enum rtw_debug_mask {
|
||||
#ifdef CPTCFG_RTW88_DEBUGFS
|
||||
|
||||
void rtw_debugfs_init(struct rtw_dev *rtwdev);
|
||||
+void rtw_debugfs_deinit(struct rtw_dev *rtwdev);
|
||||
void rtw_debugfs_get_simple_phy_info(struct seq_file *m);
|
||||
|
||||
#else
|
||||
|
||||
static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {}
|
||||
+static inline void rtw_debugfs_deinit(struct rtw_dev *rtwdev) {}
|
||||
|
||||
#endif /* CPTCFG_RTW88_DEBUGFS */
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -2300,6 +2300,7 @@ void rtw_unregister_hw(struct rtw_dev *r
|
||||
|
||||
ieee80211_unregister_hw(hw);
|
||||
rtw_unset_supported_band(hw, chip);
|
||||
+ rtw_debugfs_deinit(rtwdev);
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_unregister_hw);
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -50,6 +50,7 @@ extern const struct ieee80211_ops rtw_op
|
||||
#define RTW_MAX_CHANNEL_NUM_5G 49
|
||||
|
||||
struct rtw_dev;
|
||||
+struct rtw_debugfs;
|
||||
|
||||
enum rtw_hci_type {
|
||||
RTW_HCI_TYPE_PCIE,
|
||||
@@ -2053,7 +2054,7 @@ struct rtw_dev {
|
||||
bool beacon_loss;
|
||||
struct completion lps_leave_check;
|
||||
|
||||
- struct dentry *debugfs;
|
||||
+ struct rtw_debugfs *debugfs;
|
||||
|
||||
u8 sta_cnt;
|
||||
u32 rts_threshold;
|
@ -0,0 +1,25 @@
|
||||
From 7e989b0c1e33210c07340bf5228aa83ea52515b5 Mon Sep 17 00:00:00 2001
|
||||
From: Zong-Zhe Yang <kevin_yang@realtek.com>
|
||||
Date: Thu, 18 Jul 2024 15:06:15 +0800
|
||||
Subject: [PATCH] wifi: rtw88: select WANT_DEV_COREDUMP
|
||||
|
||||
We have invoked device coredump when fw crash.
|
||||
Should select WANT_DEV_COREDUMP by ourselves.
|
||||
|
||||
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/20240718070616.42217-1-pkshih@realtek.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/Kconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
|
||||
@@ -14,6 +14,7 @@ if RTW88
|
||||
config RTW88_CORE
|
||||
tristate
|
||||
depends on m
|
||||
+ select BPAUTO_WANT_DEV_COREDUMP
|
||||
|
||||
config RTW88_PCI
|
||||
tristate
|
@ -0,0 +1,151 @@
|
||||
From 53ed4b25a79aeec5991c2dc579e635b136ef7676 Mon Sep 17 00:00:00 2001
|
||||
From: Po-Hao Huang <phhuang@realtek.com>
|
||||
Date: Wed, 24 Jul 2024 13:05:01 +0800
|
||||
Subject: [PATCH] wifi: rtw88: 8822c: Parse channel from IE to correct invalid
|
||||
hardware reports
|
||||
|
||||
For CCK packets we could get incorrect reports from hardware.
|
||||
And this causes wrong frequencies being reported. Parse the channel
|
||||
information from IE if provided by AP to fix this.
|
||||
|
||||
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/20240724050501.7550-1-pkshih@realtek.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/pci.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 7 ++--
|
||||
drivers/net/wireless/realtek/rtw88/rx.c | 41 +++++++++++++++++++
|
||||
drivers/net/wireless/realtek/rtw88/rx.h | 13 ++++++
|
||||
drivers/net/wireless/realtek/rtw88/sdio.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 2 +
|
||||
7 files changed, 63 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -623,6 +623,7 @@ struct rtw_rx_pkt_stat {
|
||||
bool crc_err;
|
||||
bool decrypted;
|
||||
bool is_c2h;
|
||||
+ bool channel_invalid;
|
||||
|
||||
s32 signal_power;
|
||||
u16 pkt_len;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
@@ -1088,6 +1088,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de
|
||||
/* remove rx_desc */
|
||||
skb_pull(new, pkt_offset);
|
||||
|
||||
+ rtw_update_rx_freq_for_invalid(rtwdev, new, &rx_status, &pkt_stat);
|
||||
rtw_rx_stats(rtwdev, pkt_stat.vif, new);
|
||||
memcpy(new->cb, &rx_status, sizeof(rx_status));
|
||||
ieee80211_rx_napi(rtwdev->hw, NULL, new, napi);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -2576,9 +2576,10 @@ static void query_phy_status_page0(struc
|
||||
rx_power[RF_PATH_B] -= 110;
|
||||
|
||||
channel = GET_PHY_STAT_P0_CHANNEL(phy_status);
|
||||
- if (channel == 0)
|
||||
- channel = rtwdev->hal.current_channel;
|
||||
- rtw_set_rx_freq_band(pkt_stat, channel);
|
||||
+ if (channel != 0)
|
||||
+ rtw_set_rx_freq_band(pkt_stat, channel);
|
||||
+ else
|
||||
+ pkt_stat->channel_invalid = true;
|
||||
|
||||
pkt_stat->rx_power[RF_PATH_A] = rx_power[RF_PATH_A];
|
||||
pkt_stat->rx_power[RF_PATH_B] = rx_power[RF_PATH_B];
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rx.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
|
||||
@@ -146,6 +146,47 @@ static void rtw_set_rx_freq_by_pktstat(s
|
||||
rx_status->band = pkt_stat->band;
|
||||
}
|
||||
|
||||
+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb,
|
||||
+ struct ieee80211_rx_status *rx_status,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat)
|
||||
+{
|
||||
+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
|
||||
+ int channel = rtwdev->hal.current_channel;
|
||||
+ size_t hdr_len, ielen;
|
||||
+ int channel_number;
|
||||
+ u8 *variable;
|
||||
+
|
||||
+ if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
|
||||
+ goto fill_rx_status;
|
||||
+
|
||||
+ if (ieee80211_is_beacon(mgmt->frame_control)) {
|
||||
+ variable = mgmt->u.beacon.variable;
|
||||
+ hdr_len = offsetof(struct ieee80211_mgmt,
|
||||
+ u.beacon.variable);
|
||||
+ } else if (ieee80211_is_probe_resp(mgmt->frame_control)) {
|
||||
+ variable = mgmt->u.probe_resp.variable;
|
||||
+ hdr_len = offsetof(struct ieee80211_mgmt,
|
||||
+ u.probe_resp.variable);
|
||||
+ } else {
|
||||
+ goto fill_rx_status;
|
||||
+ }
|
||||
+
|
||||
+ if (skb->len > hdr_len)
|
||||
+ ielen = skb->len - hdr_len;
|
||||
+ else
|
||||
+ goto fill_rx_status;
|
||||
+
|
||||
+ channel_number = cfg80211_get_ies_channel_number(variable, ielen,
|
||||
+ NL80211_BAND_2GHZ);
|
||||
+ if (channel_number != -1)
|
||||
+ channel = channel_number;
|
||||
+
|
||||
+fill_rx_status:
|
||||
+ rtw_set_rx_freq_band(pkt_stat, channel);
|
||||
+ rtw_set_rx_freq_by_pktstat(pkt_stat, rx_status);
|
||||
+}
|
||||
+EXPORT_SYMBOL(rtw_update_rx_freq_from_ie);
|
||||
+
|
||||
void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
|
||||
struct rtw_rx_pkt_stat *pkt_stat,
|
||||
struct ieee80211_hdr *hdr,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rx.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rx.h
|
||||
@@ -50,5 +50,18 @@ void rtw_rx_fill_rx_status(struct rtw_de
|
||||
struct ieee80211_hdr *hdr,
|
||||
struct ieee80211_rx_status *rx_status,
|
||||
u8 *phy_status);
|
||||
+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb,
|
||||
+ struct ieee80211_rx_status *rx_status,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat);
|
||||
+
|
||||
+static inline
|
||||
+void rtw_update_rx_freq_for_invalid(struct rtw_dev *rtwdev, struct sk_buff *skb,
|
||||
+ struct ieee80211_rx_status *rx_status,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat)
|
||||
+{
|
||||
+ if (pkt_stat->channel_invalid)
|
||||
+ rtw_update_rx_freq_from_ie(rtwdev, skb, rx_status, pkt_stat);
|
||||
+}
|
||||
+
|
||||
|
||||
#endif
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -948,6 +948,7 @@ static void rtw_sdio_rx_skb(struct rtw_d
|
||||
skb_put(skb, pkt_stat->pkt_len);
|
||||
skb_reserve(skb, pkt_offset);
|
||||
|
||||
+ rtw_update_rx_freq_for_invalid(rtwdev, skb, rx_status, pkt_stat);
|
||||
rtw_rx_stats(rtwdev, pkt_stat->vif, skb);
|
||||
|
||||
ieee80211_rx_irqsafe(rtwdev->hw, skb);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -579,6 +579,8 @@ static void rtw_usb_rx_handler(struct wo
|
||||
|
||||
skb_put(skb, pkt_stat.pkt_len);
|
||||
skb_reserve(skb, pkt_offset);
|
||||
+
|
||||
+ rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat);
|
||||
memcpy(skb->cb, &rx_status, sizeof(rx_status));
|
||||
ieee80211_rx_irqsafe(rtwdev->hw, skb);
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
From fbbd8cb347e25b68d25c4f3871821afc495ee7a9 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Thu, 8 Aug 2024 01:19:36 +0300
|
||||
Subject: [PATCH] wifi: rtw88: usb: Init RX burst length according to USB speed
|
||||
|
||||
This is needed in order to make USB RX aggregation work with RTL8811CU
|
||||
(and presumably RTL8822BU and RTL8822CU also).
|
||||
|
||||
I don't know what BIT_DMA_BURST_CNT, BIT_DMA_MODE, and BIT_DROP_DATA_EN
|
||||
are doing.
|
||||
|
||||
Tested with RTL8822CU, RTL8811CU, and RTL8723DU.
|
||||
|
||||
The RX speed is unchanged in my tests.
|
||||
|
||||
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/ac569c6f-7129-4341-b523-901fe10cabff@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/reg.h | 6 ++++++
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 23 ++++++++++++++++++++++-
|
||||
2 files changed, 28 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/reg.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
|
||||
@@ -322,6 +322,12 @@
|
||||
#define REG_RXDMA_DPR 0x028C
|
||||
#define REG_RXDMA_MODE 0x0290
|
||||
#define BIT_DMA_MODE BIT(1)
|
||||
+#define BIT_DMA_BURST_CNT GENMASK(3, 2)
|
||||
+#define BIT_DMA_BURST_SIZE GENMASK(5, 4)
|
||||
+#define BIT_DMA_BURST_SIZE_64 2
|
||||
+#define BIT_DMA_BURST_SIZE_512 1
|
||||
+#define BIT_DMA_BURST_SIZE_1024 0
|
||||
+
|
||||
#define REG_RXPKTNUM 0x02B0
|
||||
|
||||
#define REG_INT_MIG 0x0304
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -720,9 +720,30 @@ static void rtw_usb_link_ps(struct rtw_d
|
||||
/* empty function for rtw_hci_ops */
|
||||
}
|
||||
|
||||
+static void rtw_usb_init_burst_pkt_len(struct rtw_dev *rtwdev)
|
||||
+{
|
||||
+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
|
||||
+ enum usb_device_speed speed = rtwusb->udev->speed;
|
||||
+ u8 rxdma, burst_size;
|
||||
+
|
||||
+ rxdma = BIT_DMA_BURST_CNT | BIT_DMA_MODE;
|
||||
+
|
||||
+ if (speed == USB_SPEED_SUPER)
|
||||
+ burst_size = BIT_DMA_BURST_SIZE_1024;
|
||||
+ else if (speed == USB_SPEED_HIGH)
|
||||
+ burst_size = BIT_DMA_BURST_SIZE_512;
|
||||
+ else
|
||||
+ burst_size = BIT_DMA_BURST_SIZE_64;
|
||||
+
|
||||
+ u8p_replace_bits(&rxdma, burst_size, BIT_DMA_BURST_SIZE);
|
||||
+
|
||||
+ rtw_write8(rtwdev, REG_RXDMA_MODE, rxdma);
|
||||
+ rtw_write16_set(rtwdev, REG_TXDMA_OFFSET_CHK, BIT_DROP_DATA_EN);
|
||||
+}
|
||||
+
|
||||
static void rtw_usb_interface_cfg(struct rtw_dev *rtwdev)
|
||||
{
|
||||
- /* empty function for rtw_hci_ops */
|
||||
+ rtw_usb_init_burst_pkt_len(rtwdev);
|
||||
}
|
||||
|
||||
static struct rtw_hci_ops rtw_usb_ops = {
|
@ -0,0 +1,31 @@
|
||||
From 38ea04a79ad0f8cc30bb5e9ad98d665e4ae5060c Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Thu, 8 Aug 2024 01:20:36 +0300
|
||||
Subject: [PATCH] wifi: rtw88: usb: Update the RX stats after every frame
|
||||
|
||||
Update the number of received unicast data frames and bytes every time
|
||||
a frame is received. This is what the PCI and SDIO drivers do.
|
||||
|
||||
This has an influence on the power saving, bluetooth coexistence, and
|
||||
(in a future patch) the use of RX aggregation.
|
||||
|
||||
Tested with RTL8822CU, RTL8811CU, and RTL8723DU.
|
||||
|
||||
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/75a2ca52-8f01-45c5-926f-d3a68ae3b284@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -581,6 +581,7 @@ static void rtw_usb_rx_handler(struct wo
|
||||
skb_reserve(skb, pkt_offset);
|
||||
|
||||
rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat);
|
||||
+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
|
||||
memcpy(skb->cb, &rx_status, sizeof(rx_status));
|
||||
ieee80211_rx_irqsafe(rtwdev->hw, skb);
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
From df3d8f463b1dfc7cb8f4fb52b1b81d290b850d03 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Thu, 8 Aug 2024 01:21:36 +0300
|
||||
Subject: [PATCH] wifi: rtw88: usb: Support RX aggregation
|
||||
|
||||
The chips can be configured to aggregate several frames into a single
|
||||
USB transfer. Modify rtw_usb_rx_handler() to support this case.
|
||||
|
||||
RX aggregation improves the RX speed of RTL8811CU on certain ARM
|
||||
systems, like the NanoPi NEO Core2. It also improves the RX speed of
|
||||
RTL8822CU on some x86_64 systems.
|
||||
|
||||
Currently none of the chips are configured to aggregate frames.
|
||||
|
||||
Tested with RTL8822CU, RTL8811CU, and RTL8723DU.
|
||||
|
||||
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/f845826d-de71-492d-9a22-e48c07989a1f@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 61 ++++++++++++++++--------
|
||||
1 file changed, 40 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -546,11 +546,12 @@ static void rtw_usb_rx_handler(struct wo
|
||||
struct rtw_usb *rtwusb = container_of(work, struct rtw_usb, rx_work);
|
||||
struct rtw_dev *rtwdev = rtwusb->rtwdev;
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
- struct rtw_rx_pkt_stat pkt_stat;
|
||||
+ u32 pkt_desc_sz = chip->rx_pkt_desc_sz;
|
||||
struct ieee80211_rx_status rx_status;
|
||||
+ u32 pkt_offset, next_pkt, urb_len;
|
||||
+ struct rtw_rx_pkt_stat pkt_stat;
|
||||
+ struct sk_buff *next_skb;
|
||||
struct sk_buff *skb;
|
||||
- u32 pkt_desc_sz = chip->rx_pkt_desc_sz;
|
||||
- u32 pkt_offset;
|
||||
u8 *rx_desc;
|
||||
int limit;
|
||||
|
||||
@@ -559,31 +560,48 @@ static void rtw_usb_rx_handler(struct wo
|
||||
if (!skb)
|
||||
break;
|
||||
|
||||
- rx_desc = skb->data;
|
||||
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
|
||||
- &rx_status);
|
||||
- pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
|
||||
- pkt_stat.shift;
|
||||
-
|
||||
- if (pkt_stat.is_c2h) {
|
||||
- skb_put(skb, pkt_stat.pkt_len + pkt_offset);
|
||||
- rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb);
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
if (skb_queue_len(&rtwusb->rx_queue) >= RTW_USB_MAX_RXQ_LEN) {
|
||||
dev_dbg_ratelimited(rtwdev->dev, "failed to get rx_queue, overflow\n");
|
||||
dev_kfree_skb_any(skb);
|
||||
continue;
|
||||
}
|
||||
|
||||
- skb_put(skb, pkt_stat.pkt_len);
|
||||
- skb_reserve(skb, pkt_offset);
|
||||
+ urb_len = skb->len;
|
||||
+
|
||||
+ do {
|
||||
+ rx_desc = skb->data;
|
||||
+ chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
|
||||
+ &rx_status);
|
||||
+ pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
|
||||
+ pkt_stat.shift;
|
||||
+
|
||||
+ next_pkt = round_up(pkt_stat.pkt_len + pkt_offset, 8);
|
||||
+
|
||||
+ if (urb_len >= next_pkt + pkt_desc_sz)
|
||||
+ next_skb = skb_clone(skb, GFP_KERNEL);
|
||||
+ else
|
||||
+ next_skb = NULL;
|
||||
+
|
||||
+ if (pkt_stat.is_c2h) {
|
||||
+ skb_trim(skb, pkt_stat.pkt_len + pkt_offset);
|
||||
+ rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb);
|
||||
+ } else {
|
||||
+ skb_pull(skb, pkt_offset);
|
||||
+ skb_trim(skb, pkt_stat.pkt_len);
|
||||
+ rtw_update_rx_freq_for_invalid(rtwdev, skb,
|
||||
+ &rx_status,
|
||||
+ &pkt_stat);
|
||||
+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
|
||||
+ memcpy(skb->cb, &rx_status, sizeof(rx_status));
|
||||
+ ieee80211_rx_irqsafe(rtwdev->hw, skb);
|
||||
+ }
|
||||
+
|
||||
+ skb = next_skb;
|
||||
+ if (skb)
|
||||
+ skb_pull(skb, next_pkt);
|
||||
|
||||
- rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat);
|
||||
- rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
|
||||
- memcpy(skb->cb, &rx_status, sizeof(rx_status));
|
||||
- ieee80211_rx_irqsafe(rtwdev->hw, skb);
|
||||
+ urb_len -= next_pkt;
|
||||
+ } while (skb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,6 +645,7 @@ static void rtw_usb_read_port_complete(s
|
||||
if (skb)
|
||||
dev_kfree_skb_any(skb);
|
||||
} else {
|
||||
+ skb_put(skb, urb->actual_length);
|
||||
skb_queue_tail(&rtwusb->rx_queue, skb);
|
||||
queue_work(rtwusb->rxwq, &rtwusb->rx_work);
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
From 002a5db9a52a0e7af0fa9a450d31049748435748 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Thu, 8 Aug 2024 01:23:06 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c
|
||||
|
||||
Enable USB RX aggregation when there is at least 1 Mbps RX or TX
|
||||
traffic, otherwise disable it.
|
||||
|
||||
USB RX aggregation improves the RX speed of RTL8811CU on certain ARM
|
||||
systems, like the NanoPi NEO Core2. Before: 28 Mbps, after: 231 Mbps.
|
||||
|
||||
It also improves the RX speed of RTL8822CU on some x86_64 systems.
|
||||
Before: ~200 Mbps, after: ~300 Mbps.
|
||||
|
||||
The official drivers for these chips use the same logic for SDIO, but
|
||||
for some reason the SDIO driver in rtw88 always enables RX aggregation,
|
||||
so this patch only toggles aggregation for USB devices.
|
||||
|
||||
RTL8703B is likely not found in USB devices, and RTL8723DU doesn't like
|
||||
aggregation.
|
||||
|
||||
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/b4c0d54c-6755-4b0f-9dd7-f9196fd74b68@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/hci.h | 7 ++++
|
||||
drivers/net/wireless/realtek/rtw88/main.c | 13 +++++---
|
||||
drivers/net/wireless/realtek/rtw88/pci.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/sdio.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 40 +++++++++++++++++++++++
|
||||
5 files changed, 58 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/hci.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/hci.h
|
||||
@@ -18,6 +18,7 @@ struct rtw_hci_ops {
|
||||
void (*deep_ps)(struct rtw_dev *rtwdev, bool enter);
|
||||
void (*link_ps)(struct rtw_dev *rtwdev, bool enter);
|
||||
void (*interface_cfg)(struct rtw_dev *rtwdev);
|
||||
+ void (*dynamic_rx_agg)(struct rtw_dev *rtwdev, bool enable);
|
||||
|
||||
int (*write_data_rsvd_page)(struct rtw_dev *rtwdev, u8 *buf, u32 size);
|
||||
int (*write_data_h2c)(struct rtw_dev *rtwdev, u8 *buf, u32 size);
|
||||
@@ -72,6 +73,12 @@ static inline void rtw_hci_interface_cfg
|
||||
rtwdev->hci.ops->interface_cfg(rtwdev);
|
||||
}
|
||||
|
||||
+static inline void rtw_hci_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable)
|
||||
+{
|
||||
+ if (rtwdev->hci.ops->dynamic_rx_agg)
|
||||
+ rtwdev->hci.ops->dynamic_rx_agg(rtwdev, enable);
|
||||
+}
|
||||
+
|
||||
static inline int
|
||||
rtw_hci_write_data_rsvd_page(struct rtw_dev *rtwdev, u8 *buf, u32 size)
|
||||
{
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -212,6 +212,7 @@ static void rtw_watch_dog_work(struct wo
|
||||
struct rtw_traffic_stats *stats = &rtwdev->stats;
|
||||
struct rtw_watch_dog_iter_data data = {};
|
||||
bool busy_traffic = test_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags);
|
||||
+ u32 tx_unicast_mbps, rx_unicast_mbps;
|
||||
bool ps_active;
|
||||
|
||||
mutex_lock(&rtwdev->mutex);
|
||||
@@ -236,10 +237,11 @@ static void rtw_watch_dog_work(struct wo
|
||||
else
|
||||
ps_active = false;
|
||||
|
||||
- ewma_tp_add(&stats->tx_ewma_tp,
|
||||
- (u32)(stats->tx_unicast >> RTW_TP_SHIFT));
|
||||
- ewma_tp_add(&stats->rx_ewma_tp,
|
||||
- (u32)(stats->rx_unicast >> RTW_TP_SHIFT));
|
||||
+ tx_unicast_mbps = stats->tx_unicast >> RTW_TP_SHIFT;
|
||||
+ rx_unicast_mbps = stats->rx_unicast >> RTW_TP_SHIFT;
|
||||
+
|
||||
+ ewma_tp_add(&stats->tx_ewma_tp, tx_unicast_mbps);
|
||||
+ ewma_tp_add(&stats->rx_ewma_tp, rx_unicast_mbps);
|
||||
stats->tx_throughput = ewma_tp_read(&stats->tx_ewma_tp);
|
||||
stats->rx_throughput = ewma_tp_read(&stats->rx_ewma_tp);
|
||||
|
||||
@@ -259,6 +261,9 @@ static void rtw_watch_dog_work(struct wo
|
||||
|
||||
rtw_phy_dynamic_mechanism(rtwdev);
|
||||
|
||||
+ rtw_hci_dynamic_rx_agg(rtwdev,
|
||||
+ tx_unicast_mbps >= 1 || rx_unicast_mbps >= 1);
|
||||
+
|
||||
data.rtwdev = rtwdev;
|
||||
/* rtw_iterate_vifs internally uses an atomic iterator which is needed
|
||||
* to avoid taking local->iflist_mtx mutex
|
||||
--- a/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
@@ -1601,6 +1601,7 @@ static struct rtw_hci_ops rtw_pci_ops =
|
||||
.deep_ps = rtw_pci_deep_ps,
|
||||
.link_ps = rtw_pci_link_ps,
|
||||
.interface_cfg = rtw_pci_interface_cfg,
|
||||
+ .dynamic_rx_agg = NULL,
|
||||
|
||||
.read8 = rtw_pci_read8,
|
||||
.read16 = rtw_pci_read16,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -1157,6 +1157,7 @@ static struct rtw_hci_ops rtw_sdio_ops =
|
||||
.deep_ps = rtw_sdio_deep_ps,
|
||||
.link_ps = rtw_sdio_link_ps,
|
||||
.interface_cfg = rtw_sdio_interface_cfg,
|
||||
+ .dynamic_rx_agg = NULL,
|
||||
|
||||
.read8 = rtw_sdio_read8,
|
||||
.read16 = rtw_sdio_read16,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -766,6 +766,45 @@ static void rtw_usb_interface_cfg(struct
|
||||
rtw_usb_init_burst_pkt_len(rtwdev);
|
||||
}
|
||||
|
||||
+static void rtw_usb_dynamic_rx_agg_v1(struct rtw_dev *rtwdev, bool enable)
|
||||
+{
|
||||
+ u8 size, timeout;
|
||||
+ u16 val16;
|
||||
+
|
||||
+ rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
|
||||
+ rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
|
||||
+ rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
|
||||
+
|
||||
+ if (enable) {
|
||||
+ size = 0x5;
|
||||
+ timeout = 0x20;
|
||||
+ } else {
|
||||
+ size = 0x0;
|
||||
+ timeout = 0x1;
|
||||
+ }
|
||||
+ val16 = u16_encode_bits(size, BIT_RXDMA_AGG_PG_TH) |
|
||||
+ u16_encode_bits(timeout, BIT_DMA_AGG_TO_V1);
|
||||
+
|
||||
+ rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16);
|
||||
+}
|
||||
+
|
||||
+static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable)
|
||||
+{
|
||||
+ switch (rtwdev->chip->id) {
|
||||
+ case RTW_CHIP_TYPE_8822C:
|
||||
+ case RTW_CHIP_TYPE_8822B:
|
||||
+ case RTW_CHIP_TYPE_8821C:
|
||||
+ rtw_usb_dynamic_rx_agg_v1(rtwdev, enable);
|
||||
+ break;
|
||||
+ case RTW_CHIP_TYPE_8723D:
|
||||
+ /* Doesn't like aggregation. */
|
||||
+ break;
|
||||
+ case RTW_CHIP_TYPE_8703B:
|
||||
+ /* Likely not found in USB devices. */
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static struct rtw_hci_ops rtw_usb_ops = {
|
||||
.tx_write = rtw_usb_tx_write,
|
||||
.tx_kick_off = rtw_usb_tx_kick_off,
|
||||
@@ -775,6 +814,7 @@ static struct rtw_hci_ops rtw_usb_ops =
|
||||
.deep_ps = rtw_usb_deep_ps,
|
||||
.link_ps = rtw_usb_link_ps,
|
||||
.interface_cfg = rtw_usb_interface_cfg,
|
||||
+ .dynamic_rx_agg = rtw_usb_dynamic_rx_agg,
|
||||
|
||||
.write8 = rtw_usb_write8,
|
||||
.write16 = rtw_usb_write16,
|
@ -0,0 +1,231 @@
|
||||
From 902cb7b11f9a7ff07233cc4c626b54c3e4703149 Mon Sep 17 00:00:00 2001
|
||||
From: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Date: Mon, 19 Aug 2024 10:52:48 +0800
|
||||
Subject: [PATCH] wifi: rtw88: assign mac_id for vif/sta and update to TX desc
|
||||
|
||||
A mac_id as an instance in firmware has to be assigned for each station
|
||||
including AP and connected stations. Firmware will use the mac_id to
|
||||
control TX rate and do statistics.
|
||||
|
||||
Assignment rule is to assign mac_id to each vif when adding vif.
|
||||
For station mode, sta->mac_id will reuse vif->mac_id. For AP mode,
|
||||
dynamically allocate an sta->mac_id to a station, and vif->mac_id is
|
||||
used to send broadcast/multicast packets which are not belong to
|
||||
a station. For example,
|
||||
|
||||
vif->mac_id sta->mac_id
|
||||
vif0 (STA mode) 0 0
|
||||
vif1 (AP mode) 1 2...
|
||||
|
||||
By the way, remove unused RTW_BC_MC_MACID, which was planed to send
|
||||
broadcast/multicast packets on fixed mac_id.
|
||||
|
||||
Tested-on RTL8822CE with STA + AP SCC mode.
|
||||
|
||||
Link: https://lore.kernel.org/linux-wireless/e4be0a75-43b2-4ae5-9aab-5c4a88e78097@gmail.com/
|
||||
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/20240819025248.17939-1-pkshih@realtek.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/mac80211.c | 13 ++++++--
|
||||
drivers/net/wireless/realtek/rtw88/main.c | 30 ++++++++-----------
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 14 +++++++--
|
||||
drivers/net/wireless/realtek/rtw88/tx.c | 11 +++++--
|
||||
drivers/net/wireless/realtek/rtw88/tx.h | 1 +
|
||||
5 files changed, 44 insertions(+), 25 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
|
||||
@@ -167,6 +167,12 @@ static int rtw_ops_add_interface(struct
|
||||
|
||||
mutex_lock(&rtwdev->mutex);
|
||||
|
||||
+ rtwvif->mac_id = rtw_acquire_macid(rtwdev);
|
||||
+ if (rtwvif->mac_id >= RTW_MAX_MAC_ID_NUM) {
|
||||
+ mutex_unlock(&rtwdev->mutex);
|
||||
+ return -ENOSPC;
|
||||
+ }
|
||||
+
|
||||
port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM);
|
||||
if (port >= RTW_PORT_NUM) {
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
@@ -214,7 +220,8 @@ static int rtw_ops_add_interface(struct
|
||||
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
|
||||
- rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM on port %d\n", vif->addr, rtwvif->port);
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM mac_id %d on port %d\n",
|
||||
+ vif->addr, rtwvif->mac_id, rtwvif->port);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -225,7 +232,8 @@ static void rtw_ops_remove_interface(str
|
||||
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
|
||||
u32 config = 0;
|
||||
|
||||
- rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM on port %d\n", vif->addr, rtwvif->port);
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM mac_id %d on port %d\n",
|
||||
+ vif->addr, rtwvif->mac_id, rtwvif->port);
|
||||
|
||||
mutex_lock(&rtwdev->mutex);
|
||||
|
||||
@@ -242,6 +250,7 @@ static void rtw_ops_remove_interface(str
|
||||
config |= PORT_SET_BCN_CTRL;
|
||||
rtw_vif_port_config(rtwdev, rtwvif, config);
|
||||
clear_bit(rtwvif->port, rtwdev->hw_port);
|
||||
+ rtw_release_macid(rtwdev, rtwvif->mac_id);
|
||||
rtw_recalc_lps(rtwdev, NULL);
|
||||
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -311,17 +311,6 @@ static void rtw_ips_work(struct work_str
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
}
|
||||
|
||||
-static u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
|
||||
-{
|
||||
- unsigned long mac_id;
|
||||
-
|
||||
- mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
|
||||
- if (mac_id < RTW_MAX_MAC_ID_NUM)
|
||||
- set_bit(mac_id, rtwdev->mac_id_map);
|
||||
-
|
||||
- return mac_id;
|
||||
-}
|
||||
-
|
||||
static void rtw_sta_rc_work(struct work_struct *work)
|
||||
{
|
||||
struct rtw_sta_info *si = container_of(work, struct rtw_sta_info,
|
||||
@@ -340,12 +329,14 @@ int rtw_sta_add(struct rtw_dev *rtwdev,
|
||||
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
|
||||
int i;
|
||||
|
||||
- si->mac_id = rtw_acquire_macid(rtwdev);
|
||||
- if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
|
||||
- return -ENOSPC;
|
||||
+ if (vif->type == NL80211_IFTYPE_STATION) {
|
||||
+ si->mac_id = rtwvif->mac_id;
|
||||
+ } else {
|
||||
+ si->mac_id = rtw_acquire_macid(rtwdev);
|
||||
+ if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
|
||||
+ return -ENOSPC;
|
||||
+ }
|
||||
|
||||
- if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0)
|
||||
- rtwvif->mac_id = si->mac_id;
|
||||
si->rtwdev = rtwdev;
|
||||
si->sta = sta;
|
||||
si->vif = vif;
|
||||
@@ -370,11 +361,13 @@ void rtw_sta_remove(struct rtw_dev *rtwd
|
||||
bool fw_exist)
|
||||
{
|
||||
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
|
||||
+ struct ieee80211_vif *vif = si->vif;
|
||||
int i;
|
||||
|
||||
cancel_work_sync(&si->rc_work);
|
||||
|
||||
- rtw_release_macid(rtwdev, si->mac_id);
|
||||
+ if (vif->type != NL80211_IFTYPE_STATION)
|
||||
+ rtw_release_macid(rtwdev, si->mac_id);
|
||||
if (fw_exist)
|
||||
rtw_fw_media_status_report(rtwdev, si->mac_id, false);
|
||||
|
||||
@@ -614,6 +607,8 @@ static void rtw_reset_vif_iter(void *dat
|
||||
rtw_bf_disassoc(rtwdev, vif, NULL);
|
||||
rtw_vif_assoc_changed(rtwvif, NULL);
|
||||
rtw_txq_cleanup(rtwdev, vif->txq);
|
||||
+
|
||||
+ rtw_release_macid(rtwdev, rtwvif->mac_id);
|
||||
}
|
||||
|
||||
void rtw_fw_recovery(struct rtw_dev *rtwdev)
|
||||
@@ -2139,7 +2134,6 @@ int rtw_core_init(struct rtw_dev *rtwdev
|
||||
rtwdev->sec.total_cam_num = 32;
|
||||
rtwdev->hal.current_channel = 1;
|
||||
rtwdev->dm_info.fix_rate = U8_MAX;
|
||||
- set_bit(RTW_BC_MC_MACID, rtwdev->mac_id_map);
|
||||
|
||||
rtw_stats_init(rtwdev);
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -742,7 +742,6 @@ struct rtw_txq {
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
-#define RTW_BC_MC_MACID 1
|
||||
DECLARE_EWMA(rssi, 10, 16);
|
||||
|
||||
struct rtw_sta_info {
|
||||
@@ -805,7 +804,7 @@ struct rtw_bf_info {
|
||||
struct rtw_vif {
|
||||
enum rtw_net_type net_type;
|
||||
u16 aid;
|
||||
- u8 mac_id; /* for STA mode only */
|
||||
+ u8 mac_id;
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
u8 bssid[ETH_ALEN];
|
||||
u8 port;
|
||||
@@ -2131,6 +2130,17 @@ static inline bool rtw_chip_has_tx_stbc(
|
||||
return rtwdev->chip->tx_stbc;
|
||||
}
|
||||
|
||||
+static inline u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
|
||||
+{
|
||||
+ unsigned long mac_id;
|
||||
+
|
||||
+ mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
|
||||
+ if (mac_id < RTW_MAX_MAC_ID_NUM)
|
||||
+ set_bit(mac_id, rtwdev->mac_id_map);
|
||||
+
|
||||
+ return mac_id;
|
||||
+}
|
||||
+
|
||||
static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id)
|
||||
{
|
||||
clear_bit(mac_id, rtwdev->mac_id_map);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/tx.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
|
||||
@@ -46,7 +46,8 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p
|
||||
le32_encode_bits(pkt_info->ls, RTW_TX_DESC_W0_LS) |
|
||||
le32_encode_bits(pkt_info->dis_qselseq, RTW_TX_DESC_W0_DISQSELSEQ);
|
||||
|
||||
- tx_desc->w1 = le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) |
|
||||
+ tx_desc->w1 = le32_encode_bits(pkt_info->mac_id, RTW_TX_DESC_W1_MACID) |
|
||||
+ le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) |
|
||||
le32_encode_bits(pkt_info->rate_id, RTW_TX_DESC_W1_RATE_ID) |
|
||||
le32_encode_bits(pkt_info->sec_type, RTW_TX_DESC_W1_SEC_TYPE) |
|
||||
le32_encode_bits(pkt_info->pkt_offset, RTW_TX_DESC_W1_PKT_OFFSET) |
|
||||
@@ -401,14 +402,18 @@ void rtw_tx_pkt_info_update(struct rtw_d
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||
+ struct ieee80211_vif *vif = info->control.vif;
|
||||
struct rtw_sta_info *si;
|
||||
- struct ieee80211_vif *vif = NULL;
|
||||
+ struct rtw_vif *rtwvif;
|
||||
__le16 fc = hdr->frame_control;
|
||||
bool bmc;
|
||||
|
||||
if (sta) {
|
||||
si = (struct rtw_sta_info *)sta->drv_priv;
|
||||
- vif = si->vif;
|
||||
+ pkt_info->mac_id = si->mac_id;
|
||||
+ } else if (vif) {
|
||||
+ rtwvif = (struct rtw_vif *)vif->drv_priv;
|
||||
+ pkt_info->mac_id = rtwvif->mac_id;
|
||||
}
|
||||
|
||||
if (ieee80211_is_mgmt(fc) || ieee80211_is_nullfunc(fc))
|
||||
--- a/drivers/net/wireless/realtek/rtw88/tx.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/tx.h
|
||||
@@ -27,6 +27,7 @@ struct rtw_tx_desc {
|
||||
#define RTW_TX_DESC_W0_BMC BIT(24)
|
||||
#define RTW_TX_DESC_W0_LS BIT(26)
|
||||
#define RTW_TX_DESC_W0_DISQSELSEQ BIT(31)
|
||||
+#define RTW_TX_DESC_W1_MACID GENMASK(7, 0)
|
||||
#define RTW_TX_DESC_W1_QSEL GENMASK(12, 8)
|
||||
#define RTW_TX_DESC_W1_RATE_ID GENMASK(20, 16)
|
||||
#define RTW_TX_DESC_W1_SEC_TYPE GENMASK(23, 22)
|
@ -0,0 +1,374 @@
|
||||
From 140403599b74839b0a57c5397b7e8579e5332364 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 18 Sep 2024 01:53:55 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Constify some arrays and structs
|
||||
|
||||
These are never modified, so make them const:
|
||||
|
||||
card_enable_flow_8703b
|
||||
card_disable_flow_8703b
|
||||
rtw8703b_ops
|
||||
|
||||
rtw8723d_ops
|
||||
card_enable_flow_8723d
|
||||
card_disable_flow_8723d
|
||||
|
||||
trans_carddis_to_cardemu_8821c
|
||||
trans_cardemu_to_act_8821c
|
||||
trans_act_to_cardemu_8821c
|
||||
trans_cardemu_to_carddis_8821c
|
||||
card_enable_flow_8821c
|
||||
card_disable_flow_8821c
|
||||
rtw8821c_dig
|
||||
page_table_8821c
|
||||
rqpn_table_8821c
|
||||
prioq_addrs_8821c
|
||||
rtw8821c_ops
|
||||
|
||||
card_enable_flow_8822b
|
||||
card_disable_flow_8822b
|
||||
prioq_addrs_8822b
|
||||
rtw8822b_ops
|
||||
rtw8822b_edcca_th
|
||||
|
||||
card_enable_flow_8822c
|
||||
card_disable_flow_8822c
|
||||
prioq_addrs_8822c
|
||||
rtw8822c_ops
|
||||
rtw8822c_edcca_th
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/dae7994f-3491-40de-b537-ebf68df084bb@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/mac.c | 4 ++--
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 8 +++----
|
||||
drivers/net/wireless/realtek/rtw88/phy.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 6 ++---
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 6 ++---
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 22 +++++++++----------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 10 ++++-----
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 10 ++++-----
|
||||
9 files changed, 35 insertions(+), 35 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
@@ -267,7 +267,7 @@ static void rtw_fw_scan_result(struct rt
|
||||
static void rtw_fw_adaptivity_result(struct rtw_dev *rtwdev, u8 *payload,
|
||||
u8 length)
|
||||
{
|
||||
- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
|
||||
+ const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
|
||||
struct rtw_c2h_adaptivity *result = (struct rtw_c2h_adaptivity *)payload;
|
||||
|
||||
rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/mac.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
|
||||
@@ -228,7 +228,7 @@ static int rtw_sub_pwr_seq_parser(struct
|
||||
}
|
||||
|
||||
static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
|
||||
- const struct rtw_pwr_seq_cmd **cmd_seq)
|
||||
+ const struct rtw_pwr_seq_cmd * const *cmd_seq)
|
||||
{
|
||||
u8 cut_mask;
|
||||
u8 intf_mask;
|
||||
@@ -271,7 +271,7 @@ static int rtw_pwr_seq_parser(struct rtw
|
||||
static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
|
||||
{
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
- const struct rtw_pwr_seq_cmd **pwr_seq;
|
||||
+ const struct rtw_pwr_seq_cmd * const *pwr_seq;
|
||||
u32 imr = 0;
|
||||
u8 rpwm;
|
||||
bool cur_pwr;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1167,7 +1167,7 @@ enum rtw_fwcd_item {
|
||||
|
||||
/* hardware configuration for each IC */
|
||||
struct rtw_chip_info {
|
||||
- struct rtw_chip_ops *ops;
|
||||
+ const struct rtw_chip_ops *ops;
|
||||
u8 id;
|
||||
|
||||
const char *fw_name;
|
||||
@@ -1209,8 +1209,8 @@ struct rtw_chip_info {
|
||||
|
||||
/* init values */
|
||||
u8 sys_func_en;
|
||||
- const struct rtw_pwr_seq_cmd **pwr_on_seq;
|
||||
- const struct rtw_pwr_seq_cmd **pwr_off_seq;
|
||||
+ const struct rtw_pwr_seq_cmd * const *pwr_on_seq;
|
||||
+ const struct rtw_pwr_seq_cmd * const *pwr_off_seq;
|
||||
const struct rtw_rqpn *rqpn_table;
|
||||
const struct rtw_prioq_addrs *prioq_addrs;
|
||||
const struct rtw_page_table *page_table;
|
||||
@@ -1242,7 +1242,7 @@ struct rtw_chip_info {
|
||||
u8 bfer_su_max_num;
|
||||
u8 bfer_mu_max_num;
|
||||
|
||||
- struct rtw_hw_reg_offset *edcca_th;
|
||||
+ const struct rtw_hw_reg_offset *edcca_th;
|
||||
s8 l2h_th_ini_cs;
|
||||
s8 l2h_th_ini_ad;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
@@ -123,7 +123,7 @@ static void rtw_phy_cck_pd_init(struct r
|
||||
|
||||
void rtw_phy_set_edcca_th(struct rtw_dev *rtwdev, u8 l2h, u8 h2l)
|
||||
{
|
||||
- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
|
||||
+ const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
|
||||
|
||||
rtw_write32_mask(rtwdev,
|
||||
edcca_th[EDCCA_TH_L2H_IDX].hw_reg.addr,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -481,14 +481,14 @@ static const struct rtw_pwr_seq_cmd tran
|
||||
{TRANS_SEQ_END},
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8703b[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8703b[] = {
|
||||
trans_pre_enable_8703b,
|
||||
trans_carddis_to_cardemu_8703b,
|
||||
trans_cardemu_to_act_8703b,
|
||||
NULL
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8703b[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8703b[] = {
|
||||
trans_act_to_lps_8703b,
|
||||
trans_act_to_reset_mcu_8703b,
|
||||
trans_act_to_cardemu_8703b,
|
||||
@@ -1941,7 +1941,7 @@ static const struct coex_tdma_para tdma_
|
||||
{ {0x61, 0x08, 0x03, 0x11, 0x11} },
|
||||
};
|
||||
|
||||
-static struct rtw_chip_ops rtw8703b_ops = {
|
||||
+static const struct rtw_chip_ops rtw8703b_ops = {
|
||||
.mac_init = rtw8723x_mac_init,
|
||||
.dump_fw_crash = NULL,
|
||||
.shutdown = NULL,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -1430,7 +1430,7 @@ static void rtw8723d_pwr_track(struct rt
|
||||
dm_info->pwr_trk_triggered = false;
|
||||
}
|
||||
|
||||
-static struct rtw_chip_ops rtw8723d_ops = {
|
||||
+static const struct rtw_chip_ops rtw8723d_ops = {
|
||||
.phy_set_param = rtw8723d_phy_set_param,
|
||||
.read_efuse = rtw8723x_read_efuse,
|
||||
.query_rx_desc = rtw8723d_query_rx_desc,
|
||||
@@ -1788,7 +1788,7 @@ static const struct rtw_pwr_seq_cmd tran
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8723d[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8723d[] = {
|
||||
trans_carddis_to_cardemu_8723d,
|
||||
trans_cardemu_to_act_8723d,
|
||||
NULL
|
||||
@@ -2004,7 +2004,7 @@ static const struct rtw_pwr_seq_cmd tran
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8723d[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8723d[] = {
|
||||
trans_act_to_lps_8723d,
|
||||
trans_act_to_pre_carddis_8723d,
|
||||
trans_act_to_cardemu_8723d,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -1254,7 +1254,7 @@ static void rtw8821c_fill_txdesc_checksu
|
||||
fill_txdesc_checksum_common(txdesc, 16);
|
||||
}
|
||||
|
||||
-static struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = {
|
||||
{0x0086,
|
||||
RTW_PWR_CUT_ALL_MSK,
|
||||
RTW_PWR_INTF_SDIO_MSK,
|
||||
@@ -1292,7 +1292,7 @@ static struct rtw_pwr_seq_cmd trans_card
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821c[] = {
|
||||
{0x0020,
|
||||
RTW_PWR_CUT_ALL_MSK,
|
||||
RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK,
|
||||
@@ -1396,7 +1396,7 @@ static struct rtw_pwr_seq_cmd trans_card
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821c[] = {
|
||||
{0x0093,
|
||||
RTW_PWR_CUT_ALL_MSK,
|
||||
RTW_PWR_INTF_ALL_MSK,
|
||||
@@ -1454,7 +1454,7 @@ static struct rtw_pwr_seq_cmd trans_act_
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821c[] = {
|
||||
{0x0007,
|
||||
RTW_PWR_CUT_ALL_MSK,
|
||||
RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK,
|
||||
@@ -1567,13 +1567,13 @@ static struct rtw_pwr_seq_cmd trans_card
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8821c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8821c[] = {
|
||||
trans_carddis_to_cardemu_8821c,
|
||||
trans_cardemu_to_act_8821c,
|
||||
NULL
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8821c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8821c[] = {
|
||||
trans_act_to_cardemu_8821c,
|
||||
trans_cardemu_to_carddis_8821c,
|
||||
NULL
|
||||
@@ -1629,7 +1629,7 @@ static const struct rtw_rfe_def rtw8821c
|
||||
[6] = RTW_DEF_RFE(8821c, 0, 0),
|
||||
};
|
||||
|
||||
-static struct rtw_hw_reg rtw8821c_dig[] = {
|
||||
+static const struct rtw_hw_reg rtw8821c_dig[] = {
|
||||
[0] = { .addr = 0xc50, .mask = 0x7f },
|
||||
};
|
||||
|
||||
@@ -1639,7 +1639,7 @@ static const struct rtw_ltecoex_addr rtw
|
||||
.rdata = LTECOEX_READ_DATA,
|
||||
};
|
||||
|
||||
-static struct rtw_page_table page_table_8821c[] = {
|
||||
+static const struct rtw_page_table page_table_8821c[] = {
|
||||
/* not sure what [0] stands for */
|
||||
{16, 16, 16, 14, 1},
|
||||
{16, 16, 16, 14, 1},
|
||||
@@ -1648,7 +1648,7 @@ static struct rtw_page_table page_table_
|
||||
{16, 16, 16, 14, 1},
|
||||
};
|
||||
|
||||
-static struct rtw_rqpn rqpn_table_8821c[] = {
|
||||
+static const struct rtw_rqpn rqpn_table_8821c[] = {
|
||||
/* not sure what [0] stands for */
|
||||
{RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL,
|
||||
RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW,
|
||||
@@ -1667,7 +1667,7 @@ static struct rtw_rqpn rqpn_table_8821c[
|
||||
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
|
||||
};
|
||||
|
||||
-static struct rtw_prioq_addrs prioq_addrs_8821c = {
|
||||
+static const struct rtw_prioq_addrs prioq_addrs_8821c = {
|
||||
.prio[RTW_DMA_MAPPING_EXTRA] = {
|
||||
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
|
||||
},
|
||||
@@ -1683,7 +1683,7 @@ static struct rtw_prioq_addrs prioq_addr
|
||||
.wsize = true,
|
||||
};
|
||||
|
||||
-static struct rtw_chip_ops rtw8821c_ops = {
|
||||
+static const struct rtw_chip_ops rtw8821c_ops = {
|
||||
.phy_set_param = rtw8821c_phy_set_param,
|
||||
.read_efuse = rtw8821c_read_efuse,
|
||||
.query_rx_desc = rtw8821c_query_rx_desc,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -1978,13 +1978,13 @@ static const struct rtw_pwr_seq_cmd tran
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8822b[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8822b[] = {
|
||||
trans_carddis_to_cardemu_8822b,
|
||||
trans_cardemu_to_act_8822b,
|
||||
NULL
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8822b[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8822b[] = {
|
||||
trans_act_to_cardemu_8822b,
|
||||
trans_cardemu_to_carddis_8822b,
|
||||
NULL
|
||||
@@ -2156,7 +2156,7 @@ static const struct rtw_rqpn rqpn_table_
|
||||
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
|
||||
};
|
||||
|
||||
-static struct rtw_prioq_addrs prioq_addrs_8822b = {
|
||||
+static const struct rtw_prioq_addrs prioq_addrs_8822b = {
|
||||
.prio[RTW_DMA_MAPPING_EXTRA] = {
|
||||
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
|
||||
},
|
||||
@@ -2172,7 +2172,7 @@ static struct rtw_prioq_addrs prioq_addr
|
||||
.wsize = true,
|
||||
};
|
||||
|
||||
-static struct rtw_chip_ops rtw8822b_ops = {
|
||||
+static const struct rtw_chip_ops rtw8822b_ops = {
|
||||
.phy_set_param = rtw8822b_phy_set_param,
|
||||
.read_efuse = rtw8822b_read_efuse,
|
||||
.query_rx_desc = rtw8822b_query_rx_desc,
|
||||
@@ -2521,7 +2521,7 @@ static const struct rtw_reg_domain coex_
|
||||
{0xc50, MASKBYTE0, RTW_REG_DOMAIN_MAC8},
|
||||
};
|
||||
|
||||
-static struct rtw_hw_reg_offset rtw8822b_edcca_th[] = {
|
||||
+static const struct rtw_hw_reg_offset rtw8822b_edcca_th[] = {
|
||||
[EDCCA_TH_L2H_IDX] = {{.addr = 0x8a4, .mask = MASKBYTE0}, .offset = 0},
|
||||
[EDCCA_TH_H2L_IDX] = {{.addr = 0x8a4, .mask = MASKBYTE1}, .offset = 0},
|
||||
};
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -4874,13 +4874,13 @@ static const struct rtw_pwr_seq_cmd tran
|
||||
RTW_PWR_CMD_END, 0, 0},
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8822c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8822c[] = {
|
||||
trans_carddis_to_cardemu_8822c,
|
||||
trans_cardemu_to_act_8822c,
|
||||
NULL
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8822c[] = {
|
||||
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8822c[] = {
|
||||
trans_act_to_cardemu_8822c,
|
||||
trans_cardemu_to_carddis_8822c,
|
||||
NULL
|
||||
@@ -4972,7 +4972,7 @@ static const struct rtw_rqpn rqpn_table_
|
||||
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
|
||||
};
|
||||
|
||||
-static struct rtw_prioq_addrs prioq_addrs_8822c = {
|
||||
+static const struct rtw_prioq_addrs prioq_addrs_8822c = {
|
||||
.prio[RTW_DMA_MAPPING_EXTRA] = {
|
||||
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
|
||||
},
|
||||
@@ -4988,7 +4988,7 @@ static struct rtw_prioq_addrs prioq_addr
|
||||
.wsize = true,
|
||||
};
|
||||
|
||||
-static struct rtw_chip_ops rtw8822c_ops = {
|
||||
+static const struct rtw_chip_ops rtw8822c_ops = {
|
||||
.phy_set_param = rtw8822c_phy_set_param,
|
||||
.read_efuse = rtw8822c_read_efuse,
|
||||
.query_rx_desc = rtw8822c_query_rx_desc,
|
||||
@@ -5301,7 +5301,7 @@ static const struct rtw_pwr_track_tbl rt
|
||||
.pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p,
|
||||
};
|
||||
|
||||
-static struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
|
||||
+static const struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
|
||||
[EDCCA_TH_L2H_IDX] = {
|
||||
{.addr = 0x84c, .mask = MASKBYTE2}, .offset = 0x80
|
||||
},
|
@ -0,0 +1,560 @@
|
||||
From bbb6f9be7f99464d5ab7e2f321fa728d33eeec9a Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Fri, 20 Sep 2024 22:27:30 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Parse the RX descriptor with a single function
|
||||
|
||||
rtw8703b_query_rx_desc(), rtw8723d_query_rx_desc(),
|
||||
rtw8821c_query_rx_desc(), rtw8822b_query_rx_desc(), and
|
||||
rtw8822c_query_rx_desc() are almost identical, so replace them all with
|
||||
a single function, rtw_rx_query_rx_desc().
|
||||
|
||||
Also, access the RX descriptor using a struct with __le32 members and
|
||||
le32_get_bits().
|
||||
|
||||
Tested with RTL8811CU, RTL8811AU, and RTL8812AU.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Tested-by: Ping-Ke Shih <pkshih@realtek.com> # RTL8723DE and RTL8822CE
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 5 +-
|
||||
drivers/net/wireless/realtek/rtw88/pci.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 56 +--------------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 43 +-----------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 43 +-----------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 43 +-----------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 44 +-----------
|
||||
drivers/net/wireless/realtek/rtw88/rx.c | 70 +++++++++++++++++--
|
||||
drivers/net/wireless/realtek/rtw88/rx.h | 64 ++++++++---------
|
||||
drivers/net/wireless/realtek/rtw88/sdio.c | 3 +-
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 4 +-
|
||||
11 files changed, 106 insertions(+), 271 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -848,9 +848,8 @@ struct rtw_chip_ops {
|
||||
void (*phy_set_param)(struct rtw_dev *rtwdev);
|
||||
void (*set_channel)(struct rtw_dev *rtwdev, u8 channel,
|
||||
u8 bandwidth, u8 primary_chan_idx);
|
||||
- void (*query_rx_desc)(struct rtw_dev *rtwdev, u8 *rx_desc,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_rx_status *rx_status);
|
||||
+ void (*query_phy_status)(struct rtw_dev *rtwdev, u8 *phy_status,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat);
|
||||
u32 (*read_rf)(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
|
||||
u32 addr, u32 mask);
|
||||
bool (*write_rf)(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
@@ -1065,7 +1065,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de
|
||||
dma_sync_single_for_cpu(rtwdev->dev, dma, RTK_PCI_RX_BUF_SIZE,
|
||||
DMA_FROM_DEVICE);
|
||||
rx_desc = skb->data;
|
||||
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status);
|
||||
+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status);
|
||||
|
||||
/* offset from rx_desc to payload */
|
||||
pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -29,9 +29,6 @@
|
||||
#define TBTT_PROHIBIT_HOLD_TIME 0x80
|
||||
#define TBTT_PROHIBIT_HOLD_TIME_STOP_BCN 0x64
|
||||
|
||||
-/* raw pkt_stat->drv_info_sz is in unit of 8-bytes */
|
||||
-#define RX_DRV_INFO_SZ_UNIT_8703B 8
|
||||
-
|
||||
#define TRANS_SEQ_END \
|
||||
0xFFFF, \
|
||||
RTW_PWR_CUT_ALL_MSK, \
|
||||
@@ -1032,57 +1029,6 @@ static void query_phy_status(struct rtw_
|
||||
query_phy_status_ofdm(rtwdev, phy_status, pkt_stat);
|
||||
}
|
||||
|
||||
-static void rtw8703b_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_rx_status *rx_status)
|
||||
-{
|
||||
- struct ieee80211_hdr *hdr;
|
||||
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
|
||||
- u8 *phy_status = NULL;
|
||||
-
|
||||
- memset(pkt_stat, 0, sizeof(*pkt_stat));
|
||||
-
|
||||
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
|
||||
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
|
||||
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
|
||||
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
|
||||
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
|
||||
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
|
||||
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
|
||||
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
|
||||
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
|
||||
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
|
||||
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
|
||||
- pkt_stat->ppdu_cnt = 0;
|
||||
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
|
||||
-
|
||||
- pkt_stat->drv_info_sz *= RX_DRV_INFO_SZ_UNIT_8703B;
|
||||
-
|
||||
- if (pkt_stat->is_c2h)
|
||||
- return;
|
||||
-
|
||||
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
|
||||
- pkt_stat->drv_info_sz);
|
||||
-
|
||||
- pkt_stat->bw = GET_RX_DESC_BW(rx_desc);
|
||||
-
|
||||
- if (pkt_stat->phy_status) {
|
||||
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
|
||||
- query_phy_status(rtwdev, phy_status, pkt_stat);
|
||||
- }
|
||||
-
|
||||
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
|
||||
-
|
||||
- /* Rtl8723cs driver checks for size < 14 or size > 8192 and
|
||||
- * simply drops the packet. Maybe this should go into
|
||||
- * rtw_rx_fill_rx_status()?
|
||||
- */
|
||||
- if (pkt_stat->pkt_len == 0) {
|
||||
- rx_status->flag |= RX_FLAG_NO_PSDU;
|
||||
- rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet");
|
||||
- }
|
||||
-}
|
||||
-
|
||||
#define ADDA_ON_VAL_8703B 0x03c00014
|
||||
|
||||
static
|
||||
@@ -1948,7 +1894,7 @@ static const struct rtw_chip_ops rtw8703
|
||||
.read_efuse = rtw8703b_read_efuse,
|
||||
.phy_set_param = rtw8703b_phy_set_param,
|
||||
.set_channel = rtw8703b_set_channel,
|
||||
- .query_rx_desc = rtw8703b_query_rx_desc,
|
||||
+ .query_phy_status = query_phy_status,
|
||||
.read_rf = rtw_phy_read_rf_sipi,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
.set_tx_power_index = rtw8723x_set_tx_power_index,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -227,47 +227,6 @@ static void query_phy_status(struct rtw_
|
||||
}
|
||||
}
|
||||
|
||||
-static void rtw8723d_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_rx_status *rx_status)
|
||||
-{
|
||||
- struct ieee80211_hdr *hdr;
|
||||
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
|
||||
- u8 *phy_status = NULL;
|
||||
-
|
||||
- memset(pkt_stat, 0, sizeof(*pkt_stat));
|
||||
-
|
||||
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
|
||||
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
|
||||
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
|
||||
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
|
||||
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
|
||||
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
|
||||
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
|
||||
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
|
||||
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
|
||||
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
|
||||
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
|
||||
- pkt_stat->ppdu_cnt = 0;
|
||||
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
|
||||
-
|
||||
- /* drv_info_sz is in unit of 8-bytes */
|
||||
- pkt_stat->drv_info_sz *= 8;
|
||||
-
|
||||
- /* c2h cmd pkt's rx/phy status is not interested */
|
||||
- if (pkt_stat->is_c2h)
|
||||
- return;
|
||||
-
|
||||
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
|
||||
- pkt_stat->drv_info_sz);
|
||||
- if (pkt_stat->phy_status) {
|
||||
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
|
||||
- query_phy_status(rtwdev, phy_status, pkt_stat);
|
||||
- }
|
||||
-
|
||||
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
|
||||
-}
|
||||
-
|
||||
static bool rtw8723d_check_spur_ov_thres(struct rtw_dev *rtwdev,
|
||||
u8 channel, u32 thres)
|
||||
{
|
||||
@@ -1433,7 +1392,7 @@ static void rtw8723d_pwr_track(struct rt
|
||||
static const struct rtw_chip_ops rtw8723d_ops = {
|
||||
.phy_set_param = rtw8723d_phy_set_param,
|
||||
.read_efuse = rtw8723x_read_efuse,
|
||||
- .query_rx_desc = rtw8723d_query_rx_desc,
|
||||
+ .query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8723d_set_channel,
|
||||
.mac_init = rtw8723x_mac_init,
|
||||
.shutdown = rtw8723d_shutdown,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -679,47 +679,6 @@ static void query_phy_status(struct rtw_
|
||||
}
|
||||
}
|
||||
|
||||
-static void rtw8821c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_rx_status *rx_status)
|
||||
-{
|
||||
- struct ieee80211_hdr *hdr;
|
||||
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
|
||||
- u8 *phy_status = NULL;
|
||||
-
|
||||
- memset(pkt_stat, 0, sizeof(*pkt_stat));
|
||||
-
|
||||
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
|
||||
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
|
||||
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
|
||||
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
|
||||
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
|
||||
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
|
||||
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
|
||||
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
|
||||
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
|
||||
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
|
||||
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
|
||||
- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc);
|
||||
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
|
||||
-
|
||||
- /* drv_info_sz is in unit of 8-bytes */
|
||||
- pkt_stat->drv_info_sz *= 8;
|
||||
-
|
||||
- /* c2h cmd pkt's rx/phy status is not interested */
|
||||
- if (pkt_stat->is_c2h)
|
||||
- return;
|
||||
-
|
||||
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
|
||||
- pkt_stat->drv_info_sz);
|
||||
- if (pkt_stat->phy_status) {
|
||||
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
|
||||
- query_phy_status(rtwdev, phy_status, pkt_stat);
|
||||
- }
|
||||
-
|
||||
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
|
||||
-}
|
||||
-
|
||||
static void
|
||||
rtw8821c_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs)
|
||||
{
|
||||
@@ -1686,7 +1645,7 @@ static const struct rtw_prioq_addrs prio
|
||||
static const struct rtw_chip_ops rtw8821c_ops = {
|
||||
.phy_set_param = rtw8821c_phy_set_param,
|
||||
.read_efuse = rtw8821c_read_efuse,
|
||||
- .query_rx_desc = rtw8821c_query_rx_desc,
|
||||
+ .query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8821c_set_channel,
|
||||
.mac_init = rtw8821c_mac_init,
|
||||
.read_rf = rtw_phy_read_rf,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -934,47 +934,6 @@ static void query_phy_status(struct rtw_
|
||||
}
|
||||
}
|
||||
|
||||
-static void rtw8822b_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_rx_status *rx_status)
|
||||
-{
|
||||
- struct ieee80211_hdr *hdr;
|
||||
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
|
||||
- u8 *phy_status = NULL;
|
||||
-
|
||||
- memset(pkt_stat, 0, sizeof(*pkt_stat));
|
||||
-
|
||||
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
|
||||
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
|
||||
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
|
||||
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
|
||||
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
|
||||
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
|
||||
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
|
||||
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
|
||||
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
|
||||
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
|
||||
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
|
||||
- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc);
|
||||
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
|
||||
-
|
||||
- /* drv_info_sz is in unit of 8-bytes */
|
||||
- pkt_stat->drv_info_sz *= 8;
|
||||
-
|
||||
- /* c2h cmd pkt's rx/phy status is not interested */
|
||||
- if (pkt_stat->is_c2h)
|
||||
- return;
|
||||
-
|
||||
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
|
||||
- pkt_stat->drv_info_sz);
|
||||
- if (pkt_stat->phy_status) {
|
||||
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
|
||||
- query_phy_status(rtwdev, phy_status, pkt_stat);
|
||||
- }
|
||||
-
|
||||
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
|
||||
-}
|
||||
-
|
||||
static void
|
||||
rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs)
|
||||
{
|
||||
@@ -2175,7 +2134,7 @@ static const struct rtw_prioq_addrs prio
|
||||
static const struct rtw_chip_ops rtw8822b_ops = {
|
||||
.phy_set_param = rtw8822b_phy_set_param,
|
||||
.read_efuse = rtw8822b_read_efuse,
|
||||
- .query_rx_desc = rtw8822b_query_rx_desc,
|
||||
+ .query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8822b_set_channel,
|
||||
.mac_init = rtw8822b_mac_init,
|
||||
.read_rf = rtw_phy_read_rf,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -2690,48 +2690,6 @@ static void query_phy_status(struct rtw_
|
||||
}
|
||||
}
|
||||
|
||||
-static void rtw8822c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_rx_status *rx_status)
|
||||
-{
|
||||
- struct ieee80211_hdr *hdr;
|
||||
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
|
||||
- u8 *phy_status = NULL;
|
||||
-
|
||||
- memset(pkt_stat, 0, sizeof(*pkt_stat));
|
||||
-
|
||||
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
|
||||
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
|
||||
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
|
||||
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
|
||||
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
|
||||
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
|
||||
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
|
||||
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
|
||||
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
|
||||
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
|
||||
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
|
||||
- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc);
|
||||
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
|
||||
-
|
||||
- /* drv_info_sz is in unit of 8-bytes */
|
||||
- pkt_stat->drv_info_sz *= 8;
|
||||
-
|
||||
- /* c2h cmd pkt's rx/phy status is not interested */
|
||||
- if (pkt_stat->is_c2h)
|
||||
- return;
|
||||
-
|
||||
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
|
||||
- pkt_stat->drv_info_sz);
|
||||
- pkt_stat->hdr = hdr;
|
||||
- if (pkt_stat->phy_status) {
|
||||
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
|
||||
- query_phy_status(rtwdev, phy_status, pkt_stat);
|
||||
- }
|
||||
-
|
||||
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
|
||||
-}
|
||||
-
|
||||
static void
|
||||
rtw8822c_set_write_tx_power_ref(struct rtw_dev *rtwdev, u8 *tx_pwr_ref_cck,
|
||||
u8 *tx_pwr_ref_ofdm)
|
||||
@@ -4991,7 +4949,7 @@ static const struct rtw_prioq_addrs prio
|
||||
static const struct rtw_chip_ops rtw8822c_ops = {
|
||||
.phy_set_param = rtw8822c_phy_set_param,
|
||||
.read_efuse = rtw8822c_read_efuse,
|
||||
- .query_rx_desc = rtw8822c_query_rx_desc,
|
||||
+ .query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8822c_set_channel,
|
||||
.mac_init = rtw8822c_mac_init,
|
||||
.dump_fw_crash = rtw8822c_dump_fw_crash,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rx.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
|
||||
@@ -187,11 +187,10 @@ fill_rx_status:
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_update_rx_freq_from_ie);
|
||||
|
||||
-void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_hdr *hdr,
|
||||
- struct ieee80211_rx_status *rx_status,
|
||||
- u8 *phy_status)
|
||||
+static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat,
|
||||
+ struct ieee80211_hdr *hdr,
|
||||
+ struct ieee80211_rx_status *rx_status)
|
||||
{
|
||||
struct ieee80211_hw *hw = rtwdev->hw;
|
||||
u8 path;
|
||||
@@ -242,5 +241,64 @@ void rtw_rx_fill_rx_status(struct rtw_de
|
||||
}
|
||||
|
||||
rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
|
||||
+
|
||||
+ /* Rtl8723cs driver checks for size < 14 or size > 8192 and
|
||||
+ * simply drops the packet.
|
||||
+ */
|
||||
+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8703B && pkt_stat->pkt_len == 0) {
|
||||
+ rx_status->flag |= RX_FLAG_NO_PSDU;
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void rtw_rx_query_rx_desc(struct rtw_dev *rtwdev, void *rx_desc8,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat,
|
||||
+ struct ieee80211_rx_status *rx_status)
|
||||
+{
|
||||
+ u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
|
||||
+ struct rtw_rx_desc *rx_desc = rx_desc8;
|
||||
+ struct ieee80211_hdr *hdr;
|
||||
+ u32 enc_type, swdec;
|
||||
+ void *phy_status;
|
||||
+
|
||||
+ memset(pkt_stat, 0, sizeof(*pkt_stat));
|
||||
+
|
||||
+ pkt_stat->pkt_len = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_PKT_LEN);
|
||||
+ pkt_stat->crc_err = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_CRC32);
|
||||
+ pkt_stat->icv_err = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_ICV_ERR);
|
||||
+ pkt_stat->drv_info_sz = le32_get_bits(rx_desc->w0,
|
||||
+ RTW_RX_DESC_W0_DRV_INFO_SIZE);
|
||||
+ enc_type = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_ENC_TYPE);
|
||||
+ pkt_stat->shift = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_SHIFT);
|
||||
+ pkt_stat->phy_status = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_PHYST);
|
||||
+ swdec = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_SWDEC);
|
||||
+ pkt_stat->decrypted = !swdec && enc_type != RX_DESC_ENC_NONE;
|
||||
+
|
||||
+ pkt_stat->cam_id = le32_get_bits(rx_desc->w1, RTW_RX_DESC_W1_MACID);
|
||||
+
|
||||
+ pkt_stat->is_c2h = le32_get_bits(rx_desc->w2, RTW_RX_DESC_W2_C2H);
|
||||
+ pkt_stat->ppdu_cnt = le32_get_bits(rx_desc->w2, RTW_RX_DESC_W2_PPDU_CNT);
|
||||
+
|
||||
+ pkt_stat->rate = le32_get_bits(rx_desc->w3, RTW_RX_DESC_W3_RX_RATE);
|
||||
+
|
||||
+ pkt_stat->bw = le32_get_bits(rx_desc->w4, RTW_RX_DESC_W4_BW);
|
||||
+
|
||||
+ pkt_stat->tsf_low = le32_get_bits(rx_desc->w5, RTW_RX_DESC_W5_TSFL);
|
||||
+
|
||||
+ /* drv_info_sz is in unit of 8-bytes */
|
||||
+ pkt_stat->drv_info_sz *= 8;
|
||||
+
|
||||
+ /* c2h cmd pkt's rx/phy status is not interested */
|
||||
+ if (pkt_stat->is_c2h)
|
||||
+ return;
|
||||
+
|
||||
+ phy_status = rx_desc8 + desc_sz + pkt_stat->shift;
|
||||
+ hdr = phy_status + pkt_stat->drv_info_sz;
|
||||
+ pkt_stat->hdr = hdr;
|
||||
+
|
||||
+ if (pkt_stat->phy_status)
|
||||
+ rtwdev->chip->ops->query_phy_status(rtwdev, phy_status, pkt_stat);
|
||||
+
|
||||
+ rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status);
|
||||
}
|
||||
-EXPORT_SYMBOL(rtw_rx_fill_rx_status);
|
||||
+EXPORT_SYMBOL(rtw_rx_query_rx_desc);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rx.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rx.h
|
||||
@@ -14,42 +14,40 @@ enum rtw_rx_desc_enc {
|
||||
RX_DESC_ENC_WEP104 = 5,
|
||||
};
|
||||
|
||||
-#define GET_RX_DESC_PHYST(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(26))
|
||||
-#define GET_RX_DESC_ICV_ERR(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(15))
|
||||
-#define GET_RX_DESC_CRC32(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(14))
|
||||
-#define GET_RX_DESC_SWDEC(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(27))
|
||||
-#define GET_RX_DESC_C2H(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x02), BIT(28))
|
||||
-#define GET_RX_DESC_PKT_LEN(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(13, 0))
|
||||
-#define GET_RX_DESC_DRV_INFO_SIZE(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(19, 16))
|
||||
-#define GET_RX_DESC_SHIFT(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(25, 24))
|
||||
-#define GET_RX_DESC_ENC_TYPE(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(22, 20))
|
||||
-#define GET_RX_DESC_RX_RATE(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x03), GENMASK(6, 0))
|
||||
-#define GET_RX_DESC_MACID(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x01), GENMASK(6, 0))
|
||||
-#define GET_RX_DESC_PPDU_CNT(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x02), GENMASK(30, 29))
|
||||
-#define GET_RX_DESC_TSFL(rxdesc) \
|
||||
- le32_get_bits(*((__le32 *)(rxdesc) + 0x05), GENMASK(31, 0))
|
||||
-#define GET_RX_DESC_BW(rxdesc) \
|
||||
- (le32_get_bits(*((__le32 *)(rxdesc) + 0x04), GENMASK(5, 4)))
|
||||
+struct rtw_rx_desc {
|
||||
+ __le32 w0;
|
||||
+ __le32 w1;
|
||||
+ __le32 w2;
|
||||
+ __le32 w3;
|
||||
+ __le32 w4;
|
||||
+ __le32 w5;
|
||||
+} __packed;
|
||||
+
|
||||
+#define RTW_RX_DESC_W0_PKT_LEN GENMASK(13, 0)
|
||||
+#define RTW_RX_DESC_W0_CRC32 BIT(14)
|
||||
+#define RTW_RX_DESC_W0_ICV_ERR BIT(15)
|
||||
+#define RTW_RX_DESC_W0_DRV_INFO_SIZE GENMASK(19, 16)
|
||||
+#define RTW_RX_DESC_W0_ENC_TYPE GENMASK(22, 20)
|
||||
+#define RTW_RX_DESC_W0_SHIFT GENMASK(25, 24)
|
||||
+#define RTW_RX_DESC_W0_PHYST BIT(26)
|
||||
+#define RTW_RX_DESC_W0_SWDEC BIT(27)
|
||||
+
|
||||
+#define RTW_RX_DESC_W1_MACID GENMASK(6, 0)
|
||||
+
|
||||
+#define RTW_RX_DESC_W2_C2H BIT(28)
|
||||
+#define RTW_RX_DESC_W2_PPDU_CNT GENMASK(30, 29)
|
||||
+
|
||||
+#define RTW_RX_DESC_W3_RX_RATE GENMASK(6, 0)
|
||||
+
|
||||
+#define RTW_RX_DESC_W4_BW GENMASK(5, 4)
|
||||
+
|
||||
+#define RTW_RX_DESC_W5_TSFL GENMASK(31, 0)
|
||||
|
||||
void rtw_rx_stats(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
|
||||
struct sk_buff *skb);
|
||||
-void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
|
||||
- struct rtw_rx_pkt_stat *pkt_stat,
|
||||
- struct ieee80211_hdr *hdr,
|
||||
- struct ieee80211_rx_status *rx_status,
|
||||
- u8 *phy_status);
|
||||
+void rtw_rx_query_rx_desc(struct rtw_dev *rtwdev, void *rx_desc8,
|
||||
+ struct rtw_rx_pkt_stat *pkt_stat,
|
||||
+ struct ieee80211_rx_status *rx_status);
|
||||
void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb,
|
||||
struct ieee80211_rx_status *rx_status,
|
||||
struct rtw_rx_pkt_stat *pkt_stat);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -981,8 +981,7 @@ static void rtw_sdio_rxfifo_recv(struct
|
||||
|
||||
while (true) {
|
||||
rx_desc = skb->data;
|
||||
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
|
||||
- &rx_status);
|
||||
+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status);
|
||||
pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
|
||||
pkt_stat.shift;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -570,8 +570,8 @@ static void rtw_usb_rx_handler(struct wo
|
||||
|
||||
do {
|
||||
rx_desc = skb->data;
|
||||
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
|
||||
- &rx_status);
|
||||
+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat,
|
||||
+ &rx_status);
|
||||
pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
|
||||
pkt_stat.shift;
|
||||
|
@ -0,0 +1,70 @@
|
||||
From 4aefde403da7af30757915e0462d88398c9388c5 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Tue, 8 Oct 2024 21:44:02 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Fix the RX aggregation in USB 3 mode
|
||||
|
||||
RTL8822CU, RTL8822BU, and RTL8821CU don't need BIT_EN_PRE_CALC.
|
||||
In fact, RTL8822BU in USB 3 mode doesn't pass all the frames to the
|
||||
driver, resulting in much lower download speed than normal:
|
||||
|
||||
$ iperf3 -c 192.168.0.1 -R
|
||||
Connecting to host 192.168.0.1, port 5201
|
||||
Reverse mode, remote host 192.168.0.1 is sending
|
||||
[ 5] local 192.168.0.50 port 43062 connected to 192.168.0.1 port 5201
|
||||
[ ID] Interval Transfer Bitrate
|
||||
[ 5] 0.00-1.00 sec 26.9 MBytes 225 Mbits/sec
|
||||
[ 5] 1.00-2.00 sec 7.50 MBytes 62.9 Mbits/sec
|
||||
[ 5] 2.00-3.00 sec 8.50 MBytes 71.3 Mbits/sec
|
||||
[ 5] 3.00-4.00 sec 8.38 MBytes 70.3 Mbits/sec
|
||||
[ 5] 4.00-5.00 sec 7.75 MBytes 65.0 Mbits/sec
|
||||
[ 5] 5.00-6.00 sec 8.00 MBytes 67.1 Mbits/sec
|
||||
[ 5] 6.00-7.00 sec 8.00 MBytes 67.1 Mbits/sec
|
||||
[ 5] 7.00-8.00 sec 7.75 MBytes 65.0 Mbits/sec
|
||||
[ 5] 8.00-9.00 sec 7.88 MBytes 66.1 Mbits/sec
|
||||
[ 5] 9.00-10.00 sec 7.88 MBytes 66.1 Mbits/sec
|
||||
- - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
[ ID] Interval Transfer Bitrate Retr
|
||||
[ 5] 0.00-10.02 sec 102 MBytes 85.1 Mbits/sec 224 sender
|
||||
[ 5] 0.00-10.00 sec 98.6 MBytes 82.7 Mbits/sec receiver
|
||||
|
||||
Don't set BIT_EN_PRE_CALC. Then the speed is much better:
|
||||
|
||||
% iperf3 -c 192.168.0.1 -R
|
||||
Connecting to host 192.168.0.1, port 5201
|
||||
Reverse mode, remote host 192.168.0.1 is sending
|
||||
[ 5] local 192.168.0.50 port 39000 connected to 192.168.0.1 port 5201
|
||||
[ ID] Interval Transfer Bitrate
|
||||
[ 5] 0.00-1.00 sec 52.8 MBytes 442 Mbits/sec
|
||||
[ 5] 1.00-2.00 sec 71.9 MBytes 603 Mbits/sec
|
||||
[ 5] 2.00-3.00 sec 74.8 MBytes 627 Mbits/sec
|
||||
[ 5] 3.00-4.00 sec 75.9 MBytes 636 Mbits/sec
|
||||
[ 5] 4.00-5.00 sec 76.0 MBytes 638 Mbits/sec
|
||||
[ 5] 5.00-6.00 sec 74.1 MBytes 622 Mbits/sec
|
||||
[ 5] 6.00-7.00 sec 74.0 MBytes 621 Mbits/sec
|
||||
[ 5] 7.00-8.00 sec 76.0 MBytes 638 Mbits/sec
|
||||
[ 5] 8.00-9.00 sec 74.4 MBytes 624 Mbits/sec
|
||||
[ 5] 9.00-10.00 sec 63.9 MBytes 536 Mbits/sec
|
||||
- - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
[ ID] Interval Transfer Bitrate Retr
|
||||
[ 5] 0.00-10.00 sec 717 MBytes 601 Mbits/sec 24 sender
|
||||
[ 5] 0.00-10.00 sec 714 MBytes 599 Mbits/sec receiver
|
||||
|
||||
Fixes: 002a5db9a52a ("wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c")
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@kernel.org>
|
||||
Link: https://patch.msgid.link/afb94a82-3d18-459e-97fc-1a217608cdf0@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(st
|
||||
u8 size, timeout;
|
||||
u16 val16;
|
||||
|
||||
- rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
|
||||
rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
|
||||
rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 7846f0b63562f4db45f712cc7dab091985baf07b Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Anees <pvmohammedanees2003@gmail.com>
|
||||
Date: Thu, 17 Oct 2024 13:36:38 +0530
|
||||
Subject: [PATCH] wifi: rtw88: Refactor looping in
|
||||
rtw_phy_store_tx_power_by_rate
|
||||
|
||||
The previous implementation included an unnecessary else
|
||||
condition paired with a continue statement. Since a check
|
||||
is already performed to determine if the band is either
|
||||
2G or 5G, the else condition will never be triggered.
|
||||
We can remove this check.
|
||||
|
||||
Signed-off-by: Mohammed Anees <pvmohammedanees2003@gmail.com>
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/20241017080638.13074-1-pvmohammedanees2003@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/phy.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
@@ -1470,10 +1470,8 @@ static void rtw_phy_store_tx_power_by_ra
|
||||
rate = rates[i];
|
||||
if (band == PHY_BAND_2G)
|
||||
hal->tx_pwr_by_rate_offset_2g[rfpath][rate] = offset;
|
||||
- else if (band == PHY_BAND_5G)
|
||||
- hal->tx_pwr_by_rate_offset_5g[rfpath][rate] = offset;
|
||||
else
|
||||
- continue;
|
||||
+ hal->tx_pwr_by_rate_offset_5g[rfpath][rate] = offset;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
From 47f754b3f838205f3b25c4839f74801d180995bf Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Tue, 22 Oct 2024 20:20:26 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Report the signal strength only if it's known
|
||||
|
||||
RTL8811CU doesn't report the signal strength for many (any?) data
|
||||
frames. When the signal strength is not known, set
|
||||
RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal
|
||||
strength of 0.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/f7e1e448-2c9b-498f-b8b1-a14dd967d7d3@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/rx.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rx.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
|
||||
@@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct
|
||||
else
|
||||
rx_status->bw = RATE_INFO_BW_20;
|
||||
|
||||
- rx_status->signal = pkt_stat->signal_power;
|
||||
- for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
||||
- rx_status->chains |= BIT(path);
|
||||
- rx_status->chain_signal[path] = pkt_stat->rx_power[path];
|
||||
+ if (pkt_stat->phy_status) {
|
||||
+ rx_status->signal = pkt_stat->signal_power;
|
||||
+ for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
||||
+ rx_status->chains |= BIT(path);
|
||||
+ rx_status->chain_signal[path] = pkt_stat->rx_power[path];
|
||||
+ }
|
||||
+ } else {
|
||||
+ rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
|
||||
}
|
||||
|
||||
rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
|
@ -0,0 +1,490 @@
|
||||
From d12722830ea4f562e91586927ec21b64d0369544 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:00:59 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Add some definitions for RTL8821AU/RTL8812AU
|
||||
|
||||
Add 8821A and 8812A chip type enums.
|
||||
|
||||
Add cck_high_power member to struct rtw_hal. This will be used to
|
||||
calculate the RX signal strength of RTL8812AU.
|
||||
|
||||
Add various register definitions which will be used by the new drivers.
|
||||
|
||||
Move some existing register definitions from rtw8821c.h and rtw8822b.h.
|
||||
They were duplicated in those headers and will also be used by the new
|
||||
drivers.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/9279a9cd-6f86-4dc3-a095-7c36cb9b9d06@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 3 +
|
||||
drivers/net/wireless/realtek/rtw88/reg.h | 174 ++++++++++++++++++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.h | 24 ---
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.h | 12 --
|
||||
4 files changed, 177 insertions(+), 36 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -189,6 +189,8 @@ enum rtw_chip_type {
|
||||
RTW_CHIP_TYPE_8723D,
|
||||
RTW_CHIP_TYPE_8821C,
|
||||
RTW_CHIP_TYPE_8703B,
|
||||
+ RTW_CHIP_TYPE_8821A,
|
||||
+ RTW_CHIP_TYPE_8812A,
|
||||
};
|
||||
|
||||
enum rtw_tx_queue_type {
|
||||
@@ -1934,6 +1936,7 @@ struct rtw_hal {
|
||||
u32 antenna_rx;
|
||||
u8 bfee_sts_cap;
|
||||
bool txrx_1ss;
|
||||
+ bool cck_high_power;
|
||||
|
||||
/* protect tx power section */
|
||||
struct mutex tx_power_mutex;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/reg.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
|
||||
@@ -9,6 +9,7 @@
|
||||
#define BIT_FEN_EN_25_1 BIT(13)
|
||||
#define BIT_FEN_ELDR BIT(12)
|
||||
#define BIT_FEN_CPUEN BIT(2)
|
||||
+#define BIT_FEN_USBA BIT(2)
|
||||
#define BIT_FEN_BB_GLB_RST BIT(1)
|
||||
#define BIT_FEN_BB_RSTB BIT(0)
|
||||
#define BIT_R_DIS_PRST BIT(6)
|
||||
@@ -16,6 +17,10 @@
|
||||
#define REG_SYS_PW_CTRL 0x0004
|
||||
#define BIT_PFM_WOWL BIT(3)
|
||||
#define BIT_APFM_OFFMAC BIT(9)
|
||||
+#define REG_APS_FSMCO 0x0004
|
||||
+#define APS_FSMCO_MAC_ENABLE BIT(8)
|
||||
+#define APS_FSMCO_MAC_OFF BIT(9)
|
||||
+#define APS_FSMCO_HW_POWERDOWN BIT(15)
|
||||
#define REG_SYS_CLK_CTRL 0x0008
|
||||
#define BIT_CPU_CLK_EN BIT(14)
|
||||
|
||||
@@ -58,6 +63,8 @@
|
||||
#define BIT_SHIFT_LDO25_VOLTAGE 4
|
||||
#define BIT_LDO25_EN BIT(7)
|
||||
|
||||
+#define REG_ACLK_MON 0x3e
|
||||
+
|
||||
#define REG_GPIO_MUXCFG 0x0040
|
||||
#define BIT_FSPI_EN BIT(19)
|
||||
#define BIT_EN_SIC BIT(12)
|
||||
@@ -90,6 +97,8 @@
|
||||
#define BIT_USB_SUS_DIS BIT(8)
|
||||
#define BIT_SDIO_PAD_E5 BIT(18)
|
||||
|
||||
+#define REG_RF_B_CTRL 0x76
|
||||
+
|
||||
#define REG_AFE_CTRL_4 0x0078
|
||||
#define BIT_CK320M_AFE_EN BIT(4)
|
||||
#define BIT_EN_SYN BIT(15)
|
||||
@@ -134,6 +143,11 @@
|
||||
#define REG_PMC_DBG_CTRL1 0xa8
|
||||
#define BITS_PMC_BT_IQK_STS GENMASK(22, 21)
|
||||
|
||||
+#define REG_HIMR0 0xb0
|
||||
+#define REG_HISR0 0xb4
|
||||
+#define REG_HIMR1 0xb8
|
||||
+#define REG_HISR1 0xbc
|
||||
+
|
||||
#define REG_PAD_CTRL2 0x00C4
|
||||
#define BIT_RSM_EN_V1 BIT(16)
|
||||
#define BIT_NO_PDN_CHIPOFF_V1 BIT(17)
|
||||
@@ -185,6 +199,15 @@
|
||||
#define MAC_TRX_ENABLE (BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \
|
||||
BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \
|
||||
BIT_MACTXEN | BIT_MACRXEN)
|
||||
+#define REG_PBP 0x104
|
||||
+#define PBP_RX_MASK 0x0f
|
||||
+#define PBP_TX_MASK 0xf0
|
||||
+#define PBP_64 0x0
|
||||
+#define PBP_128 0x1
|
||||
+#define PBP_256 0x2
|
||||
+#define PBP_512 0x3
|
||||
+#define PBP_1024 0x4
|
||||
+
|
||||
#define BIT_SHIFT_TXDMA_VOQ_MAP 4
|
||||
#define BIT_MASK_TXDMA_VOQ_MAP 0x3
|
||||
#define BIT_TXDMA_VOQ_MAP(x) \
|
||||
@@ -256,6 +279,8 @@
|
||||
#define REG_HMEBOX1 0x01D4
|
||||
#define REG_HMEBOX2 0x01D8
|
||||
#define REG_HMEBOX3 0x01DC
|
||||
+#define REG_LLT_INIT 0x01E0
|
||||
+#define BIT_LLT_WRITE_ACCESS BIT(30)
|
||||
#define REG_HMEBOX0_EX 0x01F0
|
||||
#define REG_HMEBOX1_EX 0x01F4
|
||||
#define REG_HMEBOX2_EX 0x01F8
|
||||
@@ -298,6 +323,7 @@
|
||||
|
||||
#define REG_AUTO_LLT 0x0224
|
||||
#define BIT_AUTO_INIT_LLT BIT(16)
|
||||
+#define REG_DWBCN1_CTRL 0x0228
|
||||
#define REG_RQPN_CTRL_1 0x0228
|
||||
#define REG_RQPN_CTRL_2 0x022C
|
||||
#define BIT_LD_RQPN BIT(31)
|
||||
@@ -329,6 +355,7 @@
|
||||
#define BIT_DMA_BURST_SIZE_1024 0
|
||||
|
||||
#define REG_RXPKTNUM 0x02B0
|
||||
+#define REG_EARLY_MODE_CONTROL 0x02BC
|
||||
|
||||
#define REG_INT_MIG 0x0304
|
||||
#define REG_HCI_MIX_CFG 0x03FC
|
||||
@@ -336,6 +363,7 @@
|
||||
|
||||
#define REG_BCNQ_INFO 0x0418
|
||||
#define BIT_MGQ_CPU_EMPTY BIT(24)
|
||||
+#define REG_TXPKT_EMPTY 0x041A
|
||||
#define REG_FWHW_TXQ_CTRL 0x0420
|
||||
#define BIT_EN_BCNQ_DL BIT(22)
|
||||
#define BIT_EN_WR_FREE_TAIL BIT(20)
|
||||
@@ -362,10 +390,12 @@
|
||||
#define REG_AMPDU_MAX_TIME_V1 0x0455
|
||||
#define REG_BCNQ1_BDNY_V1 0x0456
|
||||
#define REG_AMPDU_MAX_TIME 0x0456
|
||||
+#define REG_AMPDU_MAX_LENGTH 0x0458
|
||||
#define REG_WMAC_LBK_BF_HD 0x045D
|
||||
#define REG_TX_HANG_CTRL 0x045E
|
||||
#define BIT_EN_GNT_BT_AWAKE BIT(3)
|
||||
#define BIT_EN_EOF_V1 BIT(2)
|
||||
+#define REG_FAST_EDCA_CTRL 0x0460
|
||||
#define REG_DATA_SC 0x0483
|
||||
#define REG_ARFR2_V1 0x048C
|
||||
#define REG_ARFRH2_V1 0x0490
|
||||
@@ -390,6 +420,8 @@
|
||||
#define REG_PRECNT_CTRL 0x04E5
|
||||
#define BIT_BTCCA_CTRL (BIT(0) | BIT(1))
|
||||
#define BIT_EN_PRECNT BIT(11)
|
||||
+#define REG_TX_RPT_CTRL 0x04EC
|
||||
+#define REG_TX_RPT_TIME 0x04F0
|
||||
#define REG_DUMMY_PAGE4_V1 0x04FC
|
||||
|
||||
#define REG_EDCA_VO_PARAM 0x0500
|
||||
@@ -400,6 +432,7 @@
|
||||
#define BIT_MASK_CWMAX GENMASK(15, 12)
|
||||
#define BIT_MASK_CWMIN GENMASK(11, 8)
|
||||
#define BIT_MASK_AIFS GENMASK(7, 0)
|
||||
+#define REG_BCNTCFG 0x0510
|
||||
#define REG_PIFS 0x0512
|
||||
#define REG_SIFS 0x0514
|
||||
#define BIT_SHIFT_SIFS_OFDM_CTX 8
|
||||
@@ -526,6 +559,8 @@
|
||||
#define REG_BT_COEX_V2 0x0762
|
||||
#define BIT_GNT_BT_POLARITY BIT(12)
|
||||
#define BIT_LTE_COEX_EN BIT(7)
|
||||
+#define REG_GNT_BT 0x0765
|
||||
+#define BIT_PTA_SW_CTL GENMASK(4, 3)
|
||||
#define REG_BT_COEX_ENH_INTR_CTRL 0x76E
|
||||
#define BIT_R_GRANTALL_WLMASK BIT(3)
|
||||
#define BIT_STATIS_BT_EN BIT(2)
|
||||
@@ -543,14 +578,43 @@
|
||||
#define REG_FPGA0_RFMOD 0x0800
|
||||
#define BIT_CCKEN BIT(24)
|
||||
#define BIT_OFDMEN BIT(25)
|
||||
+#define REG_CCK_RPT_FORMAT 0x0804
|
||||
+#define BIT_CCK_RPT_FORMAT BIT(16)
|
||||
+#define REG_RXPSEL 0x0808
|
||||
+#define BIT_RX_PSEL_RST (BIT(28) | BIT(29))
|
||||
+#define REG_TXPSEL 0x080C
|
||||
#define REG_RX_GAIN_EN 0x081c
|
||||
+#define REG_CCASEL 0x082C
|
||||
+#define REG_PDMFTH 0x0830
|
||||
+#define REG_BWINDICATION 0x0834
|
||||
+#define REG_CCA2ND 0x0838
|
||||
+#define REG_L1PKTH 0x0848
|
||||
+#define REG_CLKTRK 0x0860
|
||||
+#define REG_ADCCLK 0x08AC
|
||||
+#define REG_HSSI_READ 0x08B0
|
||||
+#define REG_FPGA0_XCD_RF_PARA 0x08B4
|
||||
+#define REG_RX_MCS_LIMIT 0x08BC
|
||||
+#define REG_ADC160 0x08C4
|
||||
+#define REG_ANTSEL_SW 0x0900
|
||||
+#define REG_DAC_RSTB 0x090c
|
||||
+#define REG_SINGLE_TONE_CONT_TX 0x0914
|
||||
|
||||
#define REG_RFE_CTRL_E 0x0974
|
||||
#define REG_2ND_CCA_CTRL 0x0976
|
||||
+#define REG_IQK_COM00 0x0978
|
||||
+#define REG_IQK_COM32 0x097c
|
||||
+#define REG_IQK_COM64 0x0980
|
||||
+#define REG_IQK_COM96 0x0984
|
||||
+
|
||||
+#define REG_FAS 0x09a4
|
||||
+#define REG_RXSB 0x0a00
|
||||
+#define REG_CCK_RX 0x0a04
|
||||
+#define REG_CCK_PD_TH 0x0a0a
|
||||
|
||||
#define REG_CCK0_FAREPORT 0xa2c
|
||||
#define BIT_CCK0_2RX BIT(18)
|
||||
#define BIT_CCK0_MRC BIT(22)
|
||||
+#define REG_FA_CCK 0x0a5c
|
||||
|
||||
#define REG_DIS_DPD 0x0a70
|
||||
#define DIS_DPD_MASK GENMASK(9, 0)
|
||||
@@ -566,13 +630,109 @@
|
||||
#define DIS_DPD_RATEVHT2SS_MCS1 BIT(9)
|
||||
#define DIS_DPD_RATEALL GENMASK(9, 0)
|
||||
|
||||
+#define REG_CNTRST 0x0b58
|
||||
+
|
||||
+#define REG_3WIRE_SWA 0x0c00
|
||||
+#define REG_RX_IQC_AB_A 0x0c10
|
||||
+#define REG_TXSCALE_A 0x0c1c
|
||||
+#define BB_SWING_MASK GENMASK(31, 21)
|
||||
+#define REG_TX_AGC_A_CCK_11_CCK_1 0xc20
|
||||
+#define REG_TX_AGC_A_OFDM18_OFDM6 0xc24
|
||||
+#define REG_TX_AGC_A_OFDM54_OFDM24 0xc28
|
||||
+#define REG_TX_AGC_A_MCS3_MCS0 0xc2c
|
||||
+#define REG_TX_AGC_A_MCS7_MCS4 0xc30
|
||||
+#define REG_TX_AGC_A_MCS11_MCS8 0xc34
|
||||
+#define REG_TX_AGC_A_MCS15_MCS12 0xc38
|
||||
+#define REG_TX_AGC_A_NSS1_INDEX3_NSS1_INDEX0 0xc3c
|
||||
+#define REG_TX_AGC_A_NSS1_INDEX7_NSS1_INDEX4 0xc40
|
||||
+#define REG_TX_AGC_A_NSS2_INDEX1_NSS1_INDEX8 0xc44
|
||||
+#define REG_TX_AGC_A_NSS2_INDEX5_NSS2_INDEX2 0xc48
|
||||
+#define REG_TX_AGC_A_NSS2_INDEX9_NSS2_INDEX6 0xc4c
|
||||
+#define REG_RXIGI_A 0x0c50
|
||||
+#define REG_TX_PWR_TRAINING_A 0x0c54
|
||||
+#define REG_CK_MONHA 0x0c5c
|
||||
+#define REG_AFE_PWR1_A 0x0c60
|
||||
+#define REG_AFE_PWR2_A 0x0c64
|
||||
+#define REG_RX_WAIT_CCA_TX_CCK_RFON_A 0x0c68
|
||||
+#define REG_OFDM0_XA_TX_IQ_IMBALANCE 0x0c80
|
||||
+#define REG_OFDM0_A_TX_AFE 0x0c84
|
||||
+#define REG_OFDM0_XB_TX_IQ_IMBALANCE 0x0c88
|
||||
+#define REG_TSSI_TRK_SW 0x0c8c
|
||||
+#define REG_LSSI_WRITE_A 0x0c90
|
||||
+#define REG_PREDISTA 0x0c90
|
||||
+#define REG_TXAGCIDX 0x0c94
|
||||
+
|
||||
+#define REG_RFE_PINMUX_A 0x0cb0
|
||||
+#define REG_RFE_INV_A 0x0cb4
|
||||
#define REG_RFE_CTRL8 0x0cb4
|
||||
#define BIT_MASK_RFE_SEL89 GENMASK(7, 0)
|
||||
+#define PTA_CTRL_PIN 0x66
|
||||
+#define DPDT_CTRL_PIN 0x77
|
||||
+#define RFE_INV_MASK 0x3ff00000
|
||||
+#define REG_RFECTL_A 0x0cb8
|
||||
#define REG_RFE_INV8 0x0cbd
|
||||
#define BIT_MASK_RFE_INV89 GENMASK(1, 0)
|
||||
#define REG_RFE_INV16 0x0cbe
|
||||
#define BIT_RFE_BUF_EN BIT(3)
|
||||
|
||||
+#define REG_IQK_DPD_CFG 0x0cc4
|
||||
+#define REG_CFG_PMPD 0x0cc8
|
||||
+#define REG_IQC_Y 0x0ccc
|
||||
+#define REG_IQC_X 0x0cd4
|
||||
+#define REG_INTPO_SETA 0x0ce8
|
||||
+
|
||||
+#define REG_IQKA_END 0x0d00
|
||||
+#define REG_PI_READ_A 0x0d04
|
||||
+#define REG_SI_READ_A 0x0d08
|
||||
+#define REG_IQKB_END 0x0d40
|
||||
+#define REG_PI_READ_B 0x0d44
|
||||
+#define REG_SI_READ_B 0x0d48
|
||||
+
|
||||
+#define REG_3WIRE_SWB 0x0e00
|
||||
+#define REG_RX_IQC_AB_B 0x0e10
|
||||
+#define REG_TXSCALE_B 0x0e1c
|
||||
+#define REG_TX_AGC_B_CCK_11_CCK_1 0xe20
|
||||
+#define REG_TX_AGC_B_OFDM18_OFDM6 0xe24
|
||||
+#define REG_TX_AGC_B_OFDM54_OFDM24 0xe28
|
||||
+#define REG_TX_AGC_B_MCS3_MCS0 0xe2c
|
||||
+#define REG_TX_AGC_B_MCS7_MCS4 0xe30
|
||||
+#define REG_TX_AGC_B_MCS11_MCS8 0xe34
|
||||
+#define REG_TX_AGC_B_MCS15_MCS12 0xe38
|
||||
+#define REG_TX_AGC_B_NSS1_INDEX3_NSS1_INDEX0 0xe3c
|
||||
+#define REG_TX_AGC_B_NSS1_INDEX7_NSS1_INDEX4 0xe40
|
||||
+#define REG_TX_AGC_B_NSS2_INDEX1_NSS1_INDEX8 0xe44
|
||||
+#define REG_TX_AGC_B_NSS2_INDEX5_NSS2_INDEX2 0xe48
|
||||
+#define REG_TX_AGC_B_NSS2_INDEX9_NSS2_INDEX6 0xe4c
|
||||
+#define REG_RXIGI_B 0x0e50
|
||||
+#define REG_TX_PWR_TRAINING_B 0x0e54
|
||||
+#define REG_CK_MONHB 0x0e5c
|
||||
+#define REG_AFE_PWR1_B 0x0e60
|
||||
+#define REG_AFE_PWR2_B 0x0e64
|
||||
+#define REG_RX_WAIT_CCA_TX_CCK_RFON_B 0x0e68
|
||||
+#define REG_TXTONEB 0x0e80
|
||||
+#define REG_RXTONEB 0x0e84
|
||||
+#define REG_TXPITMB 0x0e88
|
||||
+#define REG_RXPITMB 0x0e8c
|
||||
+#define REG_LSSI_WRITE_B 0x0e90
|
||||
+#define REG_PREDISTB 0x0e90
|
||||
+#define REG_INIDLYB 0x0e94
|
||||
+#define REG_RFE_PINMUX_B 0x0eb0
|
||||
+#define REG_RFE_INV_B 0x0eb4
|
||||
+#define REG_RFECTL_B 0x0eb8
|
||||
+#define REG_BPBDB 0x0ec4
|
||||
+#define REG_PHYTXONB 0x0ec8
|
||||
+#define REG_IQKYB 0x0ecc
|
||||
+#define REG_IQKXB 0x0ed4
|
||||
+#define REG_INTPO_SETB 0x0ee8
|
||||
+
|
||||
+#define REG_CRC_CCK 0x0f04
|
||||
+#define REG_CCA_OFDM 0x0f08
|
||||
+#define REG_CRC_VHT 0x0f0c
|
||||
+#define REG_CRC_HT 0x0f10
|
||||
+#define REG_CRC_OFDM 0x0f14
|
||||
+#define REG_FA_OFDM 0x0f48
|
||||
+#define REG_CCA_CCK 0x0fcc
|
||||
+
|
||||
#define REG_ANAPARSW_MAC_0 0x1010
|
||||
#define BIT_CF_L_V2 GENMASK(29, 28)
|
||||
|
||||
@@ -709,6 +869,10 @@
|
||||
|
||||
#define REG_IGN_GNTBT4 0x4160
|
||||
|
||||
+#define REG_USB_MOD 0xf008
|
||||
+#define REG_USB3_RXITV 0xf050
|
||||
+#define REG_USB_HRPWM 0xfe58
|
||||
+
|
||||
#define RF_MODE 0x00
|
||||
#define RF_MODOPT 0x01
|
||||
#define RF_WLINT 0x01
|
||||
@@ -716,7 +880,13 @@
|
||||
#define RF_DTXLOK 0x08
|
||||
#define RF_CFGCH 0x18
|
||||
#define BIT_BAND GENMASK(18, 16)
|
||||
+#define RF18_BAND_MASK (BIT(16) | BIT(9) | BIT(8))
|
||||
+#define RF18_CHANNEL_MASK (MASKBYTE0)
|
||||
+#define RF18_RFSI_MASK (BIT(18) | BIT(17))
|
||||
#define RF_RCK 0x1d
|
||||
+#define RF_MODE_TABLE_ADDR 0x30
|
||||
+#define RF_MODE_TABLE_DATA0 0x31
|
||||
+#define RF_MODE_TABLE_DATA1 0x32
|
||||
#define RF_LUTWA 0x33
|
||||
#define RF_LUTWD1 0x3e
|
||||
#define RF_LUTWD0 0x3f
|
||||
@@ -725,10 +895,14 @@
|
||||
#define RF_T_METER 0x42
|
||||
#define RF_BSPAD 0x54
|
||||
#define RF_GAINTX 0x56
|
||||
+#define RF_TXMOD 0x58
|
||||
#define RF_TXATANK 0x64
|
||||
+#define RF_TXA_PREPAD 0x65
|
||||
#define RF_TRXIQ 0x66
|
||||
#define RF_RXIQGEN 0x8d
|
||||
+#define RF_RXBB2 0x8f
|
||||
#define RF_SYN_PFD 0xb0
|
||||
+#define RF_LCK 0xb4
|
||||
#define RF_XTALX2 0xb8
|
||||
#define RF_SYN_CTRL 0xbb
|
||||
#define RF_MALSEL 0xbe
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h
|
||||
@@ -214,19 +214,10 @@ extern const struct rtw_chip_info rtw882
|
||||
#define BIT_FEN_EN BIT(26)
|
||||
#define REG_INIRTS_RATE_SEL 0x0480
|
||||
#define REG_HTSTFWT 0x800
|
||||
-#define REG_RXPSEL 0x808
|
||||
-#define BIT_RX_PSEL_RST (BIT(28) | BIT(29))
|
||||
-#define REG_TXPSEL 0x80c
|
||||
#define REG_RXCCAMSK 0x814
|
||||
-#define REG_CCASEL 0x82c
|
||||
-#define REG_PDMFTH 0x830
|
||||
-#define REG_CCA2ND 0x838
|
||||
#define REG_L1WT 0x83c
|
||||
#define REG_L1PKWT 0x840
|
||||
#define REG_MRC 0x850
|
||||
-#define REG_CLKTRK 0x860
|
||||
-#define REG_ADCCLK 0x8ac
|
||||
-#define REG_ADC160 0x8c4
|
||||
#define REG_ADC40 0x8c8
|
||||
#define REG_CHFIR 0x8f0
|
||||
#define REG_CDDTXP 0x93c
|
||||
@@ -234,14 +225,11 @@ extern const struct rtw_chip_info rtw882
|
||||
#define REG_ACBB0 0x948
|
||||
#define REG_ACBBRXFIR 0x94c
|
||||
#define REG_ACGG2TBL 0x958
|
||||
-#define REG_FAS 0x9a4
|
||||
-#define REG_RXSB 0xa00
|
||||
#define REG_ADCINI 0xa04
|
||||
#define REG_PWRTH 0xa08
|
||||
#define REG_CCA_FLTR 0xa20
|
||||
#define REG_TXSF2 0xa24
|
||||
#define REG_TXSF6 0xa28
|
||||
-#define REG_FA_CCK 0xa5c
|
||||
#define REG_RXDESC 0xa2c
|
||||
#define REG_ENTXCCK 0xa80
|
||||
#define BTG_LNA 0xfc84
|
||||
@@ -252,12 +240,8 @@ extern const struct rtw_chip_info rtw882
|
||||
#define REG_PWRTH2 0xaa8
|
||||
#define REG_CSRATIO 0xaaa
|
||||
#define REG_TXFILTER 0xaac
|
||||
-#define REG_CNTRST 0xb58
|
||||
#define REG_AGCTR_A 0xc08
|
||||
-#define REG_TXSCALE_A 0xc1c
|
||||
#define REG_TXDFIR 0xc20
|
||||
-#define REG_RXIGI_A 0xc50
|
||||
-#define REG_TXAGCIDX 0xc94
|
||||
#define REG_TRSW 0xca0
|
||||
#define REG_RFESEL0 0xcb0
|
||||
#define REG_RFESEL8 0xcb4
|
||||
@@ -269,14 +253,6 @@ extern const struct rtw_chip_info rtw882
|
||||
#define B_WLA_SWITCH BIT(23)
|
||||
#define REG_RFEINV 0xcbc
|
||||
#define REG_AGCTR_B 0xe08
|
||||
-#define REG_RXIGI_B 0xe50
|
||||
-#define REG_CRC_CCK 0xf04
|
||||
-#define REG_CRC_OFDM 0xf14
|
||||
-#define REG_CRC_HT 0xf10
|
||||
-#define REG_CRC_VHT 0xf0c
|
||||
-#define REG_CCA_OFDM 0xf08
|
||||
-#define REG_FA_OFDM 0xf48
|
||||
-#define REG_CCA_CCK 0xfcc
|
||||
#define REG_DMEM_CTRL 0x1080
|
||||
#define BIT_WL_RST BIT(16)
|
||||
#define REG_ANTWT 0x1904
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
|
||||
@@ -151,21 +151,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
|
||||
#define RTW8822B_EDCCA_MAX 0x7f
|
||||
#define RTW8822B_EDCCA_SRC_DEF 1
|
||||
#define REG_HTSTFWT 0x800
|
||||
-#define REG_RXPSEL 0x808
|
||||
-#define BIT_RX_PSEL_RST (BIT(28) | BIT(29))
|
||||
-#define REG_TXPSEL 0x80c
|
||||
#define REG_RXCCAMSK 0x814
|
||||
-#define REG_CCASEL 0x82c
|
||||
-#define REG_PDMFTH 0x830
|
||||
-#define REG_CCA2ND 0x838
|
||||
#define REG_L1WT 0x83c
|
||||
#define REG_L1PKWT 0x840
|
||||
#define REG_MRC 0x850
|
||||
-#define REG_CLKTRK 0x860
|
||||
#define REG_EDCCA_POW_MA 0x8a0
|
||||
#define BIT_MA_LEVEL GENMASK(1, 0)
|
||||
-#define REG_ADCCLK 0x8ac
|
||||
-#define REG_ADC160 0x8c4
|
||||
#define REG_ADC40 0x8c8
|
||||
#define REG_EDCCA_DECISION 0x8dc
|
||||
#define BIT_EDCCA_OPTION BIT(5)
|
||||
@@ -176,7 +167,6 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
|
||||
#define REG_ACBB0 0x948
|
||||
#define REG_ACBBRXFIR 0x94c
|
||||
#define REG_ACGG2TBL 0x958
|
||||
-#define REG_RXSB 0xa00
|
||||
#define REG_ADCINI 0xa04
|
||||
#define REG_TXSF2 0xa24
|
||||
#define REG_TXSF6 0xa28
|
||||
@@ -184,14 +174,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
|
||||
#define REG_ENTXCCK 0xa80
|
||||
#define REG_AGCTR_A 0xc08
|
||||
#define REG_TXDFIR 0xc20
|
||||
-#define REG_RXIGI_A 0xc50
|
||||
#define REG_TRSW 0xca0
|
||||
#define REG_RFESEL0 0xcb0
|
||||
#define REG_RFESEL8 0xcb4
|
||||
#define REG_RFECTL 0xcb8
|
||||
#define REG_RFEINV 0xcbc
|
||||
#define REG_AGCTR_B 0xe08
|
||||
-#define REG_RXIGI_B 0xe50
|
||||
#define REG_ANTWT 0x1904
|
||||
#define REG_IQKFAILMSK 0x1bf0
|
||||
|
@ -0,0 +1,93 @@
|
||||
From 87341ca1eac9a3bac23bd41f6e24f3c93b77452f Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:02:05 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Dump the HW features only for some chips
|
||||
|
||||
RTL8821AU and RTL8812AU don't support this. They hit the "failed to read
|
||||
hw feature report" error.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/8becd851-8760-4480-8e8c-c4869ce72507@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.c | 3 +++
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
|
||||
7 files changed, 9 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -1917,6 +1917,9 @@ static int rtw_dump_hw_feature(struct rt
|
||||
u8 bw;
|
||||
int i;
|
||||
|
||||
+ if (!rtwdev->chip->hw_feature_report)
|
||||
+ return 0;
|
||||
+
|
||||
id = rtw_read8(rtwdev, REG_C2HEVT);
|
||||
if (id != C2H_HW_FEATURE_REPORT) {
|
||||
rtw_err(rtwdev, "failed to read hw feature report\n");
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1200,6 +1200,7 @@ struct rtw_chip_info {
|
||||
const struct rtw_fwcd_segs *fwcd_segs;
|
||||
|
||||
u8 usb_tx_agg_desc_num;
|
||||
+ bool hw_feature_report;
|
||||
|
||||
u8 default_1ss_tx_path;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -1960,6 +1960,7 @@ const struct rtw_chip_info rtw8703b_hw_s
|
||||
.max_power_index = 0x3f,
|
||||
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
|
||||
.usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */
|
||||
+ .hw_feature_report = true,
|
||||
|
||||
.path_div_supported = false,
|
||||
.ht_supported = true,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -2131,6 +2131,7 @@ const struct rtw_chip_info rtw8723d_hw_s
|
||||
.page_size = TX_PAGE_SIZE,
|
||||
.dig_min = 0x20,
|
||||
.usb_tx_agg_desc_num = 1,
|
||||
+ .hw_feature_report = true,
|
||||
.ht_supported = true,
|
||||
.vht_supported = false,
|
||||
.lps_deep_mode_supported = 0,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -1968,6 +1968,7 @@ const struct rtw_chip_info rtw8821c_hw_s
|
||||
.page_size = TX_PAGE_SIZE,
|
||||
.dig_min = 0x1c,
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
+ .hw_feature_report = true,
|
||||
.ht_supported = true,
|
||||
.vht_supported = true,
|
||||
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -2509,6 +2509,7 @@ const struct rtw_chip_info rtw8822b_hw_s
|
||||
.page_size = TX_PAGE_SIZE,
|
||||
.dig_min = 0x1c,
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
+ .hw_feature_report = true,
|
||||
.ht_supported = true,
|
||||
.vht_supported = true,
|
||||
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -5329,6 +5329,7 @@ const struct rtw_chip_info rtw8822c_hw_s
|
||||
.page_size = TX_PAGE_SIZE,
|
||||
.dig_min = 0x20,
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
+ .hw_feature_report = true,
|
||||
.default_1ss_tx_path = BB_PATH_A,
|
||||
.path_div_supported = true,
|
||||
.ht_supported = true,
|
@ -0,0 +1,175 @@
|
||||
From d9018f4373517d4560ce2ebf12684f77f5fbdad6 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:06:14 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Allow different C2H RA report sizes
|
||||
|
||||
The RTL8821AU and RTL8812AU have smaller RA report size, only 4 bytes.
|
||||
Avoid the "invalid ra report c2h length" error.
|
||||
|
||||
Also, use a struct and u8_get_bits() to access the RA report C2H.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/c3e73c3a-fb2f-4013-9f06-d5274211e282@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/fw.c | 21 +++++++++++++------
|
||||
drivers/net/wireless/realtek/rtw88/fw.h | 17 +++++++++++----
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
|
||||
8 files changed, 34 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
@@ -139,25 +139,30 @@ static u16 get_max_amsdu_len(u32 bit_rat
|
||||
struct rtw_fw_iter_ra_data {
|
||||
struct rtw_dev *rtwdev;
|
||||
u8 *payload;
|
||||
+ u8 length;
|
||||
};
|
||||
|
||||
static void rtw_fw_ra_report_iter(void *data, struct ieee80211_sta *sta)
|
||||
{
|
||||
struct rtw_fw_iter_ra_data *ra_data = data;
|
||||
+ struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)ra_data->payload;
|
||||
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
|
||||
u8 mac_id, rate, sgi, bw;
|
||||
u8 mcs, nss;
|
||||
u32 bit_rate;
|
||||
|
||||
- mac_id = GET_RA_REPORT_MACID(ra_data->payload);
|
||||
+ mac_id = ra_rpt->mac_id;
|
||||
if (si->mac_id != mac_id)
|
||||
return;
|
||||
|
||||
si->ra_report.txrate.flags = 0;
|
||||
|
||||
- rate = GET_RA_REPORT_RATE(ra_data->payload);
|
||||
- sgi = GET_RA_REPORT_SGI(ra_data->payload);
|
||||
- bw = GET_RA_REPORT_BW(ra_data->payload);
|
||||
+ rate = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_RATE);
|
||||
+ sgi = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_SGI);
|
||||
+ if (ra_data->length >= offsetofend(typeof(*ra_rpt), bw))
|
||||
+ bw = ra_rpt->bw;
|
||||
+ else
|
||||
+ bw = si->bw_mode;
|
||||
|
||||
if (rate < DESC_RATEMCS0) {
|
||||
si->ra_report.txrate.legacy = rtw_desc_to_bitrate(rate);
|
||||
@@ -197,14 +202,18 @@ legacy:
|
||||
static void rtw_fw_ra_report_handle(struct rtw_dev *rtwdev, u8 *payload,
|
||||
u8 length)
|
||||
{
|
||||
+ struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)payload;
|
||||
struct rtw_fw_iter_ra_data ra_data;
|
||||
|
||||
- if (WARN(length < 7, "invalid ra report c2h length\n"))
|
||||
+ if (WARN(length < rtwdev->chip->c2h_ra_report_size,
|
||||
+ "invalid ra report c2h length %d\n", length))
|
||||
return;
|
||||
|
||||
- rtwdev->dm_info.tx_rate = GET_RA_REPORT_RATE(payload);
|
||||
+ rtwdev->dm_info.tx_rate = u8_get_bits(ra_rpt->rate_sgi,
|
||||
+ RTW_C2H_RA_RPT_RATE);
|
||||
ra_data.rtwdev = rtwdev;
|
||||
ra_data.payload = payload;
|
||||
+ ra_data.length = length;
|
||||
rtw_iterate_stas_atomic(rtwdev, rtw_fw_ra_report_iter, &ra_data);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/fw.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/fw.h
|
||||
@@ -85,6 +85,19 @@ struct rtw_c2h_adaptivity {
|
||||
u8 option;
|
||||
} __packed;
|
||||
|
||||
+struct rtw_c2h_ra_rpt {
|
||||
+ u8 rate_sgi;
|
||||
+ u8 mac_id;
|
||||
+ u8 byte2;
|
||||
+ u8 status;
|
||||
+ u8 byte4;
|
||||
+ u8 ra_ratio;
|
||||
+ u8 bw;
|
||||
+} __packed;
|
||||
+
|
||||
+#define RTW_C2H_RA_RPT_RATE GENMASK(6, 0)
|
||||
+#define RTW_C2H_RA_RPT_SGI BIT(7)
|
||||
+
|
||||
struct rtw_h2c_register {
|
||||
u32 w0;
|
||||
u32 w1;
|
||||
@@ -364,10 +377,6 @@ struct rtw_fw_hdr_legacy {
|
||||
#define GET_CHAN_SWITCH_CENTRAL_CH(c2h_payload) (c2h_payload[2])
|
||||
#define GET_CHAN_SWITCH_ID(c2h_payload) (c2h_payload[3])
|
||||
#define GET_CHAN_SWITCH_STATUS(c2h_payload) (c2h_payload[4])
|
||||
-#define GET_RA_REPORT_RATE(c2h_payload) (c2h_payload[0] & 0x7f)
|
||||
-#define GET_RA_REPORT_SGI(c2h_payload) ((c2h_payload[0] & 0x80) >> 7)
|
||||
-#define GET_RA_REPORT_BW(c2h_payload) (c2h_payload[6])
|
||||
-#define GET_RA_REPORT_MACID(c2h_payload) (c2h_payload[1])
|
||||
|
||||
#define GET_BCN_FILTER_NOTIFY_TYPE(c2h_payload) (c2h_payload[1] & 0xf)
|
||||
#define GET_BCN_FILTER_NOTIFY_EVENT(c2h_payload) (c2h_payload[1] & 0x10)
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1201,6 +1201,7 @@ struct rtw_chip_info {
|
||||
|
||||
u8 usb_tx_agg_desc_num;
|
||||
bool hw_feature_report;
|
||||
+ u8 c2h_ra_report_size;
|
||||
|
||||
u8 default_1ss_tx_path;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -1961,6 +1961,7 @@ const struct rtw_chip_info rtw8703b_hw_s
|
||||
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
|
||||
.usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */
|
||||
.hw_feature_report = true,
|
||||
+ .c2h_ra_report_size = 7,
|
||||
|
||||
.path_div_supported = false,
|
||||
.ht_supported = true,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -2132,6 +2132,7 @@ const struct rtw_chip_info rtw8723d_hw_s
|
||||
.dig_min = 0x20,
|
||||
.usb_tx_agg_desc_num = 1,
|
||||
.hw_feature_report = true,
|
||||
+ .c2h_ra_report_size = 7,
|
||||
.ht_supported = true,
|
||||
.vht_supported = false,
|
||||
.lps_deep_mode_supported = 0,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -1969,6 +1969,7 @@ const struct rtw_chip_info rtw8821c_hw_s
|
||||
.dig_min = 0x1c,
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
.hw_feature_report = true,
|
||||
+ .c2h_ra_report_size = 7,
|
||||
.ht_supported = true,
|
||||
.vht_supported = true,
|
||||
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -2510,6 +2510,7 @@ const struct rtw_chip_info rtw8822b_hw_s
|
||||
.dig_min = 0x1c,
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
.hw_feature_report = true,
|
||||
+ .c2h_ra_report_size = 7,
|
||||
.ht_supported = true,
|
||||
.vht_supported = true,
|
||||
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -5330,6 +5330,7 @@ const struct rtw_chip_info rtw8822c_hw_s
|
||||
.dig_min = 0x20,
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
.hw_feature_report = true,
|
||||
+ .c2h_ra_report_size = 7,
|
||||
.default_1ss_tx_path = BB_PATH_A,
|
||||
.path_div_supported = true,
|
||||
.ht_supported = true,
|
@ -0,0 +1,165 @@
|
||||
From 95a772e30b60e7954d03f3372268722475aa303f Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:08:24 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Extend the init table parsing for RTL8812AU
|
||||
|
||||
The chips supported so far only use the first condition, and so the
|
||||
parsing code ignores the second condition. RTL8812AU's init tables use
|
||||
the second condition also. Make the parsing code check it.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/1bee6b74-6eab-44a3-9f40-794ca006c72d@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 15 ++++++
|
||||
drivers/net/wireless/realtek/rtw88/phy.c | 62 ++++++++++++++++++++---
|
||||
2 files changed, 69 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1835,6 +1835,20 @@ struct rtw_phy_cond {
|
||||
#define BRANCH_ENDIF 3
|
||||
};
|
||||
|
||||
+struct rtw_phy_cond2 {
|
||||
+#ifdef __LITTLE_ENDIAN
|
||||
+ u8 type_glna;
|
||||
+ u8 type_gpa;
|
||||
+ u8 type_alna;
|
||||
+ u8 type_apa;
|
||||
+#else
|
||||
+ u8 type_apa;
|
||||
+ u8 type_alna;
|
||||
+ u8 type_gpa;
|
||||
+ u8 type_glna;
|
||||
+#endif
|
||||
+};
|
||||
+
|
||||
struct rtw_fifo_conf {
|
||||
/* tx fifo information */
|
||||
u16 rsvd_boundary;
|
||||
@@ -1916,6 +1930,7 @@ struct rtw_hal {
|
||||
u8 oem_id;
|
||||
u8 pkg_type;
|
||||
struct rtw_phy_cond phy_cond;
|
||||
+ struct rtw_phy_cond2 phy_cond2;
|
||||
bool rfe_btg;
|
||||
|
||||
u8 ps_mode;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
@@ -18,7 +18,10 @@ struct phy_cfg_pair {
|
||||
};
|
||||
|
||||
union phy_table_tile {
|
||||
- struct rtw_phy_cond cond;
|
||||
+ struct {
|
||||
+ struct rtw_phy_cond cond;
|
||||
+ struct rtw_phy_cond2 cond2;
|
||||
+ } __packed;
|
||||
struct phy_cfg_pair cfg;
|
||||
};
|
||||
|
||||
@@ -1041,7 +1044,8 @@ void rtw_phy_setup_phy_cond(struct rtw_d
|
||||
{
|
||||
struct rtw_hal *hal = &rtwdev->hal;
|
||||
struct rtw_efuse *efuse = &rtwdev->efuse;
|
||||
- struct rtw_phy_cond cond = {0};
|
||||
+ struct rtw_phy_cond cond = {};
|
||||
+ struct rtw_phy_cond2 cond2 = {};
|
||||
|
||||
cond.cut = hal->cut_version ? hal->cut_version : 15;
|
||||
cond.pkg = pkg ? pkg : 15;
|
||||
@@ -1061,15 +1065,34 @@ void rtw_phy_setup_phy_cond(struct rtw_d
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A ||
|
||||
+ rtwdev->chip->id == RTW_CHIP_TYPE_8821A) {
|
||||
+ cond.rfe = 0;
|
||||
+ cond.rfe |= efuse->ext_lna_2g;
|
||||
+ cond.rfe |= efuse->ext_pa_2g << 1;
|
||||
+ cond.rfe |= efuse->ext_lna_5g << 2;
|
||||
+ cond.rfe |= efuse->ext_pa_5g << 3;
|
||||
+ cond.rfe |= efuse->btcoex << 4;
|
||||
+
|
||||
+ cond2.type_alna = efuse->alna_type;
|
||||
+ cond2.type_glna = efuse->glna_type;
|
||||
+ cond2.type_apa = efuse->apa_type;
|
||||
+ cond2.type_gpa = efuse->gpa_type;
|
||||
+ }
|
||||
+
|
||||
hal->phy_cond = cond;
|
||||
+ hal->phy_cond2 = cond2;
|
||||
|
||||
- rtw_dbg(rtwdev, RTW_DBG_PHY, "phy cond=0x%08x\n", *((u32 *)&hal->phy_cond));
|
||||
+ rtw_dbg(rtwdev, RTW_DBG_PHY, "phy cond=0x%08x cond2=0x%08x\n",
|
||||
+ *((u32 *)&hal->phy_cond), *((u32 *)&hal->phy_cond2));
|
||||
}
|
||||
|
||||
-static bool check_positive(struct rtw_dev *rtwdev, struct rtw_phy_cond cond)
|
||||
+static bool check_positive(struct rtw_dev *rtwdev, struct rtw_phy_cond cond,
|
||||
+ struct rtw_phy_cond2 cond2)
|
||||
{
|
||||
struct rtw_hal *hal = &rtwdev->hal;
|
||||
struct rtw_phy_cond drv_cond = hal->phy_cond;
|
||||
+ struct rtw_phy_cond2 drv_cond2 = hal->phy_cond2;
|
||||
|
||||
if (cond.cut && cond.cut != drv_cond.cut)
|
||||
return false;
|
||||
@@ -1080,8 +1103,29 @@ static bool check_positive(struct rtw_de
|
||||
if (cond.intf && cond.intf != drv_cond.intf)
|
||||
return false;
|
||||
|
||||
- if (cond.rfe != drv_cond.rfe)
|
||||
- return false;
|
||||
+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A ||
|
||||
+ rtwdev->chip->id == RTW_CHIP_TYPE_8821A) {
|
||||
+ if (!(cond.rfe & 0x0f))
|
||||
+ return true;
|
||||
+
|
||||
+ if ((cond.rfe & drv_cond.rfe) != cond.rfe)
|
||||
+ return false;
|
||||
+
|
||||
+ if ((cond.rfe & BIT(0)) && cond2.type_glna != drv_cond2.type_glna)
|
||||
+ return false;
|
||||
+
|
||||
+ if ((cond.rfe & BIT(1)) && cond2.type_gpa != drv_cond2.type_gpa)
|
||||
+ return false;
|
||||
+
|
||||
+ if ((cond.rfe & BIT(2)) && cond2.type_alna != drv_cond2.type_alna)
|
||||
+ return false;
|
||||
+
|
||||
+ if ((cond.rfe & BIT(3)) && cond2.type_apa != drv_cond2.type_apa)
|
||||
+ return false;
|
||||
+ } else {
|
||||
+ if (cond.rfe != drv_cond.rfe)
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1090,7 +1134,8 @@ void rtw_parse_tbl_phy_cond(struct rtw_d
|
||||
{
|
||||
const union phy_table_tile *p = tbl->data;
|
||||
const union phy_table_tile *end = p + tbl->size / 2;
|
||||
- struct rtw_phy_cond pos_cond = {0};
|
||||
+ struct rtw_phy_cond pos_cond = {};
|
||||
+ struct rtw_phy_cond2 pos_cond2 = {};
|
||||
bool is_matched = true, is_skipped = false;
|
||||
|
||||
BUILD_BUG_ON(sizeof(union phy_table_tile) != sizeof(struct phy_cfg_pair));
|
||||
@@ -1109,11 +1154,12 @@ void rtw_parse_tbl_phy_cond(struct rtw_d
|
||||
case BRANCH_ELIF:
|
||||
default:
|
||||
pos_cond = p->cond;
|
||||
+ pos_cond2 = p->cond2;
|
||||
break;
|
||||
}
|
||||
} else if (p->cond.neg) {
|
||||
if (!is_skipped) {
|
||||
- if (check_positive(rtwdev, pos_cond)) {
|
||||
+ if (check_positive(rtwdev, pos_cond, pos_cond2)) {
|
||||
is_matched = true;
|
||||
is_skipped = true;
|
||||
} else {
|
@ -0,0 +1,58 @@
|
||||
From 7c5bbeba7c36575a3a57ef4be775b2f3fb68c3f9 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:09:04 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Allow rtw_chip_info.ltecoex_addr to be NULL
|
||||
|
||||
RTL8821A doesn't have this. Trying to use it results in error messages,
|
||||
so don't try if ltecoex_addr is NULL.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/d1004817-1760-41d1-9136-3d799757c444@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/coex.c | 14 +++++++++++---
|
||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/coex.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
|
||||
@@ -950,12 +950,18 @@ static void rtw_coex_coex_ctrl_owner(str
|
||||
|
||||
static void rtw_coex_set_gnt_bt(struct rtw_dev *rtwdev, u8 state)
|
||||
{
|
||||
+ if (!rtwdev->chip->ltecoex_addr)
|
||||
+ return;
|
||||
+
|
||||
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0xc000, state);
|
||||
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0c00, state);
|
||||
}
|
||||
|
||||
static void rtw_coex_set_gnt_wl(struct rtw_dev *rtwdev, u8 state)
|
||||
{
|
||||
+ if (!rtwdev->chip->ltecoex_addr)
|
||||
+ return;
|
||||
+
|
||||
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x3000, state);
|
||||
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0300, state);
|
||||
}
|
||||
@@ -3904,7 +3910,7 @@ void rtw_coex_display_coex_info(struct r
|
||||
u8 sys_lte;
|
||||
u16 score_board_WB, score_board_BW;
|
||||
u32 wl_reg_6c0, wl_reg_6c4, wl_reg_6c8, wl_reg_778, wl_reg_6cc;
|
||||
- u32 lte_coex, bt_coex;
|
||||
+ u32 lte_coex = 0, bt_coex = 0;
|
||||
int i;
|
||||
|
||||
score_board_BW = rtw_coex_read_scbd(rtwdev);
|
||||
@@ -3916,8 +3922,10 @@ void rtw_coex_display_coex_info(struct r
|
||||
wl_reg_778 = rtw_read8(rtwdev, REG_BT_STAT_CTRL);
|
||||
|
||||
sys_lte = rtw_read8(rtwdev, 0x73);
|
||||
- lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
|
||||
- bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
|
||||
+ if (rtwdev->chip->ltecoex_addr) {
|
||||
+ lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
|
||||
+ bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
|
||||
+ }
|
||||
|
||||
if (!coex_stat->wl_under_ips &&
|
||||
(!coex_stat->wl_under_lps || coex_stat->wl_force_lps_ctrl) &&
|
@ -0,0 +1,272 @@
|
||||
From fbb5e1b3637a720c83c91a7b1476ab0429bfc747 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:09:47 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Let each driver control the power on/off process
|
||||
|
||||
RTL8821AU and RTL8812AU have to do some things differently, so let
|
||||
them have full control.
|
||||
|
||||
The other chips use the same functions as before.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/98ab839f-9100-44ae-9551-9af743a4aa3a@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/coex.c | 3 +++
|
||||
drivers/net/wireless/realtek/rtw88/mac.c | 11 +++++++----
|
||||
drivers/net/wireless/realtek/rtw88/mac.h | 3 +++
|
||||
drivers/net/wireless/realtek/rtw88/main.c | 13 ++++++++-----
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 5 +++++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 ++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 2 ++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 ++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 ++
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 ++
|
||||
10 files changed, 36 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/coex.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
|
||||
@@ -2753,16 +2753,19 @@ void rtw_coex_power_on_setting(struct rt
|
||||
rtw_write8(rtwdev, 0xff1a, 0x0);
|
||||
rtw_coex_set_gnt_debug(rtwdev);
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_coex_power_on_setting);
|
||||
|
||||
void rtw_coex_power_off_setting(struct rtw_dev *rtwdev)
|
||||
{
|
||||
rtw_write16(rtwdev, REG_WIFI_BT_INFO, BIT_BT_INT_EN);
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_coex_power_off_setting);
|
||||
|
||||
void rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only)
|
||||
{
|
||||
__rtw_coex_init_hw_config(rtwdev, wifi_only);
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_coex_init_hw_config);
|
||||
|
||||
void rtw_coex_ips_notify(struct rtw_dev *rtwdev, u8 type)
|
||||
{
|
||||
--- a/drivers/net/wireless/realtek/rtw88/mac.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
|
||||
@@ -227,8 +227,8 @@ static int rtw_sub_pwr_seq_parser(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
|
||||
- const struct rtw_pwr_seq_cmd * const *cmd_seq)
|
||||
+int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
|
||||
+ const struct rtw_pwr_seq_cmd * const *cmd_seq)
|
||||
{
|
||||
u8 cut_mask;
|
||||
u8 intf_mask;
|
||||
@@ -267,6 +267,7 @@ static int rtw_pwr_seq_parser(struct rtw
|
||||
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_pwr_seq_parser);
|
||||
|
||||
static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
|
||||
{
|
||||
@@ -994,6 +995,7 @@ int rtw_download_firmware(struct rtw_dev
|
||||
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_download_firmware);
|
||||
|
||||
static u32 get_priority_queues(struct rtw_dev *rtwdev, u32 queues)
|
||||
{
|
||||
@@ -1127,7 +1129,7 @@ static int txdma_queue_mapping(struct rt
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int set_trx_fifo_info(struct rtw_dev *rtwdev)
|
||||
+int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev)
|
||||
{
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
struct rtw_fifo_conf *fifo = &rtwdev->fifo;
|
||||
@@ -1179,6 +1181,7 @@ static int set_trx_fifo_info(struct rtw_
|
||||
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_set_trx_fifo_info);
|
||||
|
||||
static int __priority_queue_cfg(struct rtw_dev *rtwdev,
|
||||
const struct rtw_page_table *pg_tbl,
|
||||
@@ -1256,7 +1259,7 @@ static int priority_queue_cfg(struct rtw
|
||||
u16 pubq_num;
|
||||
int ret;
|
||||
|
||||
- ret = set_trx_fifo_info(rtwdev);
|
||||
+ ret = rtw_set_trx_fifo_info(rtwdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/mac.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/mac.h
|
||||
@@ -30,11 +30,14 @@
|
||||
|
||||
void rtw_set_channel_mac(struct rtw_dev *rtwdev, u8 channel, u8 bw,
|
||||
u8 primary_ch_idx);
|
||||
+int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
|
||||
+ const struct rtw_pwr_seq_cmd * const *cmd_seq);
|
||||
int rtw_mac_power_on(struct rtw_dev *rtwdev);
|
||||
void rtw_mac_power_off(struct rtw_dev *rtwdev);
|
||||
int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw);
|
||||
int rtw_mac_init(struct rtw_dev *rtwdev);
|
||||
void rtw_mac_flush_queues(struct rtw_dev *rtwdev, u32 queues, bool drop);
|
||||
+int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev);
|
||||
int rtw_ddma_to_fw_fifo(struct rtw_dev *rtwdev, u32 ocp_src, u32 size);
|
||||
|
||||
static inline void rtw_mac_flush_all_queues(struct rtw_dev *rtwdev, bool drop)
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -1309,7 +1309,7 @@ void rtw_update_sta_info(struct rtw_dev
|
||||
rtw_fw_send_ra_info(rtwdev, si, reset_ra_mask);
|
||||
}
|
||||
|
||||
-static int rtw_wait_firmware_completion(struct rtw_dev *rtwdev)
|
||||
+int rtw_wait_firmware_completion(struct rtw_dev *rtwdev)
|
||||
{
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
struct rtw_fw_state *fw;
|
||||
@@ -1329,6 +1329,7 @@ static int rtw_wait_firmware_completion(
|
||||
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_wait_firmware_completion);
|
||||
|
||||
static enum rtw_lps_deep_mode rtw_update_lps_deep_mode(struct rtw_dev *rtwdev,
|
||||
struct rtw_fw_state *fw)
|
||||
@@ -1350,7 +1351,7 @@ static enum rtw_lps_deep_mode rtw_update
|
||||
return LPS_DEEP_MODE_NONE;
|
||||
}
|
||||
|
||||
-static int rtw_power_on(struct rtw_dev *rtwdev)
|
||||
+int rtw_power_on(struct rtw_dev *rtwdev)
|
||||
{
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
struct rtw_fw_state *fw = &rtwdev->fw;
|
||||
@@ -1413,6 +1414,7 @@ err_off:
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_power_on);
|
||||
|
||||
void rtw_core_fw_scan_notify(struct rtw_dev *rtwdev, bool start)
|
||||
{
|
||||
@@ -1485,7 +1487,7 @@ int rtw_core_start(struct rtw_dev *rtwde
|
||||
{
|
||||
int ret;
|
||||
|
||||
- ret = rtw_power_on(rtwdev);
|
||||
+ ret = rtwdev->chip->ops->power_on(rtwdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1505,12 +1507,13 @@ int rtw_core_start(struct rtw_dev *rtwde
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void rtw_power_off(struct rtw_dev *rtwdev)
|
||||
+void rtw_power_off(struct rtw_dev *rtwdev)
|
||||
{
|
||||
rtw_hci_stop(rtwdev);
|
||||
rtw_coex_power_off_setting(rtwdev);
|
||||
rtw_mac_power_off(rtwdev);
|
||||
}
|
||||
+EXPORT_SYMBOL(rtw_power_off);
|
||||
|
||||
void rtw_core_stop(struct rtw_dev *rtwdev)
|
||||
{
|
||||
@@ -1535,7 +1538,7 @@ void rtw_core_stop(struct rtw_dev *rtwde
|
||||
|
||||
mutex_lock(&rtwdev->mutex);
|
||||
|
||||
- rtw_power_off(rtwdev);
|
||||
+ rtwdev->chip->ops->power_off(rtwdev);
|
||||
}
|
||||
|
||||
static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -843,6 +843,8 @@ struct rtw_regd {
|
||||
};
|
||||
|
||||
struct rtw_chip_ops {
|
||||
+ int (*power_on)(struct rtw_dev *rtwdev);
|
||||
+ void (*power_off)(struct rtw_dev *rtwdev);
|
||||
int (*mac_init)(struct rtw_dev *rtwdev);
|
||||
int (*dump_fw_crash)(struct rtw_dev *rtwdev);
|
||||
void (*shutdown)(struct rtw_dev *rtwdev);
|
||||
@@ -2209,6 +2211,7 @@ void rtw_core_scan_start(struct rtw_dev
|
||||
void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
|
||||
bool hw_scan);
|
||||
int rtw_core_start(struct rtw_dev *rtwdev);
|
||||
+void rtw_power_off(struct rtw_dev *rtwdev);
|
||||
void rtw_core_stop(struct rtw_dev *rtwdev);
|
||||
int rtw_chip_info_setup(struct rtw_dev *rtwdev);
|
||||
int rtw_core_init(struct rtw_dev *rtwdev);
|
||||
@@ -2223,6 +2226,8 @@ int rtw_sta_add(struct rtw_dev *rtwdev,
|
||||
void rtw_sta_remove(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
|
||||
bool fw_exist);
|
||||
void rtw_fw_recovery(struct rtw_dev *rtwdev);
|
||||
+int rtw_wait_firmware_completion(struct rtw_dev *rtwdev);
|
||||
+int rtw_power_on(struct rtw_dev *rtwdev);
|
||||
void rtw_core_fw_scan_notify(struct rtw_dev *rtwdev, bool start);
|
||||
int rtw_dump_fw(struct rtw_dev *rtwdev, const u32 ocp_src, u32 size,
|
||||
u32 fwcd_item);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -1888,6 +1888,8 @@ static const struct coex_tdma_para tdma_
|
||||
};
|
||||
|
||||
static const struct rtw_chip_ops rtw8703b_ops = {
|
||||
+ .power_on = rtw_power_on,
|
||||
+ .power_off = rtw_power_off,
|
||||
.mac_init = rtw8723x_mac_init,
|
||||
.dump_fw_crash = NULL,
|
||||
.shutdown = NULL,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -1390,6 +1390,8 @@ static void rtw8723d_pwr_track(struct rt
|
||||
}
|
||||
|
||||
static const struct rtw_chip_ops rtw8723d_ops = {
|
||||
+ .power_on = rtw_power_on,
|
||||
+ .power_off = rtw_power_off,
|
||||
.phy_set_param = rtw8723d_phy_set_param,
|
||||
.read_efuse = rtw8723x_read_efuse,
|
||||
.query_phy_status = query_phy_status,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -1643,6 +1643,8 @@ static const struct rtw_prioq_addrs prio
|
||||
};
|
||||
|
||||
static const struct rtw_chip_ops rtw8821c_ops = {
|
||||
+ .power_on = rtw_power_on,
|
||||
+ .power_off = rtw_power_off,
|
||||
.phy_set_param = rtw8821c_phy_set_param,
|
||||
.read_efuse = rtw8821c_read_efuse,
|
||||
.query_phy_status = query_phy_status,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -2132,6 +2132,8 @@ static const struct rtw_prioq_addrs prio
|
||||
};
|
||||
|
||||
static const struct rtw_chip_ops rtw8822b_ops = {
|
||||
+ .power_on = rtw_power_on,
|
||||
+ .power_off = rtw_power_off,
|
||||
.phy_set_param = rtw8822b_phy_set_param,
|
||||
.read_efuse = rtw8822b_read_efuse,
|
||||
.query_phy_status = query_phy_status,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -4947,6 +4947,8 @@ static const struct rtw_prioq_addrs prio
|
||||
};
|
||||
|
||||
static const struct rtw_chip_ops rtw8822c_ops = {
|
||||
+ .power_on = rtw_power_on,
|
||||
+ .power_off = rtw_power_off,
|
||||
.phy_set_param = rtw8822c_phy_set_param,
|
||||
.read_efuse = rtw8822c_read_efuse,
|
||||
.query_phy_status = query_phy_status,
|
@ -0,0 +1,194 @@
|
||||
From c7706b1173c77185a2ef40c7d1811021566563f3 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:10:32 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Enable data rate fallback for older chips
|
||||
|
||||
RTL8811AU fails to perform the 4-way handshake when the AP is too far
|
||||
because it transmits the EAPOL frames at MCS9 and when that doesn't
|
||||
work it retries 48 times with the same rate, to no avail.
|
||||
|
||||
Retrying 48 times with the same rate seems pointless. Set the
|
||||
appropriate field in the TX descriptor to allow it to use lower rates
|
||||
when retrying.
|
||||
|
||||
Set it for RTL8723D and RTL8703B because they interpret this field the
|
||||
same way as RTL8811A.
|
||||
|
||||
The newer RTL8822C, RTL8822B, RTL8821C seem to interpret this field in
|
||||
the TX descriptor differently, so leave it alone for those chips.
|
||||
|
||||
Tested with RTL8811AU and RTL8723DU.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/pci.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
|
||||
drivers/net/wireless/realtek/rtw88/sdio.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/tx.c | 6 +++++-
|
||||
drivers/net/wireless/realtek/rtw88/tx.h | 4 +++-
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 4 ++--
|
||||
12 files changed, 19 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
@@ -1290,7 +1290,7 @@ static void rtw_fill_rsvd_page_desc(stru
|
||||
rtw_tx_rsvd_page_pkt_info_update(rtwdev, &pkt_info, skb, type);
|
||||
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
|
||||
memset(pkt_desc, 0, chip->tx_pkt_desc_sz);
|
||||
- rtw_tx_fill_tx_desc(&pkt_info, skb);
|
||||
+ rtw_tx_fill_tx_desc(rtwdev, &pkt_info, skb);
|
||||
}
|
||||
|
||||
static inline u8 rtw_len_to_page(unsigned int len, u8 page_size)
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1204,6 +1204,7 @@ struct rtw_chip_info {
|
||||
u8 usb_tx_agg_desc_num;
|
||||
bool hw_feature_report;
|
||||
u8 c2h_ra_report_size;
|
||||
+ bool old_datarate_fb_limit;
|
||||
|
||||
u8 default_1ss_tx_path;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
|
||||
@@ -824,7 +824,7 @@ static int rtw_pci_tx_write_data(struct
|
||||
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
|
||||
memset(pkt_desc, 0, tx_pkt_desc_sz);
|
||||
pkt_info->qsel = rtw_pci_get_tx_qsel(skb, queue);
|
||||
- rtw_tx_fill_tx_desc(pkt_info, skb);
|
||||
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
|
||||
dma = dma_map_single(&rtwpci->pdev->dev, skb->data, skb->len,
|
||||
DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&rtwpci->pdev->dev, dma))
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -1964,6 +1964,7 @@ const struct rtw_chip_info rtw8703b_hw_s
|
||||
.usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */
|
||||
.hw_feature_report = true,
|
||||
.c2h_ra_report_size = 7,
|
||||
+ .old_datarate_fb_limit = true,
|
||||
|
||||
.path_div_supported = false,
|
||||
.ht_supported = true,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -2135,6 +2135,7 @@ const struct rtw_chip_info rtw8723d_hw_s
|
||||
.usb_tx_agg_desc_num = 1,
|
||||
.hw_feature_report = true,
|
||||
.c2h_ra_report_size = 7,
|
||||
+ .old_datarate_fb_limit = true,
|
||||
.ht_supported = true,
|
||||
.vht_supported = false,
|
||||
.lps_deep_mode_supported = 0,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -1972,6 +1972,7 @@ const struct rtw_chip_info rtw8821c_hw_s
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
.hw_feature_report = true,
|
||||
.c2h_ra_report_size = 7,
|
||||
+ .old_datarate_fb_limit = false,
|
||||
.ht_supported = true,
|
||||
.vht_supported = true,
|
||||
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -2513,6 +2513,7 @@ const struct rtw_chip_info rtw8822b_hw_s
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
.hw_feature_report = true,
|
||||
.c2h_ra_report_size = 7,
|
||||
+ .old_datarate_fb_limit = false,
|
||||
.ht_supported = true,
|
||||
.vht_supported = true,
|
||||
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -5333,6 +5333,7 @@ const struct rtw_chip_info rtw8822c_hw_s
|
||||
.usb_tx_agg_desc_num = 3,
|
||||
.hw_feature_report = true,
|
||||
.c2h_ra_report_size = 7,
|
||||
+ .old_datarate_fb_limit = false,
|
||||
.default_1ss_tx_path = BB_PATH_A,
|
||||
.path_div_supported = true,
|
||||
.ht_supported = true,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -864,7 +864,7 @@ static void rtw_sdio_tx_skb_prepare(stru
|
||||
|
||||
pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue);
|
||||
|
||||
- rtw_tx_fill_tx_desc(pkt_info, skb);
|
||||
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
|
||||
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, pkt_desc);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/tx.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
|
||||
@@ -32,7 +32,8 @@ void rtw_tx_stats(struct rtw_dev *rtwdev
|
||||
}
|
||||
}
|
||||
|
||||
-void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb)
|
||||
+void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev,
|
||||
+ struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb)
|
||||
{
|
||||
struct rtw_tx_desc *tx_desc = (struct rtw_tx_desc *)skb->data;
|
||||
bool more_data = false;
|
||||
@@ -67,6 +68,9 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p
|
||||
|
||||
tx_desc->w4 = le32_encode_bits(pkt_info->rate, RTW_TX_DESC_W4_DATARATE);
|
||||
|
||||
+ if (rtwdev->chip->old_datarate_fb_limit)
|
||||
+ tx_desc->w4 |= le32_encode_bits(0x1f, RTW_TX_DESC_W4_DATARATE_FB_LIMIT);
|
||||
+
|
||||
tx_desc->w5 = le32_encode_bits(pkt_info->short_gi, RTW_TX_DESC_W5_DATA_SHORT) |
|
||||
le32_encode_bits(pkt_info->bw, RTW_TX_DESC_W5_DATA_BW) |
|
||||
le32_encode_bits(pkt_info->ldpc, RTW_TX_DESC_W5_DATA_LDPC) |
|
||||
--- a/drivers/net/wireless/realtek/rtw88/tx.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/tx.h
|
||||
@@ -44,6 +44,7 @@ struct rtw_tx_desc {
|
||||
#define RTW_TX_DESC_W3_NAVUSEHDR BIT(15)
|
||||
#define RTW_TX_DESC_W3_MAX_AGG_NUM GENMASK(21, 17)
|
||||
#define RTW_TX_DESC_W4_DATARATE GENMASK(6, 0)
|
||||
+#define RTW_TX_DESC_W4_DATARATE_FB_LIMIT GENMASK(12, 8)
|
||||
#define RTW_TX_DESC_W4_RTSRATE GENMASK(28, 24)
|
||||
#define RTW_TX_DESC_W5_DATA_SHORT BIT(4)
|
||||
#define RTW_TX_DESC_W5_DATA_BW GENMASK(6, 5)
|
||||
@@ -94,7 +95,8 @@ void rtw_tx_pkt_info_update(struct rtw_d
|
||||
struct rtw_tx_pkt_info *pkt_info,
|
||||
struct ieee80211_sta *sta,
|
||||
struct sk_buff *skb);
|
||||
-void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb);
|
||||
+void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev,
|
||||
+ struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb);
|
||||
void rtw_tx_report_enqueue(struct rtw_dev *rtwdev, struct sk_buff *skb, u8 sn);
|
||||
void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src);
|
||||
void rtw_tx_rsvd_page_pkt_info_update(struct rtw_dev *rtwdev,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -457,7 +457,7 @@ static int rtw_usb_write_data(struct rtw
|
||||
skb_put_data(skb, buf, size);
|
||||
skb_push(skb, chip->tx_pkt_desc_sz);
|
||||
memset(skb->data, 0, chip->tx_pkt_desc_sz);
|
||||
- rtw_tx_fill_tx_desc(pkt_info, skb);
|
||||
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
|
||||
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data);
|
||||
|
||||
ret = rtw_usb_write_port(rtwdev, qsel, skb,
|
||||
@@ -524,7 +524,7 @@ static int rtw_usb_tx_write(struct rtw_d
|
||||
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
|
||||
memset(pkt_desc, 0, chip->tx_pkt_desc_sz);
|
||||
ep = qsel_to_ep(rtwusb, pkt_info->qsel);
|
||||
- rtw_tx_fill_tx_desc(pkt_info, skb);
|
||||
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
|
||||
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data);
|
||||
tx_data = rtw_usb_get_tx_data(skb);
|
||||
tx_data->sn = pkt_info->sn;
|
@ -0,0 +1,85 @@
|
||||
From abb0f19492ba6289ffba6ec1057c0426240958af Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:10:54 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Make txagc_remnant_ofdm an array
|
||||
|
||||
txagc_remnant_ofdm member of struct rtw_dm_info should be different for
|
||||
each RF path, so make it an array of size RTW_RF_PATH_MAX (4).
|
||||
|
||||
Until now all the chips using this had only one RF path, but RTL8812AU
|
||||
has two, and RTL8814AU has four.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/68571ba9-e504-4b2d-bfa1-62f468753649@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/phy.c | 4 ++--
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 4 ++--
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 4 ++--
|
||||
4 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1715,7 +1715,7 @@ struct rtw_dm_info {
|
||||
bool pwr_trk_init_trigger;
|
||||
struct ewma_thermal avg_thermal[RTW_RF_PATH_MAX];
|
||||
s8 txagc_remnant_cck;
|
||||
- s8 txagc_remnant_ofdm;
|
||||
+ s8 txagc_remnant_ofdm[RTW_RF_PATH_MAX];
|
||||
u8 rx_cck_agc_report_type;
|
||||
|
||||
/* backup dack results for each path and I/Q */
|
||||
--- a/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
@@ -2169,8 +2169,8 @@ void rtw_get_tx_power_params(struct rtw_
|
||||
|
||||
*limit = rtw_phy_get_tx_power_limit(rtwdev, band, bw, path,
|
||||
rate, ch, regd);
|
||||
- *remnant = (rate <= DESC_RATE11M ? dm_info->txagc_remnant_cck :
|
||||
- dm_info->txagc_remnant_ofdm);
|
||||
+ *remnant = rate <= DESC_RATE11M ? dm_info->txagc_remnant_cck :
|
||||
+ dm_info->txagc_remnant_ofdm[path];
|
||||
*sar = rtw_phy_get_tx_power_sar(rtwdev, hal->sar_band, path, rate);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -637,7 +637,7 @@ static void rtw8703b_pwrtrack_init(struc
|
||||
dm_info->pwr_trk_init_trigger = true;
|
||||
dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k;
|
||||
dm_info->txagc_remnant_cck = 0;
|
||||
- dm_info->txagc_remnant_ofdm = 0;
|
||||
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = 0;
|
||||
}
|
||||
|
||||
static void rtw8703b_phy_set_param(struct rtw_dev *rtwdev)
|
||||
@@ -1589,7 +1589,7 @@ static void rtw8703b_pwrtrack_set_ofdm_p
|
||||
{
|
||||
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||
|
||||
- dm_info->txagc_remnant_ofdm = txagc_idx;
|
||||
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = txagc_idx;
|
||||
|
||||
/* Only path A is calibrated for rtl8703b */
|
||||
rtw8703b_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_A);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -79,7 +79,7 @@ static void rtw8723d_pwrtrack_init(struc
|
||||
dm_info->pwr_trk_init_trigger = true;
|
||||
dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k;
|
||||
dm_info->txagc_remnant_cck = 0;
|
||||
- dm_info->txagc_remnant_ofdm = 0;
|
||||
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = 0;
|
||||
}
|
||||
|
||||
static void rtw8723d_phy_set_param(struct rtw_dev *rtwdev)
|
||||
@@ -1265,7 +1265,7 @@ static void rtw8723d_pwrtrack_set_ofdm_p
|
||||
{
|
||||
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||
|
||||
- dm_info->txagc_remnant_ofdm = txagc_idx;
|
||||
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = txagc_idx;
|
||||
|
||||
rtw8723d_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_A);
|
||||
rtw8723d_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_B);
|
@ -0,0 +1,115 @@
|
||||
From 82a617413e8545775ec03a1970809ac5f549ef32 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:12:06 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Support TX page sizes bigger than 128
|
||||
|
||||
All the chips supported so far have a TX page size of 128 bytes.
|
||||
|
||||
Change the type of the page_size member of struct rtw_chip_info from u8
|
||||
to u16 in order to support RTL8821AU (page size of 256 bytes) and
|
||||
RTL8812AU (page size of 512 bytes). Also change the types of several
|
||||
related variables and function parameters from u8 to u16.
|
||||
|
||||
The TX page size is used, among other things, to construct the beacon,
|
||||
null data, QOS null data, and PS poll templates which are uploaded to
|
||||
the chip's reserved page. Each template needs to be aligned on a
|
||||
multiple of the TX page size. Power saving can't work if the TX page
|
||||
size is wrong.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/acdefbb1-3daf-4349-9e03-9472754d5f1e@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/debug.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/fw.c | 21 +++++++++++----------
|
||||
drivers/net/wireless/realtek/rtw88/mac.c | 2 +-
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 2 +-
|
||||
4 files changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/debug.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
|
||||
@@ -308,7 +308,7 @@ static int rtw_debugfs_get_rsvd_page(str
|
||||
{
|
||||
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
||||
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
||||
- u8 page_size = rtwdev->chip->page_size;
|
||||
+ u16 page_size = rtwdev->chip->page_size;
|
||||
u32 buf_size = debugfs_priv->rsvd_page.page_num * page_size;
|
||||
u32 offset = debugfs_priv->rsvd_page.page_offset * page_size;
|
||||
u8 *buf;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
|
||||
@@ -1293,13 +1293,13 @@ static void rtw_fill_rsvd_page_desc(stru
|
||||
rtw_tx_fill_tx_desc(rtwdev, &pkt_info, skb);
|
||||
}
|
||||
|
||||
-static inline u8 rtw_len_to_page(unsigned int len, u8 page_size)
|
||||
+static inline u8 rtw_len_to_page(unsigned int len, u16 page_size)
|
||||
{
|
||||
return DIV_ROUND_UP(len, page_size);
|
||||
}
|
||||
|
||||
-static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u8 page_size,
|
||||
- u8 page_margin, u32 page, u8 *buf,
|
||||
+static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u16 page_size,
|
||||
+ u16 page_margin, u32 page, u8 *buf,
|
||||
struct rtw_rsvd_page *rsvd_pkt)
|
||||
{
|
||||
struct sk_buff *skb = rsvd_pkt->skb;
|
||||
@@ -1601,13 +1601,13 @@ static int __rtw_build_rsvd_page_from_v
|
||||
|
||||
static u8 *rtw_build_rsvd_page(struct rtw_dev *rtwdev, u32 *size)
|
||||
{
|
||||
- struct ieee80211_hw *hw = rtwdev->hw;
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
- struct sk_buff *iter;
|
||||
+ struct ieee80211_hw *hw = rtwdev->hw;
|
||||
struct rtw_rsvd_page *rsvd_pkt;
|
||||
- u32 page = 0;
|
||||
+ struct sk_buff *iter;
|
||||
+ u16 page_size, page_margin, tx_desc_sz;
|
||||
u8 total_page = 0;
|
||||
- u8 page_size, page_margin, tx_desc_sz;
|
||||
+ u32 page = 0;
|
||||
u8 *buf;
|
||||
int ret;
|
||||
|
||||
@@ -2013,12 +2013,13 @@ static int _rtw_hw_scan_update_probe_req
|
||||
{
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
struct sk_buff *skb, *tmp;
|
||||
- u8 page_offset = 1, *buf, page_size = chip->page_size;
|
||||
u16 pg_addr = rtwdev->fifo.rsvd_h2c_info_addr, loc;
|
||||
- u16 buf_offset = page_size * page_offset;
|
||||
u8 tx_desc_sz = chip->tx_pkt_desc_sz;
|
||||
- u8 page_cnt, pages;
|
||||
+ u16 page_size = chip->page_size;
|
||||
+ u8 page_offset = 1, *buf;
|
||||
+ u16 buf_offset = page_size * page_offset;
|
||||
unsigned int pkt_len;
|
||||
+ u8 page_cnt, pages;
|
||||
int ret;
|
||||
|
||||
if (rtw_fw_feature_ext_check(&rtwdev->fw, FW_FEATURE_EXT_OLD_PAGE_NUM))
|
||||
--- a/drivers/net/wireless/realtek/rtw88/mac.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
|
||||
@@ -1138,7 +1138,7 @@ int rtw_set_trx_fifo_info(struct rtw_dev
|
||||
|
||||
/* config rsvd page num */
|
||||
fifo->rsvd_drv_pg_num = chip->rsvd_drv_pg_num;
|
||||
- fifo->txff_pg_num = chip->txff_size >> 7;
|
||||
+ fifo->txff_pg_num = chip->txff_size / chip->page_size;
|
||||
if (rtw_chip_wcpu_11n(rtwdev))
|
||||
fifo->rsvd_pg_num = fifo->rsvd_drv_pg_num;
|
||||
else
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1187,7 +1187,7 @@ struct rtw_chip_info {
|
||||
u32 fw_rxff_size;
|
||||
u16 rsvd_drv_pg_num;
|
||||
u8 band;
|
||||
- u8 page_size;
|
||||
+ u16 page_size;
|
||||
u8 csi_buf_pg_num;
|
||||
u8 dig_max;
|
||||
u8 dig_min;
|
@ -0,0 +1,297 @@
|
||||
From 67d915604e6993ff627ac001983a2de63ff71b13 Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:12:39 +0300
|
||||
Subject: [PATCH] wifi: rtw88: Move pwr_track_tbl to struct rtw_rfe_def
|
||||
|
||||
RTL8812AU uses one set of TX power tracking tables for RFE 3, and
|
||||
another set for everything else.
|
||||
|
||||
Move pwr_track_tbl from struct rtw_chip_info to struct rtw_rfe_def in
|
||||
order to load the right set of tables for each RFE (RF front end) type.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/904d0ab1-c046-40cd-a3a3-d4fdcf663c9d@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/main.h | 8 ++++---
|
||||
drivers/net/wireless/realtek/rtw88/phy.c | 3 ++-
|
||||
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 12 +++++-----
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 12 +++++-----
|
||||
drivers/net/wireless/realtek/rtw88/rtw8723x.c | 3 ++-
|
||||
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 17 +++++++-------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 15 ++++++------
|
||||
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 23 +++++++++----------
|
||||
8 files changed, 47 insertions(+), 46 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
||||
@@ -1099,17 +1099,20 @@ enum rtw_rfe_fem {
|
||||
struct rtw_rfe_def {
|
||||
const struct rtw_table *phy_pg_tbl;
|
||||
const struct rtw_table *txpwr_lmt_tbl;
|
||||
+ const struct rtw_pwr_track_tbl *pwr_track_tbl;
|
||||
const struct rtw_table *agc_btg_tbl;
|
||||
};
|
||||
|
||||
-#define RTW_DEF_RFE(chip, bb_pg, pwrlmt) { \
|
||||
+#define RTW_DEF_RFE(chip, bb_pg, pwrlmt, track) { \
|
||||
.phy_pg_tbl = &rtw ## chip ## _bb_pg_type ## bb_pg ## _tbl, \
|
||||
.txpwr_lmt_tbl = &rtw ## chip ## _txpwr_lmt_type ## pwrlmt ## _tbl, \
|
||||
+ .pwr_track_tbl = &rtw ## chip ## _pwr_track_type ## track ## _tbl, \
|
||||
}
|
||||
|
||||
-#define RTW_DEF_RFE_EXT(chip, bb_pg, pwrlmt, btg) { \
|
||||
+#define RTW_DEF_RFE_EXT(chip, bb_pg, pwrlmt, track, btg) { \
|
||||
.phy_pg_tbl = &rtw ## chip ## _bb_pg_type ## bb_pg ## _tbl, \
|
||||
.txpwr_lmt_tbl = &rtw ## chip ## _txpwr_lmt_type ## pwrlmt ## _tbl, \
|
||||
+ .pwr_track_tbl = &rtw ## chip ## _pwr_track_type ## track ## _tbl, \
|
||||
.agc_btg_tbl = &rtw ## chip ## _agc_btg_type ## btg ## _tbl, \
|
||||
}
|
||||
|
||||
@@ -1243,7 +1246,6 @@ struct rtw_chip_info {
|
||||
u16 dpd_ratemask;
|
||||
u8 iqk_threshold;
|
||||
u8 lck_threshold;
|
||||
- const struct rtw_pwr_track_tbl *pwr_track_tbl;
|
||||
|
||||
u8 bfer_su_max_num;
|
||||
u8 bfer_mu_max_num;
|
||||
--- a/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
|
||||
@@ -2384,7 +2384,8 @@ void rtw_phy_init_tx_power(struct rtw_de
|
||||
void rtw_phy_config_swing_table(struct rtw_dev *rtwdev,
|
||||
struct rtw_swing_table *swing_table)
|
||||
{
|
||||
- const struct rtw_pwr_track_tbl *tbl = rtwdev->chip->pwr_track_tbl;
|
||||
+ const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev);
|
||||
+ const struct rtw_pwr_track_tbl *tbl = rfe_def->pwr_track_tbl;
|
||||
u8 channel = rtwdev->hal.current_channel;
|
||||
|
||||
if (IS_CH_2G_BAND(channel)) {
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
|
||||
@@ -493,11 +493,6 @@ static const struct rtw_pwr_seq_cmd * co
|
||||
NULL
|
||||
};
|
||||
|
||||
-static const struct rtw_rfe_def rtw8703b_rfe_defs[] = {
|
||||
- [0] = { .phy_pg_tbl = &rtw8703b_bb_pg_tbl,
|
||||
- .txpwr_lmt_tbl = &rtw8703b_txpwr_lmt_tbl,},
|
||||
-};
|
||||
-
|
||||
static const struct rtw_page_table page_table_8703b[] = {
|
||||
{12, 2, 2, 0, 1},
|
||||
{12, 2, 2, 0, 1},
|
||||
@@ -1818,6 +1813,12 @@ static const struct rtw_pwr_track_tbl rt
|
||||
.pwrtrk_xtal_p = rtw8703b_pwrtrk_xtal_p,
|
||||
};
|
||||
|
||||
+static const struct rtw_rfe_def rtw8703b_rfe_defs[] = {
|
||||
+ [0] = { .phy_pg_tbl = &rtw8703b_bb_pg_tbl,
|
||||
+ .txpwr_lmt_tbl = &rtw8703b_txpwr_lmt_tbl,
|
||||
+ .pwr_track_tbl = &rtw8703b_rtw_pwr_track_tbl, },
|
||||
+};
|
||||
+
|
||||
/* Shared-Antenna Coex Table */
|
||||
static const struct coex_table_para table_sant_8703b[] = {
|
||||
{0xffffffff, 0xffffffff}, /* case-0 */
|
||||
@@ -1997,7 +1998,6 @@ const struct rtw_chip_info rtw8703b_hw_s
|
||||
.rfe_defs_size = ARRAY_SIZE(rtw8703b_rfe_defs),
|
||||
|
||||
.iqk_threshold = 8,
|
||||
- .pwr_track_tbl = &rtw8703b_rtw_pwr_track_tbl,
|
||||
|
||||
/* WOWLAN firmware exists, but not implemented yet */
|
||||
.wow_fw_name = "rtw88/rtw8703b_wow_fw.bin",
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
|
||||
@@ -2020,11 +2020,6 @@ static const struct rtw_intf_phy_para_ta
|
||||
.n_gen1_para = ARRAY_SIZE(pcie_gen1_param_8723d),
|
||||
};
|
||||
|
||||
-static const struct rtw_rfe_def rtw8723d_rfe_defs[] = {
|
||||
- [0] = { .phy_pg_tbl = &rtw8723d_bb_pg_tbl,
|
||||
- .txpwr_lmt_tbl = &rtw8723d_txpwr_lmt_tbl,},
|
||||
-};
|
||||
-
|
||||
static const u8 rtw8723d_pwrtrk_2gb_n[] = {
|
||||
0, 0, 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5,
|
||||
6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10
|
||||
@@ -2088,6 +2083,12 @@ static const struct rtw_pwr_track_tbl rt
|
||||
.pwrtrk_xtal_n = rtw8723d_pwrtrk_xtal_n,
|
||||
};
|
||||
|
||||
+static const struct rtw_rfe_def rtw8723d_rfe_defs[] = {
|
||||
+ [0] = { .phy_pg_tbl = &rtw8723d_bb_pg_tbl,
|
||||
+ .txpwr_lmt_tbl = &rtw8723d_txpwr_lmt_tbl,
|
||||
+ .pwr_track_tbl = &rtw8723d_rtw_pwr_track_tbl, },
|
||||
+};
|
||||
+
|
||||
static const struct rtw_reg_domain coex_info_hw_regs_8723d[] = {
|
||||
{0x948, MASKDWORD, RTW_REG_DOMAIN_MAC32},
|
||||
{0x67, BIT(7), RTW_REG_DOMAIN_MAC8},
|
||||
@@ -2159,7 +2160,6 @@ const struct rtw_chip_info rtw8723d_hw_s
|
||||
.rfe_defs = rtw8723d_rfe_defs,
|
||||
.rfe_defs_size = ARRAY_SIZE(rtw8723d_rfe_defs),
|
||||
.rx_ldpc = false,
|
||||
- .pwr_track_tbl = &rtw8723d_rtw_pwr_track_tbl,
|
||||
.iqk_threshold = 8,
|
||||
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
|
||||
.max_scan_ie_len = IEEE80211_MAX_DATA_LEN,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8723x.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723x.c
|
||||
@@ -595,7 +595,8 @@ void __rtw8723x_pwrtrack_set_xtal(struct
|
||||
u8 delta)
|
||||
{
|
||||
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||
- const struct rtw_pwr_track_tbl *tbl = rtwdev->chip->pwr_track_tbl;
|
||||
+ const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev);
|
||||
+ const struct rtw_pwr_track_tbl *tbl = rfe_def->pwr_track_tbl;
|
||||
const s8 *pwrtrk_xtal;
|
||||
s8 xtal_cap;
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
||||
@@ -1581,13 +1581,6 @@ static const struct rtw_intf_phy_para_ta
|
||||
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8821c),
|
||||
};
|
||||
|
||||
-static const struct rtw_rfe_def rtw8821c_rfe_defs[] = {
|
||||
- [0] = RTW_DEF_RFE(8821c, 0, 0),
|
||||
- [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2),
|
||||
- [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2),
|
||||
- [6] = RTW_DEF_RFE(8821c, 0, 0),
|
||||
-};
|
||||
-
|
||||
static const struct rtw_hw_reg rtw8821c_dig[] = {
|
||||
[0] = { .addr = 0xc50, .mask = 0x7f },
|
||||
};
|
||||
@@ -1899,7 +1892,7 @@ static const u8 rtw8821c_pwrtrk_2g_cck_a
|
||||
5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_track_tbl rtw8821c_rtw_pwr_track_tbl = {
|
||||
+static const struct rtw_pwr_track_tbl rtw8821c_pwr_track_type0_tbl = {
|
||||
.pwrtrk_5gb_n[0] = rtw8821c_pwrtrk_5gb_n[0],
|
||||
.pwrtrk_5gb_n[1] = rtw8821c_pwrtrk_5gb_n[1],
|
||||
.pwrtrk_5gb_n[2] = rtw8821c_pwrtrk_5gb_n[2],
|
||||
@@ -1922,6 +1915,13 @@ static const struct rtw_pwr_track_tbl rt
|
||||
.pwrtrk_2g_ccka_p = rtw8821c_pwrtrk_2g_cck_a_p,
|
||||
};
|
||||
|
||||
+static const struct rtw_rfe_def rtw8821c_rfe_defs[] = {
|
||||
+ [0] = RTW_DEF_RFE(8821c, 0, 0, 0),
|
||||
+ [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 0, 2),
|
||||
+ [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 0, 2),
|
||||
+ [6] = RTW_DEF_RFE(8821c, 0, 0, 0),
|
||||
+};
|
||||
+
|
||||
static const struct rtw_reg_domain coex_info_hw_regs_8821c[] = {
|
||||
{0xCB0, MASKDWORD, RTW_REG_DOMAIN_MAC32},
|
||||
{0xCB4, MASKDWORD, RTW_REG_DOMAIN_MAC32},
|
||||
@@ -1994,7 +1994,6 @@ const struct rtw_chip_info rtw8821c_hw_s
|
||||
.rfe_defs = rtw8821c_rfe_defs,
|
||||
.rfe_defs_size = ARRAY_SIZE(rtw8821c_rfe_defs),
|
||||
.rx_ldpc = false,
|
||||
- .pwr_track_tbl = &rtw8821c_rtw_pwr_track_tbl,
|
||||
.iqk_threshold = 8,
|
||||
.bfer_su_max_num = 2,
|
||||
.bfer_mu_max_num = 1,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
|
||||
@@ -2072,12 +2072,6 @@ static const struct rtw_intf_phy_para_ta
|
||||
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822b),
|
||||
};
|
||||
|
||||
-static const struct rtw_rfe_def rtw8822b_rfe_defs[] = {
|
||||
- [2] = RTW_DEF_RFE(8822b, 2, 2),
|
||||
- [3] = RTW_DEF_RFE(8822b, 3, 0),
|
||||
- [5] = RTW_DEF_RFE(8822b, 5, 5),
|
||||
-};
|
||||
-
|
||||
static const struct rtw_hw_reg rtw8822b_dig[] = {
|
||||
[0] = { .addr = 0xc50, .mask = 0x7f },
|
||||
[1] = { .addr = 0xe50, .mask = 0x7f },
|
||||
@@ -2432,7 +2426,7 @@ static const u8 rtw8822b_pwrtrk_2g_cck_a
|
||||
10, 11, 11, 12, 12, 13, 13, 14, 14, 15
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_track_tbl rtw8822b_rtw_pwr_track_tbl = {
|
||||
+static const struct rtw_pwr_track_tbl rtw8822b_pwr_track_type0_tbl = {
|
||||
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_1] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_1],
|
||||
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_2] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_2],
|
||||
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_3] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_3],
|
||||
@@ -2455,6 +2449,12 @@ static const struct rtw_pwr_track_tbl rt
|
||||
.pwrtrk_2g_ccka_p = rtw8822b_pwrtrk_2g_cck_a_p,
|
||||
};
|
||||
|
||||
+static const struct rtw_rfe_def rtw8822b_rfe_defs[] = {
|
||||
+ [2] = RTW_DEF_RFE(8822b, 2, 2, 0),
|
||||
+ [3] = RTW_DEF_RFE(8822b, 3, 0, 0),
|
||||
+ [5] = RTW_DEF_RFE(8822b, 5, 5, 0),
|
||||
+};
|
||||
+
|
||||
static const struct rtw_reg_domain coex_info_hw_regs_8822b[] = {
|
||||
{0xcb0, MASKDWORD, RTW_REG_DOMAIN_MAC32},
|
||||
{0xcb4, MASKDWORD, RTW_REG_DOMAIN_MAC32},
|
||||
@@ -2535,7 +2535,6 @@ const struct rtw_chip_info rtw8822b_hw_s
|
||||
.rf_tbl = {&rtw8822b_rf_a_tbl, &rtw8822b_rf_b_tbl},
|
||||
.rfe_defs = rtw8822b_rfe_defs,
|
||||
.rfe_defs_size = ARRAY_SIZE(rtw8822b_rfe_defs),
|
||||
- .pwr_track_tbl = &rtw8822b_rtw_pwr_track_tbl,
|
||||
.iqk_threshold = 8,
|
||||
.bfer_su_max_num = 2,
|
||||
.bfer_mu_max_num = 1,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
|
||||
@@ -4883,16 +4883,6 @@ static const struct rtw_intf_phy_para_ta
|
||||
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822c),
|
||||
};
|
||||
|
||||
-static const struct rtw_rfe_def rtw8822c_rfe_defs[] = {
|
||||
- [0] = RTW_DEF_RFE(8822c, 0, 0),
|
||||
- [1] = RTW_DEF_RFE(8822c, 0, 0),
|
||||
- [2] = RTW_DEF_RFE(8822c, 0, 0),
|
||||
- [3] = RTW_DEF_RFE(8822c, 0, 0),
|
||||
- [4] = RTW_DEF_RFE(8822c, 0, 0),
|
||||
- [5] = RTW_DEF_RFE(8822c, 0, 5),
|
||||
- [6] = RTW_DEF_RFE(8822c, 0, 0),
|
||||
-};
|
||||
-
|
||||
static const struct rtw_hw_reg rtw8822c_dig[] = {
|
||||
[0] = { .addr = 0x1d70, .mask = 0x7f },
|
||||
[1] = { .addr = 0x1d70, .mask = 0x7f00 },
|
||||
@@ -5238,7 +5228,7 @@ static const u8 rtw8822c_pwrtrk_2g_cck_a
|
||||
18, 18, 19, 20, 21, 22, 23, 24, 24, 25
|
||||
};
|
||||
|
||||
-static const struct rtw_pwr_track_tbl rtw8822c_rtw_pwr_track_tbl = {
|
||||
+static const struct rtw_pwr_track_tbl rtw8822c_pwr_track_type0_tbl = {
|
||||
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_1] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_1],
|
||||
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_2] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_2],
|
||||
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_3] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_3],
|
||||
@@ -5261,6 +5251,16 @@ static const struct rtw_pwr_track_tbl rt
|
||||
.pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p,
|
||||
};
|
||||
|
||||
+static const struct rtw_rfe_def rtw8822c_rfe_defs[] = {
|
||||
+ [0] = RTW_DEF_RFE(8822c, 0, 0, 0),
|
||||
+ [1] = RTW_DEF_RFE(8822c, 0, 0, 0),
|
||||
+ [2] = RTW_DEF_RFE(8822c, 0, 0, 0),
|
||||
+ [3] = RTW_DEF_RFE(8822c, 0, 0, 0),
|
||||
+ [4] = RTW_DEF_RFE(8822c, 0, 0, 0),
|
||||
+ [5] = RTW_DEF_RFE(8822c, 0, 5, 0),
|
||||
+ [6] = RTW_DEF_RFE(8822c, 0, 0, 0),
|
||||
+};
|
||||
+
|
||||
static const struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
|
||||
[EDCCA_TH_L2H_IDX] = {
|
||||
{.addr = 0x84c, .mask = MASKBYTE2}, .offset = 0x80
|
||||
@@ -5360,7 +5360,6 @@ const struct rtw_chip_info rtw8822c_hw_s
|
||||
.rfe_defs_size = ARRAY_SIZE(rtw8822c_rfe_defs),
|
||||
.en_dis_dpd = true,
|
||||
.dpd_ratemask = DIS_DPD_RATEALL,
|
||||
- .pwr_track_tbl = &rtw8822c_rtw_pwr_track_tbl,
|
||||
.iqk_threshold = 8,
|
||||
.lck_threshold = 8,
|
||||
.bfer_su_max_num = 2,
|
@ -0,0 +1,27 @@
|
||||
From 85bf3041a0ea40a60b5295749268e179f056546a Mon Sep 17 00:00:00 2001
|
||||
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 17:13:10 +0300
|
||||
Subject: [PATCH] wifi: rtw88: usb: Set pkt_info.ls for the reserved page
|
||||
|
||||
"ls" meaning "last segment". Without this RTL8812AU can't upload the
|
||||
reserved page in USB 2 mode. (Somehow it's fine in USB 3 mode.)
|
||||
|
||||
Also tested with RTL8822CU, RTL8812BU, RTL8811CU, RTL8723DU, RTL8811AU.
|
||||
|
||||
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
||||
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
|
||||
Link: https://patch.msgid.link/e443f5d9-4b53-4f64-985c-64313ec80bef@gmail.com
|
||||
---
|
||||
drivers/net/wireless/realtek/rtw88/usb.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -477,6 +477,7 @@ static int rtw_usb_write_data_rsvd_page(
|
||||
pkt_info.tx_pkt_size = size;
|
||||
pkt_info.qsel = TX_DESC_QSEL_BEACON;
|
||||
pkt_info.offset = chip->tx_pkt_desc_sz;
|
||||
+ pkt_info.ls = true;
|
||||
|
||||
return rtw_usb_write_data(rtwdev, &pkt_info, buf);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user