diff options
Diffstat (limited to 'ArmVirtPkg/PrePi/FdtParser.c')
-rw-r--r-- | ArmVirtPkg/PrePi/FdtParser.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ArmVirtPkg/PrePi/FdtParser.c b/ArmVirtPkg/PrePi/FdtParser.c index 5a91f7e62d..3f443b7f0d 100644 --- a/ArmVirtPkg/PrePi/FdtParser.c +++ b/ArmVirtPkg/PrePi/FdtParser.c @@ -5,7 +5,8 @@ */
#include <Uefi.h>
-#include <Include/libfdt.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/FdtLib.h>
BOOLEAN
FindMemnode (
@@ -20,14 +21,14 @@ FindMemnode ( INT32 Length;
CONST INT32 *Prop;
- if (fdt_check_header (DeviceTreeBlob) != 0) {
+ if (FdtCheckHeader (DeviceTreeBlob) != 0) {
return FALSE;
}
//
// Look for a node called "memory" at the lowest level of the tree
//
- MemoryNode = fdt_path_offset (DeviceTreeBlob, "/memory");
+ MemoryNode = FdtPathOffset (DeviceTreeBlob, "/memory");
if (MemoryNode <= 0) {
return FALSE;
}
@@ -39,36 +40,36 @@ FindMemnode ( AddressCells = 1;
SizeCells = 1;
- Prop = fdt_getprop (DeviceTreeBlob, 0, "#address-cells", &Length);
+ Prop = FdtGetProp (DeviceTreeBlob, 0, "#address-cells", &Length);
if (Length == 4) {
- AddressCells = fdt32_to_cpu (*Prop);
+ AddressCells = Fdt32ToCpu (*Prop);
}
- Prop = fdt_getprop (DeviceTreeBlob, 0, "#size-cells", &Length);
+ Prop = FdtGetProp (DeviceTreeBlob, 0, "#size-cells", &Length);
if (Length == 4) {
- SizeCells = fdt32_to_cpu (*Prop);
+ SizeCells = Fdt32ToCpu (*Prop);
}
//
// Now find the 'reg' property of the /memory node, and read the first
// range listed.
//
- Prop = fdt_getprop (DeviceTreeBlob, MemoryNode, "reg", &Length);
+ Prop = FdtGetProp (DeviceTreeBlob, MemoryNode, "reg", &Length);
if (Length < (AddressCells + SizeCells) * sizeof (INT32)) {
return FALSE;
}
- *SystemMemoryBase = fdt32_to_cpu (Prop[0]);
+ *SystemMemoryBase = Fdt32ToCpu (Prop[0]);
if (AddressCells > 1) {
- *SystemMemoryBase = (*SystemMemoryBase << 32) | fdt32_to_cpu (Prop[1]);
+ *SystemMemoryBase = (*SystemMemoryBase << 32) | Fdt32ToCpu (Prop[1]);
}
Prop += AddressCells;
- *SystemMemorySize = fdt32_to_cpu (Prop[0]);
+ *SystemMemorySize = Fdt32ToCpu (Prop[0]);
if (SizeCells > 1) {
- *SystemMemorySize = (*SystemMemorySize << 32) | fdt32_to_cpu (Prop[1]);
+ *SystemMemorySize = (*SystemMemorySize << 32) | Fdt32ToCpu (Prop[1]);
}
return TRUE;
@@ -80,6 +81,6 @@ CopyFdt ( IN VOID *FdtSource
)
{
- fdt_pack (FdtSource);
- CopyMem (FdtDest, FdtSource, fdt_totalsize (FdtSource));
+ FdtPack (FdtSource);
+ CopyMem (FdtDest, FdtSource, FdtTotalSize (FdtSource));
}
|