* [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 keyboard support @ 2019-12-10 23:08 Guo Dong 2019-12-17 23:16 ` Ma, Maurice 0 siblings, 1 reply; 3+ messages in thread From: Guo Dong @ 2019-12-10 23:08 UTC (permalink / raw) To: devel; +Cc: maurice.ma, benjamin.you, guo.dong, u14935 Add PS2 keyboard support by default. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2316 This patch adds PS2 keyboard support in boot manager, and build PS2 keyboard driver and SIO driver by default. Signed-off-by: Guo Dong <guo.dong@intel.com> --- UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c | 25 ++++++++++++++++++++----- UefiPayloadPkg/UefiPayloadPkg.fdf | 2 ++ UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++ UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++ 4 files changed, 26 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) +#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 \ } - +ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard; ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort; UART_DEVICE_PATH gUartDeviceNode = gUart; VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal; @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL *gPlatformRootBridges[] = { BOOLEAN mDetectVgaOnly; /** - Add UART to ConOut, ConIn, ErrOut. + Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut. - @param[in] DeviceHandle - LPC device path. + @param[in] DeviceHandle Handle of the LPC Bridge device. - @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 missing + from DeviceHandle. **/ EFI_STATUS PrepareLpcBridgeDevicePath ( @@ -123,6 +129,7 @@ PrepareLpcBridgeDevicePath ( { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; DevicePath = NULL; Status = gBS->HandleProtocol ( @@ -133,10 +140,18 @@ PrepareLpcBridgeDevicePath ( if (EFI_ERROR (Status)) { return Status; } + TempDevicePath = DevicePath; + + // + // Register Keyboard + // + DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode); + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); // // Register COM1 // + DevicePath = TempDevicePath; DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode); DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode); DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf index 4cd88a3f85..b20ab82f47 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.fdf +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf @@ -120,6 +120,8 @@ INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf # ISA Support # INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf +INF OvmfPkg/SioBusDxe/SioBusDxe.inf +INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf # # Console Support diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc index 11cf17ca06..c9c2a87940 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc @@ -491,6 +491,8 @@ # ISA Support # MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + OvmfPkg/SioBusDxe/SioBusDxe.inf + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf # # Console Support diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc index 5b7994a62c..8dfc9e189c 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc @@ -492,6 +492,8 @@ # ISA Support # MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + OvmfPkg/SioBusDxe/SioBusDxe.inf + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf # # Console Support -- 2.16.2.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 keyboard support 2019-12-10 23:08 [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 keyboard support Guo Dong @ 2019-12-17 23:16 ` Ma, Maurice 2019-12-17 23:25 ` Guo Dong 0 siblings, 1 reply; 3+ messages in thread From: Ma, Maurice @ 2019-12-17 23:16 UTC (permalink / raw) To: Dong, Guo; +Cc: You, Benjamin, u14935@gmail.com, devel@edk2.groups.io Hi, Guo, Since PS2 keyboard is not commonly seen anymore, do you think it is better to define a control variable in DSC so that the PS2 driver can be easily added or removed using build command line ? Thanks Maurice > -----Original Message----- > From: Dong, Guo > Sent: Tuesday, December 10, 2019 15:09 > To: devel@edk2.groups.io > Cc: Ma, Maurice <maurice.ma@intel.com>; You, Benjamin > <benjamin.you@intel.com>; Dong, Guo <guo.dong@intel.com>; > u14935@gmail.com > Subject: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 > keyboard support > > Add PS2 keyboard support by default. > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2316 > > This patch adds PS2 keyboard support in boot manager, and build PS2 > keyboard driver and SIO driver by default. > > Signed-off-by: Guo Dong <guo.dong@intel.com> > --- > UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c | 25 > ++++++++++++++++++++----- > UefiPayloadPkg/UefiPayloadPkg.fdf | 2 ++ > UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++ > UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++ > 4 files changed, 26 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) > > +#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 \ > } > > - > +ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = > gPnpPs2Keyboard; > ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = > gPnp16550ComPort; > UART_DEVICE_PATH gUartDeviceNode = gUart; > VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal; > @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL > *gPlatformRootBridges[] = { > BOOLEAN mDetectVgaOnly; > > /** > - Add UART to ConOut, ConIn, ErrOut. > + Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut. > > - @param[in] DeviceHandle - LPC device path. > + @param[in] DeviceHandle Handle of the LPC Bridge device. > > - @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 missing > + from DeviceHandle. > **/ > EFI_STATUS > PrepareLpcBridgeDevicePath ( > @@ -123,6 +129,7 @@ PrepareLpcBridgeDevicePath ( { > EFI_STATUS Status; > EFI_DEVICE_PATH_PROTOCOL *DevicePath; > + EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; > > DevicePath = NULL; > Status = gBS->HandleProtocol ( > @@ -133,10 +140,18 @@ PrepareLpcBridgeDevicePath ( > if (EFI_ERROR (Status)) { > return Status; > } > + TempDevicePath = DevicePath; > + > + // > + // Register Keyboard > + // > + DevicePath = AppendDevicePathNode (DevicePath, > + (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode); > + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); > > // > // Register COM1 > // > + DevicePath = TempDevicePath; > DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL > *)NULL, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode); > DevicePath = AppendDevicePathNode (DevicePath, > (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode); > DevicePath = AppendDevicePathNode (DevicePath, > (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); diff --git > a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf > index 4cd88a3f85..b20ab82f47 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.fdf > +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf > @@ -120,6 +120,8 @@ INF > MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > # ISA Support > # > INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > +INF OvmfPkg/SioBusDxe/SioBusDxe.inf > +INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf > > # > # Console Support > diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > index 11cf17ca06..c9c2a87940 100644 > --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > @@ -491,6 +491,8 @@ > # ISA Support > # > MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > + OvmfPkg/SioBusDxe/SioBusDxe.inf > + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf > > # > # Console Support > diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > index 5b7994a62c..8dfc9e189c 100644 > --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > @@ -492,6 +492,8 @@ > # ISA Support > # > MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > + OvmfPkg/SioBusDxe/SioBusDxe.inf > + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf > > # > # Console Support > -- > 2.16.2.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 keyboard support 2019-12-17 23:16 ` Ma, Maurice @ 2019-12-17 23:25 ` Guo Dong 0 siblings, 0 replies; 3+ messages in thread From: Guo Dong @ 2019-12-17 23:25 UTC (permalink / raw) To: Ma, Maurice; +Cc: You, Benjamin, u14935@gmail.com, devel@edk2.groups.io Thanks Maurice. Will add PS2_KEYBOARD_ENABLE for newly added drivers and set to disabled by default. Thanks, Guo > -----Original Message----- > From: Ma, Maurice <maurice.ma@intel.com> > Sent: Tuesday, December 17, 2019 4:17 PM > To: Dong, Guo <guo.dong@intel.com> > Cc: You, Benjamin <benjamin.you@intel.com>; u14935@gmail.com; > devel@edk2.groups.io > Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 > keyboard support > > Hi, Guo, > > Since PS2 keyboard is not commonly seen anymore, do you think it is better to > define a control variable in DSC so that the PS2 driver can be easily added or > removed using build command line ? > > Thanks > Maurice > > -----Original Message----- > > From: Dong, Guo > > Sent: Tuesday, December 10, 2019 15:09 > > To: devel@edk2.groups.io > > Cc: Ma, Maurice <maurice.ma@intel.com>; You, Benjamin > > <benjamin.you@intel.com>; Dong, Guo <guo.dong@intel.com>; > > u14935@gmail.com > > Subject: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 > > keyboard support > > > > Add PS2 keyboard support by default. > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2316 > > > > This patch adds PS2 keyboard support in boot manager, and build PS2 > > keyboard driver and SIO driver by default. > > > > Signed-off-by: Guo Dong <guo.dong@intel.com> > > --- > > UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c | 25 > > ++++++++++++++++++++----- > > UefiPayloadPkg/UefiPayloadPkg.fdf | 2 ++ > > UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++ > > UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++ > > 4 files changed, 26 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) > > > > +#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 \ > > } > > > > - > > +ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = > > gPnpPs2Keyboard; > > ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = > > gPnp16550ComPort; > > UART_DEVICE_PATH gUartDeviceNode = gUart; > > VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal; > > @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL > *gPlatformRootBridges[] > > = { > > BOOLEAN mDetectVgaOnly; > > > > /** > > - Add UART to ConOut, ConIn, ErrOut. > > + Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut. > > > > - @param[in] DeviceHandle - LPC device path. > > + @param[in] DeviceHandle Handle of the LPC Bridge device. > > > > - @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 missing > > + from DeviceHandle. > > **/ > > EFI_STATUS > > PrepareLpcBridgeDevicePath ( > > @@ -123,6 +129,7 @@ PrepareLpcBridgeDevicePath ( { > > EFI_STATUS Status; > > EFI_DEVICE_PATH_PROTOCOL *DevicePath; > > + EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; > > > > DevicePath = NULL; > > Status = gBS->HandleProtocol ( > > @@ -133,10 +140,18 @@ PrepareLpcBridgeDevicePath ( > > if (EFI_ERROR (Status)) { > > return Status; > > } > > + TempDevicePath = DevicePath; > > + > > + // > > + // Register Keyboard > > + // > > + DevicePath = AppendDevicePathNode (DevicePath, > > + (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode); > > + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); > > > > // > > // Register COM1 > > // > > + DevicePath = TempDevicePath; > > DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL > > *)NULL, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode); > > DevicePath = AppendDevicePathNode (DevicePath, > > (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode); > > DevicePath = AppendDevicePathNode (DevicePath, > > (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); diff --git > > a/UefiPayloadPkg/UefiPayloadPkg.fdf > > b/UefiPayloadPkg/UefiPayloadPkg.fdf > > index 4cd88a3f85..b20ab82f47 100644 > > --- a/UefiPayloadPkg/UefiPayloadPkg.fdf > > +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf > > @@ -120,6 +120,8 @@ INF > > MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > > # ISA Support > > # > > INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > > +INF OvmfPkg/SioBusDxe/SioBusDxe.inf > > +INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf > > > > # > > # Console Support > > diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > > b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > > index 11cf17ca06..c9c2a87940 100644 > > --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > > +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc > > @@ -491,6 +491,8 @@ > > # ISA Support > > # > > MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > > + OvmfPkg/SioBusDxe/SioBusDxe.inf > > + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf > > > > # > > # Console Support > > diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > > b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > > index 5b7994a62c..8dfc9e189c 100644 > > --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > > +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > > @@ -492,6 +492,8 @@ > > # ISA Support > > # > > MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > > + OvmfPkg/SioBusDxe/SioBusDxe.inf > > + MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf > > > > # > > # Console Support > > -- > > 2.16.2.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-17 23:25 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-12-10 23:08 [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 keyboard support Guo Dong 2019-12-17 23:16 ` Ma, Maurice 2019-12-17 23:25 ` Guo Dong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox