actbl1.h 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666
  1. /******************************************************************************
  2. *
  3. * Name: actbl1.h - Additional ACPI table definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2018, 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_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
  65. #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
  66. #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
  67. #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
  68. #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
  69. #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
  70. #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
  71. #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
  72. #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
  73. #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
  74. #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
  75. /*
  76. * All tables must be byte-packed to match the ACPI specification, since
  77. * the tables are provided by the system BIOS.
  78. */
  79. #pragma pack(1)
  80. /*
  81. * Note: C bitfields are not used for this reason:
  82. *
  83. * "Bitfields are great and easy to read, but unfortunately the C language
  84. * does not specify the layout of bitfields in memory, which means they are
  85. * essentially useless for dealing with packed data in on-disk formats or
  86. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  87. * this decision was a design error in C. Ritchie could have picked an order
  88. * and stuck with it." Norman Ramsey.
  89. * See http://stackoverflow.com/a/1053662/41661
  90. */
  91. /*******************************************************************************
  92. *
  93. * Common subtable headers
  94. *
  95. ******************************************************************************/
  96. /* Generic subtable header (used in MADT, SRAT, etc.) */
  97. struct acpi_subtable_header {
  98. u8 type;
  99. u8 length;
  100. };
  101. /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
  102. struct acpi_whea_header {
  103. u8 action;
  104. u8 instruction;
  105. u8 flags;
  106. u8 reserved;
  107. struct acpi_generic_address register_region;
  108. u64 value; /* Value used with Read/Write register */
  109. u64 mask; /* Bitmask required for this register instruction */
  110. };
  111. /*******************************************************************************
  112. *
  113. * BERT - Boot Error Record Table (ACPI 4.0)
  114. * Version 1
  115. *
  116. ******************************************************************************/
  117. struct acpi_table_bert {
  118. struct acpi_table_header header; /* Common ACPI table header */
  119. u32 region_length; /* Length of the boot error region */
  120. u64 address; /* Physical address of the error region */
  121. };
  122. /* Boot Error Region (not a subtable, pointed to by Address field above) */
  123. struct acpi_bert_region {
  124. u32 block_status; /* Type of error information */
  125. u32 raw_data_offset; /* Offset to raw error data */
  126. u32 raw_data_length; /* Length of raw error data */
  127. u32 data_length; /* Length of generic error data */
  128. u32 error_severity; /* Severity code */
  129. };
  130. /* Values for block_status flags above */
  131. #define ACPI_BERT_UNCORRECTABLE (1)
  132. #define ACPI_BERT_CORRECTABLE (1<<1)
  133. #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
  134. #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
  135. #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  136. /* Values for error_severity above */
  137. enum acpi_bert_error_severity {
  138. ACPI_BERT_ERROR_CORRECTABLE = 0,
  139. ACPI_BERT_ERROR_FATAL = 1,
  140. ACPI_BERT_ERROR_CORRECTED = 2,
  141. ACPI_BERT_ERROR_NONE = 3,
  142. ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
  143. };
  144. /*
  145. * Note: The generic error data that follows the error_severity field above
  146. * uses the struct acpi_hest_generic_data defined under the HEST table below
  147. */
  148. /*******************************************************************************
  149. *
  150. * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
  151. * Version 1
  152. *
  153. ******************************************************************************/
  154. struct acpi_table_cpep {
  155. struct acpi_table_header header; /* Common ACPI table header */
  156. u64 reserved;
  157. };
  158. /* Subtable */
  159. struct acpi_cpep_polling {
  160. struct acpi_subtable_header header;
  161. u8 id; /* Processor ID */
  162. u8 eid; /* Processor EID */
  163. u32 interval; /* Polling interval (msec) */
  164. };
  165. /*******************************************************************************
  166. *
  167. * ECDT - Embedded Controller Boot Resources Table
  168. * Version 1
  169. *
  170. ******************************************************************************/
  171. struct acpi_table_ecdt {
  172. struct acpi_table_header header; /* Common ACPI table header */
  173. struct acpi_generic_address control; /* Address of EC command/status register */
  174. struct acpi_generic_address data; /* Address of EC data register */
  175. u32 uid; /* Unique ID - must be same as the EC _UID method */
  176. u8 gpe; /* The GPE for the EC */
  177. u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
  178. };
  179. /*******************************************************************************
  180. *
  181. * EINJ - Error Injection Table (ACPI 4.0)
  182. * Version 1
  183. *
  184. ******************************************************************************/
  185. struct acpi_table_einj {
  186. struct acpi_table_header header; /* Common ACPI table header */
  187. u32 header_length;
  188. u8 flags;
  189. u8 reserved[3];
  190. u32 entries;
  191. };
  192. /* EINJ Injection Instruction Entries (actions) */
  193. struct acpi_einj_entry {
  194. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  195. };
  196. /* Masks for Flags field above */
  197. #define ACPI_EINJ_PRESERVE (1)
  198. /* Values for Action field above */
  199. enum acpi_einj_actions {
  200. ACPI_EINJ_BEGIN_OPERATION = 0,
  201. ACPI_EINJ_GET_TRIGGER_TABLE = 1,
  202. ACPI_EINJ_SET_ERROR_TYPE = 2,
  203. ACPI_EINJ_GET_ERROR_TYPE = 3,
  204. ACPI_EINJ_END_OPERATION = 4,
  205. ACPI_EINJ_EXECUTE_OPERATION = 5,
  206. ACPI_EINJ_CHECK_BUSY_STATUS = 6,
  207. ACPI_EINJ_GET_COMMAND_STATUS = 7,
  208. ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
  209. ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
  210. ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
  211. ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
  212. };
  213. /* Values for Instruction field above */
  214. enum acpi_einj_instructions {
  215. ACPI_EINJ_READ_REGISTER = 0,
  216. ACPI_EINJ_READ_REGISTER_VALUE = 1,
  217. ACPI_EINJ_WRITE_REGISTER = 2,
  218. ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
  219. ACPI_EINJ_NOOP = 4,
  220. ACPI_EINJ_FLUSH_CACHELINE = 5,
  221. ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
  222. };
  223. struct acpi_einj_error_type_with_addr {
  224. u32 error_type;
  225. u32 vendor_struct_offset;
  226. u32 flags;
  227. u32 apic_id;
  228. u64 address;
  229. u64 range;
  230. u32 pcie_id;
  231. };
  232. struct acpi_einj_vendor {
  233. u32 length;
  234. u32 pcie_id;
  235. u16 vendor_id;
  236. u16 device_id;
  237. u8 revision_id;
  238. u8 reserved[3];
  239. };
  240. /* EINJ Trigger Error Action Table */
  241. struct acpi_einj_trigger {
  242. u32 header_size;
  243. u32 revision;
  244. u32 table_size;
  245. u32 entry_count;
  246. };
  247. /* Command status return values */
  248. enum acpi_einj_command_status {
  249. ACPI_EINJ_SUCCESS = 0,
  250. ACPI_EINJ_FAILURE = 1,
  251. ACPI_EINJ_INVALID_ACCESS = 2,
  252. ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
  253. };
  254. /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
  255. #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
  256. #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
  257. #define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
  258. #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
  259. #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
  260. #define ACPI_EINJ_MEMORY_FATAL (1<<5)
  261. #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
  262. #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
  263. #define ACPI_EINJ_PCIX_FATAL (1<<8)
  264. #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
  265. #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
  266. #define ACPI_EINJ_PLATFORM_FATAL (1<<11)
  267. #define ACPI_EINJ_VENDOR_DEFINED (1<<31)
  268. /*******************************************************************************
  269. *
  270. * ERST - Error Record Serialization Table (ACPI 4.0)
  271. * Version 1
  272. *
  273. ******************************************************************************/
  274. struct acpi_table_erst {
  275. struct acpi_table_header header; /* Common ACPI table header */
  276. u32 header_length;
  277. u32 reserved;
  278. u32 entries;
  279. };
  280. /* ERST Serialization Entries (actions) */
  281. struct acpi_erst_entry {
  282. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  283. };
  284. /* Masks for Flags field above */
  285. #define ACPI_ERST_PRESERVE (1)
  286. /* Values for Action field above */
  287. enum acpi_erst_actions {
  288. ACPI_ERST_BEGIN_WRITE = 0,
  289. ACPI_ERST_BEGIN_READ = 1,
  290. ACPI_ERST_BEGIN_CLEAR = 2,
  291. ACPI_ERST_END = 3,
  292. ACPI_ERST_SET_RECORD_OFFSET = 4,
  293. ACPI_ERST_EXECUTE_OPERATION = 5,
  294. ACPI_ERST_CHECK_BUSY_STATUS = 6,
  295. ACPI_ERST_GET_COMMAND_STATUS = 7,
  296. ACPI_ERST_GET_RECORD_ID = 8,
  297. ACPI_ERST_SET_RECORD_ID = 9,
  298. ACPI_ERST_GET_RECORD_COUNT = 10,
  299. ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
  300. ACPI_ERST_NOT_USED = 12,
  301. ACPI_ERST_GET_ERROR_RANGE = 13,
  302. ACPI_ERST_GET_ERROR_LENGTH = 14,
  303. ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
  304. ACPI_ERST_EXECUTE_TIMINGS = 16,
  305. ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
  306. };
  307. /* Values for Instruction field above */
  308. enum acpi_erst_instructions {
  309. ACPI_ERST_READ_REGISTER = 0,
  310. ACPI_ERST_READ_REGISTER_VALUE = 1,
  311. ACPI_ERST_WRITE_REGISTER = 2,
  312. ACPI_ERST_WRITE_REGISTER_VALUE = 3,
  313. ACPI_ERST_NOOP = 4,
  314. ACPI_ERST_LOAD_VAR1 = 5,
  315. ACPI_ERST_LOAD_VAR2 = 6,
  316. ACPI_ERST_STORE_VAR1 = 7,
  317. ACPI_ERST_ADD = 8,
  318. ACPI_ERST_SUBTRACT = 9,
  319. ACPI_ERST_ADD_VALUE = 10,
  320. ACPI_ERST_SUBTRACT_VALUE = 11,
  321. ACPI_ERST_STALL = 12,
  322. ACPI_ERST_STALL_WHILE_TRUE = 13,
  323. ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
  324. ACPI_ERST_GOTO = 15,
  325. ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
  326. ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
  327. ACPI_ERST_MOVE_DATA = 18,
  328. ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
  329. };
  330. /* Command status return values */
  331. enum acpi_erst_command_status {
  332. ACPI_ERST_SUCESS = 0,
  333. ACPI_ERST_NO_SPACE = 1,
  334. ACPI_ERST_NOT_AVAILABLE = 2,
  335. ACPI_ERST_FAILURE = 3,
  336. ACPI_ERST_RECORD_EMPTY = 4,
  337. ACPI_ERST_NOT_FOUND = 5,
  338. ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
  339. };
  340. /* Error Record Serialization Information */
  341. struct acpi_erst_info {
  342. u16 signature; /* Should be "ER" */
  343. u8 data[48];
  344. };
  345. /*******************************************************************************
  346. *
  347. * HEST - Hardware Error Source Table (ACPI 4.0)
  348. * Version 1
  349. *
  350. ******************************************************************************/
  351. struct acpi_table_hest {
  352. struct acpi_table_header header; /* Common ACPI table header */
  353. u32 error_source_count;
  354. };
  355. /* HEST subtable header */
  356. struct acpi_hest_header {
  357. u16 type;
  358. u16 source_id;
  359. };
  360. /* Values for Type field above for subtables */
  361. enum acpi_hest_types {
  362. ACPI_HEST_TYPE_IA32_CHECK = 0,
  363. ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
  364. ACPI_HEST_TYPE_IA32_NMI = 2,
  365. ACPI_HEST_TYPE_NOT_USED3 = 3,
  366. ACPI_HEST_TYPE_NOT_USED4 = 4,
  367. ACPI_HEST_TYPE_NOT_USED5 = 5,
  368. ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
  369. ACPI_HEST_TYPE_AER_ENDPOINT = 7,
  370. ACPI_HEST_TYPE_AER_BRIDGE = 8,
  371. ACPI_HEST_TYPE_GENERIC_ERROR = 9,
  372. ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
  373. ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
  374. ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */
  375. };
  376. /*
  377. * HEST substructures contained in subtables
  378. */
  379. /*
  380. * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
  381. * struct acpi_hest_ia_corrected structures.
  382. */
  383. struct acpi_hest_ia_error_bank {
  384. u8 bank_number;
  385. u8 clear_status_on_init;
  386. u8 status_format;
  387. u8 reserved;
  388. u32 control_register;
  389. u64 control_data;
  390. u32 status_register;
  391. u32 address_register;
  392. u32 misc_register;
  393. };
  394. /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
  395. struct acpi_hest_aer_common {
  396. u16 reserved1;
  397. u8 flags;
  398. u8 enabled;
  399. u32 records_to_preallocate;
  400. u32 max_sections_per_record;
  401. u32 bus; /* Bus and Segment numbers */
  402. u16 device;
  403. u16 function;
  404. u16 device_control;
  405. u16 reserved2;
  406. u32 uncorrectable_mask;
  407. u32 uncorrectable_severity;
  408. u32 correctable_mask;
  409. u32 advanced_capabilities;
  410. };
  411. /* Masks for HEST Flags fields */
  412. #define ACPI_HEST_FIRMWARE_FIRST (1)
  413. #define ACPI_HEST_GLOBAL (1<<1)
  414. #define ACPI_HEST_GHES_ASSIST (1<<2)
  415. /*
  416. * Macros to access the bus/segment numbers in Bus field above:
  417. * Bus number is encoded in bits 7:0
  418. * Segment number is encoded in bits 23:8
  419. */
  420. #define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
  421. #define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
  422. /* Hardware Error Notification */
  423. struct acpi_hest_notify {
  424. u8 type;
  425. u8 length;
  426. u16 config_write_enable;
  427. u32 poll_interval;
  428. u32 vector;
  429. u32 polling_threshold_value;
  430. u32 polling_threshold_window;
  431. u32 error_threshold_value;
  432. u32 error_threshold_window;
  433. };
  434. /* Values for Notify Type field above */
  435. enum acpi_hest_notify_types {
  436. ACPI_HEST_NOTIFY_POLLED = 0,
  437. ACPI_HEST_NOTIFY_EXTERNAL = 1,
  438. ACPI_HEST_NOTIFY_LOCAL = 2,
  439. ACPI_HEST_NOTIFY_SCI = 3,
  440. ACPI_HEST_NOTIFY_NMI = 4,
  441. ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
  442. ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
  443. ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
  444. ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
  445. ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
  446. ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
  447. ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
  448. ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
  449. };
  450. /* Values for config_write_enable bitfield above */
  451. #define ACPI_HEST_TYPE (1)
  452. #define ACPI_HEST_POLL_INTERVAL (1<<1)
  453. #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
  454. #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
  455. #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
  456. #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
  457. /*
  458. * HEST subtables
  459. */
  460. /* 0: IA32 Machine Check Exception */
  461. struct acpi_hest_ia_machine_check {
  462. struct acpi_hest_header header;
  463. u16 reserved1;
  464. u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
  465. u8 enabled;
  466. u32 records_to_preallocate;
  467. u32 max_sections_per_record;
  468. u64 global_capability_data;
  469. u64 global_control_data;
  470. u8 num_hardware_banks;
  471. u8 reserved3[7];
  472. };
  473. /* 1: IA32 Corrected Machine Check */
  474. struct acpi_hest_ia_corrected {
  475. struct acpi_hest_header header;
  476. u16 reserved1;
  477. u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
  478. u8 enabled;
  479. u32 records_to_preallocate;
  480. u32 max_sections_per_record;
  481. struct acpi_hest_notify notify;
  482. u8 num_hardware_banks;
  483. u8 reserved2[3];
  484. };
  485. /* 2: IA32 Non-Maskable Interrupt */
  486. struct acpi_hest_ia_nmi {
  487. struct acpi_hest_header header;
  488. u32 reserved;
  489. u32 records_to_preallocate;
  490. u32 max_sections_per_record;
  491. u32 max_raw_data_length;
  492. };
  493. /* 3,4,5: Not used */
  494. /* 6: PCI Express Root Port AER */
  495. struct acpi_hest_aer_root {
  496. struct acpi_hest_header header;
  497. struct acpi_hest_aer_common aer;
  498. u32 root_error_command;
  499. };
  500. /* 7: PCI Express AER (AER Endpoint) */
  501. struct acpi_hest_aer {
  502. struct acpi_hest_header header;
  503. struct acpi_hest_aer_common aer;
  504. };
  505. /* 8: PCI Express/PCI-X Bridge AER */
  506. struct acpi_hest_aer_bridge {
  507. struct acpi_hest_header header;
  508. struct acpi_hest_aer_common aer;
  509. u32 uncorrectable_mask2;
  510. u32 uncorrectable_severity2;
  511. u32 advanced_capabilities2;
  512. };
  513. /* 9: Generic Hardware Error Source */
  514. struct acpi_hest_generic {
  515. struct acpi_hest_header header;
  516. u16 related_source_id;
  517. u8 reserved;
  518. u8 enabled;
  519. u32 records_to_preallocate;
  520. u32 max_sections_per_record;
  521. u32 max_raw_data_length;
  522. struct acpi_generic_address error_status_address;
  523. struct acpi_hest_notify notify;
  524. u32 error_block_length;
  525. };
  526. /* 10: Generic Hardware Error Source, version 2 */
  527. struct acpi_hest_generic_v2 {
  528. struct acpi_hest_header header;
  529. u16 related_source_id;
  530. u8 reserved;
  531. u8 enabled;
  532. u32 records_to_preallocate;
  533. u32 max_sections_per_record;
  534. u32 max_raw_data_length;
  535. struct acpi_generic_address error_status_address;
  536. struct acpi_hest_notify notify;
  537. u32 error_block_length;
  538. struct acpi_generic_address read_ack_register;
  539. u64 read_ack_preserve;
  540. u64 read_ack_write;
  541. };
  542. /* Generic Error Status block */
  543. struct acpi_hest_generic_status {
  544. u32 block_status;
  545. u32 raw_data_offset;
  546. u32 raw_data_length;
  547. u32 data_length;
  548. u32 error_severity;
  549. };
  550. /* Values for block_status flags above */
  551. #define ACPI_HEST_UNCORRECTABLE (1)
  552. #define ACPI_HEST_CORRECTABLE (1<<1)
  553. #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
  554. #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
  555. #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  556. /* Generic Error Data entry */
  557. struct acpi_hest_generic_data {
  558. u8 section_type[16];
  559. u32 error_severity;
  560. u16 revision;
  561. u8 validation_bits;
  562. u8 flags;
  563. u32 error_data_length;
  564. u8 fru_id[16];
  565. u8 fru_text[20];
  566. };
  567. /* Extension for revision 0x0300 */
  568. struct acpi_hest_generic_data_v300 {
  569. u8 section_type[16];
  570. u32 error_severity;
  571. u16 revision;
  572. u8 validation_bits;
  573. u8 flags;
  574. u32 error_data_length;
  575. u8 fru_id[16];
  576. u8 fru_text[20];
  577. u64 time_stamp;
  578. };
  579. /* Values for error_severity above */
  580. #define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
  581. #define ACPI_HEST_GEN_ERROR_FATAL 1
  582. #define ACPI_HEST_GEN_ERROR_CORRECTED 2
  583. #define ACPI_HEST_GEN_ERROR_NONE 3
  584. /* Flags for validation_bits above */
  585. #define ACPI_HEST_GEN_VALID_FRU_ID (1)
  586. #define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
  587. #define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
  588. /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
  589. struct acpi_hest_ia_deferred_check {
  590. struct acpi_hest_header header;
  591. u16 reserved1;
  592. u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
  593. u8 enabled;
  594. u32 records_to_preallocate;
  595. u32 max_sections_per_record;
  596. struct acpi_hest_notify notify;
  597. u8 num_hardware_banks;
  598. u8 reserved2[3];
  599. };
  600. /*******************************************************************************
  601. *
  602. * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
  603. * Version 1
  604. *
  605. ******************************************************************************/
  606. struct acpi_table_hmat {
  607. struct acpi_table_header header; /* Common ACPI table header */
  608. u32 reserved;
  609. };
  610. /* Values for HMAT structure types */
  611. enum acpi_hmat_type {
  612. ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
  613. ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
  614. ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
  615. ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
  616. };
  617. struct acpi_hmat_structure {
  618. u16 type;
  619. u16 reserved;
  620. u32 length;
  621. };
  622. /*
  623. * HMAT Structures, correspond to Type in struct acpi_hmat_structure
  624. */
  625. /* 0: Memory subystem address range */
  626. struct acpi_hmat_address_range {
  627. struct acpi_hmat_structure header;
  628. u16 flags;
  629. u16 reserved1;
  630. u32 processor_PD; /* Processor proximity domain */
  631. u32 memory_PD; /* Memory proximity domain */
  632. u32 reserved2;
  633. u64 physical_address_base; /* Physical address range base */
  634. u64 physical_address_length; /* Physical address range length */
  635. };
  636. /* Masks for Flags field above */
  637. #define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: processor_PD field is valid */
  638. #define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: memory_PD field is valid */
  639. #define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
  640. /* 1: System locality latency and bandwidth information */
  641. struct acpi_hmat_locality {
  642. struct acpi_hmat_structure header;
  643. u8 flags;
  644. u8 data_type;
  645. u16 reserved1;
  646. u32 number_of_initiator_Pds;
  647. u32 number_of_target_Pds;
  648. u32 reserved2;
  649. u64 entry_base_unit;
  650. };
  651. /* Masks for Flags field above */
  652. #define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
  653. /* Values for Memory Hierarchy flag */
  654. #define ACPI_HMAT_MEMORY 0
  655. #define ACPI_HMAT_LAST_LEVEL_CACHE 1
  656. #define ACPI_HMAT_1ST_LEVEL_CACHE 2
  657. #define ACPI_HMAT_2ND_LEVEL_CACHE 3
  658. #define ACPI_HMAT_3RD_LEVEL_CACHE 4
  659. /* Values for data_type field above */
  660. #define ACPI_HMAT_ACCESS_LATENCY 0
  661. #define ACPI_HMAT_READ_LATENCY 1
  662. #define ACPI_HMAT_WRITE_LATENCY 2
  663. #define ACPI_HMAT_ACCESS_BANDWIDTH 3
  664. #define ACPI_HMAT_READ_BANDWIDTH 4
  665. #define ACPI_HMAT_WRITE_BANDWIDTH 5
  666. /* 2: Memory side cache information */
  667. struct acpi_hmat_cache {
  668. struct acpi_hmat_structure header;
  669. u32 memory_PD;
  670. u32 reserved1;
  671. u64 cache_size;
  672. u32 cache_attributes;
  673. u16 reserved2;
  674. u16 number_of_SMBIOShandles;
  675. };
  676. /* Masks for cache_attributes field above */
  677. #define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
  678. #define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
  679. #define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
  680. #define ACPI_HMAT_WRITE_POLICY (0x0000F000)
  681. #define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
  682. /* Values for cache associativity flag */
  683. #define ACPI_HMAT_CA_NONE (0)
  684. #define ACPI_HMAT_CA_DIRECT_MAPPED (1)
  685. #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
  686. /* Values for write policy flag */
  687. #define ACPI_HMAT_CP_NONE (0)
  688. #define ACPI_HMAT_CP_WB (1)
  689. #define ACPI_HMAT_CP_WT (2)
  690. /*******************************************************************************
  691. *
  692. * MADT - Multiple APIC Description Table
  693. * Version 3
  694. *
  695. ******************************************************************************/
  696. struct acpi_table_madt {
  697. struct acpi_table_header header; /* Common ACPI table header */
  698. u32 address; /* Physical address of local APIC */
  699. u32 flags;
  700. };
  701. /* Masks for Flags field above */
  702. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  703. /* Values for PCATCompat flag */
  704. #define ACPI_MADT_DUAL_PIC 1
  705. #define ACPI_MADT_MULTIPLE_APIC 0
  706. /* Values for MADT subtable type in struct acpi_subtable_header */
  707. enum acpi_madt_type {
  708. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  709. ACPI_MADT_TYPE_IO_APIC = 1,
  710. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  711. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  712. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  713. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  714. ACPI_MADT_TYPE_IO_SAPIC = 6,
  715. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  716. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  717. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  718. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  719. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  720. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  721. ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
  722. ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
  723. ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
  724. ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
  725. };
  726. /*
  727. * MADT Subtables, correspond to Type in struct acpi_subtable_header
  728. */
  729. /* 0: Processor Local APIC */
  730. struct acpi_madt_local_apic {
  731. struct acpi_subtable_header header;
  732. u8 processor_id; /* ACPI processor id */
  733. u8 id; /* Processor's local APIC id */
  734. u32 lapic_flags;
  735. };
  736. /* 1: IO APIC */
  737. struct acpi_madt_io_apic {
  738. struct acpi_subtable_header header;
  739. u8 id; /* I/O APIC ID */
  740. u8 reserved; /* reserved - must be zero */
  741. u32 address; /* APIC physical address */
  742. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  743. };
  744. /* 2: Interrupt Override */
  745. struct acpi_madt_interrupt_override {
  746. struct acpi_subtable_header header;
  747. u8 bus; /* 0 - ISA */
  748. u8 source_irq; /* Interrupt source (IRQ) */
  749. u32 global_irq; /* Global system interrupt */
  750. u16 inti_flags;
  751. };
  752. /* 3: NMI Source */
  753. struct acpi_madt_nmi_source {
  754. struct acpi_subtable_header header;
  755. u16 inti_flags;
  756. u32 global_irq; /* Global system interrupt */
  757. };
  758. /* 4: Local APIC NMI */
  759. struct acpi_madt_local_apic_nmi {
  760. struct acpi_subtable_header header;
  761. u8 processor_id; /* ACPI processor id */
  762. u16 inti_flags;
  763. u8 lint; /* LINTn to which NMI is connected */
  764. };
  765. /* 5: Address Override */
  766. struct acpi_madt_local_apic_override {
  767. struct acpi_subtable_header header;
  768. u16 reserved; /* Reserved, must be zero */
  769. u64 address; /* APIC physical address */
  770. };
  771. /* 6: I/O Sapic */
  772. struct acpi_madt_io_sapic {
  773. struct acpi_subtable_header header;
  774. u8 id; /* I/O SAPIC ID */
  775. u8 reserved; /* Reserved, must be zero */
  776. u32 global_irq_base; /* Global interrupt for SAPIC start */
  777. u64 address; /* SAPIC physical address */
  778. };
  779. /* 7: Local Sapic */
  780. struct acpi_madt_local_sapic {
  781. struct acpi_subtable_header header;
  782. u8 processor_id; /* ACPI processor id */
  783. u8 id; /* SAPIC ID */
  784. u8 eid; /* SAPIC EID */
  785. u8 reserved[3]; /* Reserved, must be zero */
  786. u32 lapic_flags;
  787. u32 uid; /* Numeric UID - ACPI 3.0 */
  788. char uid_string[1]; /* String UID - ACPI 3.0 */
  789. };
  790. /* 8: Platform Interrupt Source */
  791. struct acpi_madt_interrupt_source {
  792. struct acpi_subtable_header header;
  793. u16 inti_flags;
  794. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  795. u8 id; /* Processor ID */
  796. u8 eid; /* Processor EID */
  797. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  798. u32 global_irq; /* Global system interrupt */
  799. u32 flags; /* Interrupt Source Flags */
  800. };
  801. /* Masks for Flags field above */
  802. #define ACPI_MADT_CPEI_OVERRIDE (1)
  803. /* 9: Processor Local X2APIC (ACPI 4.0) */
  804. struct acpi_madt_local_x2apic {
  805. struct acpi_subtable_header header;
  806. u16 reserved; /* reserved - must be zero */
  807. u32 local_apic_id; /* Processor x2APIC ID */
  808. u32 lapic_flags;
  809. u32 uid; /* ACPI processor UID */
  810. };
  811. /* 10: Local X2APIC NMI (ACPI 4.0) */
  812. struct acpi_madt_local_x2apic_nmi {
  813. struct acpi_subtable_header header;
  814. u16 inti_flags;
  815. u32 uid; /* ACPI processor UID */
  816. u8 lint; /* LINTn to which NMI is connected */
  817. u8 reserved[3]; /* reserved - must be zero */
  818. };
  819. /* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
  820. struct acpi_madt_generic_interrupt {
  821. struct acpi_subtable_header header;
  822. u16 reserved; /* reserved - must be zero */
  823. u32 cpu_interface_number;
  824. u32 uid;
  825. u32 flags;
  826. u32 parking_version;
  827. u32 performance_interrupt;
  828. u64 parked_address;
  829. u64 base_address;
  830. u64 gicv_base_address;
  831. u64 gich_base_address;
  832. u32 vgic_interrupt;
  833. u64 gicr_base_address;
  834. u64 arm_mpidr;
  835. u8 efficiency_class;
  836. u8 reserved2[3];
  837. };
  838. /* Masks for Flags field above */
  839. /* ACPI_MADT_ENABLED (1) Processor is usable if set */
  840. #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
  841. #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
  842. /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
  843. struct acpi_madt_generic_distributor {
  844. struct acpi_subtable_header header;
  845. u16 reserved; /* reserved - must be zero */
  846. u32 gic_id;
  847. u64 base_address;
  848. u32 global_irq_base;
  849. u8 version;
  850. u8 reserved2[3]; /* reserved - must be zero */
  851. };
  852. /* Values for Version field above */
  853. enum acpi_madt_gic_version {
  854. ACPI_MADT_GIC_VERSION_NONE = 0,
  855. ACPI_MADT_GIC_VERSION_V1 = 1,
  856. ACPI_MADT_GIC_VERSION_V2 = 2,
  857. ACPI_MADT_GIC_VERSION_V3 = 3,
  858. ACPI_MADT_GIC_VERSION_V4 = 4,
  859. ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
  860. };
  861. /* 13: Generic MSI Frame (ACPI 5.1) */
  862. struct acpi_madt_generic_msi_frame {
  863. struct acpi_subtable_header header;
  864. u16 reserved; /* reserved - must be zero */
  865. u32 msi_frame_id;
  866. u64 base_address;
  867. u32 flags;
  868. u16 spi_count;
  869. u16 spi_base;
  870. };
  871. /* Masks for Flags field above */
  872. #define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
  873. /* 14: Generic Redistributor (ACPI 5.1) */
  874. struct acpi_madt_generic_redistributor {
  875. struct acpi_subtable_header header;
  876. u16 reserved; /* reserved - must be zero */
  877. u64 base_address;
  878. u32 length;
  879. };
  880. /* 15: Generic Translator (ACPI 6.0) */
  881. struct acpi_madt_generic_translator {
  882. struct acpi_subtable_header header;
  883. u16 reserved; /* reserved - must be zero */
  884. u32 translation_id;
  885. u64 base_address;
  886. u32 reserved2;
  887. };
  888. /*
  889. * Common flags fields for MADT subtables
  890. */
  891. /* MADT Local APIC flags */
  892. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  893. /* MADT MPS INTI flags (inti_flags) */
  894. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  895. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  896. /* Values for MPS INTI flags */
  897. #define ACPI_MADT_POLARITY_CONFORMS 0
  898. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  899. #define ACPI_MADT_POLARITY_RESERVED 2
  900. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  901. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  902. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  903. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  904. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  905. /*******************************************************************************
  906. *
  907. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  908. * Version 1
  909. *
  910. ******************************************************************************/
  911. struct acpi_table_msct {
  912. struct acpi_table_header header; /* Common ACPI table header */
  913. u32 proximity_offset; /* Location of proximity info struct(s) */
  914. u32 max_proximity_domains; /* Max number of proximity domains */
  915. u32 max_clock_domains; /* Max number of clock domains */
  916. u64 max_address; /* Max physical address in system */
  917. };
  918. /* subtable - Maximum Proximity Domain Information. Version 1 */
  919. struct acpi_msct_proximity {
  920. u8 revision;
  921. u8 length;
  922. u32 range_start; /* Start of domain range */
  923. u32 range_end; /* End of domain range */
  924. u32 processor_capacity;
  925. u64 memory_capacity; /* In bytes */
  926. };
  927. /*******************************************************************************
  928. *
  929. * NFIT - NVDIMM Interface Table (ACPI 6.0+)
  930. * Version 1
  931. *
  932. ******************************************************************************/
  933. struct acpi_table_nfit {
  934. struct acpi_table_header header; /* Common ACPI table header */
  935. u32 reserved; /* Reserved, must be zero */
  936. };
  937. /* Subtable header for NFIT */
  938. struct acpi_nfit_header {
  939. u16 type;
  940. u16 length;
  941. };
  942. /* Values for subtable type in struct acpi_nfit_header */
  943. enum acpi_nfit_type {
  944. ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
  945. ACPI_NFIT_TYPE_MEMORY_MAP = 1,
  946. ACPI_NFIT_TYPE_INTERLEAVE = 2,
  947. ACPI_NFIT_TYPE_SMBIOS = 3,
  948. ACPI_NFIT_TYPE_CONTROL_REGION = 4,
  949. ACPI_NFIT_TYPE_DATA_REGION = 5,
  950. ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
  951. ACPI_NFIT_TYPE_CAPABILITIES = 7,
  952. ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */
  953. };
  954. /*
  955. * NFIT Subtables
  956. */
  957. /* 0: System Physical Address Range Structure */
  958. struct acpi_nfit_system_address {
  959. struct acpi_nfit_header header;
  960. u16 range_index;
  961. u16 flags;
  962. u32 reserved; /* Reserved, must be zero */
  963. u32 proximity_domain;
  964. u8 range_guid[16];
  965. u64 address;
  966. u64 length;
  967. u64 memory_mapping;
  968. };
  969. /* Flags */
  970. #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
  971. #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
  972. /* Range Type GUIDs appear in the include/acuuid.h file */
  973. /* 1: Memory Device to System Address Range Map Structure */
  974. struct acpi_nfit_memory_map {
  975. struct acpi_nfit_header header;
  976. u32 device_handle;
  977. u16 physical_id;
  978. u16 region_id;
  979. u16 range_index;
  980. u16 region_index;
  981. u64 region_size;
  982. u64 region_offset;
  983. u64 address;
  984. u16 interleave_index;
  985. u16 interleave_ways;
  986. u16 flags;
  987. u16 reserved; /* Reserved, must be zero */
  988. };
  989. /* Flags */
  990. #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
  991. #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
  992. #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
  993. #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
  994. #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
  995. #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
  996. #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
  997. /* 2: Interleave Structure */
  998. struct acpi_nfit_interleave {
  999. struct acpi_nfit_header header;
  1000. u16 interleave_index;
  1001. u16 reserved; /* Reserved, must be zero */
  1002. u32 line_count;
  1003. u32 line_size;
  1004. u32 line_offset[1]; /* Variable length */
  1005. };
  1006. /* 3: SMBIOS Management Information Structure */
  1007. struct acpi_nfit_smbios {
  1008. struct acpi_nfit_header header;
  1009. u32 reserved; /* Reserved, must be zero */
  1010. u8 data[1]; /* Variable length */
  1011. };
  1012. /* 4: NVDIMM Control Region Structure */
  1013. struct acpi_nfit_control_region {
  1014. struct acpi_nfit_header header;
  1015. u16 region_index;
  1016. u16 vendor_id;
  1017. u16 device_id;
  1018. u16 revision_id;
  1019. u16 subsystem_vendor_id;
  1020. u16 subsystem_device_id;
  1021. u16 subsystem_revision_id;
  1022. u8 valid_fields;
  1023. u8 manufacturing_location;
  1024. u16 manufacturing_date;
  1025. u8 reserved[2]; /* Reserved, must be zero */
  1026. u32 serial_number;
  1027. u16 code;
  1028. u16 windows;
  1029. u64 window_size;
  1030. u64 command_offset;
  1031. u64 command_size;
  1032. u64 status_offset;
  1033. u64 status_size;
  1034. u16 flags;
  1035. u8 reserved1[6]; /* Reserved, must be zero */
  1036. };
  1037. /* Flags */
  1038. #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
  1039. /* valid_fields bits */
  1040. #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
  1041. /* 5: NVDIMM Block Data Window Region Structure */
  1042. struct acpi_nfit_data_region {
  1043. struct acpi_nfit_header header;
  1044. u16 region_index;
  1045. u16 windows;
  1046. u64 offset;
  1047. u64 size;
  1048. u64 capacity;
  1049. u64 start_address;
  1050. };
  1051. /* 6: Flush Hint Address Structure */
  1052. struct acpi_nfit_flush_address {
  1053. struct acpi_nfit_header header;
  1054. u32 device_handle;
  1055. u16 hint_count;
  1056. u8 reserved[6]; /* Reserved, must be zero */
  1057. u64 hint_address[1]; /* Variable length */
  1058. };
  1059. /* 7: Platform Capabilities Structure */
  1060. struct acpi_nfit_capabilities {
  1061. struct acpi_nfit_header header;
  1062. u8 highest_capability;
  1063. u8 reserved[3]; /* Reserved, must be zero */
  1064. u32 capabilities;
  1065. u32 reserved2;
  1066. };
  1067. /* Capabilities Flags */
  1068. #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */
  1069. #define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */
  1070. #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */
  1071. /*
  1072. * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
  1073. */
  1074. struct nfit_device_handle {
  1075. u32 handle;
  1076. };
  1077. /* Device handle construction and extraction macros */
  1078. #define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F
  1079. #define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0
  1080. #define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00
  1081. #define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000
  1082. #define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000
  1083. #define ACPI_NFIT_DIMM_NUMBER_OFFSET 0
  1084. #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4
  1085. #define ACPI_NFIT_MEMORY_ID_OFFSET 8
  1086. #define ACPI_NFIT_SOCKET_ID_OFFSET 12
  1087. #define ACPI_NFIT_NODE_ID_OFFSET 16
  1088. /* Macro to construct a NFIT/NVDIMM device handle */
  1089. #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
  1090. ((dimm) | \
  1091. ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \
  1092. ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \
  1093. ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \
  1094. ((node) << ACPI_NFIT_NODE_ID_OFFSET))
  1095. /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
  1096. #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
  1097. ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
  1098. #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
  1099. (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
  1100. #define ACPI_NFIT_GET_MEMORY_ID(handle) \
  1101. (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET)
  1102. #define ACPI_NFIT_GET_SOCKET_ID(handle) \
  1103. (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET)
  1104. #define ACPI_NFIT_GET_NODE_ID(handle) \
  1105. (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET)
  1106. /*******************************************************************************
  1107. *
  1108. * PDTT - Platform Debug Trigger Table (ACPI 6.2)
  1109. * Version 0
  1110. *
  1111. ******************************************************************************/
  1112. struct acpi_table_pdtt {
  1113. struct acpi_table_header header; /* Common ACPI table header */
  1114. u8 trigger_count;
  1115. u8 reserved[3];
  1116. u32 array_offset;
  1117. };
  1118. /*
  1119. * PDTT Communication Channel Identifier Structure.
  1120. * The number of these structures is defined by trigger_count above,
  1121. * starting at array_offset.
  1122. */
  1123. struct acpi_pdtt_channel {
  1124. u8 subchannel_id;
  1125. u8 flags;
  1126. };
  1127. /* Flags for above */
  1128. #define ACPI_PDTT_RUNTIME_TRIGGER (1)
  1129. #define ACPI_PDTT_WAIT_COMPLETION (1<<1)
  1130. /*******************************************************************************
  1131. *
  1132. * PPTT - Processor Properties Topology Table (ACPI 6.2)
  1133. * Version 1
  1134. *
  1135. ******************************************************************************/
  1136. struct acpi_table_pptt {
  1137. struct acpi_table_header header; /* Common ACPI table header */
  1138. };
  1139. /* Values for Type field above */
  1140. enum acpi_pptt_type {
  1141. ACPI_PPTT_TYPE_PROCESSOR = 0,
  1142. ACPI_PPTT_TYPE_CACHE = 1,
  1143. ACPI_PPTT_TYPE_ID = 2,
  1144. ACPI_PPTT_TYPE_RESERVED = 3
  1145. };
  1146. /* 0: Processor Hierarchy Node Structure */
  1147. struct acpi_pptt_processor {
  1148. struct acpi_subtable_header header;
  1149. u16 reserved;
  1150. u32 flags;
  1151. u32 parent;
  1152. u32 acpi_processor_id;
  1153. u32 number_of_priv_resources;
  1154. };
  1155. /* Flags */
  1156. #define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
  1157. #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
  1158. /* 1: Cache Type Structure */
  1159. struct acpi_pptt_cache {
  1160. struct acpi_subtable_header header;
  1161. u16 reserved;
  1162. u32 flags;
  1163. u32 next_level_of_cache;
  1164. u32 size;
  1165. u32 number_of_sets;
  1166. u8 associativity;
  1167. u8 attributes;
  1168. u16 line_size;
  1169. };
  1170. /* Flags */
  1171. #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
  1172. #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
  1173. #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
  1174. #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
  1175. #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
  1176. #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
  1177. #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
  1178. /* Masks for Attributes */
  1179. #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
  1180. #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
  1181. #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
  1182. /* Attributes describing cache */
  1183. #define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */
  1184. #define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */
  1185. #define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */
  1186. #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */
  1187. #define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */
  1188. #define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */
  1189. #define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */
  1190. #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */
  1191. #define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */
  1192. #define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */
  1193. /* 2: ID Structure */
  1194. struct acpi_pptt_id {
  1195. struct acpi_subtable_header header;
  1196. u16 reserved;
  1197. u32 vendor_id;
  1198. u64 level1_id;
  1199. u64 level2_id;
  1200. u16 major_rev;
  1201. u16 minor_rev;
  1202. u16 spin_rev;
  1203. };
  1204. /*******************************************************************************
  1205. *
  1206. * SBST - Smart Battery Specification Table
  1207. * Version 1
  1208. *
  1209. ******************************************************************************/
  1210. struct acpi_table_sbst {
  1211. struct acpi_table_header header; /* Common ACPI table header */
  1212. u32 warning_level;
  1213. u32 low_level;
  1214. u32 critical_level;
  1215. };
  1216. /*******************************************************************************
  1217. *
  1218. * SDEV - Secure Devices Table (ACPI 6.2)
  1219. * Version 1
  1220. *
  1221. ******************************************************************************/
  1222. struct acpi_table_sdev {
  1223. struct acpi_table_header header; /* Common ACPI table header */
  1224. };
  1225. struct acpi_sdev_header {
  1226. u8 type;
  1227. u8 flags;
  1228. u16 length;
  1229. };
  1230. /* Values for subtable type above */
  1231. enum acpi_sdev_type {
  1232. ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
  1233. ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
  1234. ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  1235. };
  1236. /* Values for flags above */
  1237. #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1)
  1238. /*
  1239. * SDEV subtables
  1240. */
  1241. /* 0: Namespace Device Based Secure Device Structure */
  1242. struct acpi_sdev_namespace {
  1243. struct acpi_sdev_header header;
  1244. u16 device_id_offset;
  1245. u16 device_id_length;
  1246. u16 vendor_data_offset;
  1247. u16 vendor_data_length;
  1248. };
  1249. /* 1: PCIe Endpoint Device Based Device Structure */
  1250. struct acpi_sdev_pcie {
  1251. struct acpi_sdev_header header;
  1252. u16 segment;
  1253. u16 start_bus;
  1254. u16 path_offset;
  1255. u16 path_length;
  1256. u16 vendor_data_offset;
  1257. u16 vendor_data_length;
  1258. };
  1259. /* 1a: PCIe Endpoint path entry */
  1260. struct acpi_sdev_pcie_path {
  1261. u8 device;
  1262. u8 function;
  1263. };
  1264. /*******************************************************************************
  1265. *
  1266. * SLIT - System Locality Distance Information Table
  1267. * Version 1
  1268. *
  1269. ******************************************************************************/
  1270. struct acpi_table_slit {
  1271. struct acpi_table_header header; /* Common ACPI table header */
  1272. u64 locality_count;
  1273. u8 entry[1]; /* Real size = localities^2 */
  1274. };
  1275. /*******************************************************************************
  1276. *
  1277. * SRAT - System Resource Affinity Table
  1278. * Version 3
  1279. *
  1280. ******************************************************************************/
  1281. struct acpi_table_srat {
  1282. struct acpi_table_header header; /* Common ACPI table header */
  1283. u32 table_revision; /* Must be value '1' */
  1284. u64 reserved; /* Reserved, must be zero */
  1285. };
  1286. /* Values for subtable type in struct acpi_subtable_header */
  1287. enum acpi_srat_type {
  1288. ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  1289. ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  1290. ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
  1291. ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
  1292. ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
  1293. ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
  1294. };
  1295. /*
  1296. * SRAT Subtables, correspond to Type in struct acpi_subtable_header
  1297. */
  1298. /* 0: Processor Local APIC/SAPIC Affinity */
  1299. struct acpi_srat_cpu_affinity {
  1300. struct acpi_subtable_header header;
  1301. u8 proximity_domain_lo;
  1302. u8 apic_id;
  1303. u32 flags;
  1304. u8 local_sapic_eid;
  1305. u8 proximity_domain_hi[3];
  1306. u32 clock_domain;
  1307. };
  1308. /* Flags */
  1309. #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
  1310. /* 1: Memory Affinity */
  1311. struct acpi_srat_mem_affinity {
  1312. struct acpi_subtable_header header;
  1313. u32 proximity_domain;
  1314. u16 reserved; /* Reserved, must be zero */
  1315. u64 base_address;
  1316. u64 length;
  1317. u32 reserved1;
  1318. u32 flags;
  1319. u64 reserved2; /* Reserved, must be zero */
  1320. };
  1321. /* Flags */
  1322. #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
  1323. #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
  1324. #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
  1325. /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
  1326. struct acpi_srat_x2apic_cpu_affinity {
  1327. struct acpi_subtable_header header;
  1328. u16 reserved; /* Reserved, must be zero */
  1329. u32 proximity_domain;
  1330. u32 apic_id;
  1331. u32 flags;
  1332. u32 clock_domain;
  1333. u32 reserved2;
  1334. };
  1335. /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
  1336. #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
  1337. /* 3: GICC Affinity (ACPI 5.1) */
  1338. struct acpi_srat_gicc_affinity {
  1339. struct acpi_subtable_header header;
  1340. u32 proximity_domain;
  1341. u32 acpi_processor_uid;
  1342. u32 flags;
  1343. u32 clock_domain;
  1344. };
  1345. /* Flags for struct acpi_srat_gicc_affinity */
  1346. #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
  1347. /* 4: GCC ITS Affinity (ACPI 6.2) */
  1348. struct acpi_srat_gic_its_affinity {
  1349. struct acpi_subtable_header header;
  1350. u32 proximity_domain;
  1351. u16 reserved;
  1352. u32 its_id;
  1353. };
  1354. /* Reset to default packing */
  1355. #pragma pack()
  1356. #endif /* __ACTBL1_H__ */