actbl2.h 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615
  1. /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
  2. /******************************************************************************
  3. *
  4. * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
  5. *
  6. * Copyright (C) 2000 - 2022, Intel Corp.
  7. *
  8. *****************************************************************************/
  9. #ifndef __ACTBL2_H__
  10. #define __ACTBL2_H__
  11. /*******************************************************************************
  12. *
  13. * Additional ACPI Tables (2)
  14. *
  15. * These tables are not consumed directly by the ACPICA subsystem, but are
  16. * included here to support device drivers and the AML disassembler.
  17. *
  18. ******************************************************************************/
  19. /*
  20. * Values for description table header signatures for tables defined in this
  21. * file. Useful because they make it more difficult to inadvertently type in
  22. * the wrong signature.
  23. */
  24. #define ACPI_SIG_AGDI "AGDI" /* Arm Generic Diagnostic Dump and Reset Device Interface */
  25. #define ACPI_SIG_APMT "APMT" /* Arm Performance Monitoring Unit table */
  26. #define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */
  27. #define ACPI_SIG_IORT "IORT" /* IO Remapping Table */
  28. #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
  29. #define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
  30. #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
  31. #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
  32. #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
  33. #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
  34. #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
  35. #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
  36. #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
  37. #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */
  38. #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
  39. #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
  40. #define ACPI_SIG_PHAT "PHAT" /* Platform Health Assessment Table */
  41. #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
  42. #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
  43. #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */
  44. #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
  45. #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */
  46. #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
  47. #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
  48. #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
  49. #define ACPI_SIG_SVKL "SVKL" /* Storage Volume Key Location Table */
  50. #define ACPI_SIG_TDEL "TDEL" /* TD Event Log Table */
  51. /*
  52. * All tables must be byte-packed to match the ACPI specification, since
  53. * the tables are provided by the system BIOS.
  54. */
  55. #pragma pack(1)
  56. /*
  57. * Note: C bitfields are not used for this reason:
  58. *
  59. * "Bitfields are great and easy to read, but unfortunately the C language
  60. * does not specify the layout of bitfields in memory, which means they are
  61. * essentially useless for dealing with packed data in on-disk formats or
  62. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  63. * this decision was a design error in C. Ritchie could have picked an order
  64. * and stuck with it." Norman Ramsey.
  65. * See http://stackoverflow.com/a/1053662/41661
  66. */
  67. /*******************************************************************************
  68. *
  69. * AEST - Arm Error Source Table
  70. *
  71. * Conforms to: ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document
  72. * September 2020.
  73. *
  74. ******************************************************************************/
  75. struct acpi_table_aest {
  76. struct acpi_table_header header;
  77. void *node_array[];
  78. };
  79. /* Common Subtable header - one per Node Structure (Subtable) */
  80. struct acpi_aest_hdr {
  81. u8 type;
  82. u16 length;
  83. u8 reserved;
  84. u32 node_specific_offset;
  85. u32 node_interface_offset;
  86. u32 node_interrupt_offset;
  87. u32 node_interrupt_count;
  88. u64 timestamp_rate;
  89. u64 reserved1;
  90. u64 error_injection_rate;
  91. };
  92. /* Values for Type above */
  93. #define ACPI_AEST_PROCESSOR_ERROR_NODE 0
  94. #define ACPI_AEST_MEMORY_ERROR_NODE 1
  95. #define ACPI_AEST_SMMU_ERROR_NODE 2
  96. #define ACPI_AEST_VENDOR_ERROR_NODE 3
  97. #define ACPI_AEST_GIC_ERROR_NODE 4
  98. #define ACPI_AEST_NODE_TYPE_RESERVED 5 /* 5 and above are reserved */
  99. /*
  100. * AEST subtables (Error nodes)
  101. */
  102. /* 0: Processor Error */
  103. typedef struct acpi_aest_processor {
  104. u32 processor_id;
  105. u8 resource_type;
  106. u8 reserved;
  107. u8 flags;
  108. u8 revision;
  109. u64 processor_affinity;
  110. } acpi_aest_processor;
  111. /* Values for resource_type above, related structs below */
  112. #define ACPI_AEST_CACHE_RESOURCE 0
  113. #define ACPI_AEST_TLB_RESOURCE 1
  114. #define ACPI_AEST_GENERIC_RESOURCE 2
  115. #define ACPI_AEST_RESOURCE_RESERVED 3 /* 3 and above are reserved */
  116. /* 0R: Processor Cache Resource Substructure */
  117. typedef struct acpi_aest_processor_cache {
  118. u32 cache_reference;
  119. u32 reserved;
  120. } acpi_aest_processor_cache;
  121. /* Values for cache_type above */
  122. #define ACPI_AEST_CACHE_DATA 0
  123. #define ACPI_AEST_CACHE_INSTRUCTION 1
  124. #define ACPI_AEST_CACHE_UNIFIED 2
  125. #define ACPI_AEST_CACHE_RESERVED 3 /* 3 and above are reserved */
  126. /* 1R: Processor TLB Resource Substructure */
  127. typedef struct acpi_aest_processor_tlb {
  128. u32 tlb_level;
  129. u32 reserved;
  130. } acpi_aest_processor_tlb;
  131. /* 2R: Processor Generic Resource Substructure */
  132. typedef struct acpi_aest_processor_generic {
  133. u32 resource;
  134. } acpi_aest_processor_generic;
  135. /* 1: Memory Error */
  136. typedef struct acpi_aest_memory {
  137. u32 srat_proximity_domain;
  138. } acpi_aest_memory;
  139. /* 2: Smmu Error */
  140. typedef struct acpi_aest_smmu {
  141. u32 iort_node_reference;
  142. u32 subcomponent_reference;
  143. } acpi_aest_smmu;
  144. /* 3: Vendor Defined */
  145. typedef struct acpi_aest_vendor {
  146. u32 acpi_hid;
  147. u32 acpi_uid;
  148. u8 vendor_specific_data[16];
  149. } acpi_aest_vendor;
  150. /* 4: Gic Error */
  151. typedef struct acpi_aest_gic {
  152. u32 interface_type;
  153. u32 instance_id;
  154. } acpi_aest_gic;
  155. /* Values for interface_type above */
  156. #define ACPI_AEST_GIC_CPU 0
  157. #define ACPI_AEST_GIC_DISTRIBUTOR 1
  158. #define ACPI_AEST_GIC_REDISTRIBUTOR 2
  159. #define ACPI_AEST_GIC_ITS 3
  160. #define ACPI_AEST_GIC_RESERVED 4 /* 4 and above are reserved */
  161. /* Node Interface Structure */
  162. typedef struct acpi_aest_node_interface {
  163. u8 type;
  164. u8 reserved[3];
  165. u32 flags;
  166. u64 address;
  167. u32 error_record_index;
  168. u32 error_record_count;
  169. u64 error_record_implemented;
  170. u64 error_status_reporting;
  171. u64 addressing_mode;
  172. } acpi_aest_node_interface;
  173. /* Values for Type field above */
  174. #define ACPI_AEST_NODE_SYSTEM_REGISTER 0
  175. #define ACPI_AEST_NODE_MEMORY_MAPPED 1
  176. #define ACPI_AEST_XFACE_RESERVED 2 /* 2 and above are reserved */
  177. /* Node Interrupt Structure */
  178. typedef struct acpi_aest_node_interrupt {
  179. u8 type;
  180. u8 reserved[2];
  181. u8 flags;
  182. u32 gsiv;
  183. u8 iort_id;
  184. u8 reserved1[3];
  185. } acpi_aest_node_interrupt;
  186. /* Values for Type field above */
  187. #define ACPI_AEST_NODE_FAULT_HANDLING 0
  188. #define ACPI_AEST_NODE_ERROR_RECOVERY 1
  189. #define ACPI_AEST_XRUPT_RESERVED 2 /* 2 and above are reserved */
  190. /*******************************************************************************
  191. * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface
  192. *
  193. * Conforms to "ACPI for Arm Components 1.1, Platform Design Document"
  194. * ARM DEN0093 v1.1
  195. *
  196. ******************************************************************************/
  197. struct acpi_table_agdi {
  198. struct acpi_table_header header; /* Common ACPI table header */
  199. u8 flags;
  200. u8 reserved[3];
  201. u32 sdei_event;
  202. u32 gsiv;
  203. };
  204. /* Mask for Flags field above */
  205. #define ACPI_AGDI_SIGNALING_MODE (1)
  206. /*******************************************************************************
  207. *
  208. * APMT - ARM Performance Monitoring Unit Table
  209. *
  210. * Conforms to:
  211. * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
  212. * ARM DEN0117 v1.0 November 25, 2021
  213. *
  214. ******************************************************************************/
  215. struct acpi_table_apmt {
  216. struct acpi_table_header header; /* Common ACPI table header */
  217. };
  218. #define ACPI_APMT_NODE_ID_LENGTH 4
  219. /*
  220. * APMT subtables
  221. */
  222. struct acpi_apmt_node {
  223. u16 length;
  224. u8 flags;
  225. u8 type;
  226. u32 id;
  227. u64 inst_primary;
  228. u32 inst_secondary;
  229. u64 base_address0;
  230. u64 base_address1;
  231. u32 ovflw_irq;
  232. u32 reserved;
  233. u32 ovflw_irq_flags;
  234. u32 proc_affinity;
  235. u32 impl_id;
  236. };
  237. /* Masks for Flags field above */
  238. #define ACPI_APMT_FLAGS_DUAL_PAGE (1<<0)
  239. #define ACPI_APMT_FLAGS_AFFINITY (1<<1)
  240. #define ACPI_APMT_FLAGS_ATOMIC (1<<2)
  241. /* Values for Flags dual page field above */
  242. #define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP (0<<0)
  243. #define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP (1<<0)
  244. /* Values for Flags processor affinity field above */
  245. #define ACPI_APMT_FLAGS_AFFINITY_PROC (0<<1)
  246. #define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1)
  247. /* Values for Flags 64-bit atomic field above */
  248. #define ACPI_APMT_FLAGS_ATOMIC_NSUPP (0<<2)
  249. #define ACPI_APMT_FLAGS_ATOMIC_SUPP (1<<2)
  250. /* Values for Type field above */
  251. enum acpi_apmt_node_type {
  252. ACPI_APMT_NODE_TYPE_MC = 0x00,
  253. ACPI_APMT_NODE_TYPE_SMMU = 0x01,
  254. ACPI_APMT_NODE_TYPE_PCIE_ROOT = 0x02,
  255. ACPI_APMT_NODE_TYPE_ACPI = 0x03,
  256. ACPI_APMT_NODE_TYPE_CACHE = 0x04,
  257. ACPI_APMT_NODE_TYPE_COUNT
  258. };
  259. /* Masks for ovflw_irq_flags field above */
  260. #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE (1<<0)
  261. #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE (1<<1)
  262. /* Values for ovflw_irq_flags mode field above */
  263. #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL (0<<0)
  264. #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE (1<<0)
  265. /* Values for ovflw_irq_flags type field above */
  266. #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED (0<<1)
  267. /*******************************************************************************
  268. *
  269. * BDAT - BIOS Data ACPI Table
  270. *
  271. * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5
  272. * Nov 2020
  273. *
  274. ******************************************************************************/
  275. struct acpi_table_bdat {
  276. struct acpi_table_header header;
  277. struct acpi_generic_address gas;
  278. };
  279. /*******************************************************************************
  280. *
  281. * IORT - IO Remapping Table
  282. *
  283. * Conforms to "IO Remapping Table System Software on ARM Platforms",
  284. * Document number: ARM DEN 0049E.d, Feb 2022
  285. *
  286. ******************************************************************************/
  287. struct acpi_table_iort {
  288. struct acpi_table_header header;
  289. u32 node_count;
  290. u32 node_offset;
  291. u32 reserved;
  292. };
  293. /*
  294. * IORT subtables
  295. */
  296. struct acpi_iort_node {
  297. u8 type;
  298. u16 length;
  299. u8 revision;
  300. u32 identifier;
  301. u32 mapping_count;
  302. u32 mapping_offset;
  303. char node_data[1];
  304. };
  305. /* Values for subtable Type above */
  306. enum acpi_iort_node_type {
  307. ACPI_IORT_NODE_ITS_GROUP = 0x00,
  308. ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
  309. ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
  310. ACPI_IORT_NODE_SMMU = 0x03,
  311. ACPI_IORT_NODE_SMMU_V3 = 0x04,
  312. ACPI_IORT_NODE_PMCG = 0x05,
  313. ACPI_IORT_NODE_RMR = 0x06,
  314. };
  315. struct acpi_iort_id_mapping {
  316. u32 input_base; /* Lowest value in input range */
  317. u32 id_count; /* Number of IDs */
  318. u32 output_base; /* Lowest value in output range */
  319. u32 output_reference; /* A reference to the output node */
  320. u32 flags;
  321. };
  322. /* Masks for Flags field above for IORT subtable */
  323. #define ACPI_IORT_ID_SINGLE_MAPPING (1)
  324. struct acpi_iort_memory_access {
  325. u32 cache_coherency;
  326. u8 hints;
  327. u16 reserved;
  328. u8 memory_flags;
  329. };
  330. /* Values for cache_coherency field above */
  331. #define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent */
  332. #define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent */
  333. /* Masks for Hints field above */
  334. #define ACPI_IORT_HT_TRANSIENT (1)
  335. #define ACPI_IORT_HT_WRITE (1<<1)
  336. #define ACPI_IORT_HT_READ (1<<2)
  337. #define ACPI_IORT_HT_OVERRIDE (1<<3)
  338. /* Masks for memory_flags field above */
  339. #define ACPI_IORT_MF_COHERENCY (1)
  340. #define ACPI_IORT_MF_ATTRIBUTES (1<<1)
  341. /*
  342. * IORT node specific subtables
  343. */
  344. struct acpi_iort_its_group {
  345. u32 its_count;
  346. u32 identifiers[1]; /* GIC ITS identifier array */
  347. };
  348. struct acpi_iort_named_component {
  349. u32 node_flags;
  350. u64 memory_properties; /* Memory access properties */
  351. u8 memory_address_limit; /* Memory address size limit */
  352. char device_name[1]; /* Path of namespace object */
  353. };
  354. /* Masks for Flags field above */
  355. #define ACPI_IORT_NC_STALL_SUPPORTED (1)
  356. #define ACPI_IORT_NC_PASID_BITS (31<<1)
  357. struct acpi_iort_root_complex {
  358. u64 memory_properties; /* Memory access properties */
  359. u32 ats_attribute;
  360. u32 pci_segment_number;
  361. u8 memory_address_limit; /* Memory address size limit */
  362. u16 pasid_capabilities; /* PASID Capabilities */
  363. u8 reserved[1]; /* Reserved, must be zero */
  364. };
  365. /* Masks for ats_attribute field above */
  366. #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */
  367. #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */
  368. #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */
  369. /* Masks for pasid_capabilities field above */
  370. #define ACPI_IORT_PASID_MAX_WIDTH (0x1F) /* Bits 0-4 */
  371. struct acpi_iort_smmu {
  372. u64 base_address; /* SMMU base address */
  373. u64 span; /* Length of memory range */
  374. u32 model;
  375. u32 flags;
  376. u32 global_interrupt_offset;
  377. u32 context_interrupt_count;
  378. u32 context_interrupt_offset;
  379. u32 pmu_interrupt_count;
  380. u32 pmu_interrupt_offset;
  381. u64 interrupts[1]; /* Interrupt array */
  382. };
  383. /* Values for Model field above */
  384. #define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */
  385. #define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */
  386. #define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */
  387. #define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */
  388. #define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */
  389. #define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium thunder_x SMMUv2 */
  390. /* Masks for Flags field above */
  391. #define ACPI_IORT_SMMU_DVM_SUPPORTED (1)
  392. #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1)
  393. /* Global interrupt format */
  394. struct acpi_iort_smmu_gsi {
  395. u32 nsg_irpt;
  396. u32 nsg_irpt_flags;
  397. u32 nsg_cfg_irpt;
  398. u32 nsg_cfg_irpt_flags;
  399. };
  400. struct acpi_iort_smmu_v3 {
  401. u64 base_address; /* SMMUv3 base address */
  402. u32 flags;
  403. u32 reserved;
  404. u64 vatos_address;
  405. u32 model;
  406. u32 event_gsiv;
  407. u32 pri_gsiv;
  408. u32 gerr_gsiv;
  409. u32 sync_gsiv;
  410. u32 pxm;
  411. u32 id_mapping_index;
  412. };
  413. /* Values for Model field above */
  414. #define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */
  415. #define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* hi_silicon Hi161x SMMUv3 */
  416. #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */
  417. /* Masks for Flags field above */
  418. #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
  419. #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1)
  420. #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3)
  421. struct acpi_iort_pmcg {
  422. u64 page0_base_address;
  423. u32 overflow_gsiv;
  424. u32 node_reference;
  425. u64 page1_base_address;
  426. };
  427. struct acpi_iort_rmr {
  428. u32 flags;
  429. u32 rmr_count;
  430. u32 rmr_offset;
  431. };
  432. /* Masks for Flags field above */
  433. #define ACPI_IORT_RMR_REMAP_PERMITTED (1)
  434. #define ACPI_IORT_RMR_ACCESS_PRIVILEGE (1<<1)
  435. /*
  436. * Macro to access the Access Attributes in flags field above:
  437. * Access Attributes is encoded in bits 9:2
  438. */
  439. #define ACPI_IORT_RMR_ACCESS_ATTRIBUTES(flags) (((flags) >> 2) & 0xFF)
  440. /* Values for above Access Attributes */
  441. #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRNE 0x00
  442. #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRE 0x01
  443. #define ACPI_IORT_RMR_ATTR_DEVICE_NGRE 0x02
  444. #define ACPI_IORT_RMR_ATTR_DEVICE_GRE 0x03
  445. #define ACPI_IORT_RMR_ATTR_NORMAL_NC 0x04
  446. #define ACPI_IORT_RMR_ATTR_NORMAL_IWB_OWB 0x05
  447. struct acpi_iort_rmr_desc {
  448. u64 base_address;
  449. u64 length;
  450. u32 reserved;
  451. };
  452. /*******************************************************************************
  453. *
  454. * IVRS - I/O Virtualization Reporting Structure
  455. * Version 1
  456. *
  457. * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
  458. * Revision 1.26, February 2009.
  459. *
  460. ******************************************************************************/
  461. struct acpi_table_ivrs {
  462. struct acpi_table_header header; /* Common ACPI table header */
  463. u32 info; /* Common virtualization info */
  464. u64 reserved;
  465. };
  466. /* Values for Info field above */
  467. #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
  468. #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
  469. #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */
  470. /* IVRS subtable header */
  471. struct acpi_ivrs_header {
  472. u8 type; /* Subtable type */
  473. u8 flags;
  474. u16 length; /* Subtable length */
  475. u16 device_id; /* ID of IOMMU */
  476. };
  477. /* Values for subtable Type above */
  478. enum acpi_ivrs_type {
  479. ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
  480. ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
  481. ACPI_IVRS_TYPE_HARDWARE3 = 0x40,
  482. ACPI_IVRS_TYPE_MEMORY1 = 0x20,
  483. ACPI_IVRS_TYPE_MEMORY2 = 0x21,
  484. ACPI_IVRS_TYPE_MEMORY3 = 0x22
  485. };
  486. /* Masks for Flags field above for IVHD subtable */
  487. #define ACPI_IVHD_TT_ENABLE (1)
  488. #define ACPI_IVHD_PASS_PW (1<<1)
  489. #define ACPI_IVHD_RES_PASS_PW (1<<2)
  490. #define ACPI_IVHD_ISOC (1<<3)
  491. #define ACPI_IVHD_IOTLB (1<<4)
  492. /* Masks for Flags field above for IVMD subtable */
  493. #define ACPI_IVMD_UNITY (1)
  494. #define ACPI_IVMD_READ (1<<1)
  495. #define ACPI_IVMD_WRITE (1<<2)
  496. #define ACPI_IVMD_EXCLUSION_RANGE (1<<3)
  497. /*
  498. * IVRS subtables, correspond to Type in struct acpi_ivrs_header
  499. */
  500. /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
  501. struct acpi_ivrs_hardware_10 {
  502. struct acpi_ivrs_header header;
  503. u16 capability_offset; /* Offset for IOMMU control fields */
  504. u64 base_address; /* IOMMU control registers */
  505. u16 pci_segment_group;
  506. u16 info; /* MSI number and unit ID */
  507. u32 feature_reporting;
  508. };
  509. /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
  510. struct acpi_ivrs_hardware_11 {
  511. struct acpi_ivrs_header header;
  512. u16 capability_offset; /* Offset for IOMMU control fields */
  513. u64 base_address; /* IOMMU control registers */
  514. u16 pci_segment_group;
  515. u16 info; /* MSI number and unit ID */
  516. u32 attributes;
  517. u64 efr_register_image;
  518. u64 reserved;
  519. };
  520. /* Masks for Info field above */
  521. #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */
  522. #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_ID */
  523. /*
  524. * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
  525. * Upper two bits of the Type field are the (encoded) length of the structure.
  526. * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
  527. * are reserved for future use but not defined.
  528. */
  529. struct acpi_ivrs_de_header {
  530. u8 type;
  531. u16 id;
  532. u8 data_setting;
  533. };
  534. /* Length of device entry is in the top two bits of Type field above */
  535. #define ACPI_IVHD_ENTRY_LENGTH 0xC0
  536. /* Values for device entry Type field above */
  537. enum acpi_ivrs_device_entry_type {
  538. /* 4-byte device entries, all use struct acpi_ivrs_device4 */
  539. ACPI_IVRS_TYPE_PAD4 = 0,
  540. ACPI_IVRS_TYPE_ALL = 1,
  541. ACPI_IVRS_TYPE_SELECT = 2,
  542. ACPI_IVRS_TYPE_START = 3,
  543. ACPI_IVRS_TYPE_END = 4,
  544. /* 8-byte device entries */
  545. ACPI_IVRS_TYPE_PAD8 = 64,
  546. ACPI_IVRS_TYPE_NOT_USED = 65,
  547. ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */
  548. ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */
  549. ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */
  550. ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */
  551. ACPI_IVRS_TYPE_SPECIAL = 72, /* Uses struct acpi_ivrs_device8c */
  552. /* Variable-length device entries */
  553. ACPI_IVRS_TYPE_HID = 240 /* Uses ACPI_IVRS_DEVICE_HID */
  554. };
  555. /* Values for Data field above */
  556. #define ACPI_IVHD_INIT_PASS (1)
  557. #define ACPI_IVHD_EINT_PASS (1<<1)
  558. #define ACPI_IVHD_NMI_PASS (1<<2)
  559. #define ACPI_IVHD_SYSTEM_MGMT (3<<4)
  560. #define ACPI_IVHD_LINT0_PASS (1<<6)
  561. #define ACPI_IVHD_LINT1_PASS (1<<7)
  562. /* Types 0-4: 4-byte device entry */
  563. struct acpi_ivrs_device4 {
  564. struct acpi_ivrs_de_header header;
  565. };
  566. /* Types 66-67: 8-byte device entry */
  567. struct acpi_ivrs_device8a {
  568. struct acpi_ivrs_de_header header;
  569. u8 reserved1;
  570. u16 used_id;
  571. u8 reserved2;
  572. };
  573. /* Types 70-71: 8-byte device entry */
  574. struct acpi_ivrs_device8b {
  575. struct acpi_ivrs_de_header header;
  576. u32 extended_data;
  577. };
  578. /* Values for extended_data above */
  579. #define ACPI_IVHD_ATS_DISABLED (1<<31)
  580. /* Type 72: 8-byte device entry */
  581. struct acpi_ivrs_device8c {
  582. struct acpi_ivrs_de_header header;
  583. u8 handle;
  584. u16 used_id;
  585. u8 variety;
  586. };
  587. /* Values for Variety field above */
  588. #define ACPI_IVHD_IOAPIC 1
  589. #define ACPI_IVHD_HPET 2
  590. /* Type 240: variable-length device entry */
  591. struct acpi_ivrs_device_hid {
  592. struct acpi_ivrs_de_header header;
  593. u64 acpi_hid;
  594. u64 acpi_cid;
  595. u8 uid_type;
  596. u8 uid_length;
  597. };
  598. /* Values for uid_type above */
  599. #define ACPI_IVRS_UID_NOT_PRESENT 0
  600. #define ACPI_IVRS_UID_IS_INTEGER 1
  601. #define ACPI_IVRS_UID_IS_STRING 2
  602. /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
  603. struct acpi_ivrs_memory {
  604. struct acpi_ivrs_header header;
  605. u16 aux_data;
  606. u64 reserved;
  607. u64 start_address;
  608. u64 memory_length;
  609. };
  610. /*******************************************************************************
  611. *
  612. * LPIT - Low Power Idle Table
  613. *
  614. * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
  615. *
  616. ******************************************************************************/
  617. struct acpi_table_lpit {
  618. struct acpi_table_header header; /* Common ACPI table header */
  619. };
  620. /* LPIT subtable header */
  621. struct acpi_lpit_header {
  622. u32 type; /* Subtable type */
  623. u32 length; /* Subtable length */
  624. u16 unique_id;
  625. u16 reserved;
  626. u32 flags;
  627. };
  628. /* Values for subtable Type above */
  629. enum acpi_lpit_type {
  630. ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
  631. ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */
  632. };
  633. /* Masks for Flags field above */
  634. #define ACPI_LPIT_STATE_DISABLED (1)
  635. #define ACPI_LPIT_NO_COUNTER (1<<1)
  636. /*
  637. * LPIT subtables, correspond to Type in struct acpi_lpit_header
  638. */
  639. /* 0x00: Native C-state instruction based LPI structure */
  640. struct acpi_lpit_native {
  641. struct acpi_lpit_header header;
  642. struct acpi_generic_address entry_trigger;
  643. u32 residency;
  644. u32 latency;
  645. struct acpi_generic_address residency_counter;
  646. u64 counter_frequency;
  647. };
  648. /*******************************************************************************
  649. *
  650. * MADT - Multiple APIC Description Table
  651. * Version 3
  652. *
  653. ******************************************************************************/
  654. struct acpi_table_madt {
  655. struct acpi_table_header header; /* Common ACPI table header */
  656. u32 address; /* Physical address of local APIC */
  657. u32 flags;
  658. };
  659. /* Masks for Flags field above */
  660. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  661. /* Values for PCATCompat flag */
  662. #define ACPI_MADT_DUAL_PIC 1
  663. #define ACPI_MADT_MULTIPLE_APIC 0
  664. /* Values for MADT subtable type in struct acpi_subtable_header */
  665. enum acpi_madt_type {
  666. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  667. ACPI_MADT_TYPE_IO_APIC = 1,
  668. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  669. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  670. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  671. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  672. ACPI_MADT_TYPE_IO_SAPIC = 6,
  673. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  674. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  675. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  676. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  677. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  678. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  679. ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
  680. ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
  681. ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
  682. ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
  683. ACPI_MADT_TYPE_RESERVED = 17, /* 17 to 0x7F are reserved */
  684. ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */
  685. };
  686. /*
  687. * MADT Subtables, correspond to Type in struct acpi_subtable_header
  688. */
  689. /* 0: Processor Local APIC */
  690. struct acpi_madt_local_apic {
  691. struct acpi_subtable_header header;
  692. u8 processor_id; /* ACPI processor id */
  693. u8 id; /* Processor's local APIC id */
  694. u32 lapic_flags;
  695. };
  696. /* 1: IO APIC */
  697. struct acpi_madt_io_apic {
  698. struct acpi_subtable_header header;
  699. u8 id; /* I/O APIC ID */
  700. u8 reserved; /* reserved - must be zero */
  701. u32 address; /* APIC physical address */
  702. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  703. };
  704. /* 2: Interrupt Override */
  705. struct acpi_madt_interrupt_override {
  706. struct acpi_subtable_header header;
  707. u8 bus; /* 0 - ISA */
  708. u8 source_irq; /* Interrupt source (IRQ) */
  709. u32 global_irq; /* Global system interrupt */
  710. u16 inti_flags;
  711. };
  712. /* 3: NMI Source */
  713. struct acpi_madt_nmi_source {
  714. struct acpi_subtable_header header;
  715. u16 inti_flags;
  716. u32 global_irq; /* Global system interrupt */
  717. };
  718. /* 4: Local APIC NMI */
  719. struct acpi_madt_local_apic_nmi {
  720. struct acpi_subtable_header header;
  721. u8 processor_id; /* ACPI processor id */
  722. u16 inti_flags;
  723. u8 lint; /* LINTn to which NMI is connected */
  724. };
  725. /* 5: Address Override */
  726. struct acpi_madt_local_apic_override {
  727. struct acpi_subtable_header header;
  728. u16 reserved; /* Reserved, must be zero */
  729. u64 address; /* APIC physical address */
  730. };
  731. /* 6: I/O Sapic */
  732. struct acpi_madt_io_sapic {
  733. struct acpi_subtable_header header;
  734. u8 id; /* I/O SAPIC ID */
  735. u8 reserved; /* Reserved, must be zero */
  736. u32 global_irq_base; /* Global interrupt for SAPIC start */
  737. u64 address; /* SAPIC physical address */
  738. };
  739. /* 7: Local Sapic */
  740. struct acpi_madt_local_sapic {
  741. struct acpi_subtable_header header;
  742. u8 processor_id; /* ACPI processor id */
  743. u8 id; /* SAPIC ID */
  744. u8 eid; /* SAPIC EID */
  745. u8 reserved[3]; /* Reserved, must be zero */
  746. u32 lapic_flags;
  747. u32 uid; /* Numeric UID - ACPI 3.0 */
  748. char uid_string[1]; /* String UID - ACPI 3.0 */
  749. };
  750. /* 8: Platform Interrupt Source */
  751. struct acpi_madt_interrupt_source {
  752. struct acpi_subtable_header header;
  753. u16 inti_flags;
  754. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  755. u8 id; /* Processor ID */
  756. u8 eid; /* Processor EID */
  757. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  758. u32 global_irq; /* Global system interrupt */
  759. u32 flags; /* Interrupt Source Flags */
  760. };
  761. /* Masks for Flags field above */
  762. #define ACPI_MADT_CPEI_OVERRIDE (1)
  763. /* 9: Processor Local X2APIC (ACPI 4.0) */
  764. struct acpi_madt_local_x2apic {
  765. struct acpi_subtable_header header;
  766. u16 reserved; /* reserved - must be zero */
  767. u32 local_apic_id; /* Processor x2APIC ID */
  768. u32 lapic_flags;
  769. u32 uid; /* ACPI processor UID */
  770. };
  771. /* 10: Local X2APIC NMI (ACPI 4.0) */
  772. struct acpi_madt_local_x2apic_nmi {
  773. struct acpi_subtable_header header;
  774. u16 inti_flags;
  775. u32 uid; /* ACPI processor UID */
  776. u8 lint; /* LINTn to which NMI is connected */
  777. u8 reserved[3]; /* reserved - must be zero */
  778. };
  779. /* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */
  780. struct acpi_madt_generic_interrupt {
  781. struct acpi_subtable_header header;
  782. u16 reserved; /* reserved - must be zero */
  783. u32 cpu_interface_number;
  784. u32 uid;
  785. u32 flags;
  786. u32 parking_version;
  787. u32 performance_interrupt;
  788. u64 parked_address;
  789. u64 base_address;
  790. u64 gicv_base_address;
  791. u64 gich_base_address;
  792. u32 vgic_interrupt;
  793. u64 gicr_base_address;
  794. u64 arm_mpidr;
  795. u8 efficiency_class;
  796. u8 reserved2[1];
  797. u16 spe_interrupt; /* ACPI 6.3 */
  798. };
  799. /* Masks for Flags field above */
  800. /* ACPI_MADT_ENABLED (1) Processor is usable if set */
  801. #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
  802. #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
  803. /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
  804. struct acpi_madt_generic_distributor {
  805. struct acpi_subtable_header header;
  806. u16 reserved; /* reserved - must be zero */
  807. u32 gic_id;
  808. u64 base_address;
  809. u32 global_irq_base;
  810. u8 version;
  811. u8 reserved2[3]; /* reserved - must be zero */
  812. };
  813. /* Values for Version field above */
  814. enum acpi_madt_gic_version {
  815. ACPI_MADT_GIC_VERSION_NONE = 0,
  816. ACPI_MADT_GIC_VERSION_V1 = 1,
  817. ACPI_MADT_GIC_VERSION_V2 = 2,
  818. ACPI_MADT_GIC_VERSION_V3 = 3,
  819. ACPI_MADT_GIC_VERSION_V4 = 4,
  820. ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
  821. };
  822. /* 13: Generic MSI Frame (ACPI 5.1) */
  823. struct acpi_madt_generic_msi_frame {
  824. struct acpi_subtable_header header;
  825. u16 reserved; /* reserved - must be zero */
  826. u32 msi_frame_id;
  827. u64 base_address;
  828. u32 flags;
  829. u16 spi_count;
  830. u16 spi_base;
  831. };
  832. /* Masks for Flags field above */
  833. #define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
  834. /* 14: Generic Redistributor (ACPI 5.1) */
  835. struct acpi_madt_generic_redistributor {
  836. struct acpi_subtable_header header;
  837. u16 reserved; /* reserved - must be zero */
  838. u64 base_address;
  839. u32 length;
  840. };
  841. /* 15: Generic Translator (ACPI 6.0) */
  842. struct acpi_madt_generic_translator {
  843. struct acpi_subtable_header header;
  844. u16 reserved; /* reserved - must be zero */
  845. u32 translation_id;
  846. u64 base_address;
  847. u32 reserved2;
  848. };
  849. /* 16: Multiprocessor wakeup (ACPI 6.4) */
  850. struct acpi_madt_multiproc_wakeup {
  851. struct acpi_subtable_header header;
  852. u16 mailbox_version;
  853. u32 reserved; /* reserved - must be zero */
  854. u64 base_address;
  855. };
  856. #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE 2032
  857. #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE 2048
  858. struct acpi_madt_multiproc_wakeup_mailbox {
  859. u16 command;
  860. u16 reserved; /* reserved - must be zero */
  861. u32 apic_id;
  862. u64 wakeup_vector;
  863. u8 reserved_os[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE]; /* reserved for OS use */
  864. u8 reserved_firmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE]; /* reserved for firmware use */
  865. };
  866. #define ACPI_MP_WAKE_COMMAND_WAKEUP 1
  867. /* 17: OEM data */
  868. struct acpi_madt_oem_data {
  869. u8 oem_data[0];
  870. };
  871. /*
  872. * Common flags fields for MADT subtables
  873. */
  874. /* MADT Local APIC flags */
  875. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  876. #define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */
  877. /* MADT MPS INTI flags (inti_flags) */
  878. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  879. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  880. /* Values for MPS INTI flags */
  881. #define ACPI_MADT_POLARITY_CONFORMS 0
  882. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  883. #define ACPI_MADT_POLARITY_RESERVED 2
  884. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  885. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  886. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  887. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  888. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  889. /*******************************************************************************
  890. *
  891. * MCFG - PCI Memory Mapped Configuration table and subtable
  892. * Version 1
  893. *
  894. * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
  895. *
  896. ******************************************************************************/
  897. struct acpi_table_mcfg {
  898. struct acpi_table_header header; /* Common ACPI table header */
  899. u8 reserved[8];
  900. };
  901. /* Subtable */
  902. struct acpi_mcfg_allocation {
  903. u64 address; /* Base address, processor-relative */
  904. u16 pci_segment; /* PCI segment group number */
  905. u8 start_bus_number; /* Starting PCI Bus number */
  906. u8 end_bus_number; /* Final PCI Bus number */
  907. u32 reserved;
  908. };
  909. /*******************************************************************************
  910. *
  911. * MCHI - Management Controller Host Interface Table
  912. * Version 1
  913. *
  914. * Conforms to "Management Component Transport Protocol (MCTP) Host
  915. * Interface Specification", Revision 1.0.0a, October 13, 2009
  916. *
  917. ******************************************************************************/
  918. struct acpi_table_mchi {
  919. struct acpi_table_header header; /* Common ACPI table header */
  920. u8 interface_type;
  921. u8 protocol;
  922. u64 protocol_data;
  923. u8 interrupt_type;
  924. u8 gpe;
  925. u8 pci_device_flag;
  926. u32 global_interrupt;
  927. struct acpi_generic_address control_register;
  928. u8 pci_segment;
  929. u8 pci_bus;
  930. u8 pci_device;
  931. u8 pci_function;
  932. };
  933. /*******************************************************************************
  934. *
  935. * MPST - Memory Power State Table (ACPI 5.0)
  936. * Version 1
  937. *
  938. ******************************************************************************/
  939. #define ACPI_MPST_CHANNEL_INFO \
  940. u8 channel_id; \
  941. u8 reserved1[3]; \
  942. u16 power_node_count; \
  943. u16 reserved2;
  944. /* Main table */
  945. struct acpi_table_mpst {
  946. struct acpi_table_header header; /* Common ACPI table header */
  947. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  948. };
  949. /* Memory Platform Communication Channel Info */
  950. struct acpi_mpst_channel {
  951. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  952. };
  953. /* Memory Power Node Structure */
  954. struct acpi_mpst_power_node {
  955. u8 flags;
  956. u8 reserved1;
  957. u16 node_id;
  958. u32 length;
  959. u64 range_address;
  960. u64 range_length;
  961. u32 num_power_states;
  962. u32 num_physical_components;
  963. };
  964. /* Values for Flags field above */
  965. #define ACPI_MPST_ENABLED 1
  966. #define ACPI_MPST_POWER_MANAGED 2
  967. #define ACPI_MPST_HOT_PLUG_CAPABLE 4
  968. /* Memory Power State Structure (follows POWER_NODE above) */
  969. struct acpi_mpst_power_state {
  970. u8 power_state;
  971. u8 info_index;
  972. };
  973. /* Physical Component ID Structure (follows POWER_STATE above) */
  974. struct acpi_mpst_component {
  975. u16 component_id;
  976. };
  977. /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
  978. struct acpi_mpst_data_hdr {
  979. u16 characteristics_count;
  980. u16 reserved;
  981. };
  982. struct acpi_mpst_power_data {
  983. u8 structure_id;
  984. u8 flags;
  985. u16 reserved1;
  986. u32 average_power;
  987. u32 power_saving;
  988. u64 exit_latency;
  989. u64 reserved2;
  990. };
  991. /* Values for Flags field above */
  992. #define ACPI_MPST_PRESERVE 1
  993. #define ACPI_MPST_AUTOENTRY 2
  994. #define ACPI_MPST_AUTOEXIT 4
  995. /* Shared Memory Region (not part of an ACPI table) */
  996. struct acpi_mpst_shared {
  997. u32 signature;
  998. u16 pcc_command;
  999. u16 pcc_status;
  1000. u32 command_register;
  1001. u32 status_register;
  1002. u32 power_state_id;
  1003. u32 power_node_id;
  1004. u64 energy_consumed;
  1005. u64 average_power;
  1006. };
  1007. /*******************************************************************************
  1008. *
  1009. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  1010. * Version 1
  1011. *
  1012. ******************************************************************************/
  1013. struct acpi_table_msct {
  1014. struct acpi_table_header header; /* Common ACPI table header */
  1015. u32 proximity_offset; /* Location of proximity info struct(s) */
  1016. u32 max_proximity_domains; /* Max number of proximity domains */
  1017. u32 max_clock_domains; /* Max number of clock domains */
  1018. u64 max_address; /* Max physical address in system */
  1019. };
  1020. /* subtable - Maximum Proximity Domain Information. Version 1 */
  1021. struct acpi_msct_proximity {
  1022. u8 revision;
  1023. u8 length;
  1024. u32 range_start; /* Start of domain range */
  1025. u32 range_end; /* End of domain range */
  1026. u32 processor_capacity;
  1027. u64 memory_capacity; /* In bytes */
  1028. };
  1029. /*******************************************************************************
  1030. *
  1031. * MSDM - Microsoft Data Management table
  1032. *
  1033. * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
  1034. * November 29, 2011. Copyright 2011 Microsoft
  1035. *
  1036. ******************************************************************************/
  1037. /* Basic MSDM table is only the common ACPI header */
  1038. struct acpi_table_msdm {
  1039. struct acpi_table_header header; /* Common ACPI table header */
  1040. };
  1041. /*******************************************************************************
  1042. *
  1043. * NFIT - NVDIMM Interface Table (ACPI 6.0+)
  1044. * Version 1
  1045. *
  1046. ******************************************************************************/
  1047. struct acpi_table_nfit {
  1048. struct acpi_table_header header; /* Common ACPI table header */
  1049. u32 reserved; /* Reserved, must be zero */
  1050. };
  1051. /* Subtable header for NFIT */
  1052. struct acpi_nfit_header {
  1053. u16 type;
  1054. u16 length;
  1055. };
  1056. /* Values for subtable type in struct acpi_nfit_header */
  1057. enum acpi_nfit_type {
  1058. ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
  1059. ACPI_NFIT_TYPE_MEMORY_MAP = 1,
  1060. ACPI_NFIT_TYPE_INTERLEAVE = 2,
  1061. ACPI_NFIT_TYPE_SMBIOS = 3,
  1062. ACPI_NFIT_TYPE_CONTROL_REGION = 4,
  1063. ACPI_NFIT_TYPE_DATA_REGION = 5,
  1064. ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
  1065. ACPI_NFIT_TYPE_CAPABILITIES = 7,
  1066. ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */
  1067. };
  1068. /*
  1069. * NFIT Subtables
  1070. */
  1071. /* 0: System Physical Address Range Structure */
  1072. struct acpi_nfit_system_address {
  1073. struct acpi_nfit_header header;
  1074. u16 range_index;
  1075. u16 flags;
  1076. u32 reserved; /* Reserved, must be zero */
  1077. u32 proximity_domain;
  1078. u8 range_guid[16];
  1079. u64 address;
  1080. u64 length;
  1081. u64 memory_mapping;
  1082. u64 location_cookie; /* ACPI 6.4 */
  1083. };
  1084. /* Flags */
  1085. #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
  1086. #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
  1087. #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2) /* 02: SPA location cookie valid (ACPI 6.4) */
  1088. /* Range Type GUIDs appear in the include/acuuid.h file */
  1089. /* 1: Memory Device to System Address Range Map Structure */
  1090. struct acpi_nfit_memory_map {
  1091. struct acpi_nfit_header header;
  1092. u32 device_handle;
  1093. u16 physical_id;
  1094. u16 region_id;
  1095. u16 range_index;
  1096. u16 region_index;
  1097. u64 region_size;
  1098. u64 region_offset;
  1099. u64 address;
  1100. u16 interleave_index;
  1101. u16 interleave_ways;
  1102. u16 flags;
  1103. u16 reserved; /* Reserved, must be zero */
  1104. };
  1105. /* Flags */
  1106. #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
  1107. #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
  1108. #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
  1109. #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
  1110. #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
  1111. #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
  1112. #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
  1113. /* 2: Interleave Structure */
  1114. struct acpi_nfit_interleave {
  1115. struct acpi_nfit_header header;
  1116. u16 interleave_index;
  1117. u16 reserved; /* Reserved, must be zero */
  1118. u32 line_count;
  1119. u32 line_size;
  1120. u32 line_offset[1]; /* Variable length */
  1121. };
  1122. /* 3: SMBIOS Management Information Structure */
  1123. struct acpi_nfit_smbios {
  1124. struct acpi_nfit_header header;
  1125. u32 reserved; /* Reserved, must be zero */
  1126. u8 data[1]; /* Variable length */
  1127. };
  1128. /* 4: NVDIMM Control Region Structure */
  1129. struct acpi_nfit_control_region {
  1130. struct acpi_nfit_header header;
  1131. u16 region_index;
  1132. u16 vendor_id;
  1133. u16 device_id;
  1134. u16 revision_id;
  1135. u16 subsystem_vendor_id;
  1136. u16 subsystem_device_id;
  1137. u16 subsystem_revision_id;
  1138. u8 valid_fields;
  1139. u8 manufacturing_location;
  1140. u16 manufacturing_date;
  1141. u8 reserved[2]; /* Reserved, must be zero */
  1142. u32 serial_number;
  1143. u16 code;
  1144. u16 windows;
  1145. u64 window_size;
  1146. u64 command_offset;
  1147. u64 command_size;
  1148. u64 status_offset;
  1149. u64 status_size;
  1150. u16 flags;
  1151. u8 reserved1[6]; /* Reserved, must be zero */
  1152. };
  1153. /* Flags */
  1154. #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
  1155. /* valid_fields bits */
  1156. #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
  1157. /* 5: NVDIMM Block Data Window Region Structure */
  1158. struct acpi_nfit_data_region {
  1159. struct acpi_nfit_header header;
  1160. u16 region_index;
  1161. u16 windows;
  1162. u64 offset;
  1163. u64 size;
  1164. u64 capacity;
  1165. u64 start_address;
  1166. };
  1167. /* 6: Flush Hint Address Structure */
  1168. struct acpi_nfit_flush_address {
  1169. struct acpi_nfit_header header;
  1170. u32 device_handle;
  1171. u16 hint_count;
  1172. u8 reserved[6]; /* Reserved, must be zero */
  1173. u64 hint_address[1]; /* Variable length */
  1174. };
  1175. /* 7: Platform Capabilities Structure */
  1176. struct acpi_nfit_capabilities {
  1177. struct acpi_nfit_header header;
  1178. u8 highest_capability;
  1179. u8 reserved[3]; /* Reserved, must be zero */
  1180. u32 capabilities;
  1181. u32 reserved2;
  1182. };
  1183. /* Capabilities Flags */
  1184. #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */
  1185. #define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */
  1186. #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */
  1187. /*
  1188. * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
  1189. */
  1190. struct nfit_device_handle {
  1191. u32 handle;
  1192. };
  1193. /* Device handle construction and extraction macros */
  1194. #define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F
  1195. #define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0
  1196. #define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00
  1197. #define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000
  1198. #define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000
  1199. #define ACPI_NFIT_DIMM_NUMBER_OFFSET 0
  1200. #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4
  1201. #define ACPI_NFIT_MEMORY_ID_OFFSET 8
  1202. #define ACPI_NFIT_SOCKET_ID_OFFSET 12
  1203. #define ACPI_NFIT_NODE_ID_OFFSET 16
  1204. /* Macro to construct a NFIT/NVDIMM device handle */
  1205. #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
  1206. ((dimm) | \
  1207. ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \
  1208. ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \
  1209. ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \
  1210. ((node) << ACPI_NFIT_NODE_ID_OFFSET))
  1211. /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
  1212. #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
  1213. ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
  1214. #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
  1215. (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
  1216. #define ACPI_NFIT_GET_MEMORY_ID(handle) \
  1217. (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET)
  1218. #define ACPI_NFIT_GET_SOCKET_ID(handle) \
  1219. (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET)
  1220. #define ACPI_NFIT_GET_NODE_ID(handle) \
  1221. (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET)
  1222. /*******************************************************************************
  1223. *
  1224. * NHLT - Non HD Audio Link Table
  1225. *
  1226. * Conforms to: Intel Smart Sound Technology NHLT Specification
  1227. * Version 0.8.1, January 2020.
  1228. *
  1229. ******************************************************************************/
  1230. /* Main table */
  1231. struct acpi_table_nhlt {
  1232. struct acpi_table_header header; /* Common ACPI table header */
  1233. u8 endpoint_count;
  1234. };
  1235. struct acpi_nhlt_endpoint {
  1236. u32 descriptor_length;
  1237. u8 link_type;
  1238. u8 instance_id;
  1239. u16 vendor_id;
  1240. u16 device_id;
  1241. u16 revision_id;
  1242. u32 subsystem_id;
  1243. u8 device_type;
  1244. u8 direction;
  1245. u8 virtual_bus_id;
  1246. };
  1247. /* Types for link_type field above */
  1248. #define ACPI_NHLT_RESERVED_HD_AUDIO 0
  1249. #define ACPI_NHLT_RESERVED_DSP 1
  1250. #define ACPI_NHLT_PDM 2
  1251. #define ACPI_NHLT_SSP 3
  1252. #define ACPI_NHLT_RESERVED_SLIMBUS 4
  1253. #define ACPI_NHLT_RESERVED_SOUNDWIRE 5
  1254. #define ACPI_NHLT_TYPE_RESERVED 6 /* 6 and above are reserved */
  1255. /* All other values above are reserved */
  1256. /* Values for device_id field above */
  1257. #define ACPI_NHLT_PDM_DMIC 0xAE20
  1258. #define ACPI_NHLT_BT_SIDEBAND 0xAE30
  1259. #define ACPI_NHLT_I2S_TDM_CODECS 0xAE23
  1260. /* Values for device_type field above */
  1261. /* SSP Link */
  1262. #define ACPI_NHLT_LINK_BT_SIDEBAND 0
  1263. #define ACPI_NHLT_LINK_FM 1
  1264. #define ACPI_NHLT_LINK_MODEM 2
  1265. /* 3 is reserved */
  1266. #define ACPI_NHLT_LINK_SSP_ANALOG_CODEC 4
  1267. /* PDM Link */
  1268. #define ACPI_NHLT_PDM_ON_CAVS_1P8 0
  1269. #define ACPI_NHLT_PDM_ON_CAVS_1P5 1
  1270. /* Values for Direction field above */
  1271. #define ACPI_NHLT_DIR_RENDER 0
  1272. #define ACPI_NHLT_DIR_CAPTURE 1
  1273. #define ACPI_NHLT_DIR_RENDER_LOOPBACK 2
  1274. #define ACPI_NHLT_DIR_RENDER_FEEDBACK 3
  1275. #define ACPI_NHLT_DIR_RESERVED 4 /* 4 and above are reserved */
  1276. struct acpi_nhlt_device_specific_config {
  1277. u32 capabilities_size;
  1278. u8 virtual_slot;
  1279. u8 config_type;
  1280. };
  1281. struct acpi_nhlt_device_specific_config_a {
  1282. u32 capabilities_size;
  1283. u8 virtual_slot;
  1284. u8 config_type;
  1285. u8 array_type;
  1286. };
  1287. /* Values for Config Type above */
  1288. #define ACPI_NHLT_CONFIG_TYPE_GENERIC 0x00
  1289. #define ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY 0x01
  1290. #define ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK 0x03
  1291. #define ACPI_NHLT_CONFIG_TYPE_RESERVED 0x04 /* 4 and above are reserved */
  1292. struct acpi_nhlt_device_specific_config_b {
  1293. u32 capabilities_size;
  1294. };
  1295. struct acpi_nhlt_device_specific_config_c {
  1296. u32 capabilities_size;
  1297. u8 virtual_slot;
  1298. };
  1299. struct acpi_nhlt_render_device_specific_config {
  1300. u32 capabilities_size;
  1301. u8 virtual_slot;
  1302. };
  1303. struct acpi_nhlt_wave_extensible {
  1304. u16 format_tag;
  1305. u16 channel_count;
  1306. u32 samples_per_sec;
  1307. u32 avg_bytes_per_sec;
  1308. u16 block_align;
  1309. u16 bits_per_sample;
  1310. u16 extra_format_size;
  1311. u16 valid_bits_per_sample;
  1312. u32 channel_mask;
  1313. u8 sub_format_guid[16];
  1314. };
  1315. /* Values for channel_mask above */
  1316. #define ACPI_NHLT_SPKR_FRONT_LEFT 0x1
  1317. #define ACPI_NHLT_SPKR_FRONT_RIGHT 0x2
  1318. #define ACPI_NHLT_SPKR_FRONT_CENTER 0x4
  1319. #define ACPI_NHLT_SPKR_LOW_FREQ 0x8
  1320. #define ACPI_NHLT_SPKR_BACK_LEFT 0x10
  1321. #define ACPI_NHLT_SPKR_BACK_RIGHT 0x20
  1322. #define ACPI_NHLT_SPKR_FRONT_LEFT_OF_CENTER 0x40
  1323. #define ACPI_NHLT_SPKR_FRONT_RIGHT_OF_CENTER 0x80
  1324. #define ACPI_NHLT_SPKR_BACK_CENTER 0x100
  1325. #define ACPI_NHLT_SPKR_SIDE_LEFT 0x200
  1326. #define ACPI_NHLT_SPKR_SIDE_RIGHT 0x400
  1327. #define ACPI_NHLT_SPKR_TOP_CENTER 0x800
  1328. #define ACPI_NHLT_SPKR_TOP_FRONT_LEFT 0x1000
  1329. #define ACPI_NHLT_SPKR_TOP_FRONT_CENTER 0x2000
  1330. #define ACPI_NHLT_SPKR_TOP_FRONT_RIGHT 0x4000
  1331. #define ACPI_NHLT_SPKR_TOP_BACK_LEFT 0x8000
  1332. #define ACPI_NHLT_SPKR_TOP_BACK_CENTER 0x10000
  1333. #define ACPI_NHLT_SPKR_TOP_BACK_RIGHT 0x20000
  1334. struct acpi_nhlt_format_config {
  1335. struct acpi_nhlt_wave_extensible format;
  1336. u32 capability_size;
  1337. u8 capabilities[];
  1338. };
  1339. struct acpi_nhlt_formats_config {
  1340. u8 formats_count;
  1341. };
  1342. struct acpi_nhlt_device_specific_hdr {
  1343. u8 virtual_slot;
  1344. u8 config_type;
  1345. };
  1346. /* Types for config_type above */
  1347. #define ACPI_NHLT_GENERIC 0
  1348. #define ACPI_NHLT_MIC 1
  1349. #define ACPI_NHLT_RENDER 3
  1350. struct acpi_nhlt_mic_device_specific_config {
  1351. struct acpi_nhlt_device_specific_hdr device_config;
  1352. u8 array_type_ext;
  1353. };
  1354. /* Values for array_type_ext above */
  1355. #define ACPI_NHLT_ARRAY_TYPE_RESERVED 0x09 /* 9 and below are reserved */
  1356. #define ACPI_NHLT_SMALL_LINEAR_2ELEMENT 0x0A
  1357. #define ACPI_NHLT_BIG_LINEAR_2ELEMENT 0x0B
  1358. #define ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT 0x0C
  1359. #define ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT 0x0D
  1360. #define ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT 0x0E
  1361. #define ACPI_NHLT_VENDOR_DEFINED 0x0F
  1362. #define ACPI_NHLT_ARRAY_TYPE_MASK 0x0F
  1363. #define ACPI_NHLT_ARRAY_TYPE_EXT_MASK 0x10
  1364. #define ACPI_NHLT_NO_EXTENSION 0x0
  1365. #define ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT (1<<4)
  1366. struct acpi_nhlt_vendor_mic_count {
  1367. u8 microphone_count;
  1368. };
  1369. struct acpi_nhlt_vendor_mic_config {
  1370. u8 type;
  1371. u8 panel;
  1372. u16 speaker_position_distance; /* mm */
  1373. u16 horizontal_offset; /* mm */
  1374. u16 vertical_offset; /* mm */
  1375. u8 frequency_low_band; /* 5*Hz */
  1376. u8 frequency_high_band; /* 500*Hz */
  1377. u16 direction_angle; /* -180 - + 180 */
  1378. u16 elevation_angle; /* -180 - + 180 */
  1379. u16 work_vertical_angle_begin; /* -180 - + 180 with 2 deg step */
  1380. u16 work_vertical_angle_end; /* -180 - + 180 with 2 deg step */
  1381. u16 work_horizontal_angle_begin; /* -180 - + 180 with 2 deg step */
  1382. u16 work_horizontal_angle_end; /* -180 - + 180 with 2 deg step */
  1383. };
  1384. /* Values for Type field above */
  1385. #define ACPI_NHLT_MIC_OMNIDIRECTIONAL 0
  1386. #define ACPI_NHLT_MIC_SUBCARDIOID 1
  1387. #define ACPI_NHLT_MIC_CARDIOID 2
  1388. #define ACPI_NHLT_MIC_SUPER_CARDIOID 3
  1389. #define ACPI_NHLT_MIC_HYPER_CARDIOID 4
  1390. #define ACPI_NHLT_MIC_8_SHAPED 5
  1391. #define ACPI_NHLT_MIC_RESERVED6 6 /* 6 is reserved */
  1392. #define ACPI_NHLT_MIC_VENDOR_DEFINED 7
  1393. #define ACPI_NHLT_MIC_RESERVED 8 /* 8 and above are reserved */
  1394. /* Values for Panel field above */
  1395. #define ACPI_NHLT_MIC_POSITION_TOP 0
  1396. #define ACPI_NHLT_MIC_POSITION_BOTTOM 1
  1397. #define ACPI_NHLT_MIC_POSITION_LEFT 2
  1398. #define ACPI_NHLT_MIC_POSITION_RIGHT 3
  1399. #define ACPI_NHLT_MIC_POSITION_FRONT 4
  1400. #define ACPI_NHLT_MIC_POSITION_BACK 5
  1401. #define ACPI_NHLT_MIC_POSITION_RESERVED 6 /* 6 and above are reserved */
  1402. struct acpi_nhlt_vendor_mic_device_specific_config {
  1403. struct acpi_nhlt_mic_device_specific_config mic_array_device_config;
  1404. u8 number_of_microphones;
  1405. struct acpi_nhlt_vendor_mic_config mic_config[]; /* Indexed by number_of_microphones */
  1406. };
  1407. /* Microphone SNR and Sensitivity extension */
  1408. struct acpi_nhlt_mic_snr_sensitivity_extension {
  1409. u32 SNR;
  1410. u32 sensitivity;
  1411. };
  1412. /* Render device with feedback */
  1413. struct acpi_nhlt_render_feedback_device_specific_config {
  1414. u8 feedback_virtual_slot; /* Render slot in case of capture */
  1415. u16 feedback_channels; /* Informative only */
  1416. u16 feedback_valid_bits_per_sample;
  1417. };
  1418. /* Non documented structures */
  1419. struct acpi_nhlt_device_info_count {
  1420. u8 structure_count;
  1421. };
  1422. struct acpi_nhlt_device_info {
  1423. u8 device_id[16];
  1424. u8 device_instance_id;
  1425. u8 device_port_id;
  1426. };
  1427. /*******************************************************************************
  1428. *
  1429. * PCCT - Platform Communications Channel Table (ACPI 5.0)
  1430. * Version 2 (ACPI 6.2)
  1431. *
  1432. ******************************************************************************/
  1433. struct acpi_table_pcct {
  1434. struct acpi_table_header header; /* Common ACPI table header */
  1435. u32 flags;
  1436. u64 reserved;
  1437. };
  1438. /* Values for Flags field above */
  1439. #define ACPI_PCCT_DOORBELL 1
  1440. /* Values for subtable type in struct acpi_subtable_header */
  1441. enum acpi_pcct_type {
  1442. ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
  1443. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
  1444. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
  1445. ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
  1446. ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
  1447. ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5, /* ACPI 6.4 */
  1448. ACPI_PCCT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
  1449. };
  1450. /*
  1451. * PCCT Subtables, correspond to Type in struct acpi_subtable_header
  1452. */
  1453. /* 0: Generic Communications Subspace */
  1454. struct acpi_pcct_subspace {
  1455. struct acpi_subtable_header header;
  1456. u8 reserved[6];
  1457. u64 base_address;
  1458. u64 length;
  1459. struct acpi_generic_address doorbell_register;
  1460. u64 preserve_mask;
  1461. u64 write_mask;
  1462. u32 latency;
  1463. u32 max_access_rate;
  1464. u16 min_turnaround_time;
  1465. };
  1466. /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
  1467. struct acpi_pcct_hw_reduced {
  1468. struct acpi_subtable_header header;
  1469. u32 platform_interrupt;
  1470. u8 flags;
  1471. u8 reserved;
  1472. u64 base_address;
  1473. u64 length;
  1474. struct acpi_generic_address doorbell_register;
  1475. u64 preserve_mask;
  1476. u64 write_mask;
  1477. u32 latency;
  1478. u32 max_access_rate;
  1479. u16 min_turnaround_time;
  1480. };
  1481. /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
  1482. struct acpi_pcct_hw_reduced_type2 {
  1483. struct acpi_subtable_header header;
  1484. u32 platform_interrupt;
  1485. u8 flags;
  1486. u8 reserved;
  1487. u64 base_address;
  1488. u64 length;
  1489. struct acpi_generic_address doorbell_register;
  1490. u64 preserve_mask;
  1491. u64 write_mask;
  1492. u32 latency;
  1493. u32 max_access_rate;
  1494. u16 min_turnaround_time;
  1495. struct acpi_generic_address platform_ack_register;
  1496. u64 ack_preserve_mask;
  1497. u64 ack_write_mask;
  1498. };
  1499. /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
  1500. struct acpi_pcct_ext_pcc_master {
  1501. struct acpi_subtable_header header;
  1502. u32 platform_interrupt;
  1503. u8 flags;
  1504. u8 reserved1;
  1505. u64 base_address;
  1506. u32 length;
  1507. struct acpi_generic_address doorbell_register;
  1508. u64 preserve_mask;
  1509. u64 write_mask;
  1510. u32 latency;
  1511. u32 max_access_rate;
  1512. u32 min_turnaround_time;
  1513. struct acpi_generic_address platform_ack_register;
  1514. u64 ack_preserve_mask;
  1515. u64 ack_set_mask;
  1516. u64 reserved2;
  1517. struct acpi_generic_address cmd_complete_register;
  1518. u64 cmd_complete_mask;
  1519. struct acpi_generic_address cmd_update_register;
  1520. u64 cmd_update_preserve_mask;
  1521. u64 cmd_update_set_mask;
  1522. struct acpi_generic_address error_status_register;
  1523. u64 error_status_mask;
  1524. };
  1525. /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
  1526. struct acpi_pcct_ext_pcc_slave {
  1527. struct acpi_subtable_header header;
  1528. u32 platform_interrupt;
  1529. u8 flags;
  1530. u8 reserved1;
  1531. u64 base_address;
  1532. u32 length;
  1533. struct acpi_generic_address doorbell_register;
  1534. u64 preserve_mask;
  1535. u64 write_mask;
  1536. u32 latency;
  1537. u32 max_access_rate;
  1538. u32 min_turnaround_time;
  1539. struct acpi_generic_address platform_ack_register;
  1540. u64 ack_preserve_mask;
  1541. u64 ack_set_mask;
  1542. u64 reserved2;
  1543. struct acpi_generic_address cmd_complete_register;
  1544. u64 cmd_complete_mask;
  1545. struct acpi_generic_address cmd_update_register;
  1546. u64 cmd_update_preserve_mask;
  1547. u64 cmd_update_set_mask;
  1548. struct acpi_generic_address error_status_register;
  1549. u64 error_status_mask;
  1550. };
  1551. /* 5: HW Registers based Communications Subspace */
  1552. struct acpi_pcct_hw_reg {
  1553. struct acpi_subtable_header header;
  1554. u16 version;
  1555. u64 base_address;
  1556. u64 length;
  1557. struct acpi_generic_address doorbell_register;
  1558. u64 doorbell_preserve;
  1559. u64 doorbell_write;
  1560. struct acpi_generic_address cmd_complete_register;
  1561. u64 cmd_complete_mask;
  1562. struct acpi_generic_address error_status_register;
  1563. u64 error_status_mask;
  1564. u32 nominal_latency;
  1565. u32 min_turnaround_time;
  1566. };
  1567. /* Values for doorbell flags above */
  1568. #define ACPI_PCCT_INTERRUPT_POLARITY (1)
  1569. #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
  1570. /*
  1571. * PCC memory structures (not part of the ACPI table)
  1572. */
  1573. /* Shared Memory Region */
  1574. struct acpi_pcct_shared_memory {
  1575. u32 signature;
  1576. u16 command;
  1577. u16 status;
  1578. };
  1579. /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
  1580. struct acpi_pcct_ext_pcc_shared_memory {
  1581. u32 signature;
  1582. u32 flags;
  1583. u32 length;
  1584. u32 command;
  1585. };
  1586. /*******************************************************************************
  1587. *
  1588. * PDTT - Platform Debug Trigger Table (ACPI 6.2)
  1589. * Version 0
  1590. *
  1591. ******************************************************************************/
  1592. struct acpi_table_pdtt {
  1593. struct acpi_table_header header; /* Common ACPI table header */
  1594. u8 trigger_count;
  1595. u8 reserved[3];
  1596. u32 array_offset;
  1597. };
  1598. /*
  1599. * PDTT Communication Channel Identifier Structure.
  1600. * The number of these structures is defined by trigger_count above,
  1601. * starting at array_offset.
  1602. */
  1603. struct acpi_pdtt_channel {
  1604. u8 subchannel_id;
  1605. u8 flags;
  1606. };
  1607. /* Flags for above */
  1608. #define ACPI_PDTT_RUNTIME_TRIGGER (1)
  1609. #define ACPI_PDTT_WAIT_COMPLETION (1<<1)
  1610. #define ACPI_PDTT_TRIGGER_ORDER (1<<2)
  1611. /*******************************************************************************
  1612. *
  1613. * PHAT - Platform Health Assessment Table (ACPI 6.4)
  1614. * Version 1
  1615. *
  1616. ******************************************************************************/
  1617. struct acpi_table_phat {
  1618. struct acpi_table_header header; /* Common ACPI table header */
  1619. };
  1620. /* Common header for PHAT subtables that follow main table */
  1621. struct acpi_phat_header {
  1622. u16 type;
  1623. u16 length;
  1624. u8 revision;
  1625. };
  1626. /* Values for Type field above */
  1627. #define ACPI_PHAT_TYPE_FW_VERSION_DATA 0
  1628. #define ACPI_PHAT_TYPE_FW_HEALTH_DATA 1
  1629. #define ACPI_PHAT_TYPE_RESERVED 2 /* 0x02-0xFFFF are reserved */
  1630. /*
  1631. * PHAT subtables, correspond to Type in struct acpi_phat_header
  1632. */
  1633. /* 0: Firmware Version Data Record */
  1634. struct acpi_phat_version_data {
  1635. struct acpi_phat_header header;
  1636. u8 reserved[3];
  1637. u32 element_count;
  1638. };
  1639. struct acpi_phat_version_element {
  1640. u8 guid[16];
  1641. u64 version_value;
  1642. u32 producer_id;
  1643. };
  1644. /* 1: Firmware Health Data Record */
  1645. struct acpi_phat_health_data {
  1646. struct acpi_phat_header header;
  1647. u8 reserved[2];
  1648. u8 health;
  1649. u8 device_guid[16];
  1650. u32 device_specific_offset; /* Zero if no Device-specific data */
  1651. };
  1652. /* Values for Health field above */
  1653. #define ACPI_PHAT_ERRORS_FOUND 0
  1654. #define ACPI_PHAT_NO_ERRORS 1
  1655. #define ACPI_PHAT_UNKNOWN_ERRORS 2
  1656. #define ACPI_PHAT_ADVISORY 3
  1657. /*******************************************************************************
  1658. *
  1659. * PMTT - Platform Memory Topology Table (ACPI 5.0)
  1660. * Version 1
  1661. *
  1662. ******************************************************************************/
  1663. struct acpi_table_pmtt {
  1664. struct acpi_table_header header; /* Common ACPI table header */
  1665. u32 memory_device_count;
  1666. /*
  1667. * Immediately followed by:
  1668. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  1669. */
  1670. };
  1671. /* Common header for PMTT subtables that follow main table */
  1672. struct acpi_pmtt_header {
  1673. u8 type;
  1674. u8 reserved1;
  1675. u16 length;
  1676. u16 flags;
  1677. u16 reserved2;
  1678. u32 memory_device_count; /* Zero means no memory device structs follow */
  1679. /*
  1680. * Immediately followed by:
  1681. * u8 type_specific_data[]
  1682. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  1683. */
  1684. };
  1685. /* Values for Type field above */
  1686. #define ACPI_PMTT_TYPE_SOCKET 0
  1687. #define ACPI_PMTT_TYPE_CONTROLLER 1
  1688. #define ACPI_PMTT_TYPE_DIMM 2
  1689. #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFE are reserved */
  1690. #define ACPI_PMTT_TYPE_VENDOR 0xFF
  1691. /* Values for Flags field above */
  1692. #define ACPI_PMTT_TOP_LEVEL 0x0001
  1693. #define ACPI_PMTT_PHYSICAL 0x0002
  1694. #define ACPI_PMTT_MEMORY_TYPE 0x000C
  1695. /*
  1696. * PMTT subtables, correspond to Type in struct acpi_pmtt_header
  1697. */
  1698. /* 0: Socket Structure */
  1699. struct acpi_pmtt_socket {
  1700. struct acpi_pmtt_header header;
  1701. u16 socket_id;
  1702. u16 reserved;
  1703. };
  1704. /*
  1705. * Immediately followed by:
  1706. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  1707. */
  1708. /* 1: Memory Controller subtable */
  1709. struct acpi_pmtt_controller {
  1710. struct acpi_pmtt_header header;
  1711. u16 controller_id;
  1712. u16 reserved;
  1713. };
  1714. /*
  1715. * Immediately followed by:
  1716. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  1717. */
  1718. /* 2: Physical Component Identifier (DIMM) */
  1719. struct acpi_pmtt_physical_component {
  1720. struct acpi_pmtt_header header;
  1721. u32 bios_handle;
  1722. };
  1723. /* 0xFF: Vendor Specific Data */
  1724. struct acpi_pmtt_vendor_specific {
  1725. struct acpi_pmtt_header header;
  1726. u8 type_uuid[16];
  1727. u8 specific[];
  1728. /*
  1729. * Immediately followed by:
  1730. * u8 vendor_specific_data[];
  1731. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  1732. */
  1733. };
  1734. /*******************************************************************************
  1735. *
  1736. * PPTT - Processor Properties Topology Table (ACPI 6.2)
  1737. * Version 1
  1738. *
  1739. ******************************************************************************/
  1740. struct acpi_table_pptt {
  1741. struct acpi_table_header header; /* Common ACPI table header */
  1742. };
  1743. /* Values for Type field above */
  1744. enum acpi_pptt_type {
  1745. ACPI_PPTT_TYPE_PROCESSOR = 0,
  1746. ACPI_PPTT_TYPE_CACHE = 1,
  1747. ACPI_PPTT_TYPE_ID = 2,
  1748. ACPI_PPTT_TYPE_RESERVED = 3
  1749. };
  1750. /* 0: Processor Hierarchy Node Structure */
  1751. struct acpi_pptt_processor {
  1752. struct acpi_subtable_header header;
  1753. u16 reserved;
  1754. u32 flags;
  1755. u32 parent;
  1756. u32 acpi_processor_id;
  1757. u32 number_of_priv_resources;
  1758. };
  1759. /* Flags */
  1760. #define ACPI_PPTT_PHYSICAL_PACKAGE (1)
  1761. #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (1<<1)
  1762. #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD (1<<2) /* ACPI 6.3 */
  1763. #define ACPI_PPTT_ACPI_LEAF_NODE (1<<3) /* ACPI 6.3 */
  1764. #define ACPI_PPTT_ACPI_IDENTICAL (1<<4) /* ACPI 6.3 */
  1765. /* 1: Cache Type Structure */
  1766. struct acpi_pptt_cache {
  1767. struct acpi_subtable_header header;
  1768. u16 reserved;
  1769. u32 flags;
  1770. u32 next_level_of_cache;
  1771. u32 size;
  1772. u32 number_of_sets;
  1773. u8 associativity;
  1774. u8 attributes;
  1775. u16 line_size;
  1776. };
  1777. /* 1: Cache Type Structure for PPTT version 3 */
  1778. struct acpi_pptt_cache_v1 {
  1779. u32 cache_id;
  1780. };
  1781. /* Flags */
  1782. #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
  1783. #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
  1784. #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
  1785. #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
  1786. #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
  1787. #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
  1788. #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
  1789. #define ACPI_PPTT_CACHE_ID_VALID (1<<7) /* Cache ID valid */
  1790. /* Masks for Attributes */
  1791. #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
  1792. #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
  1793. #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
  1794. /* Attributes describing cache */
  1795. #define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */
  1796. #define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */
  1797. #define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */
  1798. #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */
  1799. #define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */
  1800. #define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */
  1801. #define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */
  1802. #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */
  1803. #define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */
  1804. #define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */
  1805. /* 2: ID Structure */
  1806. struct acpi_pptt_id {
  1807. struct acpi_subtable_header header;
  1808. u16 reserved;
  1809. u32 vendor_id;
  1810. u64 level1_id;
  1811. u64 level2_id;
  1812. u16 major_rev;
  1813. u16 minor_rev;
  1814. u16 spin_rev;
  1815. };
  1816. /*******************************************************************************
  1817. *
  1818. * PRMT - Platform Runtime Mechanism Table
  1819. * Version 1
  1820. *
  1821. ******************************************************************************/
  1822. struct acpi_table_prmt {
  1823. struct acpi_table_header header; /* Common ACPI table header */
  1824. };
  1825. struct acpi_table_prmt_header {
  1826. u8 platform_guid[16];
  1827. u32 module_info_offset;
  1828. u32 module_info_count;
  1829. };
  1830. struct acpi_prmt_module_header {
  1831. u16 revision;
  1832. u16 length;
  1833. };
  1834. struct acpi_prmt_module_info {
  1835. u16 revision;
  1836. u16 length;
  1837. u8 module_guid[16];
  1838. u16 major_rev;
  1839. u16 minor_rev;
  1840. u16 handler_info_count;
  1841. u32 handler_info_offset;
  1842. u64 mmio_list_pointer;
  1843. };
  1844. struct acpi_prmt_handler_info {
  1845. u16 revision;
  1846. u16 length;
  1847. u8 handler_guid[16];
  1848. u64 handler_address;
  1849. u64 static_data_buffer_address;
  1850. u64 acpi_param_buffer_address;
  1851. };
  1852. /*******************************************************************************
  1853. *
  1854. * RASF - RAS Feature Table (ACPI 5.0)
  1855. * Version 1
  1856. *
  1857. ******************************************************************************/
  1858. struct acpi_table_rasf {
  1859. struct acpi_table_header header; /* Common ACPI table header */
  1860. u8 channel_id[12];
  1861. };
  1862. /* RASF Platform Communication Channel Shared Memory Region */
  1863. struct acpi_rasf_shared_memory {
  1864. u32 signature;
  1865. u16 command;
  1866. u16 status;
  1867. u16 version;
  1868. u8 capabilities[16];
  1869. u8 set_capabilities[16];
  1870. u16 num_parameter_blocks;
  1871. u32 set_capabilities_status;
  1872. };
  1873. /* RASF Parameter Block Structure Header */
  1874. struct acpi_rasf_parameter_block {
  1875. u16 type;
  1876. u16 version;
  1877. u16 length;
  1878. };
  1879. /* RASF Parameter Block Structure for PATROL_SCRUB */
  1880. struct acpi_rasf_patrol_scrub_parameter {
  1881. struct acpi_rasf_parameter_block header;
  1882. u16 patrol_scrub_command;
  1883. u64 requested_address_range[2];
  1884. u64 actual_address_range[2];
  1885. u16 flags;
  1886. u8 requested_speed;
  1887. };
  1888. /* Masks for Flags and Speed fields above */
  1889. #define ACPI_RASF_SCRUBBER_RUNNING 1
  1890. #define ACPI_RASF_SPEED (7<<1)
  1891. #define ACPI_RASF_SPEED_SLOW (0<<1)
  1892. #define ACPI_RASF_SPEED_MEDIUM (4<<1)
  1893. #define ACPI_RASF_SPEED_FAST (7<<1)
  1894. /* Channel Commands */
  1895. enum acpi_rasf_commands {
  1896. ACPI_RASF_EXECUTE_RASF_COMMAND = 1
  1897. };
  1898. /* Platform RAS Capabilities */
  1899. enum acpi_rasf_capabiliities {
  1900. ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
  1901. ACPI_SW_PATROL_SCRUB_EXPOSED = 1
  1902. };
  1903. /* Patrol Scrub Commands */
  1904. enum acpi_rasf_patrol_scrub_commands {
  1905. ACPI_RASF_GET_PATROL_PARAMETERS = 1,
  1906. ACPI_RASF_START_PATROL_SCRUBBER = 2,
  1907. ACPI_RASF_STOP_PATROL_SCRUBBER = 3
  1908. };
  1909. /* Channel Command flags */
  1910. #define ACPI_RASF_GENERATE_SCI (1<<15)
  1911. /* Status values */
  1912. enum acpi_rasf_status {
  1913. ACPI_RASF_SUCCESS = 0,
  1914. ACPI_RASF_NOT_VALID = 1,
  1915. ACPI_RASF_NOT_SUPPORTED = 2,
  1916. ACPI_RASF_BUSY = 3,
  1917. ACPI_RASF_FAILED = 4,
  1918. ACPI_RASF_ABORTED = 5,
  1919. ACPI_RASF_INVALID_DATA = 6
  1920. };
  1921. /* Status flags */
  1922. #define ACPI_RASF_COMMAND_COMPLETE (1)
  1923. #define ACPI_RASF_SCI_DOORBELL (1<<1)
  1924. #define ACPI_RASF_ERROR (1<<2)
  1925. #define ACPI_RASF_STATUS (0x1F<<3)
  1926. /*******************************************************************************
  1927. *
  1928. * RGRT - Regulatory Graphics Resource Table
  1929. * Version 1
  1930. *
  1931. * Conforms to "ACPI RGRT" available at:
  1932. * https://microsoft.github.io/mu/dyn/mu_plus/ms_core_pkg/acpi_RGRT/feature_acpi_rgrt/
  1933. *
  1934. ******************************************************************************/
  1935. struct acpi_table_rgrt {
  1936. struct acpi_table_header header; /* Common ACPI table header */
  1937. u16 version;
  1938. u8 image_type;
  1939. u8 reserved;
  1940. u8 image[];
  1941. };
  1942. /* image_type values */
  1943. enum acpi_rgrt_image_type {
  1944. ACPI_RGRT_TYPE_RESERVED0 = 0,
  1945. ACPI_RGRT_IMAGE_TYPE_PNG = 1,
  1946. ACPI_RGRT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  1947. };
  1948. /*******************************************************************************
  1949. *
  1950. * SBST - Smart Battery Specification Table
  1951. * Version 1
  1952. *
  1953. ******************************************************************************/
  1954. struct acpi_table_sbst {
  1955. struct acpi_table_header header; /* Common ACPI table header */
  1956. u32 warning_level;
  1957. u32 low_level;
  1958. u32 critical_level;
  1959. };
  1960. /*******************************************************************************
  1961. *
  1962. * SDEI - Software Delegated Exception Interface Descriptor Table
  1963. *
  1964. * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
  1965. * May 8th, 2017. Copyright 2017 ARM Ltd.
  1966. *
  1967. ******************************************************************************/
  1968. struct acpi_table_sdei {
  1969. struct acpi_table_header header; /* Common ACPI table header */
  1970. };
  1971. /*******************************************************************************
  1972. *
  1973. * SDEV - Secure Devices Table (ACPI 6.2)
  1974. * Version 1
  1975. *
  1976. ******************************************************************************/
  1977. struct acpi_table_sdev {
  1978. struct acpi_table_header header; /* Common ACPI table header */
  1979. };
  1980. struct acpi_sdev_header {
  1981. u8 type;
  1982. u8 flags;
  1983. u16 length;
  1984. };
  1985. /* Values for subtable type above */
  1986. enum acpi_sdev_type {
  1987. ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
  1988. ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
  1989. ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  1990. };
  1991. /* Values for flags above */
  1992. #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1)
  1993. #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1)
  1994. /*
  1995. * SDEV subtables
  1996. */
  1997. /* 0: Namespace Device Based Secure Device Structure */
  1998. struct acpi_sdev_namespace {
  1999. struct acpi_sdev_header header;
  2000. u16 device_id_offset;
  2001. u16 device_id_length;
  2002. u16 vendor_data_offset;
  2003. u16 vendor_data_length;
  2004. };
  2005. struct acpi_sdev_secure_component {
  2006. u16 secure_component_offset;
  2007. u16 secure_component_length;
  2008. };
  2009. /*
  2010. * SDEV sub-subtables ("Components") for above
  2011. */
  2012. struct acpi_sdev_component {
  2013. struct acpi_sdev_header header;
  2014. };
  2015. /* Values for sub-subtable type above */
  2016. enum acpi_sac_type {
  2017. ACPI_SDEV_TYPE_ID_COMPONENT = 0,
  2018. ACPI_SDEV_TYPE_MEM_COMPONENT = 1
  2019. };
  2020. struct acpi_sdev_id_component {
  2021. struct acpi_sdev_header header;
  2022. u16 hardware_id_offset;
  2023. u16 hardware_id_length;
  2024. u16 subsystem_id_offset;
  2025. u16 subsystem_id_length;
  2026. u16 hardware_revision;
  2027. u8 hardware_rev_present;
  2028. u8 class_code_present;
  2029. u8 pci_base_class;
  2030. u8 pci_sub_class;
  2031. u8 pci_programming_xface;
  2032. };
  2033. struct acpi_sdev_mem_component {
  2034. struct acpi_sdev_header header;
  2035. u32 reserved;
  2036. u64 memory_base_address;
  2037. u64 memory_length;
  2038. };
  2039. /* 1: PCIe Endpoint Device Based Device Structure */
  2040. struct acpi_sdev_pcie {
  2041. struct acpi_sdev_header header;
  2042. u16 segment;
  2043. u16 start_bus;
  2044. u16 path_offset;
  2045. u16 path_length;
  2046. u16 vendor_data_offset;
  2047. u16 vendor_data_length;
  2048. };
  2049. /* 1a: PCIe Endpoint path entry */
  2050. struct acpi_sdev_pcie_path {
  2051. u8 device;
  2052. u8 function;
  2053. };
  2054. /*******************************************************************************
  2055. *
  2056. * SVKL - Storage Volume Key Location Table (ACPI 6.4)
  2057. * From: "Guest-Host-Communication Interface (GHCI) for Intel
  2058. * Trust Domain Extensions (Intel TDX)".
  2059. * Version 1
  2060. *
  2061. ******************************************************************************/
  2062. struct acpi_table_svkl {
  2063. struct acpi_table_header header; /* Common ACPI table header */
  2064. u32 count;
  2065. };
  2066. struct acpi_svkl_key {
  2067. u16 type;
  2068. u16 format;
  2069. u32 size;
  2070. u64 address;
  2071. };
  2072. enum acpi_svkl_type {
  2073. ACPI_SVKL_TYPE_MAIN_STORAGE = 0,
  2074. ACPI_SVKL_TYPE_RESERVED = 1 /* 1 and greater are reserved */
  2075. };
  2076. enum acpi_svkl_format {
  2077. ACPI_SVKL_FORMAT_RAW_BINARY = 0,
  2078. ACPI_SVKL_FORMAT_RESERVED = 1 /* 1 and greater are reserved */
  2079. };
  2080. /*******************************************************************************
  2081. *
  2082. * TDEL - TD-Event Log
  2083. * From: "Guest-Host-Communication Interface (GHCI) for Intel
  2084. * Trust Domain Extensions (Intel TDX)".
  2085. * September 2020
  2086. *
  2087. ******************************************************************************/
  2088. struct acpi_table_tdel {
  2089. struct acpi_table_header header; /* Common ACPI table header */
  2090. u32 reserved;
  2091. u64 log_area_minimum_length;
  2092. u64 log_area_start_address;
  2093. };
  2094. /* Reset to default packing */
  2095. #pragma pack()
  2096. #endif /* __ACTBL2_H__ */