actbl3.h 14 KB

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