summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Bds/BootOption.c
diff options
context:
space:
mode:
authorOlivier Martin <Olivier.Martin@arm.com>2015-07-14 14:36:49 +0000
committeroliviermartin <oliviermartin@Edk2>2015-07-14 14:36:49 +0000
commit8b129b7b390107d258bd004eda8514976534408a (patch)
treeb159f5e50303feb398fff7b7ee15f899423217ec /ArmPlatformPkg/Bds/BootOption.c
parentc75d3eb6be41867cc3bfea9f567bf20cdead8966 (diff)
downloadedk2-platforms-8b129b7b390107d258bd004eda8514976534408a.tar.xz
ArmPlatformPkg/Bds: Remove Linux specific boot path
Since the embedded Linux Loader has been removed from BdsLib there is no more Linux specific boot option. All the boot options are now expected to be arguments for EFI applications. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17970 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Bds/BootOption.c')
-rw-r--r--ArmPlatformPkg/Bds/BootOption.c100
1 files changed, 22 insertions, 78 deletions
diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c
index 342d441f05..bdd02b4ecd 100644
--- a/ArmPlatformPkg/Bds/BootOption.c
+++ b/ArmPlatformPkg/Bds/BootOption.c
@@ -20,48 +20,27 @@ BootOptionStart (
IN BDS_LOAD_OPTION *BootOption
)
{
- EFI_STATUS Status;
- UINT32 LoaderType;
- ARM_BDS_LOADER_OPTIONAL_DATA* OptionalData;
- UINT16 LoadOptionIndexSize;
-
- if (IS_ARM_BDS_BOOTENTRY (BootOption)) {
- Status = EFI_UNSUPPORTED;
- OptionalData = BootOption->OptionalData;
- LoaderType = ReadUnaligned32 ((CONST UINT32*)&OptionalData->Header.LoaderType);
-
- if (LoaderType == BDS_LOADER_EFI_APPLICATION) {
- if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {
- // Need to connect every drivers to ensure no dependencies are missing for the application
- BdsConnectAllDrivers ();
- }
+ EFI_STATUS Status;
+ UINT16 LoadOptionIndexSize;
- Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, 0, NULL);
- } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {
- ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
- } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_FDT) {
- ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
- }
- } else {
- // Connect all the drivers if the EFI Application is not a EFI OS Loader
- if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {
- BdsConnectAllDrivers ();
- }
+ // Connect all the drivers if the EFI Application is not a EFI OS Loader
+ if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {
+ BdsConnectAllDrivers ();
+ }
- // Set BootCurrent variable
- LoadOptionIndexSize = sizeof(UINT16);
- gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- LoadOptionIndexSize, &(BootOption->LoadOptionIndex));
+ // Set BootCurrent variable
+ LoadOptionIndexSize = sizeof (UINT16);
+ gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ LoadOptionIndexSize, &(BootOption->LoadOptionIndex));
- Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);
+ Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);
- // Clear BootCurrent variable
- LoadOptionIndexSize = sizeof(UINT16);
- gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- 0, NULL);
- }
+ // Clear BootCurrent variable
+ LoadOptionIndexSize = sizeof (UINT16);
+ gRT->SetVariable (L"BootCurrent", &gEfiGlobalVariableGuid,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ 0, NULL);
return Status;
}
@@ -107,7 +86,6 @@ BootOptionSetFields (
IN UINT32 Attributes,
IN CHAR16* BootDescription,
IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
- IN ARM_BDS_LOADER_TYPE BootType,
IN UINT8* OptionalData,
IN UINTN OptionalDataSize
)
@@ -117,10 +95,6 @@ BootOptionSetFields (
UINTN BootDescriptionSize;
UINT16 FilePathListLength;
UINT8* EfiLoadOptionPtr;
- UINT8* InitrdPathListPtr;
- ARM_BDS_LINUX_ARGUMENTS* DestLinuxArguments;
- ARM_BDS_LINUX_ARGUMENTS* SrcLinuxArguments;
- ARM_BDS_LOADER_ARGUMENTS* BootArguments;
// If we are overwriting an existent Boot Option then we have to free previously allocated memory
if (BootOption->LoadOption) {
@@ -129,11 +103,6 @@ BootOptionSetFields (
BootDescriptionSize = StrSize (BootDescription);
- // Fixup the size in case of entry specific to ArmPlatformPkg/Bds
- if ((BootType == BDS_LOADER_KERNEL_LINUX_ATAG) || (BootType == BDS_LOADER_KERNEL_LINUX_FDT)) {
- OptionalDataSize += sizeof(ARM_BDS_LOADER_OPTIONAL_DATA_HEADER);
- }
-
// Compute the size of the FilePath list
FilePathListLength = GetUnalignedDevicePathSize (DevicePath);
@@ -169,33 +138,10 @@ BootOptionSetFields (
// Optional Data fields, Do unaligned writes
BootOption->OptionalData = EfiLoadOptionPtr;
- if ((BootType == BDS_LOADER_KERNEL_LINUX_ATAG) || (BootType == BDS_LOADER_KERNEL_LINUX_FDT)) {
- // Write the header
- WriteUnaligned32 ((UINT32 *)EfiLoadOptionPtr, ARM_BDS_OPTIONAL_DATA_SIGNATURE);
- WriteUnaligned32 ((UINT32 *)(EfiLoadOptionPtr + 4), BootType);
-
- // OptionalData should have been initialized by the caller of this function
- ASSERT (OptionalData != NULL);
- BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)OptionalData;
- SrcLinuxArguments = &(BootArguments->LinuxArguments);
- DestLinuxArguments = &((ARM_BDS_LOADER_OPTIONAL_DATA*)EfiLoadOptionPtr)->Arguments.LinuxArguments;
-
- WriteUnaligned16 ((UINT16 *)&(DestLinuxArguments->CmdLineSize), SrcLinuxArguments->CmdLineSize);
- WriteUnaligned16 ((UINT16 *)&(DestLinuxArguments->InitrdSize), SrcLinuxArguments->InitrdSize);
-
- if (SrcLinuxArguments->CmdLineSize > 0) {
- CopyMem ((VOID*)(DestLinuxArguments + 1), (VOID*)(SrcLinuxArguments + 1), SrcLinuxArguments->CmdLineSize);
- }
-
- if (SrcLinuxArguments->InitrdSize > 0) {
- InitrdPathListPtr = (UINT8*)((UINTN)(DestLinuxArguments + 1) + SrcLinuxArguments->CmdLineSize);
- CopyMem (InitrdPathListPtr, (VOID*)((UINTN)(SrcLinuxArguments + 1) + SrcLinuxArguments->CmdLineSize), SrcLinuxArguments->InitrdSize);
- }
- } else {
- if (OptionalData != NULL) {
- CopyMem (BootOption->OptionalData, OptionalData, OptionalDataSize);
- }
+ if (OptionalData != NULL) {
+ CopyMem (BootOption->OptionalData, OptionalData, OptionalDataSize);
}
+
BootOption->OptionalDataSize = OptionalDataSize;
// If this function is called at the creation of the Boot Device entry (not at the update) the
@@ -216,7 +162,6 @@ BootOptionCreate (
IN UINT32 Attributes,
IN CHAR16* BootDescription,
IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
- IN ARM_BDS_LOADER_TYPE BootType,
IN UINT8* OptionalData,
IN UINTN OptionalDataSize,
OUT BDS_LOAD_OPTION** BdsLoadOption
@@ -237,7 +182,7 @@ BootOptionCreate (
BootOptionEntry->BdsLoadOption = (BDS_LOAD_OPTION*)AllocateZeroPool (sizeof(BDS_LOAD_OPTION));
BootOption = BootOptionEntry->BdsLoadOption;
- BootOptionSetFields (BootOption, Attributes, BootDescription, DevicePath, BootType, OptionalData, OptionalDataSize);
+ BootOptionSetFields (BootOption, Attributes, BootDescription, DevicePath, OptionalData, OptionalDataSize);
//
// Set the related environment variables
@@ -290,7 +235,6 @@ BootOptionUpdate (
IN UINT32 Attributes,
IN CHAR16* BootDescription,
IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
- IN ARM_BDS_LOADER_TYPE BootType,
IN UINT8* OptionalData,
IN UINTN OptionalDataSize
)
@@ -299,7 +243,7 @@ BootOptionUpdate (
CHAR16 BootVariableName[9];
// Update the BDS Load Option structure
- BootOptionSetFields (BdsLoadOption, Attributes, BootDescription, DevicePath, BootType, OptionalData, OptionalDataSize);
+ BootOptionSetFields (BdsLoadOption, Attributes, BootDescription, DevicePath, OptionalData, OptionalDataSize);
// Update the related environment variables
UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BdsLoadOption->LoadOptionIndex);