Skip to content

Commit

Permalink
Fix boot address, Boot address was not getting updated when controlle…
Browse files Browse the repository at this point in the history
…r is present in boot mode which is required to move the controller from boot mode to operation mode after firmware download. This patch reads boot address even if controller is present in boot mode.
  • Loading branch information
zxystd committed Nov 8, 2021
1 parent 2173a95 commit b0a18f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
10 changes: 4 additions & 6 deletions IntelBluetoothFirmware/IntelBluetoothOpsGen2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ downloadFirmwareData(IntelVersion *ver, OSData *fwData, uint32_t *bootParams)
/* Skip version checking */
break;
default:
/* Skip reading firmware file version in bootloader mode */
if (ver->fw_variant == 0x06)
break;

/* Skip download if firmware has the same version */
if (firmwareVersion(ver->fw_build_num,
Expand Down Expand Up @@ -427,9 +424,10 @@ firmwareVersion(uint8_t num, uint8_t ww, uint8_t yy, OSData *fwData, uint32_t *b
struct cmd_write_boot_params *params;

params = (struct cmd_write_boot_params *)(fw_ptr + sizeof(*cmd));

XYLog("Boot Address: 0x%x\n",
OSSwapLittleToHostConstInt32(params->boot_addr));

*bootAddr = OSSwapLittleToHostConstInt32(params->boot_addr);

XYLog("Boot Address: 0x%x\n", *bootAddr);

XYLog("Firmware Version: %u-%u.%u\n",
params->fw_build_num, params->fw_build_ww,
Expand Down
25 changes: 11 additions & 14 deletions IntelBluetoothFirmware/IntelBluetoothOpsGen3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,17 @@ IOReturn IntelBluetoothOpsGen3::
downloadFirmwareData(IntelVersionTLV *ver, OSData *fwData, uint32_t *bootParams, uint8_t hwVariant, uint8_t sbeType)
{
uint32_t cssHeaderVer;

/* Skip reading firmware file version in bootloader mode */
if (ver->img_type != 0x01) {
/* Skip download if firmware has the same version */
if (firmwareVersion(ver->min_fw_build_nn,
ver->min_fw_build_cw,
ver->min_fw_build_yy,
fwData, bootParams)) {
XYLog("Firmware already loaded\n");
/* Return -EALREADY to indicate that firmware has
* already been loaded.
*/
return -EALREADY;
}

/* Skip download if firmware has the same version */
if (firmwareVersion(ver->min_fw_build_nn,
ver->min_fw_build_cw,
ver->min_fw_build_yy,
fwData, bootParams)) {
XYLog("Firmware already loaded\n");
/* Return -EALREADY to indicate that firmware has
* already been loaded.
*/
return -EALREADY;
}

/* The firmware variant determines if the device is in bootloader
Expand Down

0 comments on commit b0a18f1

Please sign in to comment.