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 <ler...@redhat.com>
---
 .../ArmVirtualizationPlatformLib.inf                       |  4 ++++
 .../Library/ArmVirtualizationPlatformLib/Virt.c            | 14 ++++++++++++++
 2 files changed, 18 insertions(+)

diff --git 
a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
 
b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
index 241766b..09b0123 100644
--- 
a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
+++ 
b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
@@ -34,6 +34,7 @@
   PrintLib
   FdtLib
   SerialPortLib
+  HobLib
 
 [Sources.common]
   Virt.c
@@ -61,3 +62,6 @@
   gArmTokenSpaceGuid.PcdArmPrimaryCore
   gArmTokenSpaceGuid.PcdFdBaseAddress
   gArmTokenSpaceGuid.PcdFdSize
+
+[Guids]
+  gEarlyPL011BaseAddressGuid
diff --git 
a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c
 
b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c
index c10ef91..9056510 100644
--- 
a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c
+++ 
b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c
@@ -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;
       }
-- 
1.8.3.1



------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to