From: "Abdul Lateef Attar" <abdattar@amd.com>
To: <devel@edk2.groups.io>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>,
Oram Isaac W <isaac.w.oram@intel.com>,
Eric Dong <eric.dong@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH v3 2/2] BoardModulePkg: Adds PCD to load UEFI Shell image
Date: Wed, 18 Jan 2023 18:34:13 +0530 [thread overview]
Message-ID: <8b3714f5b58493ad5d09cd156fa1b8dce2da0c0a.1674047008.git.abdattar@amd.com> (raw)
In-Reply-To: <cover.1674047008.git.abdattar@amd.com>
From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
defines two PCDs, PcdShellFile and PcdShellFileDesc,
which holds the GUID and description of the UEFI shell file to be loaded.
A PCDs based solution gives flexibility to the user to load different
images, by just overriding the DSC file.
The user can load a diagnostic image or test image during
PCDBootToShellOnly or later stages.
Cc: Oram Isaac W <isaac.w.oram@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
---
.../Intel/MinPlatformPkg/MinPlatformPkg.dec | 5 ++++
.../BoardBdsHookLib/BoardBdsHookLib.inf | 3 ++
.../Library/BoardBdsHookLib/BoardBootOption.c | 29 +++++++++----------
3 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 2953e9527224..e6f714b1816f 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -7,6 +7,7 @@
# for the build infrastructure.
#
# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -266,6 +267,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspUSize|0x00000000|UINT32|0x2000002B
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspUOffset|0x00000000|UINT32|0x2000002C
+ # GUID of Shell file to be loaded, default value is gUefiShellFileGuid define in ShellPkg.dec
+ gMinPlatformPkgTokenSpaceGuid.PcdShellFile|{GUID({0x7c04a583, 0x9e3e, 0x4f1c, {0xad, 0x65, 0xe0, 0x52, 0x68, 0xd0, 0xb4, 0xd1}})}|VOID*|0x20000230
+ gMinPlatformPkgTokenSpaceGuid.PcdShellFileDesc|L"Internal UEFI Shell 2.0"|VOID*|0x20000231
+
[PcdsDynamic, PcdsDynamicEx]
gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x90000019
gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegisterAddressSpaceId|0x00|UINT8|0x0001004B
diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
index 69f3fcb55222..7a1dbe62eafd 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
@@ -2,6 +2,7 @@
# Module Information file for the Bds Hook Library.
#
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -59,6 +60,8 @@ [Pcd]
gMinPlatformPkgTokenSpaceGuid.PcdTrustedConsoleInputDevicePath ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdTrustedConsoleOutputDevicePath ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdTrustedStorageDevicePath ## CONSUMES
+ gMinPlatformPkgTokenSpaceGuid.PcdShellFile ## CONSUMES
+ gMinPlatformPkgTokenSpaceGuid.PcdShellFileDesc ## CONSUMES
[Sources]
BoardBdsHook.h
diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
index dec3ce93ef71..05b9fa7ac682 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
@@ -2,12 +2,23 @@
Driver for Platform Boot Options support.
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "BoardBdsHook.h"
+EFI_GUID gUefiShellFileGuid = {0};
+#define UEFI_HARD_DRIVE_NAME L"UEFI Hard Drive"
+EFI_GUID mUiFile = {
+ 0x462CAA21, 0x7614, 0x4503, { 0x83, 0x6E, 0x8A, 0xB6, 0xF4, 0x66, 0x23, 0x31 }
+};
+EFI_GUID mBootMenuFile = {
+ 0xEEC25BDC, 0x67F2, 0x4D95, { 0xB1, 0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D }
+};
+
BOOLEAN mContinueBoot = FALSE;
BOOLEAN mBootMenuBoot = FALSE;
BOOLEAN mPxeBoot = FALSE;
@@ -186,14 +197,6 @@ CreateFvBootOption (
return Status;
}
-EFI_GUID mUiFile = {
- 0x462CAA21, 0x7614, 0x4503, { 0x83, 0x6E, 0x8A, 0xB6, 0xF4, 0x66, 0x23, 0x31 }
-};
-EFI_GUID mBootMenuFile = {
- 0xEEC25BDC, 0x67F2, 0x4D95, { 0xB1, 0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D }
-};
-
-
/**
Return the index of the load option in the load option array.
@@ -333,11 +336,6 @@ PlatformBootManagerWaitCallback (
}
-EFI_GUID gUefiShellFileGuid = { 0x7C04A583, 0x9E3E, 0x4f1c, { 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } };
-
-#define INTERNAL_UEFI_SHELL_NAME L"Internal UEFI Shell 2.0"
-#define UEFI_HARD_DRIVE_NAME L"UEFI Hard Drive"
-
/**
Registers default boot option
**/
@@ -352,7 +350,8 @@ RegisterDefaultBootOption (
ShellData = NULL;
ShellDataSize = 0;
- RegisterFvBootOption (&gUefiShellFileGuid, INTERNAL_UEFI_SHELL_NAME, (UINTN) -1, LOAD_OPTION_ACTIVE, (UINT8 *)ShellData, ShellDataSize);
+ CopyMem (&gUefiShellFileGuid, PcdGetPtr (PcdShellFile), sizeof (GUID));
+ RegisterFvBootOption (&gUefiShellFileGuid, (CHAR16 *) PcdGetPtr (PcdShellFileDesc), (UINTN) -1, LOAD_OPTION_ACTIVE, (UINT8 *)ShellData, ShellDataSize);
//
// Boot Menu
@@ -557,7 +556,7 @@ BootOptionPriority (
return 6;
}
- if (StrCmp (BootOption->Description, INTERNAL_UEFI_SHELL_NAME) == 0) {
+ if (StrCmp (BootOption->Description, (CHAR16 *) PcdGetPtr (PcdShellFileDesc)) == 0) {
if (PcdGetBool (PcdBootToShellOnly)) {
return 0;
}
--
2.25.1
prev parent reply other threads:[~2023-01-18 13:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1674047008.git.abdattar@amd.com>
2023-01-18 13:04 ` [PATCH v3 1/2] BoardModulePkg: Copy device path before processing Abdul Lateef Attar
2023-01-18 13:04 ` Abdul Lateef Attar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b3714f5b58493ad5d09cd156fa1b8dce2da0c0a.1674047008.git.abdattar@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox