acrestyp.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. /******************************************************************************
  2. *
  3. * Name: acrestyp.h - Defines, types, and structures for resource descriptors
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2015, 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 __ACRESTYP_H__
  43. #define __ACRESTYP_H__
  44. /*
  45. * Definitions for Resource Attributes
  46. */
  47. typedef UINT16 ACPI_RS_LENGTH; /* Resource Length field is fixed at 16 bits */
  48. typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
  49. /*
  50. * Memory Attributes
  51. */
  52. #define ACPI_READ_ONLY_MEMORY (UINT8) 0x00
  53. #define ACPI_READ_WRITE_MEMORY (UINT8) 0x01
  54. #define ACPI_NON_CACHEABLE_MEMORY (UINT8) 0x00
  55. #define ACPI_CACHABLE_MEMORY (UINT8) 0x01
  56. #define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02
  57. #define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03
  58. /*! [Begin] no source code translation */
  59. /*
  60. * IO Attributes
  61. * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
  62. * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
  63. */
  64. /*! [End] no source code translation !*/
  65. #define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01
  66. #define ACPI_ISA_ONLY_RANGES (UINT8) 0x02
  67. #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
  68. /* Type of translation - 1=Sparse, 0=Dense */
  69. #define ACPI_SPARSE_TRANSLATION (UINT8) 0x01
  70. /*
  71. * IO Port Descriptor Decode
  72. */
  73. #define ACPI_DECODE_10 (UINT8) 0x00 /* 10-bit IO address decode */
  74. #define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */
  75. /*
  76. * Interrupt attributes - used in multiple descriptors
  77. */
  78. /* Triggering */
  79. #define ACPI_LEVEL_SENSITIVE (UINT8) 0x00
  80. #define ACPI_EDGE_SENSITIVE (UINT8) 0x01
  81. /* Polarity */
  82. #define ACPI_ACTIVE_HIGH (UINT8) 0x00
  83. #define ACPI_ACTIVE_LOW (UINT8) 0x01
  84. #define ACPI_ACTIVE_BOTH (UINT8) 0x02
  85. /* Sharing */
  86. #define ACPI_EXCLUSIVE (UINT8) 0x00
  87. #define ACPI_SHARED (UINT8) 0x01
  88. /* Wake */
  89. #define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00
  90. #define ACPI_WAKE_CAPABLE (UINT8) 0x01
  91. /*
  92. * DMA Attributes
  93. */
  94. #define ACPI_COMPATIBILITY (UINT8) 0x00
  95. #define ACPI_TYPE_A (UINT8) 0x01
  96. #define ACPI_TYPE_B (UINT8) 0x02
  97. #define ACPI_TYPE_F (UINT8) 0x03
  98. #define ACPI_NOT_BUS_MASTER (UINT8) 0x00
  99. #define ACPI_BUS_MASTER (UINT8) 0x01
  100. #define ACPI_TRANSFER_8 (UINT8) 0x00
  101. #define ACPI_TRANSFER_8_16 (UINT8) 0x01
  102. #define ACPI_TRANSFER_16 (UINT8) 0x02
  103. /*
  104. * Start Dependent Functions Priority definitions
  105. */
  106. #define ACPI_GOOD_CONFIGURATION (UINT8) 0x00
  107. #define ACPI_ACCEPTABLE_CONFIGURATION (UINT8) 0x01
  108. #define ACPI_SUB_OPTIMAL_CONFIGURATION (UINT8) 0x02
  109. /*
  110. * 16, 32 and 64-bit Address Descriptor resource types
  111. */
  112. #define ACPI_MEMORY_RANGE (UINT8) 0x00
  113. #define ACPI_IO_RANGE (UINT8) 0x01
  114. #define ACPI_BUS_NUMBER_RANGE (UINT8) 0x02
  115. #define ACPI_ADDRESS_NOT_FIXED (UINT8) 0x00
  116. #define ACPI_ADDRESS_FIXED (UINT8) 0x01
  117. #define ACPI_POS_DECODE (UINT8) 0x00
  118. #define ACPI_SUB_DECODE (UINT8) 0x01
  119. /* Producer/Consumer */
  120. #define ACPI_PRODUCER (UINT8) 0x00
  121. #define ACPI_CONSUMER (UINT8) 0x01
  122. /*
  123. * If possible, pack the following structures to byte alignment
  124. */
  125. #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
  126. #pragma pack(1)
  127. #endif
  128. /* UUID data structures for use in vendor-defined resource descriptors */
  129. typedef struct acpi_uuid
  130. {
  131. UINT8 Data[ACPI_UUID_LENGTH];
  132. } ACPI_UUID;
  133. typedef struct acpi_vendor_uuid
  134. {
  135. UINT8 Subtype;
  136. UINT8 Data[ACPI_UUID_LENGTH];
  137. } ACPI_VENDOR_UUID;
  138. /*
  139. * Structures used to describe device resources
  140. */
  141. typedef struct acpi_resource_irq
  142. {
  143. UINT8 DescriptorLength;
  144. UINT8 Triggering;
  145. UINT8 Polarity;
  146. UINT8 Sharable;
  147. UINT8 WakeCapable;
  148. UINT8 InterruptCount;
  149. UINT8 Interrupts[1];
  150. } ACPI_RESOURCE_IRQ;
  151. typedef struct acpi_resource_dma
  152. {
  153. UINT8 Type;
  154. UINT8 BusMaster;
  155. UINT8 Transfer;
  156. UINT8 ChannelCount;
  157. UINT8 Channels[1];
  158. } ACPI_RESOURCE_DMA;
  159. typedef struct acpi_resource_start_dependent
  160. {
  161. UINT8 DescriptorLength;
  162. UINT8 CompatibilityPriority;
  163. UINT8 PerformanceRobustness;
  164. } ACPI_RESOURCE_START_DEPENDENT;
  165. /*
  166. * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
  167. * needed because it has no fields
  168. */
  169. typedef struct acpi_resource_io
  170. {
  171. UINT8 IoDecode;
  172. UINT8 Alignment;
  173. UINT8 AddressLength;
  174. UINT16 Minimum;
  175. UINT16 Maximum;
  176. } ACPI_RESOURCE_IO;
  177. typedef struct acpi_resource_fixed_io
  178. {
  179. UINT16 Address;
  180. UINT8 AddressLength;
  181. } ACPI_RESOURCE_FIXED_IO;
  182. typedef struct acpi_resource_fixed_dma
  183. {
  184. UINT16 RequestLines;
  185. UINT16 Channels;
  186. UINT8 Width;
  187. } ACPI_RESOURCE_FIXED_DMA;
  188. /* Values for Width field above */
  189. #define ACPI_DMA_WIDTH8 0
  190. #define ACPI_DMA_WIDTH16 1
  191. #define ACPI_DMA_WIDTH32 2
  192. #define ACPI_DMA_WIDTH64 3
  193. #define ACPI_DMA_WIDTH128 4
  194. #define ACPI_DMA_WIDTH256 5
  195. typedef struct acpi_resource_vendor
  196. {
  197. UINT16 ByteLength;
  198. UINT8 ByteData[1];
  199. } ACPI_RESOURCE_VENDOR;
  200. /* Vendor resource with UUID info (introduced in ACPI 3.0) */
  201. typedef struct acpi_resource_vendor_typed
  202. {
  203. UINT16 ByteLength;
  204. UINT8 UuidSubtype;
  205. UINT8 Uuid[ACPI_UUID_LENGTH];
  206. UINT8 ByteData[1];
  207. } ACPI_RESOURCE_VENDOR_TYPED;
  208. typedef struct acpi_resource_end_tag
  209. {
  210. UINT8 Checksum;
  211. } ACPI_RESOURCE_END_TAG;
  212. typedef struct acpi_resource_memory24
  213. {
  214. UINT8 WriteProtect;
  215. UINT16 Minimum;
  216. UINT16 Maximum;
  217. UINT16 Alignment;
  218. UINT16 AddressLength;
  219. } ACPI_RESOURCE_MEMORY24;
  220. typedef struct acpi_resource_memory32
  221. {
  222. UINT8 WriteProtect;
  223. UINT32 Minimum;
  224. UINT32 Maximum;
  225. UINT32 Alignment;
  226. UINT32 AddressLength;
  227. } ACPI_RESOURCE_MEMORY32;
  228. typedef struct acpi_resource_fixed_memory32
  229. {
  230. UINT8 WriteProtect;
  231. UINT32 Address;
  232. UINT32 AddressLength;
  233. } ACPI_RESOURCE_FIXED_MEMORY32;
  234. typedef struct acpi_memory_attribute
  235. {
  236. UINT8 WriteProtect;
  237. UINT8 Caching;
  238. UINT8 RangeType;
  239. UINT8 Translation;
  240. } ACPI_MEMORY_ATTRIBUTE;
  241. typedef struct acpi_io_attribute
  242. {
  243. UINT8 RangeType;
  244. UINT8 Translation;
  245. UINT8 TranslationType;
  246. UINT8 Reserved1;
  247. } ACPI_IO_ATTRIBUTE;
  248. typedef union acpi_resource_attribute
  249. {
  250. ACPI_MEMORY_ATTRIBUTE Mem;
  251. ACPI_IO_ATTRIBUTE Io;
  252. /* Used for the *WordSpace macros */
  253. UINT8 TypeSpecific;
  254. } ACPI_RESOURCE_ATTRIBUTE;
  255. typedef struct acpi_resource_source
  256. {
  257. UINT8 Index;
  258. UINT16 StringLength;
  259. char *StringPtr;
  260. } ACPI_RESOURCE_SOURCE;
  261. /* Fields common to all address descriptors, 16/32/64 bit */
  262. #define ACPI_RESOURCE_ADDRESS_COMMON \
  263. UINT8 ResourceType; \
  264. UINT8 ProducerConsumer; \
  265. UINT8 Decode; \
  266. UINT8 MinAddressFixed; \
  267. UINT8 MaxAddressFixed; \
  268. ACPI_RESOURCE_ATTRIBUTE Info;
  269. typedef struct acpi_address16_attribute
  270. {
  271. UINT16 Granularity;
  272. UINT16 Minimum;
  273. UINT16 Maximum;
  274. UINT16 TranslationOffset;
  275. UINT16 AddressLength;
  276. } ACPI_ADDRESS16_ATTRIBUTE;
  277. typedef struct acpi_address32_attribute
  278. {
  279. UINT32 Granularity;
  280. UINT32 Minimum;
  281. UINT32 Maximum;
  282. UINT32 TranslationOffset;
  283. UINT32 AddressLength;
  284. } ACPI_ADDRESS32_ATTRIBUTE;
  285. typedef struct acpi_address64_attribute
  286. {
  287. UINT64 Granularity;
  288. UINT64 Minimum;
  289. UINT64 Maximum;
  290. UINT64 TranslationOffset;
  291. UINT64 AddressLength;
  292. } ACPI_ADDRESS64_ATTRIBUTE;
  293. typedef struct acpi_resource_address
  294. {
  295. ACPI_RESOURCE_ADDRESS_COMMON
  296. } ACPI_RESOURCE_ADDRESS;
  297. typedef struct acpi_resource_address16
  298. {
  299. ACPI_RESOURCE_ADDRESS_COMMON
  300. ACPI_ADDRESS16_ATTRIBUTE Address;
  301. ACPI_RESOURCE_SOURCE ResourceSource;
  302. } ACPI_RESOURCE_ADDRESS16;
  303. typedef struct acpi_resource_address32
  304. {
  305. ACPI_RESOURCE_ADDRESS_COMMON
  306. ACPI_ADDRESS32_ATTRIBUTE Address;
  307. ACPI_RESOURCE_SOURCE ResourceSource;
  308. } ACPI_RESOURCE_ADDRESS32;
  309. typedef struct acpi_resource_address64
  310. {
  311. ACPI_RESOURCE_ADDRESS_COMMON
  312. ACPI_ADDRESS64_ATTRIBUTE Address;
  313. ACPI_RESOURCE_SOURCE ResourceSource;
  314. } ACPI_RESOURCE_ADDRESS64;
  315. typedef struct acpi_resource_extended_address64
  316. {
  317. ACPI_RESOURCE_ADDRESS_COMMON
  318. UINT8 RevisionID;
  319. ACPI_ADDRESS64_ATTRIBUTE Address;
  320. UINT64 TypeSpecific;
  321. } ACPI_RESOURCE_EXTENDED_ADDRESS64;
  322. typedef struct acpi_resource_extended_irq
  323. {
  324. UINT8 ProducerConsumer;
  325. UINT8 Triggering;
  326. UINT8 Polarity;
  327. UINT8 Sharable;
  328. UINT8 WakeCapable;
  329. UINT8 InterruptCount;
  330. ACPI_RESOURCE_SOURCE ResourceSource;
  331. UINT32 Interrupts[1];
  332. } ACPI_RESOURCE_EXTENDED_IRQ;
  333. typedef struct acpi_resource_generic_register
  334. {
  335. UINT8 SpaceId;
  336. UINT8 BitWidth;
  337. UINT8 BitOffset;
  338. UINT8 AccessSize;
  339. UINT64 Address;
  340. } ACPI_RESOURCE_GENERIC_REGISTER;
  341. typedef struct acpi_resource_gpio
  342. {
  343. UINT8 RevisionId;
  344. UINT8 ConnectionType;
  345. UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
  346. UINT8 PinConfig;
  347. UINT8 Sharable; /* For values, see Interrupt Attributes above */
  348. UINT8 WakeCapable; /* For values, see Interrupt Attributes above */
  349. UINT8 IoRestriction;
  350. UINT8 Triggering; /* For values, see Interrupt Attributes above */
  351. UINT8 Polarity; /* For values, see Interrupt Attributes above */
  352. UINT16 DriveStrength;
  353. UINT16 DebounceTimeout;
  354. UINT16 PinTableLength;
  355. UINT16 VendorLength;
  356. ACPI_RESOURCE_SOURCE ResourceSource;
  357. UINT16 *PinTable;
  358. UINT8 *VendorData;
  359. } ACPI_RESOURCE_GPIO;
  360. /* Values for GPIO ConnectionType field above */
  361. #define ACPI_RESOURCE_GPIO_TYPE_INT 0
  362. #define ACPI_RESOURCE_GPIO_TYPE_IO 1
  363. /* Values for PinConfig field above */
  364. #define ACPI_PIN_CONFIG_DEFAULT 0
  365. #define ACPI_PIN_CONFIG_PULLUP 1
  366. #define ACPI_PIN_CONFIG_PULLDOWN 2
  367. #define ACPI_PIN_CONFIG_NOPULL 3
  368. /* Values for IoRestriction field above */
  369. #define ACPI_IO_RESTRICT_NONE 0
  370. #define ACPI_IO_RESTRICT_INPUT 1
  371. #define ACPI_IO_RESTRICT_OUTPUT 2
  372. #define ACPI_IO_RESTRICT_NONE_PRESERVE 3
  373. /* Common structure for I2C, SPI, and UART serial descriptors */
  374. #define ACPI_RESOURCE_SERIAL_COMMON \
  375. UINT8 RevisionId; \
  376. UINT8 Type; \
  377. UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\
  378. UINT8 SlaveMode; \
  379. UINT8 TypeRevisionId; \
  380. UINT16 TypeDataLength; \
  381. UINT16 VendorLength; \
  382. ACPI_RESOURCE_SOURCE ResourceSource; \
  383. UINT8 *VendorData;
  384. typedef struct acpi_resource_common_serialbus
  385. {
  386. ACPI_RESOURCE_SERIAL_COMMON
  387. } ACPI_RESOURCE_COMMON_SERIALBUS;
  388. /* Values for the Type field above */
  389. #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
  390. #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
  391. #define ACPI_RESOURCE_SERIAL_TYPE_UART 3
  392. /* Values for SlaveMode field above */
  393. #define ACPI_CONTROLLER_INITIATED 0
  394. #define ACPI_DEVICE_INITIATED 1
  395. typedef struct acpi_resource_i2c_serialbus
  396. {
  397. ACPI_RESOURCE_SERIAL_COMMON
  398. UINT8 AccessMode;
  399. UINT16 SlaveAddress;
  400. UINT32 ConnectionSpeed;
  401. } ACPI_RESOURCE_I2C_SERIALBUS;
  402. /* Values for AccessMode field above */
  403. #define ACPI_I2C_7BIT_MODE 0
  404. #define ACPI_I2C_10BIT_MODE 1
  405. typedef struct acpi_resource_spi_serialbus
  406. {
  407. ACPI_RESOURCE_SERIAL_COMMON
  408. UINT8 WireMode;
  409. UINT8 DevicePolarity;
  410. UINT8 DataBitLength;
  411. UINT8 ClockPhase;
  412. UINT8 ClockPolarity;
  413. UINT16 DeviceSelection;
  414. UINT32 ConnectionSpeed;
  415. } ACPI_RESOURCE_SPI_SERIALBUS;
  416. /* Values for WireMode field above */
  417. #define ACPI_SPI_4WIRE_MODE 0
  418. #define ACPI_SPI_3WIRE_MODE 1
  419. /* Values for DevicePolarity field above */
  420. #define ACPI_SPI_ACTIVE_LOW 0
  421. #define ACPI_SPI_ACTIVE_HIGH 1
  422. /* Values for ClockPhase field above */
  423. #define ACPI_SPI_FIRST_PHASE 0
  424. #define ACPI_SPI_SECOND_PHASE 1
  425. /* Values for ClockPolarity field above */
  426. #define ACPI_SPI_START_LOW 0
  427. #define ACPI_SPI_START_HIGH 1
  428. typedef struct acpi_resource_uart_serialbus
  429. {
  430. ACPI_RESOURCE_SERIAL_COMMON
  431. UINT8 Endian;
  432. UINT8 DataBits;
  433. UINT8 StopBits;
  434. UINT8 FlowControl;
  435. UINT8 Parity;
  436. UINT8 LinesEnabled;
  437. UINT16 RxFifoSize;
  438. UINT16 TxFifoSize;
  439. UINT32 DefaultBaudRate;
  440. } ACPI_RESOURCE_UART_SERIALBUS;
  441. /* Values for Endian field above */
  442. #define ACPI_UART_LITTLE_ENDIAN 0
  443. #define ACPI_UART_BIG_ENDIAN 1
  444. /* Values for DataBits field above */
  445. #define ACPI_UART_5_DATA_BITS 0
  446. #define ACPI_UART_6_DATA_BITS 1
  447. #define ACPI_UART_7_DATA_BITS 2
  448. #define ACPI_UART_8_DATA_BITS 3
  449. #define ACPI_UART_9_DATA_BITS 4
  450. /* Values for StopBits field above */
  451. #define ACPI_UART_NO_STOP_BITS 0
  452. #define ACPI_UART_1_STOP_BIT 1
  453. #define ACPI_UART_1P5_STOP_BITS 2
  454. #define ACPI_UART_2_STOP_BITS 3
  455. /* Values for FlowControl field above */
  456. #define ACPI_UART_FLOW_CONTROL_NONE 0
  457. #define ACPI_UART_FLOW_CONTROL_HW 1
  458. #define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
  459. /* Values for Parity field above */
  460. #define ACPI_UART_PARITY_NONE 0
  461. #define ACPI_UART_PARITY_EVEN 1
  462. #define ACPI_UART_PARITY_ODD 2
  463. #define ACPI_UART_PARITY_MARK 3
  464. #define ACPI_UART_PARITY_SPACE 4
  465. /* Values for LinesEnabled bitfield above */
  466. #define ACPI_UART_CARRIER_DETECT (1<<2)
  467. #define ACPI_UART_RING_INDICATOR (1<<3)
  468. #define ACPI_UART_DATA_SET_READY (1<<4)
  469. #define ACPI_UART_DATA_TERMINAL_READY (1<<5)
  470. #define ACPI_UART_CLEAR_TO_SEND (1<<6)
  471. #define ACPI_UART_REQUEST_TO_SEND (1<<7)
  472. /* ACPI_RESOURCE_TYPEs */
  473. #define ACPI_RESOURCE_TYPE_IRQ 0
  474. #define ACPI_RESOURCE_TYPE_DMA 1
  475. #define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
  476. #define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
  477. #define ACPI_RESOURCE_TYPE_IO 4
  478. #define ACPI_RESOURCE_TYPE_FIXED_IO 5
  479. #define ACPI_RESOURCE_TYPE_VENDOR 6
  480. #define ACPI_RESOURCE_TYPE_END_TAG 7
  481. #define ACPI_RESOURCE_TYPE_MEMORY24 8
  482. #define ACPI_RESOURCE_TYPE_MEMORY32 9
  483. #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
  484. #define ACPI_RESOURCE_TYPE_ADDRESS16 11
  485. #define ACPI_RESOURCE_TYPE_ADDRESS32 12
  486. #define ACPI_RESOURCE_TYPE_ADDRESS64 13
  487. #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
  488. #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
  489. #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
  490. #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
  491. #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
  492. #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
  493. #define ACPI_RESOURCE_TYPE_MAX 19
  494. /* Master union for resource descriptors */
  495. typedef union acpi_resource_data
  496. {
  497. ACPI_RESOURCE_IRQ Irq;
  498. ACPI_RESOURCE_DMA Dma;
  499. ACPI_RESOURCE_START_DEPENDENT StartDpf;
  500. ACPI_RESOURCE_IO Io;
  501. ACPI_RESOURCE_FIXED_IO FixedIo;
  502. ACPI_RESOURCE_FIXED_DMA FixedDma;
  503. ACPI_RESOURCE_VENDOR Vendor;
  504. ACPI_RESOURCE_VENDOR_TYPED VendorTyped;
  505. ACPI_RESOURCE_END_TAG EndTag;
  506. ACPI_RESOURCE_MEMORY24 Memory24;
  507. ACPI_RESOURCE_MEMORY32 Memory32;
  508. ACPI_RESOURCE_FIXED_MEMORY32 FixedMemory32;
  509. ACPI_RESOURCE_ADDRESS16 Address16;
  510. ACPI_RESOURCE_ADDRESS32 Address32;
  511. ACPI_RESOURCE_ADDRESS64 Address64;
  512. ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
  513. ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;
  514. ACPI_RESOURCE_GENERIC_REGISTER GenericReg;
  515. ACPI_RESOURCE_GPIO Gpio;
  516. ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus;
  517. ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;
  518. ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;
  519. ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
  520. /* Common fields */
  521. ACPI_RESOURCE_ADDRESS Address; /* Common 16/32/64 address fields */
  522. } ACPI_RESOURCE_DATA;
  523. /* Common resource header */
  524. typedef struct acpi_resource
  525. {
  526. UINT32 Type;
  527. UINT32 Length;
  528. ACPI_RESOURCE_DATA Data;
  529. } ACPI_RESOURCE;
  530. /* restore default alignment */
  531. #pragma pack()
  532. #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
  533. #define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
  534. #define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
  535. /* Macro for walking resource templates with multiple descriptors */
  536. #define ACPI_NEXT_RESOURCE(Res) \
  537. ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length)
  538. typedef struct acpi_pci_routing_table
  539. {
  540. UINT32 Length;
  541. UINT32 Pin;
  542. UINT64 Address; /* here for 64-bit alignment */
  543. UINT32 SourceIndex;
  544. char Source[4]; /* pad to 64 bits so sizeof() works in all cases */
  545. } ACPI_PCI_ROUTING_TABLE;
  546. #endif /* __ACRESTYP_H__ */