1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace computer_system 7 { 8 // clang-format off 9 10 enum class BootSource{ 11 Invalid, 12 None, 13 Pxe, 14 Floppy, 15 Cd, 16 Usb, 17 Hdd, 18 BiosSetup, 19 Utilities, 20 Diags, 21 UefiShell, 22 UefiTarget, 23 SDCard, 24 UefiHttp, 25 RemoteDrive, 26 UefiBootNext, 27 Recovery, 28 }; 29 30 enum class SystemType{ 31 Invalid, 32 Physical, 33 Virtual, 34 OS, 35 PhysicallyPartitioned, 36 VirtuallyPartitioned, 37 Composed, 38 DPU, 39 }; 40 41 enum class IndicatorLED{ 42 Invalid, 43 Unknown, 44 Lit, 45 Blinking, 46 Off, 47 }; 48 49 enum class BootSourceOverrideEnabled{ 50 Invalid, 51 Disabled, 52 Once, 53 Continuous, 54 }; 55 56 enum class MemoryMirroring{ 57 Invalid, 58 System, 59 DIMM, 60 Hybrid, 61 None, 62 }; 63 64 enum class BootSourceOverrideMode{ 65 Invalid, 66 Legacy, 67 UEFI, 68 }; 69 70 enum class InterfaceType{ 71 Invalid, 72 TPM1_2, 73 TPM2_0, 74 TCM1_0, 75 }; 76 77 enum class HostingRole{ 78 Invalid, 79 ApplicationServer, 80 StorageServer, 81 Switch, 82 Appliance, 83 BareMetalServer, 84 VirtualMachineServer, 85 ContainerServer, 86 }; 87 88 enum class InterfaceTypeSelection{ 89 Invalid, 90 None, 91 FirmwareUpdate, 92 BiosSetting, 93 OemMethod, 94 }; 95 96 enum class WatchdogWarningActions{ 97 Invalid, 98 None, 99 DiagnosticInterrupt, 100 SMI, 101 MessagingInterrupt, 102 SCI, 103 OEM, 104 }; 105 106 enum class WatchdogTimeoutActions{ 107 Invalid, 108 None, 109 ResetSystem, 110 PowerCycle, 111 PowerDown, 112 OEM, 113 }; 114 115 enum class PowerRestorePolicyTypes{ 116 Invalid, 117 AlwaysOn, 118 AlwaysOff, 119 LastState, 120 }; 121 122 enum class BootOrderTypes{ 123 Invalid, 124 BootOrder, 125 AliasBootOrder, 126 }; 127 128 enum class AutomaticRetryConfig{ 129 Invalid, 130 Disabled, 131 RetryAttempts, 132 RetryAlways, 133 }; 134 135 enum class BootProgressTypes{ 136 Invalid, 137 None, 138 PrimaryProcessorInitializationStarted, 139 BusInitializationStarted, 140 MemoryInitializationStarted, 141 SecondaryProcessorInitializationStarted, 142 PCIResourceConfigStarted, 143 SystemHardwareInitializationComplete, 144 SetupEntered, 145 OSBootStarted, 146 OSRunning, 147 OEM, 148 }; 149 150 enum class GraphicalConnectTypesSupported{ 151 Invalid, 152 KVMIP, 153 OEM, 154 }; 155 156 enum class TrustedModuleRequiredToBoot{ 157 Invalid, 158 Disabled, 159 Required, 160 }; 161 162 enum class StopBootOnFault{ 163 Invalid, 164 Never, 165 AnyFault, 166 }; 167 168 enum class PowerMode{ 169 Invalid, 170 MaximumPerformance, 171 BalancedPerformance, 172 PowerSaving, 173 Static, 174 OSControlled, 175 OEM, 176 EfficiencyFavorPower, 177 EfficiencyFavorPerformance, 178 }; 179 180 enum class CompositionUseCase{ 181 Invalid, 182 ResourceBlockCapable, 183 ExpandableSystem, 184 }; 185 186 enum class KMIPCachePolicy{ 187 Invalid, 188 None, 189 AfterFirstUse, 190 }; 191 192 enum class DecommissionType{ 193 Invalid, 194 All, 195 UserData, 196 ManagerConfig, 197 BIOSConfig, 198 NetworkConfig, 199 StorageConfig, 200 Logs, 201 }; 202 203 enum class LastResetCauses{ 204 Invalid, 205 PowerButtonPress, 206 ManagementCommand, 207 PowerRestorePolicy, 208 RTCWakeup, 209 WatchdogExpiration, 210 OSSoftRestart, 211 SystemCrash, 212 ThermalEvent, 213 PowerEvent, 214 Unknown, 215 }; 216 217 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, { 218 {BootSource::Invalid, "Invalid"}, 219 {BootSource::None, "None"}, 220 {BootSource::Pxe, "Pxe"}, 221 {BootSource::Floppy, "Floppy"}, 222 {BootSource::Cd, "Cd"}, 223 {BootSource::Usb, "Usb"}, 224 {BootSource::Hdd, "Hdd"}, 225 {BootSource::BiosSetup, "BiosSetup"}, 226 {BootSource::Utilities, "Utilities"}, 227 {BootSource::Diags, "Diags"}, 228 {BootSource::UefiShell, "UefiShell"}, 229 {BootSource::UefiTarget, "UefiTarget"}, 230 {BootSource::SDCard, "SDCard"}, 231 {BootSource::UefiHttp, "UefiHttp"}, 232 {BootSource::RemoteDrive, "RemoteDrive"}, 233 {BootSource::UefiBootNext, "UefiBootNext"}, 234 {BootSource::Recovery, "Recovery"}, 235 }); 236 237 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, { 238 {SystemType::Invalid, "Invalid"}, 239 {SystemType::Physical, "Physical"}, 240 {SystemType::Virtual, "Virtual"}, 241 {SystemType::OS, "OS"}, 242 {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"}, 243 {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"}, 244 {SystemType::Composed, "Composed"}, 245 {SystemType::DPU, "DPU"}, 246 }); 247 248 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 249 {IndicatorLED::Invalid, "Invalid"}, 250 {IndicatorLED::Unknown, "Unknown"}, 251 {IndicatorLED::Lit, "Lit"}, 252 {IndicatorLED::Blinking, "Blinking"}, 253 {IndicatorLED::Off, "Off"}, 254 }); 255 256 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, { 257 {BootSourceOverrideEnabled::Invalid, "Invalid"}, 258 {BootSourceOverrideEnabled::Disabled, "Disabled"}, 259 {BootSourceOverrideEnabled::Once, "Once"}, 260 {BootSourceOverrideEnabled::Continuous, "Continuous"}, 261 }); 262 263 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, { 264 {MemoryMirroring::Invalid, "Invalid"}, 265 {MemoryMirroring::System, "System"}, 266 {MemoryMirroring::DIMM, "DIMM"}, 267 {MemoryMirroring::Hybrid, "Hybrid"}, 268 {MemoryMirroring::None, "None"}, 269 }); 270 271 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, { 272 {BootSourceOverrideMode::Invalid, "Invalid"}, 273 {BootSourceOverrideMode::Legacy, "Legacy"}, 274 {BootSourceOverrideMode::UEFI, "UEFI"}, 275 }); 276 277 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, { 278 {InterfaceType::Invalid, "Invalid"}, 279 {InterfaceType::TPM1_2, "TPM1_2"}, 280 {InterfaceType::TPM2_0, "TPM2_0"}, 281 {InterfaceType::TCM1_0, "TCM1_0"}, 282 }); 283 284 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, { 285 {HostingRole::Invalid, "Invalid"}, 286 {HostingRole::ApplicationServer, "ApplicationServer"}, 287 {HostingRole::StorageServer, "StorageServer"}, 288 {HostingRole::Switch, "Switch"}, 289 {HostingRole::Appliance, "Appliance"}, 290 {HostingRole::BareMetalServer, "BareMetalServer"}, 291 {HostingRole::VirtualMachineServer, "VirtualMachineServer"}, 292 {HostingRole::ContainerServer, "ContainerServer"}, 293 }); 294 295 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, { 296 {InterfaceTypeSelection::Invalid, "Invalid"}, 297 {InterfaceTypeSelection::None, "None"}, 298 {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"}, 299 {InterfaceTypeSelection::BiosSetting, "BiosSetting"}, 300 {InterfaceTypeSelection::OemMethod, "OemMethod"}, 301 }); 302 303 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, { 304 {WatchdogWarningActions::Invalid, "Invalid"}, 305 {WatchdogWarningActions::None, "None"}, 306 {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"}, 307 {WatchdogWarningActions::SMI, "SMI"}, 308 {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"}, 309 {WatchdogWarningActions::SCI, "SCI"}, 310 {WatchdogWarningActions::OEM, "OEM"}, 311 }); 312 313 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, { 314 {WatchdogTimeoutActions::Invalid, "Invalid"}, 315 {WatchdogTimeoutActions::None, "None"}, 316 {WatchdogTimeoutActions::ResetSystem, "ResetSystem"}, 317 {WatchdogTimeoutActions::PowerCycle, "PowerCycle"}, 318 {WatchdogTimeoutActions::PowerDown, "PowerDown"}, 319 {WatchdogTimeoutActions::OEM, "OEM"}, 320 }); 321 322 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, { 323 {PowerRestorePolicyTypes::Invalid, "Invalid"}, 324 {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"}, 325 {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"}, 326 {PowerRestorePolicyTypes::LastState, "LastState"}, 327 }); 328 329 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, { 330 {BootOrderTypes::Invalid, "Invalid"}, 331 {BootOrderTypes::BootOrder, "BootOrder"}, 332 {BootOrderTypes::AliasBootOrder, "AliasBootOrder"}, 333 }); 334 335 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, { 336 {AutomaticRetryConfig::Invalid, "Invalid"}, 337 {AutomaticRetryConfig::Disabled, "Disabled"}, 338 {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"}, 339 {AutomaticRetryConfig::RetryAlways, "RetryAlways"}, 340 }); 341 342 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, { 343 {BootProgressTypes::Invalid, "Invalid"}, 344 {BootProgressTypes::None, "None"}, 345 {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"}, 346 {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"}, 347 {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"}, 348 {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"}, 349 {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"}, 350 {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"}, 351 {BootProgressTypes::SetupEntered, "SetupEntered"}, 352 {BootProgressTypes::OSBootStarted, "OSBootStarted"}, 353 {BootProgressTypes::OSRunning, "OSRunning"}, 354 {BootProgressTypes::OEM, "OEM"}, 355 }); 356 357 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, { 358 {GraphicalConnectTypesSupported::Invalid, "Invalid"}, 359 {GraphicalConnectTypesSupported::KVMIP, "KVMIP"}, 360 {GraphicalConnectTypesSupported::OEM, "OEM"}, 361 }); 362 363 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, { 364 {TrustedModuleRequiredToBoot::Invalid, "Invalid"}, 365 {TrustedModuleRequiredToBoot::Disabled, "Disabled"}, 366 {TrustedModuleRequiredToBoot::Required, "Required"}, 367 }); 368 369 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, { 370 {StopBootOnFault::Invalid, "Invalid"}, 371 {StopBootOnFault::Never, "Never"}, 372 {StopBootOnFault::AnyFault, "AnyFault"}, 373 }); 374 375 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, { 376 {PowerMode::Invalid, "Invalid"}, 377 {PowerMode::MaximumPerformance, "MaximumPerformance"}, 378 {PowerMode::BalancedPerformance, "BalancedPerformance"}, 379 {PowerMode::PowerSaving, "PowerSaving"}, 380 {PowerMode::Static, "Static"}, 381 {PowerMode::OSControlled, "OSControlled"}, 382 {PowerMode::OEM, "OEM"}, 383 {PowerMode::EfficiencyFavorPower, "EfficiencyFavorPower"}, 384 {PowerMode::EfficiencyFavorPerformance, "EfficiencyFavorPerformance"}, 385 }); 386 387 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, { 388 {CompositionUseCase::Invalid, "Invalid"}, 389 {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"}, 390 {CompositionUseCase::ExpandableSystem, "ExpandableSystem"}, 391 }); 392 393 NLOHMANN_JSON_SERIALIZE_ENUM(KMIPCachePolicy, { 394 {KMIPCachePolicy::Invalid, "Invalid"}, 395 {KMIPCachePolicy::None, "None"}, 396 {KMIPCachePolicy::AfterFirstUse, "AfterFirstUse"}, 397 }); 398 399 NLOHMANN_JSON_SERIALIZE_ENUM(DecommissionType, { 400 {DecommissionType::Invalid, "Invalid"}, 401 {DecommissionType::All, "All"}, 402 {DecommissionType::UserData, "UserData"}, 403 {DecommissionType::ManagerConfig, "ManagerConfig"}, 404 {DecommissionType::BIOSConfig, "BIOSConfig"}, 405 {DecommissionType::NetworkConfig, "NetworkConfig"}, 406 {DecommissionType::StorageConfig, "StorageConfig"}, 407 {DecommissionType::Logs, "Logs"}, 408 }); 409 410 NLOHMANN_JSON_SERIALIZE_ENUM(LastResetCauses, { 411 {LastResetCauses::Invalid, "Invalid"}, 412 {LastResetCauses::PowerButtonPress, "PowerButtonPress"}, 413 {LastResetCauses::ManagementCommand, "ManagementCommand"}, 414 {LastResetCauses::PowerRestorePolicy, "PowerRestorePolicy"}, 415 {LastResetCauses::RTCWakeup, "RTCWakeup"}, 416 {LastResetCauses::WatchdogExpiration, "WatchdogExpiration"}, 417 {LastResetCauses::OSSoftRestart, "OSSoftRestart"}, 418 {LastResetCauses::SystemCrash, "SystemCrash"}, 419 {LastResetCauses::ThermalEvent, "ThermalEvent"}, 420 {LastResetCauses::PowerEvent, "PowerEvent"}, 421 {LastResetCauses::Unknown, "Unknown"}, 422 }); 423 424 } 425 // clang-format on 426