diff options
10 files changed, 79 insertions, 9 deletions
diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 22f86d4d..d3c58699 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -1,6 +1,6 @@ /** @file
*
- * Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.
+ * Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.
* Copyright (c) 2018 - 2020, Andrei Warkentin <andrey.warkentin@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -282,6 +282,15 @@ SetupVariables ( }
Size = sizeof (UINT32);
+ Status = gRT->GetVariable (L"BootPolicy",
+ &gConfigDxeFormSetGuid,
+ NULL, &Size, &Var32);
+ if (EFI_ERROR (Status)) {
+ Status = PcdSet32S (PcdBootPolicy, PcdGet32 (PcdBootPolicy));
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ Size = sizeof (UINT32);
Status = gRT->GetVariable (L"SdIsArasan",
&gConfigDxeFormSetGuid,
NULL, &Size, &Var32);
diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index d51e54e0..032e40b0 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -2,7 +2,7 @@ #
# Component description file for the RasbperryPi DXE platform config driver.
#
-# Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.
+# Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.
# Copyright (c) 2018 - 2020, Andrei Warkentin <andrey.warkentin@gmail.com>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -93,6 +93,7 @@ gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB
gRaspberryPiTokenSpaceGuid.PcdFanOnGpio
gRaspberryPiTokenSpaceGuid.PcdFanTemp
+ gRaspberryPiTokenSpaceGuid.PcdBootPolicy
[Depex]
gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid
diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 466fa852..81761d64 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -1,7 +1,7 @@ /** @file
*
* Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
- * Copyright (c) 2020, ARM Limited. All rights reserved.
+ * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -60,6 +60,14 @@ #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag"
#string STR_ADVANCED_ASSET_TAG_HELP #language en-US "Set the system Asset Tag"
+#string STR_BOOT_POLICY_PROMPT #language en-US "Boot Policy"
+#string STR_BOOT_POLICY_HELP #language en-US "When Fast Boot is selected, only required devices will be discovered for reducing "
+ "the boot time. "
+ "When Full Discovery is selected, all the devices will be discovered for some "
+ "scenarios such as system deployment and diagnostic tests."
+#string STR_FAST_BOOT #language en-US "Fast Boot"
+#string STR_FULL_DISCOVERY #language en-US "Full Discovery"
+
/*
* MMC/SD configuration.
*/
diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index cc7a09cf..aa124e4e 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -1,7 +1,7 @@ /** @file
*
* Copyright (c) 2018 Andrei Warkentin <andrey.warkentin@gmail.com>
- * Copyright (c) 2020, ARM Limited. All rights reserved.
+ * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -116,6 +116,11 @@ formset name = DisplayEnableSShot,
guid = CONFIGDXE_FORM_SET_GUID;
+ efivarstore BOOT_POLICY_VARSTORE_DATA,
+ attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ name = BootPolicy,
+ guid = CONFIGDXE_FORM_SET_GUID;
+
form formid = 1,
title = STRING_TOKEN(STR_FORM_SET_TITLE);
subtitle text = STRING_TOKEN(STR_NULL_STRING);
@@ -190,6 +195,14 @@ formset option text = STRING_TOKEN(STR_ADVANCED_SYSTAB_DT), value = SYSTEM_TABLE_MODE_DT, flags = DEFAULT;
endoneof;
+ oneof varid = BootPolicy.BootPolicy,
+ prompt = STRING_TOKEN(STR_BOOT_POLICY_PROMPT),
+ help = STRING_TOKEN(STR_BOOT_POLICY_HELP),
+ flags = NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED,
+ option text = STRING_TOKEN(STR_FAST_BOOT), value = FAST_BOOT , flags = 0;
+ option text = STRING_TOKEN(STR_FULL_DISCOVERY), value = FULL_DISCOVERY, flags = DEFAULT;
+ endoneof;
+
#if (RPI_MODEL == 4)
grayoutif NOT ideqval SystemTableMode.Mode == SYSTEM_TABLE_MODE_ACPI;
oneof varid = FanOnGpio.Enabled,
@@ -220,6 +233,7 @@ formset minsize = 0,
maxsize = ASSET_TAG_STR_MAX_LEN,
endstring;
+
endform;
form formid = 0x1003,
diff --git a/Platform/RaspberryPi/Include/ConfigVars.h b/Platform/RaspberryPi/Include/ConfigVars.h index 14231798..9ef62b7a 100644 --- a/Platform/RaspberryPi/Include/ConfigVars.h +++ b/Platform/RaspberryPi/Include/ConfigVars.h @@ -1,7 +1,7 @@ /** @file
*
* Copyright (c) 2020, Andrei Warkentin <andrey.warkentin@gmail.com>
- * Copyright (c) 2020, ARM Limited. All rights reserved.
+ * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -143,4 +143,14 @@ typedef struct { UINT32 EnableDma;
} MMC_EMMC_DMA_VARSTORE_DATA;
+#define FAST_BOOT 0
+#define FULL_DISCOVERY 1
+typedef struct {
+ /*
+ * 0 - Fast Boot
+ * 1 - Full Discovery (Connect All)
+ */
+ UINT32 BootPolicy;
+} BOOT_POLICY_VARSTORE_DATA;
+
#endif /* CONFIG_VARS_H */
diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c index c2fc40b8..d081fdae 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c @@ -4,7 +4,7 @@ * Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
* Copyright (c) 2016, Linaro Ltd. All rights reserved.
* Copyright (c) 2015-2016, Red Hat, Inc.
- * Copyright (c) 2014-2020, ARM Ltd. All rights reserved.
+ * Copyright (c) 2014-2021, ARM Ltd. All rights reserved.
* Copyright (c) 2004-2016, Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -25,10 +25,11 @@ #include <Protocol/LoadedImage.h>
#include <Guid/EventGroup.h>
#include <Guid/TtyTerm.h>
+#include <ConfigVars.h>
#include "PlatformBm.h"
-#define BOOT_PROMPT L"ESC (setup), F1 (shell), ENTER (boot)"
+#define BOOT_PROMPT L"ESC (setup), F1 (shell), ENTER (boot)\n"
#define DP_NODE_LEN(Type) { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) }
@@ -633,6 +634,16 @@ PlatformBootManagerAfterConsole ( Print (BOOT_PROMPT);
}
+ //
+ // Connect the rest of the devices if the boot polcy is set to Full discovery
+ //
+ if (PcdGet32 (PcdBootPolicy) == FULL_DISCOVERY) {
+ DEBUG ((DEBUG_INFO, "Boot Policy is Full Discovery. Connect all devices\n"));
+ EfiBootManagerConnectAll ();
+ } else if (PcdGet32 (PcdBootPolicy) == FAST_BOOT) {
+ DEBUG ((DEBUG_INFO, "Boot Policy is Fast Boot. Skip connecting all devices\n"));
+ }
+
Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, (VOID**)&EsrtManagement);
if (!EFI_ERROR (Status)) {
EsrtManagement->SyncEsrtFmp ();
diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 88f6f8fe..fbf510ab 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -63,6 +63,7 @@ [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
gRaspberryPiTokenSpaceGuid.PcdSdIsArasan
+ gRaspberryPiTokenSpaceGuid.PcdBootPolicy
[Guids]
gEfiFileInfoGuid
diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc index 0961133a..425c7ff9 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -1,6 +1,6 @@ # @file
#
-# Copyright (c) 2011 - 2020, ARM Limited. All rights reserved.
+# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
# Copyright (c) 2014, Linaro Limited. All rights reserved.
# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
# Copyright (c) 2017 - 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
@@ -513,6 +513,13 @@ gRaspberryPiTokenSpaceGuid.PcdFanTemp|L"FanTemp"|gConfigDxeFormSetGuid|0x0|0
#
+ # Boot Policy
+ # 0 - Fast Boot
+ # 1 - Full Discovery (Connect All)
+ #
+ gRaspberryPiTokenSpaceGuid.PcdBootPolicy|L"BootPolicy"|gConfigDxeFormSetGuid|0x0|1
+
+ #
# Reset-related.
#
diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index ff802d83..5c6783ea 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -1,6 +1,6 @@ # @file
#
-# Copyright (c) 2011 - 2020, ARM Limited. All rights reserved.
+# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
# Copyright (c) 2017 - 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
# Copyright (c) 2014, Linaro Limited. All rights reserved.
@@ -529,6 +529,13 @@ gRaspberryPiTokenSpaceGuid.PcdFanTemp|L"FanTemp"|gConfigDxeFormSetGuid|0x0|60
#
+ # Boot Policy
+ # 0 - Fast Boot
+ # 1 - Full Discovery (Connect All)
+ #
+ gRaspberryPiTokenSpaceGuid.PcdBootPolicy|L"BootPolicy"|gConfigDxeFormSetGuid|0x0|1
+
+ #
# Reset-related.
#
diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/RaspberryPi.dec index 08135717..8eb1c2ba 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -2,6 +2,7 @@ #
# Copyright (c) 2016, Linaro, Ltd. All rights reserved.
# Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
+# Copyright (c) 2021, ARM Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -70,3 +71,4 @@ gRaspberryPiTokenSpaceGuid.PcdFanTemp|0|UINT32|0x0000001D
gRaspberryPiTokenSpaceGuid.PcdPlatformResetDelay|0|UINT32|0x0000001E
gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma|0|UINT32|0x0000001F
+ gRaspberryPiTokenSpaceGuid.PcdBootPolicy|0|UINT32|0x00000020
|