actbl3.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. /******************************************************************************
  2. *
  3. * Name: actbl3.h - ACPI Table Definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2017, 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. struct acpi_table_bgrt {
  99. struct acpi_table_header header; /* Common ACPI table header */
  100. u16 version;
  101. u8 status;
  102. u8 image_type;
  103. u64 image_address;
  104. u32 image_offset_x;
  105. u32 image_offset_y;
  106. };
  107. /* Flags for Status field above */
  108. #define ACPI_BGRT_DISPLAYED (1)
  109. #define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1)
  110. /*******************************************************************************
  111. *
  112. * DRTM - Dynamic Root of Trust for Measurement table
  113. * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
  114. * Table version 1
  115. *
  116. ******************************************************************************/
  117. struct acpi_table_drtm {
  118. struct acpi_table_header header; /* Common ACPI table header */
  119. u64 entry_base_address;
  120. u64 entry_length;
  121. u32 entry_address32;
  122. u64 entry_address64;
  123. u64 exit_address;
  124. u64 log_area_address;
  125. u32 log_area_length;
  126. u64 arch_dependent_address;
  127. u32 flags;
  128. };
  129. /* Flag Definitions for above */
  130. #define ACPI_DRTM_ACCESS_ALLOWED (1)
  131. #define ACPI_DRTM_ENABLE_GAP_CODE (1<<1)
  132. #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2)
  133. #define ACPI_DRTM_AUTHORITY_ORDER (1<<3)
  134. /* 1) Validated Tables List (64-bit addresses) */
  135. struct acpi_drtm_vtable_list {
  136. u32 validated_table_count;
  137. u64 validated_tables[1];
  138. };
  139. /* 2) Resources List (of Resource Descriptors) */
  140. /* Resource Descriptor */
  141. struct acpi_drtm_resource {
  142. u8 size[7];
  143. u8 type;
  144. u64 address;
  145. };
  146. struct acpi_drtm_resource_list {
  147. u32 resource_count;
  148. struct acpi_drtm_resource resources[1];
  149. };
  150. /* 3) Platform-specific Identifiers List */
  151. struct acpi_drtm_dps_id {
  152. u32 dps_id_length;
  153. u8 dps_id[16];
  154. };
  155. /*******************************************************************************
  156. *
  157. * FPDT - Firmware Performance Data Table (ACPI 5.0)
  158. * Version 1
  159. *
  160. ******************************************************************************/
  161. struct acpi_table_fpdt {
  162. struct acpi_table_header header; /* Common ACPI table header */
  163. };
  164. /* FPDT subtable header (Performance Record Structure) */
  165. struct acpi_fpdt_header {
  166. u16 type;
  167. u8 length;
  168. u8 revision;
  169. };
  170. /* Values for Type field above */
  171. enum acpi_fpdt_type {
  172. ACPI_FPDT_TYPE_BOOT = 0,
  173. ACPI_FPDT_TYPE_S3PERF = 1
  174. };
  175. /*
  176. * FPDT subtables
  177. */
  178. /* 0: Firmware Basic Boot Performance Record */
  179. struct acpi_fpdt_boot_pointer {
  180. struct acpi_fpdt_header header;
  181. u8 reserved[4];
  182. u64 address;
  183. };
  184. /* 1: S3 Performance Table Pointer Record */
  185. struct acpi_fpdt_s3pt_pointer {
  186. struct acpi_fpdt_header header;
  187. u8 reserved[4];
  188. u64 address;
  189. };
  190. /*
  191. * S3PT - S3 Performance Table. This table is pointed to by the
  192. * S3 Pointer Record above.
  193. */
  194. struct acpi_table_s3pt {
  195. u8 signature[4]; /* "S3PT" */
  196. u32 length;
  197. };
  198. /*
  199. * S3PT Subtables (Not part of the actual FPDT)
  200. */
  201. /* Values for Type field in S3PT header */
  202. enum acpi_s3pt_type {
  203. ACPI_S3PT_TYPE_RESUME = 0,
  204. ACPI_S3PT_TYPE_SUSPEND = 1,
  205. ACPI_FPDT_BOOT_PERFORMANCE = 2
  206. };
  207. struct acpi_s3pt_resume {
  208. struct acpi_fpdt_header header;
  209. u32 resume_count;
  210. u64 full_resume;
  211. u64 average_resume;
  212. };
  213. struct acpi_s3pt_suspend {
  214. struct acpi_fpdt_header header;
  215. u64 suspend_start;
  216. u64 suspend_end;
  217. };
  218. /*
  219. * FPDT Boot Performance Record (Not part of the actual FPDT)
  220. */
  221. struct acpi_fpdt_boot {
  222. struct acpi_fpdt_header header;
  223. u8 reserved[4];
  224. u64 reset_end;
  225. u64 load_start;
  226. u64 startup_start;
  227. u64 exit_services_entry;
  228. u64 exit_services_exit;
  229. };
  230. /*******************************************************************************
  231. *
  232. * GTDT - Generic Timer Description Table (ACPI 5.1)
  233. * Version 2
  234. *
  235. ******************************************************************************/
  236. struct acpi_table_gtdt {
  237. struct acpi_table_header header; /* Common ACPI table header */
  238. u64 counter_block_addresss;
  239. u32 reserved;
  240. u32 secure_el1_interrupt;
  241. u32 secure_el1_flags;
  242. u32 non_secure_el1_interrupt;
  243. u32 non_secure_el1_flags;
  244. u32 virtual_timer_interrupt;
  245. u32 virtual_timer_flags;
  246. u32 non_secure_el2_interrupt;
  247. u32 non_secure_el2_flags;
  248. u64 counter_read_block_address;
  249. u32 platform_timer_count;
  250. u32 platform_timer_offset;
  251. };
  252. /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
  253. #define ACPI_GTDT_INTERRUPT_MODE (1)
  254. #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
  255. #define ACPI_GTDT_ALWAYS_ON (1<<2)
  256. /* Common GTDT subtable header */
  257. struct acpi_gtdt_header {
  258. u8 type;
  259. u16 length;
  260. };
  261. /* Values for GTDT subtable type above */
  262. enum acpi_gtdt_type {
  263. ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
  264. ACPI_GTDT_TYPE_WATCHDOG = 1,
  265. ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  266. };
  267. /* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
  268. /* 0: Generic Timer Block */
  269. struct acpi_gtdt_timer_block {
  270. struct acpi_gtdt_header header;
  271. u8 reserved;
  272. u64 block_address;
  273. u32 timer_count;
  274. u32 timer_offset;
  275. };
  276. /* Timer Sub-Structure, one per timer */
  277. struct acpi_gtdt_timer_entry {
  278. u8 frame_number;
  279. u8 reserved[3];
  280. u64 base_address;
  281. u64 el0_base_address;
  282. u32 timer_interrupt;
  283. u32 timer_flags;
  284. u32 virtual_timer_interrupt;
  285. u32 virtual_timer_flags;
  286. u32 common_flags;
  287. };
  288. /* Flag Definitions: timer_flags and virtual_timer_flags above */
  289. #define ACPI_GTDT_GT_IRQ_MODE (1)
  290. #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
  291. /* Flag Definitions: common_flags above */
  292. #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
  293. #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
  294. /* 1: SBSA Generic Watchdog Structure */
  295. struct acpi_gtdt_watchdog {
  296. struct acpi_gtdt_header header;
  297. u8 reserved;
  298. u64 refresh_frame_address;
  299. u64 control_frame_address;
  300. u32 timer_interrupt;
  301. u32 timer_flags;
  302. };
  303. /* Flag Definitions: timer_flags above */
  304. #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
  305. #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
  306. #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
  307. /*******************************************************************************
  308. *
  309. * MPST - Memory Power State Table (ACPI 5.0)
  310. * Version 1
  311. *
  312. ******************************************************************************/
  313. #define ACPI_MPST_CHANNEL_INFO \
  314. u8 channel_id; \
  315. u8 reserved1[3]; \
  316. u16 power_node_count; \
  317. u16 reserved2;
  318. /* Main table */
  319. struct acpi_table_mpst {
  320. struct acpi_table_header header; /* Common ACPI table header */
  321. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  322. };
  323. /* Memory Platform Communication Channel Info */
  324. struct acpi_mpst_channel {
  325. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  326. };
  327. /* Memory Power Node Structure */
  328. struct acpi_mpst_power_node {
  329. u8 flags;
  330. u8 reserved1;
  331. u16 node_id;
  332. u32 length;
  333. u64 range_address;
  334. u64 range_length;
  335. u32 num_power_states;
  336. u32 num_physical_components;
  337. };
  338. /* Values for Flags field above */
  339. #define ACPI_MPST_ENABLED 1
  340. #define ACPI_MPST_POWER_MANAGED 2
  341. #define ACPI_MPST_HOT_PLUG_CAPABLE 4
  342. /* Memory Power State Structure (follows POWER_NODE above) */
  343. struct acpi_mpst_power_state {
  344. u8 power_state;
  345. u8 info_index;
  346. };
  347. /* Physical Component ID Structure (follows POWER_STATE above) */
  348. struct acpi_mpst_component {
  349. u16 component_id;
  350. };
  351. /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
  352. struct acpi_mpst_data_hdr {
  353. u16 characteristics_count;
  354. u16 reserved;
  355. };
  356. struct acpi_mpst_power_data {
  357. u8 structure_id;
  358. u8 flags;
  359. u16 reserved1;
  360. u32 average_power;
  361. u32 power_saving;
  362. u64 exit_latency;
  363. u64 reserved2;
  364. };
  365. /* Values for Flags field above */
  366. #define ACPI_MPST_PRESERVE 1
  367. #define ACPI_MPST_AUTOENTRY 2
  368. #define ACPI_MPST_AUTOEXIT 4
  369. /* Shared Memory Region (not part of an ACPI table) */
  370. struct acpi_mpst_shared {
  371. u32 signature;
  372. u16 pcc_command;
  373. u16 pcc_status;
  374. u32 command_register;
  375. u32 status_register;
  376. u32 power_state_id;
  377. u32 power_node_id;
  378. u64 energy_consumed;
  379. u64 average_power;
  380. };
  381. /*******************************************************************************
  382. *
  383. * PCCT - Platform Communications Channel Table (ACPI 5.0)
  384. * Version 2 (ACPI 6.2)
  385. *
  386. ******************************************************************************/
  387. struct acpi_table_pcct {
  388. struct acpi_table_header header; /* Common ACPI table header */
  389. u32 flags;
  390. u64 reserved;
  391. };
  392. /* Values for Flags field above */
  393. #define ACPI_PCCT_DOORBELL 1
  394. /* Values for subtable type in struct acpi_subtable_header */
  395. enum acpi_pcct_type {
  396. ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
  397. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
  398. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
  399. ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
  400. ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
  401. ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
  402. };
  403. /*
  404. * PCCT Subtables, correspond to Type in struct acpi_subtable_header
  405. */
  406. /* 0: Generic Communications Subspace */
  407. struct acpi_pcct_subspace {
  408. struct acpi_subtable_header header;
  409. u8 reserved[6];
  410. u64 base_address;
  411. u64 length;
  412. struct acpi_generic_address doorbell_register;
  413. u64 preserve_mask;
  414. u64 write_mask;
  415. u32 latency;
  416. u32 max_access_rate;
  417. u16 min_turnaround_time;
  418. };
  419. /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
  420. struct acpi_pcct_hw_reduced {
  421. struct acpi_subtable_header header;
  422. u32 platform_interrupt;
  423. u8 flags;
  424. u8 reserved;
  425. u64 base_address;
  426. u64 length;
  427. struct acpi_generic_address doorbell_register;
  428. u64 preserve_mask;
  429. u64 write_mask;
  430. u32 latency;
  431. u32 max_access_rate;
  432. u16 min_turnaround_time;
  433. };
  434. /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
  435. struct acpi_pcct_hw_reduced_type2 {
  436. struct acpi_subtable_header header;
  437. u32 platform_interrupt;
  438. u8 flags;
  439. u8 reserved;
  440. u64 base_address;
  441. u64 length;
  442. struct acpi_generic_address doorbell_register;
  443. u64 preserve_mask;
  444. u64 write_mask;
  445. u32 latency;
  446. u32 max_access_rate;
  447. u16 min_turnaround_time;
  448. struct acpi_generic_address platform_ack_register;
  449. u64 ack_preserve_mask;
  450. u64 ack_write_mask;
  451. };
  452. /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
  453. struct acpi_pcct_ext_pcc_master {
  454. struct acpi_subtable_header header;
  455. u32 platform_interrupt;
  456. u8 flags;
  457. u8 reserved1;
  458. u64 base_address;
  459. u32 length;
  460. struct acpi_generic_address doorbell_register;
  461. u64 preserve_mask;
  462. u64 write_mask;
  463. u32 latency;
  464. u32 max_access_rate;
  465. u32 min_turnaround_time;
  466. struct acpi_generic_address platform_ack_register;
  467. u64 ack_preserve_mask;
  468. u64 ack_set_mask;
  469. u64 reserved2;
  470. struct acpi_generic_address cmd_complete_register;
  471. u64 cmd_complete_mask;
  472. struct acpi_generic_address cmd_update_register;
  473. u64 cmd_update_preserve_mask;
  474. u64 cmd_update_set_mask;
  475. struct acpi_generic_address error_status_register;
  476. u64 error_status_mask;
  477. };
  478. /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
  479. struct acpi_pcct_ext_pcc_slave {
  480. struct acpi_subtable_header header;
  481. u32 platform_interrupt;
  482. u8 flags;
  483. u8 reserved1;
  484. u64 base_address;
  485. u32 length;
  486. struct acpi_generic_address doorbell_register;
  487. u64 preserve_mask;
  488. u64 write_mask;
  489. u32 latency;
  490. u32 max_access_rate;
  491. u32 min_turnaround_time;
  492. struct acpi_generic_address platform_ack_register;
  493. u64 ack_preserve_mask;
  494. u64 ack_set_mask;
  495. u64 reserved2;
  496. struct acpi_generic_address cmd_complete_register;
  497. u64 cmd_complete_mask;
  498. struct acpi_generic_address cmd_update_register;
  499. u64 cmd_update_preserve_mask;
  500. u64 cmd_update_set_mask;
  501. struct acpi_generic_address error_status_register;
  502. u64 error_status_mask;
  503. };
  504. /* Values for doorbell flags above */
  505. #define ACPI_PCCT_INTERRUPT_POLARITY (1)
  506. #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
  507. /*
  508. * PCC memory structures (not part of the ACPI table)
  509. */
  510. /* Shared Memory Region */
  511. struct acpi_pcct_shared_memory {
  512. u32 signature;
  513. u16 command;
  514. u16 status;
  515. };
  516. /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
  517. struct acpi_pcct_ext_pcc_shared_memory {
  518. u32 signature;
  519. u32 flags;
  520. u32 length;
  521. u32 command;
  522. };
  523. /*******************************************************************************
  524. *
  525. * PMTT - Platform Memory Topology Table (ACPI 5.0)
  526. * Version 1
  527. *
  528. ******************************************************************************/
  529. struct acpi_table_pmtt {
  530. struct acpi_table_header header; /* Common ACPI table header */
  531. u32 reserved;
  532. };
  533. /* Common header for PMTT subtables that follow main table */
  534. struct acpi_pmtt_header {
  535. u8 type;
  536. u8 reserved1;
  537. u16 length;
  538. u16 flags;
  539. u16 reserved2;
  540. };
  541. /* Values for Type field above */
  542. #define ACPI_PMTT_TYPE_SOCKET 0
  543. #define ACPI_PMTT_TYPE_CONTROLLER 1
  544. #define ACPI_PMTT_TYPE_DIMM 2
  545. #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
  546. /* Values for Flags field above */
  547. #define ACPI_PMTT_TOP_LEVEL 0x0001
  548. #define ACPI_PMTT_PHYSICAL 0x0002
  549. #define ACPI_PMTT_MEMORY_TYPE 0x000C
  550. /*
  551. * PMTT subtables, correspond to Type in struct acpi_pmtt_header
  552. */
  553. /* 0: Socket Structure */
  554. struct acpi_pmtt_socket {
  555. struct acpi_pmtt_header header;
  556. u16 socket_id;
  557. u16 reserved;
  558. };
  559. /* 1: Memory Controller subtable */
  560. struct acpi_pmtt_controller {
  561. struct acpi_pmtt_header header;
  562. u32 read_latency;
  563. u32 write_latency;
  564. u32 read_bandwidth;
  565. u32 write_bandwidth;
  566. u16 access_width;
  567. u16 alignment;
  568. u16 reserved;
  569. u16 domain_count;
  570. };
  571. /* 1a: Proximity Domain substructure */
  572. struct acpi_pmtt_domain {
  573. u32 proximity_domain;
  574. };
  575. /* 2: Physical Component Identifier (DIMM) */
  576. struct acpi_pmtt_physical_component {
  577. struct acpi_pmtt_header header;
  578. u16 component_id;
  579. u16 reserved;
  580. u32 memory_size;
  581. u32 bios_handle;
  582. };
  583. /*******************************************************************************
  584. *
  585. * RASF - RAS Feature Table (ACPI 5.0)
  586. * Version 1
  587. *
  588. ******************************************************************************/
  589. struct acpi_table_rasf {
  590. struct acpi_table_header header; /* Common ACPI table header */
  591. u8 channel_id[12];
  592. };
  593. /* RASF Platform Communication Channel Shared Memory Region */
  594. struct acpi_rasf_shared_memory {
  595. u32 signature;
  596. u16 command;
  597. u16 status;
  598. u16 version;
  599. u8 capabilities[16];
  600. u8 set_capabilities[16];
  601. u16 num_parameter_blocks;
  602. u32 set_capabilities_status;
  603. };
  604. /* RASF Parameter Block Structure Header */
  605. struct acpi_rasf_parameter_block {
  606. u16 type;
  607. u16 version;
  608. u16 length;
  609. };
  610. /* RASF Parameter Block Structure for PATROL_SCRUB */
  611. struct acpi_rasf_patrol_scrub_parameter {
  612. struct acpi_rasf_parameter_block header;
  613. u16 patrol_scrub_command;
  614. u64 requested_address_range[2];
  615. u64 actual_address_range[2];
  616. u16 flags;
  617. u8 requested_speed;
  618. };
  619. /* Masks for Flags and Speed fields above */
  620. #define ACPI_RASF_SCRUBBER_RUNNING 1
  621. #define ACPI_RASF_SPEED (7<<1)
  622. #define ACPI_RASF_SPEED_SLOW (0<<1)
  623. #define ACPI_RASF_SPEED_MEDIUM (4<<1)
  624. #define ACPI_RASF_SPEED_FAST (7<<1)
  625. /* Channel Commands */
  626. enum acpi_rasf_commands {
  627. ACPI_RASF_EXECUTE_RASF_COMMAND = 1
  628. };
  629. /* Platform RAS Capabilities */
  630. enum acpi_rasf_capabiliities {
  631. ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
  632. ACPI_SW_PATROL_SCRUB_EXPOSED = 1
  633. };
  634. /* Patrol Scrub Commands */
  635. enum acpi_rasf_patrol_scrub_commands {
  636. ACPI_RASF_GET_PATROL_PARAMETERS = 1,
  637. ACPI_RASF_START_PATROL_SCRUBBER = 2,
  638. ACPI_RASF_STOP_PATROL_SCRUBBER = 3
  639. };
  640. /* Channel Command flags */
  641. #define ACPI_RASF_GENERATE_SCI (1<<15)
  642. /* Status values */
  643. enum acpi_rasf_status {
  644. ACPI_RASF_SUCCESS = 0,
  645. ACPI_RASF_NOT_VALID = 1,
  646. ACPI_RASF_NOT_SUPPORTED = 2,
  647. ACPI_RASF_BUSY = 3,
  648. ACPI_RASF_FAILED = 4,
  649. ACPI_RASF_ABORTED = 5,
  650. ACPI_RASF_INVALID_DATA = 6
  651. };
  652. /* Status flags */
  653. #define ACPI_RASF_COMMAND_COMPLETE (1)
  654. #define ACPI_RASF_SCI_DOORBELL (1<<1)
  655. #define ACPI_RASF_ERROR (1<<2)
  656. #define ACPI_RASF_STATUS (0x1F<<3)
  657. /*******************************************************************************
  658. *
  659. * STAO - Status Override Table (_STA override) - ACPI 6.0
  660. * Version 1
  661. *
  662. * Conforms to "ACPI Specification for Status Override Table"
  663. * 6 January 2015
  664. *
  665. ******************************************************************************/
  666. struct acpi_table_stao {
  667. struct acpi_table_header header; /* Common ACPI table header */
  668. u8 ignore_uart;
  669. };
  670. /*******************************************************************************
  671. *
  672. * WPBT - Windows Platform Environment Table (ACPI 6.0)
  673. * Version 1
  674. *
  675. * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
  676. *
  677. ******************************************************************************/
  678. struct acpi_table_wpbt {
  679. struct acpi_table_header header; /* Common ACPI table header */
  680. u32 handoff_size;
  681. u64 handoff_address;
  682. u8 layout;
  683. u8 type;
  684. u16 arguments_length;
  685. };
  686. /*******************************************************************************
  687. *
  688. * XENV - Xen Environment Table (ACPI 6.0)
  689. * Version 1
  690. *
  691. * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
  692. *
  693. ******************************************************************************/
  694. struct acpi_table_xenv {
  695. struct acpi_table_header header; /* Common ACPI table header */
  696. u64 grant_table_address;
  697. u64 grant_table_size;
  698. u32 event_interrupt;
  699. u8 event_flags;
  700. };
  701. /* Reset to default packing */
  702. #pragma pack()
  703. #endif /* __ACTBL3_H__ */