Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 1 | /* |
| 2 | // Copyright (c) 2018 Intel Corporation |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
Suryakanth Sekar | d509eb9 | 2018-11-15 17:44:11 +0530 | [diff] [blame] | 19 | #include <user_channel/user_layer.hpp> |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 20 | enum class IPMINetfnIntelOEMGeneralCmd |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 21 | { |
Richard Marian Thomaiyar | 390b435 | 2019-08-24 17:39:46 +0530 | [diff] [blame] | 22 | cmdGetSmSignal = 0x14, |
| 23 | cmdSetSmSignal = 0x15, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 24 | cmdSetBIOSID = 0x26, |
| 25 | cmdGetOEMDeviceInfo = 0x27, |
Cheng C Yang | 773703a | 2019-08-15 09:41:11 +0800 | [diff] [blame] | 26 | cmdSetColdRedundancyConfig = 0x2d, |
| 27 | cmdGetColdRedundancyConfig = 0x2e, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 28 | cmdGetAICSlotFRUIDSlotPosRecords = 0x31, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 29 | cmdSetSystemGUID = 0x41, |
Jason M. Bills | b02bf09 | 2019-08-15 13:01:56 -0700 | [diff] [blame] | 30 | cmdDisableBMCSystemReset = 0x42, |
| 31 | cmdGetBMCResetDisables = 0x43, |
Jia, Chunhui | cc49b54 | 2019-03-20 15:41:07 +0800 | [diff] [blame] | 32 | cmdSendEmbeddedFWUpdStatus = 0x44, |
Yong Li | f267a67 | 2019-08-29 11:16:07 +0800 | [diff] [blame^] | 33 | cmdSlotI2CMasterWriteRead = 0x52, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 34 | cmdSetPowerRestoreDelay = 0x54, |
| 35 | cmdGetPowerRestoreDelay = 0x55, |
Zhu, Yunge | be560b0 | 2019-04-21 21:19:21 -0400 | [diff] [blame] | 36 | cmdSetFaultIndication = 0x57, |
Suryakanth Sekar | d509eb9 | 2018-11-15 17:44:11 +0530 | [diff] [blame] | 37 | cmdSetOEMUser2Activation = 0x5A, |
Richard Marian Thomaiyar | fc5e985 | 2019-04-14 15:06:27 +0530 | [diff] [blame] | 38 | cmdSetSpecialUserPassword = 0x5F, |
Yong Li | 703922d | 2018-11-06 13:25:31 +0800 | [diff] [blame] | 39 | cmdSetShutdownPolicy = 0x60, |
| 40 | cmdGetShutdownPolicy = 0x62, |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 41 | cmdSetFanConfig = 0x89, |
| 42 | cmdGetFanConfig = 0x8a, |
James Feist | acc8a4e | 2019-04-02 14:23:57 -0700 | [diff] [blame] | 43 | cmdSetFanSpeedOffset = 0x8c, |
| 44 | cmdGetFanSpeedOffset = 0x8d, |
James Feist | 63efafa | 2019-07-24 12:39:21 -0700 | [diff] [blame] | 45 | cmdSetDimmOffset = 0x8e, |
| 46 | cmdGetDimmOffset = 0x8f, |
James Feist | 5f957ca | 2019-03-14 15:33:55 -0700 | [diff] [blame] | 47 | cmdSetFscParameter = 0x90, |
| 48 | cmdGetFscParameter = 0x91, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 49 | cmdGetChassisIdentifier = 0x92, |
Richard Marian Thomaiyar | ea537d5 | 2019-04-24 21:33:48 +0530 | [diff] [blame] | 50 | cmdReadBaseBoardProductId = 0x93, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 51 | cmdGetProcessorErrConfig = 0x9A, |
| 52 | cmdSetProcessorErrConfig = 0x9B, |
Richard Marian Thomaiyar | 1f0839c | 2019-08-25 20:10:52 +0530 | [diff] [blame] | 53 | cmdSetManufacturingData = 0xA1, |
| 54 | cmdGetManufacturingData = 0xA2, |
Kuiying Wang | 45f0498 | 2018-12-26 09:23:08 +0800 | [diff] [blame] | 55 | cmdGetLEDStatus = 0xB0, |
Richard Marian Thomaiyar | 390b435 | 2019-08-24 17:39:46 +0530 | [diff] [blame] | 56 | cmdControlBmcServices = 0xB1, |
| 57 | cmdGetBmcServiceStatus = 0xB2, |
Richard Marian Thomaiyar | d801e46 | 2019-06-20 01:05:40 +0530 | [diff] [blame] | 58 | cmdGetSecurityMode = 0xB3, |
| 59 | cmdSetSecurityMode = 0xB4, |
Richard Marian Thomaiyar | 666dd01 | 2019-08-02 20:55:37 +0530 | [diff] [blame] | 60 | cmdMtmKeepAlive = 0xB5, |
Chen Yugang | 39736d5 | 2019-07-12 16:24:33 +0800 | [diff] [blame] | 61 | cmdGetNmiStatus = 0xE5, |
Chen,Yugang | 4f7e76b | 2019-08-20 09:28:06 +0800 | [diff] [blame] | 62 | cmdSetEfiBootOptions = 0xEA, |
| 63 | cmdGetEfiBootOptions = 0xEB, |
Chen Yugang | 39736d5 | 2019-07-12 16:24:33 +0800 | [diff] [blame] | 64 | cmdSetNmiStatus = 0xED, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 65 | }; |
| 66 | |
Yong Li | 23737fe | 2019-02-19 08:49:55 +0800 | [diff] [blame] | 67 | enum class IPMINetfnIntelOEMPlatformCmd |
| 68 | { |
| 69 | cmdCfgHostSerialPortSpeed = 0x90, |
| 70 | }; |
| 71 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 72 | enum class IPMIIntelOEMReturnCodes |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 73 | { |
| 74 | ipmiCCPayloadActive = 0x80, |
| 75 | ipmiCCInvalidPCIESlotID = 0x80, |
| 76 | ipmiCCParameterNotSupported = 0x80, |
| 77 | ipmiCCPayloadAlreadyDeactivated = 0x80, |
| 78 | ipmiCCSetInProcess = 0x81, |
| 79 | ipmiCCPayloadDisable = 0x81, |
| 80 | ipmiCCLostArbitration = 0x81, |
| 81 | ipmiCCInvalidCablePortIndex = 0x81, |
| 82 | ipmiCCHealthStatusNotAvailable = 0x81, |
| 83 | ipmiCCBusError = 0x82, |
| 84 | ipmiCCReadOnly = 0x82, |
| 85 | ipmiCCWriteOnly = 0x82, |
| 86 | ipmiCCNoCablePresent = 0x82, |
| 87 | ipmiCCDataCollectionInProgress = 0x82, |
| 88 | ipmiCCPayloadActivationLimitReached = 0x82, |
| 89 | ipmiCCNACKOnWrite = 0x83, |
| 90 | ipmiCCDataCollectionFailed = 0x83, |
| 91 | ipmiCCCanNotActivateWithEncrption = 0x83, |
| 92 | ipmiCCCanNotActivateWithoutEncryption = 0x84, |
| 93 | ipmiCCInvalidChecksum = 0x85, |
| 94 | ipmiCCNoCabledPCIEPortsAvailable = 0xC2, |
| 95 | |
| 96 | }; |
| 97 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 98 | enum class IPMIReturnCodeExt |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 99 | { |
| 100 | ipmiCCInvalidLUN = 0xC2, |
| 101 | ipmiCCTimeout = 0xC3, |
| 102 | ipmiCCStorageLeak = 0xC4, |
| 103 | ipmiCCRequestDataTruncated = 0xC6, |
| 104 | ipmiCCRequestDataFieldLengthLimitExceeded = 0xC8, |
| 105 | ipmiCCCanNotReturnNumberOfRequestedDataBytes = 0xCA, |
| 106 | ipmiCCRequestSensorDataRecordNotFound = 0xCB, |
| 107 | ipmiCCDestinationUnavailable = 0xD3, |
| 108 | ipmiCCParamterNotSupportInPresentState = 0xD5, |
| 109 | }; |
| 110 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 111 | constexpr const uint8_t netfunIntelAppOEM = 0x3E; |
| 112 | static constexpr ipmi_netfn_t netfnIntcOEMGeneral = |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 113 | NETFUN_NONE; // Netfun_none. In our platform, we use it as "intel oem |
| 114 | // general". The code is 0x30 |
Yong Li | 23737fe | 2019-02-19 08:49:55 +0800 | [diff] [blame] | 115 | |
| 116 | // Intel OEM Platform code is 0x32 |
| 117 | static constexpr ipmi_netfn_t netfnIntcOEMPlatform = NETFUN_OEM; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 118 | static constexpr const uint8_t maxBIOSIDLength = 0xFF; |
| 119 | static constexpr const uint8_t maxCPUNum = 4; |
| 120 | static constexpr const char* biosObjPath = "/xyz/openbmc_project/bios"; |
| 121 | static constexpr const char* biosIntf = |
| 122 | "xyz.openbmc_project.Inventory.Item.Bios"; |
| 123 | static constexpr const char* biosProp = "BiosId"; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 124 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 125 | static constexpr const char* powerRestoreDelayObjPath = |
| 126 | "/xyz/openbmc_project/control/power_restore_delay"; |
| 127 | static constexpr const char* powerRestoreDelayIntf = |
| 128 | "xyz.openbmc_project.Control.Power.RestoreDelay"; |
| 129 | static constexpr const char* powerRestoreDelayProp = "PowerRestoreDelay"; |
| 130 | static constexpr const char* processorErrConfigObjPath = |
| 131 | "/xyz/openbmc_project/control/processor_error_config"; |
| 132 | static constexpr const char* processorErrConfigIntf = |
| 133 | "xyz.openbmc_project.Control.Processor.ErrConfig"; |
Jason M. Bills | b02bf09 | 2019-08-15 13:01:56 -0700 | [diff] [blame] | 134 | static constexpr const char* bmcResetDisablesPath = |
| 135 | "/xyz/openbmc_project/control/bmc_reset_disables"; |
| 136 | static constexpr const char* bmcResetDisablesIntf = |
| 137 | "xyz.openbmc_project.Control.ResetDisables"; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 138 | |
Yong Li | 703922d | 2018-11-06 13:25:31 +0800 | [diff] [blame] | 139 | static constexpr const char* postCodesObjPath = |
| 140 | "/xyz/openbmc_project/State/Boot/PostCode"; |
| 141 | static constexpr const char* postCodesIntf = |
| 142 | "xyz.openbmc_project.State.Boot.PostCode"; |
| 143 | |
Kuiying Wang | 45f0498 | 2018-12-26 09:23:08 +0800 | [diff] [blame] | 144 | static constexpr const char* identifyLEDObjPath = |
| 145 | "/xyz/openbmc_project/led/physical/identify"; |
| 146 | static constexpr const char* ledIntf = "xyz.openbmc_project.Led.Physical"; |
| 147 | static constexpr const char* statusAmberObjPath = |
| 148 | "/xyz/openbmc_project/led/physical/status_amber"; |
| 149 | static constexpr const char* statusGreenObjPath = |
| 150 | "/xyz/openbmc_project/led/physical/status_green"; |
| 151 | |
Yong Li | 703922d | 2018-11-06 13:25:31 +0800 | [diff] [blame] | 152 | static constexpr const uint8_t noShutdownOnOCOT = 0; |
| 153 | static constexpr const uint8_t shutdownOnOCOT = 1; |
| 154 | static constexpr const uint8_t noShutdownPolicySupported = 0; |
| 155 | static constexpr const uint8_t shutdownPolicySupported = 1; |
| 156 | static constexpr const char* oemShutdownPolicyIntf = |
Yong Li | 0669d19 | 2019-05-06 14:01:46 +0800 | [diff] [blame] | 157 | "com.intel.Control.OCOTShutdownPolicy"; |
Yong Li | 703922d | 2018-11-06 13:25:31 +0800 | [diff] [blame] | 158 | static constexpr const char* oemShutdownPolicyObjPath = |
Yong Li | 0669d19 | 2019-05-06 14:01:46 +0800 | [diff] [blame] | 159 | "/com/intel/control/ocotshutdown_policy_config"; |
| 160 | static constexpr const char* oemShutdownPolicyObjPathProp = "OCOTPolicy"; |
Yong Li | 703922d | 2018-11-06 13:25:31 +0800 | [diff] [blame] | 161 | |
Yong Li | 23737fe | 2019-02-19 08:49:55 +0800 | [diff] [blame] | 162 | static constexpr const char* fwGetEnvCmd = "/sbin/fw_printenv"; |
| 163 | static constexpr const char* fwSetEnvCmd = "/sbin/fw_setenv"; |
| 164 | static constexpr const char* fwHostSerailCfgEnvName = "hostserialcfg"; |
| 165 | |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 166 | constexpr const char* settingsBusName = "xyz.openbmc_project.Settings"; |
| 167 | |
Yong Li | 23737fe | 2019-02-19 08:49:55 +0800 | [diff] [blame] | 168 | static constexpr const uint8_t getHostSerialCfgCmd = 0; |
| 169 | static constexpr const uint8_t setHostSerialCfgCmd = 1; |
| 170 | |
| 171 | // parameters: |
| 172 | // 0: host serial port 1 and 2 normal speed |
| 173 | // 1: host serial port 1 high spend, port 2 normal speed |
| 174 | // 2: host serial port 1 normal spend, port 2 high speed |
| 175 | // 3: host serial port 1 and 2 high speed |
| 176 | static constexpr const uint8_t HostSerialCfgParamMax = 3; |
Suryakanth Sekar | d509eb9 | 2018-11-15 17:44:11 +0530 | [diff] [blame] | 177 | static constexpr uint8_t ipmiDefaultUserId = 2; |
Yong Li | 23737fe | 2019-02-19 08:49:55 +0800 | [diff] [blame] | 178 | |
Jia, Chunhui | cc49b54 | 2019-03-20 15:41:07 +0800 | [diff] [blame] | 179 | static constexpr const uint8_t selEvtTargetMask = 0xF0; |
| 180 | static constexpr const uint8_t selEvtTargetShift = 4; |
| 181 | |
| 182 | static constexpr const uint8_t targetInstanceMask = 0x0E; |
| 183 | static constexpr const uint8_t targetInstanceShift = 1; |
| 184 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 185 | enum class IPMINetfnIntelOEMAppCmd |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 186 | { |
| 187 | mdrStatus = 0x20, |
| 188 | mdrComplete = 0x21, |
| 189 | mdrEvent = 0x22, |
| 190 | mdrRead = 0x23, |
| 191 | mdrWrite = 0x24, |
| 192 | mdrLock = 0x25, |
| 193 | mdr2AgentStatus = 0x30, |
| 194 | mdr2GetDir = 0x31, |
| 195 | mdr2GetDataInfo = 0x32, |
| 196 | mdr2LockData = 0x33, |
| 197 | mdr2UnlockData = 0x34, |
| 198 | mdr2GetDataBlock = 0x35, |
| 199 | mdr2SendDir = 0x38, |
| 200 | mdr2SendDataInfoOffer = 0x39, |
| 201 | mdr2SendDataInfo = 0x3a, |
| 202 | mdr2DataStart = 0x3b, |
| 203 | mdr2DataDone = 0x3c, |
| 204 | mdr2SendDataBlock = 0x3d, |
| 205 | }; |
| 206 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 207 | enum class OEMDevEntityType |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 208 | { |
| 209 | biosId, |
| 210 | devVer, |
| 211 | sdrVer, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 212 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 213 | |
Jia, Chunhui | cc49b54 | 2019-03-20 15:41:07 +0800 | [diff] [blame] | 214 | enum class FWUpdateTarget : uint8_t |
| 215 | { |
| 216 | targetBMC = 0x0, |
| 217 | targetBIOS = 0x1, |
| 218 | targetME = 0x2, |
| 219 | targetOEMEWS = 0x4, |
| 220 | }; |
| 221 | |
Jason M. Bills | 42bd9c8 | 2019-06-28 16:39:34 -0700 | [diff] [blame] | 222 | enum class CPUStatus |
| 223 | { |
| 224 | disabled = 0x0, |
| 225 | enabled = 0x1, |
| 226 | notPresent = 0x3, |
| 227 | }; |
| 228 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 229 | #pragma pack(push, 1) |
| 230 | struct GUIDData |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 231 | { |
| 232 | uint8_t node1; |
| 233 | uint8_t node2; |
| 234 | uint8_t node3; |
| 235 | uint8_t node4; |
| 236 | uint8_t node5; |
| 237 | uint8_t node6; |
| 238 | uint8_t clock1; |
| 239 | uint8_t clock2; |
| 240 | uint8_t timeHigh1; |
| 241 | uint8_t timeHigh2; |
| 242 | uint8_t timeMid1; |
| 243 | uint8_t timeMid2; |
| 244 | uint8_t timeLow1; |
| 245 | uint8_t timeLow2; |
| 246 | uint8_t timeLow3; |
| 247 | uint8_t timeLow4; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 248 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 249 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 250 | struct DeviceInfo |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 251 | { |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 252 | uint8_t biosIDLength; |
| 253 | uint8_t biosId[maxBIOSIDLength]; |
| 254 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 255 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 256 | struct SetPowerRestoreDelayReq |
| 257 | { |
| 258 | uint8_t byteMSB; |
| 259 | uint8_t byteLSB; |
| 260 | }; |
| 261 | |
| 262 | struct GetPowerRestoreDelayRes |
| 263 | { |
| 264 | uint8_t byteMSB; |
| 265 | uint8_t byteLSB; |
| 266 | }; |
| 267 | |
| 268 | struct GetOemDeviceInfoReq |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 269 | { |
| 270 | uint8_t entityType; |
| 271 | uint8_t countToRead; |
| 272 | uint8_t offset; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 273 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 274 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 275 | struct GetOemDeviceInfoRes |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 276 | { |
| 277 | uint8_t resDatalen; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame] | 278 | uint8_t data[maxBIOSIDLength]; |
| 279 | }; |
| 280 | |
Yong Li | 703922d | 2018-11-06 13:25:31 +0800 | [diff] [blame] | 281 | struct GetOEMShutdownPolicyRes |
| 282 | { |
| 283 | uint8_t policy; |
| 284 | uint8_t policySupport; |
| 285 | }; |
Kuiying Wang | 45f0498 | 2018-12-26 09:23:08 +0800 | [diff] [blame] | 286 | |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 287 | struct SetFanConfigReq |
| 288 | { |
| 289 | uint8_t selectedProfile; |
| 290 | uint8_t flags; |
| 291 | // other parameters from previous generation are not supported |
| 292 | }; |
Yong Li | 23737fe | 2019-02-19 08:49:55 +0800 | [diff] [blame] | 293 | struct CfgHostSerialReq |
| 294 | { |
| 295 | uint8_t command; |
| 296 | uint8_t parameter; |
| 297 | }; |
Kuiying Wang | 45f0498 | 2018-12-26 09:23:08 +0800 | [diff] [blame] | 298 | #pragma pack(pop) |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 299 | |
Zhu, Yunge | be560b0 | 2019-04-21 21:19:21 -0400 | [diff] [blame] | 300 | // |
| 301 | // Fault type enumeration |
| 302 | // |
| 303 | enum class RemoteFaultType |
| 304 | { |
| 305 | fan, // 0 |
| 306 | temperature, // 1 |
| 307 | power, // 2 |
| 308 | driveslot, // 3 |
| 309 | software, // 4 |
| 310 | memory, // 5 |
| 311 | max = 6 // 6 |
| 312 | }; |
| 313 | |
| 314 | // Enumeration for remote fault states as required by the HSC |
| 315 | // |
| 316 | enum class RemoteFaultState |
| 317 | { |
| 318 | // fault indicators |
| 319 | fanLEDs, |
| 320 | cpu1DimmLeds, |
| 321 | cpu2DimmLeds, |
| 322 | cpu3DimmLeds, |
| 323 | cpu4DimmLeds, |
| 324 | maxFaultState, |
| 325 | }; |
| 326 | |
| 327 | enum class DimmFaultType |
| 328 | { |
| 329 | cpu1cpu2Dimm, |
| 330 | cpu3cpu4Dimm, |
| 331 | maxFaultGroup, |
| 332 | }; |
| 333 | |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 334 | enum class setFanProfileFlags : uint8_t |
| 335 | { |
| 336 | setFanProfile = 7, |
| 337 | setPerfAcousMode = 6, |
| 338 | // reserved [5:3] |
| 339 | performAcousSelect = 2 |
| 340 | // reserved [1:0] |
James Feist | 5f957ca | 2019-03-14 15:33:55 -0700 | [diff] [blame] | 341 | }; |
| 342 | |
| 343 | enum class setFscParamFlags : uint8_t |
| 344 | { |
| 345 | tcontrol = 0x1, |
| 346 | pwmOffset = 0x2, |
| 347 | maxPwm = 0x3, |
| 348 | cfm = 0x4 |
Jia, Chunhui | cc49b54 | 2019-03-20 15:41:07 +0800 | [diff] [blame] | 349 | }; |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 350 | |
James Feist | 63efafa | 2019-07-24 12:39:21 -0700 | [diff] [blame] | 351 | enum class dimmOffsetTypes : uint8_t |
| 352 | { |
| 353 | staticCltt = 0x0, |
| 354 | dimmPower = 0x2 |
| 355 | }; |
| 356 | |
Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 357 | // FIXME: this stuff needs to be rewritten |
| 358 | enum IPMI_INTEL_OEM_RETURN_CODES |
| 359 | { |
| 360 | IPMI_CC_OEM_PAYLOAD_ACTIVE = 0x80, |
| 361 | IPMI_CC_OEM_INVALID_PCIE_SLOTID = 0x80, |
| 362 | IPMI_CC_OEM_PARAMETER_NOT_SUPPORTED = 0x80, |
| 363 | IPMI_CC_OEM_PAYLOAD_ALREADY_DEACTIVATED = 0x80, |
| 364 | IPMI_CC_OEM_SET_IN_PROCESS = 0x81, |
| 365 | IPMI_CC_OEM_PAYLOAD_DISABLE = 0x81, |
| 366 | IPMI_CC_OEM_LOST_ARBITRATION = 0x81, |
| 367 | IPMI_CC_OEM_INVALID_CABLE_PORT_INDEX = 0x81, |
| 368 | IPMI_CC_OEM_HEALTH_STATUS_NOT_AVAILABLE = 0x81, |
| 369 | IPMI_CC_OEM_BUS_ERROR = 0x82, |
| 370 | IPMI_CC_OEM_READ_ONLY = 0x82, |
| 371 | IPMI_CC_OEM_WRITE_ONLY = 0x82, |
| 372 | IPMI_CC_OEM_NO_CABLE_PRESENT = 0x82, |
| 373 | IPMI_CC_OEM_DATA_COLLECTION_IN_PROGRESS = 0x82, |
| 374 | IPMI_CC_OEM_PAYLOAD_ACTIVATION_LIMIT_REACH = 0x82, |
| 375 | IPMI_CC_OEM_NACK_ON_WRITE = 0x83, |
| 376 | IPMI_CC_OEM_DATA_COLLECTION_FAILED = 0x83, |
| 377 | IPMI_CC_OEM_CAN_NOT_ACTIVATE_WITH_ENCRYPTION = 0x83, |
| 378 | IPMI_CC_OEM_CAN_NOT_ACTIVATE_WITHOUT_ENCRYPTION = 0x84, |
| 379 | IPMI_CC_OEM_INVALID_CHECKSUM = 0x85, |
| 380 | IPMI_CC_OEM_NO_CABLED_PCIE_PORTS_AVAILABLE = 0xC2, |
| 381 | }; |
| 382 | |
| 383 | enum IPMI_RETURN_CODE_EXT |
| 384 | { |
| 385 | IPMI_CC_INVALID_LUN = 0xC2, |
| 386 | IPMI_CC_STORGE_LEAK = 0xC4, |
| 387 | IPMI_CC_REQUEST_DATA_TRUNCATED = 0xC6, |
| 388 | IPMI_CC_REQUEST_DATA_FIELD_LENGTH_LIMIT_EXCEEDED = 0xC8, |
| 389 | IPMI_CC_CANNOT_RETURN_NUMBER_OF_REQUESTED_DATA_BYTES = 0xCA, |
| 390 | IPMI_CC_REQUEST_SENSOR_DATA_RECORD_NOT_FOUND = 0xCB, |
| 391 | IPMI_CC_DESTINATION_UNAVAILABLE = 0xD3, |
| 392 | IPMI_CC_PARAMETER_NOT_SUPPORT_IN_PRESENT_STATE = 0xD5, |
| 393 | }; |
| 394 | |
| 395 | constexpr unsigned char NETFUN_INTEL_APP_OEM = 0x3E; |
| 396 | |
| 397 | enum IPMI_NETFN_INTEL_OEM_APP_CMD |
| 398 | { |
| 399 | MDR_STATUS = 0x20, |
| 400 | MDR_COMPLETE = 0x21, |
| 401 | MDR_EVENT = 0x22, |
| 402 | MDR_READ = 0x23, |
| 403 | MDR_WRITE = 0x24, |
| 404 | MDR_LOCK = 0x25, |
| 405 | MDRII_AGENT_STATUS = 0x30, |
| 406 | MDRII_GET_DIR = 0x31, |
| 407 | MDRII_GET_DATA_INFO = 0x32, |
| 408 | MDRII_LOCK_DATA = 0x33, |
| 409 | MDRII_UNLOCK_DATA = 0x34, |
| 410 | MDRII_GET_DATA_BLOCK = 0x35, |
| 411 | MDRII_SEND_DIR = 0x38, |
| 412 | MDRII_SEND_DATA_INFO_OFFER = 0x39, |
| 413 | MDRII_SEND_DATA_INFO = 0x3a, |
| 414 | MDRII_DATA_START = 0x3b, |
| 415 | MDRII_DATA_DONE = 0x3c, |
| 416 | MDRII_SEND_DATA_BLOCK = 0x3d, |
| 417 | }; |