actbl2.h 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. /******************************************************************************
  2. *
  3. * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2012, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACTBL2_H__
  43. #define __ACTBL2_H__
  44. /*******************************************************************************
  45. *
  46. * Additional ACPI Tables (2)
  47. *
  48. * These tables are not consumed directly by the ACPICA subsystem, but are
  49. * included here to support device drivers and the AML disassembler.
  50. *
  51. * The tables in this file are defined by third-party specifications, and are
  52. * not defined directly by the ACPI specification itself.
  53. *
  54. ******************************************************************************/
  55. /*
  56. * Values for description table header signatures for tables defined in this
  57. * file. Useful because they make it more difficult to inadvertently type in
  58. * the wrong signature.
  59. */
  60. #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
  61. #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
  62. #define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
  63. #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
  64. #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
  65. #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
  66. #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
  67. #define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
  68. #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
  69. #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
  70. #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
  71. #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
  72. #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
  73. #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
  74. #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
  75. #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
  76. #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
  77. #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
  78. #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
  79. #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
  80. #ifdef ACPI_UNDEFINED_TABLES
  81. /*
  82. * These tables have been seen in the field, but no definition has been found
  83. */
  84. #define ACPI_SIG_ATKG "ATKG"
  85. #define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */
  86. #define ACPI_SIG_IEIT "IEIT"
  87. #endif
  88. /*
  89. * All tables must be byte-packed to match the ACPI specification, since
  90. * the tables are provided by the system BIOS.
  91. */
  92. #pragma pack(1)
  93. /*
  94. * Note: C bitfields are not used for this reason:
  95. *
  96. * "Bitfields are great and easy to read, but unfortunately the C language
  97. * does not specify the layout of bitfields in memory, which means they are
  98. * essentially useless for dealing with packed data in on-disk formats or
  99. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  100. * this decision was a design error in C. Ritchie could have picked an order
  101. * and stuck with it." Norman Ramsey.
  102. * See http://stackoverflow.com/a/1053662/41661
  103. */
  104. /*******************************************************************************
  105. *
  106. * ASF - Alert Standard Format table (Signature "ASF!")
  107. * Revision 0x10
  108. *
  109. * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
  110. *
  111. ******************************************************************************/
  112. struct acpi_table_asf {
  113. struct acpi_table_header header; /* Common ACPI table header */
  114. };
  115. /* ASF subtable header */
  116. struct acpi_asf_header {
  117. u8 type;
  118. u8 reserved;
  119. u16 length;
  120. };
  121. /* Values for Type field above */
  122. enum acpi_asf_type {
  123. ACPI_ASF_TYPE_INFO = 0,
  124. ACPI_ASF_TYPE_ALERT = 1,
  125. ACPI_ASF_TYPE_CONTROL = 2,
  126. ACPI_ASF_TYPE_BOOT = 3,
  127. ACPI_ASF_TYPE_ADDRESS = 4,
  128. ACPI_ASF_TYPE_RESERVED = 5
  129. };
  130. /*
  131. * ASF subtables
  132. */
  133. /* 0: ASF Information */
  134. struct acpi_asf_info {
  135. struct acpi_asf_header header;
  136. u8 min_reset_value;
  137. u8 min_poll_interval;
  138. u16 system_id;
  139. u32 mfg_id;
  140. u8 flags;
  141. u8 reserved2[3];
  142. };
  143. /* Masks for Flags field above */
  144. #define ACPI_ASF_SMBUS_PROTOCOLS (1)
  145. /* 1: ASF Alerts */
  146. struct acpi_asf_alert {
  147. struct acpi_asf_header header;
  148. u8 assert_mask;
  149. u8 deassert_mask;
  150. u8 alerts;
  151. u8 data_length;
  152. };
  153. struct acpi_asf_alert_data {
  154. u8 address;
  155. u8 command;
  156. u8 mask;
  157. u8 value;
  158. u8 sensor_type;
  159. u8 type;
  160. u8 offset;
  161. u8 source_type;
  162. u8 severity;
  163. u8 sensor_number;
  164. u8 entity;
  165. u8 instance;
  166. };
  167. /* 2: ASF Remote Control */
  168. struct acpi_asf_remote {
  169. struct acpi_asf_header header;
  170. u8 controls;
  171. u8 data_length;
  172. u16 reserved2;
  173. };
  174. struct acpi_asf_control_data {
  175. u8 function;
  176. u8 address;
  177. u8 command;
  178. u8 value;
  179. };
  180. /* 3: ASF RMCP Boot Options */
  181. struct acpi_asf_rmcp {
  182. struct acpi_asf_header header;
  183. u8 capabilities[7];
  184. u8 completion_code;
  185. u32 enterprise_id;
  186. u8 command;
  187. u16 parameter;
  188. u16 boot_options;
  189. u16 oem_parameters;
  190. };
  191. /* 4: ASF Address */
  192. struct acpi_asf_address {
  193. struct acpi_asf_header header;
  194. u8 eprom_address;
  195. u8 devices;
  196. };
  197. /*******************************************************************************
  198. *
  199. * BOOT - Simple Boot Flag Table
  200. * Version 1
  201. *
  202. * Conforms to the "Simple Boot Flag Specification", Version 2.1
  203. *
  204. ******************************************************************************/
  205. struct acpi_table_boot {
  206. struct acpi_table_header header; /* Common ACPI table header */
  207. u8 cmos_index; /* Index in CMOS RAM for the boot register */
  208. u8 reserved[3];
  209. };
  210. /*******************************************************************************
  211. *
  212. * CSRT - Core System Resource Table
  213. * Version 0
  214. *
  215. * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
  216. *
  217. ******************************************************************************/
  218. struct acpi_table_csrt {
  219. struct acpi_table_header header; /* Common ACPI table header */
  220. };
  221. /* Resource Group subtable */
  222. struct acpi_csrt_group {
  223. u32 length;
  224. u32 vendor_id;
  225. u32 subvendor_id;
  226. u16 device_id;
  227. u16 subdevice_id;
  228. u16 revision;
  229. u16 reserved;
  230. u32 info_length;
  231. /* Shared data (length = info_length) immediately follows */
  232. };
  233. /* Resource Descriptor subtable */
  234. struct acpi_csrt_descriptor {
  235. u32 length;
  236. u16 type;
  237. u16 subtype;
  238. u32 uid;
  239. /* Resource-specific information immediately follows */
  240. };
  241. /* Resource Types */
  242. #define ACPI_CSRT_TYPE_INTERRUPT 0x0001
  243. #define ACPI_CSRT_TYPE_TIMER 0x0002
  244. #define ACPI_CSRT_TYPE_DMA 0x0003
  245. /* Resource Subtypes */
  246. #define ACPI_CSRT_XRUPT_LINE 0x0000
  247. #define ACPI_CSRT_XRUPT_CONTROLLER 0x0001
  248. #define ACPI_CSRT_TIMER 0x0000
  249. #define ACPI_CSRT_DMA_CHANNEL 0x0000
  250. #define ACPI_CSRT_DMA_CONTROLLER 0x0001
  251. /*******************************************************************************
  252. *
  253. * DBG2 - Debug Port Table 2
  254. * Version 0 (Both main table and subtables)
  255. *
  256. * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
  257. *
  258. ******************************************************************************/
  259. struct acpi_table_dbg2 {
  260. struct acpi_table_header header; /* Common ACPI table header */
  261. u32 info_offset;
  262. u32 info_count;
  263. };
  264. /* Debug Device Information Subtable */
  265. struct acpi_dbg2_device {
  266. u8 revision;
  267. u16 length;
  268. u8 register_count; /* Number of base_address registers */
  269. u16 namepath_length;
  270. u16 namepath_offset;
  271. u16 oem_data_length;
  272. u16 oem_data_offset;
  273. u16 port_type;
  274. u16 port_subtype;
  275. u16 reserved;
  276. u16 base_address_offset;
  277. u16 address_size_offset;
  278. /*
  279. * Data that follows:
  280. * base_address (required) - Each in 12-byte Generic Address Structure format.
  281. * address_size (required) - Array of u32 sizes corresponding to each base_address register.
  282. * Namepath (required) - Null terminated string. Single dot if not supported.
  283. * oem_data (optional) - Length is oem_data_length.
  284. */
  285. };
  286. /* Types for port_type field above */
  287. #define ACPI_DBG2_SERIAL_PORT 0x8000
  288. #define ACPI_DBG2_1394_PORT 0x8001
  289. #define ACPI_DBG2_USB_PORT 0x8002
  290. #define ACPI_DBG2_NET_PORT 0x8003
  291. /* Subtypes for port_subtype field above */
  292. #define ACPI_DBG2_16550_COMPATIBLE 0x0000
  293. #define ACPI_DBG2_16550_SUBSET 0x0001
  294. #define ACPI_DBG2_1394_STANDARD 0x0000
  295. #define ACPI_DBG2_USB_XHCI 0x0000
  296. #define ACPI_DBG2_USB_EHCI 0x0001
  297. /*******************************************************************************
  298. *
  299. * DBGP - Debug Port table
  300. * Version 1
  301. *
  302. * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
  303. *
  304. ******************************************************************************/
  305. struct acpi_table_dbgp {
  306. struct acpi_table_header header; /* Common ACPI table header */
  307. u8 type; /* 0=full 16550, 1=subset of 16550 */
  308. u8 reserved[3];
  309. struct acpi_generic_address debug_port;
  310. };
  311. /*******************************************************************************
  312. *
  313. * DMAR - DMA Remapping table
  314. * Version 1
  315. *
  316. * Conforms to "Intel Virtualization Technology for Directed I/O",
  317. * Version 1.2, Sept. 2008
  318. *
  319. ******************************************************************************/
  320. struct acpi_table_dmar {
  321. struct acpi_table_header header; /* Common ACPI table header */
  322. u8 width; /* Host Address Width */
  323. u8 flags;
  324. u8 reserved[10];
  325. };
  326. /* Masks for Flags field above */
  327. #define ACPI_DMAR_INTR_REMAP (1)
  328. /* DMAR subtable header */
  329. struct acpi_dmar_header {
  330. u16 type;
  331. u16 length;
  332. };
  333. /* Values for subtable type in struct acpi_dmar_header */
  334. enum acpi_dmar_type {
  335. ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
  336. ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
  337. ACPI_DMAR_TYPE_ATSR = 2,
  338. ACPI_DMAR_HARDWARE_AFFINITY = 3,
  339. ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
  340. };
  341. /* DMAR Device Scope structure */
  342. struct acpi_dmar_device_scope {
  343. u8 entry_type;
  344. u8 length;
  345. u16 reserved;
  346. u8 enumeration_id;
  347. u8 bus;
  348. };
  349. /* Values for entry_type in struct acpi_dmar_device_scope */
  350. enum acpi_dmar_scope_type {
  351. ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
  352. ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
  353. ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
  354. ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
  355. ACPI_DMAR_SCOPE_TYPE_HPET = 4,
  356. ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
  357. };
  358. struct acpi_dmar_pci_path {
  359. u8 dev;
  360. u8 fn;
  361. };
  362. /*
  363. * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
  364. */
  365. /* 0: Hardware Unit Definition */
  366. struct acpi_dmar_hardware_unit {
  367. struct acpi_dmar_header header;
  368. u8 flags;
  369. u8 reserved;
  370. u16 segment;
  371. u64 address; /* Register Base Address */
  372. };
  373. /* Masks for Flags field above */
  374. #define ACPI_DMAR_INCLUDE_ALL (1)
  375. /* 1: Reserved Memory Defininition */
  376. struct acpi_dmar_reserved_memory {
  377. struct acpi_dmar_header header;
  378. u16 reserved;
  379. u16 segment;
  380. u64 base_address; /* 4K aligned base address */
  381. u64 end_address; /* 4K aligned limit address */
  382. };
  383. /* Masks for Flags field above */
  384. #define ACPI_DMAR_ALLOW_ALL (1)
  385. /* 2: Root Port ATS Capability Reporting Structure */
  386. struct acpi_dmar_atsr {
  387. struct acpi_dmar_header header;
  388. u8 flags;
  389. u8 reserved;
  390. u16 segment;
  391. };
  392. /* Masks for Flags field above */
  393. #define ACPI_DMAR_ALL_PORTS (1)
  394. /* 3: Remapping Hardware Static Affinity Structure */
  395. struct acpi_dmar_rhsa {
  396. struct acpi_dmar_header header;
  397. u32 reserved;
  398. u64 base_address;
  399. u32 proximity_domain;
  400. };
  401. /*******************************************************************************
  402. *
  403. * HPET - High Precision Event Timer table
  404. * Version 1
  405. *
  406. * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
  407. * Version 1.0a, October 2004
  408. *
  409. ******************************************************************************/
  410. struct acpi_table_hpet {
  411. struct acpi_table_header header; /* Common ACPI table header */
  412. u32 id; /* Hardware ID of event timer block */
  413. struct acpi_generic_address address; /* Address of event timer block */
  414. u8 sequence; /* HPET sequence number */
  415. u16 minimum_tick; /* Main counter min tick, periodic mode */
  416. u8 flags;
  417. };
  418. /* Masks for Flags field above */
  419. #define ACPI_HPET_PAGE_PROTECT_MASK (3)
  420. /* Values for Page Protect flags */
  421. enum acpi_hpet_page_protect {
  422. ACPI_HPET_NO_PAGE_PROTECT = 0,
  423. ACPI_HPET_PAGE_PROTECT4 = 1,
  424. ACPI_HPET_PAGE_PROTECT64 = 2
  425. };
  426. /*******************************************************************************
  427. *
  428. * IBFT - Boot Firmware Table
  429. * Version 1
  430. *
  431. * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
  432. * Specification", Version 1.01, March 1, 2007
  433. *
  434. * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
  435. * Therefore, it is not currently supported by the disassembler.
  436. *
  437. ******************************************************************************/
  438. struct acpi_table_ibft {
  439. struct acpi_table_header header; /* Common ACPI table header */
  440. u8 reserved[12];
  441. };
  442. /* IBFT common subtable header */
  443. struct acpi_ibft_header {
  444. u8 type;
  445. u8 version;
  446. u16 length;
  447. u8 index;
  448. u8 flags;
  449. };
  450. /* Values for Type field above */
  451. enum acpi_ibft_type {
  452. ACPI_IBFT_TYPE_NOT_USED = 0,
  453. ACPI_IBFT_TYPE_CONTROL = 1,
  454. ACPI_IBFT_TYPE_INITIATOR = 2,
  455. ACPI_IBFT_TYPE_NIC = 3,
  456. ACPI_IBFT_TYPE_TARGET = 4,
  457. ACPI_IBFT_TYPE_EXTENSIONS = 5,
  458. ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
  459. };
  460. /* IBFT subtables */
  461. struct acpi_ibft_control {
  462. struct acpi_ibft_header header;
  463. u16 extensions;
  464. u16 initiator_offset;
  465. u16 nic0_offset;
  466. u16 target0_offset;
  467. u16 nic1_offset;
  468. u16 target1_offset;
  469. };
  470. struct acpi_ibft_initiator {
  471. struct acpi_ibft_header header;
  472. u8 sns_server[16];
  473. u8 slp_server[16];
  474. u8 primary_server[16];
  475. u8 secondary_server[16];
  476. u16 name_length;
  477. u16 name_offset;
  478. };
  479. struct acpi_ibft_nic {
  480. struct acpi_ibft_header header;
  481. u8 ip_address[16];
  482. u8 subnet_mask_prefix;
  483. u8 origin;
  484. u8 gateway[16];
  485. u8 primary_dns[16];
  486. u8 secondary_dns[16];
  487. u8 dhcp[16];
  488. u16 vlan;
  489. u8 mac_address[6];
  490. u16 pci_address;
  491. u16 name_length;
  492. u16 name_offset;
  493. };
  494. struct acpi_ibft_target {
  495. struct acpi_ibft_header header;
  496. u8 target_ip_address[16];
  497. u16 target_ip_socket;
  498. u8 target_boot_lun[8];
  499. u8 chap_type;
  500. u8 nic_association;
  501. u16 target_name_length;
  502. u16 target_name_offset;
  503. u16 chap_name_length;
  504. u16 chap_name_offset;
  505. u16 chap_secret_length;
  506. u16 chap_secret_offset;
  507. u16 reverse_chap_name_length;
  508. u16 reverse_chap_name_offset;
  509. u16 reverse_chap_secret_length;
  510. u16 reverse_chap_secret_offset;
  511. };
  512. /*******************************************************************************
  513. *
  514. * IVRS - I/O Virtualization Reporting Structure
  515. * Version 1
  516. *
  517. * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
  518. * Revision 1.26, February 2009.
  519. *
  520. ******************************************************************************/
  521. struct acpi_table_ivrs {
  522. struct acpi_table_header header; /* Common ACPI table header */
  523. u32 info; /* Common virtualization info */
  524. u64 reserved;
  525. };
  526. /* Values for Info field above */
  527. #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
  528. #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
  529. #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */
  530. /* IVRS subtable header */
  531. struct acpi_ivrs_header {
  532. u8 type; /* Subtable type */
  533. u8 flags;
  534. u16 length; /* Subtable length */
  535. u16 device_id; /* ID of IOMMU */
  536. };
  537. /* Values for subtable Type above */
  538. enum acpi_ivrs_type {
  539. ACPI_IVRS_TYPE_HARDWARE = 0x10,
  540. ACPI_IVRS_TYPE_MEMORY1 = 0x20,
  541. ACPI_IVRS_TYPE_MEMORY2 = 0x21,
  542. ACPI_IVRS_TYPE_MEMORY3 = 0x22
  543. };
  544. /* Masks for Flags field above for IVHD subtable */
  545. #define ACPI_IVHD_TT_ENABLE (1)
  546. #define ACPI_IVHD_PASS_PW (1<<1)
  547. #define ACPI_IVHD_RES_PASS_PW (1<<2)
  548. #define ACPI_IVHD_ISOC (1<<3)
  549. #define ACPI_IVHD_IOTLB (1<<4)
  550. /* Masks for Flags field above for IVMD subtable */
  551. #define ACPI_IVMD_UNITY (1)
  552. #define ACPI_IVMD_READ (1<<1)
  553. #define ACPI_IVMD_WRITE (1<<2)
  554. #define ACPI_IVMD_EXCLUSION_RANGE (1<<3)
  555. /*
  556. * IVRS subtables, correspond to Type in struct acpi_ivrs_header
  557. */
  558. /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
  559. struct acpi_ivrs_hardware {
  560. struct acpi_ivrs_header header;
  561. u16 capability_offset; /* Offset for IOMMU control fields */
  562. u64 base_address; /* IOMMU control registers */
  563. u16 pci_segment_group;
  564. u16 info; /* MSI number and unit ID */
  565. u32 reserved;
  566. };
  567. /* Masks for Info field above */
  568. #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */
  569. #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_ID */
  570. /*
  571. * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
  572. * Upper two bits of the Type field are the (encoded) length of the structure.
  573. * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
  574. * are reserved for future use but not defined.
  575. */
  576. struct acpi_ivrs_de_header {
  577. u8 type;
  578. u16 id;
  579. u8 data_setting;
  580. };
  581. /* Length of device entry is in the top two bits of Type field above */
  582. #define ACPI_IVHD_ENTRY_LENGTH 0xC0
  583. /* Values for device entry Type field above */
  584. enum acpi_ivrs_device_entry_type {
  585. /* 4-byte device entries, all use struct acpi_ivrs_device4 */
  586. ACPI_IVRS_TYPE_PAD4 = 0,
  587. ACPI_IVRS_TYPE_ALL = 1,
  588. ACPI_IVRS_TYPE_SELECT = 2,
  589. ACPI_IVRS_TYPE_START = 3,
  590. ACPI_IVRS_TYPE_END = 4,
  591. /* 8-byte device entries */
  592. ACPI_IVRS_TYPE_PAD8 = 64,
  593. ACPI_IVRS_TYPE_NOT_USED = 65,
  594. ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */
  595. ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */
  596. ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */
  597. ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */
  598. ACPI_IVRS_TYPE_SPECIAL = 72 /* Uses struct acpi_ivrs_device8c */
  599. };
  600. /* Values for Data field above */
  601. #define ACPI_IVHD_INIT_PASS (1)
  602. #define ACPI_IVHD_EINT_PASS (1<<1)
  603. #define ACPI_IVHD_NMI_PASS (1<<2)
  604. #define ACPI_IVHD_SYSTEM_MGMT (3<<4)
  605. #define ACPI_IVHD_LINT0_PASS (1<<6)
  606. #define ACPI_IVHD_LINT1_PASS (1<<7)
  607. /* Types 0-4: 4-byte device entry */
  608. struct acpi_ivrs_device4 {
  609. struct acpi_ivrs_de_header header;
  610. };
  611. /* Types 66-67: 8-byte device entry */
  612. struct acpi_ivrs_device8a {
  613. struct acpi_ivrs_de_header header;
  614. u8 reserved1;
  615. u16 used_id;
  616. u8 reserved2;
  617. };
  618. /* Types 70-71: 8-byte device entry */
  619. struct acpi_ivrs_device8b {
  620. struct acpi_ivrs_de_header header;
  621. u32 extended_data;
  622. };
  623. /* Values for extended_data above */
  624. #define ACPI_IVHD_ATS_DISABLED (1<<31)
  625. /* Type 72: 8-byte device entry */
  626. struct acpi_ivrs_device8c {
  627. struct acpi_ivrs_de_header header;
  628. u8 handle;
  629. u16 used_id;
  630. u8 variety;
  631. };
  632. /* Values for Variety field above */
  633. #define ACPI_IVHD_IOAPIC 1
  634. #define ACPI_IVHD_HPET 2
  635. /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
  636. struct acpi_ivrs_memory {
  637. struct acpi_ivrs_header header;
  638. u16 aux_data;
  639. u64 reserved;
  640. u64 start_address;
  641. u64 memory_length;
  642. };
  643. /*******************************************************************************
  644. *
  645. * MCFG - PCI Memory Mapped Configuration table and sub-table
  646. * Version 1
  647. *
  648. * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
  649. *
  650. ******************************************************************************/
  651. struct acpi_table_mcfg {
  652. struct acpi_table_header header; /* Common ACPI table header */
  653. u8 reserved[8];
  654. };
  655. /* Subtable */
  656. struct acpi_mcfg_allocation {
  657. u64 address; /* Base address, processor-relative */
  658. u16 pci_segment; /* PCI segment group number */
  659. u8 start_bus_number; /* Starting PCI Bus number */
  660. u8 end_bus_number; /* Final PCI Bus number */
  661. u32 reserved;
  662. };
  663. /*******************************************************************************
  664. *
  665. * MCHI - Management Controller Host Interface Table
  666. * Version 1
  667. *
  668. * Conforms to "Management Component Transport Protocol (MCTP) Host
  669. * Interface Specification", Revision 1.0.0a, October 13, 2009
  670. *
  671. ******************************************************************************/
  672. struct acpi_table_mchi {
  673. struct acpi_table_header header; /* Common ACPI table header */
  674. u8 interface_type;
  675. u8 protocol;
  676. u64 protocol_data;
  677. u8 interrupt_type;
  678. u8 gpe;
  679. u8 pci_device_flag;
  680. u32 global_interrupt;
  681. struct acpi_generic_address control_register;
  682. u8 pci_segment;
  683. u8 pci_bus;
  684. u8 pci_device;
  685. u8 pci_function;
  686. };
  687. /*******************************************************************************
  688. *
  689. * SLIC - Software Licensing Description Table
  690. * Version 1
  691. *
  692. * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
  693. * Copyright 2006
  694. *
  695. ******************************************************************************/
  696. /* Basic SLIC table is only the common ACPI header */
  697. struct acpi_table_slic {
  698. struct acpi_table_header header; /* Common ACPI table header */
  699. };
  700. /* Common SLIC subtable header */
  701. struct acpi_slic_header {
  702. u32 type;
  703. u32 length;
  704. };
  705. /* Values for Type field above */
  706. enum acpi_slic_type {
  707. ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
  708. ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
  709. ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
  710. };
  711. /*
  712. * SLIC Sub-tables, correspond to Type in struct acpi_slic_header
  713. */
  714. /* 0: Public Key Structure */
  715. struct acpi_slic_key {
  716. struct acpi_slic_header header;
  717. u8 key_type;
  718. u8 version;
  719. u16 reserved;
  720. u32 algorithm;
  721. char magic[4];
  722. u32 bit_length;
  723. u32 exponent;
  724. u8 modulus[128];
  725. };
  726. /* 1: Windows Marker Structure */
  727. struct acpi_slic_marker {
  728. struct acpi_slic_header header;
  729. u32 version;
  730. char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
  731. char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
  732. char windows_flag[8];
  733. u32 slic_version;
  734. u8 reserved[16];
  735. u8 signature[128];
  736. };
  737. /*******************************************************************************
  738. *
  739. * SPCR - Serial Port Console Redirection table
  740. * Version 1
  741. *
  742. * Conforms to "Serial Port Console Redirection Table",
  743. * Version 1.00, January 11, 2002
  744. *
  745. ******************************************************************************/
  746. struct acpi_table_spcr {
  747. struct acpi_table_header header; /* Common ACPI table header */
  748. u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
  749. u8 reserved[3];
  750. struct acpi_generic_address serial_port;
  751. u8 interrupt_type;
  752. u8 pc_interrupt;
  753. u32 interrupt;
  754. u8 baud_rate;
  755. u8 parity;
  756. u8 stop_bits;
  757. u8 flow_control;
  758. u8 terminal_type;
  759. u8 reserved1;
  760. u16 pci_device_id;
  761. u16 pci_vendor_id;
  762. u8 pci_bus;
  763. u8 pci_device;
  764. u8 pci_function;
  765. u32 pci_flags;
  766. u8 pci_segment;
  767. u32 reserved2;
  768. };
  769. /* Masks for pci_flags field above */
  770. #define ACPI_SPCR_DO_NOT_DISABLE (1)
  771. /*******************************************************************************
  772. *
  773. * SPMI - Server Platform Management Interface table
  774. * Version 5
  775. *
  776. * Conforms to "Intelligent Platform Management Interface Specification
  777. * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
  778. * June 12, 2009 markup.
  779. *
  780. ******************************************************************************/
  781. struct acpi_table_spmi {
  782. struct acpi_table_header header; /* Common ACPI table header */
  783. u8 interface_type;
  784. u8 reserved; /* Must be 1 */
  785. u16 spec_revision; /* Version of IPMI */
  786. u8 interrupt_type;
  787. u8 gpe_number; /* GPE assigned */
  788. u8 reserved1;
  789. u8 pci_device_flag;
  790. u32 interrupt;
  791. struct acpi_generic_address ipmi_register;
  792. u8 pci_segment;
  793. u8 pci_bus;
  794. u8 pci_device;
  795. u8 pci_function;
  796. u8 reserved2;
  797. };
  798. /* Values for interface_type above */
  799. enum acpi_spmi_interface_types {
  800. ACPI_SPMI_NOT_USED = 0,
  801. ACPI_SPMI_KEYBOARD = 1,
  802. ACPI_SPMI_SMI = 2,
  803. ACPI_SPMI_BLOCK_TRANSFER = 3,
  804. ACPI_SPMI_SMBUS = 4,
  805. ACPI_SPMI_RESERVED = 5 /* 5 and above are reserved */
  806. };
  807. /*******************************************************************************
  808. *
  809. * TCPA - Trusted Computing Platform Alliance table
  810. * Version 1
  811. *
  812. * Conforms to "TCG PC Specific Implementation Specification",
  813. * Version 1.1, August 18, 2003
  814. *
  815. ******************************************************************************/
  816. struct acpi_table_tcpa {
  817. struct acpi_table_header header; /* Common ACPI table header */
  818. u16 reserved;
  819. u32 max_log_length; /* Maximum length for the event log area */
  820. u64 log_address; /* Address of the event log area */
  821. };
  822. /*******************************************************************************
  823. *
  824. * UEFI - UEFI Boot optimization Table
  825. * Version 1
  826. *
  827. * Conforms to "Unified Extensible Firmware Interface Specification",
  828. * Version 2.3, May 8, 2009
  829. *
  830. ******************************************************************************/
  831. struct acpi_table_uefi {
  832. struct acpi_table_header header; /* Common ACPI table header */
  833. u8 identifier[16]; /* UUID identifier */
  834. u16 data_offset; /* Offset of remaining data in table */
  835. };
  836. /*******************************************************************************
  837. *
  838. * WAET - Windows ACPI Emulated devices Table
  839. * Version 1
  840. *
  841. * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
  842. *
  843. ******************************************************************************/
  844. struct acpi_table_waet {
  845. struct acpi_table_header header; /* Common ACPI table header */
  846. u32 flags;
  847. };
  848. /* Masks for Flags field above */
  849. #define ACPI_WAET_RTC_NO_ACK (1) /* RTC requires no int acknowledge */
  850. #define ACPI_WAET_TIMER_ONE_READ (1<<1) /* PM timer requires only one read */
  851. /*******************************************************************************
  852. *
  853. * WDAT - Watchdog Action Table
  854. * Version 1
  855. *
  856. * Conforms to "Hardware Watchdog Timers Design Specification",
  857. * Copyright 2006 Microsoft Corporation.
  858. *
  859. ******************************************************************************/
  860. struct acpi_table_wdat {
  861. struct acpi_table_header header; /* Common ACPI table header */
  862. u32 header_length; /* Watchdog Header Length */
  863. u16 pci_segment; /* PCI Segment number */
  864. u8 pci_bus; /* PCI Bus number */
  865. u8 pci_device; /* PCI Device number */
  866. u8 pci_function; /* PCI Function number */
  867. u8 reserved[3];
  868. u32 timer_period; /* Period of one timer count (msec) */
  869. u32 max_count; /* Maximum counter value supported */
  870. u32 min_count; /* Minimum counter value */
  871. u8 flags;
  872. u8 reserved2[3];
  873. u32 entries; /* Number of watchdog entries that follow */
  874. };
  875. /* Masks for Flags field above */
  876. #define ACPI_WDAT_ENABLED (1)
  877. #define ACPI_WDAT_STOPPED 0x80
  878. /* WDAT Instruction Entries (actions) */
  879. struct acpi_wdat_entry {
  880. u8 action;
  881. u8 instruction;
  882. u16 reserved;
  883. struct acpi_generic_address register_region;
  884. u32 value; /* Value used with Read/Write register */
  885. u32 mask; /* Bitmask required for this register instruction */
  886. };
  887. /* Values for Action field above */
  888. enum acpi_wdat_actions {
  889. ACPI_WDAT_RESET = 1,
  890. ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
  891. ACPI_WDAT_GET_COUNTDOWN = 5,
  892. ACPI_WDAT_SET_COUNTDOWN = 6,
  893. ACPI_WDAT_GET_RUNNING_STATE = 8,
  894. ACPI_WDAT_SET_RUNNING_STATE = 9,
  895. ACPI_WDAT_GET_STOPPED_STATE = 10,
  896. ACPI_WDAT_SET_STOPPED_STATE = 11,
  897. ACPI_WDAT_GET_REBOOT = 16,
  898. ACPI_WDAT_SET_REBOOT = 17,
  899. ACPI_WDAT_GET_SHUTDOWN = 18,
  900. ACPI_WDAT_SET_SHUTDOWN = 19,
  901. ACPI_WDAT_GET_STATUS = 32,
  902. ACPI_WDAT_SET_STATUS = 33,
  903. ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
  904. };
  905. /* Values for Instruction field above */
  906. enum acpi_wdat_instructions {
  907. ACPI_WDAT_READ_VALUE = 0,
  908. ACPI_WDAT_READ_COUNTDOWN = 1,
  909. ACPI_WDAT_WRITE_VALUE = 2,
  910. ACPI_WDAT_WRITE_COUNTDOWN = 3,
  911. ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
  912. ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
  913. };
  914. /*******************************************************************************
  915. *
  916. * WDDT - Watchdog Descriptor Table
  917. * Version 1
  918. *
  919. * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
  920. * Version 001, September 2002
  921. *
  922. ******************************************************************************/
  923. struct acpi_table_wddt {
  924. struct acpi_table_header header; /* Common ACPI table header */
  925. u16 spec_version;
  926. u16 table_version;
  927. u16 pci_vendor_id;
  928. struct acpi_generic_address address;
  929. u16 max_count; /* Maximum counter value supported */
  930. u16 min_count; /* Minimum counter value supported */
  931. u16 period;
  932. u16 status;
  933. u16 capability;
  934. };
  935. /* Flags for Status field above */
  936. #define ACPI_WDDT_AVAILABLE (1)
  937. #define ACPI_WDDT_ACTIVE (1<<1)
  938. #define ACPI_WDDT_TCO_OS_OWNED (1<<2)
  939. #define ACPI_WDDT_USER_RESET (1<<11)
  940. #define ACPI_WDDT_WDT_RESET (1<<12)
  941. #define ACPI_WDDT_POWER_FAIL (1<<13)
  942. #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
  943. /* Flags for Capability field above */
  944. #define ACPI_WDDT_AUTO_RESET (1)
  945. #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
  946. /*******************************************************************************
  947. *
  948. * WDRT - Watchdog Resource Table
  949. * Version 1
  950. *
  951. * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
  952. * Version 1.01, August 28, 2006
  953. *
  954. ******************************************************************************/
  955. struct acpi_table_wdrt {
  956. struct acpi_table_header header; /* Common ACPI table header */
  957. struct acpi_generic_address control_register;
  958. struct acpi_generic_address count_register;
  959. u16 pci_device_id;
  960. u16 pci_vendor_id;
  961. u8 pci_bus; /* PCI Bus number */
  962. u8 pci_device; /* PCI Device number */
  963. u8 pci_function; /* PCI Function number */
  964. u8 pci_segment; /* PCI Segment number */
  965. u16 max_count; /* Maximum counter value supported */
  966. u8 units;
  967. };
  968. /* Reset to default packing */
  969. #pragma pack()
  970. #endif /* __ACTBL2_H__ */