mirror of
https://github.com/hzyitc/openwrt-redmi-ax3000.git
synced 2025-12-16 16:31:57 +00:00
mac80211: ath11k: Add IPQ5018 WiFi support
This commit is contained in:
parent
ebb2c02b39
commit
2453fff8b0
@ -1,77 +1,48 @@
|
||||
#
|
||||
# Copyright (C) 2022 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ath11k-firmware
|
||||
PKG_SOURCE_DATE:=2023-03-31
|
||||
PKG_SOURCE_VERSION:=a039049a9349722fa5c74185452ab04644a0d351
|
||||
PKG_MIRROR_HASH:=ed401e3f6e91d70565b3396139193f7e815f410db93700697205ac8ed1b828c5
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=2.7.0.1
|
||||
PKG_RELEASE:=01744
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/quic/upstream-wifi-fw.git
|
||||
|
||||
PKG_LICENSE_FILES:=LICENSE.qca_firmware
|
||||
|
||||
PKG_MAINTAINER:=Robert Marko <robimarko@gmail.com>
|
||||
PKG_SOURCE_URL:=https://github.com/quic/upstream-wifi-fw
|
||||
PKG_SOURCE_VERSION:=main
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
RSTRIP:=:
|
||||
STRIP:=:
|
||||
define generate-ath11k-firmware
|
||||
|
||||
define Package/$(PKG_NAME)-$(1)
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=ath11k firmware binaries for $(call toupper,$(1))
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-$(1)/description
|
||||
ath11k firmware binaries for $(call toupper,$(1))
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-$(1)/install
|
||||
$$(INSTALL_DIR) $$(1)/lib/firmware/$(if $(2),$(2),$(call toupper,$(1)))
|
||||
$$(INSTALL_DATA) \
|
||||
$$(PKG_BUILD_DIR)/ath11k-firmware/*$(call toupper,$(1))*/hw*.0/$(PKG_VERSION)/WLAN.HK.$(PKG_VERSION)-$(PKG_RELEASE)-QCAHKSWPL_SILICONZ-1/$(3)*.* \
|
||||
$$(1)/lib/firmware/$(if $(2),$(2),$(call toupper,$(1)))/
|
||||
endef
|
||||
|
||||
ALL_PACKAGE+=$(PKG_NAME)-$(1)
|
||||
|
||||
define Package/ath11k-firmware-default
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=$(PKG_SOURCE_URL)
|
||||
DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-ipq8074
|
||||
$(Package/ath11k-firmware-default)
|
||||
TITLE:=IPQ8074 ath11k firmware
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-qcn9074
|
||||
$(Package/ath11k-firmware-default)
|
||||
TITLE:=QCN9074 ath11k firmware
|
||||
endef
|
||||
$(eval $(call generate-ath11k-firmware,ipq5018))
|
||||
$(eval $(call generate-ath11k-firmware,ipq6018))
|
||||
$(eval $(call generate-ath11k-firmware,ipq8074))
|
||||
$(eval $(call generate-ath11k-firmware,qcn6122,qcn6122,qcn6122/))
|
||||
$(eval $(call generate-ath11k-firmware,qcn9074,qcn9074))
|
||||
|
||||
define Build/Compile
|
||||
|
||||
endef
|
||||
|
||||
QCN9074_BOARD_REV:=8e140c65f36137714b6d8934e09dcd73cb05c2f6
|
||||
QCN9074_BOARD_FILE:=board-2.bin.$(QCN9074_BOARD_REV)
|
||||
|
||||
define Download/qcn9074-board
|
||||
URL:=https://git.codelinaro.org/clo/ath-firmware/ath11k-firmware/-/raw/main/QCN9074/hw1.0/
|
||||
URL_FILE:=board-2.bin
|
||||
FILE:=$(QCN9074_BOARD_FILE)
|
||||
HASH:=dbf0ca14aa1229eccd48f26f1026901b9718b143bd30b51b8ea67c84ba6207f1
|
||||
endef
|
||||
$(eval $(call Download,qcn9074-board))
|
||||
|
||||
define Package/ath11k-firmware-ipq8074/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/IPQ8074
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware/IPQ8074/hw2.0/testing/2.9.0.1/WLAN.HK.2.9.0.1-01385-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(1)/lib/firmware/IPQ8074/
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-qcn9074/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware/QCN9074/hw1.0/testing/2.9.0.1/WLAN.HK.2.9.0.1-01385-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(1)/lib/firmware/ath11k/QCN9074/hw1.0/
|
||||
$(INSTALL_BIN) \
|
||||
$(DL_DIR)/$(QCN9074_BOARD_FILE) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ath11k-firmware-ipq8074))
|
||||
$(eval $(call BuildPackage,ath11k-firmware-qcn9074))
|
||||
$(foreach pkg, $(ALL_PACKAGE), \
|
||||
$(eval $(call BuildPackage,$(pkg))) \
|
||||
)
|
||||
|
||||
@ -48,10 +48,10 @@ ALLWIFIBOARDS:= \
|
||||
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
|
||||
|
||||
define Package/ipq-wifi-default
|
||||
SUBMENU:=ath10k Board-Specific Overrides
|
||||
SUBMENU:=ath Board-Specific Overrides
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x)
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq50xx||TARGET_ipq806x||TARGET_ipq807x)
|
||||
TITLE:=Custom Board
|
||||
endef
|
||||
|
||||
@ -76,12 +76,16 @@ define ipq-wifi-install-one
|
||||
$(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
|
||||
$(if $(filter $(suffix $(1)),.QCA99X0 .qca99x0),\
|
||||
$(call ipq-wifi-install-one-to,$(1),$(2),QCA99X0/hw2.0),\
|
||||
$(if $(filter $(suffix $(1)),.IPQ5018 .ipq5018),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ5018/hw1.0),\
|
||||
$(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\
|
||||
$(if $(filter $(suffix $(1)),.QCN6122 .qcn6122),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),qcn6122/hw1.0),\
|
||||
$(if $(filter $(suffix $(1)),.QCN9074 .qcn9074),\
|
||||
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN9074/hw1.0),\
|
||||
$(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
|
||||
)))))))
|
||||
)))))))))
|
||||
|
||||
endef
|
||||
# Blank line required at end of above define due to foreach context
|
||||
@ -114,7 +118,7 @@ Do not install it for any other device!
|
||||
endef
|
||||
|
||||
# Add board name to ALLWIFIBOARDS
|
||||
# Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9889|qca9984|qca99x0|ipq8074>
|
||||
# Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9889|qca9984|qca99x0|ipq5018|ipq8074|qcn6122>
|
||||
# Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
|
||||
|
||||
$(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
|
||||
|
||||
@ -325,7 +325,7 @@ define KernelPackage/ath11k-ahb
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Qualcomm 802.11ax AHB wireless chipset support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
|
||||
DEPENDS+= @TARGET_ipq807x +kmod-ath11k +kmod-qrtr-smd
|
||||
DEPENDS+= @(TARGET_ipq50xx||TARGET_ipq807x) +kmod-ath11k +kmod-qrtr-smd
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k_ahb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath11k_ahb)
|
||||
endef
|
||||
|
||||
@ -0,0 +1,67 @@
|
||||
From 824dde8652815aa67b4e2bf2d8a9455a8ef82b8f Mon Sep 17 00:00:00 2001
|
||||
From: hzy <hzyitc@outlook.com>
|
||||
Date: Thu, 29 Jun 2023 06:12:45 +0000
|
||||
Subject: [PATCH] wifi: ath11k: Support setting bdf-addr and caldb-addr via DT
|
||||
|
||||
Signed-off-by: hzy <hzyitc@outlook.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/qmi.c | 15 +++++++++++----
|
||||
1 file changed, 11 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
index f230a387..801d5880 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2032,6 +2032,7 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
|
||||
struct device_node *hremote_node = NULL;
|
||||
struct resource res;
|
||||
u32 host_ddr_sz;
|
||||
+ u32 addr;
|
||||
int i, idx, ret;
|
||||
|
||||
for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) {
|
||||
@@ -2071,7 +2072,9 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
|
||||
idx++;
|
||||
break;
|
||||
case BDF_MEM_REGION_TYPE:
|
||||
- ab->qmi.target_mem[idx].paddr = ab->hw_params.bdf_addr;
|
||||
+ if(of_property_read_u32(dev->of_node, "qcom,bdf-addr", &addr))
|
||||
+ addr = ab->hw_params.bdf_addr;
|
||||
+ ab->qmi.target_mem[idx].paddr = addr;
|
||||
ab->qmi.target_mem[idx].vaddr = NULL;
|
||||
ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size;
|
||||
ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type;
|
||||
@@ -2093,8 +2096,9 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
|
||||
if (!ab->qmi.target_mem[idx].iaddr)
|
||||
return -EIO;
|
||||
} else {
|
||||
- ab->qmi.target_mem[idx].paddr =
|
||||
- ATH11K_QMI_CALDB_ADDRESS;
|
||||
+ if(of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr))
|
||||
+ addr = ATH11K_QMI_CALDB_ADDRESS;
|
||||
+ ab->qmi.target_mem[idx].paddr = addr;
|
||||
}
|
||||
} else {
|
||||
ab->qmi.target_mem[idx].paddr = 0;
|
||||
@@ -2296,6 +2300,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab,
|
||||
struct qmi_wlanfw_bdf_download_resp_msg_v01 resp;
|
||||
struct qmi_txn txn;
|
||||
const u8 *temp = data;
|
||||
+ u32 addr;
|
||||
void __iomem *bdf_addr = NULL;
|
||||
int ret;
|
||||
u32 remaining = len;
|
||||
@@ -2307,7 +2312,9 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab,
|
||||
memset(&resp, 0, sizeof(resp));
|
||||
|
||||
if (ab->hw_params.fixed_bdf_addr) {
|
||||
- bdf_addr = ioremap(ab->hw_params.bdf_addr, ab->hw_params.fw.board_size);
|
||||
+ if(of_property_read_u32(ab->dev->of_node, "qcom,bdf-addr", &addr))
|
||||
+ addr = ab->hw_params.bdf_addr;
|
||||
+ bdf_addr = ioremap(addr, ab->hw_params.fw.board_size);
|
||||
if (!bdf_addr) {
|
||||
ath11k_warn(ab, "qmi ioremap error for bdf_addr\n");
|
||||
ret = -EIO;
|
||||
--
|
||||
2.40.1
|
||||
|
||||
@ -16,6 +16,7 @@ KERNELNAME:=Image dtbs
|
||||
DEFAULT_PACKAGES += \
|
||||
kmod-gpio-button-hotplug \
|
||||
uboot-envtools \
|
||||
kmod-qca-nss-dp swconfig
|
||||
kmod-qca-nss-dp swconfig \
|
||||
kmod-ath11k kmod-ath11k-ahb kmod-ath11k-pci wpad-basic-wolfssl
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user