@@ -34,6 +34,7 @@
PrintLib
FdtLib
SerialPortLib
+ HobLib
[Sources.common]
Virt.c
@@ -61,3 +62,6 @@
gArmTokenSpaceGuid.PcdArmPrimaryCore
gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdFdSize
+
+[Guids]
+ gEarlyPL011BaseAddressGuid
@@ -2,6 +2,7 @@
*
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
* Copyright (c) 2014, Linaro Limited. All rights reserved.
+* Copyright (c) 2014, Red Hat, Inc.
*
*
* This program and the accompanying materials
@@ -20,6 +21,12 @@
#include <Library/PcdLib.h>
#include <ArmPlatform.h>
#include <libfdt.h>
+#include <Pi/PiBootMode.h>
+#include <Uefi/UefiBaseType.h>
+#include <Uefi/UefiMultiPhase.h>
+#include <Pi/PiHob.h>
+#include <Library/HobLib.h>
+#include <Guid/EarlyPL011BaseAddress.h>
/**
Return the current Boot Mode
@@ -71,6 +78,7 @@ ArmPlatformInitializeSystemMemory (
UINT64 NewBase;
UINT64 NewSize;
BOOLEAN HaveMemory, HaveUART;
+ UINT64 *HobData;
NewBase = 0;
NewSize = 0;
@@ -78,6 +86,10 @@ ArmPlatformInitializeSystemMemory (
HaveMemory = FALSE;
HaveUART = FALSE;
+ HobData = BuildGuidHob (&gEarlyPL011BaseAddressGuid, sizeof *HobData);
+ ASSERT (HobData != NULL);
+ *HobData = 0;
+
DeviceTreeBase = (VOID *)(UINTN)FixedPcdGet64 (PcdDeviceTreeInitialBaseAddress);
ASSERT (DeviceTreeBase != NULL);
@@ -155,6 +167,8 @@ ArmPlatformInitializeSystemMemory (
DEBUG ((EFI_D_INFO, "%a: PL011 UART @ 0x%lx\n", __FUNCTION__, UartBase));
PcdSet64 (PcdPL011BaseAddress, UartBase);
+ *HobData = UartBase;
+
HaveUART = TRUE;
continue;
}
In this patch we stash the dynamic UART base in a HOB, for the DXE CORE only. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- .../ArmVirtualizationPlatformLib.inf | 4 ++++ .../Library/ArmVirtualizationPlatformLib/Virt.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+)