From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com []) by mx.groups.io with SMTP id smtpd.web09.2403.1576287159525865036 for ; Fri, 13 Dec 2019 17:32:40 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: prince.agyeman@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 17:32:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,311,1571727600"; d="scan'208";a="297091535" Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.84]) by orsmga001.jf.intel.com with ESMTP; 13 Dec 2019 17:32:38 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Nate DeSimone , Michael Kubacki Subject: [edk2-platforms] [PATCH 10/11] SimicsOpenBoardPkg: Add BDS Board Boot Manager library Date: Fri, 13 Dec 2019 17:32:36 -0800 Message-Id: <6c40c7b6ebde73fcaa110be9ff55de3e58f7bb47.1576282834.git.prince.agyeman@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2336 This library implements PlatformBootManagerWaitCallback and PlatformBootManagerUnableToBoot which can be linked Minplatform's PlatformBootManager libary instance. Cc: Nate DeSimone Cc: Michael Kubacki Signed-off-by: Prince Agyeman --- .../BoardBootManagerLib/BoardBootManager.c | 67 +++++++++++++++++++ .../BoardBootManagerLib.inf | 45 +++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManager.c create mode 100644 Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManager.c b/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManager.c new file mode 100644 index 0000000000..58035f2766 --- /dev/null +++ b/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManager.c @@ -0,0 +1,67 @@ +/** @file + The Board Boot Manager Library implements BoardBootManagerWaitCallback + and BoardBootManagerUnableToBoot callback, which is linked to the + Platform Boot Manager Library + + Copyright (c) 2019 Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + This function is called each second during the boot manager waits the + timeout. + + @param TimeoutRemain The remaining timeout. +**/ +VOID +EFIAPI +BoardBootManagerWaitCallback ( + UINT16 TimeoutRemain + ) +{ + EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White; + UINT16 Timeout; + + Timeout = PcdGet16 (PcdPlatformBootTimeOut); + + Black.Raw = 0x00000000; + White.Raw = 0x00FFFFFF; + + BootLogoUpdateProgress ( + White.Pixel, + Black.Pixel, + L"Start boot option", + White.Pixel, + (Timeout - TimeoutRemain) * 100 / Timeout, + 0 + ); +} + +/** + The function is called when no boot option could be launched, + including platform recovery options and options pointing to applications + built into firmware volumes. + + If this function returns, BDS attempts to enter an infinite loop. +**/ +VOID +EFIAPI +BoardBootManagerUnableToBoot ( + VOID + ) +{ + +} diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf b/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf new file mode 100644 index 0000000000..20778981bc --- /dev/null +++ b/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf @@ -0,0 +1,45 @@ +## @file +# Definition file for the Board Boot Manager Library. +# +# Copyright (c) 2019 Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = BoardBootManagerLib + FILE_GUID = EBBB176A-3883-4BA4-A74D-1510D0C35B37 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = BoardBootManagerLib|DXE_DRIVER + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + BoardBootManager.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + MinPlatformPkg/MinPlatformPkg.dec + +[LibraryClasses] + BaseLib + UefiBootServicesTableLib + DebugLib + UefiLib + HobLib + UefiBootManagerLib + TimerLib + BoardBootManagerLib + BootLogoLib + PcdLib + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut -- 2.19.1.windows.1