summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/XenioFdtDxe
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-15 14:15:14 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-15 15:31:24 +0100
commitcfc8d51c0cbf97b5e71cfd92dcc6c5760940214f (patch)
tree8330973059c6b0d3de0daf3d7da1a962ff40f0f6 /ArmVirtPkg/XenioFdtDxe
parent38ed4a9e3a65185e7e7b3c891feab1ddc865fdb5 (diff)
downloadedk2-cfc8d51c0cbf97b5e71cfd92dcc6c5760940214f.tar.gz
edk2-cfc8d51c0cbf97b5e71cfd92dcc6c5760940214f.tar.bz2
edk2-cfc8d51c0cbf97b5e71cfd92dcc6c5760940214f.zip
ArmVirtPkg/FdtClientDxe: report address and size cell count directly
The FDT client protocol methods dealing with "reg" properties return the size of a "reg" element. Currently, we have hardcoded this as '8', since #address-cells == #size-cells == 2 in most cases. However, for different values, have a single 'reg' element size is not unambiguous, since - however unlikely - if #address-cells != #size-cells, we do not know which is which. So before adding more methods to the protocol, fix up this oversight. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmVirtPkg/XenioFdtDxe')
-rw-r--r--ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c
index 4a88db3217..ae012a76f5 100644
--- a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c
+++ b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c
@@ -31,7 +31,8 @@ InitializeXenioFdtDxe (
EFI_STATUS Status;
FDT_CLIENT_PROTOCOL *FdtClient;
CONST UINT64 *Reg;
- UINT32 RegElemSize, RegSize;
+ UINT32 RegSize;
+ UINTN AddressCells, SizeCells;
EFI_HANDLE Handle;
UINT64 RegBase;
@@ -40,14 +41,17 @@ InitializeXenioFdtDxe (
ASSERT_EFI_ERROR (Status);
Status = FdtClient->FindCompatibleNodeReg (FdtClient, "xen,xen",
- (CONST VOID **)&Reg, &RegElemSize, &RegSize);
+ (CONST VOID **)&Reg, &AddressCells, &SizeCells,
+ &RegSize);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_WARN, "%a: No 'xen,xen' compatible DT node found\n",
__FUNCTION__));
return EFI_UNSUPPORTED;
}
- ASSERT (RegSize == 16);
+ ASSERT (AddressCells == 2);
+ ASSERT (SizeCells == 2);
+ ASSERT (RegSize == 2 * sizeof (UINT64));
//
// Retrieve the reg base from this node and wire it up to the