Lines Matching +full:firmware +full:- +full:reset
1 // SPDX-License-Identifier: GPL-2.0-or-later
10 #include <linux/firmware.h>
69 if (skb->len != sizeof(*bda)) { in btintel_check_bdaddr()
72 return -EIO; in btintel_check_bdaddr()
75 bda = (struct hci_rp_read_bd_addr *)skb->data; in btintel_check_bdaddr()
82 if (!bacmp(&bda->bdaddr, BDADDR_INTEL)) { in btintel_check_bdaddr()
84 &bda->bdaddr); in btintel_check_bdaddr()
85 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_check_bdaddr()
111 int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched) in btintel_exit_mfg() argument
118 * 0x01: Disable manufacturing mode and reset with patches deactivated. in btintel_exit_mfg()
119 * 0x02: Disable manufacturing mode and reset with patches activated. in btintel_exit_mfg()
121 if (reset) in btintel_exit_mfg()
193 if (err == -ENODATA) in btintel_set_diag()
250 bt_dev_err(hdev, "Reset after hardware error failed (%ld)", in btintel_hw_error()
263 if (skb->len != 13) { in btintel_hw_error()
269 bt_dev_err(hdev, "Exception info %s", (char *)(skb->data + 1)); in btintel_hw_error()
282 if (ver->hw_platform != 0x37) { in btintel_version_info()
284 ver->hw_platform); in btintel_version_info()
285 return -EINVAL; in btintel_version_info()
288 /* Check for supported iBT hardware variants of this firmware in btintel_version_info()
294 switch (ver->hw_variant) { in btintel_version_info()
295 case 0x07: /* WP - Legacy ROM */ in btintel_version_info()
296 case 0x08: /* StP - Legacy ROM */ in btintel_version_info()
306 ver->hw_variant); in btintel_version_info()
307 return -EINVAL; in btintel_version_info()
310 switch (ver->fw_variant) { in btintel_version_info()
321 variant = "Firmware"; in btintel_version_info()
324 bt_dev_err(hdev, "Unsupported firmware variant(%02x)", ver->fw_variant); in btintel_version_info()
325 return -EINVAL; in btintel_version_info()
328 coredump_info.hw_variant = ver->hw_variant; in btintel_version_info()
329 coredump_info.fw_build_num = ver->fw_build_num; in btintel_version_info()
332 variant, ver->fw_revision >> 4, ver->fw_revision & 0x0f, in btintel_version_info()
333 ver->fw_build_num, ver->fw_build_ww, in btintel_version_info()
334 2000 + ver->fw_build_yy); in btintel_version_info()
357 plen -= fragment_len; in btintel_secure_send()
366 const struct firmware *fw; in btintel_load_ddc_config()
371 err = request_firmware_direct(&fw, ddc_name, &hdev->dev); in btintel_load_ddc_config()
380 fw_ptr = fw->data; in btintel_load_ddc_config()
383 * Length (1 byte), DDC ID (2 bytes), and DDC value (Length - 2). in btintel_load_ddc_config()
385 while (fw->size > fw_ptr - fw->data) { in btintel_load_ddc_config()
438 if (!skb || skb->len != sizeof(*ver)) { in btintel_read_version()
441 return -EILSEQ; in btintel_read_version()
444 memcpy(ver, skb->data, sizeof(*ver)); in btintel_read_version()
460 if (INTEL_HW_PLATFORM(version->cnvi_bt) != 0x37) { in btintel_version_info_tlv()
462 INTEL_HW_PLATFORM(version->cnvi_bt)); in btintel_version_info_tlv()
463 return -EINVAL; in btintel_version_info_tlv()
466 /* Check for supported iBT hardware variants of this firmware in btintel_version_info_tlv()
472 switch (INTEL_HW_VARIANT(version->cnvi_bt)) { in btintel_version_info_tlv()
475 case 0x19: /* Slr-F */ in btintel_version_info_tlv()
483 INTEL_HW_VARIANT(version->cnvi_bt)); in btintel_version_info_tlv()
484 return -EINVAL; in btintel_version_info_tlv()
487 switch (version->img_type) { in btintel_version_info_tlv()
490 /* It is required that every single firmware fragment is acknowledged in btintel_version_info_tlv()
494 if (version->limited_cce != 0x00) { in btintel_version_info_tlv()
495 bt_dev_err(hdev, "Unsupported Intel firmware loading method (0x%x)", in btintel_version_info_tlv()
496 version->limited_cce); in btintel_version_info_tlv()
497 return -EINVAL; in btintel_version_info_tlv()
501 if (version->sbe_type > 0x01) { in btintel_version_info_tlv()
503 version->sbe_type); in btintel_version_info_tlv()
504 return -EINVAL; in btintel_version_info_tlv()
507 bt_dev_info(hdev, "Device revision is %u", version->dev_rev_id); in btintel_version_info_tlv()
509 version->secure_boot ? "enabled" : "disabled"); in btintel_version_info_tlv()
511 version->otp_lock ? "enabled" : "disabled"); in btintel_version_info_tlv()
513 version->api_lock ? "enabled" : "disabled"); in btintel_version_info_tlv()
515 version->debug_lock ? "enabled" : "disabled"); in btintel_version_info_tlv()
516 bt_dev_info(hdev, "Minimum firmware build %u week %u %u", in btintel_version_info_tlv()
517 version->min_fw_build_nn, version->min_fw_build_cw, in btintel_version_info_tlv()
518 2000 + version->min_fw_build_yy); in btintel_version_info_tlv()
524 variant = "Firmware"; in btintel_version_info_tlv()
527 bt_dev_err(hdev, "Unsupported image type(%02x)", version->img_type); in btintel_version_info_tlv()
528 return -EINVAL; in btintel_version_info_tlv()
531 coredump_info.hw_variant = INTEL_HW_VARIANT(version->cnvi_bt); in btintel_version_info_tlv()
532 coredump_info.fw_build_num = version->build_num; in btintel_version_info_tlv()
535 2000 + (version->timestamp >> 8), version->timestamp & 0xff, in btintel_version_info_tlv()
536 version->build_type, version->build_num); in btintel_version_info_tlv()
537 if (version->img_type == BTINTEL_IMG_OP) in btintel_version_info_tlv()
538 bt_dev_info(hdev, "Firmware SHA1: 0x%8.8x", version->git_sha1); in btintel_version_info_tlv()
556 while (skb->len) { in btintel_parse_version_tlv()
560 if (skb->len < sizeof(*tlv)) in btintel_parse_version_tlv()
561 return -EINVAL; in btintel_parse_version_tlv()
563 tlv = (struct intel_tlv *)skb->data; in btintel_parse_version_tlv()
566 if (skb->len < tlv->len + sizeof(*tlv)) in btintel_parse_version_tlv()
567 return -EINVAL; in btintel_parse_version_tlv()
569 switch (tlv->type) { in btintel_parse_version_tlv()
571 version->cnvi_top = get_unaligned_le32(tlv->val); in btintel_parse_version_tlv()
574 version->cnvr_top = get_unaligned_le32(tlv->val); in btintel_parse_version_tlv()
577 version->cnvi_bt = get_unaligned_le32(tlv->val); in btintel_parse_version_tlv()
580 version->cnvr_bt = get_unaligned_le32(tlv->val); in btintel_parse_version_tlv()
583 version->dev_rev_id = get_unaligned_le16(tlv->val); in btintel_parse_version_tlv()
586 version->img_type = tlv->val[0]; in btintel_parse_version_tlv()
589 /* If image type is Operational firmware (0x03), then in btintel_parse_version_tlv()
593 version->min_fw_build_cw = tlv->val[0]; in btintel_parse_version_tlv()
594 version->min_fw_build_yy = tlv->val[1]; in btintel_parse_version_tlv()
595 version->timestamp = get_unaligned_le16(tlv->val); in btintel_parse_version_tlv()
598 version->build_type = tlv->val[0]; in btintel_parse_version_tlv()
601 /* If image type is Operational firmware (0x03), then in btintel_parse_version_tlv()
605 version->min_fw_build_nn = tlv->val[0]; in btintel_parse_version_tlv()
606 version->build_num = get_unaligned_le32(tlv->val); in btintel_parse_version_tlv()
609 version->secure_boot = tlv->val[0]; in btintel_parse_version_tlv()
612 version->otp_lock = tlv->val[0]; in btintel_parse_version_tlv()
615 version->api_lock = tlv->val[0]; in btintel_parse_version_tlv()
618 version->debug_lock = tlv->val[0]; in btintel_parse_version_tlv()
621 version->min_fw_build_nn = tlv->val[0]; in btintel_parse_version_tlv()
622 version->min_fw_build_cw = tlv->val[1]; in btintel_parse_version_tlv()
623 version->min_fw_build_yy = tlv->val[2]; in btintel_parse_version_tlv()
626 version->limited_cce = tlv->val[0]; in btintel_parse_version_tlv()
629 version->sbe_type = tlv->val[0]; in btintel_parse_version_tlv()
632 memcpy(&version->otp_bd_addr, tlv->val, in btintel_parse_version_tlv()
636 version->git_sha1 = get_unaligned_le32(tlv->val); in btintel_parse_version_tlv()
639 snprintf(version->fw_id, sizeof(version->fw_id), in btintel_parse_version_tlv()
640 "%s", tlv->val); in btintel_parse_version_tlv()
647 skb_pull(skb, tlv->len + sizeof(*tlv)); in btintel_parse_version_tlv()
661 return -EINVAL; in btintel_read_version_tlv()
670 if (skb->data[0]) { in btintel_read_version_tlv()
672 skb->data[0]); in btintel_read_version_tlv()
674 return -EIO; in btintel_read_version_tlv()
683 /* ------- REGMAP IBT SUPPORT ------- */
718 return -EINVAL; in regmap_ibt_read()
731 return -EINVAL; in regmap_ibt_read()
734 /* regmap provides a little-endian formatted addr */ in regmap_ibt_read()
738 bt_dev_dbg(ctx->hdev, "Register (0x%x) read", le32_to_cpu(cp.addr)); in regmap_ibt_read()
740 skb = hci_cmd_sync(ctx->hdev, ctx->op_read, sizeof(cp), &cp, in regmap_ibt_read()
744 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error (%d)", in regmap_ibt_read()
749 if (skb->len != sizeof(*rp) + val_size) { in regmap_ibt_read()
750 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad len", in regmap_ibt_read()
752 err = -EINVAL; in regmap_ibt_read()
756 rp = (struct ibt_rp_reg_access *)skb->data; in regmap_ibt_read()
758 if (rp->addr != cp.addr) { in regmap_ibt_read()
759 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad addr", in regmap_ibt_read()
760 le32_to_cpu(rp->addr)); in regmap_ibt_read()
761 err = -EINVAL; in regmap_ibt_read()
765 memcpy(val, rp->data, val_size); in regmap_ibt_read()
784 return -EINVAL; in regmap_ibt_gather_write()
797 return -EINVAL; in regmap_ibt_gather_write()
802 return -ENOMEM; in regmap_ibt_gather_write()
804 /* regmap provides a little-endian formatted addr/value */ in regmap_ibt_gather_write()
805 cp->addr = *(__le32 *)addr; in regmap_ibt_gather_write()
806 cp->mode = mode; in regmap_ibt_gather_write()
807 cp->len = val_size; in regmap_ibt_gather_write()
808 memcpy(&cp->data, val, val_size); in regmap_ibt_gather_write()
810 bt_dev_dbg(ctx->hdev, "Register (0x%x) write", le32_to_cpu(cp->addr)); in regmap_ibt_gather_write()
812 skb = hci_cmd_sync(ctx->hdev, ctx->op_write, plen, cp, HCI_CMD_TIMEOUT); in regmap_ibt_gather_write()
815 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) write error (%d)", in regmap_ibt_gather_write()
816 le32_to_cpu(cp->addr), err); in regmap_ibt_gather_write()
832 return -EINVAL; in regmap_ibt_write()
834 return regmap_ibt_gather_write(context, data, 4, data + 4, count - 4); in regmap_ibt_write()
863 bt_dev_info(hdev, "regmap: Init R%x-W%x region", opcode_read, in btintel_regmap_init()
868 return ERR_PTR(-ENOMEM); in btintel_regmap_init()
870 ctx->op_read = opcode_read; in btintel_regmap_init()
871 ctx->op_write = opcode_write; in btintel_regmap_init()
872 ctx->hdev = hdev; in btintel_regmap_init()
874 return regmap_init(&hdev->dev, ®map_ibt, ctx, ®map_ibt_cfg); in btintel_regmap_init()
888 bt_dev_err(hdev, "Failed to send Intel Reset command"); in btintel_send_intel_reset()
910 if (skb->len != sizeof(*params)) { in btintel_read_boot_params()
913 return -EILSEQ; in btintel_read_boot_params()
916 memcpy(params, skb->data, sizeof(*params)); in btintel_read_boot_params()
920 if (params->status) { in btintel_read_boot_params()
922 params->status); in btintel_read_boot_params()
923 return -bt_to_errno(params->status); in btintel_read_boot_params()
927 le16_to_cpu(params->dev_revid)); in btintel_read_boot_params()
930 params->secure_boot ? "enabled" : "disabled"); in btintel_read_boot_params()
933 params->otp_lock ? "enabled" : "disabled"); in btintel_read_boot_params()
936 params->api_lock ? "enabled" : "disabled"); in btintel_read_boot_params()
939 params->debug_lock ? "enabled" : "disabled"); in btintel_read_boot_params()
941 bt_dev_info(hdev, "Minimum firmware build %u week %u %u", in btintel_read_boot_params()
942 params->min_fw_build_nn, params->min_fw_build_cw, in btintel_read_boot_params()
943 2000 + params->min_fw_build_yy); in btintel_read_boot_params()
950 const struct firmware *fw) in btintel_sfi_rsa_header_secure_send()
954 /* Start the firmware download transaction with the Init fragment in btintel_sfi_rsa_header_secure_send()
957 err = btintel_secure_send(hdev, 0x00, 128, fw->data); in btintel_sfi_rsa_header_secure_send()
959 bt_dev_err(hdev, "Failed to send firmware header (%d)", err); in btintel_sfi_rsa_header_secure_send()
963 /* Send the 256 bytes of public key information from the firmware in btintel_sfi_rsa_header_secure_send()
966 err = btintel_secure_send(hdev, 0x03, 256, fw->data + 128); in btintel_sfi_rsa_header_secure_send()
968 bt_dev_err(hdev, "Failed to send firmware pkey (%d)", err); in btintel_sfi_rsa_header_secure_send()
972 /* Send the 256 bytes of signature information from the firmware in btintel_sfi_rsa_header_secure_send()
975 err = btintel_secure_send(hdev, 0x02, 256, fw->data + 388); in btintel_sfi_rsa_header_secure_send()
977 bt_dev_err(hdev, "Failed to send firmware signature (%d)", err); in btintel_sfi_rsa_header_secure_send()
986 const struct firmware *fw) in btintel_sfi_ecdsa_header_secure_send()
990 /* Start the firmware download transaction with the Init fragment in btintel_sfi_ecdsa_header_secure_send()
993 err = btintel_secure_send(hdev, 0x00, 128, fw->data + 644); in btintel_sfi_ecdsa_header_secure_send()
995 bt_dev_err(hdev, "Failed to send firmware header (%d)", err); in btintel_sfi_ecdsa_header_secure_send()
999 /* Send the 96 bytes of public key information from the firmware in btintel_sfi_ecdsa_header_secure_send()
1002 err = btintel_secure_send(hdev, 0x03, 96, fw->data + 644 + 128); in btintel_sfi_ecdsa_header_secure_send()
1004 bt_dev_err(hdev, "Failed to send firmware pkey (%d)", err); in btintel_sfi_ecdsa_header_secure_send()
1008 /* Send the 96 bytes of signature information from the firmware in btintel_sfi_ecdsa_header_secure_send()
1011 err = btintel_secure_send(hdev, 0x02, 96, fw->data + 644 + 224); in btintel_sfi_ecdsa_header_secure_send()
1013 bt_dev_err(hdev, "Failed to send firmware signature (%d)", in btintel_sfi_ecdsa_header_secure_send()
1021 const struct firmware *fw, in btintel_download_firmware_payload()
1028 fw_ptr = fw->data + offset; in btintel_download_firmware_payload()
1030 err = -EINVAL; in btintel_download_firmware_payload()
1032 while (fw_ptr - fw->data < fw->size) { in btintel_download_firmware_payload()
1035 frag_len += sizeof(*cmd) + cmd->plen; in btintel_download_firmware_payload()
1038 * a 4 byte alignment. It happens so that the firmware file in btintel_download_firmware_payload()
1043 * firmware data buffer as a single Data fragement. in btintel_download_firmware_payload()
1049 "Failed to send firmware data (%d)", in btintel_download_firmware_payload()
1065 const struct firmware *fw, in btintel_firmware_version()
1070 fw_ptr = fw->data; in btintel_firmware_version()
1072 while (fw_ptr - fw->data < fw->size) { in btintel_firmware_version()
1075 /* Each SKU has a different reset parameter to use in the in btintel_firmware_version()
1076 * HCI_Intel_Reset command and it is embedded in the firmware in btintel_firmware_version()
1078 * the firmware data and save it for later use. in btintel_firmware_version()
1080 if (le16_to_cpu(cmd->opcode) == CMD_WRITE_BOOT_PARAMS) { in btintel_firmware_version()
1085 *boot_addr = le32_to_cpu(params->boot_addr); in btintel_firmware_version()
1089 bt_dev_info(hdev, "Firmware Version: %u-%u.%u", in btintel_firmware_version()
1090 params->fw_build_num, params->fw_build_ww, in btintel_firmware_version()
1091 params->fw_build_yy); in btintel_firmware_version()
1093 return (num == params->fw_build_num && in btintel_firmware_version()
1094 ww == params->fw_build_ww && in btintel_firmware_version()
1095 yy == params->fw_build_yy); in btintel_firmware_version()
1098 fw_ptr += sizeof(*cmd) + cmd->plen; in btintel_firmware_version()
1106 const struct firmware *fw, in btintel_download_firmware()
1111 /* SfP and WsP don't seem to update the firmware version on file in btintel_download_firmware()
1114 switch (ver->hw_variant) { in btintel_download_firmware()
1121 /* Skip download if firmware has the same version */ in btintel_download_firmware()
1122 if (btintel_firmware_version(hdev, ver->fw_build_num, in btintel_download_firmware()
1123 ver->fw_build_ww, ver->fw_build_yy, in btintel_download_firmware()
1125 bt_dev_info(hdev, "Firmware already loaded"); in btintel_download_firmware()
1126 /* Return -EALREADY to indicate that the firmware has in btintel_download_firmware()
1129 return -EALREADY; in btintel_download_firmware()
1133 /* The firmware variant determines if the device is in bootloader in btintel_download_firmware()
1134 * mode or is running operational firmware. The value 0x06 identifies in btintel_download_firmware()
1136 * firmware. in btintel_download_firmware()
1138 * If the firmware version has changed that means it needs to be reset in btintel_download_firmware()
1139 * to bootloader when operational so the new firmware can be loaded. in btintel_download_firmware()
1141 if (ver->fw_variant == 0x23) in btintel_download_firmware()
1142 return -EINVAL; in btintel_download_firmware()
1154 const struct firmware *fw, u32 *boot_param, in btintel_download_fw_tlv()
1160 /* Skip download if firmware has the same version */ in btintel_download_fw_tlv()
1161 if (btintel_firmware_version(hdev, ver->min_fw_build_nn, in btintel_download_fw_tlv()
1162 ver->min_fw_build_cw, in btintel_download_fw_tlv()
1163 ver->min_fw_build_yy, in btintel_download_fw_tlv()
1165 bt_dev_info(hdev, "Firmware already loaded"); in btintel_download_fw_tlv()
1166 /* Return -EALREADY to indicate that firmware has in btintel_download_fw_tlv()
1169 return -EALREADY; in btintel_download_fw_tlv()
1172 /* The firmware variant determines if the device is in bootloader in btintel_download_fw_tlv()
1173 * mode or is running operational firmware. The value 0x01 identifies in btintel_download_fw_tlv()
1175 * firmware. in btintel_download_fw_tlv()
1177 * If the firmware version has changed that means it needs to be reset in btintel_download_fw_tlv()
1178 * to bootloader when operational so the new firmware can be loaded. in btintel_download_fw_tlv()
1180 if (ver->img_type == BTINTEL_IMG_OP) in btintel_download_fw_tlv()
1181 return -EINVAL; in btintel_download_fw_tlv()
1195 css_header_ver = get_unaligned_le32(fw->data + CSS_HEADER_OFFSET); in btintel_download_fw_tlv()
1198 return -EINVAL; in btintel_download_fw_tlv()
1205 return -EINVAL; in btintel_download_fw_tlv()
1217 if (fw->data[ECDSA_OFFSET] != 0x06) in btintel_download_fw_tlv()
1218 return -EINVAL; in btintel_download_fw_tlv()
1221 css_header_ver = get_unaligned_le32(fw->data + ECDSA_OFFSET + CSS_HEADER_OFFSET); in btintel_download_fw_tlv()
1224 return -EINVAL; in btintel_download_fw_tlv()
1255 /* Send Intel Reset command. This will result in in btintel_reset_to_bootloader()
1256 * re-enumeration of BT controller. in btintel_reset_to_bootloader()
1258 * Intel Reset parameter description: in btintel_reset_to_bootloader()
1259 * reset_type : 0x00 (Soft reset), in btintel_reset_to_bootloader()
1260 * 0x01 (Hard reset) in btintel_reset_to_bootloader()
1283 bt_dev_info(hdev, "Intel reset sent to retry FW download"); in btintel_reset_to_bootloader()
1286 /* Current Intel BT controllers(ThP/JfP) hold the USB reset in btintel_reset_to_bootloader()
1287 * lines for 2ms when it receives Intel Reset in bootloader mode. in btintel_reset_to_bootloader()
1288 * Whereas, the upcoming Intel BT controllers will hold USB reset in btintel_reset_to_bootloader()
1300 /* Intel controller supports two pages, each page is of 128-bit in btintel_read_debug_features()
1311 if (skb->len != (sizeof(features->page1) + 3)) { in btintel_read_debug_features()
1314 return -EILSEQ; in btintel_read_debug_features()
1317 memcpy(features->page1, skb->data + 3, sizeof(features->page1)); in btintel_read_debug_features()
1336 return -EINVAL; in btintel_set_debug_features()
1339 if (!(features->page1[0] & 0x3f)) { in btintel_set_debug_features()
1384 return -EINVAL; in btintel_reset_debug_features()
1387 if (!(features->page1[0] & 0x3f)) { in btintel_reset_debug_features()
1409 bt_dev_info(hdev, "reset debug features: trace_enable 0x%02x mask 0x%02x", in btintel_reset_debug_features()
1429 /* Set or reset the debug features. */ in btintel_set_quality_report()
1460 snprintf(buf, sizeof(buf), "Firmware Version: 0x%X\n", in btintel_dmp_hdr()
1484 return -EOPNOTSUPP; in btintel_register_devcoredump_support()
1492 static const struct firmware *btintel_legacy_rom_get_fw(struct hci_dev *hdev, in btintel_legacy_rom_get_fw()
1495 const struct firmware *fw; in btintel_legacy_rom_get_fw()
1500 "intel/ibt-hw-%x.%x.%x-fw-%x.%x.%x.%x.%x.bseq", in btintel_legacy_rom_get_fw()
1501 ver->hw_platform, ver->hw_variant, ver->hw_revision, in btintel_legacy_rom_get_fw()
1502 ver->fw_variant, ver->fw_revision, ver->fw_build_num, in btintel_legacy_rom_get_fw()
1503 ver->fw_build_ww, ver->fw_build_yy); in btintel_legacy_rom_get_fw()
1505 ret = request_firmware(&fw, fwname, &hdev->dev); in btintel_legacy_rom_get_fw()
1507 if (ret == -EINVAL) { in btintel_legacy_rom_get_fw()
1508 bt_dev_err(hdev, "Intel firmware file request failed (%d)", in btintel_legacy_rom_get_fw()
1513 bt_dev_err(hdev, "failed to open Intel firmware file: %s (%d)", in btintel_legacy_rom_get_fw()
1516 /* If the correct firmware patch file is not found, use the in btintel_legacy_rom_get_fw()
1517 * default firmware patch file instead in btintel_legacy_rom_get_fw()
1519 snprintf(fwname, sizeof(fwname), "intel/ibt-hw-%x.%x.bseq", in btintel_legacy_rom_get_fw()
1520 ver->hw_platform, ver->hw_variant); in btintel_legacy_rom_get_fw()
1521 if (request_firmware(&fw, fwname, &hdev->dev) < 0) { in btintel_legacy_rom_get_fw()
1528 bt_dev_info(hdev, "Intel Bluetooth firmware file: %s", fwname); in btintel_legacy_rom_get_fw()
1534 const struct firmware *fw, in btintel_legacy_rom_patching()
1542 int remain = fw->size - (*fw_ptr - fw->data); in btintel_legacy_rom_patching()
1546 * in the current firmware buffer doesn't start with 0x01 or in btintel_legacy_rom_patching()
1548 * the firmware file is corrupted and it should stop the patching in btintel_legacy_rom_patching()
1553 return -EINVAL; in btintel_legacy_rom_patching()
1556 remain--; in btintel_legacy_rom_patching()
1560 remain -= sizeof(*cmd); in btintel_legacy_rom_patching()
1562 /* Ensure that the remain firmware data is long enough than the length in btintel_legacy_rom_patching()
1563 * of command parameter. If not, the firmware file is corrupted. in btintel_legacy_rom_patching()
1565 if (remain < cmd->plen) { in btintel_legacy_rom_patching()
1567 return -EFAULT; in btintel_legacy_rom_patching()
1570 /* If there is a command that loads a patch in the firmware in btintel_legacy_rom_patching()
1573 * is not required when the default firmware patch file is used in btintel_legacy_rom_patching()
1576 if (*disable_patch && le16_to_cpu(cmd->opcode) == 0xfc8e) in btintel_legacy_rom_patching()
1580 *fw_ptr += cmd->plen; in btintel_legacy_rom_patching()
1581 remain -= cmd->plen; in btintel_legacy_rom_patching()
1592 remain--; in btintel_legacy_rom_patching()
1596 remain -= sizeof(*evt); in btintel_legacy_rom_patching()
1598 if (remain < evt->plen) { in btintel_legacy_rom_patching()
1600 return -EFAULT; in btintel_legacy_rom_patching()
1604 *fw_ptr += evt->plen; in btintel_legacy_rom_patching()
1605 remain -= evt->plen; in btintel_legacy_rom_patching()
1608 /* Every HCI commands in the firmware file has its correspond event. in btintel_legacy_rom_patching()
1609 * If event is not found or remain is smaller than zero, the firmware in btintel_legacy_rom_patching()
1614 return -EFAULT; in btintel_legacy_rom_patching()
1617 skb = __hci_cmd_sync_ev(hdev, le16_to_cpu(cmd->opcode), cmd->plen, in btintel_legacy_rom_patching()
1618 cmd_param, evt->evt, HCI_INIT_TIMEOUT); in btintel_legacy_rom_patching()
1621 cmd->opcode, PTR_ERR(skb)); in btintel_legacy_rom_patching()
1626 * the firmware file. At fist, it checks the length and then in btintel_legacy_rom_patching()
1629 if (skb->len != evt->plen) { in btintel_legacy_rom_patching()
1631 le16_to_cpu(cmd->opcode)); in btintel_legacy_rom_patching()
1633 return -EFAULT; in btintel_legacy_rom_patching()
1636 if (memcmp(skb->data, evt_param, evt->plen)) { in btintel_legacy_rom_patching()
1638 le16_to_cpu(cmd->opcode)); in btintel_legacy_rom_patching()
1640 return -EFAULT; in btintel_legacy_rom_patching()
1650 const struct firmware *fw; in btintel_legacy_rom_setup()
1655 BT_DBG("%s", hdev->name); in btintel_legacy_rom_setup()
1661 if (ver->fw_patch_num) { in btintel_legacy_rom_setup()
1664 ver->fw_patch_num); in btintel_legacy_rom_setup()
1668 /* Opens the firmware patch file based on the firmware version read in btintel_legacy_rom_setup()
1669 * from the controller. If it fails to open the matching firmware in btintel_legacy_rom_setup()
1670 * patch file, it tries to open the default firmware patch file. in btintel_legacy_rom_setup()
1677 fw_ptr = fw->data; in btintel_legacy_rom_setup()
1681 * firmware patch data and configuration parameters. in btintel_legacy_rom_setup()
1691 /* The firmware data file consists of list of Intel specific HCI in btintel_legacy_rom_setup()
1695 * It reads the command and its expected event from the firmware file, in btintel_legacy_rom_setup()
1697 * the returned event is compared with the event read from the firmware in btintel_legacy_rom_setup()
1701 * Once the firmware patching is completed successfully, in btintel_legacy_rom_setup()
1702 * the manufacturer mode is disabled with reset and activating the in btintel_legacy_rom_setup()
1705 * If the firmware patching fails, the manufacturer mode is in btintel_legacy_rom_setup()
1706 * disabled with reset and deactivating the patch. in btintel_legacy_rom_setup()
1708 * If the default patch file is used, no reset is done when disabling in btintel_legacy_rom_setup()
1711 while (fw->size > fw_ptr - fw->data) { in btintel_legacy_rom_setup()
1726 * with reset and activate the downloaded firmware patches. in btintel_legacy_rom_setup()
1733 * every power-on boot in btintel_legacy_rom_setup()
1745 /* Disable the manufacturer mode without reset */ in btintel_legacy_rom_setup()
1750 bt_dev_info(hdev, "Intel firmware patch completed"); in btintel_legacy_rom_setup()
1757 /* Patching failed. Disable the manufacturer mode with reset and in btintel_legacy_rom_setup()
1758 * deactivate the downloaded firmware patches. in btintel_legacy_rom_setup()
1764 bt_dev_info(hdev, "Intel firmware patch completed and deactivated"); in btintel_legacy_rom_setup()
1785 bt_dev_info(hdev, "Waiting for firmware download to complete"); in btintel_download_wait()
1790 if (err == -EINTR) { in btintel_download_wait()
1791 bt_dev_err(hdev, "Firmware loading interrupted"); in btintel_download_wait()
1796 bt_dev_err(hdev, "Firmware loading timeout"); in btintel_download_wait()
1797 return -ETIMEDOUT; in btintel_download_wait()
1801 bt_dev_err(hdev, "Firmware loading failed"); in btintel_download_wait()
1802 return -ENOEXEC; in btintel_download_wait()
1809 bt_dev_info(hdev, "Firmware loaded in %llu usecs", duration); in btintel_download_wait()
1825 if (err == -EINTR) { in btintel_boot_wait()
1827 return -EINTR; in btintel_boot_wait()
1832 return -ETIMEDOUT; in btintel_boot_wait()
1855 bt_dev_err(hdev, "Intel Soft Reset failed (%d)", err); in btintel_boot()
1861 * is done by the operational firmware sending bootup notification. in btintel_boot()
1863 * Booting into operational firmware should not take longer than in btintel_boot()
1868 if (err == -ETIMEDOUT) in btintel_boot()
1879 switch (ver->hw_variant) { in btintel_get_fw_name()
1882 snprintf(fw_name, len, "intel/ibt-%u-%u.%s", in btintel_get_fw_name()
1883 ver->hw_variant, in btintel_get_fw_name()
1884 le16_to_cpu(params->dev_revid), in btintel_get_fw_name()
1891 snprintf(fw_name, len, "intel/ibt-%u-%u-%u.%s", in btintel_get_fw_name()
1892 ver->hw_variant, in btintel_get_fw_name()
1893 ver->hw_revision, in btintel_get_fw_name()
1894 ver->fw_revision, in btintel_get_fw_name()
1898 return -EINVAL; in btintel_get_fw_name()
1909 const struct firmware *fw; in btintel_download_fw()
1915 return -EINVAL; in btintel_download_fw()
1917 /* The firmware variant determines if the device is in bootloader in btintel_download_fw()
1918 * mode or is running operational firmware. The value 0x06 identifies in btintel_download_fw()
1920 * firmware. in btintel_download_fw()
1922 * When the operational firmware is already present, then only in btintel_download_fw()
1930 if (ver->fw_variant == 0x23) { in btintel_download_fw()
1934 /* SfP and WsP don't seem to update the firmware version on file in btintel_download_fw()
1937 switch (ver->hw_variant) { in btintel_download_fw()
1954 /* It is required that every single firmware fragment is acknowledged in btintel_download_fw()
1958 if (params->limited_cce != 0x00) { in btintel_download_fw()
1959 bt_dev_err(hdev, "Unsupported Intel firmware loading method (%u)", in btintel_download_fw()
1960 params->limited_cce); in btintel_download_fw()
1961 return -EINVAL; in btintel_download_fw()
1965 * also be no valid address for the operational firmware. in btintel_download_fw()
1967 if (!bacmp(¶ms->otp_bdaddr, BDADDR_ANY)) { in btintel_download_fw()
1969 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_download_fw()
1974 * revision information are used to select the right firmware for SfP in btintel_download_fw()
1977 * The firmware filename is ibt-<hw_variant>-<dev_revid>.sfi. in btintel_download_fw()
1990 * The firmware file name for these will be in btintel_download_fw()
1991 * ibt-<hw_variant>-<hw_revision>-<fw_revision>.sfi. in btintel_download_fw()
1997 /* Firmware has already been loaded */ in btintel_download_fw()
2002 bt_dev_err(hdev, "Unsupported Intel firmware naming"); in btintel_download_fw()
2003 return -EINVAL; in btintel_download_fw()
2006 err = firmware_request_nowarn(&fw, fwname, &hdev->dev); in btintel_download_fw()
2009 /* Firmware has already been loaded */ in btintel_download_fw()
2014 bt_dev_err(hdev, "Failed to load Intel firmware file %s (%d)", in btintel_download_fw()
2019 bt_dev_info(hdev, "Found device firmware: %s", fwname); in btintel_download_fw()
2021 if (fw->size < 644) { in btintel_download_fw()
2022 bt_dev_err(hdev, "Invalid size of firmware file (%zu)", in btintel_download_fw()
2023 fw->size); in btintel_download_fw()
2024 err = -EBADF; in btintel_download_fw()
2032 /* Start firmware downloading and get boot parameter */ in btintel_download_fw()
2035 if (err == -EALREADY) { in btintel_download_fw()
2036 /* Firmware has already been loaded */ in btintel_download_fw()
2042 /* When FW download fails, send Intel Reset to retry in btintel_download_fw()
2050 * booting the loaded firmware, wait for the bootloader notification in btintel_download_fw()
2056 * The firmware loading should not take longer than 5 seconds in btintel_download_fw()
2061 if (err == -ETIMEDOUT) in btintel_download_fw()
2078 BT_DBG("%s", hdev->name); in btintel_bootloader_setup()
2082 * command while downloading the firmware. in btintel_bootloader_setup()
2092 /* controller is already having an operational firmware */ in btintel_bootloader_setup()
2093 if (ver->fw_variant == 0x23) in btintel_bootloader_setup()
2106 bt_dev_err(hdev, "Unsupported Intel firmware naming"); in btintel_bootloader_setup()
2146 cnvi = INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top), in btintel_get_fw_name_tlv()
2147 INTEL_CNVX_TOP_STEP(ver->cnvi_top)); in btintel_get_fw_name_tlv()
2149 cnvr = INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top), in btintel_get_fw_name_tlv()
2150 INTEL_CNVX_TOP_STEP(ver->cnvr_top)); in btintel_get_fw_name_tlv()
2155 if (INTEL_HW_VARIANT(ver->cnvi_bt) >= 0x1e) { in btintel_get_fw_name_tlv()
2158 if (ver->img_type == BTINTEL_IMG_BOOTLOADER) { in btintel_get_fw_name_tlv()
2159 format = "intel/ibt-%04x-%04x-iml.%s"; in btintel_get_fw_name_tlv()
2166 /* ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step-fw_id> */ in btintel_get_fw_name_tlv()
2167 if (memcmp(ver->fw_id, zero, sizeof(zero))) { in btintel_get_fw_name_tlv()
2168 format = "intel/ibt-%04x-%04x-%s.%s"; in btintel_get_fw_name_tlv()
2170 ver->fw_id, suffix); in btintel_get_fw_name_tlv()
2173 /* If firmware id is not present, fallback to legacy naming in btintel_get_fw_name_tlv()
2178 * ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step> in btintel_get_fw_name_tlv()
2180 format = "intel/ibt-%04x-%04x.%s"; in btintel_get_fw_name_tlv()
2191 cnvi = INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top), in btintel_get_iml_tlv()
2192 INTEL_CNVX_TOP_STEP(ver->cnvi_top)); in btintel_get_iml_tlv()
2194 cnvr = INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top), in btintel_get_iml_tlv()
2195 INTEL_CNVX_TOP_STEP(ver->cnvr_top)); in btintel_get_iml_tlv()
2197 format = "intel/ibt-%04x-%04x-iml.%s"; in btintel_get_iml_tlv()
2205 const struct firmware *fw; in btintel_prepare_fw_download_tlv()
2211 return -EINVAL; in btintel_prepare_fw_download_tlv()
2213 /* The firmware variant determines if the device is in bootloader in btintel_prepare_fw_download_tlv()
2214 * mode or is running operational firmware. The value 0x03 identifies in btintel_prepare_fw_download_tlv()
2216 * firmware. in btintel_prepare_fw_download_tlv()
2218 * When the operational firmware is already present, then only in btintel_prepare_fw_download_tlv()
2226 if (ver->img_type == BTINTEL_IMG_OP) { in btintel_prepare_fw_download_tlv()
2235 if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) { in btintel_prepare_fw_download_tlv()
2237 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_prepare_fw_download_tlv()
2241 if (ver->img_type == BTINTEL_IMG_OP) { in btintel_prepare_fw_download_tlv()
2244 * firmware image which doesn't exist. Lets compare the version in btintel_prepare_fw_download_tlv()
2247 if (INTEL_HW_VARIANT(ver->cnvi_bt) >= 0x1e) in btintel_prepare_fw_download_tlv()
2255 err = firmware_request_nowarn(&fw, fwname, &hdev->dev); in btintel_prepare_fw_download_tlv()
2258 /* Firmware has already been loaded */ in btintel_prepare_fw_download_tlv()
2263 bt_dev_err(hdev, "Failed to load Intel firmware file %s (%d)", in btintel_prepare_fw_download_tlv()
2269 bt_dev_info(hdev, "Found device firmware: %s", fwname); in btintel_prepare_fw_download_tlv()
2271 if (fw->size < 644) { in btintel_prepare_fw_download_tlv()
2272 bt_dev_err(hdev, "Invalid size of firmware file (%zu)", in btintel_prepare_fw_download_tlv()
2273 fw->size); in btintel_prepare_fw_download_tlv()
2274 err = -EBADF; in btintel_prepare_fw_download_tlv()
2282 /* Start firmware downloading and get boot parameter */ in btintel_prepare_fw_download_tlv()
2284 INTEL_HW_VARIANT(ver->cnvi_bt), in btintel_prepare_fw_download_tlv()
2285 ver->sbe_type); in btintel_prepare_fw_download_tlv()
2287 if (err == -EALREADY) { in btintel_prepare_fw_download_tlv()
2288 /* Firmware has already been loaded */ in btintel_prepare_fw_download_tlv()
2294 /* When FW download fails, send Intel Reset to retry in btintel_prepare_fw_download_tlv()
2302 * booting the loaded firmware, wait for the bootloader notification in btintel_prepare_fw_download_tlv()
2308 * The firmware loading should not take longer than 5 seconds in btintel_prepare_fw_download_tlv()
2313 if (err == -ETIMEDOUT) in btintel_prepare_fw_download_tlv()
2328 return -EINVAL; in btintel_get_codec_config_data()
2335 return -EINVAL; in btintel_get_codec_config_data()
2340 err = -ENOMEM; in btintel_get_codec_config_data()
2345 switch (codec->id) { in btintel_get_codec_config_data()
2353 err = -EINVAL; in btintel_get_codec_config_data()
2354 bt_dev_err(hdev, "Invalid codec id(%u)", codec->id); in btintel_get_codec_config_data()
2357 /* codec and its capabilities are pre-defined to ids in btintel_get_codec_config_data()
2390 if (skb->len < sizeof(*use_cases)) { in btintel_configure_offload()
2391 err = -EIO; in btintel_configure_offload()
2395 use_cases = (void *)skb->data; in btintel_configure_offload()
2397 if (use_cases->status) { in btintel_configure_offload()
2398 err = -bt_to_errno(skb->data[0]); in btintel_configure_offload()
2402 if (use_cases->preset[0] & 0x03) { in btintel_configure_offload()
2403 hdev->get_data_path_id = btintel_get_data_path_id; in btintel_configure_offload()
2404 hdev->get_codec_config_data = btintel_get_codec_config_data; in btintel_configure_offload()
2422 switch (ver->cnvr_top & 0xFFF) { in btintel_set_ppag()
2427 ver->cnvr_top & 0xFFF); in btintel_set_ppag()
2433 bt_dev_info(hdev, "No support for BT device in ACPI firmware"); in btintel_set_ppag()
2440 bt_dev_dbg(hdev, "PPAG-BT: ACPI entry not found"); in btintel_set_ppag()
2443 bt_dev_warn(hdev, "PPAG-BT: ACPI Failure: %s", acpi_format_exception(status)); in btintel_set_ppag()
2448 if (p->type != ACPI_TYPE_PACKAGE || p->package.count != 2) { in btintel_set_ppag()
2449 bt_dev_warn(hdev, "PPAG-BT: Invalid object type: %d or package count: %d", in btintel_set_ppag()
2450 p->type, p->package.count); in btintel_set_ppag()
2455 elements = p->package.elements; in btintel_set_ppag()
2460 domain = (u32)p->package.elements[0].integer.value; in btintel_set_ppag()
2461 mode = (u32)p->package.elements[1].integer.value; in btintel_set_ppag()
2465 bt_dev_dbg(hdev, "PPAG-BT: Bluetooth domain is disabled in ACPI firmware"); in btintel_set_ppag()
2478 bt_dev_dbg(hdev, "PPAG-BT: EU, China mode are disabled in BIOS"); in btintel_set_ppag()
2490 bt_dev_info(hdev, "PPAG-BT: Enabled (Mode %d)", mode); in btintel_set_ppag()
2504 ret = -ENODEV; in btintel_acpi_reset_method()
2509 if (p->package.count != 1 || p->type != ACPI_TYPE_PACKAGE) { in btintel_acpi_reset_method()
2511 ret = -EINVAL; in btintel_acpi_reset_method()
2515 ref = &p->package.elements[0]; in btintel_acpi_reset_method()
2516 if (ref->type != ACPI_TYPE_LOCAL_REFERENCE) { in btintel_acpi_reset_method()
2517 bt_dev_err(hdev, "Invalid object type: 0x%x", ref->type); in btintel_acpi_reset_method()
2518 ret = -EINVAL; in btintel_acpi_reset_method()
2522 status = acpi_evaluate_object(ref->reference.handle, "_RST", NULL, NULL); in btintel_acpi_reset_method()
2525 ret = -ENODEV; in btintel_acpi_reset_method()
2549 bt_dev_dbg(hdev, "No support for bluetooth device in ACPI firmware"); in btintel_set_dsm_reset_method()
2558 switch (ver_tlv->cnvi_top & 0xfff) { in btintel_set_dsm_reset_method()
2563 /* WDISABLE2 is the default reset method */ in btintel_set_dsm_reset_method()
2568 bt_dev_err(hdev, "No dsm support to set reset delay"); in btintel_set_dsm_reset_method()
2577 bt_dev_err(hdev, "Failed to call dsm to set reset delay"); in btintel_set_dsm_reset_method()
2583 bt_dev_info(hdev, "DSM reset method type: 0x%02x", reset_payload[2]); in btintel_set_dsm_reset_method()
2587 bt_dev_warn(hdev, "No support for dsm to set reset method"); in btintel_set_dsm_reset_method()
2597 bt_dev_err(hdev, "Failed to call dsm to set reset method"); in btintel_set_dsm_reset_method()
2601 data->acpi_reset_method = btintel_acpi_reset_method; in btintel_set_dsm_reset_method()
2613 __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle); in btintel_classify_pkt_type()
2626 * configauration, bluetooth firmware shall adjust the BRI response line drive
2633 * header - defines revision number of the structure
2634 * dsbr - defines drive strength BRI response
2636 * 0 - instructs bluetooth firmware to use default values
2637 * 1 - instructs bluetooth firmware to override default values
2645 * 1. 0xF1 - indicates that the resistor on board is 33 Ohm
2646 * 2. 0x00 or 0xB1 - indicates that the resistor on board is 10 Ohm
2647 * 3. Non existing UEFI variable or invalid (none of the above) - indicates
2650 * firmware to use default values.
2666 return -EOPNOTSUPP; in btintel_uefi_get_dsbr()
2669 return -EOPNOTSUPP; in btintel_uefi_get_dsbr()
2675 return -EIO; in btintel_uefi_get_dsbr()
2681 return -ENXIO; in btintel_uefi_get_dsbr()
2704 apply_dsbr = (ver->img_type == BTINTEL_IMG_IML && in btintel_set_dsbr()
2705 ((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) && in btintel_set_dsbr()
2706 INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01); in btintel_set_dsbr()
2725 return -bt_to_errno(PTR_ERR(skb)); in btintel_set_dsbr()
2727 status = skb->data[0]; in btintel_set_dsbr()
2731 return -bt_to_errno(status); in btintel_set_dsbr()
2748 * command while downloading the firmware. in btintel_bootloader_setup_tlv()
2758 /* check if controller is already having an operational firmware */ in btintel_bootloader_setup_tlv()
2759 if (ver->img_type == BTINTEL_IMG_OP) in btintel_bootloader_setup_tlv()
2780 if (ver->img_type == BTINTEL_IMG_IML) { in btintel_bootloader_setup_tlv()
2871 if (skb->len < (sizeof(u32) * 16 + 2)) { in btintel_print_fseq_info()
2873 skb->len); in btintel_print_fseq_info()
2918 p = skb->data; in btintel_print_fseq_info()
2923 p = skb->data; in btintel_print_fseq_info()
2941 bt_dev_dbg(hdev, "Fseq Top reset address: 0x%8.8x", val); in btintel_print_fseq_info()
2979 BT_DBG("%s", hdev->name); in btintel_setup_combined()
2985 * As a workaround, send HCI Reset command first which will reset the in btintel_setup_combined()
3001 "sending initial HCI reset failed (%ld)", in btintel_setup_combined()
3022 if (skb->data[0]) { in btintel_setup_combined()
3024 skb->data[0]); in btintel_setup_combined()
3025 err = -EIO; in btintel_setup_combined()
3030 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); in btintel_setup_combined()
3031 set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); in btintel_setup_combined()
3032 set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); in btintel_setup_combined()
3035 hdev->set_quality_report = btintel_set_quality_report; in btintel_setup_combined()
3038 if (skb->len == sizeof(ver) && skb->data[1] == 0x37) { in btintel_setup_combined()
3041 memcpy(&ver, skb->data, sizeof(ver)); in btintel_setup_combined()
3046 /* Check for supported iBT hardware variants of this firmware in btintel_setup_combined()
3061 * WBS for SdP - For the Legacy ROM products, only SdP in btintel_setup_combined()
3071 &hdev->quirks); in btintel_setup_combined()
3087 &hdev->quirks); in btintel_setup_combined()
3090 set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); in btintel_setup_combined()
3101 err = -EINVAL; in btintel_setup_combined()
3126 err = -EINVAL; in btintel_setup_combined()
3130 /* Check for supported iBT hardware variants of this firmware in btintel_setup_combined()
3143 * the operational firmware supports both old and TLV based in btintel_setup_combined()
3147 * For upgrading firmware case, the TLV based version cannot in btintel_setup_combined()
3148 * be used because the firmware filename for legacy bootloader in btintel_setup_combined()
3166 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); in btintel_setup_combined()
3169 set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); in btintel_setup_combined()
3179 /* Re-classify packet type for controllers with LE audio */ in btintel_setup_combined()
3180 hdev->classify_pkt_type = btintel_classify_pkt_type; in btintel_setup_combined()
3194 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); in btintel_setup_combined()
3211 err = -EINVAL; in btintel_setup_combined()
3230 /* Send HCI Reset to the controller to stop any BT activity which in btintel_shutdown_combined()
3236 bt_dev_err(hdev, "HCI reset during shutdown failed"); in btintel_shutdown_combined()
3263 hdev->manufacturer = 2; in btintel_configure_setup()
3264 hdev->setup = btintel_setup_combined; in btintel_configure_setup()
3265 hdev->shutdown = btintel_shutdown_combined; in btintel_configure_setup()
3266 hdev->hw_error = btintel_hw_error; in btintel_configure_setup()
3267 hdev->set_diag = btintel_set_diag_combined; in btintel_configure_setup()
3268 hdev->set_bdaddr = btintel_set_bdaddr; in btintel_configure_setup()
3278 struct intel_tlv *tlv = (void *)&skb->data[5]; in btintel_diagnostics()
3281 if (tlv->type != INTEL_TLV_TYPE_ID) in btintel_diagnostics()
3284 switch (tlv->val[0]) { in btintel_diagnostics()
3290 if (!hci_devcd_init(hdev, skb->len)) { in btintel_diagnostics()
3298 bt_dev_err(hdev, "Invalid exception type %02X", tlv->val[0]); in btintel_diagnostics()
3307 struct hci_event_hdr *hdr = (void *)skb->data; in btintel_recv_event()
3310 if (skb->len > HCI_EVENT_HDR_SIZE && hdr->evt == 0xff && in btintel_recv_event()
3311 hdr->plen > 0) { in btintel_recv_event()
3312 const void *ptr = skb->data + HCI_EVENT_HDR_SIZE + 1; in btintel_recv_event()
3313 unsigned int len = skb->len - HCI_EVENT_HDR_SIZE - 1; in btintel_recv_event()
3316 switch (skb->data[2]) { in btintel_recv_event()
3318 /* When switching to the operational firmware in btintel_recv_event()
3325 /* When the firmware loading completes the in btintel_recv_event()
3327 * indicating the result of the firmware in btintel_recv_event()
3339 memcmp(&skb->data[2], diagnostics_hdr, in btintel_recv_event()
3369 if (evt->result) in btintel_secure_send_result()
3382 MODULE_FIRMWARE("intel/ibt-11-5.sfi");
3383 MODULE_FIRMWARE("intel/ibt-11-5.ddc");
3384 MODULE_FIRMWARE("intel/ibt-12-16.sfi");
3385 MODULE_FIRMWARE("intel/ibt-12-16.ddc");