[PATCH ath-next 16/17] wifi: ath12k: Resolve userPD ID per device

From: Aaradhana Sahu

Date: Thu Oct 08 2026 - 06:30:00 EST


Currently, the userPD ID is hard-coded during AHB probe. This does not
work for multi-PD platforms where different devices can have different
userPD IDs even when they use the same compatible string.

Resolve the userPD ID based on the device address so that the correct ID
is assigned to each device. The userPD ID is used to determine the
firmware name and PAS ID for firmware authentication.

Also set the multi-PD support based on the AHB device descriptor.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.6-01322-QCAHKSWPL_SILICONZ-1
Tested-on: QCN6432 hw1.0 AHB WLAN.WBE.1.6-01322-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <aaradhana.sahu@xxxxxxxxxxxxxxxx>
---
drivers/net/wireless/ath/ath12k/wifi7/ahb.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/wifi7/ahb.c b/drivers/net/wireless/ath/ath12k/wifi7/ahb.c
index bff48b2fe124..86359ed1eeb2 100644
--- a/drivers/net/wireless/ath/ath12k/wifi7/ahb.c
+++ b/drivers/net/wireless/ath/ath12k/wifi7/ahb.c
@@ -16,6 +16,10 @@
#include "core.h"
#include "hal.h"

+static const struct ath12k_ahb_userpd_map ath12k_wifi7_ahb_userpd_map[] = {
+ { .io_start = 0x0c000000, .upd_id = ATH12K_AHB_USERPD_ID_0 },
+};
+
static const struct ath12k_ahb_desc ath12k_wifi7_ahb_desc[] = {
[ATH12K_HW_IPQ5332_HW10] = {
.hw_rev = ATH12K_HW_IPQ5332_HW10,
@@ -43,6 +47,26 @@ static const struct of_device_id ath12k_wifi7_ahb_of_match[] = {

MODULE_DEVICE_TABLE(of, ath12k_wifi7_ahb_of_match);

+static u32 ath12k_wifi7_ahb_get_userpd_id(struct ath12k_base *ab)
+{
+ const struct ath12k_ahb_userpd_map *map;
+ struct resource *res;
+ size_t i;
+
+ res = platform_get_resource(ab->pdev, IORESOURCE_MEM, 0);
+
+ for (i = 0; i < ARRAY_SIZE(ath12k_wifi7_ahb_userpd_map); i++) {
+ map = &ath12k_wifi7_ahb_userpd_map[i];
+
+ if (res) {
+ if (map->io_start == res->start)
+ return map->upd_id;
+ }
+ }
+
+ return 0;
+}
+
static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
{
const struct ath12k_ahb_desc *desc;
@@ -60,7 +84,8 @@ static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
ab->hw_rev = desc->hw_rev;
ab->hif.ops = desc->ops;
ab_ahb->scm_auth_enabled = desc->auth_enabled;
- ab_ahb->userpd_id = ATH12K_AHB_USERPD_ID_0;
+ ab_ahb->supports_multipd = desc->supports_multipd;
+ ab_ahb->userpd_id = ath12k_wifi7_ahb_get_userpd_id(ab);
if (!ab_ahb->userpd_id)
return -EOPNOTSUPP;


--
2.34.1