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 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 19 | enum class IPMINetfnIntelOEMGeneralCmd |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 20 | { |
| 21 | cmdSetBIOSID = 0x26, |
| 22 | cmdGetOEMDeviceInfo = 0x27, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 23 | cmdGetAICSlotFRUIDSlotPosRecords = 0x31, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 24 | cmdSetSystemGUID = 0x41, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 25 | cmdSetPowerRestoreDelay = 0x54, |
| 26 | cmdGetPowerRestoreDelay = 0x55, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 27 | cmdGetChassisIdentifier = 0x92, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 28 | cmdGetProcessorErrConfig = 0x9A, |
| 29 | cmdSetProcessorErrConfig = 0x9B, |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 30 | }; |
| 31 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 32 | enum class IPMIIntelOEMReturnCodes |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 33 | { |
| 34 | ipmiCCPayloadActive = 0x80, |
| 35 | ipmiCCInvalidPCIESlotID = 0x80, |
| 36 | ipmiCCParameterNotSupported = 0x80, |
| 37 | ipmiCCPayloadAlreadyDeactivated = 0x80, |
| 38 | ipmiCCSetInProcess = 0x81, |
| 39 | ipmiCCPayloadDisable = 0x81, |
| 40 | ipmiCCLostArbitration = 0x81, |
| 41 | ipmiCCInvalidCablePortIndex = 0x81, |
| 42 | ipmiCCHealthStatusNotAvailable = 0x81, |
| 43 | ipmiCCBusError = 0x82, |
| 44 | ipmiCCReadOnly = 0x82, |
| 45 | ipmiCCWriteOnly = 0x82, |
| 46 | ipmiCCNoCablePresent = 0x82, |
| 47 | ipmiCCDataCollectionInProgress = 0x82, |
| 48 | ipmiCCPayloadActivationLimitReached = 0x82, |
| 49 | ipmiCCNACKOnWrite = 0x83, |
| 50 | ipmiCCDataCollectionFailed = 0x83, |
| 51 | ipmiCCCanNotActivateWithEncrption = 0x83, |
| 52 | ipmiCCCanNotActivateWithoutEncryption = 0x84, |
| 53 | ipmiCCInvalidChecksum = 0x85, |
| 54 | ipmiCCNoCabledPCIEPortsAvailable = 0xC2, |
| 55 | |
| 56 | }; |
| 57 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 58 | enum class IPMIReturnCodeExt |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 59 | { |
| 60 | ipmiCCInvalidLUN = 0xC2, |
| 61 | ipmiCCTimeout = 0xC3, |
| 62 | ipmiCCStorageLeak = 0xC4, |
| 63 | ipmiCCRequestDataTruncated = 0xC6, |
| 64 | ipmiCCRequestDataFieldLengthLimitExceeded = 0xC8, |
| 65 | ipmiCCCanNotReturnNumberOfRequestedDataBytes = 0xCA, |
| 66 | ipmiCCRequestSensorDataRecordNotFound = 0xCB, |
| 67 | ipmiCCDestinationUnavailable = 0xD3, |
| 68 | ipmiCCParamterNotSupportInPresentState = 0xD5, |
| 69 | }; |
| 70 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 71 | constexpr const uint8_t netfunIntelAppOEM = 0x3E; |
| 72 | static constexpr ipmi_netfn_t netfnIntcOEMGeneral = |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 73 | NETFUN_NONE; // Netfun_none. In our platform, we use it as "intel oem |
| 74 | // general". The code is 0x30 |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 75 | static constexpr const uint8_t maxBIOSIDLength = 0xFF; |
| 76 | static constexpr const uint8_t maxCPUNum = 4; |
| 77 | static constexpr const char* biosObjPath = "/xyz/openbmc_project/bios"; |
| 78 | static constexpr const char* biosIntf = |
| 79 | "xyz.openbmc_project.Inventory.Item.Bios"; |
| 80 | static constexpr const char* biosProp = "BiosId"; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 81 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 82 | static constexpr const char* powerRestoreDelayObjPath = |
| 83 | "/xyz/openbmc_project/control/power_restore_delay"; |
| 84 | static constexpr const char* powerRestoreDelayIntf = |
| 85 | "xyz.openbmc_project.Control.Power.RestoreDelay"; |
| 86 | static constexpr const char* powerRestoreDelayProp = "PowerRestoreDelay"; |
| 87 | static constexpr const char* processorErrConfigObjPath = |
| 88 | "/xyz/openbmc_project/control/processor_error_config"; |
| 89 | static constexpr const char* processorErrConfigIntf = |
| 90 | "xyz.openbmc_project.Control.Processor.ErrConfig"; |
| 91 | |
| 92 | enum class IPMINetfnIntelOEMAppCmd |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 93 | { |
| 94 | mdrStatus = 0x20, |
| 95 | mdrComplete = 0x21, |
| 96 | mdrEvent = 0x22, |
| 97 | mdrRead = 0x23, |
| 98 | mdrWrite = 0x24, |
| 99 | mdrLock = 0x25, |
| 100 | mdr2AgentStatus = 0x30, |
| 101 | mdr2GetDir = 0x31, |
| 102 | mdr2GetDataInfo = 0x32, |
| 103 | mdr2LockData = 0x33, |
| 104 | mdr2UnlockData = 0x34, |
| 105 | mdr2GetDataBlock = 0x35, |
| 106 | mdr2SendDir = 0x38, |
| 107 | mdr2SendDataInfoOffer = 0x39, |
| 108 | mdr2SendDataInfo = 0x3a, |
| 109 | mdr2DataStart = 0x3b, |
| 110 | mdr2DataDone = 0x3c, |
| 111 | mdr2SendDataBlock = 0x3d, |
| 112 | }; |
| 113 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 114 | enum class OEMDevEntityType |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 115 | { |
| 116 | biosId, |
| 117 | devVer, |
| 118 | sdrVer, |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 119 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 120 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 121 | #pragma pack(push, 1) |
| 122 | struct GUIDData |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 123 | { |
| 124 | uint8_t node1; |
| 125 | uint8_t node2; |
| 126 | uint8_t node3; |
| 127 | uint8_t node4; |
| 128 | uint8_t node5; |
| 129 | uint8_t node6; |
| 130 | uint8_t clock1; |
| 131 | uint8_t clock2; |
| 132 | uint8_t timeHigh1; |
| 133 | uint8_t timeHigh2; |
| 134 | uint8_t timeMid1; |
| 135 | uint8_t timeMid2; |
| 136 | uint8_t timeLow1; |
| 137 | uint8_t timeLow2; |
| 138 | uint8_t timeLow3; |
| 139 | uint8_t timeLow4; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 140 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 141 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 142 | struct DeviceInfo |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 143 | { |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 144 | uint8_t biosIDLength; |
| 145 | uint8_t biosId[maxBIOSIDLength]; |
| 146 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 147 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 148 | struct SetPowerRestoreDelayReq |
| 149 | { |
| 150 | uint8_t byteMSB; |
| 151 | uint8_t byteLSB; |
| 152 | }; |
| 153 | |
| 154 | struct GetPowerRestoreDelayRes |
| 155 | { |
| 156 | uint8_t byteMSB; |
| 157 | uint8_t byteLSB; |
| 158 | }; |
| 159 | |
| 160 | struct GetOemDeviceInfoReq |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 161 | { |
| 162 | uint8_t entityType; |
| 163 | uint8_t countToRead; |
| 164 | uint8_t offset; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 165 | }; |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 166 | |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 167 | struct GetOemDeviceInfoRes |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 168 | { |
| 169 | uint8_t resDatalen; |
Jason M. Bills | 6479604 | 2018-10-03 16:51:55 -0700 | [diff] [blame^] | 170 | uint8_t data[maxBIOSIDLength]; |
| 171 | }; |
| 172 | |
| 173 | struct SetProcessorErrConfigReq |
| 174 | { |
| 175 | uint8_t resetCfg; // Reset Configuration |
| 176 | // [0]: CATERR Reset Enabled |
| 177 | // 0b: Disabled |
| 178 | // 1b: Enabled |
| 179 | // [1]: ERR2 Reset Enabled |
| 180 | // 0b: Disabled |
| 181 | // 1b: Enabled |
| 182 | // [7:2]: Reserved |
| 183 | uint8_t reserved; // Reserved |
| 184 | uint8_t |
| 185 | resetErrorOccurrenceCounts; // Reset Error Occurrence Counts |
| 186 | //[0]: Reset CPU Error Counts |
| 187 | // 0b: Keep CPU Error Counts |
| 188 | // 1b: Reset all CPU Error Counts to zero |
| 189 | //[7:1]: Reserved |
| 190 | }; |
| 191 | |
| 192 | struct GetProcessorErrConfigRes |
| 193 | { |
| 194 | uint8_t resetCfg; // Reset Configuration |
| 195 | // [0]: CATERR Reset Enabled |
| 196 | // 0b: Disabled |
| 197 | // 1b: Enabled |
| 198 | // [1]: ERR2 Reset Enabled |
| 199 | // 0b: Disabled |
| 200 | // 1b: Enabled |
| 201 | // [7:2]: Reserved |
| 202 | uint8_t reserved; // Reserved |
| 203 | char caterrStatus[maxCPUNum]; // for all CPUs including the non-legacy |
| 204 | // socket CPU CPU CATERR (Core Error) |
| 205 | // occurrence |
| 206 | // [5:0]: Error Occurrence Count |
| 207 | // [7:6]: CPU Status |
| 208 | // 00b: Disabled |
| 209 | // 01b: Enabled |
| 210 | // 11b: Not Present |
| 211 | }; |
| 212 | #pragma pack(pop) |