actbl3.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895
  1. /******************************************************************************
  2. *
  3. * Name: actbl3.h - ACPI Table Definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2015, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACTBL3_H__
  43. #define __ACTBL3_H__
  44. /*******************************************************************************
  45. *
  46. * Additional ACPI Tables (3)
  47. *
  48. * These tables are not consumed directly by the ACPICA subsystem, but are
  49. * included here to support device drivers and the AML disassembler.
  50. *
  51. * In general, the tables in this file are fully defined within the ACPI
  52. * specification.
  53. *
  54. ******************************************************************************/
  55. /*
  56. * Values for description table header signatures for tables defined in this
  57. * file. Useful because they make it more difficult to inadvertently type in
  58. * the wrong signature.
  59. */
  60. #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
  61. #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
  62. #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
  63. #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
  64. #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
  65. #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
  66. #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
  67. #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
  68. #define ACPI_SIG_STAO "STAO" /* Status Override table */
  69. #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
  70. #define ACPI_SIG_XENV "XENV" /* Xen Environment table */
  71. #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
  72. #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
  73. /* Reserved table signatures */
  74. #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
  75. #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
  76. /*
  77. * All tables must be byte-packed to match the ACPI specification, since
  78. * the tables are provided by the system BIOS.
  79. */
  80. #pragma pack(1)
  81. /*
  82. * Note: C bitfields are not used for this reason:
  83. *
  84. * "Bitfields are great and easy to read, but unfortunately the C language
  85. * does not specify the layout of bitfields in memory, which means they are
  86. * essentially useless for dealing with packed data in on-disk formats or
  87. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  88. * this decision was a design error in C. Ritchie could have picked an order
  89. * and stuck with it." Norman Ramsey.
  90. * See http://stackoverflow.com/a/1053662/41661
  91. */
  92. /*******************************************************************************
  93. *
  94. * BGRT - Boot Graphics Resource Table (ACPI 5.0)
  95. * Version 1
  96. *
  97. ******************************************************************************/
  98. typedef struct acpi_table_bgrt
  99. {
  100. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  101. UINT16 Version;
  102. UINT8 Status;
  103. UINT8 ImageType;
  104. UINT64 ImageAddress;
  105. UINT32 ImageOffsetX;
  106. UINT32 ImageOffsetY;
  107. } ACPI_TABLE_BGRT;
  108. /*******************************************************************************
  109. *
  110. * DRTM - Dynamic Root of Trust for Measurement table
  111. * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
  112. * Table version 1
  113. *
  114. ******************************************************************************/
  115. typedef struct acpi_table_drtm
  116. {
  117. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  118. UINT64 EntryBaseAddress;
  119. UINT64 EntryLength;
  120. UINT32 EntryAddress32;
  121. UINT64 EntryAddress64;
  122. UINT64 ExitAddress;
  123. UINT64 LogAreaAddress;
  124. UINT32 LogAreaLength;
  125. UINT64 ArchDependentAddress;
  126. UINT32 Flags;
  127. } ACPI_TABLE_DRTM;
  128. /* Flag Definitions for above */
  129. #define ACPI_DRTM_ACCESS_ALLOWED (1)
  130. #define ACPI_DRTM_ENABLE_GAP_CODE (1<<1)
  131. #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2)
  132. #define ACPI_DRTM_AUTHORITY_ORDER (1<<3)
  133. /* 1) Validated Tables List (64-bit addresses) */
  134. typedef struct acpi_drtm_vtable_list
  135. {
  136. UINT32 ValidatedTableCount;
  137. UINT64 ValidatedTables[1];
  138. } ACPI_DRTM_VTABLE_LIST;
  139. /* 2) Resources List (of Resource Descriptors) */
  140. /* Resource Descriptor */
  141. typedef struct acpi_drtm_resource
  142. {
  143. UINT8 Size[7];
  144. UINT8 Type;
  145. UINT64 Address;
  146. } ACPI_DRTM_RESOURCE;
  147. typedef struct acpi_drtm_resource_list
  148. {
  149. UINT32 ResourceCount;
  150. ACPI_DRTM_RESOURCE Resources[1];
  151. } ACPI_DRTM_RESOURCE_LIST;
  152. /* 3) Platform-specific Identifiers List */
  153. typedef struct acpi_drtm_dps_id
  154. {
  155. UINT32 DpsIdLength;
  156. UINT8 DpsId[16];
  157. } ACPI_DRTM_DPS_ID;
  158. /*******************************************************************************
  159. *
  160. * FPDT - Firmware Performance Data Table (ACPI 5.0)
  161. * Version 1
  162. *
  163. ******************************************************************************/
  164. typedef struct acpi_table_fpdt
  165. {
  166. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  167. } ACPI_TABLE_FPDT;
  168. /* FPDT subtable header */
  169. typedef struct acpi_fpdt_header
  170. {
  171. UINT16 Type;
  172. UINT8 Length;
  173. UINT8 Revision;
  174. } ACPI_FPDT_HEADER;
  175. /* Values for Type field above */
  176. enum AcpiFpdtType
  177. {
  178. ACPI_FPDT_TYPE_BOOT = 0,
  179. ACPI_FPDT_TYPE_S3PERF = 1
  180. };
  181. /*
  182. * FPDT subtables
  183. */
  184. /* 0: Firmware Basic Boot Performance Record */
  185. typedef struct acpi_fpdt_boot
  186. {
  187. ACPI_FPDT_HEADER Header;
  188. UINT8 Reserved[4];
  189. UINT64 ResetEnd;
  190. UINT64 LoadStart;
  191. UINT64 StartupStart;
  192. UINT64 ExitServicesEntry;
  193. UINT64 ExitServicesExit;
  194. } ACPI_FPDT_BOOT;
  195. /* 1: S3 Performance Table Pointer Record */
  196. typedef struct acpi_fpdt_s3pt_ptr
  197. {
  198. ACPI_FPDT_HEADER Header;
  199. UINT8 Reserved[4];
  200. UINT64 Address;
  201. } ACPI_FPDT_S3PT_PTR;
  202. /*
  203. * S3PT - S3 Performance Table. This table is pointed to by the
  204. * FPDT S3 Pointer Record above.
  205. */
  206. typedef struct acpi_table_s3pt
  207. {
  208. UINT8 Signature[4]; /* "S3PT" */
  209. UINT32 Length;
  210. } ACPI_TABLE_S3PT;
  211. /*
  212. * S3PT Subtables
  213. */
  214. typedef struct acpi_s3pt_header
  215. {
  216. UINT16 Type;
  217. UINT8 Length;
  218. UINT8 Revision;
  219. } ACPI_S3PT_HEADER;
  220. /* Values for Type field above */
  221. enum AcpiS3ptType
  222. {
  223. ACPI_S3PT_TYPE_RESUME = 0,
  224. ACPI_S3PT_TYPE_SUSPEND = 1
  225. };
  226. typedef struct acpi_s3pt_resume
  227. {
  228. ACPI_S3PT_HEADER Header;
  229. UINT32 ResumeCount;
  230. UINT64 FullResume;
  231. UINT64 AverageResume;
  232. } ACPI_S3PT_RESUME;
  233. typedef struct acpi_s3pt_suspend
  234. {
  235. ACPI_S3PT_HEADER Header;
  236. UINT64 SuspendStart;
  237. UINT64 SuspendEnd;
  238. } ACPI_S3PT_SUSPEND;
  239. /*******************************************************************************
  240. *
  241. * GTDT - Generic Timer Description Table (ACPI 5.1)
  242. * Version 2
  243. *
  244. ******************************************************************************/
  245. typedef struct acpi_table_gtdt
  246. {
  247. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  248. UINT64 CounterBlockAddresss;
  249. UINT32 Reserved;
  250. UINT32 SecureEl1Interrupt;
  251. UINT32 SecureEl1Flags;
  252. UINT32 NonSecureEl1Interrupt;
  253. UINT32 NonSecureEl1Flags;
  254. UINT32 VirtualTimerInterrupt;
  255. UINT32 VirtualTimerFlags;
  256. UINT32 NonSecureEl2Interrupt;
  257. UINT32 NonSecureEl2Flags;
  258. UINT64 CounterReadBlockAddress;
  259. UINT32 PlatformTimerCount;
  260. UINT32 PlatformTimerOffset;
  261. } ACPI_TABLE_GTDT;
  262. /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
  263. #define ACPI_GTDT_INTERRUPT_MODE (1)
  264. #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
  265. #define ACPI_GTDT_ALWAYS_ON (1<<2)
  266. /* Common GTDT subtable header */
  267. typedef struct acpi_gtdt_header
  268. {
  269. UINT8 Type;
  270. UINT16 Length;
  271. } ACPI_GTDT_HEADER;
  272. /* Values for GTDT subtable type above */
  273. enum AcpiGtdtType
  274. {
  275. ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
  276. ACPI_GTDT_TYPE_WATCHDOG = 1,
  277. ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  278. };
  279. /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
  280. /* 0: Generic Timer Block */
  281. typedef struct acpi_gtdt_timer_block
  282. {
  283. ACPI_GTDT_HEADER Header;
  284. UINT8 Reserved;
  285. UINT64 BlockAddress;
  286. UINT32 TimerCount;
  287. UINT32 TimerOffset;
  288. } ACPI_GTDT_TIMER_BLOCK;
  289. /* Timer Sub-Structure, one per timer */
  290. typedef struct acpi_gtdt_timer_entry
  291. {
  292. UINT8 FrameNumber;
  293. UINT8 Reserved[3];
  294. UINT64 BaseAddress;
  295. UINT64 El0BaseAddress;
  296. UINT32 TimerInterrupt;
  297. UINT32 TimerFlags;
  298. UINT32 VirtualTimerInterrupt;
  299. UINT32 VirtualTimerFlags;
  300. UINT32 CommonFlags;
  301. } ACPI_GTDT_TIMER_ENTRY;
  302. /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
  303. #define ACPI_GTDT_GT_IRQ_MODE (1)
  304. #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
  305. /* Flag Definitions: CommonFlags above */
  306. #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
  307. #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
  308. /* 1: SBSA Generic Watchdog Structure */
  309. typedef struct acpi_gtdt_watchdog
  310. {
  311. ACPI_GTDT_HEADER Header;
  312. UINT8 Reserved;
  313. UINT64 RefreshFrameAddress;
  314. UINT64 ControlFrameAddress;
  315. UINT32 TimerInterrupt;
  316. UINT32 TimerFlags;
  317. } ACPI_GTDT_WATCHDOG;
  318. /* Flag Definitions: TimerFlags above */
  319. #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
  320. #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
  321. #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
  322. /*******************************************************************************
  323. *
  324. * MPST - Memory Power State Table (ACPI 5.0)
  325. * Version 1
  326. *
  327. ******************************************************************************/
  328. #define ACPI_MPST_CHANNEL_INFO \
  329. UINT8 ChannelId; \
  330. UINT8 Reserved1[3]; \
  331. UINT16 PowerNodeCount; \
  332. UINT16 Reserved2;
  333. /* Main table */
  334. typedef struct acpi_table_mpst
  335. {
  336. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  337. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  338. } ACPI_TABLE_MPST;
  339. /* Memory Platform Communication Channel Info */
  340. typedef struct acpi_mpst_channel
  341. {
  342. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  343. } ACPI_MPST_CHANNEL;
  344. /* Memory Power Node Structure */
  345. typedef struct acpi_mpst_power_node
  346. {
  347. UINT8 Flags;
  348. UINT8 Reserved1;
  349. UINT16 NodeId;
  350. UINT32 Length;
  351. UINT64 RangeAddress;
  352. UINT64 RangeLength;
  353. UINT32 NumPowerStates;
  354. UINT32 NumPhysicalComponents;
  355. } ACPI_MPST_POWER_NODE;
  356. /* Values for Flags field above */
  357. #define ACPI_MPST_ENABLED 1
  358. #define ACPI_MPST_POWER_MANAGED 2
  359. #define ACPI_MPST_HOT_PLUG_CAPABLE 4
  360. /* Memory Power State Structure (follows POWER_NODE above) */
  361. typedef struct acpi_mpst_power_state
  362. {
  363. UINT8 PowerState;
  364. UINT8 InfoIndex;
  365. } ACPI_MPST_POWER_STATE;
  366. /* Physical Component ID Structure (follows POWER_STATE above) */
  367. typedef struct acpi_mpst_component
  368. {
  369. UINT16 ComponentId;
  370. } ACPI_MPST_COMPONENT;
  371. /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
  372. typedef struct acpi_mpst_data_hdr
  373. {
  374. UINT16 CharacteristicsCount;
  375. UINT16 Reserved;
  376. } ACPI_MPST_DATA_HDR;
  377. typedef struct acpi_mpst_power_data
  378. {
  379. UINT8 StructureId;
  380. UINT8 Flags;
  381. UINT16 Reserved1;
  382. UINT32 AveragePower;
  383. UINT32 PowerSaving;
  384. UINT64 ExitLatency;
  385. UINT64 Reserved2;
  386. } ACPI_MPST_POWER_DATA;
  387. /* Values for Flags field above */
  388. #define ACPI_MPST_PRESERVE 1
  389. #define ACPI_MPST_AUTOENTRY 2
  390. #define ACPI_MPST_AUTOEXIT 4
  391. /* Shared Memory Region (not part of an ACPI table) */
  392. typedef struct acpi_mpst_shared
  393. {
  394. UINT32 Signature;
  395. UINT16 PccCommand;
  396. UINT16 PccStatus;
  397. UINT32 CommandRegister;
  398. UINT32 StatusRegister;
  399. UINT32 PowerStateId;
  400. UINT32 PowerNodeId;
  401. UINT64 EnergyConsumed;
  402. UINT64 AveragePower;
  403. } ACPI_MPST_SHARED;
  404. /*******************************************************************************
  405. *
  406. * PCCT - Platform Communications Channel Table (ACPI 5.0)
  407. * Version 1
  408. *
  409. ******************************************************************************/
  410. typedef struct acpi_table_pcct
  411. {
  412. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  413. UINT32 Flags;
  414. UINT64 Reserved;
  415. } ACPI_TABLE_PCCT;
  416. /* Values for Flags field above */
  417. #define ACPI_PCCT_DOORBELL 1
  418. /* Values for subtable type in ACPI_SUBTABLE_HEADER */
  419. enum AcpiPcctType
  420. {
  421. ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
  422. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
  423. ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  424. };
  425. /*
  426. * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
  427. */
  428. /* 0: Generic Communications Subspace */
  429. typedef struct acpi_pcct_subspace
  430. {
  431. ACPI_SUBTABLE_HEADER Header;
  432. UINT8 Reserved[6];
  433. UINT64 BaseAddress;
  434. UINT64 Length;
  435. ACPI_GENERIC_ADDRESS DoorbellRegister;
  436. UINT64 PreserveMask;
  437. UINT64 WriteMask;
  438. UINT32 Latency;
  439. UINT32 MaxAccessRate;
  440. UINT16 MinTurnaroundTime;
  441. } ACPI_PCCT_SUBSPACE;
  442. /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
  443. typedef struct acpi_pcct_hw_reduced
  444. {
  445. ACPI_SUBTABLE_HEADER Header;
  446. UINT32 DoorbellInterrupt;
  447. UINT8 Flags;
  448. UINT8 Reserved;
  449. UINT64 BaseAddress;
  450. UINT64 Length;
  451. ACPI_GENERIC_ADDRESS DoorbellRegister;
  452. UINT64 PreserveMask;
  453. UINT64 WriteMask;
  454. UINT32 Latency;
  455. UINT32 MaxAccessRate;
  456. UINT16 MinTurnaroundTime;
  457. } ACPI_PCCT_HW_REDUCED;
  458. /* Values for doorbell flags above */
  459. #define ACPI_PCCT_INTERRUPT_POLARITY (1)
  460. #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
  461. /*
  462. * PCC memory structures (not part of the ACPI table)
  463. */
  464. /* Shared Memory Region */
  465. typedef struct acpi_pcct_shared_memory
  466. {
  467. UINT32 Signature;
  468. UINT16 Command;
  469. UINT16 Status;
  470. } ACPI_PCCT_SHARED_MEMORY;
  471. /*******************************************************************************
  472. *
  473. * PMTT - Platform Memory Topology Table (ACPI 5.0)
  474. * Version 1
  475. *
  476. ******************************************************************************/
  477. typedef struct acpi_table_pmtt
  478. {
  479. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  480. UINT32 Reserved;
  481. } ACPI_TABLE_PMTT;
  482. /* Common header for PMTT subtables that follow main table */
  483. typedef struct acpi_pmtt_header
  484. {
  485. UINT8 Type;
  486. UINT8 Reserved1;
  487. UINT16 Length;
  488. UINT16 Flags;
  489. UINT16 Reserved2;
  490. } ACPI_PMTT_HEADER;
  491. /* Values for Type field above */
  492. #define ACPI_PMTT_TYPE_SOCKET 0
  493. #define ACPI_PMTT_TYPE_CONTROLLER 1
  494. #define ACPI_PMTT_TYPE_DIMM 2
  495. #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
  496. /* Values for Flags field above */
  497. #define ACPI_PMTT_TOP_LEVEL 0x0001
  498. #define ACPI_PMTT_PHYSICAL 0x0002
  499. #define ACPI_PMTT_MEMORY_TYPE 0x000C
  500. /*
  501. * PMTT subtables, correspond to Type in acpi_pmtt_header
  502. */
  503. /* 0: Socket Structure */
  504. typedef struct acpi_pmtt_socket
  505. {
  506. ACPI_PMTT_HEADER Header;
  507. UINT16 SocketId;
  508. UINT16 Reserved;
  509. } ACPI_PMTT_SOCKET;
  510. /* 1: Memory Controller subtable */
  511. typedef struct acpi_pmtt_controller
  512. {
  513. ACPI_PMTT_HEADER Header;
  514. UINT32 ReadLatency;
  515. UINT32 WriteLatency;
  516. UINT32 ReadBandwidth;
  517. UINT32 WriteBandwidth;
  518. UINT16 AccessWidth;
  519. UINT16 Alignment;
  520. UINT16 Reserved;
  521. UINT16 DomainCount;
  522. } ACPI_PMTT_CONTROLLER;
  523. /* 1a: Proximity Domain substructure */
  524. typedef struct acpi_pmtt_domain
  525. {
  526. UINT32 ProximityDomain;
  527. } ACPI_PMTT_DOMAIN;
  528. /* 2: Physical Component Identifier (DIMM) */
  529. typedef struct acpi_pmtt_physical_component
  530. {
  531. ACPI_PMTT_HEADER Header;
  532. UINT16 ComponentId;
  533. UINT16 Reserved;
  534. UINT32 MemorySize;
  535. UINT32 BiosHandle;
  536. } ACPI_PMTT_PHYSICAL_COMPONENT;
  537. /*******************************************************************************
  538. *
  539. * RASF - RAS Feature Table (ACPI 5.0)
  540. * Version 1
  541. *
  542. ******************************************************************************/
  543. typedef struct acpi_table_rasf
  544. {
  545. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  546. UINT8 ChannelId[12];
  547. } ACPI_TABLE_RASF;
  548. /* RASF Platform Communication Channel Shared Memory Region */
  549. typedef struct acpi_rasf_shared_memory
  550. {
  551. UINT32 Signature;
  552. UINT16 Command;
  553. UINT16 Status;
  554. UINT16 Version;
  555. UINT8 Capabilities[16];
  556. UINT8 SetCapabilities[16];
  557. UINT16 NumParameterBlocks;
  558. UINT32 SetCapabilitiesStatus;
  559. } ACPI_RASF_SHARED_MEMORY;
  560. /* RASF Parameter Block Structure Header */
  561. typedef struct acpi_rasf_parameter_block
  562. {
  563. UINT16 Type;
  564. UINT16 Version;
  565. UINT16 Length;
  566. } ACPI_RASF_PARAMETER_BLOCK;
  567. /* RASF Parameter Block Structure for PATROL_SCRUB */
  568. typedef struct acpi_rasf_patrol_scrub_parameter
  569. {
  570. ACPI_RASF_PARAMETER_BLOCK Header;
  571. UINT16 PatrolScrubCommand;
  572. UINT64 RequestedAddressRange[2];
  573. UINT64 ActualAddressRange[2];
  574. UINT16 Flags;
  575. UINT8 RequestedSpeed;
  576. } ACPI_RASF_PATROL_SCRUB_PARAMETER;
  577. /* Masks for Flags and Speed fields above */
  578. #define ACPI_RASF_SCRUBBER_RUNNING 1
  579. #define ACPI_RASF_SPEED (7<<1)
  580. #define ACPI_RASF_SPEED_SLOW (0<<1)
  581. #define ACPI_RASF_SPEED_MEDIUM (4<<1)
  582. #define ACPI_RASF_SPEED_FAST (7<<1)
  583. /* Channel Commands */
  584. enum AcpiRasfCommands
  585. {
  586. ACPI_RASF_EXECUTE_RASF_COMMAND = 1
  587. };
  588. /* Platform RAS Capabilities */
  589. enum AcpiRasfCapabiliities
  590. {
  591. ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
  592. ACPI_SW_PATROL_SCRUB_EXPOSED = 1
  593. };
  594. /* Patrol Scrub Commands */
  595. enum AcpiRasfPatrolScrubCommands
  596. {
  597. ACPI_RASF_GET_PATROL_PARAMETERS = 1,
  598. ACPI_RASF_START_PATROL_SCRUBBER = 2,
  599. ACPI_RASF_STOP_PATROL_SCRUBBER = 3
  600. };
  601. /* Channel Command flags */
  602. #define ACPI_RASF_GENERATE_SCI (1<<15)
  603. /* Status values */
  604. enum AcpiRasfStatus
  605. {
  606. ACPI_RASF_SUCCESS = 0,
  607. ACPI_RASF_NOT_VALID = 1,
  608. ACPI_RASF_NOT_SUPPORTED = 2,
  609. ACPI_RASF_BUSY = 3,
  610. ACPI_RASF_FAILED = 4,
  611. ACPI_RASF_ABORTED = 5,
  612. ACPI_RASF_INVALID_DATA = 6
  613. };
  614. /* Status flags */
  615. #define ACPI_RASF_COMMAND_COMPLETE (1)
  616. #define ACPI_RASF_SCI_DOORBELL (1<<1)
  617. #define ACPI_RASF_ERROR (1<<2)
  618. #define ACPI_RASF_STATUS (0x1F<<3)
  619. /*******************************************************************************
  620. *
  621. * STAO - Status Override Table (_STA override) - ACPI 6.0
  622. * Version 1
  623. *
  624. * Conforms to "ACPI Specification for Status Override Table"
  625. * 6 January 2015
  626. *
  627. ******************************************************************************/
  628. typedef struct acpi_table_stao
  629. {
  630. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  631. UINT8 IgnoreUart;
  632. } ACPI_TABLE_STAO;
  633. /*******************************************************************************
  634. *
  635. * WPBT - Windows Platform Environment Table (ACPI 6.0)
  636. * Version 1
  637. *
  638. * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
  639. *
  640. ******************************************************************************/
  641. typedef struct acpi_table_wpbt
  642. {
  643. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  644. UINT32 HandoffSize;
  645. UINT64 HandoffAddress;
  646. UINT8 Layout;
  647. UINT8 Type;
  648. UINT16 ArgumentsLength;
  649. } ACPI_TABLE_WPBT;
  650. /*******************************************************************************
  651. *
  652. * XENV - Xen Environment Table (ACPI 6.0)
  653. * Version 1
  654. *
  655. * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
  656. *
  657. ******************************************************************************/
  658. typedef struct acpi_table_xenv
  659. {
  660. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  661. UINT64 GrantTableAddress;
  662. UINT64 GrantTableSize;
  663. UINT32 EventInterrupt;
  664. UINT8 EventFlags;
  665. } ACPI_TABLE_XENV;
  666. /* Reset to default packing */
  667. #pragma pack()
  668. #endif /* __ACTBL3_H__ */