X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=inline;f=ArmPlatformPkg%2FBds%2FBds.c;h=4cea3cd531bbdc46e95625b4abe281d3dbc6168b;hb=776086ce307b1c3dd8b694f16e784370a02a529c;hp=6a12717a1c12c96f4b0d9dc5b9368566564fcbf4;hpb=3a2b37f0d4d489322499110b44b6f74bbe7329d6;p=mirror_edk2.git diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c index 6a12717a1c..4cea3cd531 100644 --- a/ArmPlatformPkg/Bds/Bds.c +++ b/ArmPlatformPkg/Bds/Bds.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* Copyright (c) 2011-2015, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -220,12 +220,6 @@ DefineDefaultBootEntries ( EFI_STATUS Status; EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol; EFI_DEVICE_PATH* BootDevicePath; - UINT8* OptionalData; - UINTN OptionalDataSize; - ARM_BDS_LOADER_ARGUMENTS* BootArguments; - ARM_BDS_LOADER_TYPE BootType; - EFI_DEVICE_PATH* InitrdPath; - UINTN InitrdSize; UINTN CmdLineSize; UINTN CmdLineAsciiSize; CHAR16* DefaultBootArgument; @@ -258,15 +252,17 @@ DefineDefaultBootEntries ( ASSERT_EFI_ERROR(Status); DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (BootDevicePath, TRUE, TRUE); - ASSERT (StrCmp ((CHAR16*)PcdGetPtr(PcdDefaultBootDevicePath), DevicePathTxt) == 0); + if (StrCmp ((CHAR16*)PcdGetPtr (PcdDefaultBootDevicePath), DevicePathTxt) != 0) { + DEBUG ((EFI_D_ERROR, "Device Path given: '%s' Device Path expected: '%s'\n", + (CHAR16*)PcdGetPtr (PcdDefaultBootDevicePath), DevicePathTxt)); + ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER); + } FreePool (DevicePathTxt); DEBUG_CODE_END(); // Create the entry is the Default values are correct if (BootDevicePath != NULL) { - BootType = (ARM_BDS_LOADER_TYPE)PcdGet32 (PcdDefaultBootType); - // We do not support NULL pointer ASSERT (PcdGetPtr (PcdDefaultBootArgument) != NULL); @@ -304,33 +300,11 @@ DefineDefaultBootEntries ( AsciiStrToUnicodeStr (AsciiDefaultBootArgument, DefaultBootArgument); } - if ((BootType == BDS_LOADER_KERNEL_LINUX_ATAG) || (BootType == BDS_LOADER_KERNEL_LINUX_FDT)) { - InitrdPath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdDefaultBootInitrdPath)); - InitrdSize = GetDevicePathSize (InitrdPath); - - OptionalDataSize = sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineAsciiSize + InitrdSize; - BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)AllocatePool (OptionalDataSize); - if (BootArguments == NULL) { - return EFI_OUT_OF_RESOURCES; - } - BootArguments->LinuxArguments.CmdLineSize = CmdLineAsciiSize; - BootArguments->LinuxArguments.InitrdSize = InitrdSize; - - CopyMem ((VOID*)(BootArguments + 1), AsciiDefaultBootArgument, CmdLineAsciiSize); - CopyMem ((VOID*)((UINTN)(BootArguments + 1) + CmdLineAsciiSize), InitrdPath, InitrdSize); - - OptionalData = (UINT8*)BootArguments; - } else { - OptionalData = (UINT8*)DefaultBootArgument; - OptionalDataSize = CmdLineSize; - } - BootOptionCreate (LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_BOOT, - (CHAR16*)PcdGetPtr(PcdDefaultBootDescription), + (CHAR16*)PcdGetPtr (PcdDefaultBootDescription), BootDevicePath, - BootType, - OptionalData, - OptionalDataSize, + (UINT8 *)DefaultBootArgument, // OptionalData + CmdLineSize, // OptionalDataSize &BdsLoadOption ); FreePool (BdsLoadOption); @@ -505,6 +479,9 @@ BdsEntry ( Status = gBS->CalculateCrc32 ((VOID*)gST, gST->Hdr.HeaderSize, &gST->Hdr.CRC32); ASSERT_EFI_ERROR (Status); + // Now we need to setup the EFI System Table with information about the console devices. + InitializeConsole (); + // If BootNext environment variable is defined then we just load it ! BootNextSize = sizeof(UINT16); Status = GetGlobalEnvironmentVariable (L"BootNext", NULL, &BootNextSize, (VOID**)&BootNext); @@ -544,9 +521,6 @@ BdsEntry ( // If Boot Order does not exist then create a default entry DefineDefaultBootEntries (); - // Now we need to setup the EFI System Table with information about the console devices. - InitializeConsole (); - // // Update the CRC32 in the EFI System Table header //