]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootOption.c
ArmPlatformPkg/Bds: Remove Linux specific boot path
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootOption.c
index 342d441f056bbcae16f931897548f6af134890e7..bdd02b4ecda0c312c070427cb0b5e9bb9e4c420b 100644 (file)
@@ -20,48 +20,27 @@ BootOptionStart (
   IN BDS_LOAD_OPTION *BootOption\r
   )\r
 {\r
-  EFI_STATUS                            Status;\r
-  UINT32                                LoaderType;\r
-  ARM_BDS_LOADER_OPTIONAL_DATA*         OptionalData;\r
-  UINT16                                LoadOptionIndexSize;\r
-\r
-  if (IS_ARM_BDS_BOOTENTRY (BootOption)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    OptionalData = BootOption->OptionalData;\r
-    LoaderType = ReadUnaligned32 ((CONST UINT32*)&OptionalData->Header.LoaderType);\r
-\r
-    if (LoaderType == BDS_LOADER_EFI_APPLICATION) {\r
-      if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {\r
-        // Need to connect every drivers to ensure no dependencies are missing for the application\r
-        BdsConnectAllDrivers ();\r
-      }\r
+  EFI_STATUS Status;\r
+  UINT16     LoadOptionIndexSize;\r
 \r
-      Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, 0, NULL);\r
-    } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {\r
-      ASSERT_EFI_ERROR (EFI_UNSUPPORTED);\r
-    } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_FDT) {\r
-      ASSERT_EFI_ERROR (EFI_UNSUPPORTED);\r
-    }\r
-  } else {\r
-    // Connect all the drivers if the EFI Application is not a EFI OS Loader\r
-    if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {\r
-      BdsConnectAllDrivers ();\r
-    }\r
+  // Connect all the drivers if the EFI Application is not a EFI OS Loader\r
+  if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {\r
+    BdsConnectAllDrivers ();\r
+  }\r
 \r
-    // Set BootCurrent variable\r
-    LoadOptionIndexSize = sizeof(UINT16);\r
-    gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,\r
-              EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-              LoadOptionIndexSize, &(BootOption->LoadOptionIndex));\r
+  // Set BootCurrent variable\r
+  LoadOptionIndexSize = sizeof (UINT16);\r
+  gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,\r
+            EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+            LoadOptionIndexSize, &(BootOption->LoadOptionIndex));\r
 \r
-    Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);\r
+  Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);\r
 \r
-    // Clear BootCurrent variable\r
-    LoadOptionIndexSize = sizeof(UINT16);\r
-    gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,\r
-              EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-              0, NULL);\r
-  }\r
+  // Clear BootCurrent variable\r
+  LoadOptionIndexSize = sizeof (UINT16);\r
+  gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,\r
+            EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+            0, NULL);\r
 \r
   return Status;\r
 }\r
@@ -107,7 +86,6 @@ BootOptionSetFields (
   IN UINT32                     Attributes,\r
   IN CHAR16*                    BootDescription,\r
   IN EFI_DEVICE_PATH_PROTOCOL*  DevicePath,\r
-  IN ARM_BDS_LOADER_TYPE        BootType,\r
   IN UINT8*                     OptionalData,\r
   IN UINTN                      OptionalDataSize\r
   )\r
