diff options
author | Harry Liebel <Harry.Liebel@arm.com> | 2014-10-10 10:39:36 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-10-10 10:39:36 +0000 |
commit | 3a0e4800a328f5d7893e080f65edcc6bd0bc07e5 (patch) | |
tree | 2864415363b97afbf6c08238b42b2bd3839485ac /ArmPlatformPkg/Bds | |
parent | 2618ea2c05f56ff9cfe2048e899d4bed1719d995 (diff) | |
download | edk2-3a0e4800a328f5d7893e080f65edcc6bd0bc07e5.tar.gz edk2-3a0e4800a328f5d7893e080f65edcc6bd0bc07e5.tar.bz2 edk2-3a0e4800a328f5d7893e080f65edcc6bd0bc07e5.zip |
ArmPlatformPkg/Bds: Reduce boot device entries
If a storage device is used for Variable storage or access is provided
by the Simple Filesystem Protocol do not list it again for RAW memory
map access in the 'Add Boot device' menu.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16203 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Bds')
-rw-r--r-- | ArmPlatformPkg/Bds/Bds.inf | 2 | ||||
-rw-r--r-- | ArmPlatformPkg/Bds/BootOptionSupport.c | 55 |
2 files changed, 45 insertions, 12 deletions
diff --git a/ArmPlatformPkg/Bds/Bds.inf b/ArmPlatformPkg/Bds/Bds.inf index a3efb6f4ab..5a2f86bf8c 100644 --- a/ArmPlatformPkg/Bds/Bds.inf +++ b/ArmPlatformPkg/Bds/Bds.inf @@ -61,6 +61,8 @@ gEfiPxeBaseCodeProtocolGuid
gEfiSimpleNetworkProtocolGuid
gEfiDevicePathToTextProtocolGuid
+ gEfiFirmwareVolumeBlockProtocolGuid
+ gEfiFirmwareVolumeBlock2ProtocolGuid
[Pcd]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor
diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c b/ArmPlatformPkg/Bds/BootOptionSupport.c index 6dc2ed6536..ee4281855e 100644 --- a/ArmPlatformPkg/Bds/BootOptionSupport.c +++ b/ArmPlatformPkg/Bds/BootOptionSupport.c @@ -18,6 +18,7 @@ #include <Protocol/BlockIo.h>
#include <Protocol/DevicePathToText.h>
+#include <Protocol/FirmwareVolumeBlock.h>
#include <Protocol/PxeBaseCode.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/SimpleNetwork.h>
@@ -530,17 +531,19 @@ BdsLoadOptionMemMapList ( IN OUT LIST_ENTRY* BdsLoadOptionList
)
{
- EFI_STATUS Status;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN DevicePathHandleCount;
- EFI_HANDLE *DevicePathHandleBuffer;
- BOOLEAN IsParent;
- UINTN Index;
- UINTN Index2;
- BDS_SUPPORTED_DEVICE *SupportedDevice;
- EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol;
- EFI_DEVICE_PATH* DevicePath;
+ EFI_STATUS Status;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
+ UINTN DevicePathHandleCount;
+ EFI_HANDLE *DevicePathHandleBuffer;
+ BOOLEAN IsParent;
+ UINTN Index;
+ UINTN Index2;
+ BDS_SUPPORTED_DEVICE *SupportedDevice;
+ EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol;
+ EFI_DEVICE_PATH* DevicePath;
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileProtocol;
+ EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbProtocol;
// List all the BlockIo Protocols
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &HandleCount, &HandleBuffer);
@@ -549,7 +552,35 @@ BdsLoadOptionMemMapList ( }
for (Index = 0; Index < HandleCount; Index++) {
- // We only select the handle WITH a Device Path AND not part of Media (to avoid duplication with HardDisk, CDROM, etc)
+ // We only select handles WITH a Device Path AND not part of Media (to
+ // avoid duplication with HardDisk, CDROM, etc). Skip handles used by
+ // Simple Filesystem or used for Variable Storage.
+
+
+ Status = gBS->HandleProtocol (HandleBuffer[Index],
+ &gEfiSimpleFileSystemProtocolGuid,
+ (VOID *)&FileProtocol);
+ if (!EFI_ERROR(Status)) {
+ // SimpleFilesystem supported on this handle, skip
+ continue;
+ }
+
+ Status = gBS->HandleProtocol (HandleBuffer[Index],
+ &gEfiFirmwareVolumeBlockProtocolGuid,
+ (VOID *)&FvbProtocol);
+ if (!EFI_ERROR(Status)) {
+ // Firmware Volme Block / Variable storage supported on this handle, skip
+ continue;
+ }
+
+ Status = gBS->HandleProtocol (HandleBuffer[Index],
+ &gEfiFirmwareVolumeBlock2ProtocolGuid,
+ (VOID *)&FvbProtocol);
+ if (!EFI_ERROR(Status)) {
+ // Firmware Volme Block / Variable storage supported on this handle, skip
+ continue;
+ }
+
Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **)&DevicePathProtocol);
if (!EFI_ERROR(Status)) {
// BlockIo is not part of Media Device Path
|