Home | History | Annotate | Line # | Download | only in disassembler
dmresrcl2.c revision 1.15.6.1
      1       1.1  christos /*******************************************************************************
      2       1.1  christos  *
      3       1.1  christos  * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
      4       1.1  christos  *
      5       1.1  christos  ******************************************************************************/
      6       1.1  christos 
      7  1.15.6.1  perseant /******************************************************************************
      8  1.15.6.1  perseant  *
      9  1.15.6.1  perseant  * 1. Copyright Notice
     10  1.15.6.1  perseant  *
     11  1.15.6.1  perseant  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
     12       1.1  christos  * All rights reserved.
     13       1.1  christos  *
     14  1.15.6.1  perseant  * 2. License
     15  1.15.6.1  perseant  *
     16  1.15.6.1  perseant  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.15.6.1  perseant  * rights. You may have additional license terms from the party that provided
     18  1.15.6.1  perseant  * you this software, covering your right to use that party's intellectual
     19  1.15.6.1  perseant  * property rights.
     20  1.15.6.1  perseant  *
     21  1.15.6.1  perseant  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.15.6.1  perseant  * copy of the source code appearing in this file ("Covered Code") an
     23  1.15.6.1  perseant  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.15.6.1  perseant  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.15.6.1  perseant  * make derivatives, distribute, use and display any portion of the Covered
     26  1.15.6.1  perseant  * Code in any form, with the right to sublicense such rights; and
     27  1.15.6.1  perseant  *
     28  1.15.6.1  perseant  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.15.6.1  perseant  * license (with the right to sublicense), under only those claims of Intel
     30  1.15.6.1  perseant  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.15.6.1  perseant  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.15.6.1  perseant  * solely to the minimum extent necessary to exercise the above copyright
     33  1.15.6.1  perseant  * license, and in no event shall the patent license extend to any additions
     34  1.15.6.1  perseant  * to or modifications of the Original Intel Code. No other license or right
     35  1.15.6.1  perseant  * is granted directly or by implication, estoppel or otherwise;
     36  1.15.6.1  perseant  *
     37  1.15.6.1  perseant  * The above copyright and patent license is granted only if the following
     38  1.15.6.1  perseant  * conditions are met:
     39  1.15.6.1  perseant  *
     40  1.15.6.1  perseant  * 3. Conditions
     41  1.15.6.1  perseant  *
     42  1.15.6.1  perseant  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.15.6.1  perseant  * Redistribution of source code of any substantial portion of the Covered
     44  1.15.6.1  perseant  * Code or modification with rights to further distribute source must include
     45  1.15.6.1  perseant  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.15.6.1  perseant  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.15.6.1  perseant  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.15.6.1  perseant  * contain a file documenting the changes Licensee made to create that Covered
     49  1.15.6.1  perseant  * Code and the date of any change. Licensee must include in that file the
     50  1.15.6.1  perseant  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.15.6.1  perseant  * must include a prominent statement that the modification is derived,
     52  1.15.6.1  perseant  * directly or indirectly, from Original Intel Code.
     53  1.15.6.1  perseant  *
     54  1.15.6.1  perseant  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.15.6.1  perseant  * Redistribution of source code of any substantial portion of the Covered
     56  1.15.6.1  perseant  * Code or modification without rights to further distribute source must
     57  1.15.6.1  perseant  * include the following Disclaimer and Export Compliance provision in the
     58  1.15.6.1  perseant  * documentation and/or other materials provided with distribution. In
     59  1.15.6.1  perseant  * addition, Licensee may not authorize further sublicense of source of any
     60  1.15.6.1  perseant  * portion of the Covered Code, and must include terms to the effect that the
     61  1.15.6.1  perseant  * license from Licensee to its licensee is limited to the intellectual
     62  1.15.6.1  perseant  * property embodied in the software Licensee provides to its licensee, and
     63  1.15.6.1  perseant  * not to intellectual property embodied in modifications its licensee may
     64  1.15.6.1  perseant  * make.
     65  1.15.6.1  perseant  *
     66  1.15.6.1  perseant  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.15.6.1  perseant  * substantial portion of the Covered Code or modification must reproduce the
     68  1.15.6.1  perseant  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.15.6.1  perseant  * provision in the documentation and/or other materials provided with the
     70  1.15.6.1  perseant  * distribution.
     71  1.15.6.1  perseant  *
     72  1.15.6.1  perseant  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.15.6.1  perseant  * Intel Code.
     74  1.15.6.1  perseant  *
     75  1.15.6.1  perseant  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.15.6.1  perseant  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.15.6.1  perseant  * other dealings in products derived from or relating to the Covered Code
     78  1.15.6.1  perseant  * without prior written authorization from Intel.
     79  1.15.6.1  perseant  *
     80  1.15.6.1  perseant  * 4. Disclaimer and Export Compliance
     81  1.15.6.1  perseant  *
     82  1.15.6.1  perseant  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.15.6.1  perseant  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.15.6.1  perseant  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.15.6.1  perseant  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.15.6.1  perseant  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.15.6.1  perseant  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.15.6.1  perseant  * PARTICULAR PURPOSE.
     89  1.15.6.1  perseant  *
     90  1.15.6.1  perseant  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.15.6.1  perseant  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.15.6.1  perseant  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.15.6.1  perseant  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.15.6.1  perseant  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.15.6.1  perseant  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.15.6.1  perseant  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.15.6.1  perseant  * LIMITED REMEDY.
     98  1.15.6.1  perseant  *
     99  1.15.6.1  perseant  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.15.6.1  perseant  * software or system incorporating such software without first obtaining any
    101  1.15.6.1  perseant  * required license or other approval from the U. S. Department of Commerce or
    102  1.15.6.1  perseant  * any other agency or department of the United States Government. In the
    103  1.15.6.1  perseant  * event Licensee exports any such software from the United States or
    104  1.15.6.1  perseant  * re-exports any such software from a foreign destination, Licensee shall
    105  1.15.6.1  perseant  * ensure that the distribution and export/re-export of the software is in
    106  1.15.6.1  perseant  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.15.6.1  perseant  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.15.6.1  perseant  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.15.6.1  perseant  * software, or service, directly or indirectly, to any country for which the
    110  1.15.6.1  perseant  * United States government or any agency thereof requires an export license,
    111  1.15.6.1  perseant  * other governmental approval, or letter of assurance, without first obtaining
    112  1.15.6.1  perseant  * such license, approval or letter.
    113  1.15.6.1  perseant  *
    114  1.15.6.1  perseant  *****************************************************************************
    115  1.15.6.1  perseant  *
    116  1.15.6.1  perseant  * Alternatively, you may choose to be licensed under the terms of the
    117  1.15.6.1  perseant  * following license:
    118  1.15.6.1  perseant  *
    119       1.1  christos  * Redistribution and use in source and binary forms, with or without
    120       1.1  christos  * modification, are permitted provided that the following conditions
    121       1.1  christos  * are met:
    122       1.1  christos  * 1. Redistributions of source code must retain the above copyright
    123       1.1  christos  *    notice, this list of conditions, and the following disclaimer,
    124       1.1  christos  *    without modification.
    125       1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126       1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
    127       1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
    128       1.1  christos  *    including a substantially similar Disclaimer requirement for further
    129       1.1  christos  *    binary redistribution.
    130       1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
    131       1.1  christos  *    of any contributors may be used to endorse or promote products derived
    132       1.1  christos  *    from this software without specific prior written permission.
    133       1.1  christos  *
    134       1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135       1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136      1.13  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137       1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.15.6.1  perseant  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.15.6.1  perseant  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.15.6.1  perseant  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.15.6.1  perseant  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.15.6.1  perseant  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.15.6.1  perseant  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.15.6.1  perseant  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.15.6.1  perseant  *
    146  1.15.6.1  perseant  * Alternatively, you may choose to be licensed under the terms of the
    147  1.15.6.1  perseant  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.15.6.1  perseant  * Software Foundation.
    149  1.15.6.1  perseant  *
    150  1.15.6.1  perseant  *****************************************************************************/
    151       1.1  christos 
    152       1.1  christos #include "acpi.h"
    153       1.1  christos #include "accommon.h"
    154       1.1  christos #include "acdisasm.h"
    155       1.1  christos 
    156       1.2  christos #ifdef _KERNEL
    157       1.2  christos #define MpSaveGpioInfo(a, b, c, d, e)
    158       1.2  christos #define MpSaveSerialInfo(a, b, c)
    159       1.2  christos #endif
    160       1.1  christos 
    161       1.1  christos #define _COMPONENT          ACPI_CA_DEBUGGER
    162       1.1  christos         ACPI_MODULE_NAME    ("dbresrcl2")
    163       1.1  christos 
    164       1.1  christos /* Local prototypes */
    165       1.1  christos 
    166       1.1  christos static void
    167      1.13  christos AcpiDmCsi2SerialBusDescriptor (
    168      1.13  christos     ACPI_OP_WALK_INFO       *Info,
    169      1.13  christos     AML_RESOURCE            *Resource,
    170      1.13  christos     UINT32                  Length,
    171      1.13  christos     UINT32                  Level);
    172      1.13  christos 
    173      1.13  christos static void
    174       1.1  christos AcpiDmI2cSerialBusDescriptor (
    175       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    176       1.1  christos     AML_RESOURCE            *Resource,
    177       1.1  christos     UINT32                  Length,
    178       1.1  christos     UINT32                  Level);
    179       1.1  christos 
    180       1.1  christos static void
    181       1.1  christos AcpiDmSpiSerialBusDescriptor (
    182       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    183       1.1  christos     AML_RESOURCE            *Resource,
    184       1.1  christos     UINT32                  Length,
    185       1.1  christos     UINT32                  Level);
    186       1.1  christos 
    187       1.1  christos static void
    188       1.1  christos AcpiDmUartSerialBusDescriptor (
    189       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    190       1.1  christos     AML_RESOURCE            *Resource,
    191       1.1  christos     UINT32                  Length,
    192       1.1  christos     UINT32                  Level);
    193       1.1  christos 
    194       1.1  christos static void
    195       1.1  christos AcpiDmGpioCommon (
    196       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    197       1.1  christos     AML_RESOURCE            *Resource,
    198       1.1  christos     UINT32                  Level);
    199       1.1  christos 
    200       1.1  christos static void
    201       1.1  christos AcpiDmDumpRawDataBuffer (
    202       1.1  christos     UINT8                   *Buffer,
    203       1.1  christos     UINT32                  Length,
    204       1.1  christos     UINT32                  Level);
    205       1.1  christos 
    206       1.1  christos 
    207       1.1  christos /* Dispatch table for the serial bus descriptors */
    208       1.1  christos 
    209       1.1  christos static ACPI_RESOURCE_HANDLER        SerialBusResourceDispatch [] =
    210       1.1  christos {
    211       1.1  christos     NULL,
    212       1.1  christos     AcpiDmI2cSerialBusDescriptor,
    213       1.1  christos     AcpiDmSpiSerialBusDescriptor,
    214      1.13  christos     AcpiDmUartSerialBusDescriptor,
    215      1.13  christos     AcpiDmCsi2SerialBusDescriptor
    216       1.1  christos };
    217       1.1  christos 
    218       1.1  christos 
    219       1.1  christos /*******************************************************************************
    220       1.1  christos  *
    221       1.1  christos  * FUNCTION:    AcpiDmDumpRawDataBuffer
    222       1.1  christos  *
    223       1.1  christos  * PARAMETERS:  Buffer              - Pointer to the data bytes
    224       1.1  christos  *              Length              - Length of the descriptor in bytes
    225       1.1  christos  *              Level               - Current source code indentation level
    226       1.1  christos  *
    227       1.1  christos  * RETURN:      None
    228       1.1  christos  *
    229       1.1  christos  * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
    230       1.1  christos  *              vendor data bytes.
    231       1.1  christos  *
    232       1.1  christos  ******************************************************************************/
    233       1.1  christos 
    234       1.1  christos static void
    235       1.1  christos AcpiDmDumpRawDataBuffer (
    236       1.1  christos     UINT8                   *Buffer,
    237       1.1  christos     UINT32                  Length,
    238       1.1  christos     UINT32                  Level)
    239       1.1  christos {
    240       1.1  christos     UINT32                  Index;
    241       1.1  christos     UINT32                  i;
    242       1.1  christos     UINT32                  j;
    243       1.1  christos 
    244       1.1  christos 
    245       1.1  christos     if (!Length)
    246       1.1  christos     {
    247       1.1  christos         return;
    248       1.1  christos     }
    249       1.1  christos 
    250       1.1  christos     AcpiOsPrintf ("RawDataBuffer (0x%.2X)  // Vendor Data", Length);
    251       1.1  christos 
    252       1.1  christos     AcpiOsPrintf ("\n");
    253       1.1  christos     AcpiDmIndent (Level + 1);
    254       1.1  christos     AcpiOsPrintf ("{\n");
    255       1.1  christos     AcpiDmIndent (Level + 2);
    256       1.1  christos 
    257       1.1  christos     for (i = 0; i < Length;)
    258       1.1  christos     {
    259       1.1  christos         for (j = 0; j < 8; j++)
    260       1.1  christos         {
    261       1.1  christos             Index = i + j;
    262       1.1  christos             if (Index >= Length)
    263       1.1  christos             {
    264       1.1  christos                 goto Finish;
    265       1.1  christos             }
    266       1.1  christos 
    267       1.1  christos             AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
    268       1.1  christos             if ((Index + 1) >= Length)
    269       1.1  christos             {
    270       1.1  christos                 goto Finish;
    271       1.1  christos             }
    272       1.1  christos 
    273       1.1  christos             AcpiOsPrintf (", ");
    274       1.1  christos         }
    275       1.4  christos 
    276       1.1  christos         AcpiOsPrintf ("\n");
    277       1.1  christos         AcpiDmIndent (Level + 2);
    278       1.1  christos 
    279       1.1  christos         i += 8;
    280       1.1  christos     }
    281       1.1  christos 
    282       1.1  christos Finish:
    283       1.1  christos     AcpiOsPrintf ("\n");
    284       1.1  christos     AcpiDmIndent (Level + 1);
    285       1.1  christos     AcpiOsPrintf ("}");
    286       1.1  christos }
    287       1.1  christos 
    288       1.1  christos 
    289       1.1  christos /*******************************************************************************
    290       1.1  christos  *
    291       1.1  christos  * FUNCTION:    AcpiDmGpioCommon
    292       1.1  christos  *
    293       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    294       1.2  christos  *              Resource            - Pointer to the resource descriptor
    295       1.1  christos  *              Level               - Current source code indentation level
    296       1.1  christos  *
    297       1.1  christos  * RETURN:      None
    298       1.1  christos  *
    299       1.1  christos  * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
    300       1.1  christos  *
    301       1.1  christos  ******************************************************************************/
    302       1.1  christos 
    303       1.1  christos static void
    304       1.1  christos AcpiDmGpioCommon (
    305       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    306       1.1  christos     AML_RESOURCE            *Resource,
    307       1.1  christos     UINT32                  Level)
    308       1.1  christos {
    309       1.1  christos     UINT16                  *PinList;
    310       1.1  christos     UINT8                   *VendorData;
    311       1.2  christos     char                    *DeviceName = NULL;
    312       1.2  christos     UINT32                  PinCount;
    313       1.1  christos     UINT32                  i;
    314       1.1  christos 
    315       1.1  christos 
    316       1.1  christos     /* ResourceSource, ResourceSourceIndex, ResourceType */
    317       1.1  christos 
    318       1.1  christos     AcpiDmIndent (Level + 1);
    319       1.1  christos     if (Resource->Gpio.ResSourceOffset)
    320       1.1  christos     {
    321       1.4  christos         DeviceName = ACPI_ADD_PTR (char,
    322       1.7  christos             Resource, Resource->Gpio.ResSourceOffset);
    323       1.2  christos         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    324       1.1  christos     }
    325       1.1  christos 
    326       1.1  christos     AcpiOsPrintf (", ");
    327       1.1  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
    328       1.1  christos     AcpiOsPrintf ("%s, ",
    329       1.1  christos         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
    330       1.1  christos 
    331       1.1  christos     /* Insert a descriptor name */
    332       1.1  christos 
    333       1.1  christos     AcpiDmDescriptorName ();
    334       1.1  christos     AcpiOsPrintf (",");
    335       1.1  christos 
    336       1.1  christos     /* Dump the vendor data */
    337       1.1  christos 
    338       1.1  christos     if (Resource->Gpio.VendorOffset)
    339       1.1  christos     {
    340       1.1  christos         AcpiOsPrintf ("\n");
    341       1.1  christos         AcpiDmIndent (Level + 1);
    342       1.1  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
    343       1.1  christos             Resource->Gpio.VendorOffset);
    344       1.1  christos 
    345       1.1  christos         AcpiDmDumpRawDataBuffer (VendorData,
    346       1.1  christos             Resource->Gpio.VendorLength, Level);
    347       1.1  christos     }
    348       1.1  christos 
    349       1.1  christos     AcpiOsPrintf (")\n");
    350       1.1  christos 
    351       1.1  christos     /* Dump the interrupt list */
    352       1.1  christos 
    353       1.1  christos     AcpiDmIndent (Level + 1);
    354       1.1  christos     AcpiOsPrintf ("{   // Pin list\n");
    355       1.1  christos 
    356       1.1  christos     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
    357       1.1  christos         Resource->Gpio.PinTableOffset)) /
    358       1.1  christos         sizeof (UINT16);
    359       1.1  christos 
    360       1.1  christos     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
    361       1.1  christos         Resource->Gpio.PinTableOffset);
    362       1.1  christos 
    363       1.1  christos     for (i = 0; i < PinCount; i++)
    364       1.1  christos     {
    365       1.1  christos         AcpiDmIndent (Level + 2);
    366       1.4  christos         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
    367       1.4  christos             ((i + 1) < PinCount) ? "," : "");
    368       1.1  christos     }
    369       1.1  christos 
    370       1.1  christos     AcpiDmIndent (Level + 1);
    371       1.1  christos     AcpiOsPrintf ("}\n");
    372       1.2  christos 
    373       1.4  christos     MpSaveGpioInfo (Info->MappingOp, Resource,
    374       1.4  christos         PinCount, PinList, DeviceName);
    375       1.1  christos }
    376       1.1  christos 
    377       1.1  christos 
    378       1.1  christos /*******************************************************************************
    379       1.1  christos  *
    380       1.1  christos  * FUNCTION:    AcpiDmGpioIntDescriptor
    381       1.1  christos  *
    382       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    383       1.2  christos  *              Resource            - Pointer to the resource descriptor
    384       1.1  christos  *              Length              - Length of the descriptor in bytes
    385       1.1  christos  *              Level               - Current source code indentation level
    386       1.1  christos  *
    387       1.1  christos  * RETURN:      None
    388       1.1  christos  *
    389       1.1  christos  * DESCRIPTION: Decode a GPIO Interrupt descriptor
    390       1.1  christos  *
    391       1.1  christos  ******************************************************************************/
    392       1.1  christos 
    393       1.1  christos static void
    394       1.1  christos AcpiDmGpioIntDescriptor (
    395       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    396       1.1  christos     AML_RESOURCE            *Resource,
    397       1.1  christos     UINT32                  Length,
    398       1.1  christos     UINT32                  Level)
    399       1.1  christos {
    400       1.1  christos 
    401       1.1  christos     /* Dump the GpioInt-specific portion of the descriptor */
    402       1.1  christos 
    403       1.1  christos     /* EdgeLevel, ActiveLevel, Shared */
    404       1.1  christos 
    405       1.1  christos     AcpiDmIndent (Level);
    406       1.1  christos     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
    407       1.1  christos         AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
    408       1.2  christos         AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
    409       1.1  christos         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
    410       1.1  christos 
    411       1.1  christos     /* PinConfig, DebounceTimeout */
    412       1.1  christos 
    413       1.1  christos     if (Resource->Gpio.PinConfig <= 3)
    414       1.1  christos     {
    415       1.1  christos         AcpiOsPrintf ("%s, ",
    416       1.1  christos             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
    417       1.1  christos     }
    418       1.1  christos     else
    419       1.1  christos     {
    420       1.1  christos         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
    421       1.1  christos     }
    422       1.1  christos     AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
    423       1.1  christos 
    424       1.1  christos     /* Dump the GpioInt/GpioIo common portion of the descriptor */
    425       1.1  christos 
    426       1.2  christos     AcpiDmGpioCommon (Info, Resource, Level);
    427       1.1  christos }
    428       1.1  christos 
    429       1.1  christos 
    430       1.1  christos /*******************************************************************************
    431       1.1  christos  *
    432       1.1  christos  * FUNCTION:    AcpiDmGpioIoDescriptor
    433       1.1  christos  *
    434       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    435       1.2  christos  *              Resource            - Pointer to the resource descriptor
    436       1.1  christos  *              Length              - Length of the descriptor in bytes
    437       1.1  christos  *              Level               - Current source code indentation level
    438       1.1  christos  *
    439       1.1  christos  * RETURN:      None
    440       1.1  christos  *
    441       1.1  christos  * DESCRIPTION: Decode a GPIO I/O descriptor
    442       1.1  christos  *
    443       1.1  christos  ******************************************************************************/
    444       1.1  christos 
    445       1.1  christos static void
    446       1.1  christos AcpiDmGpioIoDescriptor (
    447       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    448       1.1  christos     AML_RESOURCE            *Resource,
    449       1.1  christos     UINT32                  Length,
    450       1.1  christos     UINT32                  Level)
    451       1.1  christos {
    452       1.1  christos 
    453       1.1  christos     /* Dump the GpioIo-specific portion of the descriptor */
    454       1.1  christos 
    455       1.1  christos     /* Shared, PinConfig */
    456       1.1  christos 
    457       1.1  christos     AcpiDmIndent (Level);
    458       1.1  christos     AcpiOsPrintf ("GpioIo (%s, ",
    459       1.1  christos         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
    460       1.1  christos 
    461       1.1  christos     if (Resource->Gpio.PinConfig <= 3)
    462       1.1  christos     {
    463       1.1  christos         AcpiOsPrintf ("%s, ",
    464       1.1  christos             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
    465       1.1  christos     }
    466       1.1  christos     else
    467       1.1  christos     {
    468       1.1  christos         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
    469       1.1  christos     }
    470       1.1  christos 
    471       1.1  christos     /* DebounceTimeout, DriveStrength, IoRestriction */
    472       1.1  christos 
    473       1.1  christos     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
    474       1.1  christos     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
    475       1.1  christos     AcpiOsPrintf ("%s,\n",
    476       1.1  christos         AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
    477       1.1  christos 
    478       1.1  christos     /* Dump the GpioInt/GpioIo common portion of the descriptor */
    479       1.1  christos 
    480       1.2  christos     AcpiDmGpioCommon (Info, Resource, Level);
    481       1.1  christos }
    482       1.1  christos 
    483       1.1  christos 
    484       1.1  christos /*******************************************************************************
    485       1.1  christos  *
    486       1.1  christos  * FUNCTION:    AcpiDmGpioDescriptor
    487       1.1  christos  *
    488       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    489       1.2  christos  *              Resource            - Pointer to the resource descriptor
    490       1.1  christos  *              Length              - Length of the descriptor in bytes
    491       1.1  christos  *              Level               - Current source code indentation level
    492       1.1  christos  *
    493       1.1  christos  * RETURN:      None
    494       1.1  christos  *
    495       1.1  christos  * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor
    496       1.1  christos  *
    497       1.1  christos  ******************************************************************************/
    498       1.1  christos 
    499       1.1  christos void
    500       1.1  christos AcpiDmGpioDescriptor (
    501       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    502       1.1  christos     AML_RESOURCE            *Resource,
    503       1.1  christos     UINT32                  Length,
    504       1.1  christos     UINT32                  Level)
    505       1.1  christos {
    506       1.1  christos     UINT8                   ConnectionType;
    507       1.1  christos 
    508       1.1  christos 
    509       1.1  christos     ConnectionType = Resource->Gpio.ConnectionType;
    510       1.1  christos 
    511       1.1  christos     switch (ConnectionType)
    512       1.1  christos     {
    513       1.1  christos     case AML_RESOURCE_GPIO_TYPE_INT:
    514       1.1  christos 
    515       1.2  christos         AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
    516       1.1  christos         break;
    517       1.1  christos 
    518       1.1  christos     case AML_RESOURCE_GPIO_TYPE_IO:
    519       1.1  christos 
    520       1.2  christos         AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
    521       1.1  christos         break;
    522       1.1  christos 
    523       1.1  christos     default:
    524       1.1  christos 
    525       1.1  christos         AcpiOsPrintf ("Unknown GPIO type\n");
    526       1.1  christos         break;
    527       1.1  christos     }
    528       1.1  christos }
    529       1.1  christos 
    530      1.15  christos void
    531      1.15  christos AcpiDmClockInputDescriptor (
    532      1.15  christos     ACPI_OP_WALK_INFO       *Info,
    533      1.15  christos     AML_RESOURCE            *Resource,
    534      1.15  christos     UINT32                  Length,
    535      1.15  christos     UINT32                  Level)
    536      1.15  christos {
    537      1.15  christos     char                    *DeviceName = NULL;
    538      1.15  christos     UINT8                   *ResourceIndex = NULL;
    539      1.15  christos     AcpiDmIndent (Level);
    540      1.15  christos 
    541      1.15  christos     AcpiOsPrintf ("ClockInput (");
    542      1.15  christos 
    543      1.15  christos     AcpiOsPrintf ("0x%8.8X, ", Resource->ClockInput.FrequencyNumerator);
    544      1.15  christos 
    545      1.15  christos     AcpiOsPrintf ("0x%4.4X, ", Resource->ClockInput.FrequencyDivisor);
    546      1.15  christos 
    547      1.15  christos     AcpiOsPrintf ("%s, ",
    548      1.15  christos         AcpiGbl_ClockInputScale [ACPI_EXTRACT_2BIT_FLAG (Resource->ClockInput.Flags, 1)]);
    549      1.15  christos 
    550      1.15  christos     AcpiOsPrintf ("%s, ",
    551      1.15  christos         AcpiGbl_ClockInputMode [ACPI_GET_1BIT_FLAG (Resource->ClockInput.Flags)]);
    552      1.15  christos 
    553      1.15  christos     if (Length > sizeof(Resource->ClockInput))
    554      1.15  christos     {
    555      1.15  christos         DeviceName = ACPI_ADD_PTR (char,
    556      1.15  christos             Resource, sizeof(Resource->ClockInput)+1),
    557      1.15  christos         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    558      1.15  christos 
    559      1.15  christos         AcpiOsPrintf (", ");
    560      1.15  christos         ResourceIndex = ACPI_ADD_PTR (UINT8,
    561      1.15  christos             Resource, sizeof(Resource->ClockInput)),
    562      1.15  christos 
    563      1.15  christos         AcpiOsPrintf ("0x%2.2X", *ResourceIndex);
    564      1.15  christos     }
    565      1.15  christos 
    566      1.15  christos     AcpiOsPrintf (")\n");
    567      1.15  christos 
    568      1.15  christos }
    569      1.15  christos 
    570       1.9  christos /*******************************************************************************
    571       1.9  christos  *
    572       1.9  christos  * FUNCTION:    AcpiDmPinFunctionDescriptor
    573       1.9  christos  *
    574       1.9  christos  * PARAMETERS:  Info                - Extra resource info
    575       1.9  christos  *              Resource            - Pointer to the resource descriptor
    576       1.9  christos  *              Length              - Length of the descriptor in bytes
    577       1.9  christos  *              Level               - Current source code indentation level
    578       1.9  christos  *
    579       1.9  christos  * RETURN:      None
    580       1.9  christos  *
    581       1.9  christos  * DESCRIPTION: Decode a PinFunction descriptor
    582       1.9  christos  *
    583       1.9  christos  ******************************************************************************/
    584       1.9  christos 
    585       1.9  christos void
    586       1.9  christos AcpiDmPinFunctionDescriptor (
    587       1.9  christos     ACPI_OP_WALK_INFO       *Info,
    588       1.9  christos     AML_RESOURCE            *Resource,
    589       1.9  christos     UINT32                  Length,
    590       1.9  christos     UINT32                  Level)
    591       1.9  christos {
    592       1.9  christos     UINT16                  *PinList;
    593       1.9  christos     UINT8                   *VendorData;
    594       1.9  christos     char                    *DeviceName = NULL;
    595       1.9  christos     UINT32                  PinCount;
    596       1.9  christos     UINT32                  i;
    597       1.9  christos 
    598       1.9  christos     AcpiDmIndent (Level);
    599       1.9  christos     AcpiOsPrintf ("PinFunction (%s, ",
    600       1.9  christos         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]);
    601       1.9  christos 
    602       1.9  christos     if (Resource->PinFunction.PinConfig <= 3)
    603       1.9  christos     {
    604       1.9  christos         AcpiOsPrintf ("%s, ",
    605       1.9  christos             AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]);
    606       1.9  christos     }
    607       1.9  christos     else
    608       1.9  christos     {
    609       1.9  christos         AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig);
    610       1.9  christos     }
    611       1.9  christos 
    612       1.9  christos     /* FunctionNumber */
    613       1.9  christos 
    614       1.9  christos     AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
    615       1.9  christos 
    616       1.9  christos     if (Resource->PinFunction.ResSourceOffset)
    617       1.9  christos     {
    618       1.9  christos         DeviceName = ACPI_ADD_PTR (char,
    619       1.9  christos             Resource, Resource->PinFunction.ResSourceOffset),
    620       1.9  christos         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    621       1.9  christos     }
    622       1.9  christos 
    623       1.9  christos     AcpiOsPrintf (", ");
    624       1.9  christos     AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex);
    625       1.9  christos 
    626       1.9  christos     AcpiDmIndent (Level + 1);
    627       1.9  christos 
    628       1.9  christos     /* Always ResourceConsumer */
    629       1.9  christos     AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]);
    630       1.9  christos 
    631       1.9  christos     /* Insert a descriptor name */
    632       1.9  christos 
    633       1.9  christos     AcpiDmDescriptorName ();
    634       1.9  christos 
    635       1.9  christos     AcpiOsPrintf (",");
    636       1.9  christos 
    637       1.9  christos     /* Dump the vendor data */
    638       1.9  christos 
    639       1.9  christos     if (Resource->PinFunction.VendorLength)
    640       1.9  christos     {
    641       1.9  christos         AcpiOsPrintf ("\n");
    642       1.9  christos         AcpiDmIndent (Level + 1);
    643       1.9  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
    644       1.9  christos             Resource->PinFunction.VendorOffset);
    645       1.9  christos 
    646       1.9  christos         AcpiDmDumpRawDataBuffer (VendorData,
    647       1.9  christos             Resource->PinFunction.VendorLength, Level);
    648       1.9  christos     }
    649       1.9  christos 
    650       1.9  christos     AcpiOsPrintf (")\n");
    651       1.9  christos 
    652       1.9  christos     AcpiDmIndent (Level + 1);
    653       1.9  christos 
    654       1.9  christos     /* Dump the interrupt list */
    655       1.9  christos 
    656       1.9  christos     AcpiOsPrintf ("{   // Pin list\n");
    657       1.9  christos 
    658       1.9  christos     PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
    659       1.9  christos         Resource->PinFunction.PinTableOffset)) /
    660       1.9  christos         sizeof (UINT16);
    661       1.9  christos 
    662       1.9  christos     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
    663       1.9  christos         Resource->PinFunction.PinTableOffset);
    664       1.9  christos 
    665       1.9  christos     for (i = 0; i < PinCount; i++)
    666       1.9  christos     {
    667       1.9  christos         AcpiDmIndent (Level + 2);
    668       1.9  christos         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
    669       1.9  christos             ((i + 1) < PinCount) ? "," : "");
    670       1.9  christos     }
    671       1.9  christos 
    672       1.9  christos     AcpiDmIndent (Level + 1);
    673       1.9  christos     AcpiOsPrintf ("}\n");
    674       1.9  christos }
    675       1.9  christos 
    676       1.1  christos 
    677       1.1  christos /*******************************************************************************
    678       1.1  christos  *
    679       1.1  christos  * FUNCTION:    AcpiDmDumpSerialBusVendorData
    680       1.1  christos  *
    681       1.1  christos  * PARAMETERS:  Resource            - Pointer to the resource descriptor
    682       1.1  christos  *
    683       1.1  christos  * RETURN:      None
    684       1.1  christos  *
    685       1.1  christos  * DESCRIPTION: Dump optional serial bus vendor data
    686       1.1  christos  *
    687       1.1  christos  ******************************************************************************/
    688       1.1  christos 
    689       1.1  christos static void
    690       1.1  christos AcpiDmDumpSerialBusVendorData (
    691       1.1  christos     AML_RESOURCE            *Resource,
    692       1.1  christos     UINT32                  Level)
    693       1.1  christos {
    694       1.1  christos     UINT8                   *VendorData;
    695       1.1  christos     UINT32                  VendorLength;
    696       1.1  christos 
    697       1.1  christos 
    698       1.1  christos     /* Get the (optional) vendor data and length */
    699       1.1  christos 
    700       1.1  christos     switch (Resource->CommonSerialBus.Type)
    701       1.1  christos     {
    702       1.1  christos     case AML_RESOURCE_I2C_SERIALBUSTYPE:
    703       1.1  christos 
    704       1.1  christos         VendorLength = Resource->CommonSerialBus.TypeDataLength -
    705       1.1  christos             AML_RESOURCE_I2C_MIN_DATA_LEN;
    706       1.1  christos 
    707       1.1  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
    708       1.1  christos             sizeof (AML_RESOURCE_I2C_SERIALBUS));
    709       1.1  christos         break;
    710       1.1  christos 
    711       1.1  christos     case AML_RESOURCE_SPI_SERIALBUSTYPE:
    712       1.1  christos 
    713       1.1  christos         VendorLength = Resource->CommonSerialBus.TypeDataLength -
    714       1.1  christos             AML_RESOURCE_SPI_MIN_DATA_LEN;
    715       1.1  christos 
    716       1.1  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
    717       1.1  christos             sizeof (AML_RESOURCE_SPI_SERIALBUS));
    718       1.1  christos         break;
    719       1.1  christos 
    720       1.1  christos     case AML_RESOURCE_UART_SERIALBUSTYPE:
    721       1.1  christos 
    722       1.1  christos         VendorLength = Resource->CommonSerialBus.TypeDataLength -
    723       1.1  christos             AML_RESOURCE_UART_MIN_DATA_LEN;
    724       1.1  christos 
    725       1.1  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
    726       1.1  christos             sizeof (AML_RESOURCE_UART_SERIALBUS));
    727       1.1  christos         break;
    728       1.1  christos 
    729      1.13  christos     case AML_RESOURCE_CSI2_SERIALBUSTYPE:
    730      1.13  christos 
    731      1.13  christos         VendorLength = Resource->CommonSerialBus.TypeDataLength -
    732      1.13  christos             AML_RESOURCE_CSI2_MIN_DATA_LEN;
    733      1.13  christos 
    734      1.13  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
    735      1.13  christos             sizeof (AML_RESOURCE_CSI2_SERIALBUS));
    736      1.13  christos         break;
    737      1.13  christos 
    738       1.1  christos     default:
    739       1.1  christos 
    740       1.1  christos         return;
    741       1.1  christos     }
    742       1.1  christos 
    743       1.1  christos     /* Dump the vendor bytes as a RawDataBuffer object */
    744       1.1  christos 
    745       1.1  christos     AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
    746       1.1  christos }
    747       1.1  christos 
    748       1.1  christos 
    749       1.1  christos /*******************************************************************************
    750       1.1  christos  *
    751      1.13  christos  * FUNCTION:    AcpiDmCsi2SerialBusDescriptor
    752      1.13  christos  *
    753      1.13  christos  * PARAMETERS:  Info                - Extra resource info
    754      1.13  christos  *              Resource            - Pointer to the resource descriptor
    755      1.13  christos  *              Length              - Length of the descriptor in bytes
    756      1.13  christos  *              Level               - Current source code indentation level
    757      1.13  christos  *
    758      1.13  christos  * RETURN:      None
    759      1.13  christos  *
    760      1.13  christos  * DESCRIPTION: Decode a CSI2 serial bus descriptor
    761      1.13  christos  *
    762      1.13  christos  ******************************************************************************/
    763      1.13  christos 
    764      1.13  christos static void
    765      1.13  christos AcpiDmCsi2SerialBusDescriptor (
    766      1.13  christos     ACPI_OP_WALK_INFO       *Info,
    767      1.13  christos     AML_RESOURCE            *Resource,
    768      1.13  christos     UINT32                  Length,
    769      1.13  christos     UINT32                  Level)
    770      1.13  christos {
    771      1.13  christos     UINT32                  ResourceSourceOffset;
    772      1.13  christos     char                    *DeviceName;
    773      1.13  christos 
    774      1.13  christos 
    775      1.13  christos     /* SlaveMode, PhyType, LocalPortInstance */
    776      1.13  christos 
    777      1.13  christos     AcpiDmIndent (Level);
    778      1.13  christos     AcpiOsPrintf ("Csi2Bus (%s,",
    779      1.13  christos         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->Csi2SerialBus.Flags)]);
    780      1.13  christos 
    781      1.13  christos     AcpiOsPrintf (" 0x%2.2X, 0x%2.2X,\n",
    782      1.13  christos         Resource->Csi2SerialBus.TypeSpecificFlags & 0x03,
    783      1.13  christos         Resource->Csi2SerialBus.TypeSpecificFlags & 0xFC);
    784      1.13  christos 
    785      1.13  christos     /* ResourceSource is a required field */
    786      1.13  christos 
    787      1.13  christos     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
    788      1.13  christos         Resource->CommonSerialBus.TypeDataLength;
    789      1.13  christos 
    790      1.13  christos     AcpiDmIndent (Level + 1);
    791      1.13  christos     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
    792      1.13  christos     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    793      1.13  christos 
    794      1.13  christos     /* ResourceSourceIndex, ResourceUsage */
    795      1.13  christos 
    796      1.13  christos     AcpiOsPrintf (",\n");
    797      1.13  christos     AcpiDmIndent (Level + 1);
    798      1.13  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->Csi2SerialBus.ResSourceIndex);
    799      1.13  christos 
    800      1.13  christos     AcpiOsPrintf ("%s, ",
    801      1.13  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Csi2SerialBus.Flags, 1)]);
    802      1.13  christos 
    803      1.13  christos     /* Insert a descriptor name */
    804      1.13  christos 
    805      1.13  christos     AcpiDmDescriptorName ();
    806      1.13  christos 
    807      1.13  christos     /* Dump the vendor data */
    808      1.13  christos 
    809      1.13  christos     AcpiOsPrintf (",\n");
    810      1.13  christos     AcpiDmIndent (Level + 1);
    811      1.13  christos     AcpiDmDumpSerialBusVendorData (Resource, Level);
    812      1.13  christos     AcpiOsPrintf (")\n");
    813      1.13  christos 
    814      1.13  christos     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
    815      1.13  christos }
    816      1.13  christos 
    817      1.13  christos 
    818      1.13  christos /*******************************************************************************
    819      1.13  christos  *
    820       1.1  christos  * FUNCTION:    AcpiDmI2cSerialBusDescriptor
    821       1.1  christos  *
    822       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    823       1.2  christos  *              Resource            - Pointer to the resource descriptor
    824       1.1  christos  *              Length              - Length of the descriptor in bytes
    825       1.1  christos  *              Level               - Current source code indentation level
    826       1.1  christos  *
    827       1.1  christos  * RETURN:      None
    828       1.1  christos  *
    829       1.1  christos  * DESCRIPTION: Decode a I2C serial bus descriptor
    830       1.1  christos  *
    831       1.1  christos  ******************************************************************************/
    832       1.1  christos 
    833       1.1  christos static void
    834       1.1  christos AcpiDmI2cSerialBusDescriptor (
    835       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    836       1.1  christos     AML_RESOURCE            *Resource,
    837       1.1  christos     UINT32                  Length,
    838       1.1  christos     UINT32                  Level)
    839       1.1  christos {
    840       1.1  christos     UINT32                  ResourceSourceOffset;
    841       1.2  christos     char                    *DeviceName;
    842       1.1  christos 
    843       1.1  christos 
    844       1.1  christos     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
    845       1.1  christos 
    846       1.1  christos     AcpiDmIndent (Level);
    847       1.5  christos     AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
    848       1.1  christos         Resource->I2cSerialBus.SlaveAddress,
    849       1.1  christos         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
    850       1.1  christos         Resource->I2cSerialBus.ConnectionSpeed);
    851       1.1  christos 
    852       1.1  christos     AcpiDmIndent (Level + 1);
    853       1.1  christos     AcpiOsPrintf ("%s, ",
    854       1.1  christos         AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
    855       1.1  christos 
    856       1.1  christos     /* ResourceSource is a required field */
    857       1.1  christos 
    858       1.1  christos     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
    859       1.1  christos         Resource->CommonSerialBus.TypeDataLength;
    860       1.1  christos 
    861       1.6  christos     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
    862       1.2  christos     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    863       1.1  christos 
    864       1.1  christos     /* ResourceSourceIndex, ResourceUsage */
    865       1.1  christos 
    866       1.1  christos     AcpiOsPrintf (",\n");
    867       1.1  christos     AcpiDmIndent (Level + 1);
    868       1.1  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
    869       1.1  christos 
    870       1.1  christos     AcpiOsPrintf ("%s, ",
    871       1.1  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
    872       1.1  christos 
    873       1.1  christos     /* Insert a descriptor name */
    874       1.1  christos 
    875       1.1  christos     AcpiDmDescriptorName ();
    876       1.5  christos 
    877       1.5  christos     /* Share */
    878       1.5  christos 
    879       1.5  christos     AcpiOsPrintf (", %s,\n",
    880       1.5  christos         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 2)]);
    881       1.1  christos 
    882       1.1  christos     /* Dump the vendor data */
    883       1.1  christos 
    884       1.1  christos     AcpiDmIndent (Level + 1);
    885       1.1  christos     AcpiDmDumpSerialBusVendorData (Resource, Level);
    886       1.1  christos     AcpiOsPrintf (")\n");
    887       1.2  christos 
    888       1.2  christos     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
    889       1.1  christos }
    890       1.1  christos 
    891       1.1  christos 
    892       1.1  christos /*******************************************************************************
    893       1.1  christos  *
    894       1.1  christos  * FUNCTION:    AcpiDmSpiSerialBusDescriptor
    895       1.1  christos  *
    896       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    897       1.2  christos  *              Resource            - Pointer to the resource descriptor
    898       1.1  christos  *              Length              - Length of the descriptor in bytes
    899       1.1  christos  *              Level               - Current source code indentation level
    900       1.1  christos  *
    901       1.1  christos  * RETURN:      None
    902       1.1  christos  *
    903       1.1  christos  * DESCRIPTION: Decode a SPI serial bus descriptor
    904       1.1  christos  *
    905       1.1  christos  ******************************************************************************/
    906       1.1  christos 
    907       1.1  christos static void
    908       1.1  christos AcpiDmSpiSerialBusDescriptor (
    909       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    910       1.1  christos     AML_RESOURCE            *Resource,
    911       1.1  christos     UINT32                  Length,
    912       1.1  christos     UINT32                  Level)
    913       1.1  christos {
    914       1.1  christos     UINT32                  ResourceSourceOffset;
    915       1.2  christos     char                    *DeviceName;
    916       1.1  christos 
    917       1.1  christos 
    918       1.1  christos     /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
    919       1.1  christos 
    920       1.1  christos     AcpiDmIndent (Level);
    921       1.5  christos     AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n",
    922       1.1  christos         Resource->SpiSerialBus.DeviceSelection,
    923       1.1  christos         AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
    924       1.1  christos         AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
    925       1.1  christos         Resource->SpiSerialBus.DataBitLength);
    926       1.1  christos 
    927       1.1  christos     /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
    928       1.1  christos 
    929       1.1  christos     AcpiDmIndent (Level + 1);
    930       1.1  christos     AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
    931       1.1  christos         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
    932       1.1  christos         Resource->SpiSerialBus.ConnectionSpeed,
    933       1.1  christos         AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
    934       1.1  christos 
    935       1.1  christos     AcpiDmIndent (Level + 1);
    936       1.1  christos     AcpiOsPrintf ("%s, ",
    937       1.1  christos         AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
    938       1.1  christos 
    939       1.1  christos     /* ResourceSource is a required field */
    940       1.1  christos 
    941       1.1  christos     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
    942       1.1  christos         Resource->CommonSerialBus.TypeDataLength;
    943       1.1  christos 
    944       1.7  christos     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
    945       1.2  christos     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    946       1.1  christos 
    947       1.1  christos     /* ResourceSourceIndex, ResourceUsage */
    948       1.1  christos 
    949       1.1  christos     AcpiOsPrintf (",\n");
    950       1.1  christos     AcpiDmIndent (Level + 1);
    951       1.1  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
    952       1.1  christos 
    953       1.1  christos     AcpiOsPrintf ("%s, ",
    954       1.1  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
    955       1.1  christos 
    956       1.1  christos     /* Insert a descriptor name */
    957       1.1  christos 
    958       1.1  christos     AcpiDmDescriptorName ();
    959       1.5  christos 
    960       1.5  christos     /* Share */
    961       1.5  christos 
    962       1.5  christos     AcpiOsPrintf (", %s,\n",
    963       1.5  christos         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 2)]);
    964       1.1  christos 
    965       1.1  christos     /* Dump the vendor data */
    966       1.1  christos 
    967       1.1  christos     AcpiDmIndent (Level + 1);
    968       1.1  christos     AcpiDmDumpSerialBusVendorData (Resource, Level);
    969       1.1  christos     AcpiOsPrintf (")\n");
    970       1.2  christos 
    971       1.2  christos     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
    972       1.1  christos }
    973       1.1  christos 
    974       1.1  christos 
    975       1.1  christos /*******************************************************************************
    976       1.1  christos  *
    977       1.1  christos  * FUNCTION:    AcpiDmUartSerialBusDescriptor
    978       1.1  christos  *
    979       1.2  christos  * PARAMETERS:  Info                - Extra resource info
    980       1.2  christos  *              Resource            - Pointer to the resource descriptor
    981       1.1  christos  *              Length              - Length of the descriptor in bytes
    982       1.1  christos  *              Level               - Current source code indentation level
    983       1.1  christos  *
    984       1.1  christos  * RETURN:      None
    985       1.1  christos  *
    986       1.1  christos  * DESCRIPTION: Decode a UART serial bus descriptor
    987       1.1  christos  *
    988       1.1  christos  ******************************************************************************/
    989       1.1  christos 
    990       1.1  christos static void
    991       1.1  christos AcpiDmUartSerialBusDescriptor (
    992       1.2  christos     ACPI_OP_WALK_INFO       *Info,
    993       1.1  christos     AML_RESOURCE            *Resource,
    994       1.1  christos     UINT32                  Length,
    995       1.1  christos     UINT32                  Level)
    996       1.1  christos {
    997       1.1  christos     UINT32                  ResourceSourceOffset;
    998       1.2  christos     char                    *DeviceName;
    999       1.1  christos 
   1000       1.1  christos 
   1001       1.1  christos     /* ConnectionSpeed, BitsPerByte, StopBits */
   1002       1.1  christos 
   1003       1.1  christos     AcpiDmIndent (Level);
   1004       1.5  christos     AcpiOsPrintf ("UartSerialBusV2 (0x%8.8X, %s, %s,\n",
   1005       1.1  christos         Resource->UartSerialBus.DefaultBaudRate,
   1006       1.1  christos         AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
   1007       1.1  christos         AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
   1008       1.1  christos 
   1009       1.1  christos     /* LinesInUse, IsBigEndian, Parity, FlowControl */
   1010       1.1  christos 
   1011       1.1  christos     AcpiDmIndent (Level + 1);
   1012       1.1  christos     AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
   1013       1.1  christos         Resource->UartSerialBus.LinesEnabled,
   1014       1.1  christos         AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
   1015       1.1  christos         AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
   1016       1.1  christos         AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
   1017       1.1  christos 
   1018       1.1  christos     /* ReceiveBufferSize, TransmitBufferSize */
   1019       1.1  christos 
   1020       1.1  christos     AcpiDmIndent (Level + 1);
   1021       1.1  christos     AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
   1022       1.1  christos         Resource->UartSerialBus.RxFifoSize,
   1023       1.1  christos         Resource->UartSerialBus.TxFifoSize);
   1024       1.1  christos 
   1025       1.1  christos     /* ResourceSource is a required field */
   1026       1.1  christos 
   1027       1.1  christos     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
   1028       1.1  christos         Resource->CommonSerialBus.TypeDataLength;
   1029       1.1  christos 
   1030       1.7  christos     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
   1031       1.2  christos     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
   1032       1.1  christos 
   1033       1.1  christos     /* ResourceSourceIndex, ResourceUsage */
   1034       1.1  christos 
   1035       1.1  christos     AcpiOsPrintf (",\n");
   1036       1.1  christos     AcpiDmIndent (Level + 1);
   1037       1.1  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
   1038       1.1  christos 
   1039       1.1  christos     AcpiOsPrintf ("%s, ",
   1040       1.1  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
   1041       1.1  christos 
   1042       1.1  christos     /* Insert a descriptor name */
   1043       1.1  christos 
   1044       1.1  christos     AcpiDmDescriptorName ();
   1045       1.5  christos 
   1046       1.5  christos     /* Share */
   1047       1.5  christos 
   1048       1.5  christos     AcpiOsPrintf (", %s,\n",
   1049       1.5  christos         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 2)]);
   1050       1.1  christos 
   1051       1.1  christos     /* Dump the vendor data */
   1052       1.1  christos 
   1053       1.1  christos     AcpiDmIndent (Level + 1);
   1054       1.1  christos     AcpiDmDumpSerialBusVendorData (Resource, Level);
   1055       1.1  christos     AcpiOsPrintf (")\n");
   1056       1.2  christos 
   1057       1.2  christos     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
   1058       1.1  christos }
   1059       1.1  christos 
   1060       1.1  christos 
   1061       1.1  christos /*******************************************************************************
   1062       1.1  christos  *
   1063       1.1  christos  * FUNCTION:    AcpiDmSerialBusDescriptor
   1064       1.1  christos  *
   1065       1.2  christos  * PARAMETERS:  Info                - Extra resource info
   1066       1.2  christos  *              Resource            - Pointer to the resource descriptor
   1067       1.1  christos  *              Length              - Length of the descriptor in bytes
   1068       1.1  christos  *              Level               - Current source code indentation level
   1069       1.1  christos  *
   1070       1.1  christos  * RETURN:      None
   1071       1.1  christos  *
   1072      1.13  christos  * DESCRIPTION: Decode a I2C/SPI/UART/CSI2 serial bus descriptor
   1073       1.1  christos  *
   1074       1.1  christos  ******************************************************************************/
   1075       1.1  christos 
   1076       1.1  christos void
   1077       1.1  christos AcpiDmSerialBusDescriptor (
   1078       1.2  christos     ACPI_OP_WALK_INFO       *Info,
   1079       1.1  christos     AML_RESOURCE            *Resource,
   1080       1.1  christos     UINT32                  Length,
   1081       1.1  christos     UINT32                  Level)
   1082       1.1  christos {
   1083       1.1  christos 
   1084       1.1  christos     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
   1085       1.2  christos         Info, Resource, Length, Level);
   1086       1.1  christos }
   1087       1.9  christos 
   1088       1.9  christos /*******************************************************************************
   1089       1.9  christos  *
   1090       1.9  christos  * FUNCTION:    AcpiDmPinConfig
   1091       1.9  christos  *
   1092       1.9  christos  * PARAMETERS:  PinConfigType       - Pin configuration type
   1093       1.9  christos  *              PinConfigValue      - Pin configuration value
   1094       1.9  christos  *
   1095       1.9  christos  * RETURN:      None
   1096       1.9  christos  *
   1097       1.9  christos  * DESCRIPTION: Pretty prints PinConfig type and value.
   1098       1.9  christos  *
   1099       1.9  christos  ******************************************************************************/
   1100       1.9  christos 
   1101       1.9  christos static void
   1102       1.9  christos AcpiDmPinConfig(
   1103       1.9  christos     UINT8                   PinConfigType,
   1104       1.9  christos     UINT32                  PinConfigValue)
   1105       1.9  christos {
   1106       1.9  christos     if (PinConfigType <= 13)
   1107       1.9  christos     {
   1108       1.9  christos         AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType,
   1109       1.9  christos             AcpiGbl_PtypDecode[PinConfigType]);
   1110       1.9  christos     }
   1111       1.9  christos     else
   1112       1.9  christos     {
   1113       1.9  christos         AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType);
   1114       1.9  christos     }
   1115       1.9  christos 
   1116       1.9  christos     /* PinConfigValue */
   1117       1.9  christos 
   1118       1.9  christos     AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue);
   1119       1.9  christos }
   1120       1.9  christos 
   1121       1.9  christos /*******************************************************************************
   1122       1.9  christos  *
   1123       1.9  christos  * FUNCTION:    AcpiDmPinConfigDescriptor
   1124       1.9  christos  *
   1125       1.9  christos  * PARAMETERS:  Info                - Extra resource info
   1126       1.9  christos  *              Resource            - Pointer to the resource descriptor
   1127       1.9  christos  *              Length              - Length of the descriptor in bytes
   1128       1.9  christos  *              Level               - Current source code indentation level
   1129       1.9  christos  *
   1130       1.9  christos  * RETURN:      None
   1131       1.9  christos  *
   1132       1.9  christos  * DESCRIPTION: Decode a PinConfig descriptor
   1133       1.9  christos  *
   1134       1.9  christos  ******************************************************************************/
   1135       1.9  christos 
   1136       1.9  christos void
   1137       1.9  christos AcpiDmPinConfigDescriptor (
   1138       1.9  christos     ACPI_OP_WALK_INFO       *Info,
   1139       1.9  christos     AML_RESOURCE            *Resource,
   1140       1.9  christos     UINT32                  Length,
   1141       1.9  christos     UINT32                  Level)
   1142       1.9  christos {
   1143       1.9  christos     UINT16                  *PinList;
   1144       1.9  christos     UINT8                   *VendorData;
   1145       1.9  christos     char                    *DeviceName = NULL;
   1146       1.9  christos     UINT32                  PinCount;
   1147       1.9  christos     UINT32                  i;
   1148       1.9  christos 
   1149       1.9  christos     AcpiDmIndent (Level);
   1150       1.9  christos     AcpiOsPrintf ("PinConfig (%s, ",
   1151       1.9  christos         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]);
   1152       1.9  christos 
   1153       1.9  christos     AcpiDmPinConfig (Resource->PinConfig.PinConfigType,
   1154       1.9  christos         Resource->PinConfig.PinConfigValue);
   1155       1.9  christos 
   1156       1.9  christos     AcpiDmIndent (Level + 1);
   1157       1.9  christos 
   1158       1.9  christos     if (Resource->PinConfig.ResSourceOffset)
   1159       1.9  christos     {
   1160       1.9  christos         DeviceName = ACPI_ADD_PTR (char,
   1161       1.9  christos             Resource, Resource->PinConfig.ResSourceOffset),
   1162       1.9  christos         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
   1163       1.9  christos     }
   1164       1.9  christos 
   1165       1.9  christos     AcpiOsPrintf (", ");
   1166       1.9  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex);
   1167       1.9  christos 
   1168       1.9  christos     AcpiOsPrintf ("%s, ",
   1169       1.9  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]);
   1170       1.9  christos 
   1171       1.9  christos     /* Insert a descriptor name */
   1172       1.9  christos 
   1173       1.9  christos     AcpiDmDescriptorName ();
   1174       1.9  christos 
   1175       1.9  christos     AcpiOsPrintf (",");
   1176       1.9  christos 
   1177       1.9  christos     /* Dump the vendor data */
   1178       1.9  christos 
   1179       1.9  christos     if (Resource->PinConfig.VendorLength)
   1180       1.9  christos     {
   1181       1.9  christos         AcpiOsPrintf ("\n");
   1182       1.9  christos         AcpiDmIndent (Level + 1);
   1183       1.9  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
   1184       1.9  christos             Resource->PinConfig.VendorOffset);
   1185       1.9  christos 
   1186       1.9  christos         AcpiDmDumpRawDataBuffer (VendorData,
   1187       1.9  christos             Resource->PinConfig.VendorLength, Level);
   1188       1.9  christos     }
   1189       1.9  christos 
   1190       1.9  christos     AcpiOsPrintf (")\n");
   1191       1.9  christos 
   1192       1.9  christos     AcpiDmIndent (Level + 1);
   1193       1.9  christos 
   1194       1.9  christos     /* Dump the interrupt list */
   1195       1.9  christos 
   1196       1.9  christos     AcpiOsPrintf ("{   // Pin list\n");
   1197       1.9  christos 
   1198       1.9  christos     PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset -
   1199       1.9  christos         Resource->PinConfig.PinTableOffset)) /
   1200       1.9  christos         sizeof (UINT16);
   1201       1.9  christos 
   1202       1.9  christos     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
   1203       1.9  christos         Resource->PinConfig.PinTableOffset);
   1204       1.9  christos 
   1205       1.9  christos     for (i = 0; i < PinCount; i++)
   1206       1.9  christos     {
   1207       1.9  christos         AcpiDmIndent (Level + 2);
   1208       1.9  christos         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
   1209       1.9  christos             ((i + 1) < PinCount) ? "," : "");
   1210       1.9  christos     }
   1211       1.9  christos 
   1212       1.9  christos     AcpiDmIndent (Level + 1);
   1213       1.9  christos     AcpiOsPrintf ("}\n");
   1214       1.9  christos }
   1215       1.9  christos 
   1216       1.9  christos /*******************************************************************************
   1217       1.9  christos  *
   1218       1.9  christos  * FUNCTION:    AcpiDmPinGroupDescriptor
   1219       1.9  christos  *
   1220       1.9  christos  * PARAMETERS:  Info                - Extra resource info
   1221       1.9  christos  *              Resource            - Pointer to the resource descriptor
   1222       1.9  christos  *              Length              - Length of the descriptor in bytes
   1223       1.9  christos  *              Level               - Current source code indentation level
   1224       1.9  christos  *
   1225       1.9  christos  * RETURN:      None
   1226       1.9  christos  *
   1227       1.9  christos  * DESCRIPTION: Decode a PinGroup descriptor
   1228       1.9  christos  *
   1229       1.9  christos  ******************************************************************************/
   1230       1.9  christos 
   1231       1.9  christos void
   1232       1.9  christos AcpiDmPinGroupDescriptor (
   1233       1.9  christos     ACPI_OP_WALK_INFO       *Info,
   1234       1.9  christos     AML_RESOURCE            *Resource,
   1235       1.9  christos     UINT32                  Length,
   1236       1.9  christos     UINT32                  Level)
   1237       1.9  christos {
   1238       1.9  christos     char                    *Label;
   1239       1.9  christos     UINT16                  *PinList;
   1240       1.9  christos     UINT8                   *VendorData;
   1241       1.9  christos     UINT32                  PinCount;
   1242       1.9  christos     UINT32                  i;
   1243       1.9  christos 
   1244       1.9  christos     AcpiDmIndent (Level);
   1245       1.9  christos     /* Always producer */
   1246       1.9  christos     AcpiOsPrintf ("PinGroup (");
   1247       1.9  christos 
   1248       1.9  christos     Label = ACPI_ADD_PTR (char,
   1249       1.9  christos         Resource, Resource->PinGroup.LabelOffset),
   1250       1.9  christos     AcpiUtPrintString (Label, ACPI_UINT16_MAX);
   1251       1.9  christos 
   1252       1.9  christos     AcpiOsPrintf (", ");
   1253       1.9  christos 
   1254       1.9  christos     AcpiOsPrintf ("%s, ",
   1255       1.9  christos         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]);
   1256       1.9  christos 
   1257       1.9  christos     /* Insert a descriptor name */
   1258       1.9  christos 
   1259       1.9  christos     AcpiDmDescriptorName ();
   1260       1.9  christos 
   1261       1.9  christos     AcpiOsPrintf (",");
   1262       1.9  christos 
   1263       1.9  christos     /* Dump the vendor data */
   1264       1.9  christos 
   1265       1.9  christos     if (Resource->PinGroup.VendorLength)
   1266       1.9  christos     {
   1267       1.9  christos         AcpiOsPrintf ("\n");
   1268       1.9  christos         AcpiDmIndent (Level + 1);
   1269       1.9  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
   1270       1.9  christos             Resource->PinGroup.VendorOffset);
   1271       1.9  christos 
   1272       1.9  christos         AcpiDmDumpRawDataBuffer (VendorData,
   1273       1.9  christos             Resource->PinGroup.VendorLength, Level);
   1274       1.9  christos     }
   1275       1.9  christos 
   1276       1.9  christos     AcpiOsPrintf (")\n");
   1277       1.9  christos 
   1278       1.9  christos     AcpiDmIndent (Level + 1);
   1279       1.9  christos 
   1280       1.9  christos     /* Dump the interrupt list */
   1281       1.9  christos 
   1282       1.9  christos     AcpiOsPrintf ("{   // Pin list\n");
   1283       1.9  christos 
   1284       1.9  christos     PinCount = (Resource->PinGroup.LabelOffset -
   1285       1.9  christos         Resource->PinGroup.PinTableOffset) / sizeof (UINT16);
   1286       1.9  christos 
   1287       1.9  christos     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
   1288       1.9  christos         Resource->PinGroup.PinTableOffset);
   1289       1.9  christos 
   1290       1.9  christos     for (i = 0; i < PinCount; i++)
   1291       1.9  christos     {
   1292       1.9  christos         AcpiDmIndent (Level + 2);
   1293       1.9  christos         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
   1294       1.9  christos             ((i + 1) < PinCount) ? "," : "");
   1295       1.9  christos     }
   1296       1.9  christos 
   1297       1.9  christos     AcpiDmIndent (Level + 1);
   1298       1.9  christos     AcpiOsPrintf ("}\n");
   1299       1.9  christos }
   1300       1.9  christos 
   1301       1.9  christos /*******************************************************************************
   1302       1.9  christos  *
   1303       1.9  christos  * FUNCTION:    AcpiDmPinGroupFunctionDescriptor
   1304       1.9  christos  *
   1305       1.9  christos  * PARAMETERS:  Info                - Extra resource info
   1306       1.9  christos  *              Resource            - Pointer to the resource descriptor
   1307       1.9  christos  *              Length              - Length of the descriptor in bytes
   1308       1.9  christos  *              Level               - Current source code indentation level
   1309       1.9  christos  *
   1310       1.9  christos  * RETURN:      None
   1311       1.9  christos  *
   1312       1.9  christos  * DESCRIPTION: Decode a PinGroupFunction descriptor
   1313       1.9  christos  *
   1314       1.9  christos  ******************************************************************************/
   1315       1.9  christos 
   1316       1.9  christos void
   1317       1.9  christos AcpiDmPinGroupFunctionDescriptor (
   1318       1.9  christos     ACPI_OP_WALK_INFO       *Info,
   1319       1.9  christos     AML_RESOURCE            *Resource,
   1320       1.9  christos     UINT32                  Length,
   1321       1.9  christos     UINT32                  Level)
   1322       1.9  christos {
   1323       1.9  christos     UINT8                   *VendorData;
   1324       1.9  christos     char                    *DeviceName = NULL;
   1325       1.9  christos     char                    *Label = NULL;
   1326       1.9  christos 
   1327       1.9  christos     AcpiDmIndent (Level);
   1328       1.9  christos     AcpiOsPrintf ("PinGroupFunction (%s, ",
   1329       1.9  christos         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]);
   1330       1.9  christos 
   1331       1.9  christos     /* FunctionNumber */
   1332       1.9  christos 
   1333       1.9  christos     AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber);
   1334       1.9  christos 
   1335       1.9  christos     DeviceName = ACPI_ADD_PTR (char,
   1336       1.9  christos         Resource, Resource->PinGroupFunction.ResSourceOffset),
   1337       1.9  christos     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
   1338       1.9  christos 
   1339       1.9  christos     AcpiOsPrintf (", ");
   1340       1.9  christos     AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex);
   1341       1.9  christos 
   1342       1.9  christos     AcpiDmIndent (Level + 1);
   1343       1.9  christos 
   1344       1.9  christos     Label = ACPI_ADD_PTR (char, Resource,
   1345       1.9  christos         Resource->PinGroupFunction.ResSourceLabelOffset);
   1346       1.9  christos     AcpiUtPrintString (Label, ACPI_UINT16_MAX);
   1347       1.9  christos 
   1348       1.9  christos     AcpiOsPrintf (", ");
   1349       1.9  christos 
   1350       1.9  christos     AcpiOsPrintf ("%s, ",
   1351       1.9  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]);
   1352       1.9  christos 
   1353       1.9  christos     /* Insert a descriptor name */
   1354       1.9  christos 
   1355       1.9  christos     AcpiDmDescriptorName ();
   1356       1.9  christos 
   1357       1.9  christos     AcpiOsPrintf (",");
   1358       1.9  christos 
   1359       1.9  christos     /* Dump the vendor data */
   1360       1.9  christos 
   1361       1.9  christos     if (Resource->PinGroupFunction.VendorLength)
   1362       1.9  christos     {
   1363       1.9  christos         AcpiOsPrintf ("\n");
   1364       1.9  christos         AcpiDmIndent (Level + 1);
   1365       1.9  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
   1366       1.9  christos             Resource->PinGroupFunction.VendorOffset);
   1367       1.9  christos 
   1368       1.9  christos         AcpiDmDumpRawDataBuffer (VendorData,
   1369       1.9  christos             Resource->PinGroupFunction.VendorLength, Level);
   1370       1.9  christos     }
   1371       1.9  christos 
   1372       1.9  christos     AcpiOsPrintf (")\n");
   1373       1.9  christos }
   1374       1.9  christos 
   1375       1.9  christos /*******************************************************************************
   1376       1.9  christos  *
   1377       1.9  christos  * FUNCTION:    AcpiDmPinGroupConfigDescriptor
   1378       1.9  christos  *
   1379       1.9  christos  * PARAMETERS:  Info                - Extra resource info
   1380       1.9  christos  *              Resource            - Pointer to the resource descriptor
   1381       1.9  christos  *              Length              - Length of the descriptor in bytes
   1382       1.9  christos  *              Level               - Current source code indentation level
   1383       1.9  christos  *
   1384       1.9  christos  * RETURN:      None
   1385       1.9  christos  *
   1386       1.9  christos  * DESCRIPTION: Decode a PinGroupConfig descriptor
   1387       1.9  christos  *
   1388       1.9  christos  ******************************************************************************/
   1389       1.9  christos 
   1390       1.9  christos void
   1391       1.9  christos AcpiDmPinGroupConfigDescriptor (
   1392       1.9  christos     ACPI_OP_WALK_INFO       *Info,
   1393       1.9  christos     AML_RESOURCE            *Resource,
   1394       1.9  christos     UINT32                  Length,
   1395       1.9  christos     UINT32                  Level)
   1396       1.9  christos {
   1397       1.9  christos     UINT8                   *VendorData;
   1398       1.9  christos     char                    *DeviceName = NULL;
   1399       1.9  christos     char                    *Label = NULL;
   1400       1.9  christos 
   1401       1.9  christos     AcpiDmIndent (Level);
   1402       1.9  christos     AcpiOsPrintf ("PinGroupConfig (%s, ",
   1403       1.9  christos         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]);
   1404       1.9  christos 
   1405       1.9  christos     AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType,
   1406       1.9  christos         Resource->PinGroupConfig.PinConfigValue);
   1407       1.9  christos 
   1408       1.9  christos     AcpiDmIndent (Level + 1);
   1409       1.9  christos 
   1410       1.9  christos     DeviceName = ACPI_ADD_PTR (char,
   1411       1.9  christos         Resource, Resource->PinGroupConfig.ResSourceOffset),
   1412       1.9  christos     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
   1413       1.9  christos 
   1414       1.9  christos     AcpiOsPrintf (", ");
   1415       1.9  christos     AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex);
   1416       1.9  christos 
   1417       1.9  christos     Label = ACPI_ADD_PTR (char, Resource,
   1418       1.9  christos         Resource->PinGroupConfig.ResSourceLabelOffset);
   1419       1.9  christos     AcpiUtPrintString (Label, ACPI_UINT16_MAX);
   1420       1.9  christos 
   1421       1.9  christos     AcpiOsPrintf (", ");
   1422       1.9  christos 
   1423       1.9  christos     AcpiOsPrintf ("%s, ",
   1424       1.9  christos         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]);
   1425       1.9  christos 
   1426       1.9  christos     /* Insert a descriptor name */
   1427       1.9  christos 
   1428       1.9  christos     AcpiDmDescriptorName ();
   1429       1.9  christos 
   1430       1.9  christos     AcpiOsPrintf (",");
   1431       1.9  christos 
   1432       1.9  christos     /* Dump the vendor data */
   1433       1.9  christos 
   1434       1.9  christos     if (Resource->PinGroupConfig.VendorLength)
   1435       1.9  christos     {
   1436       1.9  christos         AcpiOsPrintf ("\n");
   1437       1.9  christos         AcpiDmIndent (Level + 1);
   1438       1.9  christos         VendorData = ACPI_ADD_PTR (UINT8, Resource,
   1439       1.9  christos             Resource->PinGroupConfig.VendorOffset);
   1440       1.9  christos 
   1441       1.9  christos         AcpiDmDumpRawDataBuffer (VendorData,
   1442       1.9  christos             Resource->PinGroupConfig.VendorLength, Level);
   1443       1.9  christos     }
   1444       1.9  christos 
   1445       1.9  christos     AcpiOsPrintf (")\n");
   1446       1.9  christos }
   1447