blob: e988d03064b07ef8bffeb7c67b8322587e3dfeba [file] [log] [blame]
Jia, Chunhuia835eaa2018-09-05 09:00:41 +08001/*
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. Bills64796042018-10-03 16:51:55 -070019enum class IPMINetfnIntelOEMGeneralCmd
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080020{
21 cmdSetBIOSID = 0x26,
22 cmdGetOEMDeviceInfo = 0x27,
Jason M. Bills64796042018-10-03 16:51:55 -070023 cmdGetAICSlotFRUIDSlotPosRecords = 0x31,
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080024 cmdSetSystemGUID = 0x41,
Jason M. Bills64796042018-10-03 16:51:55 -070025 cmdSetPowerRestoreDelay = 0x54,
26 cmdGetPowerRestoreDelay = 0x55,
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080027 cmdGetChassisIdentifier = 0x92,
Jason M. Bills64796042018-10-03 16:51:55 -070028 cmdGetProcessorErrConfig = 0x9A,
29 cmdSetProcessorErrConfig = 0x9B,
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080030};
31
Jason M. Bills64796042018-10-03 16:51:55 -070032enum class IPMIIntelOEMReturnCodes
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080033{
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. Bills64796042018-10-03 16:51:55 -070058enum class IPMIReturnCodeExt
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080059{
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. Bills64796042018-10-03 16:51:55 -070071constexpr const uint8_t netfunIntelAppOEM = 0x3E;
72static constexpr ipmi_netfn_t netfnIntcOEMGeneral =
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080073 NETFUN_NONE; // Netfun_none. In our platform, we use it as "intel oem
74 // general". The code is 0x30
Jason M. Bills64796042018-10-03 16:51:55 -070075static constexpr const uint8_t maxBIOSIDLength = 0xFF;
76static constexpr const uint8_t maxCPUNum = 4;
77static constexpr const char* biosObjPath = "/xyz/openbmc_project/bios";
78static constexpr const char* biosIntf =
79 "xyz.openbmc_project.Inventory.Item.Bios";
80static constexpr const char* biosProp = "BiosId";
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080081
Jason M. Bills64796042018-10-03 16:51:55 -070082static constexpr const char* powerRestoreDelayObjPath =
83 "/xyz/openbmc_project/control/power_restore_delay";
84static constexpr const char* powerRestoreDelayIntf =
85 "xyz.openbmc_project.Control.Power.RestoreDelay";
86static constexpr const char* powerRestoreDelayProp = "PowerRestoreDelay";
87static constexpr const char* processorErrConfigObjPath =
88 "/xyz/openbmc_project/control/processor_error_config";
89static constexpr const char* processorErrConfigIntf =
90 "xyz.openbmc_project.Control.Processor.ErrConfig";
91
92enum class IPMINetfnIntelOEMAppCmd
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080093{
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. Bills64796042018-10-03 16:51:55 -0700114enum class OEMDevEntityType
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800115{
116 biosId,
117 devVer,
118 sdrVer,
Jason M. Bills64796042018-10-03 16:51:55 -0700119};
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800120
Jason M. Bills64796042018-10-03 16:51:55 -0700121#pragma pack(push, 1)
122struct GUIDData
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800123{
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. Bills64796042018-10-03 16:51:55 -0700140};
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800141
Jason M. Bills64796042018-10-03 16:51:55 -0700142struct DeviceInfo
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800143{
Jason M. Bills64796042018-10-03 16:51:55 -0700144 uint8_t biosIDLength;
145 uint8_t biosId[maxBIOSIDLength];
146};
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800147
Jason M. Bills64796042018-10-03 16:51:55 -0700148struct SetPowerRestoreDelayReq
149{
150 uint8_t byteMSB;
151 uint8_t byteLSB;
152};
153
154struct GetPowerRestoreDelayRes
155{
156 uint8_t byteMSB;
157 uint8_t byteLSB;
158};
159
160struct GetOemDeviceInfoReq
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800161{
162 uint8_t entityType;
163 uint8_t countToRead;
164 uint8_t offset;
Jason M. Bills64796042018-10-03 16:51:55 -0700165};
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800166
Jason M. Bills64796042018-10-03 16:51:55 -0700167struct GetOemDeviceInfoRes
Jia, Chunhuia835eaa2018-09-05 09:00:41 +0800168{
169 uint8_t resDatalen;
Jason M. Bills64796042018-10-03 16:51:55 -0700170 uint8_t data[maxBIOSIDLength];
171};
172
173struct 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
192struct 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)