actbl1.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971
  1. /******************************************************************************
  2. *
  3. * Name: actbl1.h - Additional 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 __ACTBL1_H__
  43. #define __ACTBL1_H__
  44. /*******************************************************************************
  45. *
  46. * Additional ACPI Tables (1)
  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_BERT "BERT" /* Boot Error Record Table */
  60. #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
  61. #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
  62. #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
  63. #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
  64. #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
  65. #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
  66. #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
  67. #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
  68. #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
  69. #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
  70. /*
  71. * All tables must be byte-packed to match the ACPI specification, since
  72. * the tables are provided by the system BIOS.
  73. */
  74. #pragma pack(1)
  75. /*
  76. * Note: C bitfields are not used for this reason:
  77. *
  78. * "Bitfields are great and easy to read, but unfortunately the C language
  79. * does not specify the layout of bitfields in memory, which means they are
  80. * essentially useless for dealing with packed data in on-disk formats or
  81. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  82. * this decision was a design error in C. Ritchie could have picked an order
  83. * and stuck with it." Norman Ramsey.
  84. * See http://stackoverflow.com/a/1053662/41661
  85. */
  86. /*******************************************************************************
  87. *
  88. * Common subtable headers
  89. *
  90. ******************************************************************************/
  91. /* Generic subtable header (used in MADT, SRAT, etc.) */
  92. struct acpi_subtable_header {
  93. u8 type;
  94. u8 length;
  95. };
  96. /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
  97. struct acpi_whea_header {
  98. u8 action;
  99. u8 instruction;
  100. u8 flags;
  101. u8 reserved;
  102. struct acpi_generic_address register_region;
  103. u64 value; /* Value used with Read/Write register */
  104. u64 mask; /* Bitmask required for this register instruction */
  105. };
  106. /*******************************************************************************
  107. *
  108. * BERT - Boot Error Record Table (ACPI 4.0)
  109. * Version 1
  110. *
  111. ******************************************************************************/
  112. struct acpi_table_bert {
  113. struct acpi_table_header header; /* Common ACPI table header */
  114. u32 region_length; /* Length of the boot error region */
  115. u64 address; /* Physical address of the error region */
  116. };
  117. /* Boot Error Region (not a subtable, pointed to by Address field above) */
  118. struct acpi_bert_region {
  119. u32 block_status; /* Type of error information */
  120. u32 raw_data_offset; /* Offset to raw error data */
  121. u32 raw_data_length; /* Length of raw error data */
  122. u32 data_length; /* Length of generic error data */
  123. u32 error_severity; /* Severity code */
  124. };
  125. /* Values for block_status flags above */
  126. #define ACPI_BERT_UNCORRECTABLE (1)
  127. #define ACPI_BERT_CORRECTABLE (1<<1)
  128. #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
  129. #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
  130. #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  131. /* Values for error_severity above */
  132. enum acpi_bert_error_severity {
  133. ACPI_BERT_ERROR_CORRECTABLE = 0,
  134. ACPI_BERT_ERROR_FATAL = 1,
  135. ACPI_BERT_ERROR_CORRECTED = 2,
  136. ACPI_BERT_ERROR_NONE = 3,
  137. ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
  138. };
  139. /*
  140. * Note: The generic error data that follows the error_severity field above
  141. * uses the struct acpi_hest_generic_data defined under the HEST table below
  142. */
  143. /*******************************************************************************
  144. *
  145. * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
  146. * Version 1
  147. *
  148. ******************************************************************************/
  149. struct acpi_table_cpep {
  150. struct acpi_table_header header; /* Common ACPI table header */
  151. u64 reserved;
  152. };
  153. /* Subtable */
  154. struct acpi_cpep_polling {
  155. struct acpi_subtable_header header;
  156. u8 id; /* Processor ID */
  157. u8 eid; /* Processor EID */
  158. u32 interval; /* Polling interval (msec) */
  159. };
  160. /*******************************************************************************
  161. *
  162. * ECDT - Embedded Controller Boot Resources Table
  163. * Version 1
  164. *
  165. ******************************************************************************/
  166. struct acpi_table_ecdt {
  167. struct acpi_table_header header; /* Common ACPI table header */
  168. struct acpi_generic_address control; /* Address of EC command/status register */
  169. struct acpi_generic_address data; /* Address of EC data register */
  170. u32 uid; /* Unique ID - must be same as the EC _UID method */
  171. u8 gpe; /* The GPE for the EC */
  172. u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
  173. };
  174. /*******************************************************************************
  175. *
  176. * EINJ - Error Injection Table (ACPI 4.0)
  177. * Version 1
  178. *
  179. ******************************************************************************/
  180. struct acpi_table_einj {
  181. struct acpi_table_header header; /* Common ACPI table header */
  182. u32 header_length;
  183. u8 flags;
  184. u8 reserved[3];
  185. u32 entries;
  186. };
  187. /* EINJ Injection Instruction Entries (actions) */
  188. struct acpi_einj_entry {
  189. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  190. };
  191. /* Masks for Flags field above */
  192. #define ACPI_EINJ_PRESERVE (1)
  193. /* Values for Action field above */
  194. enum acpi_einj_actions {
  195. ACPI_EINJ_BEGIN_OPERATION = 0,
  196. ACPI_EINJ_GET_TRIGGER_TABLE = 1,
  197. ACPI_EINJ_SET_ERROR_TYPE = 2,
  198. ACPI_EINJ_GET_ERROR_TYPE = 3,
  199. ACPI_EINJ_END_OPERATION = 4,
  200. ACPI_EINJ_EXECUTE_OPERATION = 5,
  201. ACPI_EINJ_CHECK_BUSY_STATUS = 6,
  202. ACPI_EINJ_GET_COMMAND_STATUS = 7,
  203. ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
  204. ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
  205. ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
  206. };
  207. /* Values for Instruction field above */
  208. enum acpi_einj_instructions {
  209. ACPI_EINJ_READ_REGISTER = 0,
  210. ACPI_EINJ_READ_REGISTER_VALUE = 1,
  211. ACPI_EINJ_WRITE_REGISTER = 2,
  212. ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
  213. ACPI_EINJ_NOOP = 4,
  214. ACPI_EINJ_FLUSH_CACHELINE = 5,
  215. ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
  216. };
  217. struct acpi_einj_error_type_with_addr {
  218. u32 error_type;
  219. u32 vendor_struct_offset;
  220. u32 flags;
  221. u32 apic_id;
  222. u64 address;
  223. u64 range;
  224. u32 pcie_id;
  225. };
  226. struct acpi_einj_vendor {
  227. u32 length;
  228. u32 pcie_id;
  229. u16 vendor_id;
  230. u16 device_id;
  231. u8 revision_id;
  232. u8 reserved[3];
  233. };
  234. /* EINJ Trigger Error Action Table */
  235. struct acpi_einj_trigger {
  236. u32 header_size;
  237. u32 revision;
  238. u32 table_size;
  239. u32 entry_count;
  240. };
  241. /* Command status return values */
  242. enum acpi_einj_command_status {
  243. ACPI_EINJ_SUCCESS = 0,
  244. ACPI_EINJ_FAILURE = 1,
  245. ACPI_EINJ_INVALID_ACCESS = 2,
  246. ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
  247. };
  248. /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
  249. #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
  250. #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
  251. #define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
  252. #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
  253. #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
  254. #define ACPI_EINJ_MEMORY_FATAL (1<<5)
  255. #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
  256. #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
  257. #define ACPI_EINJ_PCIX_FATAL (1<<8)
  258. #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
  259. #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
  260. #define ACPI_EINJ_PLATFORM_FATAL (1<<11)
  261. #define ACPI_EINJ_VENDOR_DEFINED (1<<31)
  262. /*******************************************************************************
  263. *
  264. * ERST - Error Record Serialization Table (ACPI 4.0)
  265. * Version 1
  266. *
  267. ******************************************************************************/
  268. struct acpi_table_erst {
  269. struct acpi_table_header header; /* Common ACPI table header */
  270. u32 header_length;
  271. u32 reserved;
  272. u32 entries;
  273. };
  274. /* ERST Serialization Entries (actions) */
  275. struct acpi_erst_entry {
  276. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  277. };
  278. /* Masks for Flags field above */
  279. #define ACPI_ERST_PRESERVE (1)
  280. /* Values for Action field above */
  281. enum acpi_erst_actions {
  282. ACPI_ERST_BEGIN_WRITE = 0,
  283. ACPI_ERST_BEGIN_READ = 1,
  284. ACPI_ERST_BEGIN_CLEAR = 2,
  285. ACPI_ERST_END = 3,
  286. ACPI_ERST_SET_RECORD_OFFSET = 4,
  287. ACPI_ERST_EXECUTE_OPERATION = 5,
  288. ACPI_ERST_CHECK_BUSY_STATUS = 6,
  289. ACPI_ERST_GET_COMMAND_STATUS = 7,
  290. ACPI_ERST_GET_RECORD_ID = 8,
  291. ACPI_ERST_SET_RECORD_ID = 9,
  292. ACPI_ERST_GET_RECORD_COUNT = 10,
  293. ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
  294. ACPI_ERST_NOT_USED = 12,
  295. ACPI_ERST_GET_ERROR_RANGE = 13,
  296. ACPI_ERST_GET_ERROR_LENGTH = 14,
  297. ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
  298. ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
  299. };
  300. /* Values for Instruction field above */
  301. enum acpi_erst_instructions {
  302. ACPI_ERST_READ_REGISTER = 0,
  303. ACPI_ERST_READ_REGISTER_VALUE = 1,
  304. ACPI_ERST_WRITE_REGISTER = 2,
  305. ACPI_ERST_WRITE_REGISTER_VALUE = 3,
  306. ACPI_ERST_NOOP = 4,
  307. ACPI_ERST_LOAD_VAR1 = 5,
  308. ACPI_ERST_LOAD_VAR2 = 6,
  309. ACPI_ERST_STORE_VAR1 = 7,
  310. ACPI_ERST_ADD = 8,
  311. ACPI_ERST_SUBTRACT = 9,
  312. ACPI_ERST_ADD_VALUE = 10,
  313. ACPI_ERST_SUBTRACT_VALUE = 11,
  314. ACPI_ERST_STALL = 12,
  315. ACPI_ERST_STALL_WHILE_TRUE = 13,
  316. ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
  317. ACPI_ERST_GOTO = 15,
  318. ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
  319. ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
  320. ACPI_ERST_MOVE_DATA = 18,
  321. ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
  322. };
  323. /* Command status return values */
  324. enum acpi_erst_command_status {
  325. ACPI_ERST_SUCESS = 0,
  326. ACPI_ERST_NO_SPACE = 1,
  327. ACPI_ERST_NOT_AVAILABLE = 2,
  328. ACPI_ERST_FAILURE = 3,
  329. ACPI_ERST_RECORD_EMPTY = 4,
  330. ACPI_ERST_NOT_FOUND = 5,
  331. ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
  332. };
  333. /* Error Record Serialization Information */
  334. struct acpi_erst_info {
  335. u16 signature; /* Should be "ER" */
  336. u8 data[48];
  337. };
  338. /*******************************************************************************
  339. *
  340. * HEST - Hardware Error Source Table (ACPI 4.0)
  341. * Version 1
  342. *
  343. ******************************************************************************/
  344. struct acpi_table_hest {
  345. struct acpi_table_header header; /* Common ACPI table header */
  346. u32 error_source_count;
  347. };
  348. /* HEST subtable header */
  349. struct acpi_hest_header {
  350. u16 type;
  351. u16 source_id;
  352. };
  353. /* Values for Type field above for subtables */
  354. enum acpi_hest_types {
  355. ACPI_HEST_TYPE_IA32_CHECK = 0,
  356. ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
  357. ACPI_HEST_TYPE_IA32_NMI = 2,
  358. ACPI_HEST_TYPE_NOT_USED3 = 3,
  359. ACPI_HEST_TYPE_NOT_USED4 = 4,
  360. ACPI_HEST_TYPE_NOT_USED5 = 5,
  361. ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
  362. ACPI_HEST_TYPE_AER_ENDPOINT = 7,
  363. ACPI_HEST_TYPE_AER_BRIDGE = 8,
  364. ACPI_HEST_TYPE_GENERIC_ERROR = 9,
  365. ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
  366. };
  367. /*
  368. * HEST substructures contained in subtables
  369. */
  370. /*
  371. * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
  372. * struct acpi_hest_ia_corrected structures.
  373. */
  374. struct acpi_hest_ia_error_bank {
  375. u8 bank_number;
  376. u8 clear_status_on_init;
  377. u8 status_format;
  378. u8 reserved;
  379. u32 control_register;
  380. u64 control_data;
  381. u32 status_register;
  382. u32 address_register;
  383. u32 misc_register;
  384. };
  385. /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
  386. struct acpi_hest_aer_common {
  387. u16 reserved1;
  388. u8 flags;
  389. u8 enabled;
  390. u32 records_to_preallocate;
  391. u32 max_sections_per_record;
  392. u32 bus;
  393. u16 device;
  394. u16 function;
  395. u16 device_control;
  396. u16 reserved2;
  397. u32 uncorrectable_mask;
  398. u32 uncorrectable_severity;
  399. u32 correctable_mask;
  400. u32 advanced_capabilities;
  401. };
  402. /* Masks for HEST Flags fields */
  403. #define ACPI_HEST_FIRMWARE_FIRST (1)
  404. #define ACPI_HEST_GLOBAL (1<<1)
  405. /* Hardware Error Notification */
  406. struct acpi_hest_notify {
  407. u8 type;
  408. u8 length;
  409. u16 config_write_enable;
  410. u32 poll_interval;
  411. u32 vector;
  412. u32 polling_threshold_value;
  413. u32 polling_threshold_window;
  414. u32 error_threshold_value;
  415. u32 error_threshold_window;
  416. };
  417. /* Values for Notify Type field above */
  418. enum acpi_hest_notify_types {
  419. ACPI_HEST_NOTIFY_POLLED = 0,
  420. ACPI_HEST_NOTIFY_EXTERNAL = 1,
  421. ACPI_HEST_NOTIFY_LOCAL = 2,
  422. ACPI_HEST_NOTIFY_SCI = 3,
  423. ACPI_HEST_NOTIFY_NMI = 4,
  424. ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
  425. ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
  426. ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */
  427. };
  428. /* Values for config_write_enable bitfield above */
  429. #define ACPI_HEST_TYPE (1)
  430. #define ACPI_HEST_POLL_INTERVAL (1<<1)
  431. #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
  432. #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
  433. #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
  434. #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
  435. /*
  436. * HEST subtables
  437. */
  438. /* 0: IA32 Machine Check Exception */
  439. struct acpi_hest_ia_machine_check {
  440. struct acpi_hest_header header;
  441. u16 reserved1;
  442. u8 flags;
  443. u8 enabled;
  444. u32 records_to_preallocate;
  445. u32 max_sections_per_record;
  446. u64 global_capability_data;
  447. u64 global_control_data;
  448. u8 num_hardware_banks;
  449. u8 reserved3[7];
  450. };
  451. /* 1: IA32 Corrected Machine Check */
  452. struct acpi_hest_ia_corrected {
  453. struct acpi_hest_header header;
  454. u16 reserved1;
  455. u8 flags;
  456. u8 enabled;
  457. u32 records_to_preallocate;
  458. u32 max_sections_per_record;
  459. struct acpi_hest_notify notify;
  460. u8 num_hardware_banks;
  461. u8 reserved2[3];
  462. };
  463. /* 2: IA32 Non-Maskable Interrupt */
  464. struct acpi_hest_ia_nmi {
  465. struct acpi_hest_header header;
  466. u32 reserved;
  467. u32 records_to_preallocate;
  468. u32 max_sections_per_record;
  469. u32 max_raw_data_length;
  470. };
  471. /* 3,4,5: Not used */
  472. /* 6: PCI Express Root Port AER */
  473. struct acpi_hest_aer_root {
  474. struct acpi_hest_header header;
  475. struct acpi_hest_aer_common aer;
  476. u32 root_error_command;
  477. };
  478. /* 7: PCI Express AER (AER Endpoint) */
  479. struct acpi_hest_aer {
  480. struct acpi_hest_header header;
  481. struct acpi_hest_aer_common aer;
  482. };
  483. /* 8: PCI Express/PCI-X Bridge AER */
  484. struct acpi_hest_aer_bridge {
  485. struct acpi_hest_header header;
  486. struct acpi_hest_aer_common aer;
  487. u32 uncorrectable_mask2;
  488. u32 uncorrectable_severity2;
  489. u32 advanced_capabilities2;
  490. };
  491. /* 9: Generic Hardware Error Source */
  492. struct acpi_hest_generic {
  493. struct acpi_hest_header header;
  494. u16 related_source_id;
  495. u8 reserved;
  496. u8 enabled;
  497. u32 records_to_preallocate;
  498. u32 max_sections_per_record;
  499. u32 max_raw_data_length;
  500. struct acpi_generic_address error_status_address;
  501. struct acpi_hest_notify notify;
  502. u32 error_block_length;
  503. };
  504. /* Generic Error Status block */
  505. struct acpi_hest_generic_status {
  506. u32 block_status;
  507. u32 raw_data_offset;
  508. u32 raw_data_length;
  509. u32 data_length;
  510. u32 error_severity;
  511. };
  512. /* Values for block_status flags above */
  513. #define ACPI_HEST_UNCORRECTABLE (1)
  514. #define ACPI_HEST_CORRECTABLE (1<<1)
  515. #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
  516. #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
  517. #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  518. /* Generic Error Data entry */
  519. struct acpi_hest_generic_data {
  520. u8 section_type[16];
  521. u32 error_severity;
  522. u16 revision;
  523. u8 validation_bits;
  524. u8 flags;
  525. u32 error_data_length;
  526. u8 fru_id[16];
  527. u8 fru_text[20];
  528. };
  529. /*******************************************************************************
  530. *
  531. * MADT - Multiple APIC Description Table
  532. * Version 3
  533. *
  534. ******************************************************************************/
  535. struct acpi_table_madt {
  536. struct acpi_table_header header; /* Common ACPI table header */
  537. u32 address; /* Physical address of local APIC */
  538. u32 flags;
  539. };
  540. /* Masks for Flags field above */
  541. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  542. /* Values for PCATCompat flag */
  543. #define ACPI_MADT_DUAL_PIC 0
  544. #define ACPI_MADT_MULTIPLE_APIC 1
  545. /* Values for MADT subtable type in struct acpi_subtable_header */
  546. enum acpi_madt_type {
  547. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  548. ACPI_MADT_TYPE_IO_APIC = 1,
  549. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  550. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  551. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  552. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  553. ACPI_MADT_TYPE_IO_SAPIC = 6,
  554. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  555. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  556. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  557. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  558. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  559. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  560. ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
  561. };
  562. /*
  563. * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
  564. */
  565. /* 0: Processor Local APIC */
  566. struct acpi_madt_local_apic {
  567. struct acpi_subtable_header header;
  568. u8 processor_id; /* ACPI processor id */
  569. u8 id; /* Processor's local APIC id */
  570. u32 lapic_flags;
  571. };
  572. /* 1: IO APIC */
  573. struct acpi_madt_io_apic {
  574. struct acpi_subtable_header header;
  575. u8 id; /* I/O APIC ID */
  576. u8 reserved; /* reserved - must be zero */
  577. u32 address; /* APIC physical address */
  578. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  579. };
  580. /* 2: Interrupt Override */
  581. struct acpi_madt_interrupt_override {
  582. struct acpi_subtable_header header;
  583. u8 bus; /* 0 - ISA */
  584. u8 source_irq; /* Interrupt source (IRQ) */
  585. u32 global_irq; /* Global system interrupt */
  586. u16 inti_flags;
  587. };
  588. /* 3: NMI Source */
  589. struct acpi_madt_nmi_source {
  590. struct acpi_subtable_header header;
  591. u16 inti_flags;
  592. u32 global_irq; /* Global system interrupt */
  593. };
  594. /* 4: Local APIC NMI */
  595. struct acpi_madt_local_apic_nmi {
  596. struct acpi_subtable_header header;
  597. u8 processor_id; /* ACPI processor id */
  598. u16 inti_flags;
  599. u8 lint; /* LINTn to which NMI is connected */
  600. };
  601. /* 5: Address Override */
  602. struct acpi_madt_local_apic_override {
  603. struct acpi_subtable_header header;
  604. u16 reserved; /* Reserved, must be zero */
  605. u64 address; /* APIC physical address */
  606. };
  607. /* 6: I/O Sapic */
  608. struct acpi_madt_io_sapic {
  609. struct acpi_subtable_header header;
  610. u8 id; /* I/O SAPIC ID */
  611. u8 reserved; /* Reserved, must be zero */
  612. u32 global_irq_base; /* Global interrupt for SAPIC start */
  613. u64 address; /* SAPIC physical address */
  614. };
  615. /* 7: Local Sapic */
  616. struct acpi_madt_local_sapic {
  617. struct acpi_subtable_header header;
  618. u8 processor_id; /* ACPI processor id */
  619. u8 id; /* SAPIC ID */
  620. u8 eid; /* SAPIC EID */
  621. u8 reserved[3]; /* Reserved, must be zero */
  622. u32 lapic_flags;
  623. u32 uid; /* Numeric UID - ACPI 3.0 */
  624. char uid_string[1]; /* String UID - ACPI 3.0 */
  625. };
  626. /* 8: Platform Interrupt Source */
  627. struct acpi_madt_interrupt_source {
  628. struct acpi_subtable_header header;
  629. u16 inti_flags;
  630. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  631. u8 id; /* Processor ID */
  632. u8 eid; /* Processor EID */
  633. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  634. u32 global_irq; /* Global system interrupt */
  635. u32 flags; /* Interrupt Source Flags */
  636. };
  637. /* Masks for Flags field above */
  638. #define ACPI_MADT_CPEI_OVERRIDE (1)
  639. /* 9: Processor Local X2APIC (ACPI 4.0) */
  640. struct acpi_madt_local_x2apic {
  641. struct acpi_subtable_header header;
  642. u16 reserved; /* Reserved - must be zero */
  643. u32 local_apic_id; /* Processor x2APIC ID */
  644. u32 lapic_flags;
  645. u32 uid; /* ACPI processor UID */
  646. };
  647. /* 10: Local X2APIC NMI (ACPI 4.0) */
  648. struct acpi_madt_local_x2apic_nmi {
  649. struct acpi_subtable_header header;
  650. u16 inti_flags;
  651. u32 uid; /* ACPI processor UID */
  652. u8 lint; /* LINTn to which NMI is connected */
  653. u8 reserved[3];
  654. };
  655. /* 11: Generic Interrupt (ACPI 5.0) */
  656. struct acpi_madt_generic_interrupt {
  657. struct acpi_subtable_header header;
  658. u16 reserved; /* Reserved - must be zero */
  659. u32 gic_id;
  660. u32 uid;
  661. u32 flags;
  662. u32 parking_version;
  663. u32 performance_interrupt;
  664. u64 parked_address;
  665. u64 base_address;
  666. };
  667. /* 12: Generic Distributor (ACPI 5.0) */
  668. struct acpi_madt_generic_distributor {
  669. struct acpi_subtable_header header;
  670. u16 reserved; /* reserved - must be zero */
  671. u32 gic_id;
  672. u64 base_address;
  673. u32 global_irq_base;
  674. u32 reserved2; /* reserved - must be zero */
  675. };
  676. /*
  677. * Common flags fields for MADT subtables
  678. */
  679. /* MADT Local APIC flags (lapic_flags) and GIC flags */
  680. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  681. /* MADT MPS INTI flags (inti_flags) */
  682. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  683. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  684. /* Values for MPS INTI flags */
  685. #define ACPI_MADT_POLARITY_CONFORMS 0
  686. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  687. #define ACPI_MADT_POLARITY_RESERVED 2
  688. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  689. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  690. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  691. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  692. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  693. /*******************************************************************************
  694. *
  695. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  696. * Version 1
  697. *
  698. ******************************************************************************/
  699. struct acpi_table_msct {
  700. struct acpi_table_header header; /* Common ACPI table header */
  701. u32 proximity_offset; /* Location of proximity info struct(s) */
  702. u32 max_proximity_domains; /* Max number of proximity domains */
  703. u32 max_clock_domains; /* Max number of clock domains */
  704. u64 max_address; /* Max physical address in system */
  705. };
  706. /* subtable - Maximum Proximity Domain Information. Version 1 */
  707. struct acpi_msct_proximity {
  708. u8 revision;
  709. u8 length;
  710. u32 range_start; /* Start of domain range */
  711. u32 range_end; /* End of domain range */
  712. u32 processor_capacity;
  713. u64 memory_capacity; /* In bytes */
  714. };
  715. /*******************************************************************************
  716. *
  717. * SBST - Smart Battery Specification Table
  718. * Version 1
  719. *
  720. ******************************************************************************/
  721. struct acpi_table_sbst {
  722. struct acpi_table_header header; /* Common ACPI table header */
  723. u32 warning_level;
  724. u32 low_level;
  725. u32 critical_level;
  726. };
  727. /*******************************************************************************
  728. *
  729. * SLIT - System Locality Distance Information Table
  730. * Version 1
  731. *
  732. ******************************************************************************/
  733. struct acpi_table_slit {
  734. struct acpi_table_header header; /* Common ACPI table header */
  735. u64 locality_count;
  736. u8 entry[1]; /* Real size = localities^2 */
  737. };
  738. /*******************************************************************************
  739. *
  740. * SRAT - System Resource Affinity Table
  741. * Version 3
  742. *
  743. ******************************************************************************/
  744. struct acpi_table_srat {
  745. struct acpi_table_header header; /* Common ACPI table header */
  746. u32 table_revision; /* Must be value '1' */
  747. u64 reserved; /* Reserved, must be zero */
  748. };
  749. /* Values for subtable type in struct acpi_subtable_header */
  750. enum acpi_srat_type {
  751. ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  752. ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  753. ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
  754. ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
  755. };
  756. /*
  757. * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header
  758. */
  759. /* 0: Processor Local APIC/SAPIC Affinity */
  760. struct acpi_srat_cpu_affinity {
  761. struct acpi_subtable_header header;
  762. u8 proximity_domain_lo;
  763. u8 apic_id;
  764. u32 flags;
  765. u8 local_sapic_eid;
  766. u8 proximity_domain_hi[3];
  767. u32 reserved; /* Reserved, must be zero */
  768. };
  769. /* Flags */
  770. #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
  771. /* 1: Memory Affinity */
  772. struct acpi_srat_mem_affinity {
  773. struct acpi_subtable_header header;
  774. u32 proximity_domain;
  775. u16 reserved; /* Reserved, must be zero */
  776. u64 base_address;
  777. u64 length;
  778. u32 reserved1;
  779. u32 flags;
  780. u64 reserved2; /* Reserved, must be zero */
  781. };
  782. /* Flags */
  783. #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
  784. #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
  785. #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
  786. /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
  787. struct acpi_srat_x2apic_cpu_affinity {
  788. struct acpi_subtable_header header;
  789. u16 reserved; /* Reserved, must be zero */
  790. u32 proximity_domain;
  791. u32 apic_id;
  792. u32 flags;
  793. u32 clock_domain;
  794. u32 reserved2;
  795. };
  796. /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
  797. #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
  798. /* Reset to default packing */
  799. #pragma pack()
  800. #endif /* __ACTBL1_H__ */