From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.201.1603838209122050805 for ; Tue, 27 Oct 2020 15:36:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=jzYv8PwI; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: Lq97x5T8ufMXkQ22FwkKZs5jG5MfWdP+fxuvlbv8U/Lj7zVxUlpQFQ2ITKDgDToNWGHhwSJqMc ZuDf/VglC8qQ== X-IronPort-AV: E=McAfee;i="6000,8403,9787"; a="155141503" X-IronPort-AV: E=Sophos;i="5.77,424,1596524400"; d="scan'208";a="155141503" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2020 15:36:48 -0700 IronPort-SDR: hmUwdhixhMTJcFj2on+vx6VAGAazDbKfyvEE/A7/5yWTUjDvoMBPHjKPTk1TJ/nS0DTglNgxDc FzuyVQUDNJMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,424,1596524400"; d="scan'208";a="535983251" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga005.jf.intel.com with ESMTP; 27 Oct 2020 15:36:48 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 27 Oct 2020 15:36:47 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 27 Oct 2020 15:36:47 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 27 Oct 2020 15:36:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PFNtA865izVOufrgU/eSfDGJtOqXQ35bJyeKTC26zdnlXQcNQF7sNzlnwCx+drm/DyVTHHlESrfyDX1GR/ooUKXKkO1kNmh8u2LIZYH+3ypmQxfQtcQGxLKgmgPmctHemx5MB+3YXelopSb/WGsuUyGu182cWJo/MPbBzigg+5kkgnkjXrl6I8dOPge8WL9e+O0RI8jG+z4IIrKagIIIqmtZOMp/RCvw7PIji7ZEjgW2LMS5V7XhOUlegT9vFnDXrUFgZTMvywL0l1VY0bqECw8uxaVRC0svdXPkkuJeyBbuss6lqqdHWQynSthKBxXs7CWx+KzZTQ+NMXN3JzkZOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R29HVGLHoCMMYJJHibm9YJaYo5BZnKGoaOKnDtuB+WY=; b=T8a6GjoW1uCFgdVpCEtLCdLgNsoGKpX4mj7HPGDCLdbQCPpwYuhI1elPsVD1cT1pToPGjiSmibOTdTbnMbMPt7x6aFfYaruzFNRTZicHp4kc2uC8xFTb5B/E9n3qonn63OJfCA5o3UBiPjDvUcAHutLjFAIsK6XyiXhtsft9mTZfNuN0jXeG9qFPDFkCtUNJ+scZskwJsMF8nsR2q5hG8cgwI3PLkBlbN1yMnuj8x9Au/nHibSBJy1Ch4EKxL5/P6bG1tq0TB4HEct9W1iBjHCJ2DZlMJFvsbB1VYNDwu6n8p2UTc3Fv/n2lNx0bTpaEoPFpXltJItn2JJ6gH8Pfyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R29HVGLHoCMMYJJHibm9YJaYo5BZnKGoaOKnDtuB+WY=; b=jzYv8PwIbzhc43Q3zfMlwJ+hzd+7mxnHF9V7olVIiOaWAm7mjRxGHFW2GMAJ2ASneTP6B19zhzenh43bWdH4DA4xmu1hGTGE00ROpSDYaSBTumN4llpF505YoNuFb6afKZ7WRH5XXl+yhq/uq6z1Ix1Hej1FpR9KXYjANBO8d8E= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by MWHPR11MB1805.namprd11.prod.outlook.com (2603:10b6:300:114::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.27; Tue, 27 Oct 2020 22:36:46 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::75c9:81e9:2646:791c]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::75c9:81e9:2646:791c%4]) with mapi id 15.20.3477.029; Tue, 27 Oct 2020 22:36:46 +0000 From: "Nate DeSimone" To: "Luo, Heng" , "devel@edk2.groups.io" CC: "Dong, Eric" , Liming Gao , "Chiu, Chasel" , Michael Kubacki Subject: Re: [Patch V2 1/2] AdvancedFeaturePkg: Add SerialPortTerminalLib Thread-Topic: [Patch V2 1/2] AdvancedFeaturePkg: Add SerialPortTerminalLib Thread-Index: AQHWqRR+/6kEoTp9vUiPbh7wSLnr7amsA+IQ Date: Tue, 27 Oct 2020 22:36:46 +0000 Message-ID: References: <20201023081356.5167-1-heng.luo@intel.com> In-Reply-To: <20201023081356.5167-1-heng.luo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTA0NmQzM2EtZmUwZC00NmMwLWEzZTktNDNhZjY3NmYwNWRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMkF4amNwajRRQ3dmdlA2R05YTThiZU1cL3JESTJNaFwvd01pZ3c1V21GOVZTbDZFd0ViWlpLcGt1UkdHUDdKd2tpIn0= dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 41ddd7af-de4a-43b6-4d40-08d87ac8c973 x-ms-traffictypediagnostic: MWHPR11MB1805: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1w5+ErAObrwZXzsaE+/NO4lUJc8OMAWhuLznCpR2Qi0D2Wd3wEfFc2/W5ot2jsGO+rFILP4+Lown1E7RcZNf8QjT2LwQexrfzZmSJZdkicPts3sbv0k490f3ToURJiE1PQO4NF4nOQQIj8cNeOnvird1+xYHmzlBjo+6005ZMuirX7+EWwGRxkCMvrv+dMJWsWMySLAvMTNmoYukndGZmfLZler2mSq0eP2/DbbwMr3L6ScisfAnXoESkWhMwmqIJH465UQ5Hq6eHEmWu4HSJtpvhAkqVaVkeSgEu91uGyBvmVwwGu0W/AsHypGgm33BGVYsTdqSbTckJ/iRQnirlVFEC1mRFtBJBO6bocjpPHTvm27mOO1o370H+TIoKBb+v6HUR3BNBgtmcqMhL44FzA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2160.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(396003)(39860400002)(136003)(346002)(966005)(316002)(478600001)(83380400001)(4326008)(110136005)(2906002)(33656002)(9686003)(19627235002)(54906003)(66446008)(55016002)(8676002)(7696005)(71200400001)(5660300002)(86362001)(64756008)(52536014)(66946007)(6506007)(66556008)(186003)(66476007)(53546011)(76116006)(26005)(30864003)(8936002)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: X4lWZYsHPGtXy86lPwsn66No4mh5WW320+H+89DcK332+rD/rZOmbvWl+74gpnjShP/SvbTuSSj1WbJc5rV/96jmDmSlGCVkVZkGP1zVwt0mIxNQ+G0GCsH9CtEhUXrkQ+4jYvtydobF8sGE5xNai0RthHAOdFRjS0lW0hgixZRfRjH4bA/3a0+7yAEnY1Jr235G2bGJD7fCMLKh/ErpK8BMmqRj1UM7KvEm03I8fqInlsqSLALnLRPwDqXzXGTGjUJZN38Jj+h2Pox65mMqzJUvEdyPTKNBTgD/GXk6XE3aB6ZMMoIJUcXtJmHnH5R6dcEaeQcjFHSQ9GK+1BNL0pkqCPpwmBi64eW/i7p5jnsZilFVcxCjsyXO09ReYOL3l0JZCvjBKUMS3XWuMcdSdmyVRIZZ8+zThRw3M7yfTir2nEy4ClyBbEp6XbMB7FC4WPU/QybwCE3IJC50+DQkLdPmJIpKzjUWy4O+n5u0902FSOe9v/3vxJATGbcm+98xJnSYHx8JNaCQH9JppCp3eFGrLx7EgA6AsgLb3oFeh2nq14BcgobhsAuv5qDp7cNwV/O2KJjjGRvUm3tb8uZ+4gFyggqHQ5576lyoSCoXBikCpNOnZpzE18nIa3ibdQ6pO+NmV36XptPO/AeEGHdBbQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2160.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41ddd7af-de4a-43b6-4d40-08d87ac8c973 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2020 22:36:46.3800 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: D/GFQGwiSZKa5SNXiOWZUyBV2DCBOXTrXUzTCpvfQpnRr8OrpUTRlxYc/6KXuU5W/CwIXZn//I7Yd8NG22aHY2j+hbWdyio8tyA7kXRR5yk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1805 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hey Heng, SerialDebugFeaturePkg does not seem to describe this feature very well. Thi= s feature's function is routing ConIn/ConOut to the serial port, it has no = impact on the debug log. I think SerialTerminalFeaturePkg would be a more a= ppropriate name. Please see additional feedback inline. On 10/23/20, 1:14 AM, Luo, Heng wrote: >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3014 >=20 > Add the serial port terminal library to get console redirect > after the shell is loaded. >=20 > Cc: Eric Dong > Cc: Liming Gao > Cc: Chasel Chiu > Cc: Nate DeSimone >=20 > 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/SerialDebugFeatur= e.dsc | 72 +++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++ > Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTermina= lLib/SerialPortTerminalLib.c | 93 +++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTermina= lLib/SerialPortTerminalLib.h | 49 +++++++++++++++++++++++++++++++++++++++= ++++++++++ > Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTermina= lLib/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(-) >=20 > diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/F= eatures/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 > DXE_ARCH =3D X64 > =20 > -!include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc > +!include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc > + > =20 > ########################################################################= ######## > # > @@ -45,6 +46,7 @@ > gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable = |TRUE > gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable = |TRUE > gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable = |TRUE > + gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable = |TRUE Please rename to PcdSerialTerminalFeatureEnable > gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable = |TRUE > gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable = |TRUE > gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable = |FALSE > diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.d= sc 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 = TRUE > !include Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc > !endif > +!if gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable =3D= =3D TRUE > + !include SerialDebugFeaturePkg/Include/SerialDebugFeature.dsc > +!endif > =20 > # > # Network Advanced Features > diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPc= d.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 > AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec > Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec > + SerialDebugFeaturePkg/SerialDebugFeaturePkg.dec > NetworkFeaturePkg/NetworkFeaturePkg.dec > IpmiFeaturePkg/IpmiFeaturePkg.dec > S3FeaturePkg/S3FeaturePkg.dec > @@ -38,6 +39,7 @@ > gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable = |FALSE > gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable = |FALSE > gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable = |FALSE > + gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable = |FALSE > gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable = |FALSE > gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable = |FALSE > gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable = |FALSE > diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf b/F= eatures/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 = TRUE > !include Debugging/Usb3DebugFeaturePkg/Include/PostMemory.fdf > !endif > - > +!if gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable =3D= =3D TRUE > + !include SerialDebugFeaturePkg/Include/PostMemory.fdf > +!endif > # > # Network Advanced Features > # > diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf b/Fe= atures/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 = TRUE > !include Debugging/Usb3DebugFeaturePkg/Include/PreMemory.fdf > !endif > - > +!if gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable =3D= =3D TRUE > + !include SerialDebugFeaturePkg/Include/PreMemory.fdf > +!endif > # > # Network Advanced Features > # > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostM= emory.fdf b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostMemo= ry.fdf > new file mode 100644 > index 0000000000..202918511f > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PostMemory.f= df > @@ -0,0 +1,8 @@ > +## @file > +# FDF file for post-memory modules that enable Serial Debug Change Serial Debug to Serial Terminal > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## Please add the following drivers here: INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMe= mory.fdf b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMemory= .fdf > new file mode 100644 > index 0000000000..111bace4fc > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/PreMemory.fd= f > @@ -0,0 +1,8 @@ > +## @file > +# FDF file for pre-memory modules that enable Serial Debug. Change Serial Debug to Serial Terminal > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/Seria= lDebugFeature.dsc b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/= SerialDebugFeature.dsc > new file mode 100644 > index 0000000000..abed99ff8d > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Include/SerialDebugF= eature.dsc Please rename to SerialTerminalFeature.dsc > @@ -0,0 +1,72 @@ > +## @file > +# This is a build description file for the Serial Debug advanced feature= . > +# This file should be included into another package DSC file to build th= is feature. > +# > +# The DEC files are used by the utilities that parse DSC and > +# INF files to generate AutoGen.c and AutoGen.h files > +# for the build infrastructure. > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +########################################################################= ######## > +# > +# Defines Section - statements that will be processed to create a Makefi= le. > +# > +########################################################################= ######## > +[Defines] > +!ifndef $(PEI_ARCH) > + !error "PEI_ARCH must be specified to build this feature!" > +!endif > +!ifndef $(DXE_ARCH) > + !error "DXE_ARCH must be specified to build this feature!" > +!endif > + > +########################################################################= ######## > +# > +# Library Class section - list of all Library Classes needed by this fea= ture. > +# > +########################################################################= ######## > +[LibraryClasses] > + ####################################### > + # Edk2 Packages > + ####################################### > + #BaseLib|MdePkg/Library/BaseLib/BaseLib.inf > + #BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf Remove commented out code. > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEnt= ryPoint.inf > + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootMan= agerLib.inf > + > +# > +# Feature DXE Components > +# > +[Components.X64] This should be: [Components.$(DXE_ARCH)] > + ##################################### > + # Serial Debug Feature Package > + ##################################### > + > + # Add library instances here that are not included in package componen= ts and should be tested > + # in the package build. > + SerialDebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminal= Lib.inf > + > + # Add components here that should be included in the package build. > + > +########################################################################= ########################### > +# > +# BuildOptions Section - Define the module specific tool chain flags tha= t should be used as > +# the default flags for a module. These flags are= appended to any > +# standard flags that are defined by the build pr= ocess. They can be > +# applied for any modules or only those modules w= ith the specific > +# module style (EDK or EDKII) specified in [Compo= nents] section. > +# > +# For advanced features, it is recommended to ena= ble [BuildOptions] in > +# the applicable INF file so it does not affect t= he whole board package > +# build when this DSC file is active. > +# > +########################################################################= ########################### > +[BuildOptions] > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/Seria= lPortTerminalLib/SerialPortTerminalLib.c b/Features/Intel/Debugging/SerialD= ebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c > new file mode 100644 > index 0000000000..36c0e7110f > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTe= rminalLib/SerialPortTerminalLib.c > @@ -0,0 +1,93 @@ > +/** @file > + Main file for NULL named library for Serial Port Deviceboard controlle= r librarr. > + > + INTEL CONFIDENTIAL Remove INTEL CONFIDENTIAL > + Copyright (c) 2020, Intel Corporation. All rights reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "SerialPortTerminalLib.h" > + > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH mSerialDevicePath =3D { > + { > + { > + 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 > + 115200, // BaudRate > + 8, // DataBits > + 1, // Parity > + 1 // StopBits Please make PCDs to configure these values. Make sure to read the PCDs in S= erialPortTerminalLibConstructor() not here in the global variable definitio= n so that the PCDs can be made either Dynamic or DynamicEx type. > + }, > + { > + { > + 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 d= evice 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 s= ucessfully > + @retval EFI_UNSUPPORTED the shell level required was not found. > +**/ > +EFI_STATUS > +EFIAPI > +SerialPortTerminalLibConstructor ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + AddSerialTerminal(); > + > + return EFI_SUCCESS; > +} > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/Seria= lPortTerminalLib/SerialPortTerminalLib.h b/Features/Intel/Debugging/SerialD= ebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.h > new file mode 100644 > index 0000000000..afb3eb2cb3 > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTe= rminalLib/SerialPortTerminalLib.h > @@ -0,0 +1,49 @@ > +/** @file > + Header file for NULL named library for Ps2 keyboard controller library= . > + > + INTEL CONFIDENTIAL Remove INTEL CONFIDENTIAL > + Copyright (c) 2020, Intel Corporation. All rights reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef _PS2_KBC_LIB_H > +#define _PS2_KBC_LIB_H Should be _SERIAL_PORT_TERMINAL_LIB_H_ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +// > +// 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 gPciRootBridge \ > + { \ > + { \ > + ACPI_DEVICE_PATH, \ > + ACPI_DP, \ > + { \ > + (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \ > + (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \ > + }, \ > + }, \ > + EISA_PNP_ID (0x0A03), \ > + 0 \ > + } > + > +#define gEndEntire \ > + { \ > + END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { END_DEVICE_P= ATH_LENGTH, 0 } \ > + } > + > +#endif > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/Seria= lPortTerminalLib/SerialPortTerminalLib.inf b/Features/Intel/Debugging/Seria= lDebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf > new file mode 100644 > index 0000000000..4f63d1626f > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/Library/SerialPortTe= rminalLib/SerialPortTerminalLib.inf > @@ -0,0 +1,35 @@ > +## @file > +# Component information file for Serial Port Terminal Redirection Librar= y > +# > +# INTEL CONFIDENTIAL > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > +[Defines] > + INF_VERSION =3D 0x00010006 > + BASE_NAME =3D SerialPortTerminalLib > + FILE_GUID =3D E12BFA46-95F2-4ADC-9774-7E38DE78741= E > + MODULE_TYPE =3D UEFI_DRIVER > + VERSION_STRING =3D 1.2 > + LIBRARY_CLASS =3D NULL|UEFI_DRIVER This should be: LIBRARY_CLASS =3D NULL|UEFI_DRIVER DXE_DRI= VER DXE_RUNTIME_DRIVER > + CONSTRUCTOR =3D SerialPortTerminalLibConstructor > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + BoardModulePkg/BoardModulePkg.dec > + > +[Sources] > + SerialPortTerminalLib.c > + SerialPortTerminalLib.h > + > +[LibraryClasses] > + DevicePathLib > + DebugLib > + UefiDriverEntryPoint > + UefiBootManagerLib > + UefiLib > + > +[Pcd] > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/Readme.md b/F= eatures/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 > +* **Feature Name:** Serial Debug > +* **PI Phase(s) Supported:** DXE > +* **SMM Required?** No > + > +## Purpose > +The Serial Debug feature enables EDK II compliant firmware to use a seri= al port on the system for firmware debug. This package should be just about the serial terminal, not the more general= topic of serial debug. Accordingly, this should mention terminal and ConIn= /ConOut not debug. > + > +SerialPortTerminalLib.inf provider NULL named library for Serial Port Te= rminal Redirection Library, it can be used by BdsDxe to redirect the consol= e to serial port after the shell is loaded. > + > +# High-Level Theory of Operation > + > +Not available. > + > +## Firmware Volumes > + > +* N/A > + > +## Modules > + > +A bulleted list of the modules that make up the feature. > + > +* SerialPortTerminalLib > + > +## SerialPortTerminalLib > + > +This library can be used by BdsDxe to redirect the console to serial por= t. > + > +## Key Functions > + > +* Updates the ConOut, ConIn, ErrOut variables with the serial terminal d= evice path. > + > +## Configuration > + > +* Add this library to BdsDxe driver, to add the serial device to ConIn a= nd ConOut variables. > + > +## Data Flows > + > +Architecturally defined data structures and flows for the feature. > + > +### Data flows of SerialPortTerminalLib > + > +N/A > + > +## Control Flows > + > +```txt > +| BdsDxe | | SerialPortTerminalLib | > +------------ ----------------------- > + | | > + |---SerialPortTerminalLibConstructor-->|--------- > + | | | > + | | AddSerialTerminal > + | | | > + | |<-------- > +``` > + > +## Build Flows > + > +No any special build flows is needed. > + > +## Test Point Results > + > +Not available. > + > +## Functional Exit Criteria > + > +Not available. > + > +## Feature Enabling Checklist > + > +1. Add this library to BdsDxe driver in OpenBoardPkg.dsc under section [= Components.X64], to add the serial device to ConIn and ConOut variables: > + > +```dsc > +MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { > + > + NULL|SerialDebugFeaturePkg/Library/SerialPortTerminalLib/SerialPortTer= minalLib.inf > +} > +``` > + > +2. Include these 2 drivers to the OpenBoardPkg.dsc: > + > +```dsc > + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > +``` > + > +3. Include these 2 drivers to OpenBoardPkg.fdf under section [FV.FvUefiB= ootUncompact]: > + > +```fdf > +INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > +INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > +``` > + > +## Performance Impact > + > +Not available. > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFe= aturePkg.dec b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFe= aturePkg.dec > new file mode 100644 > index 0000000000..1ad36565d0 > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeaturePk= g.dec > @@ -0,0 +1,31 @@ > +## @file > +# This package provides advanced feature functionality for Serial Debug = support. > +# This package should only depend on EDK II Core packages, IntelSiliconP= kg, and MinPlatformPkg. > +# > +# The DEC files are used by the utilities that parse DSC and > +# INF files to generate AutoGen.c and AutoGen.h files > +# for the build infrastructure. > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + DEC_SPECIFICATION =3D 0x00010017 > + PACKAGE_NAME =3D SerialDebugFeaturePkg > + PACKAGE_GUID =3D A4BF76C6-6190-4B2C-B1C8-D872F60629B2 > + PACKAGE_VERSION =3D 0.1 > + > +[Includes] > + Include > + > +[Guids] > + gSerialDebugFeaturePkgTokenSpaceGuid =3D {0xebda878b, 0xa5f1, 0x4b0f= , {0x89, 0x2d, 0x47, 0x56, 0x97, 0xd4, 0x1a, 0x05}} > + > +[PcdsFeatureFlag] > + gSerialDebugFeaturePkgTokenSpaceGuid.PcdSerialDebugFeatureEnable|FALSE= |BOOLEAN|0xA0000001 > + > + > + > diff --git a/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFe= aturePkg.dsc b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFe= aturePkg.dsc > new file mode 100644 > index 0000000000..4247566a14 > --- /dev/null > +++ b/Features/Intel/Debugging/SerialDebugFeaturePkg/SerialDebugFeaturePk= g.dsc > @@ -0,0 +1,31 @@ > +## @file > +# This package provides advanced feature functionality for Serial Debug = support. > +# This package should only depend on EDK II Core packages, IntelSiliconP= kg, and MinPlatformPkg. > +# > +# The DEC files are used by the utilities that parse DSC and > +# INF files to generate AutoGen.c and AutoGen.h files > +# for the build infrastructure. > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + PLATFORM_NAME =3D SerialDebugFeaturePkg > + PLATFORM_GUID =3D 378D0A55-A83D-4B99-B85D-D78703A2878= 3 > + PLATFORM_VERSION =3D 0.1 > + DSC_SPECIFICATION =3D 0x00010005 > + OUTPUT_DIRECTORY =3D Build/$(PLATFORM_NAME) > + SUPPORTED_ARCHITECTURES =3D IA32|X64 > + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT > + SKUID_IDENTIFIER =3D DEFAULT > + PEI_ARCH =3D IA32 > + DXE_ARCH =3D X64 > + > + > +# > +# This package always builds the feature. > +# > +!include Include/SerialDebugFeature.dsc > --=20 > 2.24.0.windows.2 Thanks, Nate