From patchwork Sun May 18 18:22:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 891692 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 64E2C1D6DBB; Sun, 18 May 2025 18:23:14 +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=1747592595; cv=none; b=PbVsKpw09brlAcr1DDBBrOVTo+n0GLh8m2bVnNEpeKvxh0aGvwo1aYTxWyqRBJ7md03cChmYcmElAeblXEYXvs8WaouvoizPYsjX8PpN0Sm60eQ79aDag7eRUUIvQ114XVdJBMwfc+Rlb3O/tn6IfmlqhZXKJ78kQQHe+NMSe9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747592595; c=relaxed/simple; bh=zNl9h3O7jsIZhxMwFXEXtHLEiIIC6nEFDyTIlIpgd38=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=tmj5h0G4nR8v983l2I8m0b/fiTbhy18yM3TT3uXBIgD/uHWVeN/F4v2y/W1i1+iEqte7YzM3qypqqyePabiyzxSvSwxpLxkdV5X/S5Bx8ubi2w1BSFVo2YX7M+GRW8yGK2cSVfdPuuV+XKntMdVNPocldwFo6ICwPhHblR9uHAc= 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=aj6cDDWM; 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="aj6cDDWM" 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 54IIMxPO004036; Sun, 18 May 2025 18:22:59 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= YL8DBcm48fjZT4qgabvudsfE3bZaf+cmnGd/EUz4ouc=; b=aj6cDDWMT3Y+2rgC tlK4kKlYxBHWiytTMfyWiEUJUl8+6cFTqcYCg5lNQVugHZTyWSBu5QXIcgSunCAj jdMyYfR4z8ZQzFEDUPg/PjQkNeIhUn9yEsi+VWbvVBPWRhFq/BwI53Whq1lWF2EN wXwKwOAhc6VVEHwdKLdy2UX3M5pHd1xdDjQGdvAIC7ff/XaCitvK6kTg7PegwuGb Ux/MB9ZTjpqtruoOI/vxrhlSSmvXDYlKAgFChMqsD3x4zZUt2A/7LmXEnKoOjA+C dtwIsM80jUa5lsKlNsa66anxmCrmAgkKSIdLQ7eYB4ctmJ9MlQka1HErjSohH2qS c2qWYQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46pju7a9ar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:22:59 +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 54IIMwhU005293 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:22:58 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; Sun, 18 May 2025 11:22:55 -0700 From: Raj Kumar Bhagat Date: Sun, 18 May 2025 23:52:28 +0530 Subject: [PATCH ath-next v2 1/5] dt-bindings: net: wireless: add ath12k wifi device IPQ5424 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250518-ath12k-ipq5424-v2-1-ef81b833dc97@quicinc.com> References: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> In-Reply-To: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> To: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson CC: , , , , "Raj Kumar Bhagat" X-Mailer: b4 0.14.2 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-Authority-Analysis: v=2.4 cv=XKEwSRhE c=1 sm=1 tr=0 ts=682a2583 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=HmtOZnpMNtbFe9RdH4EA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: QPMtm3cXt3JjQzzT9hYE1Zb3Hj5DBlBI X-Proofpoint-GUID: QPMtm3cXt3JjQzzT9hYE1Zb3Hj5DBlBI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE4MDE3OSBTYWx0ZWRfX4bE2Fp/WEMzW H6ZoOmHm4Xqh7TNil/1ZC2iqMAiZsU7/lMumwhukqLw9W1TJ5aAbkD5pPX5btst/PM0uA4lBGbO wCSxaVDqa5EG23jHYzx09mfT2iB2/ABVsEB+nSRGvr9u7kc5ZXf7CyVQygWFZ7YMsL6vaXXU7wb CndE+NkDzOd+ea4+2Q1gogcy2GchH3ljomHwoX705V5L5TYXD2mk9e3o0phGMUYcodVVRArMEFv 13CZCK+Joj8WVtOfgVT6uidi2BwqBzz9nDNUSoLW+UqQ08xsb3gFupaXMR3X6WxqWbz8e7HV3x+ KVHA4ZS1PnNcoGrjSVTLxQihJvF/7pKNQjUnasrufZrdzpjWUuQuAK+EaJhkEz/wVXvlHnrjqwC LUSQH05pfdgO61l75VbEGTOXwlWWEBRqEbSQ1YCm34nT0xhUCRe62WLvejJIhcD0vPWutuUR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-18_09,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=925 phishscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505180179 Add the device-tree bindings for the ATH12K AHB wifi device IPQ5424. Signed-off-by: Raj Kumar Bhagat --- Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml index 363a0ecb6ad97c3dce72881ff552d238d08a2c12..37d8a0da778097b8bf7af2e8f1e920083a3fb81a 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml @@ -17,6 +17,7 @@ properties: compatible: enum: - qcom,ipq5332-wifi + - qcom,ipq5424-wifi reg: maxItems: 1 From patchwork Sun May 18 18:22:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 891693 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 0EA0A2F43; Sun, 18 May 2025 18:23:12 +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=1747592594; cv=none; b=BJwSomGVRaNxKxH4RXr04we9Y7jCqcPow3CnvcSboJFTVRcrJNNZLLHXAouG/l0xV27WqaKj2EAm8u7iI4DBWqaXahIKHxdO+Aay0s+ouXb537cXIX+Vnw7KTdws0PwsJrJu4iXe5h02fZSa2hccGQU5v42eAf2Jna2oiph5hRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747592594; c=relaxed/simple; bh=1as0HLR/0Fxxv/GCKtQEV7Pvofd9roAIEzxAPzygrgI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=TveURZjMFVm5GaYTZEkupN2dd3fmuMx2fqsjOf//B0a2iPjmb3dTE4dFfnyV8p8o95WRfj3v5bv6BFsz3DVRMHtgOqeheibBCDadJTtXNWU43K2xVEAn8e+OHYhsM5wV6zhCA/T85ONw9y5ed1OSyPtoA5MG+NbNUUNT06d7VF0= 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=YbzA4eNs; 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="YbzA4eNs" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54IH9uix026671; Sun, 18 May 2025 18:23:03 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= GqeUiYTeqFmaZ0dMTksqDFraKydvUwwGRWWpIbnQRU4=; b=YbzA4eNsWTSbpsR4 MWx4+6cECoyl2RervNdMizS4nT9o0zNo+ofhrKk50tyPCNNiURi+MZnjESV64/O2 BV/ZPLPfcn+loDyfSAlJ+xWTxyfaiIISicS4WIq6Z2VN0T+1Rfl0VpRoqQq/51+X thVs8Q3cip9yIWhGXYP0ELjJ7aS8/Ldfn8OU4JITGvq93Gpzl76WSAo3vnWgcM9v Mf2s8OgLVlHhfnCWnOvLMBhJRy1mUtlYm1FrEUYnurug9GFfVDl5A9My6zk8XZHF A4xygo2caSbHnXhE87B70hMaHy60eN8upgA8nx7d1i/NHeKih9chdmfEilEo3MOF qeiKsA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46pjm4j9h4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:02 +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 54IIN1xi005383 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:01 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; Sun, 18 May 2025 11:22:58 -0700 From: Raj Kumar Bhagat Date: Sun, 18 May 2025 23:52:29 +0530 Subject: [PATCH ath-next v2 2/5] wifi: ath12k: Add ath12k_hw_params for IPQ5424 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250518-ath12k-ipq5424-v2-2-ef81b833dc97@quicinc.com> References: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> In-Reply-To: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> To: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson CC: , , , , "Saravanakumar Duraisamy" , Raj Kumar Bhagat X-Mailer: b4 0.14.2 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-ORIG-GUID: pNzUPMjbSuds1JJIQpfaxyWp4ykPDJBB X-Authority-Analysis: v=2.4 cv=C4bpyRP+ c=1 sm=1 tr=0 ts=682a2586 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=vBmMNsOPyRzkxF6eNBIA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: pNzUPMjbSuds1JJIQpfaxyWp4ykPDJBB X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE4MDE3OSBTYWx0ZWRfX6guSw3aYqEmX ulYISIh7idTqXWL1NA1jHDCJlOpYSDah4siRfeVFKbaNXP5ZO/JVvWjP8CkM3Ma7WoXygNdaEom jF+7uu2KWsrH0J8MhZoNBgHBU2B8FvYbpjEW5DxB5AIbLXC8iblebaLv4ufiygcLnAWcUghZRgT vF87fYx9eTqZh4i/Sq4WV0r145XJVFQQyzxX03AYT74iaNEuuMfzaXtplmcsr4XAn8E77l50YCc C8SiWeiVEx6ivGKKt7aNmILnO4Sy7EeCI09vXcsVATnkjeSoBneaRwq+xEx8a47wSanbQ8BbHCY C8H1S0vZVhYLC2qkDgN7G0vsIzpRlDlDTX5ro05YAizlFn8IBYePGWaN0zvKMg2mDN7rsp0HZPi nhl4ECuPqxKzX45uZmj0zd9wi4aXr+ccpLUPogm1JIccfV36PDfkM3T1z38KN+RzU4eFF9p2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-18_09,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 impostorscore=0 adultscore=0 mlxlogscore=983 spamscore=0 lowpriorityscore=0 phishscore=0 mlxscore=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-2505070000 definitions=main-2505180179 From: Saravanakumar Duraisamy Add ath12k_hw_params for the new ath12k AHB-based WiFi device IPQ5424. The WiFi device IPQ5424 is similar to IPQ5332. Most of the hardware parameters like hw_ops, wmi_init, hal_ops, etc., are the same between IPQ5424 and IPQ5332, hence use these same parameters for IPQ5424. Some parameters are specific to IPQ5424; initially set these to 0 or NULL, and populate them in subsequent patches. Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1 Signed-off-by: Saravanakumar Duraisamy Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/core.h | 1 + drivers/net/wireless/ath/ath12k/hw.c | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 3aafbac46e81af9ed2da34201522fb9e73650205..b45f40f92f615dbfb2dd5f95f308865d42ea5bdc 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -150,6 +150,7 @@ enum ath12k_hw_rev { ATH12K_HW_QCN9274_HW20, ATH12K_HW_WCN7850_HW20, ATH12K_HW_IPQ5332_HW10, + ATH12K_HW_IPQ5424_HW10, }; enum ath12k_firmware_mode { diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c index 7e2cf0fb2085ab014fc14a5c81074802674b154e..866de53f37bb5af94e16c796a0052fda39eb4ea8 100644 --- a/drivers/net/wireless/ath/ath12k/hw.c +++ b/drivers/net/wireless/ath/ath12k/hw.c @@ -1590,6 +1590,84 @@ static const struct ath12k_hw_params ath12k_hw_params[] = { .ce_remap = &ath12k_ce_remap_ipq5332, .bdf_addr_offset = 0xC00000, + .dp_primary_link_only = true, + }, + { + .name = "ipq5424 hw1.0", + .hw_rev = ATH12K_HW_IPQ5424_HW10, + .fw = { + .dir = "IPQ5424/hw1.0", + .board_size = 256 * 1024, + .cal_offset = 128 * 1024, + .m3_loader = ath12k_m3_fw_loader_remoteproc, + }, + .max_radios = 1, + .single_pdev_only = false, + .qmi_service_ins_id = ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ5332, + .internal_sleep_clock = false, + + .hw_ops = &qcn9274_ops, + .regs = NULL, + .ring_mask = &ath12k_hw_ring_mask_ipq5332, + + .host_ce_config = ath12k_host_ce_config_ipq5332, + .ce_count = 12, + .target_ce_config = ath12k_target_ce_config_wlan_ipq5332, + .target_ce_count = 12, + .svc_to_ce_map = ath12k_target_service_to_ce_map_wlan_ipq5332, + .svc_to_ce_map_len = 18, + + .hal_params = &ath12k_hw_hal_params_ipq5332, + + .rxdma1_enable = false, + .num_rxdma_per_pdev = 1, + .num_rxdma_dst_ring = 0, + .rx_mac_buf_ring = false, + .vdev_start_delay = false, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_MESH_POINT), + .supports_monitor = false, + + .idle_ps = false, + .download_calib = true, + .supports_suspend = false, + .tcl_ring_retry = true, + .reoq_lut_support = false, + .supports_shadow_regs = false, + + .num_tcl_banks = 48, + .max_tx_ring = 4, + + .wmi_init = &ath12k_wmi_init_qcn9274, + + .hal_ops = &hal_qcn9274_ops, + + .qmi_cnss_feature_bitmap = BIT(CNSS_QDSS_CFG_MISS_V01), + + .rfkill_pin = 0, + .rfkill_cfg = 0, + .rfkill_on_level = 0, + + .rddm_size = 0, + + .def_num_link = 0, + .max_mlo_peer = 256, + + .otp_board_id_register = 0, + + .supports_sta_ps = false, + + .acpi_guid = NULL, + .supports_dynamic_smps_6ghz = false, + .iova_mask = 0, + .supports_aspm = false, + + .ce_ie_addr = NULL, + .ce_remap = NULL, + .bdf_addr_offset = 0x940000, + .dp_primary_link_only = true, }, }; From patchwork Sun May 18 18:22:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 891096 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 851561D6DBB; Sun, 18 May 2025 18:23:26 +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=1747592608; cv=none; b=IYf8t4Ri3BOGDS2g7PeyxqJ5KQbilUKCKV0aURkMRYESRT2zPt5ffTFCDu3isKmXJ/DPpjsi+1og94POYAHtDkrI+SqIGu3LIG/jFKu5fBNTmJA7AZFymxANXv4Wo8GodLY5a6DSRP1uQDKDPY57WtW13tjlmsNgKwtu5aUkzTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747592608; c=relaxed/simple; bh=dsjBw3PmODyz58zH9PCQXJg4HkX98omxrycVnmyNtho=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=IvqSmrYHlgljNeKM4lTWXdqhSF/Hdxu6BE6tH1Yt5aoARumr3PmX9no6Yz92y3sSb7+y3SyszuJGfj5XP8u4Cp6Qp9/L0CS8rzBnycVHB/s/5P3OtRHb6zzty4YQVGX6TJjrBkywD+TRaWydWx7E7Sq1t+SyNAshB7IORrQ9k/E= 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=i4350nT4; 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="i4350nT4" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54IGCThw024885; Sun, 18 May 2025 18:23:06 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= cnc37N2e3+pJ2Ag2byaRp/fTFyiZrRf6d4dkcepCPEo=; b=i4350nT4/Y990wIC mJMlij2ZzYzWfsqVLz6ueklPSNEA0EJQem+Thq2mJonlZ+028M8bt26xCrcrL+W/ Ir6JHXhjiAL7tGawYbcFYJCVzme5a59bABFLegzdlHymiTMyO8nrMRe3Ng5XCNVf 8rxoZlDZrPabfCOtyZXIoI7EXpPOXBEyr5ALzWxpWc3WLQTo0JAu+sWzj2VuQTG1 suRPU1zJjmRdRvk5NwRufhs/iSsGtsv2LVXlcPc9ND9DwQEY69NlxeYPDtW9aOXR dRovEI+lEvyFXc4NB033oNtaSFqGChxhlzMc3XvPDbkVEp/jlfHzJYndoZ/5uwYK FCwHSg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46pkr9t8ej-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:05 +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 54IIN5WA002265 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:05 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; Sun, 18 May 2025 11:23:01 -0700 From: Raj Kumar Bhagat Date: Sun, 18 May 2025 23:52:30 +0530 Subject: [PATCH ath-next v2 3/5] wifi: ath12k: add ath12k_hw_regs for IPQ5424 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250518-ath12k-ipq5424-v2-3-ef81b833dc97@quicinc.com> References: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> In-Reply-To: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> To: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson CC: , , , , "Saravanakumar Duraisamy" , Raj Kumar Bhagat X-Mailer: b4 0.14.2 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: 5jWUGo-1Ya7FOopAuNQkvKZSnF2Z7moF X-Proofpoint-ORIG-GUID: 5jWUGo-1Ya7FOopAuNQkvKZSnF2Z7moF X-Authority-Analysis: v=2.4 cv=DdAXqutW c=1 sm=1 tr=0 ts=682a2589 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=dagU3uUzHk6l2Oo7QSMA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE4MDE3OSBTYWx0ZWRfX62/7zr5odhPC a7278YGaIEwjh0VVuqxFFeIXP9D/IDvzPDxDgMKe7Fb6vQXC7JCxGSSjlw08tb0ljBnNI8HXElN y26TDLKatNroJP0uAe7jsxj/VQRidC0nMY96c2p7z3KmOqUaszRjyhWqR1uK0Sqr4J3XDn3N7o1 NBGny19OUKKiMlJzkNltpDGvBSZ2DjOhCqO5dw6BHNmVii/A/bx11Qm1oiRlw50AeTr5Io3RvMR fCumP5KuBcI4KkQ3p/cb49hSNb2TbzeYYFhBdsYH0IcToWUxZbAjj6hl3PEnsWCqNDvKQFndhO4 giI3NG5t5yLhJ1O6NL2MPDbIRAUs807ry88NfCNX81HrFnUU5YIH0qoCWPW7wZLTmm69BKkzXH+ LVHRJXlr+F5/QqReb8cOY14kCbB1yjamP18Ji4az9qlO+L9C5QUciRDfct7JaHwy1zRc1gNo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-18_09,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=940 clxscore=1015 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505180179 From: Saravanakumar Duraisamy Add register addresses (ath12k_hw_regs) for new ath12k AHB based WiFi device IPQ5424. Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1 Signed-off-by: Saravanakumar Duraisamy Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/hal.h | 3 ++ drivers/net/wireless/ath/ath12k/hw.c | 87 ++++++++++++++++++++++++++++++++++- 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/hal.h b/drivers/net/wireless/ath/ath12k/hal.h index 0ee9c6b26dab4ef597c95fea6fdb58d9cf1a0941..3239f3a7526b510ca94c2a4ce0e9a26b77cdf914 100644 --- a/drivers/net/wireless/ath/ath12k/hal.h +++ b/drivers/net/wireless/ath/ath12k/hal.h @@ -383,6 +383,9 @@ struct ath12k_base; #define HAL_IPQ5332_CE_WFSS_REG_BASE 0x740000 #define HAL_IPQ5332_CE_SIZE 0x100000 +#define HAL_IPQ5424_CE_WFSS_REG_BASE 0x200000 +#define HAL_IPQ5424_CE_SIZE 0x100000 + enum hal_srng_ring_id { HAL_SRNG_RING_ID_REO2SW0 = 0, HAL_SRNG_RING_ID_REO2SW1, diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c index 866de53f37bb5af94e16c796a0052fda39eb4ea8..05e2010173340bc3c0481aadf710a6894efd92bb 100644 --- a/drivers/net/wireless/ath/ath12k/hw.c +++ b/drivers/net/wireless/ath/ath12k/hw.c @@ -1132,6 +1132,91 @@ static const struct ath12k_hw_regs ipq5332_regs = { HAL_IPQ5332_CE_WFSS_REG_BASE, }; +static const struct ath12k_hw_regs ipq5424_regs = { + /* SW2TCL(x) R0 ring configuration address */ + .hal_tcl1_ring_id = 0x00000918, + .hal_tcl1_ring_misc = 0x00000920, + .hal_tcl1_ring_tp_addr_lsb = 0x0000092c, + .hal_tcl1_ring_tp_addr_msb = 0x00000930, + .hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000940, + .hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000944, + .hal_tcl1_ring_msi1_base_lsb = 0x00000958, + .hal_tcl1_ring_msi1_base_msb = 0x0000095c, + .hal_tcl1_ring_base_lsb = 0x00000910, + .hal_tcl1_ring_base_msb = 0x00000914, + .hal_tcl1_ring_msi1_data = 0x00000960, + .hal_tcl2_ring_base_lsb = 0x00000988, + .hal_tcl_ring_base_lsb = 0x00000b68, + + /* TCL STATUS ring address */ + .hal_tcl_status_ring_base_lsb = 0x00000d48, + + /* REO DEST ring address */ + .hal_reo2_ring_base = 0x00000578, + .hal_reo1_misc_ctrl_addr = 0x00000b9c, + .hal_reo1_sw_cookie_cfg0 = 0x0000006c, + .hal_reo1_sw_cookie_cfg1 = 0x00000070, + .hal_reo1_qdesc_lut_base0 = 0x00000074, + .hal_reo1_qdesc_lut_base1 = 0x00000078, + .hal_reo1_ring_base_lsb = 0x00000500, + .hal_reo1_ring_base_msb = 0x00000504, + .hal_reo1_ring_id = 0x00000508, + .hal_reo1_ring_misc = 0x00000510, + .hal_reo1_ring_hp_addr_lsb = 0x00000514, + .hal_reo1_ring_hp_addr_msb = 0x00000518, + .hal_reo1_ring_producer_int_setup = 0x00000524, + .hal_reo1_ring_msi1_base_lsb = 0x00000548, + .hal_reo1_ring_msi1_base_msb = 0x0000054C, + .hal_reo1_ring_msi1_data = 0x00000550, + .hal_reo1_aging_thres_ix0 = 0x00000B28, + .hal_reo1_aging_thres_ix1 = 0x00000B2C, + .hal_reo1_aging_thres_ix2 = 0x00000B30, + .hal_reo1_aging_thres_ix3 = 0x00000B34, + + /* REO Exception ring address */ + .hal_reo2_sw0_ring_base = 0x000008c0, + + /* REO Reinject ring address */ + .hal_sw2reo_ring_base = 0x00000320, + .hal_sw2reo1_ring_base = 0x00000398, + + /* REO cmd ring address */ + .hal_reo_cmd_ring_base = 0x000002A8, + + /* REO status ring address */ + .hal_reo_status_ring_base = 0x00000aa0, + + /* WBM idle link ring address */ + .hal_wbm_idle_ring_base_lsb = 0x00000d3c, + .hal_wbm_idle_ring_misc_addr = 0x00000d4c, + .hal_wbm_r0_idle_list_cntl_addr = 0x00000240, + .hal_wbm_r0_idle_list_size_addr = 0x00000244, + .hal_wbm_scattered_ring_base_lsb = 0x00000250, + .hal_wbm_scattered_ring_base_msb = 0x00000254, + .hal_wbm_scattered_desc_head_info_ix0 = 0x00000260, + .hal_wbm_scattered_desc_head_info_ix1 = 0x00000264, + .hal_wbm_scattered_desc_tail_info_ix0 = 0x00000270, + .hal_wbm_scattered_desc_tail_info_ix1 = 0x00000274, + .hal_wbm_scattered_desc_ptr_hp_addr = 0x0000027c, + + /* SW2WBM release ring address */ + .hal_wbm_sw_release_ring_base_lsb = 0x0000037c, + + /* WBM2SW release ring address */ + .hal_wbm0_release_ring_base_lsb = 0x00000e08, + .hal_wbm1_release_ring_base_lsb = 0x00000e80, + + /* CE relative address */ + .hal_umac_ce0_src_reg_base = 0x00200000 - + HAL_IPQ5424_CE_WFSS_REG_BASE, + .hal_umac_ce0_dest_reg_base = 0x00201000 - + HAL_IPQ5424_CE_WFSS_REG_BASE, + .hal_umac_ce1_src_reg_base = 0x00202000 - + HAL_IPQ5424_CE_WFSS_REG_BASE, + .hal_umac_ce1_dest_reg_base = 0x00203000 - + HAL_IPQ5424_CE_WFSS_REG_BASE, +}; + static const struct ath12k_hw_regs wcn7850_regs = { /* SW2TCL(x) R0 ring configuration address */ .hal_tcl1_ring_id = 0x00000908, @@ -1607,7 +1692,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = { .internal_sleep_clock = false, .hw_ops = &qcn9274_ops, - .regs = NULL, + .regs = &ipq5424_regs, .ring_mask = &ath12k_hw_ring_mask_ipq5332, .host_ce_config = ath12k_host_ce_config_ipq5332, From patchwork Sun May 18 18:22:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 891095 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 DF27C20D509; Sun, 18 May 2025 18:23:27 +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=1747592609; cv=none; b=A93vzBhZt/nBV6np20BH16xrhHWQXpDlKEq4y3GqYRC1bhn8VgA/nXsPdpQoxPX+5f9efxb9Hc6jf+y8W3cTsyoqr0vmrhdpxYKMpRUtc/WhsutPPVMEQJ5kuxwTCjD5lBsgLcX14yhx72ZYJL2il4ytPJOSRblHXC7CMwz1AiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747592609; c=relaxed/simple; bh=536Tuzvzvha6zeRlaxBJCzpsBBHN9FlgJEYTLT56Ql8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=quoqvzzlwTy6F9QpYppp/HV8kUmiahMGoAj1NCOXIyO824SPZE1KN/HZjnpx3SMp2BILpvLbzt4zslvfh2aMFaGLL9V72xLXEhuYl0QT7OnrKqz9w2vjvHSQMbMZNFzB7kXDTe+e/+0wILSyHfwDlop3+WXhg/SdIwYtXMy9+T0= 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=D7dGIE4v; 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="D7dGIE4v" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54IHWuA1024893; Sun, 18 May 2025 18:23:09 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= uYaUhtINZcWT6JkhUGSbCfjmleK1bBZQc/aVQAQWx2w=; b=D7dGIE4vISG7AN1m VhWSttbeVTUlcwpBAl2OMzk2uwCrnJOB1lIb1QNNEelr6qBikiktKctp5Dmm8L0d uUtv7ySr7EdGSrVZq0vhta6ztL3nklYe3Q02/2TNHtYRxKsBCFy3yyatxC8VaUS0 GrckT6Eg0GjzO2g7N98geGGsKCT1ROnjJU52VC28UB8nuMYtA5HMRk8QWl2uG67i KKw0OQxkMGVEV3lX28bwhYaz0VXZuW7gB1VsnjS027JdWxq9eux6QYBWknHwppK1 uC/tiOZW4cu6sdtLlnZeocus4YuXkvTfNsrt5tWr85U2M9RRwoNjxrrDMm3ywYZT QFqZ3Q== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46pjm4ta3j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:09 +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 54IIN8OO005499 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:08 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; Sun, 18 May 2025 11:23:05 -0700 From: Raj Kumar Bhagat Date: Sun, 18 May 2025 23:52:31 +0530 Subject: [PATCH ath-next v2 4/5] wifi: ath12k: Add CE remap hardware parameters for IPQ5424 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250518-ath12k-ipq5424-v2-4-ef81b833dc97@quicinc.com> References: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> In-Reply-To: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> To: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson CC: , , , , "Saravanakumar Duraisamy" , Raj Kumar Bhagat X-Mailer: b4 0.14.2 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-Authority-Analysis: v=2.4 cv=dIimmPZb c=1 sm=1 tr=0 ts=682a258d cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=m1Vj78-zd62aTB8gf0QA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: sjMMSo02zXP1ejqrRlkUf_fOlg56C4fl X-Proofpoint-GUID: sjMMSo02zXP1ejqrRlkUf_fOlg56C4fl X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE4MDE3OSBTYWx0ZWRfX7y+vpzVT8IAC J9LDwVmJwklvKR5iRFn+n3yhtLEfMpu9WLmG597Stq+E8duG9fqnE17PeHs8gAklTGnHs9z1kmQ kIiDWfyfIYDYdZlvYAZYitzSMJbRr5F5wG/wI4fMbnNkXqWer1uwoAcYrWOEG4eKhK3FJLKI01i y8eFZykrnpdxio8WDpMeRX/WzIL39wpAQ+H4Dc8PgsCm37Kunk0+LhwNYIgXcTscSBAcSZauf// lQRw0OKhS7cUDJ4T2z/dewBD2xOvzfGKM+W80GdHZkzNG0W/7iDc5Vj7firwt51Vo4Jm5c6mn2q XsW8Txt1tb+l+FanceV/OVuj+HaR9D//NKDUaFhsjvVsl1v3iffAcXrDwL4m2moZ38L9MlV85IG 5Dj/YisBFmF6w/B+spqSgpsE07agdbIAFG0hUCXwckOtdzN7txplKV4GwSRBEn9o7iVQnbqf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-18_09,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505180179 From: Saravanakumar Duraisamy Add CE remap hardware parameters for new Ath12k AHB device IPQ5424. Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1 Signed-off-by: Saravanakumar Duraisamy Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/ahb.c | 2 +- drivers/net/wireless/ath/ath12k/ce.h | 13 +++++++++---- drivers/net/wireless/ath/ath12k/hw.c | 21 ++++++++++++++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c index 636dfe237a7946c621b304268d057c1a6228b1c8..40690cef7e57d121c6c41765048d8e64c9320b02 100644 --- a/drivers/net/wireless/ath/ath12k/ahb.c +++ b/drivers/net/wireless/ath/ath12k/ahb.c @@ -935,7 +935,7 @@ static int ath12k_ahb_resource_init(struct ath12k_base *ab) goto err_mem_unmap; } ab->ce_remap = true; - ab->ce_remap_base_addr = HAL_IPQ5332_CE_WFSS_REG_BASE; + ab->ce_remap_base_addr = ce_remap->base; } ab_ahb->xo_clk = devm_clk_get(ab->dev, "xo"); diff --git a/drivers/net/wireless/ath/ath12k/ce.h b/drivers/net/wireless/ath/ath12k/ce.h index 57f75899ee03d63479698011fc081936677f8698..3ac7f28d2c9282e95ee731b86232f71ca06679c1 100644 --- a/drivers/net/wireless/ath/ath12k/ce.h +++ b/drivers/net/wireless/ath/ath12k/ce.h @@ -38,10 +38,15 @@ #define PIPEDIR_INOUT 3 /* bidirectional */ #define PIPEDIR_INOUT_H2H 4 /* bidirectional, host to host */ -/* CE address/mask */ -#define CE_HOST_IE_ADDRESS 0x75804C -#define CE_HOST_IE_2_ADDRESS 0x758050 -#define CE_HOST_IE_3_ADDRESS CE_HOST_IE_ADDRESS +/* IPQ5332 CE address/mask */ +#define CE_HOST_IPQ5332_IE_ADDRESS 0x75804C +#define CE_HOST_IPQ5332_IE_2_ADDRESS 0x758050 +#define CE_HOST_IPQ5332_IE_3_ADDRESS CE_HOST_IPQ5332_IE_ADDRESS + +/* IPQ5424 CE address/mask */ +#define CE_HOST_IPQ5424_IE_ADDRESS 0x21804C +#define CE_HOST_IPQ5424_IE_2_ADDRESS 0x218050 +#define CE_HOST_IPQ5424_IE_3_ADDRESS CE_HOST_IPQ5424_IE_ADDRESS #define CE_HOST_IE_3_SHIFT 0xC diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c index 05e2010173340bc3c0481aadf710a6894efd92bb..75042298888ca70ca55a2793b12891e45db618e4 100644 --- a/drivers/net/wireless/ath/ath12k/hw.c +++ b/drivers/net/wireless/ath/ath12k/hw.c @@ -1329,9 +1329,15 @@ static const struct ath12k_hw_hal_params ath12k_hw_hal_params_ipq5332 = { }; static const struct ce_ie_addr ath12k_ce_ie_addr_ipq5332 = { - .ie1_reg_addr = CE_HOST_IE_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, - .ie2_reg_addr = CE_HOST_IE_2_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, - .ie3_reg_addr = CE_HOST_IE_3_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, + .ie1_reg_addr = CE_HOST_IPQ5332_IE_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, + .ie2_reg_addr = CE_HOST_IPQ5332_IE_2_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, + .ie3_reg_addr = CE_HOST_IPQ5332_IE_3_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE, +}; + +static const struct ce_ie_addr ath12k_ce_ie_addr_ipq5424 = { + .ie1_reg_addr = CE_HOST_IPQ5424_IE_ADDRESS - HAL_IPQ5424_CE_WFSS_REG_BASE, + .ie2_reg_addr = CE_HOST_IPQ5424_IE_2_ADDRESS - HAL_IPQ5424_CE_WFSS_REG_BASE, + .ie3_reg_addr = CE_HOST_IPQ5424_IE_3_ADDRESS - HAL_IPQ5424_CE_WFSS_REG_BASE, }; static const struct ce_remap ath12k_ce_remap_ipq5332 = { @@ -1339,6 +1345,11 @@ static const struct ce_remap ath12k_ce_remap_ipq5332 = { .size = HAL_IPQ5332_CE_SIZE, }; +static const struct ce_remap ath12k_ce_remap_ipq5424 = { + .base = HAL_IPQ5424_CE_WFSS_REG_BASE, + .size = HAL_IPQ5424_CE_SIZE, +}; + static const struct ath12k_hw_params ath12k_hw_params[] = { { .name = "qcn9274 hw1.0", @@ -1749,8 +1760,8 @@ static const struct ath12k_hw_params ath12k_hw_params[] = { .iova_mask = 0, .supports_aspm = false, - .ce_ie_addr = NULL, - .ce_remap = NULL, + .ce_ie_addr = &ath12k_ce_ie_addr_ipq5424, + .ce_remap = &ath12k_ce_remap_ipq5424, .bdf_addr_offset = 0x940000, .dp_primary_link_only = true, From patchwork Sun May 18 18:22:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 891691 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 851B11FAC23; Sun, 18 May 2025 18:23:26 +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=1747592608; cv=none; b=LDrk6ebc4UeQ1z2vtFDHlLgLbpE5i4Jugrb9tMOjkmXL6RBtAsymeFRod82onyTa+7tN4afjZkTiC0TKx284tUapLKSxsNCh7xElnGVF9/PJEbu/HZZLuFkrC0Ikc1FELyNKsQ49AU4oyXLRA/ZgCJJbf7oBtjG44vkralqOEbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747592608; c=relaxed/simple; bh=MsNdBs/3Q+jNyguJm1dlmEu6PKBSuhmq477YGcPot58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=ZbxA0RIScrF3oVAe2jXzyfXO6KXkPHyPDBfwcxAiA6WMAKZS72goQvBDQb3EojBMal6SpztOd5fDnhSCFUr36FYFyyhYxYgSEUpkJhskvldsOLaYDUy191FOfCI/ylTJldJueVX1A29RkM4ZigbF+Acy5XoFPeTLNhayH7ugojk= 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=OeNxmXGH; 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="OeNxmXGH" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54IIA2Re029077; Sun, 18 May 2025 18:23:12 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= I/4l9n3MNcIl9r+2nFmOXILpdKv0avHCmu00r9eveT8=; b=OeNxmXGHCMGLx4e2 ZMGj8QXAuPMLgL83O1mMaNmF4f1TigqHnZCULN0YJY5oYPWbiaioFGEyZxB0vACS znKZR12UFIZyCVbtKGXMD+skESK+GKh9aCJ70XxLpqUnBYA+ECFON28rTlc3dFLR BTig8eGBM04JYTlcE2L0VdnMCctA83FU1m7bOqZ1FmtWt3EdezV/bxkOH/mofp1B yj5O68W9rpsbnCN+rj9mnBokewl8z8W25jcRmWR0ldwHCQusD2gzdgqQFh3Z6oQU z4CTNb6vK683pSCvYHCevejrY4HsxunZCwnQyi7yJrt+5l+Xf3gbBzxapKpmHdhe csUgog== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46pk7g28tx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:12 +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 54IINCXa002342 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 18 May 2025 18:23:12 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; Sun, 18 May 2025 11:23:08 -0700 From: Raj Kumar Bhagat Date: Sun, 18 May 2025 23:52:32 +0530 Subject: [PATCH ath-next v2 5/5] wifi: ath12k: Enable IPQ5424 WiFi device support Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250518-ath12k-ipq5424-v2-5-ef81b833dc97@quicinc.com> References: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> In-Reply-To: <20250518-ath12k-ipq5424-v2-0-ef81b833dc97@quicinc.com> To: Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeff Johnson CC: , , , , "Sowmiya Sree Elavalagan" , Saravanakumar Duraisamy , Raj Kumar Bhagat X-Mailer: b4 0.14.2 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-ORIG-GUID: 1RkriNYIfdnlOrwHiHVZOOulIyXdZe_q X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE4MDE3OSBTYWx0ZWRfX9sXBlJeq4YNF MVpj/HA17h9QTlSFeCmXMIuS6oAQ6oGcPJefa2jfokqpAWPmzplhV0yRrwDvgy6OUb9M4X6JUqH tl2ZdfBRtfPybyV2L9l/Wzfe5i40ooE9vS/mK0Ekjt6jEI26Ex4XNggJjXo5dez6jYoNHffgAKw NKn8Pm+OcKd+KhMHY0gNy/6K8PmU9BRLQKNnwFeqBZVLT6Ys+No0p0gp9uV7qt+e0xaIEYv+uDP qjbrBIL17gE007UHnzthKNu+G0wTfSrkT1mTxDBMlVHsho+uca83dEo0zTjqZH2fmB6RLp361SS QvWwPHHdFZcJdDfu9Q6Pb8z15LGSZtz/F/uQpSQGakkyhFOXFz7b80VhgsT1zBvuJ4DLhA6Y8mj 3sjuCq40/YHgHmSL0TJVlRIVOCp8MU8NcGhINBoKKTtgYe2LRq/ajP7/td5ai6Fxzqg6bT3a X-Authority-Analysis: v=2.4 cv=CKkqXQrD c=1 sm=1 tr=0 ts=682a2590 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=-7epug4WMcN2zn_RaXQA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: 1RkriNYIfdnlOrwHiHVZOOulIyXdZe_q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-18_09,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 impostorscore=0 phishscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505180179 From: Sowmiya Sree Elavalagan Currently, ath12k AHB (in IPQ5332) uses SCM calls to authenticate the firmware image to bring up userpd. From IPQ5424 onwards, Q6 firmware can directly communicate with the Trusted Management Engine - Lite (TME-L), eliminating the need for SCM calls for userpd bring-up. Hence, to enable IPQ5424 device support, use qcom_mdt_load_no_init() and skip the SCM call as Q6 will directly authenticate the userpd firmware. Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.5-01053-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sowmiya Sree Elavalagan Co-developed-by: Saravanakumar Duraisamy Signed-off-by: Saravanakumar Duraisamy Co-developed-by: Raj Kumar Bhagat Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/ahb.c | 114 +++++++++++++++++++++------------- drivers/net/wireless/ath/ath12k/ahb.h | 17 ++++- 2 files changed, 86 insertions(+), 45 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c index 40690cef7e57d121c6c41765048d8e64c9320b02..f5a2c176d03d6eebb119165a7fa1a394cf3ef3b2 100644 --- a/drivers/net/wireless/ath/ath12k/ahb.c +++ b/drivers/net/wireless/ath/ath12k/ahb.c @@ -16,15 +16,6 @@ #include "debug.h" #include "hif.h" -static const struct of_device_id ath12k_ahb_of_match[] = { - { .compatible = "qcom,ipq5332-wifi", - .data = (void *)ATH12K_HW_IPQ5332_HW10, - }, - { } -}; - -MODULE_DEVICE_TABLE(of, ath12k_ahb_of_match); - #define ATH12K_IRQ_CE0_OFFSET 4 #define ATH12K_MAX_UPDS 1 #define ATH12K_UPD_IRQ_WRD_LEN 18 @@ -348,9 +339,9 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab) struct reserved_mem *rmem = NULL; unsigned long time_left; phys_addr_t mem_phys; + u32 pasid, userpd_id; void *mem_region; size_t mem_size; - u32 pasid; int ret; rmem = ath12k_core_get_reserved_mem(ab, 0); @@ -366,8 +357,9 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab) return PTR_ERR(mem_region); } + userpd_id = ab_ahb->ahb_data->userpd_id; snprintf(fw_name, sizeof(fw_name), "%s/%s/%s%d%s", ATH12K_FW_DIR, - ab->hw_params->fw.dir, ATH12K_AHB_FW_PREFIX, ab_ahb->userpd_id, + ab->hw_params->fw.dir, ATH12K_AHB_FW_PREFIX, userpd_id, ATH12K_AHB_FW_SUFFIX); ret = request_firmware(&fw, fw_name, dev); @@ -385,12 +377,12 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab) goto err_fw; } - pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) | + pasid = (u32_encode_bits(userpd_id, ATH12K_USERPD_ID_MASK)) | ATH12K_AHB_UPD_SWID; /* Load FW image to a reserved memory location */ - ret = qcom_mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys, mem_size, - &mem_phys); + ret = ab_ahb->ahb_data->ahb_ops->mdt_load(dev, fw, fw_name, pasid, mem_region, + mem_phys, mem_size, &mem_phys); if (ret) { ath12k_err(ab, "Failed to load MDT segments: %d\n", ret); goto err_fw; @@ -421,11 +413,13 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab) goto err_fw2; } - /* Authenticate FW image using peripheral ID */ - ret = qcom_scm_pas_auth_and_reset(pasid); - if (ret) { - ath12k_err(ab, "failed to boot the remote processor %d\n", ret); - goto err_fw2; + if (ab_ahb->ahb_data->scm_auth_enabled) { + /* Authenticate FW image using peripheral ID */ + ret = qcom_scm_pas_auth_and_reset(pasid); + if (ret) { + ath12k_err(ab, "failed to boot the remote processor %d\n", ret); + goto err_fw2; + } } /* Instruct Q6 to spawn userPD thread */ @@ -454,7 +448,7 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab) qcom_smem_state_update_bits(ab_ahb->spawn_state, BIT(ab_ahb->spawn_bit), 0); - ath12k_dbg(ab, ATH12K_DBG_AHB, "UserPD%d is now UP\n", ab_ahb->userpd_id); + ath12k_dbg(ab, ATH12K_DBG_AHB, "UserPD%d is now UP\n", userpd_id); err_fw2: release_firmware(fw2); @@ -467,7 +461,7 @@ static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend) { struct ath12k_ahb *ab_ahb = ath12k_ab_to_ahb(ab); unsigned long time_left; - u32 pasid; + u32 pasid, userpd_id; int ret; qcom_smem_state_update_bits(ab_ahb->stop_state, BIT(ab_ahb->stop_bit), @@ -482,13 +476,16 @@ static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend) qcom_smem_state_update_bits(ab_ahb->stop_state, BIT(ab_ahb->stop_bit), 0); - pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) | - ATH12K_AHB_UPD_SWID; - /* Release the firmware */ - ret = qcom_scm_pas_shutdown(pasid); - if (ret) - ath12k_err(ab, "scm pas shutdown failed for userPD%d: %d\n", - ab_ahb->userpd_id, ret); + if (ab_ahb->ahb_data->scm_auth_enabled) { + userpd_id = ab_ahb->ahb_data->userpd_id; + pasid = (u32_encode_bits(userpd_id, ATH12K_USERPD_ID_MASK)) | + ATH12K_AHB_UPD_SWID; + /* Release the firmware */ + ret = qcom_scm_pas_shutdown(pasid); + if (ret) + ath12k_err(ab, "scm pas shutdown failed for userPD%d\n", + userpd_id); + } } static void ath12k_ahb_init_qmi_ce_config(struct ath12k_base *ab) @@ -698,6 +695,14 @@ static int ath12k_ahb_map_service_to_pipe(struct ath12k_base *ab, u16 service_id return 0; } +static const struct ath12k_ahb_ops ahb_ops_ipq5332 = { + .mdt_load = qcom_mdt_load, +}; + +static const struct ath12k_ahb_ops ahb_ops_ipq5424 = { + .mdt_load = qcom_mdt_load_no_init, +}; + static const struct ath12k_hif_ops ath12k_ahb_hif_ops_ipq5332 = { .start = ath12k_ahb_start, .stop = ath12k_ahb_stop, @@ -747,7 +752,7 @@ static int ath12k_ahb_config_rproc_irq(struct ath12k_base *ab) return -ENOMEM; scnprintf(upd_irq_name, ATH12K_UPD_IRQ_WRD_LEN, "UserPD%u-%s", - ab_ahb->userpd_id, ath12k_userpd_irq[i]); + ab_ahb->ahb_data->userpd_id, ath12k_userpd_irq[i]); ret = devm_request_threaded_irq(&ab->pdev->dev, ab_ahb->userpd_irq_num[i], NULL, ath12k_userpd_irq_handler, IRQF_TRIGGER_RISING | IRQF_ONESHOT, @@ -991,10 +996,8 @@ static void ath12k_ahb_resource_deinit(struct ath12k_base *ab) static int ath12k_ahb_probe(struct platform_device *pdev) { struct ath12k_base *ab; - const struct ath12k_hif_ops *hif_ops; struct ath12k_ahb *ab_ahb; - enum ath12k_hw_rev hw_rev; - u32 addr, userpd_id; + u32 addr; int ret; ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); @@ -1008,24 +1011,19 @@ static int ath12k_ahb_probe(struct platform_device *pdev) if (!ab) return -ENOMEM; - hw_rev = (enum ath12k_hw_rev)(kernel_ulong_t)of_device_get_match_data(&pdev->dev); - switch (hw_rev) { - case ATH12K_HW_IPQ5332_HW10: - hif_ops = &ath12k_ahb_hif_ops_ipq5332; - userpd_id = ATH12K_IPQ5332_USERPD_ID; - break; - default: + ab_ahb = ath12k_ab_to_ahb(ab); + ab_ahb->ab = ab; + ab_ahb->ahb_data = + (struct ath12k_ahb_probe_data *)of_device_get_match_data(&pdev->dev); + if (!ab_ahb->ahb_data) { ret = -EOPNOTSUPP; goto err_core_free; } - ab->hif.ops = hif_ops; + ab->hif.ops = ab_ahb->ahb_data->hif_ops; + ab->hw_rev = ab_ahb->ahb_data->hw_rev; ab->pdev = pdev; - ab->hw_rev = hw_rev; platform_set_drvdata(pdev, ab); - ab_ahb = ath12k_ab_to_ahb(ab); - ab_ahb->ab = ab; - ab_ahb->userpd_id = userpd_id; /* Set fixed_mem_region to true for platforms that support fixed memory * reservation from DT. If memory is reserved from DT for FW, ath12k driver @@ -1136,6 +1134,34 @@ static void ath12k_ahb_remove(struct platform_device *pdev) ath12k_ahb_free_resources(ab); } +static const struct ath12k_ahb_probe_data ath12k_ahb_ipq5332 = { + .hw_rev = ATH12K_HW_IPQ5332_HW10, + .userpd_id = ATH12K_IPQ5332_USERPD_ID, + .scm_auth_enabled = true, + .ahb_ops = &ahb_ops_ipq5332, + .hif_ops = &ath12k_ahb_hif_ops_ipq5332, +}; + +static const struct ath12k_ahb_probe_data ath12k_ahb_ipq5424 = { + .hw_rev = ATH12K_HW_IPQ5424_HW10, + .userpd_id = ATH12K_IPQ5332_USERPD_ID, + .scm_auth_enabled = false, + .ahb_ops = &ahb_ops_ipq5424, + .hif_ops = &ath12k_ahb_hif_ops_ipq5332, +}; + +static const struct of_device_id ath12k_ahb_of_match[] = { + { .compatible = "qcom,ipq5332-wifi", + .data = (void *)&ath12k_ahb_ipq5332, + }, + { .compatible = "qcom,ipq5424-wifi", + .data = (void *)&ath12k_ahb_ipq5424, + }, + { } +}; + +MODULE_DEVICE_TABLE(of, ath12k_ahb_of_match); + static struct platform_driver ath12k_ahb_driver = { .driver = { .name = "ath12k_ahb", diff --git a/drivers/net/wireless/ath/ath12k/ahb.h b/drivers/net/wireless/ath/ath12k/ahb.h index d56244b20a6a667cf3730dc1ce38a22b0e86ffca..84415008331a3d719573d4f88e1596f460b1522c 100644 --- a/drivers/net/wireless/ath/ath12k/ahb.h +++ b/drivers/net/wireless/ath/ath12k/ahb.h @@ -43,6 +43,21 @@ enum ath12k_ahb_userpd_irq { struct ath12k_base; +struct ath12k_ahb_ops { + int (*mdt_load)(struct device *dev, const struct firmware *fw, + const char *firmware, int pas_id, void *mem_region, + phys_addr_t mem_phys, size_t mem_size, + phys_addr_t *reloc_base); +}; + +struct ath12k_ahb_probe_data { + enum ath12k_hw_rev hw_rev; + u32 userpd_id; + bool scm_auth_enabled; + const struct ath12k_ahb_ops *ahb_ops; + const struct ath12k_hif_ops *hif_ops; +}; + struct ath12k_ahb { struct ath12k_base *ab; struct rproc *tgt_rproc; @@ -55,10 +70,10 @@ struct ath12k_ahb { struct completion userpd_spawned; struct completion userpd_ready; struct completion userpd_stopped; - u32 userpd_id; u32 spawn_bit; u32 stop_bit; int userpd_irq_num[ATH12K_USERPD_MAX_IRQ]; + const struct ath12k_ahb_probe_data *ahb_data; }; static inline struct ath12k_ahb *ath12k_ab_to_ahb(struct ath12k_base *ab)