Sync ACPICA with Intel's version 20190215.
[dragonfly.git] / sys / contrib / dev / acpica / source / include / acrestyp.h
blobfa24363d750a5cfa194fe742046161f8000b8237
1 /******************************************************************************
3 * Name: acrestyp.h - Defines, types, and structures for resource descriptors
5 *****************************************************************************/
7 /******************************************************************************
9 * 1. Copyright Notice
11 * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp.
12 * All rights reserved.
14 * 2. License
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
19 * property rights.
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
38 * conditions are met:
40 * 3. Conditions
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
64 * make.
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
70 * distribution.
72 * 3.4. Intel retains all right, title, and interest in and to the Original
73 * Intel Code.
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 * PARTICULAR PURPOSE.
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 * LIMITED REMEDY.
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
117 * following license:
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
121 * are met:
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
152 #ifndef __ACRESTYP_H__
153 #define __ACRESTYP_H__
157 * Definitions for Resource Attributes
159 typedef UINT16 ACPI_RS_LENGTH; /* Resource Length field is fixed at 16 bits */
160 typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
163 * Memory Attributes
165 #define ACPI_READ_ONLY_MEMORY (UINT8) 0x00
166 #define ACPI_READ_WRITE_MEMORY (UINT8) 0x01
168 #define ACPI_NON_CACHEABLE_MEMORY (UINT8) 0x00
169 #define ACPI_CACHABLE_MEMORY (UINT8) 0x01
170 #define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02
171 #define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03
173 /*! [Begin] no source code translation */
175 * IO Attributes
176 * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
177 * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
179 /*! [End] no source code translation !*/
181 #define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01
182 #define ACPI_ISA_ONLY_RANGES (UINT8) 0x02
183 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
185 /* Type of translation - 1=Sparse, 0=Dense */
187 #define ACPI_SPARSE_TRANSLATION (UINT8) 0x01
190 * IO Port Descriptor Decode
192 #define ACPI_DECODE_10 (UINT8) 0x00 /* 10-bit IO address decode */
193 #define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */
196 * Interrupt attributes - used in multiple descriptors
199 /* Triggering */
201 #define ACPI_LEVEL_SENSITIVE (UINT8) 0x00
202 #define ACPI_EDGE_SENSITIVE (UINT8) 0x01
204 /* Polarity */
206 #define ACPI_ACTIVE_HIGH (UINT8) 0x00
207 #define ACPI_ACTIVE_LOW (UINT8) 0x01
208 #define ACPI_ACTIVE_BOTH (UINT8) 0x02
210 /* Sharing */
212 #define ACPI_EXCLUSIVE (UINT8) 0x00
213 #define ACPI_SHARED (UINT8) 0x01
215 /* Wake */
217 #define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00
218 #define ACPI_WAKE_CAPABLE (UINT8) 0x01
221 * DMA Attributes
223 #define ACPI_COMPATIBILITY (UINT8) 0x00
224 #define ACPI_TYPE_A (UINT8) 0x01
225 #define ACPI_TYPE_B (UINT8) 0x02
226 #define ACPI_TYPE_F (UINT8) 0x03
228 #define ACPI_NOT_BUS_MASTER (UINT8) 0x00
229 #define ACPI_BUS_MASTER (UINT8) 0x01
231 #define ACPI_TRANSFER_8 (UINT8) 0x00
232 #define ACPI_TRANSFER_8_16 (UINT8) 0x01
233 #define ACPI_TRANSFER_16 (UINT8) 0x02
236 * Start Dependent Functions Priority definitions
238 #define ACPI_GOOD_CONFIGURATION (UINT8) 0x00
239 #define ACPI_ACCEPTABLE_CONFIGURATION (UINT8) 0x01
240 #define ACPI_SUB_OPTIMAL_CONFIGURATION (UINT8) 0x02
243 * 16, 32 and 64-bit Address Descriptor resource types
245 #define ACPI_MEMORY_RANGE (UINT8) 0x00
246 #define ACPI_IO_RANGE (UINT8) 0x01
247 #define ACPI_BUS_NUMBER_RANGE (UINT8) 0x02
249 #define ACPI_ADDRESS_NOT_FIXED (UINT8) 0x00
250 #define ACPI_ADDRESS_FIXED (UINT8) 0x01
252 #define ACPI_POS_DECODE (UINT8) 0x00
253 #define ACPI_SUB_DECODE (UINT8) 0x01
255 /* Producer/Consumer */
257 #define ACPI_PRODUCER (UINT8) 0x00
258 #define ACPI_CONSUMER (UINT8) 0x01
262 * If possible, pack the following structures to byte alignment
264 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
265 #pragma pack(1)
266 #endif
268 /* UUID data structures for use in vendor-defined resource descriptors */
270 typedef struct acpi_uuid
272 UINT8 Data[ACPI_UUID_LENGTH];
273 } ACPI_UUID;
275 typedef struct acpi_vendor_uuid
277 UINT8 Subtype;
278 UINT8 Data[ACPI_UUID_LENGTH];
280 } ACPI_VENDOR_UUID;
283 * Structures used to describe device resources
285 typedef struct acpi_resource_irq
287 UINT8 DescriptorLength;
288 UINT8 Triggering;
289 UINT8 Polarity;
290 UINT8 Shareable;
291 UINT8 WakeCapable;
292 UINT8 InterruptCount;
293 UINT8 Interrupts[1];
295 } ACPI_RESOURCE_IRQ;
297 typedef struct acpi_resource_dma
299 UINT8 Type;
300 UINT8 BusMaster;
301 UINT8 Transfer;
302 UINT8 ChannelCount;
303 UINT8 Channels[1];
305 } ACPI_RESOURCE_DMA;
307 typedef struct acpi_resource_start_dependent
309 UINT8 DescriptorLength;
310 UINT8 CompatibilityPriority;
311 UINT8 PerformanceRobustness;
313 } ACPI_RESOURCE_START_DEPENDENT;
317 * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
318 * needed because it has no fields
322 typedef struct acpi_resource_io
324 UINT8 IoDecode;
325 UINT8 Alignment;
326 UINT8 AddressLength;
327 UINT16 Minimum;
328 UINT16 Maximum;
330 } ACPI_RESOURCE_IO;
332 typedef struct acpi_resource_fixed_io
334 UINT16 Address;
335 UINT8 AddressLength;
337 } ACPI_RESOURCE_FIXED_IO;
339 typedef struct acpi_resource_fixed_dma
341 UINT16 RequestLines;
342 UINT16 Channels;
343 UINT8 Width;
345 } ACPI_RESOURCE_FIXED_DMA;
347 /* Values for Width field above */
349 #define ACPI_DMA_WIDTH8 0
350 #define ACPI_DMA_WIDTH16 1
351 #define ACPI_DMA_WIDTH32 2
352 #define ACPI_DMA_WIDTH64 3
353 #define ACPI_DMA_WIDTH128 4
354 #define ACPI_DMA_WIDTH256 5
357 typedef struct acpi_resource_vendor
359 UINT16 ByteLength;
360 UINT8 ByteData[1];
362 } ACPI_RESOURCE_VENDOR;
364 /* Vendor resource with UUID info (introduced in ACPI 3.0) */
366 typedef struct acpi_resource_vendor_typed
368 UINT16 ByteLength;
369 UINT8 UuidSubtype;
370 UINT8 Uuid[ACPI_UUID_LENGTH];
371 UINT8 ByteData[1];
373 } ACPI_RESOURCE_VENDOR_TYPED;
375 typedef struct acpi_resource_end_tag
377 UINT8 Checksum;
379 } ACPI_RESOURCE_END_TAG;
381 typedef struct acpi_resource_memory24
383 UINT8 WriteProtect;
384 UINT16 Minimum;
385 UINT16 Maximum;
386 UINT16 Alignment;
387 UINT16 AddressLength;
389 } ACPI_RESOURCE_MEMORY24;
391 typedef struct acpi_resource_memory32
393 UINT8 WriteProtect;
394 UINT32 Minimum;
395 UINT32 Maximum;
396 UINT32 Alignment;
397 UINT32 AddressLength;
399 } ACPI_RESOURCE_MEMORY32;
401 typedef struct acpi_resource_fixed_memory32
403 UINT8 WriteProtect;
404 UINT32 Address;
405 UINT32 AddressLength;
407 } ACPI_RESOURCE_FIXED_MEMORY32;
409 typedef struct acpi_memory_attribute
411 UINT8 WriteProtect;
412 UINT8 Caching;
413 UINT8 RangeType;
414 UINT8 Translation;
416 } ACPI_MEMORY_ATTRIBUTE;
418 typedef struct acpi_io_attribute
420 UINT8 RangeType;
421 UINT8 Translation;
422 UINT8 TranslationType;
423 UINT8 Reserved1;
425 } ACPI_IO_ATTRIBUTE;
427 typedef union acpi_resource_attribute
429 ACPI_MEMORY_ATTRIBUTE Mem;
430 ACPI_IO_ATTRIBUTE Io;
432 /* Used for the *WordSpace macros */
434 UINT8 TypeSpecific;
436 } ACPI_RESOURCE_ATTRIBUTE;
438 typedef struct acpi_resource_label
440 UINT16 StringLength;
441 char *StringPtr;
443 } ACPI_RESOURCE_LABEL;
445 typedef struct acpi_resource_source
447 UINT8 Index;
448 UINT16 StringLength;
449 char *StringPtr;
451 } ACPI_RESOURCE_SOURCE;
453 /* Fields common to all address descriptors, 16/32/64 bit */
455 #define ACPI_RESOURCE_ADDRESS_COMMON \
456 UINT8 ResourceType; \
457 UINT8 ProducerConsumer; \
458 UINT8 Decode; \
459 UINT8 MinAddressFixed; \
460 UINT8 MaxAddressFixed; \
461 ACPI_RESOURCE_ATTRIBUTE Info;
463 typedef struct acpi_address16_attribute
465 UINT16 Granularity;
466 UINT16 Minimum;
467 UINT16 Maximum;
468 UINT16 TranslationOffset;
469 UINT16 AddressLength;
471 } ACPI_ADDRESS16_ATTRIBUTE;
473 typedef struct acpi_address32_attribute
475 UINT32 Granularity;
476 UINT32 Minimum;
477 UINT32 Maximum;
478 UINT32 TranslationOffset;
479 UINT32 AddressLength;
481 } ACPI_ADDRESS32_ATTRIBUTE;
483 typedef struct acpi_address64_attribute
485 UINT64 Granularity;
486 UINT64 Minimum;
487 UINT64 Maximum;
488 UINT64 TranslationOffset;
489 UINT64 AddressLength;
491 } ACPI_ADDRESS64_ATTRIBUTE;
493 typedef struct acpi_resource_address
495 ACPI_RESOURCE_ADDRESS_COMMON
497 } ACPI_RESOURCE_ADDRESS;
499 typedef struct acpi_resource_address16
501 ACPI_RESOURCE_ADDRESS_COMMON
502 ACPI_ADDRESS16_ATTRIBUTE Address;
503 ACPI_RESOURCE_SOURCE ResourceSource;
505 } ACPI_RESOURCE_ADDRESS16;
507 typedef struct acpi_resource_address32
509 ACPI_RESOURCE_ADDRESS_COMMON
510 ACPI_ADDRESS32_ATTRIBUTE Address;
511 ACPI_RESOURCE_SOURCE ResourceSource;
513 } ACPI_RESOURCE_ADDRESS32;
515 typedef struct acpi_resource_address64
517 ACPI_RESOURCE_ADDRESS_COMMON
518 ACPI_ADDRESS64_ATTRIBUTE Address;
519 ACPI_RESOURCE_SOURCE ResourceSource;
521 } ACPI_RESOURCE_ADDRESS64;
523 typedef struct acpi_resource_extended_address64
525 ACPI_RESOURCE_ADDRESS_COMMON
526 UINT8 RevisionID;
527 ACPI_ADDRESS64_ATTRIBUTE Address;
528 UINT64 TypeSpecific;
530 } ACPI_RESOURCE_EXTENDED_ADDRESS64;
532 typedef struct acpi_resource_extended_irq
534 UINT8 ProducerConsumer;
535 UINT8 Triggering;
536 UINT8 Polarity;
537 UINT8 Shareable;
538 UINT8 WakeCapable;
539 UINT8 InterruptCount;
540 ACPI_RESOURCE_SOURCE ResourceSource;
541 UINT32 Interrupts[1];
543 } ACPI_RESOURCE_EXTENDED_IRQ;
545 typedef struct acpi_resource_generic_register
547 UINT8 SpaceId;
548 UINT8 BitWidth;
549 UINT8 BitOffset;
550 UINT8 AccessSize;
551 UINT64 Address;
553 } ACPI_RESOURCE_GENERIC_REGISTER;
555 typedef struct acpi_resource_gpio
557 UINT8 RevisionId;
558 UINT8 ConnectionType;
559 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
560 UINT8 PinConfig;
561 UINT8 Shareable; /* For values, see Interrupt Attributes above */
562 UINT8 WakeCapable; /* For values, see Interrupt Attributes above */
563 UINT8 IoRestriction;
564 UINT8 Triggering; /* For values, see Interrupt Attributes above */
565 UINT8 Polarity; /* For values, see Interrupt Attributes above */
566 UINT16 DriveStrength;
567 UINT16 DebounceTimeout;
568 UINT16 PinTableLength;
569 UINT16 VendorLength;
570 ACPI_RESOURCE_SOURCE ResourceSource;
571 UINT16 *PinTable;
572 UINT8 *VendorData;
574 } ACPI_RESOURCE_GPIO;
576 /* Values for GPIO ConnectionType field above */
578 #define ACPI_RESOURCE_GPIO_TYPE_INT 0
579 #define ACPI_RESOURCE_GPIO_TYPE_IO 1
581 /* Values for PinConfig field above */
583 #define ACPI_PIN_CONFIG_DEFAULT 0
584 #define ACPI_PIN_CONFIG_PULLUP 1
585 #define ACPI_PIN_CONFIG_PULLDOWN 2
586 #define ACPI_PIN_CONFIG_NOPULL 3
588 /* Values for IoRestriction field above */
590 #define ACPI_IO_RESTRICT_NONE 0
591 #define ACPI_IO_RESTRICT_INPUT 1
592 #define ACPI_IO_RESTRICT_OUTPUT 2
593 #define ACPI_IO_RESTRICT_NONE_PRESERVE 3
596 /* Common structure for I2C, SPI, and UART serial descriptors */
598 #define ACPI_RESOURCE_SERIAL_COMMON \
599 UINT8 RevisionId; \
600 UINT8 Type; \
601 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\
602 UINT8 SlaveMode; \
603 UINT8 ConnectionSharing; \
604 UINT8 TypeRevisionId; \
605 UINT16 TypeDataLength; \
606 UINT16 VendorLength; \
607 ACPI_RESOURCE_SOURCE ResourceSource; \
608 UINT8 *VendorData;
610 typedef struct acpi_resource_common_serialbus
612 ACPI_RESOURCE_SERIAL_COMMON
614 } ACPI_RESOURCE_COMMON_SERIALBUS;
616 /* Values for the Type field above */
618 #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
619 #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
620 #define ACPI_RESOURCE_SERIAL_TYPE_UART 3
622 /* Values for SlaveMode field above */
624 #define ACPI_CONTROLLER_INITIATED 0
625 #define ACPI_DEVICE_INITIATED 1
628 typedef struct acpi_resource_i2c_serialbus
630 ACPI_RESOURCE_SERIAL_COMMON
631 UINT8 AccessMode;
632 UINT16 SlaveAddress;
633 UINT32 ConnectionSpeed;
635 } ACPI_RESOURCE_I2C_SERIALBUS;
637 /* Values for AccessMode field above */
639 #define ACPI_I2C_7BIT_MODE 0
640 #define ACPI_I2C_10BIT_MODE 1
643 typedef struct acpi_resource_spi_serialbus
645 ACPI_RESOURCE_SERIAL_COMMON
646 UINT8 WireMode;
647 UINT8 DevicePolarity;
648 UINT8 DataBitLength;
649 UINT8 ClockPhase;
650 UINT8 ClockPolarity;
651 UINT16 DeviceSelection;
652 UINT32 ConnectionSpeed;
654 } ACPI_RESOURCE_SPI_SERIALBUS;
656 /* Values for WireMode field above */
658 #define ACPI_SPI_4WIRE_MODE 0
659 #define ACPI_SPI_3WIRE_MODE 1
661 /* Values for DevicePolarity field above */
663 #define ACPI_SPI_ACTIVE_LOW 0
664 #define ACPI_SPI_ACTIVE_HIGH 1
666 /* Values for ClockPhase field above */
668 #define ACPI_SPI_FIRST_PHASE 0
669 #define ACPI_SPI_SECOND_PHASE 1
671 /* Values for ClockPolarity field above */
673 #define ACPI_SPI_START_LOW 0
674 #define ACPI_SPI_START_HIGH 1
677 typedef struct acpi_resource_uart_serialbus
679 ACPI_RESOURCE_SERIAL_COMMON
680 UINT8 Endian;
681 UINT8 DataBits;
682 UINT8 StopBits;
683 UINT8 FlowControl;
684 UINT8 Parity;
685 UINT8 LinesEnabled;
686 UINT16 RxFifoSize;
687 UINT16 TxFifoSize;
688 UINT32 DefaultBaudRate;
690 } ACPI_RESOURCE_UART_SERIALBUS;
692 /* Values for Endian field above */
694 #define ACPI_UART_LITTLE_ENDIAN 0
695 #define ACPI_UART_BIG_ENDIAN 1
697 /* Values for DataBits field above */
699 #define ACPI_UART_5_DATA_BITS 0
700 #define ACPI_UART_6_DATA_BITS 1
701 #define ACPI_UART_7_DATA_BITS 2
702 #define ACPI_UART_8_DATA_BITS 3
703 #define ACPI_UART_9_DATA_BITS 4
705 /* Values for StopBits field above */
707 #define ACPI_UART_NO_STOP_BITS 0
708 #define ACPI_UART_1_STOP_BIT 1
709 #define ACPI_UART_1P5_STOP_BITS 2
710 #define ACPI_UART_2_STOP_BITS 3
712 /* Values for FlowControl field above */
714 #define ACPI_UART_FLOW_CONTROL_NONE 0
715 #define ACPI_UART_FLOW_CONTROL_HW 1
716 #define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
718 /* Values for Parity field above */
720 #define ACPI_UART_PARITY_NONE 0
721 #define ACPI_UART_PARITY_EVEN 1
722 #define ACPI_UART_PARITY_ODD 2
723 #define ACPI_UART_PARITY_MARK 3
724 #define ACPI_UART_PARITY_SPACE 4
726 /* Values for LinesEnabled bitfield above */
728 #define ACPI_UART_CARRIER_DETECT (1<<2)
729 #define ACPI_UART_RING_INDICATOR (1<<3)
730 #define ACPI_UART_DATA_SET_READY (1<<4)
731 #define ACPI_UART_DATA_TERMINAL_READY (1<<5)
732 #define ACPI_UART_CLEAR_TO_SEND (1<<6)
733 #define ACPI_UART_REQUEST_TO_SEND (1<<7)
735 typedef struct acpi_resource_pin_function
737 UINT8 RevisionId;
738 UINT8 PinConfig;
739 UINT8 Shareable; /* For values, see Interrupt Attributes above */
740 UINT16 FunctionNumber;
741 UINT16 PinTableLength;
742 UINT16 VendorLength;
743 ACPI_RESOURCE_SOURCE ResourceSource;
744 UINT16 *PinTable;
745 UINT8 *VendorData;
747 } ACPI_RESOURCE_PIN_FUNCTION;
749 typedef struct acpi_resource_pin_config
751 UINT8 RevisionId;
752 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
753 UINT8 Shareable; /* For values, see Interrupt Attributes above */
754 UINT8 PinConfigType;
755 UINT32 PinConfigValue;
756 UINT16 PinTableLength;
757 UINT16 VendorLength;
758 ACPI_RESOURCE_SOURCE ResourceSource;
759 UINT16 *PinTable;
760 UINT8 *VendorData;
762 } ACPI_RESOURCE_PIN_CONFIG;
764 /* Values for PinConfigType field above */
766 #define ACPI_PIN_CONFIG_DEFAULT 0
767 #define ACPI_PIN_CONFIG_BIAS_PULL_UP 1
768 #define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2
769 #define ACPI_PIN_CONFIG_BIAS_DEFAULT 3
770 #define ACPI_PIN_CONFIG_BIAS_DISABLE 4
771 #define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5
772 #define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6
773 #define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7
774 #define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8
775 #define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9
776 #define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10
777 #define ACPI_PIN_CONFIG_SLEW_RATE 11
778 #define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12
779 #define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13
781 typedef struct acpi_resource_pin_group
783 UINT8 RevisionId;
784 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
785 UINT16 PinTableLength;
786 UINT16 VendorLength;
787 UINT16 *PinTable;
788 ACPI_RESOURCE_LABEL ResourceLabel;
789 UINT8 *VendorData;
791 } ACPI_RESOURCE_PIN_GROUP;
793 typedef struct acpi_resource_pin_group_function
795 UINT8 RevisionId;
796 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
797 UINT8 Shareable; /* For values, see Interrupt Attributes above */
798 UINT16 FunctionNumber;
799 UINT16 VendorLength;
800 ACPI_RESOURCE_SOURCE ResourceSource;
801 ACPI_RESOURCE_LABEL ResourceSourceLabel;
802 UINT8 *VendorData;
804 } ACPI_RESOURCE_PIN_GROUP_FUNCTION;
806 typedef struct acpi_resource_pin_group_config
808 UINT8 RevisionId;
809 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
810 UINT8 Shareable; /* For values, see Interrupt Attributes above */
811 UINT8 PinConfigType; /* For values, see PinConfigType above */
812 UINT32 PinConfigValue;
813 UINT16 VendorLength;
814 ACPI_RESOURCE_SOURCE ResourceSource;
815 ACPI_RESOURCE_LABEL ResourceSourceLabel;
816 UINT8 *VendorData;
818 } ACPI_RESOURCE_PIN_GROUP_CONFIG;
820 /* ACPI_RESOURCE_TYPEs */
822 #define ACPI_RESOURCE_TYPE_IRQ 0
823 #define ACPI_RESOURCE_TYPE_DMA 1
824 #define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
825 #define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
826 #define ACPI_RESOURCE_TYPE_IO 4
827 #define ACPI_RESOURCE_TYPE_FIXED_IO 5
828 #define ACPI_RESOURCE_TYPE_VENDOR 6
829 #define ACPI_RESOURCE_TYPE_END_TAG 7
830 #define ACPI_RESOURCE_TYPE_MEMORY24 8
831 #define ACPI_RESOURCE_TYPE_MEMORY32 9
832 #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
833 #define ACPI_RESOURCE_TYPE_ADDRESS16 11
834 #define ACPI_RESOURCE_TYPE_ADDRESS32 12
835 #define ACPI_RESOURCE_TYPE_ADDRESS64 13
836 #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
837 #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
838 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
839 #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
840 #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
841 #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
842 #define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */
843 #define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */
844 #define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */
845 #define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */
846 #define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */
847 #define ACPI_RESOURCE_TYPE_MAX 24
849 /* Master union for resource descriptors */
851 typedef union acpi_resource_data
853 ACPI_RESOURCE_IRQ Irq;
854 ACPI_RESOURCE_DMA Dma;
855 ACPI_RESOURCE_START_DEPENDENT StartDpf;
856 ACPI_RESOURCE_IO Io;
857 ACPI_RESOURCE_FIXED_IO FixedIo;
858 ACPI_RESOURCE_FIXED_DMA FixedDma;
859 ACPI_RESOURCE_VENDOR Vendor;
860 ACPI_RESOURCE_VENDOR_TYPED VendorTyped;
861 ACPI_RESOURCE_END_TAG EndTag;
862 ACPI_RESOURCE_MEMORY24 Memory24;
863 ACPI_RESOURCE_MEMORY32 Memory32;
864 ACPI_RESOURCE_FIXED_MEMORY32 FixedMemory32;
865 ACPI_RESOURCE_ADDRESS16 Address16;
866 ACPI_RESOURCE_ADDRESS32 Address32;
867 ACPI_RESOURCE_ADDRESS64 Address64;
868 ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
869 ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;
870 ACPI_RESOURCE_GENERIC_REGISTER GenericReg;
871 ACPI_RESOURCE_GPIO Gpio;
872 ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus;
873 ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;
874 ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;
875 ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
876 ACPI_RESOURCE_PIN_FUNCTION PinFunction;
877 ACPI_RESOURCE_PIN_CONFIG PinConfig;
878 ACPI_RESOURCE_PIN_GROUP PinGroup;
879 ACPI_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction;
880 ACPI_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig;
882 /* Common fields */
884 ACPI_RESOURCE_ADDRESS Address; /* Common 16/32/64 address fields */
886 } ACPI_RESOURCE_DATA;
889 /* Common resource header */
891 typedef struct acpi_resource
893 UINT32 Type;
894 UINT32 Length;
895 ACPI_RESOURCE_DATA Data;
897 } ACPI_RESOURCE;
899 /* restore default alignment */
901 #pragma pack()
904 #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
905 #define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
906 #define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
908 /* Macro for walking resource templates with multiple descriptors */
910 #define ACPI_NEXT_RESOURCE(Res) \
911 ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length)
914 typedef struct acpi_pci_routing_table
916 UINT32 Length;
917 UINT32 Pin;
918 UINT64 Address; /* here for 64-bit alignment */
919 UINT32 SourceIndex;
920 char Source[4]; /* pad to 64 bits so sizeof() works in all cases */
922 } ACPI_PCI_ROUTING_TABLE;
924 #endif /* __ACRESTYP_H__ */