* [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
@ 2022-03-21 10:03 Sean Rhodes
2022-03-21 10:03 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Sean Rhodes @ 2022-03-21 10:03 UTC (permalink / raw)
To: devel; +Cc: Matt DeVillier, Jian J Wang, Liming Gao, Sean Rhodes
From: Matt DeVillier <matt.devillier@gmail.com>
Add Pcd to allow configuring internal devices to be prioritized over
internally-attached USB devices, such as card readers, over SATA, NVMe
and eMMC drives.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 ++++++++--
.../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 +
MdeModulePkg/MdeModulePkg.dec | 4 ++++
MdeModulePkg/MdeModulePkg.uni | 4 ++++
4 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..28c3cff471 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2214,8 +2214,14 @@ BmEnumerateBootOptions (
//
// Skip the fixed block io then the removable block io
//
- if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
- continue;
+ if (FixedPcdGetBool (PcdPrioritizeInternal)) {
+ if (BlkIo->Media->RemovableMedia == (Removable == 0)) {
+ continue;
+ }
+ } else {
+ if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
+ continue;
+ }
}
Description = BmGetBootDescription (Handles[Index]);
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
index fe05d5f1cc..207420e334 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
+++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -119,3 +119,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 40601c9583..8b8b1f7033 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1563,6 +1563,10 @@
# @Prompt SD/MMC Host Controller Operations Timeout (us).
gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UINT32|0x00000031
+ ## Inditicates if internal devices will be prioritized over external devices.
+ # @prompt Prioritize internal devices.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000032
+
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
## This PCD defines the Console output row. The default value is 25 according to UEFI spec.
# This PCD could be set to 0 then console output would be at max column and max row.
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index b070f15ff2..7b8606f091 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -1177,6 +1177,10 @@
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_HELP #language en-US "Indicates the default timeout value for SD/MMC Host Controller operations in microseconds."
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_PROMPT #language en-US "Enable booting from internal devices before external devices."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_HELP #language en-US "Indicates the if internal devices will be prioritized in boot order."
+
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMPT #language en-US "Capsule On Disk relocation device path."
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP #language en-US "Full device path of platform specific device to store Capsule On Disk temp relocation file.<BR>"
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option
2022-03-21 10:03 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
@ 2022-03-21 10:03 ` Sean Rhodes
2022-05-17 12:02 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sheng Lean Tan
2022-05-17 14:01 ` Ni, Ray
2 siblings, 0 replies; 6+ messages in thread
From: Sean Rhodes @ 2022-03-21 10:03 UTC (permalink / raw)
To: devel; +Cc: Sean Rhodes, Guo Dong, Ray Ni, Maurice Ma, Benjamin You
Hook PRIORITISE_INTERNAL build option to PrioritiseInternal PCD.
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 14a8d157a2..187e3aafc8 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -35,6 +35,7 @@
DEFINE SMM_SUPPORT = FALSE
DEFINE ABOVE_4G_MEMORY = TRUE
DEFINE BOOT_MANAGER_ESCAPE = FALSE
+ DEFINE PRIORITIZE_INTERNAL = FALSE
DEFINE SD_MMC_TIMEOUT = 1000000
#
# SBL: UEFI payload for Slim Bootloader
@@ -401,8 +402,9 @@
!if $(PERFORMANCE_MEASUREMENT_ENABLE)
gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1
!endif
- gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|$(SD_MMC_TIMEOUT)
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|$(SD_MMC_TIMEOUT)
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|$(PRIORITISE_INTERNAL)
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
2022-03-21 10:03 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
2022-03-21 10:03 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
@ 2022-05-17 12:02 ` Sheng Lean Tan
2022-05-17 14:01 ` Ni, Ray
2 siblings, 0 replies; 6+ messages in thread
From: Sheng Lean Tan @ 2022-05-17 12:02 UTC (permalink / raw)
To: Sean Rhodes, devel
[-- Attachment #1: Type: text/plain, Size: 40 bytes --]
Hi Jian J/Liming,
Any update on this?
[-- Attachment #2: Type: text/html, Size: 44 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
2022-03-21 10:03 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
2022-03-21 10:03 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
2022-05-17 12:02 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sheng Lean Tan
@ 2022-05-17 14:01 ` Ni, Ray
2 siblings, 0 replies; 6+ messages in thread
From: Ni, Ray @ 2022-05-17 14:01 UTC (permalink / raw)
To: devel@edk2.groups.io, Rhodes, Sean
Cc: Matt DeVillier, Wang, Jian J, Gao, Liming
Sean,
Can you use EfiBootManagerSortLoadOptionVariable() to sort the boot options from PlatformBootManagerLib?
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean Rhodes
> Sent: Monday, March 21, 2022 6:04 PM
> To: devel@edk2.groups.io
> Cc: Matt DeVillier <matt.devillier@gmail.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Rhodes, Sean <sean@starlabs.systems>
> Subject: [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
>
> From: Matt DeVillier <matt.devillier@gmail.com>
>
> Add Pcd to allow configuring internal devices to be prioritized over
> internally-attached USB devices, such as card readers, over SATA, NVMe
> and eMMC drives.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 ++++++++--
> .../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 +
> MdeModulePkg/MdeModulePkg.dec | 4 ++++
> MdeModulePkg/MdeModulePkg.uni | 4 ++++
> 4 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 962892d38f..28c3cff471 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -2214,8 +2214,14 @@ BmEnumerateBootOptions (
> //
>
> // Skip the fixed block io then the removable block io
>
> //
>
> - if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
>
> - continue;
>
> + if (FixedPcdGetBool (PcdPrioritizeInternal)) {
>
> + if (BlkIo->Media->RemovableMedia == (Removable == 0)) {
>
> + continue;
>
> + }
>
> + } else {
>
> + if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
>
> + continue;
>
> + }
>
> }
>
>
>
> Description = BmGetBootDescription (Handles[Index]);
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> index fe05d5f1cc..207420e334 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> @@ -119,3 +119,4 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index 40601c9583..8b8b1f7033 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -1563,6 +1563,10 @@
> # @Prompt SD/MMC Host Controller Operations Timeout (us).
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|1000000|UINT32|0x00000031
>
>
>
> + ## Inditicates if internal devices will be prioritized over external devices.
>
> + # @prompt Prioritize internal devices.
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000032
>
> +
>
> [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>
> ## This PCD defines the Console output row. The default value is 25 according to UEFI spec.
>
> # This PCD could be set to 0 then console output would be at max column and max row.
>
> diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
> index b070f15ff2..7b8606f091 100644
> --- a/MdeModulePkg/MdeModulePkg.uni
> +++ b/MdeModulePkg/MdeModulePkg.uni
> @@ -1177,6 +1177,10 @@
>
>
> #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcGenericTimeoutValue_HELP #language en-US "Indicates the
> default timeout value for SD/MMC Host Controller operations in microseconds."
>
>
>
> +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_PROMPT #language en-US "Enable booting from
> internal devices before external devices."
>
> +
>
> +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPrioritizeInternal_HELP #language en-US "Indicates the if internal
> devices will be prioritized in boot order."
>
> +
>
> #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMPT #language en-US "Capsule On Disk
> relocation device path."
>
>
>
> #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP #language en-US "Full device path of
> platform specific device to store Capsule On Disk temp relocation file.<BR>"
>
> --
> 2.32.0
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#87789): https://edk2.groups.io/g/devel/message/87789
> Mute This Topic: https://groups.io/mt/89924426/1712937
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com]
> -=-=-=-=-=-=
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
@ 2022-03-16 22:21 Sean Rhodes
2022-03-16 22:21 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
0 siblings, 1 reply; 6+ messages in thread
From: Sean Rhodes @ 2022-03-16 22:21 UTC (permalink / raw)
To: devel; +Cc: Matt DeVillier, Jian J Wang, Liming Gao, Sean Rhodes
From: Matt DeVillier <matt.devillier@gmail.com>
Add Pcd to allow configuring internal devices to be prioritized over
internally-attached USB devices, such as card readers, over SATA, NVMe
and eMMC drives.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 ++++++++--
.../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 +
MdeModulePkg/MdeModulePkg.dec | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..28c3cff471 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2214,8 +2214,14 @@ BmEnumerateBootOptions (
//
// Skip the fixed block io then the removable block io
//
- if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
- continue;
+ if (FixedPcdGetBool (PcdPrioritizeInternal)) {
+ if (BlkIo->Media->RemovableMedia == (Removable == 0)) {
+ continue;
+ }
+ } else {
+ if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
+ continue;
+ }
}
Description = BmGetBootDescription (Handles[Index]);
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
index fe05d5f1cc..207420e334 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
+++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -119,3 +119,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 463e889e9a..ded82d1cff 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1077,6 +1077,9 @@
# @Prompt Enable UEFI Stack Guard.
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
+ # Prioritize Internal Devices
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000031
+
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action.
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option
2022-03-16 22:21 Sean Rhodes
@ 2022-03-16 22:21 ` Sean Rhodes
0 siblings, 0 replies; 6+ messages in thread
From: Sean Rhodes @ 2022-03-16 22:21 UTC (permalink / raw)
To: devel; +Cc: Sean Rhodes, Guo Dong, Ray Ni, Maurice Ma, Benjamin You
Hook PRIORITISE_INTERNAL build option to PrioritiseInternal PCD.
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
MdeModulePkg/MdeModulePkg.dec | 7 +++++--
UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index ded82d1cff..50b2eddd3f 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1077,8 +1077,11 @@
# @Prompt Enable UEFI Stack Guard.
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
- # Prioritize Internal Devices
- gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000031
+ ## Prioritize Internal Devices.
+ # If enabled, internal devices will be prioritized over external devices in the boot order.<BR><BR>
+ # TRUE - Internal devices are prioritized.<BR>
+ # FALSE - Internal devices are not prioritized.<BR>
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x30001057
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action.
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 558513baf1..56698fb61e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -35,6 +35,7 @@
DEFINE SMM_SUPPORT = FALSE
DEFINE ABOVE_4G_MEMORY = TRUE
DEFINE BOOT_MANAGER_ESCAPE = FALSE
+ DEFINE PRIORITIZE_INTERNAL = FALSE
#
# SBL: UEFI payload for Slim Bootloader
# COREBOOT: UEFI payload for coreboot
@@ -400,6 +401,7 @@
!if $(PERFORMANCE_MEASUREMENT_ENABLE)
gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1
!endif
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|$(PRIORITISE_INTERNAL)
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices
@ 2022-03-04 22:52 Sean Rhodes
2022-03-04 22:52 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
0 siblings, 1 reply; 6+ messages in thread
From: Sean Rhodes @ 2022-03-04 22:52 UTC (permalink / raw)
To: devel; +Cc: Matt DeVillier, Zhichao Gao, Ray Ni, Sean Rhodes
From: Matt DeVillier <matt.devillier@gmail.com>
Add Pcd to allow configuring internal devices to be prioritized over
internally-attached USB devices, such as card readers, over SATA, NVMe
and eMMC drives.
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 ++++++++--
.../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 +
MdeModulePkg/MdeModulePkg.dec | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..28c3cff471 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2214,8 +2214,14 @@ BmEnumerateBootOptions (
//
// Skip the fixed block io then the removable block io
//
- if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
- continue;
+ if (FixedPcdGetBool (PcdPrioritizeInternal)) {
+ if (BlkIo->Media->RemovableMedia == (Removable == 0)) {
+ continue;
+ }
+ } else {
+ if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
+ continue;
+ }
}
Description = BmGetBootDescription (Handles[Index]);
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
index fe05d5f1cc..207420e334 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
+++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -119,3 +119,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 463e889e9a..ded82d1cff 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1077,6 +1077,9 @@
# @Prompt Enable UEFI Stack Guard.
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
+ # Prioritize Internal Devices
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000031
+
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action.
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option
2022-03-04 22:52 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
@ 2022-03-04 22:52 ` Sean Rhodes
0 siblings, 0 replies; 6+ messages in thread
From: Sean Rhodes @ 2022-03-04 22:52 UTC (permalink / raw)
To: devel; +Cc: Sean Rhodes, Guo Dong, Ray Ni, Maurice Ma, Benjamin You
Hook PRIORITISE_INTERNAL build option to PrioritiseInternal PCD.
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
MdeModulePkg/MdeModulePkg.dec | 7 +++++--
UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index ded82d1cff..50b2eddd3f 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1077,8 +1077,11 @@
# @Prompt Enable UEFI Stack Guard.
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
- # Prioritize Internal Devices
- gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x00000031
+ ## Prioritize Internal Devices.
+ # If enabled, internal devices will be prioritized over external devices in the boot order.<BR><BR>
+ # TRUE - Internal devices are prioritized.<BR>
+ # FALSE - Internal devices are not prioritized.<BR>
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x30001057
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action.
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 4fe81a61d6..0f7fdbddfe 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -34,6 +34,7 @@
DEFINE SECURITY_STUB_ENABLE = TRUE
DEFINE SMM_SUPPORT = FALSE
DEFINE ABOVE_4G_MEMORY = TRUE
+ DEFINE PRIORITIZE_INTERNAL = FALSE
#
# SBL: UEFI payload for Slim Bootloader
# COREBOOT: UEFI payload for coreboot
@@ -399,6 +400,7 @@
!if $(PERFORMANCE_MEASUREMENT_ENABLE)
gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1
!endif
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|$(PRIORITISE_INTERNAL)
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-05-17 14:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-21 10:03 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
2022-03-21 10:03 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
2022-05-17 12:02 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sheng Lean Tan
2022-05-17 14:01 ` Ni, Ray
-- strict thread matches above, loose matches on Subject: below --
2022-03-16 22:21 Sean Rhodes
2022-03-16 22:21 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
2022-03-04 22:52 [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices Sean Rhodes
2022-03-04 22:52 ` [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option Sean Rhodes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox