public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device
@ 2025-01-30  5:18 Raj Kumar Bhagat
  2025-01-30  5:18 ` [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424 Raj Kumar Bhagat
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-01-30  5:18 UTC (permalink / raw)
  To: ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel,
	Raj Kumar Bhagat

Add support for the new ath12k AHB device IPQ5424, as currently, Ath12k
AHB only supports IPQ5332 WiFi devices.

The IPQ5424 is an IEEE 802.11be 2 GHz WiFi device, supporting 4x4
configurations. To enable the IPQ5424 device:
- Add the necessary hardware parameters for IPQ5424.
- Modify the boot-up sequence for ath12k AHB to accommodate the
  requirements of the IPQ5424 device.

Depends-On: [PATCH v5 00/13] wifi: ath12k: add Ath12k AHB driver support for IPQ5332
Link: https://lore.kernel.org/all/20250130043508.1885026-1-quic_rajkbhag@quicinc.com/

Raj Kumar Bhagat (1):
  dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424

Saravanakumar Duraisamy (3):
  wifi: ath12k: Add ath12k_hw_params for IPQ5424
  wifi: ath12k: add ath12k_hw_regs for IPQ5424
  wifi: ath12k: Add CE remap hardware parameters for IPQ5424

Sowmiya Sree Elavalagan (1):
  wifi: ath12k: Enable IPQ5424 WiFi device support

 .../net/wireless/qcom,ath12k-ahb.yaml         | 119 ++++++++++++
 drivers/net/wireless/ath/ath12k/ahb.c         |  82 +++++---
 drivers/net/wireless/ath/ath12k/ahb.h         |   9 +
 drivers/net/wireless/ath/ath12k/ce.h          |  13 +-
 drivers/net/wireless/ath/ath12k/core.h        |   1 +
 drivers/net/wireless/ath/ath12k/hal.h         |   3 +
 drivers/net/wireless/ath/ath12k/hw.c          | 178 +++++++++++++++++-
 7 files changed, 369 insertions(+), 36 deletions(-)


base-commit: a10b8b584b8bcb7559f068ce247fc27d0c4850ca
prerequisite-patch-id: f80453350a37c9910405b6689cd6d64657186034
prerequisite-patch-id: a505f82268ec8f6502e49a9170b984fb618a6205
prerequisite-patch-id: 4bb8e397fa2a3d0db778a6a59142093b0aa9a93f
prerequisite-patch-id: aa840ba06263db886c7bb245b5a67391f22a4e17
prerequisite-patch-id: 158aa0efa9976ce0fcb42cb469f8397e8346002f
prerequisite-patch-id: 3fe11b0b9b5674d6cabe50b5db567a3ba83455a7
prerequisite-patch-id: 2740fccb97bc936614e99d17b2fc7bf6bb69d466
prerequisite-patch-id: 9b547828dabf6ed0fe18bb3cbb2ccf1fab342f17
prerequisite-patch-id: 8e9198573ddf090cec36adabc22ed9596ecef93e
prerequisite-patch-id: 9b8b2be5bd9496f9d4374d8aacfc0c9cbe94f318
prerequisite-patch-id: 70b7506b99f65b6be7407ebd43198cfda91264fe
prerequisite-patch-id: 7991ff8ab03c0a8287efdb9e54a808b4c6a93c61
prerequisite-patch-id: 90f0ff045d14b9962f94d98f8b6670602fc77b52
-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424
  2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
@ 2025-01-30  5:18 ` Raj Kumar Bhagat
  2025-01-30 18:50   ` Conor Dooley
  2025-01-30  5:18 ` [RFC PATCH 2/5] wifi: ath12k: Add ath12k_hw_params for IPQ5424 Raj Kumar Bhagat
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-01-30  5:18 UTC (permalink / raw)
  To: ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel,
	Raj Kumar Bhagat

Describe and add the device-tree bindings for the ATH12K AHB wifi device
IPQ5424.

Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
 .../net/wireless/qcom,ath12k-ahb.yaml         | 119 ++++++++++++++++++
 1 file changed, 119 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
index bd953a028dc3..1d24389a0ab3 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
@@ -18,6 +18,7 @@ properties:
   compatible:
     enum:
       - qcom,ipq5332-wifi
+      - qcom,ipq5424-wifi
 
   reg:
     maxItems: 1
@@ -317,3 +318,121 @@ examples:
                                 "stop",
                                 "spawn";
     };
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    wifi1: wifi@c000000 {
+        compatible = "qcom,ipq5424-wifi";
+        reg = <0x0c000000 0x1000000>;
+        clocks = <&gcc GCC_XO_CLK_SRC>;
+        clock-names = "xo";
+        interrupts-extended = <&wcss_smp2p_in 8 IRQ_TYPE_NONE>,
+                              <&wcss_smp2p_in 9 IRQ_TYPE_NONE>,
+                              <&wcss_smp2p_in 12 IRQ_TYPE_NONE>,
+                              <&wcss_smp2p_in 11 IRQ_TYPE_NONE>,
+                              <&intc GIC_SPI 559 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 560 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 561 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 518 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 519 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 520 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 521 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 522 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 523 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 524 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 525 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 526 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 527 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 528 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 529 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 574 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 576 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 627 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 540 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 549 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 580 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 537 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 536 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 535 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 534 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 571 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 571 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 567 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 637 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 637 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 632 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 590 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 583 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 582 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 581 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 533 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 532 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 531 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 530 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 626 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 569 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 569 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 565 IRQ_TYPE_EDGE_RISING>,
+                              <&intc GIC_SPI 502 IRQ_TYPE_EDGE_RISING>;
+        interrupt-names = "fatal",
+                          "ready",
+                          "spawn",
+                          "stop-ack",
+                          "misc-pulse1",
+                          "misc-latch",
+                          "sw-exception",
+                          "ce0",
+                          "ce1",
+                          "ce2",
+                          "ce3",
+                          "ce4",
+                          "ce5",
+                          "ce6",
+                          "ce7",
+                          "ce8",
+                          "ce9",
+                          "ce10",
+                          "ce11",
+                          "host2wbm-desc-feed",
+                          "host2reo-re-injection",
+                          "host2reo-command",
+                          "host2rxdma-monitor-ring1",
+                          "reo2ost-exception",
+                          "wbm2host-rx-release",
+                          "reo2host-status",
+                          "reo2host-destination-ring4",
+                          "reo2host-destination-ring3",
+                          "reo2host-destination-ring2",
+                          "reo2host-destination-ring1",
+                          "rxdma2host-monitor-destination-mac3",
+                          "rxdma2host-monitor-destination-mac2",
+                          "rxdma2host-monitor-destination-mac1",
+                          "host2rxdma-host-buf-ring-mac3",
+                          "host2rxdma-host-buf-ring-mac2",
+                          "host2rxdma-host-buf-ring-mac1",
+                          "host2tcl-input-ring4",
+                          "host2tcl-input-ring3",
+                          "host2tcl-input-ring2",
+                          "host2tcl-input-ring1",
+                          "wbm2host-tx-completions-ring4",
+                          "wbm2host-tx-completions-ring3",
+                          "wbm2host-tx-completions-ring2",
+                          "wbm2host-tx-completions-ring1",
+                          "host2tx-monitor-ring1",
+                          "txmon2host-monitor-destination-mac3",
+                          "txmon2host-monitor-destination-mac2",
+                          "txmon2host-monitor-destination-mac1",
+                          "umac-reset";
+
+        memory-region = <&q6_region>, <&m3_dump>, <&q6_caldb>, <&mlo_mem>;
+        memory-region-names = "q6-region", "m3-dump", "q6-caldb", "mlo-global-mem";
+        qcom,ath12k-calibration-variant = "RDP466_1";
+        qcom,rproc = <&q6v5_wcss>;
+        qcom,smem-states = <&wcss_smp2p_out 8>,
+                           <&wcss_smp2p_out 9>,
+                           <&wcss_smp2p_out 10>;
+        qcom,smem-state-names = "shutdown",
+                                "stop",
+                                "spawn";
+    };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [RFC PATCH 2/5] wifi: ath12k: Add ath12k_hw_params for IPQ5424
  2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
  2025-01-30  5:18 ` [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424 Raj Kumar Bhagat
@ 2025-01-30  5:18 ` Raj Kumar Bhagat
  2025-01-30  5:18 ` [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs " Raj Kumar Bhagat
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-01-30  5:18 UTC (permalink / raw)
  To: ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel,
	Saravanakumar Duraisamy, Raj Kumar Bhagat

From: Saravanakumar Duraisamy <quic_saradura@quicinc.com>

Add ath12k_hw_params for the new ath12k AHB-based WiFi device IPQ5424.
The WiFi device IPQ5424 is similar to IPQ5332. Most of the hardware
parameters like hw_ops, wmi_init, hal_ops, etc., are the same between
IPQ5424 and IPQ5332, hence use these same parameters for IPQ5424.
Some parameters are specific to IPQ5424; initially set these to
0 or NULL, and populate them in subsequent patches.

Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1

Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/core.h |  1 +
 drivers/net/wireless/ath/ath12k/hw.c   | 76 ++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 297e01d191ab..13db19dc50cd 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -150,6 +150,7 @@ enum ath12k_hw_rev {
 	ATH12K_HW_QCN9274_HW20,
 	ATH12K_HW_WCN7850_HW20,
 	ATH12K_HW_IPQ5332_HW10,
+	ATH12K_HW_IPQ5424_HW10,
 };
 
 enum ath12k_firmware_mode {
diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index b4d5651973b7..b8021dc3ba01 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -1566,6 +1566,82 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.ce_remap = &ath12k_ce_remap_ipq5332,
 		.bdf_addr_offset = 0xC00000,
 	},
+	{
+		.name = "ipq5424 hw1.0",
+		.hw_rev = ATH12K_HW_IPQ5424_HW10,
+		.fw = {
+			.dir = "IPQ5424/hw1.0",
+			.board_size = 256 * 1024,
+			.cal_offset = 128 * 1024,
+			.m3_loader = ath12k_m3_fw_loader_remoteproc,
+		},
+		.max_radios = 1,
+		.single_pdev_only = false,
+		.qmi_service_ins_id = ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ5332,
+		.internal_sleep_clock = false,
+
+		.hw_ops = &qcn9274_ops,
+		.regs = NULL,
+		.ring_mask = &ath12k_hw_ring_mask_ipq5332,
+
+		.host_ce_config = ath12k_host_ce_config_ipq5332,
+		.ce_count = 12,
+		.target_ce_config = ath12k_target_ce_config_wlan_ipq5332,
+		.target_ce_count = 12,
+		.svc_to_ce_map = ath12k_target_service_to_ce_map_wlan_ipq5332,
+		.svc_to_ce_map_len = 18,
+
+		.hal_params = &ath12k_hw_hal_params_ipq5332,
+
+		.rxdma1_enable = false,
+		.num_rxdma_per_pdev = 1,
+		.num_rxdma_dst_ring = 0,
+		.rx_mac_buf_ring = false,
+		.vdev_start_delay = false,
+
+		.interface_modes = BIT(NL80211_IFTYPE_STATION) |
+					BIT(NL80211_IFTYPE_AP) |
+					BIT(NL80211_IFTYPE_MESH_POINT),
+		.supports_monitor = false,
+
+		.idle_ps = false,
+		.download_calib = true,
+		.supports_suspend = false,
+		.tcl_ring_retry = true,
+		.reoq_lut_support = false,
+		.supports_shadow_regs = false,
+
+		.num_tcl_banks = 48,
+		.max_tx_ring = 4,
+
+		.wmi_init = &ath12k_wmi_init_qcn9274,
+
+		.hal_ops = &hal_qcn9274_ops,
+
+		.qmi_cnss_feature_bitmap = BIT(CNSS_QDSS_CFG_MISS_V01),
+
+		.rfkill_pin = 0,
+		.rfkill_cfg = 0,
+		.rfkill_on_level = 0,
+
+		.rddm_size = 0,
+
+		.def_num_link = 0,
+		.max_mlo_peer = 256,
+
+		.otp_board_id_register = 0,
+
+		.supports_sta_ps = false,
+
+		.acpi_guid = NULL,
+		.supports_dynamic_smps_6ghz = false,
+		.iova_mask = 0,
+		.supports_aspm = false,
+
+		.ce_ie_addr = NULL,
+		.ce_remap = NULL,
+		.bdf_addr_offset = 0x940000,
+	},
 };
 
 int ath12k_hw_init(struct ath12k_base *ab)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs for IPQ5424
  2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
  2025-01-30  5:18 ` [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424 Raj Kumar Bhagat
  2025-01-30  5:18 ` [RFC PATCH 2/5] wifi: ath12k: Add ath12k_hw_params for IPQ5424 Raj Kumar Bhagat
@ 2025-01-30  5:18 ` Raj Kumar Bhagat
  2025-01-30  8:38   ` Krzysztof Kozlowski
  2025-01-30  5:18 ` [RFC PATCH 4/5] wifi: ath12k: Add CE remap hardware parameters " Raj Kumar Bhagat
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-01-30  5:18 UTC (permalink / raw)
  To: ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel,
	Saravanakumar Duraisamy, Raj Kumar Bhagat

From: Saravanakumar Duraisamy <quic_saradura@quicinc.com>

Add register addresses (ath12k_hw_regs) for new ath12k AHB based
WiFi device IPQ5424.

Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1

Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/hal.h |  3 +
 drivers/net/wireless/ath/ath12k/hw.c  | 87 ++++++++++++++++++++++++++-
 2 files changed, 89 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/hal.h b/drivers/net/wireless/ath/ath12k/hal.h
index 9f12ed84a653..8e6c98860c46 100644
--- a/drivers/net/wireless/ath/ath12k/hal.h
+++ b/drivers/net/wireless/ath/ath12k/hal.h
@@ -377,6 +377,9 @@ struct ath12k_base;
 #define HAL_IPQ5332_CE_WFSS_REG_BASE	0x740000
 #define HAL_IPQ5332_CE_SIZE		0x100000
 
+#define HAL_IPQ5424_CE_WFSS_REG_BASE	0x200000
+#define HAL_IPQ5424_CE_SIZE		0x100000
+
 enum hal_srng_ring_id {
 	HAL_SRNG_RING_ID_REO2SW0 = 0,
 	HAL_SRNG_RING_ID_REO2SW1,
diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index b8021dc3ba01..7ee21a03fcac 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -1120,6 +1120,91 @@ static const struct ath12k_hw_regs ipq5332_regs = {
 		HAL_IPQ5332_CE_WFSS_REG_BASE,
 };
 
+static const struct ath12k_hw_regs ipq5424_regs = {
+	/* SW2TCL(x) R0 ring configuration address */
+	.hal_tcl1_ring_id = 0x00000918,
+	.hal_tcl1_ring_misc = 0x00000920,
+	.hal_tcl1_ring_tp_addr_lsb = 0x0000092c,
+	.hal_tcl1_ring_tp_addr_msb = 0x00000930,
+	.hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000940,
+	.hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000944,
+	.hal_tcl1_ring_msi1_base_lsb = 0x00000958,
+	.hal_tcl1_ring_msi1_base_msb = 0x0000095c,
+	.hal_tcl1_ring_base_lsb = 0x00000910,
+	.hal_tcl1_ring_base_msb = 0x00000914,
+	.hal_tcl1_ring_msi1_data = 0x00000960,
+	.hal_tcl2_ring_base_lsb = 0x00000988,
+	.hal_tcl_ring_base_lsb = 0x00000b68,
+
+	/* TCL STATUS ring address */
+	.hal_tcl_status_ring_base_lsb = 0x00000d48,
+
+	/* REO DEST ring address */
+	.hal_reo2_ring_base = 0x00000578,
+	.hal_reo1_misc_ctrl_addr = 0x00000b9c,
+	.hal_reo1_sw_cookie_cfg0 = 0x0000006c,
+	.hal_reo1_sw_cookie_cfg1 = 0x00000070,
+	.hal_reo1_qdesc_lut_base0 = 0x00000074,
+	.hal_reo1_qdesc_lut_base1 = 0x00000078,
+	.hal_reo1_ring_base_lsb = 0x00000500,
+	.hal_reo1_ring_base_msb = 0x00000504,
+	.hal_reo1_ring_id = 0x00000508,
+	.hal_reo1_ring_misc = 0x00000510,
+	.hal_reo1_ring_hp_addr_lsb = 0x00000514,
+	.hal_reo1_ring_hp_addr_msb = 0x00000518,
+	.hal_reo1_ring_producer_int_setup = 0x00000524,
+	.hal_reo1_ring_msi1_base_lsb = 0x00000548,
+	.hal_reo1_ring_msi1_base_msb = 0x0000054C,
+	.hal_reo1_ring_msi1_data = 0x00000550,
+	.hal_reo1_aging_thres_ix0 = 0x00000B28,
+	.hal_reo1_aging_thres_ix1 = 0x00000B2C,
+	.hal_reo1_aging_thres_ix2 = 0x00000B30,
+	.hal_reo1_aging_thres_ix3 = 0x00000B34,
+
+	/* REO Exception ring address */
+	.hal_reo2_sw0_ring_base = 0x000008c0,
+
+	/* REO Reinject ring address */
+	.hal_sw2reo_ring_base = 0x00000320,
+	.hal_sw2reo1_ring_base = 0x00000398,
+
+	/* REO cmd ring address */
+	.hal_reo_cmd_ring_base = 0x000002A8,
+
+	/* REO status ring address */
+	.hal_reo_status_ring_base = 0x00000aa0,
+
+	/* WBM idle link ring address */
+	.hal_wbm_idle_ring_base_lsb = 0x00000d3c,
+	.hal_wbm_idle_ring_misc_addr = 0x00000d4c,
+	.hal_wbm_r0_idle_list_cntl_addr = 0x00000240,
+	.hal_wbm_r0_idle_list_size_addr = 0x00000244,
+	.hal_wbm_scattered_ring_base_lsb = 0x00000250,
+	.hal_wbm_scattered_ring_base_msb = 0x00000254,
+	.hal_wbm_scattered_desc_head_info_ix0 = 0x00000260,
+	.hal_wbm_scattered_desc_head_info_ix1	= 0x00000264,
+	.hal_wbm_scattered_desc_tail_info_ix0 = 0x00000270,
+	.hal_wbm_scattered_desc_tail_info_ix1 = 0x00000274,
+	.hal_wbm_scattered_desc_ptr_hp_addr = 0x0000027c,
+
+	/* SW2WBM release ring address */
+	.hal_wbm_sw_release_ring_base_lsb = 0x0000037c,
+
+	/* WBM2SW release ring address */
+	.hal_wbm0_release_ring_base_lsb = 0x00000e08,
+	.hal_wbm1_release_ring_base_lsb = 0x00000e80,
+
+	/* CE relative address */
+	.hal_umac_ce0_src_reg_base = 0x00200000 -
+		HAL_IPQ5424_CE_WFSS_REG_BASE,
+	.hal_umac_ce0_dest_reg_base = 0x00201000 -
+		HAL_IPQ5424_CE_WFSS_REG_BASE,
+	.hal_umac_ce1_src_reg_base = 0x00202000 -
+		HAL_IPQ5424_CE_WFSS_REG_BASE,
+	.hal_umac_ce1_dest_reg_base = 0x00203000 -
+		HAL_IPQ5424_CE_WFSS_REG_BASE,
+};
+
 static const struct ath12k_hw_regs wcn7850_regs = {
 	/* SW2TCL(x) R0 ring configuration address */
 	.hal_tcl1_ring_id = 0x00000908,
@@ -1581,7 +1666,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.internal_sleep_clock = false,
 
 		.hw_ops = &qcn9274_ops,
-		.regs = NULL,
+		.regs = &ipq5424_regs,
 		.ring_mask = &ath12k_hw_ring_mask_ipq5332,
 
 		.host_ce_config = ath12k_host_ce_config_ipq5332,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [RFC PATCH 4/5] wifi: ath12k: Add CE remap hardware parameters for IPQ5424
  2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
                   ` (2 preceding siblings ...)
  2025-01-30  5:18 ` [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs " Raj Kumar Bhagat
@ 2025-01-30  5:18 ` Raj Kumar Bhagat
  2025-01-30  5:18 ` [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support Raj Kumar Bhagat
  2025-01-30  7:37 ` [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Krzysztof Kozlowski
  5 siblings, 0 replies; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-01-30  5:18 UTC (permalink / raw)
  To: ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel,
	Saravanakumar Duraisamy, Raj Kumar Bhagat

From: Saravanakumar Duraisamy <quic_saradura@quicinc.com>

Add CE remap hardware parameters for new Ath12k AHB device IPQ5424.

Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1

Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/ahb.c |  2 +-
 drivers/net/wireless/ath/ath12k/ce.h  | 13 +++++++++----
 drivers/net/wireless/ath/ath12k/hw.c  | 21 ++++++++++++++++-----
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
index 0dbee14fbe90..d502b59a78d8 100644
--- a/drivers/net/wireless/ath/ath12k/ahb.c
+++ b/drivers/net/wireless/ath/ath12k/ahb.c
@@ -977,7 +977,7 @@ static int ath12k_ahb_resource_init(struct ath12k_base *ab)
 			goto err_mem_unmap;
 		}
 		ab->ce_remap = true;
-		ab->ce_remap_base_addr = HAL_IPQ5332_CE_WFSS_REG_BASE;
+		ab->ce_remap_base_addr = ce_remap->base;
 	}
 
 	ret = ath12k_ahb_clock_init(ab);
diff --git a/drivers/net/wireless/ath/ath12k/ce.h b/drivers/net/wireless/ath/ath12k/ce.h
index 57f75899ee03..3ac7f28d2c92 100644
--- a/drivers/net/wireless/ath/ath12k/ce.h
+++ b/drivers/net/wireless/ath/ath12k/ce.h
@@ -38,10 +38,15 @@
 #define PIPEDIR_INOUT		3 /* bidirectional */
 #define PIPEDIR_INOUT_H2H	4 /* bidirectional, host to host */
 
-/* CE address/mask */
-#define CE_HOST_IE_ADDRESS	0x75804C
-#define CE_HOST_IE_2_ADDRESS	0x758050
-#define CE_HOST_IE_3_ADDRESS	CE_HOST_IE_ADDRESS
+/* IPQ5332 CE address/mask */
+#define CE_HOST_IPQ5332_IE_ADDRESS	0x75804C
+#define CE_HOST_IPQ5332_IE_2_ADDRESS	0x758050
+#define CE_HOST_IPQ5332_IE_3_ADDRESS	CE_HOST_IPQ5332_IE_ADDRESS
+
+/* IPQ5424 CE address/mask */
+#define CE_HOST_IPQ5424_IE_ADDRESS	0x21804C
+#define CE_HOST_IPQ5424_IE_2_ADDRESS	0x218050
+#define CE_HOST_IPQ5424_IE_3_ADDRESS	CE_HOST_IPQ5424_IE_ADDRESS
 
 #define CE_HOST_IE_3_SHIFT	0xC
 
diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index 7ee21a03fcac..00da2d5a0378 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -1317,9 +1317,15 @@ static const struct ath12k_hw_hal_params ath12k_hw_hal_params_ipq5332 = {
 };
 
 static const struct ce_ie_addr ath12k_ce_ie_addr_ipq5332 = {
-	.ie1_reg_addr = CE_HOST_IE_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
-	.ie2_reg_addr = CE_HOST_IE_2_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
-	.ie3_reg_addr = CE_HOST_IE_3_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
+	.ie1_reg_addr = CE_HOST_IPQ5332_IE_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
+	.ie2_reg_addr = CE_HOST_IPQ5332_IE_2_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
+	.ie3_reg_addr = CE_HOST_IPQ5332_IE_3_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
+};
+
+static const struct ce_ie_addr ath12k_ce_ie_addr_ipq5424 = {
+	.ie1_reg_addr = CE_HOST_IPQ5424_IE_ADDRESS - HAL_IPQ5424_CE_WFSS_REG_BASE,
+	.ie2_reg_addr = CE_HOST_IPQ5424_IE_2_ADDRESS - HAL_IPQ5424_CE_WFSS_REG_BASE,
+	.ie3_reg_addr = CE_HOST_IPQ5424_IE_3_ADDRESS - HAL_IPQ5424_CE_WFSS_REG_BASE,
 };
 
 static const struct ce_remap ath12k_ce_remap_ipq5332 = {
@@ -1327,6 +1333,11 @@ static const struct ce_remap ath12k_ce_remap_ipq5332 = {
 	.size = HAL_IPQ5332_CE_SIZE,
 };
 
+static const struct ce_remap ath12k_ce_remap_ipq5424 = {
+	.base = HAL_IPQ5424_CE_WFSS_REG_BASE,
+	.size = HAL_IPQ5424_CE_SIZE,
+};
+
 static const struct ath12k_hw_params ath12k_hw_params[] = {
 	{
 		.name = "qcn9274 hw1.0",
@@ -1723,8 +1734,8 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.iova_mask = 0,
 		.supports_aspm = false,
 
-		.ce_ie_addr = NULL,
-		.ce_remap = NULL,
+		.ce_ie_addr = &ath12k_ce_ie_addr_ipq5424,
+		.ce_remap = &ath12k_ce_remap_ipq5424,
 		.bdf_addr_offset = 0x940000,
 	},
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support
  2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
                   ` (3 preceding siblings ...)
  2025-01-30  5:18 ` [RFC PATCH 4/5] wifi: ath12k: Add CE remap hardware parameters " Raj Kumar Bhagat
@ 2025-01-30  5:18 ` Raj Kumar Bhagat
  2025-01-30  8:39   ` Krzysztof Kozlowski
  2025-01-30  7:37 ` [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Krzysztof Kozlowski
  5 siblings, 1 reply; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-01-30  5:18 UTC (permalink / raw)
  To: ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel,
	Sowmiya Sree Elavalagan, Saravanakumar Duraisamy,
	Raj Kumar Bhagat

From: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>

Currently, ath12k AHB (in IPQ5332) uses SCM calls to authenticate the
firmware image to bring up userpd. From IPQ5424 onwards, Q6 firmware can
directly communicate with the Trusted Management Engine - Lite (TME-L),
eliminating the need for SCM calls for userpd bring-up.

Hence, to enable IPQ5424 device support, use qcom_mdt_load_no_init() and
skip the SCM call as Q6 will directly authenticate the userpd firmware.

Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
Co-developed-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/ahb.c | 80 +++++++++++++++++----------
 drivers/net/wireless/ath/ath12k/ahb.h |  9 +++
 2 files changed, 61 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
index d502b59a78d8..75767915dec3 100644
--- a/drivers/net/wireless/ath/ath12k/ahb.c
+++ b/drivers/net/wireless/ath/ath12k/ahb.c
@@ -21,6 +21,9 @@ static const struct of_device_id ath12k_ahb_of_match[] = {
 	{ .compatible = "qcom,ipq5332-wifi",
 	  .data = (void *)ATH12K_HW_IPQ5332_HW10,
 	},
+	{ .compatible = "qcom,ipq5424-wifi",
+	  .data = (void *)ATH12K_HW_IPQ5424_HW10,
+	},
 	{ }
 };
 
@@ -398,8 +401,8 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
 		ATH12K_AHB_UPD_SWID;
 
 	/* Load FW image to a reserved memory location */
-	ret = qcom_mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys, mem_size,
-			    &mem_phys);
+	ret = ab_ahb->ahb_ops->mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys,
+					mem_size, &mem_phys);
 	if (ret) {
 		ath12k_err(ab, "Failed to load MDT segments: %d\n", ret);
 		goto err_fw;
@@ -430,11 +433,13 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
 		goto err_fw2;
 	}
 
-	/* Authenticate FW image using peripheral ID */
-	ret = qcom_scm_pas_auth_and_reset(pasid);
-	if (ret) {
-		ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
-		goto err_fw2;
+	if (ab_ahb->scm_auth_enabled) {
+		/* Authenticate FW image using peripheral ID */
+		ret = qcom_scm_pas_auth_and_reset(pasid);
+		if (ret) {
+			ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
+			goto err_fw2;
+		}
 	}
 
 	/* Instruct Q6 to spawn userPD thread */
@@ -491,13 +496,15 @@ static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend)
 
 	qcom_smem_state_update_bits(ab_ahb->stop_state, BIT(ab_ahb->stop_bit), 0);
 
-	pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
-		ATH12K_AHB_UPD_SWID;
-	/* Release the firmware */
-	ret = qcom_scm_pas_shutdown(pasid);
-	if (ret)
-		ath12k_err(ab, "scm pas shutdown failed for userPD%d: %d\n",
-			   ab_ahb->userpd_id, ret);
+	if (ab_ahb->scm_auth_enabled) {
+		pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
+			 ATH12K_AHB_UPD_SWID;
+		/* Release the firmware */
+		ret = qcom_scm_pas_shutdown(pasid);
+		if (ret)
+			ath12k_err(ab, "scm pas shutdown failed for userPD%d\n",
+				   ab_ahb->userpd_id);
+	}
 }
 
 static void ath12k_ahb_init_qmi_ce_config(struct ath12k_base *ab)
@@ -707,6 +714,14 @@ static int ath12k_ahb_map_service_to_pipe(struct ath12k_base *ab, u16 service_id
 	return 0;
 }
 
+static const struct ath12k_ahb_ops ahb_ops_ipq5332 = {
+	.mdt_load = qcom_mdt_load,
+};
+
+static const struct ath12k_ahb_ops ahb_ops_ipq5424 = {
+	.mdt_load = qcom_mdt_load_no_init,
+};
+
 static const struct ath12k_hif_ops ath12k_ahb_hif_ops_ipq5332 = {
 	.start = ath12k_ahb_start,
 	.stop = ath12k_ahb_stop,
@@ -1041,19 +1056,9 @@ static int ath12k_ahb_probe(struct platform_device *pdev)
 	struct device_node *mem_node;
 	struct ath12k_ahb *ab_ahb;
 	enum ath12k_hw_rev hw_rev;
-	u32 addr, userpd_id;
+	u32 addr;
 	int ret;
 
-	hw_rev = ath12k_ahb_get_hw_rev(pdev);
-	switch (hw_rev) {
-	case ATH12K_HW_IPQ5332_HW10:
-		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
-		userpd_id = ATH12K_IPQ5332_USERPD_ID;
-		break;
-	default:
-		return -EOPNOTSUPP;
-	}
-
 	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to set 32-bit coherent dma\n");
@@ -1067,13 +1072,32 @@ static int ath12k_ahb_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
+	ab_ahb = ath12k_ab_to_ahb(ab);
+	ab_ahb->ab = ab;
+
+	hw_rev = ath12k_ahb_get_hw_rev(pdev);
+	switch (hw_rev) {
+	case ATH12K_HW_IPQ5332_HW10:
+		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
+		ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
+		ab_ahb->scm_auth_enabled = true;
+		ab_ahb->ahb_ops = &ahb_ops_ipq5332;
+		break;
+	case ATH12K_HW_IPQ5424_HW10:
+		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
+		ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
+		ab_ahb->scm_auth_enabled = false;
+		ab_ahb->ahb_ops = &ahb_ops_ipq5424;
+		break;
+	default:
+		ret = -EOPNOTSUPP;
+		goto err_core_free;
+	}
+
 	ab->hif.ops = hif_ops;
 	ab->pdev = pdev;
 	ab->hw_rev = hw_rev;
 	platform_set_drvdata(pdev, ab);
-	ab_ahb = ath12k_ab_to_ahb(ab);
-	ab_ahb->ab = ab;
-	ab_ahb->userpd_id = userpd_id;
 
 	/* Set fixed_mem_region to true for platforms that support fixed memory
 	 * reservation from DT. If memory is reserved from DT for FW, ath12k driver
diff --git a/drivers/net/wireless/ath/ath12k/ahb.h b/drivers/net/wireless/ath/ath12k/ahb.h
index d56244b20a6a..270d6db2a4a4 100644
--- a/drivers/net/wireless/ath/ath12k/ahb.h
+++ b/drivers/net/wireless/ath/ath12k/ahb.h
@@ -43,6 +43,13 @@ enum ath12k_ahb_userpd_irq {
 
 struct ath12k_base;
 
+struct ath12k_ahb_ops {
+	int (*mdt_load)(struct device *dev, const struct firmware *fw,
+			const char *firmware, int pas_id, void *mem_region,
+			phys_addr_t mem_phys, size_t mem_size,
+			phys_addr_t *reloc_base);
+};
+
 struct ath12k_ahb {
 	struct ath12k_base *ab;
 	struct rproc *tgt_rproc;
@@ -59,6 +66,8 @@ struct ath12k_ahb {
 	u32 spawn_bit;
 	u32 stop_bit;
 	int userpd_irq_num[ATH12K_USERPD_MAX_IRQ];
+	bool scm_auth_enabled;
+	const struct ath12k_ahb_ops *ahb_ops;
 };
 
 static inline struct ath12k_ahb *ath12k_ab_to_ahb(struct ath12k_base *ab)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device
  2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
                   ` (4 preceding siblings ...)
  2025-01-30  5:18 ` [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support Raj Kumar Bhagat
@ 2025-01-30  7:37 ` Krzysztof Kozlowski
  2025-02-26 18:10   ` Raj Kumar Bhagat
  5 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-30  7:37 UTC (permalink / raw)
  To: Raj Kumar Bhagat, ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel

On 30/01/2025 06:18, Raj Kumar Bhagat wrote:
> Add support for the new ath12k AHB device IPQ5424, as currently, Ath12k
> AHB only supports IPQ5332 WiFi devices.
> 
> The IPQ5424 is an IEEE 802.11be 2 GHz WiFi device, supporting 4x4
> configurations. To enable the IPQ5424 device:
> - Add the necessary hardware parameters for IPQ5424.
> - Modify the boot-up sequence for ath12k AHB to accommodate the
>   requirements of the IPQ5424 device.
> 
> Depends-On: [PATCH v5 00/13] wifi: ath12k: add Ath12k AHB driver support for IPQ5332
> Link: https://lore.kernel.org/all/20250130043508.1885026-1-quic_rajkbhag@quicinc.com/
> 
You marked this a RFC, so this is not ready, but nothing explains this
here. What sort of comments are you looking for? What's incomplete with
this work?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs for IPQ5424
  2025-01-30  5:18 ` [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs " Raj Kumar Bhagat
@ 2025-01-30  8:38   ` Krzysztof Kozlowski
  2025-01-30 19:03     ` Jeff Johnson
  0 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-30  8:38 UTC (permalink / raw)
  To: Raj Kumar Bhagat
  Cc: ath12k, linux-wireless, Kalle Valo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jeff Johnson, devicetree,
	linux-kernel, Saravanakumar Duraisamy

On Thu, Jan 30, 2025 at 10:48:36AM +0530, Raj Kumar Bhagat wrote:
> From: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
> 
> Add register addresses (ath12k_hw_regs) for new ath12k AHB based
> WiFi device IPQ5424.
> 
> Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
> Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
> ---
>  drivers/net/wireless/ath/ath12k/hal.h |  3 +
>  drivers/net/wireless/ath/ath12k/hw.c  | 87 ++++++++++++++++++++++++++-
>  2 files changed, 89 insertions(+), 1 deletion(-)
> 

That's not a separate patch. Regs do not make any sense on their own,
so this commit makes no sense on its own.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support
  2025-01-30  5:18 ` [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support Raj Kumar Bhagat
@ 2025-01-30  8:39   ` Krzysztof Kozlowski
  2025-02-26 17:23     ` Raj Kumar Bhagat
  0 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-30  8:39 UTC (permalink / raw)
  To: Raj Kumar Bhagat
  Cc: ath12k, linux-wireless, Kalle Valo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jeff Johnson, devicetree,
	linux-kernel, Sowmiya Sree Elavalagan, Saravanakumar Duraisamy

On Thu, Jan 30, 2025 at 10:48:38AM +0530, Raj Kumar Bhagat wrote:
> From: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
> 
> Currently, ath12k AHB (in IPQ5332) uses SCM calls to authenticate the
> firmware image to bring up userpd. From IPQ5424 onwards, Q6 firmware can
> directly communicate with the Trusted Management Engine - Lite (TME-L),
> eliminating the need for SCM calls for userpd bring-up.
> 
> Hence, to enable IPQ5424 device support, use qcom_mdt_load_no_init() and
> skip the SCM call as Q6 will directly authenticate the userpd firmware.
> 
> Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
> Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
> Co-developed-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
> Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
> ---
>  drivers/net/wireless/ath/ath12k/ahb.c | 80 +++++++++++++++++----------
>  drivers/net/wireless/ath/ath12k/ahb.h |  9 +++
>  2 files changed, 61 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
> index d502b59a78d8..75767915dec3 100644
> --- a/drivers/net/wireless/ath/ath12k/ahb.c
> +++ b/drivers/net/wireless/ath/ath12k/ahb.c
> @@ -21,6 +21,9 @@ static const struct of_device_id ath12k_ahb_of_match[] = {
>  	{ .compatible = "qcom,ipq5332-wifi",
>  	  .data = (void *)ATH12K_HW_IPQ5332_HW10,
>  	},
> +	{ .compatible = "qcom,ipq5424-wifi",
> +	  .data = (void *)ATH12K_HW_IPQ5424_HW10,
> +	},
>  	{ }
>  };
>  
> @@ -398,8 +401,8 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
>  		ATH12K_AHB_UPD_SWID;
>  
>  	/* Load FW image to a reserved memory location */
> -	ret = qcom_mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys, mem_size,
> -			    &mem_phys);
> +	ret = ab_ahb->ahb_ops->mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys,
> +					mem_size, &mem_phys);
>  	if (ret) {
>  		ath12k_err(ab, "Failed to load MDT segments: %d\n", ret);
>  		goto err_fw;
> @@ -430,11 +433,13 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
>  		goto err_fw2;
>  	}
>  
> -	/* Authenticate FW image using peripheral ID */
> -	ret = qcom_scm_pas_auth_and_reset(pasid);
> -	if (ret) {
> -		ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
> -		goto err_fw2;
> +	if (ab_ahb->scm_auth_enabled) {
> +		/* Authenticate FW image using peripheral ID */
> +		ret = qcom_scm_pas_auth_and_reset(pasid);
> +		if (ret) {
> +			ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
> +			goto err_fw2;
> +		}
>  	}
>  
>  	/* Instruct Q6 to spawn userPD thread */
> @@ -491,13 +496,15 @@ static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend)
>  
>  	qcom_smem_state_update_bits(ab_ahb->stop_state, BIT(ab_ahb->stop_bit), 0);
>  
> -	pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
> -		ATH12K_AHB_UPD_SWID;
> -	/* Release the firmware */
> -	ret = qcom_scm_pas_shutdown(pasid);
> -	if (ret)
> -		ath12k_err(ab, "scm pas shutdown failed for userPD%d: %d\n",
> -			   ab_ahb->userpd_id, ret);
> +	if (ab_ahb->scm_auth_enabled) {
> +		pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
> +			 ATH12K_AHB_UPD_SWID;
> +		/* Release the firmware */
> +		ret = qcom_scm_pas_shutdown(pasid);
> +		if (ret)
> +			ath12k_err(ab, "scm pas shutdown failed for userPD%d\n",
> +				   ab_ahb->userpd_id);
> +	}
>  }
>  
>  static void ath12k_ahb_init_qmi_ce_config(struct ath12k_base *ab)
> @@ -707,6 +714,14 @@ static int ath12k_ahb_map_service_to_pipe(struct ath12k_base *ab, u16 service_id
>  	return 0;
>  }
>  
> +static const struct ath12k_ahb_ops ahb_ops_ipq5332 = {
> +	.mdt_load = qcom_mdt_load,
> +};
> +
> +static const struct ath12k_ahb_ops ahb_ops_ipq5424 = {
> +	.mdt_load = qcom_mdt_load_no_init,
> +};
> +
>  static const struct ath12k_hif_ops ath12k_ahb_hif_ops_ipq5332 = {
>  	.start = ath12k_ahb_start,
>  	.stop = ath12k_ahb_stop,
> @@ -1041,19 +1056,9 @@ static int ath12k_ahb_probe(struct platform_device *pdev)
>  	struct device_node *mem_node;
>  	struct ath12k_ahb *ab_ahb;
>  	enum ath12k_hw_rev hw_rev;
> -	u32 addr, userpd_id;
> +	u32 addr;
>  	int ret;
>  
> -	hw_rev = ath12k_ahb_get_hw_rev(pdev);
> -	switch (hw_rev) {
> -	case ATH12K_HW_IPQ5332_HW10:
> -		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
> -		userpd_id = ATH12K_IPQ5332_USERPD_ID;
> -		break;
> -	default:
> -		return -EOPNOTSUPP;
> -	}

You just added this code in previous patchset, why are you moving it?

> -
>  	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to set 32-bit coherent dma\n");
> @@ -1067,13 +1072,32 @@ static int ath12k_ahb_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  
> +	ab_ahb = ath12k_ab_to_ahb(ab);
> +	ab_ahb->ab = ab;
> +
> +	hw_rev = ath12k_ahb_get_hw_rev(pdev);
> +	switch (hw_rev) {
> +	case ATH12K_HW_IPQ5332_HW10:
> +		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
> +		ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
> +		ab_ahb->scm_auth_enabled = true;
> +		ab_ahb->ahb_ops = &ahb_ops_ipq5332;
> +		break;
> +	case ATH12K_HW_IPQ5424_HW10:
> +		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
> +		ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
> +		ab_ahb->scm_auth_enabled = false;
> +		ab_ahb->ahb_ops = &ahb_ops_ipq5424;

Why you cannot store just proper driver data structure in match data?
This entire switch is redundant.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424
  2025-01-30  5:18 ` [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424 Raj Kumar Bhagat
@ 2025-01-30 18:50   ` Conor Dooley
  2025-02-25  7:14     ` Raj Kumar Bhagat
  0 siblings, 1 reply; 14+ messages in thread
From: Conor Dooley @ 2025-01-30 18:50 UTC (permalink / raw)
  To: Raj Kumar Bhagat
  Cc: ath12k, linux-wireless, Kalle Valo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jeff Johnson, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 8206 bytes --]

On Thu, Jan 30, 2025 at 10:48:34AM +0530, Raj Kumar Bhagat wrote:
> Describe and add the device-tree bindings for the ATH12K AHB wifi device
> IPQ5424.
> 
> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
> ---
>  .../net/wireless/qcom,ath12k-ahb.yaml         | 119 ++++++++++++++++++
>  1 file changed, 119 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
> index bd953a028dc3..1d24389a0ab3 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
> @@ -18,6 +18,7 @@ properties:
>    compatible:
>      enum:
>        - qcom,ipq5332-wifi
> +      - qcom,ipq5424-wifi

Patch should end here, another example for something that doesn't have
different properties etc is pointless.

Thanks,
Conor.

>  
>    reg:
>      maxItems: 1
> @@ -317,3 +318,121 @@ examples:
>                                  "stop",
>                                  "spawn";
>      };
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    wifi1: wifi@c000000 {
> +        compatible = "qcom,ipq5424-wifi";
> +        reg = <0x0c000000 0x1000000>;
> +        clocks = <&gcc GCC_XO_CLK_SRC>;
> +        clock-names = "xo";
> +        interrupts-extended = <&wcss_smp2p_in 8 IRQ_TYPE_NONE>,
> +                              <&wcss_smp2p_in 9 IRQ_TYPE_NONE>,
> +                              <&wcss_smp2p_in 12 IRQ_TYPE_NONE>,
> +                              <&wcss_smp2p_in 11 IRQ_TYPE_NONE>,
> +                              <&intc GIC_SPI 559 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 560 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 561 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 518 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 519 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 520 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 521 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 522 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 523 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 524 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 525 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 526 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 527 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 528 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 529 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 574 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 576 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 627 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 540 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 549 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 580 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 537 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 536 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 535 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 534 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 571 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 571 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 567 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 637 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 637 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 632 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 590 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 583 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 582 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 581 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 533 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 532 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 531 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 530 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 626 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 569 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 569 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 565 IRQ_TYPE_EDGE_RISING>,
> +                              <&intc GIC_SPI 502 IRQ_TYPE_EDGE_RISING>;
> +        interrupt-names = "fatal",
> +                          "ready",
> +                          "spawn",
> +                          "stop-ack",
> +                          "misc-pulse1",
> +                          "misc-latch",
> +                          "sw-exception",
> +                          "ce0",
> +                          "ce1",
> +                          "ce2",
> +                          "ce3",
> +                          "ce4",
> +                          "ce5",
> +                          "ce6",
> +                          "ce7",
> +                          "ce8",
> +                          "ce9",
> +                          "ce10",
> +                          "ce11",
> +                          "host2wbm-desc-feed",
> +                          "host2reo-re-injection",
> +                          "host2reo-command",
> +                          "host2rxdma-monitor-ring1",
> +                          "reo2ost-exception",
> +                          "wbm2host-rx-release",
> +                          "reo2host-status",
> +                          "reo2host-destination-ring4",
> +                          "reo2host-destination-ring3",
> +                          "reo2host-destination-ring2",
> +                          "reo2host-destination-ring1",
> +                          "rxdma2host-monitor-destination-mac3",
> +                          "rxdma2host-monitor-destination-mac2",
> +                          "rxdma2host-monitor-destination-mac1",
> +                          "host2rxdma-host-buf-ring-mac3",
> +                          "host2rxdma-host-buf-ring-mac2",
> +                          "host2rxdma-host-buf-ring-mac1",
> +                          "host2tcl-input-ring4",
> +                          "host2tcl-input-ring3",
> +                          "host2tcl-input-ring2",
> +                          "host2tcl-input-ring1",
> +                          "wbm2host-tx-completions-ring4",
> +                          "wbm2host-tx-completions-ring3",
> +                          "wbm2host-tx-completions-ring2",
> +                          "wbm2host-tx-completions-ring1",
> +                          "host2tx-monitor-ring1",
> +                          "txmon2host-monitor-destination-mac3",
> +                          "txmon2host-monitor-destination-mac2",
> +                          "txmon2host-monitor-destination-mac1",
> +                          "umac-reset";
> +
> +        memory-region = <&q6_region>, <&m3_dump>, <&q6_caldb>, <&mlo_mem>;
> +        memory-region-names = "q6-region", "m3-dump", "q6-caldb", "mlo-global-mem";
> +        qcom,ath12k-calibration-variant = "RDP466_1";
> +        qcom,rproc = <&q6v5_wcss>;
> +        qcom,smem-states = <&wcss_smp2p_out 8>,
> +                           <&wcss_smp2p_out 9>,
> +                           <&wcss_smp2p_out 10>;
> +        qcom,smem-state-names = "shutdown",
> +                                "stop",
> +                                "spawn";
> +    };
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs for IPQ5424
  2025-01-30  8:38   ` Krzysztof Kozlowski
@ 2025-01-30 19:03     ` Jeff Johnson
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2025-01-30 19:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Raj Kumar Bhagat
  Cc: ath12k, linux-wireless, Kalle Valo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jeff Johnson, devicetree,
	linux-kernel, Saravanakumar Duraisamy

On 1/30/2025 12:38 AM, Krzysztof Kozlowski wrote:
> On Thu, Jan 30, 2025 at 10:48:36AM +0530, Raj Kumar Bhagat wrote:
>> From: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
>>
>> Add register addresses (ath12k_hw_regs) for new ath12k AHB based
>> WiFi device IPQ5424.
>>
>> Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
>> Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
>> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
>> ---
>>  drivers/net/wireless/ath/ath12k/hal.h |  3 +
>>  drivers/net/wireless/ath/ath12k/hw.c  | 87 ++++++++++++++++++++++++++-
>>  2 files changed, 89 insertions(+), 1 deletion(-)
>>
> 
> That's not a separate patch. Regs do not make any sense on their own,
> so this commit makes no sense on its own.

This approach was suggested during internal review so that each addition can
be reviewed without distraction from the other pieces. None of this is
actually enabled until the final patch, so "trickling in" the pieces seems
preferable to me.

/jeff


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424
  2025-01-30 18:50   ` Conor Dooley
@ 2025-02-25  7:14     ` Raj Kumar Bhagat
  0 siblings, 0 replies; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-02-25  7:14 UTC (permalink / raw)
  To: Conor Dooley
  Cc: ath12k, linux-wireless, Kalle Valo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jeff Johnson, devicetree,
	linux-kernel

On 1/31/2025 12:20 AM, Conor Dooley wrote:
> On Thu, Jan 30, 2025 at 10:48:34AM +0530, Raj Kumar Bhagat wrote:
>> Describe and add the device-tree bindings for the ATH12K AHB wifi device
>> IPQ5424.
>>
>> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
>> ---
>>  .../net/wireless/qcom,ath12k-ahb.yaml         | 119 ++++++++++++++++++
>>  1 file changed, 119 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
>> index bd953a028dc3..1d24389a0ab3 100644
>> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k-ahb.yaml
>> @@ -18,6 +18,7 @@ properties:
>>    compatible:
>>      enum:
>>        - qcom,ipq5332-wifi
>> +      - qcom,ipq5424-wifi
> Patch should end here, another example for something that doesn't have
> different properties etc is pointless.


Thanks, will update in next version.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support
  2025-01-30  8:39   ` Krzysztof Kozlowski
@ 2025-02-26 17:23     ` Raj Kumar Bhagat
  0 siblings, 0 replies; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-02-26 17:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: ath12k, linux-wireless, Kalle Valo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jeff Johnson, devicetree,
	linux-kernel, Sowmiya Sree Elavalagan, Saravanakumar Duraisamy

On 1/30/2025 2:09 PM, Krzysztof Kozlowski wrote:
> On Thu, Jan 30, 2025 at 10:48:38AM +0530, Raj Kumar Bhagat wrote:
>> From: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
>>
>> Currently, ath12k AHB (in IPQ5332) uses SCM calls to authenticate the
>> firmware image to bring up userpd. From IPQ5424 onwards, Q6 firmware can
>> directly communicate with the Trusted Management Engine - Lite (TME-L),
>> eliminating the need for SCM calls for userpd bring-up.
>>
>> Hence, to enable IPQ5424 device support, use qcom_mdt_load_no_init() and
>> skip the SCM call as Q6 will directly authenticate the userpd firmware.
>>
>> Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1
>> Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
>> Co-developed-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
>> Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
>> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
>> ---
>>  drivers/net/wireless/ath/ath12k/ahb.c | 80 +++++++++++++++++----------
>>  drivers/net/wireless/ath/ath12k/ahb.h |  9 +++
>>  2 files changed, 61 insertions(+), 28 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
>> index d502b59a78d8..75767915dec3 100644
>> --- a/drivers/net/wireless/ath/ath12k/ahb.c
>> +++ b/drivers/net/wireless/ath/ath12k/ahb.c
>> @@ -21,6 +21,9 @@ static const struct of_device_id ath12k_ahb_of_match[] = {
>>  	{ .compatible = "qcom,ipq5332-wifi",
>>  	  .data = (void *)ATH12K_HW_IPQ5332_HW10,
>>  	},
>> +	{ .compatible = "qcom,ipq5424-wifi",
>> +	  .data = (void *)ATH12K_HW_IPQ5424_HW10,
>> +	},
>>  	{ }
>>  };
>>  
>> @@ -398,8 +401,8 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
>>  		ATH12K_AHB_UPD_SWID;
>>  
>>  	/* Load FW image to a reserved memory location */
>> -	ret = qcom_mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys, mem_size,
>> -			    &mem_phys);
>> +	ret = ab_ahb->ahb_ops->mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys,
>> +					mem_size, &mem_phys);
>>  	if (ret) {
>>  		ath12k_err(ab, "Failed to load MDT segments: %d\n", ret);
>>  		goto err_fw;
>> @@ -430,11 +433,13 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
>>  		goto err_fw2;
>>  	}
>>  
>> -	/* Authenticate FW image using peripheral ID */
>> -	ret = qcom_scm_pas_auth_and_reset(pasid);
>> -	if (ret) {
>> -		ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
>> -		goto err_fw2;
>> +	if (ab_ahb->scm_auth_enabled) {
>> +		/* Authenticate FW image using peripheral ID */
>> +		ret = qcom_scm_pas_auth_and_reset(pasid);
>> +		if (ret) {
>> +			ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
>> +			goto err_fw2;
>> +		}
>>  	}
>>  
>>  	/* Instruct Q6 to spawn userPD thread */
>> @@ -491,13 +496,15 @@ static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend)
>>  
>>  	qcom_smem_state_update_bits(ab_ahb->stop_state, BIT(ab_ahb->stop_bit), 0);
>>  
>> -	pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
>> -		ATH12K_AHB_UPD_SWID;
>> -	/* Release the firmware */
>> -	ret = qcom_scm_pas_shutdown(pasid);
>> -	if (ret)
>> -		ath12k_err(ab, "scm pas shutdown failed for userPD%d: %d\n",
>> -			   ab_ahb->userpd_id, ret);
>> +	if (ab_ahb->scm_auth_enabled) {
>> +		pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
>> +			 ATH12K_AHB_UPD_SWID;
>> +		/* Release the firmware */
>> +		ret = qcom_scm_pas_shutdown(pasid);
>> +		if (ret)
>> +			ath12k_err(ab, "scm pas shutdown failed for userPD%d\n",
>> +				   ab_ahb->userpd_id);
>> +	}
>>  }
>>  
>>  static void ath12k_ahb_init_qmi_ce_config(struct ath12k_base *ab)
>> @@ -707,6 +714,14 @@ static int ath12k_ahb_map_service_to_pipe(struct ath12k_base *ab, u16 service_id
>>  	return 0;
>>  }
>>  
>> +static const struct ath12k_ahb_ops ahb_ops_ipq5332 = {
>> +	.mdt_load = qcom_mdt_load,
>> +};
>> +
>> +static const struct ath12k_ahb_ops ahb_ops_ipq5424 = {
>> +	.mdt_load = qcom_mdt_load_no_init,
>> +};
>> +
>>  static const struct ath12k_hif_ops ath12k_ahb_hif_ops_ipq5332 = {
>>  	.start = ath12k_ahb_start,
>>  	.stop = ath12k_ahb_stop,
>> @@ -1041,19 +1056,9 @@ static int ath12k_ahb_probe(struct platform_device *pdev)
>>  	struct device_node *mem_node;
>>  	struct ath12k_ahb *ab_ahb;
>>  	enum ath12k_hw_rev hw_rev;
>> -	u32 addr, userpd_id;
>> +	u32 addr;
>>  	int ret;
>>  
>> -	hw_rev = ath12k_ahb_get_hw_rev(pdev);
>> -	switch (hw_rev) {
>> -	case ATH12K_HW_IPQ5332_HW10:
>> -		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
>> -		userpd_id = ATH12K_IPQ5332_USERPD_ID;
>> -		break;
>> -	default:
>> -		return -EOPNOTSUPP;
>> -	}
> 
> You just added this code in previous patchset, why are you moving it?
> 

In the v6 of dependent series ([PATCH v6 00/13] wifi: ath12k: add Ath12k AHB driver
support for IPQ5332), we have moved this part of the code in the required position.
In the next version the above hunk will not be required.

>> -
>>  	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>>  	if (ret) {
>>  		dev_err(&pdev->dev, "Failed to set 32-bit coherent dma\n");
>> @@ -1067,13 +1072,32 @@ static int ath12k_ahb_probe(struct platform_device *pdev)
>>  		return -ENOMEM;
>>  	}
>>  
>> +	ab_ahb = ath12k_ab_to_ahb(ab);
>> +	ab_ahb->ab = ab;
>> +
>> +	hw_rev = ath12k_ahb_get_hw_rev(pdev);
>> +	switch (hw_rev) {
>> +	case ATH12K_HW_IPQ5332_HW10:
>> +		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
>> +		ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
>> +		ab_ahb->scm_auth_enabled = true;
>> +		ab_ahb->ahb_ops = &ahb_ops_ipq5332;
>> +		break;
>> +	case ATH12K_HW_IPQ5424_HW10:
>> +		hif_ops = &ath12k_ahb_hif_ops_ipq5332;
>> +		ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
>> +		ab_ahb->scm_auth_enabled = false;
>> +		ab_ahb->ahb_ops = &ahb_ops_ipq5424;
> 
> Why you cannot store just proper driver data structure in match data?
> This entire switch is redundant.
> 

Thanks for this optimization suggestion. Will implement this in the next version.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device
  2025-01-30  7:37 ` [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Krzysztof Kozlowski
@ 2025-02-26 18:10   ` Raj Kumar Bhagat
  0 siblings, 0 replies; 14+ messages in thread
From: Raj Kumar Bhagat @ 2025-02-26 18:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski, ath12k
  Cc: linux-wireless, Kalle Valo, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jeff Johnson, devicetree, linux-kernel

On 1/30/2025 1:07 PM, Krzysztof Kozlowski wrote:
> On 30/01/2025 06:18, Raj Kumar Bhagat wrote:
>> Add support for the new ath12k AHB device IPQ5424, as currently, Ath12k
>> AHB only supports IPQ5332 WiFi devices.
>>
>> The IPQ5424 is an IEEE 802.11be 2 GHz WiFi device, supporting 4x4
>> configurations. To enable the IPQ5424 device:
>> - Add the necessary hardware parameters for IPQ5424.
>> - Modify the boot-up sequence for ath12k AHB to accommodate the
>>   requirements of the IPQ5424 device.
>>
>> Depends-On: [PATCH v5 00/13] wifi: ath12k: add Ath12k AHB driver support for IPQ5332
>> Link: https://lore.kernel.org/all/20250130043508.1885026-1-quic_rajkbhag@quicinc.com/
>>
> You marked this a RFC, so this is not ready, but nothing explains this
> here. What sort of comments are you looking for? What's incomplete with
> this work?
> 

Only the basic validation has been done hence marked as RFC. For the next version
v2, we will have complete validation and will change from RFC to normal patch.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-02-26 18:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-30  5:18 [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Raj Kumar Bhagat
2025-01-30  5:18 ` [RFC PATCH 1/5] dt-bindings: net: wireless: describe the ath12k wifi device IPQ5424 Raj Kumar Bhagat
2025-01-30 18:50   ` Conor Dooley
2025-02-25  7:14     ` Raj Kumar Bhagat
2025-01-30  5:18 ` [RFC PATCH 2/5] wifi: ath12k: Add ath12k_hw_params for IPQ5424 Raj Kumar Bhagat
2025-01-30  5:18 ` [RFC PATCH 3/5] wifi: ath12k: add ath12k_hw_regs " Raj Kumar Bhagat
2025-01-30  8:38   ` Krzysztof Kozlowski
2025-01-30 19:03     ` Jeff Johnson
2025-01-30  5:18 ` [RFC PATCH 4/5] wifi: ath12k: Add CE remap hardware parameters " Raj Kumar Bhagat
2025-01-30  5:18 ` [RFC PATCH 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support Raj Kumar Bhagat
2025-01-30  8:39   ` Krzysztof Kozlowski
2025-02-26 17:23     ` Raj Kumar Bhagat
2025-01-30  7:37 ` [RFC PATCH 0/5] wifi: ath12k: Enable IPQ5424 AHB WiFi device Krzysztof Kozlowski
2025-02-26 18:10   ` Raj Kumar Bhagat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox