From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.3976.1603426102290968927 for ; Thu, 22 Oct 2020 21:08:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZMF1vODd; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: heng.luo@intel.com) IronPort-SDR: OnXKo7g9r7BXjojNHWDCPTgRLLbOboQkxBjolq5HQ67Gfvv8gzI7R+Qf+Jl4AqEB93Lk4N7pO3 ZmDDeubvif/A== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="252324636" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="252324636" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 21:08:20 -0700 IronPort-SDR: R516HIdtKlSj+ze9vwD5U4hfiTROeCBeKxqRte4SRp7j1Dhwv7zZSMUFvsm3Itj/8Zfmn9XmPn hf3lQN2/XCow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="534243168" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 22 Oct 2020 21:08:20 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 22 Oct 2020 21:08:19 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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; Thu, 22 Oct 2020 21:08:19 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 22 Oct 2020 21:08:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E/j2GosAtJ9spyAZmGdE8ulEWxb+yRGgGYr2WXQfMc7m8DyjKGOl7rBlzlxmc5twO934AqUoGejyiDrb/0lACNxvkpn2i4oopNQe0N7dCUAXlI5u++8JzXg6jlBbmXzkzKa8egqO+wv4D4djSNUa7gTezFuNCx3MyWGE9xTV2eAACGcO/O7/EZnNRcoCj7Z0AyRTuamTaO8ACfjp+c70cjRJoDagOf4Vq+CRBY+CHGFGQe9Wqhq94qf4Qp4i794ch9g7/HnvEEA5PvoDENLiRxq+ClKNKhmrFlPeKNFgOiP+f/jnHQxcL9jEXLA2bG2+VttWXUUnxfmsnH2uHP2oRw== 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=KJksc3v9KL0o8l4Ay22/SaYq1VFpilgnEM4BjP+zNko=; b=jZkidUlQkGAsMxBGXgmEQ7toYYEjgUtTAj7pEl53zVqAoC5A6+5PMS6/S7TE+jL7JrHB0NvBFtyYgzUqG/+QTy2lgqiZn9F93+h85frDlgzLbTZ64/h9AbVVvTigPUyDfGXkrzzEeFBESIy8kbHAhgjottEtQDdrj8oOgyeMt+MtQlKgTXKtU5Q/mj8ZD6ZCt3AauAx7fAPUbuQPAxHhJfjeaZA/dbSR+B+D9cRuoebFGVMi2qdchEhwgWPT9G/j5ugJSxTa8tobwtHxmdvoh0UiFEc/WcDp6bO3gGilABLgntFlPAbZ+IzpTRhBbA0OTzbbxZAvbSd7KWgi9Uu99Q== 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=KJksc3v9KL0o8l4Ay22/SaYq1VFpilgnEM4BjP+zNko=; b=ZMF1vODdiJ4fmWIK61GfHihGiWB6BEjwvZsQeQg/F12MJWl78EZE8ytbTOooISlQkvJ4QoAxAb6rrth/RVj1xZR5qNJ1G5aA+bDp+k23/f5I+koorX7e8nz98+KLzSbHwShGjeaNYHawKbtT7tj7bjoW8Y0C0N07O7BzhYGeSIo= Received: from MWHPR11MB1805.namprd11.prod.outlook.com (2603:10b6:300:114::14) by MWHPR11MB1389.namprd11.prod.outlook.com (2603:10b6:300:26::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.25; Fri, 23 Oct 2020 04:08:19 +0000 Received: from MWHPR11MB1805.namprd11.prod.outlook.com ([fe80::bd78:5a79:d875:65e4]) by MWHPR11MB1805.namprd11.prod.outlook.com ([fe80::bd78:5a79:d875:65e4%12]) with mapi id 15.20.3477.028; Fri, 23 Oct 2020 04:08:18 +0000 From: "Heng Luo" To: "Dong, Eric" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" Subject: Re: [PATCH 1/2] BoardModulePkg: Add SerialPortTerminalLib Thread-Topic: [PATCH 1/2] BoardModulePkg: Add SerialPortTerminalLib Thread-Index: AQHWpofRgHd9P0fqtEKLe5ipCR5B8ami1lpQgAHAa4A= Date: Fri, 23 Oct 2020 04:08:18 +0000 Message-ID: References: <20201020022144.2261-1-heng.luo@intel.com> <20201020022144.2261-2-heng.luo@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 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: [192.198.147.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8dec80e3-c050-44a6-7365-08d87709462e x-ms-traffictypediagnostic: MWHPR11MB1389: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KRt3j+IIYOI5kWs/ysPN89qZ2FdaWm11ze5RtzBvs8EiYgSIwaBXCMNMfjet7Pf13Dod3f400PH92l9wiakDNv4W5p60JHM0pc4g9E9j9O6mYWTP0r/XbESNHyKh6Iht2J2ADg/tsrpwBh7d+2SCfPc2KOXjl0XEA5N4LaCwEdV1AQSMy0cZM51VJZYHEqzT+n9uY56BltJQys8jTvsz22GPQ92BXilg4VKkMirJXzV+ALPVPgr83kC/paM7yJhq1CnujlVbOgdsjmDL5eCexMvEgpor07yO88OLrJfsE9Nkya1GjRWX1D4Dhe882zqYB6hUjBHgnxQXWHlSy+G3jNpWKHT7KBWz/P9+ykP7B52wDr7+Uq3/KvXi9tGFbHhvVqrcUmusiXFIrAJGQD44ig== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1805.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(396003)(366004)(136003)(346002)(376002)(54906003)(86362001)(2906002)(83380400001)(71200400001)(8936002)(76116006)(316002)(52536014)(66556008)(66446008)(55016002)(5660300002)(66946007)(110136005)(66476007)(64756008)(9686003)(26005)(478600001)(53546011)(6506007)(7696005)(966005)(33656002)(4326008)(107886003)(186003)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: oHUnkiq6I7yBHmw/seD8ndIYLFKvenYyv+qys11uy/k/OiuNSUBTxFLuDNb34mKpnTAvASvZnJj8ko7HrWfrZbua/XVHDa19dSQ+h/8KpaTL5OmlKzxjd7bj8fHlRYbEGsu+h2IVbEbGLQpU9XNecZ5Fbol4OF5nGDlUCKZrgNAsN3j+nl9FDRqxZLSSQABuudNI0ms8F1wYzI+iwSgGZxLCsygzJY1a4V0hjL/jDi/LVBD+wzW1WiILp6tbG3FKlURA1NrPVaRYhStaSw+sIx0aTDck8z9tDv6Fyq86CT4+cLcyvLiFFLlAHhzy56nKvmELmqD/PXgdQB9tPS04g/TbDx/qi0FzoM5WywLY7qrlODLUE7DXC8TgrHrBBI07QMKmoRB7xC46R389dPFjAd0jFV0pkdYEqk3KPucWyYBUUw6Kwj6Qq7yKhEAKOS/sbOpSlDg7R9bZVwQEhxWythgGbGfRhdCJgkSkZanyJbon0qr+r4AL4wJKCkht+Vcf8yDsW5KkyYlaOr0GcGlwVmEO4AX2RqAPh+DQbueUUJO5u3jYmu+0Nn9qnUGMGrLiWKaPeDlu5tI9aPz+WJwxkexu0IueBTXR5LvUOxkwdSOfAGMaZmFMfF7giuRigzsTa32041l07hrogy010aXp6Q== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1805.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8dec80e3-c050-44a6-7365-08d87709462e X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2020 04:08:18.7236 (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: bcKiIb+eP7e82L7cV9TV0zaII6J1GaBGN17+FKoTVbmlF3zGrAnBOlf7Dju53quAD5BgnBL1Mn9j+wipaKG2PA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1389 Return-Path: heng.luo@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Eric, Chaganty, Rangasai V suggest to move it to = Features\Intel\Debugging, do you agree? Thanks, heng > -----Original Message----- > From: Dong, Eric > Sent: Thursday, October 22, 2020 9:23 AM > To: Luo, Heng ; devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > > Subject: RE: [PATCH 1/2] BoardModulePkg: Add SerialPortTerminalLib >=20 > Hi Heng, >=20 > Seems like it is a common feature not related to board scope, I think > Features folder is a better place to hold it. >=20 > Thanks, > Eric >=20 > -----Original Message----- > From: Luo, Heng > Sent: Tuesday, October 20, 2020 10:22 AM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Chiu, Chasel ; > Desimone, Nathaniel L > Subject: [PATCH 1/2] BoardModulePkg: Add SerialPortTerminalLib >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3014 >=20 > Add the serial port terminal library to get console redirect after the sh= ell is > loaded. >=20 > Cc: Eric Dong > Cc: Chasel Chiu > Cc: Nate DeSimone >=20 > Signed-off-by: Heng Luo > --- >=20 > Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortTer > minalLib.c | 93 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++ >=20 > Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortTer > minalLib.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ >=20 > Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortTer > minalLib.inf | 35 +++++++++++++++++++++++++++++++++++ > 3 files changed, 177 insertions(+) >=20 > diff --git > a/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortT > erminalLib.c > b/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortT > erminalLib.c > new file mode 100644 > index 0000000000..36c0e7110f > --- /dev/null > +++ b/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/Serial > +++ PortTerminalLib.c > @@ -0,0 +1,93 @@ > +/** @file >=20 > + Main file for NULL named library for Serial Port Deviceboard controlle= r > librarr. >=20 > + >=20 > + INTEL CONFIDENTIAL >=20 > + Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include "SerialPortTerminalLib.h" >=20 > + >=20 > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH > mSerialDevicePath =3D { >=20 > + { >=20 > + { >=20 > + HARDWARE_DEVICE_PATH, >=20 > + HW_VENDOR_DP, >=20 > + { >=20 > + (UINT8) sizeof (VENDOR_DEVICE_PATH), >=20 > + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) >=20 > + } >=20 > + }, >=20 > + EDKII_SERIAL_PORT_LIB_VENDOR_GUID >=20 > + }, >=20 > + { >=20 > + { >=20 > + MESSAGING_DEVICE_PATH, >=20 > + MSG_UART_DP, >=20 > + { >=20 > + (UINT8) sizeof (UART_DEVICE_PATH), >=20 > + (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) >=20 > + } >=20 > + }, >=20 > + 0, // Reserved >=20 > + 115200, // BaudRate >=20 > + 8, // DataBits >=20 > + 1, // Parity >=20 > + 1 // StopBits >=20 > + }, >=20 > + { >=20 > + { >=20 > + MESSAGING_DEVICE_PATH, >=20 > + MSG_VENDOR_DP, >=20 > + { >=20 > + (UINT8) (sizeof (VENDOR_DEVICE_PATH)), >=20 > + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8), >=20 > + } >=20 > + }, >=20 > + DEVICE_PATH_MESSAGING_PC_ANSI >=20 > + }, >=20 > + gEndEntire >=20 > +}; >=20 > + >=20 > +/** >=20 > + Updates the ConOut, ConIn, ErrOut variables with the serial terminal > + device path >=20 > + @param none >=20 > + @retval none >=20 > +**/ >=20 > +VOID >=20 > +AddSerialTerminal ( >=20 > + VOID >=20 > + ) >=20 > +{ >=20 > + DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n")); >=20 > + >=20 > + // >=20 > + // Append Serial Terminal into "ConIn" >=20 > + // >=20 > + EfiBootManagerUpdateConsoleVariable (ConOut, > + (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL); >=20 > + EfiBootManagerUpdateConsoleVariable (ConIn, > (EFI_DEVICE_PATH_PROTOCOL > + *) &mSerialDevicePath, NULL); >=20 > + EfiBootManagerUpdateConsoleVariable (ErrOut, > + (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL); >=20 > +} >=20 > + >=20 > + >=20 > +/** >=20 > + Constructor for the Serial Port Device controller library. >=20 > + >=20 > + @param ImageHandle the image handle of the process >=20 > + @param SystemTable the EFI System Table pointer >=20 > + >=20 > + @retval EFI_SUCCESS the shell command handlers were installed > sucessfully >=20 > + @retval EFI_UNSUPPORTED the shell level required was not found. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +SerialPortTerminalLibConstructor ( >=20 > + IN EFI_HANDLE ImageHandle, >=20 > + IN EFI_SYSTEM_TABLE *SystemTable >=20 > + ) >=20 > +{ >=20 > + AddSerialTerminal(); >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > diff --git > a/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortT > erminalLib.h > b/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortT > erminalLib.h > new file mode 100644 > index 0000000000..afb3eb2cb3 > --- /dev/null > +++ b/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/Serial > +++ PortTerminalLib.h > @@ -0,0 +1,49 @@ > +/** @file >=20 > + Header file for NULL named library for Ps2 keyboard controller library= . >=20 > + >=20 > + INTEL CONFIDENTIAL >=20 > + Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#ifndef _PS2_KBC_LIB_H >=20 > +#define _PS2_KBC_LIB_H >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +// >=20 > +// Below is the platform console device path >=20 > +// >=20 > +typedef struct { >=20 > + VENDOR_DEVICE_PATH Guid; >=20 > + UART_DEVICE_PATH Uart; >=20 > + VENDOR_DEVICE_PATH TerminalType; >=20 > + EFI_DEVICE_PATH_PROTOCOL End; >=20 > +} SERIAL_DEVICE_PATH; >=20 > + >=20 > +#define gPciRootBridge \ >=20 > + { \ >=20 > + { \ >=20 > + ACPI_DEVICE_PATH, \ >=20 > + ACPI_DP, \ >=20 > + { \ >=20 > + (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \ >=20 > + (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \ >=20 > + }, \ >=20 > + }, \ >=20 > + EISA_PNP_ID (0x0A03), \ >=20 > + 0 \ >=20 > + } >=20 > + >=20 > +#define gEndEntire \ >=20 > + { \ >=20 > + END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { > + END_DEVICE_PATH_LENGTH, 0 } \ >=20 > + } >=20 > + >=20 > +#endif >=20 > diff --git > a/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortT > erminalLib.inf > b/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/SerialPortT > erminalLib.inf > new file mode 100644 > index 0000000000..4f63d1626f > --- /dev/null > +++ b/Platform/Intel/BoardModulePkg/Library/SerialPortTerminalLib/Serial > +++ PortTerminalLib.inf > @@ -0,0 +1,35 @@ > +## @file >=20 > +# Component information file for Serial Port Terminal Redirection > +Library >=20 > +# >=20 > +# INTEL CONFIDENTIAL >=20 > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +# >=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010006 >=20 > + BASE_NAME =3D SerialPortTerminalLib >=20 > + FILE_GUID =3D E12BFA46-95F2-4ADC-9774-7E38DE78741= E >=20 > + MODULE_TYPE =3D UEFI_DRIVER >=20 > + VERSION_STRING =3D 1.2 >=20 > + LIBRARY_CLASS =3D NULL|UEFI_DRIVER >=20 > + CONSTRUCTOR =3D SerialPortTerminalLibConstructor >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > + BoardModulePkg/BoardModulePkg.dec >=20 > + >=20 > +[Sources] >=20 > + SerialPortTerminalLib.c >=20 > + SerialPortTerminalLib.h >=20 > + >=20 > +[LibraryClasses] >=20 > + DevicePathLib >=20 > + DebugLib >=20 > + UefiDriverEntryPoint >=20 > + UefiBootManagerLib >=20 > + UefiLib >=20 > + >=20 > +[Pcd] >=20 > -- > 2.24.0.windows.2