1/****************************************************************************** 2 * 3 * Name: acrestyp.h - Defines, types, and structures for resource descriptors 4 * 5 *****************************************************************************/ 6 7/****************************************************************************** 8 * 9 * 1. Copyright Notice 10 * 11 * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp. 12 * All rights reserved. 13 * 14 * 2. License 15 * 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. 20 * 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 27 * 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; 36 * 37 * The above copyright and patent license is granted only if the following 38 * conditions are met: 39 * 40 * 3. Conditions 41 * 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. 53 * 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. 65 * 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. 71 * 72 * 3.4. Intel retains all right, title, and interest in and to the Original 73 * Intel Code. 74 * 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. 79 * 80 * 4. Disclaimer and Export Compliance 81 * 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. 89 * 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. 98 * 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. 113 * 114 *****************************************************************************/ 115 116#ifndef __ACRESTYP_H__ 117#define __ACRESTYP_H__ 118 119 120/* 121 * Definitions for Resource Attributes 122 */ 123typedef UINT16 ACPI_RS_LENGTH; /* Resource Length field is fixed at 16 bits */ 124typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */ 125 126/* 127 * Memory Attributes 128 */ 129#define ACPI_READ_ONLY_MEMORY (UINT8) 0x00 130#define ACPI_READ_WRITE_MEMORY (UINT8) 0x01 131 132#define ACPI_NON_CACHEABLE_MEMORY (UINT8) 0x00 133#define ACPI_CACHABLE_MEMORY (UINT8) 0x01 134#define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02 135#define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03 136 137/*! [Begin] no source code translation */ 138/* 139 * IO Attributes 140 * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. 141 * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. 142 */ 143/*! [End] no source code translation !*/ 144 145#define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01 146#define ACPI_ISA_ONLY_RANGES (UINT8) 0x02 147#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 148 149/* Type of translation - 1=Sparse, 0=Dense */ 150 151#define ACPI_SPARSE_TRANSLATION (UINT8) 0x01 152 153/* 154 * IO Port Descriptor Decode 155 */ 156#define ACPI_DECODE_10 (UINT8) 0x00 /* 10-bit IO address decode */ 157#define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */ 158 159/* 160 * Interrupt attributes - used in multiple descriptors 161 */ 162 163/* Triggering */ 164 165#define ACPI_LEVEL_SENSITIVE (UINT8) 0x00 166#define ACPI_EDGE_SENSITIVE (UINT8) 0x01 167 168/* Polarity */ 169 170#define ACPI_ACTIVE_HIGH (UINT8) 0x00 171#define ACPI_ACTIVE_LOW (UINT8) 0x01 172#define ACPI_ACTIVE_BOTH (UINT8) 0x02 173 174/* Sharing */ 175 176#define ACPI_EXCLUSIVE (UINT8) 0x00 177#define ACPI_SHARED (UINT8) 0x01 178#define ACPI_EXCLUSIVE_AND_WAKE (UINT8) 0x02 179#define ACPI_SHARED_AND_WAKE (UINT8) 0x03 180 181/* 182 * DMA Attributes 183 */ 184#define ACPI_COMPATIBILITY (UINT8) 0x00 185#define ACPI_TYPE_A (UINT8) 0x01 186#define ACPI_TYPE_B (UINT8) 0x02 187#define ACPI_TYPE_F (UINT8) 0x03 188 189#define ACPI_NOT_BUS_MASTER (UINT8) 0x00 190#define ACPI_BUS_MASTER (UINT8) 0x01 191 192#define ACPI_TRANSFER_8 (UINT8) 0x00 193#define ACPI_TRANSFER_8_16 (UINT8) 0x01 194#define ACPI_TRANSFER_16 (UINT8) 0x02 195 196/* 197 * Start Dependent Functions Priority definitions 198 */ 199#define ACPI_GOOD_CONFIGURATION (UINT8) 0x00 200#define ACPI_ACCEPTABLE_CONFIGURATION (UINT8) 0x01 201#define ACPI_SUB_OPTIMAL_CONFIGURATION (UINT8) 0x02 202 203/* 204 * 16, 32 and 64-bit Address Descriptor resource types 205 */ 206#define ACPI_MEMORY_RANGE (UINT8) 0x00 207#define ACPI_IO_RANGE (UINT8) 0x01 208#define ACPI_BUS_NUMBER_RANGE (UINT8) 0x02 209 210#define ACPI_ADDRESS_NOT_FIXED (UINT8) 0x00 211#define ACPI_ADDRESS_FIXED (UINT8) 0x01 212 213#define ACPI_POS_DECODE (UINT8) 0x00 214#define ACPI_SUB_DECODE (UINT8) 0x01 215 216/* Producer/Consumer */ 217 218#define ACPI_PRODUCER (UINT8) 0x00 219#define ACPI_CONSUMER (UINT8) 0x01 220 221 222/* 223 * If possible, pack the following structures to byte alignment 224 */ 225#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 226#pragma pack(1) 227#endif 228 229/* UUID data structures for use in vendor-defined resource descriptors */ 230 231typedef struct acpi_uuid 232{ 233 UINT8 Data[ACPI_UUID_LENGTH]; 234} ACPI_UUID; 235 236typedef struct acpi_vendor_uuid 237{ 238 UINT8 Subtype; 239 UINT8 Data[ACPI_UUID_LENGTH]; 240 241} ACPI_VENDOR_UUID; 242 243/* 244 * Structures used to describe device resources 245 */ 246typedef struct acpi_resource_irq 247{ 248 UINT8 DescriptorLength; 249 UINT8 Triggering; 250 UINT8 Polarity; 251 UINT8 Sharable; 252 UINT8 InterruptCount; 253 UINT8 Interrupts[1]; 254 255} ACPI_RESOURCE_IRQ; 256 257typedef struct acpi_resource_dma 258{ 259 UINT8 Type; 260 UINT8 BusMaster; 261 UINT8 Transfer; 262 UINT8 ChannelCount; 263 UINT8 Channels[1]; 264 265} ACPI_RESOURCE_DMA; 266 267typedef struct acpi_resource_start_dependent 268{ 269 UINT8 DescriptorLength; 270 UINT8 CompatibilityPriority; 271 UINT8 PerformanceRobustness; 272 273} ACPI_RESOURCE_START_DEPENDENT; 274 275 276/* 277 * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not 278 * needed because it has no fields 279 */ 280 281 282typedef struct acpi_resource_io 283{ 284 UINT8 IoDecode; 285 UINT8 Alignment; 286 UINT8 AddressLength; 287 UINT16 Minimum; 288 UINT16 Maximum; 289 290} ACPI_RESOURCE_IO; 291 292typedef struct acpi_resource_fixed_io 293{ 294 UINT16 Address; 295 UINT8 AddressLength; 296 297} ACPI_RESOURCE_FIXED_IO; 298 299typedef struct acpi_resource_fixed_dma 300{ 301 UINT16 RequestLines; 302 UINT16 Channels; 303 UINT8 Width; 304 305} ACPI_RESOURCE_FIXED_DMA; 306 307/* Values for Width field above */ 308 309#define ACPI_DMA_WIDTH8 0 310#define ACPI_DMA_WIDTH16 1 311#define ACPI_DMA_WIDTH32 2 312#define ACPI_DMA_WIDTH64 3 313#define ACPI_DMA_WIDTH128 4 314#define ACPI_DMA_WIDTH256 5 315 316 317typedef struct acpi_resource_vendor 318{ 319 UINT16 ByteLength; 320 UINT8 ByteData[1]; 321 322} ACPI_RESOURCE_VENDOR; 323 324/* Vendor resource with UUID info (introduced in ACPI 3.0) */ 325 326typedef struct acpi_resource_vendor_typed 327{ 328 UINT16 ByteLength; 329 UINT8 UuidSubtype; 330 UINT8 Uuid[ACPI_UUID_LENGTH]; 331 UINT8 ByteData[1]; 332 333} ACPI_RESOURCE_VENDOR_TYPED; 334 335typedef struct acpi_resource_end_tag 336{ 337 UINT8 Checksum; 338 339} ACPI_RESOURCE_END_TAG; 340 341typedef struct acpi_resource_memory24 342{ 343 UINT8 WriteProtect; 344 UINT16 Minimum; 345 UINT16 Maximum; 346 UINT16 Alignment; 347 UINT16 AddressLength; 348 349} ACPI_RESOURCE_MEMORY24; 350 351typedef struct acpi_resource_memory32 352{ 353 UINT8 WriteProtect; 354 UINT32 Minimum; 355 UINT32 Maximum; 356 UINT32 Alignment; 357 UINT32 AddressLength; 358 359} ACPI_RESOURCE_MEMORY32; 360 361typedef struct acpi_resource_fixed_memory32 362{ 363 UINT8 WriteProtect; 364 UINT32 Address; 365 UINT32 AddressLength; 366 367} ACPI_RESOURCE_FIXED_MEMORY32; 368 369typedef struct acpi_memory_attribute 370{ 371 UINT8 WriteProtect; 372 UINT8 Caching; 373 UINT8 RangeType; 374 UINT8 Translation; 375 376} ACPI_MEMORY_ATTRIBUTE; 377 378typedef struct acpi_io_attribute 379{ 380 UINT8 RangeType; 381 UINT8 Translation; 382 UINT8 TranslationType; 383 UINT8 Reserved1; 384 385} ACPI_IO_ATTRIBUTE; 386 387typedef union acpi_resource_attribute 388{ 389 ACPI_MEMORY_ATTRIBUTE Mem; 390 ACPI_IO_ATTRIBUTE Io; 391 392 /* Used for the *WordSpace macros */ 393 394 UINT8 TypeSpecific; 395 396} ACPI_RESOURCE_ATTRIBUTE; 397 398typedef struct acpi_resource_source 399{ 400 UINT8 Index; 401 UINT16 StringLength; 402 char *StringPtr; 403 404} ACPI_RESOURCE_SOURCE; 405 406/* Fields common to all address descriptors, 16/32/64 bit */ 407 408#define ACPI_RESOURCE_ADDRESS_COMMON \ 409 UINT8 ResourceType; \ 410 UINT8 ProducerConsumer; \ 411 UINT8 Decode; \ 412 UINT8 MinAddressFixed; \ 413 UINT8 MaxAddressFixed; \ 414 ACPI_RESOURCE_ATTRIBUTE Info; 415 416typedef struct acpi_resource_address 417{ 418 ACPI_RESOURCE_ADDRESS_COMMON 419 420} ACPI_RESOURCE_ADDRESS; 421 422typedef struct acpi_resource_address16 423{ 424 ACPI_RESOURCE_ADDRESS_COMMON 425 UINT16 Granularity; 426 UINT16 Minimum; 427 UINT16 Maximum; 428 UINT16 TranslationOffset; 429 UINT16 AddressLength; 430 ACPI_RESOURCE_SOURCE ResourceSource; 431 432} ACPI_RESOURCE_ADDRESS16; 433 434typedef struct acpi_resource_address32 435{ 436 ACPI_RESOURCE_ADDRESS_COMMON 437 UINT32 Granularity; 438 UINT32 Minimum; 439 UINT32 Maximum; 440 UINT32 TranslationOffset; 441 UINT32 AddressLength; 442 ACPI_RESOURCE_SOURCE ResourceSource; 443 444} ACPI_RESOURCE_ADDRESS32; 445 446typedef struct acpi_resource_address64 447{ 448 ACPI_RESOURCE_ADDRESS_COMMON 449 UINT64 Granularity; 450 UINT64 Minimum; 451 UINT64 Maximum; 452 UINT64 TranslationOffset; 453 UINT64 AddressLength; 454 ACPI_RESOURCE_SOURCE ResourceSource; 455 456} ACPI_RESOURCE_ADDRESS64; 457 458typedef struct acpi_resource_extended_address64 459{ 460 ACPI_RESOURCE_ADDRESS_COMMON 461 UINT8 RevisionID; 462 UINT64 Granularity; 463 UINT64 Minimum; 464 UINT64 Maximum; 465 UINT64 TranslationOffset; 466 UINT64 AddressLength; 467 UINT64 TypeSpecific; 468 469} ACPI_RESOURCE_EXTENDED_ADDRESS64; 470 471typedef struct acpi_resource_extended_irq 472{ 473 UINT8 ProducerConsumer; 474 UINT8 Triggering; 475 UINT8 Polarity; 476 UINT8 Sharable; 477 UINT8 InterruptCount; 478 ACPI_RESOURCE_SOURCE ResourceSource; 479 UINT32 Interrupts[1]; 480 481} ACPI_RESOURCE_EXTENDED_IRQ; 482 483typedef struct acpi_resource_generic_register 484{ 485 UINT8 SpaceId; 486 UINT8 BitWidth; 487 UINT8 BitOffset; 488 UINT8 AccessSize; 489 UINT64 Address; 490 491} ACPI_RESOURCE_GENERIC_REGISTER; 492 493typedef struct acpi_resource_gpio 494{ 495 UINT8 RevisionId; 496 UINT8 ConnectionType; 497 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ 498 UINT8 PinConfig; 499 UINT8 Sharable; /* For values, see Interrupt Attributes above */ 500 UINT8 IoRestriction; 501 UINT8 Triggering; /* For values, see Interrupt Attributes above */ 502 UINT8 Polarity; /* For values, see Interrupt Attributes above */ 503 UINT16 DriveStrength; 504 UINT16 DebounceTimeout; 505 UINT16 PinTableLength; 506 UINT16 VendorLength; 507 ACPI_RESOURCE_SOURCE ResourceSource; 508 UINT16 *PinTable; 509 UINT8 *VendorData; 510 511} ACPI_RESOURCE_GPIO; 512 513/* Values for GPIO ConnectionType field above */ 514 515#define ACPI_RESOURCE_GPIO_TYPE_INT 0 516#define ACPI_RESOURCE_GPIO_TYPE_IO 1 517 518/* Values for PinConfig field above */ 519 520#define ACPI_PIN_CONFIG_DEFAULT 0 521#define ACPI_PIN_CONFIG_PULLUP 1 522#define ACPI_PIN_CONFIG_PULLDOWN 2 523#define ACPI_PIN_CONFIG_NOPULL 3 524 525/* Values for IoRestriction field above */ 526 527#define ACPI_IO_RESTRICT_NONE 0 528#define ACPI_IO_RESTRICT_INPUT 1 529#define ACPI_IO_RESTRICT_OUTPUT 2 530#define ACPI_IO_RESTRICT_NONE_PRESERVE 3 531 532 533/* Common structure for I2C, SPI, and UART serial descriptors */ 534 535#define ACPI_RESOURCE_SERIAL_COMMON \ 536 UINT8 RevisionId; \ 537 UINT8 Type; \ 538 UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\ 539 UINT8 SlaveMode; \ 540 UINT8 TypeRevisionId; \ 541 UINT16 TypeDataLength; \ 542 UINT16 VendorLength; \ 543 ACPI_RESOURCE_SOURCE ResourceSource; \ 544 UINT8 *VendorData; 545 546typedef struct acpi_resource_common_serialbus 547{ 548 ACPI_RESOURCE_SERIAL_COMMON 549 550} ACPI_RESOURCE_COMMON_SERIALBUS; 551 552/* Values for the Type field above */ 553 554#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1 555#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2 556#define ACPI_RESOURCE_SERIAL_TYPE_UART 3 557 558/* Values for SlaveMode field above */ 559 560#define ACPI_CONTROLLER_INITIATED 0 561#define ACPI_DEVICE_INITIATED 1 562 563 564typedef struct acpi_resource_i2c_serialbus 565{ 566 ACPI_RESOURCE_SERIAL_COMMON 567 UINT8 AccessMode; 568 UINT16 SlaveAddress; 569 UINT32 ConnectionSpeed; 570 571} ACPI_RESOURCE_I2C_SERIALBUS; 572 573/* Values for AccessMode field above */ 574 575#define ACPI_I2C_7BIT_MODE 0 576#define ACPI_I2C_10BIT_MODE 1 577 578 579typedef struct acpi_resource_spi_serialbus 580{ 581 ACPI_RESOURCE_SERIAL_COMMON 582 UINT8 WireMode; 583 UINT8 DevicePolarity; 584 UINT8 DataBitLength; 585 UINT8 ClockPhase; 586 UINT8 ClockPolarity; 587 UINT16 DeviceSelection; 588 UINT32 ConnectionSpeed; 589 590} ACPI_RESOURCE_SPI_SERIALBUS; 591 592/* Values for WireMode field above */ 593 594#define ACPI_SPI_4WIRE_MODE 0 595#define ACPI_SPI_3WIRE_MODE 1 596 597/* Values for DevicePolarity field above */ 598 599#define ACPI_SPI_ACTIVE_LOW 0 600#define ACPI_SPI_ACTIVE_HIGH 1 601 602/* Values for ClockPhase field above */ 603 604#define ACPI_SPI_FIRST_PHASE 0 605#define ACPI_SPI_SECOND_PHASE 1 606 607/* Values for ClockPolarity field above */ 608 609#define ACPI_SPI_START_LOW 0 610#define ACPI_SPI_START_HIGH 1 611 612 613typedef struct acpi_resource_uart_serialbus 614{ 615 ACPI_RESOURCE_SERIAL_COMMON 616 UINT8 Endian; 617 UINT8 DataBits; 618 UINT8 StopBits; 619 UINT8 FlowControl; 620 UINT8 Parity; 621 UINT8 LinesEnabled; 622 UINT16 RxFifoSize; 623 UINT16 TxFifoSize; 624 UINT32 DefaultBaudRate; 625 626} ACPI_RESOURCE_UART_SERIALBUS; 627 628/* Values for Endian field above */ 629 630#define ACPI_UART_LITTLE_ENDIAN 0 631#define ACPI_UART_BIG_ENDIAN 1 632 633/* Values for DataBits field above */ 634 635#define ACPI_UART_5_DATA_BITS 0 636#define ACPI_UART_6_DATA_BITS 1 637#define ACPI_UART_7_DATA_BITS 2 638#define ACPI_UART_8_DATA_BITS 3 639#define ACPI_UART_9_DATA_BITS 4 640 641/* Values for StopBits field above */ 642 643#define ACPI_UART_NO_STOP_BITS 0 644#define ACPI_UART_1_STOP_BIT 1 645#define ACPI_UART_1P5_STOP_BITS 2 646#define ACPI_UART_2_STOP_BITS 3 647 648/* Values for FlowControl field above */ 649 650#define ACPI_UART_FLOW_CONTROL_NONE 0 651#define ACPI_UART_FLOW_CONTROL_HW 1 652#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2 653 654/* Values for Parity field above */ 655 656#define ACPI_UART_PARITY_NONE 0 657#define ACPI_UART_PARITY_EVEN 1 658#define ACPI_UART_PARITY_ODD 2 659#define ACPI_UART_PARITY_MARK 3 660#define ACPI_UART_PARITY_SPACE 4 661 662/* Values for LinesEnabled bitfield above */ 663 664#define ACPI_UART_CARRIER_DETECT (1<<2) 665#define ACPI_UART_RING_INDICATOR (1<<3) 666#define ACPI_UART_DATA_SET_READY (1<<4) 667#define ACPI_UART_DATA_TERMINAL_READY (1<<5) 668#define ACPI_UART_CLEAR_TO_SEND (1<<6) 669#define ACPI_UART_REQUEST_TO_SEND (1<<7) 670 671 672/* ACPI_RESOURCE_TYPEs */ 673 674#define ACPI_RESOURCE_TYPE_IRQ 0 675#define ACPI_RESOURCE_TYPE_DMA 1 676#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2 677#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3 678#define ACPI_RESOURCE_TYPE_IO 4 679#define ACPI_RESOURCE_TYPE_FIXED_IO 5 680#define ACPI_RESOURCE_TYPE_VENDOR 6 681#define ACPI_RESOURCE_TYPE_END_TAG 7 682#define ACPI_RESOURCE_TYPE_MEMORY24 8 683#define ACPI_RESOURCE_TYPE_MEMORY32 9 684#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10 685#define ACPI_RESOURCE_TYPE_ADDRESS16 11 686#define ACPI_RESOURCE_TYPE_ADDRESS32 12 687#define ACPI_RESOURCE_TYPE_ADDRESS64 13 688#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ 689#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 690#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 691#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ 692#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ 693#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ 694#define ACPI_RESOURCE_TYPE_MAX 19 695 696/* Master union for resource descriptors */ 697 698typedef union acpi_resource_data 699{ 700 ACPI_RESOURCE_IRQ Irq; 701 ACPI_RESOURCE_DMA Dma; 702 ACPI_RESOURCE_START_DEPENDENT StartDpf; 703 ACPI_RESOURCE_IO Io; 704 ACPI_RESOURCE_FIXED_IO FixedIo; 705 ACPI_RESOURCE_FIXED_DMA FixedDma; 706 ACPI_RESOURCE_VENDOR Vendor; 707 ACPI_RESOURCE_VENDOR_TYPED VendorTyped; 708 ACPI_RESOURCE_END_TAG EndTag; 709 ACPI_RESOURCE_MEMORY24 Memory24; 710 ACPI_RESOURCE_MEMORY32 Memory32; 711 ACPI_RESOURCE_FIXED_MEMORY32 FixedMemory32; 712 ACPI_RESOURCE_ADDRESS16 Address16; 713 ACPI_RESOURCE_ADDRESS32 Address32; 714 ACPI_RESOURCE_ADDRESS64 Address64; 715 ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64; 716 ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq; 717 ACPI_RESOURCE_GENERIC_REGISTER GenericReg; 718 ACPI_RESOURCE_GPIO Gpio; 719 ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus; 720 ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus; 721 ACPI_RESOURCE_UART_SERIALBUS UartSerialBus; 722 ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus; 723 724 /* Common fields */ 725 726 ACPI_RESOURCE_ADDRESS Address; /* Common 16/32/64 address fields */ 727 728} ACPI_RESOURCE_DATA; 729 730 731/* Common resource header */ 732 733typedef struct acpi_resource 734{ 735 UINT32 Type; 736 UINT32 Length; 737 ACPI_RESOURCE_DATA Data; 738 739} ACPI_RESOURCE; 740 741/* restore default alignment */ 742 743#pragma pack() 744 745 746#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ 747#define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) 748#define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type)) 749 750#define ACPI_NEXT_RESOURCE(Res) (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length) 751 752 753typedef struct acpi_pci_routing_table 754{ 755 UINT32 Length; 756 UINT32 Pin; 757 UINT64 Address; /* here for 64-bit alignment */ 758 UINT32 SourceIndex; 759 char Source[4]; /* pad to 64 bits so sizeof() works in all cases */ 760 761} ACPI_PCI_ROUTING_TABLE; 762 763#endif /* __ACRESTYP_H__ */ 764