From nobody Wed Dec 17 15:40:52 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 D7AC4204C26; Mon, 17 Mar 2025 20:47:53 +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=1742244475; cv=none; b=IKBQYk5hwUHG0ZLeBwj3meu5yOMxhCuRaThtNaXRGPCCTSfHKncPtJ9Cz1XUdkagEOYGTBKQym5fPE8EIksOF8ffh4qsDX4kYtcHpD5wkleZy2lhzKApL2gY4FGUrfkOWC/kYlAAD7nD5W64afp53808m3htxTAB+htI/sCqbxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742244475; c=relaxed/simple; bh=W+3yFttjl+vlRbE0B3sZEsn1yJhQxixo/TMmzonOF+I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NLZkPJ/lsbBTAHQFhKNFsirOqU9XRRogesgd5Lih6apI/IOXR3DkbQ0QWTYXWVjVIDfURqVxaBnifJ0UeZezALGAgtvrjc4lP6nHWnRI8a0Gc3DHoRDXX11J7wv3znXQbzWSSIY6UJHgS/DeEEmzgvB57nGIfHZYO5jVIyPVHlg= 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=cHQ/zl8c; 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="cHQ/zl8c" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52HAVecx027608; Mon, 17 Mar 2025 20:47:45 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= HoA2FewbexyyrgVYqoRyS7CdvkIP0lhy3DvDhg0mcVQ=; b=cHQ/zl8cuVJy8dav CsjE+LVlxbCFFgsibeX6xQ+yIzZFtjL4w0h/QF3YJvA7m3UccP+AkQITCX4EK4tM SpPlzJ2E+60LW5t75lX0np3X3uHz0QsGm6gHniqh4KHUpiwZUkd0eGWObL/Mhex7 6KtbHYkJTfPXbiQb0PkC56C4Np8OvfQG0TtpMh655c4p6xuy/ngE18mTgdVIUV8s S1esh+3V1Yir5uurYNxW17bXsOVfrtvs6Kl5uC4ccHHOD2LQzEUodaIxgSy+lnfn fOWUBKYgxRTmTsGbLf4vB5+zB+dIhfXl6pfD6KOOw84Oilb6HNhF2yOj1gTpwWkC kGmfwg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45d1x7ww42-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Mar 2025 20:47:45 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 52HKliHG021863 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Mar 2025 20:47:44 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 13:47:40 -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 v11 06/13] wifi: ath12k: Add hw_params to remap CE register space for IPQ5332 Date: Tue, 18 Mar 2025 02:16:32 +0530 Message-ID: <20250317204639.1864742-7-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250317204639.1864742-1-quic_rajkbhag@quicinc.com> References: <20250317204639.1864742-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: erZBV9AwU_ZIiZrfmq9SpUmuU1J0PPt7 X-Proofpoint-ORIG-GUID: erZBV9AwU_ZIiZrfmq9SpUmuU1J0PPt7 X-Authority-Analysis: v=2.4 cv=Jem8rVKV c=1 sm=1 tr=0 ts=67d88a71 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-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_08,2025-03-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 clxscore=1015 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503170150 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 a2a3f8abe5a8..96c01807761f 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 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