actbl2.h 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185
  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 - 2023, 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_CCEL "CCEL" /* CC Event Log Table */
  28. #define ACPI_SIG_CDAT "CDAT" /* Coherent Device Attribute Table */
  29. #define ACPI_SIG_IORT "IORT" /* IO Remapping Table */
  30. #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
  31. #define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
  32. #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
  33. #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
  34. #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
  35. #define ACPI_SIG_MPAM "MPAM" /* Memory System Resource Partitioning and Monitoring Table */
  36. #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
  37. #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
  38. #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
  39. #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */
  40. #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
  41. #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
  42. #define ACPI_SIG_PHAT "PHAT" /* Platform Health Assessment Table */
  43. #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
  44. #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
  45. #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */
  46. #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
  47. #define ACPI_SIG_RAS2 "RAS2" /* RAS2 Feature table */
  48. #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */
  49. #define ACPI_SIG_RHCT "RHCT" /* RISC-V Hart Capabilities Table */
  50. #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
  51. #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
  52. #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
  53. #define ACPI_SIG_SVKL "SVKL" /* Storage Volume Key Location Table */
  54. #define ACPI_SIG_TDEL "TDEL" /* TD Event Log Table */
  55. /*
  56. * All tables must be byte-packed to match the ACPI specification, since
  57. * the tables are provided by the system BIOS.
  58. */
  59. #pragma pack(1)
  60. /*
  61. * Note: C bitfields are not used for this reason:
  62. *
  63. * "Bitfields are great and easy to read, but unfortunately the C language
  64. * does not specify the layout of bitfields in memory, which means they are
  65. * essentially useless for dealing with packed data in on-disk formats or
  66. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  67. * this decision was a design error in C. Ritchie could have picked an order
  68. * and stuck with it." Norman Ramsey.
  69. * See http://stackoverflow.com/a/1053662/41661
  70. */
  71. /*******************************************************************************
  72. *
  73. * AEST - Arm Error Source Table
  74. *
  75. * Conforms to: ACPI for the Armv8 RAS Extensions 1.1(Sep 2020) and
  76. * 2.0(May 2023) Platform Design Document.
  77. *
  78. ******************************************************************************/
  79. struct acpi_table_aest {
  80. struct acpi_table_header header;
  81. };
  82. /* Common Subtable header - one per Node Structure (Subtable) */
  83. struct acpi_aest_hdr {
  84. u8 type;
  85. u16 length;
  86. u8 reserved;
  87. u32 node_specific_offset;
  88. u32 node_interface_offset;
  89. u32 node_interrupt_offset;
  90. u32 node_interrupt_count;
  91. u64 timestamp_rate;
  92. u64 reserved1;
  93. u64 error_injection_rate;
  94. };
  95. /* Values for Type above */
  96. #define ACPI_AEST_PROCESSOR_ERROR_NODE 0
  97. #define ACPI_AEST_MEMORY_ERROR_NODE 1
  98. #define ACPI_AEST_SMMU_ERROR_NODE 2
  99. #define ACPI_AEST_VENDOR_ERROR_NODE 3
  100. #define ACPI_AEST_GIC_ERROR_NODE 4
  101. #define ACPI_AEST_PCIE_ERROR_NODE 5
  102. #define ACPI_AEST_PROXY_ERROR_NODE 6
  103. #define ACPI_AEST_NODE_TYPE_RESERVED 7 /* 7 and above are reserved */
  104. /*
  105. * AEST subtables (Error nodes)
  106. */
  107. /* 0: Processor Error */
  108. typedef struct acpi_aest_processor {
  109. u32 processor_id;
  110. u8 resource_type;
  111. u8 reserved;
  112. u8 flags;
  113. u8 revision;
  114. u64 processor_affinity;
  115. } acpi_aest_processor;
  116. /* Values for resource_type above, related structs below */
  117. #define ACPI_AEST_CACHE_RESOURCE 0
  118. #define ACPI_AEST_TLB_RESOURCE 1
  119. #define ACPI_AEST_GENERIC_RESOURCE 2
  120. #define ACPI_AEST_RESOURCE_RESERVED 3 /* 3 and above are reserved */
  121. /* 0R: Processor Cache Resource Substructure */
  122. typedef struct acpi_aest_processor_cache {
  123. u32 cache_reference;
  124. u32 reserved;
  125. } acpi_aest_processor_cache;
  126. /* Values for cache_type above */
  127. #define ACPI_AEST_CACHE_DATA 0
  128. #define ACPI_AEST_CACHE_INSTRUCTION 1
  129. #define ACPI_AEST_CACHE_UNIFIED 2
  130. #define ACPI_AEST_CACHE_RESERVED 3 /* 3 and above are reserved */
  131. /* 1R: Processor TLB Resource Substructure */
  132. typedef struct acpi_aest_processor_tlb {
  133. u32 tlb_level;
  134. u32 reserved;
  135. } acpi_aest_processor_tlb;
  136. /* 2R: Processor Generic Resource Substructure */
  137. typedef struct acpi_aest_processor_generic {
  138. u32 resource;
  139. } acpi_aest_processor_generic;
  140. /* 1: Memory Error */
  141. typedef struct acpi_aest_memory {
  142. u32 srat_proximity_domain;
  143. } acpi_aest_memory;
  144. /* 2: Smmu Error */
  145. typedef struct acpi_aest_smmu {
  146. u32 iort_node_reference;
  147. u32 subcomponent_reference;
  148. } acpi_aest_smmu;
  149. /* 3: Vendor Defined */
  150. typedef struct acpi_aest_vendor {
  151. u32 acpi_hid;
  152. u32 acpi_uid;
  153. u8 vendor_specific_data[16];
  154. } acpi_aest_vendor;
  155. struct acpi_aest_vendor_v2 {
  156. char acpi_hid[8];
  157. u32 acpi_uid;
  158. u8 vendor_specific_data[16];
  159. };
  160. /* 4: Gic Error */
  161. typedef struct acpi_aest_gic {
  162. u32 interface_type;
  163. u32 instance_id;
  164. } acpi_aest_gic;
  165. /* Values for interface_type above */
  166. #define ACPI_AEST_GIC_CPU 0
  167. #define ACPI_AEST_GIC_DISTRIBUTOR 1
  168. #define ACPI_AEST_GIC_REDISTRIBUTOR 2
  169. #define ACPI_AEST_GIC_ITS 3
  170. #define ACPI_AEST_GIC_RESERVED 4 /* 4 and above are reserved */
  171. /* 5: PCIe Error */
  172. struct acpi_aest_pcie {
  173. u32 iort_node_reference;
  174. };
  175. /* 6: Proxy Error */
  176. struct acpi_aest_proxy {
  177. u64 node_address;
  178. };
  179. /* Node Interface Structure */
  180. typedef struct acpi_aest_node_interface {
  181. u8 type;
  182. u8 reserved[3];
  183. u32 flags;
  184. u64 address;
  185. u32 error_record_index;
  186. u32 error_record_count;
  187. u64 error_record_implemented;
  188. u64 error_status_reporting;
  189. u64 addressing_mode;
  190. } acpi_aest_node_interface;
  191. /* Node Interface Structure V2 */
  192. struct acpi_aest_node_interface_header {
  193. u8 type;
  194. u8 group_format;
  195. u8 reserved[2];
  196. u32 flags;
  197. u64 address;
  198. u32 error_record_index;
  199. u32 error_record_count;
  200. };
  201. #define ACPI_AEST_NODE_GROUP_FORMAT_4K 0
  202. #define ACPI_AEST_NODE_GROUP_FORMAT_16K 1
  203. #define ACPI_AEST_NODE_GROUP_FORMAT_64K 2
  204. struct acpi_aest_node_interface_common {
  205. u32 error_node_device;
  206. u32 processor_affinity;
  207. u64 error_group_register_base;
  208. u64 fault_inject_register_base;
  209. u64 interrupt_config_register_base;
  210. };
  211. struct acpi_aest_node_interface_4k {
  212. u64 error_record_implemented;
  213. u64 error_status_reporting;
  214. u64 addressing_mode;
  215. struct acpi_aest_node_interface_common common;
  216. };
  217. struct acpi_aest_node_interface_16k {
  218. u64 error_record_implemented[4];
  219. u64 error_status_reporting[4];
  220. u64 addressing_mode[4];
  221. struct acpi_aest_node_interface_common common;
  222. };
  223. struct acpi_aest_node_interface_64k {
  224. u64 error_record_implemented[14];
  225. u64 error_status_reporting[14];
  226. u64 addressing_mode[14];
  227. struct acpi_aest_node_interface_common common;
  228. };
  229. /* Values for Type field above */
  230. #define ACPI_AEST_NODE_SYSTEM_REGISTER 0
  231. #define ACPI_AEST_NODE_MEMORY_MAPPED 1
  232. #define ACPI_AEST_NODE_SINGLE_RECORD_MEMORY_MAPPED 2
  233. #define ACPI_AEST_XFACE_RESERVED 3 /* 2 and above are reserved */
  234. /* Node Interrupt Structure */
  235. typedef struct acpi_aest_node_interrupt {
  236. u8 type;
  237. u8 reserved[2];
  238. u8 flags;
  239. u32 gsiv;
  240. u8 iort_id;
  241. u8 reserved1[3];
  242. } acpi_aest_node_interrupt;
  243. /* Node Interrupt Structure V2 */
  244. struct acpi_aest_node_interrupt_v2 {
  245. u8 type;
  246. u8 reserved[2];
  247. u8 flags;
  248. u32 gsiv;
  249. u8 reserved1[4];
  250. };
  251. /* Values for Type field above */
  252. #define ACPI_AEST_NODE_FAULT_HANDLING 0
  253. #define ACPI_AEST_NODE_ERROR_RECOVERY 1
  254. #define ACPI_AEST_XRUPT_RESERVED 2 /* 2 and above are reserved */
  255. /*******************************************************************************
  256. * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface
  257. *
  258. * Conforms to "ACPI for Arm Components 1.1, Platform Design Document"
  259. * ARM DEN0093 v1.1
  260. *
  261. ******************************************************************************/
  262. struct acpi_table_agdi {
  263. struct acpi_table_header header; /* Common ACPI table header */
  264. u8 flags;
  265. u8 reserved[3];
  266. u32 sdei_event;
  267. u32 gsiv;
  268. };
  269. /* Mask for Flags field above */
  270. #define ACPI_AGDI_SIGNALING_MODE (1)
  271. /*******************************************************************************
  272. *
  273. * APMT - ARM Performance Monitoring Unit Table
  274. *
  275. * Conforms to:
  276. * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
  277. * ARM DEN0117 v1.0 November 25, 2021
  278. *
  279. ******************************************************************************/
  280. struct acpi_table_apmt {
  281. struct acpi_table_header header; /* Common ACPI table header */
  282. };
  283. #define ACPI_APMT_NODE_ID_LENGTH 4
  284. /*
  285. * APMT subtables
  286. */
  287. struct acpi_apmt_node {
  288. u16 length;
  289. u8 flags;
  290. u8 type;
  291. u32 id;
  292. u64 inst_primary;
  293. u32 inst_secondary;
  294. u64 base_address0;
  295. u64 base_address1;
  296. u32 ovflw_irq;
  297. u32 reserved;
  298. u32 ovflw_irq_flags;
  299. u32 proc_affinity;
  300. u32 impl_id;
  301. };
  302. /* Masks for Flags field above */
  303. #define ACPI_APMT_FLAGS_DUAL_PAGE (1<<0)
  304. #define ACPI_APMT_FLAGS_AFFINITY (1<<1)
  305. #define ACPI_APMT_FLAGS_ATOMIC (1<<2)
  306. /* Values for Flags dual page field above */
  307. #define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP (0<<0)
  308. #define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP (1<<0)
  309. /* Values for Flags processor affinity field above */
  310. #define ACPI_APMT_FLAGS_AFFINITY_PROC (0<<1)
  311. #define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1)
  312. /* Values for Flags 64-bit atomic field above */
  313. #define ACPI_APMT_FLAGS_ATOMIC_NSUPP (0<<2)
  314. #define ACPI_APMT_FLAGS_ATOMIC_SUPP (1<<2)
  315. /* Values for Type field above */
  316. enum acpi_apmt_node_type {
  317. ACPI_APMT_NODE_TYPE_MC = 0x00,
  318. ACPI_APMT_NODE_TYPE_SMMU = 0x01,
  319. ACPI_APMT_NODE_TYPE_PCIE_ROOT = 0x02,
  320. ACPI_APMT_NODE_TYPE_ACPI = 0x03,
  321. ACPI_APMT_NODE_TYPE_CACHE = 0x04,
  322. ACPI_APMT_NODE_TYPE_COUNT
  323. };
  324. /* Masks for ovflw_irq_flags field above */
  325. #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE (1<<0)
  326. #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE (1<<1)
  327. /* Values for ovflw_irq_flags mode field above */
  328. #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL (0<<0)
  329. #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE (1<<0)
  330. /* Values for ovflw_irq_flags type field above */
  331. #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED (0<<1)
  332. /*******************************************************************************
  333. *
  334. * BDAT - BIOS Data ACPI Table
  335. *
  336. * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5
  337. * Nov 2020
  338. *
  339. ******************************************************************************/
  340. struct acpi_table_bdat {
  341. struct acpi_table_header header;
  342. struct acpi_generic_address gas;
  343. };
  344. /*******************************************************************************
  345. *
  346. * CCEL - CC-Event Log
  347. * From: "Guest-Host-Communication Interface (GHCI) for Intel
  348. * Trust Domain Extensions (Intel TDX)". Feb 2022
  349. *
  350. ******************************************************************************/
  351. struct acpi_table_ccel {
  352. struct acpi_table_header header; /* Common ACPI table header */
  353. u8 CCtype;
  354. u8 Ccsub_type;
  355. u16 reserved;
  356. u64 log_area_minimum_length;
  357. u64 log_area_start_address;
  358. };
  359. /*******************************************************************************
  360. *
  361. * IORT - IO Remapping Table
  362. *
  363. * Conforms to "IO Remapping Table System Software on ARM Platforms",
  364. * Document number: ARM DEN 0049E.e, Sep 2022
  365. *
  366. ******************************************************************************/
  367. struct acpi_table_iort {
  368. struct acpi_table_header header;
  369. u32 node_count;
  370. u32 node_offset;
  371. u32 reserved;
  372. };
  373. /*
  374. * IORT subtables
  375. */
  376. struct acpi_iort_node {
  377. u8 type;
  378. u16 length;
  379. u8 revision;
  380. u32 identifier;
  381. u32 mapping_count;
  382. u32 mapping_offset;
  383. char node_data[];
  384. };
  385. /* Values for subtable Type above */
  386. enum acpi_iort_node_type {
  387. ACPI_IORT_NODE_ITS_GROUP = 0x00,
  388. ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
  389. ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
  390. ACPI_IORT_NODE_SMMU = 0x03,
  391. ACPI_IORT_NODE_SMMU_V3 = 0x04,
  392. ACPI_IORT_NODE_PMCG = 0x05,
  393. ACPI_IORT_NODE_RMR = 0x06,
  394. };
  395. struct acpi_iort_id_mapping {
  396. u32 input_base; /* Lowest value in input range */
  397. u32 id_count; /* Number of IDs */
  398. u32 output_base; /* Lowest value in output range */
  399. u32 output_reference; /* A reference to the output node */
  400. u32 flags;
  401. };
  402. /* Masks for Flags field above for IORT subtable */
  403. #define ACPI_IORT_ID_SINGLE_MAPPING (1)
  404. struct acpi_iort_memory_access {
  405. u32 cache_coherency;
  406. u8 hints;
  407. u16 reserved;
  408. u8 memory_flags;
  409. };
  410. /* Values for cache_coherency field above */
  411. #define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent */
  412. #define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent */
  413. /* Masks for Hints field above */
  414. #define ACPI_IORT_HT_TRANSIENT (1)
  415. #define ACPI_IORT_HT_WRITE (1<<1)
  416. #define ACPI_IORT_HT_READ (1<<2)
  417. #define ACPI_IORT_HT_OVERRIDE (1<<3)
  418. /* Masks for memory_flags field above */
  419. #define ACPI_IORT_MF_COHERENCY (1)
  420. #define ACPI_IORT_MF_ATTRIBUTES (1<<1)
  421. /*
  422. * IORT node specific subtables
  423. */
  424. struct acpi_iort_its_group {
  425. u32 its_count;
  426. u32 identifiers[]; /* GIC ITS identifier array */
  427. };
  428. struct acpi_iort_named_component {
  429. u32 node_flags;
  430. u64 memory_properties; /* Memory access properties */
  431. u8 memory_address_limit; /* Memory address size limit */
  432. char device_name[]; /* Path of namespace object */
  433. };
  434. /* Masks for Flags field above */
  435. #define ACPI_IORT_NC_STALL_SUPPORTED (1)
  436. #define ACPI_IORT_NC_PASID_BITS (31<<1)
  437. struct acpi_iort_root_complex {
  438. u64 memory_properties; /* Memory access properties */
  439. u32 ats_attribute;
  440. u32 pci_segment_number;
  441. u8 memory_address_limit; /* Memory address size limit */
  442. u16 pasid_capabilities; /* PASID Capabilities */
  443. u8 reserved[]; /* Reserved, must be zero */
  444. };
  445. /* Masks for ats_attribute field above */
  446. #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */
  447. #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */
  448. #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */
  449. /* Masks for pasid_capabilities field above */
  450. #define ACPI_IORT_PASID_MAX_WIDTH (0x1F) /* Bits 0-4 */
  451. struct acpi_iort_smmu {
  452. u64 base_address; /* SMMU base address */
  453. u64 span; /* Length of memory range */
  454. u32 model;
  455. u32 flags;
  456. u32 global_interrupt_offset;
  457. u32 context_interrupt_count;
  458. u32 context_interrupt_offset;
  459. u32 pmu_interrupt_count;
  460. u32 pmu_interrupt_offset;
  461. u64 interrupts[]; /* Interrupt array */
  462. };
  463. /* Values for Model field above */
  464. #define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */
  465. #define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */
  466. #define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */
  467. #define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */
  468. #define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */
  469. #define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium thunder_x SMMUv2 */
  470. /* Masks for Flags field above */
  471. #define ACPI_IORT_SMMU_DVM_SUPPORTED (1)
  472. #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1)
  473. /* Global interrupt format */
  474. struct acpi_iort_smmu_gsi {
  475. u32 nsg_irpt;
  476. u32 nsg_irpt_flags;
  477. u32 nsg_cfg_irpt;
  478. u32 nsg_cfg_irpt_flags;
  479. };
  480. struct acpi_iort_smmu_v3 {
  481. u64 base_address; /* SMMUv3 base address */
  482. u32 flags;
  483. u32 reserved;
  484. u64 vatos_address;
  485. u32 model;
  486. u32 event_gsiv;
  487. u32 pri_gsiv;
  488. u32 gerr_gsiv;
  489. u32 sync_gsiv;
  490. u32 pxm;
  491. u32 id_mapping_index;
  492. };
  493. /* Values for Model field above */
  494. #define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */
  495. #define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* hi_silicon Hi161x SMMUv3 */
  496. #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */
  497. /* Masks for Flags field above */
  498. #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
  499. #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1)
  500. #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3)
  501. #define ACPI_IORT_SMMU_V3_DEVICEID_VALID (1<<4)
  502. struct acpi_iort_pmcg {
  503. u64 page0_base_address;
  504. u32 overflow_gsiv;
  505. u32 node_reference;
  506. u64 page1_base_address;
  507. };
  508. struct acpi_iort_rmr {
  509. u32 flags;
  510. u32 rmr_count;
  511. u32 rmr_offset;
  512. };
  513. /* Masks for Flags field above */
  514. #define ACPI_IORT_RMR_REMAP_PERMITTED (1)
  515. #define ACPI_IORT_RMR_ACCESS_PRIVILEGE (1<<1)
  516. /*
  517. * Macro to access the Access Attributes in flags field above:
  518. * Access Attributes is encoded in bits 9:2
  519. */
  520. #define ACPI_IORT_RMR_ACCESS_ATTRIBUTES(flags) (((flags) >> 2) & 0xFF)
  521. /* Values for above Access Attributes */
  522. #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRNE 0x00
  523. #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRE 0x01
  524. #define ACPI_IORT_RMR_ATTR_DEVICE_NGRE 0x02
  525. #define ACPI_IORT_RMR_ATTR_DEVICE_GRE 0x03
  526. #define ACPI_IORT_RMR_ATTR_NORMAL_NC 0x04
  527. #define ACPI_IORT_RMR_ATTR_NORMAL_IWB_OWB 0x05
  528. struct acpi_iort_rmr_desc {
  529. u64 base_address;
  530. u64 length;
  531. u32 reserved;
  532. };
  533. /*******************************************************************************
  534. *
  535. * IVRS - I/O Virtualization Reporting Structure
  536. * Version 1
  537. *
  538. * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
  539. * Revision 1.26, February 2009.
  540. *
  541. ******************************************************************************/
  542. struct acpi_table_ivrs {
  543. struct acpi_table_header header; /* Common ACPI table header */
  544. u32 info; /* Common virtualization info */
  545. u64 reserved;
  546. };
  547. /* Values for Info field above */
  548. #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
  549. #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
  550. #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */
  551. /* IVRS subtable header */
  552. struct acpi_ivrs_header {
  553. u8 type; /* Subtable type */
  554. u8 flags;
  555. u16 length; /* Subtable length */
  556. u16 device_id; /* ID of IOMMU */
  557. };
  558. /* Values for subtable Type above */
  559. enum acpi_ivrs_type {
  560. ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
  561. ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
  562. ACPI_IVRS_TYPE_HARDWARE3 = 0x40,
  563. ACPI_IVRS_TYPE_MEMORY1 = 0x20,
  564. ACPI_IVRS_TYPE_MEMORY2 = 0x21,
  565. ACPI_IVRS_TYPE_MEMORY3 = 0x22
  566. };
  567. /* Masks for Flags field above for IVHD subtable */
  568. #define ACPI_IVHD_TT_ENABLE (1)
  569. #define ACPI_IVHD_PASS_PW (1<<1)
  570. #define ACPI_IVHD_RES_PASS_PW (1<<2)
  571. #define ACPI_IVHD_ISOC (1<<3)
  572. #define ACPI_IVHD_IOTLB (1<<4)
  573. /* Masks for Flags field above for IVMD subtable */
  574. #define ACPI_IVMD_UNITY (1)
  575. #define ACPI_IVMD_READ (1<<1)
  576. #define ACPI_IVMD_WRITE (1<<2)
  577. #define ACPI_IVMD_EXCLUSION_RANGE (1<<3)
  578. /*
  579. * IVRS subtables, correspond to Type in struct acpi_ivrs_header
  580. */
  581. /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
  582. struct acpi_ivrs_hardware_10 {
  583. struct acpi_ivrs_header header;
  584. u16 capability_offset; /* Offset for IOMMU control fields */
  585. u64 base_address; /* IOMMU control registers */
  586. u16 pci_segment_group;
  587. u16 info; /* MSI number and unit ID */
  588. u32 feature_reporting;
  589. };
  590. /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
  591. struct acpi_ivrs_hardware_11 {
  592. struct acpi_ivrs_header header;
  593. u16 capability_offset; /* Offset for IOMMU control fields */
  594. u64 base_address; /* IOMMU control registers */
  595. u16 pci_segment_group;
  596. u16 info; /* MSI number and unit ID */
  597. u32 attributes;
  598. u64 efr_register_image;
  599. u64 reserved;
  600. };
  601. /* Masks for Info field above */
  602. #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */
  603. #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_ID */
  604. /*
  605. * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
  606. * Upper two bits of the Type field are the (encoded) length of the structure.
  607. * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
  608. * are reserved for future use but not defined.
  609. */
  610. struct acpi_ivrs_de_header {
  611. u8 type;
  612. u16 id;
  613. u8 data_setting;
  614. };
  615. /* Length of device entry is in the top two bits of Type field above */
  616. #define ACPI_IVHD_ENTRY_LENGTH 0xC0
  617. /* Values for device entry Type field above */
  618. enum acpi_ivrs_device_entry_type {
  619. /* 4-byte device entries, all use struct acpi_ivrs_device4 */
  620. ACPI_IVRS_TYPE_PAD4 = 0,
  621. ACPI_IVRS_TYPE_ALL = 1,
  622. ACPI_IVRS_TYPE_SELECT = 2,
  623. ACPI_IVRS_TYPE_START = 3,
  624. ACPI_IVRS_TYPE_END = 4,
  625. /* 8-byte device entries */
  626. ACPI_IVRS_TYPE_PAD8 = 64,
  627. ACPI_IVRS_TYPE_NOT_USED = 65,
  628. ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */
  629. ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */
  630. ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */
  631. ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */
  632. ACPI_IVRS_TYPE_SPECIAL = 72, /* Uses struct acpi_ivrs_device8c */
  633. /* Variable-length device entries */
  634. ACPI_IVRS_TYPE_HID = 240 /* Uses ACPI_IVRS_DEVICE_HID */
  635. };
  636. /* Values for Data field above */
  637. #define ACPI_IVHD_INIT_PASS (1)
  638. #define ACPI_IVHD_EINT_PASS (1<<1)
  639. #define ACPI_IVHD_NMI_PASS (1<<2)
  640. #define ACPI_IVHD_SYSTEM_MGMT (3<<4)
  641. #define ACPI_IVHD_LINT0_PASS (1<<6)
  642. #define ACPI_IVHD_LINT1_PASS (1<<7)
  643. /* Types 0-4: 4-byte device entry */
  644. struct acpi_ivrs_device4 {
  645. struct acpi_ivrs_de_header header;
  646. };
  647. /* Types 66-67: 8-byte device entry */
  648. struct acpi_ivrs_device8a {
  649. struct acpi_ivrs_de_header header;
  650. u8 reserved1;
  651. u16 used_id;
  652. u8 reserved2;
  653. };
  654. /* Types 70-71: 8-byte device entry */
  655. struct acpi_ivrs_device8b {
  656. struct acpi_ivrs_de_header header;
  657. u32 extended_data;
  658. };
  659. /* Values for extended_data above */
  660. #define ACPI_IVHD_ATS_DISABLED (1<<31)
  661. /* Type 72: 8-byte device entry */
  662. struct acpi_ivrs_device8c {
  663. struct acpi_ivrs_de_header header;
  664. u8 handle;
  665. u16 used_id;
  666. u8 variety;
  667. };
  668. /* Values for Variety field above */
  669. #define ACPI_IVHD_IOAPIC 1
  670. #define ACPI_IVHD_HPET 2
  671. /* Type 240: variable-length device entry */
  672. struct acpi_ivrs_device_hid {
  673. struct acpi_ivrs_de_header header;
  674. u64 acpi_hid;
  675. u64 acpi_cid;
  676. u8 uid_type;
  677. u8 uid_length;
  678. };
  679. /* Values for uid_type above */
  680. #define ACPI_IVRS_UID_NOT_PRESENT 0
  681. #define ACPI_IVRS_UID_IS_INTEGER 1
  682. #define ACPI_IVRS_UID_IS_STRING 2
  683. /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
  684. struct acpi_ivrs_memory {
  685. struct acpi_ivrs_header header;
  686. u16 aux_data;
  687. u64 reserved;
  688. u64 start_address;
  689. u64 memory_length;
  690. };
  691. /*******************************************************************************
  692. *
  693. * LPIT - Low Power Idle Table
  694. *
  695. * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
  696. *
  697. ******************************************************************************/
  698. struct acpi_table_lpit {
  699. struct acpi_table_header header; /* Common ACPI table header */
  700. };
  701. /* LPIT subtable header */
  702. struct acpi_lpit_header {
  703. u32 type; /* Subtable type */
  704. u32 length; /* Subtable length */
  705. u16 unique_id;
  706. u16 reserved;
  707. u32 flags;
  708. };
  709. /* Values for subtable Type above */
  710. enum acpi_lpit_type {
  711. ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
  712. ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */
  713. };
  714. /* Masks for Flags field above */
  715. #define ACPI_LPIT_STATE_DISABLED (1)
  716. #define ACPI_LPIT_NO_COUNTER (1<<1)
  717. /*
  718. * LPIT subtables, correspond to Type in struct acpi_lpit_header
  719. */
  720. /* 0x00: Native C-state instruction based LPI structure */
  721. struct acpi_lpit_native {
  722. struct acpi_lpit_header header;
  723. struct acpi_generic_address entry_trigger;
  724. u32 residency;
  725. u32 latency;
  726. struct acpi_generic_address residency_counter;
  727. u64 counter_frequency;
  728. };
  729. /*******************************************************************************
  730. *
  731. * MADT - Multiple APIC Description Table
  732. * Version 3
  733. *
  734. ******************************************************************************/
  735. struct acpi_table_madt {
  736. struct acpi_table_header header; /* Common ACPI table header */
  737. u32 address; /* Physical address of local APIC */
  738. u32 flags;
  739. };
  740. /* Masks for Flags field above */
  741. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  742. /* Values for PCATCompat flag */
  743. #define ACPI_MADT_DUAL_PIC 1
  744. #define ACPI_MADT_MULTIPLE_APIC 0
  745. /* Values for MADT subtable type in struct acpi_subtable_header */
  746. enum acpi_madt_type {
  747. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  748. ACPI_MADT_TYPE_IO_APIC = 1,
  749. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  750. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  751. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  752. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  753. ACPI_MADT_TYPE_IO_SAPIC = 6,
  754. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  755. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  756. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  757. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  758. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  759. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  760. ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
  761. ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
  762. ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
  763. ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
  764. ACPI_MADT_TYPE_CORE_PIC = 17,
  765. ACPI_MADT_TYPE_LIO_PIC = 18,
  766. ACPI_MADT_TYPE_HT_PIC = 19,
  767. ACPI_MADT_TYPE_EIO_PIC = 20,
  768. ACPI_MADT_TYPE_MSI_PIC = 21,
  769. ACPI_MADT_TYPE_BIO_PIC = 22,
  770. ACPI_MADT_TYPE_LPC_PIC = 23,
  771. ACPI_MADT_TYPE_RINTC = 24,
  772. ACPI_MADT_TYPE_IMSIC = 25,
  773. ACPI_MADT_TYPE_APLIC = 26,
  774. ACPI_MADT_TYPE_PLIC = 27,
  775. ACPI_MADT_TYPE_RESERVED = 28, /* 28 to 0x7F are reserved */
  776. ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */
  777. };
  778. /*
  779. * MADT Subtables, correspond to Type in struct acpi_subtable_header
  780. */
  781. /* 0: Processor Local APIC */
  782. struct acpi_madt_local_apic {
  783. struct acpi_subtable_header header;
  784. u8 processor_id; /* ACPI processor id */
  785. u8 id; /* Processor's local APIC id */
  786. u32 lapic_flags;
  787. };
  788. /* 1: IO APIC */
  789. struct acpi_madt_io_apic {
  790. struct acpi_subtable_header header;
  791. u8 id; /* I/O APIC ID */
  792. u8 reserved; /* reserved - must be zero */
  793. u32 address; /* APIC physical address */
  794. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  795. };
  796. /* 2: Interrupt Override */
  797. struct acpi_madt_interrupt_override {
  798. struct acpi_subtable_header header;
  799. u8 bus; /* 0 - ISA */
  800. u8 source_irq; /* Interrupt source (IRQ) */
  801. u32 global_irq; /* Global system interrupt */
  802. u16 inti_flags;
  803. };
  804. /* 3: NMI Source */
  805. struct acpi_madt_nmi_source {
  806. struct acpi_subtable_header header;
  807. u16 inti_flags;
  808. u32 global_irq; /* Global system interrupt */
  809. };
  810. /* 4: Local APIC NMI */
  811. struct acpi_madt_local_apic_nmi {
  812. struct acpi_subtable_header header;
  813. u8 processor_id; /* ACPI processor id */
  814. u16 inti_flags;
  815. u8 lint; /* LINTn to which NMI is connected */
  816. };
  817. /* 5: Address Override */
  818. struct acpi_madt_local_apic_override {
  819. struct acpi_subtable_header header;
  820. u16 reserved; /* Reserved, must be zero */
  821. u64 address; /* APIC physical address */
  822. };
  823. /* 6: I/O Sapic */
  824. struct acpi_madt_io_sapic {
  825. struct acpi_subtable_header header;
  826. u8 id; /* I/O SAPIC ID */
  827. u8 reserved; /* Reserved, must be zero */
  828. u32 global_irq_base; /* Global interrupt for SAPIC start */
  829. u64 address; /* SAPIC physical address */
  830. };
  831. /* 7: Local Sapic */
  832. struct acpi_madt_local_sapic {
  833. struct acpi_subtable_header header;
  834. u8 processor_id; /* ACPI processor id */
  835. u8 id; /* SAPIC ID */
  836. u8 eid; /* SAPIC EID */
  837. u8 reserved[3]; /* Reserved, must be zero */
  838. u32 lapic_flags;
  839. u32 uid; /* Numeric UID - ACPI 3.0 */
  840. char uid_string[]; /* String UID - ACPI 3.0 */
  841. };
  842. /* 8: Platform Interrupt Source */
  843. struct acpi_madt_interrupt_source {
  844. struct acpi_subtable_header header;
  845. u16 inti_flags;
  846. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  847. u8 id; /* Processor ID */
  848. u8 eid; /* Processor EID */
  849. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  850. u32 global_irq; /* Global system interrupt */
  851. u32 flags; /* Interrupt Source Flags */
  852. };
  853. /* Masks for Flags field above */
  854. #define ACPI_MADT_CPEI_OVERRIDE (1)
  855. /* 9: Processor Local X2APIC (ACPI 4.0) */
  856. struct acpi_madt_local_x2apic {
  857. struct acpi_subtable_header header;
  858. u16 reserved; /* reserved - must be zero */
  859. u32 local_apic_id; /* Processor x2APIC ID */
  860. u32 lapic_flags;
  861. u32 uid; /* ACPI processor UID */
  862. };
  863. /* 10: Local X2APIC NMI (ACPI 4.0) */
  864. struct acpi_madt_local_x2apic_nmi {
  865. struct acpi_subtable_header header;
  866. u16 inti_flags;
  867. u32 uid; /* ACPI processor UID */
  868. u8 lint; /* LINTn to which NMI is connected */
  869. u8 reserved[3]; /* reserved - must be zero */
  870. };
  871. /* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 + ACPI 6.5 changes) */
  872. struct acpi_madt_generic_interrupt {
  873. struct acpi_subtable_header header;
  874. u16 reserved; /* reserved - must be zero */
  875. u32 cpu_interface_number;
  876. u32 uid;
  877. u32 flags;
  878. u32 parking_version;
  879. u32 performance_interrupt;
  880. u64 parked_address;
  881. u64 base_address;
  882. u64 gicv_base_address;
  883. u64 gich_base_address;
  884. u32 vgic_interrupt;
  885. u64 gicr_base_address;
  886. u64 arm_mpidr;
  887. u8 efficiency_class;
  888. u8 reserved2[1];
  889. u16 spe_interrupt; /* ACPI 6.3 */
  890. u16 trbe_interrupt; /* ACPI 6.5 */
  891. };
  892. /* Masks for Flags field above */
  893. /* ACPI_MADT_ENABLED (1) Processor is usable if set */
  894. #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
  895. #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
  896. #define ACPI_MADT_GICC_ONLINE_CAPABLE (1<<3) /* 03: Processor is online capable */
  897. #define ACPI_MADT_GICC_NON_COHERENT (1<<4) /* 04: GIC redistributor is not coherent */
  898. /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
  899. struct acpi_madt_generic_distributor {
  900. struct acpi_subtable_header header;
  901. u16 reserved; /* reserved - must be zero */
  902. u32 gic_id;
  903. u64 base_address;
  904. u32 global_irq_base;
  905. u8 version;
  906. u8 reserved2[3]; /* reserved - must be zero */
  907. };
  908. /* Values for Version field above */
  909. enum acpi_madt_gic_version {
  910. ACPI_MADT_GIC_VERSION_NONE = 0,
  911. ACPI_MADT_GIC_VERSION_V1 = 1,
  912. ACPI_MADT_GIC_VERSION_V2 = 2,
  913. ACPI_MADT_GIC_VERSION_V3 = 3,
  914. ACPI_MADT_GIC_VERSION_V4 = 4,
  915. ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
  916. };
  917. /* 13: Generic MSI Frame (ACPI 5.1) */
  918. struct acpi_madt_generic_msi_frame {
  919. struct acpi_subtable_header header;
  920. u16 reserved; /* reserved - must be zero */
  921. u32 msi_frame_id;
  922. u64 base_address;
  923. u32 flags;
  924. u16 spi_count;
  925. u16 spi_base;
  926. };
  927. /* Masks for Flags field above */
  928. #define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
  929. /* 14: Generic Redistributor (ACPI 5.1) */
  930. struct acpi_madt_generic_redistributor {
  931. struct acpi_subtable_header header;
  932. u8 flags;
  933. u8 reserved; /* reserved - must be zero */
  934. u64 base_address;
  935. u32 length;
  936. };
  937. #define ACPI_MADT_GICR_NON_COHERENT (1)
  938. /* 15: Generic Translator (ACPI 6.0) */
  939. struct acpi_madt_generic_translator {
  940. struct acpi_subtable_header header;
  941. u8 flags;
  942. u8 reserved; /* reserved - must be zero */
  943. u32 translation_id;
  944. u64 base_address;
  945. u32 reserved2;
  946. };
  947. #define ACPI_MADT_ITS_NON_COHERENT (1)
  948. /* 16: Multiprocessor wakeup (ACPI 6.4) */
  949. struct acpi_madt_multiproc_wakeup {
  950. struct acpi_subtable_header header;
  951. u16 version;
  952. u32 reserved; /* reserved - must be zero */
  953. u64 mailbox_address;
  954. u64 reset_vector;
  955. };
  956. /* Values for Version field above */
  957. enum acpi_madt_multiproc_wakeup_version {
  958. ACPI_MADT_MP_WAKEUP_VERSION_NONE = 0,
  959. ACPI_MADT_MP_WAKEUP_VERSION_V1 = 1,
  960. ACPI_MADT_MP_WAKEUP_VERSION_RESERVED = 2, /* 2 and greater are reserved */
  961. };
  962. #define ACPI_MADT_MP_WAKEUP_SIZE_V0 16
  963. #define ACPI_MADT_MP_WAKEUP_SIZE_V1 24
  964. #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE 2032
  965. #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE 2048
  966. struct acpi_madt_multiproc_wakeup_mailbox {
  967. u16 command;
  968. u16 reserved; /* reserved - must be zero */
  969. u32 apic_id;
  970. u64 wakeup_vector;
  971. u8 reserved_os[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE]; /* reserved for OS use */
  972. u8 reserved_firmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE]; /* reserved for firmware use */
  973. };
  974. #define ACPI_MP_WAKE_COMMAND_WAKEUP 1
  975. #define ACPI_MP_WAKE_COMMAND_TEST 2
  976. /* 17: CPU Core Interrupt Controller (ACPI 6.5) */
  977. struct acpi_madt_core_pic {
  978. struct acpi_subtable_header header;
  979. u8 version;
  980. u32 processor_id;
  981. u32 core_id;
  982. u32 flags;
  983. };
  984. /* Values for Version field above */
  985. enum acpi_madt_core_pic_version {
  986. ACPI_MADT_CORE_PIC_VERSION_NONE = 0,
  987. ACPI_MADT_CORE_PIC_VERSION_V1 = 1,
  988. ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  989. };
  990. /* 18: Legacy I/O Interrupt Controller (ACPI 6.5) */
  991. struct acpi_madt_lio_pic {
  992. struct acpi_subtable_header header;
  993. u8 version;
  994. u64 address;
  995. u16 size;
  996. u8 cascade[2];
  997. u32 cascade_map[2];
  998. };
  999. /* Values for Version field above */
  1000. enum acpi_madt_lio_pic_version {
  1001. ACPI_MADT_LIO_PIC_VERSION_NONE = 0,
  1002. ACPI_MADT_LIO_PIC_VERSION_V1 = 1,
  1003. ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1004. };
  1005. /* 19: HT Interrupt Controller (ACPI 6.5) */
  1006. struct acpi_madt_ht_pic {
  1007. struct acpi_subtable_header header;
  1008. u8 version;
  1009. u64 address;
  1010. u16 size;
  1011. u8 cascade[8];
  1012. };
  1013. /* Values for Version field above */
  1014. enum acpi_madt_ht_pic_version {
  1015. ACPI_MADT_HT_PIC_VERSION_NONE = 0,
  1016. ACPI_MADT_HT_PIC_VERSION_V1 = 1,
  1017. ACPI_MADT_HT_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1018. };
  1019. /* 20: Extend I/O Interrupt Controller (ACPI 6.5) */
  1020. struct acpi_madt_eio_pic {
  1021. struct acpi_subtable_header header;
  1022. u8 version;
  1023. u8 cascade;
  1024. u8 node;
  1025. u64 node_map;
  1026. };
  1027. /* Values for Version field above */
  1028. enum acpi_madt_eio_pic_version {
  1029. ACPI_MADT_EIO_PIC_VERSION_NONE = 0,
  1030. ACPI_MADT_EIO_PIC_VERSION_V1 = 1,
  1031. ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1032. };
  1033. /* 21: MSI Interrupt Controller (ACPI 6.5) */
  1034. struct acpi_madt_msi_pic {
  1035. struct acpi_subtable_header header;
  1036. u8 version;
  1037. u64 msg_address;
  1038. u32 start;
  1039. u32 count;
  1040. };
  1041. /* Values for Version field above */
  1042. enum acpi_madt_msi_pic_version {
  1043. ACPI_MADT_MSI_PIC_VERSION_NONE = 0,
  1044. ACPI_MADT_MSI_PIC_VERSION_V1 = 1,
  1045. ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1046. };
  1047. /* 22: Bridge I/O Interrupt Controller (ACPI 6.5) */
  1048. struct acpi_madt_bio_pic {
  1049. struct acpi_subtable_header header;
  1050. u8 version;
  1051. u64 address;
  1052. u16 size;
  1053. u16 id;
  1054. u16 gsi_base;
  1055. };
  1056. /* Values for Version field above */
  1057. enum acpi_madt_bio_pic_version {
  1058. ACPI_MADT_BIO_PIC_VERSION_NONE = 0,
  1059. ACPI_MADT_BIO_PIC_VERSION_V1 = 1,
  1060. ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1061. };
  1062. /* 23: LPC Interrupt Controller (ACPI 6.5) */
  1063. struct acpi_madt_lpc_pic {
  1064. struct acpi_subtable_header header;
  1065. u8 version;
  1066. u64 address;
  1067. u16 size;
  1068. u8 cascade;
  1069. };
  1070. /* Values for Version field above */
  1071. enum acpi_madt_lpc_pic_version {
  1072. ACPI_MADT_LPC_PIC_VERSION_NONE = 0,
  1073. ACPI_MADT_LPC_PIC_VERSION_V1 = 1,
  1074. ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1075. };
  1076. /* 24: RISC-V INTC */
  1077. struct acpi_madt_rintc {
  1078. struct acpi_subtable_header header;
  1079. u8 version;
  1080. u8 reserved;
  1081. u32 flags;
  1082. u64 hart_id;
  1083. u32 uid; /* ACPI processor UID */
  1084. u32 ext_intc_id; /* External INTC Id */
  1085. u64 imsic_addr; /* IMSIC base address */
  1086. u32 imsic_size; /* IMSIC size */
  1087. };
  1088. /* Values for RISC-V INTC Version field above */
  1089. enum acpi_madt_rintc_version {
  1090. ACPI_MADT_RINTC_VERSION_NONE = 0,
  1091. ACPI_MADT_RINTC_VERSION_V1 = 1,
  1092. ACPI_MADT_RINTC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
  1093. };
  1094. /* 25: RISC-V IMSIC */
  1095. struct acpi_madt_imsic {
  1096. struct acpi_subtable_header header;
  1097. u8 version;
  1098. u8 reserved;
  1099. u32 flags;
  1100. u16 num_ids;
  1101. u16 num_guest_ids;
  1102. u8 guest_index_bits;
  1103. u8 hart_index_bits;
  1104. u8 group_index_bits;
  1105. u8 group_index_shift;
  1106. };
  1107. /* 26: RISC-V APLIC */
  1108. struct acpi_madt_aplic {
  1109. struct acpi_subtable_header header;
  1110. u8 version;
  1111. u8 id;
  1112. u32 flags;
  1113. u8 hw_id[8];
  1114. u16 num_idcs;
  1115. u16 num_sources;
  1116. u32 gsi_base;
  1117. u64 base_addr;
  1118. u32 size;
  1119. };
  1120. /* 27: RISC-V PLIC */
  1121. struct acpi_madt_plic {
  1122. struct acpi_subtable_header header;
  1123. u8 version;
  1124. u8 id;
  1125. u8 hw_id[8];
  1126. u16 num_irqs;
  1127. u16 max_prio;
  1128. u32 flags;
  1129. u32 size;
  1130. u64 base_addr;
  1131. u32 gsi_base;
  1132. };
  1133. /* 80: OEM data */
  1134. struct acpi_madt_oem_data {
  1135. ACPI_FLEX_ARRAY(u8, oem_data);
  1136. };
  1137. /*
  1138. * Common flags fields for MADT subtables
  1139. */
  1140. /* MADT Local APIC flags */
  1141. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  1142. #define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */
  1143. /* MADT MPS INTI flags (inti_flags) */
  1144. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  1145. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  1146. /* Values for MPS INTI flags */
  1147. #define ACPI_MADT_POLARITY_CONFORMS 0
  1148. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  1149. #define ACPI_MADT_POLARITY_RESERVED 2
  1150. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  1151. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  1152. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  1153. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  1154. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  1155. /*******************************************************************************
  1156. *
  1157. * MCFG - PCI Memory Mapped Configuration table and subtable
  1158. * Version 1
  1159. *
  1160. * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
  1161. *
  1162. ******************************************************************************/
  1163. struct acpi_table_mcfg {
  1164. struct acpi_table_header header; /* Common ACPI table header */
  1165. u8 reserved[8];
  1166. };
  1167. /* Subtable */
  1168. struct acpi_mcfg_allocation {
  1169. u64 address; /* Base address, processor-relative */
  1170. u16 pci_segment; /* PCI segment group number */
  1171. u8 start_bus_number; /* Starting PCI Bus number */
  1172. u8 end_bus_number; /* Final PCI Bus number */
  1173. u32 reserved;
  1174. };
  1175. /*******************************************************************************
  1176. *
  1177. * MCHI - Management Controller Host Interface Table
  1178. * Version 1
  1179. *
  1180. * Conforms to "Management Component Transport Protocol (MCTP) Host
  1181. * Interface Specification", Revision 1.0.0a, October 13, 2009
  1182. *
  1183. ******************************************************************************/
  1184. struct acpi_table_mchi {
  1185. struct acpi_table_header header; /* Common ACPI table header */
  1186. u8 interface_type;
  1187. u8 protocol;
  1188. u64 protocol_data;
  1189. u8 interrupt_type;
  1190. u8 gpe;
  1191. u8 pci_device_flag;
  1192. u32 global_interrupt;
  1193. struct acpi_generic_address control_register;
  1194. u8 pci_segment;
  1195. u8 pci_bus;
  1196. u8 pci_device;
  1197. u8 pci_function;
  1198. };
  1199. /*******************************************************************************
  1200. *
  1201. * MPAM - Memory System Resource Partitioning and Monitoring
  1202. *
  1203. * Conforms to "ACPI for Memory System Resource Partitioning and Monitoring 2.0"
  1204. * Document number: ARM DEN 0065, December, 2022.
  1205. *
  1206. ******************************************************************************/
  1207. /* MPAM RIS locator types. Table 11, Location types */
  1208. enum acpi_mpam_locator_type {
  1209. ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE = 0,
  1210. ACPI_MPAM_LOCATION_TYPE_MEMORY = 1,
  1211. ACPI_MPAM_LOCATION_TYPE_SMMU = 2,
  1212. ACPI_MPAM_LOCATION_TYPE_MEMORY_CACHE = 3,
  1213. ACPI_MPAM_LOCATION_TYPE_ACPI_DEVICE = 4,
  1214. ACPI_MPAM_LOCATION_TYPE_INTERCONNECT = 5,
  1215. ACPI_MPAM_LOCATION_TYPE_UNKNOWN = 0xFF
  1216. };
  1217. /* MPAM Functional dependency descriptor. Table 10 */
  1218. struct acpi_mpam_func_deps {
  1219. u32 producer;
  1220. u32 reserved;
  1221. };
  1222. /* MPAM Processor cache locator descriptor. Table 13 */
  1223. struct acpi_mpam_resource_cache_locator {
  1224. u64 cache_reference;
  1225. u32 reserved;
  1226. };
  1227. /* MPAM Memory locator descriptor. Table 14 */
  1228. struct acpi_mpam_resource_memory_locator {
  1229. u64 proximity_domain;
  1230. u32 reserved;
  1231. };
  1232. /* MPAM SMMU locator descriptor. Table 15 */
  1233. struct acpi_mpam_resource_smmu_locator {
  1234. u64 smmu_interface;
  1235. u32 reserved;
  1236. };
  1237. /* MPAM Memory-side cache locator descriptor. Table 16 */
  1238. struct acpi_mpam_resource_memcache_locator {
  1239. u8 reserved[7];
  1240. u8 level;
  1241. u32 reference;
  1242. };
  1243. /* MPAM ACPI device locator descriptor. Table 17 */
  1244. struct acpi_mpam_resource_acpi_locator {
  1245. u64 acpi_hw_id;
  1246. u32 acpi_unique_id;
  1247. };
  1248. /* MPAM Interconnect locator descriptor. Table 18 */
  1249. struct acpi_mpam_resource_interconnect_locator {
  1250. u64 inter_connect_desc_tbl_off;
  1251. u32 reserved;
  1252. };
  1253. /* MPAM Locator structure. Table 12 */
  1254. struct acpi_mpam_resource_generic_locator {
  1255. u64 descriptor1;
  1256. u32 descriptor2;
  1257. };
  1258. union acpi_mpam_resource_locator {
  1259. struct acpi_mpam_resource_cache_locator cache_locator;
  1260. struct acpi_mpam_resource_memory_locator memory_locator;
  1261. struct acpi_mpam_resource_smmu_locator smmu_locator;
  1262. struct acpi_mpam_resource_memcache_locator mem_cache_locator;
  1263. struct acpi_mpam_resource_acpi_locator acpi_locator;
  1264. struct acpi_mpam_resource_interconnect_locator interconnect_ifc_locator;
  1265. struct acpi_mpam_resource_generic_locator generic_locator;
  1266. };
  1267. /* Memory System Component Resource Node Structure Table 9 */
  1268. struct acpi_mpam_resource_node {
  1269. u32 identifier;
  1270. u8 ris_index;
  1271. u16 reserved1;
  1272. u8 locator_type;
  1273. union acpi_mpam_resource_locator locator;
  1274. u32 num_functional_deps;
  1275. };
  1276. /* Memory System Component (MSC) Node Structure. Table 4 */
  1277. struct acpi_mpam_msc_node {
  1278. u16 length;
  1279. u8 interface_type;
  1280. u8 reserved;
  1281. u32 identifier;
  1282. u64 base_address;
  1283. u32 mmio_size;
  1284. u32 overflow_interrupt;
  1285. u32 overflow_interrupt_flags;
  1286. u32 reserved1;
  1287. u32 overflow_interrupt_affinity;
  1288. u32 error_interrupt;
  1289. u32 error_interrupt_flags;
  1290. u32 reserved2;
  1291. u32 error_interrupt_affinity;
  1292. u32 max_nrdy_usec;
  1293. u64 hardware_id_linked_device;
  1294. u32 instance_id_linked_device;
  1295. u32 num_resource_nodes;
  1296. };
  1297. struct acpi_table_mpam {
  1298. struct acpi_table_header header; /* Common ACPI table header */
  1299. };
  1300. /*******************************************************************************
  1301. *
  1302. * MPST - Memory Power State Table (ACPI 5.0)
  1303. * Version 1
  1304. *
  1305. ******************************************************************************/
  1306. #define ACPI_MPST_CHANNEL_INFO \
  1307. u8 channel_id; \
  1308. u8 reserved1[3]; \
  1309. u16 power_node_count; \
  1310. u16 reserved2;
  1311. /* Main table */
  1312. struct acpi_table_mpst {
  1313. struct acpi_table_header header; /* Common ACPI table header */
  1314. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  1315. };
  1316. /* Memory Platform Communication Channel Info */
  1317. struct acpi_mpst_channel {
  1318. ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
  1319. };
  1320. /* Memory Power Node Structure */
  1321. struct acpi_mpst_power_node {
  1322. u8 flags;
  1323. u8 reserved1;
  1324. u16 node_id;
  1325. u32 length;
  1326. u64 range_address;
  1327. u64 range_length;
  1328. u32 num_power_states;
  1329. u32 num_physical_components;
  1330. };
  1331. /* Values for Flags field above */
  1332. #define ACPI_MPST_ENABLED 1
  1333. #define ACPI_MPST_POWER_MANAGED 2
  1334. #define ACPI_MPST_HOT_PLUG_CAPABLE 4
  1335. /* Memory Power State Structure (follows POWER_NODE above) */
  1336. struct acpi_mpst_power_state {
  1337. u8 power_state;
  1338. u8 info_index;
  1339. };
  1340. /* Physical Component ID Structure (follows POWER_STATE above) */
  1341. struct acpi_mpst_component {
  1342. u16 component_id;
  1343. };
  1344. /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
  1345. struct acpi_mpst_data_hdr {
  1346. u16 characteristics_count;
  1347. u16 reserved;
  1348. };
  1349. struct acpi_mpst_power_data {
  1350. u8 structure_id;
  1351. u8 flags;
  1352. u16 reserved1;
  1353. u32 average_power;
  1354. u32 power_saving;
  1355. u64 exit_latency;
  1356. u64 reserved2;
  1357. };
  1358. /* Values for Flags field above */
  1359. #define ACPI_MPST_PRESERVE 1
  1360. #define ACPI_MPST_AUTOENTRY 2
  1361. #define ACPI_MPST_AUTOEXIT 4
  1362. /* Shared Memory Region (not part of an ACPI table) */
  1363. struct acpi_mpst_shared {
  1364. u32 signature;
  1365. u16 pcc_command;
  1366. u16 pcc_status;
  1367. u32 command_register;
  1368. u32 status_register;
  1369. u32 power_state_id;
  1370. u32 power_node_id;
  1371. u64 energy_consumed;
  1372. u64 average_power;
  1373. };
  1374. /*******************************************************************************
  1375. *
  1376. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  1377. * Version 1
  1378. *
  1379. ******************************************************************************/
  1380. struct acpi_table_msct {
  1381. struct acpi_table_header header; /* Common ACPI table header */
  1382. u32 proximity_offset; /* Location of proximity info struct(s) */
  1383. u32 max_proximity_domains; /* Max number of proximity domains */
  1384. u32 max_clock_domains; /* Max number of clock domains */
  1385. u64 max_address; /* Max physical address in system */
  1386. };
  1387. /* subtable - Maximum Proximity Domain Information. Version 1 */
  1388. struct acpi_msct_proximity {
  1389. u8 revision;
  1390. u8 length;
  1391. u32 range_start; /* Start of domain range */
  1392. u32 range_end; /* End of domain range */
  1393. u32 processor_capacity;
  1394. u64 memory_capacity; /* In bytes */
  1395. };
  1396. /*******************************************************************************
  1397. *
  1398. * MSDM - Microsoft Data Management table
  1399. *
  1400. * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
  1401. * November 29, 2011. Copyright 2011 Microsoft
  1402. *
  1403. ******************************************************************************/
  1404. /* Basic MSDM table is only the common ACPI header */
  1405. struct acpi_table_msdm {
  1406. struct acpi_table_header header; /* Common ACPI table header */
  1407. };
  1408. /*******************************************************************************
  1409. *
  1410. * NFIT - NVDIMM Interface Table (ACPI 6.0+)
  1411. * Version 1
  1412. *
  1413. ******************************************************************************/
  1414. struct acpi_table_nfit {
  1415. struct acpi_table_header header; /* Common ACPI table header */
  1416. u32 reserved; /* Reserved, must be zero */
  1417. };
  1418. /* Subtable header for NFIT */
  1419. struct acpi_nfit_header {
  1420. u16 type;
  1421. u16 length;
  1422. };
  1423. /* Values for subtable type in struct acpi_nfit_header */
  1424. enum acpi_nfit_type {
  1425. ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
  1426. ACPI_NFIT_TYPE_MEMORY_MAP = 1,
  1427. ACPI_NFIT_TYPE_INTERLEAVE = 2,
  1428. ACPI_NFIT_TYPE_SMBIOS = 3,
  1429. ACPI_NFIT_TYPE_CONTROL_REGION = 4,
  1430. ACPI_NFIT_TYPE_DATA_REGION = 5,
  1431. ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
  1432. ACPI_NFIT_TYPE_CAPABILITIES = 7,
  1433. ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */
  1434. };
  1435. /*
  1436. * NFIT Subtables
  1437. */
  1438. /* 0: System Physical Address Range Structure */
  1439. struct acpi_nfit_system_address {
  1440. struct acpi_nfit_header header;
  1441. u16 range_index;
  1442. u16 flags;
  1443. u32 reserved; /* Reserved, must be zero */
  1444. u32 proximity_domain;
  1445. u8 range_guid[16];
  1446. u64 address;
  1447. u64 length;
  1448. u64 memory_mapping;
  1449. u64 location_cookie; /* ACPI 6.4 */
  1450. };
  1451. /* Flags */
  1452. #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
  1453. #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
  1454. #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2) /* 02: SPA location cookie valid (ACPI 6.4) */
  1455. /* Range Type GUIDs appear in the include/acuuid.h file */
  1456. /* 1: Memory Device to System Address Range Map Structure */
  1457. struct acpi_nfit_memory_map {
  1458. struct acpi_nfit_header header;
  1459. u32 device_handle;
  1460. u16 physical_id;
  1461. u16 region_id;
  1462. u16 range_index;
  1463. u16 region_index;
  1464. u64 region_size;
  1465. u64 region_offset;
  1466. u64 address;
  1467. u16 interleave_index;
  1468. u16 interleave_ways;
  1469. u16 flags;
  1470. u16 reserved; /* Reserved, must be zero */
  1471. };
  1472. /* Flags */
  1473. #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
  1474. #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
  1475. #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
  1476. #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
  1477. #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
  1478. #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
  1479. #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
  1480. /* 2: Interleave Structure */
  1481. struct acpi_nfit_interleave {
  1482. struct acpi_nfit_header header;
  1483. u16 interleave_index;
  1484. u16 reserved; /* Reserved, must be zero */
  1485. u32 line_count;
  1486. u32 line_size;
  1487. u32 line_offset[]; /* Variable length */
  1488. };
  1489. /* 3: SMBIOS Management Information Structure */
  1490. struct acpi_nfit_smbios {
  1491. struct acpi_nfit_header header;
  1492. u32 reserved; /* Reserved, must be zero */
  1493. u8 data[]; /* Variable length */
  1494. };
  1495. /* 4: NVDIMM Control Region Structure */
  1496. struct acpi_nfit_control_region {
  1497. struct acpi_nfit_header header;
  1498. u16 region_index;
  1499. u16 vendor_id;
  1500. u16 device_id;
  1501. u16 revision_id;
  1502. u16 subsystem_vendor_id;
  1503. u16 subsystem_device_id;
  1504. u16 subsystem_revision_id;
  1505. u8 valid_fields;
  1506. u8 manufacturing_location;
  1507. u16 manufacturing_date;
  1508. u8 reserved[2]; /* Reserved, must be zero */
  1509. u32 serial_number;
  1510. u16 code;
  1511. u16 windows;
  1512. u64 window_size;
  1513. u64 command_offset;
  1514. u64 command_size;
  1515. u64 status_offset;
  1516. u64 status_size;
  1517. u16 flags;
  1518. u8 reserved1[6]; /* Reserved, must be zero */
  1519. };
  1520. /* Flags */
  1521. #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
  1522. /* valid_fields bits */
  1523. #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
  1524. /* 5: NVDIMM Block Data Window Region Structure */
  1525. struct acpi_nfit_data_region {
  1526. struct acpi_nfit_header header;
  1527. u16 region_index;
  1528. u16 windows;
  1529. u64 offset;
  1530. u64 size;
  1531. u64 capacity;
  1532. u64 start_address;
  1533. };
  1534. /* 6: Flush Hint Address Structure */
  1535. struct acpi_nfit_flush_address {
  1536. struct acpi_nfit_header header;
  1537. u32 device_handle;
  1538. u16 hint_count;
  1539. u8 reserved[6]; /* Reserved, must be zero */
  1540. u64 hint_address[]; /* Variable length */
  1541. };
  1542. /* 7: Platform Capabilities Structure */
  1543. struct acpi_nfit_capabilities {
  1544. struct acpi_nfit_header header;
  1545. u8 highest_capability;
  1546. u8 reserved[3]; /* Reserved, must be zero */
  1547. u32 capabilities;
  1548. u32 reserved2;
  1549. };
  1550. /* Capabilities Flags */
  1551. #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */
  1552. #define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */
  1553. #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */
  1554. /*
  1555. * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
  1556. */
  1557. struct nfit_device_handle {
  1558. u32 handle;
  1559. };
  1560. /* Device handle construction and extraction macros */
  1561. #define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F
  1562. #define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0
  1563. #define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00
  1564. #define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000
  1565. #define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000
  1566. #define ACPI_NFIT_DIMM_NUMBER_OFFSET 0
  1567. #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4
  1568. #define ACPI_NFIT_MEMORY_ID_OFFSET 8
  1569. #define ACPI_NFIT_SOCKET_ID_OFFSET 12
  1570. #define ACPI_NFIT_NODE_ID_OFFSET 16
  1571. /* Macro to construct a NFIT/NVDIMM device handle */
  1572. #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
  1573. ((dimm) | \
  1574. ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \
  1575. ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \
  1576. ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \
  1577. ((node) << ACPI_NFIT_NODE_ID_OFFSET))
  1578. /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
  1579. #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
  1580. ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
  1581. #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
  1582. (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
  1583. #define ACPI_NFIT_GET_MEMORY_ID(handle) \
  1584. (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET)
  1585. #define ACPI_NFIT_GET_SOCKET_ID(handle) \
  1586. (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET)
  1587. #define ACPI_NFIT_GET_NODE_ID(handle) \
  1588. (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET)
  1589. /*******************************************************************************
  1590. *
  1591. * NHLT - Non HDAudio Link Table
  1592. * Version 1
  1593. *
  1594. ******************************************************************************/
  1595. struct acpi_table_nhlt {
  1596. struct acpi_table_header header; /* Common ACPI table header */
  1597. u8 endpoints_count;
  1598. /*
  1599. * struct acpi_nhlt_endpoint endpoints[];
  1600. * struct acpi_nhlt_config oed_config;
  1601. */
  1602. };
  1603. struct acpi_nhlt_endpoint {
  1604. u32 length;
  1605. u8 link_type;
  1606. u8 instance_id;
  1607. u16 vendor_id;
  1608. u16 device_id;
  1609. u16 revision_id;
  1610. u32 subsystem_id;
  1611. u8 device_type;
  1612. u8 direction;
  1613. u8 virtual_bus_id;
  1614. /*
  1615. * struct acpi_nhlt_config device_config;
  1616. * struct acpi_nhlt_formats_config formats_config;
  1617. * struct acpi_nhlt_devices_info devices_info;
  1618. */
  1619. };
  1620. /*
  1621. * Values for link_type field above
  1622. *
  1623. * Only types PDM and SSP are used
  1624. */
  1625. #define ACPI_NHLT_LINKTYPE_HDA 0
  1626. #define ACPI_NHLT_LINKTYPE_DSP 1
  1627. #define ACPI_NHLT_LINKTYPE_PDM 2
  1628. #define ACPI_NHLT_LINKTYPE_SSP 3
  1629. #define ACPI_NHLT_LINKTYPE_SLIMBUS 4
  1630. #define ACPI_NHLT_LINKTYPE_SDW 5
  1631. #define ACPI_NHLT_LINKTYPE_UAOL 6
  1632. /* Values for device_id field above */
  1633. #define ACPI_NHLT_DEVICEID_DMIC 0xAE20
  1634. #define ACPI_NHLT_DEVICEID_BT 0xAE30
  1635. #define ACPI_NHLT_DEVICEID_I2S 0xAE34
  1636. /* Values for device_type field above */
  1637. /*
  1638. * Device types unique to endpoint of link_type=PDM
  1639. *
  1640. * Type PDM used for all SKL+ platforms
  1641. */
  1642. #define ACPI_NHLT_DEVICETYPE_PDM 0
  1643. #define ACPI_NHLT_DEVICETYPE_PDM_SKL 1
  1644. /* Device types unique to endpoint of link_type=SSP */
  1645. #define ACPI_NHLT_DEVICETYPE_BT 0
  1646. #define ACPI_NHLT_DEVICETYPE_FM 1
  1647. #define ACPI_NHLT_DEVICETYPE_MODEM 2
  1648. #define ACPI_NHLT_DEVICETYPE_CODEC 4
  1649. /* Values for Direction field above */
  1650. #define ACPI_NHLT_DIR_RENDER 0
  1651. #define ACPI_NHLT_DIR_CAPTURE 1
  1652. struct acpi_nhlt_config {
  1653. u32 capabilities_size;
  1654. u8 capabilities[];
  1655. };
  1656. struct acpi_nhlt_gendevice_config {
  1657. u8 virtual_slot;
  1658. u8 config_type;
  1659. };
  1660. /* Values for config_type field above */
  1661. #define ACPI_NHLT_CONFIGTYPE_GENERIC 0
  1662. #define ACPI_NHLT_CONFIGTYPE_MICARRAY 1
  1663. struct acpi_nhlt_micdevice_config {
  1664. u8 virtual_slot;
  1665. u8 config_type;
  1666. u8 array_type;
  1667. };
  1668. /* Values for array_type field above */
  1669. #define ACPI_NHLT_ARRAYTYPE_LINEAR2_SMALL 0xA
  1670. #define ACPI_NHLT_ARRAYTYPE_LINEAR2_BIG 0xB
  1671. #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO1 0xC
  1672. #define ACPI_NHLT_ARRAYTYPE_PLANAR4_LSHAPED 0xD
  1673. #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO2 0xE
  1674. #define ACPI_NHLT_ARRAYTYPE_VENDOR 0xF
  1675. struct acpi_nhlt_vendor_mic_config {
  1676. u8 type;
  1677. u8 panel;
  1678. u16 speaker_position_distance; /* mm */
  1679. u16 horizontal_offset; /* mm */
  1680. u16 vertical_offset; /* mm */
  1681. u8 frequency_low_band; /* 5*Hz */
  1682. u8 frequency_high_band; /* 500*Hz */
  1683. u16 direction_angle; /* -180 - +180 */
  1684. u16 elevation_angle; /* -180 - +180 */
  1685. u16 work_vertical_angle_begin; /* -180 - +180 with 2 deg step */
  1686. u16 work_vertical_angle_end; /* -180 - +180 with 2 deg step */
  1687. u16 work_horizontal_angle_begin; /* -180 - +180 with 2 deg step */
  1688. u16 work_horizontal_angle_end; /* -180 - +180 with 2 deg step */
  1689. };
  1690. /* Values for Type field above */
  1691. #define ACPI_NHLT_MICTYPE_OMNIDIRECTIONAL 0
  1692. #define ACPI_NHLT_MICTYPE_SUBCARDIOID 1
  1693. #define ACPI_NHLT_MICTYPE_CARDIOID 2
  1694. #define ACPI_NHLT_MICTYPE_SUPERCARDIOID 3
  1695. #define ACPI_NHLT_MICTYPE_HYPERCARDIOID 4
  1696. #define ACPI_NHLT_MICTYPE_8SHAPED 5
  1697. #define ACPI_NHLT_MICTYPE_RESERVED 6
  1698. #define ACPI_NHLT_MICTYPE_VENDORDEFINED 7
  1699. /* Values for Panel field above */
  1700. #define ACPI_NHLT_MICLOCATION_TOP 0
  1701. #define ACPI_NHLT_MICLOCATION_BOTTOM 1
  1702. #define ACPI_NHLT_MICLOCATION_LEFT 2
  1703. #define ACPI_NHLT_MICLOCATION_RIGHT 3
  1704. #define ACPI_NHLT_MICLOCATION_FRONT 4
  1705. #define ACPI_NHLT_MICLOCATION_REAR 5
  1706. struct acpi_nhlt_vendor_micdevice_config {
  1707. u8 virtual_slot;
  1708. u8 config_type;
  1709. u8 array_type;
  1710. u8 mics_count;
  1711. struct acpi_nhlt_vendor_mic_config mics[];
  1712. };
  1713. union acpi_nhlt_device_config {
  1714. u8 virtual_slot;
  1715. struct acpi_nhlt_gendevice_config gen;
  1716. struct acpi_nhlt_micdevice_config mic;
  1717. struct acpi_nhlt_vendor_micdevice_config vendor_mic;
  1718. };
  1719. /* Inherited from Microsoft's WAVEFORMATEXTENSIBLE. */
  1720. struct acpi_nhlt_wave_formatext {
  1721. u16 format_tag;
  1722. u16 channel_count;
  1723. u32 samples_per_sec;
  1724. u32 avg_bytes_per_sec;
  1725. u16 block_align;
  1726. u16 bits_per_sample;
  1727. u16 extra_format_size;
  1728. u16 valid_bits_per_sample;
  1729. u32 channel_mask;
  1730. u8 subformat[16];
  1731. };
  1732. struct acpi_nhlt_format_config {
  1733. struct acpi_nhlt_wave_formatext format;
  1734. struct acpi_nhlt_config config;
  1735. };
  1736. struct acpi_nhlt_formats_config {
  1737. u8 formats_count;
  1738. struct acpi_nhlt_format_config formats[];
  1739. };
  1740. struct acpi_nhlt_device_info {
  1741. u8 id[16];
  1742. u8 instance_id;
  1743. u8 port_id;
  1744. };
  1745. struct acpi_nhlt_devices_info {
  1746. u8 devices_count;
  1747. struct acpi_nhlt_device_info devices[];
  1748. };
  1749. /*******************************************************************************
  1750. *
  1751. * PCCT - Platform Communications Channel Table (ACPI 5.0)
  1752. * Version 2 (ACPI 6.2)
  1753. *
  1754. ******************************************************************************/
  1755. struct acpi_table_pcct {
  1756. struct acpi_table_header header; /* Common ACPI table header */
  1757. u32 flags;
  1758. u64 reserved;
  1759. };
  1760. /* Values for Flags field above */
  1761. #define ACPI_PCCT_DOORBELL 1
  1762. /* Values for subtable type in struct acpi_subtable_header */
  1763. enum acpi_pcct_type {
  1764. ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
  1765. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
  1766. ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
  1767. ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
  1768. ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
  1769. ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5, /* ACPI 6.4 */
  1770. ACPI_PCCT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
  1771. };
  1772. /*
  1773. * PCCT Subtables, correspond to Type in struct acpi_subtable_header
  1774. */
  1775. /* 0: Generic Communications Subspace */
  1776. struct acpi_pcct_subspace {
  1777. struct acpi_subtable_header header;
  1778. u8 reserved[6];
  1779. u64 base_address;
  1780. u64 length;
  1781. struct acpi_generic_address doorbell_register;
  1782. u64 preserve_mask;
  1783. u64 write_mask;
  1784. u32 latency;
  1785. u32 max_access_rate;
  1786. u16 min_turnaround_time;
  1787. };
  1788. /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
  1789. struct acpi_pcct_hw_reduced {
  1790. struct acpi_subtable_header header;
  1791. u32 platform_interrupt;
  1792. u8 flags;
  1793. u8 reserved;
  1794. u64 base_address;
  1795. u64 length;
  1796. struct acpi_generic_address doorbell_register;
  1797. u64 preserve_mask;
  1798. u64 write_mask;
  1799. u32 latency;
  1800. u32 max_access_rate;
  1801. u16 min_turnaround_time;
  1802. };
  1803. /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
  1804. struct acpi_pcct_hw_reduced_type2 {
  1805. struct acpi_subtable_header header;
  1806. u32 platform_interrupt;
  1807. u8 flags;
  1808. u8 reserved;
  1809. u64 base_address;
  1810. u64 length;
  1811. struct acpi_generic_address doorbell_register;
  1812. u64 preserve_mask;
  1813. u64 write_mask;
  1814. u32 latency;
  1815. u32 max_access_rate;
  1816. u16 min_turnaround_time;
  1817. struct acpi_generic_address platform_ack_register;
  1818. u64 ack_preserve_mask;
  1819. u64 ack_write_mask;
  1820. };
  1821. /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
  1822. struct acpi_pcct_ext_pcc_master {
  1823. struct acpi_subtable_header header;
  1824. u32 platform_interrupt;
  1825. u8 flags;
  1826. u8 reserved1;
  1827. u64 base_address;
  1828. u32 length;
  1829. struct acpi_generic_address doorbell_register;
  1830. u64 preserve_mask;
  1831. u64 write_mask;
  1832. u32 latency;
  1833. u32 max_access_rate;
  1834. u32 min_turnaround_time;
  1835. struct acpi_generic_address platform_ack_register;
  1836. u64 ack_preserve_mask;
  1837. u64 ack_set_mask;
  1838. u64 reserved2;
  1839. struct acpi_generic_address cmd_complete_register;
  1840. u64 cmd_complete_mask;
  1841. struct acpi_generic_address cmd_update_register;
  1842. u64 cmd_update_preserve_mask;
  1843. u64 cmd_update_set_mask;
  1844. struct acpi_generic_address error_status_register;
  1845. u64 error_status_mask;
  1846. };
  1847. /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
  1848. struct acpi_pcct_ext_pcc_slave {
  1849. struct acpi_subtable_header header;
  1850. u32 platform_interrupt;
  1851. u8 flags;
  1852. u8 reserved1;
  1853. u64 base_address;
  1854. u32 length;
  1855. struct acpi_generic_address doorbell_register;
  1856. u64 preserve_mask;
  1857. u64 write_mask;
  1858. u32 latency;
  1859. u32 max_access_rate;
  1860. u32 min_turnaround_time;
  1861. struct acpi_generic_address platform_ack_register;
  1862. u64 ack_preserve_mask;
  1863. u64 ack_set_mask;
  1864. u64 reserved2;
  1865. struct acpi_generic_address cmd_complete_register;
  1866. u64 cmd_complete_mask;
  1867. struct acpi_generic_address cmd_update_register;
  1868. u64 cmd_update_preserve_mask;
  1869. u64 cmd_update_set_mask;
  1870. struct acpi_generic_address error_status_register;
  1871. u64 error_status_mask;
  1872. };
  1873. /* 5: HW Registers based Communications Subspace */
  1874. struct acpi_pcct_hw_reg {
  1875. struct acpi_subtable_header header;
  1876. u16 version;
  1877. u64 base_address;
  1878. u64 length;
  1879. struct acpi_generic_address doorbell_register;
  1880. u64 doorbell_preserve;
  1881. u64 doorbell_write;
  1882. struct acpi_generic_address cmd_complete_register;
  1883. u64 cmd_complete_mask;
  1884. struct acpi_generic_address error_status_register;
  1885. u64 error_status_mask;
  1886. u32 nominal_latency;
  1887. u32 min_turnaround_time;
  1888. };
  1889. /* Values for doorbell flags above */
  1890. #define ACPI_PCCT_INTERRUPT_POLARITY (1)
  1891. #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
  1892. /*
  1893. * PCC memory structures (not part of the ACPI table)
  1894. */
  1895. /* Shared Memory Region */
  1896. struct acpi_pcct_shared_memory {
  1897. u32 signature;
  1898. u16 command;
  1899. u16 status;
  1900. };
  1901. /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
  1902. struct acpi_pcct_ext_pcc_shared_memory {
  1903. u32 signature;
  1904. u32 flags;
  1905. u32 length;
  1906. u32 command;
  1907. };
  1908. /*******************************************************************************
  1909. *
  1910. * PDTT - Platform Debug Trigger Table (ACPI 6.2)
  1911. * Version 0
  1912. *
  1913. ******************************************************************************/
  1914. struct acpi_table_pdtt {
  1915. struct acpi_table_header header; /* Common ACPI table header */
  1916. u8 trigger_count;
  1917. u8 reserved[3];
  1918. u32 array_offset;
  1919. };
  1920. /*
  1921. * PDTT Communication Channel Identifier Structure.
  1922. * The number of these structures is defined by trigger_count above,
  1923. * starting at array_offset.
  1924. */
  1925. struct acpi_pdtt_channel {
  1926. u8 subchannel_id;
  1927. u8 flags;
  1928. };
  1929. /* Flags for above */
  1930. #define ACPI_PDTT_RUNTIME_TRIGGER (1)
  1931. #define ACPI_PDTT_WAIT_COMPLETION (1<<1)
  1932. #define ACPI_PDTT_TRIGGER_ORDER (1<<2)
  1933. /*******************************************************************************
  1934. *
  1935. * PHAT - Platform Health Assessment Table (ACPI 6.4)
  1936. * Version 1
  1937. *
  1938. ******************************************************************************/
  1939. struct acpi_table_phat {
  1940. struct acpi_table_header header; /* Common ACPI table header */
  1941. };
  1942. /* Common header for PHAT subtables that follow main table */
  1943. struct acpi_phat_header {
  1944. u16 type;
  1945. u16 length;
  1946. u8 revision;
  1947. };
  1948. /* Values for Type field above */
  1949. #define ACPI_PHAT_TYPE_FW_VERSION_DATA 0
  1950. #define ACPI_PHAT_TYPE_FW_HEALTH_DATA 1
  1951. #define ACPI_PHAT_TYPE_RESERVED 2 /* 0x02-0xFFFF are reserved */
  1952. /*
  1953. * PHAT subtables, correspond to Type in struct acpi_phat_header
  1954. */
  1955. /* 0: Firmware Version Data Record */
  1956. struct acpi_phat_version_data {
  1957. struct acpi_phat_header header;
  1958. u8 reserved[3];
  1959. u32 element_count;
  1960. };
  1961. struct acpi_phat_version_element {
  1962. u8 guid[16];
  1963. u64 version_value;
  1964. u32 producer_id;
  1965. };
  1966. /* 1: Firmware Health Data Record */
  1967. struct acpi_phat_health_data {
  1968. struct acpi_phat_header header;
  1969. u8 reserved[2];
  1970. u8 health;
  1971. u8 device_guid[16];
  1972. u32 device_specific_offset; /* Zero if no Device-specific data */
  1973. };
  1974. /* Values for Health field above */
  1975. #define ACPI_PHAT_ERRORS_FOUND 0
  1976. #define ACPI_PHAT_NO_ERRORS 1
  1977. #define ACPI_PHAT_UNKNOWN_ERRORS 2
  1978. #define ACPI_PHAT_ADVISORY 3
  1979. /*******************************************************************************
  1980. *
  1981. * PMTT - Platform Memory Topology Table (ACPI 5.0)
  1982. * Version 1
  1983. *
  1984. ******************************************************************************/
  1985. struct acpi_table_pmtt {
  1986. struct acpi_table_header header; /* Common ACPI table header */
  1987. u32 memory_device_count;
  1988. /*
  1989. * Immediately followed by:
  1990. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  1991. */
  1992. };
  1993. /* Common header for PMTT subtables that follow main table */
  1994. struct acpi_pmtt_header {
  1995. u8 type;
  1996. u8 reserved1;
  1997. u16 length;
  1998. u16 flags;
  1999. u16 reserved2;
  2000. u32 memory_device_count; /* Zero means no memory device structs follow */
  2001. /*
  2002. * Immediately followed by:
  2003. * u8 type_specific_data[]
  2004. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  2005. */
  2006. };
  2007. /* Values for Type field above */
  2008. #define ACPI_PMTT_TYPE_SOCKET 0
  2009. #define ACPI_PMTT_TYPE_CONTROLLER 1
  2010. #define ACPI_PMTT_TYPE_DIMM 2
  2011. #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFE are reserved */
  2012. #define ACPI_PMTT_TYPE_VENDOR 0xFF
  2013. /* Values for Flags field above */
  2014. #define ACPI_PMTT_TOP_LEVEL 0x0001
  2015. #define ACPI_PMTT_PHYSICAL 0x0002
  2016. #define ACPI_PMTT_MEMORY_TYPE 0x000C
  2017. /*
  2018. * PMTT subtables, correspond to Type in struct acpi_pmtt_header
  2019. */
  2020. /* 0: Socket Structure */
  2021. struct acpi_pmtt_socket {
  2022. struct acpi_pmtt_header header;
  2023. u16 socket_id;
  2024. u16 reserved;
  2025. };
  2026. /*
  2027. * Immediately followed by:
  2028. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  2029. */
  2030. /* 1: Memory Controller subtable */
  2031. struct acpi_pmtt_controller {
  2032. struct acpi_pmtt_header header;
  2033. u16 controller_id;
  2034. u16 reserved;
  2035. };
  2036. /*
  2037. * Immediately followed by:
  2038. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  2039. */
  2040. /* 2: Physical Component Identifier (DIMM) */
  2041. struct acpi_pmtt_physical_component {
  2042. struct acpi_pmtt_header header;
  2043. u32 bios_handle;
  2044. };
  2045. /* 0xFF: Vendor Specific Data */
  2046. struct acpi_pmtt_vendor_specific {
  2047. struct acpi_pmtt_header header;
  2048. u8 type_uuid[16];
  2049. u8 specific[];
  2050. /*
  2051. * Immediately followed by:
  2052. * u8 vendor_specific_data[];
  2053. * MEMORY_DEVICE memory_device_struct[memory_device_count];
  2054. */
  2055. };
  2056. /*******************************************************************************
  2057. *
  2058. * PPTT - Processor Properties Topology Table (ACPI 6.2)
  2059. * Version 1
  2060. *
  2061. ******************************************************************************/
  2062. struct acpi_table_pptt {
  2063. struct acpi_table_header header; /* Common ACPI table header */
  2064. };
  2065. /* Values for Type field above */
  2066. enum acpi_pptt_type {
  2067. ACPI_PPTT_TYPE_PROCESSOR = 0,
  2068. ACPI_PPTT_TYPE_CACHE = 1,
  2069. ACPI_PPTT_TYPE_ID = 2,
  2070. ACPI_PPTT_TYPE_RESERVED = 3
  2071. };
  2072. /* 0: Processor Hierarchy Node Structure */
  2073. struct acpi_pptt_processor {
  2074. struct acpi_subtable_header header;
  2075. u16 reserved;
  2076. u32 flags;
  2077. u32 parent;
  2078. u32 acpi_processor_id;
  2079. u32 number_of_priv_resources;
  2080. };
  2081. /* Flags */
  2082. #define ACPI_PPTT_PHYSICAL_PACKAGE (1)
  2083. #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (1<<1)
  2084. #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD (1<<2) /* ACPI 6.3 */
  2085. #define ACPI_PPTT_ACPI_LEAF_NODE (1<<3) /* ACPI 6.3 */
  2086. #define ACPI_PPTT_ACPI_IDENTICAL (1<<4) /* ACPI 6.3 */
  2087. /* 1: Cache Type Structure */
  2088. struct acpi_pptt_cache {
  2089. struct acpi_subtable_header header;
  2090. u16 reserved;
  2091. u32 flags;
  2092. u32 next_level_of_cache;
  2093. u32 size;
  2094. u32 number_of_sets;
  2095. u8 associativity;
  2096. u8 attributes;
  2097. u16 line_size;
  2098. };
  2099. /* 1: Cache Type Structure for PPTT version 3 */
  2100. struct acpi_pptt_cache_v1 {
  2101. u32 cache_id;
  2102. };
  2103. /* Flags */
  2104. #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
  2105. #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
  2106. #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
  2107. #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
  2108. #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
  2109. #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
  2110. #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
  2111. #define ACPI_PPTT_CACHE_ID_VALID (1<<7) /* Cache ID valid */
  2112. /* Masks for Attributes */
  2113. #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
  2114. #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
  2115. #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
  2116. /* Attributes describing cache */
  2117. #define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */
  2118. #define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */
  2119. #define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */
  2120. #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */
  2121. #define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */
  2122. #define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */
  2123. #define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */
  2124. #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */
  2125. #define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */
  2126. #define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */
  2127. /* 2: ID Structure */
  2128. struct acpi_pptt_id {
  2129. struct acpi_subtable_header header;
  2130. u16 reserved;
  2131. u32 vendor_id;
  2132. u64 level1_id;
  2133. u64 level2_id;
  2134. u16 major_rev;
  2135. u16 minor_rev;
  2136. u16 spin_rev;
  2137. };
  2138. /*******************************************************************************
  2139. *
  2140. * PRMT - Platform Runtime Mechanism Table
  2141. * Version 1
  2142. *
  2143. ******************************************************************************/
  2144. struct acpi_table_prmt {
  2145. struct acpi_table_header header; /* Common ACPI table header */
  2146. };
  2147. struct acpi_table_prmt_header {
  2148. u8 platform_guid[16];
  2149. u32 module_info_offset;
  2150. u32 module_info_count;
  2151. };
  2152. struct acpi_prmt_module_header {
  2153. u16 revision;
  2154. u16 length;
  2155. };
  2156. struct acpi_prmt_module_info {
  2157. u16 revision;
  2158. u16 length;
  2159. u8 module_guid[16];
  2160. u16 major_rev;
  2161. u16 minor_rev;
  2162. u16 handler_info_count;
  2163. u32 handler_info_offset;
  2164. u64 mmio_list_pointer;
  2165. };
  2166. struct acpi_prmt_handler_info {
  2167. u16 revision;
  2168. u16 length;
  2169. u8 handler_guid[16];
  2170. u64 handler_address;
  2171. u64 static_data_buffer_address;
  2172. u64 acpi_param_buffer_address;
  2173. };
  2174. /*******************************************************************************
  2175. *
  2176. * RASF - RAS Feature Table (ACPI 5.0)
  2177. * Version 1
  2178. *
  2179. ******************************************************************************/
  2180. struct acpi_table_rasf {
  2181. struct acpi_table_header header; /* Common ACPI table header */
  2182. u8 channel_id[12];
  2183. };
  2184. /* RASF Platform Communication Channel Shared Memory Region */
  2185. struct acpi_rasf_shared_memory {
  2186. u32 signature;
  2187. u16 command;
  2188. u16 status;
  2189. u16 version;
  2190. u8 capabilities[16];
  2191. u8 set_capabilities[16];
  2192. u16 num_parameter_blocks;
  2193. u32 set_capabilities_status;
  2194. };
  2195. /* RASF Parameter Block Structure Header */
  2196. struct acpi_rasf_parameter_block {
  2197. u16 type;
  2198. u16 version;
  2199. u16 length;
  2200. };
  2201. /* RASF Parameter Block Structure for PATROL_SCRUB */
  2202. struct acpi_rasf_patrol_scrub_parameter {
  2203. struct acpi_rasf_parameter_block header;
  2204. u16 patrol_scrub_command;
  2205. u64 requested_address_range[2];
  2206. u64 actual_address_range[2];
  2207. u16 flags;
  2208. u8 requested_speed;
  2209. };
  2210. /* Masks for Flags and Speed fields above */
  2211. #define ACPI_RASF_SCRUBBER_RUNNING 1
  2212. #define ACPI_RASF_SPEED (7<<1)
  2213. #define ACPI_RASF_SPEED_SLOW (0<<1)
  2214. #define ACPI_RASF_SPEED_MEDIUM (4<<1)
  2215. #define ACPI_RASF_SPEED_FAST (7<<1)
  2216. /* Channel Commands */
  2217. enum acpi_rasf_commands {
  2218. ACPI_RASF_EXECUTE_RASF_COMMAND = 1
  2219. };
  2220. /* Platform RAS Capabilities */
  2221. enum acpi_rasf_capabiliities {
  2222. ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
  2223. ACPI_SW_PATROL_SCRUB_EXPOSED = 1
  2224. };
  2225. /* Patrol Scrub Commands */
  2226. enum acpi_rasf_patrol_scrub_commands {
  2227. ACPI_RASF_GET_PATROL_PARAMETERS = 1,
  2228. ACPI_RASF_START_PATROL_SCRUBBER = 2,
  2229. ACPI_RASF_STOP_PATROL_SCRUBBER = 3
  2230. };
  2231. /* Channel Command flags */
  2232. #define ACPI_RASF_GENERATE_SCI (1<<15)
  2233. /* Status values */
  2234. enum acpi_rasf_status {
  2235. ACPI_RASF_SUCCESS = 0,
  2236. ACPI_RASF_NOT_VALID = 1,
  2237. ACPI_RASF_NOT_SUPPORTED = 2,
  2238. ACPI_RASF_BUSY = 3,
  2239. ACPI_RASF_FAILED = 4,
  2240. ACPI_RASF_ABORTED = 5,
  2241. ACPI_RASF_INVALID_DATA = 6
  2242. };
  2243. /* Status flags */
  2244. #define ACPI_RASF_COMMAND_COMPLETE (1)
  2245. #define ACPI_RASF_SCI_DOORBELL (1<<1)
  2246. #define ACPI_RASF_ERROR (1<<2)
  2247. #define ACPI_RASF_STATUS (0x1F<<3)
  2248. /*******************************************************************************
  2249. *
  2250. * RAS2 - RAS2 Feature Table (ACPI 6.5)
  2251. * Version 1
  2252. *
  2253. *
  2254. ******************************************************************************/
  2255. struct acpi_table_ras2 {
  2256. struct acpi_table_header header; /* Common ACPI table header */
  2257. u16 reserved;
  2258. u16 num_pcc_descs;
  2259. };
  2260. /* RAS2 Platform Communication Channel Descriptor */
  2261. struct acpi_ras2_pcc_desc {
  2262. u8 channel_id;
  2263. u16 reserved;
  2264. u8 feature_type;
  2265. u32 instance;
  2266. };
  2267. /* RAS2 Platform Communication Channel Shared Memory Region */
  2268. struct acpi_ras2_shared_memory {
  2269. u32 signature;
  2270. u16 command;
  2271. u16 status;
  2272. u16 version;
  2273. u8 features[16];
  2274. u8 set_capabilities[16];
  2275. u16 num_parameter_blocks;
  2276. u32 set_capabilities_status;
  2277. };
  2278. /* RAS2 Parameter Block Structure for PATROL_SCRUB */
  2279. struct acpi_ras2_parameter_block {
  2280. u16 type;
  2281. u16 version;
  2282. u16 length;
  2283. };
  2284. /* RAS2 Parameter Block Structure for PATROL_SCRUB */
  2285. struct acpi_ras2_patrol_scrub_parameter {
  2286. struct acpi_ras2_parameter_block header;
  2287. u16 patrol_scrub_command;
  2288. u64 requested_address_range[2];
  2289. u64 actual_address_range[2];
  2290. u32 flags;
  2291. u32 scrub_params_out;
  2292. u32 scrub_params_in;
  2293. };
  2294. /* Masks for Flags field above */
  2295. #define ACPI_RAS2_SCRUBBER_RUNNING 1
  2296. /* RAS2 Parameter Block Structure for LA2PA_TRANSLATION */
  2297. struct acpi_ras2_la2pa_translation_parameter {
  2298. struct acpi_ras2_parameter_block header;
  2299. u16 addr_translation_command;
  2300. u64 sub_inst_id;
  2301. u64 logical_address;
  2302. u64 physical_address;
  2303. u32 status;
  2304. };
  2305. /* Channel Commands */
  2306. enum acpi_ras2_commands {
  2307. ACPI_RAS2_EXECUTE_RAS2_COMMAND = 1
  2308. };
  2309. /* Platform RAS2 Features */
  2310. enum acpi_ras2_features {
  2311. ACPI_RAS2_PATROL_SCRUB_SUPPORTED = 0,
  2312. ACPI_RAS2_LA2PA_TRANSLATION = 1
  2313. };
  2314. /* RAS2 Patrol Scrub Commands */
  2315. enum acpi_ras2_patrol_scrub_commands {
  2316. ACPI_RAS2_GET_PATROL_PARAMETERS = 1,
  2317. ACPI_RAS2_START_PATROL_SCRUBBER = 2,
  2318. ACPI_RAS2_STOP_PATROL_SCRUBBER = 3
  2319. };
  2320. /* RAS2 LA2PA Translation Commands */
  2321. enum acpi_ras2_la2_pa_translation_commands {
  2322. ACPI_RAS2_GET_LA2PA_TRANSLATION = 1,
  2323. };
  2324. /* RAS2 LA2PA Translation Status values */
  2325. enum acpi_ras2_la2_pa_translation_status {
  2326. ACPI_RAS2_LA2PA_TRANSLATION_SUCCESS = 0,
  2327. ACPI_RAS2_LA2PA_TRANSLATION_FAIL = 1,
  2328. };
  2329. /* Channel Command flags */
  2330. #define ACPI_RAS2_GENERATE_SCI (1<<15)
  2331. /* Status values */
  2332. enum acpi_ras2_status {
  2333. ACPI_RAS2_SUCCESS = 0,
  2334. ACPI_RAS2_NOT_VALID = 1,
  2335. ACPI_RAS2_NOT_SUPPORTED = 2,
  2336. ACPI_RAS2_BUSY = 3,
  2337. ACPI_RAS2_FAILED = 4,
  2338. ACPI_RAS2_ABORTED = 5,
  2339. ACPI_RAS2_INVALID_DATA = 6
  2340. };
  2341. /* Status flags */
  2342. #define ACPI_RAS2_COMMAND_COMPLETE (1)
  2343. #define ACPI_RAS2_SCI_DOORBELL (1<<1)
  2344. #define ACPI_RAS2_ERROR (1<<2)
  2345. #define ACPI_RAS2_STATUS (0x1F<<3)
  2346. /*******************************************************************************
  2347. *
  2348. * RGRT - Regulatory Graphics Resource Table
  2349. * Version 1
  2350. *
  2351. * Conforms to "ACPI RGRT" available at:
  2352. * https://microsoft.github.io/mu/dyn/mu_plus/ms_core_pkg/acpi_RGRT/feature_acpi_rgrt/
  2353. *
  2354. ******************************************************************************/
  2355. struct acpi_table_rgrt {
  2356. struct acpi_table_header header; /* Common ACPI table header */
  2357. u16 version;
  2358. u8 image_type;
  2359. u8 reserved;
  2360. u8 image[];
  2361. };
  2362. /* image_type values */
  2363. enum acpi_rgrt_image_type {
  2364. ACPI_RGRT_TYPE_RESERVED0 = 0,
  2365. ACPI_RGRT_IMAGE_TYPE_PNG = 1,
  2366. ACPI_RGRT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  2367. };
  2368. /*******************************************************************************
  2369. *
  2370. * RHCT - RISC-V Hart Capabilities Table
  2371. * Version 1
  2372. *
  2373. ******************************************************************************/
  2374. struct acpi_table_rhct {
  2375. struct acpi_table_header header; /* Common ACPI table header */
  2376. u32 flags; /* RHCT flags */
  2377. u64 time_base_freq;
  2378. u32 node_count;
  2379. u32 node_offset;
  2380. };
  2381. /* RHCT Flags */
  2382. #define ACPI_RHCT_TIMER_CANNOT_WAKEUP_CPU (1)
  2383. /*
  2384. * RHCT subtables
  2385. */
  2386. struct acpi_rhct_node_header {
  2387. u16 type;
  2388. u16 length;
  2389. u16 revision;
  2390. };
  2391. /* Values for RHCT subtable Type above */
  2392. enum acpi_rhct_node_type {
  2393. ACPI_RHCT_NODE_TYPE_ISA_STRING = 0x0000,
  2394. ACPI_RHCT_NODE_TYPE_CMO = 0x0001,
  2395. ACPI_RHCT_NODE_TYPE_MMU = 0x0002,
  2396. ACPI_RHCT_NODE_TYPE_RESERVED = 0x0003,
  2397. ACPI_RHCT_NODE_TYPE_HART_INFO = 0xFFFF,
  2398. };
  2399. /*
  2400. * RHCT node specific subtables
  2401. */
  2402. /* ISA string node structure */
  2403. struct acpi_rhct_isa_string {
  2404. u16 isa_length;
  2405. char isa[];
  2406. };
  2407. struct acpi_rhct_cmo_node {
  2408. u8 reserved; /* Must be zero */
  2409. u8 cbom_size; /* CBOM size in powerof 2 */
  2410. u8 cbop_size; /* CBOP size in powerof 2 */
  2411. u8 cboz_size; /* CBOZ size in powerof 2 */
  2412. };
  2413. struct acpi_rhct_mmu_node {
  2414. u8 reserved; /* Must be zero */
  2415. u8 mmu_type; /* Virtual Address Scheme */
  2416. };
  2417. enum acpi_rhct_mmu_type {
  2418. ACPI_RHCT_MMU_TYPE_SV39 = 0,
  2419. ACPI_RHCT_MMU_TYPE_SV48 = 1,
  2420. ACPI_RHCT_MMU_TYPE_SV57 = 2
  2421. };
  2422. /* Hart Info node structure */
  2423. struct acpi_rhct_hart_info {
  2424. u16 num_offsets;
  2425. u32 uid; /* ACPI processor UID */
  2426. };
  2427. /*******************************************************************************
  2428. *
  2429. * SBST - Smart Battery Specification Table
  2430. * Version 1
  2431. *
  2432. ******************************************************************************/
  2433. struct acpi_table_sbst {
  2434. struct acpi_table_header header; /* Common ACPI table header */
  2435. u32 warning_level;
  2436. u32 low_level;
  2437. u32 critical_level;
  2438. };
  2439. /*******************************************************************************
  2440. *
  2441. * SDEI - Software Delegated Exception Interface Descriptor Table
  2442. *
  2443. * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
  2444. * May 8th, 2017. Copyright 2017 ARM Ltd.
  2445. *
  2446. ******************************************************************************/
  2447. struct acpi_table_sdei {
  2448. struct acpi_table_header header; /* Common ACPI table header */
  2449. };
  2450. /*******************************************************************************
  2451. *
  2452. * SDEV - Secure Devices Table (ACPI 6.2)
  2453. * Version 1
  2454. *
  2455. ******************************************************************************/
  2456. struct acpi_table_sdev {
  2457. struct acpi_table_header header; /* Common ACPI table header */
  2458. };
  2459. struct acpi_sdev_header {
  2460. u8 type;
  2461. u8 flags;
  2462. u16 length;
  2463. };
  2464. /* Values for subtable type above */
  2465. enum acpi_sdev_type {
  2466. ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
  2467. ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
  2468. ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  2469. };
  2470. /* Values for flags above */
  2471. #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1)
  2472. #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1)
  2473. /*
  2474. * SDEV subtables
  2475. */
  2476. /* 0: Namespace Device Based Secure Device Structure */
  2477. struct acpi_sdev_namespace {
  2478. struct acpi_sdev_header header;
  2479. u16 device_id_offset;
  2480. u16 device_id_length;
  2481. u16 vendor_data_offset;
  2482. u16 vendor_data_length;
  2483. };
  2484. struct acpi_sdev_secure_component {
  2485. u16 secure_component_offset;
  2486. u16 secure_component_length;
  2487. };
  2488. /*
  2489. * SDEV sub-subtables ("Components") for above
  2490. */
  2491. struct acpi_sdev_component {
  2492. struct acpi_sdev_header header;
  2493. };
  2494. /* Values for sub-subtable type above */
  2495. enum acpi_sac_type {
  2496. ACPI_SDEV_TYPE_ID_COMPONENT = 0,
  2497. ACPI_SDEV_TYPE_MEM_COMPONENT = 1
  2498. };
  2499. struct acpi_sdev_id_component {
  2500. struct acpi_sdev_header header;
  2501. u16 hardware_id_offset;
  2502. u16 hardware_id_length;
  2503. u16 subsystem_id_offset;
  2504. u16 subsystem_id_length;
  2505. u16 hardware_revision;
  2506. u8 hardware_rev_present;
  2507. u8 class_code_present;
  2508. u8 pci_base_class;
  2509. u8 pci_sub_class;
  2510. u8 pci_programming_xface;
  2511. };
  2512. struct acpi_sdev_mem_component {
  2513. struct acpi_sdev_header header;
  2514. u32 reserved;
  2515. u64 memory_base_address;
  2516. u64 memory_length;
  2517. };
  2518. /* 1: PCIe Endpoint Device Based Device Structure */
  2519. struct acpi_sdev_pcie {
  2520. struct acpi_sdev_header header;
  2521. u16 segment;
  2522. u16 start_bus;
  2523. u16 path_offset;
  2524. u16 path_length;
  2525. u16 vendor_data_offset;
  2526. u16 vendor_data_length;
  2527. };
  2528. /* 1a: PCIe Endpoint path entry */
  2529. struct acpi_sdev_pcie_path {
  2530. u8 device;
  2531. u8 function;
  2532. };
  2533. /*******************************************************************************
  2534. *
  2535. * SVKL - Storage Volume Key Location Table (ACPI 6.4)
  2536. * From: "Guest-Host-Communication Interface (GHCI) for Intel
  2537. * Trust Domain Extensions (Intel TDX)".
  2538. * Version 1
  2539. *
  2540. ******************************************************************************/
  2541. struct acpi_table_svkl {
  2542. struct acpi_table_header header; /* Common ACPI table header */
  2543. u32 count;
  2544. };
  2545. struct acpi_svkl_key {
  2546. u16 type;
  2547. u16 format;
  2548. u32 size;
  2549. u64 address;
  2550. };
  2551. enum acpi_svkl_type {
  2552. ACPI_SVKL_TYPE_MAIN_STORAGE = 0,
  2553. ACPI_SVKL_TYPE_RESERVED = 1 /* 1 and greater are reserved */
  2554. };
  2555. enum acpi_svkl_format {
  2556. ACPI_SVKL_FORMAT_RAW_BINARY = 0,
  2557. ACPI_SVKL_FORMAT_RESERVED = 1 /* 1 and greater are reserved */
  2558. };
  2559. /*******************************************************************************
  2560. *
  2561. * TDEL - TD-Event Log
  2562. * From: "Guest-Host-Communication Interface (GHCI) for Intel
  2563. * Trust Domain Extensions (Intel TDX)".
  2564. * September 2020
  2565. *
  2566. ******************************************************************************/
  2567. struct acpi_table_tdel {
  2568. struct acpi_table_header header; /* Common ACPI table header */
  2569. u32 reserved;
  2570. u64 log_area_minimum_length;
  2571. u64 log_area_start_address;
  2572. };
  2573. /* Reset to default packing */
  2574. #pragma pack()
  2575. #endif /* __ACTBL2_H__ */