From patchwork Thu May 5 19:22:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 67229 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp917425qge; Thu, 5 May 2016 12:22:40 -0700 (PDT) X-Received: by 10.98.64.79 with SMTP id n76mr23081895pfa.149.1462476160143; Thu, 05 May 2016 12:22:40 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id n76si12577794pfa.84.2016.05.05.12.22.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 May 2016 12:22:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B063F1A1F72; Thu, 5 May 2016 12:22:39 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 870E41A1EBF for ; Thu, 5 May 2016 12:22:38 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1854CA0A3B; Thu, 5 May 2016 19:22:38 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-77.phx2.redhat.com [10.3.113.77]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u45JMVdl015691; Thu, 5 May 2016 15:22:37 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 5 May 2016 21:22:16 +0200 Message-Id: <1462476147-10404-3-git-send-email-lersek@redhat.com> In-Reply-To: <1462476147-10404-1-git-send-email-lersek@redhat.com> References: <1462476147-10404-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Subject: [edk2] [PATCH 02/13] ArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfaces X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" "IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h" declares the following interfaces: - PlatformBdsInit - PlatformBdsPolicyBehavior - PlatformBdsBootFail - PlatformBdsBootSuccess - PlatformBdsLockNonUpdatableFlash - LockKeyboards >From these, we've been using PlatformBdsInit() and PlatformBdsPolicyBehavior(). "MdeModulePkg/Include/Library/PlatformBootManagerLib.h" declares the three interfaces below: - PlatformBootManagerBeforeConsole - PlatformBootManagerAfterConsole - PlatformBootManagerWaitCallback Comparing the BdsEntry() functions between - "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" and - "MdeModulePkg/Universal/BdsDxe/BdsEntry.c", we can establish the following mapping: IntelFrameworkModulePkg MdeModulePkg BdsEntry() BdsEntry() PlatformBdsInit() <--------------> PlatformBootManagerBeforeConsole() dispatch Driver#### <--------------> dispatch Driver#### connect consoles PlatformBdsPolicyBehavior() <------> PlatformBootManagerAfterConsole() The difference in connecting the consoles will be addressed in a later patch, now we just rename the functions according to the mapping above, and copy the call site comments from MdeModulePkg's BdsEntry(). For the third interface, PlatformBootManagerWaitCallback(), add an empty implementation (and copy the comment from the library class header). Platform BDS can use this callback to draw a progress bar, for example. This patch parallels OvmfPkg commit a7566234e92c. Cc: Ard Biesheuvel Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 4 +- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 54 +++++++++++++------- 2 files changed, 37 insertions(+), 21 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 1ad4c6f220f8..d2013b0f60a6 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -18,11 +18,11 @@ [Defines] INF_VERSION = 0x00010005 - BASE_NAME = PlatformIntelBdsLib + BASE_NAME = PlatformBootManagerLib FILE_GUID = 469184E8-FADA-41E4-8823-012CA19B40D4 MODULE_TYPE = DXE_DRIVER VERSION_STRING = 1.0 - LIBRARY_CLASS = PlatformBdsLib|DXE_DRIVER + LIBRARY_CLASS = PlatformBootManagerLib|DXE_DRIVER # # The following information is for reference only and not required by the build tools. diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c index f841d7c1b5c6..4920621e5d19 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -126,13 +125,19 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = { // BDS Platform Functions // /** - Platform Bds init. Include the platform firmware vendor, revision - and so crc check. - + Do the platform init, can be customized by OEM/IBV + Possible things that can be done in PlatformBootManagerBeforeConsole: + > Update console variable: 1. include hot-plug devices; + > 2. Clear ConIn and add SOL for AMT + > Register new Driver#### or Boot#### + > Register new Key####: e.g.: F12 + > Signal ReadyToLock event + > Authentication action: 1. connect Auth devices; + > 2. Identify auto logon user. **/ VOID EFIAPI -PlatformBdsInit ( +PlatformBootManagerBeforeConsole ( VOID ) { @@ -344,23 +349,20 @@ AddOutput ( /** - The function will execute with as the platform policy, current policy - is driven by boot mode. IBV/OEM can customize this code for their specific - policy action. - - @param DriverOptionList The header of the driver option link list - @param BootOptionList The header of the boot option link list - @param ProcessCapsules A pointer to ProcessCapsules() - @param BaseMemoryTest A pointer to BaseMemoryTest() - + Do the platform specific action after the console is ready + Possible things that can be done in PlatformBootManagerAfterConsole: + > Console post action: + > Dynamically switch output mode from 100x31 to 80x25 for certain senarino + > Signal console ready platform customized event + > Run diagnostics like memory testing + > Connect certain devices + > Dispatch aditional option roms + > Special boot: e.g.: USB boot, enter UI **/ VOID EFIAPI -PlatformBdsPolicyBehavior ( - IN LIST_ENTRY *DriverOptionList, - IN LIST_ENTRY *BootOptionList, - IN PROCESS_CAPSULES ProcessCapsules, - IN BASEM_MEMORY_TEST BaseMemoryTest +PlatformBootManagerAfterConsole ( + VOID ) { // @@ -489,3 +491,17 @@ PlatformBdsLockNonUpdatableFlash ( { return; } + +/** + This function is called each second during the boot manager waits the + timeout. + + @param TimeoutRemain The remaining timeout. +**/ +VOID +EFIAPI +PlatformBootManagerWaitCallback ( + UINT16 TimeoutRemain + ) +{ +}