1 /*++
2 
3 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution.  The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8 
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 
12 Module Name:
13 
14   DataHubSubClassMemory.h
15 
16 Abstract:
17 
18   Definitions for memory sub class data records
19 
20 Revision History
21 
22 --*/
23 
24 #ifndef _DATAHUB_SUBCLASS_MEMORY_H_
25 #define _DATAHUB_SUBCLASS_MEMORY_H_
26 
27 #include EFI_GUID_DEFINITION (DataHubRecords)
28 
29 
30 #define EFI_MEMORY_SUBCLASS_GUID \
31   {0x4E8F4EBB, 0x64B9, 0x4e05, {0x9B, 0x18, 0x4C, 0xFE, 0x49, 0x23, 0x50, 0x97}}
32 
33 #define EFI_MEMORY_SUBCLASS_VERSION     0x0100
34 
35 
36 #define EFI_MEMORY_SIZE_RECORD_NUMBER                 0x00000001
37 
38 typedef enum _EFI_MEMORY_REGION_TYPE {
39   EfiMemoryRegionMemory                       = 0x01,
40   EfiMemoryRegionReserved                     = 0x02,
41   EfiMemoryRegionAcpi                         = 0x03,
42   EfiMemoryRegionNvs                          = 0x04
43 } EFI_MEMORY_REGION_TYPE;
44 
45 typedef struct {
46   UINT32                      ProcessorNumber;
47   UINT16                      StartBusNumber;
48   UINT16                      EndBusNumber;
49   EFI_MEMORY_REGION_TYPE      MemoryRegionType;
50   EFI_EXP_BASE2_DATA          MemorySize;
51   EFI_PHYSICAL_ADDRESS        MemoryStartAddress;
52 } EFI_MEMORY_SIZE_DATA;
53 
54 
55 #define EFI_MEMORY_ARRAY_LOCATION_RECORD_NUMBER       0x00000002
56 
57 typedef enum _EFI_MEMORY_ARRAY_LOCATION {
58   EfiMemoryArrayLocationOther                 = 0x01,
59   EfiMemoryArrayLocationUnknown               = 0x02,
60   EfiMemoryArrayLocationSystemBoard           = 0x03,
61   EfiMemoryArrayLocationIsaAddonCard          = 0x04,
62   EfiMemoryArrayLocationEisaAddonCard         = 0x05,
63   EfiMemoryArrayLocationPciAddonCard          = 0x06,
64   EfiMemoryArrayLocationMcaAddonCard          = 0x07,
65   EfiMemoryArrayLocationPcmciaAddonCard       = 0x08,
66   EfiMemoryArrayLocationProprietaryAddonCard  = 0x09,
67   EfiMemoryArrayLocationNuBus                 = 0x0A,
68   EfiMemoryArrayLocationPc98C20AddonCard      = 0xA0,
69   EfiMemoryArrayLocationPc98C24AddonCard      = 0xA1,
70   EfiMemoryArrayLocationPc98EAddonCard        = 0xA2,
71   EfiMemoryArrayLocationPc98LocalBusAddonCard = 0xA3
72 } EFI_MEMORY_ARRAY_LOCATION;
73 
74 typedef enum _EFI_MEMORY_ARRAY_USE {
75   EfiMemoryArrayUseOther                      = 0x01,
76   EfiMemoryArrayUseUnknown                    = 0x02,
77   EfiMemoryArrayUseSystemMemory               = 0x03,
78   EfiMemoryArrayUseVideoMemory                = 0x04,
79   EfiMemoryArrayUseFlashMemory                = 0x05,
80   EfiMemoryArrayUseNonVolatileRam             = 0x06,
81   EfiMemoryArrayUseCacheMemory                = 0x07
82 } EFI_MEMORY_ARRAY_USE;
83 
84 typedef enum _EFI_MEMORY_ERROR_CORRECTION {
85   EfiMemoryErrorCorrectionOther               = 0x01,
86   EfiMemoryErrorCorrectionUnknown             = 0x02,
87   EfiMemoryErrorCorrectionNone                = 0x03,
88   EfiMemoryErrorCorrectionParity              = 0x04,
89   EfiMemoryErrorCorrectionSingleBitEcc        = 0x05,
90   EfiMemoryErrorCorrectionMultiBitEcc         = 0x06,
91   EfiMemoryErrorCorrectionCrc                 = 0x07
92 } EFI_MEMORY_ERROR_CORRECTION;
93 
94 typedef struct {
95   EFI_MEMORY_ARRAY_LOCATION   MemoryArrayLocation;
96   EFI_MEMORY_ARRAY_USE        MemoryArrayUse;
97   EFI_MEMORY_ERROR_CORRECTION MemoryErrorCorrection;
98   UINT32                      MaximumMemoryCapacity;
99   UINT16                      NumberMemoryDevices;
100 } EFI_MEMORY_ARRAY_LOCATION_DATA;
101 
102 
103 #define EFI_MEMORY_ARRAY_LINK_RECORD_NUMBER           0x00000003
104 
105 typedef enum _EFI_MEMORY_FORM_FACTOR {
106   EfiMemoryFormFactorOther                    = 0x01,
107   EfiMemoryFormFactorUnknown                  = 0x02,
108   EfiMemoryFormFactorSimm                     = 0x03,
109   EfiMemoryFormFactorSip                      = 0x04,
110   EfiMemoryFormFactorChip                     = 0x05,
111   EfiMemoryFormFactorDip                      = 0x06,
112   EfiMemoryFormFactorZip                      = 0x07,
113   EfiMemoryFormFactorProprietaryCard          = 0x08,
114   EfiMemoryFormFactorDimm                     = 0x09,
115   EfiMemoryFormFactorTsop                     = 0x0A,
116   EfiMemoryFormFactorRowOfChips               = 0x0B,
117   EfiMemoryFormFactorRimm                     = 0x0C,
118   EfiMemoryFormFactorSodimm                   = 0x0D,
119   EfiMemoryFormFactorSrimm                    = 0x0E,
120   EfiMemoryFormFactorFbDimm                   = 0x0F
121 } EFI_MEMORY_FORM_FACTOR;
122 
123 typedef enum _EFI_MEMORY_ARRAY_TYPE {
124   EfiMemoryTypeOther                          = 0x01,
125   EfiMemoryTypeUnknown                        = 0x02,
126   EfiMemoryTypeDram                           = 0x03,
127   EfiMemoryTypeEdram                          = 0x04,
128   EfiMemoryTypeVram                           = 0x05,
129   EfiMemoryTypeSram                           = 0x06,
130   EfiMemoryTypeRam                            = 0x07,
131   EfiMemoryTypeRom                            = 0x08,
132   EfiMemoryTypeFlash                          = 0x09,
133   EfiMemoryTypeEeprom                         = 0x0A,
134   EfiMemoryTypeFeprom                         = 0x0B,
135   EfiMemoryTypeEprom                          = 0x0C,
136   EfiMemoryTypeCdram                          = 0x0D,
137   EfiMemoryType3Dram                          = 0x0E,
138   EfiMemoryTypeSdram                          = 0x0F,
139   EfiMemoryTypeSgram                          = 0x10,
140   EfiMemoryTypeRdram                          = 0x11,
141   EfiMemoryTypeDdr                            = 0x12,
142   EfiMemoryTypeDdr2                           = 0x13,
143   EfiMemoryTypeDdr2FbDimm                     = 0x14,
144   EfiMemoryTypeDdr3                           = 0x18,
145   EfiMemoryTypeFbd2                           = 0x19
146 } EFI_MEMORY_ARRAY_TYPE;
147 
148 typedef struct {
149   UINT32                      Reserved        :1;
150   UINT32                      Other           :1;
151   UINT32                      Unknown         :1;
152   UINT32                      FastPaged       :1;
153   UINT32                      StaticColumn    :1;
154   UINT32                      PseudoStatic    :1;
155   UINT32                      Rambus          :1;
156   UINT32                      Synchronous     :1;
157   UINT32                      Cmos            :1;
158   UINT32                      Edo             :1;
159   UINT32                      WindowDram      :1;
160   UINT32                      CacheDram       :1;
161   UINT32                      Nonvolatile     :1;
162   UINT32                      Reserved1       :19;
163 } EFI_MEMORY_TYPE_DETAIL;
164 
165 typedef enum {
166   EfiMemoryStateEnabled =0,
167   EfiMemoryStateUnknown,
168   EfiMemoryStateUnsupported,
169   EfiMemoryStateError,
170   EfiMemoryStateAbsent,
171   EfiMemoryStateDisabled,
172   EfiMemoryStatePartial
173 } EFI_MEMORY_STATE;
174 
175 typedef struct {
176   EFI_STRING_TOKEN            MemoryDeviceLocator;
177   EFI_STRING_TOKEN            MemoryBankLocator;
178   EFI_STRING_TOKEN            MemoryManufacturer;
179   EFI_STRING_TOKEN            MemorySerialNumber;
180   EFI_STRING_TOKEN            MemoryAssetTag;
181   EFI_STRING_TOKEN            MemoryPartNumber;
182   EFI_INTER_LINK_DATA         MemoryArrayLink;
183   EFI_INTER_LINK_DATA         MemorySubArrayLink;
184   UINT16                      MemoryTotalWidth;
185   UINT16                      MemoryDataWidth;
186   UINT64                      MemoryDeviceSize;
187   EFI_MEMORY_FORM_FACTOR      MemoryFormFactor;
188   UINT8                       MemoryDeviceSet;
189   EFI_MEMORY_ARRAY_TYPE       MemoryType;
190   EFI_MEMORY_TYPE_DETAIL      MemoryTypeDetail;
191   UINT16                      MemorySpeed;
192   EFI_MEMORY_STATE            MemoryState;
193   UINT8                       MemoryAttributes;
194   UINT8                       MemoryBankConnections;
195   UINT8                       MemoryErrorStatus;
196 } EFI_MEMORY_ARRAY_LINK;
197 
198 
199 #define EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER  0x00000004
200 
201 typedef struct {
202   EFI_PHYSICAL_ADDRESS        MemoryArrayStartAddress;
203   EFI_PHYSICAL_ADDRESS        MemoryArrayEndAddress;
204   EFI_INTER_LINK_DATA         PhysicalMemoryArrayLink;
205   UINT16                      MemoryArrayPartitionWidth;
206 } EFI_MEMORY_ARRAY_START_ADDRESS;
207 
208 
209 #define EFI_MEMORY_DEVICE_START_ADDRESS_RECORD_NUMBER 0x00000005
210 
211 typedef struct {
212   EFI_PHYSICAL_ADDRESS        MemoryDeviceStartAddress;
213   EFI_PHYSICAL_ADDRESS        MemoryDeviceEndAddress;
214   EFI_INTER_LINK_DATA         PhysicalMemoryDeviceLink;
215   EFI_INTER_LINK_DATA         PhysicalMemoryArrayLink;
216   UINT8                       MemoryDevicePartitionRowPosition;
217   UINT8                       MemoryDeviceInterleavePosition;
218   UINT8                       MemoryDeviceInterleaveDataDepth;
219 } EFI_MEMORY_DEVICE_START_ADDRESS;
220 
221 
222 //
223 //  Memory. Channel Device Type -  SMBIOS Type 37
224 //
225 
226 #define EFI_MEMORY_CHANNEL_TYPE_RECORD_NUMBER         0x00000006
227 
228 typedef enum _EFI_MEMORY_CHANNEL_TYPE {
229   EfiMemoryChannelTypeOther                   = 1,
230   EfiMemoryChannelTypeUnknown                 = 2,
231   EfiMemoryChannelTypeRambus                  = 3,
232   EfiMemoryChannelTypeSyncLink                = 4
233 } EFI_MEMORY_CHANNEL_TYPE;
234 
235 typedef struct {
236   EFI_MEMORY_CHANNEL_TYPE     MemoryChannelType;
237   UINT8                       MemoryChannelMaximumLoad;
238   UINT8                       MemoryChannelDeviceCount;
239 } EFI_MEMORY_CHANNEL_TYPE_DATA;
240 
241 #define EFI_MEMORY_CHANNEL_DEVICE_RECORD_NUMBER       0x00000007
242 
243 typedef struct {
244   UINT8                       DeviceId;
245   EFI_INTER_LINK_DATA         DeviceLink;
246   UINT8                       MemoryChannelDeviceLoad;
247 } EFI_MEMORY_CHANNEL_DEVICE_DATA;
248 
249 //
250 //  Memory. Controller Information - SMBIOS Type 5
251 //
252 #define EFI_MEMORY_CONTROLLER_INFORMATION_RECORD_NUMBER 0x00000008
253 
254 typedef enum {
255   EfiErrorDetectingMethodOther   = 1,
256   EfiErrorDetectingMethodUnknown = 2,
257   EfiErrorDetectingMethodNone    = 3,
258   EfiErrorDetectingMethodParity  = 4,
259   EfiErrorDetectingMethod32Ecc   = 5,
260   EfiErrorDetectingMethod64Ecc   = 6,
261   EfiErrorDetectingMethod128Ecc  = 7,
262   EfiErrorDetectingMethodCrc     = 8
263 } EFI_MEMORY_ERROR_DETECT_METHOD_TYPE;
264 
265 typedef struct {
266   UINT8  Other                 :1;
267   UINT8  Unknown               :1;
268   UINT8  None                  :1;
269   UINT8  SingleBitErrorCorrect :1;
270   UINT8  DoubleBitErrorCorrect :1;
271   UINT8  ErrorScrubbing        :1;
272   UINT8  Reserved              :2;
273 } EFI_MEMORY_ERROR_CORRECT_CAPABILITY;
274 
275 typedef enum {
276   EfiMemoryInterleaveOther      = 1,
277   EfiMemoryInterleaveUnknown    = 2,
278   EfiMemoryInterleaveOneWay     = 3,
279   EfiMemoryInterleaveTwoWay     = 4,
280   EfiMemoryInterleaveFourWay    = 5,
281   EfiMemoryInterleaveEightWay   = 6,
282   EfiMemoryInterleaveSixteenWay = 7
283 } EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE;
284 
285 typedef struct {
286   UINT16  Other                 :1;
287   UINT16  Unknown               :1;
288   UINT16  SeventyNs             :1;
289   UINT16  SixtyNs               :1;
290   UINT16  FiftyNs               :1;
291   UINT16  Reserved              :11;
292 } EFI_MEMORY_SPEED_TYPE;
293 
294 typedef struct {
295   UINT16  Other                 :1;
296   UINT16  Unknown               :1;
297   UINT16  Standard              :1;
298   UINT16  FastPageMode          :1;
299   UINT16  EDO                   :1;
300   UINT16  Parity                :1;
301   UINT16  ECC                   :1;
302   UINT16  SIMM                  :1;
303   UINT16  DIMM                  :1;
304   UINT16  BurstEdo              :1;
305   UINT16  SDRAM                 :1;
306   UINT16  Reserved              :5;
307 } EFI_MEMORY_SUPPORTED_TYPE;
308 
309 typedef struct {
310   UINT8  Five                  :1;
311   UINT8  Three                 :1;
312   UINT8  Two                   :1;
313   UINT8  Reserved              :5;
314 } EFI_MEMORY_MODULE_VOLTAGE_TYPE;
315 
316 //
317 //  EFI_MEMORY_CONTROLLER_INFORMATION is obsolete
318 //  Use EFI_MEMORY_CONTROLLER_INFORMATION_DATA instead
319 //
320 typedef struct {
321   EFI_MEMORY_ERROR_DETECT_METHOD_TYPE   ErrorDetectingMethod;
322   EFI_MEMORY_ERROR_CORRECT_CAPABILITY   ErrorCorrectingCapability;
323   EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE    MemorySupportedInterleave;
324   EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE    MemoryCurrentInterleave;
325   UINT8                                 MaxMemoryModuleSize;
326   EFI_MEMORY_SPEED_TYPE                 MemorySpeedType;
327   EFI_MEMORY_SUPPORTED_TYPE             MemorySupportedType;
328   EFI_MEMORY_MODULE_VOLTAGE_TYPE        MemoryModuleVoltage;
329   UINT8                                 NumberofMemorySlot;
330   EFI_MEMORY_ERROR_CORRECT_CAPABILITY   EnabledCorrectingCapability;
331   UINT16                                *MemoryModuleConfigHandles;
332 } EFI_MEMORY_CONTROLLER_INFORMATION;
333 
334 typedef struct {
335   EFI_MEMORY_ERROR_DETECT_METHOD_TYPE   ErrorDetectingMethod;
336   EFI_MEMORY_ERROR_CORRECT_CAPABILITY   ErrorCorrectingCapability;
337   EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE    MemorySupportedInterleave;
338   EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE    MemoryCurrentInterleave;
339   UINT8                                 MaxMemoryModuleSize;
340   EFI_MEMORY_SPEED_TYPE                 MemorySpeedType;
341   EFI_MEMORY_SUPPORTED_TYPE             MemorySupportedType;
342   EFI_MEMORY_MODULE_VOLTAGE_TYPE        MemoryModuleVoltage;
343   UINT8                                 NumberofMemorySlot;
344   EFI_MEMORY_ERROR_CORRECT_CAPABILITY   EnabledCorrectingCapability;
345   EFI_INTER_LINK_DATA                   MemoryModuleConfig[1];
346 } EFI_MEMORY_CONTROLLER_INFORMATION_DATA;
347 
348 //
349 //  Memory. Error Information - SMBIOS Type 18
350 //
351 #define EFI_MEMORY_32BIT_ERROR_INFORMATION_RECORD_NUMBER 0x00000009
352 
353 typedef enum {
354   EfiMemoryErrorOther             = 1,
355   EfiMemoryErrorUnknown           = 2,
356   EfiMemoryErrorOk                = 3,
357   EfiMemoryErrorBadRead           = 4,
358   EfiMemoryErrorParity            = 5,
359   EfiMemoryErrorSigleBit          = 6,
360   EfiMemoryErrorDoubleBit         = 7,
361   EfiMemoryErrorMultiBit          = 8,
362   EfiMemoryErrorNibble            = 9,
363   EfiMemoryErrorChecksum          = 10,
364   EfiMemoryErrorCrc               = 11,
365   EfiMemoryErrorCorrectSingleBit  = 12,
366   EfiMemoryErrorCorrected         = 13,
367   EfiMemoryErrorUnCorrectable     = 14
368 } EFI_MEMORY_ERROR_TYPE;
369 
370 typedef enum {
371   EfiMemoryGranularityOther               = 1,
372   EfiMemoryGranularityOtherUnknown        = 2,
373   EfiMemoryGranularityDeviceLevel         = 3,
374   EfiMemoryGranularityMemPartitionLevel   = 4
375 } EFI_MEMORY_ERROR_GRANULARITY_TYPE;
376 
377 typedef enum {
378   EfiMemoryErrorOperationOther            = 1,
379   EfiMemoryErrorOperationUnknown          = 2,
380   EfiMemoryErrorOperationRead             = 3,
381   EfiMemoryErrorOperationWrite            = 4,
382   EfiMemoryErrorOperationPartialWrite     = 5
383 } EFI_MEMORY_ERROR_OPERATION_TYPE;
384 
385 typedef struct {
386   EFI_MEMORY_ERROR_TYPE               MemoryErrorType;
387   EFI_MEMORY_ERROR_GRANULARITY_TYPE   MemoryErrorGranularity;
388   EFI_MEMORY_ERROR_OPERATION_TYPE     MemoryErrorOperation;
389   UINT32                              VendorSyndrome;
390   UINT32                              MemoryArrayErrorAddress;
391   UINT32                              DeviceErrorAddress;
392   UINT32                              DeviceErrorResolution;
393 } EFI_MEMORY_32BIT_ERROR_INFORMATION;
394 
395 //
396 //  Memory. Error Information - SMBIOS Type 33
397 //
398 #define EFI_MEMORY_64BIT_ERROR_INFORMATION_RECORD_NUMBER 0x0000000A
399 
400 typedef struct {
401   EFI_MEMORY_ERROR_TYPE               MemoryErrorType;
402   EFI_MEMORY_ERROR_GRANULARITY_TYPE   MemoryErrorGranularity;
403   EFI_MEMORY_ERROR_OPERATION_TYPE     MemoryErrorOperation;
404   UINT32                              VendorSyndrome;
405   UINT64                              MemoryArrayErrorAddress;
406   UINT64                              DeviceErrorAddress;
407   UINT32                              DeviceErrorResolution;
408 } EFI_MEMORY_64BIT_ERROR_INFORMATION;
409 
410 
411 typedef union _EFI_MEMORY_SUBCLASS_RECORDS {
412   EFI_MEMORY_SIZE_DATA                  SizeData;
413   EFI_MEMORY_ARRAY_LOCATION_DATA        ArrayLocationData;
414   EFI_MEMORY_ARRAY_LINK                 ArrayLink;
415   EFI_MEMORY_ARRAY_START_ADDRESS        ArrayStartAddress;
416   EFI_MEMORY_DEVICE_START_ADDRESS       DeviceStartAddress;
417   EFI_MEMORY_CHANNEL_TYPE_DATA          ChannelTypeData;
418   EFI_MEMORY_CHANNEL_DEVICE_DATA        ChannelDeviceData;
419   EFI_MEMORY_CONTROLLER_INFORMATION     MemoryControllerInfo;
420   EFI_MEMORY_32BIT_ERROR_INFORMATION    Memory32bitErrorInfo;
421   EFI_MEMORY_64BIT_ERROR_INFORMATION    Memory64bitErrorInfo;
422 } EFI_MEMORY_SUBCLASS_RECORDS;
423 
424 typedef struct {
425   EFI_SUBCLASS_TYPE1_HEADER             Header;
426   EFI_MEMORY_SUBCLASS_RECORDS           Record;
427 } EFI_MEMORY_SUBCLASS_DRIVER_DATA;
428 
429 
430 
431 #endif
432