From e2a193b733aa1fa33a8b1c4ed062c6dc092c267c Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 5 May 2016 16:24:00 +0200 Subject: [PATCH] ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole() With IntelFrameworkModulePkg BDS, the platform code is responsible for updating console variables (e.g., with BdsLibUpdateConsoleVariable()), and then connecting them (e.g., with BdsLibConnectAllDefaultConsoles()). This is usually (although not necessarily) done in PlatformBdsPolicyBehavior(). With MdeModulePkg BDS, the platform is responsible for updating the console variables in PlatformBootManagerBeforeConsole(). When that function returns, BdsEntry() will automatically connect the consoles; the platform is not responsible for the connection. IntelFrameworkModulePkg MdeModulePkg BdsEntry BdsEntry PlatformBdsInit PlatformBootManagerBeforeConsole +----> EfiBootManagerUpdateConsoleVariable | dispatch Driver#### | dispatch Driver#### | +> connect consoles | | PlatformBdsPolicyBehavior | | PlatformBootManagerAfterConsole BdsLibUpdateConsoleVariable <--+ | BdsLibConnectAllDefaultConsoles <+ display splash screen display splash screen Thus, move the console variable massaging from the beginning of PlatformBootManagerAfterConsole() (originally PlatformBdsPolicyBehavior()) to the end of PlatformBootManagerBeforeConsole(), and drop the explicit BdsLibConnectAllDefaultConsoles() call. This patch parallels OvmfPkg commit e9e9ad644fab. Cc: Ard Biesheuvel Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Tested-by: Ard Biesheuvel Reviewed-by: Ruiyu Ni --- .../PlatformBootManagerLib/PlatformBm.c | 77 +++++++++---------- 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 3157b89980..81cee15af9 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -122,32 +122,6 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = { } }; -// -// BDS Platform Functions -// -/** - 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 -PlatformBootManagerBeforeConsole ( - VOID - ) -{ - // - // Signal EndOfDxe PI Event - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); -} - /** Check if the handle satisfies a particular condition. @@ -349,23 +323,31 @@ AddOutput ( } +// +// BDS Platform Functions +// /** - 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 + 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 -PlatformBootManagerAfterConsole ( +PlatformBootManagerBeforeConsole ( VOID ) { + // + // Signal EndOfDxe PI Event + // + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); + // // Locate the PCI root bridges and make the PCI bus driver connect each, // non-recursively. This will produce a number of child handles with PciIo on @@ -408,12 +390,25 @@ PlatformBootManagerAfterConsole ( (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL); EfiBootManagerUpdateConsoleVariable (ErrOut, (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL); +} - // - // Connect the consoles based on the above variables. - // - BdsLibConnectAllDefaultConsoles (); - +/** + 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 +PlatformBootManagerAfterConsole ( + VOID + ) +{ // // Show the splash screen. // -- 2.39.2