2 The header file of Platform PEIM.
4 Copyright (c) 2013 Intel Corporation.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef __PLATFORM_EARLY_INIT_H__
18 #define __PLATFORM_EARLY_INIT_H__
20 #define PEI_STALL_RESOLUTION 1
21 #define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')
25 EFI_FFS_FILE_HEADER
*FfsHeader
;
26 EFI_PEI_NOTIFY_DESCRIPTOR StallNotify
;
27 } STALL_CALLBACK_STATE_INFORMATION
;
29 #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)
34 #define USB2_GLOBAL_PORT 0x4001
35 #define USB2_PLL1 0x7F02
36 #define USB2_PLL2 0x7F03
37 #define USB2_COMPBG 0x7F04
40 Peform the boot mode determination logic
41 If the box is closed, then
42 1. If it's first time to boot, it's boot with full config .
43 2. If the ChassisIntrution is selected, force to be a boot with full config
44 3. Otherwise it's boot with no change.
46 @param PeiServices General purpose services available to every PEIM.
48 @param BootMode The detected boot mode.
50 @retval EFI_SUCCESS if the boot mode could be set
54 IN EFI_PEI_SERVICES
**PeiServices
,
55 OUT EFI_BOOT_MODE
*BootMode
59 This function reset the entire platform, including all processor and devices, and
62 @param PeiServices General purpose services available to every PEIM.
64 @retval EFI_SUCCESS if it completed successfully.
69 IN CONST EFI_PEI_SERVICES
**PeiServices
73 This function will be called when MRC is done.
75 @param PeiServices General purpose services available to every PEIM.
77 @param NotifyDescriptor Information about the notify event..
79 @param Ppi The notify context.
81 @retval EFI_SUCCESS If the function completed successfully.
85 MemoryDiscoveredPpiNotifyCallback (
86 IN EFI_PEI_SERVICES
**PeiServices
,
87 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
92 This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load
95 @param PeiServices General purpose services available to every PEIM.
96 @param NotifyDescriptor The context of notification.
97 @param Ppi The notify PPI.
99 @retval EFI_SUCCESS if it completed successfully.
103 FvFileLoaderPpiNotifyCallback (
104 IN EFI_PEI_SERVICES
**PeiServices
,
105 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
110 This function provides a blocking stall for reset at least the given number of microseconds
111 stipulated in the final argument.
113 @param PeiServices General purpose services available to every PEIM.
115 @param this Pointer to the local data for the interface.
117 @param Microseconds number of microseconds for which to stall.
119 @retval EFI_SUCCESS the function provided at least the required stall.
124 IN CONST EFI_PEI_SERVICES
**PeiServices
,
125 IN CONST EFI_PEI_STALL_PPI
*This
,
126 IN UINTN Microseconds
130 This function initialize recovery functionality by installing the recovery PPI.
132 @param PeiServices General purpose services available to every PEIM.
134 @retval EFI_SUCCESS if the interface could be successfully installed.
138 PeimInitializeRecovery (
139 IN EFI_PEI_SERVICES
**PeiServices
144 1. Calling MRC to initialize memory.
145 2. Install EFI Memory.
146 3. Create HOB of system memory.
148 @param PeiServices Pointer to the PEI Service Table
150 @retval EFI_SUCCESS If it completes successfully.
155 IN EFI_PEI_SERVICES
**PeiServices
158 /** Return info derived from Installing Memory by MemoryInit.
160 @param[out] RmuMainBaseAddressPtr Return RmuMainBaseAddress to this location.
161 @param[out] SmramDescriptorPtr Return start of Smram descriptor list to this location.
162 @param[out] NumSmramRegionsPtr Return numbers of Smram regions to this location.
164 @return Address of RMU shadow region at the top of available memory.
165 @return List of Smram descriptors for each Smram region.
166 @return Numbers of Smram regions.
170 InfoPostInstallMemory (
171 OUT UINT32
*RmuMainBaseAddressPtr OPTIONAL
,
172 OUT EFI_SMRAM_DESCRIPTOR
**SmramDescriptorPtr OPTIONAL
,
173 OUT UINTN
*NumSmramRegionsPtr OPTIONAL
177 This function provides the implementation of AtaController PPI Enable Channel function.
179 @param PeiServices General purpose services available to every PEIM.
180 @param this Pointer to the local data for the interface.
181 @param ChannelMask This parameter is used to specify primary or slavery IDE channel.
183 @retval EFI_SUCCESS Procedure returned successfully.
188 IN EFI_PEI_SERVICES
**PeiServices
,
189 IN PEI_ATA_CONTROLLER_PPI
*This
,
194 This function provides the implementation of AtaController PPI Get IDE channel Register Base Address
196 @param PeiServices General purpose services available to every PEIM.
197 @param this Pointer to the local data for the interface.
198 @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record
199 IDE Command and Control regeisters Base Address.
201 @retval EFI_SUCCESS Procedure returned successfully.
206 IN EFI_PEI_SERVICES
**PeiServices
,
207 IN PEI_ATA_CONTROLLER_PPI
*This
,
208 IN IDE_REGS_BASE_ADDR
*IdeRegsBaseAddr
218 This function provides early platform initialisation.
220 @param PlatformInfo Pointer to platform Info structure.
230 This function provides early platform GPIO initialisation.
232 @param PlatformType Platform type for GPIO init.
237 EarlyPlatformLegacyGpioInit (
238 IN CONST EFI_PLATFORM_TYPE PlatformType
242 Performs any early platform specific GPIO manipulation.
244 @param PlatformType Platform type GPIO manipulation.
249 EarlyPlatformLegacyGpioManipulation (
250 IN CONST EFI_PLATFORM_TYPE PlatformType
254 Performs any early platform specific GPIO Controller init & manipulation.
256 @param PlatformType Platform type for GPIO init & manipulation.
261 EarlyPlatformGpioCtrlerInitAndManipulation (
262 IN CONST EFI_PLATFORM_TYPE PlatformType
266 Performs any early platform init of SoC Ethernet Mac devices.
268 @param IohMac0Address Mac address to program into Mac0 device.
269 @param IohMac1Address Mac address to program into Mac1 device.
274 EarlyPlatformMacInit (
275 IN CONST UINT8
*IohMac0Address
,
276 IN CONST UINT8
*IohMac1Address
280 Find security headers using EFI_CAPSULE_VARIABLE_NAME variables and build Hobs.
282 @param PeiServices General purpose services available to every PEIM.
284 @retval 0 if no security headers found.
285 @return number of security header hobs built.
289 FindCapsuleSecurityHeadersAndBuildHobs (
290 IN EFI_PEI_SERVICES
**PeiServices
294 Build capsule security header hob.
296 @param SecHdr Pointer to security header.
298 @retval NULL if failure to build HOB.
299 @return pointer to built hob.
303 BuildCapsuleSecurityHeaderHob (