oem-ibm: Support for concurrent out-of-band FW update
Redfish triggers the out-of-band code update to BMC. This code update is
called concurrent FW update when the remote PLDM terminus is up during
code update.
The system has two boot sides: Temporary and Permanent, with the default
image running from the temporary side. During an out-of-band (OOB) code
update triggered by the Redfish client, the boot side is swapped, the
correct image is assigned to the permanent side, and a new image is
written to the temporary side. Boot side rename event is used to notify
the remote PLDM terminus about the rename operation during the update.
Change-Id: I21f2b871c5cdd35660e2fc84019749f0365f1d76
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index decb953..cb2862d 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -333,7 +333,8 @@
auto state =
reinterpret_cast<state_sensor_possible_states*>(possibleStates);
if ((stateSetID == PLDM_OEM_IBM_BOOT_STATE) ||
- (stateSetID == PLDM_OEM_IBM_VERIFICATION_STATE))
+ (stateSetID == PLDM_OEM_IBM_VERIFICATION_STATE) ||
+ (stateSetID == PLDM_OEM_IBM_BOOT_SIDE_RENAME))
state->states[0].byte = 6;
else if (stateSetID == PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE)
state->states[0].byte = 126;
@@ -438,6 +439,9 @@
buildAllCodeUpdateSensorPDR(this, PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE,
ENTITY_INSTANCE_0,
PLDM_OEM_IBM_VERIFICATION_STATE, repo);
+ buildAllCodeUpdateSensorPDR(this, PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE,
+ ENTITY_INSTANCE_0,
+ PLDM_OEM_IBM_BOOT_SIDE_RENAME, repo);
auto sensorId = findStateSensorId(
repo.getPdr(), 0, PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE,
ENTITY_INSTANCE_0, 1, PLDM_OEM_IBM_VERIFICATION_STATE);
@@ -446,6 +450,10 @@
repo.getPdr(), 0, PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE,
ENTITY_INSTANCE_0, 1, PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE);
codeUpdate->setFirmwareUpdateSensor(sensorId);
+ sensorId =
+ findStateSensorId(repo.getPdr(), 0, PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE,
+ ENTITY_INSTANCE_0, 0, PLDM_OEM_IBM_BOOT_SIDE_RENAME);
+ codeUpdate->setBootSideRenameStateSensor(sensorId);
}
void pldm::responder::oem_ibm_platform::Handler::setPlatformHandler(