]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootMenu.c
ArmPlatformPkg/Bds: Remove any use of the "Fdt" UEFI variable
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootMenu.c
index 91e00b759ee48bb2073c34907f5f4d3f4b215d46..76c66fd0bb3f867442dbdbc3473774e4d715dc4b 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -341,6 +341,9 @@ BootMenuAddBootOption (
       if (InitrdPathNodes != NULL) {\r
         // Append the Device Path to the selected device path\r
         InitrdPath = AppendDevicePath (SupportedBootDevice->DevicePathProtocol, (CONST EFI_DEVICE_PATH_PROTOCOL *)InitrdPathNodes);\r
+        // Free the InitrdPathNodes created by Support->CreateDevicePathNode()\r
+        FreePool (InitrdPathNodes);\r
+\r
         if (InitrdPath == NULL) {\r
           Status = EFI_OUT_OF_RESOURCES;\r
           goto EXIT;\r
@@ -540,6 +543,8 @@ BootMenuUpdateBootOption (
           // Append the Device Path to the selected device path\r
           InitrdPath = AppendDevicePath (TempInitrdPath, (CONST EFI_DEVICE_PATH_PROTOCOL *)InitrdPathNodes);\r
           FreePool (TempInitrdPath);\r
+          // Free the InitrdPathNodes created by Support->CreateDevicePathNode()\r
+          FreePool (InitrdPathNodes);\r
           if (InitrdPath == NULL) {\r
             Status = EFI_OUT_OF_RESOURCES;\r
             goto EXIT;\r
@@ -819,61 +824,6 @@ ErrorExit:
   return Status ;\r
 }\r
 \r
-EFI_STATUS\r
-UpdateFdtPath (\r
-  IN LIST_ENTRY *BootOptionsList\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  UINTN                     FdtDevicePathSize;\r
-  BDS_SUPPORTED_DEVICE      *SupportedBootDevice;\r
-  EFI_DEVICE_PATH_PROTOCOL  *FdtDevicePathNodes;\r
-  EFI_DEVICE_PATH_PROTOCOL  *FdtDevicePath;\r
-\r
-  Status = SelectBootDevice (&SupportedBootDevice);\r
-  if (EFI_ERROR(Status)) {\r
-    Status = EFI_ABORTED;\r
-    goto EXIT;\r
-  }\r
-\r
-  // Create the specific device path node\r
-  Status = SupportedBootDevice->Support->CreateDevicePathNode (L"FDT blob", &FdtDevicePathNodes);\r
-  if (EFI_ERROR(Status)) {\r
-    Status = EFI_ABORTED;\r
-    goto EXIT;\r
-  }\r
-\r
-  if (FdtDevicePathNodes != NULL) {\r
-    // Append the Device Path node to the select device path\r
-    FdtDevicePath = AppendDevicePath (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNodes);\r
-    FdtDevicePathSize = GetDevicePathSize (FdtDevicePath);\r
-    Status = gRT->SetVariable (\r
-                    (CHAR16*)L"Fdt",\r
-                    &gArmGlobalVariableGuid,\r
-                    EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
-                    FdtDevicePathSize,\r
-                    FdtDevicePath\r
-                    );\r
-    ASSERT_EFI_ERROR(Status);\r
-  } else {\r
-    gRT->SetVariable (\r
-           (CHAR16*)L"Fdt",\r
-           &gArmGlobalVariableGuid,\r
-           EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
-           0,\r
-           NULL\r
-           );\r
-    ASSERT_EFI_ERROR(Status);\r
-  }\r
-\r
-EXIT:\r
-  if (Status == EFI_ABORTED) {\r
-    Print(L"\n");\r
-  }\r
-  FreePool(SupportedBootDevice);\r
-  return Status;\r
-}\r
-\r
 /**\r
   Set boot timeout\r
 \r
@@ -930,7 +880,6 @@ struct BOOT_MANAGER_ENTRY {
     { L"Update Boot Device Entry", BootMenuUpdateBootOption },\r
     { L"Remove Boot Device Entry", BootMenuRemoveBootOption },\r
     { L"Reorder Boot Device Entries", BootMenuReorderBootOptions },\r
-    { L"Update FDT path", UpdateFdtPath },\r
     { L"Set Boot Timeout", BootMenuSetBootTimeout },\r
 };\r
 \r