From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com []) by mx.groups.io with SMTP id smtpd.web09.5671.1603440849296652168 for ; Fri, 23 Oct 2020 01:14:09 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: heng.luo@intel.com) IronPort-SDR: JPEPah+gxGfgxYbaUp6Pvr1YPdzTqH1gN1lg6mQcXZZxc1EaGHF69WmUhpSEGwbLdIC1K/nJ4s hcQ5b8slR42g== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="252342518" X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="252342518" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 01:14:03 -0700 IronPort-SDR: TVk09CWsFfk+9K0tfXVhcgFM5lKjsOAkkry5MDV2SUk8V1NFio7flZhoNjfGWnjctUeHh8Y1O/ o55LvxXbqDNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,407,1596524400"; d="scan'208";a="349117482" Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.154]) by fmsmga004.fm.intel.com with ESMTP; 23 Oct 2020 01:14:01 -0700 From: "Heng Luo" To: devel@edk2.groups.io Cc: Eric Dong , Liming Gao , Chasel Chiu , Nate DeSimone Subject: [Patch V2 1/2] AdvancedFeaturePkg: Add SerialPortTerminalLib Date: Fri, 23 Oct 2020 16:13:55 +0800 Message-Id: <20201023081356.5167-1-heng.luo@intel.com> X-Mailer: git-send-email 2.24.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3014 Add the serial port terminal library to get console redirect after the shell is loaded. Cc: Eric Dong Cc: Liming Gao Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Heng Luo --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc = | 4 +++- Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc = | 3 +++ Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc = | 2 ++ Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf = | 4 +++- Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf = | 4 +++- Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostMemory.fdf = | 8 ++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMemory.fdf = | 8 ++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/Include/SerialDebugFeature.= dsc | 72 +++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTerminalL= ib/SerialPortTerminalLib.c | 93 +++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTerminalL= ib/SerialPortTerminalLib.h | 49 +++++++++++++++++++++++++++++++++++++++++= ++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTerminalL= ib/SerialPortTerminalLib.inf | 35 +++++++++++++++++++++++++++++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/Readme.md = | 97 +++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeaturePkg.dec = | 31 +++++++++++++++++++++++++++++++ Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeaturePkg.dsc = | 31 +++++++++++++++++++++++++++++++ 14 files changed, 438 insertions(+), 3 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Fea= tures/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index ced0a97c37..28b2d82d26 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -30,7 +30,8 @@ PEI_ARCH =3D IA32=0D DXE_ARCH =3D X64=0D =0D -!include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc=0D=0D +!include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc=0D +=0D =0D ##########################################################################= ######=0D #=0D @@ -45,6 +46,7 @@ gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable = |TRUE=0D gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable = |TRUE=0D gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable = |TRUE=0D + gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable = |TRUE=0D gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable = |TRUE=0D gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable = |TRUE=0D gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable = |FALSE=0D diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc= b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc index ac9ab80e8e..5f7b9ef33d 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc @@ -19,6 +19,9 @@ !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable =3D=3D TR= UE=0D !include Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc=0D !endif=0D +!if gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable =3D= =3D TRUE=0D + !include SerialDebugFeaturePkg/Include/SerialDebugFeature.dsc=0D +!endif=0D =0D #=0D # Network Advanced Features=0D diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.= dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc index ad248de800..07abd34d8f 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc @@ -18,6 +18,7 @@ MdePkg/MdePkg.dec=0D AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec=0D Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec=0D + SerialDebugFeaturePkg/SerialDebugFeaturePkg.dec=0D NetworkFeaturePkg/NetworkFeaturePkg.dec=0D IpmiFeaturePkg/IpmiFeaturePkg.dec=0D S3FeaturePkg/S3FeaturePkg.dec=0D @@ -38,6 +39,7 @@ gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable = |FALSE=0D gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable = |FALSE=0D gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable = |FALSE=0D + gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable = |FALSE=0D gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable = |FALSE=0D gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable = |FALSE=0D gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable = |FALSE=0D diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf b/Fea= tures/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf index c49a0fd875..baa3b4f299 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf @@ -20,7 +20,9 @@ !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable =3D=3D TR= UE=0D !include Debugging/Usb3DebugFeaturePkg/Include/PostMemory.fdf=0D !endif=0D -=0D +!if gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable =3D= =3D TRUE=0D + !include SerialDebugFeaturePkg/Include/PostMemory.fdf=0D +!endif=0D #=0D # Network Advanced Features=0D #=0D diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf b/Feat= ures/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf index 1b21e96a5f..1b56cdbd6e 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf @@ -20,7 +20,9 @@ !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable =3D=3D TR= UE=0D !include Debugging/Usb3DebugFeaturePkg/Include/PreMemory.fdf=0D !endif=0D -=0D +!if gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable =3D= =3D TRUE=0D + !include SerialDebugFeaturePkg/Include/PreMemory.fdf=0D +!endif=0D #=0D # Network Advanced Features=0D #=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostMem= ory.fdf b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostMemory= .fdf new file mode 100644 index 0000000000..202918511f --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostMemory.fdf @@ -0,0 +1,8 @@ +## @file=0D +# FDF file for post-memory modules that enable Serial Debug=0D +#=0D +# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMemo= ry.fdf b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMemory.f= df new file mode 100644 index 0000000000..111bace4fc --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,8 @@ +## @file=0D +# FDF file for pre-memory modules that enable Serial Debug.=0D +#=0D +# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/SerialD= ebugFeature.dsc b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/Se= rialDebugFeature.dsc new file mode 100644 index 0000000000..abed99ff8d --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/SerialDebugFea= ture.dsc @@ -0,0 +1,72 @@ +## @file=0D +# This is a build description file for the Serial Debug advanced feature.= =0D +# This file should be included into another package DSC file to build this= feature.=0D +#=0D +# The DEC files are used by the utilities that parse DSC and=0D +# INF files to generate AutoGen.c and AutoGen.h files=0D +# for the build infrastructure.=0D +#=0D +# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +##########################################################################= ######=0D +#=0D +# Defines Section - statements that will be processed to create a Makefile= .=0D +#=0D +##########################################################################= ######=0D +[Defines]=0D +!ifndef $(PEI_ARCH)=0D + !error "PEI_ARCH must be specified to build this feature!"=0D +!endif=0D +!ifndef $(DXE_ARCH)=0D + !error "DXE_ARCH must be specified to build this feature!"=0D +!endif=0D +=0D +##########################################################################= ######=0D +#=0D +# Library Class section - list of all Library Classes needed by this featu= re.=0D +#=0D +##########################################################################= ######=0D +[LibraryClasses]=0D + #######################################=0D + # Edk2 Packages=0D + #######################################=0D + #BaseLib|MdePkg/Library/BaseLib/BaseLib.inf=0D + #BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf=0D + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf=0D + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf=0D + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf=0D + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf=0D +=0D +#=0D +# Feature DXE Components=0D +#=0D +[Components.X64]=0D + #####################################=0D + # Serial Debug Feature Package=0D + #####################################=0D +=0D + # Add library instances here that are not included in package components= and should be tested=0D + # in the package build.=0D + SerialDebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLi= b.inf=0D +=0D + # Add components here that should be included in the package build.=0D +=0D +##########################################################################= #########################=0D +#=0D +# BuildOptions Section - Define the module specific tool chain flags that = should be used as=0D +# the default flags for a module. These flags are a= ppended to any=0D +# standard flags that are defined by the build proc= ess. They can be=0D +# applied for any modules or only those modules wit= h the specific=0D +# module style (EDK or EDKII) specified in [Compone= nts] section.=0D +#=0D +# For advanced features, it is recommended to enabl= e [BuildOptions] in=0D +# the applicable INF file so it does not affect the= whole board package=0D +# build when this DSC file is active.=0D +#=0D +##########################################################################= #########################=0D +[BuildOptions]=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialP= ortTerminalLib/SerialPortTerminalLib.c b/Features/Intel/Debugging/SerialDeb= ugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c new file mode 100644 index 0000000000..36c0e7110f --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTerm= inalLib/SerialPortTerminalLib.c @@ -0,0 +1,93 @@ +/** @file=0D + Main file for NULL named library for Serial Port Deviceboard controller = librarr.=0D +=0D + INTEL CONFIDENTIAL=0D + Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "SerialPortTerminalLib.h"=0D +=0D +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH mSerialDevicePath =3D {=0D + {=0D + {=0D + HARDWARE_DEVICE_PATH,=0D + HW_VENDOR_DP,=0D + {=0D + (UINT8) sizeof (VENDOR_DEVICE_PATH),=0D + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)=0D + }=0D + },=0D + EDKII_SERIAL_PORT_LIB_VENDOR_GUID=0D + },=0D + {=0D + {=0D + MESSAGING_DEVICE_PATH,=0D + MSG_UART_DP,=0D + {=0D + (UINT8) sizeof (UART_DEVICE_PATH),=0D + (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)=0D + }=0D + },=0D + 0, // Reserved=0D + 115200, // BaudRate=0D + 8, // DataBits=0D + 1, // Parity=0D + 1 // StopBits=0D + },=0D + {=0D + {=0D + MESSAGING_DEVICE_PATH,=0D + MSG_VENDOR_DP,=0D + {=0D + (UINT8) (sizeof (VENDOR_DEVICE_PATH)),=0D + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),=0D + }=0D + },=0D + DEVICE_PATH_MESSAGING_PC_ANSI=0D + },=0D + gEndEntire=0D +};=0D +=0D +/**=0D + Updates the ConOut, ConIn, ErrOut variables with the serial terminal dev= ice path=0D + @param none=0D + @retval none=0D +**/=0D +VOID=0D +AddSerialTerminal (=0D + VOID=0D + )=0D +{=0D + DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));=0D +=0D + //=0D + // Append Serial Terminal into "ConIn"=0D + //=0D + EfiBootManagerUpdateConsoleVariable (ConOut, (EFI_DEVICE_PATH_PROTOCOL *= ) &mSerialDevicePath, NULL);=0D + EfiBootManagerUpdateConsoleVariable (ConIn, (EFI_DEVICE_PATH_PROTOCOL *)= &mSerialDevicePath, NULL);=0D + EfiBootManagerUpdateConsoleVariable (ErrOut, (EFI_DEVICE_PATH_PROTOCOL *= ) &mSerialDevicePath, NULL);=0D +}=0D +=0D +=0D +/**=0D + Constructor for the Serial Port Device controller library.=0D +=0D + @param ImageHandle the image handle of the process=0D + @param SystemTable the EFI System Table pointer=0D +=0D + @retval EFI_SUCCESS the shell command handlers were installed suc= essfully=0D + @retval EFI_UNSUPPORTED the shell level required was not found.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SerialPortTerminalLibConstructor (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + )=0D +{=0D + AddSerialTerminal();=0D +=0D + return EFI_SUCCESS;=0D +}=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialP= ortTerminalLib/SerialPortTerminalLib.h b/Features/Intel/Debugging/SerialDeb= ugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.h new file mode 100644 index 0000000000..afb3eb2cb3 --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTerm= inalLib/SerialPortTerminalLib.h @@ -0,0 +1,49 @@ +/** @file=0D + Header file for NULL named library for Ps2 keyboard controller library.= =0D +=0D + INTEL CONFIDENTIAL=0D + Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef _PS2_KBC_LIB_H=0D +#define _PS2_KBC_LIB_H=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +//=0D +// Below is the platform console device path=0D +//=0D +typedef struct {=0D + VENDOR_DEVICE_PATH Guid;=0D + UART_DEVICE_PATH Uart;=0D + VENDOR_DEVICE_PATH TerminalType;=0D + EFI_DEVICE_PATH_PROTOCOL End;=0D +} SERIAL_DEVICE_PATH;=0D +=0D +#define gPciRootBridge \=0D + { \=0D + { \=0D + ACPI_DEVICE_PATH, \=0D + ACPI_DP, \=0D + { \=0D + (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \=0D + (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \=0D + }, \=0D + }, \=0D + EISA_PNP_ID (0x0A03), \=0D + 0 \=0D + }=0D +=0D +#define gEndEntire \=0D + { \=0D + END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { END_DEVICE_PAT= H_LENGTH, 0 } \=0D + }=0D +=0D +#endif=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialP= ortTerminalLib/SerialPortTerminalLib.inf b/Features/Intel/Debugging/SerialD= ebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf new file mode 100644 index 0000000000..4f63d1626f --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTerm= inalLib/SerialPortTerminalLib.inf @@ -0,0 +1,35 @@ +## @file=0D +# Component information file for Serial Port Terminal Redirection Library= =0D +#=0D +# INTEL CONFIDENTIAL=0D +# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +[Defines]=0D + INF_VERSION =3D 0x00010006=0D + BASE_NAME =3D SerialPortTerminalLib=0D + FILE_GUID =3D E12BFA46-95F2-4ADC-9774-7E38DE78741E= =0D + MODULE_TYPE =3D UEFI_DRIVER=0D + VERSION_STRING =3D 1.2=0D + LIBRARY_CLASS =3D NULL|UEFI_DRIVER=0D + CONSTRUCTOR =3D SerialPortTerminalLibConstructor=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + MdeModulePkg/MdeModulePkg.dec=0D + BoardModulePkg/BoardModulePkg.dec=0D +=0D +[Sources]=0D + SerialPortTerminalLib.c=0D + SerialPortTerminalLib.h=0D +=0D +[LibraryClasses]=0D + DevicePathLib=0D + DebugLib=0D + UefiDriverEntryPoint=0D + UefiBootManagerLib=0D + UefiLib=0D +=0D +[Pcd]=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Readme.md b/Fea= tures/Intel/Debugging/SerialDebugFeaturePkg/Readme.md new file mode 100644 index 0000000000..5745be0f3e --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Readme.md @@ -0,0 +1,97 @@ +# Overview=0D +* **Feature Name:** Serial Debug=0D +* **PI Phase(s) Supported:** DXE=0D +* **SMM Required?** No=0D +=0D +## Purpose=0D +The Serial Debug feature enables EDK II compliant firmware to use a serial= port on the system for firmware debug.=0D +=0D +SerialPortTerminalLib.inf provider NULL named library for Serial Port Term= inal Redirection Library, it can be used by BdsDxe to redirect the console = to serial port after the shell is loaded.=0D +=0D +# High-Level Theory of Operation=0D +=0D +Not available.=0D +=0D +## Firmware Volumes=0D +=0D +* N/A=0D +=0D +## Modules=0D +=0D +A bulleted list of the modules that make up the feature.=0D +=0D +* SerialPortTerminalLib=0D +=0D +## SerialPortTerminalLib=0D +=0D +This library can be used by BdsDxe to redirect the console to serial port.= =0D +=0D +## Key Functions=0D +=0D +* Updates the ConOut, ConIn, ErrOut variables with the serial terminal dev= ice path.=0D +=0D +## Configuration=0D +=0D +* Add this library to BdsDxe driver, to add the serial device to ConIn and= ConOut variables.=0D +=0D +## Data Flows=0D +=0D +Architecturally defined data structures and flows for the feature.=0D +=0D +### Data flows of SerialPortTerminalLib=0D +=0D +N/A=0D +=0D +## Control Flows=0D +=0D +```txt=0D +| BdsDxe | | SerialPortTerminalLib |=0D +------------ -----------------------=0D + | |=0D + |---SerialPortTerminalLibConstructor-->|---------=0D + | | |=0D + | | AddSerialTerminal=0D + | | |=0D + | |<--------=0D +```=0D +=0D +## Build Flows=0D +=0D +No any special build flows is needed.=0D +=0D +## Test Point Results=0D +=0D +Not available.=0D +=0D +## Functional Exit Criteria=0D +=0D +Not available.=0D +=0D +## Feature Enabling Checklist=0D +=0D +1. Add this library to BdsDxe driver in OpenBoardPkg.dsc under section [Co= mponents.X64], to add the serial device to ConIn and ConOut variables:=0D +=0D +```dsc=0D +MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {=0D +=0D + NULL|SerialDebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTermi= nalLib.inf=0D +}=0D +```=0D +=0D +2. Include these 2 drivers to the OpenBoardPkg.dsc:=0D +=0D +```dsc=0D + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf=0D + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf=0D +```=0D +=0D +3. Include these 2 drivers to OpenBoardPkg.fdf under section [FV.FvUefiBoo= tUncompact]:=0D +=0D +```fdf=0D +INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf=0D +INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf=0D +```=0D +=0D +## Performance Impact=0D +=0D +Not available.=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeat= urePkg.dec b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeat= urePkg.dec new file mode 100644 index 0000000000..1ad36565d0 --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeaturePkg.= dec @@ -0,0 +1,31 @@ +## @file=0D +# This package provides advanced feature functionality for Serial Debug su= pport.=0D +# This package should only depend on EDK II Core packages, IntelSiliconPkg= , and MinPlatformPkg.=0D +#=0D +# The DEC files are used by the utilities that parse DSC and=0D +# INF files to generate AutoGen.c and AutoGen.h files=0D +# for the build infrastructure.=0D +#=0D +# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + DEC_SPECIFICATION =3D 0x00010017=0D + PACKAGE_NAME =3D SerialDebugFeaturePkg=0D + PACKAGE_GUID =3D A4BF76C6-6190-4B2C-B1C8-D872F60629B2=0D + PACKAGE_VERSION =3D 0.1=0D +=0D +[Includes]=0D + Include=0D +=0D +[Guids]=0D + gSerialDebugFeaturePkgTokenSpaceGuid =3D {0xebda878b, 0xa5f1, 0x4b0f, = {0x89, 0x2d, 0x47, 0x56, 0x97, 0xd4, 0x1a, 0x05}}=0D +=0D +[PcdsFeatureFlag]=0D + gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable|FALSE|B= OOLEAN|0xA0000001=0D +=0D +=0D +=0D diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeat= urePkg.dsc b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeat= urePkg.dsc new file mode 100644 index 0000000000..4247566a14 --- /dev/null +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeaturePkg.= dsc @@ -0,0 +1,31 @@ +## @file=0D +# This package provides advanced feature functionality for Serial Debug su= pport.=0D +# This package should only depend on EDK II Core packages, IntelSiliconPkg= , and MinPlatformPkg.=0D +#=0D +# The DEC files are used by the utilities that parse DSC and=0D +# INF files to generate AutoGen.c and AutoGen.h files=0D +# for the build infrastructure.=0D +#=0D +# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + PLATFORM_NAME =3D SerialDebugFeaturePkg=0D + PLATFORM_GUID =3D 378D0A55-A83D-4B99-B85D-D78703A28783= =0D + PLATFORM_VERSION =3D 0.1=0D + DSC_SPECIFICATION =3D 0x00010005=0D + OUTPUT_DIRECTORY =3D Build/$(PLATFORM_NAME)=0D + SUPPORTED_ARCHITECTURES =3D IA32|X64=0D + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT=0D + SKUID_IDENTIFIER =3D DEFAULT=0D + PEI_ARCH =3D IA32=0D + DXE_ARCH =3D X64=0D +=0D +=0D +#=0D +# This package always builds the feature.=0D +#=0D +!include Include/SerialDebugFeature.dsc=0D --=20 2.24.0.windows.2