actbl1.h 41 KB

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