actbl1.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272
  1. /******************************************************************************
  2. *
  3. * Name: actbl1.h - Additional ACPI table definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2016, 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. #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
  71. /*
  72. * All tables must be byte-packed to match the ACPI specification, since
  73. * the tables are provided by the system BIOS.
  74. */
  75. #pragma pack(1)
  76. /*
  77. * Note: C bitfields are not used for this reason:
  78. *
  79. * "Bitfields are great and easy to read, but unfortunately the C language
  80. * does not specify the layout of bitfields in memory, which means they are
  81. * essentially useless for dealing with packed data in on-disk formats or
  82. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  83. * this decision was a design error in C. Ritchie could have picked an order
  84. * and stuck with it." Norman Ramsey.
  85. * See http://stackoverflow.com/a/1053662/41661
  86. */
  87. /*******************************************************************************
  88. *
  89. * Common subtable headers
  90. *
  91. ******************************************************************************/
  92. /* Generic subtable header (used in MADT, SRAT, etc.) */
  93. struct acpi_subtable_header {
  94. u8 type;
  95. u8 length;
  96. };
  97. /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
  98. struct acpi_whea_header {
  99. u8 action;
  100. u8 instruction;
  101. u8 flags;
  102. u8 reserved;
  103. struct acpi_generic_address register_region;
  104. u64 value; /* Value used with Read/Write register */
  105. u64 mask; /* Bitmask required for this register instruction */
  106. };
  107. /*******************************************************************************
  108. *
  109. * BERT - Boot Error Record Table (ACPI 4.0)
  110. * Version 1
  111. *
  112. ******************************************************************************/
  113. struct acpi_table_bert {
  114. struct acpi_table_header header; /* Common ACPI table header */
  115. u32 region_length; /* Length of the boot error region */
  116. u64 address; /* Physical address of the error region */
  117. };
  118. /* Boot Error Region (not a subtable, pointed to by Address field above) */
  119. struct acpi_bert_region {
  120. u32 block_status; /* Type of error information */
  121. u32 raw_data_offset; /* Offset to raw error data */
  122. u32 raw_data_length; /* Length of raw error data */
  123. u32 data_length; /* Length of generic error data */
  124. u32 error_severity; /* Severity code */
  125. };
  126. /* Values for block_status flags above */
  127. #define ACPI_BERT_UNCORRECTABLE (1)
  128. #define ACPI_BERT_CORRECTABLE (1<<1)
  129. #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
  130. #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
  131. #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  132. /* Values for error_severity above */
  133. enum acpi_bert_error_severity {
  134. ACPI_BERT_ERROR_CORRECTABLE = 0,
  135. ACPI_BERT_ERROR_FATAL = 1,
  136. ACPI_BERT_ERROR_CORRECTED = 2,
  137. ACPI_BERT_ERROR_NONE = 3,
  138. ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
  139. };
  140. /*
  141. * Note: The generic error data that follows the error_severity field above
  142. * uses the struct acpi_hest_generic_data defined under the HEST table below
  143. */
  144. /*******************************************************************************
  145. *
  146. * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
  147. * Version 1
  148. *
  149. ******************************************************************************/
  150. struct acpi_table_cpep {
  151. struct acpi_table_header header; /* Common ACPI table header */
  152. u64 reserved;
  153. };
  154. /* Subtable */
  155. struct acpi_cpep_polling {
  156. struct acpi_subtable_header header;
  157. u8 id; /* Processor ID */
  158. u8 eid; /* Processor EID */
  159. u32 interval; /* Polling interval (msec) */
  160. };
  161. /*******************************************************************************
  162. *
  163. * ECDT - Embedded Controller Boot Resources Table
  164. * Version 1
  165. *
  166. ******************************************************************************/
  167. struct acpi_table_ecdt {
  168. struct acpi_table_header header; /* Common ACPI table header */
  169. struct acpi_generic_address control; /* Address of EC command/status register */
  170. struct acpi_generic_address data; /* Address of EC data register */
  171. u32 uid; /* Unique ID - must be same as the EC _UID method */
  172. u8 gpe; /* The GPE for the EC */
  173. u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
  174. };
  175. /*******************************************************************************
  176. *
  177. * EINJ - Error Injection Table (ACPI 4.0)
  178. * Version 1
  179. *
  180. ******************************************************************************/
  181. struct acpi_table_einj {
  182. struct acpi_table_header header; /* Common ACPI table header */
  183. u32 header_length;
  184. u8 flags;
  185. u8 reserved[3];
  186. u32 entries;
  187. };
  188. /* EINJ Injection Instruction Entries (actions) */
  189. struct acpi_einj_entry {
  190. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  191. };
  192. /* Masks for Flags field above */
  193. #define ACPI_EINJ_PRESERVE (1)
  194. /* Values for Action field above */
  195. enum acpi_einj_actions {
  196. ACPI_EINJ_BEGIN_OPERATION = 0,
  197. ACPI_EINJ_GET_TRIGGER_TABLE = 1,
  198. ACPI_EINJ_SET_ERROR_TYPE = 2,
  199. ACPI_EINJ_GET_ERROR_TYPE = 3,
  200. ACPI_EINJ_END_OPERATION = 4,
  201. ACPI_EINJ_EXECUTE_OPERATION = 5,
  202. ACPI_EINJ_CHECK_BUSY_STATUS = 6,
  203. ACPI_EINJ_GET_COMMAND_STATUS = 7,
  204. ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
  205. ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
  206. ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
  207. ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
  208. };
  209. /* Values for Instruction field above */
  210. enum acpi_einj_instructions {
  211. ACPI_EINJ_READ_REGISTER = 0,
  212. ACPI_EINJ_READ_REGISTER_VALUE = 1,
  213. ACPI_EINJ_WRITE_REGISTER = 2,
  214. ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
  215. ACPI_EINJ_NOOP = 4,
  216. ACPI_EINJ_FLUSH_CACHELINE = 5,
  217. ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
  218. };
  219. struct acpi_einj_error_type_with_addr {
  220. u32 error_type;
  221. u32 vendor_struct_offset;
  222. u32 flags;
  223. u32 apic_id;
  224. u64 address;
  225. u64 range;
  226. u32 pcie_id;
  227. };
  228. struct acpi_einj_vendor {
  229. u32 length;
  230. u32 pcie_id;
  231. u16 vendor_id;
  232. u16 device_id;
  233. u8 revision_id;
  234. u8 reserved[3];
  235. };
  236. /* EINJ Trigger Error Action Table */
  237. struct acpi_einj_trigger {
  238. u32 header_size;
  239. u32 revision;
  240. u32 table_size;
  241. u32 entry_count;
  242. };
  243. /* Command status return values */
  244. enum acpi_einj_command_status {
  245. ACPI_EINJ_SUCCESS = 0,
  246. ACPI_EINJ_FAILURE = 1,
  247. ACPI_EINJ_INVALID_ACCESS = 2,
  248. ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
  249. };
  250. /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
  251. #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
  252. #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
  253. #define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
  254. #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
  255. #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
  256. #define ACPI_EINJ_MEMORY_FATAL (1<<5)
  257. #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
  258. #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
  259. #define ACPI_EINJ_PCIX_FATAL (1<<8)
  260. #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
  261. #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
  262. #define ACPI_EINJ_PLATFORM_FATAL (1<<11)
  263. #define ACPI_EINJ_VENDOR_DEFINED (1<<31)
  264. /*******************************************************************************
  265. *
  266. * ERST - Error Record Serialization Table (ACPI 4.0)
  267. * Version 1
  268. *
  269. ******************************************************************************/
  270. struct acpi_table_erst {
  271. struct acpi_table_header header; /* Common ACPI table header */
  272. u32 header_length;
  273. u32 reserved;
  274. u32 entries;
  275. };
  276. /* ERST Serialization Entries (actions) */
  277. struct acpi_erst_entry {
  278. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  279. };
  280. /* Masks for Flags field above */
  281. #define ACPI_ERST_PRESERVE (1)
  282. /* Values for Action field above */
  283. enum acpi_erst_actions {
  284. ACPI_ERST_BEGIN_WRITE = 0,
  285. ACPI_ERST_BEGIN_READ = 1,
  286. ACPI_ERST_BEGIN_CLEAR = 2,
  287. ACPI_ERST_END = 3,
  288. ACPI_ERST_SET_RECORD_OFFSET = 4,
  289. ACPI_ERST_EXECUTE_OPERATION = 5,
  290. ACPI_ERST_CHECK_BUSY_STATUS = 6,
  291. ACPI_ERST_GET_COMMAND_STATUS = 7,
  292. ACPI_ERST_GET_RECORD_ID = 8,
  293. ACPI_ERST_SET_RECORD_ID = 9,
  294. ACPI_ERST_GET_RECORD_COUNT = 10,
  295. ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
  296. ACPI_ERST_NOT_USED = 12,
  297. ACPI_ERST_GET_ERROR_RANGE = 13,
  298. ACPI_ERST_GET_ERROR_LENGTH = 14,
  299. ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
  300. ACPI_ERST_EXECUTE_TIMINGS = 16,
  301. ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
  302. };
  303. /* Values for Instruction field above */
  304. enum acpi_erst_instructions {
  305. ACPI_ERST_READ_REGISTER = 0,
  306. ACPI_ERST_READ_REGISTER_VALUE = 1,
  307. ACPI_ERST_WRITE_REGISTER = 2,
  308. ACPI_ERST_WRITE_REGISTER_VALUE = 3,
  309. ACPI_ERST_NOOP = 4,
  310. ACPI_ERST_LOAD_VAR1 = 5,
  311. ACPI_ERST_LOAD_VAR2 = 6,
  312. ACPI_ERST_STORE_VAR1 = 7,
  313. ACPI_ERST_ADD = 8,
  314. ACPI_ERST_SUBTRACT = 9,
  315. ACPI_ERST_ADD_VALUE = 10,
  316. ACPI_ERST_SUBTRACT_VALUE = 11,
  317. ACPI_ERST_STALL = 12,
  318. ACPI_ERST_STALL_WHILE_TRUE = 13,
  319. ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
  320. ACPI_ERST_GOTO = 15,
  321. ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
  322. ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
  323. ACPI_ERST_MOVE_DATA = 18,
  324. ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
  325. };
  326. /* Command status return values */
  327. enum acpi_erst_command_status {
  328. ACPI_ERST_SUCESS = 0,
  329. ACPI_ERST_NO_SPACE = 1,
  330. ACPI_ERST_NOT_AVAILABLE = 2,
  331. ACPI_ERST_FAILURE = 3,
  332. ACPI_ERST_RECORD_EMPTY = 4,
  333. ACPI_ERST_NOT_FOUND = 5,
  334. ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
  335. };
  336. /* Error Record Serialization Information */
  337. struct acpi_erst_info {
  338. u16 signature; /* Should be "ER" */
  339. u8 data[48];
  340. };
  341. /*******************************************************************************
  342. *
  343. * HEST - Hardware Error Source Table (ACPI 4.0)
  344. * Version 1
  345. *
  346. ******************************************************************************/
  347. struct acpi_table_hest {
  348. struct acpi_table_header header; /* Common ACPI table header */
  349. u32 error_source_count;
  350. };
  351. /* HEST subtable header */
  352. struct acpi_hest_header {
  353. u16 type;
  354. u16 source_id;
  355. };
  356. /* Values for Type field above for subtables */
  357. enum acpi_hest_types {
  358. ACPI_HEST_TYPE_IA32_CHECK = 0,
  359. ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
  360. ACPI_HEST_TYPE_IA32_NMI = 2,
  361. ACPI_HEST_TYPE_NOT_USED3 = 3,
  362. ACPI_HEST_TYPE_NOT_USED4 = 4,
  363. ACPI_HEST_TYPE_NOT_USED5 = 5,
  364. ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
  365. ACPI_HEST_TYPE_AER_ENDPOINT = 7,
  366. ACPI_HEST_TYPE_AER_BRIDGE = 8,
  367. ACPI_HEST_TYPE_GENERIC_ERROR = 9,
  368. ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
  369. ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */
  370. };
  371. /*
  372. * HEST substructures contained in subtables
  373. */
  374. /*
  375. * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
  376. * struct acpi_hest_ia_corrected structures.
  377. */
  378. struct acpi_hest_ia_error_bank {
  379. u8 bank_number;
  380. u8 clear_status_on_init;
  381. u8 status_format;
  382. u8 reserved;
  383. u32 control_register;
  384. u64 control_data;
  385. u32 status_register;
  386. u32 address_register;
  387. u32 misc_register;
  388. };
  389. /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
  390. struct acpi_hest_aer_common {
  391. u16 reserved1;
  392. u8 flags;
  393. u8 enabled;
  394. u32 records_to_preallocate;
  395. u32 max_sections_per_record;
  396. u32 bus; /* Bus and Segment numbers */
  397. u16 device;
  398. u16 function;
  399. u16 device_control;
  400. u16 reserved2;
  401. u32 uncorrectable_mask;
  402. u32 uncorrectable_severity;
  403. u32 correctable_mask;
  404. u32 advanced_capabilities;
  405. };
  406. /* Masks for HEST Flags fields */
  407. #define ACPI_HEST_FIRMWARE_FIRST (1)
  408. #define ACPI_HEST_GLOBAL (1<<1)
  409. /*
  410. * Macros to access the bus/segment numbers in Bus field above:
  411. * Bus number is encoded in bits 7:0
  412. * Segment number is encoded in bits 23:8
  413. */
  414. #define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
  415. #define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
  416. /* Hardware Error Notification */
  417. struct acpi_hest_notify {
  418. u8 type;
  419. u8 length;
  420. u16 config_write_enable;
  421. u32 poll_interval;
  422. u32 vector;
  423. u32 polling_threshold_value;
  424. u32 polling_threshold_window;
  425. u32 error_threshold_value;
  426. u32 error_threshold_window;
  427. };
  428. /* Values for Notify Type field above */
  429. enum acpi_hest_notify_types {
  430. ACPI_HEST_NOTIFY_POLLED = 0,
  431. ACPI_HEST_NOTIFY_EXTERNAL = 1,
  432. ACPI_HEST_NOTIFY_LOCAL = 2,
  433. ACPI_HEST_NOTIFY_SCI = 3,
  434. ACPI_HEST_NOTIFY_NMI = 4,
  435. ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
  436. ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
  437. ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
  438. ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
  439. ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
  440. ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
  441. ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */
  442. };
  443. /* Values for config_write_enable bitfield above */
  444. #define ACPI_HEST_TYPE (1)
  445. #define ACPI_HEST_POLL_INTERVAL (1<<1)
  446. #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
  447. #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
  448. #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
  449. #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
  450. /*
  451. * HEST subtables
  452. */
  453. /* 0: IA32 Machine Check Exception */
  454. struct acpi_hest_ia_machine_check {
  455. struct acpi_hest_header header;
  456. u16 reserved1;
  457. u8 flags;
  458. u8 enabled;
  459. u32 records_to_preallocate;
  460. u32 max_sections_per_record;
  461. u64 global_capability_data;
  462. u64 global_control_data;
  463. u8 num_hardware_banks;
  464. u8 reserved3[7];
  465. };
  466. /* 1: IA32 Corrected Machine Check */
  467. struct acpi_hest_ia_corrected {
  468. struct acpi_hest_header header;
  469. u16 reserved1;
  470. u8 flags;
  471. u8 enabled;
  472. u32 records_to_preallocate;
  473. u32 max_sections_per_record;
  474. struct acpi_hest_notify notify;
  475. u8 num_hardware_banks;
  476. u8 reserved2[3];
  477. };
  478. /* 2: IA32 Non-Maskable Interrupt */
  479. struct acpi_hest_ia_nmi {
  480. struct acpi_hest_header header;
  481. u32 reserved;
  482. u32 records_to_preallocate;
  483. u32 max_sections_per_record;
  484. u32 max_raw_data_length;
  485. };
  486. /* 3,4,5: Not used */
  487. /* 6: PCI Express Root Port AER */
  488. struct acpi_hest_aer_root {
  489. struct acpi_hest_header header;
  490. struct acpi_hest_aer_common aer;
  491. u32 root_error_command;
  492. };
  493. /* 7: PCI Express AER (AER Endpoint) */
  494. struct acpi_hest_aer {
  495. struct acpi_hest_header header;
  496. struct acpi_hest_aer_common aer;
  497. };
  498. /* 8: PCI Express/PCI-X Bridge AER */
  499. struct acpi_hest_aer_bridge {
  500. struct acpi_hest_header header;
  501. struct acpi_hest_aer_common aer;
  502. u32 uncorrectable_mask2;
  503. u32 uncorrectable_severity2;
  504. u32 advanced_capabilities2;
  505. };
  506. /* 9: Generic Hardware Error Source */
  507. struct acpi_hest_generic {
  508. struct acpi_hest_header header;
  509. u16 related_source_id;
  510. u8 reserved;
  511. u8 enabled;
  512. u32 records_to_preallocate;
  513. u32 max_sections_per_record;
  514. u32 max_raw_data_length;
  515. struct acpi_generic_address error_status_address;
  516. struct acpi_hest_notify notify;
  517. u32 error_block_length;
  518. };
  519. /* 10: Generic Hardware Error Source, version 2 */
  520. struct acpi_hest_generic_v2 {
  521. struct acpi_hest_header header;
  522. u16 related_source_id;
  523. u8 reserved;
  524. u8 enabled;
  525. u32 records_to_preallocate;
  526. u32 max_sections_per_record;
  527. u32 max_raw_data_length;
  528. struct acpi_generic_address error_status_address;
  529. struct acpi_hest_notify notify;
  530. u32 error_block_length;
  531. struct acpi_generic_address read_ack_register;
  532. u64 read_ack_preserve;
  533. u64 read_ack_write;
  534. };
  535. /* Generic Error Status block */
  536. struct acpi_hest_generic_status {
  537. u32 block_status;
  538. u32 raw_data_offset;
  539. u32 raw_data_length;
  540. u32 data_length;
  541. u32 error_severity;
  542. };
  543. /* Values for block_status flags above */
  544. #define ACPI_HEST_UNCORRECTABLE (1)
  545. #define ACPI_HEST_CORRECTABLE (1<<1)
  546. #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
  547. #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
  548. #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  549. /* Generic Error Data entry */
  550. struct acpi_hest_generic_data {
  551. u8 section_type[16];
  552. u32 error_severity;
  553. u16 revision;
  554. u8 validation_bits;
  555. u8 flags;
  556. u32 error_data_length;
  557. u8 fru_id[16];
  558. u8 fru_text[20];
  559. };
  560. /* Extension for revision 0x0300 */
  561. struct acpi_hest_generic_data_v300 {
  562. u8 section_type[16];
  563. u32 error_severity;
  564. u16 revision;
  565. u8 validation_bits;
  566. u8 flags;
  567. u32 error_data_length;
  568. u8 fru_id[16];
  569. u8 fru_text[20];
  570. u64 time_stamp;
  571. };
  572. /* Values for error_severity above */
  573. #define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
  574. #define ACPI_HEST_GEN_ERROR_FATAL 1
  575. #define ACPI_HEST_GEN_ERROR_CORRECTED 2
  576. #define ACPI_HEST_GEN_ERROR_NONE 3
  577. /* Flags for validation_bits above */
  578. #define ACPI_HEST_GEN_VALID_FRU_ID (1)
  579. #define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
  580. #define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
  581. /*******************************************************************************
  582. *
  583. * MADT - Multiple APIC Description Table
  584. * Version 3
  585. *
  586. ******************************************************************************/
  587. struct acpi_table_madt {
  588. struct acpi_table_header header; /* Common ACPI table header */
  589. u32 address; /* Physical address of local APIC */
  590. u32 flags;
  591. };
  592. /* Masks for Flags field above */
  593. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  594. /* Values for PCATCompat flag */
  595. #define ACPI_MADT_DUAL_PIC 0
  596. #define ACPI_MADT_MULTIPLE_APIC 1
  597. /* Values for MADT subtable type in struct acpi_subtable_header */
  598. enum acpi_madt_type {
  599. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  600. ACPI_MADT_TYPE_IO_APIC = 1,
  601. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  602. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  603. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  604. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  605. ACPI_MADT_TYPE_IO_SAPIC = 6,
  606. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  607. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  608. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  609. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  610. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  611. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  612. ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
  613. ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
  614. ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
  615. ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
  616. };
  617. /*
  618. * MADT Subtables, correspond to Type in struct acpi_subtable_header
  619. */
  620. /* 0: Processor Local APIC */
  621. struct acpi_madt_local_apic {
  622. struct acpi_subtable_header header;
  623. u8 processor_id; /* ACPI processor id */
  624. u8 id; /* Processor's local APIC id */
  625. u32 lapic_flags;
  626. };
  627. /* 1: IO APIC */
  628. struct acpi_madt_io_apic {
  629. struct acpi_subtable_header header;
  630. u8 id; /* I/O APIC ID */
  631. u8 reserved; /* reserved - must be zero */
  632. u32 address; /* APIC physical address */
  633. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  634. };
  635. /* 2: Interrupt Override */
  636. struct acpi_madt_interrupt_override {
  637. struct acpi_subtable_header header;
  638. u8 bus; /* 0 - ISA */
  639. u8 source_irq; /* Interrupt source (IRQ) */
  640. u32 global_irq; /* Global system interrupt */
  641. u16 inti_flags;
  642. };
  643. /* 3: NMI Source */
  644. struct acpi_madt_nmi_source {
  645. struct acpi_subtable_header header;
  646. u16 inti_flags;
  647. u32 global_irq; /* Global system interrupt */
  648. };
  649. /* 4: Local APIC NMI */
  650. struct acpi_madt_local_apic_nmi {
  651. struct acpi_subtable_header header;
  652. u8 processor_id; /* ACPI processor id */
  653. u16 inti_flags;
  654. u8 lint; /* LINTn to which NMI is connected */
  655. };
  656. /* 5: Address Override */
  657. struct acpi_madt_local_apic_override {
  658. struct acpi_subtable_header header;
  659. u16 reserved; /* Reserved, must be zero */
  660. u64 address; /* APIC physical address */
  661. };
  662. /* 6: I/O Sapic */
  663. struct acpi_madt_io_sapic {
  664. struct acpi_subtable_header header;
  665. u8 id; /* I/O SAPIC ID */
  666. u8 reserved; /* Reserved, must be zero */
  667. u32 global_irq_base; /* Global interrupt for SAPIC start */
  668. u64 address; /* SAPIC physical address */
  669. };
  670. /* 7: Local Sapic */
  671. struct acpi_madt_local_sapic {
  672. struct acpi_subtable_header header;
  673. u8 processor_id; /* ACPI processor id */
  674. u8 id; /* SAPIC ID */
  675. u8 eid; /* SAPIC EID */
  676. u8 reserved[3]; /* Reserved, must be zero */
  677. u32 lapic_flags;
  678. u32 uid; /* Numeric UID - ACPI 3.0 */
  679. char uid_string[1]; /* String UID - ACPI 3.0 */
  680. };
  681. /* 8: Platform Interrupt Source */
  682. struct acpi_madt_interrupt_source {
  683. struct acpi_subtable_header header;
  684. u16 inti_flags;
  685. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  686. u8 id; /* Processor ID */
  687. u8 eid; /* Processor EID */
  688. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  689. u32 global_irq; /* Global system interrupt */
  690. u32 flags; /* Interrupt Source Flags */
  691. };
  692. /* Masks for Flags field above */
  693. #define ACPI_MADT_CPEI_OVERRIDE (1)
  694. /* 9: Processor Local X2APIC (ACPI 4.0) */
  695. struct acpi_madt_local_x2apic {
  696. struct acpi_subtable_header header;
  697. u16 reserved; /* reserved - must be zero */
  698. u32 local_apic_id; /* Processor x2APIC ID */
  699. u32 lapic_flags;
  700. u32 uid; /* ACPI processor UID */
  701. };
  702. /* 10: Local X2APIC NMI (ACPI 4.0) */
  703. struct acpi_madt_local_x2apic_nmi {
  704. struct acpi_subtable_header header;
  705. u16 inti_flags;
  706. u32 uid; /* ACPI processor UID */
  707. u8 lint; /* LINTn to which NMI is connected */
  708. u8 reserved[3]; /* reserved - must be zero */
  709. };
  710. /* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
  711. struct acpi_madt_generic_interrupt {
  712. struct acpi_subtable_header header;
  713. u16 reserved; /* reserved - must be zero */
  714. u32 cpu_interface_number;
  715. u32 uid;
  716. u32 flags;
  717. u32 parking_version;
  718. u32 performance_interrupt;
  719. u64 parked_address;
  720. u64 base_address;
  721. u64 gicv_base_address;
  722. u64 gich_base_address;
  723. u32 vgic_interrupt;
  724. u64 gicr_base_address;
  725. u64 arm_mpidr;
  726. u8 efficiency_class;
  727. u8 reserved2[3];
  728. };
  729. /* Masks for Flags field above */
  730. /* ACPI_MADT_ENABLED (1) Processor is usable if set */
  731. #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
  732. #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
  733. /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
  734. struct acpi_madt_generic_distributor {
  735. struct acpi_subtable_header header;
  736. u16 reserved; /* reserved - must be zero */
  737. u32 gic_id;
  738. u64 base_address;
  739. u32 global_irq_base;
  740. u8 version;
  741. u8 reserved2[3]; /* reserved - must be zero */
  742. };
  743. /* Values for Version field above */
  744. enum acpi_madt_gic_version {
  745. ACPI_MADT_GIC_VERSION_NONE = 0,
  746. ACPI_MADT_GIC_VERSION_V1 = 1,
  747. ACPI_MADT_GIC_VERSION_V2 = 2,
  748. ACPI_MADT_GIC_VERSION_V3 = 3,
  749. ACPI_MADT_GIC_VERSION_V4 = 4,
  750. ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
  751. };
  752. /* 13: Generic MSI Frame (ACPI 5.1) */
  753. struct acpi_madt_generic_msi_frame {
  754. struct acpi_subtable_header header;
  755. u16 reserved; /* reserved - must be zero */
  756. u32 msi_frame_id;
  757. u64 base_address;
  758. u32 flags;
  759. u16 spi_count;
  760. u16 spi_base;
  761. };
  762. /* Masks for Flags field above */
  763. #define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
  764. /* 14: Generic Redistributor (ACPI 5.1) */
  765. struct acpi_madt_generic_redistributor {
  766. struct acpi_subtable_header header;
  767. u16 reserved; /* reserved - must be zero */
  768. u64 base_address;
  769. u32 length;
  770. };
  771. /* 15: Generic Translator (ACPI 6.0) */
  772. struct acpi_madt_generic_translator {
  773. struct acpi_subtable_header header;
  774. u16 reserved; /* reserved - must be zero */
  775. u32 translation_id;
  776. u64 base_address;
  777. u32 reserved2;
  778. };
  779. /*
  780. * Common flags fields for MADT subtables
  781. */
  782. /* MADT Local APIC flags */
  783. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  784. /* MADT MPS INTI flags (inti_flags) */
  785. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  786. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  787. /* Values for MPS INTI flags */
  788. #define ACPI_MADT_POLARITY_CONFORMS 0
  789. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  790. #define ACPI_MADT_POLARITY_RESERVED 2
  791. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  792. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  793. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  794. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  795. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  796. /*******************************************************************************
  797. *
  798. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  799. * Version 1
  800. *
  801. ******************************************************************************/
  802. struct acpi_table_msct {
  803. struct acpi_table_header header; /* Common ACPI table header */
  804. u32 proximity_offset; /* Location of proximity info struct(s) */
  805. u32 max_proximity_domains; /* Max number of proximity domains */
  806. u32 max_clock_domains; /* Max number of clock domains */
  807. u64 max_address; /* Max physical address in system */
  808. };
  809. /* subtable - Maximum Proximity Domain Information. Version 1 */
  810. struct acpi_msct_proximity {
  811. u8 revision;
  812. u8 length;
  813. u32 range_start; /* Start of domain range */
  814. u32 range_end; /* End of domain range */
  815. u32 processor_capacity;
  816. u64 memory_capacity; /* In bytes */
  817. };
  818. /*******************************************************************************
  819. *
  820. * NFIT - NVDIMM Interface Table (ACPI 6.0+)
  821. * Version 1
  822. *
  823. ******************************************************************************/
  824. struct acpi_table_nfit {
  825. struct acpi_table_header header; /* Common ACPI table header */
  826. u32 reserved; /* Reserved, must be zero */
  827. };
  828. /* Subtable header for NFIT */
  829. struct acpi_nfit_header {
  830. u16 type;
  831. u16 length;
  832. };
  833. /* Values for subtable type in struct acpi_nfit_header */
  834. enum acpi_nfit_type {
  835. ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
  836. ACPI_NFIT_TYPE_MEMORY_MAP = 1,
  837. ACPI_NFIT_TYPE_INTERLEAVE = 2,
  838. ACPI_NFIT_TYPE_SMBIOS = 3,
  839. ACPI_NFIT_TYPE_CONTROL_REGION = 4,
  840. ACPI_NFIT_TYPE_DATA_REGION = 5,
  841. ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
  842. ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
  843. };
  844. /*
  845. * NFIT Subtables
  846. */
  847. /* 0: System Physical Address Range Structure */
  848. struct acpi_nfit_system_address {
  849. struct acpi_nfit_header header;
  850. u16 range_index;
  851. u16 flags;
  852. u32 reserved; /* Reseved, must be zero */
  853. u32 proximity_domain;
  854. u8 range_guid[16];
  855. u64 address;
  856. u64 length;
  857. u64 memory_mapping;
  858. };
  859. /* Flags */
  860. #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
  861. #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
  862. /* Range Type GUIDs appear in the include/acuuid.h file */
  863. /* 1: Memory Device to System Address Range Map Structure */
  864. struct acpi_nfit_memory_map {
  865. struct acpi_nfit_header header;
  866. u32 device_handle;
  867. u16 physical_id;
  868. u16 region_id;
  869. u16 range_index;
  870. u16 region_index;
  871. u64 region_size;
  872. u64 region_offset;
  873. u64 address;
  874. u16 interleave_index;
  875. u16 interleave_ways;
  876. u16 flags;
  877. u16 reserved; /* Reserved, must be zero */
  878. };
  879. /* Flags */
  880. #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
  881. #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
  882. #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
  883. #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
  884. #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
  885. #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
  886. #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
  887. /* 2: Interleave Structure */
  888. struct acpi_nfit_interleave {
  889. struct acpi_nfit_header header;
  890. u16 interleave_index;
  891. u16 reserved; /* Reserved, must be zero */
  892. u32 line_count;
  893. u32 line_size;
  894. u32 line_offset[1]; /* Variable length */
  895. };
  896. /* 3: SMBIOS Management Information Structure */
  897. struct acpi_nfit_smbios {
  898. struct acpi_nfit_header header;
  899. u32 reserved; /* Reserved, must be zero */
  900. u8 data[1]; /* Variable length */
  901. };
  902. /* 4: NVDIMM Control Region Structure */
  903. struct acpi_nfit_control_region {
  904. struct acpi_nfit_header header;
  905. u16 region_index;
  906. u16 vendor_id;
  907. u16 device_id;
  908. u16 revision_id;
  909. u16 subsystem_vendor_id;
  910. u16 subsystem_device_id;
  911. u16 subsystem_revision_id;
  912. u8 valid_fields;
  913. u8 manufacturing_location;
  914. u16 manufacturing_date;
  915. u8 reserved[2]; /* Reserved, must be zero */
  916. u32 serial_number;
  917. u16 code;
  918. u16 windows;
  919. u64 window_size;
  920. u64 command_offset;
  921. u64 command_size;
  922. u64 status_offset;
  923. u64 status_size;
  924. u16 flags;
  925. u8 reserved1[6]; /* Reserved, must be zero */
  926. };
  927. /* Flags */
  928. #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
  929. /* valid_fields bits */
  930. #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
  931. /* 5: NVDIMM Block Data Window Region Structure */
  932. struct acpi_nfit_data_region {
  933. struct acpi_nfit_header header;
  934. u16 region_index;
  935. u16 windows;
  936. u64 offset;
  937. u64 size;
  938. u64 capacity;
  939. u64 start_address;
  940. };
  941. /* 6: Flush Hint Address Structure */
  942. struct acpi_nfit_flush_address {
  943. struct acpi_nfit_header header;
  944. u32 device_handle;
  945. u16 hint_count;
  946. u8 reserved[6]; /* Reserved, must be zero */
  947. u64 hint_address[1]; /* Variable length */
  948. };
  949. /*******************************************************************************
  950. *
  951. * SBST - Smart Battery Specification Table
  952. * Version 1
  953. *
  954. ******************************************************************************/
  955. struct acpi_table_sbst {
  956. struct acpi_table_header header; /* Common ACPI table header */
  957. u32 warning_level;
  958. u32 low_level;
  959. u32 critical_level;
  960. };
  961. /*******************************************************************************
  962. *
  963. * SLIT - System Locality Distance Information Table
  964. * Version 1
  965. *
  966. ******************************************************************************/
  967. struct acpi_table_slit {
  968. struct acpi_table_header header; /* Common ACPI table header */
  969. u64 locality_count;
  970. u8 entry[1]; /* Real size = localities^2 */
  971. };
  972. /*******************************************************************************
  973. *
  974. * SRAT - System Resource Affinity Table
  975. * Version 3
  976. *
  977. ******************************************************************************/
  978. struct acpi_table_srat {
  979. struct acpi_table_header header; /* Common ACPI table header */
  980. u32 table_revision; /* Must be value '1' */
  981. u64 reserved; /* Reserved, must be zero */
  982. };
  983. /* Values for subtable type in struct acpi_subtable_header */
  984. enum acpi_srat_type {
  985. ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  986. ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  987. ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
  988. ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
  989. ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
  990. };
  991. /*
  992. * SRAT Subtables, correspond to Type in struct acpi_subtable_header
  993. */
  994. /* 0: Processor Local APIC/SAPIC Affinity */
  995. struct acpi_srat_cpu_affinity {
  996. struct acpi_subtable_header header;
  997. u8 proximity_domain_lo;
  998. u8 apic_id;
  999. u32 flags;
  1000. u8 local_sapic_eid;
  1001. u8 proximity_domain_hi[3];
  1002. u32 clock_domain;
  1003. };
  1004. /* Flags */
  1005. #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
  1006. /* 1: Memory Affinity */
  1007. struct acpi_srat_mem_affinity {
  1008. struct acpi_subtable_header header;
  1009. u32 proximity_domain;
  1010. u16 reserved; /* Reserved, must be zero */
  1011. u64 base_address;
  1012. u64 length;
  1013. u32 reserved1;
  1014. u32 flags;
  1015. u64 reserved2; /* Reserved, must be zero */
  1016. };
  1017. /* Flags */
  1018. #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
  1019. #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
  1020. #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
  1021. /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
  1022. struct acpi_srat_x2apic_cpu_affinity {
  1023. struct acpi_subtable_header header;
  1024. u16 reserved; /* Reserved, must be zero */
  1025. u32 proximity_domain;
  1026. u32 apic_id;
  1027. u32 flags;
  1028. u32 clock_domain;
  1029. u32 reserved2;
  1030. };
  1031. /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
  1032. #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
  1033. /* 3: GICC Affinity (ACPI 5.1) */
  1034. struct acpi_srat_gicc_affinity {
  1035. struct acpi_subtable_header header;
  1036. u32 proximity_domain;
  1037. u32 acpi_processor_uid;
  1038. u32 flags;
  1039. u32 clock_domain;
  1040. };
  1041. /* Flags for struct acpi_srat_gicc_affinity */
  1042. #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
  1043. /* Reset to default packing */
  1044. #pragma pack()
  1045. #endif /* __ACTBL1_H__ */