summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 23:23:19 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 23:23:19 +0000
commit95b3580f8217f1cd19994b480447c42cee752a20 (patch)
treee74999daa7666e1ccfa32f2a1fc8df538a51a2ab /ArmPlatformPkg
parent1ddb209e0e7d57d13483a52db2e0f9483b150b68 (diff)
downloadedk2-platforms-95b3580f8217f1cd19994b480447c42cee752a20.tar.xz
ArmPlatformPkg/Bds: Add an option in the Boot Manager to edit the Device Path of the Platform Device Tree
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12430 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Bds/BootMenu.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c
index 543958bf17..7d1010bac2 100644
--- a/ArmPlatformPkg/Bds/BootMenu.c
+++ b/ArmPlatformPkg/Bds/BootMenu.c
@@ -436,6 +436,49 @@ EXIT:
return Status;
}
+EFI_STATUS
+UpdateFdtPath (
+ IN LIST_ENTRY *BootOptionsList
+ )
+{
+ EFI_STATUS Status;
+
+ BDS_SUPPORTED_DEVICE *SupportedBootDevice;
+ EFI_DEVICE_PATH_PROTOCOL *FdtDevicePathNode;
+ EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;
+
+ Status = SelectBootDevice (&SupportedBootDevice);
+ if (EFI_ERROR(Status)) {
+ Status = EFI_ABORTED;
+ goto EXIT;
+ }
+
+ // Create the specific device path node
+ Print(L"File path of the FDT blob: ");
+ Status = SupportedBootDevice->Support->CreateDevicePathNode (SupportedBootDevice, &FdtDevicePathNode, NULL, NULL);
+ if (EFI_ERROR(Status)) {
+ Status = EFI_ABORTED;
+ goto EXIT;
+ }
+
+ if (FdtDevicePathNode != NULL) {
+ // Append the Device Path node to the select device path
+ FdtDevicePath = AppendDevicePathNode (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNode);
+ Status = gRT->SetVariable ((CHAR16*)L"FDT", &gEfiGlobalVariableGuid, (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS ), 4, &FdtDevicePath);
+ ASSERT_EFI_ERROR(Status);
+ } else {
+ gRT->SetVariable ((CHAR16*)L"FDT", &gEfiGlobalVariableGuid, (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS ), 0, NULL);
+ ASSERT_EFI_ERROR(Status);
+ }
+
+EXIT:
+ if (Status == EFI_ABORTED) {
+ Print(L"\n");
+ }
+ FreePool(SupportedBootDevice);
+ return Status;
+}
+
struct BOOT_MANAGER_ENTRY {
CONST CHAR16* Description;
EFI_STATUS (*Callback) (IN LIST_ENTRY *BootOptionsList);
@@ -443,6 +486,7 @@ struct BOOT_MANAGER_ENTRY {
{ L"Add Boot Device Entry", BootMenuAddBootOption },
{ L"Update Boot Device Entry", BootMenuUpdateBootOption },
{ L"Remove Boot Device Entry", BootMenuRemoveBootOption },
+ { L"Update FDT path", UpdateFdtPath },
};
EFI_STATUS