summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec2
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc3
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf3
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.c11
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.inf4
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c10
-rw-r--r--ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf3
7 files changed, 20 insertions, 16 deletions
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec
index ddb79904fa..7ab2405b88 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec
@@ -44,8 +44,6 @@
gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0|UINT64|0x00000001
[PcdsDynamic, PcdsFixedAtBuild]
- gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeBaseAddress|0x0|UINT64|0x00000002
-
#
# ARM PSCI function invocations can be done either through hypervisor
# calls (HVC) or secure monitor calls (SMC).
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
index 0da1224649..2fd641fb65 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
@@ -176,9 +176,6 @@
# System Memory Size -- 1 MB initially, actual size will be fetched from DT
gArmTokenSpaceGuid.PcdSystemMemorySize|0x00100000
- # location of the device tree blob passed by QEMU
- gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeBaseAddress|0x0
-
gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|0x0
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x0
gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|0x0
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
index 43b3c6ca1b..2cff4b62ea 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf
@@ -30,11 +30,10 @@
[LibraryClasses]
IoLib
+ MemoryAllocationLib
ArmLib
PrintLib
FdtLib
- SerialPortLib
- HobLib
[Sources.common]
Virt.c
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.c b/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.c
index 58bc2b828d..c500d5964b 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.c
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.c
@@ -22,6 +22,7 @@
#include <libfdt.h>
#include <Guid/EarlyPL011BaseAddress.h>
+#include <Guid/FdtHob.h>
EFI_STATUS
EFIAPI
@@ -32,6 +33,7 @@ PlatformPeim (
VOID *Base;
VOID *NewBase;
UINTN FdtSize;
+ UINT64 *FdtHobData;
UINT64 *UartHobData;
INT32 Node, Prev;
CONST CHAR8 *Compatible;
@@ -41,15 +43,18 @@ PlatformPeim (
UINT64 UartBase;
- Base = (VOID*)(UINTN)FixedPcdGet64 (PcdDeviceTreeInitialBaseAddress);
+ Base = (VOID*)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);
+ ASSERT (Base != NULL);
ASSERT (fdt_check_header (Base) == 0);
FdtSize = fdt_totalsize (Base);
NewBase = AllocatePages (EFI_SIZE_TO_PAGES (FdtSize));
ASSERT (NewBase != NULL);
-
CopyMem (NewBase, Base, FdtSize);
- PcdSet64 (PcdDeviceTreeBaseAddress, (UINT64)(UINTN)NewBase);
+
+ FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof *FdtHobData);
+ ASSERT (FdtHobData != NULL);
+ *FdtHobData = (UINTN)NewBase;
UartHobData = BuildGuidHob (&gEarlyPL011BaseAddressGuid, sizeof *UartHobData);
ASSERT (UartHobData != NULL);
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.inf b/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
index a376fbd1f3..96019e4009 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
@@ -41,11 +41,9 @@
gArmTokenSpaceGuid.PcdFvSize
gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
-[Pcd]
- gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeBaseAddress
-
[Guids]
gEarlyPL011BaseAddressGuid
+ gFdtHobGuid
[Depex]
gEfiPeiMemoryDiscoveredPpiGuid
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
index 041ad88e10..e63294a12e 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
@@ -24,10 +24,12 @@
#include <Library/DevicePathLib.h>
#include <Library/PcdLib.h>
#include <Library/DxeServicesLib.h>
+#include <Library/HobLib.h>
#include <libfdt.h>
#include <Guid/Fdt.h>
#include <Guid/VirtioMmioTransport.h>
+#include <Guid/FdtHob.h>
#pragma pack (1)
typedef struct {
@@ -277,6 +279,7 @@ InitializeVirtFdtDxe (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
+ VOID *Hob;
VOID *DeviceTreeBase;
INT32 Node, Prev;
INT32 RtcNode;
@@ -297,8 +300,11 @@ InitializeVirtFdtDxe (
UINT64 FwCfgDataAddress;
UINT64 FwCfgDataSize;
- DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress);
- ASSERT (DeviceTreeBase != NULL);
+ Hob = GetFirstGuidHob(&gFdtHobGuid);
+ if (Hob == NULL || GET_GUID_HOB_DATA_SIZE (Hob) != sizeof (UINT64)) {
+ return EFI_NOT_FOUND;
+ }
+ DeviceTreeBase = (VOID *)(UINTN)*(UINT64 *)GET_GUID_HOB_DATA (Hob);
if (fdt_check_header (DeviceTreeBase) != 0) {
DEBUG ((EFI_D_ERROR, "%a: No DTB found @ 0x%p\n", __FUNCTION__, DeviceTreeBase));
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf
index cdfca61060..bca0f0b5f3 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf
@@ -41,13 +41,14 @@
DxeServicesLib
FdtLib
VirtioMmioDeviceLib
+ HobLib
[Guids]
gFdtTableGuid
gVirtioMmioTransportGuid
+ gFdtHobGuid
[Pcd]
- gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeBaseAddress
gArmVirtualizationTokenSpaceGuid.PcdArmPsciMethod
gArmVirtualizationTokenSpaceGuid.PcdFwCfgSelectorAddress
gArmVirtualizationTokenSpaceGuid.PcdFwCfgDataAddress