actbl3.h 14 KB

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