summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2012-11-26 16:30:04 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2012-11-26 16:55:13 +0000
commit87150407e1570cf5883dd927d2f05be12113b642 (patch)
tree07c51ff9f3d200ac8af174f9b529e44676e85a75
parent8cf4d079377df54cd3918039d9a0608c99f26d5a (diff)
Bds: show global FDT config in main menu
Previously, there was no way to read the global FDT config. This patch displays the global FDT config after the boot devices in the main menu. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rw-r--r--edk2/ArmPlatformPkg/Bds/BootMenu.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/edk2/ArmPlatformPkg/Bds/BootMenu.c b/edk2/ArmPlatformPkg/Bds/BootMenu.c
index 3f443fca8..1cc048e51 100644
--- a/edk2/ArmPlatformPkg/Bds/BootMenu.c
+++ b/edk2/ArmPlatformPkg/Bds/BootMenu.c
@@ -613,6 +613,9 @@ BootMenuMain (
UINTN Index;
UINTN BootMainEntryCount;
CHAR8 BootOptionSelectedStr[32];
+ EFI_DEVICE_PATH_PROTOCOL* DefaultFdtDevicePath;
+ UINTN FdtDevicePathSize;
+
BootOption = NULL;
BootMainEntryCount = sizeof(BootMainEntries) / sizeof(struct BOOT_MAIN_ENTRY);
@@ -672,6 +675,30 @@ BootMenuMain (
}
BootOptionCount = OptionCount-1;
+ // Display the global FDT config
+ Print(L"-----------------------\n");
+ {
+ EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol;
+ EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath;
+ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;
+ CHAR16* DevicePathTxt;
+
+ // Get the default FDT device path
+ Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);
+ ASSERT_EFI_ERROR(Status);
+ DefaultFdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));
+
+ // Get the FDT device path
+ FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath);
+ Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);
+ ASSERT_EFI_ERROR(Status);
+
+ // Convert FdtDevicePath to text
+ Status = gBS->LocateProtocol (&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
+ DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText ( FdtDevicePath, TRUE, TRUE );
+ Print(L"Global FDT Config\n\t- %s\n", DevicePathTxt);
+ }
+
// Display the hardcoded Boot entries
Print(L"-----------------------\n");
for (Index = 0; Index < BootMainEntryCount; Index++) {