diff options
author | Lin Ming <ming.m.lin@intel.com> | 2011-11-16 01:38:13 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-01-17 03:36:30 -0500 |
commit | e0fe0a8d4ed5474261d0ee1452f5d9ae77236958 (patch) | |
tree | cec332ccaab7fa0dd03cbc87ea1212f7182c2309 /include/acpi | |
parent | 2da120b6847f85c406f9afa13853e2755684389e (diff) |
ACPI 5.0: Support for all new resource descriptors
FixedDMA, GPIO descriptors, SerialBus descriptors
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acrestyp.h | 207 |
1 files changed, 203 insertions, 4 deletions
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index 0a66cc45dd6b..3506e39a66b1 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h | |||
@@ -61,11 +61,14 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6 | |||
61 | #define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 | 61 | #define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 |
62 | #define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 | 62 | #define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 |
63 | 63 | ||
64 | /*! [Begin] no source code translation */ | ||
64 | /* | 65 | /* |
65 | * IO Attributes | 66 | * IO Attributes |
66 | * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. | 67 | * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. |
67 | * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. | 68 | * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. |
68 | */ | 69 | */ |
70 | /*! [End] no source code translation !*/ | ||
71 | |||
69 | #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 | 72 | #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 |
70 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 | 73 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 |
71 | #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) | 74 | #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) |
@@ -81,16 +84,26 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6 | |||
81 | #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ | 84 | #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ |
82 | 85 | ||
83 | /* | 86 | /* |
84 | * IRQ Attributes | 87 | * Interrupt attributes - used in multiple descriptors |
85 | */ | 88 | */ |
89 | |||
90 | /* Triggering */ | ||
91 | |||
86 | #define ACPI_LEVEL_SENSITIVE (u8) 0x00 | 92 | #define ACPI_LEVEL_SENSITIVE (u8) 0x00 |
87 | #define ACPI_EDGE_SENSITIVE (u8) 0x01 | 93 | #define ACPI_EDGE_SENSITIVE (u8) 0x01 |
88 | 94 | ||
95 | /* Polarity */ | ||
96 | |||
89 | #define ACPI_ACTIVE_HIGH (u8) 0x00 | 97 | #define ACPI_ACTIVE_HIGH (u8) 0x00 |
90 | #define ACPI_ACTIVE_LOW (u8) 0x01 | 98 | #define ACPI_ACTIVE_LOW (u8) 0x01 |
99 | #define ACPI_ACTIVE_BOTH (u8) 0x02 | ||
100 | |||
101 | /* Sharing */ | ||
91 | 102 | ||
92 | #define ACPI_EXCLUSIVE (u8) 0x00 | 103 | #define ACPI_EXCLUSIVE (u8) 0x00 |
93 | #define ACPI_SHARED (u8) 0x01 | 104 | #define ACPI_SHARED (u8) 0x01 |
105 | #define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02 | ||
106 | #define ACPI_SHARED_AND_WAKE (u8) 0x03 | ||
94 | 107 | ||
95 | /* | 108 | /* |
96 | * DMA Attributes | 109 | * DMA Attributes |
@@ -127,6 +140,8 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6 | |||
127 | #define ACPI_POS_DECODE (u8) 0x00 | 140 | #define ACPI_POS_DECODE (u8) 0x00 |
128 | #define ACPI_SUB_DECODE (u8) 0x01 | 141 | #define ACPI_SUB_DECODE (u8) 0x01 |
129 | 142 | ||
143 | /* Producer/Consumer */ | ||
144 | |||
130 | #define ACPI_PRODUCER (u8) 0x00 | 145 | #define ACPI_PRODUCER (u8) 0x00 |
131 | #define ACPI_CONSUMER (u8) 0x01 | 146 | #define ACPI_CONSUMER (u8) 0x01 |
132 | 147 | ||
@@ -192,6 +207,21 @@ struct acpi_resource_fixed_io { | |||
192 | u8 address_length; | 207 | u8 address_length; |
193 | }; | 208 | }; |
194 | 209 | ||
210 | struct acpi_resource_fixed_dma { | ||
211 | u16 request_lines; | ||
212 | u16 channels; | ||
213 | u8 width; | ||
214 | }; | ||
215 | |||
216 | /* Values for Width field above */ | ||
217 | |||
218 | #define ACPI_DMA_WIDTH8 0 | ||
219 | #define ACPI_DMA_WIDTH16 1 | ||
220 | #define ACPI_DMA_WIDTH32 2 | ||
221 | #define ACPI_DMA_WIDTH64 3 | ||
222 | #define ACPI_DMA_WIDTH128 4 | ||
223 | #define ACPI_DMA_WIDTH256 5 | ||
224 | |||
195 | struct acpi_resource_vendor { | 225 | struct acpi_resource_vendor { |
196 | u16 byte_length; | 226 | u16 byte_length; |
197 | u8 byte_data[1]; | 227 | u8 byte_data[1]; |
@@ -329,6 +359,166 @@ struct acpi_resource_generic_register { | |||
329 | u64 address; | 359 | u64 address; |
330 | }; | 360 | }; |
331 | 361 | ||
362 | struct acpi_resource_gpio { | ||
363 | u8 revision_id; | ||
364 | u8 connection_type; | ||
365 | u8 producer_consumer; /* For values, see Producer/Consumer above */ | ||
366 | u8 pin_config; | ||
367 | u8 sharable; /* For values, see Interrupt Attributes above */ | ||
368 | u8 io_restriction; | ||
369 | u8 triggering; /* For values, see Interrupt Attributes above */ | ||
370 | u8 polarity; /* For values, see Interrupt Attributes above */ | ||
371 | u16 drive_strength; | ||
372 | u16 debounce_timeout; | ||
373 | u16 pin_table_length; | ||
374 | u16 vendor_length; | ||
375 | struct acpi_resource_source resource_source; | ||
376 | u16 *pin_table; | ||
377 | u8 *vendor_data; | ||
378 | }; | ||
379 | |||
380 | /* Values for GPIO connection_type field above */ | ||
381 | |||
382 | #define ACPI_RESOURCE_GPIO_TYPE_INT 0 | ||
383 | #define ACPI_RESOURCE_GPIO_TYPE_IO 1 | ||
384 | |||
385 | /* Values for pin_config field above */ | ||
386 | |||
387 | #define ACPI_PIN_CONFIG_DEFAULT 0 | ||
388 | #define ACPI_PIN_CONFIG_PULLUP 1 | ||
389 | #define ACPI_PIN_CONFIG_PULLDOWN 2 | ||
390 | #define ACPI_PIN_CONFIG_NOPULL 3 | ||
391 | |||
392 | /* Values for io_restriction field above */ | ||
393 | |||
394 | #define ACPI_IO_RESTRICT_NONE 0 | ||
395 | #define ACPI_IO_RESTRICT_INPUT 1 | ||
396 | #define ACPI_IO_RESTRICT_OUTPUT 2 | ||
397 | #define ACPI_IO_RESTRICT_NONE_PRESERVE 3 | ||
398 | |||
399 | /* Common structure for I2C, SPI, and UART serial descriptors */ | ||
400 | |||
401 | #define ACPI_RESOURCE_SERIAL_COMMON \ | ||
402 | u8 revision_id; \ | ||
403 | u8 type; \ | ||
404 | u8 producer_consumer; /* For values, see Producer/Consumer above */\ | ||
405 | u8 slave_mode; \ | ||
406 | u8 type_revision_id; \ | ||
407 | u16 type_data_length; \ | ||
408 | u16 vendor_length; \ | ||
409 | struct acpi_resource_source resource_source; \ | ||
410 | u8 *vendor_data; | ||
411 | |||
412 | struct acpi_resource_common_serialbus { | ||
413 | ACPI_RESOURCE_SERIAL_COMMON}; | ||
414 | |||
415 | /* Values for the Type field above */ | ||
416 | |||
417 | #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1 | ||
418 | #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2 | ||
419 | #define ACPI_RESOURCE_SERIAL_TYPE_UART 3 | ||
420 | |||
421 | /* Values for slave_mode field above */ | ||
422 | |||
423 | #define ACPI_CONTROLLER_INITIATED 0 | ||
424 | #define ACPI_DEVICE_INITIATED 1 | ||
425 | |||
426 | struct acpi_resource_i2c_serialbus { | ||
427 | ACPI_RESOURCE_SERIAL_COMMON u8 access_mode; | ||
428 | u16 slave_address; | ||
429 | u32 connection_speed; | ||
430 | }; | ||
431 | |||
432 | /* Values for access_mode field above */ | ||
433 | |||
434 | #define ACPI_I2C_7BIT_MODE 0 | ||
435 | #define ACPI_I2C_10BIT_MODE 1 | ||
436 | |||
437 | struct acpi_resource_spi_serialbus { | ||
438 | ACPI_RESOURCE_SERIAL_COMMON u8 wire_mode; | ||
439 | u8 device_polarity; | ||
440 | u8 data_bit_length; | ||
441 | u8 clock_phase; | ||
442 | u8 clock_polarity; | ||
443 | u16 device_selection; | ||
444 | u32 connection_speed; | ||
445 | }; | ||
446 | |||
447 | /* Values for wire_mode field above */ | ||
448 | |||
449 | #define ACPI_SPI_4WIRE_MODE 0 | ||
450 | #define ACPI_SPI_3WIRE_MODE 1 | ||
451 | |||
452 | /* Values for device_polarity field above */ | ||
453 | |||
454 | #define ACPI_SPI_ACTIVE_LOW 0 | ||
455 | #define ACPI_SPI_ACTIVE_HIGH 1 | ||
456 | |||
457 | /* Values for clock_phase field above */ | ||
458 | |||
459 | #define ACPI_SPI_FIRST_PHASE 0 | ||
460 | #define ACPI_SPI_SECOND_PHASE 1 | ||
461 | |||
462 | /* Values for clock_polarity field above */ | ||
463 | |||
464 | #define ACPI_SPI_START_LOW 0 | ||
465 | #define ACPI_SPI_START_HIGH 1 | ||
466 | |||
467 | struct acpi_resource_uart_serialbus { | ||
468 | ACPI_RESOURCE_SERIAL_COMMON u8 endian; | ||
469 | u8 data_bits; | ||
470 | u8 stop_bits; | ||
471 | u8 flow_control; | ||
472 | u8 parity; | ||
473 | u8 lines_enabled; | ||
474 | u16 rx_fifo_size; | ||
475 | u16 tx_fifo_size; | ||
476 | u32 default_baud_rate; | ||
477 | }; | ||
478 | |||
479 | /* Values for Endian field above */ | ||
480 | |||
481 | #define ACPI_UART_LITTLE_ENDIAN 0 | ||
482 | #define ACPI_UART_BIG_ENDIAN 1 | ||
483 | |||
484 | /* Values for data_bits field above */ | ||
485 | |||
486 | #define ACPI_UART_5_DATA_BITS 0 | ||
487 | #define ACPI_UART_6_DATA_BITS 1 | ||
488 | #define ACPI_UART_7_DATA_BITS 2 | ||
489 | #define ACPI_UART_8_DATA_BITS 3 | ||
490 | #define ACPI_UART_9_DATA_BITS 4 | ||
491 | |||
492 | /* Values for stop_bits field above */ | ||
493 | |||
494 | #define ACPI_UART_NO_STOP_BITS 0 | ||
495 | #define ACPI_UART_1_STOP_BIT 1 | ||
496 | #define ACPI_UART_1P5_STOP_BITS 2 | ||
497 | #define ACPI_UART_2_STOP_BITS 3 | ||
498 | |||
499 | /* Values for flow_control field above */ | ||
500 | |||
501 | #define ACPI_UART_FLOW_CONTROL_NONE 0 | ||
502 | #define ACPI_UART_FLOW_CONTROL_HW 1 | ||
503 | #define ACPI_UART_FLOW_CONTROL_XON_XOFF 2 | ||
504 | |||
505 | /* Values for Parity field above */ | ||
506 | |||
507 | #define ACPI_UART_PARITY_NONE 0 | ||
508 | #define ACPI_UART_PARITY_EVEN 1 | ||
509 | #define ACPI_UART_PARITY_ODD 2 | ||
510 | #define ACPI_UART_PARITY_MARK 3 | ||
511 | #define ACPI_UART_PARITY_SPACE 4 | ||
512 | |||
513 | /* Values for lines_enabled bitfield above */ | ||
514 | |||
515 | #define ACPI_UART_CARRIER_DETECT (1<<2) | ||
516 | #define ACPI_UART_RING_INDICATOR (1<<3) | ||
517 | #define ACPI_UART_DATA_SET_READY (1<<4) | ||
518 | #define ACPI_UART_DATA_TERMINAL_READY (1<<5) | ||
519 | #define ACPI_UART_CLEAR_TO_SEND (1<<6) | ||
520 | #define ACPI_UART_REQUEST_TO_SEND (1<<7) | ||
521 | |||
332 | /* ACPI_RESOURCE_TYPEs */ | 522 | /* ACPI_RESOURCE_TYPEs */ |
333 | 523 | ||
334 | #define ACPI_RESOURCE_TYPE_IRQ 0 | 524 | #define ACPI_RESOURCE_TYPE_IRQ 0 |
@@ -348,7 +538,10 @@ struct acpi_resource_generic_register { | |||
348 | #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ | 538 | #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ |
349 | #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 | 539 | #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 |
350 | #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 | 540 | #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 |
351 | #define ACPI_RESOURCE_TYPE_MAX 16 | 541 | #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ |
542 | #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ | ||
543 | #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ | ||
544 | #define ACPI_RESOURCE_TYPE_MAX 19 | ||
352 | 545 | ||
353 | /* Master union for resource descriptors */ | 546 | /* Master union for resource descriptors */ |
354 | 547 | ||
@@ -358,6 +551,7 @@ union acpi_resource_data { | |||
358 | struct acpi_resource_start_dependent start_dpf; | 551 | struct acpi_resource_start_dependent start_dpf; |
359 | struct acpi_resource_io io; | 552 | struct acpi_resource_io io; |
360 | struct acpi_resource_fixed_io fixed_io; | 553 | struct acpi_resource_fixed_io fixed_io; |
554 | struct acpi_resource_fixed_dma fixed_dma; | ||
361 | struct acpi_resource_vendor vendor; | 555 | struct acpi_resource_vendor vendor; |
362 | struct acpi_resource_vendor_typed vendor_typed; | 556 | struct acpi_resource_vendor_typed vendor_typed; |
363 | struct acpi_resource_end_tag end_tag; | 557 | struct acpi_resource_end_tag end_tag; |
@@ -370,6 +564,11 @@ union acpi_resource_data { | |||
370 | struct acpi_resource_extended_address64 ext_address64; | 564 | struct acpi_resource_extended_address64 ext_address64; |
371 | struct acpi_resource_extended_irq extended_irq; | 565 | struct acpi_resource_extended_irq extended_irq; |
372 | struct acpi_resource_generic_register generic_reg; | 566 | struct acpi_resource_generic_register generic_reg; |
567 | struct acpi_resource_gpio gpio; | ||
568 | struct acpi_resource_i2c_serialbus i2c_serial_bus; | ||
569 | struct acpi_resource_spi_serialbus spi_serial_bus; | ||
570 | struct acpi_resource_uart_serialbus uart_serial_bus; | ||
571 | struct acpi_resource_common_serialbus common_serial_bus; | ||
373 | 572 | ||
374 | /* Common fields */ | 573 | /* Common fields */ |
375 | 574 | ||