actbl3.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. /******************************************************************************
  2. *
  3. * Name: actbl3.h - ACPI Table Definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2012, 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. * The tables in this file are fully defined within the ACPI specification.
  52. *
  53. ******************************************************************************/
  54. /*
  55. * Values for description table header signatures for tables defined in this
  56. * file. Useful because they make it more difficult to inadvertently type in
  57. * the wrong signature.
  58. */
  59. #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
  60. #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
  61. #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
  62. #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
  63. #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
  64. #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
  65. #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
  66. #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
  67. #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
  68. #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
  69. /* Reserved table signatures */
  70. #define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */
  71. #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
  72. #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
  73. #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
  74. /*
  75. * All tables must be byte-packed to match the ACPI specification, since
  76. * the tables are provided by the system BIOS.
  77. */
  78. #pragma pack(1)
  79. /*
  80. * Note: C bitfields are not used for this reason:
  81. *
  82. * "Bitfields are great and easy to read, but unfortunately the C language
  83. * does not specify the layout of bitfields in memory, which means they are
  84. * essentially useless for dealing with packed data in on-disk formats or
  85. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  86. * this decision was a design error in C. Ritchie could have picked an order
  87. * and stuck with it." Norman Ramsey.
  88. * See http://stackoverflow.com/a/1053662/41661
  89. */
  90. /*******************************************************************************
  91. *
  92. * BGRT - Boot Graphics Resource Table (ACPI 5.0)
  93. * Version 1
  94. *
  95. ******************************************************************************/
  96. struct acpi_table_bgrt {
  97. struct acpi_table_header header; /* Common ACPI table header */
  98. u16 version;
  99. u8 status;
  100. u8 image_type;
  101. u64 image_address;
  102. u32 image_offset_x;
  103. u32 image_offset_y;
  104. };
  105. /*******************************************************************************
  106. *
  107. * DRTM - Dynamic Root of Trust for Measurement table
  108. *
  109. ******************************************************************************/
  110. struct acpi_table_drtm {
  111. struct acpi_table_header header; /* Common ACPI table header */
  112. u64 entry_base_address;
  113. u64 entry_length;
  114. u32 entry_address32;
  115. u64 entry_address64;
  116. u64 exit_address;
  117. u64 log_area_address;
  118. u32 log_area_length;
  119. u64 arch_dependent_address;
  120. u32 flags;
  121. };
  122. /* 1) Validated Tables List */
  123. struct acpi_drtm_vtl_list {
  124. u32 validated_table_list_count;
  125. };
  126. /* 2) Resources List */
  127. struct acpi_drtm_resource_list {
  128. u32 resource_list_count;
  129. };
  130. /* 3) Platform-specific Identifiers List */
  131. struct acpi_drtm_id_list {
  132. u32 id_list_count;
  133. };
  134. /*******************************************************************************
  135. *
  136. * FPDT - Firmware Performance Data Table (ACPI 5.0)
  137. * Version 1
  138. *
  139. ******************************************************************************/
  140. struct acpi_table_fpdt {
  141. struct acpi_table_header header; /* Common ACPI table header */
  142. };
  143. /* FPDT subtable header */
  144. struct acpi_fpdt_header {
  145. u16 type;
  146. u8 length;
  147. u8 revision;
  148. };
  149. /* Values for Type field above */
  150. enum acpi_fpdt_type {
  151. ACPI_FPDT_TYPE_BOOT = 0,
  152. ACPI_FPDT_TYPE_S3PERF = 1,
  153. };
  154. /*
  155. * FPDT subtables
  156. */
  157. /* 0: Firmware Basic Boot Performance Record */
  158. struct acpi_fpdt_boot {
  159. struct acpi_fpdt_header header;
  160. u8 reserved[4];
  161. u64 reset_end;
  162. u64 load_start;
  163. u64 startup_start;
  164. u64 exit_services_entry;
  165. u64 exit_services_exit;
  166. };
  167. /* 1: S3 Performance Table Pointer Record */
  168. struct acpi_fpdt_s3pt_ptr {
  169. struct acpi_fpdt_header header;
  170. u8 reserved[4];
  171. u64 address;
  172. };
  173. /*
  174. * S3PT - S3 Performance Table. This table is pointed to by the
  175. * FPDT S3 Pointer Record above.
  176. */
  177. struct acpi_table_s3pt {
  178. u8 signature[4]; /* "S3PT" */
  179. u32 length;
  180. };
  181. /*
  182. * S3PT Subtables
  183. */
  184. struct acpi_s3pt_header {
  185. u16 type;
  186. u8 length;
  187. u8 revision;
  188. };
  189. /* Values for Type field above */
  190. enum acpi_s3pt_type {
  191. ACPI_S3PT_TYPE_RESUME = 0,
  192. ACPI_S3PT_TYPE_SUSPEND = 1,
  193. };
  194. struct acpi_s3pt_resume {
  195. struct acpi_s3pt_header header;
  196. u32 resume_count;
  197. u64 full_resume;
  198. u64 average_resume;
  199. };
  200. struct acpi_s3pt_suspend {
  201. struct acpi_s3pt_header header;
  202. u64 suspend_start;
  203. u64 suspend_end;
  204. };
  205. /*******************************************************************************
  206. *
  207. * GTDT - Generic Timer Description Table (ACPI 5.0)
  208. * Version 1
  209. *
  210. ******************************************************************************/
  211. struct acpi_table_gtdt {
  212. struct acpi_table_header header; /* Common ACPI table header */
  213. u64 address;
  214. u32 flags;
  215. u32 secure_pl1_interrupt;
  216. u32 secure_pl1_flags;
  217. u32 non_secure_pl1_interrupt;
  218. u32 non_secure_pl1_flags;
  219. u32 virtual_timer_interrupt;
  220. u32 virtual_timer_flags;
  221. u32 non_secure_pl2_interrupt;
  222. u32 non_secure_pl2_flags;
  223. };
  224. /* Values for Flags field above */
  225. #define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
  226. /* Values for all "TimerFlags" fields above */
  227. #define ACPI_GTDT_INTERRUPT_MODE 1
  228. #define ACPI_GTDT_INTERRUPT_POLARITY 2
  229. /*******************************************************************************
  230. *
  231. * MPST - Memory Power State Table (ACPI 5.0)
  232. * Version 1
  233. *
  234. ******************************************************************************/
  235. #define ACPI_MPST_CHANNEL_INFO \
  236. u16 reserved1; \
  237. u8 channel_id; \
  238. u8 reserved2; \
  239. u16 power_node_count;
  240. /* Main table */
  241. struct acpi_table_mpst {
  242. struct acpi_table_header header; /* Common ACPI table header */
  243. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  244. };
  245. /* Memory Platform Communication Channel Info */
  246. struct acpi_mpst_channel {
  247. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  248. };
  249. /* Memory Power Node Structure */
  250. struct acpi_mpst_power_node {
  251. u8 flags;
  252. u8 reserved1;
  253. u16 node_id;
  254. u32 length;
  255. u64 range_address;
  256. u64 range_length;
  257. u8 num_power_states;
  258. u8 num_physical_components;
  259. u16 reserved2;
  260. };
  261. /* Values for Flags field above */
  262. #define ACPI_MPST_ENABLED 1
  263. #define ACPI_MPST_POWER_MANAGED 2
  264. #define ACPI_MPST_HOT_PLUG_CAPABLE 4
  265. /* Memory Power State Structure (follows POWER_NODE above) */
  266. struct acpi_mpst_power_state {
  267. u8 power_state;
  268. u8 info_index;
  269. };
  270. /* Physical Component ID Structure (follows POWER_STATE above) */
  271. struct acpi_mpst_component {
  272. u16 component_id;
  273. };
  274. /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
  275. struct acpi_mpst_data_hdr {
  276. u16 characteristics_count;
  277. };
  278. struct acpi_mpst_power_data {
  279. u8 revision;
  280. u8 flags;
  281. u16 reserved1;
  282. u32 average_power;
  283. u32 power_saving;
  284. u64 exit_latency;
  285. u64 reserved2;
  286. };
  287. /* Values for Flags field above */
  288. #define ACPI_MPST_PRESERVE 1
  289. #define ACPI_MPST_AUTOENTRY 2
  290. #define ACPI_MPST_AUTOEXIT 4
  291. /* Shared Memory Region (not part of an ACPI table) */
  292. struct acpi_mpst_shared {
  293. u32 signature;
  294. u16 pcc_command;
  295. u16 pcc_status;
  296. u16 command_register;
  297. u16 status_register;
  298. u16 power_state_id;
  299. u16 power_node_id;
  300. u64 energy_consumed;
  301. u64 average_power;
  302. };
  303. /*******************************************************************************
  304. *
  305. * PCCT - Platform Communications Channel Table (ACPI 5.0)
  306. * Version 1
  307. *
  308. ******************************************************************************/
  309. struct acpi_table_pcct {
  310. struct acpi_table_header header; /* Common ACPI table header */
  311. u32 flags;
  312. u32 latency;
  313. u32 reserved;
  314. };
  315. /* Values for Flags field above */
  316. #define ACPI_PCCT_DOORBELL 1
  317. /*
  318. * PCCT subtables
  319. */
  320. /* 0: Generic Communications Subspace */
  321. struct acpi_pcct_subspace {
  322. struct acpi_subtable_header header;
  323. u8 reserved[6];
  324. u64 base_address;
  325. u64 length;
  326. struct acpi_generic_address doorbell_register;
  327. u64 preserve_mask;
  328. u64 write_mask;
  329. };
  330. /*
  331. * PCC memory structures (not part of the ACPI table)
  332. */
  333. /* Shared Memory Region */
  334. struct acpi_pcct_shared_memory {
  335. u32 signature;
  336. u16 command;
  337. u16 status;
  338. };
  339. /*******************************************************************************
  340. *
  341. * PMTT - Platform Memory Topology Table (ACPI 5.0)
  342. * Version 1
  343. *
  344. ******************************************************************************/
  345. struct acpi_table_pmtt {
  346. struct acpi_table_header header; /* Common ACPI table header */
  347. u32 reserved;
  348. };
  349. /* Common header for PMTT subtables that follow main table */
  350. struct acpi_pmtt_header {
  351. u8 type;
  352. u8 reserved1;
  353. u16 length;
  354. u16 flags;
  355. u16 reserved2;
  356. };
  357. /* Values for Type field above */
  358. #define ACPI_PMTT_TYPE_SOCKET 0
  359. #define ACPI_PMTT_TYPE_CONTROLLER 1
  360. #define ACPI_PMTT_TYPE_DIMM 2
  361. #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
  362. /* Values for Flags field above */
  363. #define ACPI_PMTT_TOP_LEVEL 0x0001
  364. #define ACPI_PMTT_PHYSICAL 0x0002
  365. #define ACPI_PMTT_MEMORY_TYPE 0x000C
  366. /*
  367. * PMTT subtables, correspond to Type in struct acpi_pmtt_header
  368. */
  369. /* 0: Socket Structure */
  370. struct acpi_pmtt_socket {
  371. struct acpi_pmtt_header header;
  372. u16 socket_id;
  373. u16 reserved;
  374. };
  375. /* 1: Memory Controller subtable */
  376. struct acpi_pmtt_controller {
  377. struct acpi_pmtt_header header;
  378. u32 read_latency;
  379. u32 write_latency;
  380. u32 read_bandwidth;
  381. u32 write_bandwidth;
  382. u16 access_width;
  383. u16 alignment;
  384. u16 reserved;
  385. u16 domain_count;
  386. };
  387. /* 1a: Proximity Domain substructure */
  388. struct acpi_pmtt_domain {
  389. u32 proximity_domain;
  390. };
  391. /* 2: Physical Component Identifier (DIMM) */
  392. struct acpi_pmtt_physical_component {
  393. struct acpi_pmtt_header header;
  394. u16 component_id;
  395. u16 reserved;
  396. u32 memory_size;
  397. u32 bios_handle;
  398. };
  399. /*******************************************************************************
  400. *
  401. * RASF - RAS Feature Table (ACPI 5.0)
  402. * Version 1
  403. *
  404. ******************************************************************************/
  405. struct acpi_table_rasf {
  406. struct acpi_table_header header; /* Common ACPI table header */
  407. u8 channel_id[12];
  408. };
  409. /* RASF Platform Communication Channel Shared Memory Region */
  410. struct acpi_rasf_shared_memory {
  411. u32 signature;
  412. u16 command;
  413. u16 status;
  414. u64 requested_address;
  415. u64 requested_length;
  416. u64 actual_address;
  417. u64 actual_length;
  418. u16 flags;
  419. u8 speed;
  420. };
  421. /* Masks for Flags and Speed fields above */
  422. #define ACPI_RASF_SCRUBBER_RUNNING 1
  423. #define ACPI_RASF_SPEED (7<<1)
  424. /* Channel Commands */
  425. enum acpi_rasf_commands {
  426. ACPI_RASF_GET_RAS_CAPABILITIES = 1,
  427. ACPI_RASF_GET_PATROL_PARAMETERS = 2,
  428. ACPI_RASF_START_PATROL_SCRUBBER = 3,
  429. ACPI_RASF_STOP_PATROL_SCRUBBER = 4
  430. };
  431. /* Channel Command flags */
  432. #define ACPI_RASF_GENERATE_SCI (1<<15)
  433. /* Status values */
  434. enum acpi_rasf_status {
  435. ACPI_RASF_SUCCESS = 0,
  436. ACPI_RASF_NOT_VALID = 1,
  437. ACPI_RASF_NOT_SUPPORTED = 2,
  438. ACPI_RASF_BUSY = 3,
  439. ACPI_RASF_FAILED = 4,
  440. ACPI_RASF_ABORTED = 5,
  441. ACPI_RASF_INVALID_DATA = 6
  442. };
  443. /* Status flags */
  444. #define ACPI_RASF_COMMAND_COMPLETE (1)
  445. #define ACPI_RASF_SCI_DOORBELL (1<<1)
  446. #define ACPI_RASF_ERROR (1<<2)
  447. #define ACPI_RASF_STATUS (0x1F<<3)
  448. /* Reset to default packing */
  449. #pragma pack()
  450. #endif /* __ACTBL3_H__ */