Kabylake Intel(R) Firmware Support Package (FSP) Integration Guide: MemInfoHob.h Source File

Kabylake Intel Firmware

Kabylake Intel(R) Firmware Support Package (FSP) Integration Guide
MemInfoHob.h
Go to the documentation of this file.
1 /** @file
2  This file contains definitions required for creation of
3  Memory S3 Save data, Memory Info data and Memory Platform
4  data hobs.
5 
6  @copyright
7  INTEL CONFIDENTIAL
8  Copyright 1999 - 2018 Intel Corporation.
9 
10  The source code contained or described herein and all documents related to the
11  source code ("Material") are owned by Intel Corporation or its suppliers or
12  licensors. Title to the Material remains with Intel Corporation or its suppliers
13  and licensors. The Material may contain trade secrets and proprietary and
14  confidential information of Intel Corporation and its suppliers and licensors,
15  and is protected by worldwide copyright and trade secret laws and treaty
16  provisions. No part of the Material may be used, copied, reproduced, modified,
17  published, uploaded, posted, transmitted, distributed, or disclosed in any way
18  without Intel's prior express written permission.
19 
20  No license under any patent, copyright, trade secret or other intellectual
21  property right is granted to or conferred upon you by disclosure or delivery
22  of the Materials, either expressly, by implication, inducement, estoppel or
23  otherwise. Any license under such intellectual property rights must be
24  express and approved by Intel in writing.
25 
26  Unless otherwise agreed by Intel in writing, you may not remove or alter
27  this notice or any other notice embedded in Materials by Intel or
28  Intel's suppliers or licensors in any way.
29 
30  This file contains an 'Intel Peripheral Driver' and is uniquely identified as
31  "Intel Reference Module" and is licensed for Intel CPUs and chipsets under
32  the terms of your license agreement with Intel or your vendor. This file may
33  be modified by the user, subject to additional terms of the license agreement.
34 
35 @par Specification Reference:
36 **/
37 #ifndef _MEM_INFO_HOB_H_
38 #define _MEM_INFO_HOB_H_
39 
40 #pragma pack (push, 1)
41 
42 extern EFI_GUID gSiMemoryS3DataGuid;
43 extern EFI_GUID gSiMemoryInfoDataGuid;
44 extern EFI_GUID gSiMemoryPlatformDataGuid;
45 
46 #define MAX_NODE 1
47 #define MAX_CH 2
48 #define MAX_DIMM 2
49 
50 ///
51 /// Host reset states from MRC.
52 ///
53 #define WARM_BOOT 2
54 
55 #define R_MC_CHNL_RANK_PRESENT 0x7C
56 #define B_RANK0_PRS BIT0
57 #define B_RANK1_PRS BIT1
58 #define B_RANK2_PRS BIT4
59 #define B_RANK3_PRS BIT5
60 
61 // @todo remove and use the MdePkg\Include\Pi\PiHob.h
62 #if !defined(_PEI_HOB_H_) && !defined(__PI_HOB_H__)
63 #ifndef __HOB__H__
64 typedef struct _EFI_HOB_GENERIC_HEADER {
65  UINT16 HobType;
66  UINT16 HobLength;
67  UINT32 Reserved;
68 } EFI_HOB_GENERIC_HEADER;
69 
70 typedef struct _EFI_HOB_GUID_TYPE {
71  EFI_HOB_GENERIC_HEADER Header;
72  EFI_GUID Name;
73  ///
74  /// Guid specific data goes here
75  ///
76 } EFI_HOB_GUID_TYPE;
77 #endif
78 #endif
79 
80 ///
81 /// Defines taken from MRC so avoid having to include MrcInterface.h
82 ///
83 
84 //
85 // Matches MAX_SPD_SAVE define in MRC
86 //
87 #ifndef MAX_SPD_SAVE
88 #define MAX_SPD_SAVE 29
89 #endif
90 
91 //
92 // MRC version description.
93 //
94 typedef struct {
95  UINT8 Major; ///< Major version number
96  UINT8 Minor; ///< Minor version number
97  UINT8 Rev; ///< Revision number
98  UINT8 Build; ///< Build number
99 } SiMrcVersion;
100 
101 //
102 // Matches MrcDimmSts enum in MRC
103 //
104 #ifndef DIMM_ENABLED
105 #define DIMM_ENABLED 0 // DIMM/rank Pair is enabled, presence will be detected.
106 #endif
107 #ifndef DIMM_DISABLED
108 #define DIMM_DISABLED 1 // DIMM/rank Pair is disabled, regardless of presence.
109 #endif
110 #ifndef DIMM_PRESENT
111 #define DIMM_PRESENT 2 // There is a DIMM present in the slot/rank pair and it will be used.
112 #endif
113 #ifndef DIMM_NOT_PRESENT
114 #define DIMM_NOT_PRESENT 3 // There is no DIMM present in the slot/rank pair.
115 #endif
116 
117 //
118 // Matches MrcBootMode enum in MRC
119 //
120 #ifndef bmCold
121 #define bmCold 0 // Cold boot
122 #endif
123 #ifndef bmWarm
124 #define bmWarm 1 // Warm boot
125 #endif
126 #ifndef bmS3
127 #define bmS3 2 // S3 resume
128 #endif
129 #ifndef bmFast
130 #define bmFast 3 // Fast boot
131 #endif
132 
133 //
134 // Matches MrcDdrType enum in MRC
135 //
136 #ifndef MRC_DDR_TYPE_DDR4
137 #define MRC_DDR_TYPE_DDR4 0
138 #endif
139 #ifndef MRC_DDR_TYPE_DDR3
140 #define MRC_DDR_TYPE_DDR3 1
141 #endif
142 #ifndef MRC_DDR_TYPE_LPDDR3
143 #define MRC_DDR_TYPE_LPDDR3 2
144 #endif
145 #ifndef MRC_DDR_TYPE_UNKNOWN
146 #define MRC_DDR_TYPE_UNKNOWN 3
147 #endif
148 
149 #define MAX_PROFILE_NUM 4 // number of memory profiles supported
150 #define MAX_XMP_PROFILE_NUM 2 // number of XMP profiles supported
151 
152 //
153 // DIMM timings
154 //
155 typedef struct {
156  UINT32 tCK; ///< Memory cycle time, in femtoseconds.
157  UINT16 NMode; ///< Number of tCK cycles for the channel DIMM's command rate mode.
158  UINT16 tCL; ///< Number of tCK cycles for the channel DIMM's CAS latency.
159  UINT16 tCWL; ///< Number of tCK cycles for the channel DIMM's minimum CAS write latency time.
160  UINT16 tFAW; ///< Number of tCK cycles for the channel DIMM's minimum four activate window delay time.
161  UINT16 tRAS; ///< Number of tCK cycles for the channel DIMM's minimum active to precharge delay time.
162  UINT16 tRCDtRP; ///< Number of tCK cycles for the channel DIMM's minimum RAS# to CAS# delay time and Row Precharge delay time.
163  UINT16 tREFI; ///< Number of tCK cycles for the channel DIMM's minimum Average Periodic Refresh Interval.
164  UINT16 tRFC; ///< Number of tCK cycles for the channel DIMM's minimum refresh recovery delay time.
165  UINT16 tRFC2; ///< Number of tCK cycles for the channel DIMM's minimum refresh recovery delay time.
166  UINT16 tRFC4; ///< Number of tCK cycles for the channel DIMM's minimum refresh recovery delay time.
167  UINT16 tRPab; ///< Number of tCK cycles for the channel DIMM's minimum row precharge delay time for all banks.
168  UINT16 tRRD; ///< Number of tCK cycles for the channel DIMM's minimum row active to row active delay time.
169  UINT16 tRRD_L; ///< Number of tCK cycles for the channel DIMM's minimum row active to row active delay time for same bank groups.
170  UINT16 tRRD_S; ///< Number of tCK cycles for the channel DIMM's minimum row active to row active delay time for different bank groups.
171  UINT16 tRTP; ///< Number of tCK cycles for the channel DIMM's minimum internal read to precharge command delay time.
172  UINT16 tWR; ///< Number of tCK cycles for the channel DIMM's minimum write recovery time.
173  UINT16 tWTR; ///< Number of tCK cycles for the channel DIMM's minimum internal write to read command delay time.
174  UINT16 tWTR_L; ///< Number of tCK cycles for the channel DIMM's minimum internal write to read command delay time for same bank groups.
175  UINT16 tWTR_S; ///< Number of tCK cycles for the channel DIMM's minimum internal write to read command delay time for different bank groups.
176 } MRC_CH_TIMING;
177 
178 typedef struct {
179  UINT8 SG; ///< Number of tCK cycles between transactions in the same bank group.
180  UINT8 DG; ///< Number of tCK cycles between transactions when switching bank groups.
181  UINT8 DR; ///< Number of tCK cycles between transactions when switching between Ranks (in the same DIMM).
182  UINT8 DD; ///< Number of tCK cycles between transactions when switching between DIMMs.
183 } MRC_TA_TIMING;
184 
185 ///
186 /// Memory SMBIOS & OC Memory Data Hob
187 ///
188 typedef struct {
189  UINT8 Status; ///< See MrcDimmStatus for the definition of this field.
190  UINT8 DimmId;
191  UINT32 DimmCapacity; ///< DIMM size in MBytes.
192  UINT16 MfgId;
193  UINT8 ModulePartNum[20]; ///< Module part number for DDR3 is 18 bytes however for DRR4 20 bytes as per JEDEC Spec, so reserving 20 bytes
194  UINT8 RankInDimm; ///< The number of ranks in this DIMM.
195  UINT8 SpdDramDeviceType; ///< Save SPD DramDeviceType information needed for SMBIOS structure creation.
196  UINT8 SpdModuleType; ///< Save SPD ModuleType information needed for SMBIOS structure creation.
197  UINT8 SpdModuleMemoryBusWidth; ///< Save SPD ModuleMemoryBusWidth information needed for SMBIOS structure creation.
198  UINT8 SpdSave[MAX_SPD_SAVE]; ///< Save SPD Manufacturing information needed for SMBIOS structure creation.
199 } DIMM_INFO;
200 
201 typedef struct {
202  UINT8 Status; ///< Indicates whether this channel should be used.
203  UINT8 ChannelId;
204  UINT8 DimmCount; ///< Number of valid DIMMs that exist in the channel.
205  MRC_CH_TIMING Timing[MAX_PROFILE_NUM]; ///< The channel timing values.
206  DIMM_INFO DimmInfo[MAX_DIMM]; ///< Save the DIMM output characteristics.
207  MRC_TA_TIMING tRd2Rd; ///< Read-to-Read Turn Around Timings
208  MRC_TA_TIMING tRd2Wr; ///< Read-to-Write Turn Around Timings
209  MRC_TA_TIMING tWr2Rd; ///< Write-to-Read Turn Around Timings
210  MRC_TA_TIMING tWr2Wr; ///< Write-to-Write Turn Around Timings
211 } CHANNEL_INFO;
212 
213 typedef struct {
214  UINT8 Status; ///< Indicates whether this controller should be used.
215  UINT16 DeviceId; ///< The PCI device id of this memory controller.
216  UINT8 RevisionId; ///< The PCI revision id of this memory controller.
217  UINT8 ChannelCount; ///< Number of valid channels that exist on the controller.
218  CHANNEL_INFO ChannelInfo[MAX_CH]; ///< The following are channel level definitions.
219  MRC_TA_TIMING tRd2Rd; ///< Deprecated and moved to CHANNEL_INFO. Read-to-Read Turn Around Timings
220  MRC_TA_TIMING tRd2Wr; ///< Deprecated and moved to CHANNEL_INFO. Read-to-Write Turn Around Timings
221  MRC_TA_TIMING tWr2Rd; ///< Deprecated and moved to CHANNEL_INFO. Write-to-Read Turn Around Timings
222  MRC_TA_TIMING tWr2Wr; ///< Deprecated and moved to CHANNEL_INFO. Write-to-Write Turn Around Timings
223 } CONTROLLER_INFO;
224 
225 typedef struct {
226  UINT8 Revision;
227  UINT16 DataWidth; ///< Data width, in bits, of this memory device
228  /** As defined in SMBIOS 3.0 spec
229  Section 7.18.2 and Table 75
230  **/
231  UINT8 MemoryType; ///< DDR type: DDR3, DDR4, or LPDDR3
232  UINT16 MaximumMemoryClockSpeed;///< The maximum capable speed of the device, in megahertz (MHz)
233  UINT16 ConfiguredMemoryClockSpeed; ///< The configured clock speed to the memory device, in megahertz (MHz)
234  /** As defined in SMBIOS 3.0 spec
235  Section 7.17.3 and Table 72
236  **/
237  UINT8 ErrorCorrectionType;
238 
239  SiMrcVersion Version;
240  BOOLEAN EccSupport;
241  UINT8 MemoryProfile;
242  UINT32 TotalPhysicalMemorySize;
243  UINT32 DefaultXmptCK[MAX_XMP_PROFILE_NUM];///< Stores the tCK value read from SPD XMP profiles if they exist.
244  UINT8 XmpProfileEnable; ///< If XMP capable DIMMs are detected, this will indicate which XMP Profiles are common among all DIMMs.
245  UINT8 Ratio;
246  UINT8 RefClk;
247  UINT32 VddVoltage[MAX_PROFILE_NUM];
248  CONTROLLER_INFO Controller[MAX_NODE];
249 } MEMORY_INFO_DATA_HOB;
250 
251 /**
252  Memory Platform Data Hob
253 
254  <b>Revision 1:</b>
255  - Initial version.
256  <b>Revision 2:</b>
257  - Added TsegBase, PrmrrSize, PrmrrBase, Gttbase, MmioSize, PciEBaseAddress fields
258 **/
259 typedef struct {
260  UINT8 Revision;
261  UINT8 Reserved[3];
262  UINT32 BootMode;
263  UINT32 TsegSize;
264  UINT32 TsegBase;
265  UINT32 PrmrrSize;
266  UINT32 PrmrrBase;
267  UINT32 GttBase;
268  UINT32 MmioSize;
269  UINT32 PciEBaseAddress;
271 
272 typedef struct {
273  EFI_HOB_GUID_TYPE EfiHobGuidType;
275  UINT8 *Buffer;
276 } MEMORY_PLATFORM_DATA_HOB;
277 
278 #pragma pack (pop)
279 
280 #endif // _MEM_INFO_HOB_H_
UINT8 Status
See MrcDimmStatus for the definition of this field.
Definition: MemInfoHob.h:189
UINT8 SpdDramDeviceType
Save SPD DramDeviceType information needed for SMBIOS structure creation.
Definition: MemInfoHob.h:195
UINT8 SpdModuleMemoryBusWidth
Save SPD ModuleMemoryBusWidth information needed for SMBIOS structure creation.
Definition: MemInfoHob.h:197
UINT32 DimmCapacity
DIMM size in MBytes.
Definition: MemInfoHob.h:191
Memory SMBIOS & OC Memory Data Hob.
Definition: MemInfoHob.h:188
Memory Platform Data Hob.
Definition: MemInfoHob.h:259
UINT8 SpdModuleType
Save SPD ModuleType information needed for SMBIOS structure creation.
Definition: MemInfoHob.h:196
#define MAX_SPD_SAVE
Defines taken from MRC so avoid having to include MrcInterface.h.
Definition: MemInfoHob.h:88
UINT8 RankInDimm
The number of ranks in this DIMM.
Definition: MemInfoHob.h:194
Generated on Thu Jun 28 2018 21:44:49 for Kabylake Intel(R) Firmware Support Package (FSP) Integration Guide by   doxygen 1.8.10