mbox series

[-qemu,0/2] hw/cxl: Firmware Update support

Message ID 20240109070436.21253-1-dave@stgolabs.net
Headers show
Series hw/cxl: Firmware Update support | expand

Message

Davidlohr Bueso Jan. 9, 2024, 7:04 a.m. UTC
Hello,

The following implements the remaining commands for emulating the cxl
firmware update operations, similar to what the mock device does.

# cxl update-firmware mem0 
  ...
  "firmware":{
    "num_slots":2,
    "active_slot":1,
    "staged_slot":1,
    "online_activate_capable":true,
    "slot_1_version":"BWFW VERSION 0",
    "fw_update_in_progress":false
  }
}

# cxl update-firmware mem0 -F ~/fw.bin -w
{
  ...
  "firmware":{
    "num_slots":2,
    "active_slot":1,
    "staged_slot":2,
    "online_activate_capable":true,
    "slot_1_version":"BWFW VERSION 0",
    "slot_2_version":"BWFW VERSION 1",
    "fw_update_in_progress":false
  }
}

One note is that this implementation will optimistically set the new firmware
before the successful completion of a full or end transfer, for example:

  "firmware":{
    "num_slots":2,
    "active_slot":1,
    "staged_slot":2,
    "online_activate_capable":true,
    "slot_1_version":"BWFW VERSION 0",
    "slot_2_version":"BWFW VERSION 1",
    "fw_update_in_progress":true,
    "remaining_size":5091200
  }

Applies against Jonathan's latst branch:
	https://gitlab.com/jic23/qemu/-/tree/cxl-2023-11-02

Thanks!

Davidlohr Bueso (2):
  hw/cxl: Add Transfer FW support
  hw/cxl: Add Activate FW support

 hw/cxl/cxl-mailbox-utils.c  | 179 +++++++++++++++++++++++++++++++++++-
 include/hw/cxl/cxl_device.h |   9 ++
 2 files changed, 183 insertions(+), 5 deletions(-)