Acpi2_0.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. /** @file
  2. ACPI 2.0 definitions from the ACPI Specification, revision 2.0
  3. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
  4. This program and the accompanying materials are licensed and made available
  5. under the terms and conditions of the BSD License which accompanies this
  6. distribution. The full text of the license may be found at
  7. http://opensource.org/licenses/bsd-license.php
  8. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  10. **/
  11. #ifndef _ACPI_2_0_H_
  12. #define _ACPI_2_0_H_
  13. #include "IndustryStandard/Acpi.h"
  14. //
  15. // Ensure proper structure formats
  16. //
  17. #pragma pack(1)
  18. //
  19. // ACPI Specification Revision
  20. //
  21. #define EFI_ACPI_2_0_REVISION 0x02
  22. //
  23. // BUGBUG: OEM values need to be moved somewhere else, probably read from data hub
  24. // and produced by a platform specific driver.
  25. //
  26. //
  27. // ACPI OEM ID
  28. //
  29. #define EFI_ACPI_2_0_OEM_ID "INTEL "
  30. #define EFI_ACPI_2_0_OEM_TABLE_ID 0x5034303738543245 // "E2T8704P"
  31. //
  32. // ACPI OEM Revision
  33. //
  34. #define EFI_ACPI_2_0_OEM_REVISION 0x00000002
  35. //
  36. // ACPI table creator ID
  37. //
  38. #define EFI_ACPI_2_0_CREATOR_ID 0x5446534D // TBD "MSFT"
  39. //
  40. // ACPI table creator revision
  41. //
  42. #define EFI_ACPI_2_0_CREATOR_REVISION 0x01000013 // TBD
  43. //
  44. // ACPI 2.0 Generic Address Space definition
  45. //
  46. typedef struct {
  47. UINT8 AddressSpaceId;
  48. UINT8 RegisterBitWidth;
  49. UINT8 RegisterBitOffset;
  50. UINT8 Reserved;
  51. UINT64 Address;
  52. } EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
  53. //
  54. // Generic Address Space Address IDs
  55. //
  56. #define EFI_ACPI_2_0_SYSTEM_MEMORY 0
  57. #define EFI_ACPI_2_0_SYSTEM_IO 1
  58. #define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
  59. #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
  60. #define EFI_ACPI_2_0_SMBUS 4
  61. #define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
  62. //
  63. // ACPI 2.0 table structures
  64. //
  65. //
  66. // Root System Description Pointer Structure
  67. //
  68. typedef struct {
  69. UINT64 Signature;
  70. UINT8 Checksum;
  71. UINT8 OemId[6];
  72. UINT8 Revision;
  73. UINT32 RsdtAddress;
  74. UINT32 Length;
  75. UINT64 XsdtAddress;
  76. UINT8 ExtendedChecksum;
  77. UINT8 Reserved[3];
  78. } EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
  79. //
  80. // RSD_PTR Revision (as defined in ACPI 2.0 spec.)
  81. //
  82. #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
  83. //
  84. // Common table header, this prefaces all ACPI tables, including FACS, but
  85. // excluding the RSD PTR structure
  86. //
  87. typedef struct {
  88. UINT32 Signature;
  89. UINT32 Length;
  90. } EFI_ACPI_2_0_COMMON_HEADER;
  91. //
  92. // Root System Description Table
  93. // No definition needed as it is a common description table header followed by a
  94. // variable number of UINT32 table pointers.
  95. //
  96. //
  97. // RSDT Revision (as defined in ACPI 2.0 spec.)
  98. //
  99. #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
  100. //
  101. // Extended System Description Table
  102. // No definition needed as it is a common description table header followed by a
  103. // variable number of UINT64 table pointers.
  104. //
  105. //
  106. // XSDT Revision (as defined in ACPI 2.0 spec.)
  107. //
  108. #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
  109. //
  110. // Fixed ACPI Description Table Structure (FADT)
  111. //
  112. typedef struct {
  113. EFI_ACPI_DESCRIPTION_HEADER Header;
  114. UINT32 FirmwareCtrl;
  115. UINT32 Dsdt;
  116. UINT8 Reserved0;
  117. UINT8 PreferredPmProfile;
  118. UINT16 SciInt;
  119. UINT32 SmiCmd;
  120. UINT8 AcpiEnable;
  121. UINT8 AcpiDisable;
  122. UINT8 S4BiosReq;
  123. UINT8 PstateCnt;
  124. UINT32 Pm1aEvtBlk;
  125. UINT32 Pm1bEvtBlk;
  126. UINT32 Pm1aCntBlk;
  127. UINT32 Pm1bCntBlk;
  128. UINT32 Pm2CntBlk;
  129. UINT32 PmTmrBlk;
  130. UINT32 Gpe0Blk;
  131. UINT32 Gpe1Blk;
  132. UINT8 Pm1EvtLen;
  133. UINT8 Pm1CntLen;
  134. UINT8 Pm2CntLen;
  135. UINT8 PmTmrLen;
  136. UINT8 Gpe0BlkLen;
  137. UINT8 Gpe1BlkLen;
  138. UINT8 Gpe1Base;
  139. UINT8 CstCnt;
  140. UINT16 PLvl2Lat;
  141. UINT16 PLvl3Lat;
  142. UINT16 FlushSize;
  143. UINT16 FlushStride;
  144. UINT8 DutyOffset;
  145. UINT8 DutyWidth;
  146. UINT8 DayAlrm;
  147. UINT8 MonAlrm;
  148. UINT8 Century;
  149. UINT16 IaPcBootArch;
  150. UINT8 Reserved1;
  151. UINT32 Flags;
  152. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
  153. UINT8 ResetValue;
  154. UINT8 Reserved2[3];
  155. UINT64 XFirmwareCtrl;
  156. UINT64 XDsdt;
  157. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
  158. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
  159. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
  160. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
  161. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
  162. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
  163. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
  164. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
  165. } EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
  166. //
  167. // FADT Version (as defined in ACPI 2.0 spec.)
  168. //
  169. #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
  170. //
  171. // Fixed ACPI Description Table Boot Architecture Flags
  172. // All other bits are reserved and must be set to 0.
  173. //
  174. #define EFI_ACPI_2_0_LEGACY_DEVICES (1 << 0)
  175. #define EFI_ACPI_2_0_8042 (1 << 1)
  176. //
  177. // Fixed ACPI Description Table Fixed Feature Flags
  178. // All other bits are reserved and must be set to 0.
  179. //
  180. #define EFI_ACPI_2_0_WBINVD (1 << 0)
  181. #define EFI_ACPI_2_0_WBINVD_FLUSH (1 << 1)
  182. #define EFI_ACPI_2_0_PROC_C1 (1 << 2)
  183. #define EFI_ACPI_2_0_P_LVL2_UP (1 << 3)
  184. #define EFI_ACPI_2_0_PWR_BUTTON (1 << 4)
  185. #define EFI_ACPI_2_0_SLP_BUTTON (1 << 5)
  186. #define EFI_ACPI_2_0_FIX_RTC (1 << 6)
  187. #define EFI_ACPI_2_0_RTC_S4 (1 << 7)
  188. #define EFI_ACPI_2_0_TMR_VAL_EXT (1 << 8)
  189. #define EFI_ACPI_2_0_DCK_CAP (1 << 9)
  190. #define EFI_ACPI_2_0_RESET_REG_SUP (1 << 10)
  191. #define EFI_ACPI_2_0_SEALED_CASE (1 << 11)
  192. #define EFI_ACPI_2_0_HEADLESS (1 << 12)
  193. #define EFI_ACPI_2_0_CPU_SW_SLP (1 << 13)
  194. //
  195. // Firmware ACPI Control Structure
  196. //
  197. typedef struct {
  198. UINT32 Signature;
  199. UINT32 Length;
  200. UINT32 HardwareSignature;
  201. UINT32 FirmwareWakingVector;
  202. UINT32 GlobalLock;
  203. UINT32 Flags;
  204. UINT64 XFirmwareWakingVector;
  205. UINT8 Version;
  206. UINT8 Reserved[31];
  207. } EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
  208. //
  209. // FACS Version (as defined in ACPI 2.0 spec.)
  210. //
  211. #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
  212. //
  213. // Firmware Control Structure Feature Flags
  214. // All other bits are reserved and must be set to 0.
  215. //
  216. #define EFI_ACPI_2_0_S4BIOS_F (1 << 0)
  217. //
  218. // Multiple APIC Description Table header definition. The rest of the table
  219. // must be defined in a platform specific manner.
  220. //
  221. typedef struct {
  222. EFI_ACPI_DESCRIPTION_HEADER Header;
  223. UINT32 LocalApicAddress;
  224. UINT32 Flags;
  225. } EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
  226. //
  227. // MADT Revision (as defined in ACPI 2.0 spec.)
  228. //
  229. #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
  230. //
  231. // Multiple APIC Flags
  232. // All other bits are reserved and must be set to 0.
  233. //
  234. #define EFI_ACPI_2_0_PCAT_COMPAT (1 << 0)
  235. //
  236. // Multiple APIC Description Table APIC structure types
  237. // All other values between 0x09 an 0xFF are reserved and
  238. // will be ignored by OSPM.
  239. //
  240. #define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
  241. #define EFI_ACPI_2_0_IO_APIC 0x01
  242. #define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
  243. #define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
  244. #define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
  245. #define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
  246. #define EFI_ACPI_2_0_IO_SAPIC 0x06
  247. #define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
  248. #define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
  249. //
  250. // APIC Structure Definitions
  251. //
  252. //
  253. // Processor Local APIC Structure Definition
  254. //
  255. typedef struct {
  256. UINT8 Type;
  257. UINT8 Length;
  258. UINT8 AcpiProcessorId;
  259. UINT8 ApicId;
  260. UINT32 Flags;
  261. } EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
  262. //
  263. // Local APIC Flags. All other bits are reserved and must be 0.
  264. //
  265. #define EFI_ACPI_2_0_LOCAL_APIC_ENABLED (1 << 0)
  266. //
  267. // IO APIC Structure
  268. //
  269. typedef struct {
  270. UINT8 Type;
  271. UINT8 Length;
  272. UINT8 IoApicId;
  273. UINT8 Reserved;
  274. UINT32 IoApicAddress;
  275. UINT32 GlobalSystemInterruptBase;
  276. } EFI_ACPI_2_0_IO_APIC_STRUCTURE;
  277. //
  278. // Interrupt Source Override Structure
  279. //
  280. typedef struct {
  281. UINT8 Type;
  282. UINT8 Length;
  283. UINT8 Bus;
  284. UINT8 Source;
  285. UINT32 GlobalSystemInterrupt;
  286. UINT16 Flags;
  287. } EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
  288. //
  289. // Non-Maskable Interrupt Source Structure
  290. //
  291. typedef struct {
  292. UINT8 Type;
  293. UINT8 Length;
  294. UINT16 Flags;
  295. UINT32 GlobalSystemInterrupt;
  296. } EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
  297. //
  298. // Local APIC NMI Structure
  299. //
  300. typedef struct {
  301. UINT8 Type;
  302. UINT8 Length;
  303. UINT8 AcpiProcessorId;
  304. UINT16 Flags;
  305. UINT8 LocalApicLint;
  306. } EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
  307. //
  308. // Local APIC Address Override Structure
  309. //
  310. typedef struct {
  311. UINT8 Type;
  312. UINT8 Length;
  313. UINT16 Reserved;
  314. UINT64 LocalApicAddress;
  315. } EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
  316. //
  317. // IO SAPIC Structure
  318. //
  319. typedef struct {
  320. UINT8 Type;
  321. UINT8 Length;
  322. UINT8 IoApicId;
  323. UINT8 Reserved;
  324. UINT32 GlobalSystemInterruptBase;
  325. UINT64 IoSapicAddress;
  326. } EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
  327. //
  328. // Local SAPIC Structure
  329. //
  330. typedef struct {
  331. UINT8 Type;
  332. UINT8 Length;
  333. UINT8 AcpiProcessorId;
  334. UINT8 LocalSapicId;
  335. UINT8 LocalSapicEid;
  336. UINT8 Reserved[3];
  337. UINT32 Flags;
  338. } EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
  339. //
  340. // Platform Interrupt Sources Structure
  341. //
  342. typedef struct {
  343. UINT8 Type;
  344. UINT8 Length;
  345. UINT16 Flags;
  346. UINT8 InterruptType;
  347. UINT8 ProcessorId;
  348. UINT8 ProcessorEid;
  349. UINT8 IoSapicVector;
  350. UINT32 GlobalSystemInterrupt;
  351. UINT32 Reserved;
  352. } EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
  353. //
  354. // Smart Battery Description Table (SBST)
  355. //
  356. typedef struct {
  357. EFI_ACPI_DESCRIPTION_HEADER Header;
  358. UINT32 WarningEnergyLevel;
  359. UINT32 LowEnergyLevel;
  360. UINT32 CriticalEnergyLevel;
  361. } EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
  362. //
  363. // SBST Version (as defined in ACPI 2.0 spec.)
  364. //
  365. #define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
  366. //
  367. // Embedded Controller Boot Resources Table (ECDT)
  368. // The table is followed by a null terminated ASCII string that contains
  369. // a fully qualified reference to the name space object.
  370. //
  371. typedef struct {
  372. EFI_ACPI_DESCRIPTION_HEADER Header;
  373. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
  374. EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
  375. UINT32 Uid;
  376. UINT8 GpeBit;
  377. } EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
  378. //
  379. // ECDT Version (as defined in ACPI 2.0 spec.)
  380. //
  381. #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
  382. //
  383. // Known table signatures
  384. //
  385. //
  386. // "RSD PTR " Root System Description Pointer
  387. //
  388. #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352
  389. //
  390. // "SPIC" Multiple SAPIC Description Table
  391. //
  392. // BUGBUG: Don't know where this came from except SR870BN4 uses it.
  393. // #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
  394. //
  395. #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
  396. //
  397. // "BOOT" MS Simple Boot Spec
  398. //
  399. #define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
  400. //
  401. // "DBGP" MS Bebug Port Spec
  402. //
  403. #define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
  404. //
  405. // "DSDT" Differentiated System Description Table
  406. //
  407. #define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
  408. //
  409. // "ECDT" Embedded Controller Boot Resources Table
  410. //
  411. #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
  412. //
  413. // "ETDT" Event Timer Description Table
  414. //
  415. #define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
  416. //
  417. // "FACS" Firmware ACPI Control Structure
  418. //
  419. #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
  420. //
  421. // "FACP" Fixed ACPI Description Table
  422. //
  423. #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
  424. //
  425. // "APIC" Multiple APIC Description Table
  426. //
  427. #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
  428. //
  429. // "PSDT" Persistent System Description Table
  430. //
  431. #define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
  432. //
  433. // "RSDT" Root System Description Table
  434. //
  435. #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
  436. //
  437. // "SBST" Smart Battery Specification Table
  438. //
  439. #define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
  440. //
  441. // "SLIT" System Locality Information Table
  442. //
  443. #define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
  444. //
  445. // "SPCR" Serial Port Console Redirection Table
  446. //
  447. #define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
  448. //
  449. // "SRAT" Static Resource Affinity Table
  450. //
  451. #define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
  452. //
  453. // "SSDT" Secondary System Description Table
  454. //
  455. #define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
  456. //
  457. // "SPMI" Server Platform Management Interface Table
  458. //
  459. #define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE 0x494D5053
  460. //
  461. // "XSDT" Extended System Description Table
  462. //
  463. #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
  464. #pragma pack()
  465. #endif