actbl1.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  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_RESERVED = 5 /* 5 and greater are reserved */
  425. };
  426. /* Values for config_write_enable bitfield above */
  427. #define ACPI_HEST_TYPE (1)
  428. #define ACPI_HEST_POLL_INTERVAL (1<<1)
  429. #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
  430. #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
  431. #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
  432. #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
  433. /*
  434. * HEST subtables
  435. */
  436. /* 0: IA32 Machine Check Exception */
  437. struct acpi_hest_ia_machine_check {
  438. struct acpi_hest_header header;
  439. u16 reserved1;
  440. u8 flags;
  441. u8 enabled;
  442. u32 records_to_preallocate;
  443. u32 max_sections_per_record;
  444. u64 global_capability_data;
  445. u64 global_control_data;
  446. u8 num_hardware_banks;
  447. u8 reserved3[7];
  448. };
  449. /* 1: IA32 Corrected Machine Check */
  450. struct acpi_hest_ia_corrected {
  451. struct acpi_hest_header header;
  452. u16 reserved1;
  453. u8 flags;
  454. u8 enabled;
  455. u32 records_to_preallocate;
  456. u32 max_sections_per_record;
  457. struct acpi_hest_notify notify;
  458. u8 num_hardware_banks;
  459. u8 reserved2[3];
  460. };
  461. /* 2: IA32 Non-Maskable Interrupt */
  462. struct acpi_hest_ia_nmi {
  463. struct acpi_hest_header header;
  464. u32 reserved;
  465. u32 records_to_preallocate;
  466. u32 max_sections_per_record;
  467. u32 max_raw_data_length;
  468. };
  469. /* 3,4,5: Not used */
  470. /* 6: PCI Express Root Port AER */
  471. struct acpi_hest_aer_root {
  472. struct acpi_hest_header header;
  473. struct acpi_hest_aer_common aer;
  474. u32 root_error_command;
  475. };
  476. /* 7: PCI Express AER (AER Endpoint) */
  477. struct acpi_hest_aer {
  478. struct acpi_hest_header header;
  479. struct acpi_hest_aer_common aer;
  480. };
  481. /* 8: PCI Express/PCI-X Bridge AER */
  482. struct acpi_hest_aer_bridge {
  483. struct acpi_hest_header header;
  484. struct acpi_hest_aer_common aer;
  485. u32 uncorrectable_mask2;
  486. u32 uncorrectable_severity2;
  487. u32 advanced_capabilities2;
  488. };
  489. /* 9: Generic Hardware Error Source */
  490. struct acpi_hest_generic {
  491. struct acpi_hest_header header;
  492. u16 related_source_id;
  493. u8 reserved;
  494. u8 enabled;
  495. u32 records_to_preallocate;
  496. u32 max_sections_per_record;
  497. u32 max_raw_data_length;
  498. struct acpi_generic_address error_status_address;
  499. struct acpi_hest_notify notify;
  500. u32 error_block_length;
  501. };
  502. /* Generic Error Status block */
  503. struct acpi_hest_generic_status {
  504. u32 block_status;
  505. u32 raw_data_offset;
  506. u32 raw_data_length;
  507. u32 data_length;
  508. u32 error_severity;
  509. };
  510. /* Values for block_status flags above */
  511. #define ACPI_HEST_UNCORRECTABLE (1)
  512. #define ACPI_HEST_CORRECTABLE (1<<1)
  513. #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
  514. #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
  515. #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  516. /* Generic Error Data entry */
  517. struct acpi_hest_generic_data {
  518. u8 section_type[16];
  519. u32 error_severity;
  520. u16 revision;
  521. u8 validation_bits;
  522. u8 flags;
  523. u32 error_data_length;
  524. u8 fru_id[16];
  525. u8 fru_text[20];
  526. };
  527. /*******************************************************************************
  528. *
  529. * MADT - Multiple APIC Description Table
  530. * Version 3
  531. *
  532. ******************************************************************************/
  533. struct acpi_table_madt {
  534. struct acpi_table_header header; /* Common ACPI table header */
  535. u32 address; /* Physical address of local APIC */
  536. u32 flags;
  537. };
  538. /* Masks for Flags field above */
  539. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  540. /* Values for PCATCompat flag */
  541. #define ACPI_MADT_DUAL_PIC 0
  542. #define ACPI_MADT_MULTIPLE_APIC 1
  543. /* Values for MADT subtable type in struct acpi_subtable_header */
  544. enum acpi_madt_type {
  545. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  546. ACPI_MADT_TYPE_IO_APIC = 1,
  547. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  548. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  549. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  550. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  551. ACPI_MADT_TYPE_IO_SAPIC = 6,
  552. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  553. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  554. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  555. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  556. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  557. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  558. ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
  559. };
  560. /*
  561. * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
  562. */
  563. /* 0: Processor Local APIC */
  564. struct acpi_madt_local_apic {
  565. struct acpi_subtable_header header;
  566. u8 processor_id; /* ACPI processor id */
  567. u8 id; /* Processor's local APIC id */
  568. u32 lapic_flags;
  569. };
  570. /* 1: IO APIC */
  571. struct acpi_madt_io_apic {
  572. struct acpi_subtable_header header;
  573. u8 id; /* I/O APIC ID */
  574. u8 reserved; /* reserved - must be zero */
  575. u32 address; /* APIC physical address */
  576. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  577. };
  578. /* 2: Interrupt Override */
  579. struct acpi_madt_interrupt_override {
  580. struct acpi_subtable_header header;
  581. u8 bus; /* 0 - ISA */
  582. u8 source_irq; /* Interrupt source (IRQ) */
  583. u32 global_irq; /* Global system interrupt */
  584. u16 inti_flags;
  585. };
  586. /* 3: NMI Source */
  587. struct acpi_madt_nmi_source {
  588. struct acpi_subtable_header header;
  589. u16 inti_flags;
  590. u32 global_irq; /* Global system interrupt */
  591. };
  592. /* 4: Local APIC NMI */
  593. struct acpi_madt_local_apic_nmi {
  594. struct acpi_subtable_header header;
  595. u8 processor_id; /* ACPI processor id */
  596. u16 inti_flags;
  597. u8 lint; /* LINTn to which NMI is connected */
  598. };
  599. /* 5: Address Override */
  600. struct acpi_madt_local_apic_override {
  601. struct acpi_subtable_header header;
  602. u16 reserved; /* Reserved, must be zero */
  603. u64 address; /* APIC physical address */
  604. };
  605. /* 6: I/O Sapic */
  606. struct acpi_madt_io_sapic {
  607. struct acpi_subtable_header header;
  608. u8 id; /* I/O SAPIC ID */
  609. u8 reserved; /* Reserved, must be zero */
  610. u32 global_irq_base; /* Global interrupt for SAPIC start */
  611. u64 address; /* SAPIC physical address */
  612. };
  613. /* 7: Local Sapic */
  614. struct acpi_madt_local_sapic {
  615. struct acpi_subtable_header header;
  616. u8 processor_id; /* ACPI processor id */
  617. u8 id; /* SAPIC ID */
  618. u8 eid; /* SAPIC EID */
  619. u8 reserved[3]; /* Reserved, must be zero */
  620. u32 lapic_flags;
  621. u32 uid; /* Numeric UID - ACPI 3.0 */
  622. char uid_string[1]; /* String UID - ACPI 3.0 */
  623. };
  624. /* 8: Platform Interrupt Source */
  625. struct acpi_madt_interrupt_source {
  626. struct acpi_subtable_header header;
  627. u16 inti_flags;
  628. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  629. u8 id; /* Processor ID */
  630. u8 eid; /* Processor EID */
  631. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  632. u32 global_irq; /* Global system interrupt */
  633. u32 flags; /* Interrupt Source Flags */
  634. };
  635. /* Masks for Flags field above */
  636. #define ACPI_MADT_CPEI_OVERRIDE (1)
  637. /* 9: Processor Local X2APIC (ACPI 4.0) */
  638. struct acpi_madt_local_x2apic {
  639. struct acpi_subtable_header header;
  640. u16 reserved; /* Reserved - must be zero */
  641. u32 local_apic_id; /* Processor x2APIC ID */
  642. u32 lapic_flags;
  643. u32 uid; /* ACPI processor UID */
  644. };
  645. /* 10: Local X2APIC NMI (ACPI 4.0) */
  646. struct acpi_madt_local_x2apic_nmi {
  647. struct acpi_subtable_header header;
  648. u16 inti_flags;
  649. u32 uid; /* ACPI processor UID */
  650. u8 lint; /* LINTn to which NMI is connected */
  651. u8 reserved[3];
  652. };
  653. /* 11: Generic Interrupt (ACPI 5.0) */
  654. struct acpi_madt_generic_interrupt {
  655. struct acpi_subtable_header header;
  656. u16 reserved; /* Reserved - must be zero */
  657. u32 gic_id;
  658. u32 uid;
  659. u32 flags;
  660. u32 parking_version;
  661. u32 performance_interrupt;
  662. u64 parked_address;
  663. u64 base_address;
  664. };
  665. /* 12: Generic Distributor (ACPI 5.0) */
  666. struct acpi_madt_generic_distributor {
  667. struct acpi_subtable_header header;
  668. u16 reserved; /* reserved - must be zero */
  669. u32 gic_id;
  670. u64 base_address;
  671. u32 global_irq_base;
  672. u32 reserved2; /* reserved - must be zero */
  673. };
  674. /*
  675. * Common flags fields for MADT subtables
  676. */
  677. /* MADT Local APIC flags (lapic_flags) and GIC flags */
  678. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  679. /* MADT MPS INTI flags (inti_flags) */
  680. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  681. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  682. /* Values for MPS INTI flags */
  683. #define ACPI_MADT_POLARITY_CONFORMS 0
  684. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  685. #define ACPI_MADT_POLARITY_RESERVED 2
  686. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  687. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  688. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  689. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  690. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  691. /*******************************************************************************
  692. *
  693. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  694. * Version 1
  695. *
  696. ******************************************************************************/
  697. struct acpi_table_msct {
  698. struct acpi_table_header header; /* Common ACPI table header */
  699. u32 proximity_offset; /* Location of proximity info struct(s) */
  700. u32 max_proximity_domains; /* Max number of proximity domains */
  701. u32 max_clock_domains; /* Max number of clock domains */
  702. u64 max_address; /* Max physical address in system */
  703. };
  704. /* subtable - Maximum Proximity Domain Information. Version 1 */
  705. struct acpi_msct_proximity {
  706. u8 revision;
  707. u8 length;
  708. u32 range_start; /* Start of domain range */
  709. u32 range_end; /* End of domain range */
  710. u32 processor_capacity;
  711. u64 memory_capacity; /* In bytes */
  712. };
  713. /*******************************************************************************
  714. *
  715. * SBST - Smart Battery Specification Table
  716. * Version 1
  717. *
  718. ******************************************************************************/
  719. struct acpi_table_sbst {
  720. struct acpi_table_header header; /* Common ACPI table header */
  721. u32 warning_level;
  722. u32 low_level;
  723. u32 critical_level;
  724. };
  725. /*******************************************************************************
  726. *
  727. * SLIT - System Locality Distance Information Table
  728. * Version 1
  729. *
  730. ******************************************************************************/
  731. struct acpi_table_slit {
  732. struct acpi_table_header header; /* Common ACPI table header */
  733. u64 locality_count;
  734. u8 entry[1]; /* Real size = localities^2 */
  735. };
  736. /*******************************************************************************
  737. *
  738. * SRAT - System Resource Affinity Table
  739. * Version 3
  740. *
  741. ******************************************************************************/
  742. struct acpi_table_srat {
  743. struct acpi_table_header header; /* Common ACPI table header */
  744. u32 table_revision; /* Must be value '1' */
  745. u64 reserved; /* Reserved, must be zero */
  746. };
  747. /* Values for subtable type in struct acpi_subtable_header */
  748. enum acpi_srat_type {
  749. ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  750. ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  751. ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
  752. ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
  753. };
  754. /*
  755. * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header
  756. */
  757. /* 0: Processor Local APIC/SAPIC Affinity */
  758. struct acpi_srat_cpu_affinity {
  759. struct acpi_subtable_header header;
  760. u8 proximity_domain_lo;
  761. u8 apic_id;
  762. u32 flags;
  763. u8 local_sapic_eid;
  764. u8 proximity_domain_hi[3];
  765. u32 reserved; /* Reserved, must be zero */
  766. };
  767. /* Flags */
  768. #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
  769. /* 1: Memory Affinity */
  770. struct acpi_srat_mem_affinity {
  771. struct acpi_subtable_header header;
  772. u32 proximity_domain;
  773. u16 reserved; /* Reserved, must be zero */
  774. u64 base_address;
  775. u64 length;
  776. u32 reserved1;
  777. u32 flags;
  778. u64 reserved2; /* Reserved, must be zero */
  779. };
  780. /* Flags */
  781. #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
  782. #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
  783. #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
  784. /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
  785. struct acpi_srat_x2apic_cpu_affinity {
  786. struct acpi_subtable_header header;
  787. u16 reserved; /* Reserved, must be zero */
  788. u32 proximity_domain;
  789. u32 apic_id;
  790. u32 flags;
  791. u32 clock_domain;
  792. u32 reserved2;
  793. };
  794. /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
  795. #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
  796. /* Reset to default packing */
  797. #pragma pack()
  798. #endif /* __ACTBL1_H__ */