From: Kiran K <kiran.k@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: chethan.tumkur.narayan@intel.com,
chandrashekar.devegowda@intel.com, Kiran K <kiran.k@intel.com>,
Ravindra <ravindra@intel.com>
Subject: [PATCH v4 2/2] Bluetooth: btintel: load unlocker.sfi to allow unsigned firmware
Date: Thu, 8 Oct 2026 19:36:02 +0530 [thread overview]
Message-ID: <20261008140602.2623464-2-kiran.k@intel.com> (raw)
In-Reply-To: <20261008140602.2623464-1-kiran.k@intel.com>
When an unsigned operational firmware image is needed for debug, the
controller requires intel/unlocker.sfi to be loaded first. Without the
unlocker image, the controller rejects the unsigned operational firmware.
Support both firmware download flows based on the unlock policy advertised
in the version TLV:
BlazarI/BlazarIW/BlazarU/Gale Peak (unlock_policy == 0):
Boot ROM -> unlocker.sfi -> IML -> OPFW
Scorpius Peak onwards (unlock_policy == 1):
Boot ROM -> IML -> unlocker.sfi -> OPFW
Parse the new INTEL_TLV_UNLOCK_POLICY and INTEL_TLV_PLATFORM_ID TLVs
into struct intel_version_tlv, track the pending unlocker load through
a new btintel_data::unlocker flag, and pick intel/unlocker.sfi as the
firmware filename when that flag is set. If the unlocker image is not
present in the firmware search path, the driver silently falls through
to the normal firmware download path. If the unlocker image is present
but fails to download to the controller, the driver logs the error and
aborts bootloader setup, since continuing would leave the controller in
an inconsistent state.
[ 413.375247] Bluetooth: hci0: Found device firmware: intel/unlocker.sfi
[ 413.501051] Bluetooth: hci0: Waiting for firmware download to complete
[ 413.501058] Bluetooth: hci0: Firmware loaded in 122864 usecs
[ 413.501537] Bluetooth: hci0: Found device firmware: intel/ibt-02a2-01a1.sfi
[ 413.501547] Bluetooth: hci0: Boot Address: 0x10001000
[ 413.501548] Bluetooth: hci0: Firmware Version: 137-39.26
[ 414.103473] Bluetooth: hci0: Waiting for firmware download to complete
[ 414.103478] Bluetooth: hci0: Firmware loaded in 587841 usecs
[ 414.149576] Bluetooth: hci0: Applying Intel DDC parameters completed
[ 414.150089] Bluetooth: hci0: Firmware timestamp 2026.39 buildtype 3 build 86921
[ 414.150092] Bluetooth: hci0: Firmware SHA1: 0xeb2e0a4b
[ 414.150093] Bluetooth: hci0: Platform ID: 570c6ffbcbe6
[ 414.150094] Bluetooth: hci0: Fseq status: Success (0x00)
[ 414.150730] Bluetooth: hci0: Fseq executed: 15.255.00.98
[ 414.150734] Bluetooth: hci0: Fseq BT Top: 06.32.00.02
Assisted-by: Copilot:Claude Opus 4.7
Signed-off-by: Ravindra <ravindra@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
---
changes in v4:
In 1/2, addressed comment[1], comment[3]
https://sashiko.dev/#/patchset/20261007124721.2521956-1-kiran.k%40intel.com
changes in v3:
- Address Sashiko review comments
https://sashiko.dev/#/patchset/20260929021056.1396791-1-kiran.k%40intel.com
changes in v2:
- Updated commit message
drivers/bluetooth/btintel.c | 94 +++++++++++++++++++++++++++++++++++--
drivers/bluetooth/btintel.h | 5 ++
2 files changed, 96 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index c4a6b5ea64f1..0709fb3212f9 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -579,6 +579,11 @@ int btintel_version_info_tlv(struct hci_dev *hdev,
if (version->img_type == BTINTEL_IMG_OP)
bt_dev_info(hdev, "Firmware SHA1: 0x%8.8x", version->git_sha1);
+ if (!mem_is_zero(version->platform_id, sizeof(version->platform_id)))
+ bt_dev_info(hdev, "Platform ID: %6phN", version->platform_id);
+
+ bt_dev_info(hdev, "Unlock policy: 0x%2.2x", version->unlock_policy);
+
return 0;
}
EXPORT_SYMBOL_GPL(btintel_version_info_tlv);
@@ -604,11 +609,14 @@ static u8 btintel_version_tlv_min_len(u8 type)
case INTEL_TLV_DEBUG_LOCK:
case INTEL_TLV_LIMITED_CCE:
case INTEL_TLV_SBE_TYPE:
+ case INTEL_TLV_UNLOCK_POLICY:
return sizeof(u8);
case INTEL_TLV_MIN_FW:
return 3;
case INTEL_TLV_OTP_BDADDR:
return sizeof(bdaddr_t);
+ case INTEL_TLV_PLATFORM_ID:
+ return sizeof(((struct intel_version_tlv *)0)->platform_id);
default:
return 0;
}
@@ -716,6 +724,13 @@ int btintel_parse_version_tlv(struct hci_dev *hdev,
snprintf(version->fw_id, sizeof(version->fw_id),
"%.*s", tlv->len, tlv->val);
break;
+ case INTEL_TLV_UNLOCK_POLICY:
+ version->unlock_policy = tlv->val[0];
+ break;
+ case INTEL_TLV_PLATFORM_ID:
+ memcpy(version->platform_id, tlv->val,
+ sizeof(version->platform_id));
+ break;
default:
/* Ignore rest of information */
break;
@@ -2473,7 +2488,12 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev,
else
btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi");
} else {
- btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi");
+ if (intel_data->unlocker) {
+ strscpy(fwname, "intel/unlocker.sfi");
+ intel_data->unlocker = false;
+ } else {
+ btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi");
+ }
}
err = firmware_request_nowarn(&fw, fwname, &hdev->dev);
@@ -3490,6 +3510,36 @@ static int btintel_set_specific_absorption_rate(struct hci_dev *hdev,
return 0;
}
+/* Attempt to load intel/unlocker.sfi if it is present in the firmware
+ * search path. If the file is not available the device will be booted
+ * with a signed operational firmware, which is the common case, so its
+ * absence must be treated as normal and not logged as an error.
+ */
+static int btintel_try_load_unlocker(struct hci_dev *hdev,
+ struct intel_version_tlv *ver)
+{
+ struct btintel_data *data = hci_get_priv(hdev);
+ const struct firmware *fw;
+ u32 boot_param = 0;
+ int err;
+
+ err = firmware_request_nowarn(&fw, "intel/unlocker.sfi", &hdev->dev);
+ if (err) {
+ bt_dev_dbg(hdev, "intel/unlocker.sfi not present (%d), skipping unlocker load",
+ err);
+ return 0;
+ }
+ release_firmware(fw);
+
+ data->unlocker = true;
+ err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
+ if (err) {
+ bt_dev_err(hdev, "Failed to load intel/unlocker.sfi (%d)", err);
+ data->unlocker = false;
+ }
+ return err;
+}
+
int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
struct intel_version_tlv *ver)
{
@@ -3497,6 +3547,8 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
char ddcname[64];
int err;
struct intel_version_tlv new_ver;
+ struct btintel_data *data = hci_get_priv(hdev);
+ u8 hw_variant = INTEL_HW_VARIANT(ver->cnvi_bt);
bt_dev_dbg(hdev, "");
@@ -3515,6 +3567,31 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
btintel_set_flag(hdev, INTEL_BOOTLOADER);
+ data->unlocker = false;
+
+ /* Legacy unlocker flow (BlazarI / BlazarIW / BlazarU / Gale Peak):
+ * Boot ROM -> unlocker.sfi -> IML -> OPFW
+ *
+ * Skip the unlocker check when the controller is already running
+ * operational firmware (can happen on USB); the unlocker flow is
+ * only meaningful from the bootloader stage.
+ */
+ if (ver->img_type != BTINTEL_IMG_OP &&
+ ver->api_lock && ver->unlock_policy == 0) {
+ switch (hw_variant) {
+ case BTINTEL_HWID_BZRI:
+ case BTINTEL_HWID_BZRIW:
+ case BTINTEL_HWID_BZRU:
+ case BTINTEL_HWID_GAP:
+ err = btintel_try_load_unlocker(hdev, ver);
+ if (err)
+ return err;
+ break;
+ default:
+ break;
+ }
+ }
+
err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
if (err)
return err;
@@ -3538,8 +3615,19 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
return err;
}
- /* If image type returned is BTINTEL_IMG_IML, then controller supports
- * intermediate loader image
+ /* New unlocker flow (Scorpius Peak onwards):
+ * Boot ROM -> IML -> unlocker.sfi -> OPFW
+ */
+ if (hw_variant >= BTINTEL_HWID_SCP &&
+ ver->api_lock && ver->unlock_policy == 1) {
+ err = btintel_try_load_unlocker(hdev, ver);
+ if (err)
+ return err;
+ }
+
+ /* Transition to Operational Firmware
+ * If image type returned is BTINTEL_IMG_IML, then controller supports
+ * intermediate loader image.
*/
if (ver->img_type == BTINTEL_IMG_IML) {
err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h
index ff7c1d623007..9526acf65959 100644
--- a/drivers/bluetooth/btintel.h
+++ b/drivers/bluetooth/btintel.h
@@ -43,6 +43,8 @@ enum {
INTEL_TLV_OTP_BDADDR,
INTEL_TLV_UNLOCKED_STATE,
INTEL_TLV_GIT_SHA1,
+ INTEL_TLV_UNLOCK_POLICY = 0x3c,
+ INTEL_TLV_PLATFORM_ID = 0x3d,
INTEL_TLV_FW_ID = 0x50
};
@@ -108,6 +110,8 @@ struct intel_version_tlv {
u32 git_sha1;
u8 fw_id[BTINTEL_FWID_MAXLEN];
bdaddr_t otp_bd_addr;
+ u8 unlock_policy;
+ u8 platform_id[6];
};
struct intel_version {
@@ -261,6 +265,7 @@ struct btintel_data {
DECLARE_BITMAP(flags, __INTEL_NUM_FLAGS);
int (*acpi_reset_method)(struct hci_dev *hdev);
u32 cnvi_bt;
+ bool unlocker;
};
#define btintel_set_flag(hdev, nr) \
--
2.54.0
next prev parent reply other threads:[~2026-10-08 13:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 14:06 [PATCH v4 1/2] Bluetooth: btintel: Zero version data before parsing TLVs Kiran K
2026-10-08 14:06 ` Kiran K [this message]
2026-10-08 15:26 ` [v4,1/2] " bluez.test.bot
2026-10-09 14:00 ` Luiz Augusto von Dentz
2026-10-09 19:50 ` [PATCH v4 1/2] " patchwork-bot+bluetooth
2026-10-09 20:00 ` patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261008140602.2623464-2-kiran.k@intel.com \
--to=kiran.k@intel.com \
--cc=chandrashekar.devegowda@intel.com \
--cc=chethan.tumkur.narayan@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ravindra@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox