* [PATCH 0/6] wifi: ath11k: Add support for QCN6122
@ 2025-10-29 14:26 George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 1/6] dt: bindings: net: add bindings " George Moussalem via B4 Relay
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
QCN6122 is a PCIe based solution that is attached to and enumerated
by the WPSS (Wireless Processor SubSystem) Q6 processor.
Though it is a PCIe device, since it is not attached to APSS processor
(Application Processor SubSystem), APSS will be unaware of such a decice
so it is registered to the APSS processor as a platform device(AHB).
Because of this hybrid nature, it is called as a hybrid bus device as
introduced by WCN6750.
This chip is similar to WCN6750 and follows the same codepath as for
WCN6750 to bring up the radio and communicate with the firmware.
QCN6122 is an IPQ5018 SoC specific solution and uses shared
IPQ5018/QCN6122 firmware.
This patch series is a much simplified version of below vendor patch:
Download from https://git.codelinaro.org/clo/qsdk/oss/system/feeds/wlan-open/-/blob/NHSS.QSDK.12.4.5.r2/mac80211/patches/232-ath11k-qcn6122-support.patch
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
George Moussalem (6):
dt: bindings: net: add bindings for QCN6122
wifi: ath11k: add hw params for QCN6122
wifi: ath11k: add hw ring mask for QCN6122
wifi: ath11k: update hif and pci ops for QCN6122
wifi: ath11k: add multipd support for QCN6122
wifi: ath11k: add QCN6122 device support
.../bindings/net/wireless/qcom,ath11k.yaml | 57 +++++++++++++++++-
drivers/net/wireless/ath/ath11k/ahb.c | 68 ++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/core.c | 68 ++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/core.h | 5 ++
drivers/net/wireless/ath/ath11k/hif.h | 9 +++
drivers/net/wireless/ath/ath11k/hw.c | 37 ++++++++++++
drivers/net/wireless/ath/ath11k/hw.h | 1 +
drivers/net/wireless/ath/ath11k/pci.c | 1 +
drivers/net/wireless/ath/ath11k/pcic.c | 9 +++
drivers/net/wireless/ath/ath11k/qmi.c | 2 +
drivers/net/wireless/ath/ath11k/qmi.h | 3 +-
11 files changed, 258 insertions(+), 2 deletions(-)
---
base-commit: 88de08348af8ce15dc563e0ebb5553eddd821c06
change-id: 20251029-ath11k-qcn6122-7d533aa44a66
Best regards,
--
George Moussalem <george.moussalem@outlook.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/6] dt: bindings: net: add bindings for QCN6122
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
@ 2025-10-29 14:26 ` George Moussalem via B4 Relay
2025-10-29 14:32 ` Krzysztof Kozlowski
2025-10-29 14:26 ` [PATCH 2/6] wifi: ath11k: add hw params " George Moussalem via B4 Relay
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
From: George Moussalem <george.moussalem@outlook.com>
QCN6122 is a PCIe based solution that is attached to and enumerated
by the WPSS (Wireless Processor SubSystem) Q6 processor.
Though it is a PCIe device, since it is not attached to APSS processor
(Application Processor SubSystem), APSS will be unaware of such a decice
so it is registered to the APSS processor as a platform device(AHB).
Because of this hybrid nature, it is called as a hybrid bus device as
introduced by WCN6750. It has 5 CE and 8 DP rings.
QCN6122 is similar to WCN6750 and follows the same codepath as for
WCN6750.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
.../bindings/net/wireless/qcom,ath11k.yaml | 57 +++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
index c089677702cf17f3016b054d21494d2a7706ce5d..4b0b282bb9231c8bc496fed42e0917b9d7d106d2 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
@@ -21,12 +21,13 @@ properties:
- qcom,ipq6018-wifi
- qcom,wcn6750-wifi
- qcom,ipq5018-wifi
+ - qcom,qcn6122-wifi
reg:
maxItems: 1
interrupts:
- minItems: 32
+ minItems: 13
maxItems: 52
interrupt-names:
@@ -87,6 +88,14 @@ properties:
items:
- const: wlan-smp2p-out
+ qcom,userpd:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [2, 3]
+ description: instance ID of user PD (protection domain) in multi-PD
+ architectures to distinguish between multiple instances
+ of the same wifi chip used by QMI in its interface with
+ the firmware running on Q6.
+
required:
- compatible
- reg
@@ -268,6 +277,31 @@ allOf:
- description: interrupt event for ring DP20
- description: interrupt event for ring DP21
- description: interrupt event for ring DP22
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,qcn6122-wifi
+ then:
+ required:
+ - qcom,userpd
+ properties:
+ interrupts:
+ items:
+ - description: interrupt event for ring CE1
+ - description: interrupt event for ring CE2
+ - description: interrupt event for ring CE3
+ - description: interrupt event for ring CE4
+ - description: interrupt event for ring CE5
+ - description: interrupt event for ring DP1
+ - description: interrupt event for ring DP2
+ - description: interrupt event for ring DP3
+ - description: interrupt event for ring DP4
+ - description: interrupt event for ring DP5
+ - description: interrupt event for ring DP6
+ - description: interrupt event for ring DP7
+ - description: interrupt event for ring DP8
examples:
- |
@@ -467,3 +501,24 @@ examples:
iommus = <&apps_smmu 0x1c02 0x1>;
};
};
+
+ - |
+ wifi1: wifi@b00a040 {
+ reg = <0x0b00a040 0x0>;
+ compatible = "qcom,qcn6122-wifi";
+ interrupts = <GIC_SPI 416 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 417 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 418 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 419 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 420 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 421 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 422 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 423 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 424 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 425 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 426 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 427 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 428 IRQ_TYPE_EDGE_RISING>;
+ qcom,rproc = <&q6v5_wcss_pd2>;
+ qcom,userpd = <2>;
+ };
--
2.51.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/6] wifi: ath11k: add hw params for QCN6122
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 1/6] dt: bindings: net: add bindings " George Moussalem via B4 Relay
@ 2025-10-29 14:26 ` George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 3/6] wifi: ath11k: add hw ring mask " George Moussalem via B4 Relay
` (3 subsequent siblings)
5 siblings, 0 replies; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
From: George Moussalem <george.moussalem@outlook.com>
Add QCN6122 platform support.
QCN6122 is a PCIe based solution that is attached to and enumerated
by the WPSS (Wireless Processor SubSystem) Q6 processor.
Though it is a PCIe device, since it is not attached to APSS processor
(Application Processor SubSystem), APSS will be unaware of such a decice
so it is registered to the APSS processor as a platform device (AHB).
Because of this hybrid nature, it is called as a hybrid bus device.
QCN6122 is similar to WCN6750 and follows the same codepath as for
WCN6750 though it does not support shadow regs.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
drivers/net/wireless/ath/ath11k/core.c | 67 ++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/core.h | 1 +
drivers/net/wireless/ath/ath11k/qmi.h | 3 +-
3 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 2810752260f2f7eee226f88d5aea7cdabe7e9ed4..401b843402c6cca0e7fdd61e68b57fa6d5a6ae7e 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -907,6 +907,73 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.support_dual_stations = true,
.pdev_suspend = false,
},
+ {
+ .hw_rev = ATH11K_HW_QCN6122_HW10,
+ .name = "qcn6122 hw1.0",
+ .fw = {
+ .dir = "QCN6122/hw1.0",
+ .board_size = 256 * 1024,
+ .cal_offset = 128 * 1024,
+ },
+ .hal_params = &ath11k_hw_hal_params_ipq8074,
+ .max_radios = MAX_RADIOS_5018,
+ .bdf_addr = 0x4D200000,
+ .hw_ops = &ipq5018_ops,
+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN6122,
+ .interface_modes = BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_AP) |
+ BIT(NL80211_IFTYPE_MESH_POINT),
+ .spectral = {
+ .fft_sz = 2,
+ .fft_pad_sz = 0,
+ .summary_pad_sz = 16,
+ .fft_hdr_len = 24,
+ .max_fft_bins = 1024,
+ },
+ .internal_sleep_clock = false,
+ .regs = &wcn6750_regs,
+ .credit_flow = false,
+ .max_tx_ring = 1,
+ .supports_monitor = true,
+ .supports_shadow_regs = false,
+ .idle_ps = false,
+ .supports_suspend = false,
+ .host_ce_config = ath11k_host_ce_config_qcn9074,
+ .ce_count = CE_CNT_5018,
+ .target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
+ .target_ce_count = TARGET_CE_CNT_5018,
+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018,
+ .svc_to_ce_map_len = SVC_CE_MAP_LEN_5018,
+ .single_pdev_only = false,
+ .rxdma1_enable = true,
+ .num_rxdma_per_pdev = RXDMA_PER_PDEV_5018,
+ .rx_mac_buf_ring = false,
+ .vdev_start_delay = false,
+ .htt_peer_map_v2 = true,
+ .coldboot_cal_mm = false,
+ .coldboot_cal_ftm = false,
+ .cbcal_restart_fw = true,
+ .fix_l1ss = true,
+ .alloc_cacheable_memory = true,
+ .m3_fw_support = false,
+ .fixed_bdf_addr = true,
+ .fixed_mem_region = true,
+ .static_window_map = true,
+ .hybrid_bus_type = true,
+ .fw_mem_mode = 1,
+ .supports_sta_ps = false,
+ .dbr_debug_support = true,
+ .bios_sar_capa = NULL,
+ .fixed_fw_mem = false,
+ .support_off_channel_tx = false,
+ .tcl_ring_retry = true,
+ .tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ .smp2p_wow_exit = false,
+ .support_fw_mac_sequence = false,
+ .support_dual_stations = false,
+ .pdev_suspend = false,
+ },
};
static const struct dmi_system_id ath11k_pm_quirk_table[] = {
diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index e8780b05ce11e39bdd93dd02d39812be90689b40..afc591f9608f48506bf19851169828c519661d72 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -152,6 +152,7 @@ enum ath11k_hw_rev {
ATH11K_HW_IPQ5018_HW10,
ATH11K_HW_QCA2066_HW21,
ATH11K_HW_QCA6698AQ_HW21,
+ ATH11K_HW_QCN6122_HW10,
};
enum ath11k_firmware_mode {
diff --git a/drivers/net/wireless/ath/ath11k/qmi.h b/drivers/net/wireless/ath/ath11k/qmi.h
index 7968ab122b65dc28a44eca7b34904f55f717f586..f6014b9662dbe5f4cfc6a2af7010938cad454267 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.h
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
@@ -22,10 +22,11 @@
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074 0x07
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_WCN6750 0x03
+#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN6122 0x40
#define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32
#define ATH11K_QMI_RESP_LEN_MAX 8192
#define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 52
-#define ATH11K_QMI_CALDB_SIZE 0x480000
+#define ATH11K_QMI_CALDB_SIZE 0x500000
#define ATH11K_QMI_BDF_EXT_STR_LENGTH 0x20
#define ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT 5
--
2.51.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/6] wifi: ath11k: add hw ring mask for QCN6122
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 1/6] dt: bindings: net: add bindings " George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 2/6] wifi: ath11k: add hw params " George Moussalem via B4 Relay
@ 2025-10-29 14:26 ` George Moussalem via B4 Relay
2025-10-29 14:33 ` Krzysztof Kozlowski
2025-10-29 14:26 ` [PATCH 4/6] wifi: ath11k: update hif and pci ops " George Moussalem via B4 Relay
` (2 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
From: George Moussalem <george.moussalem@outlook.com>
Add ring mask for QCN6122 and register them in hw params.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
drivers/net/wireless/ath/ath11k/core.c | 1 +
drivers/net/wireless/ath/ath11k/hw.c | 37 ++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/hw.h | 1 +
3 files changed, 39 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 401b843402c6cca0e7fdd61e68b57fa6d5a6ae7e..b8ed8b673516855e6596d519c8234f4e230b6a2f 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -919,6 +919,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.max_radios = MAX_RADIOS_5018,
.bdf_addr = 0x4D200000,
.hw_ops = &ipq5018_ops,
+ .ring_mask = &ath11k_hw_ring_mask_qcn6122,
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN6122,
.interface_modes = BIT(NL80211_IFTYPE_STATION) |
diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c
index caa6dc12a790b5072d5453ac123a604cf440a20a..56e7f86f2878f87aab42ae6abe504949b44297cc 100644
--- a/drivers/net/wireless/ath/ath11k/hw.c
+++ b/drivers/net/wireless/ath/ath11k/hw.c
@@ -2070,6 +2070,43 @@ const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_wcn6750 = {
},
};
+const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn6122 = {
+ .tx = {
+ ATH11K_TX_RING_MASK_0,
+ ATH11K_TX_RING_MASK_1,
+ ATH11K_TX_RING_MASK_2,
+ },
+ .rx_mon_status = {
+ 0, 0, 0,
+ ATH11K_RX_MON_STATUS_RING_MASK_0,
+ },
+ .rx = {
+ 0, 0, 0, 0,
+ ATH11K_RX_RING_MASK_0,
+ ATH11K_RX_RING_MASK_1,
+ ATH11K_RX_RING_MASK_2,
+ ATH11K_RX_RING_MASK_3,
+ },
+ .rx_err = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ ATH11K_RX_ERR_RING_MASK_0,
+ },
+ .rx_wbm_rel = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ATH11K_RX_WBM_REL_RING_MASK_0,
+ },
+ .reo_status = {
+ 0, 0, 0,
+ ATH11K_REO_STATUS_RING_MASK_0,
+ },
+ .rxdma2host = {
+ ATH11K_RXDMA2HOST_RING_MASK_0,
+ },
+ .host2rxdma = {
+ ATH11K_HOST2RXDMA_RING_MASK_0,
+ },
+};
+
/* Target firmware's Copy Engine configuration for IPQ5018 */
const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[] = {
/* CE0: host->target HTC control and raw streams */
diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index 52d9f4c13b1366f2339b8900cf9db91e6ff1bcff..e7220c46de10c378ea5b452d78f921054ff54e54 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -285,6 +285,7 @@ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074;
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_wcn6750;
+extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn6122;
extern const struct ce_ie_addr ath11k_ce_ie_addr_ipq8074;
extern const struct ce_ie_addr ath11k_ce_ie_addr_ipq5018;
--
2.51.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/6] wifi: ath11k: update hif and pci ops for QCN6122
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
` (2 preceding siblings ...)
2025-10-29 14:26 ` [PATCH 3/6] wifi: ath11k: add hw ring mask " George Moussalem via B4 Relay
@ 2025-10-29 14:26 ` George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 5/6] wifi: ath11k: add multipd support " George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 6/6] wifi: ath11k: add QCN6122 device support George Moussalem via B4 Relay
5 siblings, 0 replies; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
From: George Moussalem <george.moussalem@outlook.com>
Add HIF and PCI ops for QCN6122. QCN6122 by default uses DP window 3.
However, this is configurable, so let's introduce a function to do that
and follow the existing register access code for (hybrid) AHB devices
and use DP window 1.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
drivers/net/wireless/ath/ath11k/ahb.c | 34 ++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/hif.h | 9 +++++++++
drivers/net/wireless/ath/ath11k/qmi.c | 2 ++
3 files changed, 45 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 8dfe9b40c12626649639fc1dd9da0e5e0c2dcaf1..7b267dd62e964b2c4d6c3bbe016abd1ad0297219 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -762,6 +762,18 @@ static int ath11k_ahb_hif_resume(struct ath11k_base *ab)
return 0;
}
+static void ath11k_ahb_config_static_window_qcn6122(struct ath11k_base *ab)
+{
+ u32 umac_window = FIELD_GET(ATH11K_PCI_WINDOW_VALUE_MASK, HAL_SEQ_WCSS_UMAC_OFFSET);
+ u32 ce_window = FIELD_GET(ATH11K_PCI_WINDOW_VALUE_MASK, HAL_CE_WFSS_CE_REG_BASE);
+ u32 window;
+
+ window = (umac_window) | (ce_window << 6);
+
+ iowrite32(ATH11K_PCI_WINDOW_ENABLE_BIT | window,
+ ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS);
+}
+
static const struct ath11k_hif_ops ath11k_ahb_hif_ops_ipq8074 = {
.start = ath11k_ahb_start,
.stop = ath11k_ahb_stop,
@@ -794,6 +806,24 @@ static const struct ath11k_hif_ops ath11k_ahb_hif_ops_wcn6750 = {
.ce_irq_disable = ath11k_pci_disable_ce_irqs_except_wake_irq,
};
+static const struct ath11k_hif_ops ath11k_ahb_hif_ops_qcn6122 = {
+ .start = ath11k_pcic_start,
+ .stop = ath11k_pcic_stop,
+ .read32 = ath11k_pcic_read32,
+ .write32 = ath11k_pcic_write32,
+ .read = NULL,
+ .irq_enable = ath11k_pcic_ext_irq_enable,
+ .irq_disable = ath11k_pcic_ext_irq_disable,
+ .get_msi_address = ath11k_pcic_get_msi_address,
+ .get_user_msi_vector = ath11k_pcic_get_user_msi_assignment,
+ .map_service_to_pipe = ath11k_pcic_map_service_to_pipe,
+ .power_down = ath11k_ahb_power_down,
+ .power_up = ath11k_ahb_power_up,
+ .ce_irq_enable = ath11k_pci_enable_ce_irqs_except_wake_irq,
+ .ce_irq_disable = ath11k_pci_disable_ce_irqs_except_wake_irq,
+ .config_static_window = ath11k_ahb_config_static_window_qcn6122,
+};
+
static int ath11k_core_get_rproc(struct ath11k_base *ab)
{
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
@@ -1127,6 +1157,10 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
hif_ops = &ath11k_ahb_hif_ops_wcn6750;
pci_ops = &ath11k_ahb_pci_ops_wcn6750;
break;
+ case ATH11K_HW_QCN6122_HW10:
+ hif_ops = &ath11k_ahb_hif_ops_qcn6122;
+ pci_ops = &ath11k_ahb_pci_ops_wcn6750;
+ break;
default:
dev_err(&pdev->dev, "unsupported device type %d\n", hw_rev);
return -EOPNOTSUPP;
diff --git a/drivers/net/wireless/ath/ath11k/hif.h b/drivers/net/wireless/ath/ath11k/hif.h
index cd9c4b838246815ecb2a10784732c009a5423b6e..e4c1ad4d8ffc7627f6b3c384d64cb71b82451639 100644
--- a/drivers/net/wireless/ath/ath11k/hif.h
+++ b/drivers/net/wireless/ath/ath11k/hif.h
@@ -32,6 +32,7 @@ struct ath11k_hif_ops {
void (*ce_irq_disable)(struct ath11k_base *ab);
void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx);
void (*coredump_download)(struct ath11k_base *ab);
+ void (*config_static_window)(struct ath11k_base *ab);
};
static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab)
@@ -159,4 +160,12 @@ static inline void ath11k_hif_coredump_download(struct ath11k_base *ab)
ab->hif.ops->coredump_download(ab);
}
+static inline void ath11k_hif_config_static_window(struct ath11k_base *ab)
+{
+ if (!ab->hw_params.static_window_map || !ab->hif.ops->config_static_window)
+ return;
+
+ ab->hif.ops->config_static_window(ab);
+}
+
#endif /* _HIF_H_ */
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index aea56c38bf8f38982532fc90de25582c26ba4393..613e8c56978fe5af8f9b1b24c1b46efbc0bf2cb7 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2190,6 +2190,8 @@ static int ath11k_qmi_request_device_info(struct ath11k_base *ab)
if (!ab->hw_params.ce_remap)
ab->mem_ce = ab->mem;
+ ath11k_hif_config_static_window(ab);
+
return 0;
out:
return ret;
--
2.51.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/6] wifi: ath11k: add multipd support for QCN6122
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
` (3 preceding siblings ...)
2025-10-29 14:26 ` [PATCH 4/6] wifi: ath11k: update hif and pci ops " George Moussalem via B4 Relay
@ 2025-10-29 14:26 ` George Moussalem via B4 Relay
2025-10-29 14:43 ` Krzysztof Kozlowski
2025-10-29 14:26 ` [PATCH 6/6] wifi: ath11k: add QCN6122 device support George Moussalem via B4 Relay
5 siblings, 1 reply; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
From: George Moussalem <george.moussalem@outlook.com>
IPQ5018/QCN6122 platforms use multi PD (protection domains) to avoid
having one instance of the running Q6 firmware crashing resulting in
crashing the others.
The IPQ5018 platform can have up to two QCN6122 wifi chips.
To differentiate the two, the PD instance number (1 or 2) is added to
the QMI service instance ID, which the QCN6122 firmware also expects.
IPQ5018 internal wifi is always the first PD while QCN6122 cards must be
second or third.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
See below patch for more info:
https://lore.kernel.org/all/20231110091939.3025413-1-quic_mmanikan@quicinc.com/
---
drivers/net/wireless/ath/ath11k/ahb.c | 31 +++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/core.h | 4 ++++
drivers/net/wireless/ath/ath11k/pci.c | 1 +
3 files changed, 36 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 7b267dd62e964b2c4d6c3bbe016abd1ad0297219..820a383e88caf125892176e421b0121fed7e7055 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -429,6 +429,7 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
+ ab->qmi.service_ins_id += ab->userpd_id;
}
static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
@@ -1101,6 +1102,28 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab)
return ret;
}
+static int ath11k_get_userpd_id(struct device *dev, int *userpd)
+{
+ int ret, userpd_id;
+
+ ret = of_property_read_u32(dev->of_node, "qcom,userpd", &userpd_id);
+
+ if (ret)
+ return ret;
+
+ switch (userpd_id) {
+ case 2:
+ *userpd = ATH11K_QCN6122_USERPD_2;
+ break;
+ case 3:
+ *userpd = ATH11K_QCN6122_USERPD_3;
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
static int ath11k_ahb_fw_resource_deinit(struct ath11k_base *ab)
{
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
@@ -1142,6 +1165,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
const struct ath11k_hif_ops *hif_ops;
const struct ath11k_pci_ops *pci_ops;
enum ath11k_hw_rev hw_rev;
+ int userpd_id = 0;
int ret;
hw_rev = (uintptr_t)device_get_match_data(&pdev->dev);
@@ -1160,6 +1184,12 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
case ATH11K_HW_QCN6122_HW10:
hif_ops = &ath11k_ahb_hif_ops_qcn6122;
pci_ops = &ath11k_ahb_pci_ops_wcn6750;
+ ret = ath11k_get_userpd_id(&pdev->dev, &userpd_id);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to get userpd: %d\n", ret);
+ return ret;
+ }
+ dev_info(&pdev->dev, "multi-pd architecture - userpd: %d\n", userpd_id);
break;
default:
dev_err(&pdev->dev, "unsupported device type %d\n", hw_rev);
@@ -1182,6 +1212,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
ab->hif.ops = hif_ops;
ab->pdev = pdev;
ab->hw_rev = hw_rev;
+ ab->userpd_id = userpd_id;
ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;
platform_set_drvdata(pdev, ab);
diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index afc591f9608f48506bf19851169828c519661d72..87e047c9a0debc35aa3d37cb0125e741085f73d9 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -48,6 +48,9 @@
#define ATH11K_INVALID_HW_MAC_ID 0xFF
#define ATH11K_CONNECTION_LOSS_HZ (3 * HZ)
+#define ATH11K_QCN6122_USERPD_2 1
+#define ATH11K_QCN6122_USERPD_3 2
+
/* SMBIOS type containing Board Data File Name Extension */
#define ATH11K_SMBIOS_BDF_EXT_TYPE 0xF8
@@ -969,6 +972,7 @@ struct ath11k_base {
struct list_head peers;
wait_queue_head_t peer_mapping_wq;
u8 mac_addr[ETH_ALEN];
+ int userpd_id;
int irq_num[ATH11K_IRQ_NUM_MAX];
struct ath11k_ext_irq_grp ext_irq_grp[ATH11K_EXT_IRQ_GRP_NUM_MAX];
struct ath11k_targ_cap target_caps;
diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
index d8655badd96d0f4b6946f8af927d878aaa3147ad..89b882bdf08446fd2d429d9a360c90f68c740bdb 100644
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -383,6 +383,7 @@ static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab)
cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
+ ab->qmi.service_ins_id += ab->userpd_id;
ath11k_ce_get_shadow_config(ab, &cfg->shadow_reg_v2,
&cfg->shadow_reg_v2_len);
--
2.51.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/6] wifi: ath11k: add QCN6122 device support
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
` (4 preceding siblings ...)
2025-10-29 14:26 ` [PATCH 5/6] wifi: ath11k: add multipd support " George Moussalem via B4 Relay
@ 2025-10-29 14:26 ` George Moussalem via B4 Relay
5 siblings, 0 replies; 14+ messages in thread
From: George Moussalem via B4 Relay @ 2025-10-29 14:26 UTC (permalink / raw)
To: Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel,
George Moussalem
From: George Moussalem <george.moussalem@outlook.com>
Add support for QCN6122 wifi.
STA, AP, and MESH modes are supported.
Tested on: Linksys MX2000, Linksys MX6200, and GLiNET B3000 access
points for prolonged duration tests spanning multiple days with multiple
clients connected with firmware:
WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Although QCN6122 is a PCIe device, it is an IPQ5018 SoC specific
solution and uses shared IPQ5018/QCN6122 firmware.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
drivers/net/wireless/ath/ath11k/ahb.c | 3 +++
drivers/net/wireless/ath/ath11k/pcic.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 820a383e88caf125892176e421b0121fed7e7055..6747fcdbf9a777d4214b9ef751dac2774a80c0ff 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -37,6 +37,9 @@ static const struct of_device_id ath11k_ahb_of_match[] = {
{ .compatible = "qcom,ipq5018-wifi",
.data = (void *)ATH11K_HW_IPQ5018_HW10,
},
+ { .compatible = "qcom,qcn6122-wifi",
+ .data = (void *)ATH11K_HW_QCN6122_HW10,
+ },
{ }
};
diff --git a/drivers/net/wireless/ath/ath11k/pcic.c b/drivers/net/wireless/ath/ath11k/pcic.c
index fc6e7da05c6028e30facf10d38a55f614067e44b..ac1e156ab3e0f0c47de1eb1ac5afea21addfd739 100644
--- a/drivers/net/wireless/ath/ath11k/pcic.c
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
@@ -139,6 +139,15 @@ static const struct ath11k_msi_config ath11k_msi_config[] = {
},
.hw_rev = ATH11K_HW_QCA6698AQ_HW21,
},
+ {
+ .total_vectors = 13,
+ .total_users = 2,
+ .users = (struct ath11k_msi_user[]) {
+ { .name = "CE", .num_vectors = 5, .base_vector = 0 },
+ { .name = "DP", .num_vectors = 8, .base_vector = 5 },
+ },
+ .hw_rev = ATH11K_HW_QCN6122_HW10,
+ },
};
int ath11k_pcic_init_msi_config(struct ath11k_base *ab)
--
2.51.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] dt: bindings: net: add bindings for QCN6122
2025-10-29 14:26 ` [PATCH 1/6] dt: bindings: net: add bindings " George Moussalem via B4 Relay
@ 2025-10-29 14:32 ` Krzysztof Kozlowski
2025-10-29 14:42 ` Krzysztof Kozlowski
2025-10-29 16:12 ` George Moussalem
0 siblings, 2 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-29 14:32 UTC (permalink / raw)
To: george.moussalem, Johannes Berg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 29/10/2025 15:26, George Moussalem via B4 Relay wrote:
> From: George Moussalem <george.moussalem@outlook.com>
>
> QCN6122 is a PCIe based solution that is attached to and enumerated
> by the WPSS (Wireless Processor SubSystem) Q6 processor.
Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
The prefix is never "dt:".
A nit, subject: drop second/last, redundant "bindings for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>
> Though it is a PCIe device, since it is not attached to APSS processor
> (Application Processor SubSystem), APSS will be unaware of such a decice
> so it is registered to the APSS processor as a platform device(AHB).
> Because of this hybrid nature, it is called as a hybrid bus device as
> introduced by WCN6750. It has 5 CE and 8 DP rings.
>
> QCN6122 is similar to WCN6750 and follows the same codepath as for
> WCN6750.
>
> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
> ---
> .../bindings/net/wireless/qcom,ath11k.yaml | 57 +++++++++++++++++++++-
> 1 file changed, 56 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
> index c089677702cf17f3016b054d21494d2a7706ce5d..4b0b282bb9231c8bc496fed42e0917b9d7d106d2 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
> @@ -21,12 +21,13 @@ properties:
> - qcom,ipq6018-wifi
> - qcom,wcn6750-wifi
> - qcom,ipq5018-wifi
> + - qcom,qcn6122-wifi
Why people keep adding to the end... previously ipq5018 added by
qualcom, did not even get any review.
Place it before wcn and let ipq5018 be outlier since this was broken
already.
>
> reg:
> maxItems: 1
>
> interrupts:
> - minItems: 32
> + minItems: 13
> maxItems: 52
>
> interrupt-names:
> @@ -87,6 +88,14 @@ properties:
> items:
> - const: wlan-smp2p-out
>
> + qcom,userpd:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum: [2, 3]
> + description: instance ID of user PD (protection domain) in multi-PD
> + architectures to distinguish between multiple instances
> + of the same wifi chip used by QMI in its interface with
> + the firmware running on Q6.
Broken indentation. It is supposed to be two spaces. Look at this file -
why are you doing this completely different?
Anyway, please do not come with 2nd or 3rd property for this. We already
have such somewhere.
> +
> required:
> - compatible
> - reg
> @@ -268,6 +277,31 @@ allOf:
> - description: interrupt event for ring DP20
> - description: interrupt event for ring DP21
> - description: interrupt event for ring DP22
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - qcom,qcn6122-wifi
> + then:
> + required:
> + - qcom,userpd
> + properties:
> + interrupts:
> + items:
> + - description: interrupt event for ring CE1
> + - description: interrupt event for ring CE2
> + - description: interrupt event for ring CE3
> + - description: interrupt event for ring CE4
> + - description: interrupt event for ring CE5
> + - description: interrupt event for ring DP1
> + - description: interrupt event for ring DP2
> + - description: interrupt event for ring DP3
> + - description: interrupt event for ring DP4
> + - description: interrupt event for ring DP5
> + - description: interrupt event for ring DP6
> + - description: interrupt event for ring DP7
> + - description: interrupt event for ring DP8
>
> examples:
> - |
> @@ -467,3 +501,24 @@ examples:
> iommus = <&apps_smmu 0x1c02 0x1>;
> };
> };
> +
> + - |
> + wifi1: wifi@b00a040 {
> + reg = <0x0b00a040 0x0>;
> + compatible = "qcom,qcn6122-wifi";
Don't add examples if they differ by one property. Drop.
BR
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] wifi: ath11k: add hw ring mask for QCN6122
2025-10-29 14:26 ` [PATCH 3/6] wifi: ath11k: add hw ring mask " George Moussalem via B4 Relay
@ 2025-10-29 14:33 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-29 14:33 UTC (permalink / raw)
To: george.moussalem, Johannes Berg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 29/10/2025 15:26, George Moussalem via B4 Relay wrote:
> +};
> +
> /* Target firmware's Copy Engine configuration for IPQ5018 */
> const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[] = {
> /* CE0: host->target HTC control and raw streams */
> diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
> index 52d9f4c13b1366f2339b8900cf9db91e6ff1bcff..e7220c46de10c378ea5b452d78f921054ff54e54 100644
> --- a/drivers/net/wireless/ath/ath11k/hw.h
> +++ b/drivers/net/wireless/ath/ath11k/hw.h
> @@ -285,6 +285,7 @@ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
> extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;
> extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074;
> extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_wcn6750;
> +extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn6122;
Why are you breaking the order in every such list? Keep it
alphabetically sorted.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] dt: bindings: net: add bindings for QCN6122
2025-10-29 14:32 ` Krzysztof Kozlowski
@ 2025-10-29 14:42 ` Krzysztof Kozlowski
2025-10-29 16:12 ` George Moussalem
1 sibling, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-29 14:42 UTC (permalink / raw)
To: george.moussalem, Johannes Berg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 29/10/2025 15:32, Krzysztof Kozlowski wrote:
>> interrupt-names:
>> @@ -87,6 +88,14 @@ properties:
>> items:
>> - const: wlan-smp2p-out
>>
>> + qcom,userpd:
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + enum: [2, 3]
>> + description: instance ID of user PD (protection domain) in multi-PD
>> + architectures to distinguish between multiple instances
>> + of the same wifi chip used by QMI in its interface with
>> + the firmware running on Q6.
>
> Broken indentation. It is supposed to be two spaces. Look at this file -
> why are you doing this completely different?
>
> Anyway, please do not come with 2nd or 3rd property for this. We already
> have such somewhere.
And reading the driver code, this is instance ID, so not really suitable
here. Sorry, such are not allowed. See writing bindings or my last OSSE
slides.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 5/6] wifi: ath11k: add multipd support for QCN6122
2025-10-29 14:26 ` [PATCH 5/6] wifi: ath11k: add multipd support " George Moussalem via B4 Relay
@ 2025-10-29 14:43 ` Krzysztof Kozlowski
2025-10-29 17:41 ` George Moussalem
0 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-29 14:43 UTC (permalink / raw)
To: george.moussalem, Johannes Berg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 29/10/2025 15:26, George Moussalem via B4 Relay wrote:
> From: George Moussalem <george.moussalem@outlook.com>
>
> IPQ5018/QCN6122 platforms use multi PD (protection domains) to avoid
> having one instance of the running Q6 firmware crashing resulting in
> crashing the others.
>
> The IPQ5018 platform can have up to two QCN6122 wifi chips.
> To differentiate the two, the PD instance number (1 or 2) is added to
> the QMI service instance ID, which the QCN6122 firmware also expects.
> IPQ5018 internal wifi is always the first PD while QCN6122 cards must be
> second or third.
>
> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
> ---
> See below patch for more info:
> https://lore.kernel.org/all/20231110091939.3025413-1-quic_mmanikan@quicinc.com/
I don't see any common part with that. Your bindings are completely
different and while PD was justified there, there is no such
justification here. Neither in the bindings.
> ---
> drivers/net/wireless/ath/ath11k/ahb.c | 31 +++++++++++++++++++++++++++++++
> drivers/net/wireless/ath/ath11k/core.h | 4 ++++
> drivers/net/wireless/ath/ath11k/pci.c | 1 +
> 3 files changed, 36 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
> index 7b267dd62e964b2c4d6c3bbe016abd1ad0297219..820a383e88caf125892176e421b0121fed7e7055 100644
> --- a/drivers/net/wireless/ath/ath11k/ahb.c
> +++ b/drivers/net/wireless/ath/ath11k/ahb.c
> @@ -429,6 +429,7 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
> cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
> cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
> ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
> + ab->qmi.service_ins_id += ab->userpd_id;
> }
>
> static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
> @@ -1101,6 +1102,28 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab)
> return ret;
> }
>
> +static int ath11k_get_userpd_id(struct device *dev, int *userpd)
> +{
> + int ret, userpd_id;
> +
> + ret = of_property_read_u32(dev->of_node, "qcom,userpd", &userpd_id);
> +
> + if (ret)
> + return ret;
> +
> + switch (userpd_id) {
> + case 2:
> + *userpd = ATH11K_QCN6122_USERPD_2;
> + break;
> + case 3:
> + *userpd = ATH11K_QCN6122_USERPD_3;
> + break;
> + default:
> + return -EINVAL;
> + }
> + return 0;
> +}
> +
> static int ath11k_ahb_fw_resource_deinit(struct ath11k_base *ab)
> {
> struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
> @@ -1142,6 +1165,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
> const struct ath11k_hif_ops *hif_ops;
> const struct ath11k_pci_ops *pci_ops;
> enum ath11k_hw_rev hw_rev;
> + int userpd_id = 0;
> int ret;
>
> hw_rev = (uintptr_t)device_get_match_data(&pdev->dev);
> @@ -1160,6 +1184,12 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
> case ATH11K_HW_QCN6122_HW10:
> hif_ops = &ath11k_ahb_hif_ops_qcn6122;
> pci_ops = &ath11k_ahb_pci_ops_wcn6750;
> + ret = ath11k_get_userpd_id(&pdev->dev, &userpd_id);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to get userpd: %d\n", ret);
> + return ret;
> + }
> + dev_info(&pdev->dev, "multi-pd architecture - userpd: %d\n", userpd_id);
This does not look like useful printk message. Drivers should be silent
on success:
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/coding-style.rst#L913
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/debugging/driver_development_debugging_guide.rst#L79
> break;
> default:
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] dt: bindings: net: add bindings for QCN6122
2025-10-29 14:32 ` Krzysztof Kozlowski
2025-10-29 14:42 ` Krzysztof Kozlowski
@ 2025-10-29 16:12 ` George Moussalem
2025-10-30 5:47 ` Krzysztof Kozlowski
1 sibling, 1 reply; 14+ messages in thread
From: George Moussalem @ 2025-10-29 16:12 UTC (permalink / raw)
To: Krzysztof Kozlowski, Johannes Berg, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 10/29/25 18:32, Krzysztof Kozlowski wrote:
> On 29/10/2025 15:26, George Moussalem via B4 Relay wrote:
>> From: George Moussalem <george.moussalem@outlook.com>
>>
>> QCN6122 is a PCIe based solution that is attached to and enumerated
>> by the WPSS (Wireless Processor SubSystem) Q6 processor.
>
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching. For bindings, the preferred subjects are
> explained here:
> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
>
> The prefix is never "dt:".
>
Will do in next version, thanks.
>
> A nit, subject: drop second/last, redundant "bindings for". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>
Will change accordingly.
>>
>> Though it is a PCIe device, since it is not attached to APSS processor
>> (Application Processor SubSystem), APSS will be unaware of such a decice
>> so it is registered to the APSS processor as a platform device(AHB).
>> Because of this hybrid nature, it is called as a hybrid bus device as
>> introduced by WCN6750. It has 5 CE and 8 DP rings.
>>
>> QCN6122 is similar to WCN6750 and follows the same codepath as for
>> WCN6750.
>>
>> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
>> ---
>> .../bindings/net/wireless/qcom,ath11k.yaml | 57 +++++++++++++++++++++-
>> 1 file changed, 56 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>> index c089677702cf17f3016b054d21494d2a7706ce5d..4b0b282bb9231c8bc496fed42e0917b9d7d106d2 100644
>> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>> @@ -21,12 +21,13 @@ properties:
>> - qcom,ipq6018-wifi
>> - qcom,wcn6750-wifi
>> - qcom,ipq5018-wifi
>> + - qcom,qcn6122-wifi
>
> Why people keep adding to the end... previously ipq5018 added by
> qualcom, did not even get any review.
>
> Place it before wcn and let ipq5018 be outlier since this was broken
> already.
>
it was exactly ipq5018 which got me thinking I should add it to the end.
Will alphabetically insert qcn6122. I could reorder the entire list as
well if you'd like (ipq6018 is also misplaced)
>>
>> reg:
>> maxItems: 1
>>
>> interrupts:
>> - minItems: 32
>> + minItems: 13
>> maxItems: 52
>>
>> interrupt-names:
>> @@ -87,6 +88,14 @@ properties:
>> items:
>> - const: wlan-smp2p-out
>>
>> + qcom,userpd:
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + enum: [2, 3]
>> + description: instance ID of user PD (protection domain) in multi-PD
>> + architectures to distinguish between multiple instances
>> + of the same wifi chip used by QMI in its interface with
>> + the firmware running on Q6.
>
> Broken indentation. It is supposed to be two spaces. Look at this file -
> why are you doing this completely different?
>
> Anyway, please do not come with 2nd or 3rd property for this. We already
> have such somewhere.
Would you mind pointing me to the property you're referring to? Do you
mean the QRTR ID as proposed in this RFC:
https://lore.kernel.org/linux-wireless/cover.1732506261.git.ionic@ionic.de/
if so, this wouldn't help this in this case. Although it's PCIe based,
PCI is not even enabled as the Q6 firmware itself takes care of that.
>
>> +
>> required:
>> - compatible
>> - reg
>> @@ -268,6 +277,31 @@ allOf:
>> - description: interrupt event for ring DP20
>> - description: interrupt event for ring DP21
>> - description: interrupt event for ring DP22
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - qcom,qcn6122-wifi
>> + then:
>> + required:
>> + - qcom,userpd
>> + properties:
>> + interrupts:
>> + items:
>> + - description: interrupt event for ring CE1
>> + - description: interrupt event for ring CE2
>> + - description: interrupt event for ring CE3
>> + - description: interrupt event for ring CE4
>> + - description: interrupt event for ring CE5
>> + - description: interrupt event for ring DP1
>> + - description: interrupt event for ring DP2
>> + - description: interrupt event for ring DP3
>> + - description: interrupt event for ring DP4
>> + - description: interrupt event for ring DP5
>> + - description: interrupt event for ring DP6
>> + - description: interrupt event for ring DP7
>> + - description: interrupt event for ring DP8
>>
>> examples:
>> - |
>> @@ -467,3 +501,24 @@ examples:
>> iommus = <&apps_smmu 0x1c02 0x1>;
>> };
>> };
>> +
>> + - |
>> + wifi1: wifi@b00a040 {
>> + reg = <0x0b00a040 0x0>;
>> + compatible = "qcom,qcn6122-wifi";
>
> Don't add examples if they differ by one property. Drop.
Dropped in next version.
Thanks for the quick review!
>
> BR
>
> Best regards,
> Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 5/6] wifi: ath11k: add multipd support for QCN6122
2025-10-29 14:43 ` Krzysztof Kozlowski
@ 2025-10-29 17:41 ` George Moussalem
0 siblings, 0 replies; 14+ messages in thread
From: George Moussalem @ 2025-10-29 17:41 UTC (permalink / raw)
To: Krzysztof Kozlowski, Johannes Berg, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 10/29/25 18:43, Krzysztof Kozlowski wrote:
> On 29/10/2025 15:26, George Moussalem via B4 Relay wrote:
>> From: George Moussalem <george.moussalem@outlook.com>
>>
>> IPQ5018/QCN6122 platforms use multi PD (protection domains) to avoid
>> having one instance of the running Q6 firmware crashing resulting in
>> crashing the others.
>>
>> The IPQ5018 platform can have up to two QCN6122 wifi chips.
>> To differentiate the two, the PD instance number (1 or 2) is added to
>> the QMI service instance ID, which the QCN6122 firmware also expects.
>> IPQ5018 internal wifi is always the first PD while QCN6122 cards must be
>> second or third.
>>
>> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
>> ---
>> See below patch for more info:
>> https://lore.kernel.org/all/20231110091939.3025413-1-quic_mmanikan@quicinc.com/
>
> I don't see any common part with that. Your bindings are completely
> different and while PD was justified there, there is no such
> justification here. Neither in the bindings.
Will adjust the description in the bindings and add more details. Mind
you that I don't have access to the proprietary designs / data sheets,
so it will be based on my understanding:
The firmware running on the Q6 remote processor takes WCSS - wifi
functionality - out of reset and brings them up. Each wifi radio on the
IPQ5018/QCN6122 platform runs on a separate process (referred to as
protection domain) which avoids one that crashed crashing the others.
The firmware and kernel driver communicate over QMI leveraging the user
PD IDs as instance IDs to distinguish between multiple QCN6122 wifi chips.
With that, would the additional property in the bindings be considered /
accepted? Else, any guidance would be appreciated.
>
>> ---
>> drivers/net/wireless/ath/ath11k/ahb.c | 31 +++++++++++++++++++++++++++++++
>> drivers/net/wireless/ath/ath11k/core.h | 4 ++++
>> drivers/net/wireless/ath/ath11k/pci.c | 1 +
>> 3 files changed, 36 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
>> index 7b267dd62e964b2c4d6c3bbe016abd1ad0297219..820a383e88caf125892176e421b0121fed7e7055 100644
>> --- a/drivers/net/wireless/ath/ath11k/ahb.c
>> +++ b/drivers/net/wireless/ath/ath11k/ahb.c
>> @@ -429,6 +429,7 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
>> cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
>> cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
>> ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
>> + ab->qmi.service_ins_id += ab->userpd_id;
>> }
>>
>> static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
>> @@ -1101,6 +1102,28 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab)
>> return ret;
>> }
>>
>> +static int ath11k_get_userpd_id(struct device *dev, int *userpd)
>> +{
>> + int ret, userpd_id;
>> +
>> + ret = of_property_read_u32(dev->of_node, "qcom,userpd", &userpd_id);
>> +
>> + if (ret)
>> + return ret;
>> +
>> + switch (userpd_id) {
>> + case 2:
>> + *userpd = ATH11K_QCN6122_USERPD_2;
>> + break;
>> + case 3:
>> + *userpd = ATH11K_QCN6122_USERPD_3;
>> + break;
>> + default:
>> + return -EINVAL;
>> + }
>> + return 0;
>> +}
>> +
>> static int ath11k_ahb_fw_resource_deinit(struct ath11k_base *ab)
>> {
>> struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
>> @@ -1142,6 +1165,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
>> const struct ath11k_hif_ops *hif_ops;
>> const struct ath11k_pci_ops *pci_ops;
>> enum ath11k_hw_rev hw_rev;
>> + int userpd_id = 0;
>> int ret;
>>
>> hw_rev = (uintptr_t)device_get_match_data(&pdev->dev);
>> @@ -1160,6 +1184,12 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
>> case ATH11K_HW_QCN6122_HW10:
>> hif_ops = &ath11k_ahb_hif_ops_qcn6122;
>> pci_ops = &ath11k_ahb_pci_ops_wcn6750;
>> + ret = ath11k_get_userpd_id(&pdev->dev, &userpd_id);
>> + if (ret) {
>> + dev_err(&pdev->dev, "failed to get userpd: %d\n", ret);
>> + return ret;
>> + }
>> + dev_info(&pdev->dev, "multi-pd architecture - userpd: %d\n", userpd_id);
>
> This does not look like useful printk message. Drivers should be silent
> on success:
> https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/coding-style.rst#L913
> https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/debugging/driver_development_debugging_guide.rst#L79
>
>> break;
>> default:
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] dt: bindings: net: add bindings for QCN6122
2025-10-29 16:12 ` George Moussalem
@ 2025-10-30 5:47 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-30 5:47 UTC (permalink / raw)
To: George Moussalem, Johannes Berg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jeff Johnson
Cc: linux-wireless, devicetree, ath11k, linux-kernel
On 29/10/2025 17:12, George Moussalem wrote:
>
>
> On 10/29/25 18:32, Krzysztof Kozlowski wrote:
>> On 29/10/2025 15:26, George Moussalem via B4 Relay wrote:
>>> From: George Moussalem <george.moussalem@outlook.com>
>>>
>>> QCN6122 is a PCIe based solution that is attached to and enumerated
>>> by the WPSS (Wireless Processor SubSystem) Q6 processor.
>>
>> Please use subject prefixes matching the subsystem. You can get them for
>> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
>> your patch is touching. For bindings, the preferred subjects are
>> explained here:
>> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
>>
>> The prefix is never "dt:".
>>
> Will do in next version, thanks.
>
>>
>> A nit, subject: drop second/last, redundant "bindings for". The
>> "dt-bindings" prefix is already stating that these are bindings.
>> See also:
>> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>>
>
> Will change accordingly.
>
>>>
>>> Though it is a PCIe device, since it is not attached to APSS processor
>>> (Application Processor SubSystem), APSS will be unaware of such a decice
>>> so it is registered to the APSS processor as a platform device(AHB).
>>> Because of this hybrid nature, it is called as a hybrid bus device as
>>> introduced by WCN6750. It has 5 CE and 8 DP rings.
>>>
>>> QCN6122 is similar to WCN6750 and follows the same codepath as for
>>> WCN6750.
>>>
>>> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
>>> ---
>>> .../bindings/net/wireless/qcom,ath11k.yaml | 57 +++++++++++++++++++++-
>>> 1 file changed, 56 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>>> index c089677702cf17f3016b054d21494d2a7706ce5d..4b0b282bb9231c8bc496fed42e0917b9d7d106d2 100644
>>> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
>>> @@ -21,12 +21,13 @@ properties:
>>> - qcom,ipq6018-wifi
>>> - qcom,wcn6750-wifi
>>> - qcom,ipq5018-wifi
>>> + - qcom,qcn6122-wifi
>>
>> Why people keep adding to the end... previously ipq5018 added by
>> qualcom, did not even get any review.
>>
>> Place it before wcn and let ipq5018 be outlier since this was broken
>> already.
>>
>
> it was exactly ipq5018 which got me thinking I should add it to the end.
> Will alphabetically insert qcn6122. I could reorder the entire list as
> well if you'd like (ipq6018 is also misplaced)
>
>>>
>>> reg:
>>> maxItems: 1
>>>
>>> interrupts:
>>> - minItems: 32
>>> + minItems: 13
>>> maxItems: 52
>>>
>>> interrupt-names:
>>> @@ -87,6 +88,14 @@ properties:
>>> items:
>>> - const: wlan-smp2p-out
>>>
>>> + qcom,userpd:
>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>> + enum: [2, 3]
>>> + description: instance ID of user PD (protection domain) in multi-PD
>>> + architectures to distinguish between multiple instances
>>> + of the same wifi chip used by QMI in its interface with
>>> + the firmware running on Q6.
>>
>> Broken indentation. It is supposed to be two spaces. Look at this file -
>> why are you doing this completely different?
>>
>> Anyway, please do not come with 2nd or 3rd property for this. We already
>> have such somewhere.
>
> Would you mind pointing me to the property you're referring to? Do you
> mean the QRTR ID as proposed in this RFC:
> https://lore.kernel.org/linux-wireless/cover.1732506261.git.ionic@ionic.de/
>
> if so, this wouldn't help this in this case. Although it's PCIe based,
> PCI is not even enabled as the Q6 firmware itself takes care of that.
I expect something covering all cases, so it must cover ipq5332 and
ipq9574 from the other patchset you mentioned:
https://lore.kernel.org/all/20231110091939.3025413-2-quic_mmanikan@quicinc.com/
Same thing cannot be represented in two different ways.
For APR and GPR we already have qcom,protection-domain as a service
name. Linux drivers use it a bit differently than your code here, but
unfortunately I focus on bindings and the binding sounds exactly the same.
Anyway instance ID is not acceptable. Check my slides for possible
workarounds, if you do not know the actual protection domain.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-10-30 5:47 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 14:26 [PATCH 0/6] wifi: ath11k: Add support for QCN6122 George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 1/6] dt: bindings: net: add bindings " George Moussalem via B4 Relay
2025-10-29 14:32 ` Krzysztof Kozlowski
2025-10-29 14:42 ` Krzysztof Kozlowski
2025-10-29 16:12 ` George Moussalem
2025-10-30 5:47 ` Krzysztof Kozlowski
2025-10-29 14:26 ` [PATCH 2/6] wifi: ath11k: add hw params " George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 3/6] wifi: ath11k: add hw ring mask " George Moussalem via B4 Relay
2025-10-29 14:33 ` Krzysztof Kozlowski
2025-10-29 14:26 ` [PATCH 4/6] wifi: ath11k: update hif and pci ops " George Moussalem via B4 Relay
2025-10-29 14:26 ` [PATCH 5/6] wifi: ath11k: add multipd support " George Moussalem via B4 Relay
2025-10-29 14:43 ` Krzysztof Kozlowski
2025-10-29 17:41 ` George Moussalem
2025-10-29 14:26 ` [PATCH 6/6] wifi: ath11k: add QCN6122 device support George Moussalem via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).