From nobody Tue Feb 10 19:50:21 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F7F125B697; Tue, 25 Feb 2025 06:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740466187; cv=none; b=FnUigIp+73njTIUr+1f7KfN43yAatA5QAY1jLZ2virMwTJvUw82fxgvTcZh9U6R0tWDc6rhJHgQkMBPnGrKkES+FiB1YnEh1dEaEjxuupNJVNjS4nD8NbAOZ2zh7aGS21n8nUYX5xZLwEwrE2d82B7qluOq/PwS3EHgfu6ScBEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740466187; c=relaxed/simple; bh=ALqLLUWogQkYE6963EHBoJczaxpLtNHQoLsx/VbbmHQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hjeurWRPK5yDiDgFnrIFuAgudK5ygdxFb9K0uYJlvPMEuG7ix7w8pWJr8ZfFeYpvA0YKPxg+tmvFO1XzMB8HSIagbhmfIoY0lYp82LQSwvtjqPW15IqeetRQFwqYhp1llMOzOEERhfqPrq51LJom2Hf+GQfAuEvw/2aR/5r67n8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=mbn6FwYd; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="mbn6FwYd" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51OKOdeb001961; Tue, 25 Feb 2025 06:49:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 4UWfRvr5rUx8BlgHcPdBC9yg9LunZEnqYzq8eLC80og=; b=mbn6FwYd8BcREnme MSEGwuAZriE18YBLlXv2XC8Jz2dUQ6xdvAkGF1lD95EvBk098DUfr4XlEvCmc96b hGYPkUhzxobt+f5mW1wR61icoXJ9ji1lSpeWqDZgQBozE6LIbZvdLvvUPoH0L5G8 sQG2fL8iCSUFhodeMVA2m+zgjRJUEQlit2l/IviJ4WMxac/CNHp8YVIvtN3wMpol 9V81Cm9cmVuh04+NYCASWwg3pYrKssOPRstiGSJ9Ygxxwgg0pKcAub9UiyCkOKdm FcKliGGycseapEIhI+PGcUZHE1DGFv6sTL3ruDgOOw1EnQjybhC0nx/bLGCLQ1E5 PR2eLg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44y7rjypa4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2025 06:49:29 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 51P6nSSL016333 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2025 06:49:28 GMT Received: from hu-rajkbhag-blr.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 24 Feb 2025 22:49:24 -0800 From: Raj Kumar Bhagat To: CC: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson , , , , Balamurugan S , P Praneesh , "Raj Kumar Bhagat" Subject: [PATCH v6 06/13] wifi: ath12k: Add hw_params to remap CE register space for IPQ5332 Date: Tue, 25 Feb 2025 12:18:27 +0530 Message-ID: <20250225064834.2002499-7-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250225064834.2002499-1-quic_rajkbhag@quicinc.com> References: <20250225064834.2002499-1-quic_rajkbhag@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Wf8DEHBmutqYx0CJRAtHpFJmZ5sYyzp1 X-Proofpoint-ORIG-GUID: Wf8DEHBmutqYx0CJRAtHpFJmZ5sYyzp1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-25_02,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 phishscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502250043 Content-Type: text/plain; charset="utf-8" From: Balamurugan S For IPQ5332 CE register space is moved out of WCSS region and the space is not contiguous. Hence, add hardware params (ce_ie_addr & ce_remap) for IPQ5332. These parameters would be used by Ath12k AHB driver (in subsequent patches) to remap the CE registers to a new space for accessing them. Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1 Signed-off-by: Balamurugan S Co-developed-by: P Praneesh Signed-off-by: P Praneesh Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/ce.h | 11 ++++++++ drivers/net/wireless/ath/ath12k/core.h | 4 +++ drivers/net/wireless/ath/ath12k/hal.h | 4 +++ drivers/net/wireless/ath/ath12k/hw.c | 35 +++++++++++++++++++++++--- drivers/net/wireless/ath/ath12k/hw.h | 3 +++ 5 files changed, 53 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/ce.h b/drivers/net/wireless/at= h/ath12k/ce.h index 8007a94cec5d..57f75899ee03 100644 --- a/drivers/net/wireless/ath/ath12k/ce.h +++ b/drivers/net/wireless/ath/ath12k/ce.h @@ -76,6 +76,17 @@ struct ce_pipe_config { __le32 reserved; }; =20 +struct ce_ie_addr { + u32 ie1_reg_addr; + u32 ie2_reg_addr; + u32 ie3_reg_addr; +}; + +struct ce_remap { + u32 base; + u32 size; +}; + struct ce_attr { /* CE_ATTR_* values */ unsigned int flags; diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/= ath/ath12k/core.h index 553965f12fcd..85f0cdce774e 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -924,6 +924,10 @@ struct ath12k_base { void __iomem *mem; unsigned long mem_len; =20 + void __iomem *mem_ce; + u32 ce_remap_base_addr; + bool ce_remap; + struct { enum ath12k_bus bus; const struct ath12k_hif_ops *ops; diff --git a/drivers/net/wireless/ath/ath12k/hal.h b/drivers/net/wireless/a= th/ath12k/hal.h index 1ce97f9a92ac..47ff0b1bfdf4 100644 --- a/drivers/net/wireless/ath/ath12k/hal.h +++ b/drivers/net/wireless/ath/ath12k/hal.h @@ -11,6 +11,7 @@ #include "rx_desc.h" =20 struct ath12k_base; +#define HAL_CE_REMAP_REG_BASE (ab->ce_remap_base_addr) =20 #define HAL_LINK_DESC_SIZE (32 << 2) #define HAL_LINK_DESC_ALIGN 128 @@ -372,6 +373,9 @@ struct ath12k_base; * ath12k_hal_rx_desc_get_err(). */ =20 +#define HAL_IPQ5332_CE_WFSS_REG_BASE 0x740000 +#define HAL_IPQ5332_CE_SIZE 0x100000 + enum hal_srng_ring_id { HAL_SRNG_RING_ID_REO2SW0 =3D 0, HAL_SRNG_RING_ID_REO2SW1, diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/at= h/ath12k/hw.c index 84f542c02c94..91aecca566a4 100644 --- a/drivers/net/wireless/ath/ath12k/hw.c +++ b/drivers/net/wireless/ath/ath12k/hw.c @@ -1110,10 +1110,14 @@ static const struct ath12k_hw_regs ipq5332_regs =3D= { .hal_ppe_rel_ring_base =3D 0x0000046c, =20 /* CE address */ - .hal_umac_ce0_src_reg_base =3D 0x00740000, - .hal_umac_ce0_dest_reg_base =3D 0x00741000, - .hal_umac_ce1_src_reg_base =3D 0x00742000, - .hal_umac_ce1_dest_reg_base =3D 0x00743000, + .hal_umac_ce0_src_reg_base =3D 0x00740000 - + HAL_IPQ5332_CE_WFSS_REG_BASE, + .hal_umac_ce0_dest_reg_base =3D 0x00741000 - + HAL_IPQ5332_CE_WFSS_REG_BASE, + .hal_umac_ce1_src_reg_base =3D 0x00742000 - + HAL_IPQ5332_CE_WFSS_REG_BASE, + .hal_umac_ce1_dest_reg_base =3D 0x00743000 - + HAL_IPQ5332_CE_WFSS_REG_BASE, }; =20 static const struct ath12k_hw_regs wcn7850_regs =3D { @@ -1227,6 +1231,17 @@ static const struct ath12k_hw_hal_params ath12k_hw_h= al_params_ipq5332 =3D { HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW4_EN, }; =20 +static const struct ce_ie_addr ath12k_ce_ie_addr_ipq5332 =3D { + .ie1_reg_addr =3D CE_HOST_IE_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, + .ie2_reg_addr =3D CE_HOST_IE_2_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, + .ie3_reg_addr =3D CE_HOST_IE_3_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, +}; + +static const struct ce_remap ath12k_ce_remap_ipq5332 =3D { + .base =3D HAL_IPQ5332_CE_WFSS_REG_BASE, + .size =3D HAL_IPQ5332_CE_SIZE, +}; + static const struct ath12k_hw_params ath12k_hw_params[] =3D { { .name =3D "qcn9274 hw1.0", @@ -1304,6 +1319,9 @@ static const struct ath12k_hw_params ath12k_hw_params= [] =3D { .iova_mask =3D 0, =20 .supports_aspm =3D false, + + .ce_ie_addr =3D NULL, + .ce_remap =3D NULL, }, { .name =3D "wcn7850 hw2.0", @@ -1385,6 +1403,9 @@ static const struct ath12k_hw_params ath12k_hw_params= [] =3D { .iova_mask =3D ATH12K_PCIE_MAX_PAYLOAD_SIZE - 1, =20 .supports_aspm =3D true, + + .ce_ie_addr =3D NULL, + .ce_remap =3D NULL, }, { .name =3D "qcn9274 hw2.0", @@ -1462,6 +1483,9 @@ static const struct ath12k_hw_params ath12k_hw_params= [] =3D { .iova_mask =3D 0, =20 .supports_aspm =3D false, + + .ce_ie_addr =3D NULL, + .ce_remap =3D NULL, }, { .name =3D "ipq5332 hw1.0", @@ -1534,6 +1558,9 @@ static const struct ath12k_hw_params ath12k_hw_params= [] =3D { .supports_dynamic_smps_6ghz =3D false, .iova_mask =3D 0, .supports_aspm =3D false, + + .ce_ie_addr =3D &ath12k_ce_ie_addr_ipq5332, + .ce_remap =3D &ath12k_ce_remap_ipq5332, }, }; =20 diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/at= h/ath12k/hw.h index fbe1aec475ce..6a75af093f31 100644 --- a/drivers/net/wireless/ath/ath12k/hw.h +++ b/drivers/net/wireless/ath/ath12k/hw.h @@ -226,6 +226,9 @@ struct ath12k_hw_params { bool supports_dynamic_smps_6ghz; =20 u32 iova_mask; + + const struct ce_ie_addr *ce_ie_addr; + const struct ce_remap *ce_remap; }; =20 struct ath12k_hw_ops { --=20 2.34.1