summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg
Commit message (Collapse)AuthorAgeFilesLines
* UefiPayloadPkg: Remove asm code and sharing librariesGuo Dong2021-09-3016-321/+105
| | | | | | | | | | | | | | | | | Remove asm code used for payload entry. Use patchable PCD instead a fixed PCD PcdPayloadStackTop to avoid potential conflict. Based on the removal, use same HobLib regardless UNIVERSAL_PAYLOAD. Use same PlatformHookLib regardless UNIVERSAL_PAYLOAD. The original PlatformHookLib was removed and UniversalPayloadPlatformHookLib was rename to new PlatformHookLib. Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiPayloadPkg: Update maximum logic processor to 256Cheng-Chieh Huang2021-09-291-1/+1
| | | | | | | | | | | | | Signed-off-by: Cheng-Chieh Huang <chengchieh@google.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Cheng-Chieh Huang <chengchieh@google.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Trammell Hudson <hudson@trmm.net> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Ray Ni <ray.ni@intel.com>
* UefiPayloadPkg: Add ".upld_info" in universal payloadGuo Dong2021-09-291-3/+39
| | | | | | | | | | | | | | V2: Use LittleEndianStructure by review comment. From the universal scalable firmware payload requirement V0.75, Payload must have Universal Payload Information Section ".upld_info" So update the build tool to add this section. Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com>
* UefiPayloadPkg: Use dummy constructor for PlatformHookLibGuo Dong2021-09-292-1/+18
| | | | | | | | | | | | The Library constructor is only used for library dependency. So use a dummy function to make it clear instead of using an actual function. Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com>
* UefiPayloadPkg: Build a HOB from bootloader ACPI tableGuo Dong2021-09-296-173/+233
| | | | | | | | | | | | | | V2: Update BuildHobFromAcpi() to return a HOB pointer. For universal UEFI payload, build a HOB from the ACPI table, so that other modules could use this info from HOB at very early DXE phase. This code are shared by universal payload and non universal payload. Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com>
* UefiPayloadPkg: Add Macro to enable or disable some drivers.Zhiguang Liu2021-09-242-4/+13
| | | | | | | | | | | Add Macro to enable or disable RamDiskDxe and SioBusDxe drivers. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Fix the warning when building UefiPayloadPkg with IA32+X64Tan, Dun2021-09-161-3/+5
| | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3603 Move the unspecified PCDs from .common section. to .X64 section in .dsc file. The corresponding PCDs are not used in IA32. Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Dun Tan <dun.tan@intel.com>
* UefiPayloadPkg: Add script to build UniversalPayload in UefiPayloadPkgTan, Dun2021-09-161-0/+98
| | | | | | | | | | | | | | | V1: Add script to build UniversalPayload, which can be used after edksetup rebuild The final UPL.elf will be located at root folder of edk2 V2: Revise the ouput directory of generated files and coding style in the script Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Dun Tan <dun.tan@intel.com>
* UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuidduntan2021-09-102-1/+26
| | | | | | | | | | | | | V1: Dump this hob infomation from gEdkiiBootManagerMenuFileGuid V2: Delete the duplicated assertions V3: Add input parameter in Comment Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Dun Tan <dun.tan@intel.com>
* UefiPayloadPkg: Fix the bug in dump guid HOB info functionsduntan2021-09-101-3/+7
| | | | | | | | | | | The input HobLength of PrintHandler should be data size instead of whole length of HOB Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Dun Tan <dun.tan@intel.com>
* UefiPayloadPkg: Include Network modules in UefiPayloadPkg.Sravanthi2021-09-092-2/+23
| | | | | | | | | | | Include Network modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Sravanthi <k.kavyax.sravanthi@intel.com>
* UefiPayloadPkg: Include more modules in UefiPayloadPkg.Sravanthi2021-09-092-0/+12
| | | | | | | | | | | Include core modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Sravanthi <k.kavyax.sravanthi@intel.com>
* UefiPayloadPkg: Create .yaml file in UefiPayloadPkgduntan2021-09-021-0/+90
| | | | | | | | | | | Create .yaml file in UefiPayloadPkg to enable Core ci for UefiPayloadPkg Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: DunTan <dun.tan@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* UefiPayloadPkg/UefiPayloadEntry: Fix memory corruptionMarvin H?user2021-09-011-1/+1
| | | | | | | | | | | | | | UefiPayloadEntry's AllocatePool() applies the "sizeof" operator to HOB index rather than the HOB header structure. This yields 4 Bytes compared to the 8 Bytes the structure header requires. Fix the call to allocate the required space instead. Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Vitaly Cheptsov <vit9696@protonmail.com> Signed-off-by: Marvin H?user <mhaeuser@posteo.de>
* UefiPayloadPkg: Fix the build error when enable Core ci for UefiPayloadPkgduntan2021-09-013-20/+4
| | | | | | | | | | | | | | V1: Add quotes when using $(ARCH) in .dsc and .fdf file. The quotes are added due to the way by which Core ci parse the .dsc file. Add UINTN in Hob.c to fix cast from pointer to integer of different size error. V2: Delete lines which reference ShellBinPkg.The pkg doesn't exist in edk2. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: DunTan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiPayloadPkg: Fix the non-ascii character in UniversalPayloadEntry.cedk2-stable202108-rc0DunTan2021-08-091-1/+1
| | | | | | | | | | | Fix the non-ascii character in UniversalPayloadEntry.c Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: DunTan <dun.tan@intel.com>
* UefiPayloadPkg: Add a macro to enable or diable the serial driver.Zhiguang Liu2021-08-092-0/+6
| | | | | | | | | | | This patch doesn't change the default behavior. Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: change the default value of some PCDs.Zhiguang Liu2021-08-091-1/+3
| | | | | | | | | | | | | | Change the default value of the below PCDs to diable some legacy feature. gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|FALSE gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0 Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: define some PCD as DynamicEX PCDZhiguang Liu2021-08-095-21/+18
| | | | | | | | | | | | | Define some PCDs as DynamicEX PCD to be used as global variable. Because PcdUartDefaultBaudRate is defined as DynamicEX, remove the code to set it in platformlib. That code was actually redundant. Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Add Fixed PCDs and use Macro to define the default value.Zhiguang Liu2021-08-091-1/+10
| | | | | | | | | | | | | | | | Add the three PCDs as fixed at build PCD: gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister The default value is defined as Macro, so it can be passed in at build command. Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Add FV Guid for DXEFV and PLDFVZhiguang Liu2021-07-161-0/+2
| | | | | | Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com>
* UefiPayloadPkg: Add PCD_DYNAMIC_AS_DYNAMICEX and set to TrueLiu, Zhiguang2021-07-141-0/+1
| | | | | | | | | | | | PCD_DYNAMIC_AS_DYNAMICEX is recently added to Edk2, and it can treat Dynamic PCD to Dynamic Ex PCD, which is Uefi Payload needs. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiPayloadPkg: Assign the length of UniversalPayload ExtraDataTan, Dun2021-07-131-1/+5
| | | | | | | | | | | | | | V1: Assign the length and revision of UniversalPayload ExtraData V2: Force int to UINT16 V3: Create a local variable to hold the size of ExtraData Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: DunTan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiPayloadPkg: Dump hob information from boot loaderLiu, Zhiguang2021-07-133-0/+664
| | | | | | | | | | | | | | | | | | | | V1: Universal Payload will consume Hobs from boot loader. Dump all hobs in the Universal Payload entry. V2: Add function comments V3: minor change, for example Hobsize -> HobLength, SMBiosTable -> SmBiosTable Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Thiyagu Kesavan Balakrishnan <thiyagux.kesavan.balakrishnan@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiPayloadPkg: Fix the build failureGuo Dong2021-07-012-5/+2
| | | | | | | | | | For non-universal payload, HandoffHobTable is used without initialization. This patch fixed this failure. Cc: Benjamin You <benjamin.you@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com>
* UefiPayloadPkg/PayloadLoader: Remove assertionRay Ni2021-06-302-2/+0
| | | | | | | | | | | | | | For R_386_RELATIVE and R_X86_64_RELATIVE, today's logic assumes that the content pointed by the Rela->r_offset is 0 but it's not always TRUE. We observed that linker may set the content to Rela->r_addend. The patch removes the assertion. There is no functionality impact for this patch. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
* UefiPayloadPkg/PayloadLoader: Fix bug in locating relocation sectionRay Ni2021-06-302-14/+30
| | | | | | | | | | | | | | | | | | | | | Per ELF spec, the DT_REL/DT_RELA tag in dynamic section stores the virtual address of the relocation section. But today's code logic treats it as the section offset and finds the relocation section whose offset equals to DT_REL/DT_RELA. The logic can work when the section offset equals to the section virtual address. But when the ELF is generated from the link script that reserves a sizeof(pe_header) in the file beginning, the section offset doesn't equal to section virtual address. Such logic can not find the relocation section. The patch fixes this bug. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
* UefiPayloadPkg: consume the BootManagerMenuFile HOBduntan2021-06-243-2/+57
| | | | | | | | | | | Consume the BootManagerMenuFile HOB in PlatformBootManagerLib This Lib is in UefiPayloadPkg Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: DunTan <dun.tan@intel.com>
* UefiPayloadPkg: Add new structure for BootManagerMenuFile HOBduntan2021-06-242-0/+30
| | | | | | | | | | Add new structure for BootManagerMenuFile HOB in UefiPayloadPkg Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: DunTan <dun.tan@intel.com>
* UefiPayloadPkg: Add PcdResetOnMemoryTypeInformationChange in UefiPayloadPkgZhiguang Liu2021-06-241-0/+1
| | | | | | | | | | This PCD will be consumed by Universal Payload Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Add PcdInstallAcpiSdtProtocol feature in UefiPayloadPkgZhiguang Liu2021-06-241-0/+2
| | | | | | | | | | To install ACPI SDT protocol, define PcdInstallAcpiSdtProtocol as TRUE. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Add macro to enable and disable some driversZhiguang Liu2021-06-242-1/+14
| | | | | | | | | | | Add macro EMU_VARIABLE_ENABLE and DISABLE_RESET_SYSTEM to include or exclude some drivers from Payload Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Remove assert when reserve MMIO/IO resource for devicesZhiguang Liu2021-06-241-9/+11
| | | | | | | | | | | Some boot loader may already reserve MMIO/IO resource for IOAPIC and HPET, so remove the assert when reserve MMIO/IO resource for IOAPIC and HPET Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Include UniversalPayLoad modules in UefiPayloadPkg.dscZhiguang Liu2021-06-242-5/+20
| | | | | | | | | | Add a new macro "UNIVERSAL_PAYLOAD" to build Universal Payload. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Fix up UPL Pcd databaseZhiguang Liu2021-06-246-7/+119
| | | | | | | | | | | | | | | Edk2 bootloader will pass the pei pcd database, and UPL also contain a PCD database. Dxe PCD driver has the assumption that the two PCD database can be catenated and the local token number should be successive。 This patch will manually fix up the UPL PCD database to meet that assumption. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Get and enter DxeCore for Universal PayloadZhiguang Liu2021-06-245-4/+104
| | | | | | | | | | | | | From gUniversalPayloadExtraDataGuid Guid Hob, get the Dxe FV information, and get the Dxe Core from the FV. Also, make sure if there are muliple FV hob, the FV hob pointing to this FV will be the first in the hob list. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Create separate Payload Entry for UniversalPayloadZhiguang Liu2021-06-242-0/+402
| | | | | | | | | | | | | | This patch create the UniversalPayload Entry based on the UefiPayload Entry. It implements the logic to find a proper memory range to create the new Hob and migrate the Hobs from Bootloader. To make the change history clear, the logic to get the DxeCore will be in the next patch. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Update the function definition of HobConstructorZhiguang Liu2021-06-243-25/+22
| | | | | | | | | | | Update the function defination of HobConstructor to align the Phit Hob structure. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Add a separate PlatformHookLib for Universal PayloadZhiguang Liu2021-06-242-0/+123
| | | | | | | | | | | Add a new separate PlatformHookLib for Universal Payload to consume Guid Hob gUniversalPayloadSerialPortInfoGuid to get serial port information Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Add HobLib for UniversalPayloadZhiguang Liu2021-06-2411-6/+838
| | | | | | | | | | | | | | | | | | | | | | | | | For payload entry, use PayloadEntryHobLib as HobLib and payload entry should initialize hob base. For DxeCore, use new added DxeHobLib as HobLib, and DxeCore will initialize hob base. For Dxe Driver, use new added DxeHobLib as HobLib, and use DxeHobListLib to initialize hob base. Adding a new library DxeHobLib + DxeHobListLib instead of using the DxeHobLib.inf in MdePkg is because the constructor needed be separated from DxeHobLib. If not, when building UefiPayloadPkg, the dependency chain is as below: DebugLib -> SerialPortLib -> PlatformHookLib -> HobLib -> DebugLib Each library has a constructor, and this becomes a constructor circle. To break the circle, separate the constructor from the HobLib as a new DxeHobListLib, which won't depend on DebugLib. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WAGuo Dong2021-06-221-5/+0
| | | | | | | | Previous it would hang in CpuDxe if DXE drivers are dispatched above 4GB. Now remove the work around since the fixed in CpuDxe are merged. Signed-off-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com>
* UefiPayloadPkg/UefiPayloadEntry: Improve bootloader memrange parsingPatrick Rudolph2021-06-222-3/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently several DXE crash due to invalid memory resource settings. The PciHostBridgeDxe which expects the MMCONF and PCI Aperature to be EfiMemoryMappedIO, but currently those regions are (partly) mapped as EfiReservedMemoryType. coreboot and slimbootloader provide an e820 compatible memory map, which doesn't work well with EDK2 as the e820 spec is missing MMIO regions. In e820 'reserved' could either mean "DRAM used by boot firmware" or "MMIO in use and not detectable by OS". Guess Top of lower usable DRAM (TOLUD) by walking the bootloader provided memory ranges. Memory types of RAM, ACPI and ACPI NVS below 4 GiB are used to increment TOLUD and reserved memory ranges touching TOLUD at the base are also assumed to be reserved DRAM, which increment TOLUD. Then mark everything reserved below TOLUD as EfiReservedMemoryType and everything reserved above TOLUD as EfiMemoryMappedIO. This fixes assertions seen in PciHostBridgeDxe. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com>
* UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payloadRay Ni2021-06-1610-0/+3350
| | | | | | | | | | | | | | Per universal payload spec, the payload is in ELF format. The patch adds a payload loader that supports to load ELF image. The location of extra data sections whose names start with "upld." is stored in UNIVERSAL_PAYLOAD_EXTRA_DATA HOB. Signed-off-by: Maurice Ma <maurice.ma@intel.com> Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
* UefiPayloadPkg: Use DynamicEx instead of Dynamic to pass PCD across binaryZhiguang Liu2021-06-161-2/+5
| | | | | | | | | | | | | | | | | | When passing PCD database from Edk2 boot loader to Universal Payload, the local token number in boot loader PCD database can be different with that in Payload PCD database. Dynamic PCD directly use local token number, while DynamicEx will search token number by Guid and ExTokenNumber, which are unique pair and can make sure finding the correct token number in boot loader's PCD database. Therefore, using DynamicEx instead of Dynamic. Also, explicitly define some PCDs as DynamicEx, or their default type will be Dynamic Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Create gUniversalPayloadAcpiTableGuid HobZhiguang Liu2021-06-167-23/+18
| | | | | | | | | | | | | | | From SysTableInfo Hob, get ACPI table address, and create gUniversalPayloadAcpiTableGuid Hob to store it. Remove directly adding ACPI table to ConfigurationTable. Dxe ACPI driver will parse it and install ACPI table from Guid Hob. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Create gUniversalPayloadSmbiosTableGuid HobZhiguang Liu2021-06-165-15/+17
| | | | | | | | | | | | | | From SysTableInfo Hob, get Smbios table address, and create gUniversalPayloadSmbiosTableGuid Hob to store it. Remove directly adding smbios table to ConfigurationTable. Dxe module SmbiosDxe will parse it and install smbios table from it. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: UefiPayload retrieve PCI root bridge from Guid HobZhiguang Liu2021-06-165-8/+162
| | | | | | | | | | | | | | UefiPayload parse gUniversalPayloadPciRootBridgeInfoGuid Guid Hob to retrieve PCI root bridges information. gUniversalPayloadPciRootBridgeInfoGuid Guid Hob should be created by Bootloader. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg: Get platform specific logic via protocol for BDSZhiguang Liu2021-06-164-3/+114
| | | | | | | | | | | | | | Currently, BDS driver will link a PlatformBootManagerLib, which contains platform specific logic. This patch get the platform specific logic from a protocol, so that platform logic for Boot manager can be in another binary. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* UefiPayloadPkg/UefiPayloadPkg.dsc: Consume MicrocodeLibRay Ni2021-04-091-0/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3303 Signed-off-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
* UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi2021-03-311-1/+4
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com>