summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Library
diff options
context:
space:
mode:
authorRonald Cron <Ronald.Cron@arm.com>2015-02-26 11:02:39 +0000
committeroliviermartin <oliviermartin@Edk2>2015-02-26 11:02:39 +0000
commit6332ffb0affadde53e45325d81b084bc9936ef02 (patch)
tree553fcbe92b3d80b31e11b68c41e864feeb3bbc47 /ArmPlatformPkg/Library
parent7aec2926b926ad90d09fb026af0ee04c4c831237 (diff)
ArmPlatformPkg/Bds: Remove any use of the "Fdt" UEFI variable
Remove the option to update the "Fdt" UEFI variable in the ARM BDS as the "setfdt" EFI Shell command provides this service from now. Remove the use of this variable in the legacy kernel boot loader and use the FDT installed in the configuration table instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <Ronald.Cron@arm.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16940 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Library')
-rw-r--r--ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c36
-rw-r--r--ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf4
2 files changed, 13 insertions, 27 deletions
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c
index dcd7c4100..8aae7b2c4 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c
@@ -27,6 +27,7 @@
#include <Protocol/DevicePathFromText.h>
#include <Guid/ArmGlobalVariableHob.h>
+#include <Guid/Fdt.h>
#include <libfdt.h>
@@ -178,41 +179,28 @@ EblDumpFdt (
IN CHAR8 **Argv
)
{
- EFI_STATUS Status;
- EFI_DEVICE_PATH* FdtDevicePath;
- EFI_PHYSICAL_ADDRESS FdtBlob;
- UINTN FdtBlobSize;
- UINTN Ret;
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;
+ EFI_STATUS Status;
+ VOID *FdtBlob;
+ UINTN Ret;
// If no FDT file is passed to the argument then get the one from the platform
if (Argc < 2) {
- Status = GetEnvironmentVariable (L"Fdt", &gArmGlobalVariableGuid, NULL, NULL, (VOID**)&FdtDevicePath);
- if (Status == EFI_NOT_FOUND) {
- // No set yet, get the Default Device Path
- Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);
- ASSERT_EFI_ERROR(Status);
- FdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &FdtBlob);
+ if (EFI_ERROR (Status)) {
+ Print (L"ERROR: Did not find the Fdt Blob.\n");
+ return Status;
}
} else {
return EFI_NOT_FOUND;
}
- Status = BdsLoadImage (FdtDevicePath, AllocateAnyPages, &FdtBlob, &FdtBlobSize);
- if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find the Fdt Blob.\n");
- return Status;
- }
-
- Ret = fdt_check_header((CONST VOID*)(UINTN)FdtBlob);
+ Ret = fdt_check_header (FdtBlob);
if (Ret != 0) {
- Print (L"ERROR: Device Tree header not valid (err:%d)\n",Ret);
- return Status;
+ Print (L"ERROR: Device Tree header not valid (err:%d)\n", Ret);
+ return EFI_INVALID_PARAMETER;
}
- DumpFdt ((VOID*)(UINTN)FdtBlob);
-
- FreePool (FdtDevicePath);
+ DumpFdt (FdtBlob);
return EFI_SUCCESS;
}
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
index 5506c77eb..c4b2ae1f6 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
@@ -61,6 +61,4 @@
[Guids]
gEfiDebugImageInfoTableGuid
-
-[Pcd]
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath
+ gFdtTableGuid