summaryrefslogtreecommitdiff
path: root/ReferenceCode/Chipset/SystemAgent/SaInit/Pei/SaInitPeim.h
blob: 2f3263c020ad865a4b5863cc130a6e7f37695487 (plain)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/** @file
  Header file for the SA Init PEIM

@copyright
  Copyright (c) 1999 - 2012 Intel Corporation. All rights reserved
  This software and associated documentation (if any) is furnished
  under a license and may only be used or copied in accordance
  with the terms of the license. Except as permitted by such
  license, no part of this software or documentation may be
  reproduced, stored in a retrieval system, or transmitted in any
  form or by any means without the express written consent of
  Intel Corporation.

  This file contains an 'Intel Peripheral Driver' and uniquely
  identified as "Intel Reference Module" and is
  licensed for Intel CPUs and chipsets under the terms of your
  license agreement with Intel or your vendor.  This file may
  be modified by the user, subject to additional terms of the
  license agreement
**/
#ifndef _SA_INIT_PEIM_H_
#define _SA_INIT_PEIM_H_

///
/// External include files do NOT need to be explicitly specified in real EDKII
/// environment
///
#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000)
#include "EdkIIGluePeim.h"
#include "SaAccess.h"
#include "MemInfoHob.h"
#include "CpuRegs.h"
#include "CpuPlatformLib.h"
#include "SaOcInit.h"

#include EFI_PPI_DEPENDENCY  (SaPlatformPolicy)
#include EFI_PPI_DEPENDENCY  (CpuPlatformPolicy)
#include EFI_PPI_PRODUCER    (SaPeiInit)
#include EFI_GUID_DEFINITION (SaDataHob)
#endif
///
/// Data definitions & structures
///

EFI_GUID  gMemoryInitHobGuid = EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID;

///
/// Functions
///
EFI_STATUS
EFIAPI
SaInitPeiEntryPoint (
  IN EFI_FFS_FILE_HEADER       *FfsHeader,
  IN EFI_PEI_SERVICES          **PeiServices
  )
/**
  SA PEI Initialization.

  @param[in] FfsHeader    - Pointer to Firmware File System file header.
  @param[in] PeiServices  - General purpose services available to every PEIM.

  @retval EFI_SUCCESS
**/
;

VOID
ProgramSaBars (
  IN    SA_PLATFORM_POLICY_PPI    *SaPlatformPolicyPpi
  )
/**
  Programs Sa Bars

  @param[in] SaPlatformPolicyPpi  - Instance of SA_PLATFORM_POLICY_PPI
**/
;

VOID
SwitchableGraphicsInit (
  IN EFI_PEI_SERVICES             **PeiServices,
  IN SA_PLATFORM_POLICY_PPI       *SaPlatformPolicyPpi
  )
/**
  SwitchableGraphicsInit: Initialize the Switchable Graphics if enabled

  @param[in] PeiServices          - Pointer to the PEI services table
  @param[in] SaPlatformPolicyPpi  - SaPlatformPolicyPpi to access the SgConfig related information
**/
;

VOID
EarlyBiosPostProgramming (
  IN    SA_PLATFORM_POLICY_PPI   *SaPlatformPolicyPpi
  )
/**
  Do Early BIOS POST Programming

  @param[in] SaPlatformPolicyPpi - Instance of SA_PLATFORM_POLICY_PPI
**/
;

VOID
GraphicsInit (
  IN EFI_PEI_SERVICES             **PeiServices,
  IN SA_PLATFORM_POLICY_PPI       *SaPlatformPolicyPpi
  )
/**
  GraphicsInit: Initialize the IGD if no other external graphics is present

  @param[in] PeiServices          - Pointer to the PEI services table
  @param[in] SaPlatformPolicyPpi  - SaPlatformPolicyPpi to access the GtConfig related information
**/
;

EFI_STATUS
SaDmiTcVcInit (
  IN EFI_PEI_SERVICES          **PeiServices,
  IN SA_PLATFORM_POLICY_PPI    *SaPlatformPolicyPpi
  )
/**
  Initialize DMI Tc/Vc mapping through SA-PCH.

  @param[in] PeiServices          - General purpose services available to every PEIM.
  @param[in] SaPlatformPolicyPpi  - SaPlatformPolicyPpi to access the GtConfig related information

  @retval EFI_SUCCESS
**/
;

