+++ /dev/null
-/** @file\r
-The header file of Platform PEIM.\r
-\r
-Copyright (c) 2013 - 2019 Intel Corporation.\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-\r
-#ifndef __PLATFORM_EARLY_INIT_H__\r
-#define __PLATFORM_EARLY_INIT_H__\r
-\r
-#define PEI_STALL_RESOLUTION 1\r
-#define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')\r
-\r
-typedef struct {\r
- UINT32 Signature;\r
- EFI_FFS_FILE_HEADER *FfsHeader;\r
- EFI_PEI_NOTIFY_DESCRIPTOR StallNotify;\r
-} STALL_CALLBACK_STATE_INFORMATION;\r
-\r
-#define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)\r
-\r
-//\r
-// USB Phy Registers\r
-//\r
-#define USB2_GLOBAL_PORT 0x4001\r
-#define USB2_PLL1 0x7F02\r
-#define USB2_PLL2 0x7F03\r
-#define USB2_COMPBG 0x7F04\r
-\r
-/**\r
- Peform the boot mode determination logic\r
- If the box is closed, then\r
- 1. If it's first time to boot, it's boot with full config .\r
- 2. If the ChassisIntrution is selected, force to be a boot with full config\r
- 3. Otherwise it's boot with no change.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
-\r
- @param BootMode The detected boot mode.\r
-\r
- @retval EFI_SUCCESS if the boot mode could be set\r
-**/\r
-EFI_STATUS\r
-UpdateBootMode (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- OUT EFI_BOOT_MODE *BootMode\r
- );\r
-\r
-/**\r
- This function reset the entire platform, including all processor and devices, and\r
- reboots the system.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
-\r
- @retval EFI_SUCCESS if it completed successfully.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformResetSystem (\r
- IN CONST EFI_PEI_SERVICES **PeiServices\r
- );\r
-\r
-/**\r
- This function will be called when MRC is done.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
-\r
- @param NotifyDescriptor Information about the notify event..\r
-\r
- @param Ppi The notify context.\r
-\r
- @retval EFI_SUCCESS If the function completed successfully.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-MemoryDiscoveredPpiNotifyCallback (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
- IN VOID *Ppi\r
- );\r
-\r
-/**\r
- This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load\r
- the PEIM into memory.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
- @param NotifyDescriptor The context of notification.\r
- @param Ppi The notify PPI.\r
-\r
- @retval EFI_SUCCESS if it completed successfully.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-FvFileLoaderPpiNotifyCallback (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
- IN VOID *Ppi\r
- );\r
-\r
-/**\r
- This function provides a blocking stall for reset at least the given number of microseconds\r
- stipulated in the final argument.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
-\r
- @param this Pointer to the local data for the interface.\r
-\r
- @param Microseconds number of microseconds for which to stall.\r
-\r
- @retval EFI_SUCCESS the function provided at least the required stall.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Stall (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN CONST EFI_PEI_STALL_PPI *This,\r
- IN UINTN Microseconds\r
- );\r
-\r
-/**\r
- This function initialize recovery functionality by installing the recovery PPI.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
-\r
- @retval EFI_SUCCESS if the interface could be successfully installed.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeRecovery (\r
- IN EFI_PEI_SERVICES **PeiServices\r
- );\r
-\r
-/**\r
- This function\r
- 1. Calling MRC to initialize memory.\r
- 2. Install EFI Memory.\r
- 3. Create HOB of system memory.\r
-\r
- @param PeiServices Pointer to the PEI Service Table\r
-\r
- @retval EFI_SUCCESS If it completes successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-MemoryInit (\r
- IN EFI_PEI_SERVICES **PeiServices\r
- );\r
-\r
-/** Return info derived from Installing Memory by MemoryInit.\r
-\r
- @param[out] RmuMainBaseAddressPtr Return RmuMainBaseAddress to this location.\r
- @param[out] SmramDescriptorPtr Return start of Smram descriptor list to this location.\r
- @param[out] NumSmramRegionsPtr Return numbers of Smram regions to this location.\r
-\r
- @return Address of RMU shadow region at the top of available memory.\r
- @return List of Smram descriptors for each Smram region.\r
- @return Numbers of Smram regions.\r
-**/\r
-VOID\r
-EFIAPI\r
-InfoPostInstallMemory (\r
- OUT UINT32 *RmuMainBaseAddressPtr OPTIONAL,\r
- OUT EFI_SMRAM_DESCRIPTOR **SmramDescriptorPtr OPTIONAL,\r
- OUT UINTN *NumSmramRegionsPtr OPTIONAL\r
- );\r
-\r
-/**\r
- This function provides the implementation of AtaController PPI Enable Channel function.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
- @param this Pointer to the local data for the interface.\r
- @param ChannelMask This parameter is used to specify primary or slavery IDE channel.\r
-\r
- @retval EFI_SUCCESS Procedure returned successfully.\r
-**/\r
-\r
-EFI_STATUS\r
-EnableAtaChannel (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_ATA_CONTROLLER_PPI *This,\r
- IN UINT8 ChannelMask\r
- );\r
-\r
-/**\r
- This function provides the implementation of AtaController PPI Get IDE channel Register Base Address\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
- @param this Pointer to the local data for the interface.\r
- @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record\r
- IDE Command and Control regeisters Base Address.\r
-\r
- @retval EFI_SUCCESS Procedure returned successfully.\r
-**/\r
-\r
-EFI_STATUS\r
-GetIdeRegsBaseAddr (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_ATA_CONTROLLER_PPI *This,\r
- IN IDE_REGS_BASE_ADDR *IdeRegsBaseAddr\r
- );\r
-\r
-VOID\r
-EFIAPI\r
-InitializeUSBPhy (\r
- VOID\r
- );\r
-\r
-/**\r
- This function provides early platform initialisation.\r
-\r
- @param PlatformInfo Pointer to platform Info structure.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EarlyPlatformInit (\r
- VOID\r
- );\r
-\r
-/**\r
- This function provides early platform GPIO initialisation.\r
-\r
- @param PlatformType Platform type for GPIO init.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EarlyPlatformLegacyGpioInit (\r
- IN CONST EFI_PLATFORM_TYPE PlatformType\r
- );\r
-\r
-/**\r
- Performs any early platform specific GPIO manipulation.\r
-\r
- @param PlatformType Platform type GPIO manipulation.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EarlyPlatformLegacyGpioManipulation (\r
- IN CONST EFI_PLATFORM_TYPE PlatformType\r
- );\r
-\r
-/**\r
- Performs any early platform specific GPIO Controller init & manipulation.\r
-\r
- @param PlatformType Platform type for GPIO init & manipulation.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EarlyPlatformGpioCtrlerInitAndManipulation (\r
- IN CONST EFI_PLATFORM_TYPE PlatformType\r
- );\r
-\r
-/**\r
- Performs any early platform init of SoC Ethernet Mac devices.\r
-\r
- @param IohMac0Address Mac address to program into Mac0 device.\r
- @param IohMac1Address Mac address to program into Mac1 device.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EarlyPlatformMacInit (\r
- IN CONST UINT8 *IohMac0Address,\r
- IN CONST UINT8 *IohMac1Address\r
- );\r
-\r
-/**\r
- Find security headers using EFI_CAPSULE_VARIABLE_NAME variables and build Hobs.\r
-\r
- @param PeiServices General purpose services available to every PEIM.\r
-\r
- @retval 0 if no security headers found.\r
- @return number of security header hobs built.\r
-**/\r
-UINTN\r
-EFIAPI\r
-FindCapsuleSecurityHeadersAndBuildHobs (\r
- IN EFI_PEI_SERVICES **PeiServices\r
- );\r
-\r
-/**\r
- Build capsule security header hob.\r
-\r
- @param SecHdr Pointer to security header.\r
-\r
- @retval NULL if failure to build HOB.\r
- @return pointer to built hob.\r
-**/\r
-VOID *\r
-EFIAPI\r
-BuildCapsuleSecurityHeaderHob (\r
- IN VOID *SecHdr\r
- );\r
-\r
-#endif\r