mirror of https://github.com/acidanthera/audk.git
UefiPayloadPkg: Add PCI root bridge info hob support for SBL
Current UefiPayloadPkg can suport PCI root bridge info HOB provided by bootloader. For UniversalPayload, bootloader can directly provide this HOB for payload consumption. However, for legacy UEFI payload, it is required to migrate the HOB information from bootloader HOB space to UEFI payload HOB space. This patch added the missing part for the bootloader ParseLib in order to support both legacy and universal UEFI payload. This patch was tested on Slim Bootloader with latest UEFI payload, and it worked as expected. Cc: Ray Ni <ray.ni@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com>
This commit is contained in:
parent
6ed6abd6c1
commit
978d428ec3
|
@ -116,4 +116,18 @@ ParseGfxDeviceInfo (
|
|||
OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *GfxDeviceInfo
|
||||
);
|
||||
|
||||
/**
|
||||
Parse and handle the misc info provided by bootloader
|
||||
|
||||
@retval RETURN_SUCCESS The misc information was parsed successfully.
|
||||
@retval RETURN_NOT_FOUND Could not find required misc info.
|
||||
@retval RETURN_OUT_OF_RESOURCES Insufficant memory space.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
ParseMiscInfo (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -560,3 +560,19 @@ ParseGfxDeviceInfo (
|
|||
return RETURN_NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
Parse and handle the misc info provided by bootloader
|
||||
|
||||
@retval RETURN_SUCCESS The misc information was parsed successfully.
|
||||
@retval RETURN_NOT_FOUND Could not find required misc info.
|
||||
@retval RETURN_OUT_OF_RESOURCES Insufficant memory space.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
ParseMiscInfo (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
This library will parse the Slim Bootloader to get required information.
|
||||
|
||||
Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
@ -15,7 +15,7 @@
|
|||
#include <Library/HobLib.h>
|
||||
#include <Library/BlParseLib.h>
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
|
||||
#include <UniversalPayload/PciRootBridges.h>
|
||||
|
||||
/**
|
||||
This function retrieves the parameter base address from boot loader.
|
||||
|
@ -221,3 +221,46 @@ ParseGfxDeviceInfo (
|
|||
return RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Parse and handle the misc info provided by bootloader
|
||||
|
||||
@retval RETURN_SUCCESS The misc information was parsed successfully.
|
||||
@retval RETURN_NOT_FOUND Could not find required misc info.
|
||||
@retval RETURN_OUT_OF_RESOURCES Insufficant memory space.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
ParseMiscInfo (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
RETURN_STATUS Status;
|
||||
UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *BlRootBridgesHob;
|
||||
UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PldRootBridgesHob;
|
||||
|
||||
Status = RETURN_NOT_FOUND;
|
||||
BlRootBridgesHob = (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) GetGuidHobDataFromSbl (
|
||||
&gUniversalPayloadPciRootBridgeInfoGuid
|
||||
);
|
||||
if (BlRootBridgesHob != NULL) {
|
||||
//
|
||||
// Migrate bootloader root bridge info hob from bootloader to payload.
|
||||
//
|
||||
PldRootBridgesHob = BuildGuidHob (
|
||||
&gUniversalPayloadPciRootBridgeInfoGuid,
|
||||
BlRootBridgesHob->Header.Length
|
||||
);
|
||||
ASSERT (PldRootBridgesHob != NULL);
|
||||
if (PldRootBridgesHob != NULL) {
|
||||
CopyMem (PldRootBridgesHob, BlRootBridgesHob, BlRootBridgesHob->Header.Length);
|
||||
DEBUG ((DEBUG_INFO, "Create PCI root bridge info guid hob\n"));
|
||||
Status = RETURN_SUCCESS;
|
||||
} else {
|
||||
Status = RETURN_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
gLoaderMemoryMapInfoGuid
|
||||
gEfiGraphicsInfoHobGuid
|
||||
gEfiGraphicsDeviceInfoHobGuid
|
||||
gUniversalPayloadPciRootBridgeInfoGuid
|
||||
|
||||
[Pcd]
|
||||
gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter
|
||||
|
|
|
@ -321,6 +321,14 @@ BuildHobFromBl (
|
|||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Parse the misc info provided by bootloader
|
||||
//
|
||||
Status = ParseMiscInfo ();
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_WARN, "Error when parsing misc info, Status = %r\n", Status));
|
||||
}
|
||||
|
||||
//
|
||||
// Parse platform specific information.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue