2
0

acpi-defs.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the License, or
  5. * (at your option) any later version.
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. * GNU General Public License for more details.
  10. * You should have received a copy of the GNU General Public License along
  11. * with this program; if not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #ifndef QEMU_ACPI_DEFS_H
  14. #define QEMU_ACPI_DEFS_H
  15. enum {
  16. ACPI_FADT_F_WBINVD,
  17. ACPI_FADT_F_WBINVD_FLUSH,
  18. ACPI_FADT_F_PROC_C1,
  19. ACPI_FADT_F_P_LVL2_UP,
  20. ACPI_FADT_F_PWR_BUTTON,
  21. ACPI_FADT_F_SLP_BUTTON,
  22. ACPI_FADT_F_FIX_RTC,
  23. ACPI_FADT_F_RTC_S4,
  24. ACPI_FADT_F_TMR_VAL_EXT,
  25. ACPI_FADT_F_DCK_CAP,
  26. ACPI_FADT_F_RESET_REG_SUP,
  27. ACPI_FADT_F_SEALED_CASE,
  28. ACPI_FADT_F_HEADLESS,
  29. ACPI_FADT_F_CPU_SW_SLP,
  30. ACPI_FADT_F_PCI_EXP_WAK,
  31. ACPI_FADT_F_USE_PLATFORM_CLOCK,
  32. ACPI_FADT_F_S4_RTC_STS_VALID,
  33. ACPI_FADT_F_REMOTE_POWER_ON_CAPABLE,
  34. ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL,
  35. ACPI_FADT_F_FORCE_APIC_PHYSICAL_DESTINATION_MODE,
  36. ACPI_FADT_F_HW_REDUCED_ACPI,
  37. ACPI_FADT_F_LOW_POWER_S0_IDLE_CAPABLE,
  38. };
  39. typedef struct AcpiRsdpData {
  40. char *oem_id; /* OEM identification */
  41. uint8_t revision; /* Must be 0 for 1.0, 2 for 2.0 */
  42. unsigned *rsdt_tbl_offset;
  43. unsigned *xsdt_tbl_offset;
  44. } AcpiRsdpData;
  45. struct AcpiGenericAddress {
  46. uint8_t space_id; /* Address space where struct or register exists */
  47. uint8_t bit_width; /* Size in bits of given register */
  48. uint8_t bit_offset; /* Bit offset within the register */
  49. uint8_t access_width; /* ACPI 3.0: Minimum Access size (ACPI 3.0),
  50. ACPI 2.0: Reserved, Table 5-1 */
  51. uint64_t address; /* 64-bit address of struct or register */
  52. };
  53. typedef struct AcpiFadtData {
  54. struct AcpiGenericAddress pm1a_cnt; /* PM1a_CNT_BLK */
  55. struct AcpiGenericAddress pm1a_evt; /* PM1a_EVT_BLK */
  56. struct AcpiGenericAddress pm_tmr; /* PM_TMR_BLK */
  57. struct AcpiGenericAddress gpe0_blk; /* GPE0_BLK */
  58. struct AcpiGenericAddress reset_reg; /* RESET_REG */
  59. struct AcpiGenericAddress sleep_ctl; /* SLEEP_CONTROL_REG */
  60. struct AcpiGenericAddress sleep_sts; /* SLEEP_STATUS_REG */
  61. uint8_t reset_val; /* RESET_VALUE */
  62. uint8_t rev; /* Revision */
  63. uint32_t flags; /* Flags */
  64. uint32_t smi_cmd; /* SMI_CMD */
  65. uint16_t sci_int; /* SCI_INT */
  66. uint8_t int_model; /* INT_MODEL */
  67. uint8_t acpi_enable_cmd; /* ACPI_ENABLE */
  68. uint8_t acpi_disable_cmd; /* ACPI_DISABLE */
  69. uint8_t rtc_century; /* CENTURY */
  70. uint16_t plvl2_lat; /* P_LVL2_LAT */
  71. uint16_t plvl3_lat; /* P_LVL3_LAT */
  72. uint16_t arm_boot_arch; /* ARM_BOOT_ARCH */
  73. uint16_t iapc_boot_arch; /* IAPC_BOOT_ARCH */
  74. uint8_t minor_ver; /* FADT Minor Version */
  75. /*
  76. * respective tables offsets within ACPI_BUILD_TABLE_FILE,
  77. * NULL if table doesn't exist (in that case field's value
  78. * won't be patched by linker and will be kept set to 0)
  79. */
  80. unsigned *facs_tbl_offset; /* FACS offset in */
  81. unsigned *dsdt_tbl_offset;
  82. unsigned *xdsdt_tbl_offset;
  83. } AcpiFadtData;
  84. typedef struct AcpiGas {
  85. uint8_t id; /* Address space ID */
  86. uint8_t width; /* Register bit width */
  87. uint8_t offset; /* Register bit offset */
  88. uint8_t size; /* Access size */
  89. uint64_t addr; /* Address */
  90. } AcpiGas;
  91. /* SPCR (Serial Port Console Redirection table) */
  92. typedef struct AcpiSpcrData {
  93. uint8_t interface_type;
  94. uint8_t reserved[3];
  95. struct AcpiGas base_addr;
  96. uint8_t interrupt_type;
  97. uint8_t pc_interrupt;
  98. uint32_t interrupt; /* Global system interrupt */
  99. uint8_t baud_rate;
  100. uint8_t parity;
  101. uint8_t stop_bits;
  102. uint8_t flow_control;
  103. uint8_t terminal_type;
  104. uint8_t language;
  105. uint16_t pci_device_id; /* Must be 0xffff if not PCI device */
  106. uint16_t pci_vendor_id; /* Must be 0xffff if not PCI device */
  107. uint8_t pci_bus;
  108. uint8_t pci_device;
  109. uint8_t pci_function;
  110. uint32_t pci_flags;
  111. uint8_t pci_segment;
  112. uint32_t uart_clk_freq;
  113. uint32_t precise_baudrate;
  114. uint32_t namespace_string_length;
  115. uint32_t namespace_string_offset;
  116. char namespace_string[];
  117. } AcpiSpcrData;
  118. #define ACPI_FADT_ARM_PSCI_COMPLIANT (1 << 0)
  119. #define ACPI_FADT_ARM_PSCI_USE_HVC (1 << 1)
  120. #endif