2 The header file of Platform PEIM.
4 Copyright (c) 2013 Intel Corporation.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef __PLATFORM_EARLY_INIT_H__
12 #define __PLATFORM_EARLY_INIT_H__
14 #define PEI_STALL_RESOLUTION 1
15 #define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')
19 EFI_FFS_FILE_HEADER
*FfsHeader
;
20 EFI_PEI_NOTIFY_DESCRIPTOR StallNotify
;
21 } STALL_CALLBACK_STATE_INFORMATION
;
23 #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)
28 #define USB2_GLOBAL_PORT 0x4001
29 #define USB2_PLL1 0x7F02
30 #define USB2_PLL2 0x7F03
31 #define USB2_COMPBG 0x7F04
34 Peform the boot mode determination logic
35 If the box is closed, then
36 1. If it's first time to boot, it's boot with full config .
37 2. If the ChassisIntrution is selected, force to be a boot with full config
38 3. Otherwise it's boot with no change.
40 @param PeiServices General purpose services available to every PEIM.
42 @param BootMode The detected boot mode.
44 @retval EFI_SUCCESS if the boot mode could be set
48 IN EFI_PEI_SERVICES
**PeiServices
,
49 OUT EFI_BOOT_MODE
*BootMode
53 This function reset the entire platform, including all processor and devices, and
56 @param PeiServices General purpose services available to every PEIM.
58 @retval EFI_SUCCESS if it completed successfully.
63 IN CONST EFI_PEI_SERVICES
**PeiServices
67 This function will be called when MRC is done.
69 @param PeiServices General purpose services available to every PEIM.
71 @param NotifyDescriptor Information about the notify event..
73 @param Ppi The notify context.
75 @retval EFI_SUCCESS If the function completed successfully.
79 MemoryDiscoveredPpiNotifyCallback (
80 IN EFI_PEI_SERVICES
**PeiServices
,
81 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
86 This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load
89 @param PeiServices General purpose services available to every PEIM.
90 @param NotifyDescriptor The context of notification.
91 @param Ppi The notify PPI.
93 @retval EFI_SUCCESS if it completed successfully.
97 FvFileLoaderPpiNotifyCallback (
98 IN EFI_PEI_SERVICES
**PeiServices
,
99 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
104 This function provides a blocking stall for reset at least the given number of microseconds
105 stipulated in the final argument.
107 @param PeiServices General purpose services available to every PEIM.
109 @param this Pointer to the local data for the interface.
111 @param Microseconds number of microseconds for which to stall.
113 @retval EFI_SUCCESS the function provided at least the required stall.
118 IN CONST EFI_PEI_SERVICES
**PeiServices
,
119 IN CONST EFI_PEI_STALL_PPI
*This
,
120 IN UINTN Microseconds
124 This function initialize recovery functionality by installing the recovery PPI.
126 @param PeiServices General purpose services available to every PEIM.
128 @retval EFI_SUCCESS if the interface could be successfully installed.
132 PeimInitializeRecovery (
133 IN EFI_PEI_SERVICES
**PeiServices
138 1. Calling MRC to initialize memory.
139 2. Install EFI Memory.
140 3. Create HOB of system memory.
142 @param PeiServices Pointer to the PEI Service Table
144 @retval EFI_SUCCESS If it completes successfully.
149 IN EFI_PEI_SERVICES
**PeiServices
152 /** Return info derived from Installing Memory by MemoryInit.
154 @param[out] RmuMainBaseAddressPtr Return RmuMainBaseAddress to this location.
155 @param[out] SmramDescriptorPtr Return start of Smram descriptor list to this location.
156 @param[out] NumSmramRegionsPtr Return numbers of Smram regions to this location.
158 @return Address of RMU shadow region at the top of available memory.
159 @return List of Smram descriptors for each Smram region.
160 @return Numbers of Smram regions.
164 InfoPostInstallMemory (
165 OUT UINT32
*RmuMainBaseAddressPtr OPTIONAL
,
166 OUT EFI_SMRAM_DESCRIPTOR
**SmramDescriptorPtr OPTIONAL
,
167 OUT UINTN
*NumSmramRegionsPtr OPTIONAL
171 This function provides the implementation of AtaController PPI Enable Channel function.
173 @param PeiServices General purpose services available to every PEIM.
174 @param this Pointer to the local data for the interface.
175 @param ChannelMask This parameter is used to specify primary or slavery IDE channel.
177 @retval EFI_SUCCESS Procedure returned successfully.
182 IN EFI_PEI_SERVICES
**PeiServices
,
183 IN PEI_ATA_CONTROLLER_PPI
*This
,
188 This function provides the implementation of AtaController PPI Get IDE channel Register Base Address
190 @param PeiServices General purpose services available to every PEIM.
191 @param this Pointer to the local data for the interface.
192 @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record
193 IDE Command and Control regeisters Base Address.
195 @retval EFI_SUCCESS Procedure returned successfully.
200 IN EFI_PEI_SERVICES
**PeiServices
,
201 IN PEI_ATA_CONTROLLER_PPI
*This
,
202 IN IDE_REGS_BASE_ADDR
*IdeRegsBaseAddr
212 This function provides early platform initialisation.
214 @param PlatformInfo Pointer to platform Info structure.
224 This function provides early platform GPIO initialisation.
226 @param PlatformType Platform type for GPIO init.
231 EarlyPlatformLegacyGpioInit (
232 IN CONST EFI_PLATFORM_TYPE PlatformType
236 Performs any early platform specific GPIO manipulation.
238 @param PlatformType Platform type GPIO manipulation.
243 EarlyPlatformLegacyGpioManipulation (
244 IN CONST EFI_PLATFORM_TYPE PlatformType
248 Performs any early platform specific GPIO Controller init & manipulation.
250 @param PlatformType Platform type for GPIO init & manipulation.
255 EarlyPlatformGpioCtrlerInitAndManipulation (
256 IN CONST EFI_PLATFORM_TYPE PlatformType
260 Performs any early platform init of SoC Ethernet Mac devices.
262 @param IohMac0Address Mac address to program into Mac0 device.
263 @param IohMac1Address Mac address to program into Mac1 device.
268 EarlyPlatformMacInit (
269 IN CONST UINT8
*IohMac0Address
,
270 IN CONST UINT8
*IohMac1Address
274 Find security headers using EFI_CAPSULE_VARIABLE_NAME variables and build Hobs.
276 @param PeiServices General purpose services available to every PEIM.
278 @retval 0 if no security headers found.
279 @return number of security header hobs built.
283 FindCapsuleSecurityHeadersAndBuildHobs (
284 IN EFI_PEI_SERVICES
**PeiServices
288 Build capsule security header hob.
290 @param SecHdr Pointer to security header.
292 @retval NULL if failure to build HOB.
293 @return pointer to built hob.
297 BuildCapsuleSecurityHeaderHob (