[edk2-devel] [edk2-platforms Patch 01/14] Vlv2DeviceRefCodePkg: Add gEfiSmmIchnDispatchProtocolGuid

Michael D Kinney michael.d.kinney at intel.com
Mon Jul 1 02:55:40 UTC 2019


* 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 at intel.com>
Cc: Yi Qian <yi.qian at intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney at 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43061): https://edk2.groups.io/g/devel/message/43061
Mute This Topic: https://groups.io/mt/32267617/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list