From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by mx.groups.io with SMTP id smtpd.web08.1594.1658535728097942879 for ; Fri, 22 Jul 2022 17:22:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QsyZ1QFS; spf=pass (domain: gmail.com, ip: 209.85.219.51, mailfrom: benjamin.doron00@gmail.com) Received: by mail-qv1-f51.google.com with SMTP id mn11so167064qvb.9 for ; Fri, 22 Jul 2022 17:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oltT+4KTGK2qRpeBuI5mJOZuHWk58xgxrksjBsB/3HE=; b=QsyZ1QFSnlrqz50XgPnYmDN4idyhtmoSMxPFzwPz1YCa62fKR6P5EqDuJFzwsqZirk zZZhHgsTwyY+stl/b6ckw5rGyeUyJomRiAXBf/zOJk2MyBUe+gtUDvOMNNxGL9XbuHtU Jc2dKhkaFgBEuXk3DYUb2J0WYggECXWM0YCyLHwEfH42Qke5B51PUyRJuMPsjCuKW+j6 TTuU4qkT2tHUSSPNqxt+MjWlin57lddNVYeDjMfp7EvN0VY9DvpE+o64cb1zmoMMDDCm bhsGpBAP4sfe6xTaeW4XjyDf5kXbd9YTOke7oIpRHBpcc2og3tmTqB8Ura9BG8XNTY4r YA1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oltT+4KTGK2qRpeBuI5mJOZuHWk58xgxrksjBsB/3HE=; b=kS7poQYmqg5GSsN0t1n/RaHjZOsuxgn+7JJ464/qahlgrlCbJTeYfLAvJxgW7hGero haAUlHNvvZMcfU8ILNhX/3aDzI8NjKzSx5hybu47dQE9njrD9xpjXFemKoUVicYYqabx G8zDtCAm6lfsMbICN7cuQ/5e1iMs8ruSGs3EgM7Pzb70YT3uDW6PLy9pmWjF4zJ5vK8t 9c7abdrjQHU0N+jC7XRKGTuycC7jHFSl7WSgiHkJRKlat5RqiOSThVOMppKWONwT6tqG L7AfifPTrJBNiRx+/PKBty44ZRJrjYNj5wZJsMiN6cbPCMjvLg4UNqJ2im8Q4bkwE5gU 4upg== X-Gm-Message-State: AJIora9whhimFtn1awrnIcG4teYVhZbVAiiq/lNseap7hVF1OltCAVMR 8+nwXpVXSCX66C4noyo2ASaA3AR1QsE= X-Google-Smtp-Source: AGRyM1v9ubxpl+aPpsAsJqNIfQMUjEHVfbNpsU4PDlDkO8mEVDU9miBU7ttDuXRB0iEvpRxw5+5z6g== X-Received: by 2002:ad4:5761:0:b0:473:7861:69d1 with SMTP id r1-20020ad45761000000b00473786169d1mr2329891qvx.73.1658535726944; Fri, 22 Jul 2022 17:22:06 -0700 (PDT) Return-Path: Received: from aturtleortwo-benjamindomain.. ([2607:f2c0:e98c:e:39b7:8453:91b5:69bf]) by smtp.gmail.com with ESMTPSA id z8-20020ac84308000000b0031ee1f0c420sm3766705qtm.10.2022.07.22.17.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 17:22:06 -0700 (PDT) From: "Benjamin Doron" To: devel@edk2.groups.io Cc: Nate DeSimone , Ankit Sinha , Ray Ni , Rangasai V Chaganty , Isaac Oram Subject: [PATCH v1 2/5] Silicon/Intel: Port SMM Control protocol to PPI for S3 Date: Fri, 22 Jul 2022 20:19:58 -0400 Message-Id: <20220723002001.1309418-3-benjamin.doron00@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220723002001.1309418-1-benjamin.doron00@gmail.com> References: <20220723002001.1309418-1-benjamin.doron00@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable S3 resume may require communication with SMM, for which we need the SMM Control PPI. Therefore, port the DXE driver to a library, like there is for SMM Access. Tested, working on Kabylake. Further testing required after the refactor for compatibility. Cc: Nate DeSimone Cc: Ankit Sinha Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Isaac Oram Signed-off-by: Benjamin Doron --- Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseIntelCompatShimLibCfl/BaseI= ntelCompatShimLibCfl.c | 28 ++ Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseIntelCompatShimLibCfl/BaseI= ntelCompatShimLibCfl.inf | 24 ++ Silicon/Intel/IntelSiliconPkg/Feature/SmmControl/Library/PeiSmmControlLib/= PeiSmmControlLib.c | 309 ++++++++++++++++++++ Silicon/Intel/IntelSiliconPkg/Feature/SmmControl/Library/PeiSmmControlLib/= PeiSmmControlLib.inf | 36 +++ Silicon/Intel/IntelSiliconPkg/Include/Library/IntelCompatShimLib.h = | 23 ++ Silicon/Intel/IntelSiliconPkg/Include/Library/SmmControlLib.h = | 26 ++ Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec = | 4 + Silicon/Intel/KabylakeSiliconPkg/Library/BaseIntelCompatShimLibKbl/BaseInt= elCompatShimLibKbl.c | 27 ++ Silicon/Intel/KabylakeSiliconPkg/Library/BaseIntelCompatShimLibKbl/BaseInt= elCompatShimLibKbl.inf | 24 ++ 9 files changed, 501 insertions(+) diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseIntelCompatShim= LibCfl/BaseIntelCompatShimLibCfl.c b/Silicon/Intel/CoffeelakeSiliconPkg/Lib= rary/BaseIntelCompatShimLibCfl/BaseIntelCompatShimLibCfl.c new file mode 100644 index 000000000000..ee8592e7d9bf --- /dev/null +++ b/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseIntelCompatShimLibCfl/= BaseIntelCompatShimLibCfl.c @@ -0,0 +1,28 @@ +/** @file + Library description file for compatibility shim on Coffeelake+ + + Copyright (c) 2022, Baruch Binyamin Doron
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + Get PCH ACPI base address. + + @param[out] Address Address of ACPI base address. + + @retval EFI_SUCCESS Successfully completed. + @retval EFI_INVALID_PARAMETER Invalid pointer passed. +**/ +EFI_STATUS +EFIAPI +CompatShimGetAcpiBase ( + OUT UINT16 *Address + ) +{ + *Address =3D PmcGetAcpiBase (); + return EFI_SUCCESS; +} diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseIntelCompatShim= LibCfl/BaseIntelCompatShimLibCfl.inf b/Silicon/Intel/CoffeelakeSiliconPkg/L= ibrary/BaseIntelCompatShimLibCfl/BaseIntelCompatShimLibCfl.inf new file mode 100644 index 000000000000..0d3ae7c4e733 --- /dev/null +++ b/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseIntelCompatShimLibCfl/= BaseIntelCompatShimLibCfl.inf @@ -0,0 +1,24 @@ +## @file +# Library description file for a Kabylake compatibility shim +# +# Copyright (c) 2022, Baruch Binyamin Doron
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] +INF_VERSION =3D 0x00010017 +BASE_NAME =3D BaseIntelCompatShimLibCfl +FILE_GUID =3D 3D0BB32E-D328-4615-ADFC-782CECC68D53 +VERSION_STRING =3D 1.0 +MODULE_TYPE =3D BASE +LIBRARY_CLASS =3D IntelCompatShimLib + +[LibraryClasses] +PmcLib + +[Packages] +CoffeelakeSiliconPkg/SiPkg.dec + +[Sources] +BaseIntelCompatShimLibCfl.c diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmControl/Library/PeiSm= mControlLib/PeiSmmControlLib.c b/Silicon/Intel/IntelSiliconPkg/Feature/SmmC= ontrol/Library/PeiSmmControlLib/PeiSmmControlLib.c new file mode 100644 index 000000000000..66d8ad49b2d5 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmControl/Library/PeiSmmContro= lLib/PeiSmmControlLib.c @@ -0,0 +1,309 @@ +/** @file=0D + This is to publish the SMM Control Ppi instance.=0D +=0D + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include =0D +#include =0D +=0D +#define SMM_CONTROL_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('i', '4', 's', '= c')=0D +=0D +typedef struct {=0D + UINTN Signature;=0D + EFI_HANDLE Handle;=0D + EFI_PEI_MM_CONTROL_PPI SmmControl;=0D +} SMM_CONTROL_PRIVATE_DATA;=0D +=0D +#define SMM_CONTROL_PRIVATE_DATA_FROM_THIS(a) \=0D + CR (a, \=0D + SMM_CONTROL_PRIVATE_DATA, \=0D + SmmControl, \=0D + SMM_CONTROL_DEV_SIGNATURE \=0D + )=0D +=0D +//=0D +// Common registers:=0D +//=0D +//=0D +// APM Registers=0D +//=0D +#define R_PCH_APM_CNT 0xB2=0D +//=0D +// ACPI and legacy I/O register offsets from ACPIBASE=0D +//=0D +#define R_PCH_ACPI_PM1_STS 0x00=0D +#define B_PCH_ACPI_PM1_STS_PRBTNOR BIT11=0D +=0D +#define R_PCH_SMI_EN 0x30=0D +=0D +#define R_PCH_SMI_STS 0x34=0D +#define B_PCH_SMI_STS_APM BIT5=0D +#define B_PCH_SMI_EN_APMC BIT5=0D +#define B_PCH_SMI_EN_EOS BIT1=0D +#define B_PCH_SMI_EN_GBL_SMI BIT0=0D +=0D +/**=0D + Trigger the software SMI=0D +=0D + @param[in] Data The value to be set on the software SMI = data port=0D +=0D + @retval EFI_SUCCESS Function completes successfully=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmTrigger (=0D + UINT8 Data=0D + )=0D +{=0D + UINT16 ABase;=0D + UINT32 OutputData;=0D + UINT32 OutputPort;=0D +=0D + CompatShimGetAcpiBase (&ABase);=0D +=0D + ///=0D + /// Enable the APMC SMI=0D + ///=0D + OutputPort =3D ABase + R_PCH_SMI_EN;=0D + OutputData =3D IoRead32 ((UINTN) OutputPort);=0D + OutputData |=3D (B_PCH_SMI_EN_APMC | B_PCH_SMI_EN_GBL_SMI);=0D + DEBUG (=0D + (DEBUG_EVENT,=0D + "The SMI Control Port at address %x will be written to %x.\n",=0D + OutputPort,=0D + OutputData)=0D + );=0D + IoWrite32 (=0D + (UINTN) OutputPort,=0D + (UINT32) (OutputData)=0D + );=0D +=0D + OutputPort =3D R_PCH_APM_CNT;=0D + OutputData =3D Data;=0D +=0D + ///=0D + /// Generate the APMC SMI=0D + ///=0D + IoWrite8 (=0D + (UINTN) OutputPort,=0D + (UINT8) (OutputData)=0D + );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + Clear the SMI status=0D +=0D +=0D + @retval EFI_SUCCESS The function completes successfully=0D + @retval EFI_DEVICE_ERROR Something error occurred=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmClear (=0D + VOID=0D + )=0D +{=0D + UINT16 ABase;=0D + UINT32 OutputData;=0D + UINT32 OutputPort;=0D +=0D + CompatShimGetAcpiBase (&ABase);=0D +=0D + ///=0D + /// Clear the Power Button Override Status Bit, it gates EOS from being = set.=0D + ///=0D + OutputPort =3D ABase + R_PCH_ACPI_PM1_STS;=0D + OutputData =3D B_PCH_ACPI_PM1_STS_PRBTNOR;=0D + DEBUG (=0D + (DEBUG_EVENT,=0D + "The PM1 Status Port at address %x will be written to %x.\n",=0D + OutputPort,=0D + OutputData)=0D + );=0D + IoWrite16 (=0D + (UINTN) OutputPort,=0D + (UINT16) (OutputData)=0D + );=0D +=0D + ///=0D + /// Clear the APM SMI Status Bit=0D + ///=0D + OutputPort =3D ABase + R_PCH_SMI_STS;=0D + OutputData =3D B_PCH_SMI_STS_APM;=0D + DEBUG (=0D + (DEBUG_EVENT,=0D + "The SMI Status Port at address %x will be written to %x.\n",=0D + OutputPort,=0D + OutputData)=0D + );=0D + IoWrite32 (=0D + (UINTN) OutputPort,=0D + (UINT32) (OutputData)=0D + );=0D +=0D + ///=0D + /// Set the EOS Bit=0D + ///=0D + OutputPort =3D ABase + R_PCH_SMI_EN;=0D + OutputData =3D IoRead32 ((UINTN) OutputPort);=0D + OutputData |=3D B_PCH_SMI_EN_EOS;=0D + DEBUG (=0D + (DEBUG_EVENT,=0D + "The SMI Control Port at address %x will be written to %x.\n",=0D + OutputPort,=0D + OutputData)=0D + );=0D + IoWrite32 (=0D + (UINTN) OutputPort,=0D + (UINT32) (OutputData)=0D + );=0D +=0D + ///=0D + /// There is no need to read EOS back and check if it is set.=0D + /// This can lead to a reading of zero if an SMI occurs right after the = SMI_EN port read=0D + /// but before the data is returned to the CPU.=0D + /// SMM Dispatcher should make sure that EOS is set after all SMI source= s are processed.=0D + ///=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + This routine generates an SMI=0D +=0D + @param[in] This The EFI SMM Control protocol insta= nce=0D + @param[in, out] ArgumentBuffer The buffer of argument=0D + @param[in, out] ArgumentBufferSize The size of the argument buffer=0D + @param[in] Periodic Periodic or not=0D + @param[in] ActivationInterval Interval of periodic SMI=0D +=0D + @retval EFI Status Describing the result of the opera= tion=0D + @retval EFI_INVALID_PARAMETER Some parameter value passed is not= supported=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +Activate (=0D + IN EFI_PEI_SERVICES **PeiServices,=0D + IN EFI_PEI_MM_CONTROL_PPI * This,=0D + IN OUT INT8 *ArgumentBuffer OPTIONAL,=0D + IN OUT UINTN *ArgumentBufferSize OPTIONAL,=0D + IN BOOLEAN Periodic OPTIONAL,=0D + IN UINTN ActivationInterval OPTIONAL=0D + )=0D +{=0D + EFI_STATUS Status;=0D + UINT8 Data;=0D +=0D + if (Periodic) {=0D + DEBUG ((DEBUG_WARN, "Invalid parameter\n"));=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + // NOTE: Copied from Quark. Matches the usage in PiSmmCommunicationPei=0D + if (ArgumentBuffer =3D=3D NULL) {=0D + Data =3D 0xFF;=0D + } else {=0D + if (ArgumentBufferSize =3D=3D NULL || *ArgumentBufferSize !=3D 1) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Data =3D *ArgumentBuffer;=0D + }=0D + ///=0D + /// Clear any pending the APM SMI=0D + ///=0D + Status =3D SmmClear ();=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + return SmmTrigger (Data);=0D +}=0D +=0D +/**=0D + This routine clears an SMI=0D +=0D + @param[in] This The EFI SMM Control protocol instance=0D + @param[in] Periodic Periodic or not=0D +=0D + @retval EFI Status Describing the result of the operation=0D + @retval EFI_INVALID_PARAMETER Some parameter value passed is not suppo= rted=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +Deactivate (=0D + IN EFI_PEI_SERVICES **PeiServices,=0D + IN EFI_PEI_MM_CONTROL_PPI * This,=0D + IN BOOLEAN Periodic OPTIONAL=0D + )=0D +{=0D + if (Periodic) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + return SmmClear ();=0D +}=0D +=0D +/**=0D + This function is to install an SMM Control PPI=0D + - Introduction \n=0D + An API to install an instance of EFI_PEI_MM_CONTROL_PPI. This PPI prov= ides a standard=0D + way for other modules to trigger software SMIs.=0D +=0D + @retval EFI_SUCCESS - Ppi successfully started and installed= .=0D + @retval EFI_NOT_FOUND - Ppi can't be found.=0D + @retval EFI_OUT_OF_RESOURCES - Ppi does not have enough resources to = initialize the driver.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PeiInstallSmmControlPpi (=0D + VOID=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_PEI_PPI_DESCRIPTOR *PpiList;=0D + SMM_CONTROL_PRIVATE_DATA *SmmControlPrivate;=0D +=0D + //=0D + // Initialize private data=0D + //=0D + SmmControlPrivate =3D AllocateZeroPool (sizeof (*SmmControlPrivate));=0D + ASSERT (SmmControlPrivate !=3D NULL);=0D + if (SmmControlPrivate =3D=3D NULL) {=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D + PpiList =3D AllocateZeroPool (sizeof (*PpiList));=0D + ASSERT (PpiList !=3D NULL);=0D + if (PpiList =3D=3D NULL) {=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + SmmControlPrivate->Signature =3D SMM_CONTROL_PRIVATE_DATA_SIGNATURE;=0D + SmmControlPrivate->Handle =3D NULL;=0D +=0D + SmmControlPrivate->SmmControl.Trigger =3D Activate;=0D + SmmControlPrivate->SmmControl.Clear =3D Deactivate;=0D +=0D + //=0D + // Install PPI=0D + //=0D + PpiList->Flags =3D (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR= _TERMINATE_LIST);=0D + PpiList->Guid =3D &gEfiPeiMmControlPpiGuid;=0D + PpiList->Ppi =3D &SmmControlPrivate->SmmControl;=0D +=0D + Status =3D PeiServicesInstallPpi (PpiList);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D + // Unlike driver, do not disable SMIs as S3 resume continues=0D + return EFI_SUCCESS;=0D +}=0D diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmControl/Library/PeiSm= mControlLib/PeiSmmControlLib.inf b/Silicon/Intel/IntelSiliconPkg/Feature/Sm= mControl/Library/PeiSmmControlLib/PeiSmmControlLib.inf new file mode 100644 index 000000000000..e0d2d1f55270 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmControl/Library/PeiSmmContro= lLib/PeiSmmControlLib.inf @@ -0,0 +1,36 @@ +## @file=0D +# Library description file for SmmControl PPI=0D +#=0D +# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D +INF_VERSION =3D 0x00010017=0D +BASE_NAME =3D PeiSmmControlLib=0D +FILE_GUID =3D f45d521a-c0df-4283-a3ca-65ad01b479e7=0D +VERSION_STRING =3D 1.0=0D +MODULE_TYPE =3D PEIM=0D +LIBRARY_CLASS =3D SmmControlLib=0D +=0D +=0D +[LibraryClasses]=0D +IntelCompatShimLib=0D +IoLib=0D +DebugLib=0D +MemoryAllocationLib=0D +PeiServicesLib=0D +=0D +=0D +[Packages]=0D +MdePkg/MdePkg.dec=0D +IntelSiliconPkg/IntelSiliconPkg.dec=0D +=0D +=0D +[Sources]=0D +PeiSmmControlLib.c=0D +=0D +=0D +[Ppis]=0D +gEfiPeiMmControlPpiGuid ## PRODUCES=0D diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/IntelCompatShimL= ib.h b/Silicon/Intel/IntelSiliconPkg/Include/Library/IntelCompatShimLib.h new file mode 100644 index 000000000000..d4455feb1aaf --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/IntelCompatShimLib.h @@ -0,0 +1,23 @@ +/** @file + Library description file for compatibility shim + + Copyright (c) 2022, Baruch Binyamin Doron
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +/** + Get PCH ACPI base address. + + @param[out] Address Address of ACPI base address. + + @retval EFI_SUCCESS Successfully completed. + @retval EFI_INVALID_PARAMETER Invalid pointer passed. +**/ +EFI_STATUS +EFIAPI +CompatShimGetAcpiBase ( + OUT UINT16 *Address + ); diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmControlLib.h = b/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmControlLib.h new file mode 100644 index 000000000000..b532dd13f373 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmControlLib.h @@ -0,0 +1,26 @@ +/** @file=0D + This is to publish the SMM Control Ppi instance.=0D +=0D + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +#ifndef _SMM_CONTROL_LIB_H_=0D +#define _SMM_CONTROL_LIB_H_=0D +=0D +/**=0D + This function is to install an SMM Control PPI=0D + - Introduction \n=0D + An API to install an instance of EFI_PEI_MM_CONTROL_PPI. This PPI prov= ides a standard=0D + way for other modules to trigger software SMIs.=0D +=0D + @retval EFI_SUCCESS - Ppi successfully started and installed= .=0D + @retval EFI_NOT_FOUND - Ppi can't be found.=0D + @retval EFI_OUT_OF_RESOURCES - Ppi does not have enough resources to = initialize the driver.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PeiInstallSmmControlPpi (=0D + VOID=0D + );=0D +#endif=0D diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index c36d130a0197..fc27b394d267 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -35,6 +35,10 @@ #=0D SmmAccessLib|Include/Library/SmmAccessLib.h=0D =0D + ## @libraryclass Provides services to trigger SMI=0D + #=0D + SmmControlLib|Include/Library/SmmControlLib.h=0D +=0D ## @libraryclass Provides services to access config block=0D #=0D ConfigBlockLib|Include/Library/ConfigBlockLib.h=0D diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/BaseIntelCompatShimLi= bKbl/BaseIntelCompatShimLibKbl.c b/Silicon/Intel/KabylakeSiliconPkg/Library= /BaseIntelCompatShimLibKbl/BaseIntelCompatShimLibKbl.c new file mode 100644 index 000000000000..af1549a860f0 --- /dev/null +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/BaseIntelCompatShimLibKbl/Ba= seIntelCompatShimLibKbl.c @@ -0,0 +1,27 @@ +/** @file + Library description file for compatibility shim on Kabylake + + Copyright (c) 2022, Baruch Binyamin Doron
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + Get PCH ACPI base address. + + @param[out] Address Address of ACPI base address. + + @retval EFI_SUCCESS Successfully completed. + @retval EFI_INVALID_PARAMETER Invalid pointer passed. +**/ +EFI_STATUS +EFIAPI +CompatShimGetAcpiBase ( + OUT UINT16 *Address + ) +{ + return PchAcpiBaseGet(Address); +} diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/BaseIntelCompatShimLi= bKbl/BaseIntelCompatShimLibKbl.inf b/Silicon/Intel/KabylakeSiliconPkg/Libra= ry/BaseIntelCompatShimLibKbl/BaseIntelCompatShimLibKbl.inf new file mode 100644 index 000000000000..dd7c7baf8624 --- /dev/null +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/BaseIntelCompatShimLibKbl/Ba= seIntelCompatShimLibKbl.inf @@ -0,0 +1,24 @@ +## @file +# Library description file for a Kabylake compatibility shim +# +# Copyright (c) 2022, Baruch Binyamin Doron
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] +INF_VERSION =3D 0x00010017 +BASE_NAME =3D BaseIntelCompatShimLibKbl +FILE_GUID =3D B4A2193E-CF3E-46E6-8617-49E48143B5AB +VERSION_STRING =3D 1.0 +MODULE_TYPE =3D BASE +LIBRARY_CLASS =3D IntelCompatShimLib + +[LibraryClasses] +PchCycleDecodingLib + +[Packages] +KabylakeSiliconPkg/SiPkg.dec + +[Sources] +BaseIntelCompatShimLibKbl.c --=20 2.36.1