summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-12-08 14:55:22 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-12-08 16:33:15 +0000
commit6c4194c99e2ec6251b657ec8fb5834332f544b7b (patch)
tree9410bdadafa8e9b0ff6e478af578006ce3ef0c56 /ArmPkg
parent2b129e87c0f43ea3ace95f93c4d1d4e9eae61989 (diff)
downloadedk2-6c4194c99e2ec6251b657ec8fb5834332f544b7b.zip
edk2-6c4194c99e2ec6251b657ec8fb5834332f544b7b.tar.gz
edk2-6c4194c99e2ec6251b657ec8fb5834332f544b7b.tar.bz2
ArmPkg/PlatformBootManagerLib: print firmware version to console
If gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString is set to a non-empty string, print it to the console at boot. Note that this is independent of DEBUG/RELEASE or graphical vs serial console, although we do attempt to stay clear of the logo and progress bar in graphical mode, by printing it top center. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c25
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf1
2 files changed, 26 insertions, 0 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
index 95e739c..ccdb3e0 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -515,6 +515,8 @@ PlatformBootManagerBeforeConsole (
PlatformRegisterOptionsAndKeys ();
}
+#define VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version "
+
/**
Do the platform specific action after the console is ready
Possible things that can be done in PlatformBootManagerAfterConsole:
@@ -534,14 +536,37 @@ PlatformBootManagerAfterConsole (
{
ESRT_MANAGEMENT_PROTOCOL *EsrtManagement;
EFI_STATUS Status;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
+ UINTN FirmwareVerLength;
+ UINTN PosX;
+ UINTN PosY;
+
+ FirmwareVerLength = StrLen (PcdGetPtr (PcdFirmwareVersionString));
//
// Show the splash screen.
//
Status = BootLogoEnableLogo ();
if (EFI_ERROR (Status)) {
+ if (FirmwareVerLength > 0) {
+ Print (VERSION_STRING_PREFIX L"%s",
+ PcdGetPtr (PcdFirmwareVersionString));
+ }
Print (L"Press ESCAPE for boot options ");
+ } else if (FirmwareVerLength > 0) {
+ Status = gBS->HandleProtocol (gST->ConsoleOutHandle,
+ &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
+ if (!EFI_ERROR (Status)) {
+ PosX = (GraphicsOutput->Mode->Info->HorizontalResolution -
+ (StrLen (VERSION_STRING_PREFIX) + FirmwareVerLength) *
+ EFI_GLYPH_WIDTH) / 2;
+ PosY = 0;
+
+ PrintXY (PosX, PosY, NULL, NULL, VERSION_STRING_PREFIX L"%s",
+ PcdGetPtr (PcdFirmwareVersionString));
+ }
}
+
//
// Connect the rest of the devices.
//
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index fce7349..71f1d04 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -59,6 +59,7 @@
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
[FixedPcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity