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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user