hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/** @file
  SysHost.h
 
  @copyright
  Copyright 2006 - 2021 Intel Corporation. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _SYS_HOST_H_
#define _SYS_HOST_H_
 
#include "SysHostChipCommon.h"
 
 
 
#define MAX_LINE 256
 
#define RC_SIM_FASTCADB 0
 
 
 
typedef struct sysHost SYSHOST, *PSYSHOST;
 
#include "DataTypes.h"
#include "SysHostChipCommon.h"
#include "PlatformHost.h"
#include "MemHost.h"
#include <Ppi/MemoryPolicyPpi.h>
 
///
/// Enhanced Warning Log Header
///
typedef struct {
  EFI_GUID  EwlGuid;      /// GUID that uniquely identifies the EWL revision
  UINT32    Size;         /// Total size in bytes including the header and buffer
  UINT32    FreeOffset;   /// Offset of the beginning of the free space from byte 0
                          /// of the buffer immediately following this structure
                          /// Can be used to determine if buffer has sufficient space for next entry
  UINT32    Crc;          /// 32-bit CRC generated over the whole size minus this crc field
                          /// Note: UEFI 32-bit CRC implementation (CalculateCrc32) (References [7])
                          /// Consumers can ignore CRC check if not needed.
  UINT32    Reserved;     /// Reserved for future use, must be initialized to 0
} EWL_HEADER;
 
///
/// Enhanced Warning Log Spec defined data log structure
///
typedef struct {
  EWL_HEADER Header;          /// The size will vary by implementation and should not be assumed
  UINT8      Buffer[4 * 1024];  /// The spec requirement is that the buffer follow the header
} EWL_PUBLIC_DATA;
 
///
/// EWL private data structure.  This is going to be implementation dependent
///   When we separate OEM hooks via a PPI, we can remove this
///
typedef struct {
  UINT32            bufSizeOverflow;  // Number of bytes that could not be added to buffer
  UINT32            numEntries;       // Number of entries currently logged
  EWL_PUBLIC_DATA   status;           // Spec defined EWL
} EWL_PRIVATE_DATA;
 
#pragma pack(1)
 
///
/// System NVRAM structure
//
struct sysNvram {
  struct memNvram     mem;
  struct commonNvram  common;
}; //struct sysNvram
 
#pragma pack()
 
//
// -----------------------------------------------------------------------------
// Variable structures
//
 
typedef struct CpuidRegisterInfo {
  UINT32 Eax;
  UINT32 Ebx;
  UINT32 Ecx;
  UINT32 Edx;
} CPUID_REGISTER_INFO;
 
typedef struct processorCommon {
  UINT32  capid0;
  UINT32  capid1;
  UINT32  capid2;
  UINT32  capid3;
  UINT32  capid4;
  UINT32  capid5;
  UINT32  capid6lo;
  UINT32  capid6hi;
  CPUID_REGISTER_INFO  ExtCpuid7;
  CPUID_REGISTER_INFO  ExtCpuid1B;
} PROCESSOR_COMMON;
 
///
/// Common variable structure
///
struct commonVar {
  RC_VERSION                RcVersion;              ///< Version of the reference code last executed
  UINT32                    rcStatus;               ///< Non-zero indicates fatal error
  UINT8                     chopType[MAX_SOCKET];   ///< HCC, MCC, LCC, MCC-DE, LCC-DE (HSX family only)
  UINT8                     sbsp;                   ///< Non-zero value indicates that the socket is System BSP
  UINT16                    pmBase;                 ///< Power Management Base Address
  UINT32                    tohmLimit;
  UINT32                    JumpBuffer;
 
#ifdef COMPRESS_RC
  UINT32                    rcSrc;                  ///< Decompression source code pointer
  UINT32                    rcDest;                 ///< Decompression destination pointer
  UINT32                    rcDecompressSourceAddr; ///< Decompression routine address of type func(UINT8*Src, UINT8*Dest);
#endif  // #ifdef COMPRESS_RC
 
  UINT32                    heapBase;
  UINT32                    heapSize;
 
  UINT32                    oemVariable;
  EWL_PRIVATE_DATA          ewlPrivateData;         // implementation data for EWL
  struct processorCommon    procCom[MAX_SOCKET];
  UINT32                    MicroCodeRev;
 
#define MAX_PROMOTE_WARN_LIMIT  90
  UINT32                    promoteWarnLimit;
  UINT16                    promoteWarnList[MAX_PROMOTE_WARN_LIMIT];
  UINT32                    printfDepth;            ///< handle nested calls to get/releasePrintFControl
  UINT32                    meRequestedSize;         /// Size of the memory range requested by ME FW, in MB
  UINT32                    ieRequestedSize;         /// Size of the memory range requested by IE FW, in MB
};  //struct commonVar
 
///
/// System Variable structure
///
struct sysVar {
  struct memVar     mem;
  struct commonVar  common;
};  //struct sysVar
 
// Bit definitions for commonSetup.options
//                   ; PROMOTE_WARN_EN enables warnings to be treated as fatal error
//                   ; PROMOTE_MRC_WARN_EN enables MRC warnings to be treated as fatal error
//                   ; HALT_ON_ERROR_EN enables errors to loop forever
//                   ; HALT_ON_ERROR_AUTO auto reset with Maximum Serial port debug message level when fatal error is encountered.
#define PROMOTE_WARN_EN           BIT0
#define PROMOTE_MRC_WARN_EN       BIT1
#define HALT_ON_ERROR_EN          BIT2
#define HALT_ON_ERROR_AUTO        BIT3
 
typedef union _RMT_FLAGS {
  UINT8   Data;
  struct {
    UINT8   EnableShortFormat         :1;
    UINT8   SkipPerBitMargin          :1;
    UINT8   SkipDisplayPerBitEyes     :1;
    UINT8   SkipDisplayPerBitMargins  :1;
    UINT8   SkipRmtRxDqs              :1;
    UINT8   SkipRmtRxVref             :1;
    UINT8   SkipRmtTxDq               :1;
    UINT8   SkipRmtTxVref             :1;
  } Bits;
} RMT_FLAGS;
 
///
/// System Host (root structure)
///
struct sysHost {
  struct sysVar         var;    ///< variable, volatile data
  struct sysNvram       nvram;  ///< variable, non-volatile data for S3 and fast path
  UINT8   ChannelModeOperation;
  UINT32  cpuFlows; ///< Which flows to take
  UINT32  ktiFlows;
  UINT32  qpiFlows;
  UINT32  opioFlows;
  UINT32  memFlows;
  UINT32  memFlowsExt;
  UINT32  memFlowsExt2;
  UINT32  memFlowsExt3;
 
 
  UINT32  MrcHooksServicesPpi;
  UINT32  MrcHooksChipServicesPpi;
 
  BOOLEAN PrintCsr;                               // Enable / disable printing CSR
  BOOLEAN MtrrCheck;                              // Check number of used MTRR's
  INT32   DdrioUltSupport;
  RMT_FLAGS               RmtFlags;
};
 
#endif // #ifndef _SYS_HOST_H_