From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.61009.1638838871492233137 for ; Mon, 06 Dec 2021 17:01:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=s9y350an; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: isaac.w.oram@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10190"; a="218132520" X-IronPort-AV: E=Sophos;i="5.87,292,1631602800"; d="scan'208";a="218132520" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 17:01:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,292,1631602800"; d="scan'208";a="515213790" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga007.fm.intel.com with ESMTP; 06 Dec 2021 17:01:10 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 6 Dec 2021 17:01:09 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 6 Dec 2021 17:01:09 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.170) 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.20; Mon, 6 Dec 2021 17:01:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JksgmEDkOnlRaBb3gFdgRZq2bnq6fgxrSrYkHZSykveVTyCC8BqWgGLGtGL4OIG6/fbFewz/plv5BG/lEtMVn+pF6ATn+ZYqfPSZKEuBfeC7ucn9KQi0ZZiAb8NYhJTtB9tgXcs77ckpeFeeujd+i567FbfNlkXOk+ooGA2dgJ6ZkThckFv2Fq8iSlbe5wl4XfFgr/6Wdb/VBgCAjrtaKFAxCh6djhD4xiz8sGLvYDvPBbl4WJoIY7cpWBtTA6UKLo4aHPC5ROHeoTRFX6qTBhNNqDS0SdsFpJeavTGFK7H3q5EV4871iojjDPftQWvP0Vn8vxLCwkVK/6P2Mri4gQ== 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=81KcFOFYE2cobqTi/W/DqtdF4R+uoqu/1ydGis15P/c=; b=Wqn48YRW/WoNGapzNqSDDNYNyQGGzAt/Qwnvos+miN8UDzoNYSluAh1h1m4D7gesg3f3OdQ/BOuLA3EUu/DW3INLUwX9LJ+PEc6QpH+g3OqJG7ZtlcmPWz561QW0Vht3ASw8/KOAXdf9+qGFX1jY4oWBOJqN50CPnbdNjKK19LtBPl177ou6H5QBA/cp+7OKkuzc9D2SuP2fNdD7tHpcNvZg+N2JtYD+Gs/5phV06axz6FXczyoP9DFncorPIo5aDhzIFOSflsb/bvY9t84s4IUUnR7zh7WTkj0G2U9lbQnlcCPQjlHfedMHGcVr275ALvTVzFQ7WJ4IpzyyrwIPEw== 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=81KcFOFYE2cobqTi/W/DqtdF4R+uoqu/1ydGis15P/c=; b=s9y350angvmbH/P6ONs3vp+G/EHJtkIJxdPRISwiIdCluFsUTSCYTMKPg2D6S6yDk1hne4dHzR9r7EDOfZLUx4ITVVNOIvXkrVFxd/0aDO13iHdHX4ti+5ZJLw0MzLLTtJ6pVD0kiKqc2I4osE3nbctASs4Z1p+XMf+ajy+avpo= Received: from MW3PR11MB4747.namprd11.prod.outlook.com (2603:10b6:303:2f::11) by MWHPR11MB1885.namprd11.prod.outlook.com (2603:10b6:300:111::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 01:01:08 +0000 Received: from MW3PR11MB4747.namprd11.prod.outlook.com ([fe80::7850:1961:886:ddbe]) by MW3PR11MB4747.namprd11.prod.outlook.com ([fe80::7850:1961:886:ddbe%9]) with mapi id 15.20.4755.021; Tue, 7 Dec 2021 01:01:08 +0000 From: "Oram, Isaac W" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: "Chiu, Chasel" Subject: Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/BoardAcpiLib: Simplify implementation Thread-Topic: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/BoardAcpiLib: Simplify implementation Thread-Index: AQHX1qCRAWXahXMN00SXUCO89Sv7zKwehT2AgAfZOaA= Date: Tue, 7 Dec 2021 01:01:08 +0000 Message-ID: References: <30f645c0b6ab6d17d4d5844637b0cd15e9f19d8a.1636595644.git.isaac.w.oram@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action 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: f9567ed3-5ac8-4532-1a66-08d9b91d0df7 x-ms-traffictypediagnostic: MWHPR11MB1885:EE_ 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: 82k2EqqPCONzYOg1zOsplC2KLrh/tzO9Z/kAnXk9fVQP/1jsehdePKNRBnpAAcSESGrGy2d0R5s6t+2k/sUGWhaU4+jkU93oeCJ5yWaUs12kNvWzMtklz3H7pqiPkTWX+wFSk5h0GceNAp75VcMy529jHGP+Th39j8wcqnwPfzf8W/ZPb/tlRc7N2p5g3xE1wCEJyZSVoKVx9CSxvM7IRzUV8JSCaiYdKCklvMxcnSpKqg47SIObemey+WwIuRr1KQDqTs/sP08GX2rbWujHHT/yS5wHSjxDUIMxBKjE9TqogE5c+dbu/oZZVw4FmL2DlHc2T8GXjWHFD9AQaLZDntweCK1EeLkEudwvFTJHrsw20Y7a6e99QkAlwMwwQV/XVff5+O1PSJx5zvmpALCtQy3Coy5dmHhz66liIC9SeWaG0LhvRQCsvxi4I+nz4j4ocyW6EKyrtCBXR7GoxUad7LvxK4cO5jvnLXQYtg7itWwIgy3jJedF059fIDMMXcZTtV0AwvzJIP4lrLBRnN6u2LlmYYZxIPjvxI5hpXTxVmUbtzVT5YkFabtshvWMbaTOkHcgHwoi2a85dy/yZdAAl9n/QhSYqjsNIO03VNHhpNy9SwUDUuXw8UpMechQdD4Itur/xf5Q9G1n2adFL75FzRgp1F723je0ZkaUuDPd7uHqXz4Hw3C72VJI2c99R8GAShHyXQRlNv403wjnpGGuNw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4747.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(82960400001)(2906002)(76116006)(7696005)(8936002)(186003)(30864003)(8676002)(122000001)(6506007)(53546011)(26005)(38100700002)(66476007)(316002)(55016003)(33656002)(52536014)(64756008)(4326008)(83380400001)(71200400001)(86362001)(508600001)(107886003)(66446008)(66946007)(9686003)(38070700005)(5660300002)(110136005)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oz3PEB5sJLifPPhf8Wv25tPH+63x+vZYt8NgxAB89RAxAAdcaEf7m0oGHLta?= =?us-ascii?Q?h7//z1k3pxk1FpfmCrLmZAjKWUOs1q/TKCgaFdU+fzpU4kur4eSMUoU5XIjG?= =?us-ascii?Q?qgrC2AK8ZHd1kxjk53NRVvggAJac75kJC3ZWUf1mnRtTYpRKAIWA+aIaFvxu?= =?us-ascii?Q?plCOL60rjEwXql5OYrd7aFTrAJ20jMabjjn2znxtFp/IwiD0wjMBQ+hvf6Jy?= =?us-ascii?Q?M3+JSp3cKZe5Us0dN3mYMSVNWPtlBmG97/ENfWX8cW1/Yaqfqm+0X9upAZOR?= =?us-ascii?Q?2DYSnqKvGJ4y/n/HU/53ngfCfGY/i3m+ZVUaUp6eCI6essnUaviNCmWciL31?= =?us-ascii?Q?FQ3xjB1oEy/V98XgG+hag2ygOQZx6c4GaI+zaeMGJm+tDjVh28EQSjOJaufj?= =?us-ascii?Q?qi6+Ceor1UDcj28XS7Kte5eFVBg5amaMYPPAkUvdkMaJ6UitRxDmvp4dm9ic?= =?us-ascii?Q?glp2dglPn2RsC8Q6iC4uMSuKTVn15Wa6vXFNMO07ED7JJCZme8qru/ab5hzE?= =?us-ascii?Q?enGyIAt49CFknsshoUqWqkSPqTLwoe8kiukUnx3nRGXi2gXkHWDHcMMAxz1D?= =?us-ascii?Q?jq3TfTOWQp0IZqUqf5E8yFu0yez7GfR6er1nWXDax1d6gmm1C4KtYqWZrzlb?= =?us-ascii?Q?NNsyOhBc6lzIe33PBvz/bpgVkN+PAMK625of1NRRppt51vMfBgaEN6BMAUqA?= =?us-ascii?Q?ZT1gzhfNChIh5XAYrI96TFD+Rhim1xNhsbrCWItVbG7tKdTm6pYlTMsINbBT?= =?us-ascii?Q?KAQPZRt0oBpWRtuI78BL4i52GOHsqSFWhJbBkNZLhGdgg4y0bmVaZtbKgp1Z?= =?us-ascii?Q?XRc2Dbg7BveDuYn8T+SKQDKQguXaB54F+gvmUcXOqdJqx95aApN1aH1TPsTK?= =?us-ascii?Q?1qeyR3R4y7CG5SYHm9kwr8+BUdqFeGpmEmocc4iHUcWPDEwYaMYhtRRZFx11?= =?us-ascii?Q?OC1eHHlRi/bSsKWffywjmBdIP8Z8+aFrJdrneootXvqmr7/y95VRKRx6nq5l?= =?us-ascii?Q?7gENOXMCp+WBQuOctRdgep7x2bUqJQZBb8pg7S4/yDMQ1LLQhCicLMmcj+RW?= =?us-ascii?Q?h7lSEwXvPvMwtRvU2c5eqk4nHnoni6hy6YAvR7UG/FBh349Dh8ry8EfaVhoX?= =?us-ascii?Q?CJqMXh1ZoyIUeN5FMirt1DYeGzbhtwmpDFOg+iBpqPs3SMNBau1UR9ns65O0?= =?us-ascii?Q?5kOD8tKaae04s/A2HVFYPEv7oIxRfP2ROYMeLfkBTWKKNrgwjazSFucbbMgD?= =?us-ascii?Q?d+Q25m3f2j3AHBPSQPM5BkKdonru03h9wjZkeJLZGYCKGWJw80KAblb1uCso?= =?us-ascii?Q?nLTLkXs97O6Q48Jqw7Cz6f9Cqdy5uSa/9pqoIp1KgcaSq5ugWONv4KjHpS1L?= =?us-ascii?Q?yS2Vx+4It7NeOdg4TDNo6N2z/AAFS3xzeKoRQ7cU7dg77GIdDuGAzH3En4mP?= =?us-ascii?Q?Mt59bqb9wWD0fKhZ3gEOMlwqG98OSdtvbBx//DJPY4cGYKS6JdDntl9nzDW7?= =?us-ascii?Q?Y9kkHsMQKDoT4rbId8K3DSnN9El3FczuEXeOv2TGhUckDQuzOsF6xOjXkkVp?= =?us-ascii?Q?dTefs5NVquO6EdiJXb3o9Fv2jXNyrBRwlvbyhvZ6Wneh1wABGLD+Eom8TmfB?= =?us-ascii?Q?amflcdKYdDM+K4XOFjg+zMQ=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4747.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9567ed3-5ac8-4532-1a66-08d9b91d0df7 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2021 01:01:08.8088 (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: EYoYq1fqjzvRDQNGDyY+m8hlbltBWBEYl/3P3JkwgGZuIubHiDss8USSLvWdqO2CvR6tvO8k/xDKNdASNUBRqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1885 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed as 41dacdf4fb36b350bd199adeb9036b7d44b3d243 -----Original Message----- From: Desimone, Nathaniel L =20 Sent: Wednesday, December 1, 2021 5:09 PM To: Oram, Isaac W ; devel@edk2.groups.io Cc: Chiu, Chasel Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg= /BoardAcpiLib: Simplify implementation Reviewed-by: Nate DeSimone -----Original Message----- From: Oram, Isaac W Sent: Wednesday, November 10, 2021 6:05 PM To: devel@edk2.groups.io Cc: Oram, Isaac W ; Desimone, Nathaniel L ; Chiu, Chasel Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/Boa= rdAcpiLib: Simplify implementation Remove DXE version as the library isn't in use. Simplify the SMM library. Remove functions calling functions. Cc: Nate DeSimone Cc: Chasel Chiu Signed-off-by: Isaac Oram --- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableL= ib.c | 37 ------ Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableL= ib.inf | 44 ------- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtOlympusAcpiTa= bleLib.c | 54 -------- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAcpiEnable= Lib.c | 89 +++++++++++-- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAcpiEnable= Lib.inf | 1 - Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmSiliconAcpiEnab= leLib.c | 138 -------------------- Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc = | 7 +- 7 files changed, 77 insertions(+), 293 deletions(-) diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoa= rdAcpiTableLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/= DxeBoardAcpiTableLib.c deleted file mode 100644 index dfa0c994dc..0000000000 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiT= ableLib.c +++ /dev/null @@ -1,37 +0,0 @@ -/** @file - Platform Hook Library instances - - @copyright - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include -#include -#include -#include -#include -#include -#include -#include - -EFI_STATUS -EFIAPI -MtOlympusBoardUpdateAcpiTable ( - IN OUT EFI_ACPI_COMMON_HEADER *Table, - IN OUT EFI_ACPI_TABLE_VERSION *Version - ); - -EFI_STATUS -EFIAPI -BoardUpdateAcpiTable ( - IN OUT EFI_ACPI_COMMON_HEADER *Table, - IN OUT EFI_ACPI_TABLE_VERSION *Version - ) -{ - MtOlympusBoardUpdateAcpiTable (Table, Version); - - return EFI_SUCCESS; -} - diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoa= rdAcpiTableLib.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLi= b/DxeBoardAcpiTableLib.inf deleted file mode 100644 index 3186c6c91e..0000000000 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiT= ableLib.inf +++ /dev/null @@ -1,44 +0,0 @@ -### @file -# Platform Hook Library instance for SandyBridge Mobile/Desktop CRB. -# -# @copyright -# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
-= # -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010017 - BASE_NAME =3D DxeBoardAcpiTableLib - FILE_GUID =3D 6562E0AE-90D8-4D41-8C97-81286B4BE7D2 - VERSION_STRING =3D 1.0 - MODULE_TYPE =3D BASE - LIBRARY_CLASS =3D BoardAcpiTableLib - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC -# - -[LibraryClasses] - BaseLib - IoLib - PciLib - PcdLib -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - MinPlatformPkg/MinPlatformPkg.dec - WhitleyOpenBoardPkg/PlatformPkg.dec - WhitleySiliconPkg/WhitleySiliconPkg.dec - WhitleySiliconPkg/SiliconPkg.dec - -[Pcd] - gOemSkuTokenSpaceGuid.PcdAcpiGnvsAddress - -[Sources] - DxeMtOlympusAcpiTableLib.c - DxeBoardAcpiTableLib.c - diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtO= lympusAcpiTableLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpi= Lib/DxeMtOlympusAcpiTableLib.c deleted file mode 100644 index 09b917083c..0000000000 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtOlympusA= cpiTableLib.c +++ /dev/null @@ -1,54 +0,0 @@ -/** @file - Platform Hook Library instances - - @copyright - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -GLOBAL_REMOVE_IF_UNREFERENCED BIOS_ACPI_PARAM *mGlobalNvsArea= ; - -VOID -MtOlympusUpdateGlobalNvs ( - VOID - ) -{ - - // - // Allocate and initialize the NVS area for SMM and ASL communication. - // - mGlobalNvsArea =3D (VOID *)(UINTN)PcdGet64 (PcdAcpiGnvsAddress); - - // - // Update global NVS area for ASL and SMM init code to use - // - - -} - -EFI_STATUS -EFIAPI -MtOlympusBoardUpdateAcpiTable ( - IN OUT EFI_ACPI_COMMON_HEADER *Table, - IN OUT EFI_ACPI_TABLE_VERSION *Version - ) -{ - if (Table->Signature =3D=3D EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTI= ON_TABLE_SIGNATURE) { - MtOlympusUpdateGlobalNvs (); - } - - return EFI_SUCCESS; -} - diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoa= rdAcpiEnableLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib= /SmmBoardAcpiEnableLib.c index 09a6b00877..0f8a62460a 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAcpiE= nableLib.c +++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAc +++ piEnableLib.c @@ -15,18 +15,9 @@ #include #include #inc= lude - -EFI_STATUS -EFIAPI -SiliconEnableAcpi ( - IN BOOLEAN EnableSci - ); - -EFI_STATUS -EFIAPI -SiliconDisableAcpi ( - IN BOOLEAN DisableSci - ); +#include +#include +#include =20 EFI_STATUS EFIAPI @@ -34,7 +25,52 @@ BoardEnableAcpi ( IN BOOLEAN EnableSci ) { - SiliconEnableAcpi (EnableSci); + UINT32 SmiEn; + UINT16 Pm1En; + UINT16 Pm1Cnt; + UINT16 PchPmBase; + EFI_STATUS Status; + DYNAMIC_SI_LIBARY_SMM_PROTOCOL *DynamicSiLibrarySmmProtocol =3D NULL; + + Status =3D gSmst->SmmLocateProtocol (&gDynamicSiLibrarySmmProtocolGuid, + NULL, &DynamicSiLibrarySmmProtocol); if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + // + // Init Power Management I/O Base aka ACPI Base // PchPmBase =3D + DynamicSiLibrarySmmProtocol->PmcGetAcpiBase (); + + SmiEn =3D IoRead32 (PchPmBase + R_ACPI_IO_SMI_EN); + + // + // Disable SW SMI Timer and legacy USB // SmiEn &=3D=20 + ~(B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB |=20 + B_ACPI_IO_SMI_EN_LEGACY_USB2); + + // + // And enable SMI on write to B_PCH_ACPI_PM1_CNT_SLP_EN when SLP_TYP=20 + is written // SmiEn |=3D B_ACPI_IO_SMI_EN_ON_SLP_EN ; + IoWrite32 (PchPmBase + R_ACPI_IO_SMI_EN, SmiEn); + + // + // Disable PM sources except power button // + Pm1En =3D B_ACPI_IO_PM1_EN_PWRBTN; + IoWrite16 (PchPmBase + R_ACPI_IO_PM1_EN, Pm1En); + + // + // Enable SCI + // + if (EnableSci) { + Pm1Cnt =3D IoRead16 (PchPmBase + R_ACPI_IO_PM1_CNT); + Pm1Cnt |=3D B_ACPI_IO_PM1_CNT_SCI_EN; + IoWrite16 (PchPmBase + R_ACPI_IO_PM1_CNT, Pm1Cnt); } + return EFI_SUCCESS; } =20 @@ -44,7 +80,32 @@ BoardDisableAcpi ( IN BOOLEAN DisableSci ) { - SiliconDisableAcpi (DisableSci); + UINT16 Pm1Cnt; + UINT16 PchPmBase; + EFI_STATUS Status; + DYNAMIC_SI_LIBARY_SMM_PROTOCOL *DynamicSiLibrarySmmProtocol =3D NULL; + + Status =3D gSmst->SmmLocateProtocol (&gDynamicSiLibrarySmmProtocolGuid, + NULL, &DynamicSiLibrarySmmProtocol); if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + // + // Init Power Management I/O Base aka ACPI Base // PchPmBase =3D + DynamicSiLibrarySmmProtocol->PmcGetAcpiBase (); + + + // + // Disable SCI + // + if (DisableSci) { + Pm1Cnt =3D IoRead16 (PchPmBase + R_ACPI_IO_PM1_CNT); + Pm1Cnt &=3D ~B_ACPI_IO_PM1_CNT_SCI_EN; + IoWrite16 (PchPmBase + R_ACPI_IO_PM1_CNT, Pm1Cnt); } + return EFI_SUCCESS; } =20 diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoa= rdAcpiEnableLib.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiL= ib/SmmBoardAcpiEnableLib.inf index 19d29ed40f..fcb3e23365 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAcpiE= nableLib.inf +++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAc +++ piEnableLib.inf @@ -38,7 +38,6 @@ WhitleySiliconPkg/CpRcPkg.dec =20 [Sources] - SmmSiliconAcpiEnableLib.c SmmBoardAcpiEnableLib.c =20 [Protocols] diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmSil= iconAcpiEnableLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiL= ib/SmmSiliconAcpiEnableLib.c deleted file mode 100644 index 484311811b..0000000000 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmSiliconAcp= iEnableLib.c +++ /dev/null @@ -1,138 +0,0 @@ -/** @file - Platform Hook Library instances - - @copyright - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include -#include -#include -#include -#include -#include -#include -#inc= lude -#include -#include -#include - -/** - Clear Port 80h - - SMI handler to enable ACPI mode - - Dispatched on reads from APM port with value EFI_ACPI_ENABLE_SW_SMI - - Disables the SW SMI Timer. - ACPI events are disabled and ACPI event status is cleared. - SCI mode is then enabled. - - Clear SLP SMI status - Enable SLP SMI - - Disable SW SMI Timer - - Clear all ACPI event status and disable all ACPI events - - Disable PM sources except power button - Clear status bits - - Disable GPE0 sources - Clear status bits - - Disable GPE1 sources - Clear status bits - - Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4) - - Enable SCI -**/ -EFI_STATUS -EFIAPI -SiliconEnableAcpi ( - IN BOOLEAN EnableSci - ) -{ - UINT32 SmiEn; - UINT16 Pm1En; - UINT16 Pm1Cnt; - UINT16 PchPmBase; - EFI_STATUS Status; - DYNAMIC_SI_LIBARY_SMM_PROTOCOL *DynamicSiLibrarySmmProtocol =3D NULL; - - Status =3D gSmst->SmmLocateProtocol (&gDynamicSiLibrarySmmProtocolGuid, = NULL, &DynamicSiLibrarySmmProtocol); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - - // - // Init Power Management I/O Base aka ACPI Base - // - PchPmBase =3D DynamicSiLibrarySmmProtocol->PmcGetAcpiBase (); - - SmiEn =3D IoRead32 (PchPmBase + R_ACPI_IO_SMI_EN); - - // - // Disable SW SMI Timer and legacy USB - // - SmiEn &=3D ~(B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB | = B_ACPI_IO_SMI_EN_LEGACY_USB2); - - // - // And enable SMI on write to B_PCH_ACPI_PM1_CNT_SLP_EN when SLP_TYP is = written - // - SmiEn |=3D B_ACPI_IO_SMI_EN_ON_SLP_EN ; - IoWrite32 (PchPmBase + R_ACPI_IO_SMI_EN, SmiEn); - - // - // Disable PM sources except power button - // - Pm1En =3D B_ACPI_IO_PM1_EN_PWRBTN; - IoWrite16 (PchPmBase + R_ACPI_IO_PM1_EN, Pm1En); - - // - // Enable SCI - // - Pm1Cnt =3D IoRead16 (PchPmBase + R_ACPI_IO_PM1_CNT); - Pm1Cnt |=3D B_ACPI_IO_PM1_CNT_SCI_EN; - IoWrite16 (PchPmBase + R_ACPI_IO_PM1_CNT, Pm1Cnt); - - return EFI_SUCCESS; -} - -EFI_STATUS -EFIAPI -SiliconDisableAcpi ( - IN BOOLEAN DisableSci - ) -{ - UINT16 Pm1Cnt; - UINT16 PchPmBase; - EFI_STATUS Status; - DYNAMIC_SI_LIBARY_SMM_PROTOCOL *DynamicSiLibrarySmmProtocol =3D NULL; - - Status =3D gSmst->SmmLocateProtocol (&gDynamicSiLibrarySmmProtocolGuid, = NULL, &DynamicSiLibrarySmmProtocol); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - - // - // Init Power Management I/O Base aka ACPI Base - // - PchPmBase =3D DynamicSiLibrarySmmProtocol->PmcGetAcpiBase (); - - Pm1Cnt =3D IoRead16 (PchPmBase + R_ACPI_IO_PM1_CNT); - - // - // Disable SCI - // - Pm1Cnt &=3D ~B_ACPI_IO_PM1_CNT_SCI_EN; - - IoWrite16 (PchPmBase + R_ACPI_IO_PM1_CNT, Pm1Cnt); - - return EFI_SUCCESS; -} diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/= Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc index 63cb4dd559..ae3646df7a 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc @@ -627,10 +627,10 @@ =20 [LibraryClasses.Common.DXE_SMM_DRIVER] SpiFlashCommonLib|$(RP_PKG)/Library/SmmSpiFlashCommonLib/SmmSpiFlashComm= onLib.inf - TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestP= ointCheckLib.inf TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.in= f MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.= inf + =20 + BoardAcpiEnableLib|$(RP_PKG)/Library/BoardAcpiLib/SmmBoardAcpiEnableLi + b.inf =20 [LibraryClasses.Common.SMM_CORE] S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptL= ibNull.inf @@ -745,10 +745,7 @@ =20 $(RP_PKG)/Features/AcpiVtd/AcpiVtd.inf =20 - $(PLATFORM_PKG)/Acpi/AcpiSmm/AcpiSmm.inf { - - BoardAcpiEnableLib|$(RP_PKG)/Library/BoardAcpiLib/SmmBoardAcpiEnable= Lib.inf - } + $(PLATFORM_PKG)/Acpi/AcpiSmm/AcpiSmm.inf =20 $(PLATFORM_PKG)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf { -- 2.27.0.windows.1