From nobody Mon May 6 07:55:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52299+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52299+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1576627991; cv=none; d=zohomail.com; s=zohoarc; b=aeNaz34WoLn2dtw8wGi7kQnfgawS2AIt1tJfeHai8jX6BerS6W+lwI+5Jb7SA9BtiuzXGPE0H4GPcoZiVycSFedvxjPyWGeFSqvb0nhSsZvvfHLAcnVP3mUVKBYKmyT0T7RPcvECFHs0Jz8z8094xqmVyH1NtYiIC7Sn1cOZiB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576627991; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=u5LwmDc52LtRw4Iz82yCTYf2pzOFdzpd/vIGdDxGwX8=; b=iz3Rc8cB83HsLW8XHbooxZk4hei2oaPu4IJCexaHFvJE/tMOIfFB+1zxXAkyGFfbffa2hfivpSMwcAhq8hCzNL97LXUHVfGkdIMCbFvPGn/H474l4NU35qA1eEvMtTfYxmEvy1Oabx7mtoU9KpWqx6hPpZRTibqIpISMgFc5jsI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52299+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1576627991211165.93899389706007; Tue, 17 Dec 2019 16:13:11 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id j19IYY1788612xC2OwMRdIxZ; Tue, 17 Dec 2019 16:13:10 -0800 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.4501.1576627990150127908 for ; Tue, 17 Dec 2019 16:13:10 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Dec 2019 16:13:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,327,1571727600"; d="scan'208";a="212743168" X-Received: from gdong1-mobl.amr.corp.intel.com ([10.78.24.40]) by fmsmga008.fm.intel.com with ESMTP; 17 Dec 2019 16:13:09 -0800 From: "Guo Dong" To: devel@edk2.groups.io Cc: maurice.ma@intel.com, benjamin.you@intel.com, guo.dong@intel.com, u14935@gmail.com Subject: [edk2-devel] [PATCH V2] UefiPayloadPkg/BootManager: Add PS2 keyboard support Date: Tue, 17 Dec 2019 17:12:17 -0700 Message-Id: <20191218001217.13652-1-guo.dong@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guo.dong@intel.com X-Gm-Message-State: taCNimyYFucLPwOyED6zmGD3x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1576627990; bh=BjQweAPGCpxj00jpgbBV9jB49eqNKWhZazNTDD576Ts=; h=Cc:Date:From:Reply-To:Subject:To; b=SySZSQ7YD6sP/0OCTGGk0DursAWvoP34igXKNxQDauN8d2eVqSmX+VAt/TPQH6SUOGA ni8toSi4BQ5qnXHi9T1up2mdU1BpI99cInuJfJkuz1akWZmeWceABQdkAKfrhFtmka/FV 9PiHRp1o6Q6d5qK9NLQvesTvrQMM8RnhtjA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add PS2 keyboard support. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2316 This patch adds PS2 keyboard support in boot manager, and add a build flag PS2_KEYBOARD_ENABLE for PS2 keyboard to build PS2 keyboard driver and SIO driver. Be default the build flag is not enabled since PS2 keyboard is not common used. could use -DPS2_KEYBOARD_ENABLE to enable build it if need this feature. Signed-off-by: Guo Dong Reviewed-by: Maurice Ma --- UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c | 25 +++++= +++++++++++++++----- UefiPayloadPkg/UefiPayloadPkg.fdf | 4 ++++ UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 4 ++++ UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 5 +++++ 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.= c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c index ee2d8c8d1e..a27cc552ab 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c @@ -44,6 +44,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define gPnp16550ComPort \ PNPID_DEVICE_PATH_NODE(0x0501) =20 +#define gPnpPs2Keyboard \ + PNPID_DEVICE_PATH_NODE(0x0303) + #define gUartVendor \ { \ { \ @@ -87,7 +90,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent DEVICE_PATH_MESSAGING_PC_ANSI \ } =20 - +ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode =3D gPnpPs2Keyboard; ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode =3D gPnp16550ComPort; UART_DEVICE_PATH gUartDeviceNode =3D gUart; VENDOR_DEVICE_PATH gTerminalTypeDeviceNode =3D gPcAnsiTerminal; @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL *gPlatformRootBridg= es[] =3D { BOOLEAN mDetectVgaOnly; =20 /** - Add UART to ConOut, ConIn, ErrOut. + Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut. =20 - @param[in] DeviceHandle - LPC device path. + @param[in] DeviceHandle Handle of the LPC Bridge device. =20 - @retval EFI_SUCCESS - Serial console is added to ConOut, ConIn, and Err= Out. - @retval EFI_STATUS - No serial console is added. + @retval EFI_SUCCESS Console devices on the LPC bridge have been added to + ConOut, ConIn, and ErrOut. + + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. **/ EFI_STATUS PrepareLpcBridgeDevicePath ( @@ -123,6 +129,7 @@ PrepareLpcBridgeDevicePath ( { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; =20 DevicePath =3D NULL; Status =3D gBS->HandleProtocol ( @@ -133,10 +140,18 @@ PrepareLpcBridgeDevicePath ( if (EFI_ERROR (Status)) { return Status; } + TempDevicePath =3D DevicePath; + + // + // Register Keyboard + // + DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gPnpPs2KeyboardDeviceNode); + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); =20 // // Register COM1 // + DevicePath =3D TempDevicePath; DevicePath =3D AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL, (= EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode); DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gUartDeviceNode); DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gTerminalTypeDeviceNode); diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload= Pkg.fdf index 4cd88a3f85..dfbcde5668 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.fdf +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf @@ -120,6 +120,10 @@ INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridg= eDxe.inf # ISA Support # INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf +!if $(PS2_KEYBOARD_ENABLE) =3D=3D TRUE +INF OvmfPkg/SioBusDxe/SioBusDxe.inf +INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf +!endif =20 # # Console Support diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc b/UefiPayloadPkg/UefiPay= loadPkgIa32.dsc index 11cf17ca06..d52945442e 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc @@ -491,6 +491,10 @@ # ISA Support # MdeModulePkg/Universal/SerialDxe/SerialDxe.inf +!if $(PS2_KEYBOARD_ENABLE) =3D=3D TRUE + OvmfPkg/SioBusDxe/SioBusDxe.inf + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf +!endif =20 # # Console Support diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/Uefi= PayloadPkgIa32X64.dsc index 5b7994a62c..0736cd9954 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc @@ -25,6 +25,7 @@ FLASH_DEFINITION =3D UefiPayloadPkg/UefiPayloadPkg.fdf =20 DEFINE SOURCE_DEBUG_ENABLE =3D FALSE + DEFINE PS2_KEYBOARD_ENABLE =3D FALSE =20 # # SBL: UEFI payload for Slim Bootloader @@ -492,6 +493,10 @@ # ISA Support # MdeModulePkg/Universal/SerialDxe/SerialDxe.inf +!if $(PS2_KEYBOARD_ENABLE) =3D=3D TRUE + OvmfPkg/SioBusDxe/SioBusDxe.inf + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf +!endif =20 # # Console Support --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52299): https://edk2.groups.io/g/devel/message/52299 Mute This Topic: https://groups.io/mt/68776665/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-