achware.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /******************************************************************************
  2. *
  3. * Name: achware.h -- hardware specific interfaces
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2015, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACHWARE_H__
  43. #define __ACHWARE_H__
  44. /* Values for the _SST predefined method */
  45. #define ACPI_SST_INDICATOR_OFF 0
  46. #define ACPI_SST_WORKING 1
  47. #define ACPI_SST_WAKING 2
  48. #define ACPI_SST_SLEEPING 3
  49. #define ACPI_SST_SLEEP_CONTEXT 4
  50. /*
  51. * hwacpi - high level functions
  52. */
  53. ACPI_STATUS
  54. AcpiHwSetMode (
  55. UINT32 Mode);
  56. UINT32
  57. AcpiHwGetMode (
  58. void);
  59. /*
  60. * hwregs - ACPI Register I/O
  61. */
  62. ACPI_STATUS
  63. AcpiHwValidateRegister (
  64. ACPI_GENERIC_ADDRESS *Reg,
  65. UINT8 MaxBitWidth,
  66. UINT64 *Address);
  67. ACPI_STATUS
  68. AcpiHwRead (
  69. UINT32 *Value,
  70. ACPI_GENERIC_ADDRESS *Reg);
  71. ACPI_STATUS
  72. AcpiHwWrite (
  73. UINT32 Value,
  74. ACPI_GENERIC_ADDRESS *Reg);
  75. ACPI_BIT_REGISTER_INFO *
  76. AcpiHwGetBitRegisterInfo (
  77. UINT32 RegisterId);
  78. ACPI_STATUS
  79. AcpiHwWritePm1Control (
  80. UINT32 Pm1aControl,
  81. UINT32 Pm1bControl);
  82. ACPI_STATUS
  83. AcpiHwRegisterRead (
  84. UINT32 RegisterId,
  85. UINT32 *ReturnValue);
  86. ACPI_STATUS
  87. AcpiHwRegisterWrite (
  88. UINT32 RegisterId,
  89. UINT32 Value);
  90. ACPI_STATUS
  91. AcpiHwClearAcpiStatus (
  92. void);
  93. /*
  94. * hwsleep - sleep/wake support (Legacy sleep registers)
  95. */
  96. ACPI_STATUS
  97. AcpiHwLegacySleep (
  98. UINT8 SleepState);
  99. ACPI_STATUS
  100. AcpiHwLegacyWakePrep (
  101. UINT8 SleepState);
  102. ACPI_STATUS
  103. AcpiHwLegacyWake (
  104. UINT8 SleepState);
  105. /*
  106. * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
  107. */
  108. void
  109. AcpiHwExecuteSleepMethod (
  110. char *MethodName,
  111. UINT32 IntegerArgument);
  112. ACPI_STATUS
  113. AcpiHwExtendedSleep (
  114. UINT8 SleepState);
  115. ACPI_STATUS
  116. AcpiHwExtendedWakePrep (
  117. UINT8 SleepState);
  118. ACPI_STATUS
  119. AcpiHwExtendedWake (
  120. UINT8 SleepState);
  121. /*
  122. * hwvalid - Port I/O with validation
  123. */
  124. ACPI_STATUS
  125. AcpiHwReadPort (
  126. ACPI_IO_ADDRESS Address,
  127. UINT32 *Value,
  128. UINT32 Width);
  129. ACPI_STATUS
  130. AcpiHwWritePort (
  131. ACPI_IO_ADDRESS Address,
  132. UINT32 Value,
  133. UINT32 Width);
  134. /*
  135. * hwgpe - GPE support
  136. */
  137. UINT32
  138. AcpiHwGetGpeRegisterBit (
  139. ACPI_GPE_EVENT_INFO *GpeEventInfo);
  140. ACPI_STATUS
  141. AcpiHwLowSetGpe (
  142. ACPI_GPE_EVENT_INFO *GpeEventInfo,
  143. UINT32 Action);
  144. ACPI_STATUS
  145. AcpiHwDisableGpeBlock (
  146. ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
  147. ACPI_GPE_BLOCK_INFO *GpeBlock,
  148. void *Context);
  149. ACPI_STATUS
  150. AcpiHwClearGpe (
  151. ACPI_GPE_EVENT_INFO *GpeEventInfo);
  152. ACPI_STATUS
  153. AcpiHwClearGpeBlock (
  154. ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
  155. ACPI_GPE_BLOCK_INFO *GpeBlock,
  156. void *Context);
  157. ACPI_STATUS
  158. AcpiHwGetGpeStatus (
  159. ACPI_GPE_EVENT_INFO *GpeEventInfo,
  160. ACPI_EVENT_STATUS *EventStatus);
  161. ACPI_STATUS
  162. AcpiHwDisableAllGpes (
  163. void);
  164. ACPI_STATUS
  165. AcpiHwEnableAllRuntimeGpes (
  166. void);
  167. ACPI_STATUS
  168. AcpiHwEnableAllWakeupGpes (
  169. void);
  170. ACPI_STATUS
  171. AcpiHwEnableRuntimeGpeBlock (
  172. ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
  173. ACPI_GPE_BLOCK_INFO *GpeBlock,
  174. void *Context);
  175. /*
  176. * hwpci - PCI configuration support
  177. */
  178. ACPI_STATUS
  179. AcpiHwDerivePciId (
  180. ACPI_PCI_ID *PciId,
  181. ACPI_HANDLE RootPciDevice,
  182. ACPI_HANDLE PciRegion);
  183. #endif /* __ACHWARE_H__ */