From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::22b; helo=mail-it0-x22b.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 21A652217CE53 for ; Fri, 8 Dec 2017 08:32:39 -0800 (PST) Received: by mail-it0-x22b.google.com with SMTP id d16so5974617itj.1 for ; Fri, 08 Dec 2017 08:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=n0y+z1hxM2ksygIoFgKEBciwELov/e7C2HQTMfYcl2A=; b=WmFwcHWKZrsNmLcyowse9tQ4P0oQ321SkhsDCF15xaRvNJ+S4WjIECc7hyIfw24d9o C6GfoLGJ7oI/LWW+Q9H7Cfpu8sqExwRTrU5VoYp3/elMoSGr+zju2ZxnBzRgGmX+L8Cu GMjgi1daVnpGQhf+jWfn3DcmP6C/W/bxj2Ffk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=n0y+z1hxM2ksygIoFgKEBciwELov/e7C2HQTMfYcl2A=; b=gI3tyoossqwq3eXtS88/Ua35j8AsX7OvCFCY/iWuKfYQ0/GxmLjYejwYtUY/wG4OEu ObfssU5NgtRtgRyruNH431Xp36+TJYRnhYuZAf5fYLL94Nls+JAA+YeavlbLy9StLF6P XFTvOendleGgxnNMG4Bb5y3TVQEZmLXYD5N5gzv+uol1ye4JSHWL3+8jC/HieBMb6UTd +l3RzZ2EaiQdPUrKrRUSXUA4dV249GKys20OI+s2OmHWdP37x45I8SjsjHxyTNNSpZ9J QTpr/c3BXaiELxkBlvnpnxvGi08Uw7LTJplpCJrswASLbFyYHl0SnLZqRelu9NO7tz1f T9sQ== X-Gm-Message-State: AKGB3mKGPUwLR4qbocYM0S9etyZGIsZN1aZbVbpd1w2x+K+R8uqJKOvP HDchJEIZg9VlLaep7u3bS8gs8/1hL9PwU2rHCSg3wpQ1Oso= X-Google-Smtp-Source: AGs4zMZYuc3UWqAQk0ljf7ryMafvH6lFPQ6PsJrueYUKqkmq7kZUOcI9IlClfHFybdF+DOt+KWusm5F49NAsCdwi78E= X-Received: by 10.36.78.212 with SMTP id r203mr6594661ita.58.1512751032916; Fri, 08 Dec 2017 08:37:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Fri, 8 Dec 2017 08:37:12 -0800 (PST) In-Reply-To: <20171208163148.dng2ndivzyantbmp@bivouac.eciton.net> References: <20171208150149.10731-1-ard.biesheuvel@linaro.org> <20171208163148.dng2ndivzyantbmp@bivouac.eciton.net> From: Ard Biesheuvel Date: Fri, 8 Dec 2017 16:37:12 +0000 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" Subject: Re: [PATCH] ArmPkg/PlatformBootManagerLib: print firmware version to console X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Dec 2017 16:32:39 -0000 Content-Type: text/plain; charset="UTF-8" On 8 December 2017 at 16:31, Leif Lindholm wrote: > On Fri, Dec 08, 2017 at 03:01:49PM +0000, Ard Biesheuvel wrote: >> 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 > > Reviewed-by: Leif Lindholm > Thanks. Pushed as 6c4194c99e2e >> --- >> ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 25 ++++++++++++++++++++ >> ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + >> 2 files changed, 26 insertions(+) >> >> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c >> index 95e739c66c29..ccdb3e0a5d78 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 fce7349ff867..71f1d04a87ee 100644 >> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf >> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf >> @@ -59,6 +59,7 @@ [FeaturePcd] >> gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport >> >> [FixedPcd] >> + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString >> gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate >> gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits >> gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity >> -- >> 2.11.0 >>