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>
This commit is contained in:
Benjamin Doron
2025-07-14 13:22:14 -04:00
committed by mergify[bot]
parent 44d88d5d0c
commit 4488d4479a
4 changed files with 3 additions and 95 deletions

View File

@@ -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
//

View File

@@ -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>

View File

@@ -42,10 +42,8 @@
[LibraryClasses]
UefiDriverEntryPoint
UefiBootServicesTableLib
DxeServicesTableLib
DebugLib
BaseMemoryLib
UefiLib
HobLib
[LibraryClasses.AARCH64]

View File

@@ -6,86 +6,9 @@
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;
}
/**
Architecture level additional operation which needs to be performed before
launching payload.
@@ -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;
}