actbl2.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. #ifndef __ACTBL2_H__
  2. #define __ACTBL2_H__
  3. /*******************************************************************************
  4. *
  5. * Additional ACPI Tables (2)
  6. *
  7. * These tables are not consumed directly by the ACPICA subsystem, but are
  8. * included here to support device drivers and the AML disassembler.
  9. *
  10. * The tables in this file are defined by third-party specifications, and are
  11. * not defined directly by the ACPI specification itself.
  12. *
  13. ******************************************************************************/
  14. /*
  15. * Values for description table header signatures. Useful because they make
  16. * it more difficult to inadvertently type in the wrong signature.
  17. */
  18. #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
  19. #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
  20. #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
  21. #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
  22. #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
  23. #define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */
  24. #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
  25. #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
  26. #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
  27. #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
  28. #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
  29. #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
  30. #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
  31. #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
  32. /*
  33. * All tables must be byte-packed to match the ACPI specification, since
  34. * the tables are provided by the system BIOS.
  35. */
  36. #pragma pack(1)
  37. /*
  38. * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
  39. * This is the only type that is even remotely portable. Anything else is not
  40. * portable, so do not use any other bitfield types.
  41. */
  42. /*******************************************************************************
  43. *
  44. * ASF - Alert Standard Format table (Signature "ASF!")
  45. *
  46. * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
  47. *
  48. ******************************************************************************/
  49. struct acpi_table_asf {
  50. struct acpi_table_header header; /* Common ACPI table header */
  51. };
  52. /* ASF subtable header */
  53. struct acpi_asf_header {
  54. u8 type;
  55. u8 reserved;
  56. u16 length;
  57. };
  58. /* Values for Type field above */
  59. enum acpi_asf_type {
  60. ACPI_ASF_TYPE_INFO = 0,
  61. ACPI_ASF_TYPE_ALERT = 1,
  62. ACPI_ASF_TYPE_CONTROL = 2,
  63. ACPI_ASF_TYPE_BOOT = 3,
  64. ACPI_ASF_TYPE_ADDRESS = 4,
  65. ACPI_ASF_TYPE_RESERVED = 5
  66. };
  67. /*
  68. * ASF subtables
  69. */
  70. /* 0: ASF Information */
  71. struct acpi_asf_info {
  72. struct acpi_asf_header header;
  73. u8 min_reset_value;
  74. u8 min_poll_interval;
  75. u16 system_id;
  76. u32 mfg_id;
  77. u8 flags;
  78. u8 reserved2[3];
  79. };
  80. /* 1: ASF Alerts */
  81. struct acpi_asf_alert {
  82. struct acpi_asf_header header;
  83. u8 assert_mask;
  84. u8 deassert_mask;
  85. u8 alerts;
  86. u8 data_length;
  87. };
  88. struct acpi_asf_alert_data {
  89. u8 address;
  90. u8 command;
  91. u8 mask;
  92. u8 value;
  93. u8 sensor_type;
  94. u8 type;
  95. u8 offset;
  96. u8 source_type;
  97. u8 severity;
  98. u8 sensor_number;
  99. u8 entity;
  100. u8 instance;
  101. };
  102. /* 2: ASF Remote Control */
  103. struct acpi_asf_remote {
  104. struct acpi_asf_header header;
  105. u8 controls;
  106. u8 data_length;
  107. u16 reserved2;
  108. };
  109. struct acpi_asf_control_data {
  110. u8 function;
  111. u8 address;
  112. u8 command;
  113. u8 value;
  114. };
  115. /* 3: ASF RMCP Boot Options */
  116. struct acpi_asf_rmcp {
  117. struct acpi_asf_header header;
  118. u8 capabilities[7];
  119. u8 completion_code;
  120. u32 enterprise_id;
  121. u8 command;
  122. u16 parameter;
  123. u16 boot_options;
  124. u16 oem_parameters;
  125. };
  126. /* 4: ASF Address */
  127. struct acpi_asf_address {
  128. struct acpi_asf_header header;
  129. u8 eprom_address;
  130. u8 devices;
  131. };
  132. /*******************************************************************************
  133. *
  134. * BOOT - Simple Boot Flag Table
  135. *
  136. ******************************************************************************/
  137. struct acpi_table_boot {
  138. struct acpi_table_header header; /* Common ACPI table header */
  139. u8 cmos_index; /* Index in CMOS RAM for the boot register */
  140. u8 reserved[3];
  141. };
  142. /*******************************************************************************
  143. *
  144. * DBGP - Debug Port table
  145. *
  146. ******************************************************************************/
  147. struct acpi_table_dbgp {
  148. struct acpi_table_header header; /* Common ACPI table header */
  149. u8 type; /* 0=full 16550, 1=subset of 16550 */
  150. u8 reserved[3];
  151. struct acpi_generic_address debug_port;
  152. };
  153. /*******************************************************************************
  154. *
  155. * DMAR - DMA Remapping table
  156. * From "Intel Virtualization Technology for Directed I/O", Sept. 2007
  157. *
  158. ******************************************************************************/
  159. struct acpi_table_dmar {
  160. struct acpi_table_header header; /* Common ACPI table header */
  161. u8 width; /* Host Address Width */
  162. u8 flags;
  163. u8 reserved[10];
  164. };
  165. /* Flags */
  166. #define ACPI_DMAR_INTR_REMAP (1)
  167. /* DMAR subtable header */
  168. struct acpi_dmar_header {
  169. u16 type;
  170. u16 length;
  171. };
  172. /* Values for subtable type in struct acpi_dmar_header */
  173. enum acpi_dmar_type {
  174. ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
  175. ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
  176. ACPI_DMAR_TYPE_ATSR = 2,
  177. ACPI_DMAR_TYPE_RESERVED = 3 /* 3 and greater are reserved */
  178. };
  179. struct acpi_dmar_device_scope {
  180. u8 entry_type;
  181. u8 length;
  182. u16 reserved;
  183. u8 enumeration_id;
  184. u8 bus;
  185. };
  186. /* Values for entry_type in struct acpi_dmar_device_scope */
  187. enum acpi_dmar_scope_type {
  188. ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
  189. ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
  190. ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
  191. ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
  192. ACPI_DMAR_SCOPE_TYPE_HPET = 4,
  193. ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
  194. };
  195. struct acpi_dmar_pci_path {
  196. u8 dev;
  197. u8 fn;
  198. };
  199. /*
  200. * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
  201. */
  202. /* 0: Hardware Unit Definition */
  203. struct acpi_dmar_hardware_unit {
  204. struct acpi_dmar_header header;
  205. u8 flags;
  206. u8 reserved;
  207. u16 segment;
  208. u64 address; /* Register Base Address */
  209. };
  210. /* Flags */
  211. #define ACPI_DMAR_INCLUDE_ALL (1)
  212. /* 1: Reserved Memory Defininition */
  213. struct acpi_dmar_reserved_memory {
  214. struct acpi_dmar_header header;
  215. u16 reserved;
  216. u16 segment;
  217. u64 base_address; /* 4_k aligned base address */
  218. u64 end_address; /* 4_k aligned limit address */
  219. };
  220. /* Flags */
  221. #define ACPI_DMAR_ALLOW_ALL (1)
  222. /* 2: Root Port ATS Capability Reporting Structure */
  223. struct acpi_dmar_atsr {
  224. struct acpi_dmar_header header;
  225. u8 flags;
  226. u8 reserved;
  227. u16 segment;
  228. };
  229. /* Flags */
  230. #define ACPI_DMAR_ALL_PORTS (1)
  231. /*******************************************************************************
  232. *
  233. * HPET - High Precision Event Timer table
  234. *
  235. ******************************************************************************/
  236. struct acpi_table_hpet {
  237. struct acpi_table_header header; /* Common ACPI table header */
  238. u32 id; /* Hardware ID of event timer block */
  239. struct acpi_generic_address address; /* Address of event timer block */
  240. u8 sequence; /* HPET sequence number */
  241. u16 minimum_tick; /* Main counter min tick, periodic mode */
  242. u8 flags;
  243. };
  244. /*! Flags */
  245. #define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */
  246. #define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */
  247. #define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */
  248. /*! [End] no source code translation !*/
  249. /*******************************************************************************
  250. *
  251. * IBFT - Boot Firmware Table
  252. *
  253. ******************************************************************************/
  254. struct acpi_table_ibft {
  255. struct acpi_table_header header; /* Common ACPI table header */
  256. u8 reserved[12];
  257. };
  258. /* IBFT common subtable header */
  259. struct acpi_ibft_header {
  260. u8 type;
  261. u8 version;
  262. u16 length;
  263. u8 index;
  264. u8 flags;
  265. };
  266. /* Values for Type field above */
  267. enum acpi_ibft_type {
  268. ACPI_IBFT_TYPE_NOT_USED = 0,
  269. ACPI_IBFT_TYPE_CONTROL = 1,
  270. ACPI_IBFT_TYPE_INITIATOR = 2,
  271. ACPI_IBFT_TYPE_NIC = 3,
  272. ACPI_IBFT_TYPE_TARGET = 4,
  273. ACPI_IBFT_TYPE_EXTENSIONS = 5,
  274. ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
  275. };
  276. /* IBFT subtables */
  277. struct acpi_ibft_control {
  278. struct acpi_ibft_header header;
  279. u16 extensions;
  280. u16 initiator_offset;
  281. u16 nic0_offset;
  282. u16 target0_offset;
  283. u16 nic1_offset;
  284. u16 target1_offset;
  285. };
  286. struct acpi_ibft_initiator {
  287. struct acpi_ibft_header header;
  288. u8 sns_server[16];
  289. u8 slp_server[16];
  290. u8 primary_server[16];
  291. u8 secondary_server[16];
  292. u16 name_length;
  293. u16 name_offset;
  294. };
  295. struct acpi_ibft_nic {
  296. struct acpi_ibft_header header;
  297. u8 ip_address[16];
  298. u8 subnet_mask_prefix;
  299. u8 origin;
  300. u8 gateway[16];
  301. u8 primary_dns[16];
  302. u8 secondary_dns[16];
  303. u8 dhcp[16];
  304. u16 vlan;
  305. u8 mac_address[6];
  306. u16 pci_address;
  307. u16 name_length;
  308. u16 name_offset;
  309. };
  310. struct acpi_ibft_target {
  311. struct acpi_ibft_header header;
  312. u8 target_ip_address[16];
  313. u16 target_ip_socket;
  314. u8 target_boot_lun[8];
  315. u8 chap_type;
  316. u8 nic_association;
  317. u16 target_name_length;
  318. u16 target_name_offset;
  319. u16 chap_name_length;
  320. u16 chap_name_offset;
  321. u16 chap_secret_length;
  322. u16 chap_secret_offset;
  323. u16 reverse_chap_name_length;
  324. u16 reverse_chap_name_offset;
  325. u16 reverse_chap_secret_length;
  326. u16 reverse_chap_secret_offset;
  327. };
  328. /*******************************************************************************
  329. *
  330. * MCFG - PCI Memory Mapped Configuration table and sub-table
  331. *
  332. ******************************************************************************/
  333. struct acpi_table_mcfg {
  334. struct acpi_table_header header; /* Common ACPI table header */
  335. u8 reserved[8];
  336. };
  337. /* Subtable */
  338. struct acpi_mcfg_allocation {
  339. u64 address; /* Base address, processor-relative */
  340. u16 pci_segment; /* PCI segment group number */
  341. u8 start_bus_number; /* Starting PCI Bus number */
  342. u8 end_bus_number; /* Final PCI Bus number */
  343. u32 reserved;
  344. };
  345. /*******************************************************************************
  346. *
  347. * SPCR - Serial Port Console Redirection table
  348. *
  349. ******************************************************************************/
  350. struct acpi_table_spcr {
  351. struct acpi_table_header header; /* Common ACPI table header */
  352. u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
  353. u8 reserved[3];
  354. struct acpi_generic_address serial_port;
  355. u8 interrupt_type;
  356. u8 pc_interrupt;
  357. u32 interrupt;
  358. u8 baud_rate;
  359. u8 parity;
  360. u8 stop_bits;
  361. u8 flow_control;
  362. u8 terminal_type;
  363. u8 reserved1;
  364. u16 pci_device_id;
  365. u16 pci_vendor_id;
  366. u8 pci_bus;
  367. u8 pci_device;
  368. u8 pci_function;
  369. u32 pci_flags;
  370. u8 pci_segment;
  371. u32 reserved2;
  372. };
  373. /*******************************************************************************
  374. *
  375. * SPMI - Server Platform Management Interface table
  376. *
  377. ******************************************************************************/
  378. struct acpi_table_spmi {
  379. struct acpi_table_header header; /* Common ACPI table header */
  380. u8 reserved;
  381. u8 interface_type;
  382. u16 spec_revision; /* Version of IPMI */
  383. u8 interrupt_type;
  384. u8 gpe_number; /* GPE assigned */
  385. u8 reserved1;
  386. u8 pci_device_flag;
  387. u32 interrupt;
  388. struct acpi_generic_address ipmi_register;
  389. u8 pci_segment;
  390. u8 pci_bus;
  391. u8 pci_device;
  392. u8 pci_function;
  393. };
  394. /*******************************************************************************
  395. *
  396. * TCPA - Trusted Computing Platform Alliance table
  397. *
  398. ******************************************************************************/
  399. struct acpi_table_tcpa {
  400. struct acpi_table_header header; /* Common ACPI table header */
  401. u16 reserved;
  402. u32 max_log_length; /* Maximum length for the event log area */
  403. u64 log_address; /* Address of the event log area */
  404. };
  405. /*******************************************************************************
  406. *
  407. * UEFI - UEFI Boot optimization Table
  408. *
  409. ******************************************************************************/
  410. struct acpi_table_uefi {
  411. struct acpi_table_header header; /* Common ACPI table header */
  412. u8 identifier[16]; /* UUID identifier */
  413. u16 data_offset; /* Offset of remaining data in table */
  414. u8 data;
  415. };
  416. /*******************************************************************************
  417. *
  418. * WDAT - Watchdog Action Table
  419. *
  420. ******************************************************************************/
  421. struct acpi_table_wdat {
  422. struct acpi_table_header header; /* Common ACPI table header */
  423. u32 header_length; /* Watchdog Header Length */
  424. u16 pci_segment; /* PCI Segment number */
  425. u8 pci_bus; /* PCI Bus number */
  426. u8 pci_device; /* PCI Device number */
  427. u8 pci_function; /* PCI Function number */
  428. u8 reserved[3];
  429. u32 timer_period; /* Period of one timer count (msec) */
  430. u32 max_count; /* Maximum counter value supported */
  431. u32 min_count; /* Minimum counter value */
  432. u8 flags;
  433. u8 reserved2[3];
  434. u32 entries; /* Number of watchdog entries that follow */
  435. };
  436. /* WDAT Instruction Entries (actions) */
  437. struct acpi_wdat_entry {
  438. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  439. };
  440. /* Values for Action field above */
  441. enum acpi_wdat_actions {
  442. ACPI_WDAT_RESET = 1,
  443. ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
  444. ACPI_WDAT_GET_COUNTDOWN = 5,
  445. ACPI_WDAT_SET_COUNTDOWN = 6,
  446. ACPI_WDAT_GET_RUNNING_STATE = 8,
  447. ACPI_WDAT_SET_RUNNING_STATE = 9,
  448. ACPI_WDAT_GET_STOPPED_STATE = 10,
  449. ACPI_WDAT_SET_STOPPED_STATE = 11,
  450. ACPI_WDAT_GET_REBOOT = 16,
  451. ACPI_WDAT_SET_REBOOT = 17,
  452. ACPI_WDAT_GET_SHUTDOWN = 18,
  453. ACPI_WDAT_SET_SHUTDOWN = 19,
  454. ACPI_WDAT_GET_STATUS = 32,
  455. ACPI_WDAT_SET_STATUS = 33,
  456. ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
  457. };
  458. /* Values for Instruction field above */
  459. enum acpi_wdat_instructions {
  460. ACPI_WDAT_READ_VALUE = 0,
  461. ACPI_WDAT_READ_COUNTDOWN = 1,
  462. ACPI_WDAT_WRITE_VALUE = 2,
  463. ACPI_WDAT_WRITE_COUNTDOWN = 3,
  464. ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
  465. ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
  466. };
  467. /*******************************************************************************
  468. *
  469. * WDRT - Watchdog Resource Table
  470. *
  471. ******************************************************************************/
  472. struct acpi_table_wdrt {
  473. struct acpi_table_header header; /* Common ACPI table header */
  474. u32 header_length; /* Watchdog Header Length */
  475. u8 pci_segment; /* PCI Segment number */
  476. u8 pci_bus; /* PCI Bus number */
  477. u8 pci_device; /* PCI Device number */
  478. u8 pci_function; /* PCI Function number */
  479. u32 timer_period; /* Period of one timer count (msec) */
  480. u32 max_count; /* Maximum counter value supported */
  481. u32 min_count; /* Minimum counter value */
  482. u8 flags;
  483. u8 reserved[3];
  484. u32 entries; /* Number of watchdog entries that follow */
  485. };
  486. /* Flags */
  487. #define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */
  488. /* Reset to default packing */
  489. #pragma pack()
  490. #endif /* __ACTBL2_H__ */