172c194f7SMichael S. Tsirkin /* 272c194f7SMichael S. Tsirkin * This program is free software; you can redistribute it and/or modify 372c194f7SMichael S. Tsirkin * it under the terms of the GNU General Public License as published by 472c194f7SMichael S. Tsirkin * the Free Software Foundation; either version 2 of the License, or 572c194f7SMichael S. Tsirkin * (at your option) any later version. 672c194f7SMichael S. Tsirkin 772c194f7SMichael S. Tsirkin * This program is distributed in the hope that it will be useful, 872c194f7SMichael S. Tsirkin * but WITHOUT ANY WARRANTY; without even the implied warranty of 972c194f7SMichael S. Tsirkin * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1072c194f7SMichael S. Tsirkin * GNU General Public License for more details. 1172c194f7SMichael S. Tsirkin 1272c194f7SMichael S. Tsirkin * You should have received a copy of the GNU General Public License along 1372c194f7SMichael S. Tsirkin * with this program; if not, see <http://www.gnu.org/licenses/>. 1472c194f7SMichael S. Tsirkin */ 1572c194f7SMichael S. Tsirkin #ifndef QEMU_ACPI_DEFS_H 1672c194f7SMichael S. Tsirkin #define QEMU_ACPI_DEFS_H 1772c194f7SMichael S. Tsirkin 1872c194f7SMichael S. Tsirkin enum { 1972c194f7SMichael S. Tsirkin ACPI_FADT_F_WBINVD, 2072c194f7SMichael S. Tsirkin ACPI_FADT_F_WBINVD_FLUSH, 2172c194f7SMichael S. Tsirkin ACPI_FADT_F_PROC_C1, 2272c194f7SMichael S. Tsirkin ACPI_FADT_F_P_LVL2_UP, 2372c194f7SMichael S. Tsirkin ACPI_FADT_F_PWR_BUTTON, 2472c194f7SMichael S. Tsirkin ACPI_FADT_F_SLP_BUTTON, 2572c194f7SMichael S. Tsirkin ACPI_FADT_F_FIX_RTC, 2672c194f7SMichael S. Tsirkin ACPI_FADT_F_RTC_S4, 2772c194f7SMichael S. Tsirkin ACPI_FADT_F_TMR_VAL_EXT, 2872c194f7SMichael S. Tsirkin ACPI_FADT_F_DCK_CAP, 2972c194f7SMichael S. Tsirkin ACPI_FADT_F_RESET_REG_SUP, 3072c194f7SMichael S. Tsirkin ACPI_FADT_F_SEALED_CASE, 3172c194f7SMichael S. Tsirkin ACPI_FADT_F_HEADLESS, 3272c194f7SMichael S. Tsirkin ACPI_FADT_F_CPU_SW_SLP, 3372c194f7SMichael S. Tsirkin ACPI_FADT_F_PCI_EXP_WAK, 3472c194f7SMichael S. Tsirkin ACPI_FADT_F_USE_PLATFORM_CLOCK, 3572c194f7SMichael S. Tsirkin ACPI_FADT_F_S4_RTC_STS_VALID, 3672c194f7SMichael S. Tsirkin ACPI_FADT_F_REMOTE_POWER_ON_CAPABLE, 3772c194f7SMichael S. Tsirkin ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL, 3872c194f7SMichael S. Tsirkin ACPI_FADT_F_FORCE_APIC_PHYSICAL_DESTINATION_MODE, 3972c194f7SMichael S. Tsirkin ACPI_FADT_F_HW_REDUCED_ACPI, 4072c194f7SMichael S. Tsirkin ACPI_FADT_F_LOW_POWER_S0_IDLE_CAPABLE, 4172c194f7SMichael S. Tsirkin }; 4272c194f7SMichael S. Tsirkin 435c5fce1aSSamuel Ortiz typedef struct AcpiRsdpData { 44602b4582SMarian Postevca char *oem_id; /* OEM identification */ 455c5fce1aSSamuel Ortiz uint8_t revision; /* Must be 0 for 1.0, 2 for 2.0 */ 465c5fce1aSSamuel Ortiz 475c5fce1aSSamuel Ortiz unsigned *rsdt_tbl_offset; 485c5fce1aSSamuel Ortiz unsigned *xsdt_tbl_offset; 495c5fce1aSSamuel Ortiz } AcpiRsdpData; 505c5fce1aSSamuel Ortiz 51c2f7c0c3SShannon Zhao struct AcpiGenericAddress { 52c2f7c0c3SShannon Zhao uint8_t space_id; /* Address space where struct or register exists */ 53c2f7c0c3SShannon Zhao uint8_t bit_width; /* Size in bits of given register */ 54c2f7c0c3SShannon Zhao uint8_t bit_offset; /* Bit offset within the register */ 55b8e0f589SIgor Mammedov uint8_t access_width; /* ACPI 3.0: Minimum Access size (ACPI 3.0), 56b8e0f589SIgor Mammedov ACPI 2.0: Reserved, Table 5-1 */ 57c2f7c0c3SShannon Zhao uint64_t address; /* 64-bit address of struct or register */ 58*a8a57687SIgor Mammedov }; 59c2f7c0c3SShannon Zhao 60937d1b58SIgor Mammedov typedef struct AcpiFadtData { 61937d1b58SIgor Mammedov struct AcpiGenericAddress pm1a_cnt; /* PM1a_CNT_BLK */ 62937d1b58SIgor Mammedov struct AcpiGenericAddress pm1a_evt; /* PM1a_EVT_BLK */ 63937d1b58SIgor Mammedov struct AcpiGenericAddress pm_tmr; /* PM_TMR_BLK */ 64937d1b58SIgor Mammedov struct AcpiGenericAddress gpe0_blk; /* GPE0_BLK */ 65937d1b58SIgor Mammedov struct AcpiGenericAddress reset_reg; /* RESET_REG */ 66c8ed8f57SGerd Hoffmann struct AcpiGenericAddress sleep_ctl; /* SLEEP_CONTROL_REG */ 67c8ed8f57SGerd Hoffmann struct AcpiGenericAddress sleep_sts; /* SLEEP_STATUS_REG */ 68937d1b58SIgor Mammedov uint8_t reset_val; /* RESET_VALUE */ 69937d1b58SIgor Mammedov uint8_t rev; /* Revision */ 70937d1b58SIgor Mammedov uint32_t flags; /* Flags */ 71937d1b58SIgor Mammedov uint32_t smi_cmd; /* SMI_CMD */ 72937d1b58SIgor Mammedov uint16_t sci_int; /* SCI_INT */ 73937d1b58SIgor Mammedov uint8_t int_model; /* INT_MODEL */ 74937d1b58SIgor Mammedov uint8_t acpi_enable_cmd; /* ACPI_ENABLE */ 75937d1b58SIgor Mammedov uint8_t acpi_disable_cmd; /* ACPI_DISABLE */ 76937d1b58SIgor Mammedov uint8_t rtc_century; /* CENTURY */ 77937d1b58SIgor Mammedov uint16_t plvl2_lat; /* P_LVL2_LAT */ 78937d1b58SIgor Mammedov uint16_t plvl3_lat; /* P_LVL3_LAT */ 79dd1b2037SIgor Mammedov uint16_t arm_boot_arch; /* ARM_BOOT_ARCH */ 80dd1b2037SIgor Mammedov uint8_t minor_ver; /* FADT Minor Version */ 81937d1b58SIgor Mammedov 82937d1b58SIgor Mammedov /* 83937d1b58SIgor Mammedov * respective tables offsets within ACPI_BUILD_TABLE_FILE, 84937d1b58SIgor Mammedov * NULL if table doesn't exist (in that case field's value 85937d1b58SIgor Mammedov * won't be patched by linker and will be kept set to 0) 86937d1b58SIgor Mammedov */ 87937d1b58SIgor Mammedov unsigned *facs_tbl_offset; /* FACS offset in */ 88937d1b58SIgor Mammedov unsigned *dsdt_tbl_offset; 89937d1b58SIgor Mammedov unsigned *xdsdt_tbl_offset; 90937d1b58SIgor Mammedov } AcpiFadtData; 91937d1b58SIgor Mammedov 928c92c6a4SAndrew Jones #define ACPI_FADT_ARM_PSCI_COMPLIANT (1 << 0) 938c92c6a4SAndrew Jones #define ACPI_FADT_ARM_PSCI_USE_HVC (1 << 1) 94c2f7c0c3SShannon Zhao 9572c194f7SMichael S. Tsirkin #endif 96