Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp520730lqb; Wed, 29 May 2024 02:56:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGNgldc4BGUEzxatdHYdS8hhDsCRHOHRjn51P22OThZUIfcZk3HdtPfG1kr1XOxRDMH7Id+MfTzlgxRVzHsCRXmddN/Dk3cGjlWgYZIA== X-Google-Smtp-Source: AGHT+IGh1xP4Mfp8qtZ9TmmH1hbpu3gXE8MUKRvW9mT+6HuaVehCamUyNBOsV5Tma9Xzu/sDa3XA X-Received: by 2002:a17:906:39cf:b0:a5c:f73d:67b3 with SMTP id a640c23a62f3a-a6265010976mr996412366b.63.1716976616254; Wed, 29 May 2024 02:56:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716976616; cv=pass; d=google.com; s=arc-20160816; b=01PTvNONHiISfPbx5PNFVokIO00TjkV0i61EA/KWpx/G5pC+5DrRpvA9ElDCrGrMpP WDSeNQHIGjonCqCHaWTYUFAHx2lzmCQHVGijNhcwNvLCGQdlltSmMTCEh1RSP3U7ATro OHkpmQxj3w/nGvbQn/li32HFHiptXwhBqgNR4/iSnMvT5uXm7lZDFBnvDXdZc8BLFg5Z 15XyUeVH22I0nPDkmO/a3grSRzFuxRHqE1bvwZuZj62VdZOa3UBlQOHvJ/+bbU2op7oF Iq/CfXwaTbiImz5mzWIcB/ivUG5Opu60QcxsqqSC4jAUeb2xfqALsjHuOLkuBsPkHg+w Z37g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=1YYxtp3uDjFvuqlbzB+Ymh6cpCWl04NNDyaoh1wKmaU=; fh=hXpNshll8NKcIVYmXMX8eXDtLBIyOmt5qcO0HpVmfZs=; b=Gjh26fqcqTOELzouu0b0I3VH5HbkuDBXV+cMtx+gXfQjkYmeSwnJDr474KdnjK7/lQ S3HqJNanWqyOoEClj10LuRq3wr2MN94r5Sz72J4GbxsRfnrfmZQjMyiXkLMq/0l5jEFC +2sVvmK/ZDgb1xLh1HqNoxnhj2Pdx0z1E9j5AAu4MFSsixm6+0SLTtEIJQDhcYkzm3FV nhHQRq1IkT1GwvPdYB+92Ww7uhEXDrARl+Q1Lf+Wt/ZmOaJJMWpOTOeUDP+OyZ0nyzft RleN9UypwH5RJws5rSzXP58toPgr6VbfpQ0dRQAdraZ81PhreYzbxCGsiGNVdTMjE2yV Zc9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cd9786bsi599672066b.895.2024.05.29.02.56.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 02:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 00C0D1F220EC for ; Wed, 29 May 2024 09:56:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5883117A91B; Wed, 29 May 2024 09:56:09 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (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 37C2F16D9D9; Wed, 29 May 2024 09:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716976569; cv=none; b=D392FFLnOOp1iBK5kn5pwFS8c1jQQA3gluzHdVCmK3+mNRf23gukKrrvvIzsvnMr27Y65VHdhGQ7aRE8jSWFNVuU6Wme/U1s9wjZCXKfBFJD09LkXx9dIgtS9mlGTzcVvPIi8jfxbdczeTzAaTBa3BOXHBa6h7OjPS9tcqX/M1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716976569; c=relaxed/simple; bh=dHqEPBaw5nSQKZiDPjBfxGzkUWeHJx2AEu+zXPtpOlg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kaX0S/i4y97kdC7XGEvKhhcQrDe0VUT8/9Dj+TJAG7Qfy/Xal+f5iIji7mCmKK0Rtn0EGpTEqCCCwv5Pwj0p4gYbSepGt5Bi8MH2N8xhlX8H3pUl3NdlDMBOg2iLMBfWeBtpIzPROoxuLTulBZiLjAauNRAQXaFqexN7nQKQewU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6F8B81A178D; Wed, 29 May 2024 11:56:05 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 21D031A13BE; Wed, 29 May 2024 11:56:05 +0200 (CEST) Received: from pe-lt8779.in-pnq01.nxp.com (pe-lt8779.in-pnq01.nxp.com [10.17.104.141]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id DA2AA183AC0C; Wed, 29 May 2024 17:56:02 +0800 (+08) From: Neeraj Sanjay Kale To: marcel@holtmann.org, luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, amitkumar.karwar@nxp.com, rohit.fule@nxp.com, neeraj.sanjaykale@nxp.com, sherry.sun@nxp.com, ziniu.wang_1@nxp.com, haibo.chen@nxp.com, LnxRevLi@nxp.com Subject: [PATCH v3 2/2] Bluetooth: btnxpuart: Update firmware names Date: Wed, 29 May 2024 15:23:47 +0530 Message-Id: <20240529095347.22186-3-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529095347.22186-1-neeraj.sanjaykale@nxp.com> References: <20240529095347.22186-1-neeraj.sanjaykale@nxp.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP This updates the firmware names of 3 chipsets: w8987, w8997, w9098. These changes are been done to standardize chip specific firmware file names. To allow user to use older firmware file names, a new device tree property has been introduced called firmware-name, which will override the hardcoded firmware names in the driver. Signed-off-by: Neeraj Sanjay Kale --- v2: Remove "nxp/" from all firmware name definitions to be inline with firware file name read from device tree file. (Krzysztof) --- drivers/bluetooth/btnxpuart.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index 0b93c2ff29e4..4442d911eba8 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -33,16 +33,16 @@ /* NXP HW err codes */ #define BTNXPUART_IR_HW_ERR 0xb0 -#define FIRMWARE_W8987 "nxp/uartuart8987_bt.bin" -#define FIRMWARE_W8997 "nxp/uartuart8997_bt_v4.bin" -#define FIRMWARE_W9098 "nxp/uartuart9098_bt_v1.bin" -#define FIRMWARE_IW416 "nxp/uartiw416_bt_v0.bin" -#define FIRMWARE_IW612 "nxp/uartspi_n61x_v1.bin.se" -#define FIRMWARE_IW624 "nxp/uartiw624_bt.bin" -#define FIRMWARE_SECURE_IW624 "nxp/uartiw624_bt.bin.se" -#define FIRMWARE_AW693 "nxp/uartaw693_bt.bin" -#define FIRMWARE_SECURE_AW693 "nxp/uartaw693_bt.bin.se" -#define FIRMWARE_HELPER "nxp/helper_uart_3000000.bin" +#define FIRMWARE_W8987 "uart8987_bt_v0.bin" +#define FIRMWARE_W8997 "uart8997_bt_v4.bin" +#define FIRMWARE_W9098 "uart9098_bt_v1.bin" +#define FIRMWARE_IW416 "uartiw416_bt_v0.bin" +#define FIRMWARE_IW612 "uartspi_n61x_v1.bin.se" +#define FIRMWARE_IW624 "uartiw624_bt.bin" +#define FIRMWARE_SECURE_IW624 "uartiw624_bt.bin.se" +#define FIRMWARE_AW693 "uartaw693_bt.bin" +#define FIRMWARE_SECURE_AW693 "uartaw693_bt.bin.se" +#define FIRMWARE_HELPER "helper_uart_3000000.bin" #define CHIP_ID_W9098 0x5c03 #define CHIP_ID_IW416 0x7201 @@ -685,13 +685,19 @@ static bool process_boot_signature(struct btnxpuart_dev *nxpdev) static int nxp_request_firmware(struct hci_dev *hdev, const char *fw_name) { struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev); + const char *fw_name_dt; int err = 0; if (!fw_name) return -ENOENT; if (!strlen(nxpdev->fw_name)) { - snprintf(nxpdev->fw_name, MAX_FW_FILE_NAME_LEN, "%s", fw_name); + if (strcmp(fw_name, FIRMWARE_HELPER) && + !device_property_read_string(&nxpdev->serdev->dev, + "firmware-name", + &fw_name_dt)) + fw_name = fw_name_dt; + snprintf(nxpdev->fw_name, MAX_FW_FILE_NAME_LEN, "nxp/%s", fw_name); bt_dev_dbg(hdev, "Request Firmware: %s", nxpdev->fw_name); err = request_firmware(&nxpdev->fw, nxpdev->fw_name, &hdev->dev); -- 2.34.1