3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 SPDX-License-Identifier: BSD-2-Clause-Patent
16 #include <IndustryStandard/Acpi50.h>
24 #define EFI_ACPI_LOW_POWER_IDLE_TABLE_REVISION 0x1
27 // Ensure proper structure formats
31 typedef union _EFI_ACPI_LPI_STATE_FLAGS {
34 UINT32 CounterUnavailable :1;
38 } EFI_ACPI_LPI_STATE_FLAGS, *PEFI_ACPI_LPI_STATE_FLAGS;
40 // Only Mwait LPI here:
42 typedef struct _EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR {
43 UINT32 Type; // offset: 0
44 UINT32 Length; // offset: 4
45 UINT16 UniqueId; // offset: 8
46 UINT8 Reserved[2]; // offset: 9
47 EFI_ACPI_LPI_STATE_FLAGS Flags; // offset: 12
48 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EntryTrigger; // offset: 16
49 UINT32 Residency; // offset: 28
50 UINT32 Latency; // offset: 32
51 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResidencyCounter; // offset: 36
52 UINT64 ResidencyCounterFrequency; //offset: 48
53 } EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR;
57 // Defines for LPIT table, some are VLV specific
62 #define EFI_ACPI_LOW_POWER_IDLE_TABLE_SIGNATURE 0x5449504c
64 #define EFI_ACPI_OEM_LPIT_REVISION 0x00000000
66 #define EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE 0x0
67 #define EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG 0x0
68 #define EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_8K 0x8000 // 32768
71 // LPI state count (4 on VLV: S0ir, S0i1, S0i2, S0i3)
74 #define EFI_ACPI_VLV_LPI_STATE_COUNT 0x4
77 // LPI TRIGGER (HW C7 on VLV),
80 #define EFI_ACPI_VLV_LPI_TRIGGER {0x7F,0x1,0x2,0x0,0x64}
83 // LPI residency counter (MMIO)
85 #define EFI_ACPI_VLV_LPI_RES_COUNTER0 {0x0,32,0x0,0x03,0xFED03080}
86 #define EFI_ACPI_VLV_LPI_RES_COUNTER1 {0x0,32,0x0,0x03,0xFED03084}
87 #define EFI_ACPI_VLV_LPI_RES_COUNTER2 {0x0,32,0x0,0x03,0xFED03088}
88 #define EFI_ACPI_VLV_LPI_RES_COUNTER3 {0x0,32,0x0,0x03,0xFED0308C}
91 // LPI break-even residency in us - all match S0i3 residency
92 // Residency estimate: Latency x 3
94 #define EFI_ACPI_VLV_LPI_MIN_RES0 15000
95 #define EFI_ACPI_VLV_LPI_MIN_RES1 15000
96 #define EFI_ACPI_VLV_LPI_MIN_RES2 15000
97 #define EFI_ACPI_VLV_LPI_MIN_RES3 15000
100 // LPI latency in us - all match S0i3 latency
102 #define EFI_ACPI_VLV_LPI_LATENCY0 5000
103 #define EFI_ACPI_VLV_LPI_LATENCY1 5000
104 #define EFI_ACPI_VLV_LPI_LATENCY2 5000
105 #define EFI_ACPI_VLV_LPI_LATENCY3 5000
111 #define EFI_ACPI_VLV_LPI_UNIQUE_ID0 0
112 #define EFI_ACPI_VLV_LPI_UNIQUE_ID1 1
113 #define EFI_ACPI_VLV_LPI_UNIQUE_ID2 2
114 #define EFI_ACPI_VLV_LPI_UNIQUE_ID3 3
117 // LPI ACPI table header
121 typedef struct _EFI_ACPI_LOW_POWER_IDLE_TABLE {
122 EFI_ACPI_DESCRIPTION_HEADER Header;
123 EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR LpiStates[EFI_ACPI_VLV_LPI_STATE_COUNT];
124 } EFI_ACPI_LOW_POWER_IDLE_TABLE;
128 EFI_ACPI_LOW_POWER_IDLE_TABLE Lpit = {
135 EFI_ACPI_LOW_POWER_IDLE_TABLE_SIGNATURE,
136 sizeof (EFI_ACPI_LOW_POWER_IDLE_TABLE),
137 EFI_ACPI_LOW_POWER_IDLE_TABLE_REVISION ,
140 // Checksum will be updated at runtime
145 // It is expected that these values will be updated at runtime
147 ' ', ' ', ' ', ' ', ' ', ' ',
150 EFI_ACPI_OEM_LPIT_REVISION,
161 EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE,
162 sizeof(EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR),
163 EFI_ACPI_VLV_LPI_UNIQUE_ID0,
165 {EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG}, // Flags
166 EFI_ACPI_VLV_LPI_TRIGGER, //EntryTrigger
167 EFI_ACPI_VLV_LPI_MIN_RES0, //Residency
168 EFI_ACPI_VLV_LPI_LATENCY0, //Latency
169 EFI_ACPI_VLV_LPI_RES_COUNTER0, //ResidencyCounter
170 EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_8K //Residency counter frequency
173 EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE,
174 sizeof(EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR),
175 EFI_ACPI_VLV_LPI_UNIQUE_ID1,
177 {EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG}, // Flags
178 EFI_ACPI_VLV_LPI_TRIGGER, //EntryTrigger
179 EFI_ACPI_VLV_LPI_MIN_RES1, //Residency
180 EFI_ACPI_VLV_LPI_LATENCY1, //Latency
181 EFI_ACPI_VLV_LPI_RES_COUNTER1, //ResidencyCounter
182 EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_8K //Residency counter frequency
185 EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE,
186 sizeof(EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR),
187 EFI_ACPI_VLV_LPI_UNIQUE_ID2,
189 {EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG}, // Flags
190 EFI_ACPI_VLV_LPI_TRIGGER, //EntryTrigger
191 EFI_ACPI_VLV_LPI_MIN_RES2, //Residency
192 EFI_ACPI_VLV_LPI_LATENCY2, //Latency
193 EFI_ACPI_VLV_LPI_RES_COUNTER2, //ResidencyCounter
194 EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_8K //Residency counter frequency
197 EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE,
198 sizeof(EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR),
199 EFI_ACPI_VLV_LPI_UNIQUE_ID3,
201 {EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG}, // Flags
202 EFI_ACPI_VLV_LPI_TRIGGER, //EntryTrigger
203 EFI_ACPI_VLV_LPI_MIN_RES3, //Residency
204 EFI_ACPI_VLV_LPI_LATENCY3, //Latency
205 EFI_ACPI_VLV_LPI_RES_COUNTER3, //ResidencyCounter
206 EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_8K //Residency counter frequency
219 // Reference the table being generated to prevent the optimizer from
220 // removing the data structure from the executable