All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
@ 2020-12-08 11:55 Venkata Lakshmi Narayana Gubba
  2020-12-08 13:54 ` [v4] " bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Venkata Lakshmi Narayana Gubba @ 2020-12-08 11:55 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: mka, linux-kernel, linux-bluetooth, hemantg, linux-arm-msm,
	bgodavar, rjliao, hbandi, abhishekpandit,
	Venkata Lakshmi Narayana Gubba

Add support to read FW build version from debugfs node.
This info can be read from
/sys/kernel/debug/bluetooth/hci0/firmware_info

Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
---
 drivers/bluetooth/btqca.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/bluetooth/btqca.h |  1 +
 2 files changed, 55 insertions(+)

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index f85a55a..f6256a3 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -94,6 +94,53 @@ int qca_read_soc_version(struct hci_dev *hdev, struct qca_btsoc_version *ver,
 }
 EXPORT_SYMBOL_GPL(qca_read_soc_version);
 
+static int qca_read_fw_build_info(struct hci_dev *hdev)
+{
+	struct sk_buff *skb;
+	struct edl_event_hdr *edl;
+	char cmd, build_label[QCA_FW_BUILD_VER_LEN];
+	int build_lbl_len, err = 0;
+
+	bt_dev_dbg(hdev, "QCA read fw build info");
+
+	cmd = EDL_GET_BUILD_INFO_CMD;
+	skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, EDL_PATCH_CMD_LEN,
+				&cmd, 0, HCI_INIT_TIMEOUT);
+	if (IS_ERR(skb)) {
+		err = PTR_ERR(skb);
+		bt_dev_err(hdev, "Reading QCA fw build info failed (%d)",
+			   err);
+		return err;
+	}
+
+	edl = (struct edl_event_hdr *)(skb->data);
+	if (!edl) {
+		bt_dev_err(hdev, "QCA read fw build info with no header");
+		err = -EILSEQ;
+		goto out;
+	}
+
+	if (edl->cresp != EDL_CMD_REQ_RES_EVT ||
+	    edl->rtype != EDL_GET_BUILD_INFO_CMD) {
+		bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp,
+			   edl->rtype);
+		err = -EIO;
+		goto out;
+	}
+
+	build_lbl_len = edl->data[0];
+	if (build_lbl_len <= QCA_FW_BUILD_VER_LEN - 1) {
+		memcpy(build_label, edl->data + 1, build_lbl_len);
+		*(build_label + build_lbl_len) = '\0';
+	}
+
+	hci_set_fw_info(hdev, "%s", build_label);
+
+out:
+	kfree_skb(skb);
+	return err;
+}
+
 static int qca_send_reset(struct hci_dev *hdev)
 {
 	struct sk_buff *skb;
@@ -524,6 +571,13 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 		return err;
 	}
 
+	if (soc_type == QCA_WCN3991) {
+		/* get fw build info */
+		err = qca_read_fw_build_info(hdev);
+		if (err < 0)
+			return err;
+	}
+
 	bt_dev_info(hdev, "QCA setup on UART is completed");
 
 	return 0;
diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h
index e73b8f8..b19add7 100644
--- a/drivers/bluetooth/btqca.h
+++ b/drivers/bluetooth/btqca.h
@@ -11,6 +11,7 @@
 #define EDL_PATCH_CMD_LEN		(1)
 #define EDL_PATCH_VER_REQ_CMD		(0x19)
 #define EDL_PATCH_TLV_REQ_CMD		(0x1E)
+#define EDL_GET_BUILD_INFO_CMD		(0x20)
 #define EDL_NVM_ACCESS_SET_REQ_CMD	(0x01)
 #define MAX_SIZE_PER_TLV_SEGMENT	(243)
 #define QCA_PRE_SHUTDOWN_CMD		(0xFC08)
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
  2020-12-08 11:55 [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC Venkata Lakshmi Narayana Gubba
@ 2020-12-08 13:54 ` bluez.test.bot
  2020-12-18 21:24 ` [PATCH v4] " Marcel Holtmann
  2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2020-12-08 13:54 UTC (permalink / raw)
  To: linux-bluetooth, gubbaven

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=398171

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuildK - PASS



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
  2020-12-08 11:55 [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC Venkata Lakshmi Narayana Gubba
  2020-12-08 13:54 ` [v4] " bluez.test.bot
@ 2020-12-18 21:24 ` Marcel Holtmann
  2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  2 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2020-12-18 21:24 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba
  Cc: Johan Hedberg, mka, linux-kernel, linux-bluetooth, hemantg,
	linux-arm-msm, bgodavar, rjliao, hbandi, abhishekpandit

Hi Venkata,

> Add support to read FW build version from debugfs node.
> This info can be read from
> /sys/kernel/debug/bluetooth/hci0/firmware_info
> 
> Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
> ---
> drivers/bluetooth/btqca.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
> drivers/bluetooth/btqca.h |  1 +
> 2 files changed, 55 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
  2020-12-08 11:55 [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC Venkata Lakshmi Narayana Gubba
  2020-12-08 13:54 ` [v4] " bluez.test.bot
  2020-12-18 21:24 ` [PATCH v4] " Marcel Holtmann
@ 2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-03-01 19:59 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Tue,  8 Dec 2020 17:25:29 +0530 you wrote:
> Add support to read FW build version from debugfs node.
> This info can be read from
> /sys/kernel/debug/bluetooth/hci0/firmware_info
> 
> Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
> ---
>  drivers/bluetooth/btqca.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
>  drivers/bluetooth/btqca.h |  1 +
>  2 files changed, 55 insertions(+)

Here is the summary with links:
  - [v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
    https://git.kernel.org/qcom/c/c0187b0bd3e9

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-01 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 11:55 [PATCH v4] Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC Venkata Lakshmi Narayana Gubba
2020-12-08 13:54 ` [v4] " bluez.test.bot
2020-12-18 21:24 ` [PATCH v4] " Marcel Holtmann
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.