From nobody Fri Nov 1 14:25:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1512745320997944.3295459255347; Fri, 8 Dec 2017 07:02:00 -0800 (PST) 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) 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) 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) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.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 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-Google-Smtp-Source: AGs4zMZnkgi2HGEwNdVd5MwWj3KCBRKdnJRahEZMVlDWI5o0KJUGGv5WPfcbNwXGlBd5QuQuIpVFQg== X-Received: by 10.28.101.11 with SMTP id z11mr3878929wmb.110.1512745315866; Fri, 08 Dec 2017 07:01:55 -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 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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(+) diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Li= brary/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 (); } =20 +#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 =3D StrLen (PcdGetPtr (PcdFirmwareVersionString)); =20 // // Show the splash screen. // Status =3D 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 =3D gBS->HandleProtocol (gST->ConsoleOutHandle, + &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOut= put); + if (!EFI_ERROR (Status)) { + PosX =3D (GraphicsOutput->Mode->Info->HorizontalResolution - + (StrLen (VERSION_STRING_PREFIX) + FirmwareVerLength) * + EFI_GLYPH_WIDTH) / 2; + PosY =3D 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.i= nf 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 =20 [FixedPcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel