From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.431.1652374591652231177 for ; Thu, 12 May 2022 09:56:33 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=fwhZNJWb; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: guo.dong@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652374592; x=1683910592; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=VeJc95coTPfzTRMkAMP8r1RrUI9dDnBghbMl6mVU+b4=; b=fwhZNJWbMskoq1KahX2iaOnIc/D9UnEKCAVSoKmB1Gp9uG06L34pTjCe QXiBQBf9t4TVL83JCSYNVqVHJS8oBxpnUCBWavO2n1rpwqhFEJPtr/4HA yochHIFS9VMmzzdH3LlWWxxsTDleKnYx+61VEY5e0UjBpfkRehewYNuQd Jvdo2MNqWIaJfoYklw2jqq0EELxlhMXyjw+jboMKECV2Jwkonn6YdZ2b0 hymSbFW2nsPrRkXmaIPiepZ5GCIHzSb0awiheGXLqFdV/+ebzqdGNKG6A i4XtMkLrG8Wmd88/P3C8lz82cffRBZvH9TXKbZN0c1uUw0Ongt5f0n5gj A==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="268894708" X-IronPort-AV: E=Sophos;i="5.91,220,1647327600"; d="scan'208";a="268894708" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 09:45:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,220,1647327600"; d="scan'208";a="711992926" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga001.fm.intel.com with ESMTP; 12 May 2022 09:45:37 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 12 May 2022 09:45:36 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 12 May 2022 09:45:36 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 12 May 2022 09:45:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrNPEm6gchfGWGQnaGFpGvNvXp1zkA7tAciQcHm2LsLiC8+P5whLFIZnbk5lJXRgLpzMg+OsFjuc/zJwGNJHs/zSnl+qirdxOto3rfD7r0SOOZGce3hoKpxDQjShoG21/pQYfNgHSr1PE9LU8qg1r4bheuN9yV6BvnF2Eqf5hgq1nirgrs/aejaxkuuU2HI2AO+PXI6wGq3D0k/OK/ZRT9FisvlYvM3EEilXfCUY/ZUcGRsg2Auqc1IVt6dOUKkb57Zy1XxjVyH6K+h5/qZJ5TnhoBbEIoSLw0MsJHfFE7YsWFJ9PRuhqw9LpcRfSForn2D4e4zfwcXb5jUiH2ArDw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WUq7QI052RZFsa6hnr6Co8kxqS9Cs7tMOUos6gmw16M=; b=W8YyK/p0Hk2hRqvybDZeb/IvhE5MbEeA67N1VrIbbdJ/f+BeXiTgr3GMcXKbSy2naHFBgbutqUzYJOUXFMPyzjqGv/4R6UpI5blP0s2rPjUEYv1pwgRWLvEWmbIb4JUEZsEs8qwkFgBu8e/YOzZH0PytQTpGqldLp4gANtSykobeXz/hn1m8PjOptpLKcCGMOoCby1u88T964moYP9VNsKkJJ+t39q2LGpUN9mSjtFYfLzILG1EtcOQt+upT4VvHIUOSR4d49nTHgK4nsE9gPW5LqcqYvUbx1zGk6JEbKpjRqrOZ93iorROJWQrvE0Lk76EtHtq61nEdo9xosgB6jQ== 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 Received: from BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by DM6PR11MB4138.namprd11.prod.outlook.com (2603:10b6:5:19a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Thu, 12 May 2022 16:45:34 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::cdf7:2641:1ae1:6197]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::cdf7:2641:1ae1:6197%7]) with mapi id 15.20.5227.023; Thu, 12 May 2022 16:45:33 +0000 From: "Guo Dong" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Ni, Ray" , Maurice Ma , "You, Benjamin" , "Rhodes, Sean" Subject: Re: [PATCH v2 2/3] UefiPayloadPkg: Add Serial IO device path according to related protocol Thread-Topic: [PATCH v2 2/3] UefiPayloadPkg: Add Serial IO device path according to related protocol Thread-Index: AQHYZe7PFt8K39Ft9UW8qNNDDeSCda0bc35w Date: Thu, 12 May 2022 16:45:33 +0000 Message-ID: References: <03aeca65da52907434e14d1f9fbd1c0651874257.1652351830.git.zhiguang.liu@intel.com> In-Reply-To: <03aeca65da52907434e14d1f9fbd1c0651874257.1652351830.git.zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 14cdcdea-4f9d-4ed9-687b-08da3436d55c x-ms-traffictypediagnostic: DM6PR11MB4138:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rm6W0aPtylfNICy9nWvnNGj+GGtXAfWgCwV5ZnwrOx3Zb7tczvKo33wOA2G3nBvfwElD+uyqNRNMoi6GxyxYo6FLTLyNNvTw2u5xt+jmK2ycQL29rZAPaG36iC0hrtbTPQsmzKdAF7NdZuUwAOcIj8Xu+MyQrVWt8A64pXGaKkaWFQwgux7GYsAsWOaM063dy1qtqzqEN3Q8Smtob80Xj/3A2oK5mikDmXYvR8ExvEfDjkEAwvwleMwcWjunGFNN3Zyt6ClJtNaPOnROjSTGfTEysUzdng5abuYYisPnUbnb5pPHaXJ0yOF6igxOO2MM7HsfxITRE/SuI76vGOvxFMjB7V+Ne6TxyieEkpbWEnZn55J6g3iKTOf4sQ/+3H+XRLYQMz877T23lmsdAPyydKbHFXJBbibu3Hb6blt0hgXZiilqwkPmouNoFP4cv/eE4mUWFPVRlY8k5IH5xNM6n2QOo2SmOI9qYKS1LsndGxT/eGQvVZb8C475Th3R5mWMa8CwouFXWIytRkt3nsRL3yVbHbwY9YvUEdqvgSEhRpAHn57FW0ivoet7vSOkITUWsn9hgyY/o3Fi4h31YYnSeMDJj6brAnKPBHrVwwoMFl6pMR273WrSuoggWmEGofmbXJApbDhcQv8EAsYoEl7jEVDE98JNmJdN44wmno6O/O7PZhnqgye6z5/x/ceYq+3eFbU+cvsisAW7XK63DK67zA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(66446008)(66556008)(9686003)(53546011)(5660300002)(4326008)(66476007)(66946007)(76116006)(186003)(8676002)(71200400001)(54906003)(33656002)(110136005)(52536014)(8936002)(55016003)(64756008)(86362001)(7696005)(82960400001)(316002)(19627235002)(508600001)(2906002)(6506007)(83380400001)(122000001)(38100700002)(38070700005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 2 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gBbFADj856fy733TrW/YZukfRp4fU/+lvwnk4iaJFbikPe93ewgcr4yi/lU/?= =?us-ascii?Q?wlUVTizyhUbzOgUGWkij4spOIRg0+XfEjNAJhYg3osvqnt8lofH/6Wfbij6Y?= =?us-ascii?Q?KtyiXNoAInrBS7yeNVaPgDDHbQ06Y5vgFjshFB7naUTUSlRoAHMns8xJQB/a?= =?us-ascii?Q?xZpVcpBZCIuKpe+HJR0+VsE4V4gd5ydKdG19y8g0sixg4GrBnX+Zonvnv4uy?= =?us-ascii?Q?Mu5S2hX66ZJeLLHBRzVS4af7p1+9Nx0jmE5aVwO5kR8Wq8YiMd5qVr+MjSOK?= =?us-ascii?Q?60wgpD2pMz5u8qmD2/0AiLvn6F/j4qKd9v4AAWudk1fp0W2d5zjMvRt9nQtn?= =?us-ascii?Q?aK16sFxEtIawb6peZHdnPj+zWW9Gcqb+n2loTALNQ/kFW2Yhxnhw2J/R2j7Z?= =?us-ascii?Q?veHaxPWbFzc4Ql/kbMs55q3Xymlul20sJ6NbW9+tl1Pcbol90DOqp51VcBm+?= =?us-ascii?Q?hFgtVEACPLEi4a6HeGdPk706fvzkfI/SfWaNXOkY3H6TdT9a1gXrQLuCetZl?= =?us-ascii?Q?wF4ovRnYMWNkVb8B57OeIvix4VJOb6tgmYMwIi4NIErA6qmyEIIHdHD0rhHy?= =?us-ascii?Q?6VD/Em/ggyEJJ5tferwZS2Y9HZKeOU2vKaZolQKrywmI0qFls1qJZh/+KoSJ?= =?us-ascii?Q?YriDRpu1Nss2CELdapAQHWy23UgOZ3q7WhL4cfOq9Ec+CJUGGNsJ0Sf9yFfW?= =?us-ascii?Q?/07MEkWV4+iBAnkc40S7po31ONVDHhDa1DEJS4ncM/0PIuKaO4m+WzVaUvUJ?= =?us-ascii?Q?sxv3jQ4b26PO42ceR+pS7hpIHM3J/624vWWoFTnbb4VN5Nlv110adJaLi/b0?= =?us-ascii?Q?llLS4l7VBjPzYqi3Mkqpg0T+aDoOasRBHn5ibRHECvqQS6lyCVRKvGAXKDZN?= =?us-ascii?Q?/T8fZXWin1cd6vr1zKulEHc6rej2/cz2ufW39peyCQa62+h/22lGOLPMDhH8?= =?us-ascii?Q?41k4d4jiCNX7NPou+ciW3EhUeqIkJZDguIibndRh/jBMLCBH7Gr2XG06BGCN?= =?us-ascii?Q?VnEELhfTpAJzs2irTW7XWfwWDb/CQYNog/slR6cuEoBEkun+MKRaIsKBE1Nl?= =?us-ascii?Q?HM4ar92nVa5yxc4FLmLt+CPwLisJH5ZZF68MKyux4JsKCEbmJsLOekij22vJ?= =?us-ascii?Q?w5XHRLnLXlQ0qXK5tXfvBCZmj75OAzISTb4Qr7OGizaoeCD2JPoTfJMz8ITn?= =?us-ascii?Q?dL0FpZvKINVwerz1SxF4JwhpJ18I2TZgxaZsA6zrZyZdgr25Ge7gqtrvlHBV?= =?us-ascii?Q?Ud4nMHjFR+DatWT7+tfLayICMAtjoNmNMTD4PzQz9cvfKImkqXPCVOK9B+kM?= =?us-ascii?Q?Dlaf6fWFbMwpwWdy8Ki6CFXLra5GiovpZ9gfrz0og79nIcPzK+/MQt3ZcMin?= =?us-ascii?Q?VJD6iQVuBRkAS1aQjBh3w6xOdvPUHZ1XDjGiV5NtbUbpB8BO9V/76og4iu2l?= =?us-ascii?Q?CgrtJHgAj4cl4ffR6r6FB+CEJWozBbWI4FCbAh8WTHUkdMDY57Mc3tk8oDIU?= =?us-ascii?Q?j61kBN55xF8zZBkd3W7Dx7MHxPNVkD4lpkSNi0dap/h1HFSJSbe5nqK9TvEM?= =?us-ascii?Q?BEg5qeJyb6tY3dvzfF2Kl7nxPkD1zb1JPVy98YRt5i4ITgCFDPuqGtNnbEBz?= =?us-ascii?Q?2RoSapuJ1fYm2QzE5lPkzXo5jznYAVOpwb5V34ij6Kzpay83zOc1HljmGCmP?= =?us-ascii?Q?fhHbSZd3jr6KbtUlY3ZvXNVVqJ7kH3dIdTAMskHZdIdEDB/dQTw+BuGctIaS?= =?us-ascii?Q?I5baJ3weAWf4uh02XVc9xuT5lV4XiJH/K4QSRkibUbln0LrUgz3qBFCRtxLo?= x-ms-exchange-antispam-messagedata-1: YZtSDVle8PIVOw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14cdcdea-4f9d-4ed9-687b-08da3436d55c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2022 16:45:33.8359 (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: uNtQbtw/G8QzoOLI8Dz7lVd6OuggL57Jczf89/mCwUtqFWWSS5fv2edwFKcGmednLgLZtJi0S8s35qgxzALlXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4138 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guo Dong -----Original Message----- From: Liu, Zhiguang =20 Sent: Thursday, May 12, 2022 3:55 AM To: devel@edk2.groups.io Cc: Dong, Guo ; Ni, Ray ; Maurice Ma = ; You, Benjamin ; Rhodes, Sea= n Subject: [PATCH v2 2/3] UefiPayloadPkg: Add Serial IO device path according= to related protocol Current code follow some rules to check if the PCI device connected to a se= rial port device, but some platform or hardware doesn't follow such rule. By locating gEfiSerialIoProtocolGuid protocol, we can find the related devi= ce path. Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Cc: Sean Rhodes Signed-off-by: Zhiguang Liu --- .../PlatformBootManagerLib.inf | 1 + .../PlatformBootManagerLib/PlatformConsole.c | 146 +++++------------- .../PlatformBootManagerLib/PlatformConsole.h | 1 - 3 files changed, 41 insertions(+), 107 deletions(-) diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf index 80390e0d98..acf2880d22 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL +++ ib.inf @@ -60,6 +60,7 @@ gEfiDxeSmmReadyToLockProtocolGuid gEfiSmmAccess2ProtocolGuid gUniver= salPayloadPlatformBootManagerOverrideProtocolGuid+ gEfiSerialIoProtocolGui= d [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOutdiff --git a/Uefi= PayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c b/UefiPayloadPk= g/Library/PlatformBootManagerLib/PlatformConsole.c index 75aafebccd..5aece6636f 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c @@ -47,36 +47,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define gPnpPs2Keyboard \ PNPID_DEVICE_PATH_NODE(0x0303) -#define gUartV= endor \- { \- { \- HARDWARE_DEVICE_PATH, \- HW_VENDOR_DP, \- = { \- (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \- (UINT8) (= (sizeof (VENDOR_DEVICE_PATH)) >> 8) \- } \- }, \- EDKII_SERIAL_P= ORT_LIB_VENDOR_GUID \- }--#define gUart \- { \- { \- MESSAGING_DE= VICE_PATH, \- MSG_UART_DP, \- { \- (UINT8) (sizeof (UART_D= EVICE_PATH)), \- (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \- = } \- }, \- 0, \- 115200, \- 8, \- 1, \- 1 \- }- #define = gPcAnsiTerminal \ { \ { \@@ -92,9 +62,7 @@ SPDX-License-Identifier: B= SD-2-Clause-Patent ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode =3D gPnpPs2Keyboard; ACP= I_HID_DEVICE_PATH gPnp16550ComPortDeviceNode =3D gPnp16550ComPort;-UART_DE= VICE_PATH gUartDeviceNode =3D gUart; VENDOR_DEVICE_PATH = gTerminalTypeDeviceNode =3D gPcAnsiTerminal;-VENDOR_DEVICE_PATH gUart= DeviceVendorNode =3D gUartVendor; // // Predefined platform root brid= ge@@ -112,13 +80,11 @@ EFI_DEVICE_PATH_PROTOCOL *gPlatformRootBridges[] = =3D { BOOLEAN mDetectDisplayOnly; /**- Add IsaKeyboard to ConIn; add IsaSeria= l to ConOut, ConIn, ErrOut.+ Add IsaKeyboard to ConIn. @param[in] Devic= eHandle Handle of the LPC Bridge device. - @retval EFI_SUCCESS Console d= evices on the LPC bridge have been added to- ConOut, = ConIn, and ErrOut.-+ @retval EFI_SUCCESS IsaKeyboard on the LPC bridge ha= ve been added to ConIn. @return Error codes, due to EFI_DEVI= CE_PATH_PROTOCOL missing from DeviceHandle. **/@@ -1= 29,7 +95,6 @@ PrepareLpcBridgeDevicePath ( { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DeviceP= ath;- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; DevicePath =3D NULL; = Status =3D gBS->HandleProtocol (@@ -141,26 +106,11 @@ PrepareLpcBridge= DevicePath ( return Status; } - TempDevicePath =3D DevicePath;- // // Regist= er Keyboard // DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DE= VICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode); EfiBootManagerUpdateCon= soleVariable (ConIn, DevicePath, NULL);-- //- // Register COM1- //- Dev= icePath =3D TempDevicePath;- DevicePath =3D AppendDevicePathNode ((EFI_DEV= ICE_PATH_PROTOCOL *)NULL, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNod= e);- DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PRO= TOCOL *)&gUartDeviceNode);- DevicePath =3D AppendDevicePathNode (DevicePat= h, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);-- EfiBootManager= UpdateConsoleVariable (ConOut, DevicePath, NULL);- EfiBootManagerUpdateCon= soleVariable (ConIn, DevicePath, NULL);- EfiBootManagerUpdateConsoleVariab= le (ErrOut, DevicePath, NULL);- return EFI_SUCCESS; } @@ -291,43 +241,6 @= @ PreparePciVgaDevicePath ( return EFI_SUCCESS; } -/**- Add PCI Serial to ConOut, ConIn, ErrOut.-- = @param[in] DeviceHandle - Handle of PciIo protocol.-- @retval EFI_SUCCES= S - PCI Serial is added to ConOut, ConIn, and ErrOut.- @retval EFI_STATUS= - No PCI Serial device is added.--**/-EFI_STATUS-PreparePciSerialDeviceP= ath (- IN EFI_HANDLE DeviceHandle- )-{- EFI_STATUS Statu= s;- EFI_DEVICE_PATH_PROTOCOL *DevicePath;-- DevicePath =3D NULL;- Statu= s =3D gBS->HandleProtocol (- DeviceHandle,- = &gEfiDevicePathProtocolGuid,- (VOID *)&= DevicePath- );- if (EFI_ERROR (Status)) {- return = Status;- }-- DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE= _PATH_PROTOCOL *)&gUartDeviceNode);- DevicePath =3D AppendDevicePathNode (= DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);-- EfiBo= otManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);- EfiBootManager= UpdateConsoleVariable (ConIn, DevicePath, NULL);- EfiBootManagerUpdateCons= oleVariable (ErrOut, DevicePath, NULL);-- return EFI_SUCCESS;-}- /** For= every PCI instance execute a callback function. @@ -447,18 +360,6 @@ Detec= tAndPreparePlatformPciDevicePath ( PrepareLpcBridgeDevicePath (Handle); return EFI_SUCCESS; }= -- //- // Here we decide which Serial device to enable in PCI bus- = //- if (IS_PCI_16550SERIAL (&Pci)) {- //- // Add them to ConO= ut, ConIn, ErrOut.- //- DEBUG ((DEBUG_INFO, "Found PCI 16550 SERI= AL device\n"));- PreparePciSerialDevicePath (Handle);- return EFI= _SUCCESS;- } } //@@ -476,6 +377,39 @@ DetectAndPreparePlatformPciDe= vicePath ( return Status; } +/**+ For every Serial Io instance, add it to ConOut, = ConIn, ErrOut.++ @param[in] Handle - The Serial Io device handle+ @p= aram[in] Instance - The instance of the SerialIo protocol++ @retval EFI= _STATUS - Callback function failed.++**/+EFI_STATUS+EFIAPI+AddDevicePathFor= OneSerialIoInstance (+ IN EFI_HANDLE Handle,+ IN VOID *Instance+ = )+{+ EFI_STATUS Status;+ EFI_DEVICE_PATH_PROTOCOL *Devic= ePath;++ DevicePath =3D NULL;+ Status =3D gBS->HandleProtocol (+ = Handle,+ &gEfiDevicePathProtocolGuid,= + (VOID *)&DevicePath+ );+ Devic= ePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gT= erminalTypeDeviceNode);++ EfiBootManagerUpdateConsoleVariable (ConOut, Dev= icePath, NULL);+ EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, N= ULL);+ EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);+ r= eturn Status;+}+ /** Do platform specific PCI Device check and add them t= o ConOut, ConIn, ErrOut @@ -500,6 +434,11 @@ DetectAndPreparePlatformPciDev= icePaths ( NULL ); + VisitAllInstancesOfProtocol (+ &gEfiSerialIoProtocol= Guid,+ AddDevicePathForOneSerialIoInstance+ );+ Status =3D VisitAll= InstancesOfProtocol ( &gEfiPciIoProtocolGuid, Det= ectAndPreparePlatformPciDevicePath@@ -552,11 +491,6 @@ PlatformConsoleInit = ( VOID ) {- gUartDeviceNode.BaudRate =3D PcdGet64 (PcdUartDefaultBaudRa= te);- gUartDeviceNode.DataBits =3D PcdGet8 (PcdUartDefaultDataBits);- gUa= rtDeviceNode.Parity =3D PcdGet8 (PcdUartDefaultParity);- gUartDeviceNode= .StopBits =3D PcdGet8 (PcdUartDefaultStopBits);- ConnectRootBridge (); = //diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConso= le.h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h index 3713c21c45..6889c897ad 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h @@ -21,7 +21,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_= BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)-#define IS_PCI_16550SERIAL(_p) IS= _CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550) // // Type = definitions-- 2.32.0.windows.2