summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Doron <benjamin.doron@9elements.com>2025-07-14 13:22:14 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-08-07 11:52:36 +0000
commit4488d4479a0d433a9df2ecf4c5c7863055118256 (patch)
tree0ccd59fab72121900d79f5946584ee440c171f31
parent44d88d5d0c082f618be62ce7ef92cf4a8969e092 (diff)
downloadedk2-4488d4479a0d433a9df2ecf4c5c7863055118256.tar.gz
edk2-4488d4479a0d433a9df2ecf4c5c7863055118256.zip
UefiPayloadPkg/BlSupportDxe: Drop manual reservations for APIC and HPET
The entrypoint module should do this programmatically using resources passed by the bootloader. Under UPL, bootloaders are expected to pass such ranges in the FDT. Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
-rw-r--r--UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c6
-rw-r--r--UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h4
-rw-r--r--UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf2
-rw-r--r--UefiPayloadPkg/BlSupportDxe/X86/BlSupport.c86
4 files changed, 3 insertions, 95 deletions
diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
index 2fd6f7d66f..215bc60f77 100644
--- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
+++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
@@ -1,6 +1,6 @@
/** @file
- This driver will report some MMIO/IO resources to dxe core, extract smbios and acpi
- tables from bootloader.
+ This driver will setup PCDs for DXE phase from HOBs
+ and initialise architecture-specific settings and resources.
Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -30,8 +30,6 @@ BlDxeEntryPoint (
EFI_PEI_GRAPHICS_INFO_HOB *GfxInfo;
ACPI_BOARD_INFO *AcpiBoardInfo;
- Status = EFI_SUCCESS;
-
//
// Find the frame buffer information and update PCDs
//
diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h
index ebae6f2b5e..5f611c3713 100644
--- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h
+++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h
@@ -11,16 +11,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <PiDxe.h>
-#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
-#include <Library/DxeServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
-#include <Library/UefiLib.h>
#include <Library/IoLib.h>
#include <Library/HobLib.h>
-#include <Guid/SmBios.h>
#include <Guid/AcpiBoardInfoGuid.h>
#include <Guid/GraphicsInfoHob.h>
diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
index 4c15fd4eab..401b99f9b6 100644
--- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
+++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
@@ -42,10 +42,8 @@
[LibraryClasses]
UefiDriverEntryPoint
UefiBootServicesTableLib
- DxeServicesTableLib
DebugLib
BaseMemoryLib
- UefiLib
HobLib
[LibraryClasses.AARCH64]
diff --git a/UefiPayloadPkg/BlSupportDxe/X86/BlSupport.c b/UefiPayloadPkg/BlSupportDxe/X86/BlSupport.c
index 56d4c71822..a7bbd88541 100644
--- a/UefiPayloadPkg/BlSupportDxe/X86/BlSupport.c
+++ b/UefiPayloadPkg/BlSupportDxe/X86/BlSupport.c
@@ -6,85 +6,8 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-#include "BlSupportDxe.h"
-
-/**
- Reserve MMIO/IO resource in GCD
-
- @param IsMMIO Flag of whether it is mmio resource or io resource.
- @param GcdType Type of the space.
- @param BaseAddress Base address of the space.
- @param Length Length of the space.
- @param Alignment Align with 2^Alignment
- @param ImageHandle Handle for the image of this driver.
-
- @retval EFI_SUCCESS Reserve successful
-**/
-EFI_STATUS
-ReserveResourceInGcd (
- IN BOOLEAN IsMMIO,
- IN UINTN GcdType,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN UINTN Alignment,
- IN EFI_HANDLE ImageHandle
- )
-{
- EFI_STATUS Status;
-
- if (IsMMIO) {
- Status = gDS->AddMemorySpace (
- GcdType,
- BaseAddress,
- Length,
- EFI_MEMORY_UC
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((
- DEBUG_WARN,
- "Failed to add memory space :0x%lx 0x%lx\n",
- BaseAddress,
- Length
- ));
- }
-
- Status = gDS->AllocateMemorySpace (
- EfiGcdAllocateAddress,
- GcdType,
- Alignment,
- Length,
- &BaseAddress,
- ImageHandle,
- NULL
- );
- } else {
- Status = gDS->AddIoSpace (
- GcdType,
- BaseAddress,
- Length
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((
- DEBUG_WARN,
- "Failed to add IO space :0x%lx 0x%lx\n",
- BaseAddress,
- Length
- ));
- }
-
- Status = gDS->AllocateIoSpace (
- EfiGcdAllocateAddress,
- GcdType,
- Alignment,
- Length,
- &BaseAddress,
- ImageHandle,
- NULL
- );
- }
- return Status;
-}
+#include "BlSupportDxe.h"
/**
Architecture level additional operation which needs to be performed before
@@ -104,12 +27,5 @@ BlArchAdditionalOps (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- //
- // Report MMIO/IO Resources
- //
- ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, ImageHandle); // IOAPIC
-
- ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, ImageHandle); // HPET
-
return EFI_SUCCESS;
}