acrestyp.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. /******************************************************************************
  2. *
  3. * Name: acrestyp.h - Defines, types, and structures for resource descriptors
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2017, 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 u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */
  48. typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
  49. /*
  50. * Memory Attributes
  51. */
  52. #define ACPI_READ_ONLY_MEMORY (u8) 0x00
  53. #define ACPI_READ_WRITE_MEMORY (u8) 0x01
  54. #define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00
  55. #define ACPI_CACHABLE_MEMORY (u8) 0x01
  56. #define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02
  57. #define ACPI_PREFETCHABLE_MEMORY (u8) 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 (u8) 0x01
  66. #define ACPI_ISA_ONLY_RANGES (u8) 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 (u8) 0x01
  70. /*
  71. * IO Port Descriptor Decode
  72. */
  73. #define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */
  74. #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
  75. /*
  76. * Interrupt attributes - used in multiple descriptors
  77. */
  78. /* Triggering */
  79. #define ACPI_LEVEL_SENSITIVE (u8) 0x00
  80. #define ACPI_EDGE_SENSITIVE (u8) 0x01
  81. /* Polarity */
  82. #define ACPI_ACTIVE_HIGH (u8) 0x00
  83. #define ACPI_ACTIVE_LOW (u8) 0x01
  84. #define ACPI_ACTIVE_BOTH (u8) 0x02
  85. /* Sharing */
  86. #define ACPI_EXCLUSIVE (u8) 0x00
  87. #define ACPI_SHARED (u8) 0x01
  88. /* Wake */
  89. #define ACPI_NOT_WAKE_CAPABLE (u8) 0x00
  90. #define ACPI_WAKE_CAPABLE (u8) 0x01
  91. /*
  92. * DMA Attributes
  93. */
  94. #define ACPI_COMPATIBILITY (u8) 0x00
  95. #define ACPI_TYPE_A (u8) 0x01
  96. #define ACPI_TYPE_B (u8) 0x02
  97. #define ACPI_TYPE_F (u8) 0x03
  98. #define ACPI_NOT_BUS_MASTER (u8) 0x00
  99. #define ACPI_BUS_MASTER (u8) 0x01
  100. #define ACPI_TRANSFER_8 (u8) 0x00
  101. #define ACPI_TRANSFER_8_16 (u8) 0x01
  102. #define ACPI_TRANSFER_16 (u8) 0x02
  103. /*
  104. * Start Dependent Functions Priority definitions
  105. */
  106. #define ACPI_GOOD_CONFIGURATION (u8) 0x00
  107. #define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01
  108. #define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02
  109. /*
  110. * 16, 32 and 64-bit Address Descriptor resource types
  111. */
  112. #define ACPI_MEMORY_RANGE (u8) 0x00
  113. #define ACPI_IO_RANGE (u8) 0x01
  114. #define ACPI_BUS_NUMBER_RANGE (u8) 0x02
  115. #define ACPI_ADDRESS_NOT_FIXED (u8) 0x00
  116. #define ACPI_ADDRESS_FIXED (u8) 0x01
  117. #define ACPI_POS_DECODE (u8) 0x00
  118. #define ACPI_SUB_DECODE (u8) 0x01
  119. /* Producer/Consumer */
  120. #define ACPI_PRODUCER (u8) 0x00
  121. #define ACPI_CONSUMER (u8) 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. struct acpi_uuid {
  130. u8 data[ACPI_UUID_LENGTH];
  131. };
  132. struct acpi_vendor_uuid {
  133. u8 subtype;
  134. u8 data[ACPI_UUID_LENGTH];
  135. };
  136. /*
  137. * Structures used to describe device resources
  138. */
  139. struct acpi_resource_irq {
  140. u8 descriptor_length;
  141. u8 triggering;
  142. u8 polarity;
  143. u8 sharable;
  144. u8 wake_capable;
  145. u8 interrupt_count;
  146. u8 interrupts[1];
  147. };
  148. struct acpi_resource_dma {
  149. u8 type;
  150. u8 bus_master;
  151. u8 transfer;
  152. u8 channel_count;
  153. u8 channels[1];
  154. };
  155. struct acpi_resource_start_dependent {
  156. u8 descriptor_length;
  157. u8 compatibility_priority;
  158. u8 performance_robustness;
  159. };
  160. /*
  161. * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
  162. * needed because it has no fields
  163. */
  164. struct acpi_resource_io {
  165. u8 io_decode;
  166. u8 alignment;
  167. u8 address_length;
  168. u16 minimum;
  169. u16 maximum;
  170. };
  171. struct acpi_resource_fixed_io {
  172. u16 address;
  173. u8 address_length;
  174. };
  175. struct acpi_resource_fixed_dma {
  176. u16 request_lines;
  177. u16 channels;
  178. u8 width;
  179. };
  180. /* Values for Width field above */
  181. #define ACPI_DMA_WIDTH8 0
  182. #define ACPI_DMA_WIDTH16 1
  183. #define ACPI_DMA_WIDTH32 2
  184. #define ACPI_DMA_WIDTH64 3
  185. #define ACPI_DMA_WIDTH128 4
  186. #define ACPI_DMA_WIDTH256 5
  187. struct acpi_resource_vendor {
  188. u16 byte_length;
  189. u8 byte_data[1];
  190. };
  191. /* Vendor resource with UUID info (introduced in ACPI 3.0) */
  192. struct acpi_resource_vendor_typed {
  193. u16 byte_length;
  194. u8 uuid_subtype;
  195. u8 uuid[ACPI_UUID_LENGTH];
  196. u8 byte_data[1];
  197. };
  198. struct acpi_resource_end_tag {
  199. u8 checksum;
  200. };
  201. struct acpi_resource_memory24 {
  202. u8 write_protect;
  203. u16 minimum;
  204. u16 maximum;
  205. u16 alignment;
  206. u16 address_length;
  207. };
  208. struct acpi_resource_memory32 {
  209. u8 write_protect;
  210. u32 minimum;
  211. u32 maximum;
  212. u32 alignment;
  213. u32 address_length;
  214. };
  215. struct acpi_resource_fixed_memory32 {
  216. u8 write_protect;
  217. u32 address;
  218. u32 address_length;
  219. };
  220. struct acpi_memory_attribute {
  221. u8 write_protect;
  222. u8 caching;
  223. u8 range_type;
  224. u8 translation;
  225. };
  226. struct acpi_io_attribute {
  227. u8 range_type;
  228. u8 translation;
  229. u8 translation_type;
  230. u8 reserved1;
  231. };
  232. union acpi_resource_attribute {
  233. struct acpi_memory_attribute mem;
  234. struct acpi_io_attribute io;
  235. /* Used for the *word_space macros */
  236. u8 type_specific;
  237. };
  238. struct acpi_resource_label {
  239. u16 string_length;
  240. char *string_ptr;
  241. };
  242. struct acpi_resource_source {
  243. u8 index;
  244. u16 string_length;
  245. char *string_ptr;
  246. };
  247. /* Fields common to all address descriptors, 16/32/64 bit */
  248. #define ACPI_RESOURCE_ADDRESS_COMMON \
  249. u8 resource_type; \
  250. u8 producer_consumer; \
  251. u8 decode; \
  252. u8 min_address_fixed; \
  253. u8 max_address_fixed; \
  254. union acpi_resource_attribute info;
  255. struct acpi_address16_attribute {
  256. u16 granularity;
  257. u16 minimum;
  258. u16 maximum;
  259. u16 translation_offset;
  260. u16 address_length;
  261. };
  262. struct acpi_address32_attribute {
  263. u32 granularity;
  264. u32 minimum;
  265. u32 maximum;
  266. u32 translation_offset;
  267. u32 address_length;
  268. };
  269. struct acpi_address64_attribute {
  270. u64 granularity;
  271. u64 minimum;
  272. u64 maximum;
  273. u64 translation_offset;
  274. u64 address_length;
  275. };
  276. struct acpi_resource_address {
  277. ACPI_RESOURCE_ADDRESS_COMMON};
  278. struct acpi_resource_address16 {
  279. ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address16_attribute address;
  280. struct acpi_resource_source resource_source;
  281. };
  282. struct acpi_resource_address32 {
  283. ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address32_attribute address;
  284. struct acpi_resource_source resource_source;
  285. };
  286. struct acpi_resource_address64 {
  287. ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address64_attribute address;
  288. struct acpi_resource_source resource_source;
  289. };
  290. struct acpi_resource_extended_address64 {
  291. ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
  292. struct acpi_address64_attribute address;
  293. u64 type_specific;
  294. };
  295. struct acpi_resource_extended_irq {
  296. u8 producer_consumer;
  297. u8 triggering;
  298. u8 polarity;
  299. u8 sharable;
  300. u8 wake_capable;
  301. u8 interrupt_count;
  302. struct acpi_resource_source resource_source;
  303. u32 interrupts[1];
  304. };
  305. struct acpi_resource_generic_register {
  306. u8 space_id;
  307. u8 bit_width;
  308. u8 bit_offset;
  309. u8 access_size;
  310. u64 address;
  311. };
  312. struct acpi_resource_gpio {
  313. u8 revision_id;
  314. u8 connection_type;
  315. u8 producer_consumer; /* For values, see Producer/Consumer above */
  316. u8 pin_config;
  317. u8 sharable; /* For values, see Interrupt Attributes above */
  318. u8 wake_capable; /* For values, see Interrupt Attributes above */
  319. u8 io_restriction;
  320. u8 triggering; /* For values, see Interrupt Attributes above */
  321. u8 polarity; /* For values, see Interrupt Attributes above */
  322. u16 drive_strength;
  323. u16 debounce_timeout;
  324. u16 pin_table_length;
  325. u16 vendor_length;
  326. struct acpi_resource_source resource_source;
  327. u16 *pin_table;
  328. u8 *vendor_data;
  329. };
  330. /* Values for GPIO connection_type field above */
  331. #define ACPI_RESOURCE_GPIO_TYPE_INT 0
  332. #define ACPI_RESOURCE_GPIO_TYPE_IO 1
  333. /* Values for pin_config field above */
  334. #define ACPI_PIN_CONFIG_DEFAULT 0
  335. #define ACPI_PIN_CONFIG_PULLUP 1
  336. #define ACPI_PIN_CONFIG_PULLDOWN 2
  337. #define ACPI_PIN_CONFIG_NOPULL 3
  338. /* Values for io_restriction field above */
  339. #define ACPI_IO_RESTRICT_NONE 0
  340. #define ACPI_IO_RESTRICT_INPUT 1
  341. #define ACPI_IO_RESTRICT_OUTPUT 2
  342. #define ACPI_IO_RESTRICT_NONE_PRESERVE 3
  343. /* Common structure for I2C, SPI, and UART serial descriptors */
  344. #define ACPI_RESOURCE_SERIAL_COMMON \
  345. u8 revision_id; \
  346. u8 type; \
  347. u8 producer_consumer; /* For values, see Producer/Consumer above */\
  348. u8 slave_mode; \
  349. u8 connection_sharing; \
  350. u8 type_revision_id; \
  351. u16 type_data_length; \
  352. u16 vendor_length; \
  353. struct acpi_resource_source resource_source; \
  354. u8 *vendor_data;
  355. struct acpi_resource_common_serialbus {
  356. ACPI_RESOURCE_SERIAL_COMMON};
  357. /* Values for the Type field above */
  358. #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
  359. #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
  360. #define ACPI_RESOURCE_SERIAL_TYPE_UART 3
  361. /* Values for slave_mode field above */
  362. #define ACPI_CONTROLLER_INITIATED 0
  363. #define ACPI_DEVICE_INITIATED 1
  364. struct acpi_resource_i2c_serialbus {
  365. ACPI_RESOURCE_SERIAL_COMMON u8 access_mode;
  366. u16 slave_address;
  367. u32 connection_speed;
  368. };
  369. /* Values for access_mode field above */
  370. #define ACPI_I2C_7BIT_MODE 0
  371. #define ACPI_I2C_10BIT_MODE 1
  372. struct acpi_resource_spi_serialbus {
  373. ACPI_RESOURCE_SERIAL_COMMON u8 wire_mode;
  374. u8 device_polarity;
  375. u8 data_bit_length;
  376. u8 clock_phase;
  377. u8 clock_polarity;
  378. u16 device_selection;
  379. u32 connection_speed;
  380. };
  381. /* Values for wire_mode field above */
  382. #define ACPI_SPI_4WIRE_MODE 0
  383. #define ACPI_SPI_3WIRE_MODE 1
  384. /* Values for device_polarity field above */
  385. #define ACPI_SPI_ACTIVE_LOW 0
  386. #define ACPI_SPI_ACTIVE_HIGH 1
  387. /* Values for clock_phase field above */
  388. #define ACPI_SPI_FIRST_PHASE 0
  389. #define ACPI_SPI_SECOND_PHASE 1
  390. /* Values for clock_polarity field above */
  391. #define ACPI_SPI_START_LOW 0
  392. #define ACPI_SPI_START_HIGH 1
  393. struct acpi_resource_uart_serialbus {
  394. ACPI_RESOURCE_SERIAL_COMMON u8 endian;
  395. u8 data_bits;
  396. u8 stop_bits;
  397. u8 flow_control;
  398. u8 parity;
  399. u8 lines_enabled;
  400. u16 rx_fifo_size;
  401. u16 tx_fifo_size;
  402. u32 default_baud_rate;
  403. };
  404. /* Values for Endian field above */
  405. #define ACPI_UART_LITTLE_ENDIAN 0
  406. #define ACPI_UART_BIG_ENDIAN 1
  407. /* Values for data_bits field above */
  408. #define ACPI_UART_5_DATA_BITS 0
  409. #define ACPI_UART_6_DATA_BITS 1
  410. #define ACPI_UART_7_DATA_BITS 2
  411. #define ACPI_UART_8_DATA_BITS 3
  412. #define ACPI_UART_9_DATA_BITS 4
  413. /* Values for stop_bits field above */
  414. #define ACPI_UART_NO_STOP_BITS 0
  415. #define ACPI_UART_1_STOP_BIT 1
  416. #define ACPI_UART_1P5_STOP_BITS 2
  417. #define ACPI_UART_2_STOP_BITS 3
  418. /* Values for flow_control field above */
  419. #define ACPI_UART_FLOW_CONTROL_NONE 0
  420. #define ACPI_UART_FLOW_CONTROL_HW 1
  421. #define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
  422. /* Values for Parity field above */
  423. #define ACPI_UART_PARITY_NONE 0
  424. #define ACPI_UART_PARITY_EVEN 1
  425. #define ACPI_UART_PARITY_ODD 2
  426. #define ACPI_UART_PARITY_MARK 3
  427. #define ACPI_UART_PARITY_SPACE 4
  428. /* Values for lines_enabled bitfield above */
  429. #define ACPI_UART_CARRIER_DETECT (1<<2)
  430. #define ACPI_UART_RING_INDICATOR (1<<3)
  431. #define ACPI_UART_DATA_SET_READY (1<<4)
  432. #define ACPI_UART_DATA_TERMINAL_READY (1<<5)
  433. #define ACPI_UART_CLEAR_TO_SEND (1<<6)
  434. #define ACPI_UART_REQUEST_TO_SEND (1<<7)
  435. struct acpi_resource_pin_function {
  436. u8 revision_id;
  437. u8 pin_config;
  438. u8 sharable; /* For values, see Interrupt Attributes above */
  439. u16 function_number;
  440. u16 pin_table_length;
  441. u16 vendor_length;
  442. struct acpi_resource_source resource_source;
  443. u16 *pin_table;
  444. u8 *vendor_data;
  445. };
  446. struct acpi_resource_pin_config {
  447. u8 revision_id;
  448. u8 producer_consumer; /* For values, see Producer/Consumer above */
  449. u8 sharable; /* For values, see Interrupt Attributes above */
  450. u8 pin_config_type;
  451. u32 pin_config_value;
  452. u16 pin_table_length;
  453. u16 vendor_length;
  454. struct acpi_resource_source resource_source;
  455. u16 *pin_table;
  456. u8 *vendor_data;
  457. };
  458. /* Values for pin_config_type field above */
  459. #define ACPI_PIN_CONFIG_DEFAULT 0
  460. #define ACPI_PIN_CONFIG_BIAS_PULL_UP 1
  461. #define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2
  462. #define ACPI_PIN_CONFIG_BIAS_DEFAULT 3
  463. #define ACPI_PIN_CONFIG_BIAS_DISABLE 4
  464. #define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5
  465. #define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6
  466. #define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7
  467. #define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8
  468. #define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9
  469. #define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10
  470. #define ACPI_PIN_CONFIG_SLEW_RATE 11
  471. #define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12
  472. #define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13
  473. struct acpi_resource_pin_group {
  474. u8 revision_id;
  475. u8 producer_consumer; /* For values, see Producer/Consumer above */
  476. u16 pin_table_length;
  477. u16 vendor_length;
  478. u16 *pin_table;
  479. struct acpi_resource_label resource_label;
  480. u8 *vendor_data;
  481. };
  482. struct acpi_resource_pin_group_function {
  483. u8 revision_id;
  484. u8 producer_consumer; /* For values, see Producer/Consumer above */
  485. u8 sharable; /* For values, see Interrupt Attributes above */
  486. u16 function_number;
  487. u16 vendor_length;
  488. struct acpi_resource_source resource_source;
  489. struct acpi_resource_label resource_source_label;
  490. u8 *vendor_data;
  491. };
  492. struct acpi_resource_pin_group_config {
  493. u8 revision_id;
  494. u8 producer_consumer; /* For values, see Producer/Consumer above */
  495. u8 sharable; /* For values, see Interrupt Attributes above */
  496. u8 pin_config_type; /* For values, see pin_config_type above */
  497. u32 pin_config_value;
  498. u16 vendor_length;
  499. struct acpi_resource_source resource_source;
  500. struct acpi_resource_label resource_source_label;
  501. u8 *vendor_data;
  502. };
  503. /* ACPI_RESOURCE_TYPEs */
  504. #define ACPI_RESOURCE_TYPE_IRQ 0
  505. #define ACPI_RESOURCE_TYPE_DMA 1
  506. #define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
  507. #define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
  508. #define ACPI_RESOURCE_TYPE_IO 4
  509. #define ACPI_RESOURCE_TYPE_FIXED_IO 5
  510. #define ACPI_RESOURCE_TYPE_VENDOR 6
  511. #define ACPI_RESOURCE_TYPE_END_TAG 7
  512. #define ACPI_RESOURCE_TYPE_MEMORY24 8
  513. #define ACPI_RESOURCE_TYPE_MEMORY32 9
  514. #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
  515. #define ACPI_RESOURCE_TYPE_ADDRESS16 11
  516. #define ACPI_RESOURCE_TYPE_ADDRESS32 12
  517. #define ACPI_RESOURCE_TYPE_ADDRESS64 13
  518. #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
  519. #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
  520. #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
  521. #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
  522. #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
  523. #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
  524. #define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */
  525. #define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */
  526. #define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */
  527. #define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */
  528. #define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */
  529. #define ACPI_RESOURCE_TYPE_MAX 24
  530. /* Master union for resource descriptors */
  531. union acpi_resource_data {
  532. struct acpi_resource_irq irq;
  533. struct acpi_resource_dma dma;
  534. struct acpi_resource_start_dependent start_dpf;
  535. struct acpi_resource_io io;
  536. struct acpi_resource_fixed_io fixed_io;
  537. struct acpi_resource_fixed_dma fixed_dma;
  538. struct acpi_resource_vendor vendor;
  539. struct acpi_resource_vendor_typed vendor_typed;
  540. struct acpi_resource_end_tag end_tag;
  541. struct acpi_resource_memory24 memory24;
  542. struct acpi_resource_memory32 memory32;
  543. struct acpi_resource_fixed_memory32 fixed_memory32;
  544. struct acpi_resource_address16 address16;
  545. struct acpi_resource_address32 address32;
  546. struct acpi_resource_address64 address64;
  547. struct acpi_resource_extended_address64 ext_address64;
  548. struct acpi_resource_extended_irq extended_irq;
  549. struct acpi_resource_generic_register generic_reg;
  550. struct acpi_resource_gpio gpio;
  551. struct acpi_resource_i2c_serialbus i2c_serial_bus;
  552. struct acpi_resource_spi_serialbus spi_serial_bus;
  553. struct acpi_resource_uart_serialbus uart_serial_bus;
  554. struct acpi_resource_common_serialbus common_serial_bus;
  555. struct acpi_resource_pin_function pin_function;
  556. struct acpi_resource_pin_config pin_config;
  557. struct acpi_resource_pin_group pin_group;
  558. struct acpi_resource_pin_group_function pin_group_function;
  559. struct acpi_resource_pin_group_config pin_group_config;
  560. /* Common fields */
  561. struct acpi_resource_address address; /* Common 16/32/64 address fields */
  562. };
  563. /* Common resource header */
  564. struct acpi_resource {
  565. u32 type;
  566. u32 length;
  567. union acpi_resource_data data;
  568. };
  569. /* restore default alignment */
  570. #pragma pack()
  571. #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
  572. #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
  573. #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
  574. /* Macro for walking resource templates with multiple descriptors */
  575. #define ACPI_NEXT_RESOURCE(res) \
  576. ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length)
  577. struct acpi_pci_routing_table {
  578. u32 length;
  579. u32 pin;
  580. u64 address; /* here for 64-bit alignment */
  581. u32 source_index;
  582. char source[4]; /* pad to 64 bits so sizeof() works in all cases */
  583. };
  584. #endif /* __ACRESTYP_H__ */