@@ -17,6 +17,7 @@
#include <Library/DevicePathLib.h>
#include <Library/DxeServicesLib.h>
#include <Library/HiiLib.h>
+#include <Library/PcdLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
@@ -121,7 +122,9 @@ DtPlatformDxeEntryPoint (
//
Dtb = NULL;
Status = GetSectionFromAnyFv (&gDtPlatformDefaultDtbFileGuid,
- EFI_SECTION_RAW, 0, &Dtb, &DtbSize);
+ EFI_SECTION_RAW,
+ PcdGet8 (PcdDtPlatformDefaultDtbSectionIndex),
+ &Dtb, &DtbSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "%a: no DTB blob found, defaulting to ACPI\n",
__FUNCTION__));
@@ -43,6 +43,7 @@ [LibraryClasses]
DxeServicesLib
HiiLib
MemoryAllocationLib
+ PcdLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiRuntimeServicesTableLib
@@ -56,3 +57,6 @@ [Guids]
[Depex]
gEfiVariableArchProtocolGuid AND
gEfiVariableWriteArchProtocolGuid
+
+[Pcd]
+ gEmbeddedTokenSpaceGuid.PcdDtPlatformDefaultDtbSectionIndex
@@ -198,3 +198,6 @@ [PcdsFixedAtBuild.X64]
[PcdsFixedAtBuild.common, PcdsDynamic.common]
gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L""|VOID*|0x00000055
+
+ # the section containing the default DTB for the current platform
+ gEmbeddedTokenSpaceGuid.PcdDtPlatformDefaultDtbSectionIndex|0|UINT8|0x00000057
To allow some dynamic behavior in selecting the DTB to expose to the OS, allow the DTB FV file to contain multiple sections, and indirect the choice of section via a fixed/dynamic PCD, which defaults to 0. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c | 5 ++++- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf | 4 ++++ EmbeddedPkg/EmbeddedPkg.dec | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel