]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/PlatformPei/Platform.h
Vlv2TbltDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformPei / Platform.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9
10 **/
11
12
13 #ifndef __PEI_PLATFORM_H__
14 #define __PEI_PLATFORM_H__
15
16 #define PEI_STALL_RESOLUTION 1
17 #define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')
18
19 typedef struct {
20 UINT32 Signature;
21 EFI_FFS_FILE_HEADER *FfsHeader;
22 EFI_PEI_NOTIFY_DESCRIPTOR StallNotify;
23 } STALL_CALLBACK_STATE_INFORMATION;
24
25 #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)
26
27 #ifdef NOCS_S3_SUPPORT
28
29 /**
30 Peform the boot mode determination logic
31 If the box is closed, then
32 1. If it's first time to boot, it's boot with full config .
33 2. If the ChassisIntrution is selected, force to be a boot with full config
34 3. Otherwise it's boot with no change.
35
36 @param PeiServices General purpose services available to every PEIM.
37 @param BootMode The detected boot mode.
38
39 @retval EFI_SUCCESS if the boot mode could be set
40 **/
41 EFI_STATUS
42 UpdateBootMode (
43 IN CONST EFI_PEI_SERVICES **PeiServices
44 );
45 #endif
46
47 /**
48 This function reset the entire platform, including all processor and devices, and
49 reboots the system.
50
51 @param PeiServices General purpose services available to every PEIM.
52
53 @retval EFI_SUCCESS if it completed successfully.
54 **/
55 EFI_STATUS
56 EFIAPI
57 ResetSystem (
58 IN CONST EFI_PEI_SERVICES **PeiServices
59 );
60
61 /**
62 This function will be called when MRC is done.
63
64 @param PeiServices General purpose services available to every PEIM.
65 @param NotifyDescriptor Information about the notify event..
66 @param Ppi The notify context.
67
68 @retval EFI_SUCCESS If the function completed successfully.
69 **/
70 EFI_STATUS
71 EFIAPI
72 MemoryDiscoveredPpiNotifyCallback (
73 IN EFI_PEI_SERVICES **PeiServices,
74 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
75 IN VOID *Ppi
76 );
77
78 /**
79 This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load
80 the PEIM into memory.
81
82 @param PeiServices General purpose services available to every PEIM.
83 @param NotifyDescriptor The context of notification.
84 @param Ppi The notify PPI.
85
86 @retval EFI_SUCCESS if it completed successfully.
87 **/
88 EFI_STATUS
89 EFIAPI
90 FvFileLoaderPpiNotifyCallback (
91 IN EFI_PEI_SERVICES **PeiServices,
92 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
93 IN VOID *Ppi
94 );
95
96 /**
97 This function provides a blocking stall for reset at least the given number of microseconds
98 stipulated in the final argument.
99
100 @param PeiServices General purpose services available to every PEIM.
101 @param this Pointer to the local data for the interface.
102 @param Microseconds number of microseconds for which to stall.
103
104 @retval EFI_SUCCESS the function provided at least the required stall.
105 **/
106 EFI_STATUS
107 EFIAPI
108 Stall (
109 IN CONST EFI_PEI_SERVICES **PeiServices,
110 IN CONST EFI_PEI_STALL_PPI *This,
111 IN UINTN Microseconds
112 );
113
114 /**
115 This function initialize recovery functionality by installing the recovery PPI.
116
117 @param PeiServices General purpose services available to every PEIM.
118
119 @retval EFI_SUCCESS If the interface could be successfully installed.
120 **/
121 EFI_STATUS
122 EFIAPI
123 InitializeRecovery (
124 IN EFI_PEI_SERVICES **PeiServices
125 );
126
127 /**
128 This function
129 1. Calling MRC to initialize memory.
130 2. Install EFI Memory.
131 3. Capsule coalesce if capsule boot mode.
132 4. Create HOB of system memory.
133
134 @param PeiServices Pointer to the PEI Service Table
135
136 @retval EFI_SUCCESS If it completes successfully.
137
138 **/
139 EFI_STATUS
140 MemoryInit (
141 IN EFI_PEI_SERVICES **PeiServices
142 );
143
144 /**
145 This function provides the implementation of AtaController PPI Enable Channel function.
146
147 @param PeiServices General purpose services available to every PEIM.
148 @param this Pointer to the local data for the interface.
149 @param ChannelMask This parameter is used to specify primary or slavery IDE channel.
150
151 @retval EFI_SUCCESS Procedure returned successfully.
152 **/
153 EFI_STATUS
154 EnableAtaChannel (
155 IN EFI_PEI_SERVICES **PeiServices,
156 IN PEI_ATA_CONTROLLER_PPI *This,
157 IN UINT8 ChannelMask
158 );
159
160 /**
161 This function provides the implementation of AtaController PPI Get IDE channel Register Base Address
162
163 @param PeiServices General purpose services available to every PEIM.
164 @param this Pointer to the local data for the interface.
165 @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record
166 IDE Command and Control regeisters Base Address.
167
168 @retval EFI_SUCCESS Procedure returned successfully.
169 **/
170 EFI_STATUS
171 GetIdeRegsBaseAddr (
172 IN EFI_PEI_SERVICES **PeiServices,
173 IN PEI_ATA_CONTROLLER_PPI *This,
174 IN IDE_REGS_BASE_ADDR *IdeRegsBaseAddr
175 );
176
177 /**
178 This function provides the implementation to properly setup both LM & PDM functionality.
179
180 @param PeiServices General purpose services available to every PEIM.
181
182 @retval EFI_SUCCESS Procedure returned successfully.
183
184 **/
185 EFI_STATUS
186 ConfigureLM(
187 IN EFI_PEI_SERVICES **PeiServices
188 );
189
190 #include <Ppi/VlvMmioPolicy.h>
191
192 BOOLEAN
193 EFIAPI
194 IsFastBootEnabled (
195 IN CONST EFI_PEI_SERVICES **PeiServices
196 );
197
198 EFI_STATUS
199 PrioritizeBootMode (
200 IN OUT EFI_BOOT_MODE *CurrentBootMode,
201 IN EFI_BOOT_MODE NewBootMode
202 );
203
204 EFI_STATUS
205 EFIAPI
206 CapsulePpiNotifyCallback (
207 IN EFI_PEI_SERVICES **PeiServices,
208 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
209 IN VOID *Ppi
210 );
211 #endif