From nobody Wed Dec 17 15:45:27 2025 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 B57F624DFF7; Mon, 17 Mar 2025 15:43:18 +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=1742226200; cv=none; b=boaCJeFD+THqYMe5QQRPwvYPNMCWAokiT9uyWUhutO1n3Sb++tKqOUbbsoZ5afGSmKmFa9NMwrK1eCkXCQjDN8rUdpIp5nb5K6DwIN+0Bh49Il8S6vQcXJSwVkoXt5bPRiy8Sl4glXbyRWqruy8NCKRyMu9F49QRAKP5qvdhq0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742226200; c=relaxed/simple; bh=w+wm1M9dx3XKvm+n2laF9jGsXnjwYGSlI2WSGrrVRoc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PJIC/xEPkfHT4xc6kyKBeeKCZcIZ9nMeJcKTFHpUCApDnK8LiNxgC9uFPLHtsx4SSUD5ZhD7KtU3lvmZaSsjLdvShZNhwRaGHNwHxY3H7LpvlF7Hh1780oXLFYeGwe99EJvU9SeLoviw6X+84emTPrZbW3umuBdxpVA1VQTrNeE= 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=HRqqROwy; 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="HRqqROwy" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52HAUAXG011631; Mon, 17 Mar 2025 15:43:08 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= kMzwBR0HwdMxDOU5MHCY25bbnLrxSfvAhgP8h3Yolt4=; b=HRqqROwyRFZwju46 dLt+04rEMBeo5GbF6PlQq0h1QCz8aQthOuxJ7K1tkVc4QdJN0Xs3w9sTv26a/ZBU MTV0YIzTm1eBB/GzNeyMCdOc4r5AE5UqNWKiWNXOnC8eqecoaadkJStrqDQbnPOg CWCf6wPedO4P4tpamGB0ywVYKL0Ho6m/503GDWA5okQvLwZROoTLTzHN/fUeNuuI Sm7A578IYkZjY4NyqrDr91r/iTyHVpKIT50cWQJV5l67kwK2dqMol0tu0Nl2+4qU 9XYxY+wTRN9vkYd3oaeo+6tYkGqjMnZw+6azYqlctegPYjRRTevqFPUoRrnWQaeF zD+d9A== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45d1s3w7n5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Mar 2025 15:43:08 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 52HFh7H9027875 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Mar 2025 15:43:07 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, 17 Mar 2025 08:43:03 -0700 From: Raj Kumar Bhagat To: CC: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson , , , , Balamurugan S , P Praneesh , "Raj Kumar Bhagat" , Vasanthakumar Thiagarajan Subject: [PATCH ath-next v10 06/13] wifi: ath12k: Add hw_params to remap CE register space for IPQ5332 Date: Mon, 17 Mar 2025 21:11:43 +0530 Message-ID: <20250317154150.1361364-7-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250317154150.1361364-1-quic_rajkbhag@quicinc.com> References: <20250317154150.1361364-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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-Authority-Analysis: v=2.4 cv=WbQMa1hX c=1 sm=1 tr=0 ts=67d8430c cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=Vs1iUdzkB0EA:10 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=7j9kn6NuwsAEDTjzSyQA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: F1Hm6yDiznadvF0hVoBdQoo3rzBlyTSA X-Proofpoint-ORIG-GUID: F1Hm6yDiznadvF0hVoBdQoo3rzBlyTSA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-17_06,2025-03-17_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 impostorscore=0 suspectscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503170113 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 Reviewed-by: Vasanthakumar Thiagarajan --- 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