From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.9307.1632986975307678651 for ; Thu, 30 Sep 2021 00:29:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=r8Vu7jOl; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="225195663" X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="225195663" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 00:29:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="655799433" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 30 Sep 2021 00:29:34 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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.2242.12; Thu, 30 Sep 2021 00:29:33 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 00:29:33 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 30 Sep 2021 00:29:33 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.48) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 30 Sep 2021 00:29:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nrUGv8PfuTW9J6OI3/yS2U1qL134sqc3BglcS8BVJ2Ql1QGI8Z8qXY463GJ+ldP4bvk6OowGiP9WtPpePAm+Yi0EYidGiO0JaF99wErBY+tyWUTmcEMDO9Sm6RLonrY9R1qtzOsBzxqsvn9K1Wnz2qqCfS2OKDQmPdAX7vvWLYxith23XjwZN+C2LG8IwWQi+Eb6hZ2PtaLGWJw3+HAa8gb50IK2p3SOHzJna7hXff3/Kf+H9a59WCsS9mRluUvgBfzG2v+K+O9RktFwjNXN9KRfo3Ss1vakKoVuI7q21nUkoQP8NvY3F67Un8gDV0Tdo0OMKmhMD5t8nBRaYV4dBg== 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; bh=Y5sRam+m78EVlYGK7VxJyLDrriJda86yzLptdlL0tpM=; b=d9NifScX7CIW/q4gFNLVtdytfNF6lEeaeAJWq3zs+gElt19hNTM7SZW8H0AOnvHRk5nZWU1nR+UNyEGukKilERInjxN/AHQ9Ifj1Agi9sdVh7Nh6bhClpkWUInwLi67TB/bW3itltVbbzKgrGOSH75mLKoVgAOHsFZdiHIViHsZa42BN3KbkgePHonlm1ne/SwkHM7dsPi2WtOImy8jCP9Z5zcG8E2ghfPzQD9JkM1fsEUU8sHgVzC2Z9K3gixUkcIOlPaBJc4w5lYAztdGU6pHlAEVT4qryJtKPBISfWSopEd+2eZ7YQoivIsYG7RapAHgqA8TZmoFbkBmZEUjvbA== 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=Y5sRam+m78EVlYGK7VxJyLDrriJda86yzLptdlL0tpM=; b=r8Vu7jOljlKecLK7EAxTzKbF2uo7nd+D9KiB5kJUYVMlx7i3XU0yVU+geWNvY0iUE0PXXM5bPnqmD+/5A9b3jeLy1RWMxekH+QIJzUg0QeJRAM38dJrttG7pf7UIWdTbaSejL5yUVM/VZgTfd0k1LsIwck9ljiRpd3sSI8ieONY= Received: from CY4PR1101MB2072.namprd11.prod.outlook.com (2603:10b6:910:1d::15) by CY4PR11MB1301.namprd11.prod.outlook.com (2603:10b6:903:30::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.18; Thu, 30 Sep 2021 07:29:29 +0000 Received: from CY4PR1101MB2072.namprd11.prod.outlook.com ([fe80::7dc5:34b5:bbff:832f]) by CY4PR1101MB2072.namprd11.prod.outlook.com ([fe80::7dc5:34b5:bbff:832f%8]) with mapi id 15.20.4566.015; Thu, 30 Sep 2021 07:29:29 +0000 From: "Ni, Ray" To: "Dong, Guo" , "devel@edk2.groups.io" CC: "Ma, Maurice" , "You, Benjamin" Subject: Re: [`edk2-devel][PATCH] UefiPayloadPkg: Remove asm code and sharing libraries Thread-Topic: [`edk2-devel][PATCH] UefiPayloadPkg: Remove asm code and sharing libraries Thread-Index: AQHXtPW+UoELTpstkEWkJ4n8Igbxrau8LfFA Date: Thu, 30 Sep 2021 07:29:29 +0000 Message-ID: References: <20210929054903.1188-1-guo.dong@intel.com> In-Reply-To: <20210929054903.1188-1-guo.dong@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d047f19a-162d-4b8e-dca1-08d983e409f3 x-ms-traffictypediagnostic: CY4PR11MB1301: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iss1dpLt7qfOVyFziI1L5Xx81Tb7UhCVpqNhUkTn+bb4O7qruU/2lPlJ4futycQvFZkPUhOpX4jDpHRnrETWMCuFDKvKbh/lsV4BOPR3QvcEzJ8ZZvOcP69RdAHp3jpOrydpS4DSepwsPg6k6F2+Y/Zvp1mevbhIAQqKHKCrxo6XOWKF6owtLdD76ja6erWzdVo4ypcFV5ztzBXagAvLG815JGx06EwtMuUyImLN6lSwy+3VBZDnjft5Ft0vYWXApTmxPXB3W6iT9RPTV5OWuM1ukTHaK7/sJt1aQhKfOVxXE5CMvP+auTbeUCb5ARJ/7BTzlzKx6sWuiHtzKrXRfzYH/VsTpcCKpfoonQoXuDg2+7IJPBB8XCYNdQcgjQ7wjrBvSAECJJss8u1vd17fRtTfHRHX2gAWv4HLnRZ6jC1c3jR0Oo2aiLsh2lpEcr+j8FA/TezWlvj4oYtYcGnb0pO93ELedICfDlzuwMPJy2UjTrMkz7iWARZ/hKv0GCUoASxARfVrMHrNdfzYE3pGnF9zN/JUUoNPosVXGtz0krt3hABE2pmoF0eAcYwsiWqtj/ttb9q2s5pHFYN36ohBxb2ImhfZn0MVXbtXVNS6LWy3S4MLlHwEowzl9oKNiCPZLg6mcOy0DaZW3GGtsHhJGDiI50p8vwOj86ifkxeTO1YHv7yQrhUQjiJrh5kwgoYs9F1RKn3ORwunEPH96oP9LkEg3p0UzYScyyH9KWiu+xA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1101MB2072.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(6506007)(4326008)(7696005)(107886003)(53546011)(33656002)(316002)(110136005)(83380400001)(71200400001)(2906002)(66946007)(55016002)(8676002)(122000001)(26005)(19627235002)(38100700002)(9686003)(76116006)(8936002)(66446008)(64756008)(66476007)(66556008)(5660300002)(508600001)(30864003)(186003)(54906003)(52536014)(38070700005)(81973001)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qSHzvJrLgD36ZnLvJyt9XDXprnYxD7a78e+Z7M6B9jh6463Ypg+j3oaOgcjU?= =?us-ascii?Q?2TMsJ4v4NOVqo5NeihlloBbym66YmWj/u9GFO4YrD3CFKR9XkV+yJ+rvl8Pq?= =?us-ascii?Q?nofl6Wp95zoO8m4ke+00yl2CwN/j5PLWelEcbHHarbiFwENDE+mSCDSjlGXB?= =?us-ascii?Q?gIr9aRjHVpP1uzEjr3oFwsGyfgbGOfnOK2/ft4ER/X34xQatVAjEKY2QoJ2P?= =?us-ascii?Q?jMb/EHUMhFxFUrutFsoyjIUf9krAxg1GjRx42CTwAOeGgD6tSL09ZT1WUG/9?= =?us-ascii?Q?irE64/eU3uJBrXETJIvbUz6o2Mq5fRA6VjXhYzrXvNSlV+ithKvKbHF445+v?= =?us-ascii?Q?0gNA35bUo+Phk3ZvAm/yyTlZEi5dE8ia3QV0Sa8d95oZIMH6u3luVsP5cGKR?= =?us-ascii?Q?kKn5CWmVNNyM9MsAjmSJvJbv18wSJTaxc84CdNBfXtAbFRYUsbbne8xgqg1k?= =?us-ascii?Q?EeypL4aaaiJps7kWIMuy9IkR8gsheALyncQZ3GpdVO/jdC0WV69tJ6l1HLxh?= =?us-ascii?Q?Tb9SrHVnRYQLyWMTe2Qlml8aoXHGTcX/zVCYWBhVZZiXfkV2QyXdqHMcMree?= =?us-ascii?Q?7opRLOH72IfpE6IWcAQNh4WVA8RFKpEJijd+trvgweHCF/oTorh/1XnG07IT?= =?us-ascii?Q?z/2kG9Z+A2Rb8eAmyEcSN+5VTWz1Ag8+UeYOA4T6tiV/InB4e9QR56YYrnZ0?= =?us-ascii?Q?WDjGNNXCvJQ2EBWSlVqQNBYfNzVKzOJG6LjN22eAUbcHtwgPqRLCWIvFCcTU?= =?us-ascii?Q?ObSgKWjch+u6kGS6DwGOwQx2pOQ3sy9J9NwgSfUNeTXMW3qTun8J/lUFHog3?= =?us-ascii?Q?jpXFEj7vFEZC+AUIv3ejcpwnXvGrBaVF3R2GbWy6S1OSreL6tDRFTfbW6oBn?= =?us-ascii?Q?iG5BmJ/5+aKugNGwZrXV9FzIomIxzM3w6Zzz51sV9UYO0vneCPJ6Vn74d7SG?= =?us-ascii?Q?r9NkYY9+/+7J7nyPkVP4X3SPMiNI7oD2PfBbMXMJM8DjH4tF0HoXOEROftDf?= =?us-ascii?Q?AMrGwmyjDGuDEDh0eVSW5ZJ4lH1fNDFpDMgF99q6J3zftPYi167obaypn4Qz?= =?us-ascii?Q?dAayoi+RvnuA9vDz1XboGW+c095HHuePfWXgxHVKPtQsRaPDYBEA01xQ1kfp?= =?us-ascii?Q?Gh98+PSB+xdcNQ/wuX8Bx0KmEwTuJmSYhySZujMyDyg9iYukFcepFZDMt7Yz?= =?us-ascii?Q?Fz8ZiT6E9EY86CpJM/YEyFWoU7CQr/qyXBnzJnNj1gWYiuqTCy0avPunAudf?= =?us-ascii?Q?pf1upkGrwlQka6HsueI18TIrL7/rNDqtOFDzEs2TBNemFDgGRCQHQZkOln7r?= =?us-ascii?Q?X6rRTZ8pxV0waj8J70nGX6vI?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR1101MB2072.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d047f19a-162d-4b8e-dca1-08d983e409f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2021 07:29:29.0355 (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: wap3SryD708bVD8GI1JDN4kVOMWQ3uvNhzeo+Q+e2oZhx8kL59xjeakRkr2FAtNG98hnZtS6In5b9IkpDN16jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1301 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It looks much cleaner and universal payload code is not touched. Reviewed-by: Ray Ni > -----Original Message----- > From: Dong, Guo > Sent: Wednesday, September 29, 2021 1:49 PM > To: devel@edk2.groups.io > Cc: Dong, Guo ; Ni, Ray ; Ma, Mauri= ce ; You, Benjamin > > Subject: [`edk2-devel][PATCH] UefiPayloadPkg: Remove asm code and sharing= libraries >=20 > From: Guo Dong >=20 > Remove asm code used for payload entry. > Use patchable PCD instead a fixed PCD PcdPayloadStackTop to avoid > potential conflict. >=20 > Based on the removal, use same HobLib regardless UNIVERSAL_PAYLOAD. > Use same PlatformHookLib regardless UNIVERSAL_PAYLOAD. The original > PlatformHookLib was removed and UniversalPayloadPlatformHookLib was > rename to new PlatformHookLib. >=20 > Cc: Ray Ni > Cc: Maurice Ma > Cc: Benjamin You > Signed-off-by: Guo Dong > --- > UefiPayloadPkg/Include/Library/BlParseLib.h = | 5 ++--- > UefiPayloadPkg/Library/CbParseLib/CbParseLib.c = | 6 ++++-- > UefiPayloadPkg/Library/CbParseLib/CbParseLib.inf = | 4 ++-- > UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c = | 110 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------= ------------------------------------- > UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf = | 18 ++++++++++-------- > UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf = | 4 ++-- > UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.c= | 95 --------------------------------------------------- > -------------------------------------------- > UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.i= nf | 40 ---------------------------------------- > UefiPayloadPkg/UefiPayloadEntry/Ia32/SecEntry.nasm = | 46 ---------------------------------------------- > UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c = | 30 +++++++++++++++++++++++------- > UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h = | 1 + > UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf = | 5 ++--- > UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf = | 1 - > UefiPayloadPkg/UefiPayloadEntry/X64/SecEntry.nasm = | 47 ----------------------------------------------- > UefiPayloadPkg/UefiPayloadPkg.dec = | 4 ++-- > UefiPayloadPkg/UefiPayloadPkg.dsc = | 10 +--------- > 16 files changed, 105 insertions(+), 321 deletions(-) >=20 > diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h b/UefiPayloadPkg= /Include/Library/BlParseLib.h > index 20a526d15c..1244190d4e 100644 > --- a/UefiPayloadPkg/Include/Library/BlParseLib.h > +++ b/UefiPayloadPkg/Include/Library/BlParseLib.h > @@ -2,7 +2,7 @@ > This library will parse the coreboot table in memory and extract those= required >=20 > information. >=20 >=20 >=20 > - Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -16,8 +16,7 @@ > #ifndef __BOOTLOADER_PARSE_LIB__ >=20 > #define __BOOTLOADER_PARSE_LIB__ >=20 >=20 >=20 > -#define GET_BOOTLOADER_PARAMETER() (*(UINTN *)(UINTN)(PcdGet32(PcdP= ayloadStackTop) - sizeof(UINT64))) >=20 > -#define SET_BOOTLOADER_PARAMETER(Value) GET_BOOTLOADER_PARAMETER()=3DVal= ue >=20 > +#define GET_BOOTLOADER_PARAMETER() PcdGet64 (PcdBootloaderParameter= ) >=20 >=20 >=20 > typedef RETURN_STATUS \ >=20 > (*BL_MEM_INFO_CALLBACK) (MEMROY_MAP_ENTRY *MemoryMapEntry, VOID = *Param); >=20 > diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c b/UefiPayload= Pkg/Library/CbParseLib/CbParseLib.c > index 4e23cff50e..4f90687e40 100644 > --- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c > +++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c > @@ -2,7 +2,7 @@ > This library will parse the coreboot table in memory and extract those= required >=20 > information. >=20 >=20 >=20 > - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -140,6 +140,7 @@ GetParameterBase ( > UINT8 *TmpPtr; >=20 > UINT8 *CbTablePtr; >=20 > UINTN Idx; >=20 > + EFI_STATUS Status; >=20 >=20 >=20 > // >=20 > // coreboot could pass coreboot table to UEFI payload >=20 > @@ -193,7 +194,8 @@ GetParameterBase ( > return NULL; >=20 > } >=20 >=20 >=20 > - SET_BOOTLOADER_PARAMETER ((UINT32)(UINTN)CbTablePtr); >=20 > + PcdSet64S (PcdBootloaderParameter, (UINTN)CbTablePtr); >=20 > + ASSERT_EFI_STATUS (Status); >=20 >=20 >=20 > return CbTablePtr; >=20 > } >=20 > diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.inf b/UefiPaylo= adPkg/Library/CbParseLib/CbParseLib.inf > index 52e3ad2054..cf81697703 100644 > --- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.inf > +++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.inf > @@ -1,7 +1,7 @@ > ## @file >=20 > # Coreboot Table Parse Library. >=20 > # >=20 > -# Copyright (c) 2014, Intel Corporation. All rights reserved.
>=20 > +# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved. >=20 > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > # >=20 > ## >=20 > @@ -36,4 +36,4 @@ > PcdLib >=20 >=20 >=20 > [Pcd] >=20 > - gUefiPayloadPkgTokenSpaceGuid.PcdPayloadStackTop >=20 > + gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter >=20 > diff --git a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c > b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c > index d8453e5957..004fcd8b7c 100644 > --- a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c > +++ b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c > @@ -1,29 +1,34 @@ > /** @file >=20 > Platform Hook Library instance for UART device. >=20 >=20 >=20 > - Copyright (c) 2015, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 >=20 >=20 > #include >=20 > -#include >=20 > -#include >=20 > +#include >=20 > +#include >=20 > #include >=20 > -#include >=20 > #include >=20 > +#include >=20 >=20 >=20 > -typedef struct { >=20 > - UINT16 VendorId; ///< Vendor ID to match the PCI device. Th= e value 0xFFFF terminates the list of entries. >=20 > - UINT16 DeviceId; ///< Device ID to match the PCI device >=20 > - UINT32 ClockRate; ///< UART clock rate. Set to 0 for default= clock rate of 1843200 Hz >=20 > - UINT64 Offset; ///< The byte offset into to the BAR >=20 > - UINT8 BarIndex; ///< Which BAR to get the UART base address >=20 > - UINT8 RegisterStride; ///< UART register stride in bytes. Set to= 0 for default register stride of 1 byte. >=20 > - UINT16 ReceiveFifoDepth; ///< UART receive FIFO depth in bytes. Set = to 0 for a default FIFO depth of 16 bytes. >=20 > - UINT16 TransmitFifoDepth; ///< UART transmit FIFO depth in bytes. Set= to 0 for a default FIFO depth of 16 bytes. >=20 > - UINT8 Reserved[2]; >=20 > -} PCI_SERIAL_PARAMETER; >=20 > + >=20 > +/** Library Constructor >=20 > + >=20 > + @retval RETURN_SUCCESS Success. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +PlatformHookSerialPortConstructor ( >=20 > + VOID >=20 > + ) >=20 > +{ >=20 > + // Nothing to do here. This constructor is added to >=20 > + // enable the chain of constructor invocation for >=20 > + // dependent libraries. >=20 > + return RETURN_SUCCESS; >=20 > +} >=20 >=20 >=20 > /** >=20 > Performs platform specific initialization required for the CPU to acce= ss >=20 > @@ -42,52 +47,49 @@ PlatformHookSerialPortInitialize ( > VOID >=20 > ) >=20 > { >=20 > - RETURN_STATUS Status; >=20 > - UINT32 DeviceVendor; >=20 > - PCI_SERIAL_PARAMETER *SerialParam; >=20 > - SERIAL_PORT_INFO SerialPortInfo; >=20 > - >=20 > - Status =3D ParseSerialInfo (&SerialPortInfo); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > + RETURN_STATUS Status; >=20 > + UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *SerialPortInfo; >=20 > + UINT8 *GuidHob; >=20 > + UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader; >=20 >=20 >=20 > - if (SerialPortInfo.Type =3D=3D PLD_SERIAL_TYPE_MEMORY_MAPPED) { >=20 > - Status =3D PcdSetBoolS (PcdSerialUseMmio, TRUE); >=20 > - } else { //IO >=20 > - Status =3D PcdSetBoolS (PcdSerialUseMmio, FALSE); >=20 > - } >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > - Status =3D PcdSet64S (PcdSerialRegisterBase, SerialPortInfo.BaseAddr); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > + GuidHob =3D GetFirstGuidHob (&gUniversalPayloadSerialPortInfoGuid); >=20 > + if (GuidHob =3D=3D NULL) { >=20 > + return EFI_NOT_FOUND; >=20 > } >=20 >=20 >=20 > - Status =3D PcdSet32S (PcdSerialRegisterStride, SerialPortInfo.RegWidth= ); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > + GenericHeader =3D (UNIVERSAL_PAYLOAD_GENERIC_HEADER *) GET_GUID_HOB_DA= TA (GuidHob); >=20 > + if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) > GET_GUID_HOB_DATA_SIZ= E (GuidHob)) || (GenericHeader->Length > > GET_GUID_HOB_DATA_SIZE (GuidHob))) { >=20 > + return EFI_NOT_FOUND; >=20 > } >=20 >=20 >=20 > - Status =3D PcdSet32S (PcdSerialBaudRate, SerialPortInfo.Baud); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > + if (GenericHeader->Revision =3D=3D UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO_= REVISION) { >=20 > + SerialPortInfo =3D (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *) GET_GUID_H= OB_DATA (GuidHob); >=20 > + if (GenericHeader->Length < UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (= UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO, > RegisterBase)) { >=20 > + // >=20 > + // Return if can't find the Serial Port Info Hob with enough lengt= h >=20 > + // >=20 > + return EFI_NOT_FOUND; >=20 > + } >=20 >=20 >=20 > - Status =3D PcdSet32S (PcdSerialClockRate, SerialPortInfo.InputHertz); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > + Status =3D PcdSetBoolS (PcdSerialUseMmio, SerialPortInfo->UseMmio); >=20 > + if (RETURN_ERROR (Status)) { >=20 > + return Status; >=20 > + } >=20 > + Status =3D PcdSet64S (PcdSerialRegisterBase, SerialPortInfo->Registe= rBase); >=20 > + if (RETURN_ERROR (Status)) { >=20 > + return Status; >=20 > + } >=20 > + Status =3D PcdSet32S (PcdSerialRegisterStride, SerialPortInfo->Regis= terStride); >=20 > + if (RETURN_ERROR (Status)) { >=20 > + return Status; >=20 > + } >=20 > + Status =3D PcdSet32S (PcdSerialBaudRate, SerialPortInfo->BaudRate); >=20 > + if (RETURN_ERROR (Status)) { >=20 > + return Status; >=20 > + } >=20 >=20 >=20 > - if (SerialPortInfo.UartPciAddr >=3D 0x80000000) { >=20 > - DeviceVendor =3D PciRead32 (SerialPortInfo.UartPciAddr & 0x0ffff000)= ; >=20 > - SerialParam =3D PcdGetPtr(PcdPciSerialParameters); >=20 > - SerialParam->VendorId =3D (UINT16)DeviceVendor; >=20 > - SerialParam->DeviceId =3D DeviceVendor >> 16; >=20 > - SerialParam->ClockRate =3D SerialPortInfo.InputHertz; >=20 > - SerialParam->RegisterStride =3D (UINT8)SerialPortInfo.RegWidth; >=20 > + return RETURN_SUCCESS; >=20 > } >=20 >=20 >=20 > - return RETURN_SUCCESS; >=20 > + return EFI_NOT_FOUND; >=20 > } >=20 > diff --git a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf > b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf > index 3eeb94d8fa..7ac6bfa1b1 100644 > --- a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf > +++ b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf > @@ -1,7 +1,7 @@ > ## @file >=20 > -# Platform Hook Library instance for UART device. >=20 > +# Platform Hook Library instance for UART device for Universal Payload. >=20 > # >=20 > -# Copyright (c) 2015, Intel Corporation. All rights reserved.
>=20 > +# Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > # >=20 > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > # >=20 > @@ -10,29 +10,31 @@ > [Defines] >=20 > INF_VERSION =3D 0x00010005 >=20 > BASE_NAME =3D PlatformHookLib >=20 > - FILE_GUID =3D 40A2CBC6-CFB8-447b-A90E-198E88FD345= E >=20 > + FILE_GUID =3D 807E05AB-9411-429F-97F0-FE425BF6B09= 4 >=20 > MODULE_TYPE =3D BASE >=20 > VERSION_STRING =3D 1.0 >=20 > LIBRARY_CLASS =3D PlatformHookLib >=20 > - CONSTRUCTOR =3D PlatformHookSerialPortInitialize >=20 > + CONSTRUCTOR =3D PlatformHookSerialPortConstructor >=20 >=20 >=20 > [Sources] >=20 > PlatformHookLib.c >=20 >=20 >=20 > [LibraryClasses] >=20 > - BlParseLib >=20 > PcdLib >=20 > - PciLib >=20 > + BaseLib >=20 > + HobLib >=20 > + DxeHobListLib >=20 >=20 >=20 > [Packages] >=20 > MdePkg/MdePkg.dec >=20 > MdeModulePkg/MdeModulePkg.dec >=20 > UefiPayloadPkg/UefiPayloadPkg.dec >=20 >=20 >=20 > +[Guids] >=20 > + gUniversalPayloadSerialPortInfoGuid >=20 > + >=20 > [Pcd] >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## PRODUCES >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase ## PRODUCES >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## PRODUCES >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## PRODUCES >=20 > - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## PRODUCES >=20 > - gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters ## PRODUCES >=20 > diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf b/UefiPay= loadPkg/Library/SblParseLib/SblParseLib.inf > index 9ce2864f9f..665a5a8adc 100644 > --- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf > +++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf > @@ -1,7 +1,7 @@ > ## @file >=20 > # Slim Bootloader parse library. >=20 > # >=20 > -# Copyright (c) 2019, Intel Corporation. All rights reserved.
>=20 > +# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved. >=20 > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > # >=20 > ## >=20 > @@ -43,4 +43,4 @@ > gEfiGraphicsDeviceInfoHobGuid >=20 >=20 >=20 > [Pcd] >=20 > - gUefiPayloadPkgTokenSpaceGuid.PcdPayloadStackTop >=20 > + gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter >=20 > diff --git a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/Platf= ormHookLib.c > b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.= c > deleted file mode 100644 > index 004fcd8b7c..0000000000 > --- a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHook= Lib.c > +++ /dev/null > @@ -1,95 +0,0 @@ > -/** @file >=20 > - Platform Hook Library instance for UART device. >=20 > - >=20 > - Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > - SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > - >=20 > -**/ >=20 > - >=20 > -#include >=20 > -#include >=20 > -#include >=20 > -#include >=20 > -#include >=20 > -#include >=20 > - >=20 > - >=20 > -/** Library Constructor >=20 > - >=20 > - @retval RETURN_SUCCESS Success. >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -PlatformHookSerialPortConstructor ( >=20 > - VOID >=20 > - ) >=20 > -{ >=20 > - // Nothing to do here. This constructor is added to >=20 > - // enable the chain of constructor invocation for >=20 > - // dependent libraries. >=20 > - return RETURN_SUCCESS; >=20 > -} >=20 > - >=20 > -/** >=20 > - Performs platform specific initialization required for the CPU to acce= ss >=20 > - the hardware associated with a SerialPortLib instance. This function = does >=20 > - not initialize the serial port hardware itself. Instead, it initializ= es >=20 > - hardware devices that are required for the CPU to access the serial po= rt >=20 > - hardware. This function may be called more than once. >=20 > - >=20 > - @retval RETURN_SUCCESS The platform specific initialization succ= eeded. >=20 > - @retval RETURN_DEVICE_ERROR The platform specific initialization coul= d not be completed. >=20 > - >=20 > -**/ >=20 > -RETURN_STATUS >=20 > -EFIAPI >=20 > -PlatformHookSerialPortInitialize ( >=20 > - VOID >=20 > - ) >=20 > -{ >=20 > - RETURN_STATUS Status; >=20 > - UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *SerialPortInfo; >=20 > - UINT8 *GuidHob; >=20 > - UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader; >=20 > - >=20 > - GuidHob =3D GetFirstGuidHob (&gUniversalPayloadSerialPortInfoGuid); >=20 > - if (GuidHob =3D=3D NULL) { >=20 > - return EFI_NOT_FOUND; >=20 > - } >=20 > - >=20 > - GenericHeader =3D (UNIVERSAL_PAYLOAD_GENERIC_HEADER *) GET_GUID_HOB_DA= TA (GuidHob); >=20 > - if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) > GET_GUID_HOB_DATA_SIZ= E (GuidHob)) || (GenericHeader->Length > > GET_GUID_HOB_DATA_SIZE (GuidHob))) { >=20 > - return EFI_NOT_FOUND; >=20 > - } >=20 > - >=20 > - if (GenericHeader->Revision =3D=3D UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO_= REVISION) { >=20 > - SerialPortInfo =3D (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *) GET_GUID_H= OB_DATA (GuidHob); >=20 > - if (GenericHeader->Length < UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (= UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO, > RegisterBase)) { >=20 > - // >=20 > - // Return if can't find the Serial Port Info Hob with enough lengt= h >=20 > - // >=20 > - return EFI_NOT_FOUND; >=20 > - } >=20 > - >=20 > - Status =3D PcdSetBoolS (PcdSerialUseMmio, SerialPortInfo->UseMmio); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > - Status =3D PcdSet64S (PcdSerialRegisterBase, SerialPortInfo->Registe= rBase); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > - Status =3D PcdSet32S (PcdSerialRegisterStride, SerialPortInfo->Regis= terStride); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > - Status =3D PcdSet32S (PcdSerialBaudRate, SerialPortInfo->BaudRate); >=20 > - if (RETURN_ERROR (Status)) { >=20 > - return Status; >=20 > - } >=20 > - >=20 > - return RETURN_SUCCESS; >=20 > - } >=20 > - >=20 > - return EFI_NOT_FOUND; >=20 > -} >=20 > diff --git a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/Platf= ormHookLib.inf > b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.= inf > deleted file mode 100644 > index 7ac6bfa1b1..0000000000 > --- a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHook= Lib.inf > +++ /dev/null > @@ -1,40 +0,0 @@ > -## @file >=20 > -# Platform Hook Library instance for UART device for Universal Payload. >=20 > -# >=20 > -# Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > -# >=20 > -# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > -# >=20 > -## >=20 > - >=20 > -[Defines] >=20 > - INF_VERSION =3D 0x00010005 >=20 > - BASE_NAME =3D PlatformHookLib >=20 > - FILE_GUID =3D 807E05AB-9411-429F-97F0-FE425BF6B09= 4 >=20 > - MODULE_TYPE =3D BASE >=20 > - VERSION_STRING =3D 1.0 >=20 > - LIBRARY_CLASS =3D PlatformHookLib >=20 > - CONSTRUCTOR =3D PlatformHookSerialPortConstructor >=20 > - >=20 > -[Sources] >=20 > - PlatformHookLib.c >=20 > - >=20 > -[LibraryClasses] >=20 > - PcdLib >=20 > - BaseLib >=20 > - HobLib >=20 > - DxeHobListLib >=20 > - >=20 > -[Packages] >=20 > - MdePkg/MdePkg.dec >=20 > - MdeModulePkg/MdeModulePkg.dec >=20 > - UefiPayloadPkg/UefiPayloadPkg.dec >=20 > - >=20 > -[Guids] >=20 > - gUniversalPayloadSerialPortInfoGuid >=20 > - >=20 > -[Pcd] >=20 > - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## PRODUCES >=20 > - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase ## PRODUCES >=20 > - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## PRODUCES >=20 > - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## PRODUCES >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/SecEntry.nasm b/UefiPay= loadPkg/UefiPayloadEntry/Ia32/SecEntry.nasm > deleted file mode 100644 > index fa5ed159c6..0000000000 > --- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/SecEntry.nasm > +++ /dev/null > @@ -1,46 +0,0 @@ > -;-----------------------------------------------------------------------= ------- >=20 > -;* >=20 > -;* Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<= BR> >=20 > -;* SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > - >=20 > -;-----------------------------------------------------------------------= ------- >=20 > - >=20 > -#include >=20 > - >=20 > -SECTION .text >=20 > - >=20 > -extern ASM_PFX(PayloadEntry) >=20 > -extern ASM_PFX(PcdGet32 (PcdPayloadStackTop)) >=20 > - >=20 > -; >=20 > -; SecCore Entry Point >=20 > -; >=20 > -; Processor is in flat protected mode >=20 > - >=20 > -global ASM_PFX(_ModuleEntryPoint) >=20 > -ASM_PFX(_ModuleEntryPoint): >=20 > - >=20 > - ; >=20 > - ; Disable all the interrupts >=20 > - ; >=20 > - cli >=20 > - >=20 > - ; >=20 > - ; Save the bootloader parameter base address >=20 > - ; >=20 > - mov eax, [esp + 4] >=20 > - >=20 > - mov esp, FixedPcdGet32 (PcdPayloadStackTop) >=20 > - >=20 > - ; >=20 > - ; Push the bootloader parameter address onto new stack >=20 > - ; >=20 > - push 0 >=20 > - push eax >=20 > - >=20 > - ; >=20 > - ; Call into C code >=20 > - ; >=20 > - call ASM_PFX(PayloadEntry) >=20 > - jmp $ >=20 > - >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPay= loadPkg/UefiPayloadEntry/UefiPayloadEntry.c > index a12d9961f1..f2ac3d2c69 100644 > --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c > +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c > @@ -385,7 +385,7 @@ BuildGenericHob ( > **/ >=20 > EFI_STATUS >=20 > EFIAPI >=20 > -PayloadEntry ( >=20 > +_ModuleEntryPoint ( >=20 > IN UINTN BootloaderParameter >=20 > ) >=20 > { >=20 > @@ -395,13 +395,10 @@ PayloadEntry ( > UINTN HobMemBase; >=20 > UINTN HobMemTop; >=20 > EFI_PEI_HOB_POINTERS Hob; >=20 > + SERIAL_PORT_INFO SerialPortInfo; >=20 > + UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *UniversalSerialPort; >=20 >=20 >=20 > - // Call constructor for all libraries >=20 > - ProcessLibraryConstructorList (); >=20 > - >=20 > - DEBUG ((DEBUG_INFO, "GET_BOOTLOADER_PARAMETER() =3D 0x%lx\n", GET_BOOT= LOADER_PARAMETER())); >=20 > - DEBUG ((DEBUG_INFO, "sizeof(UINTN) =3D 0x%x\n", sizeof(UINTN))); >=20 > - >=20 > + PcdSet64S (PcdBootloaderParameter, BootloaderParameter); >=20 > // Initialize floating point operating environment to be compliant wit= h UEFI spec. >=20 > InitializeFloatingPointUnits (); >=20 >=20 >=20 > @@ -412,6 +409,25 @@ PayloadEntry ( >=20 >=20 > HobConstructor ((VOID *)MemBase, (VOID *)HobMemTop, (VOID *)HobMemBase= , (VOID *)HobMemTop); >=20 >=20 >=20 > + // >=20 > + // Build serial port info >=20 > + // >=20 > + Status =3D ParseSerialInfo (&SerialPortInfo); >=20 > + if (!EFI_ERROR (Status)) { >=20 > + UniversalSerialPort =3D BuildGuidHob (&gUniversalPayloadSerialPortIn= foGuid, sizeof > (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO)); >=20 > + ASSERT (UniversalSerialPort !=3D NULL); >=20 > + UniversalSerialPort->Header.Revision =3D UNIVERSAL_PAYLOAD_SERIAL_PO= RT_INFO_REVISION; >=20 > + UniversalSerialPort->Header.Length =3D sizeof (UNIVERSAL_PAYLOAD_S= ERIAL_PORT_INFO); >=20 > + UniversalSerialPort->UseMmio =3D (SerialPortInfo.Type =3D=3D= 1)?FALSE:TRUE; >=20 > + UniversalSerialPort->RegisterBase =3D SerialPortInfo.BaseAddr; >=20 > + UniversalSerialPort->BaudRate =3D SerialPortInfo.Baud; >=20 > + UniversalSerialPort->RegisterStride =3D (UINT8)SerialPortInfo.RegWi= dth; >=20 > + } >=20 > + >=20 > + // The library constructors might depend on serial port, so call it af= ter serial port hob >=20 > + ProcessLibraryConstructorList (); >=20 > + DEBUG ((DEBUG_INFO, "sizeof(UINTN) =3D 0x%x\n", sizeof(UINTN))); >=20 > + >=20 > // Build HOB based on information from Bootloader >=20 > Status =3D BuildHobFromBl (); >=20 > if (EFI_ERROR (Status)) { >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h b/UefiPay= loadPkg/UefiPayloadEntry/UefiPayloadEntry.h > index 9922b56b39..de51c2fba9 100644 > --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h > +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h > @@ -35,6 +35,7 @@ > #include >=20 > #include >=20 > #include >=20 > +#include >=20 > #include >=20 >=20 >=20 > #define LEGACY_8259_MASK_REGISTER_MASTER 0x21 >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf b/UefiP= ayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf > index 4c5170d9cc..96e4bb81f4 100644 > --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf > +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf > @@ -32,13 +32,11 @@ > X64/VirtualMemory.c >=20 > Ia32/DxeLoadFunc.c >=20 > Ia32/IdtVectorAsm.nasm >=20 > - Ia32/SecEntry.nasm >=20 >=20 >=20 > [Sources.X64] >=20 > X64/VirtualMemory.h >=20 > X64/VirtualMemory.c >=20 > X64/DxeLoadFunc.c >=20 > - X64/SecEntry.nasm >=20 >=20 >=20 > [Packages] >=20 > MdePkg/MdePkg.dec >=20 > @@ -67,6 +65,7 @@ > gUefiAcpiBoardInfoGuid >=20 > gUniversalPayloadSmbiosTableGuid >=20 > gUniversalPayloadAcpiTableGuid >=20 > + gUniversalPayloadSerialPortInfoGuid >=20 >=20 >=20 > [FeaturePcd.IA32] >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONSU= MES >=20 > @@ -87,7 +86,7 @@ >=20 >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemBase >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize >=20 > - gUefiPayloadPkgTokenSpaceGuid.PcdPayloadStackTop >=20 > + gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize >=20 >=20 >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack ## SOMET= IMES_CONSUMES >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > index e7e05b744a..928bd2e42b 100644 > --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > @@ -92,7 +92,6 @@ >=20 >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemBase >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize >=20 > - gUefiPayloadPkgTokenSpaceGuid.PcdPayloadStackTop >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize >=20 >=20 >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack ## SOMET= IMES_CONSUMES >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/SecEntry.nasm b/UefiPayl= oadPkg/UefiPayloadEntry/X64/SecEntry.nasm > deleted file mode 100644 > index 974cf77771..0000000000 > --- a/UefiPayloadPkg/UefiPayloadEntry/X64/SecEntry.nasm > +++ /dev/null > @@ -1,47 +0,0 @@ > -;-----------------------------------------------------------------------= ------- >=20 > -;* >=20 > -;* Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<= BR> >=20 > -;* SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > - >=20 > -;-----------------------------------------------------------------------= ------- >=20 > - >=20 > -#include >=20 > - >=20 > -DEFAULT REL >=20 > -SECTION .text >=20 > - >=20 > -extern ASM_PFX(PayloadEntry) >=20 > -extern ASM_PFX(PcdGet32 (PcdPayloadStackTop)) >=20 > - >=20 > -; >=20 > -; SecCore Entry Point >=20 > -; >=20 > -; Processor is in flat protected mode >=20 > - >=20 > -global ASM_PFX(_ModuleEntryPoint) >=20 > -ASM_PFX(_ModuleEntryPoint): >=20 > - >=20 > - ; >=20 > - ; Disable all the interrupts >=20 > - ; >=20 > - cli >=20 > - >=20 > - >=20 > - mov rsp, FixedPcdGet32 (PcdPayloadStackTop) >=20 > - >=20 > - ; >=20 > - ; Push the bootloader parameter address onto new stack >=20 > - ; >=20 > - push rcx >=20 > - mov rax, 0 >=20 > - push rax ; shadow space >=20 > - push rax >=20 > - push rax >=20 > - push rax >=20 > - >=20 > - ; >=20 > - ; Call into C code >=20 > - ; >=20 > - call ASM_PFX(PayloadEntry) >=20 > - jmp $ >=20 > - >=20 > diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPaylo= adPkg.dec > index 8f0a7e3f95..e5e8db8863 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.dec > +++ b/UefiPayloadPkg/UefiPayloadPkg.dec > @@ -60,8 +60,8 @@ > gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemBase|0|UINT32|0x10000001 >=20 > ## Provides the size of the payload binary in memory >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize|0|UINT32|0x10000002 >=20 > -## Payload stack top >=20 > -gUefiPayloadPkgTokenSpaceGuid.PcdPayloadStackTop|0x90000|UINT32|0x100000= 04 >=20 > +## Save bootloader parameter >=20 > +gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter|0|UINT64|0x10000004 >=20 >=20 >=20 > ## FFS filename to find the shell application. >=20 > gUefiPayloadPkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3= E, 0x9E, 0x1c, 0x4f, 0xAD, 0x65, 0xE0, 0x52, 0x68, > 0xD0, 0xB4, 0xD1 }|VOID*|0x10000005 >=20 > diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPaylo= adPkg.dsc > index fb805dc772..57b04f10be 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.dsc > +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc > @@ -169,12 +169,7 @@ > IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf >=20 > OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf >=20 > RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf >=20 > - >=20 > -!if $(UNIVERSAL_PAYLOAD) =3D=3D TRUE >=20 > HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf >=20 > -!else >=20 > - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf >=20 > -!endif >=20 >=20 >=20 > # >=20 > # UEFI & PI >=20 > @@ -217,11 +212,7 @@ > TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf >=20 > ResetSystemLib|UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.in= f >=20 > SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPo= rtLib16550.inf >=20 > -!if $(UNIVERSAL_PAYLOAD) =3D=3D TRUE >=20 > - PlatformHookLib|UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib= /PlatformHookLib.inf >=20 > -!else >=20 > PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib= .inf >=20 > -!endif >=20 > PlatformBootManagerLib|UefiPayloadPkg/Library/PlatformBootManagerLib/P= latformBootManagerLib.inf >=20 > IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf >=20 >=20 >=20 > @@ -366,6 +357,7 @@ >=20 >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LOGICA= L_PROCESSORS) >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0 >=20 > + gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter|0 >=20 >=20 >=20 > ########################################################################= ######## >=20 > # >=20 > -- > 2.32.0.windows.2