Skip to contentSkip to conversation

Bluetooth: btintel: Add support for downloading secondary boot loader image

PATCH Superseded Kiran K 3 participants 6 messages Mar 1, 2024 – Mar 5, 2024 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kiran K

author
#0 lore raw

PATCH 1/1 Bluetooth: btintel: Add support for downloading secondary boot loader image

Some variants of Intel controllers like BlazarI supports downloading of secondary bootloader. This patch adds the support to download secondary boot loader image before downloading operational firmware image.

---
dmesg logs:

[   16.537130] Bluetooth: Core ver 2.22
[   16.537135] Bluetooth: Starting self testing
[   16.540021] Bluetooth: ECDH test passed in 2818 usecs
[   16.560666] Bluetooth: SMP test passed in 602 usecs
[   16.560674] Bluetooth: Finished self testing
[   16.560690] Bluetooth: HCI device and connection manager initialized
[   16.560695] Bluetooth: HCI socket layer initialized
[   16.560697] Bluetooth: L2CAP socket layer initialized
[   16.560700] Bluetooth: SCO socket layer initialized
[   16.571934] Bluetooth: hci0: Device revision is 0
[   16.571940] Bluetooth: hci0: Secure boot is disabled
[   16.571941] Bluetooth: hci0: OTP lock is disabled
[   16.571942] Bluetooth: hci0: API lock is enabled
[   16.571943] Bluetooth: hci0: Debug lock is disabled
[   16.571943] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[   16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1 build 26590
[   16.572189] Bluetooth: hci0: DSM reset method type: 0x00
[   16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-02.sfi
[   16.575007] Bluetooth: hci0: Boot Address: 0x30099000
[   16.575008] Bluetooth: hci0: Firmware Version: 200-10.24
[   16.705698] Bluetooth: hci0: Waiting for firmware download to complete
[   16.705927] Bluetooth: hci0: Firmware loaded in 127852 usecs
[   16.705952] Bluetooth: hci0: Waiting for device to boot
[   16.708519] Bluetooth: hci0: Device booted in 2522 usecs
[   16.708538] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[   16.710296] Bluetooth: hci0: No device address configured
[   16.712483] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291.sfi
[   16.712497] Bluetooth: hci0: Boot Address: 0x10000800
[   16.712498] Bluetooth: hci0: Firmware Version: 211-10.24
[   16.930834] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   16.930840] Bluetooth: BNEP filters: protocol multicast
[   16.930844] Bluetooth: BNEP socket layer initialized
[   18.494137] Bluetooth: hci0: Waiting for firmware download to complete
[   18.494897] Bluetooth: hci0: Firmware loaded in 1740634 usecs
[   18.494972] Bluetooth: hci0: Waiting for device to boot
[   18.529089] Bluetooth: hci0: Device booted in 33371 usecs
[   18.529121] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[   18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-0291.ddc
[   18.532158] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.532582] Bluetooth: hci0: Found Intel DDC parameters: intel/bdaddress.cfg
[   18.534109] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0 build 58067
[   18.537177] Bluetooth: hci0: Firmware SHA1: 0x81abf1ea
[   18.540985] Bluetooth: hci0: Fseq status: Success (0x00)
[   18.540992] Bluetooth: hci0: Fseq executed: 00.00.00.00
[   18.540993] Bluetooth: hci0: Fseq BT Top: 00.00.00.00
[   18.631360] Bluetooth: MGMT ver 1.22
[   18.673023] Bluetooth: RFCOMM TTY layer initialized
[   18.673031] Bluetooth: RFCOMM socket layer initialized
[   18.673039] Bluetooth: RFCOMM ver 1.11
 drivers/bluetooth/btintel.c | 38 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel.c +37 -1
index 6ba7f5d1b837..934aad89bbf1 100644
@@ -521,6 +521,9 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
 			    version->min_fw_build_nn, version->min_fw_build_cw,
 			    2000 + version->min_fw_build_yy);
 		break;
+	case 0x02:
+		variant = "IML";
+		break;
 	case 0x03:
 		variant = "Firmware";
 		break;
@@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver,
 				    char *fw_name, size_t len,
 				    const char *suffix)
 {
+	const char *format;
 	/* The firmware file name for new generation controllers will be
 	 * ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
 	 */
-	snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s",
+	switch (INTEL_HW_VARIANT(ver->cnvi_bt)) {
+	/* Only Blazar-I (0x1e) product supports downloading of secondary boot
+	 * loader image
+	 */
+	case 0x1e:
+		if (ver->img_type == 1)
+			format = "intel/ibt-%04x-%04x-02.%s";
+		else
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	default:
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	}
+
+	snprintf(fw_name, len, format,
 		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top),
 					  INTEL_CNVX_TOP_STEP(ver->cnvi_top)),
 		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top),
@@ -2607,6 +2626,23 @@ static int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
 	if (err)
 		return err;
 
+	err = btintel_read_version_tlv(hdev, ver);
+	if (err)
+		return err;
+
+    /* If image type returned is 0x02, then controller supports secondary
+     * boot loader image
+     */
+	if (ver->img_type == 0x02) {
+		err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
+		if (err)
+			return err;
+
+		err = btintel_boot(hdev, boot_param);
+		if (err)
+			return err;
+	}
+
 	btintel_clear_flag(hdev, INTEL_BOOTLOADER);
 
 	btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");
