Project

General

Profile

Feature #11203

Support for NVMe drive firmware updates

Added by Paul Winder 19 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

50%

Estimated time:
Difficulty:
Medium
Tags:

Description

The NVMe specification in section 5.7 and 5.8 details the NVM commands to update firmware in a drive.
This translates to three steps:
  1. Upload the firmware from the O/S to the drive (from the drive's POV this is referred to as down load).
  2. Commit the firmware to a drive slot.
  3. Activate the drive slot.

And these translate into three new options to nvmeadm:

nvmeadm -h load-firmware
usage:
  nvmeadm load-firmware
  nvmeadm [-dv] load-firmware <ctl> <image file> [<offset>]

  Load firmware <image file> to offset <offset>.
  The firmware needs to be committed to a slot using "nvmeadm commit-firmware" 
  command.

nvmeadm -h commit-firmware
usage:
  nvmeadm -h commit-firmware
  nvmeadm [-dv] commit-firmware <ctl> <slot>

  Commit previously downloaded firmware to slot <slot>.
  The firmware is only activated after a "nvmeadm activate-firmware" command.

nvmeadm -h activate-firmware
usage:
  nvmeadm -h activate-firmware
  nvmeadm [-dv] activate-firmware <ctl> <slot>

  Activate firmware in slot <slot>.
  The firmware will be in use after the next system reset


There is already a get-logpage option to view firmware slots:
nvmeadm get-logpage nvme0 firmware
nvme0: Firmware Slot Information
  Active Firmware Slot:                     4
  Firmware Revision for Slot 1:             KNGND110
  Firmware Revision for Slot 2:             KNGND110
  Firmware Revision for Slot 3:             KNGND110
  Firmware Revision for Slot 4:             KNGND112
  Firmware Revision for Slot 5:             KNGND110

For example:

# nvmeadm get-logpage nvme2 firmware
nvme2: Firmware Slot Information
  Active Firmware Slot:                     2
  Next Firmware Slot:                       2
  Firmware Revision for Slot 1:             KNGND110
  Firmware Revision for Slot 2:             KNGND113
  Firmware Revision for Slot 3:             KNGND110
  Firmware Revision for Slot 4:             KNGND112
  Firmware Revision for Slot 5:             KNGND110
  Firmware Revision for Slot 6:             <Unused>
  Firmware Revision for Slot 7:             <Unused>

# nvmeadm -v load-firmware nvme1 KNGND113.bin 
1740544 bytes downloaded

# nvmeadm -v commit-firmware nvme1 3 
firmware committed to slot 3

# nvmeadm -v activate-firmware nvme1 3 
Slot 3 activated: NVM subsystem reset required

# nvmeadm get-logpage nvme1 firmware
nvme1: Firmware Slot Information
  Active Firmware Slot:                     2
  Next Firmware Slot:                       3
  Firmware Revision for Slot 1:             KNGND110
  Firmware Revision for Slot 2:             KTGND76E
  Firmware Revision for Slot 3:             KNGND113
  Firmware Revision for Slot 4:             KNGND112
  Firmware Revision for Slot 5:             KNGND110
  Firmware Revision for Slot 6:             <Unused>
  Firmware Revision for Slot 7:             <Unused>

Also available in: Atom PDF