From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.12711.1576686924259828594 for ; Wed, 18 Dec 2019 08:35:24 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: maurice.ma@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2019 08:35:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,330,1571727600"; d="scan'208";a="240842511" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by fmsmga004.fm.intel.com with ESMTP; 18 Dec 2019 08:35:23 -0800 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 18 Dec 2019 08:35:22 -0800 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.174]) by ORSMSX112.amr.corp.intel.com ([169.254.3.41]) with mapi id 14.03.0439.000; Wed, 18 Dec 2019 08:35:22 -0800 From: "Ma, Maurice" To: "Dong, Guo" CC: "You, Benjamin" , "u14935@gmail.com" , "devel@edk2.groups.io" Subject: Re: [edk2-devel] [PATCH V2] UefiPayloadPkg/BootManager: Add PS2 keyboard support Thread-Topic: [edk2-devel] [PATCH V2] UefiPayloadPkg/BootManager: Add PS2 keyboard support Thread-Index: AQHVtTfuqYu+HJWKf0aBa4Oed9sgQKfAF3pA Date: Wed, 18 Dec 2019 16:35:22 +0000 Message-ID: <7AAC936950815649B5F88FAE785306C2F70AC39C@ORSMSX105.amr.corp.intel.com> References: <20191218001217.13652-1-guo.dong@intel.com> In-Reply-To: <20191218001217.13652-1-guo.dong@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmZkOWRhYTItNTVmOC00MGI3LWI5Y2YtMTNjYWQ0YTk1NmQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidXJLR3FpRGNOYm5vR1JvOVJuMm5MZWI0V2YwMlJlNzNOK09mZWxKaWthZmEyUjlqQmlaRlNsdTNOa2FnRTlaWCJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: maurice.ma@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Maurice Ma Thanks, -Maurice > -----Original Message----- > From: Dong, Guo > Sent: Tuesday, December 17, 2019 16:12 > To: devel@edk2.groups.io > Cc: Ma, Maurice ; You, Benjamin > ; Dong, Guo ; > u14935@gmail.com > Subject: [edk2-devel] [PATCH V2] UefiPayloadPkg/BootManager: Add PS2 > keyboard support >=20 > Add PS2 keyboard support. > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2316 >=20 > This patch adds PS2 keyboard support in boot manager, and add a build fla= g > 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 i= s not > common used. could use -DPS2_KEYBOARD_ENABLE to enable build it if > need this feature. >=20 > 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(-) >=20 > 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 gPcAnsiTermina= l; > @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL > *gPlatformRootBridges[] =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 > ErrOut. > - @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 miss= ing > + 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_PROTOCOL *)&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_PROTOCOL *)&gUartDeviceNode); > DevicePath =3D AppendDevicePathNode (DevicePath, > (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); diff --git > a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf > index 4cd88a3f85..dfbcde5668 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.fdf > +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf > @@ -120,6 +120,10 @@ INF > MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.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/UefiPayloadPkgIa32.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/UefiPayloadPkgIa32X64.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 > -- > 2.16.2.windows.1