oem-ibm: create OEM PDRs for all OEM state sensors and
effecters
Created Sensors and effecters for Code update for the
Boot side and Firmware update State indication and
control.
root@rainier:/tmp# ./pldmtool platform GetPDR -d 22
nextRecordHandle: 23
responseCount: 30
recordHandle: 22
PDRHeaderVersion: 1
PDRType: State Effecter PDR(11)
recordChangeNumber: 0
dataLength: 16
PLDMTerminusHandle: 1
effecterID: 7
entityType: Virtual Machine Manager
entityInstanceNumber: 0
containerID: 0
effecterSemanticID: 0
effecterInit: noInit
effecterDescriptionPDR: false
compositeEffecterCount: 1
stateSetID: 32769
possibleStatesSize: 2
possibleStates: 1 2
root@rainier:/tmp# ./pldmtool platform GetPDR -d 23
nextRecordHandle: 24
responseCount: 30
recordHandle: 23
PDRHeaderVersion: 1
PDRType: State Effecter PDR(11)
recordChangeNumber: 0
dataLength: 16
PLDMTerminusHandle: 1
effecterID: 8
entityType: Virtual Machine Manager
entityInstanceNumber: 1
containerID: 0
effecterSemanticID: 0
effecterInit: noInit
effecterDescriptionPDR: false
compositeEffecterCount: 1
stateSetID: 32769
possibleStatesSize: 2
possibleStates: 1 2
root@rainier:/tmp# ./pldmtool platform GetPDR -d 24
nextRecordHandle: 25
responseCount: 30
recordHandle: 24
PDRHeaderVersion: 1
PDRType: State Effecter PDR(11)
recordChangeNumber: 0
dataLength: 16
PLDMTerminusHandle: 1
effecterID: 9
entityType: Virtual Machine Manager
entityInstanceNumber: 0
containerID: 0
effecterSemanticID: 0
effecterInit: noInit
effecterDescriptionPDR: false
compositeEffecterCount: 1
stateSetID: 32768
possibleStatesSize: 2
possibleStates: 1 2 3 4 5 6
root@rainier:/tmp# ./pldmtool platform GetPDR -d 25
nextRecordHandle: 26
responseCount: 28
recordHandle: 25
PDRHeaderVersion: 1
PDRType: State Sensor PDR(4)
recordChangeNumber: 0
dataLength: 14
PLDMTerminusHandle: 1
sensorID: 1
entityType: Virtual Machine Manager
entityInstanceNumber: 0
containerID: 0
sensorInit: noInit
sensorAuxiliaryNamesPDR: false
compositeSensorCount: 1
stateSetID: 32769
possibleStatesSize: 2
possibleStates: 1 2
root@rainier:/tmp# ./pldmtool platform GetPDR -d 26
nextRecordHandle: 27
responseCount: 28
recordHandle: 26
PDRHeaderVersion: 1
PDRType: State Sensor PDR(4)
recordChangeNumber: 0
dataLength: 14
PLDMTerminusHandle: 1
sensorID: 2
entityType: Virtual Machine Manager
entityInstanceNumber: 1
containerID: 0
sensorInit: noInit
sensorAuxiliaryNamesPDR: false
compositeSensorCount: 1
stateSetID: 32769
possibleStatesSize: 2
possibleStates: 1 2
root@rainier:/tmp# ./pldmtool platform GetPDR -d 27
nextRecordHandle: 0
responseCount: 28
recordHandle: 27
PDRHeaderVersion: 1
PDRType: State Sensor PDR(4)
recordChangeNumber: 0
dataLength: 14
PLDMTerminusHandle: 1
sensorID: 3
entityType: Virtual Machine Manager
entityInstanceNumber: 0
containerID: 0
sensorInit: noInit
sensorAuxiliaryNamesPDR: false
compositeSensorCount: 1
stateSetID: 32768
possibleStatesSize: 2
possibleStates: 1 2 3 4 5 6
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: I1dc39a549297241792cebc7812722447cce5762d
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index 2d294f0..2220adb 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -6,16 +6,18 @@
namespace pldm
{
-
namespace responder
{
-
namespace oem_ibm_platform
{
#define PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE 32768
#define PLDM_OEM_IBM_BOOT_STATE 32769
+static constexpr auto PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE = 24577;
+constexpr uint16_t ENTITY_INSTANCE_0 = 0;
+constexpr uint16_t ENTITY_INSTANCE_1 = 1;
+
class Handler : public oem_platform::Handler
{
public:
@@ -43,6 +45,32 @@
*/
void setPlatformHandler(pldm::responder::platform::Handler* handler);
+ /** @brief Method to fetch the effecter ID of the code update PDRs
+ *
+ * @return platformHandler->getNextEffecterId() - returns the
+ * effecter ID from the platform handler
+ */
+ uint16_t getNextEffecterId()
+ {
+ return platformHandler->getNextEffecterId();
+ }
+
+ /** @brief Method to fetch the sensor ID of the code update PDRs
+ *
+ * @return platformHandler->getNextSensorId() - returns the
+ * Sensor ID from the platform handler
+ */
+ uint16_t getNextSensorId()
+ {
+ return platformHandler->getNextSensorId();
+ }
+
+ /** @brief Method to Generate the OEM PDRs
+ *
+ * @param[in] repo - instance of concrete implementation of Repo
+ */
+ void buildOEMPDR(pdr_utils::Repo& repo);
+
~Handler() = default;
pldm::responder::CodeUpdate* codeUpdate; //!< pointer to CodeUpdate object