Signature · 1 line
2.34.1
#1 lore raw

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=831464

---Test result---

Test Summary:

CheckPatch                    PASS      0.67 seconds
GitLint                       FAIL      0.53 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      27.55 seconds
CheckAllWarning               PASS      30.69 seconds
CheckSparse                   PASS      36.37 seconds
CheckSmatch                   PASS      100.65 seconds
BuildKernel32                 PASS      27.86 seconds
TestRunnerSetup               PASS      505.77 seconds
TestRunner_l2cap-tester       PASS      20.20 seconds
TestRunner_iso-tester         PASS      30.84 seconds
TestRunner_bnep-tester        PASS      4.85 seconds
TestRunner_mgmt-tester        PASS      109.12 seconds
TestRunner_rfcomm-tester      PASS      7.48 seconds
TestRunner_sco-tester         PASS      15.17 seconds
TestRunner_ioctl-tester       PASS      8.11 seconds
TestRunner_mesh-tester        PASS      6.03 seconds
TestRunner_smp-tester         PASS      7.04 seconds
TestRunner_userchan-tester    PASS      5.06 seconds
IncrementalBuild              PASS      27.15 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v1] Bluetooth: btintel: Add support for downloading secondary boot loader image

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search

25: B1 Line exceeds max length (84>80): "[   16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1 build 26590"
27: B1 Line exceeds max length (81>80): "[   16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-02.sfi"
47: B1 Line exceeds max length (83>80): "[   18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-0291.ddc"
51: B1 Line exceeds max length (81>80): "[   18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0 build 58067"

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Kiran K

Dear Kiran,

Thank you for your patch.

Am 01.03.24 um 11:24 schrieb Kiran K:

Quoted 1 line

Some variants of Intel controllers like BlazarI supports downloading of

support

In the diff you write Blazar-I.

Quoted 2 lines

secondary bootloader. This patch adds the support to download secondary boot loader image before downloading operational firmware image.

What is the secondary bootloader needed for?

Quoted 17 lines

---
dmesg logs:

[   16.537130] Bluetooth: Core ver 2.22
[   16.537135] Bluetooth: Starting self testing
[   16.540021] Bluetooth: ECDH test passed in 2818 usecs
[   16.560666] Bluetooth: SMP test passed in 602 usecs
[   16.560674] Bluetooth: Finished self testing
[   16.560690] Bluetooth: HCI device and connection manager initialized
[   16.560695] Bluetooth: HCI socket layer initialized
[   16.560697] Bluetooth: L2CAP socket layer initialized
[   16.560700] Bluetooth: SCO socket layer initialized
[   16.571934] Bluetooth: hci0: Device revision is 0
[   16.571940] Bluetooth: hci0: Secure boot is disabled
[   16.571941] Bluetooth: hci0: OTP lock is disabled
[   16.571942] Bluetooth: hci0: API lock is enabled
[   16.571943] Bluetooth: hci0: Debug lock is disabled
Quoted 8 lines
[   16.571943] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[   16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1 build 26590
[   16.572189] Bluetooth: hci0: DSM reset method type: 0x00
[   16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-02.sfi
[   16.575007] Bluetooth: hci0: Boot Address: 0x30099000
[   16.575008] Bluetooth: hci0: Firmware Version: 200-10.24
[   16.705698] Bluetooth: hci0: Waiting for firmware download to complete
[   16.705927] Bluetooth: hci0: Firmware loaded in 127852 usecs

Unrelated, but this is quite long.

Quoted 3 lines
[   16.705952] Bluetooth: hci0: Waiting for device to boot
[   16.708519] Bluetooth: hci0: Device booted in 2522 usecs
[   16.708538] Bluetooth: hci0: Malformed MSFT vendor event: 0x02

(Unrelated, but this is shown on a lot of devices. One more time below.)

Quoted 4 lines
[   16.710296] Bluetooth: hci0: No device address configured
[   16.712483] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291.sfi
[   16.712497] Bluetooth: hci0: Boot Address: 0x10000800
[   16.712498] Bluetooth: hci0: Firmware Version: 211-10.24

It’s unclear from the logs, why two firmware files (with different versions) are loaded.

Quoted 5 lines
[   16.930834] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   16.930840] Bluetooth: BNEP filters: protocol multicast
[   16.930844] Bluetooth: BNEP socket layer initialized
[   18.494137] Bluetooth: hci0: Waiting for firmware download to complete
[   18.494897] Bluetooth: hci0: Firmware loaded in 1740634 usecs

Hmm, 1.7 seconds is very long.

Quoted 8 lines
[   18.494972] Bluetooth: hci0: Waiting for device to boot
[   18.529089] Bluetooth: hci0: Device booted in 33371 usecs
[   18.529121] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[   18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-0291.ddc
[   18.532158] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.532582] Bluetooth: hci0: Found Intel DDC parameters: intel/bdaddress.cfg
[   18.534109] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0 build 58067
Quoted 8 lines
[   18.537177] Bluetooth: hci0: Firmware SHA1: 0x81abf1ea
[   18.540985] Bluetooth: hci0: Fseq status: Success (0x00)
[   18.540992] Bluetooth: hci0: Fseq executed: 00.00.00.00
[   18.540993] Bluetooth: hci0: Fseq BT Top: 00.00.00.00
[   18.631360] Bluetooth: MGMT ver 1.22
[   18.673023] Bluetooth: RFCOMM TTY layer initialized
[   18.673031] Bluetooth: RFCOMM socket layer initialized
[   18.673039] Bluetooth: RFCOMM ver 1.11

Thank you for pasting this. It’d be great if you added it to the commit message, so above ---.

drivers/bluetooth/btintel.c static int btintel_version_info_tlv(struct hci_dev *hdev, · line 525

Quoted 13 lines
  drivers/bluetooth/btintel.c | 38 ++++++++++++++++++++++++++++++++++++-
  1 file changed, 37 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel.c +2 -0
index 6ba7f5d1b837..934aad89bbf1 100644
@@ -521,6 +521,9 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
  			    version->min_fw_build_nn, version->min_fw_build_cw,
  			    2000 + version->min_fw_build_yy);
  		break;
+	case 0x02:
+		variant = "IML";

What does IML mean?

Quoted 8 lines
drivers/bluetooth/btintel.c +1 -0
+		break;
  	case 0x03:
  		variant = "Firmware";
  		break;
@@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver,
  				    char *fw_name, size_t len,
  				    const char *suffix)
  {

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2208

Quoted 10 lines
drivers/bluetooth/btintel.c +6 -1
+	const char *format;
  	/* The firmware file name for new generation controllers will be
  	 * ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
  	 */
-	snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s",
+	switch (INTEL_HW_VARIANT(ver->cnvi_bt)) {
+	/* Only Blazar-I (0x1e) product supports downloading of secondary boot
+	 * loader image
+	 */
+	case 0x1e:

Should a macro be defined for 0x1e?

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2209

Quoted 1 line
drivers/bluetooth/btintel.c +1 -0
+		if (ver->img_type == 1)

Below you write 0x0x. Should this be consistent?

Quoted 15 lines
drivers/bluetooth/btintel.c +10 -0
+			format = "intel/ibt-%04x-%04x-02.%s";
+		else
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	default:
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	}
+
+	snprintf(fw_name, len, format,
  		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top),
  					  INTEL_CNVX_TOP_STEP(ver->cnvi_top)),
  		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top),
