From patchwork Fri Dec 8 15:01:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 121176 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp763262qgn; Fri, 8 Dec 2017 07:02:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMaWlo9mPiM/aSAvVcmBgiylY2WONw68aOF0NHwiVUqaKw3LTPkm8wSr0jFKUOFOKwpmiBuh X-Received: by 10.84.179.193 with SMTP id b59mr30827216plc.12.1512745320586; Fri, 08 Dec 2017 07:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512745320; cv=none; d=google.com; s=arc-20160816; b=CRV6WGeppB8mcP7jE1nBrq8VnKLOW0xykToByEoRLEJi+mM3tol1z8TfcpyAYC2wc6 /4j3BSXlVyE8YeMu5vxcRtUdw3sX9ch6SwQRWDLf2kXTRPGBEA4ZyNiUoe0QOE1HWtdD e6ep8yfW78TDxOxKbJxEsysn0o6Z3FpLvw8J5VAOAuCYXv4uNfS8yR2DKIAIBAhX7foU 1+pHo9R6YJvP7fmFsKirkY/WKgQPirUVmJBkt9trzLOugPpSFow3dXkglOakZYpyh9Mc 0EFl5PH0EkfikIQDMsH2dbDjo4ECN+hBKqGfRdoBy6O0NDWAvuE0l8vaqM30P2uXYNFo fShQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=rjFpLybTQtH7kLcnUhGghh31wJ9WMRbbcUfsVxhgzlc=; b=xqayB4n1OqvaFxjiOxYe9UY1O7v3oSUmcdAOiUznpH72/PmZ8AZlx3UpBnTKmKqR2k VVoGQYmXiP7m7Y6I6uKWDgbAML/F5LfnkvXUaAtdYHFVKXE+7shDBqnbQlRU6yXtmkqw PG5hOIYlNjHTFHqqRzVmdYitmbEpk7dRmjS+UgqQ+Fpf8Bmwv80otqIFOeqvbl8qagrW vP9SIXMFhENhJ6BFWKjAbkDjfHnec5wcyJisThgJi4utQFhYKc9wneq/l55SBA/Lgh6E 3zbIJCJIUk/zwDuJl/wRq4QCHENWsyD84TeUZdsTAXpJmoCUgS0obd9qgKgXvIg2tLWC XyfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=M+zAo+wF; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id w8si6208382pfa.267.2017.12.08.07.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2017 07:02:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=M+zAo+wF; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7B8A52217CE4D; Fri, 8 Dec 2017 06:57:25 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::232; helo=mail-wm0-x232.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 C99CA2217CE47 for ; Fri, 8 Dec 2017 06:57:23 -0800 (PST) Received: by mail-wm0-x232.google.com with SMTP id 64so3627918wme.3 for ; Fri, 08 Dec 2017 07:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=MXLxJld7UIF+GX72+n9AzZQexsmgJiDAfH82sOP7erI=; b=M+zAo+wFRmH4TYQBfx05gYmsvT75j5CNgjG57FU0evj9k9tfe55xHxm8YM8Wf+dCUb S06TPQwFg/6Pk2qe3xJ2gEJhHCJDkhQNXJL/XpCqVD8uKf82JNW7vbZoeSOu/5uZ2XR8 ubZI6yts6BNZIaZOU54UDe0+GsRWVlMkRt2ds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MXLxJld7UIF+GX72+n9AzZQexsmgJiDAfH82sOP7erI=; b=dofYks8iYCA92+8XAPpo7ydpVyQRyrXD5vtrJDtnRIkiN7KNXsAs3lTUDd/isvvD9E gvGnPyBZbmpGYOVueUmt5voqAiN0vHT+rm1BJampR0pMNiK2bl1lQ+iQ4Ara2CBit0pC pU78HWRucKSJv3twbUQFif8M77V4mnrx7aRDvc1IjjgKGaq1X4lryGjDfV5nBLbw65Ol GqrQ4OOdJCMnCPuQE3EsVxpS8ciMvvB7UE6SwsE5mhG83Ld02GVTbIULXtO+0CB88p8Q qhy87cv+1WIre+n38c4wPVDTivBMvBLm9Q4tMRpxQWC/54Zb7xvNHwsnFdvi9yHphA0+ VFhA== X-Gm-Message-State: AKGB3mKQZk8WmTSFy0qgm99O7gBnYTOd1rnNnRkwJdfAinJPWwedQjIs mfVBRh7frb5wR2TdjAEzZUJDNIx6mrA= X-Received: by 10.28.101.11 with SMTP id z11mr3878929wmb.110.1512745315866; Fri, 08 Dec 2017 07:01:55 -0800 (PST) Received: from localhost.localdomain ([160.171.158.223]) by smtp.gmail.com with ESMTPSA id a203sm1740784wmh.45.2017.12.08.07.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2017 07:01:54 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Fri, 8 Dec 2017 15:01:49 +0000 Message-Id: <20171208150149.10731-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 25 ++++++++++++++++++++ ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + 2 files changed, 26 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm 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