SioService.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /** @file
  2. Super I/O Interface function declarations.
  3. Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _SIO_ACPI_H_
  7. #define _SIO_ACPI_H_
  8. //
  9. // Prototypes for the SIO protocol interface
  10. //
  11. /**
  12. Provides an interface to get a list of the current resources consumed by the device in the ACPI
  13. Resource Descriptor format.
  14. GetResources() returns a list of resources currently consumed by the device. The
  15. ResourceList is a pointer to the buffer containing resource descriptors for the device. The
  16. descriptors are in the format of Small or Large ACPI resource descriptor as defined by ACPI
  17. specification (2.0 & 3.0). The buffer of resource descriptors is terminated with the 'End tag'
  18. resource descriptor.
  19. @param[in] This Indicates a pointer to the calling context.
  20. @param[out] ResourceList A pointer to an ACPI resource descriptor list that defines the current resources
  21. used by the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the "Related
  22. Definitions" below.
  23. @retval EFI_SUCCESS The operation completed successfully
  24. @retval EFI_INVALID_PARAMETER ResourceList is NULL
  25. **/
  26. EFI_STATUS
  27. EFIAPI
  28. SioGetResources (
  29. IN CONST EFI_SIO_PROTOCOL *This,
  30. OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
  31. );
  32. /**
  33. Sets the resources for the device.
  34. @param[in] This Indicates a pointer to the calling context.
  35. @param[in] ResourceList Pointer to the ACPI resource descriptor list. Type ACPI_RESOURCE_HEADER_PTR
  36. is defined in the "Related Definitions" section of
  37. EFI_SIO_PROTOCOL.GetResources().
  38. @retval EFI_SUCCESS The operation completed successfully
  39. @retval EFI_INVALID_PARAMETER ResourceList is invalid
  40. @retval EFI_ACCESS_DENIED Some of the resources in ResourceList are in use
  41. **/
  42. EFI_STATUS
  43. EFIAPI
  44. SioSetResources (
  45. IN CONST EFI_SIO_PROTOCOL *This,
  46. IN ACPI_RESOURCE_HEADER_PTR ResourceList
  47. );
  48. /**
  49. Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
  50. defines a combination of resources that can potentially be used by the device.
  51. @param[in] This Indicates a pointer to the calling context.
  52. @param[out] ResourceCollection Collection of the resource descriptor lists.
  53. @retval EFI_SUCCESS The operation completed successfully
  54. @retval EFI_INVALID_PARAMETER ResourceCollection is NULL
  55. **/
  56. EFI_STATUS
  57. EFIAPI
  58. SioPossibleResources (
  59. IN CONST EFI_SIO_PROTOCOL *This,
  60. OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
  61. );
  62. /**
  63. Provides a low level access to the registers for the Super I/O.
  64. @param[in] This Indicates a pointer to the calling context.
  65. @param[in] Write Specifies the type of the register operation. If this parameter is TRUE,
  66. Value is interpreted as an input parameter and the operation is a register write.
  67. If this parameter is FALSE, Value is interpreted as an output parameter and the
  68. operation is a register read.
  69. @param[in] ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the
  70. Super I/O driver will turn off configuration mode of the Super I/O prior to returning
  71. from this function. If this parameter is set to FALSE, the Super I/O driver will
  72. leave Super I/O in the configuration mode.
  73. The Super I/O driver must track the current state of the Super I/O and enable the
  74. configuration mode of Super I/O if necessary prior to register access.
  75. @param[in] Register Register number.
  76. @param[in, out] Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
  77. written to the Super I/O register. If Write is FALSE, Value is a pointer to the
  78. destination buffer for the byte of data to be read from the Super I/O register.
  79. @retval EFI_SUCCESS The operation completed successfully
  80. @retval EFI_INVALID_PARAMETER The Value is NULL
  81. @retval EFI_INVALID_PARAMETER Invalid Register number
  82. **/
  83. EFI_STATUS
  84. EFIAPI
  85. SioRegisterAccess (
  86. IN CONST EFI_SIO_PROTOCOL *This,
  87. IN BOOLEAN Write,
  88. IN BOOLEAN ExitCfgMode,
  89. IN UINT8 Register,
  90. IN OUT UINT8 *Value
  91. );
  92. /**
  93. Provides an interface for a table based programming of the Super I/O registers.
  94. The Modify() function provides an interface for table based programming of the Super I/O
  95. registers. This function can be used to perform programming of multiple Super I/O registers with a
  96. single function call. For each table entry, the Register is read, its content is bitwise ANDed with
  97. AndMask, and then ORed with OrMask before being written back to the Register. The Super
  98. I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
  99. O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
  100. returned to the original state.
  101. @param[in] This Indicates a pointer to the calling context.
  102. @param[in] Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
  103. structures. Each structure specifies a single Super I/O register modify operation.
  104. Type EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
  105. @param[in] NumberOfCommands Number of elements in the Command array.
  106. @retval EFI_SUCCESS The operation completed successfully
  107. @retval EFI_INVALID_PARAMETER Command is NULL
  108. **/
  109. EFI_STATUS
  110. EFIAPI
  111. SioModify (
  112. IN CONST EFI_SIO_PROTOCOL *This,
  113. IN CONST EFI_SIO_REGISTER_MODIFY *Command,
  114. IN UINTN NumberOfCommands
  115. );
  116. #endif