From nobody Wed Dec 17 12:10:07 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 5D34A227EB6; Fri, 21 Mar 2025 10:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742554408; cv=none; b=t3O8u3TtDlCk5ncRP0TroVpJbzjCRZtrBMFn76sUto7uCHJEJAITrWXibgnkiGv9TUxpZUVY5K0D3FuKwin81455wBEC5gPcoHmB7xpKUxzTTKhTv87c4Hcddt5fEF0DOWXELVFNjFrwhjEtvGVVB2IZwBgExaPAmXFE2rLGkyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742554408; c=relaxed/simple; bh=5GSdt/cYlRY0p0pCH4lObCQqm++w76O6nmu90BVizkU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=YD11UorBCIq+vpO2eH67FcbKSAKOqEKL2PCBWQQNlNVxNF1MuO+9fnFwsIaw7Tp+31oKsElc0yNTdy3iWOlMcErGs6EjpZ6ye9MM5L8ElNZrhk9hL0qF80IrQi7OoKiZD/AX+BM55smWrpFfDSOLAIcz1UqpGmJ/r6ECiFDOY5s= 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=TP3k6ZIp; arc=none smtp.client-ip=205.220.180.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="TP3k6ZIp" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52LATE28001603; Fri, 21 Mar 2025 10:53:18 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= xDnluI8ibIlhsD/cN02BOnEfGKXnFRRHyixHimEfM9w=; b=TP3k6ZIpa+zc9orD meZagicN8uPn2O4ZDAWhoE9o0ZnB2+W97HZr8rKgV+evvDMbDufhB9C0MMDMm1eY S1mLJLOgm8bx7ctzRuGLT2dk088jXLIFg04RwYRDLnhUxKMujau+M77gQ/mgQcvR +xPpmm+Nvab3lfhTj2tcM3JvT5Uct7LS8Ay09BPk2NeWbR8GhdkzfkXogdNqjmEJ k0KlFsb5/PZCaXlGcrmqDZ84zM6Wv6rmC4YRern1kudugOIQoTv/0co5cu3sCpm2 yFWsoAeoliaDPwUTs5gt+zKt/sYMcMnR+cZl+XIcly2TgsWyIpA8L82MGQVwse8d nX4d3A== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45g3sf5nq6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Mar 2025 10:53:18 +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 52LArH8R028268 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Mar 2025 10:53:17 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; Fri, 21 Mar 2025 03:53:13 -0700 From: Raj Kumar Bhagat Date: Fri, 21 Mar 2025 16:22:43 +0530 Subject: [PATCH ath-next v12 06/13] wifi: ath12k: Add hw_params to remap CE register space for IPQ5332 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250321-ath12k-ahb-v12-6-bb389ed76ae5@quicinc.com> References: <20250321-ath12k-ahb-v12-0-bb389ed76ae5@quicinc.com> In-Reply-To: <20250321-ath12k-ahb-v12-0-bb389ed76ae5@quicinc.com> To: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson CC: , , , , Balamurugan S , P Praneesh , Vasanthakumar Thiagarajan , "Raj Kumar Bhagat" X-Mailer: b4 0.14.2 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-Proofpoint-GUID: Lnvm57yjzUFTKvoC1RDhFgvQG_-Gv9a5 X-Proofpoint-ORIG-GUID: Lnvm57yjzUFTKvoC1RDhFgvQG_-Gv9a5 X-Authority-Analysis: v=2.4 cv=R9IDGcRX c=1 sm=1 tr=0 ts=67dd451e cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=7j9kn6NuwsAEDTjzSyQA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 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-21_04,2025-03-20_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 malwarescore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503210080 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 Reviewed-by: Vasanthakumar Thiagarajan 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 8007a94cec5d3f465fdc8fefc5fc534515053c8a..57f75899ee03d63479698011fc0= 81936677f8698 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 a2a3f8abe5a8ca94f6d8d257acf9f23ca13ab62c..96c01807761f0e1e8575d272a4d= 817843bc7299b 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -925,6 +925,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 1ce97f9a92ac57e0dbc28682a3d7e57c9891a5ac..47ff0b1bfdf48915426dc79ebcd= e15d8d47dde7b 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 84f542c02c94e9382ce884e97243237ef34010b7..91aecca566a4b3b3927f019c4b0= b66e2663ce975 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 fbe1aec475ceb14cc7d6090e3d203620f3b7c516..6a75af093f319364f5930830c0c= 15e50906b9f78 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