From: "Heng Luo" <heng.luo@intel.com>
To: "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Eric" <eric.dong@intel.com>,
"Chiu, Chasel" <chasel.chiu@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>
Subject: Re: [Patch V6 3/3] MinPlatformPkg: Add SerialPortTerminalLib to suport Serial Terminal feature
Date: Mon, 16 Nov 2020 01:20:30 +0000 [thread overview]
Message-ID: <MWHPR11MB1805F2DC0774B6B1B2C213DC93E30@MWHPR11MB1805.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR1101MB2160517FCE51A79B7C4598C2CDE50@MWHPR1101MB2160.namprd11.prod.outlook.com>
Hi Nate,
Thank you for your review, sorry about the mistake, I will submit Patch V7, the first 2 changes are same, and fix the bug in last change.
Thanks,
Heng
> -----Original Message-----
> From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Sent: Sunday, November 15, 2020 7:35 AM
> To: Luo, Heng <heng.luo@intel.com>; devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>;
> Liming Gao <gaoliming@byosoft.com.cn>
> Subject: RE: [Patch V6 3/3] MinPlatformPkg: Add SerialPortTerminalLib to
> suport Serial Terminal feature
>
> Hi Heng,
>
> There is a bug in this code. You need to change
> SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLi
> b.inf to
> MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf
>
> Other than that, look's good!
>
> Thanks,
> Nate
>
> On 11/11/20, 7:01 PM, Luo, Heng <heng.luo@intel.com> wrote:
>
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> >
> > 1. Add SerialPortTerminalLib to MinPlatformPkg/Library.
> > 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial device to
> > ConIn and ConOut variables
> > 3. Include SerialDxe and TerminalDxe to CoreDxeInclude.dsc and
> > CoreUefiBootInclude.fdf.
> >
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Chasel Chiu <chasel.chiu@intel.com>
> > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Signed-off-by: Heng Luo <heng.luo@intel.com>
> > ---
> > Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > | 15 +++++++++++++--
> > Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > | 8 +++++++-
> >
> > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.c | 102
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++++++++++++++++++++++++++++++++++++++
> >
> > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.h | 34 ++++++++++++++++++++++++++++++++++
> >
> > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > Ter minalLib.inf | 40 ++++++++++++++++++++++++++++++++++++++++
> > 5 files changed, 196 insertions(+), 3 deletions(-)
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > index f0e578f8cc..86bf5e6f22 100644
> > --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > @@ -1,7 +1,7 @@
> > ## @file
> >
> > # Platform description.
> >
> > #
> >
> > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> >
> > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > +reserved.<BR>
> >
> > #
> >
> > # SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > #
> >
> > @@ -46,7 +46,18 @@
> >
> >
> >
> > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCoun
> > terRuntimeDxe.inf
> >
> >
> >
> > - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> >
> > + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
> >
> > + <LibraryClasses>
> >
> > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> >
> > +
> > NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPort
> > NULL|Ter
> > minalLib.inf
>
> This is the bug, please change to
> MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf
>
> >
> > +!endif
> >
> > + }
> >
> > +
> >
> > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> >
> > + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> >
> > + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> >
> > +!endif
> >
> > +
> >
> >
> > MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManager
> > Dxe.inf
> >
> > MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> >
> > <LibraryClasses>
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > index 7859c0b1a5..ef4576eedf 100644
> > ---
> > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fd
> > +++ f
> > @@ -1,7 +1,7 @@
> > ## @file
> >
> > # FDF file of Platform.
> >
> > #
> >
> > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> >
> > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > +reserved.<BR>
> >
> > #
> >
> > # SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > #
> >
> > @@ -26,6 +26,12 @@ INF
> > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > INF
> > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCoun
> > terRuntimeDxe.inf
> >
> >
> >
> > INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> >
> > +
> >
> > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> >
> > +INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> >
> > +INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> >
> > +!endif
> >
> > +
> >
> > INF
> > MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManager
> > Dxe.inf
> >
> > INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> >
> > INF
> > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.c
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.c
> > new file mode 100644
> > index 0000000000..94de475173
> > --- /dev/null
> > +++
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.c
> > @@ -0,0 +1,102 @@
> > +/** @file
> >
> > + Main file for NULL named library for Serial Port Terminal Redirection
> library.
> >
> > +
> >
> > + Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> >
> > + SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +
> >
> > +**/
> >
> > +
> >
> > +#include "SerialPortTerminalLib.h"
> >
> > +
> >
> > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> > mSerialDevicePath = {
> >
> > + {
> >
> > + {
> >
> > + HARDWARE_DEVICE_PATH,
> >
> > + HW_VENDOR_DP,
> >
> > + {
> >
> > + (UINT8) sizeof (VENDOR_DEVICE_PATH),
> >
> > + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> >
> > + }
> >
> > + },
> >
> > + EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> >
> > + },
> >
> > + {
> >
> > + {
> >
> > + MESSAGING_DEVICE_PATH,
> >
> > + MSG_UART_DP,
> >
> > + {
> >
> > + (UINT8) sizeof (UART_DEVICE_PATH),
> >
> > + (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> >
> > + }
> >
> > + },
> >
> > + 0, // Reserved
> >
> > + 0, // BaudRate
> >
> > + 0, // DataBits
> >
> > + 0, // Parity
> >
> > + 0 // StopBits
> >
> > + },
> >
> > + {
> >
> > + {
> >
> > + MESSAGING_DEVICE_PATH,
> >
> > + MSG_VENDOR_DP,
> >
> > + {
> >
> > + (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> >
> > + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> >
> > + }
> >
> > + },
> >
> > + DEVICE_PATH_MESSAGING_PC_ANSI
> >
> > + },
> >
> > + gEndEntire
> >
> > +};
> >
> > +
> >
> > +/**
> >
> > + Updates the ConOut, ConIn, ErrOut variables with the serial
> > + terminal
> > device path
> >
> > + @param none
> >
> > + @retval none
> >
> > +**/
> >
> > +VOID
> >
> > +AddSerialTerminal (
> >
> > + VOID
> >
> > + )
> >
> > +{
> >
> > + DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> >
> > +
> >
> > + //
> >
> > + // Append Serial Terminal into "ConIn"
> >
> > + //
> >
> > + EfiBootManagerUpdateConsoleVariable (ConOut,
> > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> >
> > + EfiBootManagerUpdateConsoleVariable (ConIn,
> > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> >
> > + EfiBootManagerUpdateConsoleVariable (ErrOut,
> > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> >
> > +}
> >
> > +
> >
> > +
> >
> > +/**
> >
> > + Constructor for the Serial Port Device controller library.
> >
> > +
> >
> > + @param ImageHandle the image handle of the process
> >
> > + @param SystemTable the EFI System Table pointer
> >
> > +
> >
> > + @retval EFI_SUCCESS the shell command handlers were installed
> > sucessfully
> >
> > + @retval EFI_UNSUPPORTED the shell level required was not found.
> >
> > +**/
> >
> > +EFI_STATUS
> >
> > +EFIAPI
> >
> > +SerialPortTerminalLibConstructor (
> >
> > + IN EFI_HANDLE ImageHandle,
> >
> > + IN EFI_SYSTEM_TABLE *SystemTable
> >
> > + )
> >
> > +{
> >
> > + mSerialDevicePath.Uart.BaudRate =
> > PcdGet64(PcdSerialTerminalBaudRate);
> >
> > + mSerialDevicePath.Uart.DataBits =
> > + PcdGet8(PcdSerialTerminalDataBits);
> >
> > + mSerialDevicePath.Uart.Parity = PcdGet8(PcdSerialTerminalParity);
> >
> > + mSerialDevicePath.Uart.StopBits =
> > + PcdGet8(PcdSerialTerminalStopBits);
> >
> > + DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor] [%d, %d,
> > + %d,
> > %d]\n",
> >
> > + mSerialDevicePath.Uart.BaudRate,
> >
> > + mSerialDevicePath.Uart.DataBits,
> >
> > + mSerialDevicePath.Uart.Parity,
> >
> > + mSerialDevicePath.Uart.StopBits));
> >
> > +
> >
> > + AddSerialTerminal();
> >
> > +
> >
> > + return EFI_SUCCESS;
> >
> > +}
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.h
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.h
> > new file mode 100644
> > index 0000000000..bfa73cca7d
> > --- /dev/null
> > +++
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.h
> > @@ -0,0 +1,34 @@
> > +/** @file
> >
> > + Header file for NULL named library for for Serial Port Terminal
> > + Redirection
> > library.
> >
> > +
> >
> > + Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> >
> > + SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +
> >
> > +**/
> >
> > +
> >
> > +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> >
> > +#define _SERIAL_PORT_TERMINAL_LIB_H_
> >
> > +
> >
> > +#include <Uefi.h>
> >
> > +#include <Guid/SerialPortLibVendor.h>
> >
> > +#include <Library/UefiLib.h>
> >
> > +#include <Library/DevicePathLib.h>
> >
> > +#include <Library/DebugLib.h>
> >
> > +#include <Library/UefiBootManagerLib.h>
> >
> > +
> >
> > +//
> >
> > +// Below is the platform console device path
> >
> > +//
> >
> > +typedef struct {
> >
> > + VENDOR_DEVICE_PATH Guid;
> >
> > + UART_DEVICE_PATH Uart;
> >
> > + VENDOR_DEVICE_PATH TerminalType;
> >
> > + EFI_DEVICE_PATH_PROTOCOL End;
> >
> > +} SERIAL_DEVICE_PATH;
> >
> > +
> >
> > +#define gEndEntire \
> >
> > + { \
> >
> > + END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {
> > END_DEVICE_PATH_LENGTH, 0 } \
> >
> > + }
> >
> > +
> >
> > +#endif
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.inf
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.inf
> > new file mode 100644
> > index 0000000000..2667ec6d19
> > --- /dev/null
> > +++
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTe
> > rminalLib.inf
> > @@ -0,0 +1,40 @@
> > +## @file
> >
> > +# Component information file for Serial Port Terminal Redirection
> > +Library
> >
> > +#
> >
> > +# INTEL CONFIDENTIAL
> >
> > +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> >
> > +#
> >
> > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +#
> >
> > +##
> >
> > +[Defines]
> >
> > + INF_VERSION = 0x00010006
> >
> > + BASE_NAME = SerialPortTerminalLib
> >
> > + FILE_GUID = E12BFA46-95F2-4ADC-9774-7E38DE78741E
> >
> > + MODULE_TYPE = UEFI_DRIVER
> >
> > + VERSION_STRING = 1.2
> >
> > + LIBRARY_CLASS = NULL|UEFI_DRIVER DXE_DRIVER
> > DXE_RUNTIME_DRIVER
> >
> > + CONSTRUCTOR = SerialPortTerminalLibConstructor
> >
> > +
> >
> > +[Packages]
> >
> > + MdePkg/MdePkg.dec
> >
> > + MdeModulePkg/MdeModulePkg.dec
> >
> > + BoardModulePkg/BoardModulePkg.dec
> >
> > + MinPlatformPkg/MinPlatformPkg.dec
> >
> > +
> >
> > +[Sources]
> >
> > + SerialPortTerminalLib.c
> >
> > + SerialPortTerminalLib.h
> >
> > +
> >
> > +[LibraryClasses]
> >
> > + DevicePathLib
> >
> > + DebugLib
> >
> > + UefiDriverEntryPoint
> >
> > + UefiBootManagerLib
> >
> > + UefiLib
> >
> > +
> >
> > +[Pcd]
> >
> > + gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> >
> > + gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalDataBits
> >
> > + gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalParity
> >
> > + gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalStopBits
> >
> > --
> > 2.24.0.windows.2
next prev parent reply other threads:[~2020-11-16 1:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 3:00 [Patch V6 1/3] MinPlatformPkg: Add PCDs for Serial Terminal feature Heng Luo
2020-11-12 3:00 ` [Patch V6 2/3] OpenBoardPkg: Configurae PcdSerialTerminalEnable Heng Luo
2020-11-14 23:34 ` Nate DeSimone
2020-11-12 3:00 ` [Patch V6 3/3] MinPlatformPkg: Add SerialPortTerminalLib to suport Serial Terminal feature Heng Luo
2020-11-14 23:34 ` Nate DeSimone
2020-11-16 1:20 ` Heng Luo [this message]
2020-11-14 23:34 ` [Patch V6 1/3] MinPlatformPkg: Add PCDs for " Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MWHPR11MB1805F2DC0774B6B1B2C213DC93E30@MWHPR11MB1805.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox