PchEspiSmiDispatch.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /** @file
  2. SmmEspiDispatch Protocol
  3. Copyright (c) 2019 Intel Corporation. All rights reserved. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _PCH_ESPI_SMI_DISPATCH_PROTOCOL_H_
  7. #define _PCH_ESPI_SMI_DISPATCH_PROTOCOL_H_
  8. //
  9. // Extern the GUID for protocol users.
  10. //
  11. extern EFI_GUID gPchEspiSmiDispatchProtocolGuid;
  12. //
  13. // Forward reference for ANSI C compatibility
  14. //
  15. typedef struct _PCH_ESPI_SMI_DISPATCH_PROTOCOL PCH_ESPI_SMI_DISPATCH_PROTOCOL;
  16. //
  17. // Member functions
  18. //
  19. /**
  20. Callback function for an PCH eSPI SMI handler dispatch.
  21. @param[in] DispatchHandle The unique handle assigned to this handler by register function.
  22. **/
  23. typedef
  24. VOID
  25. (EFIAPI *PCH_ESPI_SMI_DISPATCH_CALLBACK) (
  26. IN EFI_HANDLE DispatchHandle
  27. );
  28. /**
  29. Generic function to register different types of eSPI SMI types
  30. @param[in] This Not used
  31. @param[in] DispatchFunction The callback to execute
  32. @param[out] DispatchHandle The handle for this callback registration
  33. @retval EFI_SUCCESS Registration successful
  34. @retval EFI_ACCESS_DENIED Return access denied if the EndOfDxe event has been triggered
  35. @retval others Registration failed
  36. **/
  37. typedef
  38. EFI_STATUS
  39. (EFIAPI *PCH_ESPI_SMI_REGISTER) (
  40. IN PCH_ESPI_SMI_DISPATCH_PROTOCOL *This,
  41. IN PCH_ESPI_SMI_DISPATCH_CALLBACK DispatchFunction,
  42. OUT EFI_HANDLE *DispatchHandle
  43. );
  44. /**
  45. eSPI SMI Dispatch Protocol instance to unregister a callback based on handle
  46. @param[in] This Not used
  47. @param[in] DispatchHandle Handle acquired during registration
  48. @retval EFI_SUCCESS Unregister successful
  49. @retval EFI_INVALID_PARAMETER DispatchHandle is null
  50. @retval EFI_INVALID_PARAMETER DispatchHandle's forward link has bad pointer
  51. @retval EFI_INVALID_PARAMETER DispatchHandle does not exist in database
  52. @retval EFI_ACCESS_DENIED Unregistration is done after end of DXE
  53. **/
  54. typedef
  55. EFI_STATUS
  56. (EFIAPI *PCH_ESPI_SMI_UNREGISTER) (
  57. IN PCH_ESPI_SMI_DISPATCH_PROTOCOL *This,
  58. IN EFI_HANDLE DispatchHandle
  59. );
  60. /**
  61. Interface structure for PCH eSPI SMIs Dispatch Protocol
  62. The PCH ESPI SMI DISPATCH PROTOCOL provides the ability to dispatch function for PCH eSPI related SMIs.
  63. It contains SMI types of BiosWr, EcAssertedVw, and eSPI Master asserted SMIs
  64. **/
  65. struct _PCH_ESPI_SMI_DISPATCH_PROTOCOL {
  66. /**
  67. This member specifies the revision of this structure. This field is used to
  68. indicate backwards compatible changes to the protocol.
  69. **/
  70. UINT8 Revision;
  71. /**
  72. Unregister eSPI SMI events
  73. **/
  74. PCH_ESPI_SMI_UNREGISTER UnRegister;
  75. /**
  76. Register a BIOS Write Protect event
  77. **/
  78. PCH_ESPI_SMI_REGISTER BiosWrProtectRegister;
  79. /**
  80. Register a BIOS Write Report event
  81. **/
  82. PCH_ESPI_SMI_REGISTER BiosWrReportRegister;
  83. /**
  84. Register a Peripheral Channel Non Fatal Error event
  85. **/
  86. PCH_ESPI_SMI_REGISTER PcErrNonFatalRegister;
  87. /**
  88. Register a Peripheral Channel Fatal Error event
  89. **/
  90. PCH_ESPI_SMI_REGISTER PcErrFatalRegister;
  91. /**
  92. Register a Virtual Wire Non Fatal Error event
  93. **/
  94. PCH_ESPI_SMI_REGISTER VwErrNonFatalRegister;
  95. /**
  96. Register a Virtual Wire Fatal Error event
  97. **/
  98. PCH_ESPI_SMI_REGISTER VwErrFatalRegister;
  99. /**
  100. Register a Flash Channel Non Fatal Error event
  101. **/
  102. PCH_ESPI_SMI_REGISTER FlashErrNonFatalRegister;
  103. /**
  104. Register a Flash Channel Fatal Error event
  105. **/
  106. PCH_ESPI_SMI_REGISTER FlashErrFatalRegister;
  107. /**
  108. Register a Link Error event
  109. **/
  110. PCH_ESPI_SMI_REGISTER LnkErrType1Register;
  111. /**
  112. Register a SMI handler for Espi slaver
  113. This routine will also lock down ESPI_SMI_LOCK bit after registration and prevent
  114. this handler from unregistration.
  115. On platform that supports more than 1 device through another chip select (SPT-H),
  116. the SMI handler itself needs to inspect both the eSPI devices' interrupt status registers
  117. (implementation specific for each Slave) in order to identify and service the cause.
  118. After servicing it, it has to clear the Slaves' internal SMI# status registers
  119. **/
  120. PCH_ESPI_SMI_REGISTER EspiSlaveSmiRegister;
  121. };
  122. /**
  123. PCH ESPI SMI dispatch revision number
  124. Revision 1: Initial version
  125. **/
  126. #define PCH_ESPI_SMI_DISPATCH_REVISION 1
  127. #endif