@@ -2607,6 +2626,23 @@ static int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
  	if (err)

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2636

Quoted 10 lines
drivers/bluetooth/btintel.c +8 -0
  		return err;
 
+	err = btintel_read_version_tlv(hdev, ver);
+	if (err)
+		return err;
+
+    /* If image type returned is 0x02, then controller supports secondary
+     * boot loader image
+     */
+	if (ver->img_type == 0x02) {

Could a macro be defined for 0x02?

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2648

Quoted 12 lines
drivers/bluetooth/btintel.c +9 -0
+		err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
+		if (err)
+			return err;
+
+		err = btintel_boot(hdev, boot_param);
+		if (err)
+			return err;
+	}
+
  	btintel_clear_flag(hdev, INTEL_BOOTLOADER);
 
  	btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");

Kind regards,

Paul

author
#3 lore raw

Hi Paul,

Thanks for your comments.

Quoted 16 lines

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Friday, March 1, 2024 4:38 PM
To: K, Kiran <[email protected]>
Cc: [email protected]; Srivatsa, Ravishankar <[email protected]>; Tumkur Narayan, Chethan <[email protected]>
Subject: Re: [PATCH v1] Bluetooth: btintel: Add support for downloading secondary boot loader image

Dear Kiran,

Thank you for your patch.

Quoted 7 lines

Am 01.03.24 um 11:24 schrieb Kiran K:

Quoted 2 lines

Some variants of Intel controllers like BlazarI supports downloading of

support

In the diff you write Blazar-I.

Ok. I will fix it in the next patch.

Quoted 7 lines
Quoted 3 lines

secondary bootloader. This patch adds the support to download secondary boot loader image before downloading operational firmware

image.

What is the secondary bootloader needed for?

Primary bootloader is flashed over ROM and any issues found once the product released to market is hard / impossible to fix. So idea is to keep primary bootloader minimal and have secondary bootloader.

Quoted 22 lines
Quoted 19 lines

---
dmesg logs:

