From patchwork Fri Apr 5 09:01:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Sanjay Kale X-Patchwork-Id: 13618717 X-Patchwork-Delegate: kuba@kernel.org Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (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 69D0A15FA7F; Fri, 5 Apr 2024 09:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307704; cv=none; b=VyfcmqqvcDOc5L36vgY9c2VCiQk6UYwB2ymztjYSmbwSnZv1dVX24CvVDWhYUCHoj/fSa4cZf4+9EZ7v3SZ3GZJ4TZo52v8vI0XnpTtuu5cG7WXLVLW/T7yLoDPpsQLO48ZlEKrxaSOKCdLFt5xXUL02gigOhrFQ2xSEPxGQ+KA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307704; c=relaxed/simple; bh=+CGC8ZxRnPkLnB2bwYcIb90Vs1Fp+CoONNI+Hnio564=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=APIjfn32uEbYrLpJ69ZdrY4aR6EDyAbOyeBjTGP+IfzlJJXiIN4ywjgyjNoaXLP157tc+R2jfjkv2Yt4GFc6pV9m5NdYXr2jc524j58BcSDJYA2eaQWfDerTB/C6Vt2WKd0P4F3LYRvaXu1RuYGjGGgkjyd2Eaujy43IEncU2SM= 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.21 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 inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E28F62018ED; Fri, 5 Apr 2024 11:01:34 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8C136200EE8; Fri, 5 Apr 2024 11:01:34 +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 733CC183AD25; Fri, 5 Apr 2024 17:01:32 +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+dt@kernel.org, krzysztof.kozlowski+dt@linaro.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 v1 1/2] dt-bindings: net: bluetooth: btnxpuart: Add firmware-name property Date: Fri, 5 Apr 2024 14:31:17 +0530 Message-Id: <20240405090118.582310-2-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240405090118.582310-1-neeraj.sanjaykale@nxp.com> References: <20240405090118.582310-1-neeraj.sanjaykale@nxp.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-Patchwork-Delegate: kuba@kernel.org This adds a new optional device tree property called firware-name. If this property is specified, the driver overrides the firmware name hardcoded in the driver source code. Signed-off-by: Neeraj Sanjay Kale --- .../devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml index f01a3988538c..25c258212bcd 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml @@ -31,6 +31,13 @@ properties: This property depends on the module vendor's configuration. + firmware-name: + $ref: /schemas/types.yaml#/definitions/string + description: + Specify firmware file name, prepended with nxp/. + This property overrides the firmware names hardcoded + in the driver source code. + required: - compatible @@ -42,5 +49,6 @@ examples: bluetooth { compatible = "nxp,88w8987-bt"; fw-init-baudrate = <3000000>; + firmware-name = "nxp/uartuart8987_bt_v0.bin"; }; }; From patchwork Fri Apr 5 09:01:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Sanjay Kale X-Patchwork-Id: 13618718 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (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 755B315FCFD; Fri, 5 Apr 2024 09:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307705; cv=none; b=k7WPPptJZHllodVSnXpZ7H7tQNO+hlQDuSnFZ3gbe9nOZAJMzMqDP5xHgbO865zZRxYKu1I9Qb66hH9TeZIqo3+iwpzKuRnbemPTnz4APpA/IfIFO5/PFqbucqYhY3BSnH4gbWgMc7JNGVJ0bWpvNLC1rd8ZXziD+DqbrFpXBVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307705; c=relaxed/simple; bh=ur2axIziRbxJ6gwxj4bwjmuqpUC0P7kxy2AtM8ZM3+c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rGMORz8zIJ4+6FF1bbTBfoT6Apzl5UCSZ92IghIlXdUlkPPM8dAOodV0Q9V+G9MMcEAk8R+mXSIjUANHb8CPRYfPW45Kk0UIhJ1h1oPEMo/BiZuDVbqaH1oKQ7Y09b7EwjA8yiNejZQjFNxmo8RMY/kIZmearVSR/CcUC5VVhmw= 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.21 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 inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 355382018FE; Fri, 5 Apr 2024 11:01:36 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DB174201498; Fri, 5 Apr 2024 11:01:35 +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 C8725181D0E4; Fri, 5 Apr 2024 17:01:33 +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+dt@kernel.org, krzysztof.kozlowski+dt@linaro.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 v1 2/2] Bluetooth: btnxpuart: Update firmware names Date: Fri, 5 Apr 2024 14:31:18 +0530 Message-Id: <20240405090118.582310-3-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240405090118.582310-1-neeraj.sanjaykale@nxp.com> References: <20240405090118.582310-1-neeraj.sanjaykale@nxp.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- drivers/bluetooth/btnxpuart.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index 0b93c2ff29e4..45f2ae2b542b 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -33,9 +33,9 @@ /* 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_W8987 "nxp/uart8987_bt_v0.bin" +#define FIRMWARE_W8997 "nxp/uart8997_bt_v4.bin" +#define FIRMWARE_W9098 "nxp/uart9098_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" @@ -685,12 +685,18 @@ 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)) { + 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, "%s", fw_name); bt_dev_dbg(hdev, "Request Firmware: %s", nxpdev->fw_name);