@@ -117,10 +95,6 @@ BootOptionSetFields (
   UINTN                         BootDescriptionSize;\r
   UINT16                        FilePathListLength;\r
   UINT8*                        EfiLoadOptionPtr;\r
-  UINT8*                        InitrdPathListPtr;\r
-  ARM_BDS_LINUX_ARGUMENTS*      DestLinuxArguments;\r
-  ARM_BDS_LINUX_ARGUMENTS*      SrcLinuxArguments;\r
-  ARM_BDS_LOADER_ARGUMENTS*     BootArguments;\r
 \r
   // If we are overwriting an existent Boot Option then we have to free previously allocated memory\r
   if (BootOption->LoadOption) {\r
@@ -129,11 +103,6 @@ BootOptionSetFields (
 \r
   BootDescriptionSize = StrSize (BootDescription);\r
 \r
-  // Fixup the size in case of entry specific to ArmPlatformPkg/Bds\r
-  if ((BootType == BDS_LOADER_KERNEL_LINUX_ATAG) || (BootType == BDS_LOADER_KERNEL_LINUX_FDT)) {\r
-    OptionalDataSize += sizeof(ARM_BDS_LOADER_OPTIONAL_DATA_HEADER);\r
-  }\r
-\r
   // Compute the size of the FilePath list\r
   FilePathListLength = GetUnalignedDevicePathSize (DevicePath);\r
 \r
@@ -169,33 +138,10 @@ BootOptionSetFields (
   // Optional Data fields, Do unaligned writes\r
   BootOption->OptionalData = EfiLoadOptionPtr;\r
 \r
-  if ((BootType == BDS_LOADER_KERNEL_LINUX_ATAG) || (BootType == BDS_LOADER_KERNEL_LINUX_FDT)) {\r
-    // Write the header\r
-    WriteUnaligned32 ((UINT32 *)EfiLoadOptionPtr, ARM_BDS_OPTIONAL_DATA_SIGNATURE);\r
-    WriteUnaligned32 ((UINT32 *)(EfiLoadOptionPtr + 4), BootType);\r
-\r
-    // OptionalData should have been initialized by the caller of this function\r
-    ASSERT (OptionalData != NULL);\r
-    BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)OptionalData;\r
-    SrcLinuxArguments = &(BootArguments->LinuxArguments);\r
-    DestLinuxArguments = &((ARM_BDS_LOADER_OPTIONAL_DATA*)EfiLoadOptionPtr)->Arguments.LinuxArguments;\r
-\r
-    WriteUnaligned16 ((UINT16 *)&(DestLinuxArguments->CmdLineSize), SrcLinuxArguments->CmdLineSize);\r
-    WriteUnaligned16 ((UINT16 *)&(DestLinuxArguments->InitrdSize), SrcLinuxArguments->InitrdSize);\r
-\r
-    if (SrcLinuxArguments->CmdLineSize > 0) {\r
-      CopyMem ((VOID*)(DestLinuxArguments + 1), (VOID*)(SrcLinuxArguments + 1), SrcLinuxArguments->CmdLineSize);\r
-    }\r
-\r
-    if (SrcLinuxArguments->InitrdSize > 0) {\r
-      InitrdPathListPtr = (UINT8*)((UINTN)(DestLinuxArguments + 1) + SrcLinuxArguments->CmdLineSize);\r
-      CopyMem (InitrdPathListPtr, (VOID*)((UINTN)(SrcLinuxArguments + 1) + SrcLinuxArguments->CmdLineSize), SrcLinuxArguments->InitrdSize);\r
-    }\r
-  } else {\r
-    if (OptionalData != NULL) {\r
-      CopyMem (BootOption->OptionalData, OptionalData, OptionalDataSize);\r
-    }\r
+  if (OptionalData != NULL) {\r
+    CopyMem (BootOption->OptionalData, OptionalData, OptionalDataSize);\r
   }\r
+\r
   BootOption->OptionalDataSize = OptionalDataSize;\r
 \r
   // If this function is called at the creation of the Boot Device entry (not at the update) the\r
@@ -216,7 +162,6 @@ BootOptionCreate (
   IN  UINT32                    Attributes,\r
   IN  CHAR16*                   BootDescription,\r
   IN  EFI_DEVICE_PATH_PROTOCOL* DevicePath,\r
-  IN  ARM_BDS_LOADER_TYPE       BootType,\r
   IN  UINT8*                    OptionalData,\r
   IN  UINTN                     OptionalDataSize,\r
   OUT BDS_LOAD_OPTION**         BdsLoadOption\r
@@ -237,7 +182,7 @@ BootOptionCreate (
   BootOptionEntry->BdsLoadOption = (BDS_LOAD_OPTION*)AllocateZeroPool (sizeof(BDS_LOAD_OPTION));\r
 \r
   BootOption = BootOptionEntry->BdsLoadOption;\r
-  BootOptionSetFields (BootOption, Attributes, BootDescription, DevicePath, BootType, OptionalData, OptionalDataSize);\r
+  BootOptionSetFields (BootOption, Attributes, BootDescription, DevicePath, OptionalData, OptionalDataSize);\r
 \r
   //\r
   // Set the related environment variables\r
@@ -290,7 +235,6 @@ BootOptionUpdate (
   IN  UINT32                    Attributes,\r
   IN  CHAR16*                   BootDescription,\r
   IN  EFI_DEVICE_PATH_PROTOCOL* DevicePath,\r
-  IN  ARM_BDS_LOADER_TYPE       BootType,\r
   IN UINT8*                     OptionalData,\r
   IN UINTN                      OptionalDataSize\r
   )\r
@@ -299,7 +243,7 @@ BootOptionUpdate (
   CHAR16          BootVariableName[9];\r
 \r
   // Update the BDS Load Option structure\r
-  BootOptionSetFields (BdsLoadOption, Attributes, BootDescription, DevicePath, BootType, OptionalData, OptionalDataSize);\r
+  BootOptionSetFields (BdsLoadOption, Attributes, BootDescription, DevicePath, OptionalData, OptionalDataSize);\r
 \r
   // Update the related environment variables\r
   UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BdsLoadOption->LoadOptionIndex);\r