diff options
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c | 8 | ||||
-rw-r--r-- | EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c | 22 | ||||
-rw-r--r-- | EmbeddedPkg/EmbeddedPkg.dsc | 2 | ||||
-rw-r--r-- | EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c | 32 |
4 files changed, 32 insertions, 32 deletions
diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c index e846394180..f1a6f78f50 100644 --- a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c @@ -8,11 +8,11 @@ #include <Uefi.h>
#include <IndustryStandard/Acpi.h>
-#include <libfdt.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
+#include <Library/FdtLib.h>
#include <Library/HiiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
@@ -123,18 +123,18 @@ RemoveDtStdoutPath ( return;
}
- Node = fdt_path_offset (Dtb, "/chosen");
+ Node = FdtPathOffset (Dtb, "/chosen");
if (Node < 0) {
return;
}
- Error = fdt_delprop (Dtb, Node, "stdout-path");
+ Error = FdtDelProp (Dtb, Node, "stdout-path");
if (Error) {
DEBUG ((
DEBUG_INFO,
"%a: Failed to delete 'stdout-path' property: %a\n",
__func__,
- fdt_strerror (Error)
+ FdtStrerror (Error)
));
}
}
diff --git a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c index 42d9281b29..6d2fea6c41 100644 --- a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c +++ b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c @@ -9,10 +9,10 @@ #include <Library/BaseLib.h>
#include <Library/DebugLib.h>
+#include <Library/FdtLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/HobLib.h>
-#include <libfdt.h>
#include <Guid/Fdt.h>
#include <Guid/FdtHob.h>
@@ -38,7 +38,7 @@ GetNodeProperty ( ASSERT (mDeviceTreeBase != NULL);
ASSERT (Prop != NULL);
- *Prop = fdt_getprop (mDeviceTreeBase, Node, PropertyName, &Len);
+ *Prop = FdtGetProp (mDeviceTreeBase, Node, PropertyName, &Len);
if (*Prop == NULL) {
return EFI_NOT_FOUND;
}
@@ -65,7 +65,7 @@ SetNodeProperty ( ASSERT (mDeviceTreeBase != NULL);
- Ret = fdt_setprop (mDeviceTreeBase, Node, PropertyName, Prop, PropSize);
+ Ret = FdtSetProp (mDeviceTreeBase, Node, PropertyName, Prop, PropSize);
if (Ret != 0) {
return EFI_DEVICE_ERROR;
}
@@ -87,7 +87,7 @@ IsNodeEnabled ( // may occur here. If the status property is present, check whether
// it is set to 'ok' or 'okay', anything else is treated as 'disabled'.
//
- NodeStatus = fdt_getprop (mDeviceTreeBase, Node, "status", &Len);
+ NodeStatus = FdtGetProp (mDeviceTreeBase, Node, "status", &Len);
if (NodeStatus == NULL) {
return TRUE;
}
@@ -121,7 +121,7 @@ FindNextCompatibleNode ( ASSERT (Node != NULL);
for (Prev = PrevNode; ; Prev = Next) {
- Next = fdt_next_node (mDeviceTreeBase, Prev, NULL);
+ Next = FdtNextNode (mDeviceTreeBase, Prev, NULL);
if (Next < 0) {
break;
}
@@ -130,7 +130,7 @@ FindNextCompatibleNode ( continue;
}
- Type = fdt_getprop (mDeviceTreeBase, Next, "compatible", &Len);
+ Type = FdtGetProp (mDeviceTreeBase, Next, "compatible", &Len);
if (Type == NULL) {
continue;
}
@@ -257,12 +257,12 @@ FindNextMemoryNodeReg ( ASSERT (Node != NULL);
for (Prev = PrevNode; ; Prev = Next) {
- Next = fdt_next_node (mDeviceTreeBase, Prev, NULL);
+ Next = FdtNextNode (mDeviceTreeBase, Prev, NULL);
if (Next < 0) {
break;
}
- DeviceType = fdt_getprop (mDeviceTreeBase, Next, "device_type", &Len);
+ DeviceType = FdtGetProp (mDeviceTreeBase, Next, "device_type", &Len);
if ((DeviceType == NULL) || (AsciiStrCmp (DeviceType, "memory") != 0)) {
continue;
}
@@ -342,9 +342,9 @@ GetOrInsertChosenNode ( ASSERT (mDeviceTreeBase != NULL);
ASSERT (Node != NULL);
- NewNode = fdt_path_offset (mDeviceTreeBase, "/chosen");
+ NewNode = FdtPathOffset (mDeviceTreeBase, "/chosen");
if (NewNode < 0) {
- NewNode = fdt_add_subnode (mDeviceTreeBase, 0, "/chosen");
+ NewNode = FdtAddSubnode (mDeviceTreeBase, 0, "/chosen");
}
if (NewNode < 0) {
@@ -422,7 +422,7 @@ InitializeFdtClientDxe ( DeviceTreeBase = (VOID *)(UINTN)*(UINT64 *)GET_GUID_HOB_DATA (Hob);
- if (fdt_check_header (DeviceTreeBase) != 0) {
+ if (FdtCheckHeader (DeviceTreeBase) != 0) {
DEBUG ((
DEBUG_ERROR,
"%a: No DTB found @ 0x%p\n",
diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc index 2259c8fcec..482329127e 100644 --- a/EmbeddedPkg/EmbeddedPkg.dsc +++ b/EmbeddedPkg/EmbeddedPkg.dsc @@ -90,7 +90,7 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
AcpiLib|EmbeddedPkg/Library/AcpiLib/AcpiLib.inf
- FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
+ FdtLib|MdePkg/Library/BaseFdtLib/BaseFdtLib.inf
# Shell libraries
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c index 1a0c92d4de..9c1621343f 100644 --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c @@ -7,9 +7,9 @@ **/
-#include <libfdt.h>
#include <Library/AndroidBootImgLib.h>
#include <Library/BaseMemoryLib.h>
+#include <Library/FdtLib.h>
#include <Library/PrintLib.h>
#include <Library/DevicePathLib.h>
#include <Library/UefiBootServicesTableLib.h>
@@ -434,7 +434,7 @@ AndroidBootImgLocateFdt ( return Status;
}
- Err = fdt_check_header (*FdtBase);
+ Err = FdtCheckHeader (*FdtBase);
if (Err != 0) {
DEBUG ((
DEBUG_ERROR,
@@ -454,9 +454,9 @@ AndroidBootImgGetChosenNode ( {
INTN ChosenNode;
- ChosenNode = fdt_subnode_offset ((CONST VOID *)UpdatedFdtBase, 0, "chosen");
+ ChosenNode = FdtSubnodeOffset ((CONST VOID *)UpdatedFdtBase, 0, "chosen");
if (ChosenNode < 0) {
- ChosenNode = fdt_add_subnode ((VOID *)UpdatedFdtBase, 0, "chosen");
+ ChosenNode = FdtAddSubnode ((VOID *)UpdatedFdtBase, 0, "chosen");
if (ChosenNode < 0) {
DEBUG ((DEBUG_ERROR, "Fail to find fdt node chosen!\n"));
return 0;
@@ -474,19 +474,19 @@ AndroidBootImgSetProperty64 ( IN UINT64 Val
)
{
- INTN Err;
- struct fdt_property *Property;
- int Len;
+ INTN Err;
+ CONST FDT_PROPERTY *Property;
+ int Len;
- Property = fdt_get_property_w (
+ Property = FdtGetPropertyW (
(VOID *)UpdatedFdtBase,
ChosenNode,
PropertyName,
&Len
);
if ((NULL == Property) && (Len == -FDT_ERR_NOTFOUND)) {
- Val = cpu_to_fdt64 (Val);
- Err = fdt_appendprop (
+ Val = CpuToFdt64 (Val);
+ Err = FdtAppendProp (
(VOID *)UpdatedFdtBase,
ChosenNode,
PropertyName,
@@ -494,18 +494,18 @@ AndroidBootImgSetProperty64 ( sizeof (UINT64)
);
if (Err) {
- DEBUG ((DEBUG_ERROR, "fdt_appendprop() fail: %a\n", fdt_strerror (Err)));
+ DEBUG ((DEBUG_ERROR, "FdtAppendProp() fail: %a\n", FdtStrerror (Err)));
return EFI_INVALID_PARAMETER;
}
} else if (Property != NULL) {
- Err = fdt_setprop_u64 (
+ Err = FdtSetPropU64 (
(VOID *)UpdatedFdtBase,
ChosenNode,
PropertyName,
Val
);
if (Err) {
- DEBUG ((DEBUG_ERROR, "fdt_setprop_u64() fail: %a\n", fdt_strerror (Err)));
+ DEBUG ((DEBUG_ERROR, "FdtSetpropU64() fail: %a\n", FdtStrerror (Err)));
return EFI_INVALID_PARAMETER;
}
} else {
@@ -528,7 +528,7 @@ AndroidBootImgUpdateFdt ( EFI_STATUS Status;
EFI_PHYSICAL_ADDRESS UpdatedFdtBase, NewFdtBase;
- NewFdtSize = (UINTN)fdt_totalsize (FdtBase)
+ NewFdtSize = (UINTN)FdtTotalSize (FdtBase)
+ FDT_ADDITIONAL_ENTRIES_SIZE;
Status = gBS->AllocatePages (
AllocateAnyPages,
@@ -546,9 +546,9 @@ AndroidBootImgUpdateFdt ( }
// Load the Original FDT tree into the new region
- Err = fdt_open_into (FdtBase, (VOID *)(INTN)UpdatedFdtBase, NewFdtSize);
+ Err = FdtOpenInto (FdtBase, (VOID *)(INTN)UpdatedFdtBase, NewFdtSize);
if (Err) {
- DEBUG ((DEBUG_ERROR, "fdt_open_into(): %a\n", fdt_strerror (Err)));
+ DEBUG ((DEBUG_ERROR, "FdtOpenInto(): %a\n", FdtStrerror (Err)));
Status = EFI_INVALID_PARAMETER;
goto Fdt_Exit;
}
|