[   16.537130] Bluetooth: Core ver 2.22
[   16.537135] Bluetooth: Starting self testing
[   16.540021] Bluetooth: ECDH test passed in 2818 usecs
[   16.560666] Bluetooth: SMP test passed in 602 usecs
[   16.560674] Bluetooth: Finished self testing
[   16.560690] Bluetooth: HCI device and connection manager initialized
[   16.560695] Bluetooth: HCI socket layer initialized
[   16.560697] Bluetooth: L2CAP socket layer initialized
[   16.560700] Bluetooth: SCO socket layer initialized
[   16.571934] Bluetooth: hci0: Device revision is 0
[   16.571940] Bluetooth: hci0: Secure boot is disabled
[   16.571941] Bluetooth: hci0: OTP lock is disabled
[   16.571942] Bluetooth: hci0: API lock is enabled
[   16.571943] Bluetooth: hci0: Debug lock is disabled
[   16.571943] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[   16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1

build 26590

Quoted 2 lines
[   16.572189] Bluetooth: hci0: DSM reset method type: 0x00
[   16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-
Quoted 7 lines

02.sfi

Quoted 4 lines
[   16.575007] Bluetooth: hci0: Boot Address: 0x30099000
[   16.575008] Bluetooth: hci0: Firmware Version: 200-10.24
[   16.705698] Bluetooth: hci0: Waiting for firmware download to complete
[   16.705927] Bluetooth: hci0: Firmware loaded in 127852 usecs

Unrelated, but this is quite long.

I can pass on this information to firmware. I feel this seems to be OK as the maximum timeout for firmware download is 5 seconds.

Quoted 9 lines
Quoted 4 lines
[   16.705952] Bluetooth: hci0: Waiting for device to boot
[   16.708519] Bluetooth: hci0: Device booted in 2522 usecs
[   16.708538] Bluetooth: hci0: Malformed MSFT vendor event: 0x02

(Unrelated, but this is shown on a lot of devices. One more time below.)

Quoted 2 lines
[   16.710296] Bluetooth: hci0: No device address configured
[   16.712483] Bluetooth: hci0: Found device firmware: intel/ibt-0090-
Quoted 8 lines

0291.sfi

Quoted 2 lines
[   16.712497] Bluetooth: hci0: Boot Address: 0x10000800
[   16.712498] Bluetooth: hci0: Firmware Version: 211-10.24

It’s unclear from the logs, why two firmware files (with different versions) are loaded.

One is secondary bootloader (ibt-0090-0291-02.sfi) and the other one is operational firmware (ibt-0090-0291.sfi) . It's possible to have different version.

Quoted 28 lines
Quoted 5 lines
[   16.930834] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   16.930840] Bluetooth: BNEP filters: protocol multicast
[   16.930844] Bluetooth: BNEP socket layer initialized
[   18.494137] Bluetooth: hci0: Waiting for firmware download to complete
[   18.494897] Bluetooth: hci0: Firmware loaded in 1740634 usecs

Hmm, 1.7 seconds is very long.

Quoted 4 lines
[   18.494972] Bluetooth: hci0: Waiting for device to boot
[   18.529089] Bluetooth: hci0: Device booted in 33371 usecs
[   18.529121] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[   18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-

0291.ddc

Quoted 2 lines
[   18.532158] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.532582] Bluetooth: hci0: Found Intel DDC parameters:

intel/bdaddress.cfg

Quoted 2 lines
[   18.534109] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0 build

58067

Quoted 8 lines
[   18.537177] Bluetooth: hci0: Firmware SHA1: 0x81abf1ea
[   18.540985] Bluetooth: hci0: Fseq status: Success (0x00)
[   18.540992] Bluetooth: hci0: Fseq executed: 00.00.00.00
[   18.540993] Bluetooth: hci0: Fseq BT Top: 00.00.00.00
[   18.631360] Bluetooth: MGMT ver 1.22
[   18.673023] Bluetooth: RFCOMM TTY layer initialized
[   18.673031] Bluetooth: RFCOMM socket layer initialized
[   18.673039] Bluetooth: RFCOMM ver 1.11
Quoted 2 lines

Thank you for pasting this. It’d be great if you added it to the commit message, so above ---.

Ok. I will have it part of commit message.

Quoted 91 lines
Quoted 2 lines
  drivers/bluetooth/btintel.c | 38

++++++++++++++++++++++++++++++++++++-

drivers/bluetooth/btintel.c static int btintel_version_info_tlv(struct hci_dev

Quoted 7 lines
  1 file changed, 37 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel.c +0 -0
index 6ba7f5d1b837..934aad89bbf1 100644
@@ -521,6 +521,9 @@ static int btintel_version_info_tlv(struct hci_dev

*hdev,

drivers/bluetooth/btintel.c static int btintel_version_info_tlv(struct hci_dev *hdev, · line 525

Quoted 6 lines
drivers/bluetooth/btintel.c +2 -0
  			    version->min_fw_build_nn, version-
 min_fw_build_cw,
  			    2000 + version->min_fw_build_yy);
  		break;
+	case 0x02:
+		variant = "IML";

What does IML mean?

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const

Quoted 5 lines
drivers/bluetooth/btintel.c +1 -0
+		break;
  	case 0x03:
  		variant = "Firmware";

break;

drivers/bluetooth/btintel.c +0 -0
@@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const

struct intel_version_tlv *ver,

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver,

Quoted 10 lines
drivers/bluetooth/btintel.c +3 -1
  				    char *fw_name, size_t len,
  				    const char *suffix)
  {
+	const char *format;
  	/* The firmware file name for new generation controllers will be
  	 * ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
  	 */
-	snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s",
+	switch (INTEL_HW_VARIANT(ver->cnvi_bt)) {
+	/* Only Blazar-I (0x1e) product supports downloading of secondary

boot

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2208

Quoted 3 lines
drivers/bluetooth/btintel.c +3 -0
+	 * loader image
+	 */
+	case 0x1e:

Should a macro be defined for 0x1e?

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2209

Quoted 1 line
drivers/bluetooth/btintel.c +1 -0
+		if (ver->img_type == 1)

Below you write 0x0x. Should this be consistent?

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct

Quoted 17 lines
drivers/bluetooth/btintel.c +10 -0
+			format = "intel/ibt-%04x-%04x-02.%s";
+		else
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	default:
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	}
+
+	snprintf(fw_name, len, format,
  		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver-
 cnvi_top),
  					  INTEL_CNVX_TOP_STEP(ver-

cnvi_top)),
INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver-
cnvr_top),

drivers/bluetooth/btintel.c +0 -0
@@ -2607,6 +2626,23 @@ static int btintel_bootloader_setup_tlv(struct

hci_dev *hdev,

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2636

Quoted 11 lines
drivers/bluetooth/btintel.c +8 -0
  	if (err)
  		return err;
 
+	err = btintel_read_version_tlv(hdev, ver);
+	if (err)
+		return err;
+
+    /* If image type returned is 0x02, then controller supports secondary
+     * boot loader image
+     */
+	if (ver->img_type == 0x02) {

Could a macro be defined for 0x02?

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct · line 2637

Quoted 1 line
drivers/bluetooth/btintel.c +1 -0
+		err = btintel_prepare_fw_download_tlv(hdev, ver,

&boot_param);

Quoted 10 lines
drivers/bluetooth/btintel.c +8 -0
+		if (err)
+			return err;
+
+		err = btintel_boot(hdev, boot_param);
+		if (err)
+			return err;
+	}
+
  	btintel_clear_flag(hdev, INTEL_BOOTLOADER);
 
Quoted 6 lines

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2648

Quoted 1 line
drivers/bluetooth/btintel.c +0 -0
  	btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");

Kind regards,

Paul

Thanks,
Kiran

#4 lore raw

Dear Kiran,

Thank you for your reply.

Am 04.03.24 um 09:21 schrieb K, Kiran:

Quoted 3 lines
Quoted 3 lines

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Friday, March 1, 2024 4:38 PM

[…]

Quoted 10 lines
Quoted 7 lines

Am 01.03.24 um 11:24 schrieb Kiran K:

Quoted 2 lines

Some variants of Intel controllers like BlazarI supports downloading of

support

In the diff you write Blazar-I.

Ok. I will fix it in the next patch.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

secondary bootloader. This patch adds the support to download secondary boot loader image before downloading operational firmware image.

What is the secondary bootloader needed for?

Primary bootloader is flashed over ROM and any issues found once the product released to market is hard / impossible to fix. So idea is to keep primary bootloader minimal and have secondary bootloader.

Thank you. I think, that’d be good to have in the commit message.

Quoted 26 lines
Quoted 26 lines
Quoted 25 lines

---
dmesg logs:

[   16.537130] Bluetooth: Core ver 2.22
[   16.537135] Bluetooth: Starting self testing
[   16.540021] Bluetooth: ECDH test passed in 2818 usecs
[   16.560666] Bluetooth: SMP test passed in 602 usecs
[   16.560674] Bluetooth: Finished self testing
[   16.560690] Bluetooth: HCI device and connection manager initialized
[   16.560695] Bluetooth: HCI socket layer initialized
[   16.560697] Bluetooth: L2CAP socket layer initialized
[   16.560700] Bluetooth: SCO socket layer initialized
[   16.571934] Bluetooth: hci0: Device revision is 0
[   16.571940] Bluetooth: hci0: Secure boot is disabled
[   16.571941] Bluetooth: hci0: OTP lock is disabled
[   16.571942] Bluetooth: hci0: API lock is enabled
[   16.571943] Bluetooth: hci0: Debug lock is disabled
[   16.571943] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[   16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1 build 26590
[   16.572189] Bluetooth: hci0: DSM reset method type: 0x00
[   16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-02.sfi
[   16.575007] Bluetooth: hci0: Boot Address: 0x30099000
[   16.575008] Bluetooth: hci0: Firmware Version: 200-10.24
[   16.705698] Bluetooth: hci0: Waiting for firmware download to complete
[   16.705927] Bluetooth: hci0: Firmware loaded in 127852 usecs
Quoted 3 lines
Quoted 1 line

Unrelated, but this is quite long.

I can pass on this information to firmware. I feel this seems to be OK as the maximum timeout for firmware download is 5 seconds.

Starting my system, in an ideal world it’s ready after at most one second (system firmware 0.5 seconds, Linux kernel 0.2 seconds + 0.3 user space). ;-) Ideally, Bluetooth would be operational by then.

Quoted 11 lines
Quoted 10 lines
Quoted 3 lines
[   16.705952] Bluetooth: hci0: Waiting for device to boot
[   16.708519] Bluetooth: hci0: Device booted in 2522 usecs
[   16.708538] Bluetooth: hci0: Malformed MSFT vendor event: 0x02

(Unrelated, but this is shown on a lot of devices. One more time below.)

Quoted 4 lines
[   16.710296] Bluetooth: hci0: No device address configured
[   16.712483] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291.sfi
[   16.712497] Bluetooth: hci0: Boot Address: 0x10000800
[   16.712498] Bluetooth: hci0: Firmware Version: 211-10.24
Quoted 6 lines
Quoted 2 lines

It’s unclear from the logs, why two firmware files (with different versions) are loaded.

One is secondary bootloader (ibt-0090-0291-02.sfi) and the other one is operational firmware (ibt-0090-0291.sfi) . It's possible to have different version.

Understood. Could that be made more clear in the logging output?

Quoted 25 lines
Quoted 25 lines
Quoted 5 lines
[   16.930834] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   16.930840] Bluetooth: BNEP filters: protocol multicast
[   16.930844] Bluetooth: BNEP socket layer initialized
[   18.494137] Bluetooth: hci0: Waiting for firmware download to complete
[   18.494897] Bluetooth: hci0: Firmware loaded in 1740634 usecs

Hmm, 1.7 seconds is very long.

Quoted 16 lines
[   18.494972] Bluetooth: hci0: Waiting for device to boot
[   18.529089] Bluetooth: hci0: Device booted in 33371 usecs
[   18.529121] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[   18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-0291.ddc
[   18.532158] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.532582] Bluetooth: hci0: Found Intel DDC parameters: intel/bdaddress.cfg
[   18.534109] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0 build 58067
[   18.537177] Bluetooth: hci0: Firmware SHA1: 0x81abf1ea
[   18.540985] Bluetooth: hci0: Fseq status: Success (0x00)
[   18.540992] Bluetooth: hci0: Fseq executed: 00.00.00.00
[   18.540993] Bluetooth: hci0: Fseq BT Top: 00.00.00.00
[   18.631360] Bluetooth: MGMT ver 1.22
[   18.673023] Bluetooth: RFCOMM TTY layer initialized
[   18.673031] Bluetooth: RFCOMM socket layer initialized
[   18.673039] Bluetooth: RFCOMM ver 1.11
Quoted 4 lines
Quoted 2 lines

Thank you for pasting this. It’d be great if you added it to the commit message, so above ---.

Ok. I will have it part of commit message.

Thank you.

By the way, I had written some more comments below. It looks like you overlooked them.

Quoted 84 lines
Quoted 84 lines

drivers/bluetooth/btintel.c static int btintel_version_info_tlv(struct hci_dev

Quoted 8 lines
   drivers/bluetooth/btintel.c | 38 ++++++++++++++++++++++++++++++++++++-
   1 file changed, 37 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel.c +0 -0
index 6ba7f5d1b837..934aad89bbf1 100644
@@ -521,6 +521,9 @@ static int btintel_version_info_tlv(struct hci_dev

*hdev,

drivers/bluetooth/btintel.c static int btintel_version_info_tlv(struct hci_dev *hdev, · line 525

Quoted 6 lines
drivers/bluetooth/btintel.c +2 -0
   			    version->min_fw_build_nn, version-
 min_fw_build_cw,
   			    2000 + version->min_fw_build_yy);
   		break;
+	case 0x02:
+		variant = "IML";

What does IML mean?

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const

Quoted 5 lines
drivers/bluetooth/btintel.c +1 -0
+		break;
   	case 0x03:
   		variant = "Firmware";
   		break;
drivers/bluetooth/btintel.c +0 -0
@@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const

struct intel_version_tlv *ver,

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2208

Quoted 13 lines
drivers/bluetooth/btintel.c +6 -1
   				    char *fw_name, size_t len,
   				    const char *suffix)
   {
+	const char *format;
   	/* The firmware file name for new generation controllers will be
   	 * ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
   	 */
-	snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s",
+	switch (INTEL_HW_VARIANT(ver->cnvi_bt)) {
+	/* Only Blazar-I (0x1e) product supports downloading of secondary boot
+	 * loader image
+	 */
+	case 0x1e:

Should a macro be defined for 0x1e?

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2209

Quoted 1 line
drivers/bluetooth/btintel.c +1 -0
+		if (ver->img_type == 1)

Below you write 0x0x. Should this be consistent?

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct

Quoted 14 lines
drivers/bluetooth/btintel.c +10 -0
+			format = "intel/ibt-%04x-%04x-02.%s";
+		else
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	default:
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	}
+
+	snprintf(fw_name, len, format,
   		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver- cnvi_top),
   					  INTEL_CNVX_TOP_STEP(ver- cnvi_top)),
   		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver- cnvr_top),
@@ -2607,6 +2626,23 @@ static int btintel_bootloader_setup_tlv(struct

hci_dev *hdev,

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2636

Quoted 11 lines
drivers/bluetooth/btintel.c +8 -0
   	if (err)
   		return err;
 
+	err = btintel_read_version_tlv(hdev, ver);
+	if (err)
+		return err;
+
+    /* If image type returned is 0x02, then controller supports secondary
+     * boot loader image
+     */
+	if (ver->img_type == 0x02) {

Could a macro be defined for 0x02?

Quoted 11 lines
drivers/bluetooth/btintel.c +9 -0
+		err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
+		if (err)
+			return err;
+
+		err = btintel_boot(hdev, boot_param);
+		if (err)
+			return err;
+	}
+
   	btintel_clear_flag(hdev, INTEL_BOOTLOADER);
 
Quoted 1 line
Quoted 1 line

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2648

Quoted 1 line
drivers/bluetooth/btintel.c +0 -0
   	btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");

Kind regards,

Paul

author
#5 lore raw

Hi Paul,

Appreciate your comments.

Quoted 26 lines

Dear Kiran,

Thank you for your reply.

Am 04.03.24 um 09:21 schrieb K, Kiran:

Quoted 3 lines
Quoted 3 lines

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Friday, March 1, 2024 4:38 PM

[…]

Quoted 12 lines
Quoted 7 lines

Am 01.03.24 um 11:24 schrieb Kiran K:

Quoted 2 lines

Some variants of Intel controllers like BlazarI supports downloading of

support

In the diff you write Blazar-I.

Ok. I will fix it in the next patch.

Quoted 3 lines
Quoted 3 lines

secondary bootloader. This patch adds the support to download secondary boot loader image before downloading operational firmware

Quoted 9 lines

image.

Quoted 6 lines
Quoted 2 lines

What is the secondary bootloader needed for?

Primary bootloader is flashed over ROM and any issues found once the product released to market is hard / impossible to fix. So idea is to keep primary bootloader minimal and have secondary bootloader.

Thank you. I think, that’d be good to have in the commit message.

Ack. I will update commit message.

Quoted 50 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

---
dmesg logs:

[   16.537130] Bluetooth: Core ver 2.22
[   16.537135] Bluetooth: Starting self testing
[   16.540021] Bluetooth: ECDH test passed in 2818 usecs
[   16.560666] Bluetooth: SMP test passed in 602 usecs
[   16.560674] Bluetooth: Finished self testing
[   16.560690] Bluetooth: HCI device and connection manager initialized
[   16.560695] Bluetooth: HCI socket layer initialized
[   16.560697] Bluetooth: L2CAP socket layer initialized
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
[   16.560700] Bluetooth: SCO socket layer initialized
[   16.571934] Bluetooth: hci0: Device revision is 0
[   16.571940] Bluetooth: hci0: Secure boot is disabled
[   16.571941] Bluetooth: hci0: OTP lock is disabled
[   16.571942] Bluetooth: hci0: API lock is enabled
[   16.571943] Bluetooth: hci0: Debug lock is disabled
[   16.571943] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[   16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1

build 26590

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   16.572189] Bluetooth: hci0: DSM reset method type: 0x00
[   16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-

0291-02.sfi

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[   16.575007] Bluetooth: hci0: Boot Address: 0x30099000
[   16.575008] Bluetooth: hci0: Firmware Version: 200-10.24
[   16.705698] Bluetooth: hci0: Waiting for firmware download to

complete

Quoted 5 lines
Quoted 3 lines
Quoted 1 line
[   16.705927] Bluetooth: hci0: Firmware loaded in 127852 usecs

Unrelated, but this is quite long.

I can pass on this information to firmware. I feel this seems to be OK as the maximum timeout for firmware download is 5 seconds.

Starting my system, in an ideal world it’s ready after at most one second (system firmware 0.5 seconds, Linux kernel 0.2 seconds + 0.3 user space). ;-) Ideally, Bluetooth would be operational by then.

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
[   16.705952] Bluetooth: hci0: Waiting for device to boot
[   16.708519] Bluetooth: hci0: Device booted in 2522 usecs
[   16.708538] Bluetooth: hci0: Malformed MSFT vendor event: 0x02

(Unrelated, but this is shown on a lot of devices. One more time below.)

Quoted 2 lines
[   16.710296] Bluetooth: hci0: No device address configured
[   16.712483] Bluetooth: hci0: Found device firmware: intel/ibt-0090-

0291.sfi

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
[   16.712497] Bluetooth: hci0: Boot Address: 0x10000800
[   16.712498] Bluetooth: hci0: Firmware Version: 211-10.24
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

It’s unclear from the logs, why two firmware files (with different versions) are loaded.

One is secondary bootloader (ibt-0090-0291-02.sfi) and the other one is operational firmware (ibt-0090-0291.sfi) . It's possible to have different version.

Understood. Could that be made more clear in the logging output?

Ack. I will use the string "iml" instead of image type - 02.

Quoted 32 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
[   16.930834] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   16.930840] Bluetooth: BNEP filters: protocol multicast
[   16.930844] Bluetooth: BNEP socket layer initialized
[   18.494137] Bluetooth: hci0: Waiting for firmware download to

complete

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
[   18.494897] Bluetooth: hci0: Firmware loaded in 1740634 usecs

Hmm, 1.7 seconds is very long.

Quoted 4 lines
[   18.494972] Bluetooth: hci0: Waiting for device to boot
[   18.529089] Bluetooth: hci0: Device booted in 33371 usecs
[   18.529121] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[   18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-

0090-0291.ddc

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   18.532158] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.532582] Bluetooth: hci0: Found Intel DDC parameters:

intel/bdaddress.cfg

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   18.534109] Bluetooth: hci0: Applying Intel DDC parameters completed
[   18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0

build 58067

Quoted 12 lines
Quoted 11 lines
Quoted 8 lines
[   18.537177] Bluetooth: hci0: Firmware SHA1: 0x81abf1ea
[   18.540985] Bluetooth: hci0: Fseq status: Success (0x00)
[   18.540992] Bluetooth: hci0: Fseq executed: 00.00.00.00
[   18.540993] Bluetooth: hci0: Fseq BT Top: 00.00.00.00
[   18.631360] Bluetooth: MGMT ver 1.22
[   18.673023] Bluetooth: RFCOMM TTY layer initialized
[   18.673031] Bluetooth: RFCOMM socket layer initialized
[   18.673039] Bluetooth: RFCOMM ver 1.11

Thank you for pasting this. It’d be great if you added it to the commit message, so above ---.

Quoted 7 lines
Quoted 1 line

Ok. I will have it part of commit message.

Thank you.

By the way, I had written some more comments below. It looks like you overlooked them.

Yes. My bad. Please see the response below.

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
   drivers/bluetooth/btintel.c | 38

++++++++++++++++++++++++++++++++++++-

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
   1 file changed, 37 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/bluetooth/btintel.c index 6ba7f5d1b837..934aad89bbf1 100644

drivers/bluetooth/btintel.c +0 -0
@@ -521,6 +521,9 @@ static int btintel_version_info_tlv(struct

hci_dev

*hdev,

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
   			    version->min_fw_build_nn, version-

min_fw_build_cw,

Quoted 6 lines
Quoted 6 lines

drivers/bluetooth/btintel.c static int btintel_version_info_tlv(struct hci_dev *hdev, · line 525

Quoted 4 lines
   			    2000 + version->min_fw_build_yy);
   		break;
drivers/bluetooth/btintel.c +2 -0
+	case 0x02:
+		variant = "IML";

What does IML mean?

Intermediate loader.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const

Quoted 6 lines
drivers/bluetooth/btintel.c +1 -0
+		break;
   	case 0x03:
   		variant = "Firmware";
   		break;
@@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const

struct intel_version_tlv *ver,

Quoted 16 lines
Quoted 10 lines
Quoted 10 lines

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver,

Quoted 10 lines
drivers/bluetooth/btintel.c +3 -1
   				    char *fw_name, size_t len,
   				    const char *suffix)
   {
+	const char *format;
   	/* The firmware file name for new generation controllers will be
   	 * ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
   	 */
-	snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s",
+	switch (INTEL_HW_VARIANT(ver->cnvi_bt)) {
+	/* Only Blazar-I (0x1e) product supports downloading of secondary

boot

Quoted 5 lines
Quoted 5 lines

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2208

Quoted 3 lines
drivers/bluetooth/btintel.c +3 -0
+	 * loader image
+	 */
+	case 0x1e:

Should a macro be defined for 0x1e?

Ack.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, · line 2209

Quoted 2 lines
drivers/bluetooth/btintel.c +1 -0
+		if (ver->img_type == 1)

Below you write 0x0x. Should this be consistent?

Ack

Quoted 13 lines
Quoted 12 lines
Quoted 12 lines

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver,

Quoted 12 lines
drivers/bluetooth/btintel.c +10 -0
+			format = "intel/ibt-%04x-%04x-02.%s";
+		else
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	default:
+			format = "intel/ibt-%04x-%04x.%s";
+		break;
+	}
+
+	snprintf(fw_name, len, format,
   		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver-

cnvi_top),

Quoted 20 lines
Quoted 1 line
Quoted 1 line

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const · line 2221

Quoted 1 line
drivers/bluetooth/btintel.c +0 -0
   					  INTEL_CNVX_TOP_STEP(ver-

cnvi_top)),

Quoted 1 line
Quoted 1 line

drivers/bluetooth/btintel.c static void btintel_get_fw_name_tlv(const · line 2222

Quoted 1 line
drivers/bluetooth/btintel.c +0 -0
   		 INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver-

cnvr_top),

Quoted 16 lines
Quoted 16 lines
Quoted 2 lines
drivers/bluetooth/btintel.c +0 -0
@@ -2607,6 +2626,23 @@ static int

btintel_bootloader_setup_tlv(struct

hci_dev *hdev,

drivers/bluetooth/btintel.c static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2636

Quoted 11 lines
   	if (err)
   		return err;
drivers/bluetooth/btintel.c +8 -0
+	err = btintel_read_version_tlv(hdev, ver);
+	if (err)
+		return err;
+
+    /* If image type returned is 0x02, then controller supports secondary
+     * boot loader image
+     */
+	if (ver->img_type == 0x02) {

Could a macro be defined for 0x02?

Ack

Quoted 13 lines
Quoted 2 lines
Quoted 2 lines

drivers/bluetooth/btintel.c

Quoted 2 lines
drivers/bluetooth/btintel.c +1 -0
+		err = btintel_prepare_fw_download_tlv(hdev, ver,

&boot_param);

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/bluetooth/btintel.c +8 -0
+		if (err)
+			return err;
+
+		err = btintel_boot(hdev, boot_param);
+		if (err)
+			return err;
+	}
+
   	btintel_clear_flag(hdev, INTEL_BOOTLOADER);
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
   	btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");

Kind regards,

Paul

Thanks,
Kiran