From 72385b183a943c9c3da46beca9fe222afec6393e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20B=C4=83l=C4=83nic=C4=83?= Date: Thu, 11 Jan 2024 05:59:23 +0200 Subject: [PATCH] PlatformBootManagerLib: Add USB keyboard path to ConIn earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a keyboard gets installed after connecting the USB controller handles, ConPlatformDxe will check that its short-form device path exists in the ConIn variable before enabling input from it. This variable is missing at first boot, so adding the path after the keyboard was already ignored means it won't be usable during BDS countdown. Signed-off-by: Mario Bălănică --- .../PlatformBootManagerLib/PlatformBm.c | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/edk2-rockchip/Silicon/Rockchip/Library/PlatformBootManagerLib/PlatformBm.c b/edk2-rockchip/Silicon/Rockchip/Library/PlatformBootManagerLib/PlatformBm.c index 675ca7f6..c2899079 100644 --- a/edk2-rockchip/Silicon/Rockchip/Library/PlatformBootManagerLib/PlatformBm.c +++ b/edk2-rockchip/Silicon/Rockchip/Library/PlatformBootManagerLib/PlatformBm.c @@ -859,6 +859,20 @@ PlatformBootManagerBeforeConsole ( // EfiBootManagerDispatchDeferredImages (); + // + // Add the hardcoded short-form USB keyboard device path to ConIn. + // This must be done prior to connecting any USB bus controllers, because + // when a keyboard gets installed, ConPlatformDxe will immediately check + // that its device path exists in the ConIn variable before enabling input + // from it. Since this variable is not initially populated at first boot, + // we would otherwise end up with no keyboard input during BDS countdown. + // + EfiBootManagerUpdateConsoleVariable ( + ConIn, + (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, + NULL + ); + // // 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 @@ -901,15 +915,6 @@ PlatformBootManagerBeforeConsole ( // FilterAndProcess (&gEfiBlockIoProtocolGuid, IsSdBootBlockIo, Connect); - // - // Add the hardcoded short-form USB keyboard device path to ConIn. - // - EfiBootManagerUpdateConsoleVariable ( - ConIn, - (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, - NULL - ); - // // Add the hardcoded serial console device path to ConIn, ConOut, ErrOut. //