Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
bb536758ea
2
Makefile
2
Makefile
@ -15,6 +15,8 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
|
||||
world:
|
||||
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH)
|
||||
|
||||
ifneq ($(OPENWRT_BUILD),1)
|
||||
|
||||
@ -204,11 +204,12 @@ menu "Target Images"
|
||||
|
||||
config GRUB_EFI_IMAGES
|
||||
bool "Build GRUB EFI images (Linux x86 or x86_64 host only)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_x86 || TARGET_armsr
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-efi
|
||||
select PACKAGE_grub2-bios-setup
|
||||
select PACKAGE_grub2 if TARGET_x86
|
||||
select PACKAGE_grub2-efi if TARGET_x86
|
||||
select PACKAGE_grub2-bios-setup if TARGET_x86
|
||||
select PACKAGE_grub2-efi-arm if TARGET_armsr
|
||||
select PACKAGE_kmod-fs-vfat
|
||||
default y
|
||||
|
||||
@ -261,7 +262,7 @@ menu "Target Images"
|
||||
|
||||
config QCOW2_IMAGES
|
||||
bool "Build PVE/KVM image files (QCOW2)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_x86 || TARGET_armsr
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
select PACKAGE_kmod-e1000
|
||||
default y if BUILDBOT
|
||||
@ -275,7 +276,7 @@ menu "Target Images"
|
||||
|
||||
config VMDK_IMAGES
|
||||
bool "Build VMware image files (VMDK)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_x86 || TARGET_armsr
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
select PACKAGE_kmod-e1000
|
||||
default y if BUILDBOT
|
||||
@ -289,7 +290,7 @@ menu "Target Images"
|
||||
|
||||
config TARGET_IMAGES_GZIP
|
||||
bool "GZip images"
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta
|
||||
default y
|
||||
|
||||
comment "Image Options"
|
||||
@ -303,6 +304,7 @@ menu "Target Images"
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 16 if TARGET_rockchip
|
||||
default 64 if TARGET_bcm27xx
|
||||
default 128 if TARGET_armsr
|
||||
default 32
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
|
||||
@ -363,7 +363,7 @@ config KERNEL_DEBUG_INFO
|
||||
config KERNEL_DEBUG_INFO_BTF
|
||||
|
||||
bool "Enable additional BTF type information"
|
||||
default y if TARGET_bcm27xx || TARGET_ipq807x || TARGET_mediatek_filogic || TARGET_mvebu_cortexa53 || TARGET_mvebu_cortexa72 || TARGET_rockchip || TARGET_sunxi || TARGET_x86
|
||||
default y if TARGET_armsr || TARGET_bcm27xx || TARGET_ipq807x || TARGET_mediatek_filogic || TARGET_mvebu_cortexa53 || TARGET_mvebu_cortexa72 || TARGET_rockchip || TARGET_sunxi || TARGET_x86
|
||||
depends on !HOST_OS_MACOS
|
||||
depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED
|
||||
select DWARVES
|
||||
@ -387,7 +387,7 @@ config KERNEL_MODULE_ALLOW_BTF_MISMATCH
|
||||
|
||||
config KERNEL_DEBUG_INFO_REDUCED
|
||||
bool "Reduce debugging information"
|
||||
default y if !(TARGET_bcm27xx || TARGET_ipq807x || TARGET_mediatek_filogic || TARGET_mvebu_cortexa53 || TARGET_mvebu_cortexa72 || TARGET_rockchip || TARGET_sunxi || TARGET_x86)
|
||||
default y if !(TARGET_armsr || TARGET_bcm27xx || TARGET_ipq807x || TARGET_mediatek_filogic || TARGET_mvebu_cortexa53 || TARGET_mvebu_cortexa72 || TARGET_rockchip || TARGET_sunxi || TARGET_x86)
|
||||
depends on KERNEL_DEBUG_INFO
|
||||
help
|
||||
If you say Y here gcc is instructed to generate less debugging
|
||||
|
||||
@ -26,6 +26,7 @@ HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
|
||||
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
|
||||
HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
|
||||
HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed
|
||||
HOST_STAMP_PROGRAMS:=$(foreach program,$(PKG_PROGRAMS),$(subst $(PKG_NAME),$(program),$(HOST_STAMP_INSTALLED)) )
|
||||
|
||||
override MAKEFLAGS=
|
||||
|
||||
@ -172,7 +173,7 @@ ifndef DUMP
|
||||
$(foreach hook,$(Hooks/HostInstall/Post),$(call $(hook))$(sep))
|
||||
mkdir -p $$(shell dirname $$@)
|
||||
touch $(HOST_STAMP_BUILT)
|
||||
touch $$@
|
||||
touch $$@ $(HOST_STAMP_PROGRAMS)
|
||||
|
||||
$(call DefaultTargets,$(patsubst %,host-%,$(DEFAULT_SUBDIR_TARGETS)))
|
||||
ifndef STAMP_BUILT
|
||||
@ -187,7 +188,7 @@ ifndef DUMP
|
||||
|
||||
$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
|
||||
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
|
||||
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED)
|
||||
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_PROGRAMS)
|
||||
host-install: host-compile
|
||||
|
||||
host-clean-build: FORCE
|
||||
@ -196,7 +197,7 @@ ifndef DUMP
|
||||
|
||||
host-clean: host-clean-build
|
||||
$(call Host/Clean)
|
||||
rm -rf $(HOST_STAMP_INSTALLED)
|
||||
rm -rf $(HOST_STAMP_INSTALLED) $(HOST_STAMP_PROGRAMS)
|
||||
|
||||
ifneq ($(CONFIG_AUTOREMOVE),)
|
||||
host-compile:
|
||||
|
||||
@ -13,6 +13,15 @@ endif
|
||||
|
||||
include $(KERNEL_DETAILS_FILE)
|
||||
|
||||
ifdef KERNEL_TESTING_PATCHVER
|
||||
KERNEL_TESTING_DETAILS_FILE=$(INCLUDE_DIR)/kernel-$(KERNEL_TESTING_PATCHVER)
|
||||
ifeq ($(wildcard $(KERNEL_TESTING_DETAILS_FILE)),)
|
||||
$(error Missing kernel version/hash file for $(KERNEL_TESTING_PATCHVER). Please create $(KERNEL_TESTING_DETAILS_FILE))
|
||||
endif
|
||||
|
||||
include $(KERNEL_TESTING_DETAILS_FILE)
|
||||
endif
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
|
||||
|
||||
@ -28,9 +28,9 @@ define Require
|
||||
|
||||
prereq-$(1): $(if $(PREREQ_PREV),prereq-$(PREREQ_PREV)) FORCE
|
||||
printf "Checking '$(1)'... "
|
||||
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||||
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) PATH="$(ORIG_PATH)" >/dev/null 2>/dev/null; then \
|
||||
echo 'ok.'; \
|
||||
elif $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||||
elif $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) PATH="$(ORIG_PATH)" >/dev/null 2>/dev/null; then \
|
||||
echo 'updated.'; \
|
||||
else \
|
||||
echo 'failed.'; \
|
||||
@ -104,13 +104,21 @@ define SetupHostCommand
|
||||
$(call QuoteHostCommand,$(9)) $(call QuoteHostCommand,$(10)) \
|
||||
$(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \
|
||||
if [ -n "$$$$$$$$cmd" ]; then \
|
||||
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
|
||||
command -v "$$$$$$$${cmd%% *}")"; \
|
||||
bin="$$$$$$$$(command -v "$$$$$$$${cmd%% *}")"; \
|
||||
if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \
|
||||
case "$$$$$$$$(ls -dl -- $(STAGING_DIR_HOST)/bin/$(strip $(1)))" in \
|
||||
*" -> $$$$$$$$bin"*) \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
"-"*) \
|
||||
find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
*" -> /"*) \
|
||||
;; \
|
||||
*" -> "*) \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
esac; \
|
||||
ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
|
||||
exit 0; \
|
||||
|
||||
@ -11,6 +11,7 @@ TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
|
||||
FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
||||
OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(STAGING_DIR_HOST)/bin:$(PATH)
|
||||
|
||||
define feedname
|
||||
|
||||
@ -50,6 +50,7 @@ space:= $(empty) $(empty)
|
||||
path:=$(subst :,$(space),$(PATH))
|
||||
path:=$(filter-out .%,$(path))
|
||||
path:=$(subst $(space),:,$(path))
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(path)
|
||||
export STAGING_DIR_HOST:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host),$(TOPDIR)/staging_dir/host)
|
||||
|
||||
|
||||
@ -33,14 +33,15 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/grub2/Default
|
||||
CATEGORY:=Boot Loaders
|
||||
SECTION:=boot
|
||||
TITLE:=GRand Unified Bootloader ($(1))
|
||||
TITLE:=GRand Unified Bootloader ($(2))
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
VARIANT:=$(1)
|
||||
DEPENDS:=@TARGET_$(1)
|
||||
VARIANT:=$(2)
|
||||
endef
|
||||
|
||||
Package/grub2=$(call Package/grub2/Default,pc)
|
||||
Package/grub2-efi=$(call Package/grub2/Default,efi)
|
||||
Package/grub2=$(call Package/grub2/Default,x86,pc)
|
||||
Package/grub2-efi=$(call Package/grub2/Default,x86,efi)
|
||||
Package/grub2-efi-arm=$(call Package/grub2/Default,armsr,efi)
|
||||
|
||||
define Package/grub2-editenv
|
||||
CATEGORY:=Utilities
|
||||
@ -107,6 +108,10 @@ ifneq ($(BUILD_VARIANT),none)
|
||||
MAKE_PATH := grub-core
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_arm),y)
|
||||
TARGET_CFLAGS := $(filter-out -mfloat-abi=hard,$(TARGET_CFLAGS))
|
||||
endif
|
||||
|
||||
define Host/Configure
|
||||
$(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
|
||||
$(Host/Configure/Default)
|
||||
@ -162,9 +167,31 @@ define Package/grub2-efi/install
|
||||
-O $(CONFIG_ARCH)-efi \
|
||||
-c ./files/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/iso-boot$(if $(CONFIG_x86_64),x64,ia32).efi \
|
||||
at_keyboard boot chain configfile fat iso9660 linux ls part_msdos part_gpt reboot serial test efi_gop efi_uga
|
||||
boot chain configfile fat iso9660 linux ls part_msdos part_gpt reboot serial test efi_gop efi_uga
|
||||
endef
|
||||
|
||||
define Package/grub2-efi-arm/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/grub2
|
||||
cp ./files/grub-early-gpt.cfg $(PKG_BUILD_DIR)/grub-early.cfg
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O arm$(if $(CONFIG_aarch64),64,)-efi \
|
||||
-c $(PKG_BUILD_DIR)/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_aarch64),aa64,arm).efi \
|
||||
boot chain configfile fat linux ls part_gpt part_msdos reboot search \
|
||||
search_fs_uuid search_label serial efi_gop lsefi minicmd ext2
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O arm$(if $(CONFIG_aarch64),64,)-efi \
|
||||
-c ./files/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/iso-bootaa$(if $(CONFIG_aarch64),aa64,arm).efi \
|
||||
boot chain configfile fat iso9660 linux ls lsefi minicmd part_msdos part_gpt \
|
||||
reboot serial test efi_gop
|
||||
endef
|
||||
|
||||
|
||||
define Package/grub2-editenv/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
||||
@ -178,5 +205,6 @@ endef
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2))
|
||||
$(eval $(call BuildPackage,grub2-efi))
|
||||
$(eval $(call BuildPackage,grub2-efi-arm))
|
||||
$(eval $(call BuildPackage,grub2-editenv))
|
||||
$(eval $(call BuildPackage,grub2-bios-setup))
|
||||
|
||||
2
package/boot/grub2/files/grub-early-gpt.cfg
Normal file
2
package/boot/grub2/files/grub-early-gpt.cfg
Normal file
@ -0,0 +1,2 @@
|
||||
search --set=root --label kernel
|
||||
configfile ($root)/efi/openwrt/grub.cfg
|
||||
36
package/boot/uboot-armsr/Makefile
Normal file
36
package/boot/uboot-armsr/Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2023.04
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=e31cac91545ff41b71cec5d8c22afd695645cd6e2a442ccdacacd60534069341
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define U-Boot/Default
|
||||
BUILD_TARGET:=armsr
|
||||
endef
|
||||
|
||||
define U-Boot/qemu_armv7
|
||||
NAME:=QEMU ARM Virtual Machine 32-bit
|
||||
BUILD_SUBTARGET:=armv7
|
||||
BUILD_DEVICES:=generic
|
||||
UBOOT_CONFIG:=qemu_arm
|
||||
endef
|
||||
|
||||
define U-Boot/qemu_armv8
|
||||
NAME:=QEMU ARM Virtual Machine 64-bit
|
||||
BUILD_SUBTARGET:=armv8
|
||||
BUILD_DEVICES:=generic
|
||||
UBOOT_CONFIG:=qemu_arm64
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
qemu_armv7 \
|
||||
qemu_armv8
|
||||
|
||||
UBOOT_CUSTOMIZE_CONFIG := \
|
||||
--enable CMD_EFIDEBUG
|
||||
|
||||
$(eval $(call BuildPackage/U-Boot))
|
||||
@ -0,0 +1,62 @@
|
||||
From: Simon Glass <sjg@chromium.org>
|
||||
To: U-Boot Mailing List <u-boot@lists.denx.de>
|
||||
Subject: [PATCH v10 7/9] bootstd: Use blk uclass device numbers to set efi
|
||||
bootdev
|
||||
Date: Mon, 24 Apr 2023 13:49:50 +1200
|
||||
Message-ID:
|
||||
<20230424134946.v10.7.Ia5f5e39c882ac22b5f71c4d576941b34e868eeba@changeid>
|
||||
|
||||
From: Mathew McBride <matt@traverse.com.au>
|
||||
|
||||
When loading a file from a block device, efiload_read_file
|
||||
was using the seq_num of the device (e.g "35" of virtio_blk#35)
|
||||
instead of the block device id (e.g what you get from running
|
||||
the corresponding device scan command, like "virtio 0")
|
||||
|
||||
This cause EFI booting from these devices to fail as an
|
||||
invalid device number is passed to blk_get_device_part_str:
|
||||
|
||||
Scanning bootdev 'virtio-blk#35.bootdev':
|
||||
distro_efi_read_bootflow_file start (efi,fname=<NULL>)
|
||||
distro_efi_read_bootflow_file start (efi,fname=<NULL>)
|
||||
setting bootdev virtio, 35, efi/boot/bootaa64.efi, 00000000beef9a40, 170800
|
||||
efi_dp_from_name calling blk_get_device_part_str
|
||||
dev=virtio devnr=35 path=efi/boot/bootaa64.efi
|
||||
blk_get_device_part_str (virtio,35)
|
||||
blk_get_device_by_str (virtio, 35)
|
||||
** Bad device specification virtio 35 **
|
||||
Using default device tree: dtb/qemu-arm.dtb
|
||||
No device tree available
|
||||
0 efi ready virtio 1 virtio-blk#35.bootdev.par efi/boot/bootaa64.efi
|
||||
** Booting bootflow 'virtio-blk#35.bootdev.part_1' with efi
|
||||
blk_get_device_part_str (virtio,0:1)
|
||||
blk_get_device_by_str (virtio, 0)
|
||||
No UEFI binary known at beef9a40 (image buf=00000000beef9a40,addr=0000000000000000)
|
||||
Boot failed (err=-22)
|
||||
|
||||
Signed-off-by: Mathew McBride <matt@traverse.com.au>
|
||||
Signed-off-by: Simon Glass <sjg@chromium.org>
|
||||
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport to 2023.04]
|
||||
---
|
||||
|
||||
(no changes since v8)
|
||||
|
||||
Changes in v8:
|
||||
- Add new patch to use blk uclass device numbers to set efi bootdev
|
||||
|
||||
boot/bootmeth_efi.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/boot/bootmeth_efi.c
|
||||
+++ b/boot/bootmeth_efi.c
|
||||
@@ -117,7 +117,9 @@ static int efiload_read_file(struct blk_
|
||||
* this can go away.
|
||||
*/
|
||||
media_dev = dev_get_parent(bflow->dev);
|
||||
- snprintf(devnum_str, sizeof(devnum_str), "%x", dev_seq(media_dev));
|
||||
+ snprintf(devnum_str, sizeof(devnum_str), "%x:%x",
|
||||
+ desc ? desc->devnum : dev_seq(media_dev),
|
||||
+ bflow->part);
|
||||
|
||||
strlcpy(dirname, bflow->fname, sizeof(dirname));
|
||||
last_slash = strrchr(dirname, '/');
|
||||
@ -38,6 +38,11 @@ xiaomi,ax9000)
|
||||
[ -n "$idx2" ] && \
|
||||
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
prpl,haze)
|
||||
mmcpart="$(find_mmc_part 0:APPSBLENV)"
|
||||
[ -n "$mmcpart" ] && \
|
||||
ubootenv_add_uci_config "$mmcpart" "0x0" "0x40000" "0x400" "0x100"
|
||||
;;
|
||||
qnap,301w)
|
||||
idx="$(find_mtd_index 0:appsblenv)"
|
||||
[ -n "$idx" ] && \
|
||||
|
||||
@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2023-04-12
|
||||
PKG_SOURCE_VERSION:=b22487d729362feaff7d06354353d005a3a9d6b7
|
||||
PKG_MIRROR_HASH:=94eea9db636b2cbf6782ec17d8b8fe36770c61ff283702ec418df1a1b09f54ef
|
||||
PKG_SOURCE_DATE:=2023-06-03
|
||||
PKG_SOURCE_VERSION:=cd9c30ca47b8e5388b770c523a7f6b8b969e2f92
|
||||
PKG_MIRROR_HASH:=45e623fcc512b514ade0f22e217275536aa8de4afba7dfdb11696482b8fa71a2
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@ -29,10 +29,12 @@ endef
|
||||
|
||||
ALLWIFIBOARDS:= \
|
||||
buffalo_wxr-5950ax12 \
|
||||
compex_wpq873 \
|
||||
dynalink_dl-wrx36 \
|
||||
edgecore_eap102 \
|
||||
edimax_cax1800 \
|
||||
netgear_wax218 \
|
||||
prpl_haze \
|
||||
qnap_301w \
|
||||
redmi_ax6 \
|
||||
wallys_dr40x9 \
|
||||
@ -114,11 +116,13 @@ endef
|
||||
# Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
|
||||
|
||||
$(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
|
||||
$(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873))
|
||||
$(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
|
||||
$(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
|
||||
$(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
|
||||
$(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))
|
||||
$(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
|
||||
$(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
|
||||
$(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
|
||||
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
|
||||
|
||||
@ -12,7 +12,7 @@ PKG_VERSION:=21.08
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils
|
||||
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/mc-utils
|
||||
PKG_SOURCE_VERSION:=LSDK-21.08
|
||||
PKG_MIRROR_HASH:=372498ff4b5c8a1ac64ead5856d03ee021332f57771989ed6fe066745372b242
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ $(eval $(call KernelPackage,mii))
|
||||
define KernelPackage/mdio-devres
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Supports MDIO device registration
|
||||
DEPENDS:=+kmod-libphy +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
DEPENDS:=+kmod-libphy +(TARGET_armsr||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
KCONFIG:=CONFIG_MDIO_DEVRES
|
||||
HIDDEN:=1
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/mdio_devres.ko
|
||||
@ -158,7 +158,7 @@ $(eval $(call KernelPackage,mdio-devres))
|
||||
define KernelPackage/mdio-gpio
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:= Supports GPIO lib-based MDIO busses
|
||||
DEPENDS:=+kmod-libphy @GPIO_SUPPORT +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
DEPENDS:=+kmod-libphy @GPIO_SUPPORT +(TARGET_armsr||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
KCONFIG:= \
|
||||
CONFIG_MDIO_BITBANG \
|
||||
CONFIG_MDIO_GPIO
|
||||
@ -437,7 +437,7 @@ $(eval $(call KernelPackage,switch-rtl8306))
|
||||
define KernelPackage/switch-rtl8366-smi
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Realtek RTL8366 SMI switch interface support
|
||||
DEPENDS:=@GPIO_SUPPORT +kmod-swconfig +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
DEPENDS:=@GPIO_SUPPORT +kmod-swconfig +(TARGET_armsr||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
KCONFIG:=CONFIG_RTL8366_SMI
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366_smi.ko
|
||||
AUTOLOAD:=$(call AutoLoad,42,rtl8366_smi,1)
|
||||
@ -1583,7 +1583,6 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,atlantic))
|
||||
|
||||
|
||||
define KernelPackage/lan743x
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Microchip LAN743x PCI Express Gigabit Ethernet NIC
|
||||
@ -1599,3 +1598,18 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,lan743x))
|
||||
|
||||
define KernelPackage/amazon-ena
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Elastic Network Adapter (for Amazon AWS)
|
||||
DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8
|
||||
KCONFIG:=CONFIG_ENA_ETHERNET
|
||||
FILES:=$(LINUX_DIR)/drivers/net/ethernet/amazon/ena/ena.ko
|
||||
AUTOLOAD:=$(call AutoLoad,12,ena)
|
||||
endef
|
||||
|
||||
define KernelPackage/amazon-ena/description
|
||||
This driver supports Elastic Network Adapter (ENA)
|
||||
used by Amazon AWS T3 (2018) and later instances.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,amazon-ena))
|
||||
|
||||
@ -1359,6 +1359,21 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,mdio))
|
||||
|
||||
define KernelPackage/mdio-bus-mux
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=MDIO bus multiplexers
|
||||
KCONFIG:=CONFIG_MDIO_BUS_MUX
|
||||
HIDDEN:=1
|
||||
FILES:=$(LINUX_DIR)/drivers/net/mdio/mdio-mux.ko
|
||||
AUTOLOAD:=$(call AutoLoad,32,mdio-mux)
|
||||
endef
|
||||
|
||||
define KernelPackage/mdio-bus-mux/description
|
||||
Kernel framework for MDIO bus multiplexers.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mdio-bus-mux))
|
||||
|
||||
define KernelPackage/macsec
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=IEEE 802.1AE MAC-level encryption (MAC)
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
From 695df2f417d25202bdac9cde3c82d2acb6492b4d Mon Sep 17 00:00:00 2001
|
||||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Fri, 5 May 2023 16:11:25 +0300
|
||||
Subject: [PATCH] wifi: ath: work around false-positive stringop-overread
|
||||
warning
|
||||
|
||||
In a rare arm64 randconfig build, I got multiple warnings for ath11k
|
||||
and ath12k:
|
||||
|
||||
In function 'ath11k_peer_assoc_h_ht',
|
||||
inlined from 'ath11k_peer_assoc_prepare' at drivers/net/wireless/ath/ath11k/mac.c:2665:2:
|
||||
drivers/net/wireless/ath/ath11k/mac.c:1709:13: error: 'ath11k_peer_assoc_h_ht_masked' reading 10 bytes from a region of size 0 [-Werror=stringop-overread]
|
||||
1709 | if (ath11k_peer_assoc_h_ht_masked(ht_mcs_mask))
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This happens whenever gcc-13 fails to inline one of the functions
|
||||
that take a fixed-length array argument but gets passed a pointer.
|
||||
|
||||
Change these functions to all take a regular pointer argument
|
||||
instead.
|
||||
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230417205447.1800912-1-arnd@kernel.org
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -433,7 +433,7 @@ u8 ath11k_mac_bitrate_to_idx(const struc
|
||||
}
|
||||
|
||||
static u32
|
||||
-ath11k_mac_max_ht_nss(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN])
|
||||
+ath11k_mac_max_ht_nss(const u8 *ht_mcs_mask)
|
||||
{
|
||||
int nss;
|
||||
|
||||
@@ -445,7 +445,7 @@ ath11k_mac_max_ht_nss(const u8 ht_mcs_ma
|
||||
}
|
||||
|
||||
static u32
|
||||
-ath11k_mac_max_vht_nss(const u16 vht_mcs_mask[NL80211_VHT_NSS_MAX])
|
||||
+ath11k_mac_max_vht_nss(const u16 *vht_mcs_mask)
|
||||
{
|
||||
int nss;
|
||||
|
||||
@@ -457,7 +457,7 @@ ath11k_mac_max_vht_nss(const u16 vht_mcs
|
||||
}
|
||||
|
||||
static u32
|
||||
-ath11k_mac_max_he_nss(const u16 he_mcs_mask[NL80211_HE_NSS_MAX])
|
||||
+ath11k_mac_max_he_nss(const u16 *he_mcs_mask)
|
||||
{
|
||||
int nss;
|
||||
|
||||
@@ -1658,7 +1658,7 @@ static void ath11k_peer_assoc_h_rates(st
|
||||
}
|
||||
|
||||
static bool
|
||||
-ath11k_peer_assoc_h_ht_masked(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN])
|
||||
+ath11k_peer_assoc_h_ht_masked(const u8 *ht_mcs_mask)
|
||||
{
|
||||
int nss;
|
||||
|
||||
@@ -1670,7 +1670,7 @@ ath11k_peer_assoc_h_ht_masked(const u8 h
|
||||
}
|
||||
|
||||
static bool
|
||||
-ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[])
|
||||
+ath11k_peer_assoc_h_vht_masked(const u16 *vht_mcs_mask)
|
||||
{
|
||||
int nss;
|
||||
|
||||
@@ -2065,7 +2065,7 @@ static u16 ath11k_peer_assoc_h_he_limit(
|
||||
}
|
||||
|
||||
static bool
|
||||
-ath11k_peer_assoc_h_he_masked(const u16 he_mcs_mask[NL80211_HE_NSS_MAX])
|
||||
+ath11k_peer_assoc_h_he_masked(const u16 *he_mcs_mask)
|
||||
{
|
||||
int nss;
|
||||
|
||||
@ -0,0 +1,133 @@
|
||||
From a08dbb04d7365a04d52882143cf196005bfc88c3 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:27 +0300
|
||||
Subject: [PATCH 71/77] wifi: ath11k: driver settings for MBSSID and EMA
|
||||
|
||||
Advertise the driver support for multiple BSSID (MBSSID) and
|
||||
enhanced multi-BSSID advertisements (EMA) by setting extended
|
||||
capabilities.
|
||||
|
||||
Configure mbssid_max_interfaces and ema_max_profile_periodicity
|
||||
fields in structure wiphy which are used to advertise maximum number
|
||||
of interfaces and profile periodicity supported by the driver.
|
||||
|
||||
Add new WMI fields to configure maximum vdev count supported for
|
||||
MBSSID and profile periodicity in case of EMA.
|
||||
Setting WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET flag
|
||||
indicates that the firmware should track and update the DTIM counts
|
||||
for each non-transmitted profile.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-2-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/hw.c | 3 +++
|
||||
drivers/net/wireless/ath/ath11k/hw.h | 1 +
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 7 +++++++
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 3 +++
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 6 ++++++
|
||||
5 files changed, 20 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.c
|
||||
@@ -202,6 +202,9 @@ static void ath11k_init_wmi_config_ipq80
|
||||
config->twt_ap_sta_count = 1000;
|
||||
config->flag1 |= WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64;
|
||||
config->flag1 |= WMI_RSRC_CFG_FLAG1_ACK_RSSI;
|
||||
+ config->ema_max_vap_cnt = ab->num_radios;
|
||||
+ config->ema_max_profile_period = TARGET_EMA_MAX_PROFILE_PERIOD;
|
||||
+ config->beacon_tx_offload_max_vdev += config->ema_max_vap_cnt;
|
||||
}
|
||||
|
||||
static int ath11k_hw_mac_id_to_pdev_id_ipq8074(struct ath11k_hw_params *hw,
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -64,6 +64,7 @@
|
||||
#define TARGET_NUM_WDS_ENTRIES 32
|
||||
#define TARGET_DMA_BURST_SIZE 1
|
||||
#define TARGET_RX_BATCHMODE 1
|
||||
+#define TARGET_EMA_MAX_PROFILE_PERIOD 8
|
||||
|
||||
#define ATH11K_HW_MAX_QUEUES 4
|
||||
#define ATH11K_QUEUE_LEN 4096
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -9001,19 +9001,23 @@ static int ath11k_mac_setup_iface_combin
|
||||
|
||||
static const u8 ath11k_if_types_ext_capa[] = {
|
||||
[0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
|
||||
+ [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
|
||||
[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
|
||||
};
|
||||
|
||||
static const u8 ath11k_if_types_ext_capa_sta[] = {
|
||||
[0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
|
||||
+ [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
|
||||
[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
|
||||
[9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT,
|
||||
};
|
||||
|
||||
static const u8 ath11k_if_types_ext_capa_ap[] = {
|
||||
[0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
|
||||
+ [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
|
||||
[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
|
||||
[9] = WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT,
|
||||
+ [10] = WLAN_EXT_CAPA11_EMA_SUPPORT,
|
||||
};
|
||||
|
||||
static const struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = {
|
||||
@@ -9251,6 +9255,9 @@ static int __ath11k_mac_register(struct
|
||||
wiphy_ext_feature_set(ar->hw->wiphy,
|
||||
NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
|
||||
|
||||
+ ar->hw->wiphy->mbssid_max_interfaces = TARGET_NUM_VDEVS(ab);
|
||||
+ ar->hw->wiphy->ema_max_profile_periodicity = TARGET_EMA_MAX_PROFILE_PERIOD;
|
||||
+
|
||||
ath11k_reg_init(ar);
|
||||
|
||||
if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) {
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -3987,6 +3987,9 @@ ath11k_wmi_copy_resource_config(struct w
|
||||
~(1 << WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
|
||||
wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported <<
|
||||
WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
|
||||
+ wmi_cfg->flags2 = WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET;
|
||||
+ wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt;
|
||||
+ wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period;
|
||||
}
|
||||
|
||||
static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -2317,6 +2317,7 @@ struct wmi_init_cmd {
|
||||
} __packed;
|
||||
|
||||
#define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5)
|
||||
+#define WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET BIT(9)
|
||||
#define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18)
|
||||
|
||||
#define WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT 4
|
||||
@@ -2389,6 +2390,9 @@ struct wmi_resource_config {
|
||||
u32 msdu_flow_override_config1;
|
||||
u32 flags2;
|
||||
u32 host_service_flags;
|
||||
+ u32 max_rnr_neighbours;
|
||||
+ u32 ema_max_vap_cnt;
|
||||
+ u32 ema_max_profile_period;
|
||||
} __packed;
|
||||
|
||||
struct wmi_service_ready_event {
|
||||
@@ -5646,6 +5650,8 @@ struct target_resource_config {
|
||||
u32 twt_ap_pdev_count;
|
||||
u32 twt_ap_sta_count;
|
||||
u8 is_reg_cc_ext_event_supported;
|
||||
+ u32 ema_max_vap_cnt;
|
||||
+ u32 ema_max_profile_period;
|
||||
};
|
||||
|
||||
enum wmi_debug_log_param {
|
||||
@ -0,0 +1,215 @@
|
||||
From 5a81610acf66c4ad6e1a1fbd09f3f555fca863b1 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:27 +0300
|
||||
Subject: [PATCH 72/77] wifi: ath11k: MBSSID configuration during vdev
|
||||
create/start
|
||||
|
||||
Configure multiple BSSID flags and index of the transmitting interface
|
||||
in vdev create/start commands depending on the service bit
|
||||
WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 70 +++++++++++++++++++++++++--
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 5 ++
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 19 ++++++++
|
||||
3 files changed, 90 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -6181,17 +6181,62 @@ static void ath11k_mac_op_stop(struct ie
|
||||
atomic_set(&ar->num_pending_mgmt_tx, 0);
|
||||
}
|
||||
|
||||
-static void
|
||||
-ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif,
|
||||
- struct vdev_create_params *params)
|
||||
+static int ath11k_mac_setup_vdev_params_mbssid(struct ath11k_vif *arvif,
|
||||
+ u32 *flags, u32 *tx_vdev_id)
|
||||
+{
|
||||
+ struct ath11k *ar = arvif->ar;
|
||||
+ struct ath11k_vif *tx_arvif;
|
||||
+ struct ieee80211_vif *tx_vif;
|
||||
+
|
||||
+ *tx_vdev_id = 0;
|
||||
+ tx_vif = arvif->vif->mbssid_tx_vif;
|
||||
+ if (!tx_vif) {
|
||||
+ *flags = WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ tx_arvif = (void *)tx_vif->drv_priv;
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.nontransmitted) {
|
||||
+ if (ar->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ *flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP;
|
||||
+ *tx_vdev_id = ath11k_vif_to_arvif(tx_vif)->vdev_id;
|
||||
+ } else if (tx_arvif == arvif) {
|
||||
+ *flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP;
|
||||
+ } else {
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.ema_ap)
|
||||
+ *flags |= WMI_HOST_VDEV_FLAGS_EMA_MODE;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif,
|
||||
+ struct vdev_create_params *params)
|
||||
{
|
||||
struct ath11k *ar = arvif->ar;
|
||||
struct ath11k_pdev *pdev = ar->pdev;
|
||||
+ int ret;
|
||||
|
||||
params->if_id = arvif->vdev_id;
|
||||
params->type = arvif->vdev_type;
|
||||
params->subtype = arvif->vdev_subtype;
|
||||
params->pdev_id = pdev->pdev_id;
|
||||
+ params->mbssid_flags = 0;
|
||||
+ params->mbssid_tx_vdev_id = 0;
|
||||
+
|
||||
+ if (!test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT,
|
||||
+ ar->ab->wmi_ab.svc_map)) {
|
||||
+ ret = ath11k_mac_setup_vdev_params_mbssid(arvif,
|
||||
+ ¶ms->mbssid_flags,
|
||||
+ ¶ms->mbssid_tx_vdev_id);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) {
|
||||
params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains;
|
||||
@@ -6206,6 +6251,7 @@ ath11k_mac_setup_vdev_create_params(stru
|
||||
params->chains[NL80211_BAND_6GHZ].tx = ar->num_tx_chains;
|
||||
params->chains[NL80211_BAND_6GHZ].rx = ar->num_rx_chains;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
|
||||
@@ -6500,7 +6546,12 @@ static int ath11k_mac_op_add_interface(s
|
||||
for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++)
|
||||
vif->hw_queue[i] = i % (ATH11K_HW_MAX_QUEUES - 1);
|
||||
|
||||
- ath11k_mac_setup_vdev_create_params(arvif, &vdev_param);
|
||||
+ ret = ath11k_mac_setup_vdev_create_params(arvif, &vdev_param);
|
||||
+ if (ret) {
|
||||
+ ath11k_warn(ab, "failed to create vdev parameters %d: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ goto err;
|
||||
+ }
|
||||
|
||||
ret = ath11k_wmi_vdev_create(ar, vif->addr, &vdev_param);
|
||||
if (ret) {
|
||||
@@ -6905,6 +6956,17 @@ ath11k_mac_vdev_start_restart(struct ath
|
||||
arg.pref_tx_streams = ar->num_tx_chains;
|
||||
arg.pref_rx_streams = ar->num_rx_chains;
|
||||
|
||||
+ arg.mbssid_flags = 0;
|
||||
+ arg.mbssid_tx_vdev_id = 0;
|
||||
+ if (test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT,
|
||||
+ ar->ab->wmi_ab.svc_map)) {
|
||||
+ ret = ath11k_mac_setup_vdev_params_mbssid(arvif,
|
||||
+ &arg.mbssid_flags,
|
||||
+ &arg.mbssid_tx_vdev_id);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
|
||||
arg.ssid = arvif->u.ap.ssid;
|
||||
arg.ssid_len = arvif->u.ap.ssid_len;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -724,6 +724,9 @@ int ath11k_wmi_vdev_create(struct ath11k
|
||||
cmd->vdev_subtype = param->subtype;
|
||||
cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX;
|
||||
cmd->pdev_id = param->pdev_id;
|
||||
+ cmd->mbssid_flags = param->mbssid_flags;
|
||||
+ cmd->mbssid_tx_vdev_id = param->mbssid_tx_vdev_id;
|
||||
+
|
||||
ether_addr_copy(cmd->vdev_macaddr.addr, macaddr);
|
||||
|
||||
ptr = skb->data + sizeof(*cmd);
|
||||
@@ -941,6 +944,8 @@ int ath11k_wmi_vdev_start(struct ath11k
|
||||
cmd->cac_duration_ms = arg->cac_duration_ms;
|
||||
cmd->regdomain = arg->regdomain;
|
||||
cmd->he_ops = arg->he_ops;
|
||||
+ cmd->mbssid_flags = arg->mbssid_flags;
|
||||
+ cmd->mbssid_tx_vdev_id = arg->mbssid_tx_vdev_id;
|
||||
|
||||
if (!restart) {
|
||||
if (arg->ssid) {
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -137,6 +137,14 @@ enum {
|
||||
WMI_AUTORATE_3200NS_GI = BIT(11),
|
||||
};
|
||||
|
||||
+enum {
|
||||
+ WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP = 0x00000001,
|
||||
+ WMI_HOST_VDEV_FLAGS_TRANSMIT_AP = 0x00000002,
|
||||
+ WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP = 0x00000004,
|
||||
+ WMI_HOST_VDEV_FLAGS_EMA_MODE = 0x00000008,
|
||||
+ WMI_HOST_VDEV_FLAGS_SCAN_MODE_VAP = 0x00000010,
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* wmi command groups.
|
||||
*/
|
||||
@@ -2096,6 +2104,7 @@ enum wmi_tlv_service {
|
||||
WMI_TLV_SERVICE_EXT2_MSG = 220,
|
||||
WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT = 246,
|
||||
WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249,
|
||||
+ WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT = 253,
|
||||
WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE = 263,
|
||||
|
||||
/* The second 128 bits */
|
||||
@@ -2583,6 +2592,8 @@ struct vdev_create_params {
|
||||
u8 rx;
|
||||
} chains[NUM_NL80211_BANDS];
|
||||
u32 pdev_id;
|
||||
+ u32 mbssid_flags;
|
||||
+ u32 mbssid_tx_vdev_id;
|
||||
};
|
||||
|
||||
struct wmi_vdev_create_cmd {
|
||||
@@ -2593,6 +2604,8 @@ struct wmi_vdev_create_cmd {
|
||||
struct wmi_mac_addr vdev_macaddr;
|
||||
u32 num_cfg_txrx_streams;
|
||||
u32 pdev_id;
|
||||
+ u32 mbssid_flags;
|
||||
+ u32 mbssid_tx_vdev_id;
|
||||
} __packed;
|
||||
|
||||
struct wmi_vdev_txrx_streams {
|
||||
@@ -2656,6 +2669,9 @@ struct wmi_vdev_start_request_cmd {
|
||||
u32 he_ops;
|
||||
u32 cac_duration_ms;
|
||||
u32 regdomain;
|
||||
+ u32 min_data_rate;
|
||||
+ u32 mbssid_flags;
|
||||
+ u32 mbssid_tx_vdev_id;
|
||||
} __packed;
|
||||
|
||||
#define MGMT_TX_DL_FRM_LEN 64
|
||||
@@ -2825,6 +2841,9 @@ struct wmi_vdev_start_req_arg {
|
||||
u32 pref_rx_streams;
|
||||
u32 pref_tx_streams;
|
||||
u32 num_noa_descriptors;
|
||||
+ u32 min_data_rate;
|
||||
+ u32 mbssid_flags;
|
||||
+ u32 mbssid_tx_vdev_id;
|
||||
};
|
||||
|
||||
struct peer_create_params {
|
||||
@ -0,0 +1,52 @@
|
||||
From cf604e72bc6e6db68c7fcaa8779b03ec14b8d2fa Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:27 +0300
|
||||
Subject: [PATCH 73/77] wifi: ath11k: rename MBSSID fields in wmi_vdev_up_cmd
|
||||
|
||||
Rename trans_bssid to tx_vdev_bssid to make it similar to vdev_bssid.
|
||||
|
||||
Rename profile_num to nontx_profile_cnt, and profile_idx to
|
||||
nontx_profile_idx which makes it clear that these store configurations
|
||||
related to MBSSID non-transmitting profiles.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-4-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 6 +++---
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 6 +++---
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -1029,10 +1029,10 @@ int ath11k_wmi_vdev_up(struct ath11k *ar
|
||||
bss_conf = &arvif->vif->bss_conf;
|
||||
|
||||
if (bss_conf->nontransmitted) {
|
||||
- ether_addr_copy(cmd->trans_bssid.addr,
|
||||
+ ether_addr_copy(cmd->tx_vdev_bssid.addr,
|
||||
bss_conf->transmitter_bssid);
|
||||
- cmd->profile_idx = bss_conf->bssid_index;
|
||||
- cmd->profile_num = bss_conf->bssid_indicator;
|
||||
+ cmd->nontx_profile_idx = bss_conf->bssid_index;
|
||||
+ cmd->nontx_profile_cnt = bss_conf->bssid_indicator;
|
||||
}
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -2625,9 +2625,9 @@ struct wmi_vdev_up_cmd {
|
||||
u32 vdev_id;
|
||||
u32 vdev_assoc_id;
|
||||
struct wmi_mac_addr vdev_bssid;
|
||||
- struct wmi_mac_addr trans_bssid;
|
||||
- u32 profile_idx;
|
||||
- u32 profile_num;
|
||||
+ struct wmi_mac_addr tx_vdev_bssid;
|
||||
+ u32 nontx_profile_idx;
|
||||
+ u32 nontx_profile_cnt;
|
||||
} __packed;
|
||||
|
||||
struct wmi_vdev_stop_cmd {
|
||||
@ -0,0 +1,138 @@
|
||||
From c82dc33f252fd8883be66f2d0230af0fd734c683 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:27 +0300
|
||||
Subject: [PATCH 74/77] wifi: ath11k: MBSSID parameter configuration in AP mode
|
||||
|
||||
Include MBSSID parameters in WMI vdev up operation.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 29 +++++++++++++++++++++------
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 8 +++++++-
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 3 ++-
|
||||
3 files changed, 32 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -964,7 +964,7 @@ static int ath11k_mac_monitor_vdev_start
|
||||
return ret;
|
||||
}
|
||||
|
||||
- ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr);
|
||||
+ ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr, NULL, 0, 0);
|
||||
if (ret) {
|
||||
ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n",
|
||||
vdev_id, ret);
|
||||
@@ -1423,6 +1423,7 @@ static void ath11k_control_beaconing(str
|
||||
struct ieee80211_bss_conf *info)
|
||||
{
|
||||
struct ath11k *ar = arvif->ar;
|
||||
+ struct ath11k_vif *tx_arvif = NULL;
|
||||
int ret = 0;
|
||||
|
||||
lockdep_assert_held(&arvif->ar->conf_mutex);
|
||||
@@ -1451,8 +1452,14 @@ static void ath11k_control_beaconing(str
|
||||
|
||||
ether_addr_copy(arvif->bssid, info->bssid);
|
||||
|
||||
+ if (arvif->vif->mbssid_tx_vif)
|
||||
+ tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
|
||||
+
|
||||
ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
|
||||
- arvif->bssid);
|
||||
+ arvif->bssid,
|
||||
+ tx_arvif ? tx_arvif->bssid : NULL,
|
||||
+ info->bssid_index,
|
||||
+ 1 << info->bssid_indicator);
|
||||
if (ret) {
|
||||
ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
|
||||
arvif->vdev_id, ret);
|
||||
@@ -2879,7 +2886,8 @@ static void ath11k_bss_assoc(struct ieee
|
||||
arvif->aid = vif->cfg.aid;
|
||||
ether_addr_copy(arvif->bssid, bss_conf->bssid);
|
||||
|
||||
- ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid);
|
||||
+ ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid,
|
||||
+ NULL, 0, 0);
|
||||
if (ret) {
|
||||
ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n",
|
||||
arvif->vdev_id, ret);
|
||||
@@ -7133,7 +7141,8 @@ ath11k_mac_update_vif_chan(struct ath11k
|
||||
int n_vifs)
|
||||
{
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
- struct ath11k_vif *arvif;
|
||||
+ struct ath11k_vif *arvif, *tx_arvif = NULL;
|
||||
+ struct ieee80211_vif *mbssid_tx_vif;
|
||||
int ret;
|
||||
int i;
|
||||
bool monitor_vif = false;
|
||||
@@ -7187,8 +7196,15 @@ ath11k_mac_update_vif_chan(struct ath11k
|
||||
ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
|
||||
ret);
|
||||
|
||||
+ mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
|
||||
+ if (mbssid_tx_vif)
|
||||
+ tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
|
||||
+
|
||||
ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
|
||||
- arvif->bssid);
|
||||
+ arvif->bssid,
|
||||
+ tx_arvif ? tx_arvif->bssid : NULL,
|
||||
+ arvif->vif->bss_conf.bssid_index,
|
||||
+ 1 << arvif->vif->bss_conf.bssid_indicator);
|
||||
if (ret) {
|
||||
ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
|
||||
arvif->vdev_id, ret);
|
||||
@@ -7306,7 +7322,8 @@ static int ath11k_start_vdev_delay(struc
|
||||
}
|
||||
|
||||
if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
|
||||
- ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr);
|
||||
+ ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr,
|
||||
+ NULL, 0, 0);
|
||||
if (ret) {
|
||||
ath11k_warn(ab, "failed put monitor up: %d\n", ret);
|
||||
return ret;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -1001,7 +1001,8 @@ int ath11k_wmi_vdev_start(struct ath11k
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
|
||||
+int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid,
|
||||
+ u8 *tx_bssid, u32 nontx_profile_idx, u32 nontx_profile_cnt)
|
||||
{
|
||||
struct ath11k_pdev_wmi *wmi = ar->wmi;
|
||||
struct wmi_vdev_up_cmd *cmd;
|
||||
@@ -1025,6 +1026,11 @@ int ath11k_wmi_vdev_up(struct ath11k *ar
|
||||
|
||||
ether_addr_copy(cmd->vdev_bssid.addr, bssid);
|
||||
|
||||
+ cmd->nontx_profile_idx = nontx_profile_idx;
|
||||
+ cmd->nontx_profile_cnt = nontx_profile_cnt;
|
||||
+ if (tx_bssid)
|
||||
+ ether_addr_copy(cmd->tx_vdev_bssid.addr, tx_bssid);
|
||||
+
|
||||
if (arvif && arvif->vif->type == NL80211_IFTYPE_STATION) {
|
||||
bss_conf = &arvif->vif->bss_conf;
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -6301,7 +6301,8 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a
|
||||
struct sk_buff *bcn);
|
||||
int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id);
|
||||
int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid,
|
||||
- const u8 *bssid);
|
||||
+ const u8 *bssid, u8 *tx_bssid, u32 nontx_profile_idx,
|
||||
+ u32 nontx_profile_cnt);
|
||||
int ath11k_wmi_vdev_stop(struct ath11k *ar, u8 vdev_id);
|
||||
int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,
|
||||
bool restart);
|
||||
@ -0,0 +1,86 @@
|
||||
From cb9bea773c85e372931cd7a177db4165adf29d95 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:28 +0300
|
||||
Subject: [PATCH 75/77] wifi: ath11k: refactor vif parameter configurations
|
||||
|
||||
Security parameters for each non-transmitting profile can be
|
||||
different when MBSSID is enabled and this information is included
|
||||
in the MBSSID element in the Beacon frame. Current implementation
|
||||
to set rsnie_present and wpaie_present does not parse this element
|
||||
hence it applies only to the transmitting interface.
|
||||
|
||||
Move the code to a separate function to make additions for
|
||||
non-transmitting interfaces cleaner.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-6-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 41 ++++++++++++++++-----------
|
||||
1 file changed, 24 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -1351,28 +1351,14 @@ err_mon_del:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
|
||||
+static void ath11k_mac_set_vif_params(struct ath11k_vif *arvif,
|
||||
+ struct sk_buff *bcn)
|
||||
{
|
||||
- struct ath11k *ar = arvif->ar;
|
||||
- struct ath11k_base *ab = ar->ab;
|
||||
- struct ieee80211_hw *hw = ar->hw;
|
||||
- struct ieee80211_vif *vif = arvif->vif;
|
||||
- struct ieee80211_mutable_offsets offs = {};
|
||||
- struct sk_buff *bcn;
|
||||
struct ieee80211_mgmt *mgmt;
|
||||
u8 *ies;
|
||||
- int ret;
|
||||
-
|
||||
- if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
|
||||
- return 0;
|
||||
-
|
||||
- bcn = ieee80211_beacon_get_template(hw, vif, &offs, 0);
|
||||
- if (!bcn) {
|
||||
- ath11k_warn(ab, "failed to get beacon template from mac80211\n");
|
||||
- return -EPERM;
|
||||
- }
|
||||
|
||||
ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn);
|
||||
+ mgmt = (struct ieee80211_mgmt *)bcn->data;
|
||||
ies += sizeof(mgmt->u.beacon);
|
||||
|
||||
if (cfg80211_find_ie(WLAN_EID_RSN, ies, (skb_tail_pointer(bcn) - ies)))
|
||||
@@ -1386,7 +1372,28 @@ static int ath11k_mac_setup_bcn_tmpl(str
|
||||
arvif->wpaie_present = true;
|
||||
else
|
||||
arvif->wpaie_present = false;
|
||||
+}
|
||||
+
|
||||
+static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
|
||||
+{
|
||||
+ struct ath11k *ar = arvif->ar;
|
||||
+ struct ath11k_base *ab = ar->ab;
|
||||
+ struct ieee80211_hw *hw = ar->hw;
|
||||
+ struct ieee80211_vif *vif = arvif->vif;
|
||||
+ struct ieee80211_mutable_offsets offs = {};
|
||||
+ struct sk_buff *bcn;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
|
||||
+ return 0;
|
||||
+
|
||||
+ bcn = ieee80211_beacon_get_template(hw, vif, &offs, 0);
|
||||
+ if (!bcn) {
|
||||
+ ath11k_warn(ab, "failed to get beacon template from mac80211\n");
|
||||
+ return -EPERM;
|
||||
+ }
|
||||
|
||||
+ ath11k_mac_set_vif_params(arvif, bcn);
|
||||
ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn);
|
||||
|
||||
kfree_skb(bcn);
|
||||
@ -0,0 +1,190 @@
|
||||
From 335a92765d308dfe22826f5562cd4b4389b45e71 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:28 +0300
|
||||
Subject: [PATCH 76/77] wifi: ath11k: MBSSID beacon support
|
||||
|
||||
- Split ath11k_mac_setup_bcn_tmpl() to move the beacon retrieval and
|
||||
WMI command to a new function, ath11k_mac_setup_bcn_tmpl_legacy().
|
||||
In the original function add checks to use the transmitting interface
|
||||
when MBSSID is enabled.
|
||||
- Set rsnie_present and wpaie_present fields for the non-transmitting
|
||||
interfaces when MBSSID is enabled.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-7-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 116 ++++++++++++++++++++++++--
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 1 +
|
||||
2 files changed, 112 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -1351,6 +1351,84 @@ err_mon_del:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static void ath11k_mac_setup_nontx_vif_rsnie(struct ath11k_vif *arvif,
|
||||
+ bool tx_arvif_rsnie_present,
|
||||
+ const u8 *profile, u8 profile_len)
|
||||
+{
|
||||
+ if (cfg80211_find_ie(WLAN_EID_RSN, profile, profile_len)) {
|
||||
+ arvif->rsnie_present = true;
|
||||
+ } else if (tx_arvif_rsnie_present) {
|
||||
+ int i;
|
||||
+ u8 nie_len;
|
||||
+ const u8 *nie = cfg80211_find_ext_ie(WLAN_EID_EXT_NON_INHERITANCE,
|
||||
+ profile, profile_len);
|
||||
+ if (!nie)
|
||||
+ return;
|
||||
+
|
||||
+ nie_len = nie[1];
|
||||
+ nie += 2;
|
||||
+ for (i = 0; i < nie_len; i++) {
|
||||
+ if (nie[i] == WLAN_EID_RSN) {
|
||||
+ arvif->rsnie_present = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static bool ath11k_mac_set_nontx_vif_params(struct ath11k_vif *tx_arvif,
|
||||
+ struct ath11k_vif *arvif,
|
||||
+ struct sk_buff *bcn)
|
||||
+{
|
||||
+ struct ieee80211_mgmt *mgmt;
|
||||
+ const u8 *ies, *profile, *next_profile;
|
||||
+ int ies_len;
|
||||
+
|
||||
+ ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn);
|
||||
+ mgmt = (struct ieee80211_mgmt *)bcn->data;
|
||||
+ ies += sizeof(mgmt->u.beacon);
|
||||
+ ies_len = skb_tail_pointer(bcn) - ies;
|
||||
+
|
||||
+ ies = cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ies, ies_len);
|
||||
+ arvif->rsnie_present = tx_arvif->rsnie_present;
|
||||
+
|
||||
+ while (ies) {
|
||||
+ u8 mbssid_len;
|
||||
+
|
||||
+ ies_len -= (2 + ies[1]);
|
||||
+ mbssid_len = ies[1] - 1;
|
||||
+ profile = &ies[3];
|
||||
+
|
||||
+ while (mbssid_len) {
|
||||
+ u8 profile_len;
|
||||
+
|
||||
+ profile_len = profile[1];
|
||||
+ next_profile = profile + (2 + profile_len);
|
||||
+ mbssid_len -= (2 + profile_len);
|
||||
+
|
||||
+ profile += 2;
|
||||
+ profile_len -= (2 + profile[1]);
|
||||
+ profile += (2 + profile[1]); /* nontx capabilities */
|
||||
+ profile_len -= (2 + profile[1]);
|
||||
+ profile += (2 + profile[1]); /* SSID */
|
||||
+ if (profile[2] == arvif->vif->bss_conf.bssid_index) {
|
||||
+ profile_len -= 5;
|
||||
+ profile = profile + 5;
|
||||
+ ath11k_mac_setup_nontx_vif_rsnie(arvif,
|
||||
+ tx_arvif->rsnie_present,
|
||||
+ profile,
|
||||
+ profile_len);
|
||||
+ return true;
|
||||
+ }
|
||||
+ profile = next_profile;
|
||||
+ }
|
||||
+ ies = cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, profile,
|
||||
+ ies_len);
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static void ath11k_mac_set_vif_params(struct ath11k_vif *arvif,
|
||||
struct sk_buff *bcn)
|
||||
{
|
||||
@@ -1374,18 +1452,26 @@ static void ath11k_mac_set_vif_params(st
|
||||
arvif->wpaie_present = false;
|
||||
}
|
||||
|
||||
-static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
|
||||
+static int ath11k_mac_setup_bcn_tmpl_mbssid(struct ath11k_vif *arvif)
|
||||
{
|
||||
struct ath11k *ar = arvif->ar;
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
+ struct ath11k_vif *tx_arvif = arvif;
|
||||
struct ieee80211_hw *hw = ar->hw;
|
||||
struct ieee80211_vif *vif = arvif->vif;
|
||||
struct ieee80211_mutable_offsets offs = {};
|
||||
struct sk_buff *bcn;
|
||||
int ret;
|
||||
|
||||
- if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
|
||||
- return 0;
|
||||
+ if (arvif->vif->mbssid_tx_vif) {
|
||||
+ tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
|
||||
+ if (tx_arvif != arvif) {
|
||||
+ ar = tx_arvif->ar;
|
||||
+ ab = ar->ab;
|
||||
+ hw = ar->hw;
|
||||
+ vif = tx_arvif->vif;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
bcn = ieee80211_beacon_get_template(hw, vif, &offs, 0);
|
||||
if (!bcn) {
|
||||
@@ -1393,9 +1479,12 @@ static int ath11k_mac_setup_bcn_tmpl(str
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
- ath11k_mac_set_vif_params(arvif, bcn);
|
||||
- ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn);
|
||||
+ if (tx_arvif == arvif)
|
||||
+ ath11k_mac_set_vif_params(tx_arvif, bcn);
|
||||
+ else if (!ath11k_mac_set_nontx_vif_params(tx_arvif, arvif, bcn))
|
||||
+ return -EINVAL;
|
||||
|
||||
+ ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn);
|
||||
kfree_skb(bcn);
|
||||
|
||||
if (ret)
|
||||
@@ -1405,6 +1494,23 @@ static int ath11k_mac_setup_bcn_tmpl(str
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
|
||||
+{
|
||||
+ struct ieee80211_vif *vif = arvif->vif;
|
||||
+
|
||||
+ if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Target does not expect beacon templates for the already up
|
||||
+ * non-transmitting interfaces, and results in a crash if sent.
|
||||
+ */
|
||||
+ if (vif->mbssid_tx_vif &&
|
||||
+ arvif != (void *)vif->mbssid_tx_vif->drv_priv && arvif->is_up)
|
||||
+ return 0;
|
||||
+
|
||||
+ return ath11k_mac_setup_bcn_tmpl_mbssid(arvif);
|
||||
+}
|
||||
+
|
||||
void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif)
|
||||
{
|
||||
struct ieee80211_vif *vif = arvif->vif;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -1737,6 +1737,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a
|
||||
}
|
||||
|
||||
cmd->buf_len = bcn->len;
|
||||
+ cmd->mbssid_ie_offset = offs->mbssid_off;
|
||||
|
||||
ptr = skb->data + sizeof(*cmd);
|
||||
|
||||
@ -0,0 +1,156 @@
|
||||
From 87bd401138161008fdb82fbca6e213af117bfeb9 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Fri, 5 May 2023 16:11:28 +0300
|
||||
Subject: [PATCH 77/77] wifi: ath11k: EMA beacon support
|
||||
|
||||
Add new function ath11k_mac_setup_bcn_tmpl_ema() which invokes the new
|
||||
API provided by MAC80211 to retrieve EMA beacons.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230405221648.17950-8-quic_alokad@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 59 ++++++++++++++++++++++++++-
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 3 +-
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 11 ++++-
|
||||
3 files changed, 70 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -1452,6 +1452,60 @@ static void ath11k_mac_set_vif_params(st
|
||||
arvif->wpaie_present = false;
|
||||
}
|
||||
|
||||
+static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif)
|
||||
+{
|
||||
+ struct ath11k_vif *tx_arvif;
|
||||
+ struct ieee80211_ema_beacons *beacons;
|
||||
+ int ret = 0;
|
||||
+ bool nontx_vif_params_set = false;
|
||||
+ u32 params = 0;
|
||||
+ u8 i = 0;
|
||||
+
|
||||
+ tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
|
||||
+
|
||||
+ beacons = ieee80211_beacon_get_template_ema_list(tx_arvif->ar->hw,
|
||||
+ tx_arvif->vif, 0);
|
||||
+ if (!beacons || !beacons->cnt) {
|
||||
+ ath11k_warn(arvif->ar->ab,
|
||||
+ "failed to get ema beacon templates from mac80211\n");
|
||||
+ return -EPERM;
|
||||
+ }
|
||||
+
|
||||
+ if (tx_arvif == arvif)
|
||||
+ ath11k_mac_set_vif_params(tx_arvif, beacons->bcn[0].skb);
|
||||
+ else
|
||||
+ arvif->wpaie_present = tx_arvif->wpaie_present;
|
||||
+
|
||||
+ for (i = 0; i < beacons->cnt; i++) {
|
||||
+ if (tx_arvif != arvif && !nontx_vif_params_set)
|
||||
+ nontx_vif_params_set =
|
||||
+ ath11k_mac_set_nontx_vif_params(tx_arvif, arvif,
|
||||
+ beacons->bcn[i].skb);
|
||||
+
|
||||
+ params = beacons->cnt;
|
||||
+ params |= (i << WMI_EMA_TMPL_IDX_SHIFT);
|
||||
+ params |= ((!i ? 1 : 0) << WMI_EMA_FIRST_TMPL_SHIFT);
|
||||
+ params |= ((i + 1 == beacons->cnt ? 1 : 0) << WMI_EMA_LAST_TMPL_SHIFT);
|
||||
+
|
||||
+ ret = ath11k_wmi_bcn_tmpl(tx_arvif->ar, tx_arvif->vdev_id,
|
||||
+ &beacons->bcn[i].offs,
|
||||
+ beacons->bcn[i].skb, params);
|
||||
+ if (ret) {
|
||||
+ ath11k_warn(tx_arvif->ar->ab,
|
||||
+ "failed to set ema beacon template id %i error %d\n",
|
||||
+ i, ret);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ieee80211_beacon_free_ema_list(beacons);
|
||||
+
|
||||
+ if (tx_arvif != arvif && !nontx_vif_params_set)
|
||||
+ return -EINVAL; /* Profile not found in the beacons */
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int ath11k_mac_setup_bcn_tmpl_mbssid(struct ath11k_vif *arvif)
|
||||
{
|
||||
struct ath11k *ar = arvif->ar;
|
||||
@@ -1484,7 +1538,7 @@ static int ath11k_mac_setup_bcn_tmpl_mbs
|
||||
else if (!ath11k_mac_set_nontx_vif_params(tx_arvif, arvif, bcn))
|
||||
return -EINVAL;
|
||||
|
||||
- ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn);
|
||||
+ ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn, 0);
|
||||
kfree_skb(bcn);
|
||||
|
||||
if (ret)
|
||||
@@ -1508,6 +1562,9 @@ static int ath11k_mac_setup_bcn_tmpl(str
|
||||
arvif != (void *)vif->mbssid_tx_vif->drv_priv && arvif->is_up)
|
||||
return 0;
|
||||
|
||||
+ if (vif->bss_conf.ema_ap && vif->mbssid_tx_vif)
|
||||
+ return ath11k_mac_setup_bcn_tmpl_ema(arvif);
|
||||
+
|
||||
return ath11k_mac_setup_bcn_tmpl_mbssid(arvif);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -1699,7 +1699,7 @@ int ath11k_wmi_send_bcn_offload_control_
|
||||
|
||||
int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id,
|
||||
struct ieee80211_mutable_offsets *offs,
|
||||
- struct sk_buff *bcn)
|
||||
+ struct sk_buff *bcn, u32 ema_params)
|
||||
{
|
||||
struct ath11k_pdev_wmi *wmi = ar->wmi;
|
||||
struct wmi_bcn_tmpl_cmd *cmd;
|
||||
@@ -1738,6 +1738,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a
|
||||
|
||||
cmd->buf_len = bcn->len;
|
||||
cmd->mbssid_ie_offset = offs->mbssid_off;
|
||||
+ cmd->ema_params = ema_params;
|
||||
|
||||
ptr = skb->data + sizeof(*cmd);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -3566,6 +3566,10 @@ struct wmi_get_pdev_temperature_cmd {
|
||||
|
||||
#define WMI_BEACON_TX_BUFFER_SIZE 512
|
||||
|
||||
+#define WMI_EMA_TMPL_IDX_SHIFT 8
|
||||
+#define WMI_EMA_FIRST_TMPL_SHIFT 16
|
||||
+#define WMI_EMA_LAST_TMPL_SHIFT 24
|
||||
+
|
||||
struct wmi_bcn_tmpl_cmd {
|
||||
u32 tlv_header;
|
||||
u32 vdev_id;
|
||||
@@ -3576,6 +3580,11 @@ struct wmi_bcn_tmpl_cmd {
|
||||
u32 csa_event_bitmap;
|
||||
u32 mbssid_ie_offset;
|
||||
u32 esp_ie_offset;
|
||||
+ u32 csc_switch_count_offset;
|
||||
+ u32 csc_event_bitmap;
|
||||
+ u32 mu_edca_ie_offset;
|
||||
+ u32 feature_enable_bitmap;
|
||||
+ u32 ema_params;
|
||||
} __packed;
|
||||
|
||||
struct wmi_key_seq_counter {
|
||||
@@ -6298,7 +6307,7 @@ int ath11k_wmi_mgmt_send(struct ath11k *
|
||||
struct sk_buff *frame);
|
||||
int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id,
|
||||
struct ieee80211_mutable_offsets *offs,
|
||||
- struct sk_buff *bcn);
|
||||
+ struct sk_buff *bcn, u32 ema_param);
|
||||
int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id);
|
||||
int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid,
|
||||
const u8 *bssid, u8 *tx_bssid, u32 nontx_profile_idx,
|
||||
@ -0,0 +1,75 @@
|
||||
From 570eec3d40505c30babbe3b8f85a38496c975ab2 Mon Sep 17 00:00:00 2001
|
||||
From: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
||||
Date: Tue, 9 May 2023 20:07:23 +0300
|
||||
Subject: [PATCH] wifi: ath11k: Relocate the func
|
||||
ath11k_mac_bitrate_mask_num_ht_rates() and change hweight16 to hweight8
|
||||
|
||||
Relocate the function ath11k_mac_bitrate_mask_num_ht_rates() definition
|
||||
to call this function from other functions which helps to avoid the
|
||||
compilation error (function not defined).
|
||||
|
||||
ht_mcs[] is 1 byte array and it is enough to use hweight8() instead
|
||||
of hweight16(). Hence, fixed the same.
|
||||
|
||||
Tested on: Compile tested only.
|
||||
|
||||
Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 30 +++++++++++++--------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <net/mac80211.h>
|
||||
@@ -4338,6 +4338,20 @@ exit:
|
||||
}
|
||||
|
||||
static int
|
||||
+ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
|
||||
+ enum nl80211_band band,
|
||||
+ const struct cfg80211_bitrate_mask *mask)
|
||||
+{
|
||||
+ int num_rates = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
|
||||
+ num_rates += hweight8(mask->control[band].ht_mcs[i]);
|
||||
+
|
||||
+ return num_rates;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
ath11k_mac_bitrate_mask_num_vht_rates(struct ath11k *ar,
|
||||
enum nl80211_band band,
|
||||
const struct cfg80211_bitrate_mask *mask)
|
||||
@@ -7791,20 +7805,6 @@ static void ath11k_mac_op_flush(struct i
|
||||
ath11k_mac_flush_tx_complete(ar);
|
||||
}
|
||||
|
||||
-static int
|
||||
-ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
|
||||
- enum nl80211_band band,
|
||||
- const struct cfg80211_bitrate_mask *mask)
|
||||
-{
|
||||
- int num_rates = 0;
|
||||
- int i;
|
||||
-
|
||||
- for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
|
||||
- num_rates += hweight16(mask->control[band].ht_mcs[i]);
|
||||
-
|
||||
- return num_rates;
|
||||
-}
|
||||
-
|
||||
static bool
|
||||
ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
|
||||
enum nl80211_band band,
|
||||
@ -0,0 +1,141 @@
|
||||
From df8e3729ffc0aa645839693f74ee7b6d999cdf64 Mon Sep 17 00:00:00 2001
|
||||
From: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
||||
Date: Tue, 9 May 2023 20:07:24 +0300
|
||||
Subject: [PATCH] wifi: ath11k: Send HT fixed rate in WMI peer fixed param
|
||||
|
||||
Due to the firmware behavior with HT fixed rate setting,
|
||||
HT fixed rate MCS with NSS > 1 are treated as NSS = 1
|
||||
HT rates in the firmware and enables the HT fixed rate of
|
||||
NSS = 1.
|
||||
|
||||
This leads to HT fixed rate is always configured for NSS = 1
|
||||
even though the user sets NSS = 2 or > 1 HT fixed MCS in the
|
||||
set bitrate command.
|
||||
|
||||
Currently HT fixed MCS is sent via WMI peer assoc command.
|
||||
Fix this issue, by sending the HT fixed rate MCS in WMI peer
|
||||
fixed param instead of sending in peer assoc command.
|
||||
|
||||
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 63 ++++++++++++++++++++++++++-
|
||||
1 file changed, 61 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -4480,6 +4480,54 @@ ath11k_mac_set_peer_he_fixed_rate(struct
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int
|
||||
+ath11k_mac_set_peer_ht_fixed_rate(struct ath11k_vif *arvif,
|
||||
+ struct ieee80211_sta *sta,
|
||||
+ const struct cfg80211_bitrate_mask *mask,
|
||||
+ enum nl80211_band band)
|
||||
+{
|
||||
+ struct ath11k *ar = arvif->ar;
|
||||
+ u8 ht_rate, nss = 0;
|
||||
+ u32 rate_code;
|
||||
+ int ret, i;
|
||||
+
|
||||
+ lockdep_assert_held(&ar->conf_mutex);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++) {
|
||||
+ if (hweight8(mask->control[band].ht_mcs[i]) == 1) {
|
||||
+ nss = i + 1;
|
||||
+ ht_rate = ffs(mask->control[band].ht_mcs[i]) - 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!nss) {
|
||||
+ ath11k_warn(ar->ab, "No single HT Fixed rate found to set for %pM",
|
||||
+ sta->addr);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ /* Avoid updating invalid nss as fixed rate*/
|
||||
+ if (nss > sta->deflink.rx_nss)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
|
||||
+ "Setting Fixed HT Rate for peer %pM. Device will not switch to any other selected rates",
|
||||
+ sta->addr);
|
||||
+
|
||||
+ rate_code = ATH11K_HW_RATE_CODE(ht_rate, nss - 1,
|
||||
+ WMI_RATE_PREAMBLE_HT);
|
||||
+ ret = ath11k_wmi_set_peer_param(ar, sta->addr,
|
||||
+ arvif->vdev_id,
|
||||
+ WMI_PEER_PARAM_FIXED_RATE,
|
||||
+ rate_code);
|
||||
+ if (ret)
|
||||
+ ath11k_warn(ar->ab,
|
||||
+ "failed to update STA %pM HT Fixed Rate %d: %d\n",
|
||||
+ sta->addr, rate_code, ret);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int ath11k_station_assoc(struct ath11k *ar,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta,
|
||||
@@ -4491,7 +4539,7 @@ static int ath11k_station_assoc(struct a
|
||||
struct cfg80211_chan_def def;
|
||||
enum nl80211_band band;
|
||||
struct cfg80211_bitrate_mask *mask;
|
||||
- u8 num_vht_rates, num_he_rates;
|
||||
+ u8 num_ht_rates, num_vht_rates, num_he_rates;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
|
||||
@@ -4519,6 +4567,7 @@ static int ath11k_station_assoc(struct a
|
||||
|
||||
num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask);
|
||||
num_he_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band, mask);
|
||||
+ num_ht_rates = ath11k_mac_bitrate_mask_num_ht_rates(ar, band, mask);
|
||||
|
||||
/* If single VHT/HE rate is configured (by set_bitrate_mask()),
|
||||
* peer_assoc will disable VHT/HE. This is now enabled by a peer specific
|
||||
@@ -4535,6 +4584,11 @@ static int ath11k_station_assoc(struct a
|
||||
band);
|
||||
if (ret)
|
||||
return ret;
|
||||
+ } else if (sta->deflink.ht_cap.ht_supported && num_ht_rates == 1) {
|
||||
+ ret = ath11k_mac_set_peer_ht_fixed_rate(arvif, sta, mask,
|
||||
+ band);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/* Re-assoc is run only to update supported rates for given station. It
|
||||
@@ -4608,7 +4662,7 @@ static void ath11k_sta_rc_update_wk(stru
|
||||
const u16 *vht_mcs_mask;
|
||||
const u16 *he_mcs_mask;
|
||||
u32 changed, bw, nss, smps, bw_prev;
|
||||
- int err, num_vht_rates, num_he_rates;
|
||||
+ int err, num_ht_rates, num_vht_rates, num_he_rates;
|
||||
const struct cfg80211_bitrate_mask *mask;
|
||||
struct peer_assoc_params peer_arg;
|
||||
enum wmi_phy_mode peer_phymode;
|
||||
@@ -4724,6 +4778,8 @@ static void ath11k_sta_rc_update_wk(stru
|
||||
|
||||
if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) {
|
||||
mask = &arvif->bitrate_mask;
|
||||
+ num_ht_rates = ath11k_mac_bitrate_mask_num_ht_rates(ar, band,
|
||||
+ mask);
|
||||
num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band,
|
||||
mask);
|
||||
num_he_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band,
|
||||
@@ -4746,6 +4802,9 @@ static void ath11k_sta_rc_update_wk(stru
|
||||
} else if (sta->deflink.he_cap.has_he && num_he_rates == 1) {
|
||||
ath11k_mac_set_peer_he_fixed_rate(arvif, sta, mask,
|
||||
band);
|
||||
+ } else if (sta->deflink.ht_cap.ht_supported && num_ht_rates == 1) {
|
||||
+ ath11k_mac_set_peer_ht_fixed_rate(arvif, sta, mask,
|
||||
+ band);
|
||||
} else {
|
||||
/* If the peer is non-VHT/HE or no fixed VHT/HE rate
|
||||
* is provided in the new bitrate mask we set the
|
||||
@ -0,0 +1,127 @@
|
||||
From 88ca89202f8e8afb5225eb5244d79cd67c15d744 Mon Sep 17 00:00:00 2001
|
||||
From: Wen Gong <quic_wgong@quicinc.com>
|
||||
Date: Fri, 26 May 2023 12:41:06 +0300
|
||||
Subject: [PATCH] wifi: ath11k: add support default regdb while searching
|
||||
board-2.bin for WCN6855
|
||||
|
||||
Sometimes board-2.bin does not have the regdb data which matched the
|
||||
parameters such as vendor, device, subsystem-vendor, subsystem-device
|
||||
and etc. Add default regdb data with 'bus=%s' into board-2.bin for
|
||||
WCN6855, then ath11k use 'bus=pci' to search regdb data in board-2.bin
|
||||
for WCN6855.
|
||||
|
||||
kernel: [ 122.515808] ath11k_pci 0000:03:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
|
||||
kernel: [ 122.517240] ath11k_pci 0000:03:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 6179564
|
||||
kernel: [ 122.517280] ath11k_pci 0000:03:00.0: failed to fetch regdb data for bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262 from ath11k/WCN6855/hw2.0/board-2.bin
|
||||
kernel: [ 122.517464] ath11k_pci 0000:03:00.0: boot using board name 'bus=pci'
|
||||
kernel: [ 122.518901] ath11k_pci 0000:03:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 6179564
|
||||
kernel: [ 122.518915] ath11k_pci 0000:03:00.0: board name
|
||||
kernel: [ 122.518917] ath11k_pci 0000:03:00.0: 00000000: 62 75 73 3d 70 63 69 bus=pci
|
||||
kernel: [ 122.518918] ath11k_pci 0000:03:00.0: boot found match regdb data for name 'bus=pci'
|
||||
kernel: [ 122.518920] ath11k_pci 0000:03:00.0: boot found regdb data for 'bus=pci'
|
||||
kernel: [ 122.518921] ath11k_pci 0000:03:00.0: fetched regdb
|
||||
|
||||
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
|
||||
|
||||
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230517133959.8224-1-quic_wgong@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/core.c | 53 +++++++++++++++++++-------
|
||||
1 file changed, 40 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -961,7 +961,8 @@ int ath11k_core_check_dt(struct ath11k_b
|
||||
}
|
||||
|
||||
static int __ath11k_core_create_board_name(struct ath11k_base *ab, char *name,
|
||||
- size_t name_len, bool with_variant)
|
||||
+ size_t name_len, bool with_variant,
|
||||
+ bool bus_type_mode)
|
||||
{
|
||||
/* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */
|
||||
char variant[9 + ATH11K_QMI_BDF_EXT_STR_LENGTH] = { 0 };
|
||||
@@ -972,15 +973,20 @@ static int __ath11k_core_create_board_na
|
||||
|
||||
switch (ab->id.bdf_search) {
|
||||
case ATH11K_BDF_SEARCH_BUS_AND_BOARD:
|
||||
- scnprintf(name, name_len,
|
||||
- "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s",
|
||||
- ath11k_bus_str(ab->hif.bus),
|
||||
- ab->id.vendor, ab->id.device,
|
||||
- ab->id.subsystem_vendor,
|
||||
- ab->id.subsystem_device,
|
||||
- ab->qmi.target.chip_id,
|
||||
- ab->qmi.target.board_id,
|
||||
- variant);
|
||||
+ if (bus_type_mode)
|
||||
+ scnprintf(name, name_len,
|
||||
+ "bus=%s",
|
||||
+ ath11k_bus_str(ab->hif.bus));
|
||||
+ else
|
||||
+ scnprintf(name, name_len,
|
||||
+ "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s",
|
||||
+ ath11k_bus_str(ab->hif.bus),
|
||||
+ ab->id.vendor, ab->id.device,
|
||||
+ ab->id.subsystem_vendor,
|
||||
+ ab->id.subsystem_device,
|
||||
+ ab->qmi.target.chip_id,
|
||||
+ ab->qmi.target.board_id,
|
||||
+ variant);
|
||||
break;
|
||||
default:
|
||||
scnprintf(name, name_len,
|
||||
@@ -999,13 +1005,19 @@ static int __ath11k_core_create_board_na
|
||||
static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name,
|
||||
size_t name_len)
|
||||
{
|
||||
- return __ath11k_core_create_board_name(ab, name, name_len, true);
|
||||
+ return __ath11k_core_create_board_name(ab, name, name_len, true, false);
|
||||
}
|
||||
|
||||
static int ath11k_core_create_fallback_board_name(struct ath11k_base *ab, char *name,
|
||||
size_t name_len)
|
||||
{
|
||||
- return __ath11k_core_create_board_name(ab, name, name_len, false);
|
||||
+ return __ath11k_core_create_board_name(ab, name, name_len, false, false);
|
||||
+}
|
||||
+
|
||||
+static int ath11k_core_create_bus_type_board_name(struct ath11k_base *ab, char *name,
|
||||
+ size_t name_len)
|
||||
+{
|
||||
+ return __ath11k_core_create_board_name(ab, name, name_len, false, true);
|
||||
}
|
||||
|
||||
const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
|
||||
@@ -1309,7 +1321,7 @@ success:
|
||||
|
||||
int ath11k_core_fetch_regdb(struct ath11k_base *ab, struct ath11k_board_data *bd)
|
||||
{
|
||||
- char boardname[BOARD_NAME_SIZE];
|
||||
+ char boardname[BOARD_NAME_SIZE], default_boardname[BOARD_NAME_SIZE];
|
||||
int ret;
|
||||
|
||||
ret = ath11k_core_create_board_name(ab, boardname, BOARD_NAME_SIZE);
|
||||
@@ -1323,6 +1335,21 @@ int ath11k_core_fetch_regdb(struct ath11
|
||||
ATH11K_BD_IE_REGDB,
|
||||
ATH11K_BD_IE_REGDB_NAME,
|
||||
ATH11K_BD_IE_REGDB_DATA);
|
||||
+ if (!ret)
|
||||
+ goto exit;
|
||||
+
|
||||
+ ret = ath11k_core_create_bus_type_board_name(ab, default_boardname,
|
||||
+ BOARD_NAME_SIZE);
|
||||
+ if (ret) {
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_BOOT,
|
||||
+ "failed to create default board name for regdb: %d", ret);
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ ret = ath11k_core_fetch_board_data_api_n(ab, bd, default_boardname,
|
||||
+ ATH11K_BD_IE_REGDB,
|
||||
+ ATH11K_BD_IE_REGDB_NAME,
|
||||
+ ATH11K_BD_IE_REGDB_DATA);
|
||||
if (!ret)
|
||||
goto exit;
|
||||
|
||||
@ -0,0 +1,128 @@
|
||||
From 86f85575a3f6a20cef1c8bb98e78585fe3a53ccc Mon Sep 17 00:00:00 2001
|
||||
From: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
|
||||
Date: Fri, 26 May 2023 12:41:06 +0300
|
||||
Subject: [PATCH 82/84] wifi: ath11k: remove unused function
|
||||
ath11k_tm_event_wmi()
|
||||
|
||||
The function ath11k_tm_event_wmi() is only defined and it is not used
|
||||
anywhere. Hence remove the unused.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
|
||||
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230517135934.16408-2-quic_rajkbhag@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/testmode.c | 64 +---------------------
|
||||
drivers/net/wireless/ath/ath11k/testmode.h | 8 +--
|
||||
2 files changed, 2 insertions(+), 70 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/testmode.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/testmode.c
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "testmode.h"
|
||||
@@ -20,69 +21,6 @@ static const struct nla_policy ath11k_tm
|
||||
[ATH11K_TM_ATTR_VERSION_MINOR] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
-/* Returns true if callee consumes the skb and the skb should be discarded.
|
||||
- * Returns false if skb is not used. Does not sleep.
|
||||
- */
|
||||
-bool ath11k_tm_event_wmi(struct ath11k *ar, u32 cmd_id, struct sk_buff *skb)
|
||||
-{
|
||||
- struct sk_buff *nl_skb;
|
||||
- bool consumed;
|
||||
- int ret;
|
||||
-
|
||||
- ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
|
||||
- "testmode event wmi cmd_id %d skb %pK skb->len %d\n",
|
||||
- cmd_id, skb, skb->len);
|
||||
-
|
||||
- ath11k_dbg_dump(ar->ab, ATH11K_DBG_TESTMODE, NULL, "", skb->data, skb->len);
|
||||
-
|
||||
- spin_lock_bh(&ar->data_lock);
|
||||
-
|
||||
- consumed = true;
|
||||
-
|
||||
- nl_skb = cfg80211_testmode_alloc_event_skb(ar->hw->wiphy,
|
||||
- 2 * sizeof(u32) + skb->len,
|
||||
- GFP_ATOMIC);
|
||||
- if (!nl_skb) {
|
||||
- ath11k_warn(ar->ab,
|
||||
- "failed to allocate skb for testmode wmi event\n");
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- ret = nla_put_u32(nl_skb, ATH11K_TM_ATTR_CMD, ATH11K_TM_CMD_WMI);
|
||||
- if (ret) {
|
||||
- ath11k_warn(ar->ab,
|
||||
- "failed to put testmode wmi event cmd attribute: %d\n",
|
||||
- ret);
|
||||
- kfree_skb(nl_skb);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- ret = nla_put_u32(nl_skb, ATH11K_TM_ATTR_WMI_CMDID, cmd_id);
|
||||
- if (ret) {
|
||||
- ath11k_warn(ar->ab,
|
||||
- "failed to put testmode wmi even cmd_id: %d\n",
|
||||
- ret);
|
||||
- kfree_skb(nl_skb);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- ret = nla_put(nl_skb, ATH11K_TM_ATTR_DATA, skb->len, skb->data);
|
||||
- if (ret) {
|
||||
- ath11k_warn(ar->ab,
|
||||
- "failed to copy skb to testmode wmi event: %d\n",
|
||||
- ret);
|
||||
- kfree_skb(nl_skb);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
|
||||
-
|
||||
-out:
|
||||
- spin_unlock_bh(&ar->data_lock);
|
||||
-
|
||||
- return consumed;
|
||||
-}
|
||||
-
|
||||
static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[])
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
--- a/drivers/net/wireless/ath/ath11k/testmode.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/testmode.h
|
||||
@@ -1,24 +1,18 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "core.h"
|
||||
|
||||
#ifdef CPTCFG_NL80211_TESTMODE
|
||||
|
||||
-bool ath11k_tm_event_wmi(struct ath11k *ar, u32 cmd_id, struct sk_buff *skb);
|
||||
int ath11k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
void *data, int len);
|
||||
|
||||
#else
|
||||
|
||||
-static inline bool ath11k_tm_event_wmi(struct ath11k *ar, u32 cmd_id,
|
||||
- struct sk_buff *skb)
|
||||
-{
|
||||
- return false;
|
||||
-}
|
||||
-
|
||||
static inline int ath11k_tm_cmd(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
void *data, int len)
|
||||
@ -0,0 +1,850 @@
|
||||
From b43310e44edc823a7f02af1e1e2b4e8a9abc7d91 Mon Sep 17 00:00:00 2001
|
||||
From: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
|
||||
Date: Fri, 26 May 2023 12:41:07 +0300
|
||||
Subject: [PATCH 83/84] wifi: ath11k: factory test mode support
|
||||
|
||||
Add support to process factory test mode commands (FTM) for calibration.
|
||||
By default firmware start with NORMAL mode and to process the FTM commands
|
||||
firmware needs to be restarted in FTM mode using module parameter ftm_mode.
|
||||
The pre-request is all the radios should be down before starting the test.
|
||||
|
||||
When start command ATH11K_TM_CMD_TESTMODE_START is received, ar->state
|
||||
is set to Test Mode. If the FTM command or event length is greater
|
||||
than 256 bytes, it will be broken down into multiple segments and
|
||||
encoded with TLV header if it is segmented commands, else it is sent
|
||||
to firmware as it is.
|
||||
|
||||
On receiving UTF event from firmware, if it is segmented event, the driver
|
||||
will wait until it receives all the segments and notify the complete
|
||||
data to user application. In case the segmented sequence are missed or
|
||||
lost from the firmware, driver will skip the already received partial data.
|
||||
|
||||
In case of unsegmented UTF event from firmware, driver notifies the
|
||||
data to the user application as it comes. Applications handles
|
||||
the data further.
|
||||
|
||||
Command to boot in ftm mode:
|
||||
|
||||
insmod ath11k ftm_mode=1
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
|
||||
Co-developed-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
|
||||
Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
|
||||
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230517135934.16408-4-quic_rajkbhag@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/ahb.c | 3 +-
|
||||
drivers/net/wireless/ath/ath11k/core.c | 21 +-
|
||||
drivers/net/wireless/ath/ath11k/core.h | 16 +-
|
||||
drivers/net/wireless/ath/ath11k/debug.h | 1 +
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 11 +-
|
||||
drivers/net/wireless/ath/ath11k/pci.c | 3 +-
|
||||
drivers/net/wireless/ath/ath11k/testmode.c | 350 ++++++++++++++++++-
|
||||
drivers/net/wireless/ath/ath11k/testmode.h | 6 +
|
||||
drivers/net/wireless/ath/ath11k/testmode_i.h | 18 +-
|
||||
drivers/net/wireless/ath/ath11k/wmi.c | 11 +-
|
||||
drivers/net/wireless/ath/ath11k/wmi.h | 22 ++
|
||||
drivers/net/wireless/ath/ath11k/wow.c | 3 +-
|
||||
12 files changed, 444 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -1155,6 +1155,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
ab->hif.ops = hif_ops;
|
||||
ab->pdev = pdev;
|
||||
ab->hw_rev = hw_rev;
|
||||
+ ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;
|
||||
platform_set_drvdata(pdev, ab);
|
||||
|
||||
ret = ath11k_pcic_register_pci_ops(ab, pci_ops);
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -32,6 +32,10 @@ module_param_named(frame_mode, ath11k_fr
|
||||
MODULE_PARM_DESC(frame_mode,
|
||||
"Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)");
|
||||
|
||||
+bool ath11k_ftm_mode;
|
||||
+module_param_named(ftm_mode, ath11k_ftm_mode, bool, 0444);
|
||||
+MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode");
|
||||
+
|
||||
static const struct ath11k_hw_params ath11k_hw_params[] = {
|
||||
{
|
||||
.hw_rev = ATH11K_HW_IPQ8074,
|
||||
@@ -1381,6 +1385,11 @@ static int ath11k_core_soc_create(struct
|
||||
{
|
||||
int ret;
|
||||
|
||||
+ if (ath11k_ftm_mode) {
|
||||
+ ab->fw_mode = ATH11K_FIRMWARE_MODE_FTM;
|
||||
+ ath11k_info(ab, "Booting in factory test mode\n");
|
||||
+ }
|
||||
+
|
||||
ret = ath11k_qmi_init_service(ab);
|
||||
if (ret) {
|
||||
ath11k_err(ab, "failed to initialize qmi :%d\n", ret);
|
||||
@@ -1607,7 +1616,7 @@ int ath11k_core_qmi_firmware_ready(struc
|
||||
{
|
||||
int ret;
|
||||
|
||||
- ret = ath11k_core_start_firmware(ab, ATH11K_FIRMWARE_MODE_NORMAL);
|
||||
+ ret = ath11k_core_start_firmware(ab, ab->fw_mode);
|
||||
if (ret) {
|
||||
ath11k_err(ab, "failed to start firmware: %d\n", ret);
|
||||
return ret;
|
||||
@@ -1772,7 +1781,8 @@ void ath11k_core_pre_reconfigure_recover
|
||||
for (i = 0; i < ab->num_radios; i++) {
|
||||
pdev = &ab->pdevs[i];
|
||||
ar = pdev->ar;
|
||||
- if (!ar || ar->state == ATH11K_STATE_OFF)
|
||||
+ if (!ar || ar->state == ATH11K_STATE_OFF ||
|
||||
+ ar->state == ATH11K_STATE_FTM)
|
||||
continue;
|
||||
|
||||
ieee80211_stop_queues(ar->hw);
|
||||
@@ -1841,7 +1851,12 @@ static void ath11k_core_post_reconfigure
|
||||
ath11k_warn(ab,
|
||||
"device is wedged, will not restart radio %d\n", i);
|
||||
break;
|
||||
+ case ATH11K_STATE_FTM:
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
|
||||
+ "fw mode reset done radio %d\n", i);
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
}
|
||||
complete(&ab->driver_recovery);
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef ATH11K_CORE_H
|
||||
@@ -52,6 +52,7 @@
|
||||
#define ATH11K_SMBIOS_BDF_EXT_MAGIC "BDF_"
|
||||
|
||||
extern unsigned int ath11k_frame_mode;
|
||||
+extern bool ath11k_ftm_mode;
|
||||
|
||||
#define ATH11K_SCAN_TIMEOUT_HZ (20 * HZ)
|
||||
|
||||
@@ -277,6 +278,7 @@ enum ath11k_dev_flags {
|
||||
ATH11K_FLAG_FIXED_MEM_RGN,
|
||||
ATH11K_FLAG_DEVICE_INIT_DONE,
|
||||
ATH11K_FLAG_MULTI_MSI_VECTORS,
|
||||
+ ATH11K_FLAG_FTM_SEGMENTED,
|
||||
};
|
||||
|
||||
enum ath11k_monitor_flags {
|
||||
@@ -530,6 +532,7 @@ enum ath11k_state {
|
||||
ATH11K_STATE_RESTARTING,
|
||||
ATH11K_STATE_RESTARTED,
|
||||
ATH11K_STATE_WEDGED,
|
||||
+ ATH11K_STATE_FTM,
|
||||
/* Add other states as required */
|
||||
};
|
||||
|
||||
@@ -709,6 +712,8 @@ struct ath11k {
|
||||
u32 last_ppdu_id;
|
||||
u32 cached_ppdu_id;
|
||||
int monitor_vdev_id;
|
||||
+ struct completion fw_mode_reset;
|
||||
+ u8 ftm_msgref;
|
||||
#ifdef CPTCFG_ATH11K_DEBUGFS
|
||||
struct ath11k_debug debug;
|
||||
#endif
|
||||
@@ -838,6 +843,7 @@ struct ath11k_msi_config {
|
||||
/* Master structure to hold the hw data which may be used in core module */
|
||||
struct ath11k_base {
|
||||
enum ath11k_hw_rev hw_rev;
|
||||
+ enum ath11k_firmware_mode fw_mode;
|
||||
struct platform_device *pdev;
|
||||
struct device *dev;
|
||||
struct ath11k_qmi qmi;
|
||||
@@ -978,6 +984,14 @@ struct ath11k_base {
|
||||
const struct ath11k_pci_ops *ops;
|
||||
} pci;
|
||||
|
||||
+#ifdef CPTCFG_NL80211_TESTMODE
|
||||
+ struct {
|
||||
+ u32 data_pos;
|
||||
+ u32 expected_seq;
|
||||
+ u8 *eventdata;
|
||||
+ } testmode;
|
||||
+#endif
|
||||
+
|
||||
/* must be last */
|
||||
u8 drv_priv[] __aligned(sizeof(void *));
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath11k/debug.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debug.h
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _ATH11K_DEBUG_H_
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -643,7 +643,10 @@ struct ath11k *ath11k_mac_get_ar_by_pdev
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ab->num_radios; i++) {
|
||||
- pdev = rcu_dereference(ab->pdevs_active[i]);
|
||||
+ if (ab->fw_mode == ATH11K_FIRMWARE_MODE_FTM)
|
||||
+ pdev = &ab->pdevs[i];
|
||||
+ else
|
||||
+ pdev = rcu_dereference(ab->pdevs_active[i]);
|
||||
|
||||
if (pdev && pdev->pdev_id == pdev_id)
|
||||
return (pdev->ar ? pdev->ar : NULL);
|
||||
@@ -6271,6 +6274,11 @@ static int ath11k_mac_op_start(struct ie
|
||||
struct ath11k_pdev *pdev = ar->pdev;
|
||||
int ret;
|
||||
|
||||
+ if (ath11k_ftm_mode) {
|
||||
+ ath11k_warn(ab, "mac operations not supported in factory test mode\n");
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
ath11k_mac_drain_tx(ar);
|
||||
mutex_lock(&ar->conf_mutex);
|
||||
|
||||
@@ -6285,6 +6293,7 @@ static int ath11k_mac_op_start(struct ie
|
||||
case ATH11K_STATE_RESTARTED:
|
||||
case ATH11K_STATE_WEDGED:
|
||||
case ATH11K_STATE_ON:
|
||||
+ case ATH11K_STATE_FTM:
|
||||
WARN_ON(1);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -745,6 +745,7 @@ static int ath11k_pci_probe(struct pci_d
|
||||
ab_pci->ab = ab;
|
||||
ab_pci->pdev = pdev;
|
||||
ab->hif.ops = &ath11k_pci_hif_ops;
|
||||
+ ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;
|
||||
pci_set_drvdata(pdev, ab);
|
||||
spin_lock_init(&ab_pci->window_lock);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/testmode.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/testmode.c
|
||||
@@ -12,6 +12,9 @@
|
||||
#include "core.h"
|
||||
#include "testmode_i.h"
|
||||
|
||||
+#define ATH11K_FTM_SEGHDR_CURRENT_SEQ GENMASK(3, 0)
|
||||
+#define ATH11K_FTM_SEGHDR_TOTAL_SEGMENTS GENMASK(7, 4)
|
||||
+
|
||||
static const struct nla_policy ath11k_tm_policy[ATH11K_TM_ATTR_MAX + 1] = {
|
||||
[ATH11K_TM_ATTR_CMD] = { .type = NLA_U32 },
|
||||
[ATH11K_TM_ATTR_DATA] = { .type = NLA_BINARY,
|
||||
@@ -21,13 +24,217 @@ static const struct nla_policy ath11k_tm
|
||||
[ATH11K_TM_ATTR_VERSION_MINOR] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
+static struct ath11k *ath11k_tm_get_ar(struct ath11k_base *ab)
|
||||
+{
|
||||
+ struct ath11k_pdev *pdev;
|
||||
+ struct ath11k *ar = NULL;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < ab->num_radios; i++) {
|
||||
+ pdev = &ab->pdevs[i];
|
||||
+ ar = pdev->ar;
|
||||
+
|
||||
+ if (ar && ar->state == ATH11K_STATE_FTM)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return ar;
|
||||
+}
|
||||
+
|
||||
+/* This function handles unsegmented events. Data in various events are aggregated
|
||||
+ * in application layer, this event is unsegmented from host perspective.
|
||||
+ */
|
||||
+static void ath11k_tm_wmi_event_unsegmented(struct ath11k_base *ab, u32 cmd_id,
|
||||
+ struct sk_buff *skb)
|
||||
+{
|
||||
+ struct sk_buff *nl_skb;
|
||||
+ struct ath11k *ar;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
|
||||
+ "event wmi cmd_id %d skb length %d\n",
|
||||
+ cmd_id, skb->len);
|
||||
+ ath11k_dbg_dump(ab, ATH11K_DBG_TESTMODE, NULL, "", skb->data, skb->len);
|
||||
+
|
||||
+ ar = ath11k_tm_get_ar(ab);
|
||||
+ if (!ar) {
|
||||
+ ath11k_warn(ab, "testmode event not handled due to invalid pdev\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ spin_lock_bh(&ar->data_lock);
|
||||
+
|
||||
+ nl_skb = cfg80211_testmode_alloc_event_skb(ar->hw->wiphy,
|
||||
+ 2 * nla_total_size(sizeof(u32)) +
|
||||
+ nla_total_size(skb->len),
|
||||
+ GFP_ATOMIC);
|
||||
+ if (!nl_skb) {
|
||||
+ ath11k_warn(ab,
|
||||
+ "failed to allocate skb for unsegmented testmode wmi event\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (nla_put_u32(nl_skb, ATH11K_TM_ATTR_CMD, ATH11K_TM_CMD_WMI) ||
|
||||
+ nla_put_u32(nl_skb, ATH11K_TM_ATTR_WMI_CMDID, cmd_id) ||
|
||||
+ nla_put(nl_skb, ATH11K_TM_ATTR_DATA, skb->len, skb->data)) {
|
||||
+ ath11k_warn(ab, "failed to populate testmode unsegmented event\n");
|
||||
+ kfree_skb(nl_skb);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
+ return;
|
||||
+
|
||||
+out:
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
+ ath11k_warn(ab, "Failed to send testmode event to higher layers\n");
|
||||
+}
|
||||
+
|
||||
+/* This function handles segmented events. Data of various events received
|
||||
+ * from firmware is aggregated and sent to application layer
|
||||
+ */
|
||||
+static int ath11k_tm_process_event(struct ath11k_base *ab, u32 cmd_id,
|
||||
+ const struct wmi_ftm_event_msg *ftm_msg,
|
||||
+ u16 length)
|
||||
+{
|
||||
+ struct sk_buff *nl_skb;
|
||||
+ int ret = 0;
|
||||
+ struct ath11k *ar;
|
||||
+ u8 const *buf_pos;
|
||||
+ u16 datalen;
|
||||
+ u8 total_segments, current_seq;
|
||||
+ u32 data_pos;
|
||||
+ u32 pdev_id;
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
|
||||
+ "event wmi cmd_id %d ftm event msg %pK datalen %d\n",
|
||||
+ cmd_id, ftm_msg, length);
|
||||
+ ath11k_dbg_dump(ab, ATH11K_DBG_TESTMODE, NULL, "", ftm_msg, length);
|
||||
+ pdev_id = DP_HW2SW_MACID(ftm_msg->seg_hdr.pdev_id);
|
||||
+
|
||||
+ if (pdev_id >= ab->num_radios) {
|
||||
+ ath11k_warn(ab, "testmode event not handled due to invalid pdev id: %d\n",
|
||||
+ pdev_id);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ ar = ab->pdevs[pdev_id].ar;
|
||||
+ if (!ar) {
|
||||
+ ath11k_warn(ab, "testmode event not handled due to absence of pdev\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ current_seq = FIELD_GET(ATH11K_FTM_SEGHDR_CURRENT_SEQ,
|
||||
+ ftm_msg->seg_hdr.segmentinfo);
|
||||
+ total_segments = FIELD_GET(ATH11K_FTM_SEGHDR_TOTAL_SEGMENTS,
|
||||
+ ftm_msg->seg_hdr.segmentinfo);
|
||||
+ datalen = length - (sizeof(struct wmi_ftm_seg_hdr));
|
||||
+ buf_pos = ftm_msg->data;
|
||||
+
|
||||
+ spin_lock_bh(&ar->data_lock);
|
||||
+
|
||||
+ if (current_seq == 0) {
|
||||
+ ab->testmode.expected_seq = 0;
|
||||
+ ab->testmode.data_pos = 0;
|
||||
+ }
|
||||
+
|
||||
+ data_pos = ab->testmode.data_pos;
|
||||
+
|
||||
+ if ((data_pos + datalen) > ATH11K_FTM_EVENT_MAX_BUF_LENGTH) {
|
||||
+ ath11k_warn(ab, "Invalid ftm event length at %d: %d\n",
|
||||
+ data_pos, datalen);
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(&ab->testmode.eventdata[data_pos], buf_pos, datalen);
|
||||
+ data_pos += datalen;
|
||||
+
|
||||
+ if (++ab->testmode.expected_seq != total_segments) {
|
||||
+ ab->testmode.data_pos = data_pos;
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
|
||||
+ "partial data received current_seq %d total_seg %d\n",
|
||||
+ current_seq, total_segments);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
|
||||
+ "total data length pos %d len %d\n",
|
||||
+ data_pos, ftm_msg->seg_hdr.len);
|
||||
+ nl_skb = cfg80211_testmode_alloc_event_skb(ar->hw->wiphy,
|
||||
+ 2 * nla_total_size(sizeof(u32)) +
|
||||
+ nla_total_size(data_pos),
|
||||
+ GFP_ATOMIC);
|
||||
+ if (!nl_skb) {
|
||||
+ ath11k_warn(ab,
|
||||
+ "failed to allocate skb for segmented testmode wmi event\n");
|
||||
+ ret = -ENOMEM;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (nla_put_u32(nl_skb, ATH11K_TM_ATTR_CMD,
|
||||
+ ATH11K_TM_CMD_WMI_FTM) ||
|
||||
+ nla_put_u32(nl_skb, ATH11K_TM_ATTR_WMI_CMDID, cmd_id) ||
|
||||
+ nla_put(nl_skb, ATH11K_TM_ATTR_DATA, data_pos,
|
||||
+ &ab->testmode.eventdata[0])) {
|
||||
+ ath11k_warn(ab, "failed to populate segmented testmode event");
|
||||
+ kfree_skb(nl_skb);
|
||||
+ ret = -ENOBUFS;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
|
||||
+
|
||||
+out:
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void ath11k_tm_wmi_event_segmented(struct ath11k_base *ab, u32 cmd_id,
|
||||
+ struct sk_buff *skb)
|
||||
+{
|
||||
+ const void **tb;
|
||||
+ const struct wmi_ftm_event_msg *ev;
|
||||
+ u16 length;
|
||||
+ int ret;
|
||||
+
|
||||
+ tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC);
|
||||
+ if (IS_ERR(tb)) {
|
||||
+ ret = PTR_ERR(tb);
|
||||
+ ath11k_warn(ab, "failed to parse ftm event tlv: %d\n", ret);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ev = tb[WMI_TAG_ARRAY_BYTE];
|
||||
+ if (!ev) {
|
||||
+ ath11k_warn(ab, "failed to fetch ftm msg\n");
|
||||
+ kfree(tb);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ length = skb->len - TLV_HDR_SIZE;
|
||||
+ ret = ath11k_tm_process_event(ab, cmd_id, ev, length);
|
||||
+ if (ret)
|
||||
+ ath11k_warn(ab, "Failed to process ftm event\n");
|
||||
+
|
||||
+ kfree(tb);
|
||||
+}
|
||||
+
|
||||
+void ath11k_tm_wmi_event(struct ath11k_base *ab, u32 cmd_id, struct sk_buff *skb)
|
||||
+{
|
||||
+ if (test_bit(ATH11K_FLAG_FTM_SEGMENTED, &ab->dev_flags))
|
||||
+ ath11k_tm_wmi_event_segmented(ab, cmd_id, skb);
|
||||
+ else
|
||||
+ ath11k_tm_wmi_event_unsegmented(ab, cmd_id, skb);
|
||||
+}
|
||||
+
|
||||
static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[])
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
int ret;
|
||||
|
||||
ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
|
||||
- "testmode cmd get version_major %d version_minor %d\n",
|
||||
+ "cmd get version_major %d version_minor %d\n",
|
||||
ATH11K_TESTMODE_VERSION_MAJOR,
|
||||
ATH11K_TESTMODE_VERSION_MINOR);
|
||||
|
||||
@@ -53,6 +260,43 @@ static int ath11k_tm_cmd_get_version(str
|
||||
return cfg80211_testmode_reply(skb);
|
||||
}
|
||||
|
||||
+static int ath11k_tm_cmd_testmode_start(struct ath11k *ar, struct nlattr *tb[])
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ mutex_lock(&ar->conf_mutex);
|
||||
+
|
||||
+ if (ar->state == ATH11K_STATE_FTM) {
|
||||
+ ret = -EALREADY;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ /* start utf only when the driver is not in use */
|
||||
+ if (ar->state != ATH11K_STATE_OFF) {
|
||||
+ ret = -EBUSY;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ ar->ab->testmode.eventdata = kzalloc(ATH11K_FTM_EVENT_MAX_BUF_LENGTH,
|
||||
+ GFP_KERNEL);
|
||||
+ if (!ar->ab->testmode.eventdata) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ ar->state = ATH11K_STATE_FTM;
|
||||
+ ar->ftm_msgref = 0;
|
||||
+
|
||||
+ mutex_unlock(&ar->conf_mutex);
|
||||
+
|
||||
+ ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE, "cmd start\n");
|
||||
+ return 0;
|
||||
+
|
||||
+err:
|
||||
+ mutex_unlock(&ar->conf_mutex);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int ath11k_tm_cmd_wmi(struct ath11k *ar, struct nlattr *tb[])
|
||||
{
|
||||
struct ath11k_pdev_wmi *wmi = ar->wmi;
|
||||
@@ -63,11 +307,6 @@ static int ath11k_tm_cmd_wmi(struct ath1
|
||||
|
||||
mutex_lock(&ar->conf_mutex);
|
||||
|
||||
- if (ar->state != ATH11K_STATE_ON) {
|
||||
- ret = -ENETDOWN;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
if (!tb[ATH11K_TM_ATTR_DATA]) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
@@ -80,11 +319,17 @@ static int ath11k_tm_cmd_wmi(struct ath1
|
||||
|
||||
buf = nla_data(tb[ATH11K_TM_ATTR_DATA]);
|
||||
buf_len = nla_len(tb[ATH11K_TM_ATTR_DATA]);
|
||||
+ if (!buf_len) {
|
||||
+ ath11k_warn(ar->ab, "No data present in testmode wmi command\n");
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
cmd_id = nla_get_u32(tb[ATH11K_TM_ATTR_WMI_CMDID]);
|
||||
|
||||
ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
|
||||
- "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n",
|
||||
- cmd_id, buf, buf_len);
|
||||
+ "cmd wmi cmd_id %d buf length %d\n",
|
||||
+ cmd_id, buf_len);
|
||||
|
||||
ath11k_dbg_dump(ar->ab, ATH11K_DBG_TESTMODE, NULL, "", buf, buf_len);
|
||||
|
||||
@@ -111,6 +356,91 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int ath11k_tm_cmd_wmi_ftm(struct ath11k *ar, struct nlattr *tb[])
|
||||
+{
|
||||
+ struct ath11k_pdev_wmi *wmi = ar->wmi;
|
||||
+ struct ath11k_base *ab = ar->ab;
|
||||
+ struct sk_buff *skb;
|
||||
+ u32 cmd_id, buf_len, hdr_info;
|
||||
+ int ret;
|
||||
+ void *buf;
|
||||
+ u8 segnumber = 0, seginfo;
|
||||
+ u16 chunk_len, total_bytes, num_segments;
|
||||
+ u8 *bufpos;
|
||||
+ struct wmi_ftm_cmd *ftm_cmd;
|
||||
+
|
||||
+ set_bit(ATH11K_FLAG_FTM_SEGMENTED, &ab->dev_flags);
|
||||
+
|
||||
+ mutex_lock(&ar->conf_mutex);
|
||||
+
|
||||
+ if (ar->state != ATH11K_STATE_FTM) {
|
||||
+ ret = -ENETDOWN;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (!tb[ATH11K_TM_ATTR_DATA]) {
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ buf = nla_data(tb[ATH11K_TM_ATTR_DATA]);
|
||||
+ buf_len = nla_len(tb[ATH11K_TM_ATTR_DATA]);
|
||||
+ cmd_id = WMI_PDEV_UTF_CMDID;
|
||||
+
|
||||
+ ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
|
||||
+ "cmd wmi ftm cmd_id %d buffer length %d\n",
|
||||
+ cmd_id, buf_len);
|
||||
+ ath11k_dbg_dump(ar->ab, ATH11K_DBG_TESTMODE, NULL, "", buf, buf_len);
|
||||
+
|
||||
+ bufpos = buf;
|
||||
+ total_bytes = buf_len;
|
||||
+ num_segments = total_bytes / MAX_WMI_UTF_LEN;
|
||||
+
|
||||
+ if (buf_len - (num_segments * MAX_WMI_UTF_LEN))
|
||||
+ num_segments++;
|
||||
+
|
||||
+ while (buf_len) {
|
||||
+ chunk_len = min_t(u16, buf_len, MAX_WMI_UTF_LEN);
|
||||
+
|
||||
+ skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, (chunk_len +
|
||||
+ sizeof(struct wmi_ftm_cmd)));
|
||||
+ if (!skb) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ftm_cmd = (struct wmi_ftm_cmd *)skb->data;
|
||||
+ hdr_info = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) |
|
||||
+ FIELD_PREP(WMI_TLV_LEN, (chunk_len +
|
||||
+ sizeof(struct wmi_ftm_seg_hdr)));
|
||||
+ ftm_cmd->tlv_header = hdr_info;
|
||||
+ ftm_cmd->seg_hdr.len = total_bytes;
|
||||
+ ftm_cmd->seg_hdr.msgref = ar->ftm_msgref;
|
||||
+ seginfo = FIELD_PREP(ATH11K_FTM_SEGHDR_TOTAL_SEGMENTS, num_segments) |
|
||||
+ FIELD_PREP(ATH11K_FTM_SEGHDR_CURRENT_SEQ, segnumber);
|
||||
+ ftm_cmd->seg_hdr.segmentinfo = seginfo;
|
||||
+ segnumber++;
|
||||
+
|
||||
+ memcpy(&ftm_cmd->data, bufpos, chunk_len);
|
||||
+
|
||||
+ ret = ath11k_wmi_cmd_send(wmi, skb, cmd_id);
|
||||
+ if (ret) {
|
||||
+ ath11k_warn(ar->ab, "failed to send wmi ftm command: %d\n", ret);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ buf_len -= chunk_len;
|
||||
+ bufpos += chunk_len;
|
||||
+ }
|
||||
+
|
||||
+ ar->ftm_msgref++;
|
||||
+ ret = 0;
|
||||
+
|
||||
+out:
|
||||
+ mutex_unlock(&ar->conf_mutex);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
int ath11k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
void *data, int len)
|
||||
{
|
||||
@@ -131,6 +461,10 @@ int ath11k_tm_cmd(struct ieee80211_hw *h
|
||||
return ath11k_tm_cmd_get_version(ar, tb);
|
||||
case ATH11K_TM_CMD_WMI:
|
||||
return ath11k_tm_cmd_wmi(ar, tb);
|
||||
+ case ATH11K_TM_CMD_TESTMODE_START:
|
||||
+ return ath11k_tm_cmd_testmode_start(ar, tb);
|
||||
+ case ATH11K_TM_CMD_WMI_FTM:
|
||||
+ return ath11k_tm_cmd_wmi_ftm(ar, tb);
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath11k/testmode.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/testmode.h
|
||||
@@ -8,11 +8,17 @@
|
||||
|
||||
#ifdef CPTCFG_NL80211_TESTMODE
|
||||
|
||||
+void ath11k_tm_wmi_event(struct ath11k_base *ab, u32 cmd_id, struct sk_buff *skb);
|
||||
int ath11k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
void *data, int len);
|
||||
|
||||
#else
|
||||
|
||||
+static inline void ath11k_tm_wmi_event(struct ath11k_base *ab, u32 cmd_id,
|
||||
+ struct sk_buff *skb)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
static inline int ath11k_tm_cmd(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
void *data, int len)
|
||||
--- a/drivers/net/wireless/ath/ath11k/testmode_i.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/testmode_i.h
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/* "API" level of the ath11k testmode interface. Bump it after every
|
||||
@@ -11,9 +12,10 @@
|
||||
/* Bump this after every _compatible_ interface change, for example
|
||||
* addition of a new command or an attribute.
|
||||
*/
|
||||
-#define ATH11K_TESTMODE_VERSION_MINOR 0
|
||||
+#define ATH11K_TESTMODE_VERSION_MINOR 1
|
||||
|
||||
#define ATH11K_TM_DATA_MAX_LEN 5000
|
||||
+#define ATH11K_FTM_EVENT_MAX_BUF_LENGTH 2048
|
||||
|
||||
enum ath11k_tm_attr {
|
||||
__ATH11K_TM_ATTR_INVALID = 0,
|
||||
@@ -47,4 +49,18 @@ enum ath11k_tm_cmd {
|
||||
* ATH11K_TM_ATTR_DATA.
|
||||
*/
|
||||
ATH11K_TM_CMD_WMI = 1,
|
||||
+
|
||||
+ /* Boots the UTF firmware, the netdev interface must be down at the
|
||||
+ * time.
|
||||
+ */
|
||||
+ ATH11K_TM_CMD_TESTMODE_START = 2,
|
||||
+
|
||||
+ /* The command used to transmit a FTM WMI command to the firmware
|
||||
+ * and the event to receive WMI events from the firmware. The data
|
||||
+ * received only contain the payload, need to add the tlv header
|
||||
+ * and send the cmd to firmware with command id WMI_PDEV_UTF_CMDID.
|
||||
+ * The data payload size could be large and the driver needs to
|
||||
+ * send segmented data to firmware.
|
||||
+ */
|
||||
+ ATH11K_TM_CMD_WMI_FTM = 3,
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2021, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/ctype.h>
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "mac.h"
|
||||
#include "hw.h"
|
||||
#include "peer.h"
|
||||
+#include "testmode.h"
|
||||
|
||||
struct wmi_tlv_policy {
|
||||
size_t min_len;
|
||||
@@ -237,9 +238,8 @@ static int ath11k_wmi_tlv_parse(struct a
|
||||
(void *)tb);
|
||||
}
|
||||
|
||||
-static const void **
|
||||
-ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, const void *ptr,
|
||||
- size_t len, gfp_t gfp)
|
||||
+const void **ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, const void *ptr,
|
||||
+ size_t len, gfp_t gfp)
|
||||
{
|
||||
const void **tb;
|
||||
int ret;
|
||||
@@ -8628,6 +8628,9 @@ static void ath11k_wmi_tlv_op_rx(struct
|
||||
case WMI_PDEV_CSA_SWITCH_COUNT_STATUS_EVENTID:
|
||||
ath11k_wmi_pdev_csa_switch_count_status_event(ab, skb);
|
||||
break;
|
||||
+ case WMI_PDEV_UTF_EVENTID:
|
||||
+ ath11k_tm_wmi_event(ab, id, skb);
|
||||
+ break;
|
||||
case WMI_PDEV_TEMPERATURE_EVENTID:
|
||||
ath11k_wmi_pdev_temperature_event(ab, skb);
|
||||
break;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef ATH11K_WMI_H
|
||||
@@ -68,6 +69,7 @@ struct wmi_tlv {
|
||||
|
||||
#define WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG 1
|
||||
|
||||
+#define MAX_WMI_UTF_LEN 252
|
||||
#define WMI_BA_MODE_BUFFER_SIZE_256 3
|
||||
/*
|
||||
* HW mode config type replicated from FW header
|
||||
@@ -3564,6 +3566,24 @@ struct wmi_get_pdev_temperature_cmd {
|
||||
u32 pdev_id;
|
||||
} __packed;
|
||||
|
||||
+struct wmi_ftm_seg_hdr {
|
||||
+ u32 len;
|
||||
+ u32 msgref;
|
||||
+ u32 segmentinfo;
|
||||
+ u32 pdev_id;
|
||||
+} __packed;
|
||||
+
|
||||
+struct wmi_ftm_cmd {
|
||||
+ u32 tlv_header;
|
||||
+ struct wmi_ftm_seg_hdr seg_hdr;
|
||||
+ u8 data[];
|
||||
+} __packed;
|
||||
+
|
||||
+struct wmi_ftm_event_msg {
|
||||
+ struct wmi_ftm_seg_hdr seg_hdr;
|
||||
+ u8 data[];
|
||||
+} __packed;
|
||||
+
|
||||
#define WMI_BEACON_TX_BUFFER_SIZE 512
|
||||
|
||||
#define WMI_EMA_TMPL_IDX_SHIFT 8
|
||||
@@ -6300,6 +6320,8 @@ enum wmi_sta_keepalive_method {
|
||||
#define WMI_STA_KEEPALIVE_INTERVAL_DEFAULT 30
|
||||
#define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
|
||||
|
||||
+const void **ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, const void *ptr,
|
||||
+ size_t len, gfp_t gfp);
|
||||
int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb,
|
||||
u32 cmd_id);
|
||||
struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_sc, u32 len);
|
||||
--- a/drivers/net/wireless/ath/ath11k/wow.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wow.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
@@ -838,6 +838,7 @@ exit:
|
||||
case ATH11K_STATE_RESTARTING:
|
||||
case ATH11K_STATE_RESTARTED:
|
||||
case ATH11K_STATE_WEDGED:
|
||||
+ case ATH11K_STATE_FTM:
|
||||
ath11k_warn(ar->ab, "encountered unexpected device state %d on resume, cannot recover\n",
|
||||
ar->state);
|
||||
ret = -EIO;
|
||||
@ -0,0 +1,47 @@
|
||||
From 8aeba427296bff6a6051686f1d139c89a0b00e4c Mon Sep 17 00:00:00 2001
|
||||
From: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
|
||||
Date: Fri, 26 May 2023 12:41:07 +0300
|
||||
Subject: [PATCH 84/84] wifi: ath11k: Allow ath11k to boot without caldata in
|
||||
ftm mode
|
||||
|
||||
Currently, if ath11k is unable to load the calibration data file it will
|
||||
always exit. However the calibration data may not be present in factory
|
||||
test mode, so update the logic to allow the driver to execute in FTM mode
|
||||
even if downloading the calibration data fails.
|
||||
|
||||
Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
|
||||
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230517135934.16408-5-quic_rajkbhag@quicinc.com
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/qmi.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/elf.h>
|
||||
@@ -2460,6 +2460,14 @@ static int ath11k_qmi_load_bdf_qmi(struc
|
||||
|
||||
fw_entry = ath11k_core_firmware_request(ab, ATH11K_DEFAULT_CAL_FILE);
|
||||
if (IS_ERR(fw_entry)) {
|
||||
+ /* Caldata may not be present during first time calibration in
|
||||
+ * factory hence allow to boot without loading caldata in ftm mode
|
||||
+ */
|
||||
+ if (ath11k_ftm_mode) {
|
||||
+ ath11k_info(ab,
|
||||
+ "Booting without cal data file in factory test mode\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
ret = PTR_ERR(fw_entry);
|
||||
ath11k_warn(ab,
|
||||
"qmi failed to load CAL data file:%s\n",
|
||||
@ -0,0 +1,261 @@
|
||||
From 2d4f9093e2d8531ad0a2bb98fe5b36dc8addf2a2 Mon Sep 17 00:00:00 2001
|
||||
From: Nidhi Jain <quic_nidhjain@quicinc.com>
|
||||
Date: Fri, 26 May 2023 12:41:07 +0300
|
||||
Subject: [PATCH] wifi: ath11k: Add HTT stats for PHY reset case
|
||||
|
||||
New HTT stats are added with stats type 37 to
|
||||
provide PHY reset stats and PHY reset counter stats.
|
||||
|
||||
PHY reset stats are used to display the current
|
||||
PHY-related operation information such as band, CCA
|
||||
threshold, current operating channel etc.,
|
||||
|
||||
PHY reset counter stats are used to display the
|
||||
PHY reset counter values like calibration counts,
|
||||
temperature based recalibration counts etc.,
|
||||
|
||||
Usage:
|
||||
echo 37 > /sys/kernel/debug/ieee80211/phyX/ath11k/htt_stats_type
|
||||
cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats
|
||||
|
||||
Output:
|
||||
|
||||
HTT_PHY_RESET_STATS_TLV:
|
||||
pdev_id = 0
|
||||
chan_mhz = 5180
|
||||
chan_band_center_freq1 = 5210
|
||||
chan_band_center_freq2 = 0
|
||||
chan_phy_mode = 18
|
||||
chan_flags = 0x8
|
||||
chan_num = 36
|
||||
reset_cause = 0x50000
|
||||
prev_reset_cause = 0x50000
|
||||
phy_warm_reset_src = 0x0
|
||||
rx_gain_tbl_mode = 0
|
||||
xbar_val = 0xfac688
|
||||
force_calibration = 0
|
||||
phyrf_mode = 0
|
||||
phy_homechan = 0
|
||||
phy_tx_ch_mask = 0x3
|
||||
phy_rx_ch_mask = 0x3
|
||||
phybb_ini_mask = 0x5
|
||||
phyrf_ini_mask = 0x0
|
||||
phy_dfs_en_mask = 0x0
|
||||
phy_sscan_en_mask = 0x0
|
||||
phy_synth_sel_mask = 0x0
|
||||
phy_adfs_freq = 0
|
||||
cck_fir_settings = 0x0
|
||||
phy_dyn_pri_chan = 6
|
||||
cca_thresh = 0x26232020
|
||||
dyn_cca_status = 0
|
||||
rxdesense_thresh_hw = 0xcfe0afe
|
||||
rxdesense_thresh_sw = 0xcfe0afe
|
||||
|
||||
HTT_PHY_RESET_COUNTERS_TLV:
|
||||
pdev_id = 0
|
||||
cf_active_low_fail_cnt = 0
|
||||
cf_active_low_pass_cnt = 0
|
||||
phy_off_through_vreg_cnt = 0
|
||||
force_calibration_cnt = 0
|
||||
rf_mode_switch_phy_off_cnt = 0
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Nidhi Jain <quic_nidhjain@quicinc.com>
|
||||
Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://lore.kernel.org/r/20230517141242.2754293-1-quic_mkenna@quicinc.com
|
||||
---
|
||||
.../wireless/ath/ath11k/debugfs_htt_stats.c | 114 ++++++++++++++++++
|
||||
.../wireless/ath/ath11k/debugfs_htt_stats.h | 43 +++++++
|
||||
2 files changed, 157 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
|
||||
@@ -4011,6 +4011,114 @@ void htt_print_phy_stats_tlv(const void
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
+static inline void
|
||||
+htt_print_phy_reset_counters_tlv(const void *tag_buf,
|
||||
+ u16 tag_len,
|
||||
+ struct debug_htt_stats_req *stats_req)
|
||||
+{
|
||||
+ const struct htt_phy_reset_counters_tlv *htt_stats_buf = tag_buf;
|
||||
+ u8 *buf = stats_req->buf;
|
||||
+ u32 len = stats_req->buf_len;
|
||||
+ u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE;
|
||||
+
|
||||
+ if (tag_len < sizeof(*htt_stats_buf))
|
||||
+ return;
|
||||
+
|
||||
+ len += scnprintf(buf + len, buf_len - len, "HTT_PHY_RESET_COUNTERS_TLV:\n");
|
||||
+
|
||||
+ len += scnprintf(buf + len, buf_len - len, "pdev_id = %u\n",
|
||||
+ htt_stats_buf->pdev_id);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "cf_active_low_fail_cnt = %u\n",
|
||||
+ htt_stats_buf->cf_active_low_fail_cnt);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "cf_active_low_pass_cnt = %u\n",
|
||||
+ htt_stats_buf->cf_active_low_pass_cnt);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_off_through_vreg_cnt = %u\n",
|
||||
+ htt_stats_buf->phy_off_through_vreg_cnt);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "force_calibration_cnt = %u\n",
|
||||
+ htt_stats_buf->force_calibration_cnt);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "rf_mode_switch_phy_off_cnt = %u\n",
|
||||
+ htt_stats_buf->rf_mode_switch_phy_off_cnt);
|
||||
+
|
||||
+ stats_req->buf_len = len;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+htt_print_phy_reset_stats_tlv(const void *tag_buf,
|
||||
+ u16 tag_len,
|
||||
+ struct debug_htt_stats_req *stats_req)
|
||||
+{
|
||||
+ const struct htt_phy_reset_stats_tlv *htt_stats_buf = tag_buf;
|
||||
+ u8 *buf = stats_req->buf;
|
||||
+ u32 len = stats_req->buf_len;
|
||||
+ u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE;
|
||||
+
|
||||
+ if (tag_len < sizeof(*htt_stats_buf))
|
||||
+ return;
|
||||
+
|
||||
+ len += scnprintf(buf + len, buf_len - len, "HTT_PHY_RESET_STATS_TLV:\n");
|
||||
+
|
||||
+ len += scnprintf(buf + len, buf_len - len, "pdev_id = %u\n",
|
||||
+ htt_stats_buf->pdev_id);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "chan_mhz = %u\n",
|
||||
+ htt_stats_buf->chan_mhz);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "chan_band_center_freq1 = %u\n",
|
||||
+ htt_stats_buf->chan_band_center_freq1);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "chan_band_center_freq2 = %u\n",
|
||||
+ htt_stats_buf->chan_band_center_freq2);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "chan_phy_mode = %u\n",
|
||||
+ htt_stats_buf->chan_phy_mode);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "chan_flags = 0x%0x\n",
|
||||
+ htt_stats_buf->chan_flags);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "chan_num = %u\n",
|
||||
+ htt_stats_buf->chan_num);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "reset_cause = 0x%0x\n",
|
||||
+ htt_stats_buf->reset_cause);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "prev_reset_cause = 0x%0x\n",
|
||||
+ htt_stats_buf->prev_reset_cause);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_warm_reset_src = 0x%0x\n",
|
||||
+ htt_stats_buf->phy_warm_reset_src);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "rx_gain_tbl_mode = %d\n",
|
||||
+ htt_stats_buf->rx_gain_tbl_mode);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "xbar_val = 0x%0x\n",
|
||||
+ htt_stats_buf->xbar_val);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "force_calibration = %u\n",
|
||||
+ htt_stats_buf->force_calibration);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phyrf_mode = %u\n",
|
||||
+ htt_stats_buf->phyrf_mode);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_homechan = %u\n",
|
||||
+ htt_stats_buf->phy_homechan);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_tx_ch_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phy_tx_ch_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_rx_ch_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phy_rx_ch_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phybb_ini_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phybb_ini_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phyrf_ini_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phyrf_ini_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_dfs_en_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phy_dfs_en_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_sscan_en_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phy_sscan_en_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_synth_sel_mask = 0x%0x\n",
|
||||
+ htt_stats_buf->phy_synth_sel_mask);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_adfs_freq = %u\n",
|
||||
+ htt_stats_buf->phy_adfs_freq);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "cck_fir_settings = 0x%0x\n",
|
||||
+ htt_stats_buf->cck_fir_settings);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "phy_dyn_pri_chan = %u\n",
|
||||
+ htt_stats_buf->phy_dyn_pri_chan);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "cca_thresh = 0x%0x\n",
|
||||
+ htt_stats_buf->cca_thresh);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "dyn_cca_status = %u\n",
|
||||
+ htt_stats_buf->dyn_cca_status);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "rxdesense_thresh_hw = 0x%x\n",
|
||||
+ htt_stats_buf->rxdesense_thresh_hw);
|
||||
+ len += scnprintf(buf + len, buf_len - len, "rxdesense_thresh_sw = 0x%x\n",
|
||||
+ htt_stats_buf->rxdesense_thresh_sw);
|
||||
+
|
||||
+ stats_req->buf_len = len;
|
||||
+}
|
||||
+
|
||||
static inline
|
||||
void htt_print_peer_ctrl_path_txrx_stats_tlv(const void *tag_buf,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
@@ -4425,6 +4533,12 @@ static int ath11k_dbg_htt_ext_stats_pars
|
||||
case HTT_STATS_PHY_STATS_TAG:
|
||||
htt_print_phy_stats_tlv(tag_buf, stats_req);
|
||||
break;
|
||||
+ case HTT_STATS_PHY_RESET_COUNTERS_TAG:
|
||||
+ htt_print_phy_reset_counters_tlv(tag_buf, len, stats_req);
|
||||
+ break;
|
||||
+ case HTT_STATS_PHY_RESET_STATS_TAG:
|
||||
+ htt_print_phy_reset_stats_tlv(tag_buf, len, stats_req);
|
||||
+ break;
|
||||
case HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG:
|
||||
htt_print_peer_ctrl_path_txrx_stats_tlv(tag_buf, stats_req);
|
||||
break;
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
|
||||
@@ -111,6 +111,8 @@ enum htt_tlv_tag_t {
|
||||
HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116,
|
||||
HTT_STATS_PHY_COUNTERS_TAG = 121,
|
||||
HTT_STATS_PHY_STATS_TAG = 122,
|
||||
+ HTT_STATS_PHY_RESET_COUNTERS_TAG = 123,
|
||||
+ HTT_STATS_PHY_RESET_STATS_TAG = 124,
|
||||
|
||||
HTT_STATS_MAX_TAG,
|
||||
};
|
||||
@@ -1964,6 +1966,47 @@ struct htt_phy_stats_tlv {
|
||||
u32 fw_run_time;
|
||||
};
|
||||
|
||||
+struct htt_phy_reset_counters_tlv {
|
||||
+ u32 pdev_id;
|
||||
+ u32 cf_active_low_fail_cnt;
|
||||
+ u32 cf_active_low_pass_cnt;
|
||||
+ u32 phy_off_through_vreg_cnt;
|
||||
+ u32 force_calibration_cnt;
|
||||
+ u32 rf_mode_switch_phy_off_cnt;
|
||||
+};
|
||||
+
|
||||
+struct htt_phy_reset_stats_tlv {
|
||||
+ u32 pdev_id;
|
||||
+ u32 chan_mhz;
|
||||
+ u32 chan_band_center_freq1;
|
||||
+ u32 chan_band_center_freq2;
|
||||
+ u32 chan_phy_mode;
|
||||
+ u32 chan_flags;
|
||||
+ u32 chan_num;
|
||||
+ u32 reset_cause;
|
||||
+ u32 prev_reset_cause;
|
||||
+ u32 phy_warm_reset_src;
|
||||
+ u32 rx_gain_tbl_mode;
|
||||
+ u32 xbar_val;
|
||||
+ u32 force_calibration;
|
||||
+ u32 phyrf_mode;
|
||||
+ u32 phy_homechan;
|
||||
+ u32 phy_tx_ch_mask;
|
||||
+ u32 phy_rx_ch_mask;
|
||||
+ u32 phybb_ini_mask;
|
||||
+ u32 phyrf_ini_mask;
|
||||
+ u32 phy_dfs_en_mask;
|
||||
+ u32 phy_sscan_en_mask;
|
||||
+ u32 phy_synth_sel_mask;
|
||||
+ u32 phy_adfs_freq;
|
||||
+ u32 cck_fir_settings;
|
||||
+ u32 phy_dyn_pri_chan;
|
||||
+ u32 cca_thresh;
|
||||
+ u32 dyn_cca_status;
|
||||
+ u32 rxdesense_thresh_hw;
|
||||
+ u32 rxdesense_thresh_sw;
|
||||
+};
|
||||
+
|
||||
struct htt_peer_ctrl_path_txrx_stats_tlv {
|
||||
/* peer mac address */
|
||||
u8 peer_mac_addr[ETH_ALEN];
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -82,7 +82,7 @@ static const struct ath11k_hw_params ath
|
||||
@@ -86,7 +86,7 @@ static const struct ath11k_hw_params ath
|
||||
.supports_shadow_regs = false,
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
|
||||
@ -22,16 +22,16 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -32,7 +32,7 @@ module_param_named(frame_mode, ath11k_fr
|
||||
MODULE_PARM_DESC(frame_mode,
|
||||
"Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)");
|
||||
@@ -36,7 +36,7 @@ bool ath11k_ftm_mode;
|
||||
module_param_named(ftm_mode, ath11k_ftm_mode, bool, 0444);
|
||||
MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode");
|
||||
|
||||
-static const struct ath11k_hw_params ath11k_hw_params[] = {
|
||||
+static struct ath11k_hw_params ath11k_hw_params[] = {
|
||||
{
|
||||
.hw_rev = ATH11K_HW_IPQ8074,
|
||||
.name = "ipq8074 hw2.0",
|
||||
@@ -1911,7 +1911,8 @@ static void ath11k_core_reset(struct wor
|
||||
@@ -1953,7 +1953,8 @@ static void ath11k_core_reset(struct wor
|
||||
static int ath11k_init_hw_params(struct ath11k_base *ab)
|
||||
{
|
||||
const struct ath11k_hw_params *hw_params = NULL;
|
||||
@ -41,7 +41,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
|
||||
hw_params = &ath11k_hw_params[i];
|
||||
@@ -1927,7 +1928,30 @@ static int ath11k_init_hw_params(struct
|
||||
@@ -1969,7 +1970,30 @@ static int ath11k_init_hw_params(struct
|
||||
|
||||
ab->hw_params = *hw_params;
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
#endif
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -6980,24 +6980,12 @@ static void ath11k_wmi_htc_tx_complete(s
|
||||
@@ -6996,24 +6996,12 @@ static void ath11k_wmi_htc_tx_complete(s
|
||||
wake_up(&wmi->tx_ce_desc_wq);
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
int ret = 0, pdev_idx, i, j;
|
||||
struct ath11k *ar;
|
||||
|
||||
@@ -7059,17 +7047,7 @@ static int ath11k_reg_chan_list_event(st
|
||||
@@ -7075,17 +7063,7 @@ static int ath11k_reg_chan_list_event(st
|
||||
(char *)reg_info->alpha2, 2))
|
||||
goto mem_free;
|
||||
|
||||
|
||||
@ -0,0 +1,372 @@
|
||||
From bd54f3c29077f23dad92ef82a78061b40be30c65 Mon Sep 17 00:00:00 2001
|
||||
From: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Date: Mon, 5 Dec 2022 16:50:37 -0800
|
||||
Subject: [PATCH] wifi: mac80211: generate EMA beacons in AP mode
|
||||
|
||||
Add APIs to generate an array of beacons for an EMA AP (enhanced
|
||||
multiple BSSID advertisements), each including a single MBSSID element.
|
||||
EMA profile periodicity equals the count of elements.
|
||||
|
||||
- ieee80211_beacon_get_template_ema_list() - Generate and return all
|
||||
EMA beacon templates. Drivers must call ieee80211_beacon_free_ema_list()
|
||||
to free the memory. No change in the prototype for the existing API,
|
||||
ieee80211_beacon_get_template(), which should be used for non-EMA AP.
|
||||
|
||||
- ieee80211_beacon_get_template_ema_index() - Generate a beacon which
|
||||
includes the multiple BSSID element at the given index. Drivers can use
|
||||
this function in a loop until NULL is returned which indicates end of
|
||||
available MBSSID elements.
|
||||
|
||||
- ieee80211_beacon_free_ema_list() - free the memory allocated for the
|
||||
list of EMA beacon templates.
|
||||
|
||||
Modify existing functions ieee80211_beacon_get_ap(),
|
||||
ieee80211_get_mbssid_beacon_len() and ieee80211_beacon_add_mbssid()
|
||||
to accept a new parameter for EMA index.
|
||||
|
||||
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
||||
Co-developed-by: John Crispin <john@phrozen.org>
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Link: https://lore.kernel.org/r/20221206005040.3177-2-quic_alokad@quicinc.com
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
include/net/mac80211.h | 68 +++++++++++++++++++
|
||||
net/mac80211/cfg.c | 11 +--
|
||||
net/mac80211/ieee80211_i.h | 10 ++-
|
||||
net/mac80211/tx.c | 134 ++++++++++++++++++++++++++++++++++---
|
||||
4 files changed, 205 insertions(+), 18 deletions(-)
|
||||
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -5252,6 +5252,74 @@ ieee80211_beacon_get_template(struct iee
|
||||
unsigned int link_id);
|
||||
|
||||
/**
|
||||
+ * ieee80211_beacon_get_template_ema_index - EMA beacon template generation
|
||||
+ * @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
|
||||
+ * @offs: &struct ieee80211_mutable_offsets pointer to struct that will
|
||||
+ * receive the offsets that may be updated by the driver.
|
||||
+ * @link_id: the link id to which the beacon belongs (or 0 for a non-MLD AP).
|
||||
+ * @ema_index: index of the beacon in the EMA set.
|
||||
+ *
|
||||
+ * This function follows the same rules as ieee80211_beacon_get_template()
|
||||
+ * but returns a beacon template which includes multiple BSSID element at the
|
||||
+ * requested index.
|
||||
+ *
|
||||
+ * Return: The beacon template. %NULL indicates the end of EMA templates.
|
||||
+ */
|
||||
+struct sk_buff *
|
||||
+ieee80211_beacon_get_template_ema_index(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_mutable_offsets *offs,
|
||||
+ unsigned int link_id, u8 ema_index);
|
||||
+
|
||||
+/**
|
||||
+ * struct ieee80211_ema_beacons - List of EMA beacons
|
||||
+ * @cnt: count of EMA beacons.
|
||||
+ *
|
||||
+ * @bcn: array of EMA beacons.
|
||||
+ * @bcn.skb: the skb containing this specific beacon
|
||||
+ * @bcn.offs: &struct ieee80211_mutable_offsets pointer to struct that will
|
||||
+ * receive the offsets that may be updated by the driver.
|
||||
+ */
|
||||
+struct ieee80211_ema_beacons {
|
||||
+ u8 cnt;
|
||||
+ struct {
|
||||
+ struct sk_buff *skb;
|
||||
+ struct ieee80211_mutable_offsets offs;
|
||||
+ } bcn[];
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * ieee80211_beacon_get_template_ema_list - EMA beacon template generation
|
||||
+ * @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
|
||||
+ * @link_id: the link id to which the beacon belongs (or 0 for a non-MLD AP)
|
||||
+ *
|
||||
+ * This function follows the same rules as ieee80211_beacon_get_template()
|
||||
+ * but allocates and returns a pointer to list of all beacon templates required
|
||||
+ * to cover all profiles in the multiple BSSID set. Each template includes only
|
||||
+ * one multiple BSSID element.
|
||||
+ *
|
||||
+ * Driver must call ieee80211_beacon_free_ema_list() to free the memory.
|
||||
+ *
|
||||
+ * Return: EMA beacon templates of type struct ieee80211_ema_beacons *.
|
||||
+ * %NULL on error.
|
||||
+ */
|
||||
+struct ieee80211_ema_beacons *
|
||||
+ieee80211_beacon_get_template_ema_list(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ unsigned int link_id);
|
||||
+
|
||||
+/**
|
||||
+ * ieee80211_beacon_free_ema_list - free an EMA beacon template list
|
||||
+ * @ema_beacons: list of EMA beacons of type &struct ieee80211_ema_beacons pointers.
|
||||
+ *
|
||||
+ * This function will free a list previously acquired by calling
|
||||
+ * ieee80211_beacon_get_template_ema_list()
|
||||
+ */
|
||||
+void ieee80211_beacon_free_ema_list(struct ieee80211_ema_beacons *ema_beacons);
|
||||
+
|
||||
+/**
|
||||
* ieee80211_beacon_get_tim - beacon generation function
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -1122,11 +1122,11 @@ static int ieee80211_assign_beacon(struc
|
||||
if (params->mbssid_ies) {
|
||||
mbssid = params->mbssid_ies;
|
||||
size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
|
||||
- size += ieee80211_get_mbssid_beacon_len(mbssid);
|
||||
+ size += ieee80211_get_mbssid_beacon_len(mbssid, mbssid->cnt);
|
||||
} else if (old && old->mbssid_ies) {
|
||||
mbssid = old->mbssid_ies;
|
||||
size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
|
||||
- size += ieee80211_get_mbssid_beacon_len(mbssid);
|
||||
+ size += ieee80211_get_mbssid_beacon_len(mbssid, mbssid->cnt);
|
||||
}
|
||||
|
||||
new = kzalloc(size, GFP_KERNEL);
|
||||
@@ -3384,8 +3384,11 @@ cfg80211_beacon_dup(struct cfg80211_beac
|
||||
|
||||
len = beacon->head_len + beacon->tail_len + beacon->beacon_ies_len +
|
||||
beacon->proberesp_ies_len + beacon->assocresp_ies_len +
|
||||
- beacon->probe_resp_len + beacon->lci_len + beacon->civicloc_len +
|
||||
- ieee80211_get_mbssid_beacon_len(beacon->mbssid_ies);
|
||||
+ beacon->probe_resp_len + beacon->lci_len + beacon->civicloc_len;
|
||||
+
|
||||
+ if (beacon->mbssid_ies)
|
||||
+ len += ieee80211_get_mbssid_beacon_len(beacon->mbssid_ies,
|
||||
+ beacon->mbssid_ies->cnt);
|
||||
|
||||
new_beacon = kzalloc(sizeof(*new_beacon) + len, GFP_KERNEL);
|
||||
if (!new_beacon)
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1182,13 +1182,17 @@ ieee80211_vif_get_shift(struct ieee80211
|
||||
}
|
||||
|
||||
static inline int
|
||||
-ieee80211_get_mbssid_beacon_len(struct cfg80211_mbssid_elems *elems)
|
||||
+ieee80211_get_mbssid_beacon_len(struct cfg80211_mbssid_elems *elems, u8 i)
|
||||
{
|
||||
- int i, len = 0;
|
||||
+ int len = 0;
|
||||
|
||||
- if (!elems)
|
||||
+ if (!elems || !elems->cnt || i > elems->cnt)
|
||||
return 0;
|
||||
|
||||
+ if (i < elems->cnt)
|
||||
+ return elems->elem[i].len;
|
||||
+
|
||||
+ /* i == elems->cnt, calculate total length of all MBSSID elements */
|
||||
for (i = 0; i < elems->cnt; i++)
|
||||
len += elems->elem[i].len;
|
||||
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -5205,13 +5205,20 @@ ieee80211_beacon_get_finish(struct ieee8
|
||||
}
|
||||
|
||||
static void
|
||||
-ieee80211_beacon_add_mbssid(struct sk_buff *skb, struct beacon_data *beacon)
|
||||
+ieee80211_beacon_add_mbssid(struct sk_buff *skb, struct beacon_data *beacon,
|
||||
+ u8 i)
|
||||
{
|
||||
- int i;
|
||||
+ if (!beacon->mbssid_ies || !beacon->mbssid_ies->cnt ||
|
||||
+ i > beacon->mbssid_ies->cnt)
|
||||
+ return;
|
||||
|
||||
- if (!beacon->mbssid_ies)
|
||||
+ if (i < beacon->mbssid_ies->cnt) {
|
||||
+ skb_put_data(skb, beacon->mbssid_ies->elem[i].data,
|
||||
+ beacon->mbssid_ies->elem[i].len);
|
||||
return;
|
||||
+ }
|
||||
|
||||
+ /* i == beacon->mbssid_ies->cnt, include all MBSSID elements */
|
||||
for (i = 0; i < beacon->mbssid_ies->cnt; i++)
|
||||
skb_put_data(skb, beacon->mbssid_ies->elem[i].data,
|
||||
beacon->mbssid_ies->elem[i].len);
|
||||
@@ -5224,7 +5231,8 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
struct ieee80211_mutable_offsets *offs,
|
||||
bool is_template,
|
||||
struct beacon_data *beacon,
|
||||
- struct ieee80211_chanctx_conf *chanctx_conf)
|
||||
+ struct ieee80211_chanctx_conf *chanctx_conf,
|
||||
+ u8 ema_index)
|
||||
{
|
||||
struct ieee80211_local *local = hw_to_local(hw);
|
||||
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
|
||||
@@ -5243,7 +5251,9 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
/* headroom, head length,
|
||||
* tail length, maximum TIM length and multiple BSSID length
|
||||
*/
|
||||
- mbssid_len = ieee80211_get_mbssid_beacon_len(beacon->mbssid_ies);
|
||||
+ mbssid_len = ieee80211_get_mbssid_beacon_len(beacon->mbssid_ies,
|
||||
+ ema_index);
|
||||
+
|
||||
skb = dev_alloc_skb(local->tx_headroom + beacon->head_len +
|
||||
beacon->tail_len + 256 +
|
||||
local->hw.extra_beacon_tailroom + mbssid_len);
|
||||
@@ -5261,7 +5271,7 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
offs->cntdwn_counter_offs[0] = beacon->cntdwn_counter_offsets[0];
|
||||
|
||||
if (mbssid_len) {
|
||||
- ieee80211_beacon_add_mbssid(skb, beacon);
|
||||
+ ieee80211_beacon_add_mbssid(skb, beacon, ema_index);
|
||||
offs->mbssid_off = skb->len - mbssid_len;
|
||||
}
|
||||
|
||||
@@ -5280,12 +5290,51 @@ ieee80211_beacon_get_ap(struct ieee80211
|
||||
return skb;
|
||||
}
|
||||
|
||||
+static struct ieee80211_ema_beacons *
|
||||
+ieee80211_beacon_get_ap_ema_list(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_link_data *link,
|
||||
+ struct ieee80211_mutable_offsets *offs,
|
||||
+ bool is_template, struct beacon_data *beacon,
|
||||
+ struct ieee80211_chanctx_conf *chanctx_conf)
|
||||
+{
|
||||
+ struct ieee80211_ema_beacons *ema = NULL;
|
||||
+
|
||||
+ if (!beacon->mbssid_ies || !beacon->mbssid_ies->cnt)
|
||||
+ return NULL;
|
||||
+
|
||||
+ ema = kzalloc(struct_size(ema, bcn, beacon->mbssid_ies->cnt),
|
||||
+ GFP_ATOMIC);
|
||||
+ if (!ema)
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (ema->cnt = 0; ema->cnt < beacon->mbssid_ies->cnt; ema->cnt++) {
|
||||
+ ema->bcn[ema->cnt].skb =
|
||||
+ ieee80211_beacon_get_ap(hw, vif, link,
|
||||
+ &ema->bcn[ema->cnt].offs,
|
||||
+ is_template, beacon,
|
||||
+ chanctx_conf, ema->cnt);
|
||||
+ if (!ema->bcn[ema->cnt].skb)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (ema->cnt == beacon->mbssid_ies->cnt)
|
||||
+ return ema;
|
||||
+
|
||||
+ ieee80211_beacon_free_ema_list(ema);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+#define IEEE80211_INCLUDE_ALL_MBSSID_ELEMS -1
|
||||
+
|
||||
static struct sk_buff *
|
||||
__ieee80211_beacon_get(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_mutable_offsets *offs,
|
||||
bool is_template,
|
||||
- unsigned int link_id)
|
||||
+ unsigned int link_id,
|
||||
+ int ema_index,
|
||||
+ struct ieee80211_ema_beacons **ema_beacons)
|
||||
{
|
||||
struct ieee80211_local *local = hw_to_local(hw);
|
||||
struct beacon_data *beacon = NULL;
|
||||
@@ -5314,8 +5363,29 @@ __ieee80211_beacon_get(struct ieee80211_
|
||||
if (!beacon)
|
||||
goto out;
|
||||
|
||||
- skb = ieee80211_beacon_get_ap(hw, vif, link, offs, is_template,
|
||||
- beacon, chanctx_conf);
|
||||
+ if (ema_beacons) {
|
||||
+ *ema_beacons =
|
||||
+ ieee80211_beacon_get_ap_ema_list(hw, vif, link,
|
||||
+ offs,
|
||||
+ is_template,
|
||||
+ beacon,
|
||||
+ chanctx_conf);
|
||||
+ } else {
|
||||
+ if (beacon->mbssid_ies && beacon->mbssid_ies->cnt) {
|
||||
+ if (ema_index >= beacon->mbssid_ies->cnt)
|
||||
+ goto out; /* End of MBSSID elements */
|
||||
+
|
||||
+ if (ema_index <= IEEE80211_INCLUDE_ALL_MBSSID_ELEMS)
|
||||
+ ema_index = beacon->mbssid_ies->cnt;
|
||||
+ } else {
|
||||
+ ema_index = 0;
|
||||
+ }
|
||||
+
|
||||
+ skb = ieee80211_beacon_get_ap(hw, vif, link, offs,
|
||||
+ is_template, beacon,
|
||||
+ chanctx_conf,
|
||||
+ ema_index);
|
||||
+ }
|
||||
} else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
|
||||
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
|
||||
struct ieee80211_hdr *hdr;
|
||||
@@ -5403,10 +5473,50 @@ ieee80211_beacon_get_template(struct iee
|
||||
struct ieee80211_mutable_offsets *offs,
|
||||
unsigned int link_id)
|
||||
{
|
||||
- return __ieee80211_beacon_get(hw, vif, offs, true, link_id);
|
||||
+ return __ieee80211_beacon_get(hw, vif, offs, true, link_id,
|
||||
+ IEEE80211_INCLUDE_ALL_MBSSID_ELEMS, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(ieee80211_beacon_get_template);
|
||||
|
||||
+struct sk_buff *
|
||||
+ieee80211_beacon_get_template_ema_index(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_mutable_offsets *offs,
|
||||
+ unsigned int link_id, u8 ema_index)
|
||||
+{
|
||||
+ return __ieee80211_beacon_get(hw, vif, offs, true, link_id, ema_index,
|
||||
+ NULL);
|
||||
+}
|
||||
+EXPORT_SYMBOL(ieee80211_beacon_get_template_ema_index);
|
||||
+
|
||||
+void ieee80211_beacon_free_ema_list(struct ieee80211_ema_beacons *ema_beacons)
|
||||
+{
|
||||
+ u8 i;
|
||||
+
|
||||
+ if (!ema_beacons)
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < ema_beacons->cnt; i++)
|
||||
+ kfree_skb(ema_beacons->bcn[i].skb);
|
||||
+
|
||||
+ kfree(ema_beacons);
|
||||
+}
|
||||
+EXPORT_SYMBOL(ieee80211_beacon_free_ema_list);
|
||||
+
|
||||
+struct ieee80211_ema_beacons *
|
||||
+ieee80211_beacon_get_template_ema_list(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ unsigned int link_id)
|
||||
+{
|
||||
+ struct ieee80211_ema_beacons *ema_beacons = NULL;
|
||||
+
|
||||
+ WARN_ON(__ieee80211_beacon_get(hw, vif, NULL, false, link_id, 0,
|
||||
+ &ema_beacons));
|
||||
+
|
||||
+ return ema_beacons;
|
||||
+}
|
||||
+EXPORT_SYMBOL(ieee80211_beacon_get_template_ema_list);
|
||||
+
|
||||
struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
u16 *tim_offset, u16 *tim_length,
|
||||
@@ -5414,7 +5524,9 @@ struct sk_buff *ieee80211_beacon_get_tim
|
||||
{
|
||||
struct ieee80211_mutable_offsets offs = {};
|
||||
struct sk_buff *bcn = __ieee80211_beacon_get(hw, vif, &offs, false,
|
||||
- link_id);
|
||||
+ link_id,
|
||||
+ IEEE80211_INCLUDE_ALL_MBSSID_ELEMS,
|
||||
+ NULL);
|
||||
struct sk_buff *copy;
|
||||
int shift;
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
|
||||
{
|
||||
struct ieee80211_local *local = wiphy_priv(wiphy);
|
||||
@@ -4953,6 +4966,7 @@ const struct cfg80211_ops mac80211_confi
|
||||
@@ -4956,6 +4969,7 @@ const struct cfg80211_ops mac80211_confi
|
||||
.set_wiphy_params = ieee80211_set_wiphy_params,
|
||||
.set_tx_power = ieee80211_set_tx_power,
|
||||
.get_tx_power = ieee80211_get_tx_power,
|
||||
@ -87,7 +87,7 @@
|
||||
CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump)
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1538,6 +1538,7 @@ struct ieee80211_local {
|
||||
@@ -1542,6 +1542,7 @@ struct ieee80211_local {
|
||||
int dynamic_ps_forced_timeout;
|
||||
|
||||
int user_power_level; /* in dBm, for all interfaces */
|
||||
|
||||
@ -155,11 +155,12 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
- dp_priv->phydev = phy_connect(netdev, phy_id,
|
||||
- &nss_dp_adjust_link,
|
||||
- dp_priv->phy_mii_type);
|
||||
- if (IS_ERR(dp_priv->phydev)) {
|
||||
- netdev_dbg(netdev, "failed to connect to phy device\n");
|
||||
+ dp_priv->phydev = of_phy_connect(netdev, dp_priv->phy_node,
|
||||
+ &nss_dp_adjust_link, 0,
|
||||
+ dp_priv->phy_mii_type);
|
||||
if (IS_ERR(dp_priv->phydev)) {
|
||||
- netdev_dbg(netdev, "failed to connect to phy device\n");
|
||||
+ if (!(dp_priv->phydev)) {
|
||||
+ dev_err(&pdev->dev, "Could not attach to PHY\n");
|
||||
goto phy_setup_fail;
|
||||
}
|
||||
|
||||
@ -5,9 +5,9 @@ PKG_RELEASE=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
|
||||
PKG_MIRROR_HASH:=400bef38b8c0f382e4e595a50bb52dfbdb8da820eb80f3447b9bd7be3f5499a5
|
||||
PKG_SOURCE_DATE:=2022-09-27
|
||||
PKG_SOURCE_VERSION:=ea56013409d5823001b47a9bba6f74055a6d76a5
|
||||
PKG_MIRROR_HASH:=f22de22a784a0135cc2869fe81ff30e52136dca36863ee713503b4be5be01869
|
||||
PKG_SOURCE_DATE:=2023-05-23
|
||||
PKG_SOURCE_VERSION:=75a3b870cace1171faf57bd55e5a9a2f1564f757
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
|
||||
@ -100,8 +100,8 @@ This variant uses AES CPU instructions (Intel AESNI or ARMv8 Crypto Extension)
|
||||
endef
|
||||
|
||||
define Package/libwolfsslcpu-crypto/config
|
||||
if TARGET_armvirt && PACKAGE_libwolfsslcpu-crypto = y
|
||||
comment "You are about to build libwolfsslcpu-crypto into an armvirt_64 image."
|
||||
if TARGET_armsr && PACKAGE_libwolfsslcpu-crypto = y
|
||||
comment "You are about to build libwolfsslcpu-crypto into an armsr_64 image."
|
||||
comment "Ensure all of your installation targets support the Crypto Extension. "
|
||||
comment "Look for the 'aes' feature in /proc/cpuinfo. This library does not do "
|
||||
comment "run-time detection and will crash if the CPU does not support it. "
|
||||
|
||||
@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=unetd
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git
|
||||
PKG_SOURCE_DATE:=2022-09-16.1
|
||||
PKG_SOURCE_VERSION:=6c888f897862b152e2cfae735faafc9cdcb07336
|
||||
PKG_MIRROR_HASH:=35df8c822c671495146c3d5d1c193c1d1a44721c274aee2035943eb5e8c04768
|
||||
PKG_SOURCE_DATE:=2023-05-31
|
||||
PKG_SOURCE_VERSION:=7d3986b7a5a20b9af0dacd053b2657210385e7bb
|
||||
PKG_MIRROR_HASH:=07f0a4cbae3e80c6309bb8aa27fcef19fbc56093a9c7e426e0d527227af09429
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
@ -12,7 +12,7 @@ PKG_VERSION:=21.08
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/restool
|
||||
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/restool
|
||||
PKG_SOURCE_VERSION:=LSDK-21.08
|
||||
PKG_MIRROR_HASH:=0396644927b8f3da20183227562f695c8063d3d4c6bb606e8f31dda450e962e4
|
||||
|
||||
|
||||
1
rules.mk
1
rules.mk
@ -227,6 +227,7 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(TARGET_PATH)
|
||||
export STAGING_DIR STAGING_DIR_HOST STAGING_DIR_HOSTPKG
|
||||
export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
|
||||
|
||||
@ -9,8 +9,10 @@ fi
|
||||
OUTPUT="$1"
|
||||
KERNELSIZE="$2"
|
||||
KERNELDIR="$3"
|
||||
KERNELPARTTYPE=${KERNELPARTTYPE:-83}
|
||||
ROOTFSSIZE="$4"
|
||||
ROOTFSIMAGE="$5"
|
||||
ROOTFSPARTTYPE=${ROOTFSPARTTYPE:-83}
|
||||
ALIGN="$6"
|
||||
|
||||
rm -f "$OUTPUT"
|
||||
@ -19,7 +21,7 @@ head=16
|
||||
sect=63
|
||||
|
||||
# create partition table
|
||||
set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p "${KERNELSIZE}m${PARTOFFSET:+@$PARTOFFSET}" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID})
|
||||
set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -t "${KERNELPARTTYPE}" -p "${KERNELSIZE}m${PARTOFFSET:+@$PARTOFFSET}" -t "${ROOTFSPARTTYPE}" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID})
|
||||
|
||||
KERNELOFFSET="$(($1 / 512))"
|
||||
KERNELSIZE="$2"
|
||||
|
||||
@ -109,10 +109,10 @@ Examples
|
||||
$SELF malta be -m 64
|
||||
$SELF malta le64
|
||||
$SELF malta be-glibc
|
||||
$SELF armvirt 32 \\
|
||||
$SELF armsr armv7 \\
|
||||
--machine virt,highmem=off \\
|
||||
--kernel bin/targets/armvirt/32/openwrt-armvirt-32-zImage \\
|
||||
--rootfs bin/targets/armvirt/32/openwrt-armvirt-32-root.ext4
|
||||
--kernel bin/targets/armsr/armv7/openwrt-armsr-armv7-generic-kernel.bin \\
|
||||
--rootfs bin/targets/armsr/armv7/openwrt-armsr-armv7-generic-ext4-rootfs.img
|
||||
EOF
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ parse_args() {
|
||||
o_bindir="${CONFIG_BINARY_FOLDER:-bin}/targets/$o_target/$o_subtarget"
|
||||
}
|
||||
|
||||
start_qemu_armvirt() {
|
||||
start_qemu_armsr() {
|
||||
local kernel="$o_kernel"
|
||||
local rootfs="$o_rootfs"
|
||||
local mach="${o_mach:-virt}"
|
||||
@ -170,15 +170,15 @@ start_qemu_armvirt() {
|
||||
local qemu_exe
|
||||
|
||||
case "${o_subtarget%-*}" in
|
||||
32)
|
||||
armv7)
|
||||
qemu_exe="qemu-system-arm"
|
||||
cpu="cortex-a15"
|
||||
[ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-zImage-initramfs"
|
||||
[ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-generic-initramfs-kernel.bin"
|
||||
;;
|
||||
64)
|
||||
armv8)
|
||||
qemu_exe="qemu-system-aarch64"
|
||||
cpu="cortex-a57"
|
||||
[ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-Image-initramfs"
|
||||
[ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-generic-initramfs-kernel.bin"
|
||||
;;
|
||||
*)
|
||||
__errmsg "target $o_target: unknown subtarget $o_subtarget"
|
||||
@ -328,7 +328,7 @@ start_qemu_x86() {
|
||||
|
||||
start_qemu() {
|
||||
case "$o_target" in
|
||||
armvirt) start_qemu_armvirt ;;
|
||||
armsr) start_qemu_armsr ;;
|
||||
malta) start_qemu_malta ;;
|
||||
x86) start_qemu_x86 ;;
|
||||
*)
|
||||
|
||||
@ -13,6 +13,7 @@ export TOPDIR LC_ALL LANG
|
||||
export OPENWRT_VERBOSE=s
|
||||
all: help
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||
|
||||
ifneq ($(OPENWRT_BUILD),1)
|
||||
|
||||
@ -4,15 +4,18 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
BOARD:=armvirt
|
||||
BOARDNAME:=QEMU ARM Virtual Machine
|
||||
FEATURES:=fpu pci rtc usb
|
||||
FEATURES+=cpiogz ext4 ramdisk squashfs targz
|
||||
BOARD:=armsr
|
||||
BOARDNAME:=Arm SystemReady (EFI) compliant
|
||||
FEATURES:=fpu pci pcie rtc usb boot-part rootfs-part
|
||||
FEATURES+=cpiogz ext4 ramdisk squashfs targz vmdk
|
||||
|
||||
KERNEL_PATCHVER:=5.15
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
DEFAULT_PACKAGES += mkf2fs e2fsprogs
|
||||
# blkid used for resolving PARTUUID
|
||||
# in sysupgrade
|
||||
DEFAULT_PACKAGES += blkid
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
75
target/linux/armsr/README
Normal file
75
target/linux/armsr/README
Normal file
@ -0,0 +1,75 @@
|
||||
This target generates images that can be used on ARM machines with EFI
|
||||
support (e.g EDKII/TianoCore or U-Boot with bootefi).
|
||||
|
||||
There are two subtargets:
|
||||
- armv7 for 32-bit machines
|
||||
- armv8 for 64-bit machines
|
||||
|
||||
The kernel and filesystem images can also be used directly by QEMU:
|
||||
|
||||
Run with qemu-system-arm
|
||||
|
||||
# boot with initramfs embedded in
|
||||
qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armsr-armv7-generic-initramfs-kernel.bin
|
||||
|
||||
# boot with accel=kvm
|
||||
qemu-system-arm -nographic -M virt,accel=kvm -cpu host -m 64 -kernel
|
||||
openwrt-armsr-armv7-generic-initramfs-kernel.bin
|
||||
|
||||
# boot with a separate rootfs
|
||||
qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armsr-armv7-generic-kernel.bin \
|
||||
-drive file=openwrt-armsr-armv7-generic-ext4-rootfs.img,format=raw,if=virtio -append 'root=/dev/vda rootwait'
|
||||
|
||||
# boot with local dir as rootfs
|
||||
qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armsr-armv7-generic-kernel.bin \
|
||||
-fsdev local,id=rootdev,path=root-armsr/,security_model=none \
|
||||
-device virtio-9p-pci,fsdev=rootdev,mount_tag=/dev/root \
|
||||
-append 'rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p'
|
||||
|
||||
Run with kvmtool
|
||||
|
||||
# start a named machine
|
||||
lkvm run -k openwrt-armsr-armv7-zImage -i openwrt-armsr-armv7-rootfs.cpio --name armsr0
|
||||
|
||||
# start with virtio-9p rootfs
|
||||
lkvm run -k openwrt-armsr-armv7-zImage -d root-armsr/
|
||||
|
||||
# stop "armsr0"
|
||||
lkvm stop --name armsr0
|
||||
|
||||
# stop all
|
||||
lkvm stop --all
|
||||
|
||||
The multi-platform ARMv8 target can be used with QEMU:
|
||||
|
||||
qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \
|
||||
-kernel openwrt-armsr-armv8-generic-initramfs-kernel.bin \
|
||||
|
||||
With a EDKII or U-Boot binary for the QEMU ARM virtual machines, you can use these
|
||||
images in EFI mode:
|
||||
|
||||
32-bit:
|
||||
gunzip -c bin/targets/armsr/armv7/openwrt-armsr-armv7-generic-ext4-combined.img.gz > openwrt-arm-32.img
|
||||
qemu-system-arm -nographic \
|
||||
-cpu cortex-a15 -machine virt \
|
||||
-bios bin/targets/armsr/armv7/u-boot-qemu_armv7/u-boot.bin \
|
||||
-smp 1 -m 1024 \
|
||||
-device virtio-rng-pci \
|
||||
-drive file=openwrt-arm-32.img,format=raw,index=0,media=disk \
|
||||
-netdev user,id=testlan -net nic,netdev=testlan \
|
||||
-netdev user,id=testwan -net nic,netdev=testwan
|
||||
|
||||
64-bit:
|
||||
gunzip -c bin/targets/armsr/armv8/openwrt-armsr-armv8-generic-ext4-combined.img.gz > openwrt-arm-64.img
|
||||
qemu-system-aarch64 -nographic \
|
||||
-cpu cortex-a53 -machine virt \
|
||||
-bios bin/targets/armsr/armv8/u-boot-qemu_armv8/u-boot.bin \
|
||||
-smp 1 -m 1024 \
|
||||
-device virtio-rng-pci \
|
||||
-drive file=openwrt-arm-64.img,format=raw,index=0,media=disk \
|
||||
-netdev user,id=testlan -net nic,netdev=testlan \
|
||||
-netdev user,id=testwan -net nic,netdev=testwan
|
||||
|
||||
One can obtain other EFI/BIOS binaries from:
|
||||
- Distribution packages (such as qemu-efi-arm and qemu-efi-aarch64 in Debian)
|
||||
- Community builds, like retrage/edk2-nightly: https://retrage.github.io/edk2-nightly/
|
||||
@ -4,6 +4,7 @@ CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
||||
CONFIG_ARCH_MULTIPLATFORM=y
|
||||
CONFIG_ARCH_MULTI_V6_V7=y
|
||||
CONFIG_ARCH_MULTI_V7=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=8
|
||||
CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
|
||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
|
||||
@ -14,6 +15,7 @@ CONFIG_ARM_CPU_SUSPEND=y
|
||||
CONFIG_ARM_CRYPTO=y
|
||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
||||
CONFIG_ARM_HEAVY_MB=y
|
||||
# CONFIG_ARM_HIGHBANK_CPUIDLE is not set
|
||||
CONFIG_ARM_L1_CACHE_SHIFT=6
|
||||
CONFIG_ARM_L1_CACHE_SHIFT_6=y
|
||||
CONFIG_ARM_LPAE=y
|
||||
@ -1,6 +1,6 @@
|
||||
ARCH:=arm
|
||||
SUBTARGET:=32
|
||||
BOARDNAME:=QEMU ARM Virtual Machine (cortex-a15)
|
||||
SUBTARGET:=armv7
|
||||
BOARDNAME:=32-bit (armv7) machines
|
||||
CPU_TYPE:=cortex-a15
|
||||
CPU_SUBTYPE:=neon-vfpv4
|
||||
KERNELNAME:=zImage
|
||||
500
target/linux/armsr/armv8/config-5.15
Normal file
500
target/linux/armsr/armv8/config-5.15
Normal file
@ -0,0 +1,500 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ARCH_HISI=y
|
||||
CONFIG_ARCH_INTEL_SOCFPGA=y
|
||||
CONFIG_ARCH_LAYERSCAPE=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_MVEBU=y
|
||||
CONFIG_ARCH_MXC=y
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUNXI=y
|
||||
CONFIG_ARCH_SYNQUACER=y
|
||||
CONFIG_ARCH_THUNDER=y
|
||||
CONFIG_ARCH_THUNDER2=y
|
||||
CONFIG_ARCH_VEXPRESS=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_ZYNQMP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
CONFIG_ARM64_ERRATUM_827319=y
|
||||
CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=48
|
||||
CONFIG_ARM64_VA_BITS_48=y
|
||||
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
|
||||
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
|
||||
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y
|
||||
# CONFIG_ARMADA_37XX_RWTM_MBOX is not set
|
||||
CONFIG_ARMADA_37XX_WATCHDOG=y
|
||||
CONFIG_ARMADA_THERMAL=y
|
||||
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
|
||||
# CONFIG_ARM_DMC620_PMU is not set
|
||||
# CONFIG_ARM_MHU_V2 is not set
|
||||
CONFIG_ARM_SBSA_WATCHDOG=y
|
||||
CONFIG_ARM_SMC_WATCHDOG=y
|
||||
CONFIG_ARM_SMMU=y
|
||||
# CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT is not set
|
||||
# CONFIG_ARM_SMMU_LEGACY_DT_BINDINGS is not set
|
||||
CONFIG_ARM_SMMU_V3=y
|
||||
# CONFIG_ARM_SMMU_V3_PMU is not set
|
||||
# CONFIG_ARM_SMMU_V3_SVA is not set
|
||||
CONFIG_AT803X_PHY=y
|
||||
CONFIG_ATA=y
|
||||
CONFIG_ATOMIC64_SELFTEST=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
# CONFIG_AXI_DMAC is not set
|
||||
CONFIG_BACKLIGHT_CLASS_DEVICE=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_CAVIUM_TX2_ERRATUM_219=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLK_IMX8MM=y
|
||||
CONFIG_CLK_IMX8MN=y
|
||||
CONFIG_CLK_IMX8MP=y
|
||||
CONFIG_CLK_IMX8MQ=y
|
||||
CONFIG_CLK_INTEL_SOCFPGA=y
|
||||
CONFIG_CLK_INTEL_SOCFPGA64=y
|
||||
CONFIG_CLK_LS1028A_PLLDIG=y
|
||||
CONFIG_CLK_PX30=y
|
||||
CONFIG_CLK_QORIQ=y
|
||||
CONFIG_CLK_RK3308=y
|
||||
CONFIG_CLK_RK3328=y
|
||||
CONFIG_CLK_RK3368=y
|
||||
CONFIG_CLK_RK3399=y
|
||||
CONFIG_CLK_RK3568=y
|
||||
CONFIG_CLK_SP810=y
|
||||
CONFIG_CLK_SUNXI=y
|
||||
CONFIG_CLK_SUNXI_CLOCKS=y
|
||||
# CONFIG_CLK_SUNXI_PRCM_SUN6I is not set
|
||||
# CONFIG_CLK_SUNXI_PRCM_SUN8I is not set
|
||||
# CONFIG_CLK_SUNXI_PRCM_SUN9I is not set
|
||||
CONFIG_CLK_VEXPRESS_OSC=y
|
||||
# CONFIG_COMMON_CLK_FSL_FLEXSPI is not set
|
||||
# CONFIG_COMMON_CLK_FSL_SAI is not set
|
||||
CONFIG_COMMON_CLK_HI3516CV300=y
|
||||
CONFIG_COMMON_CLK_HI3519=y
|
||||
CONFIG_COMMON_CLK_HI3559A=y
|
||||
CONFIG_COMMON_CLK_HI3660=y
|
||||
CONFIG_COMMON_CLK_HI3670=y
|
||||
CONFIG_COMMON_CLK_HI3798CV200=y
|
||||
CONFIG_COMMON_CLK_HI6220=y
|
||||
CONFIG_COMMON_CLK_HI655X=y
|
||||
CONFIG_COMMON_CLK_ROCKCHIP=y
|
||||
CONFIG_COMMON_CLK_SCPI=y
|
||||
CONFIG_COMMON_CLK_ZYNQMP=y
|
||||
CONFIG_COMMON_RESET_HI3660=y
|
||||
CONFIG_COMMON_RESET_HI6220=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CHACHA20=y
|
||||
CONFIG_CRYPTO_CHACHA20_NEON=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
# CONFIG_CRYPTO_DEV_ALLWINNER is not set
|
||||
# CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM is not set
|
||||
# CONFIG_CRYPTO_DEV_HISI_HPRE is not set
|
||||
# CONFIG_CRYPTO_DEV_HISI_SEC2 is not set
|
||||
# CONFIG_CRYPTO_DEV_HISI_TRNG is not set
|
||||
# CONFIG_CRYPTO_DEV_OCTEONTX2_CPT is not set
|
||||
# CONFIG_CRYPTO_DEV_ROCKCHIP is not set
|
||||
# CONFIG_CRYPTO_DEV_ZYNQMP_AES is not set
|
||||
CONFIG_CRYPTO_GHASH_ARM64_CE=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y
|
||||
CONFIG_CRYPTO_SHA1=y
|
||||
CONFIG_CRYPTO_SHA1_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA2_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_SUN6I=y
|
||||
CONFIG_DRM=y
|
||||
CONFIG_DRM_BOCHS=y
|
||||
CONFIG_DRM_BRIDGE=y
|
||||
CONFIG_DRM_GEM_SHMEM_HELPER=y
|
||||
# CONFIG_DRM_IMX_DCSS is not set
|
||||
CONFIG_DRM_KMS_HELPER=y
|
||||
CONFIG_DRM_PANEL=y
|
||||
CONFIG_DRM_PANEL_BRIDGE=y
|
||||
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
|
||||
CONFIG_DRM_QXL=y
|
||||
CONFIG_DRM_TTM=y
|
||||
CONFIG_DRM_TTM_HELPER=y
|
||||
CONFIG_DRM_VIRTIO_GPU=y
|
||||
CONFIG_DRM_VRAM_HELPER=y
|
||||
# CONFIG_DWMAC_SUN8I is not set
|
||||
# CONFIG_DWMAC_SUNXI is not set
|
||||
CONFIG_DW_WATCHDOG=y
|
||||
CONFIG_ENA_ETHERNET=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_ARMCLCD=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
CONFIG_FB_MODE_HELPERS=y
|
||||
# CONFIG_FB_MX3 is not set
|
||||
# CONFIG_FB_XILINX is not set
|
||||
CONFIG_FRAME_POINTER=y
|
||||
# CONFIG_FSL_DPAA is not set
|
||||
# CONFIG_FSL_DPAA2_QDMA is not set
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
# CONFIG_FSL_IMX8_DDR_PMU is not set
|
||||
# CONFIG_FSL_PQ_MDIO is not set
|
||||
CONFIG_FUJITSU_ERRATUM_010001=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
# CONFIG_GIANFAR is not set
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GPIO_MPC8XXX=y
|
||||
CONFIG_GPIO_MXC=y
|
||||
CONFIG_GPIO_ROCKCHIP=y
|
||||
CONFIG_GPIO_THUNDERX=y
|
||||
CONFIG_GPIO_XLP=y
|
||||
CONFIG_GPIO_ZYNQ=y
|
||||
CONFIG_HDMI=y
|
||||
CONFIG_HI3660_MBOX=y
|
||||
CONFIG_HI6220_MBOX=y
|
||||
CONFIG_HISILICON_LPC=y
|
||||
CONFIG_HISI_PMU=y
|
||||
CONFIG_HISI_THERMAL=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_ARM_SMCCC_TRNG=y
|
||||
# CONFIG_HW_RANDOM_HISI is not set
|
||||
CONFIG_HW_RANDOM_VIRTIO=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_ALGOBIT=y
|
||||
CONFIG_I2C_ALTERA=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_HIX5HD2 is not set
|
||||
CONFIG_I2C_IMX=y
|
||||
CONFIG_I2C_IMX_LPI2C=y
|
||||
CONFIG_I2C_SYNQUACER=y
|
||||
CONFIG_I2C_THUNDERX=y
|
||||
# CONFIG_I2C_XLP9XX is not set
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_IMX2_WDT=y
|
||||
CONFIG_IMX7ULP_WDT=y
|
||||
# CONFIG_IMX8MM_THERMAL is not set
|
||||
# CONFIG_IMX_DMA is not set
|
||||
# CONFIG_IMX_DSP is not set
|
||||
CONFIG_IMX_IRQSTEER=y
|
||||
CONFIG_IMX_MBOX=y
|
||||
# CONFIG_IMX_SCU is not set
|
||||
CONFIG_IMX_SDMA=y
|
||||
# CONFIG_IMX_WEIM is not set
|
||||
# CONFIG_INPUT_HISI_POWERKEY is not set
|
||||
# CONFIG_INTEL_STRATIX10_RSU is not set
|
||||
# CONFIG_INTEL_STRATIX10_SERVICE is not set
|
||||
CONFIG_INTERCONNECT=y
|
||||
CONFIG_INTERCONNECT_IMX=y
|
||||
CONFIG_INTERCONNECT_IMX8MM=y
|
||||
CONFIG_INTERCONNECT_IMX8MN=y
|
||||
CONFIG_INTERCONNECT_IMX8MQ=y
|
||||
# CONFIG_IOMMU_DEBUGFS is not set
|
||||
# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set
|
||||
CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
|
||||
CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y
|
||||
# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
|
||||
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
|
||||
CONFIG_IOMMU_SUPPORT=y
|
||||
# CONFIG_K3_DMA is not set
|
||||
CONFIG_KCMP=y
|
||||
# CONFIG_KEYBOARD_SUN4I_LRADC is not set
|
||||
CONFIG_LCD_CLASS_DEVICE=m
|
||||
# CONFIG_LCD_PLATFORM is not set
|
||||
# CONFIG_MAILBOX_TEST is not set
|
||||
CONFIG_MDIO_SUN4I=y
|
||||
# CONFIG_MFD_ALTERA_A10SR is not set
|
||||
CONFIG_MFD_ALTERA_SYSMGR=y
|
||||
# CONFIG_MFD_AXP20X_RSB is not set
|
||||
CONFIG_MFD_CORE=y
|
||||
CONFIG_MFD_HI655X_PMIC=y
|
||||
# CONFIG_MFD_KHADAS_MCU is not set
|
||||
CONFIG_MFD_SUN4I_GPADC=y
|
||||
# CONFIG_MFD_SUN6I_PRCM is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MFD_VEXPRESS_SYSREG=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_ARMMMCI=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_CAVIUM_THUNDERX=y
|
||||
CONFIG_MMC_DW=y
|
||||
# CONFIG_MMC_DW_BLUEFIELD is not set
|
||||
# CONFIG_MMC_DW_EXYNOS is not set
|
||||
# CONFIG_MMC_DW_HI3798CV200 is not set
|
||||
# CONFIG_MMC_DW_K3 is not set
|
||||
# CONFIG_MMC_DW_PCI is not set
|
||||
CONFIG_MMC_DW_PLTFM=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
# CONFIG_MMC_MXC is not set
|
||||
CONFIG_MMC_RICOH_MMC=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_ACPI=y
|
||||
CONFIG_MMC_SDHCI_CADENCE=y
|
||||
CONFIG_MMC_SDHCI_ESDHC_IMX=y
|
||||
CONFIG_MMC_SDHCI_OF_ESDHC=y
|
||||
CONFIG_MMC_SDHCI_PCI=y
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MMC_SUNXI=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
# CONFIG_MV_XOR is not set
|
||||
# CONFIG_MX3_IPU is not set
|
||||
CONFIG_MXS_DMA=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
# CONFIG_NET_VENDOR_ALLWINNER is not set
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=64
|
||||
CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y
|
||||
# CONFIG_NVMEM_IMX_IIM is not set
|
||||
CONFIG_NVMEM_IMX_OCOTP=y
|
||||
CONFIG_NVMEM_IMX_OCOTP_SCU=y
|
||||
# CONFIG_NVMEM_LAYERSCAPE_SFP is not set
|
||||
CONFIG_NVMEM_ROCKCHIP_EFUSE=y
|
||||
# CONFIG_NVMEM_ROCKCHIP_OTP is not set
|
||||
# CONFIG_NVMEM_SNVS_LPGPR is not set
|
||||
# CONFIG_NVMEM_SUNXI_SID is not set
|
||||
# CONFIG_NVMEM_ZYNQMP is not set
|
||||
CONFIG_PCC=y
|
||||
CONFIG_PCIE_HISI_STB=y
|
||||
CONFIG_PCIE_LAYERSCAPE=y
|
||||
CONFIG_PCIE_MOBIVEIL_PLAT=y
|
||||
CONFIG_PCIE_ROCKCHIP=y
|
||||
# CONFIG_PCIE_ROCKCHIP_DW_HOST is not set
|
||||
CONFIG_PCIE_ROCKCHIP_HOST=y
|
||||
CONFIG_PCIE_XILINX_CPM=y
|
||||
CONFIG_PCIE_XILINX_NWL=y
|
||||
CONFIG_PCI_AARDVARK=y
|
||||
CONFIG_PCI_IMX6=y
|
||||
CONFIG_PCI_LAYERSCAPE=y
|
||||
CONFIG_PHY_FSL_IMX8MQ_USB=y
|
||||
CONFIG_PHY_HI3660_USB=y
|
||||
CONFIG_PHY_HI3670_USB=y
|
||||
CONFIG_PHY_HI6220_USB=y
|
||||
CONFIG_PHY_HISI_INNO_USB2=y
|
||||
# CONFIG_PHY_HISTB_COMBPHY is not set
|
||||
CONFIG_PHY_MVEBU_A3700_COMPHY=y
|
||||
CONFIG_PHY_MVEBU_A3700_UTMI=y
|
||||
CONFIG_PHY_MVEBU_A38X_COMPHY=y
|
||||
CONFIG_PHY_MVEBU_CP110_COMPHY=y
|
||||
# CONFIG_PHY_ROCKCHIP_DP is not set
|
||||
# CONFIG_PHY_ROCKCHIP_DPHY_RX0 is not set
|
||||
CONFIG_PHY_ROCKCHIP_EMMC=y
|
||||
# CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY is not set
|
||||
# CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set
|
||||
# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_PCIE=y
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=y
|
||||
# CONFIG_PHY_ROCKCHIP_USB is not set
|
||||
CONFIG_PHY_SUN4I_USB=y
|
||||
CONFIG_PHY_SUN50I_USB3=y
|
||||
# CONFIG_PHY_SUN6I_MIPI_DPHY is not set
|
||||
CONFIG_PHY_SUN9I_USB=y
|
||||
# CONFIG_PHY_XILINX_ZYNQMP is not set
|
||||
CONFIG_PINCTRL_IMX8MM=y
|
||||
CONFIG_PINCTRL_IMX8MN=y
|
||||
CONFIG_PINCTRL_IMX8MP=y
|
||||
CONFIG_PINCTRL_IMX8MQ=y
|
||||
CONFIG_PINCTRL_IMX8ULP=y
|
||||
CONFIG_PINCTRL_ROCKCHIP=y
|
||||
CONFIG_PINCTRL_SUN4I_A10=y
|
||||
CONFIG_PINCTRL_SUN50I_A100=y
|
||||
CONFIG_PINCTRL_SUN50I_A100_R=y
|
||||
CONFIG_PINCTRL_SUN50I_A64=y
|
||||
CONFIG_PINCTRL_SUN50I_A64_R=y
|
||||
CONFIG_PINCTRL_SUN50I_H5=y
|
||||
CONFIG_PINCTRL_SUN50I_H6=y
|
||||
CONFIG_PINCTRL_SUN50I_H616=y
|
||||
CONFIG_PINCTRL_SUN50I_H616_R=y
|
||||
CONFIG_PINCTRL_SUN50I_H6_R=y
|
||||
CONFIG_PINCTRL_SUN5I=y
|
||||
# CONFIG_PINCTRL_SUN6I_A31 is not set
|
||||
# CONFIG_PINCTRL_SUN6I_A31_R is not set
|
||||
# CONFIG_PINCTRL_SUN8I_A23 is not set
|
||||
# CONFIG_PINCTRL_SUN8I_A23_R is not set
|
||||
# CONFIG_PINCTRL_SUN8I_A33 is not set
|
||||
# CONFIG_PINCTRL_SUN8I_A83T is not set
|
||||
# CONFIG_PINCTRL_SUN8I_A83T_R is not set
|
||||
# CONFIG_PINCTRL_SUN8I_H3 is not set
|
||||
# CONFIG_PINCTRL_SUN8I_H3_R is not set
|
||||
# CONFIG_PINCTRL_SUN8I_V3S is not set
|
||||
# CONFIG_PINCTRL_SUN9I_A80 is not set
|
||||
# CONFIG_PINCTRL_SUN9I_A80_R is not set
|
||||
CONFIG_PINCTRL_ZYNQMP=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_HISI=y
|
||||
CONFIG_POWER_RESET_VEXPRESS=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_QORIQ_THERMAL=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_REGULATOR=y
|
||||
CONFIG_REGULATOR_ANATOP=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
CONFIG_REGULATOR_HI655X=y
|
||||
CONFIG_REGULATOR_PFUZE100=y
|
||||
# CONFIG_REGULATOR_VEXPRESS is not set
|
||||
CONFIG_RESET_IMX7=y
|
||||
CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
CONFIG_ROCKCHIP_IOMMU=y
|
||||
# CONFIG_ROCKCHIP_MBOX is not set
|
||||
CONFIG_ROCKCHIP_PM_DOMAINS=y
|
||||
# CONFIG_ROCKCHIP_SARADC is not set
|
||||
# CONFIG_ROCKCHIP_THERMAL is not set
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
# CONFIG_RTC_DRV_FSL_FTM_ALARM is not set
|
||||
# CONFIG_RTC_DRV_IMXDI is not set
|
||||
CONFIG_RTC_DRV_MV=y
|
||||
# CONFIG_RTC_DRV_MXC is not set
|
||||
# CONFIG_RTC_DRV_MXC_V2 is not set
|
||||
CONFIG_RTC_I2C_AND_SPI=y
|
||||
CONFIG_SATA_AHCI=y
|
||||
CONFIG_SATA_AHCI_PLATFORM=y
|
||||
CONFIG_SATA_HOST=y
|
||||
# CONFIG_SERIAL_8250_EXAR is not set
|
||||
CONFIG_SERIAL_8250_PCI=y
|
||||
CONFIG_SERIAL_IMX=y
|
||||
CONFIG_SERIAL_IMX_CONSOLE=y
|
||||
CONFIG_SERIAL_IMX_EARLYCON=y
|
||||
CONFIG_SERIAL_MVEBU_CONSOLE=y
|
||||
CONFIG_SERIAL_MVEBU_UART=y
|
||||
CONFIG_SERIAL_SAMSUNG=y
|
||||
CONFIG_SERIAL_SAMSUNG_CONSOLE=y
|
||||
# CONFIG_SMC91X is not set
|
||||
# CONFIG_SND_SUN4I_I2S is not set
|
||||
# CONFIG_SND_SUN50I_CODEC_ANALOG is not set
|
||||
# CONFIG_SND_SUN50I_DMIC is not set
|
||||
# CONFIG_SND_SUN8I_CODEC is not set
|
||||
# CONFIG_SND_SUN8I_CODEC_ANALOG is not set
|
||||
# CONFIG_SNI_NETSEC is not set
|
||||
CONFIG_SOC_IMX8M=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPI_ARMADA_3700=y
|
||||
# CONFIG_SPI_FSL_LPSPI is not set
|
||||
# CONFIG_SPI_FSL_QUADSPI is not set
|
||||
# CONFIG_SPI_HISI_KUNPENG is not set
|
||||
# CONFIG_SPI_HISI_SFC is not set
|
||||
# CONFIG_SPI_HISI_SFC_V3XX is not set
|
||||
# CONFIG_SPI_IMX is not set
|
||||
# CONFIG_SPI_ROCKCHIP_SFC is not set
|
||||
# CONFIG_SPI_SUN4I is not set
|
||||
# CONFIG_SPI_SUN6I is not set
|
||||
# CONFIG_SPI_SYNQUACER is not set
|
||||
CONFIG_SPI_THUNDERX=y
|
||||
# CONFIG_SPI_XLP is not set
|
||||
CONFIG_STUB_CLK_HI3660=y
|
||||
CONFIG_STUB_CLK_HI6220=y
|
||||
CONFIG_SUN50I_A100_CCU=y
|
||||
CONFIG_SUN50I_A100_R_CCU=y
|
||||
CONFIG_SUN50I_A64_CCU=y
|
||||
CONFIG_SUN50I_H616_CCU=y
|
||||
CONFIG_SUN50I_H6_CCU=y
|
||||
CONFIG_SUN50I_H6_R_CCU=y
|
||||
CONFIG_SUN50I_IOMMU=y
|
||||
CONFIG_SUN6I_MSGBOX=y
|
||||
# CONFIG_SUN8I_A83T_CCU is not set
|
||||
CONFIG_SUN8I_DE2_CCU=y
|
||||
# CONFIG_SUN8I_H3_CCU is not set
|
||||
CONFIG_SUN8I_R_CCU=y
|
||||
CONFIG_SUN8I_THERMAL=y
|
||||
CONFIG_SUNXI_CCU=y
|
||||
CONFIG_SUNXI_RSB=y
|
||||
CONFIG_SUNXI_WATCHDOG=y
|
||||
CONFIG_SYNC_FILE=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
# CONFIG_TCG_TIS_SYNQUACER is not set
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
# CONFIG_TURRIS_MOX_RWTM is not set
|
||||
CONFIG_TYPEC=y
|
||||
# CONFIG_TYPEC_DP_ALTMODE is not set
|
||||
# CONFIG_TYPEC_FUSB302 is not set
|
||||
# CONFIG_TYPEC_HD3SS3220 is not set
|
||||
# CONFIG_TYPEC_MUX_PI3USB30532 is not set
|
||||
# CONFIG_TYPEC_RT1711H is not set
|
||||
# CONFIG_TYPEC_STUSB160X is not set
|
||||
CONFIG_TYPEC_TCPCI=y
|
||||
# CONFIG_TYPEC_TCPCI_MAXIM is not set
|
||||
CONFIG_TYPEC_TCPM=y
|
||||
# CONFIG_TYPEC_TPS6598X is not set
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB_CHIPIDEA=y
|
||||
CONFIG_USB_CHIPIDEA_HOST=y
|
||||
CONFIG_USB_CHIPIDEA_IMX=y
|
||||
CONFIG_USB_CHIPIDEA_MSM=y
|
||||
CONFIG_USB_CHIPIDEA_UDC=y
|
||||
CONFIG_USB_DWC3=y
|
||||
CONFIG_USB_DWC3_DUAL_ROLE=y
|
||||
CONFIG_USB_DWC3_HAPS=y
|
||||
CONFIG_USB_DWC3_IMX8MP=y
|
||||
CONFIG_USB_DWC3_OF_SIMPLE=y
|
||||
CONFIG_USB_DWC3_XILINX=y
|
||||
CONFIG_USB_EHCI_FSL=y
|
||||
# CONFIG_USB_EHCI_HCD_ORION is not set
|
||||
CONFIG_USB_MXS_PHY=y
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_XHCI_HISTB=y
|
||||
CONFIG_USB_XHCI_MVEBU=y
|
||||
CONFIG_USB_XHCI_PLATFORM=y
|
||||
CONFIG_VEXPRESS_CONFIG=y
|
||||
CONFIG_VIDEOMODE_HELPERS=y
|
||||
# CONFIG_VIDEO_SUN4I_CSI is not set
|
||||
# CONFIG_VIDEO_SUN6I_CSI is not set
|
||||
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
|
||||
# CONFIG_VIRTIO_IOMMU is not set
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WDAT_WDT=y
|
||||
# CONFIG_XILINX_AMS is not set
|
||||
# CONFIG_XILINX_INTC is not set
|
||||
CONFIG_ZONE_DMA32=y
|
||||
CONFIG_ZYNQMP_FIRMWARE=y
|
||||
# CONFIG_ZYNQMP_FIRMWARE_DEBUG is not set
|
||||
CONFIG_ZYNQMP_PM_DOMAINS=y
|
||||
CONFIG_ZYNQMP_POWER=y
|
||||
@ -1,8 +1,6 @@
|
||||
ARCH:=aarch64
|
||||
SUBTARGET:=64
|
||||
BOARDNAME:=QEMU ARMv8 Virtual Machine (cortex-a53)
|
||||
CPU_TYPE:=cortex-a53
|
||||
KERNELNAME:=Image
|
||||
SUBTARGET:=armv8
|
||||
BOARDNAME:=64-bit (armv8) machines
|
||||
|
||||
define Target/Description
|
||||
Build multi-platform images for the ARMv8 instruction set architecture
|
||||
19
target/linux/armsr/base-files/etc/board.d/01_led
Normal file
19
target/linux/armsr/base-files/etc/board.d/01_led
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ten64)
|
||||
ucidef_set_led_netdev "sfp1" "SFP 1" "ten64:green:sfp1:down" "eth8" "link tx rx"
|
||||
ucidef_set_led_netdev "sfp2" "SFP 2" "ten64:green:sfp2:up" "eth9" "link tx rx"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
18
target/linux/armsr/base-files/etc/board.d/02_network
Normal file
18
target/linux/armsr/base-files/etc/board.d/02_network
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
. /lib/functions/system.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
traverse,ten64)
|
||||
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
|
||||
ucidef_set_interface_wan "eth6"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
23
target/linux/armsr/base-files/etc/board.d/03_gpio_switches
Normal file
23
target/linux/armsr/base-files/etc/board.d/03_gpio_switches
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ten64)
|
||||
ucidef_add_gpio_switch "lte_reset" "Cell Modem Reset" "376"
|
||||
ucidef_add_gpio_switch "lte_power" "Cell Modem Power" "377"
|
||||
ucidef_add_gpio_switch "lte_disable" "Cell Modem Airplane mode" "378"
|
||||
ucidef_add_gpio_switch "gnss_disable" "Cell Modem Disable GNSS receiver" "379"
|
||||
ucidef_add_gpio_switch "lower_sfp_txidsable" "Lower SFP+ TX Disable" "369"
|
||||
ucidef_add_gpio_switch "upper_sfp_txdisable" "Upper SFP+ TX Disable" "373"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@ -2,4 +2,8 @@
|
||||
::shutdown:/etc/init.d/rcS K shutdown
|
||||
ttyAMA0::askfirst:/usr/libexec/login.sh
|
||||
ttyS0::askfirst:/usr/libexec/login.sh
|
||||
tty0::askfirst:/usr/libexec/login.sh
|
||||
hvc0::askfirst:/usr/libexec/login.sh
|
||||
ttymxc0::askfirst:/usr/libexec/login.sh
|
||||
ttymxc1::askfirst:/usr/libexec/login.sh
|
||||
ttymxc2::askfirst:/usr/libexec/login.sh
|
||||
52
target/linux/armsr/base-files/lib/preinit/01_sysinfo_acpi
Normal file
52
target/linux/armsr/base-files/lib/preinit/01_sysinfo_acpi
Normal file
@ -0,0 +1,52 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
sanitize_name_arm64() {
|
||||
sed -e '
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
|
||||
s/[^a-z0-9_-]\+/-/g;
|
||||
s/^-//;
|
||||
s/-$//;
|
||||
' "$@"
|
||||
}
|
||||
|
||||
do_sysinfo_arm64() {
|
||||
local vendor product file
|
||||
|
||||
for file in sys_vendor board_vendor; do
|
||||
vendor="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
|
||||
case "$vendor" in
|
||||
empty | \
|
||||
System\ manufacturer | \
|
||||
To\ [bB]e\ [fF]illed\ [bB]y\ O\.E\.M\.)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
[ -n "$vendor" ] && break
|
||||
done
|
||||
|
||||
for file in product_name board_name; do
|
||||
product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
|
||||
case "$vendor:$product" in
|
||||
?*:empty | \
|
||||
?*:System\ Product\ Name | \
|
||||
?*:To\ [bB]e\ [fF]illed\ [bB]y\ O\.E\.M\.)
|
||||
continue
|
||||
;;
|
||||
?*:?*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -d "/sys/firmware/devicetree/base" ] && return
|
||||
|
||||
[ -n "$vendor" -a -n "$product" ] || return
|
||||
|
||||
mkdir -p /tmp/sysinfo
|
||||
|
||||
echo "$vendor $product" > /tmp/sysinfo/model
|
||||
|
||||
sanitize_name_arm64 /tmp/sysinfo/model > /tmp/sysinfo/board_name
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main do_sysinfo_arm64
|
||||
164
target/linux/armsr/base-files/lib/upgrade/platform.sh
Normal file
164
target/linux/armsr/base-files/lib/upgrade/platform.sh
Normal file
@ -0,0 +1,164 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
RAMFS_COPY_BIN="/usr/sbin/blkid"
|
||||
|
||||
platform_check_image() {
|
||||
local board=$(board_name)
|
||||
local diskdev partdev diff
|
||||
[ "$#" -gt 1 ] && return 1
|
||||
|
||||
v "Board is ${board}"
|
||||
|
||||
export_bootdevice && export_partdevice diskdev 0 || {
|
||||
v "platform_check_image: Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
|
||||
get_partitions "/dev/$diskdev" bootdisk
|
||||
|
||||
v "Extract boot sector from the image"
|
||||
get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b
|
||||
|
||||
get_partitions /tmp/image.bs image
|
||||
|
||||
#compare tables
|
||||
diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
|
||||
|
||||
rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image
|
||||
|
||||
if [ -n "$diff" ]; then
|
||||
v "Partition layout has changed. Full image will be written."
|
||||
ask_bool 0 "Abort" && exit 1
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
platform_copy_config() {
|
||||
local partdev parttype=ext4
|
||||
|
||||
if export_partdevice partdev 2; then
|
||||
mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt
|
||||
cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
|
||||
umount /mnt
|
||||
else
|
||||
v "ERROR: Unable to find partition to copy config data to"
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
}
|
||||
|
||||
# To avoid writing over any firmware
|
||||
# files (e.g ubootefi.var or firmware/X/ aka EBBR)
|
||||
# Copy efi/openwrt and efi/boot from the new image
|
||||
# to the existing ESP
|
||||
platform_do_upgrade_efi_system_partition() {
|
||||
local image_file=$1
|
||||
local target_partdev=$2
|
||||
local image_efisp_start=$3
|
||||
local image_efisp_size=$4
|
||||
|
||||
v "Updating ESP on ${target_partdev}"
|
||||
NEW_ESP_DIR="/mnt/new_esp_loop"
|
||||
CUR_ESP_DIR="/mnt/cur_esp"
|
||||
mkdir "${NEW_ESP_DIR}"
|
||||
mkdir "${CUR_ESP_DIR}"
|
||||
|
||||
get_image_dd "$image_file" of="/tmp/new_efi_sys_part.img" \
|
||||
skip="$image_efisp_start" count="$image_efisp_size"
|
||||
|
||||
mount -t vfat -o loop -o ro /tmp/new_efi_sys_part.img "${NEW_ESP_DIR}"
|
||||
if [ ! -d "${NEW_ESP_DIR}/efi/boot" ]; then
|
||||
v "ERROR: Image does not contain EFI boot files (/efi/boot)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
mount -t vfat "/dev/$partdev" "${CUR_ESP_DIR}"
|
||||
|
||||
for d in $(find "${NEW_ESP_DIR}/efi/" -mindepth 1 -maxdepth 1 -type d); do
|
||||
v "Copying ${d}"
|
||||
newdir_bname=$(basename "${d}")
|
||||
rm -rf "${CUR_ESP_DIR}/efi/${newdir_bname}"
|
||||
cp -r "${d}" "${CUR_ESP_DIR}/efi"
|
||||
done
|
||||
|
||||
umount "${NEW_ESP_DIR}"
|
||||
umount "${CUR_ESP_DIR}"
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
local board=$(board_name)
|
||||
local diskdev partdev diff
|
||||
|
||||
export_bootdevice && export_partdevice diskdev 0 || {
|
||||
v "platform_do_upgrade: Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
|
||||
sync
|
||||
|
||||
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
|
||||
get_partitions "/dev/$diskdev" bootdisk
|
||||
|
||||
v "Extract boot sector from the image"
|
||||
get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b
|
||||
|
||||
get_partitions /tmp/image.bs image
|
||||
|
||||
#compare tables
|
||||
diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
|
||||
else
|
||||
diff=1
|
||||
fi
|
||||
|
||||
# Only change the partition table if sysupgrade -p is set,
|
||||
# otherwise doing so could interfere with embedded "single storage"
|
||||
# (e.g SoC boot from SD card) setups, as well as other user
|
||||
# created storage (like uvol)
|
||||
if [ -n "$diff" ] && [ "${UPGRADE_OPT_SAVE_PARTITIONS}" = "0" ]; then
|
||||
# Need to remove partitions before dd, otherwise the partitions
|
||||
# that are added after will have minor numbers offset
|
||||
partx -d - "/dev/$diskdev"
|
||||
|
||||
get_image_dd "$1" of="/dev/$diskdev" bs=4096 conv=fsync
|
||||
|
||||
# Separate removal and addtion is necessary; otherwise, partition 1
|
||||
# will be missing if it overlaps with the old partition 2
|
||||
partx -a - "/dev/$diskdev"
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
#iterate over each partition from the image and write it to the boot disk
|
||||
while read part start size; do
|
||||
if export_partdevice partdev $part; then
|
||||
v "Writing image to /dev/$partdev..."
|
||||
if [ "$part" = "1" ]; then
|
||||
platform_do_upgrade_efi_system_partition \
|
||||
$1 $partdev $start $size || return 1
|
||||
else
|
||||
v "Normal partition, doing DD"
|
||||
get_image_dd "$1" of="/dev/$partdev" ibs=512 obs=1M skip="$start" \
|
||||
count="$size" conv=fsync
|
||||
fi
|
||||
else
|
||||
v "Unable to find partition $part device, skipped."
|
||||
fi
|
||||
done < /tmp/partmap.image
|
||||
|
||||
local parttype=ext4
|
||||
|
||||
if (blkid > /dev/null) && export_partdevice partdev 1; then
|
||||
part_magic_fat "/dev/$partdev" && parttype=vfat
|
||||
mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt
|
||||
if export_partdevice partdev 2; then
|
||||
THIS_PART_BLKID=$(blkid -o value -s PARTUUID "/dev/${partdev}")
|
||||
v "Setting rootfs PARTUUID=${THIS_PART_BLKID}"
|
||||
sed -i "s/\(PARTUUID=\)[a-f0-9-]\+/\1${THIS_PART_BLKID}/ig" \
|
||||
/mnt/efi/openwrt/grub.cfg
|
||||
fi
|
||||
umount /mnt
|
||||
fi
|
||||
# Provide time for the storage medium to flush before system reset
|
||||
# (despite the sync/umount it appears NVMe etc. do it in the background)
|
||||
sleep 5
|
||||
}
|
||||
316
target/linux/armsr/config-5.15
Normal file
316
target/linux/armsr/config-5.15
Normal file
@ -0,0 +1,316 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_9P_FS=y
|
||||
# CONFIG_9P_FS_POSIX_ACL is not set
|
||||
# CONFIG_9P_FS_SECURITY is not set
|
||||
CONFIG_ACPI=y
|
||||
CONFIG_ACPI_AC=y
|
||||
CONFIG_ACPI_APEI=y
|
||||
CONFIG_ACPI_APEI_EINJ=y
|
||||
# CONFIG_ACPI_APEI_ERST_DEBUG is not set
|
||||
CONFIG_ACPI_APEI_GHES=y
|
||||
CONFIG_ACPI_APEI_MEMORY_FAILURE=y
|
||||
CONFIG_ACPI_APEI_PCIEAER=y
|
||||
CONFIG_ACPI_BATTERY=y
|
||||
# CONFIG_ACPI_BGRT is not set
|
||||
CONFIG_ACPI_CCA_REQUIRED=y
|
||||
CONFIG_ACPI_CONTAINER=y
|
||||
CONFIG_ACPI_CPPC_CPUFREQ=y
|
||||
# CONFIG_ACPI_DEBUG is not set
|
||||
# CONFIG_ACPI_DEBUGGER is not set
|
||||
# CONFIG_ACPI_DOCK is not set
|
||||
# CONFIG_ACPI_EC_DEBUGFS is not set
|
||||
CONFIG_ACPI_FAN=y
|
||||
CONFIG_ACPI_GENERIC_GSI=y
|
||||
CONFIG_ACPI_GTDT=y
|
||||
CONFIG_ACPI_HOTPLUG_CPU=y
|
||||
CONFIG_ACPI_I2C_OPREGION=y
|
||||
CONFIG_ACPI_IORT=y
|
||||
CONFIG_ACPI_MCFG=y
|
||||
# CONFIG_ACPI_PCI_SLOT is not set
|
||||
CONFIG_ACPI_PPTT=y
|
||||
CONFIG_ACPI_PROCESSOR=y
|
||||
CONFIG_ACPI_PROCESSOR_IDLE=y
|
||||
CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y
|
||||
CONFIG_ACPI_SPCR_TABLE=y
|
||||
CONFIG_ACPI_THERMAL=y
|
||||
# CONFIG_ACPI_TINY_POWER_BUTTON is not set
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
# CONFIG_ARM64_ACPI_PARKING_PROTOCOL is not set
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_GIC_V3_ITS_PCI=y
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BALLOON_COMPACTION=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_NVME=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_MQ_VIRTIO=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_ACPI=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMI=y
|
||||
CONFIG_DMIID=y
|
||||
CONFIG_DMI_SYSFS=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EFI=y
|
||||
CONFIG_EFIVAR_FS=y
|
||||
CONFIG_EFI_ARMSTUB_DTB_LOADER=y
|
||||
# CONFIG_EFI_BOOTLOADER_CONTROL is not set
|
||||
# CONFIG_EFI_CAPSULE_LOADER is not set
|
||||
# CONFIG_EFI_CUSTOM_SSDT_OVERLAYS is not set
|
||||
# CONFIG_EFI_DISABLE_PCI_DMA is not set
|
||||
CONFIG_EFI_EARLYCON=y
|
||||
CONFIG_EFI_ESRT=y
|
||||
CONFIG_EFI_GENERIC_STUB=y
|
||||
# CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER is not set
|
||||
CONFIG_EFI_PARAMS_FROM_FDT=y
|
||||
CONFIG_EFI_RUNTIME_WRAPPERS=y
|
||||
CONFIG_EFI_STUB=y
|
||||
# CONFIG_EFI_TEST is not set
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FAILOVER=y
|
||||
CONFIG_FB_EFI=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_FONT_AUTOSELECT=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_ACPI=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_HISI is not set
|
||||
CONFIG_GPIO_PL061=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HID=y
|
||||
CONFIG_HID_GENERIC=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HOTPLUG_PCI_ACPI=y
|
||||
CONFIG_HVC_DRIVER=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
# CONFIG_I2C_AMD_MP2 is not set
|
||||
CONFIG_I2C_HID_ACPI=y
|
||||
# CONFIG_I2C_HISI is not set
|
||||
# CONFIG_I2C_SLAVE_TESTUNIT is not set
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_INPUT_KEYBOARD=y
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
# CONFIG_ISCSI_IBFT is not set
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_BALLOON=y
|
||||
CONFIG_MIGRATION=y
|
||||
# CONFIG_MLXBF_GIGE is not set
|
||||
CONFIG_MMC_SDHCI_ACPI=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_MVMDIO=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_9P=y
|
||||
# CONFIG_NET_9P_DEBUG is not set
|
||||
CONFIG_NET_9P_VIRTIO=y
|
||||
CONFIG_NET_FAILOVER=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NR_CPUS=256
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVME_CORE=y
|
||||
# CONFIG_NVME_MULTIPATH is not set
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_REPORTING=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
# CONFIG_PCIE_HISI_ERR is not set
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_ECAM=y
|
||||
CONFIG_PCI_HOST_COMMON=y
|
||||
CONFIG_PCI_HOST_GENERIC=y
|
||||
CONFIG_PCI_LABEL=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
# CONFIG_PMIC_OPREGION is not set
|
||||
CONFIG_PNP=y
|
||||
CONFIG_PNPACPI=y
|
||||
CONFIG_PNP_DEBUG_MESSAGES=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RESET_ATTACK_MITIGATION is not set
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_EFI=y
|
||||
CONFIG_RTC_DRV_PL031=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
CONFIG_SCSI_VIRTIO=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_PNP=y
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_SURFACE_PLATFORMS is not set
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_SYSFB=y
|
||||
# CONFIG_SYSFB_SIMPLEFB is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_ACPI=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UACCE is not set
|
||||
CONFIG_UCS2_STRING=y
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_HID=y
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB_PCI=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_XHCI_PCI=y
|
||||
CONFIG_VIRTIO=y
|
||||
CONFIG_VIRTIO_BALLOON=y
|
||||
CONFIG_VIRTIO_BLK=y
|
||||
CONFIG_VIRTIO_CONSOLE=y
|
||||
CONFIG_VIRTIO_MMIO=y
|
||||
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
|
||||
CONFIG_VIRTIO_NET=y
|
||||
CONFIG_VIRTIO_PCI=y
|
||||
CONFIG_VIRTIO_PCI_LEGACY=y
|
||||
CONFIG_VIRTIO_PCI_LIB=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
# CONFIG_VT_HW_CONSOLE_BINDING is not set
|
||||
CONFIG_WDAT_WDT=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_ZONE_DMA32=y
|
||||
122
target/linux/armsr/image/Makefile
Normal file
122
target/linux/armsr/image/Makefile
Normal file
@ -0,0 +1,122 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2016-2017 Yousong Zhou <yszhou4tech@gmail.com>
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
GRUB2_VARIANT =
|
||||
GRUB_TERMINALS =
|
||||
GRUB_SERIAL_CONFIG =
|
||||
GRUB_TERMINAL_CONFIG =
|
||||
GRUB_CONSOLE_CMDLINE = earlycon
|
||||
|
||||
ifneq ($(CONFIG_GRUB_CONSOLE),)
|
||||
GRUB_TERMINALS += console
|
||||
endif
|
||||
|
||||
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
||||
|
||||
ifneq ($(GRUB_SERIAL),)
|
||||
GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off)
|
||||
GRUB_TERMINALS += serial
|
||||
endif
|
||||
|
||||
ifneq ($(GRUB_TERMINALS),)
|
||||
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
||||
endif
|
||||
|
||||
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
||||
ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02)
|
||||
GPT_ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
||||
GPT_ROOTPART:=$(if $(GPT_ROOTPART),$(GPT_ROOTPART),PARTUUID=$(shell echo $(IMG_PART_DISKGUID) | sed 's/00$$/02/'))
|
||||
|
||||
GRUB_TIMEOUT:=$(call qstrip,$(CONFIG_GRUB_TIMEOUT))
|
||||
GRUB_TITLE:=$(call qstrip,$(CONFIG_GRUB_TITLE))
|
||||
|
||||
BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS))
|
||||
|
||||
define Build/combined
|
||||
$(INSTALL_DIR) $@.boot/
|
||||
$(CP) $(KDIR)/$(KERNEL_NAME) $@.boot/efi/openwrt/
|
||||
-$(CP) $(STAGING_DIR_ROOT)/boot/. $@.boot/boot/
|
||||
$(if $(filter $(1),efi),
|
||||
$(INSTALL_DIR) $@.boot/efi/boot
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_aarch64),aa64,arm).efi $@.boot/efi/openwrt/
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_aarch64),aa64,arm).efi $@.boot/efi/boot/
|
||||
)
|
||||
KERNELPARTTYPE=ef FAT_TYPE="32" PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" \
|
||||
$(if $(filter $(1),efi),GUID="$(IMG_PART_DISKGUID)") $(SCRIPT_DIR)/gen_image_generic.sh \
|
||||
$@ \
|
||||
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
|
||||
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
|
||||
256
|
||||
endef
|
||||
|
||||
define Build/grub-config
|
||||
rm -fR $@.boot
|
||||
$(INSTALL_DIR) $@.boot/efi/openwrt/
|
||||
sed \
|
||||
-e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \
|
||||
-e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
|
||||
-e 's#@ROOTPART@#root=$(ROOTPART) rootwait#g' \
|
||||
-e 's#@GPT_ROOTPART@#root=$(GPT_ROOTPART) rootwait#g' \
|
||||
-e 's#@CMDLINE@#$(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE)#g' \
|
||||
-e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
|
||||
-e 's#@TITLE@#$(GRUB_TITLE)#g' \
|
||||
-e 's#@KERNEL_NAME@#$(KERNEL_NAME)#g' \
|
||||
./grub-$(1).cfg > $@.boot/efi/openwrt/grub.cfg
|
||||
endef
|
||||
|
||||
define Build/grub-install
|
||||
rm -fR $@.grub2
|
||||
$(INSTALL_DIR) $@.grub2
|
||||
endef
|
||||
|
||||
DEVICE_VARS += GRUB2_VARIANT UBOOT
|
||||
define Device/efi-default
|
||||
IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
|
||||
IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
|
||||
IMAGE/combined.img := grub-config efi | combined efi | grub-install efi | append-metadata
|
||||
IMAGE/combined.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
|
||||
IMAGE/combined.qcow2 := grub-config efi | combined efi | grub-install efi | qemu-image qcow2
|
||||
IMAGE/combined.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
|
||||
ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
|
||||
IMAGES-y := rootfs.img.gz
|
||||
IMAGES-y += combined.img.gz
|
||||
else
|
||||
IMAGES-y := rootfs.img
|
||||
IMAGES-y += combined.img
|
||||
endif
|
||||
ifeq ($(CONFIG_QCOW2_IMAGES),y)
|
||||
IMAGES-y += combined.qcow2
|
||||
endif
|
||||
ifeq ($(CONFIG_VMDK_IMAGES),y)
|
||||
IMAGES-y += combined.vmdk
|
||||
endif
|
||||
KERNEL := kernel-bin
|
||||
KERNEL_INSTALL := 1
|
||||
IMAGES := $$(IMAGES-y)
|
||||
ARTIFACTS := $$(ARTIFACTS-y)
|
||||
SUPPORTED_DEVICES :=
|
||||
ifeq ($(CONFIG_arm),y)
|
||||
KERNEL_NAME = zImage
|
||||
endif
|
||||
endef
|
||||
|
||||
define Device/generic
|
||||
$(call Device/efi-default)
|
||||
DEVICE_TITLE := Generic EFI Boot
|
||||
GRUB2_VARIANT := generic
|
||||
FILESYSTEMS := ext4 squashfs
|
||||
UBOOT := $(if $(CONFIG_aarch64),qemu_armv8,qemu_armv7)
|
||||
DEVICE_PACKAGES += kmod-amazon-ena kmod-e1000e kmod-vmxnet3 kmod-rtc-rx8025 \
|
||||
kmod-i2c-mux-pca954x kmod-gpio-pca953x partx-utils kmod-wdt-sp805 \
|
||||
kmod-mvneta kmod-mvpp2 kmod-fsl-dpaa1-net kmod-fsl-dpaa2-net \
|
||||
kmod-fsl-enetc-net kmod-dwmac-imx kmod-fsl-fec kmod-thunderx-net \
|
||||
kmod-dwmac-rockchip kmod-dwmac-sun8i kmod-phy-aquantia kmod-phy-broadcom \
|
||||
kmod-phy-marvell kmod-phy-marvell-10g kmod-sfp kmod-atlantic
|
||||
endef
|
||||
TARGET_DEVICES += generic
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
14
target/linux/armsr/image/grub-efi.cfg
Normal file
14
target/linux/armsr/image/grub-efi.cfg
Normal file
@ -0,0 +1,14 @@
|
||||
@SERIAL_CONFIG@
|
||||
@TERMINAL_CONFIG@
|
||||
|
||||
set default="0"
|
||||
set timeout="@TIMEOUT@"
|
||||
|
||||
menuentry "@TITLE@" {
|
||||
search --set=root --label kernel
|
||||
linux /efi/openwrt/@KERNEL_NAME@ @GPT_ROOTPART@ @CMDLINE@ noinitrd
|
||||
}
|
||||
menuentry "@TITLE@ (failsafe)" {
|
||||
search --set=root --label kernel
|
||||
linux /efi/openwrt/@KERNEL_NAME@ failsafe=true @GPT_ROOTPART@ @CMDLINE@ noinitrd
|
||||
}
|
||||
291
target/linux/armsr/modules.mk
Normal file
291
target/linux/armsr/modules.mk
Normal file
@ -0,0 +1,291 @@
|
||||
define KernelPackage/acpi-mdio
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=ACPI MDIO support
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy +kmod-mdio-devres
|
||||
KCONFIG:=CONFIG_ACPI_MDIO
|
||||
FILES:=$(LINUX_DIR)/drivers/net/mdio/acpi_mdio.ko
|
||||
AUTOLOAD:=$(call AutoLoad,11,acpi_mdio)
|
||||
endef
|
||||
|
||||
define KernelPackage/acpi-mdio/description
|
||||
Kernel driver for ACPI MDIO support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,acpi-mdio))
|
||||
|
||||
define KernelPackage/fsl-pcs-lynx
|
||||
SUBMENU=$(NETWORK_DEVICES_MENU)
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy +kmod-of-mdio +kmod-phylink
|
||||
TITLE:=NXP (Freescale) Lynx PCS
|
||||
HIDDEN:=1
|
||||
KCONFIG:=CONFIG_PCS_LYNX
|
||||
FILES=$(LINUX_DIR)/drivers/net/pcs/pcs-lynx.ko
|
||||
AUTOLOAD=$(call AutoLoad,30,pcs-lynx)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-pcs-lynx))
|
||||
|
||||
define KernelPackage/pcs-xpcs
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Synopsis DesignWare PCS driver
|
||||
DEPENDS:=@(TARGET_armsr_armv8)
|
||||
KCONFIG:=CONFIG_PCS_XPCS
|
||||
FILES:=$(LINUX_DIR)/drivers/net/pcs/pcs_xpcs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,20,pcs_xpcs)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,pcs-xpcs))
|
||||
|
||||
define KernelPackage/fsl-fec
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy +kmod-of-mdio \
|
||||
+kmod-ptp +kmod-net-selftests
|
||||
TITLE:=NXP (Freescale) FEC Ethernet controller (i.MX)
|
||||
KCONFIG:=CONFIG_FEC
|
||||
FILES:=$(LINUX_DIR)/drivers/net/ethernet/freescale/fec.ko
|
||||
AUTOLOAD:=$(call AutoLoad,35,fec)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-fec))
|
||||
|
||||
define KernelPackage/fsl-xgmac-mdio
|
||||
SUBMENU=$(NETWORK_DEVICES_MENU)
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy +kmod-of-mdio +kmod-acpi-mdio
|
||||
TITLE:=NXP (Freescale) MDIO bus
|
||||
KCONFIG:=CONFIG_FSL_XGMAC_MDIO
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/freescale/xgmac_mdio.ko
|
||||
AUTOLOAD=$(call AutoLoad,30,xgmac_mdio)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-xgmac-mdio))
|
||||
|
||||
define KernelPackage/fsl-mc-dpio
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=NXP DPAA2 DPIO (Data Path IO) driver
|
||||
HIDDEN:=1
|
||||
KCONFIG:=CONFIG_FSL_MC_BUS=y \
|
||||
CONFIG_FSL_MC_DPIO
|
||||
FILES:=$(LINUX_DIR)/drivers/soc/fsl/dpio/fsl-mc-dpio.ko
|
||||
AUTOLOAD=$(call AutoLoad,30,fsl-mc-dpio)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-mc-dpio))
|
||||
|
||||
define KernelPackage/fsl-enetc-net
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=:NXP ENETC (LS1028A) Ethernet
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-phylink +kmod-fsl-pcs-lynx
|
||||
KCONFIG:= \
|
||||
CONFIG_FSL_ENETC \
|
||||
CONFIG_FSL_ENETC_VF \
|
||||
CONFIG_FSL_ENETC_QOS
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/enetc/fsl-enetc.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/enetc/fsl-enetc-vf.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/enetc/fsl-enetc-mdio.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/enetc/fsl-enetc-ierb.ko
|
||||
AUTOLOAD=$(call AutoLoad,35,fsl-enetc)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-enetc-net))
|
||||
|
||||
define KernelPackage/fsl-dpaa1-net
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=NXP DPAA1 (LS1043/LS1046) Ethernet
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-fsl-xgmac-mdio +kmod-libphy +kmod-crypto-crc32
|
||||
KCONFIG:= \
|
||||
CONFIG_FSL_DPAA=y \
|
||||
CONFIG_FSL_DPAA_ETH \
|
||||
CONFIG_FSL_FMAN \
|
||||
CONFIG_FSL_DPAA_CHECKING=n \
|
||||
CONFIG_FSL_BMAN_TEST=n \
|
||||
CONFIG_FSL_QMAN_TEST=n
|
||||
MODULES:= \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/dpaa/fsl_dpa.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/fman/fsl_dpaa_fman.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/fman/fsl_dpaa_mac.ko
|
||||
AUTOLOAD=$(call AutoLoad,35,fsl-dpa)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-dpaa1-net))
|
||||
|
||||
define KernelPackage/fsl-dpaa2-net
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=NXP DPAA2 Ethernet
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-fsl-xgmac-mdio +kmod-phylink \
|
||||
+kmod-fsl-pcs-lynx +kmod-fsl-mc-dpio
|
||||
KCONFIG:= \
|
||||
CONFIG_FSL_MC_UAPI_SUPPORT=y \
|
||||
CONFIG_FSL_DPAA2_ETH
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko
|
||||
AUTOLOAD=$(call AutoLoad,35,fsl-dpaa2-eth)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-dpaa2-net))
|
||||
|
||||
define KernelPackage/fsl-dpaa2-console
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=NXP DPAA2 Debug console
|
||||
DEPENDS:=@(TARGET_armsr_armv8)
|
||||
KCONFIG:=CONFIG_DPAA2_CONSOLE
|
||||
FILES=$(LINUX_DIR)/drivers/soc/fsl/dpaa2-console.ko
|
||||
AUTOLOAD=$(call AutoLoad,40,dpaa2-console)
|
||||
endef
|
||||
|
||||
define KernelPackage/fsl-dpaa2-console/description
|
||||
Kernel modules for the NXP DPAA2 debug consoles
|
||||
(Management Complex and AIOP).
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fsl-dpaa2-console))
|
||||
|
||||
define KernelPackage/marvell-mdio
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Marvell Armada platform MDIO driver
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy +kmod-of-mdio +kmod-acpi-mdio
|
||||
KCONFIG:=CONFIG_MVMDIO
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/marvell/mvmdio.ko
|
||||
AUTOLOAD=$(call AutoLoad,30,marvell-mdio)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,marvell-mdio))
|
||||
|
||||
define KernelPackage/phy-marvell-10g
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Marvell Alaska 10G PHY driver
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy
|
||||
KCONFIG:=CONFIG_MARVELL_10G_PHY
|
||||
FILES=$(LINUX_DIR)/drivers/net/phy/marvell10g.ko
|
||||
AUTOLOAD=$(call AutoLoad,35,marvell10g)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,phy-marvell-10g))
|
||||
|
||||
define KernelPackage/mvneta
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Marvell Armada 370/38x/XP/37xx network driver
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-marvell-mdio +kmod-phylink
|
||||
KCONFIG:=CONFIG_MVNETA
|
||||
FILES:=$(LINUX_DIR)/drivers/net/ethernet/marvell/mvneta.ko
|
||||
AUTOLOAD=$(call AutoLoad,40,mvneta)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mvneta))
|
||||
|
||||
define KernelPackage/mvpp2
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Marvell Armada 375/7K/8K network driver
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-marvell-mdio +kmod-phylink
|
||||
KCONFIG:=CONFIG_MVPP2 \
|
||||
CONFIG_MVPP2_PTP=n
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/marvell/mvpp2/mvpp2.ko
|
||||
AUTOLOAD=$(call AutoLoad,40,mvpp2)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mvpp2))
|
||||
|
||||
define KernelPackage/imx2-wdt
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=NXP (Freescale) i.MX2+ and Layerscape watchdog driver
|
||||
KCONFIG:=CONFIG_IMX2_WDT
|
||||
FILES=$(LINUX_DIR)/drivers/watchdog/imx2_wdt.ko
|
||||
AUTOLOAD=$(call AutoLoad,60,imx2_wdt)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,imx2-wdt))
|
||||
|
||||
define KernelPackage/imx7-ulp-wdt
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=NXP (Freescale) i.MX7ULP and later watchdog
|
||||
KCONFIG:=CONFIG_IMX7ULP_WDT
|
||||
FILES=$(LINUX_DIR)/drivers/watchdog/imx7ulp_wdt.ko
|
||||
AUTOLOAD=$(call AutoLoad,60,imx7ulp_wdt)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,imx7-ulp-wdt))
|
||||
|
||||
define KernelPackage/stmmac-core
|
||||
SUBMENU=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others)
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-phylink +kmod-pcs-xpcs +kmod-ptp
|
||||
KCONFIG:=CONFIG_STMMAC_ETH \
|
||||
CONFIG_STMMAC_SELFTESTS=n \
|
||||
CONFIG_STMMAC_PLATFORM \
|
||||
CONFIG_CONFIG_DWMAC_DWC_QOS_ETH=n \
|
||||
CONFIG_DWMAC_GENERIC
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko
|
||||
AUTOLOAD=$(call AutoLoad,40,stmmac stmmac-platform dwmac-generic)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,stmmac-core))
|
||||
|
||||
define KernelPackage/dwmac-imx
|
||||
SUBMENU=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=NXP i.MX8 Ethernet controller
|
||||
DEPENDS:=+kmod-stmmac-core
|
||||
KCONFIG:=CONFIG_DWMAC_IMX8
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.ko
|
||||
AUTOLOAD=$(call AutoLoad,45,dwmac-imx)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,dwmac-imx))
|
||||
|
||||
define KernelPackage/dwmac-sun8i
|
||||
SUBMENU=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Allwinner H3/A83T/A64 (sun8i) Ethernet
|
||||
DEPENDS:=+kmod-stmmac-core +kmod-mdio-bus-mux
|
||||
KCONFIG:=CONFIG_DWMAC_SUN8I
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.ko
|
||||
AUTOLOAD=$(call AutoLoad,45,dwmac-sun8i)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,dwmac-sun8i))
|
||||
|
||||
define KernelPackage/dwmac-rockchip
|
||||
SUBMENU=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Rockchip RK3328/RK3399/RK3568 Ethernet
|
||||
DEPENDS:=+kmod-stmmac-core +kmod-mdio-bus-mux
|
||||
KCONFIG:=CONFIG_DWMAC_ROCKCHIP
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko
|
||||
AUTOLOAD=$(call AutoLoad,45,dwmac-rk)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,dwmac-rockchip))
|
||||
|
||||
define KernelPackage/thunderx-net
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Marvell (Cavium) ThunderX/2 network drivers
|
||||
DEPENDS:=@(TARGET_armsr_armv8) +kmod-phylink
|
||||
KCONFIG:=CONFIG_NET_VENDOR_CAVIUM \
|
||||
CONFIG_THUNDER_NIC_PF \
|
||||
CONFIG_THUNDER_NIC_VF \
|
||||
CONFIG_THUNDER_NIC_BGX \
|
||||
CONFIG_THUNDER_NIC_RGX
|
||||
FILES=$(LINUX_DIR)/drivers/net/ethernet/cavium/thunder/nicvf.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/cavium/thunder/nicpf.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/cavium/thunder/thunder_xcv.ko \
|
||||
$(LINUX_DIR)/drivers/net/ethernet/cavium/thunder/thunder_bgx.ko
|
||||
AUTOLOAD=$(call AutoLoad,40,nicpf nicvf thunder_xcv thunder_bgx)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,thunderx-net))
|
||||
|
||||
define KernelPackage/wdt-sp805
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=ARM SP805 Watchdog
|
||||
KCONFIG:=CONFIG_ARM_SP805_WATCHDOG
|
||||
FILES=$(LINUX_DIR)/drivers/watchdog/sp805_wdt.ko
|
||||
AUTOLOAD=$(call AutoLoad,50,sp805_wdt)
|
||||
endef
|
||||
|
||||
define KernelPackage/wdt-sp805/description
|
||||
Support for the ARM SP805 wathchdog module.
|
||||
This is present in the NXP Layerscape family,
|
||||
HiSilicon HI3660 among others.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,wdt-sp805))
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
From b77c0ecdc7915e5c5c515da1aa6cfaf6f4eb8351 Mon Sep 17 00:00:00 2001
|
||||
From: Mathew McBride <matt@traverse.com.au>
|
||||
Date: Wed, 28 Sep 2022 16:39:31 +1000
|
||||
Subject: [PATCH] arm: disable code size reduction measures
|
||||
(gc-sections,-f*-sections)
|
||||
|
||||
This interferes with the EFI boot stub on armv7l.
|
||||
|
||||
Signed-off-by: Mathew McBride <matt@traverse.com.au>
|
||||
---
|
||||
arch/arm/Kconfig | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/arch/arm/Kconfig
|
||||
+++ b/arch/arm/Kconfig
|
||||
@@ -117,7 +117,6 @@ config ARM
|
||||
select HAVE_UID16
|
||||
select HAVE_VIRT_CPU_ACCOUNTING_GEN
|
||||
select IRQ_FORCED_THREADING
|
||||
- select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
|
||||
select MODULES_USE_ELF_REL
|
||||
select NEED_DMA_MAP_STATE
|
||||
select OF_EARLY_FLATTREE if OF
|
||||
@ -0,0 +1,74 @@
|
||||
From d5af37ae22f0364be9ded773d737dd6e5b207b10 Mon Sep 17 00:00:00 2001
|
||||
From: Ioana Ciornei <ioana.ciornei@nxp.com>
|
||||
Date: Thu, 21 Nov 2019 21:15:25 +0200
|
||||
Subject: [PATCH 3/4] dpaa2-eth: do not hold rtnl_lock on phylink_create() or
|
||||
_destroy()
|
||||
|
||||
The rtnl_lock should not be held when calling phylink_create() or
|
||||
phylink_destroy() since it leads to the deadlock listed below:
|
||||
|
||||
[ 18.656576] rtnl_lock+0x18/0x20
|
||||
[ 18.659798] sfp_bus_add_upstream+0x28/0x90
|
||||
[ 18.663974] phylink_create+0x2cc/0x828
|
||||
[ 18.667803] dpaa2_mac_connect+0x14c/0x2a8
|
||||
[ 18.671890] dpaa2_eth_connect_mac+0x94/0xd8
|
||||
|
||||
Fix this by moving the _lock() and _unlock() calls just outside of
|
||||
phylink_of_phy_connect() and phylink_disconnect_phy().
|
||||
|
||||
Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink")
|
||||
Reported-by: Russell King <linux@armlinux.org.uk>
|
||||
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
---
|
||||
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ----
|
||||
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 4 ++++
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
|
||||
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
|
||||
@@ -4217,12 +4217,10 @@ static irqreturn_t dpni_irq0_handler_thr
|
||||
dpaa2_eth_set_mac_addr(netdev_priv(net_dev));
|
||||
dpaa2_eth_update_tx_fqids(priv);
|
||||
|
||||
- rtnl_lock();
|
||||
if (dpaa2_eth_has_mac(priv))
|
||||
dpaa2_eth_disconnect_mac(priv);
|
||||
else
|
||||
dpaa2_eth_connect_mac(priv);
|
||||
- rtnl_unlock();
|
||||
}
|
||||
|
||||
return IRQ_HANDLED;
|
||||
@@ -4516,9 +4514,7 @@ static int dpaa2_eth_remove(struct fsl_m
|
||||
#endif
|
||||
|
||||
unregister_netdev(net_dev);
|
||||
- rtnl_lock();
|
||||
dpaa2_eth_disconnect_mac(priv);
|
||||
- rtnl_unlock();
|
||||
|
||||
dpaa2_eth_dl_port_del(priv);
|
||||
dpaa2_eth_dl_traps_unregister(priv);
|
||||
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
|
||||
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
|
||||
@@ -351,7 +351,9 @@ int dpaa2_mac_connect(struct dpaa2_mac *
|
||||
if (mac->pcs)
|
||||
phylink_set_pcs(mac->phylink, &mac->pcs->pcs);
|
||||
|
||||
+ rtnl_lock();
|
||||
err = phylink_fwnode_phy_connect(mac->phylink, dpmac_node, 0);
|
||||
+ rtnl_unlock();
|
||||
if (err) {
|
||||
netdev_err(net_dev, "phylink_fwnode_phy_connect() = %d\n", err);
|
||||
goto err_phylink_destroy;
|
||||
@@ -372,7 +374,9 @@ void dpaa2_mac_disconnect(struct dpaa2_m
|
||||
if (!mac->phylink)
|
||||
return;
|
||||
|
||||
+ rtnl_lock();
|
||||
phylink_disconnect_phy(mac->phylink);
|
||||
+ rtnl_unlock();
|
||||
phylink_destroy(mac->phylink);
|
||||
dpaa2_pcs_destroy(mac);
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
From c314138bd045e050432158ab021160de3ba51c5e Mon Sep 17 00:00:00 2001
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Date: Thu, 30 Jan 2020 22:42:38 +0000
|
||||
Subject: [PATCH 2/4] net: dpaa2-mac: add support for more 10G modes
|
||||
|
||||
Phylink documentation says:
|
||||
* Note that the PHY may be able to transform from one connection
|
||||
* technology to another, so, eg, don't clear 1000BaseX just
|
||||
* because the MAC is unable to BaseX mode. This is more about
|
||||
* clearing unsupported speeds and duplex settings. The port modes
|
||||
* should not be cleared; phylink_set_port_modes() will help with this.
|
||||
|
||||
So add the missing 10G modes.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
---
|
||||
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
|
||||
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
|
||||
@@ -140,6 +140,12 @@ static void dpaa2_mac_validate(struct ph
|
||||
case PHY_INTERFACE_MODE_10GBASER:
|
||||
case PHY_INTERFACE_MODE_USXGMII:
|
||||
phylink_set(mask, 10000baseT_Full);
|
||||
+ phylink_set(mask, 10000baseKR_Full);
|
||||
+ phylink_set(mask, 10000baseCR_Full);
|
||||
+ phylink_set(mask, 10000baseSR_Full);
|
||||
+ phylink_set(mask, 10000baseLR_Full);
|
||||
+ phylink_set(mask, 10000baseLRM_Full);
|
||||
+ phylink_set(mask, 10000baseER_Full);
|
||||
if (state->interface == PHY_INTERFACE_MODE_10GBASER)
|
||||
break;
|
||||
phylink_set(mask, 5000baseT_Full);
|
||||
@ -1,154 +0,0 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_VEXPRESS=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
CONFIG_ARM64_ERRATUM_827319=y
|
||||
CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
|
||||
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
|
||||
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y
|
||||
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
|
||||
CONFIG_ARM_SBSA_WATCHDOG=y
|
||||
CONFIG_ATOMIC64_SELFTEST=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BACKLIGHT_CLASS_DEVICE=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_CAVIUM_TX2_ERRATUM_219=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLK_SP810=y
|
||||
CONFIG_CLK_VEXPRESS_OSC=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CHACHA20=y
|
||||
CONFIG_CRYPTO_CHACHA20_NEON=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
CONFIG_CRYPTO_GHASH_ARM64_CE=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y
|
||||
CONFIG_CRYPTO_SHA1=y
|
||||
CONFIG_CRYPTO_SHA1_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA2_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DRM=y
|
||||
CONFIG_DRM_BOCHS=y
|
||||
CONFIG_DRM_BRIDGE=y
|
||||
CONFIG_DRM_GEM_SHMEM_HELPER=y
|
||||
CONFIG_DRM_KMS_HELPER=y
|
||||
CONFIG_DRM_PANEL=y
|
||||
CONFIG_DRM_PANEL_BRIDGE=y
|
||||
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
|
||||
CONFIG_DRM_QXL=y
|
||||
CONFIG_DRM_TTM=y
|
||||
CONFIG_DRM_TTM_HELPER=y
|
||||
CONFIG_DRM_VIRTIO_GPU=y
|
||||
CONFIG_DRM_VRAM_HELPER=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_ARMCLCD=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
CONFIG_FB_MODE_HELPERS=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
CONFIG_FUJITSU_ERRATUM_010001=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_HDMI=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_ARM_SMCCC_TRNG=y
|
||||
CONFIG_HW_RANDOM_VIRTIO=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_ALGOBIT=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_KCMP=y
|
||||
CONFIG_LCD_CLASS_DEVICE=m
|
||||
# CONFIG_LCD_PLATFORM is not set
|
||||
CONFIG_MFD_CORE=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MFD_VEXPRESS_SYSREG=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_ARMMMCI=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=64
|
||||
CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_VEXPRESS=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
CONFIG_RTC_I2C_AND_SPI=y
|
||||
CONFIG_SMC91X=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SYNC_FILE=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_VEXPRESS_CONFIG=y
|
||||
CONFIG_VIDEOMODE_HELPERS=y
|
||||
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_ZONE_DMA32=y
|
||||
@ -1,40 +0,0 @@
|
||||
This is intended to be used with OpenWrt project to provide image for use with
|
||||
QEMU ARM virt machine.
|
||||
|
||||
Run with qemu-system-arm
|
||||
|
||||
# boot with initramfs embedded in
|
||||
qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage-initramfs
|
||||
|
||||
# boot with accel=kvm
|
||||
qemu-system-arm -nographic -M virt,accel=kvm -cpu host -m 64 -kernel
|
||||
openwrt-armvirt-32-zImage-initramfs
|
||||
|
||||
# boot with a separate rootfs
|
||||
qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage \
|
||||
-drive file=openwrt-armvirt-32-root.ext4,format=raw,if=virtio -append 'root=/dev/vda rootwait'
|
||||
|
||||
# boot with local dir as rootfs
|
||||
qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage \
|
||||
-fsdev local,id=rootdev,path=root-armvirt/,security_model=none \
|
||||
-device virtio-9p-pci,fsdev=rootdev,mount_tag=/dev/root \
|
||||
-append 'rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p'
|
||||
|
||||
Run with kvmtool
|
||||
|
||||
# start a named machine
|
||||
lkvm run -k openwrt-armvirt-32-zImage -i openwrt-armvirt-32-rootfs.cpio --name armvirt0
|
||||
|
||||
# start with virtio-9p rootfs
|
||||
lkvm run -k openwrt-armvirt-32-zImage -d root-armvirt/
|
||||
|
||||
# stop "armvirt0"
|
||||
lkvm stop --name armvirt0
|
||||
|
||||
# stop all
|
||||
lkvm stop --all
|
||||
|
||||
The multi-platform ARMv8 target can be used with QEMU:
|
||||
|
||||
qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \
|
||||
-kernel openwrt-armvirt-64-Image-initramfs \
|
||||
@ -1,13 +0,0 @@
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
ucidef_set_board_id "armvirt"
|
||||
ucidef_set_model_name "QEMU ARM Virtual Machine"
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@ -1,155 +0,0 @@
|
||||
CONFIG_9P_FS=y
|
||||
# CONFIG_9P_FS_POSIX_ACL is not set
|
||||
# CONFIG_9P_FS_SECURITY is not set
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_GIC_V3_ITS_PCI=y
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_BALLOON_COMPACTION=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_MQ_VIRTIO=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FAILOVER=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_PL061=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HVC_DRIVER=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_BALLOON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NET_9P=y
|
||||
# CONFIG_NET_9P_DEBUG is not set
|
||||
CONFIG_NET_9P_VIRTIO=y
|
||||
CONFIG_NET_FAILOVER=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_REPORTING=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_ECAM=y
|
||||
CONFIG_PCI_HOST_COMMON=y
|
||||
CONFIG_PCI_HOST_GENERIC=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_PL031=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
CONFIG_SCSI_VIRTIO=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_VIRTIO=y
|
||||
CONFIG_VIRTIO_BALLOON=y
|
||||
CONFIG_VIRTIO_BLK=y
|
||||
CONFIG_VIRTIO_CONSOLE=y
|
||||
CONFIG_VIRTIO_MMIO=y
|
||||
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
|
||||
CONFIG_VIRTIO_NET=y
|
||||
CONFIG_VIRTIO_PCI=y
|
||||
CONFIG_VIRTIO_PCI_LEGACY=y
|
||||
CONFIG_VIRTIO_PCI_LIB=y
|
||||
CONFIG_XPS=y
|
||||
@ -1,32 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2016-2017 Yousong Zhou <yszhou4tech@gmail.com>
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
define Image/BuildKernel
|
||||
$(foreach k,$(filter zImage Image,$(KERNELNAME)), \
|
||||
cp $(KDIR)/$(KERNELNAME) $(BIN_DIR)/$(IMG_PREFIX)-$(k) \
|
||||
)
|
||||
endef
|
||||
|
||||
define Image/Build/Initramfs
|
||||
$(foreach k,$(filter zImage Image,$(KERNELNAME)), \
|
||||
cp $(KDIR)/$(k)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(k)-initramfs \
|
||||
)
|
||||
endef
|
||||
|
||||
define Image/Build/gzip
|
||||
gzip -f9n $(BIN_DIR)/$(IMG_ROOTFS)-$(1).img
|
||||
endef
|
||||
|
||||
$(eval $(call Image/gzip-ext4-padded-squashfs))
|
||||
|
||||
define Image/Build
|
||||
$(call Image/Build/$(1))
|
||||
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_ROOTFS)-$(1).img
|
||||
$(call Image/Build/gzip/$(1))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
@ -5,6 +5,7 @@
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
comtrend,ar-5381u |\
|
||||
comtrend,ar-5387un)
|
||||
ucidef_set_bridge_device switch
|
||||
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
case "$(board_name)" in
|
||||
comtrend,ar-5381u |\
|
||||
comtrend,ar-5387un)
|
||||
mtd fixtrx firmware
|
||||
;;
|
||||
|
||||
190
target/linux/bmips/dts/bcm6328-comtrend-ar-5381u.dts
Normal file
190
target/linux/bmips/dts/bcm6328-comtrend-ar-5381u.dts
Normal file
@ -0,0 +1,190 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "bcm6328.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Comtrend AR-5381u";
|
||||
compatible = "comtrend,ar-5381u", "brcm,bcm6328";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_power_green;
|
||||
led-failsafe = &led_alarm_red;
|
||||
led-running = &led_power_green;
|
||||
led-upgrade = &led_power_green;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys-polled";
|
||||
poll-interval = <100>;
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
bcm43225-sprom {
|
||||
compatible = "brcm,bcma-sprom";
|
||||
|
||||
pci-bus = <1>;
|
||||
pci-dev = <0>;
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <1>;
|
||||
|
||||
brcm,sprom = "brcm/bcm43225-sprom.bin";
|
||||
brcm,sprom-fixups = <97 0xfee5>,
|
||||
<98 0x157c>,
|
||||
<99 0xfae7>,
|
||||
<113 0xfefa>,
|
||||
<114 0x15d6>,
|
||||
<115 0xfaf8>;
|
||||
};
|
||||
};
|
||||
|
||||
&ehci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ðernet {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&hsspi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
spi-max-frequency = <16666667>;
|
||||
spi-tx-bus-width = <2>;
|
||||
spi-rx-bus-width = <2>;
|
||||
reg = <0>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cfe: partition@0 {
|
||||
reg = <0x000000 0x010000>;
|
||||
label = "cfe";
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@10000 {
|
||||
compatible = "brcm,bcm963xx-imagetag";
|
||||
reg = <0x010000 0xfe0000>;
|
||||
label = "firmware";
|
||||
};
|
||||
|
||||
partition@ff0000 {
|
||||
reg = <0xff0000 0x010000>;
|
||||
label = "nvram";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_leds>;
|
||||
|
||||
led_alarm_red: led@2 {
|
||||
reg = <2>;
|
||||
active-low;
|
||||
label = "red:alarm";
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@3 {
|
||||
reg = <3>;
|
||||
active-low;
|
||||
label = "green:internet";
|
||||
};
|
||||
|
||||
led_power_green: led@4 {
|
||||
reg = <4>;
|
||||
active-low;
|
||||
label = "green:power";
|
||||
};
|
||||
};
|
||||
|
||||
&ohci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
pinctrl_leds: leds {
|
||||
function = "led";
|
||||
pins = "gpio2", "gpio3", "gpio4";
|
||||
};
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
label = "lan1";
|
||||
|
||||
phy-handle = <&phy1>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
label = "lan2";
|
||||
|
||||
phy-handle = <&phy2>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
|
||||
port@2 {
|
||||
reg = <2>;
|
||||
label = "lan3";
|
||||
|
||||
phy-handle = <&phy3>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
|
||||
port@3 {
|
||||
reg = <3>;
|
||||
label = "lan4";
|
||||
|
||||
phy-handle = <&phy4>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbh {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&cfe {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_cfe_6a0: macaddr@6a0 {
|
||||
reg = <0x6a0 0x6>;
|
||||
};
|
||||
};
|
||||
@ -1,5 +1,18 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
define Device/comtrend_ar-5381u
|
||||
$(Device/bcm63xx-cfe)
|
||||
DEVICE_VENDOR := Comtrend
|
||||
DEVICE_MODEL := AR-5381u
|
||||
CHIP_ID := 6328
|
||||
CFE_BOARD_ID := 96328A-1241N
|
||||
FLASH_MB := 16
|
||||
DEVICE_PACKAGES += $(USB2_PACKAGES) \
|
||||
$(B43_PACKAGES) broadcom-43225-sprom \
|
||||
kmod-leds-bcm6328
|
||||
endef
|
||||
TARGET_DEVICES += comtrend_ar-5381u
|
||||
|
||||
define Device/comtrend_ar-5387un
|
||||
$(Device/bcm63xx-cfe)
|
||||
DEVICE_VENDOR := Comtrend
|
||||
|
||||
@ -1611,8 +1611,8 @@ static int b53_switch_init(struct b53_device *dev)
|
||||
return b53_switch_reset(dev);
|
||||
}
|
||||
|
||||
struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops,
|
||||
void *priv)
|
||||
struct b53_device *b53_swconfig_switch_alloc(struct device *base, struct b53_io_ops *ops,
|
||||
void *priv)
|
||||
{
|
||||
struct b53_device *dev;
|
||||
|
||||
@ -1627,9 +1627,9 @@ struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops,
|
||||
|
||||
return dev;
|
||||
}
|
||||
EXPORT_SYMBOL(b53_switch_alloc);
|
||||
EXPORT_SYMBOL(b53_swconfig_switch_alloc);
|
||||
|
||||
int b53_switch_detect(struct b53_device *dev)
|
||||
int b53_swconfig_switch_detect(struct b53_device *dev)
|
||||
{
|
||||
u32 id32;
|
||||
u16 tmp;
|
||||
@ -1694,9 +1694,9 @@ int b53_switch_detect(struct b53_device *dev)
|
||||
return b53_read8(dev, B53_MGMT_PAGE, B53_REV_ID,
|
||||
&dev->core_rev);
|
||||
}
|
||||
EXPORT_SYMBOL(b53_switch_detect);
|
||||
EXPORT_SYMBOL(b53_swconfig_switch_detect);
|
||||
|
||||
int b53_switch_register(struct b53_device *dev)
|
||||
int b53_swconfig_switch_register(struct b53_device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -1706,7 +1706,7 @@ int b53_switch_register(struct b53_device *dev)
|
||||
dev->sw_dev.alias = dev->pdata->alias;
|
||||
}
|
||||
|
||||
if (!dev->chip_id && b53_switch_detect(dev))
|
||||
if (!dev->chip_id && b53_swconfig_switch_detect(dev))
|
||||
return -EINVAL;
|
||||
|
||||
ret = b53_switch_init(dev);
|
||||
@ -1717,7 +1717,7 @@ int b53_switch_register(struct b53_device *dev)
|
||||
|
||||
return register_switch(&dev->sw_dev, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(b53_switch_register);
|
||||
EXPORT_SYMBOL(b53_swconfig_switch_register);
|
||||
|
||||
MODULE_AUTHOR("Jonas Gorski <jogo@openwrt.org>");
|
||||
MODULE_DESCRIPTION("B53 switch library");
|
||||
|
||||
@ -280,7 +280,7 @@ static int b53_phy_probe(struct phy_device *phydev)
|
||||
if (phydev->mdio.addr != B53_PSEUDO_PHY && phydev->mdio.addr != 0)
|
||||
return -ENODEV;
|
||||
|
||||
dev = b53_switch_alloc(&phydev->mdio.dev, &b53_mdio_ops, phydev->mdio.bus);
|
||||
dev = b53_swconfig_switch_alloc(&phydev->mdio.dev, &b53_mdio_ops, phydev->mdio.bus);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -290,7 +290,7 @@ static int b53_phy_probe(struct phy_device *phydev)
|
||||
dev->pdata = NULL;
|
||||
mutex_init(&dev->reg_mutex);
|
||||
|
||||
ret = b53_switch_detect(dev);
|
||||
ret = b53_swconfig_switch_detect(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -302,7 +302,7 @@ static int b53_phy_probe(struct phy_device *phydev)
|
||||
|
||||
linkmode_copy(phydev->advertising, phydev->supported);
|
||||
|
||||
ret = b53_switch_register(dev);
|
||||
ret = b53_swconfig_switch_register(dev);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "failed to register switch: %i\n", ret);
|
||||
return ret;
|
||||
|
||||
@ -205,7 +205,7 @@ static int b53_mmap_probe(struct platform_device *pdev)
|
||||
if (!pdata)
|
||||
return -EINVAL;
|
||||
|
||||
dev = b53_switch_alloc(&pdev->dev, &b53_mmap_ops, pdata->regs);
|
||||
dev = b53_swconfig_switch_alloc(&pdev->dev, &b53_mmap_ops, pdata->regs);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -214,7 +214,7 @@ static int b53_mmap_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, dev);
|
||||
|
||||
return b53_switch_register(dev);
|
||||
return b53_swconfig_switch_register(dev);
|
||||
}
|
||||
|
||||
static int b53_mmap_remove(struct platform_device *pdev)
|
||||
|
||||
@ -183,12 +183,12 @@ static inline struct b53_device *sw_to_b53(struct switch_dev *sw)
|
||||
return container_of(sw, struct b53_device, sw_dev);
|
||||
}
|
||||
|
||||
struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops,
|
||||
void *priv);
|
||||
struct b53_device *b53_swconfig_switch_alloc(struct device *base, struct b53_io_ops *ops,
|
||||
void *priv);
|
||||
|
||||
int b53_switch_detect(struct b53_device *dev);
|
||||
int b53_swconfig_switch_detect(struct b53_device *dev);
|
||||
|
||||
int b53_switch_register(struct b53_device *dev);
|
||||
int b53_swconfig_switch_register(struct b53_device *dev);
|
||||
|
||||
static inline void b53_switch_remove(struct b53_device *dev)
|
||||
{
|
||||
|
||||
@ -288,14 +288,14 @@ static int b53_spi_probe(struct spi_device *spi)
|
||||
struct b53_device *dev;
|
||||
int ret;
|
||||
|
||||
dev = b53_switch_alloc(&spi->dev, &b53_spi_ops, spi);
|
||||
dev = b53_swconfig_switch_alloc(&spi->dev, &b53_spi_ops, spi);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
if (spi->dev.platform_data)
|
||||
dev->pdata = spi->dev.platform_data;
|
||||
|
||||
ret = b53_switch_register(dev);
|
||||
ret = b53_swconfig_switch_register(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@ -342,7 +342,7 @@ static int b53_srab_probe(struct platform_device *pdev)
|
||||
if (!pdata)
|
||||
return -EINVAL;
|
||||
|
||||
dev = b53_switch_alloc(&pdev->dev, &b53_srab_ops, pdata->regs);
|
||||
dev = b53_swconfig_switch_alloc(&pdev->dev, &b53_srab_ops, pdata->regs);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -351,7 +351,7 @@ static int b53_srab_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, dev);
|
||||
|
||||
return b53_switch_register(dev);
|
||||
return b53_swconfig_switch_register(dev);
|
||||
}
|
||||
|
||||
static int b53_srab_remove(struct platform_device *pdev)
|
||||
|
||||
@ -8,7 +8,7 @@ KERNELNAME:=Image dtbs
|
||||
CPU_TYPE:=cortex-a53
|
||||
SUBTARGETS:=generic
|
||||
|
||||
KERNEL_PATCHVER:=5.15
|
||||
KERNEL_PATCHVER:=6.1
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
DEFAULT_PACKAGES += \
|
||||
@ -16,6 +16,7 @@ DEFAULT_PACKAGES += \
|
||||
kmod-leds-gpio kmod-gpio-button-hotplug \
|
||||
kmod-qca-nss-dp qca-ssdk-shell kmod-phy-aquantia \
|
||||
ath11k-firmware-ipq8074 kmod-ath11k-ahb wpad-openssl \
|
||||
uboot-envtools autocore automount luci-app-cpufreq
|
||||
uboot-envtools automount losetup \
|
||||
autocore luci-app-cpufreq
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
@ -26,6 +26,9 @@ ipq807x_setup_interfaces()
|
||||
netgear,wax218)
|
||||
ucidef_set_interface_lan "lan" "dhcp"
|
||||
;;
|
||||
prpl,haze)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
|
||||
;;
|
||||
qnap,301w)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g-2" "10g-1"
|
||||
;;
|
||||
|
||||
@ -24,10 +24,17 @@ case "$FIRMWARE" in
|
||||
zyxel,nbg7815)
|
||||
caldata_extract "0:art" 0x1000 0x20000
|
||||
;;
|
||||
prpl,haze)
|
||||
caldata_extract_mmc "0:ART" 0x1000 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin")
|
||||
"ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin"|\
|
||||
"ath11k/QCN9074/hw1.0/cal-pci-0001:01:00.0.bin")
|
||||
case "$board" in
|
||||
prpl,haze)
|
||||
caldata_extract_mmc "0:ART" 0x26800 0x20000
|
||||
;;
|
||||
xiaomi,ax9000)
|
||||
caldata_extract "0:art" 0x26800 0x20000
|
||||
;;
|
||||
|
||||
@ -70,6 +70,7 @@ platform_do_upgrade() {
|
||||
netgear,wax218)
|
||||
nand_do_upgrade "$1"
|
||||
;;
|
||||
prpl,haze|\
|
||||
qnap,301w)
|
||||
kernelname="0:HLOS"
|
||||
rootfsname="rootfs"
|
||||
|
||||
@ -0,0 +1,308 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "ipq8074.dtsi"
|
||||
#include "ipq8074-hk-cpu.dtsi"
|
||||
#include "ipq8074-ess.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
model = "prpl Foundation Haze";
|
||||
compatible = "prpl,haze", "qcom,ipq8074";
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart5;
|
||||
/* Aliases are required by U-Boot to patch MAC addresses */
|
||||
ethernet0 = &dp6_syn;
|
||||
ethernet1 = &dp4;
|
||||
ethernet2 = &dp3;
|
||||
ethernet3 = &dp2;
|
||||
label-mac-device = &dp6_syn;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
wps-button {
|
||||
label = "wps";
|
||||
gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
};
|
||||
|
||||
reset-button {
|
||||
label = "reset";
|
||||
gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
mdio_pins: mdio-state {
|
||||
mdc-pins {
|
||||
pins = "gpio68";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mdio-pins {
|
||||
pins = "gpio69";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button-state {
|
||||
wps-pins {
|
||||
pins = "gpio42";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
rst-pins {
|
||||
pins = "gpio44";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&blsp1_uart5 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&prng {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&ssphy_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qusb_phy_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&ssphy_1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qusb_phy_1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&cryptobam {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qpic_bam {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&blsp1_spi1 { /* BLSP1 QUP1 */
|
||||
pinctrl-0 = <&spi_0_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-gpios = <0>;
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "jedec,spi-nor";
|
||||
spi-max-frequency = <50000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "qcom,smem-part";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&mdio {
|
||||
status = "okay";
|
||||
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&tlmm 22 GPIO_ACTIVE_LOW>;
|
||||
|
||||
qca8075_1: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
qca8075_2: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
qca8075_3: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
qca8075_4: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
};
|
||||
|
||||
aqr113c: ethernet-phy@5 {
|
||||
compatible ="ethernet-phy-ieee802.3-c45";
|
||||
reg = <8>;
|
||||
reset-gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&sdhc_1 {
|
||||
status = "okay";
|
||||
|
||||
vqmmc-supply = <&l11>;
|
||||
};
|
||||
|
||||
&switch {
|
||||
status = "okay";
|
||||
|
||||
switch_cpu_bmp = <0x1>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x60>; /* wan port bitmap */
|
||||
switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
|
||||
switch_mac_mode1 = <0xe>; /* mac mode for uniphy instance1*/
|
||||
switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/
|
||||
bm_tick_mode = <0>; /* bm tick mode */
|
||||
tm_tick_mode = <0>; /* tm tick mode */
|
||||
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <6>;
|
||||
phy_address = <8>;
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
ethernet-phy-ieee802.3-c45;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&edma {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/* Dummy LAN port */
|
||||
&dp1 {
|
||||
status = "disabled";
|
||||
phy-handle = <&qca8075_1>;
|
||||
label = "lan4";
|
||||
};
|
||||
|
||||
&dp2 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_2>;
|
||||
label = "lan3";
|
||||
};
|
||||
|
||||
&dp3 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_3>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
&dp4 {
|
||||
status = "okay";
|
||||
phy-handle = <&qca8075_4>;
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
&dp6_syn {
|
||||
status = "okay";
|
||||
qcom,mactype = <1>;
|
||||
phy-handle = <&aqr113c>;
|
||||
label = "wan";
|
||||
};
|
||||
|
||||
&pcie_qmp0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
status = "okay";
|
||||
|
||||
perst-gpio = <&tlmm 58 GPIO_ACTIVE_LOW>;
|
||||
|
||||
bridge@0,0 {
|
||||
reg = <0x00020000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_qmp1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie1 {
|
||||
status = "okay";
|
||||
|
||||
perst-gpio = <&tlmm 61 GPIO_ACTIVE_LOW>;
|
||||
|
||||
bridge@1,0 {
|
||||
reg = <0x00010000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
wifi@1,0 {
|
||||
status = "okay";
|
||||
|
||||
/* ath11k has no DT compatible for PCI cards */
|
||||
compatible = "pci17cb,1104";
|
||||
reg = <0x00010000 0 0 0 0>;
|
||||
|
||||
qcom,ath11k-calibration-variant = "prpl-Haze";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
|
||||
qcom,ath11k-calibration-variant = "prpl-Haze";
|
||||
};
|
||||
@ -10,6 +10,12 @@ define Device/FitImageLzma
|
||||
KERNEL_NAME := Image
|
||||
endef
|
||||
|
||||
define Device/EmmcImage
|
||||
IMAGES += factory.bin sysupgrade.bin
|
||||
IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
|
||||
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
|
||||
endef
|
||||
|
||||
define Device/UbiFit
|
||||
KERNEL_IN_UBI := 1
|
||||
IMAGES := factory.ubi sysupgrade.bin
|
||||
@ -88,18 +94,26 @@ define Device/netgear_wax218
|
||||
endef
|
||||
TARGET_DEVICES += netgear_wax218
|
||||
|
||||
define Device/prpl_haze
|
||||
$(call Device/FitImage)
|
||||
$(call Device/EmmcImage)
|
||||
DEVICE_VENDOR := prpl Foundation
|
||||
DEVICE_MODEL := Haze
|
||||
DEVICE_DTS_CONFIG := config@hk09
|
||||
SOC := ipq8072
|
||||
DEVICE_PACKAGES += ath11k-firmware-qcn9074 ipq-wifi-prpl_haze kmod-ath11k-pci
|
||||
endef
|
||||
TARGET_DEVICES += prpl_haze
|
||||
|
||||
define Device/qnap_301w
|
||||
$(call Device/FitImage)
|
||||
$(call Device/EmmcImage)
|
||||
DEVICE_VENDOR := QNAP
|
||||
DEVICE_MODEL := 301w
|
||||
DEVICE_DTS_CONFIG := config@hk01
|
||||
KERNEL_SIZE := 16384k
|
||||
BLOCKSIZE := 512k
|
||||
SOC := ipq8072
|
||||
IMAGES += factory.bin sysupgrade.bin
|
||||
IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
|
||||
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
|
||||
DEVICE_PACKAGES := ipq-wifi-qnap_301w e2fsprogs kmod-fs-ext4 losetup
|
||||
DEVICE_PACKAGES += ipq-wifi-qnap_301w
|
||||
endef
|
||||
TARGET_DEVICES += qnap_301w
|
||||
|
||||
@ -180,16 +194,12 @@ TARGET_DEVICES += zte_mf269
|
||||
|
||||
define Device/zyxel_nbg7815
|
||||
$(call Device/FitImage)
|
||||
$(call Device/EmmcImage)
|
||||
DEVICE_VENDOR := ZYXEL
|
||||
DEVICE_MODEL := NBG7815
|
||||
DEVICE_DTS_CONFIG := config@nbg7815
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
SOC := ipq8074
|
||||
IMAGES += factory.bin sysupgrade.bin
|
||||
IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
|
||||
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
|
||||
DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci e2fsprogs kmod-fs-ext4 losetup \
|
||||
kmod-hwmon-tmp103 kmod-bluetooth
|
||||
DEVICE_PACKAGES += ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci kmod-hwmon-tmp103 \
|
||||
kmod-bluetooth
|
||||
endef
|
||||
TARGET_DEVICES += zyxel_nbg7815
|
||||
|
||||
@ -7,7 +7,7 @@ Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is squash of all commits with ppfe driver taken from NXP 5.15 tree:
|
||||
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/log/drivers/staging/fsl_ppfe?h=lf-5.15.y
|
||||
https://github.com/nxp-qoriq/linux/commits/lf-5.15.y/drivers/staging/fsl_ppfe
|
||||
|
||||
List of original commits:
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
#include <net/nexthop.h>
|
||||
#include <net/neighbour.h>
|
||||
#include <net/netevent.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/inetdevice.h>
|
||||
#include <linux/rhashtable.h>
|
||||
#include <linux/of_net.h>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include <net/dsa.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/if_bridge.h>
|
||||
#include <asm/mach-rtl838x/mach-rtl83xx.h>
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include <asm/mach-rtl838x/mach-rtl83xx.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <net/nexthop.h>
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include <asm/mach-rtl838x/mach-rtl83xx.h>
|
||||
#include <linux/etherdevice.h>
|
||||
|
||||
#include "rtl83xx.h"
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include <asm/mach-rtl838x/mach-rtl83xx.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/inetdevice.h>
|
||||
|
||||
#include "rtl83xx.h"
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include <asm/mach-rtl838x/mach-rtl83xx.h>
|
||||
#include <linux/etherdevice.h>
|
||||
|
||||
#include "rtl83xx.h"
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
#include <net/dsa.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <net/flow_offload.h>
|
||||
#include <linux/rhashtable.h>
|
||||
|
||||
@ -1557,7 +1557,7 @@ static int rtl838x_set_mac_address(struct net_device *dev, void *p)
|
||||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
|
||||
dev_addr_set(dev, addr->sa_data);
|
||||
rtl838x_set_mac_hw(dev, mac);
|
||||
|
||||
pr_info("Using MAC %08x%08x\n", sw_r32(priv->r->mac), sw_r32(priv->r->mac + 4));
|
||||
@ -2352,6 +2352,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
|
||||
struct resource *res, *mem;
|
||||
phy_interface_t phy_mode;
|
||||
struct phylink *phylink;
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
int err = 0, rxrings, rxringlen;
|
||||
struct ring_b *ring;
|
||||
|
||||
@ -2478,17 +2479,18 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
|
||||
* 1) from device tree data
|
||||
* 2) from internal registers set by bootloader
|
||||
*/
|
||||
of_get_mac_address(pdev->dev.of_node, dev->dev_addr);
|
||||
if (is_valid_ether_addr(dev->dev_addr)) {
|
||||
rtl838x_set_mac_hw(dev, (u8 *)dev->dev_addr);
|
||||
of_get_mac_address(pdev->dev.of_node, mac_addr);
|
||||
if (is_valid_ether_addr(mac_addr)) {
|
||||
rtl838x_set_mac_hw(dev, mac_addr);
|
||||
} else {
|
||||
dev->dev_addr[0] = (sw_r32(priv->r->mac) >> 8) & 0xff;
|
||||
dev->dev_addr[1] = sw_r32(priv->r->mac) & 0xff;
|
||||
dev->dev_addr[2] = (sw_r32(priv->r->mac + 4) >> 24) & 0xff;
|
||||
dev->dev_addr[3] = (sw_r32(priv->r->mac + 4) >> 16) & 0xff;
|
||||
dev->dev_addr[4] = (sw_r32(priv->r->mac + 4) >> 8) & 0xff;
|
||||
dev->dev_addr[5] = sw_r32(priv->r->mac + 4) & 0xff;
|
||||
mac_addr[0] = (sw_r32(priv->r->mac) >> 8) & 0xff;
|
||||
mac_addr[1] = sw_r32(priv->r->mac) & 0xff;
|
||||
mac_addr[2] = (sw_r32(priv->r->mac + 4) >> 24) & 0xff;
|
||||
mac_addr[3] = (sw_r32(priv->r->mac + 4) >> 16) & 0xff;
|
||||
mac_addr[4] = (sw_r32(priv->r->mac + 4) >> 8) & 0xff;
|
||||
mac_addr[5] = sw_r32(priv->r->mac + 4) & 0xff;
|
||||
}
|
||||
dev_addr_set(dev, mac_addr);
|
||||
/* if the address is invalid, use a random value */
|
||||
if (!is_valid_ether_addr(dev->dev_addr)) {
|
||||
struct sockaddr sa = { AF_UNSPEC };
|
||||
|
||||
@ -2,23 +2,6 @@
|
||||
#
|
||||
# Copyright (C) 2017 Cezary Jackiewicz <cezary@eko.one.pll>
|
||||
|
||||
define KernelPackage/amazon-ena
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Elastic Network Adapter (for Amazon AWS T3)
|
||||
DEPENDS:=@TARGET_x86_64
|
||||
KCONFIG:=CONFIG_ENA_ETHERNET
|
||||
FILES:=$(LINUX_DIR)/drivers/net/ethernet/amazon/ena/ena.ko
|
||||
AUTOLOAD:=$(call AutoLoad,12,ena)
|
||||
endef
|
||||
|
||||
define KernelPackage/amazon-ena/description
|
||||
This driver supports Elastic Network Adapter (ENA)
|
||||
used by Amazon AWS T3 instances.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,amazon-ena))
|
||||
|
||||
|
||||
define KernelPackage/amd-xgbe
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=AMD Ethernet on SoC support
|
||||
|
||||
@ -15,6 +15,8 @@ export TOPDIR LC_ALL LANG SDK
|
||||
world:
|
||||
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||
|
||||
ifneq ($(OPENWRT_BUILD),1)
|
||||
|
||||
@ -43,6 +43,7 @@ TOOLCHAIN_BIN_DIR="$REALNAME_DIR/"
|
||||
|
||||
# Set the PATH so that our run-time location is first
|
||||
# (get_feature is run from the path, so this has to be set)
|
||||
export ORIG_PATH=${ORIG_PATH:-$PATH}
|
||||
export PATH="$TOOLCHAIN_BIN_DIR":$PATH
|
||||
export GCC_HONOUR_COPTS
|
||||
|
||||
|
||||
@ -16,20 +16,18 @@ PKG_HASH:=adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa
|
||||
|
||||
HOST_BUILD_PARALLEL := 1
|
||||
|
||||
BUILD_PROGRAMS = date readlink touch ln chown ginstall
|
||||
PKG_PROGRAMS:=date readlink touch ln chown ginstall
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
|
||||
|
||||
BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS))
|
||||
|
||||
HOST_CONFIGURE_ARGS += \
|
||||
--enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS)))
|
||||
--enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
|
||||
|
||||
HOST_MAKE_FLAGS += \
|
||||
$(AM_TOOL_PATHS_FAKE) \
|
||||
PROGRAMS="$(BUILD_BINS)" \
|
||||
PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
|
||||
LIBRARIES= MANS= SUBDIRS=.
|
||||
|
||||
define Host/Bootstrap
|
||||
@ -58,7 +56,7 @@ endef
|
||||
|
||||
define Host/Install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/%,$(BUILD_BINS)) $(1)/bin/
|
||||
$(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
|
||||
ln -sf ginstall $(1)/bin/install
|
||||
endef
|
||||
|
||||
|
||||
@ -14,6 +14,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
|
||||
PKG_HASH:=a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe
|
||||
|
||||
PKG_PROGRAMS:=find locate updatedb xargs
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
Loading…
Reference in New Issue
Block a user