1## @file 2# This is the Platform PEIM to initialize whole platform on PEI phase. 3# 4# This PEIM includes 3 parts, pre memory initialization, MRC 5# wrapper and post memory initialization. 6# On pre memory, following action is performed, 7# 1. Initizluize GMCH. 8# 2. Detect boot mode. 9# 3. Detect video adapter to determine whether we need pre allocated 10# memory. 11# 12# After that MRC wrapper calls MRC to initialize memory and install a PPI 13# notify to do post memory 14# initialization. MRC wrapper performance following actions, 15# 1. Install EFI Memory. 16# 2. Create HOB of system memory. 17# 18# On post memory, following action is performed, 19# 1. QNC initialization after MRC. 20# 2. SIO initialization. 21# 3. Install ResetSystem and FinvFv PPI, relocate Stall to memory on 22# recovery boot mode. 23# 4. Set MTRR for PEI 24# 5. Create FV HOB and Flash HOB 25# 6. Install RecoveryModule and AtaController PPI if on recovery boot mode. 26# 27# This PEIM does not have any register access directly, it depends on 28# IntelQNCLib, QNCAccess libraries to access Chipset 29# registers. 30# 31# Platform.c - Provide main flow and entrypoint of PEIM. 32# MemoryCallback.c - Includes a memory call back function notified when 33# MRC is done. 34# Recovery.c - provides the platform recoveyr functionality. 35# MrcWrapper.c - Contains the logic to call MRC PPI and do Framework 36# memory specific stuff like build memory map, build 37# resource description hob for DXE phase,etc. 38# Bootmode.c - Detect boot mode. 39# Copyright (c) 2013 - 2016 Intel Corporation. 40# 41# This program and the accompanying materials 42# are licensed and made available under the terms and conditions of the BSD License 43# which accompanies this distribution. The full text of the license may be found at 44# http://opensource.org/licenses/bsd-license.php 45# 46# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 47# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 48# 49## 50 51[Defines] 52 INF_VERSION = 0x00010005 53 BASE_NAME = PlatformEarlyInitPei 54 FILE_GUID = 9618C0DC-50A4-496c-994F-7241F282ED01 55 MODULE_TYPE = PEIM 56 VERSION_STRING = 1.0 57 ENTRY_POINT = PeiInitPlatform 58 59# 60# The following information is for reference only and not required by the build tools. 61# 62# VALID_ARCHITECTURES = IA32 X64 63# 64 65[Sources] 66 Generic/Recovery.c 67 PlatformErratas.c 68 MrcWrapper.c 69 MrcWrapper.h 70 PlatformEarlyInit.c 71 PlatformEarlyInit.h 72 MemoryCallback.c 73 BootMode.c 74 CommonHeader.h 75 PeiFvSecurity.c 76 PeiFvSecurity.h 77 78[Packages] 79 MdePkg/MdePkg.dec 80 MdeModulePkg/MdeModulePkg.dec 81 UefiCpuPkg/UefiCpuPkg.dec 82 IntelFrameworkPkg/IntelFrameworkPkg.dec 83 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec 84 QuarkPlatformPkg/QuarkPlatformPkg.dec 85 QuarkSocPkg/QuarkSocPkg.dec 86 87[LibraryClasses] 88 ResetSystemLib 89 PrintLib 90 TimerLib 91 PcdLib 92 IntelQNCLib 93 ReportStatusCodeLib 94 PciLib 95 PciExpressLib 96 IoLib 97 PciCf8Lib 98 HobLib 99 BaseMemoryLib 100 PeiServicesTablePointerLib 101 PeiServicesLib 102 BaseLib 103 PeimEntryPoint 104 DebugLib 105 MemoryAllocationLib 106 PerformanceLib 107 CacheMaintenanceLib 108 MtrrLib 109 QNCAccessLib 110 PlatformHelperLib 111 PlatformPcieHelperLib 112 I2cLib 113 114[Guids] 115 gEfiMemoryConfigDataGuid # ALWAYS_CONSUMED L"MemoryConfig" 116 gEfiAcpiVariableGuid # ALWAYS_CONSUMED L"AcpiGlobalVariab" 117 gEfiMemoryTypeInformationGuid # ALWAYS_CONSUMED L"MemoryTypeInformation" 118 gEfiMemoryConfigDataGuid # SOMETIMES_PRODUCED Hob: GUID_EXTENSION 119 gEfiSmmPeiSmramMemoryReserveGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION 120 gEfiFirmwareFileSystem2Guid # ALWAYS_CONSUMED 121 gEfiCapsuleGuid # ALWAYS_CONSUMED 122 gPeiCapsuleOnDataCDGuid 123 gPeiCapsuleOnFatIdeDiskGuid 124 gPeiCapsuleOnFatUsbDiskGuid 125 gEfiMemoryOverwriteControlDataGuid # SOMETIMES_CONSUMED 126 gEfiQuarkCapsuleGuid 127 128[Ppis] 129 gQNCMemoryInitPpiGuid # PPI ALWAYS_CONSUMED 130 gEfiPeiMemoryDiscoveredPpiGuid # PPI ALWAYS_PRODUCED 131 gPeiAtaControllerPpiGuid # PPI SOMETIMES_PRODUCED 132 gEfiPeiStallPpiGuid # PPI ALWAYS_PRODUCED 133 gEfiPeiDeviceRecoveryModulePpiGuid # PPI SOMETIMES_CONSUMED 134 gEfiPeiRecoveryModulePpiGuid # PPI SOMETIMES_PRODUCED 135 gEfiPeiResetPpiGuid # PPI ALWAYS_PRODUCED 136 gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED 137 gEfiPeiBootInRecoveryModePpiGuid # PPI SOMETIMES_PRODUCED 138 gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED 139 gEfiPeiFirmwareVolumeInfoPpiGuid 140 gEfiEndOfPeiSignalPpiGuid 141 gEfiPeiVirtualBlockIoPpiGuid 142 gPeiCapsulePpiGuid # PPI ALWAYS_CONSUMED 143 144[FeaturePcd] 145 gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryOnFatUsbDisk 146 gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryOnDataCD 147 gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryOnFatFloppyDisk 148 gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryOnIdeDisk 149 gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport 150 gQuarkPlatformTokenSpaceGuid.WaitIfResetDueToError 151 152[Pcd] 153 gQuarkPlatformTokenSpaceGuid.PcdEsramStage1Base 154 gQuarkPlatformTokenSpaceGuid.PcdFlashAreaSize 155 gQuarkPlatformTokenSpaceGuid.PcdFlashAreaBaseAddress 156 gQuarkPlatformTokenSpaceGuid.PcdEccScrubBlkSize 157 gQuarkPlatformTokenSpaceGuid.PcdEccScrubInterval 158 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase 159 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize 160 gQuarkPlatformTokenSpaceGuid.PcdFlashQNCMicrocodeSize 161 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPmbaIoBaseAddress 162 gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress 163 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciHostBridgeIoBase 164 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciHostBridgeIoSize 165 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohUartFunctionNumber 166 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohUartBusNumber 167 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohUartDevNumber 168 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohGpioBusNumber 169 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohGpioDevNumber 170 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohGpioFunctionNumber 171 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohGpioBarRegister 172 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohGpioMmioBase 173 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohMac0MmioBase 174 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohMac1MmioBase 175 gEfiQuarkSCSocIdTokenSpaceGuid.PcdPeiQNCUsbControllerMemoryBaseAddress 176 gEfiQuarkNcSocIdTokenSpaceGuid.PcdRcbaMmioBaseAddress 177 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciHostBridgeMemory32Base 178 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciHostBridgeMemory32Size 179 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciHostBridgeMemory64Base 180 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciHostBridgeMemory64Size 181 gEfiQuarkNcSocIdTokenSpaceGuid.PcdPciExpressSize 182 gEfiQuarkNcSocIdTokenSpaceGuid.PcdGbaIoBaseAddress 183 gEfiQuarkNcSocIdTokenSpaceGuid.PcdQuarkMicrocodeFile 184 gEfiQuarkNcSocIdTokenSpaceGuid.PcdTSegSize 185 gEfiQuarkNcSocIdTokenSpaceGuid.PcdESramMemorySize 186 gQuarkPlatformTokenSpaceGuid.PcdFlashFvRecoverySize 187 gQuarkPlatformTokenSpaceGuid.PcdFlashFvRecoveryBase 188 gQuarkPlatformTokenSpaceGuid.PcdFlashFvMainSize 189 gQuarkPlatformTokenSpaceGuid.PcdFlashFvMainBase 190 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootState 191 gQuarkPlatformTokenSpaceGuid.PcdFlashFvPayloadBase 192 gQuarkPlatformTokenSpaceGuid.PcdFlashFvPayloadSize 193 gQuarkPlatformTokenSpaceGuid.PcdEnableFastBoot 194 gQuarkPlatformTokenSpaceGuid.PcdPlatformType 195 gEfiQuarkNcSocIdTokenSpaceGuid.PcdMrcParameters 196 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohEthernetMac0 197 gEfiQuarkSCSocIdTokenSpaceGuid.PcdIohEthernetMac1 198 199[Depex] 200 gEfiPeiReadOnlyVariable2PpiGuid AND gQNCMemoryInitPpiGuid 201