From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zailiang.sun@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Sun, 30 Jun 2019 21:06:40 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2019 21:06:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,437,1557212400"; d="scan'208";a="165225154" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 30 Jun 2019 21:06:38 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 30 Jun 2019 21:06:37 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.134]) with mapi id 14.03.0439.000; Mon, 1 Jul 2019 12:06:35 +0800 From: "Sun, Zailiang" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Qian, Yi" Subject: Re: [edk2-platforms Patch 01/14] Vlv2DeviceRefCodePkg: Add gEfiSmmIchnDispatchProtocolGuid Thread-Topic: [edk2-platforms Patch 01/14] Vlv2DeviceRefCodePkg: Add gEfiSmmIchnDispatchProtocolGuid Thread-Index: AQHVL7iHT4LhCz2I3kSsO3ABoUbrlKa1JSWA Date: Mon, 1 Jul 2019 04:06:35 +0000 Message-ID: <7CB7EF03E15B5D48981329A508747A9850C904AD@SHSMSX104.ccr.corp.intel.com> References: <20190701025553.18596-1-michael.d.kinney@intel.com> <20190701025553.18596-2-michael.d.kinney@intel.com> In-Reply-To: <20190701025553.18596-2-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zailiang.sun@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-By: Zailiang Sun -----Original Message----- From: Kinney, Michael D=20 Sent: Monday, July 01, 2019 10:56 AM To: devel@edk2.groups.io Cc: Sun, Zailiang ; Qian, Yi Subject: [edk2-platforms Patch 01/14] Vlv2DeviceRefCodePkg: Add gEfiSmmIchn= DispatchProtocolGuid * Add the gEfiSmmIchnDispatchProtocolGuid from the IntelFrameworkPkg to the Si specific Vlv2TbltDevicePkg. This removes a dependency on the IntelFrameworkPkg and adds a Si specific protocol to a Si package. Cc: Zailiang Sun Cc: Yi Qian Signed-off-by: Michael D Kinney --- .../Include/Protocol/SmmIchnDispatch.h | 183 ++++++++++++++++++ .../Vlv2DeviceRefCodePkg.dec | 5 +- 2 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 Sil= icon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispatch.h diff --git a/Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDis= patch.h b/Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispat= ch.h new file mode 100644 index 0000000000..3cf86c0ff9 --- /dev/null +++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispatc +++ h.h @@ -0,0 +1,183 @@ +/** @file + Provides the parent dispatch service for a given SMI source generator. + The EFI_SMM_ICHN_DISPATCH_PROTOCOL provides the ability to install=20 +child handlers for + the given event types. + +Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + This Protocol is defined in Framework of EFI SMM Core Interface Spec =20 + Version 0.9. + +**/ + +#ifndef _EFI_SMM_ICHN_DISPATCH_H_ +#define _EFI_SMM_ICHN_DISPATCH_H_ + + +// +// Global ID for the ICH SMI Protocol +// +#define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \ + { \ + 0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10,=20 +0x85, 0xcc } \ + } + +typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL =20 +EFI_SMM_ICHN_DISPATCH_PROTOCOL; + +// +// Related Definitions +// +// +// ICHN Specific SMIs. These are miscellaneous SMI sources that are=20 +supported by the // ICHN specific SMI implementation. These may change=20 +over time. TrapNumber is only // valid if the Type is Trap. +// +typedef enum { + // + // NOTE: NEVER delete items from this list/enumeration! Doing so=20 +will prevent other versions + // of the code from compiling. If the ICH version your driver is=20 +written for doesn't support + // some of these SMIs, then simply return EFI_UNSUPPORTED when a=20 +child/client tries to register + // for them. + // + IchnMch, + IchnPme, + IchnRtcAlarm, + IchnRingIndicate, + IchnAc97Wake, + IchnSerialIrq, + IchnY2KRollover, + IchnTcoTimeout, + IchnOsTco, + IchnNmi, + IchnIntruderDetect, + IchnBiosWp, + IchnMcSmi, + IchnPmeB0, + IchnThrmSts, + IchnSmBus, + IchnIntelUsb2, + IchnMonSmi7, + IchnMonSmi6, + IchnMonSmi5, + IchnMonSmi4, + IchnDevTrap13, + IchnDevTrap12, + IchnDevTrap11, + IchnDevTrap10, + IchnDevTrap9, + IchnDevTrap8, + IchnDevTrap7, + IchnDevTrap6, + IchnDevTrap5, + IchnDevTrap3, + IchnDevTrap2, + IchnDevTrap1, + IchnDevTrap0, + IchnIoTrap3, + IchnIoTrap2, + IchnIoTrap1, + IchnIoTrap0, + IchnPciExpress, + IchnMonitor, + IchnSpi, + IchnQRT, + IchnGpioUnlock, + // + // INSERT NEW ITEMS JUST BEFORE THIS LINE + // + NUM_ICHN_TYPES // the number of items in this enumeration }=20 +EFI_SMM_ICHN_SMI_TYPE; + +typedef struct { + EFI_SMM_ICHN_SMI_TYPE Type; +} EFI_SMM_ICHN_DISPATCH_CONTEXT; + +// +// Member functions +// +/** + Dispatch function for a ICHN specific SMI handler. + + @param DispatchHandle The handle of this dispatch function. + @param DispatchContext The pointer to the dispatch function's con= text. + The DispatchContext fields are filled in + by the dispatching driver prior to + invoking this dispatch function. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_SMM_ICHN_DISPATCH)( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext + ); + +/** + Register a child SMI source dispatch function with a parent SMM driver. + + @param This The pointer to the EFI_SMM_ICHN_DISPATCH_P= ROTOCOL instance. + @param DispatchFunction The function to install. + @param DispatchContext The pointer to the dispatch function's con= text. + The caller fills in this context before ca= lling + the register function to indicate to the r= egister + function the ICHN SMI source for which the= dispatch + function should be invoked. + @param DispatchHandle The handle generated by the dispatcher to = track the function + instance. + + @retval EFI_SUCCESS The dispatch function has been successfull= y + registered and the SMI source has been ena= bled. + @retval EFI_DEVICE_ERROR The driver could not enable the SMI source= . + @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manag= e this + child. + @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The ICHN input= value + is not within valid range. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_ICHN_REGISTER)( + IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This, + IN EFI_SMM_ICHN_DISPATCH DispatchFunction, + IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle + ); + +/** + Unregister a child SMI source dispatch function with a parent SMM=20 +driver + + @param This The pointer to the EFI_SMM_ICHN_DISPATCH_P= ROTOCOL instance. + @param DispatchHandle The handle of the service to remove. + + @retval EFI_SUCCESS The dispatch function has been successfull= y + unregistered, and the SMI source has been = disabled, + if there are no other registered child dis= patch + functions for this SMI source. + @retval EFI_INVALID_PARAMETER The handle is invalid. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_ICHN_UNREGISTER)( + IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle + ); + +// +// Interface structure for the SMM ICHN specific SMI Dispatch Protocol=20 +// +/** + Provides the parent dispatch service for a given SMI source generator. +**/ +struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL { + EFI_SMM_ICHN_REGISTER Register; ///< Installs a child service to b= e dispatched by this protocol. + EFI_SMM_ICHN_UNREGISTER UnRegister; ///< Removes a child service dispa= tched by this protocol. +}; + +extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid; + +#endif diff --git a/Silicon/Intel/Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec b/= Silicon/Intel/Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec index 6117f179ba..1af1ed757c 100644 --- a/Silicon/Intel/Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec +++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec @@ -1,6 +1,6 @@ ## @file Vlv2DeviceRefCodePkg.dec # -# Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved +# Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -32,7 +32,7 @@ [Ppis] gEfiPeiReadOnlyVariable2PpiGuid =3D { 0x2ab86ef5, 0xecb5, 0x4134, = {0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4}} gPchPeiInitPpiGuid =3D { 0xACB93B08, 0x5CDC, 0x4A8F, = {0x93, 0xD4, 0x6, 0xE3, 0x42, 0xDF, 0x18, 0x2E}} gPttPassThruPpiGuid =3D { 0xc5068bac, 0xa7dc, 0x42f1, = {0xae, 0x80, 0xca, 0xa2, 0x4b, 0xb4, 0x90, 0x4b}} - =20 + [Protocols] gEfiGlobalNvsAreaProtocolGuid =3D { 0x074e1e48, 0x8132, 0x47a1, = {0x8c, 0x2c, 0x3f, 0x14, 0xad, 0x9a, 0x66, 0xdc}} gPpmPlatformPolicyProtocolGuid =3D { 0xddabfeac, 0xef63, 0x452c, = {0x8f, 0x39, 0xed, 0x7f, 0xae, 0xd8, 0x26, 0x5e}} @@ -41,6 +41,7 @@ [Protocols] gEfiSdHostIoProtocolGuid =3D { 0xb63f8ec7, 0xa9c9, 0x4472, = {0xa4, 0xc0, 0x4d, 0x8b, 0xf3, 0x65, 0xcc, 0x51}} gEfiSpiProtocolGuid =3D { 0x1156efc6, 0xea32, 0x4396, = {0xb5, 0xd5, 0x26, 0x93, 0x2e, 0x83, 0xc3, 0x13}} gEfiSmmSpiProtocolGuid =3D { 0xD9072C35, 0xEB8F, 0x43AD, = {0xA2, 0x20, 0x34, 0xD4, 0x0E, 0x2A, 0x82, 0x85}} + gEfiSmmIchnDispatchProtocolGuid =3D { 0xc50b323e, 0x9075, 0x4f2a, = { 0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc}} gEfiSmmIchnDispatchExProtocolGuid =3D { 0x3920405B, 0xC897, 0x44DA, = {0x88, 0xF3, 0x4C, 0x49, 0x8A, 0x6F, 0xF7, 0x36}} gEfiPchS3SupportProtocolGuid =3D { 0xE287D20B, 0xD897, 0x4E1E, = {0xA5, 0xD9, 0x97, 0x77, 0x63, 0x93, 0x6A, 0x04}} gPchResetProtocolGuid =3D { 0xDB63592C, 0xB8CC, 0x44C8, = {0x91, 0x8C, 0x51, 0xF5, 0x34, 0x59, 0x8A, 0x5A}} -- 2.21.0.windows.1