actbl1.h 26 KB

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