blob: f6aea0c9b2fea69fee3b79cfe24c7a168a81e758 [file] [log] [blame]
Brad Bishop869b7762021-12-03 13:56:23 -05001#include <libpldm/entity.h>
Brad Bishop27403f42021-12-01 21:37:44 -05002#include <libpldm/entity_oem_ibm.h>
George Liuc453e162022-12-21 17:16:23 +08003#include <libpldm/state_set_oem_ibm.h>
Brad Bishop869b7762021-12-03 13:56:23 -05004
Sridevi Rameshdcdcd3b2021-06-15 04:06:49 -05005/** @brief PLDM OEM IBM Code Update possible state set values
6 */
7enum pldm_oem_ibm_cu_state_set_values
8{
9 OEM_IBM_STATE_SET_CU_START = 1,
10 OEM_IBM_STATE_SET_CU_END = 2,
11 OEM_IBM_STATE_SET_CU_FAIL = 3,
12 OEM_IBM_STATE_SET_CU_ABORT = 4,
13 OEM_IBM_STATE_SET_CU_ACCEPT = 5,
14 OEM_IBM_STATE_SET_CU_REJECT = 6,
15};
16
17/** @brief PLDM OEM IBM Verification possible state set values
18 */
19enum pldm_oem_ibm_verification_state_set_values
20{
21 OEM_IBM_STATE_SET_VERFICATION_VALID = 0,
22 OEM_IBM_STATE_SET_VERFICATION_ENTITLEMENT_FAIL = 1,
23 OEM_IBM_STATE_SET_VERFICATION_BANNED_PLATFORM_FAIL = 2,
24 OEM_IBM_STATE_SET_VERFICATION_MIN_MIF_FAIL = 4,
25};
26
27/** @brief PLDM OEM IBM system power state possible state set values
28 */
29enum pldm_oem_ibm_sys_power_state_set_values
30{
31 OEM_IBM_STATE_SET_SYS_PWR_STATE_RECYCLE_HARD = 1,
32};
33
34/** @brief PLDM OEM IBM boot state possible state set values
35 */
36enum pldm_oem_ibm_boot_state_set_values
37{
38 OEM_IBM_STATE_SET_BOOT_STATE_P_SIDE = 1,
39 OEM_IBM_STATE_SET_BOOT_STATE_T_SIDE = 2,
40};
41
42/** @brief Map for PLDM OEM IBM Entity Types
43 */
44extern const std::map<uint8_t, std::string> OemIBMEntityType{
Brad Bishop27403f42021-12-01 21:37:44 -050045 {PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE, "OEM IBM Firmware Update"},
Manojkiran Eda8fadc9e2022-01-03 12:42:19 +053046 {PLDM_OEM_IBM_ENTITY_TPM, "OEM IBM Trusted Platform Module"}};
Sridevi Rameshdcdcd3b2021-06-15 04:06:49 -050047
48/** @brief Map for PLDM OEM IBM State Sets
49 */
50extern const std::map<uint16_t, std::string> OemIBMstateSet{
51 {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, "OEM IBM Firmware Update State"},
52 {PLDM_OEM_IBM_BOOT_STATE, "OEM IBM Boot State"},
Pavithra Barithayaa2b964f2021-10-06 07:46:19 -050053 {PLDM_OEM_IBM_VERIFICATION_STATE, "OEM IBM Verification State"},
Sridevi Rameshdcdcd3b2021-06-15 04:06:49 -050054 {PLDM_OEM_IBM_SYSTEM_POWER_STATE, "OEM IBM System Power State"}};
55
56/** @brief Map for PLDM OEM IBM firmware update possible state values
57 */
58extern const std::map<uint8_t, std::string> SetOemIBMFWUpdateStateValues{
59 {OEM_IBM_STATE_SET_CU_START, "Start"},
60 {OEM_IBM_STATE_SET_CU_END, "End"},
61 {OEM_IBM_STATE_SET_CU_FAIL, "Fail"},
62 {OEM_IBM_STATE_SET_CU_ABORT, "Abort"},
63 {OEM_IBM_STATE_SET_CU_ACCEPT, "Accept"},
64 {OEM_IBM_STATE_SET_CU_REJECT, "Reject"}};
65
66/** @brief Map for PLDM OEM IBM verification state possible state values
67 */
68extern const std::map<uint8_t, std::string> SetOemIBMVerStateValues{
69 {OEM_IBM_STATE_SET_VERFICATION_VALID, "Valid"},
70 {OEM_IBM_STATE_SET_VERFICATION_ENTITLEMENT_FAIL, "Entitlement Fail"},
71 {OEM_IBM_STATE_SET_VERFICATION_BANNED_PLATFORM_FAIL,
72 "Banned Platform Fail"},
73 {OEM_IBM_STATE_SET_VERFICATION_MIN_MIF_FAIL, "Minimum MIF Fail"}};
74
75/** @brief Map for PLDM OEM IBM systerm power state possible state values
76 */
77extern const std::map<uint8_t, std::string> SetOemIBMSysPowerStatesValues{
78 {OEM_IBM_STATE_SET_SYS_PWR_STATE_RECYCLE_HARD, "Power Cycle Hard"}};
79
80/** @brief Map for PLDM OEM IBM boot state possible state values
81 */
82extern const std::map<uint8_t, std::string> SetOemIBMBootStateValues{
83 {OEM_IBM_STATE_SET_BOOT_STATE_P_SIDE, "P Side"},
84 {OEM_IBM_STATE_SET_BOOT_STATE_T_SIDE, "T side"}};
85
86/** @brief Map for populating PLDM OEM IBM state sets with possible state values
87 */
88extern const std::map<uint16_t, const std::map<uint8_t, std::string>>
89 populateOemIBMStateMaps{
Pavithra Barithayaa2b964f2021-10-06 07:46:19 -050090 {PLDM_OEM_IBM_VERIFICATION_STATE, SetOemIBMVerStateValues},
Sridevi Rameshdcdcd3b2021-06-15 04:06:49 -050091 {PLDM_OEM_IBM_SYSTEM_POWER_STATE, SetOemIBMSysPowerStatesValues},
92 {PLDM_OEM_IBM_BOOT_STATE, SetOemIBMBootStateValues},
93 {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, SetOemIBMFWUpdateStateValues},
94 };