diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-02-28 20:26:00 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-02-28 20:26:00 +0000 |
commit | cc667df08ae8208865744465eafa446b39b2805d (patch) | |
tree | 29b4d2e9bdc50735b45732b2990c4b81b95dcd8b /ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe | |
parent | 337d450e20149480a59db7598078dce4565f8059 (diff) | |
download | edk2-platforms-cc667df08ae8208865744465eafa446b39b2805d.tar.xz |
ArmVirtualizationPkg: use a HOB to store device tree blob
Instead of using a dynamic PCD, store the device tree address in a HOB
so that we can also run under a configuration that does not support
dynamic PCDs.
This also adds MemoryAllocationLib to the [LibraryClasses] section of
ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf, as this
dependency was formerly satisfied transitively through one of the
library dependencies that were dropped.
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16959 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe')
-rw-r--r-- | ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c | 10 | ||||
-rw-r--r-- | ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf | 3 |
2 files changed, 10 insertions, 3 deletions
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
|