public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Zailiang Sun <zailiang.sun@intel.com>, Yi Qian <yi.qian@intel.com>
Subject: [edk2-platforms Patch 01/14] Vlv2DeviceRefCodePkg: Add gEfiSmmIchnDispatchProtocolGuid
Date: Sun, 30 Jun 2019 19:55:40 -0700	[thread overview]
Message-ID: <20190701025553.18596-2-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20190701025553.18596-1-michael.d.kinney@intel.com>

* 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 <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../Include/Protocol/SmmIchnDispatch.h        | 183 ++++++++++++++++++
 .../Vlv2DeviceRefCodePkg.dec                  |   5 +-
 2 files changed, 186 insertions(+), 2 deletions(-)
 create mode 100644 Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispatch.h

diff --git a/Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispatch.h b/Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispatch.h
new file mode 100644
index 0000000000..3cf86c0ff9
--- /dev/null
+++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/Include/Protocol/SmmIchnDispatch.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 child handlers for
+  the given event types.
+
+Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec
+  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, 0x85, 0xcc } \
+  }
+
+typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL  EFI_SMM_ICHN_DISPATCH_PROTOCOL;
+
+//
+// Related Definitions
+//
+//
+// ICHN Specific SMIs.  These are miscellaneous SMI sources that are supported by the
+// ICHN specific SMI implementation.  These may change over time.  TrapNumber is only
+// valid if the Type is Trap.
+//
+typedef enum {
+  //
+  // NOTE: NEVER delete items from this list/enumeration!  Doing so will prevent other versions
+  // of the code from compiling.  If the ICH version your driver is written for doesn't support
+  // some of these SMIs, then simply return EFI_UNSUPPORTED when a 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
+} 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 context.
+                                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_PROTOCOL instance.
+  @param  DispatchFunction      The function to install.
+  @param  DispatchContext       The pointer to the dispatch function's context.
+                                The caller fills in this context before calling
+                                the register function to indicate to the register
+                                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 successfully
+                                registered and the SMI source has been enabled.
+  @retval EFI_DEVICE_ERROR      The driver could not enable the SMI source.
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage 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 driver
+
+  @param  This                  The pointer to the EFI_SMM_ICHN_DISPATCH_PROTOCOL instance.
+  @param  DispatchHandle        The handle of the service to remove.
+
+  @retval EFI_SUCCESS           The dispatch function has been successfully
+                                unregistered, and the SMI source has been disabled,
+                                if there are no other registered child dispatch
+                                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
+//
+/**
+  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 be dispatched by this protocol.
+  EFI_SMM_ICHN_UNREGISTER UnRegister;   ///< Removes a child service dispatched 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       = { 0x2ab86ef5, 0xecb5, 0x4134, {0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4}}
   gPchPeiInitPpiGuid                    = { 0xACB93B08, 0x5CDC, 0x4A8F, {0x93, 0xD4, 0x6, 0xE3, 0x42, 0xDF, 0x18, 0x2E}}
   gPttPassThruPpiGuid                   = { 0xc5068bac, 0xa7dc, 0x42f1, {0xae, 0x80, 0xca, 0xa2, 0x4b, 0xb4, 0x90, 0x4b}}
-  
+
 [Protocols]
   gEfiGlobalNvsAreaProtocolGuid         = { 0x074e1e48, 0x8132, 0x47a1, {0x8c, 0x2c, 0x3f, 0x14, 0xad, 0x9a, 0x66, 0xdc}}
   gPpmPlatformPolicyProtocolGuid        = { 0xddabfeac, 0xef63, 0x452c, {0x8f, 0x39, 0xed, 0x7f, 0xae, 0xd8, 0x26, 0x5e}}
@@ -41,6 +41,7 @@ [Protocols]
   gEfiSdHostIoProtocolGuid              = { 0xb63f8ec7, 0xa9c9, 0x4472, {0xa4, 0xc0, 0x4d, 0x8b, 0xf3, 0x65, 0xcc, 0x51}}
   gEfiSpiProtocolGuid                   = { 0x1156efc6, 0xea32, 0x4396, {0xb5, 0xd5, 0x26, 0x93, 0x2e, 0x83, 0xc3, 0x13}}
   gEfiSmmSpiProtocolGuid                = { 0xD9072C35, 0xEB8F, 0x43AD, {0xA2, 0x20, 0x34, 0xD4, 0x0E, 0x2A, 0x82, 0x85}}
+  gEfiSmmIchnDispatchProtocolGuid       = { 0xc50b323e, 0x9075, 0x4f2a, { 0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc}}
   gEfiSmmIchnDispatchExProtocolGuid     = { 0x3920405B, 0xC897, 0x44DA, {0x88, 0xF3, 0x4C, 0x49, 0x8A, 0x6F, 0xF7, 0x36}}
   gEfiPchS3SupportProtocolGuid          = { 0xE287D20B, 0xD897, 0x4E1E, {0xA5, 0xD9, 0x97, 0x77, 0x63, 0x93, 0x6A, 0x04}}
   gPchResetProtocolGuid                 = { 0xDB63592C, 0xB8CC, 0x44C8, {0x91, 0x8C, 0x51, 0xF5, 0x34, 0x59, 0x8A, 0x5A}}
-- 
2.21.0.windows.1


  reply	other threads:[~2019-07-01  2:55 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01  2:55 [edk2-platforms Patch 00/14] Vlv2TbltDevicePkg: Remove Intel Framework dependencies Michael D Kinney
2019-07-01  2:55 ` Michael D Kinney [this message]
2019-07-01  4:06   ` [edk2-platforms Patch 01/14] Vlv2DeviceRefCodePkg: Add gEfiSmmIchnDispatchProtocolGuid Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 02/14] Vlv2TbltDevicePkg: Reduce Intel Framework dependencies Michael D Kinney
2019-07-01  4:06   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 03/14] Vlv2TbltDevicePkg: Remove unused modules/libraries Michael D Kinney
2019-07-01  4:07   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 04/14] Vlv2TbltDevicePkg: Switch from ISA to SIO modules Michael D Kinney
2019-07-01  4:07   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 05/14] Vlv2TbltDevicePkg: Switch to CPU I/O 2 Protocol Michael D Kinney
2019-07-01  4:07   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 06/14] Vlv2TbltDevicePkg: Remove use of PS/2 Policy Protocol Michael D Kinney
2019-07-01  4:07   ` [edk2-devel] " Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 07/14] Vlv2TbltDevicePkg: Remove use of BIOS ID tools Michael D Kinney
2019-07-01  4:07   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 08/14] Vlv2TbltDevicePkg: Remove use of Data Hub Protocol Michael D Kinney
2019-07-01  4:08   ` [edk2-devel] " Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 09/14] Vlv2TbltDevicePkg: Use PI Spec SMBUS2 PPI Michael D Kinney
2019-07-01  4:08   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 10/14] Vlv2TbltDevicePkg: Switch to MdeModulePkg BdsDxe Michael D Kinney
2019-07-01  4:08   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 11/14] Vlv2TbltDevicePkg: Update boot mode/state behaviors Michael D Kinney
2019-07-01  4:08   ` [edk2-devel] " Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 12/14] Vlv2TbltDevicePkg/PlatformSmm: Switch to PI SMM Protocols Michael D Kinney
2019-07-01  4:08   ` [edk2-devel] " Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 13/14] Vlv2TbltDevicePkg: Change to PI Spec ACPI Table Protocol Michael D Kinney
2019-07-01  4:08   ` Sun, Zailiang
2019-07-01  2:55 ` [edk2-platforms Patch 14/14] Vlv2TbltDevicePkg/PlatformInitPei: Update MemoryTypeInformation Michael D Kinney
2019-07-01  4:08   ` Sun, Zailiang
2019-07-01  4:04 ` [edk2-devel] [edk2-platforms Patch 00/14] Vlv2TbltDevicePkg: Remove Intel Framework dependencies Gary Lin
2019-07-01 23:07   ` Michael D Kinney
2019-07-02  9:48     ` Gary Lin
2019-07-02 16:49       ` Michael D Kinney
2019-07-02 21:11         ` Michael D Kinney
2019-07-03  3:57           ` Gary Lin
2019-07-09  3:52             ` Michael D Kinney
2019-07-09  6:04               ` Gary Lin
2019-07-10  3:38                 ` Michael D Kinney
2019-07-10  4:14                   ` Gary Lin
2019-07-10  5:01                     ` Michael D Kinney
2019-07-10  7:10                       ` Gary Lin
2019-07-10 19:27                         ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190701025553.18596-2-michael.d.kinney@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox