From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (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 B5D5A2217CE53 for ; Fri, 8 Dec 2017 08:27:22 -0800 (PST) Received: by mail-wr0-x243.google.com with SMTP id s66so11341079wrc.9 for ; Fri, 08 Dec 2017 08:31:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zFI4VOj2aawUwdyBhSkBwyTcGDgmJjQkJKHANX5qlGM=; b=a1onoOUQIWV35uQ8I0VDB+kM3yxMNlcGIyb6bOIK//vQbYLeaj3XkIgUr01dIDA21e yHqHqz79AD7yaHxcgJGKEMjFERh1wkpHHpL7I4ON7YyBhixBCpgPKeBB0dslU4fXbIWu F5SIMrN04/R6QEnXJkZuvFuYS2Qbweh87TUcc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zFI4VOj2aawUwdyBhSkBwyTcGDgmJjQkJKHANX5qlGM=; b=EhZRUHwvcQyVRB8LLkz0MPLWTEcb/n28ChKlkkR3Jbqf5oQQk0lFGWfZuLD9dIPwrJ k8NyfaOn+NXET4KeefajQkABM/0bkLFq3eSjbNbKZtvwF7VfNh/ZBj/uztEpLTv1DVcM fh7RKc+lcUtTnceR72i+OuvJsnxSHqQ7D55CRFa1jUeVYrtsQX+HVza9Y0fonwHoZz7e cW1yNnSkw+J97wWORduoSt/eoEwqRNo/d3S3QIY2iqg9gDEUQTwp5rP9X/yB849P/ysC MqRT3iHUKyeuQfsCy9eXcsRgzNv/2/WQNMuSe2FxVUDeulaBTmbD3LakjY3VPnqbRIvi xGTQ== X-Gm-Message-State: AJaThX5H1Xk0O+gCyAirh20e0TzRVWNa7hVz5w2wRCp8w97YXfL3LcEt RrdW18Bi0n3Ub/plZ8FJLgLWhg== X-Google-Smtp-Source: AGs4zMai3ATOiPdt7Yh3ug/f44YT64YQuvbqKBSmKD64SSYPdera2/y6Xq0AXA1xbVDxh7udVKNSeA== X-Received: by 10.223.196.179 with SMTP id m48mr26201428wrf.67.1512750715817; Fri, 08 Dec 2017 08:31:55 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id e4sm1967968wmi.14.2017.12.08.08.31.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Dec 2017 08:31:54 -0800 (PST) Date: Fri, 8 Dec 2017 16:31:48 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20171208163148.dng2ndivzyantbmp@bivouac.eciton.net> References: <20171208150149.10731-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20171208150149.10731-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) 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:27:23 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > 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 >