From patchwork Thu Oct 24 07:41:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqing Pan X-Patchwork-Id: 13848474 X-Patchwork-Delegate: kvalo@adurom.com 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 2292A1A76B0; Thu, 24 Oct 2024 07:42:19 +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=1729755741; cv=none; b=Q84Dh3q6jMvEvjQOo3buiJGvnOLHCb0Uq/aZPiWE1FtJ/S3sbN/AXmp0Sq0KCPota6hjQjJyC40xmtXBKBSknxtwnxRRJ/o+hkxov42ktoUup2wSy8oSc2ame2nKYR9U6qGA4yJl7D9zTNSU6+lL0gzY6ZanjgIxam7aqZq1k+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729755741; c=relaxed/simple; bh=YrpthfNQ+GbzT8ZULqGupYFXckIUsqgDSEk29sp/mao=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lx7n5gF7+rbUztxqCFoL13g8Q1gFmavg3XRo/x6dgq63jPB+/yy+xFrZW+JD9Z88Ul86lw3WF03qZz9oK7DxhmPFwwA4mJKWaoXhT1P/3d74Gby3I4ifqbrkEwmrAWwyxunCs+9PiD1MEh3Hlv3D4oFhsjijFSxGThhmxXnRguA= 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=X+RN8FkU; 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="X+RN8FkU" 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 49NMbpgf025445; Thu, 24 Oct 2024 07:42:13 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= nveTTtWi/IOzGp+i8IafJAXKLu4PpCQzTMgEOopL/30=; b=X+RN8FkUHpLQko0t K/ecCC6NfK4iODQU0biXIvB46WxvEucMx2Ql7rryBww5neDGpGZfF/FzUxfWHEZh U5u1XHMFG4wi1NT/Bg7uXa+xk2SEuiosijhtoHCnawJduUKzNnIsIR+roM7h4FBw I4fNkMP/sQNR1O0bvXi58UoRHYTK+RTDZZ9lngJrcPQZcRmKDVs749UcCctsd7BX SiaWBbP3QP5jzd8AMdqT82KmDdBuXbCQQifj8PKx4bSZ/AvfD9HkbWM0M9Qa2L+H CR/o9NQx+uq0LAr0RK8JN+zq8B7ffjCYwc1vJBBhK93E8O+Ei8wRS0a1Kjom1lFh wS3Hvw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42em40cwtd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Oct 2024 07:42:09 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49O7g8Bp018415 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Oct 2024 07:42:08 GMT Received: from Z2-SFF-G9-MQ.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 24 Oct 2024 00:42:05 -0700 From: Miaoqing Pan To: , , , CC: , , , , , , , , Miaoqing Pan Subject: [RESEND PATCH v2 1/2] dt-bindings: net: wireless: ath11k-pci: add firmware-name property Date: Thu, 24 Oct 2024 15:41:43 +0800 Message-ID: <20241024074144.179868-2-quic_miaoqing@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241024074144.179868-1-quic_miaoqing@quicinc.com> References: <20241024074144.179868-1-quic_miaoqing@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: PhWEx4wJOuiEZ0BK7K3k6XZEq7PaynHb X-Proofpoint-GUID: PhWEx4wJOuiEZ0BK7K3k6XZEq7PaynHb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 impostorscore=0 spamscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 malwarescore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410240059 This is the same optional property that defined in qcom,ath10k.yaml. It's useful for the platform / board to specify firmware through device-tree. Signed-off-by: Miaoqing Pan --- .../devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml index a71fdf05bc1e..2aa81690f7d5 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml @@ -1,5 +1,6 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright (c) 2023 Linaro Limited +# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. %YAML 1.2 --- $id: http://devicetree.org/schemas/net/wireless/qcom,ath11k-pci.yaml# @@ -29,6 +30,12 @@ properties: string to uniquely identify variant of the calibration data for designs with colliding bus and device ids + firmware-name: + maxItems: 1 + description: + If present, a board or platform specific string used to lookup firmware + files for the device. + vddrfacmn-supply: description: VDD_RFA_CMN supply regulator handle From patchwork Thu Oct 24 07:41:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqing Pan X-Patchwork-Id: 13848473 X-Patchwork-Delegate: kvalo@adurom.com 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 CAEE41AC8B9; Thu, 24 Oct 2024 07:42: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=1729755740; cv=none; b=FLAb2HxpIuF1JYbT44fdAP1wOxVf4s43I8wLH2jD9qCzeT9TtPESg2FHgU3f8sa56GZUCZvh2oPxrnJ8Ff0YiELNtNyZVCC2/Ftsc5f/y6v4c9zEczMWVt8vA/ookhP8jk924FRATkxFor2ZR0zdvLg9fjwnuyiwwR5OYLHbM4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729755740; c=relaxed/simple; bh=qsRqvK76S3ups7ElipLSRytsqF4KKob6IkpG+FZ+TcE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Dw4dvXfmBPFV9aGaXQBeZhIaU+tENPozAsYROzkSsAia8eA5yPECw5kIWw4YaU7FjIzt4yesU1biJCsIWDC8ZCcpWGvQuBfvn/MuUwpRHIqNB25b76KqzdFMZCAIaDaelxcxrfSjump9juQ+rot08p2vKFc4vhaDnH7UarJFduI= 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=Nhotgdvi; 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="Nhotgdvi" 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 49NLNKTk025624; Thu, 24 Oct 2024 07:42:13 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= Bh6viNY/CMUSxXuYICO/0PagqIHUhjSm/VjBvclHGP4=; b=NhotgdvilXO4fXko 6zn33HzfnsHhsBuL/SEiAtw9fKZDRymxKGxDcr2Z1p26l9Qy4cgKMr5H3CK7PMGg 2vUd2asDLvEtMN+X7Cq73VkGqJjq04IakIS5fAwQXgcGdfE5VZ77/latKeX87xhz gJIrPEWqSppXlc9LNEQ1iCcK9cGolhnAp8PEGV6HArkm93vUdlJHdxDxlK7bsYsB 2VvPg6FHsC6FSsQCdRt/QR0a6WH8UX+C2JFD5fpkqHHfpySeWHD+AjIzmN8A/o7N VuK5X6RD9SGzS+A9SnamMhCwSGuV/dcMnTwuGeFXyLJ5ldG2uvhlQTuNaqlHMlFM 4vaOAA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42em40cwtj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Oct 2024 07:42:12 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49O7gBg9010103 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Oct 2024 07:42:11 GMT Received: from Z2-SFF-G9-MQ.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 24 Oct 2024 00:42:08 -0700 From: Miaoqing Pan To: , , , CC: , , , , , , , , Miaoqing Pan Subject: [RESEND PATCH v2 2/2] wifi: ath11k: support board-specific firmware overrides Date: Thu, 24 Oct 2024 15:41:44 +0800 Message-ID: <20241024074144.179868-3-quic_miaoqing@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241024074144.179868-1-quic_miaoqing@quicinc.com> References: <20241024074144.179868-1-quic_miaoqing@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: E_k9KHY1nt4Tq5jkynsrBzO-NP3J8YT2 X-Proofpoint-GUID: E_k9KHY1nt4Tq5jkynsrBzO-NP3J8YT2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 impostorscore=0 spamscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 malwarescore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410240059 QCA6698AQ IP core is the same as WCN6855 hw2.1, but it has different RF, IPA, thermal, RAM size and etc, so new firmware files used. This change allows board DT files to override the subdir of the firmware directory used to lookup the amss.bin and m3.bin. For example: - ath11k/WCN6855/hw2.1/amss.bin, ath11k/WCN6855/hw2.1/m3.bin: main firmware files, used by default - ath11k/WCN6855/hw2.1/qca6698aq/amss.bin, ath11k/WCN6855/hw2.1/qca6698aq/m3.bin Tested-on: QCA6698AQ hw2.1 PCI WLAN.HSP.1.1-04402-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1 Signed-off-by: Miaoqing Pan --- drivers/net/wireless/ath/ath11k/core.c | 16 ++++++++++++++++ drivers/net/wireless/ath/ath11k/core.h | 11 +++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index be67382c00f6..775e48551522 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -1178,6 +1178,22 @@ static int ath11k_core_create_chip_id_board_name(struct ath11k_base *ab, char *n ATH11K_BDF_NAME_CHIP_ID); } +void ath11k_core_create_firmware_path(struct ath11k_base *ab, + const char *filename, + void *buf, size_t buf_len) +{ const char *board_name = NULL; + + of_property_read_string(ab->dev->of_node, "firmware-name", &board_name); + + if (board_name) + snprintf(buf, buf_len, "%s/%s/%s/%s", ATH11K_FW_DIR, + ab->hw_params.fw.dir, board_name, filename); + else + snprintf(buf, buf_len, "%s/%s/%s", ATH11K_FW_DIR, + ab->hw_params.fw.dir, filename); +} +EXPORT_SYMBOL(ath11k_core_create_firmware_path); + const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, const char *file) { diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 09c37e19a168..ce4102cfed4d 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -1249,6 +1249,9 @@ bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab); const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, const char *filename); +void ath11k_core_create_firmware_path(struct ath11k_base *ab, + const char *filename, + void *buf, size_t buf_len); static inline const char *ath11k_scan_state_str(enum ath11k_scan_state state) { @@ -1295,14 +1298,6 @@ static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab, return ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; } -static inline void ath11k_core_create_firmware_path(struct ath11k_base *ab, - const char *filename, - void *buf, size_t buf_len) -{ - snprintf(buf, buf_len, "%s/%s/%s", ATH11K_FW_DIR, - ab->hw_params.fw.dir, filename); -} - static inline const char *ath11k_bus_str(enum ath11k_bus bus) { switch (bus) {