Brad Bishop | 869b776 | 2021-12-03 13:56:23 -0500 | [diff] [blame] | 1 | #include <libpldm/entity.h> |
Andrew Jeffery | 21f128d | 2024-01-15 15:34:26 +1030 | [diff] [blame] | 2 | #include <libpldm/oem/ibm/entity.h> |
| 3 | #include <libpldm/oem/ibm/state_set.h> |
Pavithra Barithaya | 51cc5bd | 2024-07-31 13:54:48 +0530 | [diff] [blame] | 4 | #include <stdint.h> |
| 5 | |
| 6 | #include <map> |
| 7 | #include <string> |
Brad Bishop | 869b776 | 2021-12-03 13:56:23 -0500 | [diff] [blame] | 8 | |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 9 | /** @brief PLDM OEM IBM Code Update possible state set values |
| 10 | */ |
| 11 | enum pldm_oem_ibm_cu_state_set_values |
| 12 | { |
| 13 | OEM_IBM_STATE_SET_CU_START = 1, |
| 14 | OEM_IBM_STATE_SET_CU_END = 2, |
| 15 | OEM_IBM_STATE_SET_CU_FAIL = 3, |
| 16 | OEM_IBM_STATE_SET_CU_ABORT = 4, |
| 17 | OEM_IBM_STATE_SET_CU_ACCEPT = 5, |
| 18 | OEM_IBM_STATE_SET_CU_REJECT = 6, |
| 19 | }; |
| 20 | |
| 21 | /** @brief PLDM OEM IBM Verification possible state set values |
| 22 | */ |
| 23 | enum pldm_oem_ibm_verification_state_set_values |
| 24 | { |
| 25 | OEM_IBM_STATE_SET_VERFICATION_VALID = 0, |
| 26 | OEM_IBM_STATE_SET_VERFICATION_ENTITLEMENT_FAIL = 1, |
| 27 | OEM_IBM_STATE_SET_VERFICATION_BANNED_PLATFORM_FAIL = 2, |
| 28 | OEM_IBM_STATE_SET_VERFICATION_MIN_MIF_FAIL = 4, |
| 29 | }; |
| 30 | |
| 31 | /** @brief PLDM OEM IBM system power state possible state set values |
| 32 | */ |
| 33 | enum pldm_oem_ibm_sys_power_state_set_values |
| 34 | { |
| 35 | OEM_IBM_STATE_SET_SYS_PWR_STATE_RECYCLE_HARD = 1, |
| 36 | }; |
| 37 | |
| 38 | /** @brief PLDM OEM IBM boot state possible state set values |
| 39 | */ |
| 40 | enum pldm_oem_ibm_boot_state_set_values |
| 41 | { |
| 42 | OEM_IBM_STATE_SET_BOOT_STATE_P_SIDE = 1, |
| 43 | OEM_IBM_STATE_SET_BOOT_STATE_T_SIDE = 2, |
| 44 | }; |
| 45 | |
| 46 | /** @brief Map for PLDM OEM IBM Entity Types |
| 47 | */ |
| 48 | extern const std::map<uint8_t, std::string> OemIBMEntityType{ |
Brad Bishop | 27403f4 | 2021-12-01 21:37:44 -0500 | [diff] [blame] | 49 | {PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE, "OEM IBM Firmware Update"}, |
Manojkiran Eda | 8fadc9e | 2022-01-03 12:42:19 +0530 | [diff] [blame] | 50 | {PLDM_OEM_IBM_ENTITY_TPM, "OEM IBM Trusted Platform Module"}}; |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 51 | |
| 52 | /** @brief Map for PLDM OEM IBM State Sets |
| 53 | */ |
| 54 | extern const std::map<uint16_t, std::string> OemIBMstateSet{ |
| 55 | {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, "OEM IBM Firmware Update State"}, |
| 56 | {PLDM_OEM_IBM_BOOT_STATE, "OEM IBM Boot State"}, |
Pavithra Barithaya | a2b964f | 2021-10-06 07:46:19 -0500 | [diff] [blame] | 57 | {PLDM_OEM_IBM_VERIFICATION_STATE, "OEM IBM Verification State"}, |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 58 | {PLDM_OEM_IBM_SYSTEM_POWER_STATE, "OEM IBM System Power State"}}; |
| 59 | |
| 60 | /** @brief Map for PLDM OEM IBM firmware update possible state values |
| 61 | */ |
| 62 | extern const std::map<uint8_t, std::string> SetOemIBMFWUpdateStateValues{ |
| 63 | {OEM_IBM_STATE_SET_CU_START, "Start"}, |
| 64 | {OEM_IBM_STATE_SET_CU_END, "End"}, |
| 65 | {OEM_IBM_STATE_SET_CU_FAIL, "Fail"}, |
| 66 | {OEM_IBM_STATE_SET_CU_ABORT, "Abort"}, |
| 67 | {OEM_IBM_STATE_SET_CU_ACCEPT, "Accept"}, |
| 68 | {OEM_IBM_STATE_SET_CU_REJECT, "Reject"}}; |
| 69 | |
| 70 | /** @brief Map for PLDM OEM IBM verification state possible state values |
| 71 | */ |
| 72 | extern const std::map<uint8_t, std::string> SetOemIBMVerStateValues{ |
| 73 | {OEM_IBM_STATE_SET_VERFICATION_VALID, "Valid"}, |
| 74 | {OEM_IBM_STATE_SET_VERFICATION_ENTITLEMENT_FAIL, "Entitlement Fail"}, |
| 75 | {OEM_IBM_STATE_SET_VERFICATION_BANNED_PLATFORM_FAIL, |
| 76 | "Banned Platform Fail"}, |
| 77 | {OEM_IBM_STATE_SET_VERFICATION_MIN_MIF_FAIL, "Minimum MIF Fail"}}; |
| 78 | |
| 79 | /** @brief Map for PLDM OEM IBM systerm power state possible state values |
| 80 | */ |
| 81 | extern const std::map<uint8_t, std::string> SetOemIBMSysPowerStatesValues{ |
| 82 | {OEM_IBM_STATE_SET_SYS_PWR_STATE_RECYCLE_HARD, "Power Cycle Hard"}}; |
| 83 | |
| 84 | /** @brief Map for PLDM OEM IBM boot state possible state values |
| 85 | */ |
| 86 | extern const std::map<uint8_t, std::string> SetOemIBMBootStateValues{ |
| 87 | {OEM_IBM_STATE_SET_BOOT_STATE_P_SIDE, "P Side"}, |
| 88 | {OEM_IBM_STATE_SET_BOOT_STATE_T_SIDE, "T side"}}; |
| 89 | |
| 90 | /** @brief Map for populating PLDM OEM IBM state sets with possible state values |
| 91 | */ |
| 92 | extern const std::map<uint16_t, const std::map<uint8_t, std::string>> |
| 93 | populateOemIBMStateMaps{ |
Pavithra Barithaya | a2b964f | 2021-10-06 07:46:19 -0500 | [diff] [blame] | 94 | {PLDM_OEM_IBM_VERIFICATION_STATE, SetOemIBMVerStateValues}, |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 95 | {PLDM_OEM_IBM_SYSTEM_POWER_STATE, SetOemIBMSysPowerStatesValues}, |
| 96 | {PLDM_OEM_IBM_BOOT_STATE, SetOemIBMBootStateValues}, |
| 97 | {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, SetOemIBMFWUpdateStateValues}, |
| 98 | }; |