#ifdef DMI_FLAG
EFI_STATUS
DmiInit (
  IN EFI_PEI_SERVICES          **PeiServices,
  IN SA_PLATFORM_POLICY_PPI    *SaPlatformPolicyPpi
  )
/**
  Initialize DMI.

  @param[in] PeiServices          - General purpose services available to every PEIM.
  @param[in] SaPlatformPolicyPpi  - SaPlatformPolicyPpi to access the GtConfig related information

  @retval EFI_SUCCESS
**/
;
#endif // DMI_FLAG

#ifdef PEG_FLAG
VOID
PciExpressInit (
  IN EFI_PEI_SERVICES          **PeiServices,
  IN SA_PLATFORM_POLICY_PPI    *SaPlatformPolicyPpi
  )
/**
  GraphicsInit: Initialize the IGD if no other external graphics is present

  @param[in] PeiServices          - Pointer to the PEI services table
  @param[in] SaPlatformPolicyPpi  - SaPlatformPolicyPpi to access the GtConfig related information
**/
;
#endif // PEG_FLAG

EFI_STATUS
InstallSaHob (
  IN EFI_PEI_SERVICES          **PeiServices,
  IN SA_PLATFORM_POLICY_PPI    *SaPlatformPolicyPpi
  )
/**
  Init and Install SA Hob

  @param[in] PeiServices  - General purpose services available to every PEIM.
  @param[in] SaPlatformPolicyPpi  - SaPlatformPolicyPpi to access the GtConfig related information

  @retval EFI_SUCCESS
**/
;

EFI_STATUS
ReportPcieVersion (
  IN    SA_PLATFORM_POLICY_PPI   *SaPlatformPolicyPpi
  )
/**
  Report the SA PCIe initialization code version.

  @param[in] SaPlatformPolicyPpi - Instance of SA_PLATFORM_POLICY_PPI

  @retval EFI_SUCCESS
**/
;

STATIC
EFI_STATUS
SaResetComplete (
  IN      EFI_PEI_SERVICES          **PeiServices,
  IN      EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
  IN      VOID                      *Ppi
  )
/**
  BIOS_CPL_BIT is set for processor to activate the power and thermal management
  features on the platform.

  @param[in] PeiServices   - Pointer to PEI Services Table.
  @param[in] NotifyDesc    - Pointer to the descriptor for the Notification event that
                  caused this function to execute.
  @param[in] Ppi           - Pointer to the PPI data associated with this function.

  @retval EFI_SUCCESS
**/
;

VOID
SaPeiPolicyDump (
  IN    SA_PLATFORM_POLICY_PPI   *SaPlatformPolicyPpi
  )
/**
  This function prints the PEI phase platform policy.

  @param[in] SaPlatformPolicyPpi - Instance of SA_PLATFORM_POLICY_PPI
**/
;

static
EFI_STATUS
SaS3ResumeAtEndOfPei (
  IN      EFI_PEI_SERVICES          **PeiServices,
  IN      EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
  IN      VOID                      *Ppi
  )
/**
  This function handles SA S3 resume task

  @param[in] PeiServices   - Pointer to PEI Services Table.
  @param[in] NotifyDesc    - Pointer to the descriptor for the Notification event that
                             caused this function to execute.
  @param[in] Ppi           - Pointer to the PPI data associated with this function.

  @retval EFI_STATUS       - Always return EFI_SUCCESS
**/
;

#ifdef RAPID_START_FLAG
static
EFI_STATUS
SaCheckRapidStartMode (
  IN      EFI_PEI_SERVICES          **PeiServices,
  IN      EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
  IN      VOID                      *Ppi
  )
/**
  This function will check Rapid Start mode and install SaS3Resume callback notify if it was Rapid Start Resume

  @param[in] PeiServices   - Pointer to PEI Services Table.
  @param[in] NotifyDesc    - Pointer to the descriptor for the Notification event that
                             caused this function to execute.
  @param[in] Ppi           - Pointer to the PPI data associated with this function.

  @retval EFI_STATUS       - Always return EFI_SUCCESS
**/
;
#endif // RAPID_START_FLAG

#endif