ACPICA: Add support for LPIT table.
authorBob Moore <robert.moore@intel.com>
Wed, 30 Apr 2014 02:04:06 +0000 (10:04 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 May 2014 22:55:00 +0000 (00:55 +0200)
Adds header, disassembler, table compiler, and template support
for the Low Power Idle Table (LPIT).

Note that the disassembler and table compiler are not shipped in
the kernel.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/acpi/actbl2.h

index c8adad9c6b6a73e7d9834c5e19bc988b51b5dfa8..687426168b0e4867abe2c441899c480c4239267e 100644 (file)
@@ -70,6 +70,7 @@
 #define ACPI_SIG_HPET           "HPET" /* High Precision Event Timer table */
 #define ACPI_SIG_IBFT           "IBFT" /* iSCSI Boot Firmware Table */
 #define ACPI_SIG_IVRS           "IVRS" /* I/O Virtualization Reporting Structure */
+#define ACPI_SIG_LPIT           "LPIT" /* Low Power Idle Table */
 #define ACPI_SIG_MCFG           "MCFG" /* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI" /* Management Controller Host Interface table */
 #define ACPI_SIG_MTMR           "MTMR" /* MID Timer table */
@@ -818,6 +819,70 @@ struct acpi_ivrs_memory {
        u64 memory_length;
 };
 
+/*******************************************************************************
+ *
+ * LPIT - Low Power Idle Table
+ *
+ * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ *
+ ******************************************************************************/
+
+struct acpi_table_lpit {
+       struct acpi_table_header header;        /* Common ACPI table header */
+};
+
+/* LPIT subtable header */
+
+struct acpi_lpit_header {
+       u32 type;               /* Subtable type */
+       u32 length;             /* Subtable length */
+       u16 unique_id;
+       u16 reserved;
+       u32 flags;
+};
+
+/* Values for subtable Type above */
+
+enum acpi_lpit_type {
+       ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
+       ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
+};
+
+/* Masks for Flags field above  */
+
+#define ACPI_LPIT_STATE_DISABLED    (1)
+#define ACPI_LPIT_NO_COUNTER        (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in struct acpi_lpit_header
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+struct acpi_lpit_native {
+       struct acpi_lpit_header header;
+       struct acpi_generic_address entry_trigger;
+       u32 residency;
+       u32 latency;
+       struct acpi_generic_address residency_counter;
+       u64 counter_frequency;
+};
+
+/* 0x01: Simple I/O based LPI structure */
+
+struct acpi_lpit_io {
+       struct acpi_lpit_header header;
+       struct acpi_generic_address entry_trigger;
+       u32 trigger_action;
+       u64 trigger_value;
+       u64 trigger_mask;
+       struct acpi_generic_address minimum_idle_state;
+       u32 residency;
+       u32 latency;
+       struct acpi_generic_address residency_counter;
+       u64 counter_frequency;
+};
+
 /*******************************************************************************
  *
  * MCFG - PCI Memory Mapped Configuration table and sub-table