summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Bds/BootOptionSupport.c
diff options
context:
space:
mode:
authorHarry Liebel <Harry.Liebel@arm.com>2014-09-24 17:13:23 +0100
committerRyan Harkin <ryan.harkin@linaro.org>2014-10-22 16:22:41 +0100
commitf4affe6f42ba5ea4d50ca65253dafa9b278ea260 (patch)
tree9897f00e425f8bcfb14258965f02eb7d28ff2978 /ArmPlatformPkg/Bds/BootOptionSupport.c
parentaa592e479db328a8703ca8d2eb790ed0051fdbb5 (diff)
ArmPlatformPkg/Bds: Reduce boot device entrieslinaro-platform-juno/14.10linaro-platform-juno
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. Signed-off-by: Harry Liebel <Harry.Liebel@arm.com> Change-Id: I47b8e32d1f4b21d7c8701f646870643b5fb86716
Diffstat (limited to 'ArmPlatformPkg/Bds/BootOptionSupport.c')
-rw-r--r--ArmPlatformPkg/Bds/BootOptionSupport.c55
1 files changed, 43 insertions, 12 deletions
diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c b/ArmPlatformPkg/Bds/BootOptionSupport.c
index 6dc2ed653..ee4281855 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