# ARM processor package.\r
#\r
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011 - 2022, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011 - 2023, ARM Limited. All rights reserved.\r
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.\r
#\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
gArmTokenSpaceGuid.PcdArmDmaDeviceOffset|0x0|UINT64|0x0000044\r
\r
+ #\r
+ # Boot the Uefi Shell instead of UiApp when no valid boot option is found.\r
+ # This is useful in CI environment so that startup.nsh can be launched.\r
+ # The default value is FALSE.\r
+ #\r
+ gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable|FALSE|BOOLEAN|0x0000052\r
+\r
[PcdsFixedAtBuild.common, PcdsPatchableInModule.common]\r
gArmTokenSpaceGuid.PcdFdBaseAddress|0|UINT64|0x0000002B\r
gArmTokenSpaceGuid.PcdFvBaseAddress|0|UINT64|0x0000002D\r
Implementation for PlatformBootManagerLib library class interfaces.\r
\r
Copyright (C) 2015-2016, Red Hat, Inc.\r
- Copyright (c) 2014 - 2021, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2023, Arm Ltd. All rights reserved.<BR>\r
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
Copyright (c) 2021, Semihalf All rights reserved.<BR>\r
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
}\r
\r
+/** Boot a Fv Boot Option.\r
+\r
+ This function is useful for booting the UEFI Shell as it is loaded\r
+ as a non active boot option.\r
+\r
+ @param[in] FileGuid The File GUID.\r
+ @param[in] Description String describing the Boot Option.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+PlatformBootFvBootOption (\r
+ IN CONST EFI_GUID *FileGuid,\r
+ IN CHAR16 *Description\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_BOOT_MANAGER_LOAD_OPTION NewOption;\r
+ MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;\r
+ EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+\r
+ Status = gBS->HandleProtocol (\r
+ gImageHandle,\r
+ &gEfiLoadedImageProtocolGuid,\r
+ (VOID **)&LoadedImage\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ //\r
+ // The UEFI Shell was registered in PlatformRegisterFvBootOption ()\r
+ // previously, thus it must still be available in this FV.\r
+ //\r
+ EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);\r
+ DevicePath = DevicePathFromHandle (LoadedImage->DeviceHandle);\r
+ ASSERT (DevicePath != NULL);\r
+ DevicePath = AppendDevicePathNode (\r
+ DevicePath,\r
+ (EFI_DEVICE_PATH_PROTOCOL *)&FileNode\r
+ );\r
+ ASSERT (DevicePath != NULL);\r
+\r
+ Status = EfiBootManagerInitializeLoadOption (\r
+ &NewOption,\r
+ LoadOptionNumberUnassigned,\r
+ LoadOptionTypeBoot,\r
+ LOAD_OPTION_ACTIVE,\r
+ Description,\r
+ DevicePath,\r
+ NULL,\r
+ 0\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ FreePool (DevicePath);\r
+\r
+ EfiBootManagerBoot (&NewOption);\r
+}\r
+\r
STATIC\r
VOID\r
GetPlatformOptions (\r
EfiBootManagerConnectAll ();\r
EfiBootManagerRefreshAllBootOption ();\r
\r
+ //\r
+ // Boot the 'UEFI Shell'. If the Pcd is not set, the UEFI Shell is not\r
+ // an active boot option and must be manually selected through UiApp\r
+ // (at least during the fist boot).\r
+ //\r
+ if (FixedPcdGetBool (PcdUefiShellDefaultBootEnable)) {\r
+ PlatformBootFvBootOption (\r
+ &gUefiShellFileGuid,\r
+ L"UEFI Shell (default)"\r
+ );\r
+ }\r
+\r
//\r
// Record the updated number of boot configured boot options\r
//\r
# Implementation for PlatformBootManagerLib library class interfaces.\r
#\r
# Copyright (C) 2015-2016, Red Hat, Inc.\r
-# Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2023, Arm Ltd. All rights reserved.<BR>\r
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
#\r
PlatformBm.h\r
\r
[Packages]\r
+ ArmPkg/ArmPkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
MdePkg/MdePkg.dec\r
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
\r
[FixedPcd]\r
+ gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable\r
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate\r