From 8028b2907e20b21cd7d69639a36ac82a77c81dc1 Mon Sep 17 00:00:00 2001 From: Marcello Sylvester Bauer Date: Wed, 22 Jul 2020 11:00:29 +0200 Subject: UefiPayloadPkg: Support variable size MMCONF space The default size is still 256MiB, but will be overwritten by UefiPayloadPkg with the real MMCONF size. e.g.: On embedded AMD platforms the MMCONF window size is usually only 64MiB. Fixes crash on platforms not exposing 256 buses. Tested on: * AMD Stoney Ridge Signed-off-by: Patrick Rudolph Signed-off-by: Marcello Sylvester Bauer Cc: Patrick Rudolph Cc: Christian Walter Cc: Maurice Ma Cc: Nate DeSimone Cc: Benjamin You Reviewed-by: Guo Dong --- UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c | 4 +++- UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'UefiPayloadPkg/BlSupportDxe') diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c index a3974dcc02..a746d0581e 100644 --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c @@ -155,13 +155,15 @@ BlDxeEntryPoint ( } // - // Set PcdPciExpressBaseAddress by HOB info + // Set PcdPciExpressBaseAddress and PcdPciExpressBaseSize by HOB info // GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); if (GuidHob != NULL) { AcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob); Status = PcdSet64S (PcdPciExpressBaseAddress, AcpiBoardInfo->PcieBaseAddress); ASSERT_EFI_ERROR (Status); + Status = PcdSet64S (PcdPciExpressBaseSize, AcpiBoardInfo->PcieBaseSize); + ASSERT_EFI_ERROR (Status); } return EFI_SUCCESS; diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf index 1371d5eb79..cebc811355 100644 --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf @@ -54,6 +54,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize [Depex] TRUE -- cgit v1.2.3