xref: /illumos-gate/usr/src/common/acpica/disassembler/dmresrcl2.c (revision 35786f6866ae52207d0f1a25fe7ca5f652f32ce0)
1 /*******************************************************************************
2  *
3  * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
4  *
5  ******************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2018, 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  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #include "acpi.h"
153 #include "accommon.h"
154 #include "acdisasm.h"
155 
156 
157 #define _COMPONENT          ACPI_CA_DEBUGGER
158         ACPI_MODULE_NAME    ("dbresrcl2")
159 
160 /* Local prototypes */
161 
162 static void
163 AcpiDmI2cSerialBusDescriptor (
164     ACPI_OP_WALK_INFO       *Info,
165     AML_RESOURCE            *Resource,
166     UINT32                  Length,
167     UINT32                  Level);
168 
169 static void
170 AcpiDmSpiSerialBusDescriptor (
171     ACPI_OP_WALK_INFO       *Info,
172     AML_RESOURCE            *Resource,
173     UINT32                  Length,
174     UINT32                  Level);
175 
176 static void
177 AcpiDmUartSerialBusDescriptor (
178     ACPI_OP_WALK_INFO       *Info,
179     AML_RESOURCE            *Resource,
180     UINT32                  Length,
181     UINT32                  Level);
182 
183 static void
184 AcpiDmGpioCommon (
185     ACPI_OP_WALK_INFO       *Info,
186     AML_RESOURCE            *Resource,
187     UINT32                  Level);
188 
189 static void
190 AcpiDmDumpRawDataBuffer (
191     UINT8                   *Buffer,
192     UINT32                  Length,
193     UINT32                  Level);
194 
195 
196 /* Dispatch table for the serial bus descriptors */
197 
198 static ACPI_RESOURCE_HANDLER        SerialBusResourceDispatch [] =
199 {
200     NULL,
201     AcpiDmI2cSerialBusDescriptor,
202     AcpiDmSpiSerialBusDescriptor,
203     AcpiDmUartSerialBusDescriptor
204 };
205 
206 
207 /*******************************************************************************
208  *
209  * FUNCTION:    AcpiDmDumpRawDataBuffer
210  *
211  * PARAMETERS:  Buffer              - Pointer to the data bytes
212  *              Length              - Length of the descriptor in bytes
213  *              Level               - Current source code indentation level
214  *
215  * RETURN:      None
216  *
217  * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
218  *              vendor data bytes.
219  *
220  ******************************************************************************/
221 
222 static void
AcpiDmDumpRawDataBuffer(UINT8 * Buffer,UINT32 Length,UINT32 Level)223 AcpiDmDumpRawDataBuffer (
224     UINT8                   *Buffer,
225     UINT32                  Length,
226     UINT32                  Level)
227 {
228     UINT32                  Index;
229     UINT32                  i;
230     UINT32                  j;
231 
232 
233     if (!Length)
234     {
235         return;
236     }
237 
238     AcpiOsPrintf ("RawDataBuffer (0x%.2X)  // Vendor Data", Length);
239 
240     AcpiOsPrintf ("\n");
241     AcpiDmIndent (Level + 1);
242     AcpiOsPrintf ("{\n");
243     AcpiDmIndent (Level + 2);
244 
245     for (i = 0; i < Length;)
246     {
247         for (j = 0; j < 8; j++)
248         {
249             Index = i + j;
250             if (Index >= Length)
251             {
252                 goto Finish;
253             }
254 
255             AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
256             if ((Index + 1) >= Length)
257             {
258                 goto Finish;
259             }
260 
261             AcpiOsPrintf (", ");
262         }
263 
264         AcpiOsPrintf ("\n");
265         AcpiDmIndent (Level + 2);
266 
267         i += 8;
268     }
269 
270 Finish:
271     AcpiOsPrintf ("\n");
272     AcpiDmIndent (Level + 1);
273     AcpiOsPrintf ("}");
274 }
275 
276 
277 /*******************************************************************************
278  *
279  * FUNCTION:    AcpiDmGpioCommon
280  *
281  * PARAMETERS:  Info                - Extra resource info
282  *              Resource            - Pointer to the resource descriptor
283  *              Level               - Current source code indentation level
284  *
285  * RETURN:      None
286  *
287  * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
288  *
289  ******************************************************************************/
290 
291 static void
AcpiDmGpioCommon(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Level)292 AcpiDmGpioCommon (
293     ACPI_OP_WALK_INFO       *Info,
294     AML_RESOURCE            *Resource,
295     UINT32                  Level)
296 {
297     UINT16                  *PinList;
298     UINT8                   *VendorData;
299     char                    *DeviceName = NULL;
300     UINT32                  PinCount;
301     UINT32                  i;
302 
303 
304     /* ResourceSource, ResourceSourceIndex, ResourceType */
305 
306     AcpiDmIndent (Level + 1);
307     if (Resource->Gpio.ResSourceOffset)
308     {
309         DeviceName = ACPI_ADD_PTR (char,
310             Resource, Resource->Gpio.ResSourceOffset),
311         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
312     }
313 
314     AcpiOsPrintf (", ");
315     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
316     AcpiOsPrintf ("%s, ",
317         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
318 
319     /* Insert a descriptor name */
320 
321     AcpiDmDescriptorName ();
322     AcpiOsPrintf (",");
323 
324     /* Dump the vendor data */
325 
326     if (Resource->Gpio.VendorOffset)
327     {
328         AcpiOsPrintf ("\n");
329         AcpiDmIndent (Level + 1);
330         VendorData = ACPI_ADD_PTR (UINT8, Resource,
331             Resource->Gpio.VendorOffset);
332 
333         AcpiDmDumpRawDataBuffer (VendorData,
334             Resource->Gpio.VendorLength, Level);
335     }
336 
337     AcpiOsPrintf (")\n");
338 
339     /* Dump the interrupt list */
340 
341     AcpiDmIndent (Level + 1);
342     AcpiOsPrintf ("{   // Pin list\n");
343 
344     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
345         Resource->Gpio.PinTableOffset)) /
346         sizeof (UINT16);
347 
348     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
349         Resource->Gpio.PinTableOffset);
350 
351     for (i = 0; i < PinCount; i++)
352     {
353         AcpiDmIndent (Level + 2);
354         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
355             ((i + 1) < PinCount) ? "," : "");
356     }
357 
358     AcpiDmIndent (Level + 1);
359     AcpiOsPrintf ("}\n");
360 
361 #ifdef ACPI_APPLICATION
362     MpSaveGpioInfo (Info->MappingOp, Resource,
363         PinCount, PinList, DeviceName);
364 #endif
365 }
366 
367 
368 /*******************************************************************************
369  *
370  * FUNCTION:    AcpiDmGpioIntDescriptor
371  *
372  * PARAMETERS:  Info                - Extra resource info
373  *              Resource            - Pointer to the resource descriptor
374  *              Length              - Length of the descriptor in bytes
375  *              Level               - Current source code indentation level
376  *
377  * RETURN:      None
378  *
379  * DESCRIPTION: Decode a GPIO Interrupt descriptor
380  *
381  ******************************************************************************/
382 
383 static void
AcpiDmGpioIntDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)384 AcpiDmGpioIntDescriptor (
385     ACPI_OP_WALK_INFO       *Info,
386     AML_RESOURCE            *Resource,
387     UINT32                  Length,
388     UINT32                  Level)
389 {
390 
391     /* Dump the GpioInt-specific portion of the descriptor */
392 
393     /* EdgeLevel, ActiveLevel, Shared */
394 
395     AcpiDmIndent (Level);
396     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
397         AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
398         AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
399         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
400 
401     /* PinConfig, DebounceTimeout */
402 
403     if (Resource->Gpio.PinConfig <= 3)
404     {
405         AcpiOsPrintf ("%s, ",
406             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
407     }
408     else
409     {
410         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
411     }
412     AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
413 
414     /* Dump the GpioInt/GpioIo common portion of the descriptor */
415 
416     AcpiDmGpioCommon (Info, Resource, Level);
417 }
418 
419 
420 /*******************************************************************************
421  *
422  * FUNCTION:    AcpiDmGpioIoDescriptor
423  *
424  * PARAMETERS:  Info                - Extra resource info
425  *              Resource            - Pointer to the resource descriptor
426  *              Length              - Length of the descriptor in bytes
427  *              Level               - Current source code indentation level
428  *
429  * RETURN:      None
430  *
431  * DESCRIPTION: Decode a GPIO I/O descriptor
432  *
433  ******************************************************************************/
434 
435 static void
AcpiDmGpioIoDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)436 AcpiDmGpioIoDescriptor (
437     ACPI_OP_WALK_INFO       *Info,
438     AML_RESOURCE            *Resource,
439     UINT32                  Length,
440     UINT32                  Level)
441 {
442 
443     /* Dump the GpioIo-specific portion of the descriptor */
444 
445     /* Shared, PinConfig */
446 
447     AcpiDmIndent (Level);
448     AcpiOsPrintf ("GpioIo (%s, ",
449         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
450 
451     if (Resource->Gpio.PinConfig <= 3)
452     {
453         AcpiOsPrintf ("%s, ",
454             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
455     }
456     else
457     {
458         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
459     }
460 
461     /* DebounceTimeout, DriveStrength, IoRestriction */
462 
463     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
464     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
465     AcpiOsPrintf ("%s,\n",
466         AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
467 
468     /* Dump the GpioInt/GpioIo common portion of the descriptor */
469 
470     AcpiDmGpioCommon (Info, Resource, Level);
471 }
472 
473 
474 /*******************************************************************************
475  *
476  * FUNCTION:    AcpiDmGpioDescriptor
477  *
478  * PARAMETERS:  Info                - Extra resource info
479  *              Resource            - Pointer to the resource descriptor
480  *              Length              - Length of the descriptor in bytes
481  *              Level               - Current source code indentation level
482  *
483  * RETURN:      None
484  *
485  * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor
486  *
487  ******************************************************************************/
488 
489 void
AcpiDmGpioDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)490 AcpiDmGpioDescriptor (
491     ACPI_OP_WALK_INFO       *Info,
492     AML_RESOURCE            *Resource,
493     UINT32                  Length,
494     UINT32                  Level)
495 {
496     UINT8                   ConnectionType;
497 
498 
499     ConnectionType = Resource->Gpio.ConnectionType;
500 
501     switch (ConnectionType)
502     {
503     case AML_RESOURCE_GPIO_TYPE_INT:
504 
505         AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
506         break;
507 
508     case AML_RESOURCE_GPIO_TYPE_IO:
509 
510         AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
511         break;
512 
513     default:
514 
515         AcpiOsPrintf ("Unknown GPIO type\n");
516         break;
517     }
518 }
519 
520 /*******************************************************************************
521  *
522  * FUNCTION:    AcpiDmPinFunctionDescriptor
523  *
524  * PARAMETERS:  Info                - Extra resource info
525  *              Resource            - Pointer to the resource descriptor
526  *              Length              - Length of the descriptor in bytes
527  *              Level               - Current source code indentation level
528  *
529  * RETURN:      None
530  *
531  * DESCRIPTION: Decode a PinFunction descriptor
532  *
533  ******************************************************************************/
534 
535 void
AcpiDmPinFunctionDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)536 AcpiDmPinFunctionDescriptor (
537     ACPI_OP_WALK_INFO       *Info,
538     AML_RESOURCE            *Resource,
539     UINT32                  Length,
540     UINT32                  Level)
541 {
542     UINT16                  *PinList;
543     UINT8                   *VendorData;
544     char                    *DeviceName = NULL;
545     UINT32                  PinCount;
546     UINT32                  i;
547 
548     AcpiDmIndent (Level);
549     AcpiOsPrintf ("PinFunction (%s, ",
550         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]);
551 
552     if (Resource->PinFunction.PinConfig <= 3)
553     {
554         AcpiOsPrintf ("%s, ",
555             AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]);
556     }
557     else
558     {
559         AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig);
560     }
561 
562     /* FunctionNumber */
563 
564     AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
565 
566     if (Resource->PinFunction.ResSourceOffset)
567     {
568         DeviceName = ACPI_ADD_PTR (char,
569             Resource, Resource->PinFunction.ResSourceOffset),
570         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
571     }
572 
573     AcpiOsPrintf (", ");
574     AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex);
575 
576     AcpiDmIndent (Level + 1);
577 
578     /* Always ResourceConsumer */
579     AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]);
580 
581     /* Insert a descriptor name */
582 
583     AcpiDmDescriptorName ();
584 
585     AcpiOsPrintf (",");
586 
587     /* Dump the vendor data */
588 
589     if (Resource->PinFunction.VendorLength)
590     {
591         AcpiOsPrintf ("\n");
592         AcpiDmIndent (Level + 1);
593         VendorData = ACPI_ADD_PTR (UINT8, Resource,
594             Resource->PinFunction.VendorOffset);
595 
596         AcpiDmDumpRawDataBuffer (VendorData,
597             Resource->PinFunction.VendorLength, Level);
598     }
599 
600     AcpiOsPrintf (")\n");
601 
602     AcpiDmIndent (Level + 1);
603 
604     /* Dump the interrupt list */
605 
606     AcpiOsPrintf ("{   // Pin list\n");
607 
608     PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
609         Resource->PinFunction.PinTableOffset)) /
610         sizeof (UINT16);
611 
612     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
613         Resource->PinFunction.PinTableOffset);
614 
615     for (i = 0; i < PinCount; i++)
616     {
617         AcpiDmIndent (Level + 2);
618         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
619             ((i + 1) < PinCount) ? "," : "");
620     }
621 
622     AcpiDmIndent (Level + 1);
623     AcpiOsPrintf ("}\n");
624 }
625 
626 
627 /*******************************************************************************
628  *
629  * FUNCTION:    AcpiDmDumpSerialBusVendorData
630  *
631  * PARAMETERS:  Resource            - Pointer to the resource descriptor
632  *
633  * RETURN:      None
634  *
635  * DESCRIPTION: Dump optional serial bus vendor data
636  *
637  ******************************************************************************/
638 
639 static void
AcpiDmDumpSerialBusVendorData(AML_RESOURCE * Resource,UINT32 Level)640 AcpiDmDumpSerialBusVendorData (
641     AML_RESOURCE            *Resource,
642     UINT32                  Level)
643 {
644     UINT8                   *VendorData;
645     UINT32                  VendorLength;
646 
647 
648     /* Get the (optional) vendor data and length */
649 
650     switch (Resource->CommonSerialBus.Type)
651     {
652     case AML_RESOURCE_I2C_SERIALBUSTYPE:
653 
654         VendorLength = Resource->CommonSerialBus.TypeDataLength -
655             AML_RESOURCE_I2C_MIN_DATA_LEN;
656 
657         VendorData = ACPI_ADD_PTR (UINT8, Resource,
658             sizeof (AML_RESOURCE_I2C_SERIALBUS));
659         break;
660 
661     case AML_RESOURCE_SPI_SERIALBUSTYPE:
662 
663         VendorLength = Resource->CommonSerialBus.TypeDataLength -
664             AML_RESOURCE_SPI_MIN_DATA_LEN;
665 
666         VendorData = ACPI_ADD_PTR (UINT8, Resource,
667             sizeof (AML_RESOURCE_SPI_SERIALBUS));
668         break;
669 
670     case AML_RESOURCE_UART_SERIALBUSTYPE:
671 
672         VendorLength = Resource->CommonSerialBus.TypeDataLength -
673             AML_RESOURCE_UART_MIN_DATA_LEN;
674 
675         VendorData = ACPI_ADD_PTR (UINT8, Resource,
676             sizeof (AML_RESOURCE_UART_SERIALBUS));
677         break;
678 
679     default:
680 
681         return;
682     }
683 
684     /* Dump the vendor bytes as a RawDataBuffer object */
685 
686     AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
687 }
688 
689 
690 /*******************************************************************************
691  *
692  * FUNCTION:    AcpiDmI2cSerialBusDescriptor
693  *
694  * PARAMETERS:  Info                - Extra resource info
695  *              Resource            - Pointer to the resource descriptor
696  *              Length              - Length of the descriptor in bytes
697  *              Level               - Current source code indentation level
698  *
699  * RETURN:      None
700  *
701  * DESCRIPTION: Decode a I2C serial bus descriptor
702  *
703  ******************************************************************************/
704 
705 static void
AcpiDmI2cSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)706 AcpiDmI2cSerialBusDescriptor (
707     ACPI_OP_WALK_INFO       *Info,
708     AML_RESOURCE            *Resource,
709     UINT32                  Length,
710     UINT32                  Level)
711 {
712     UINT32                  ResourceSourceOffset;
713     char                    *DeviceName;
714 
715 
716     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
717 
718     AcpiDmIndent (Level);
719     AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
720         Resource->I2cSerialBus.SlaveAddress,
721         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
722         Resource->I2cSerialBus.ConnectionSpeed);
723 
724     AcpiDmIndent (Level + 1);
725     AcpiOsPrintf ("%s, ",
726         AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
727 
728     /* ResourceSource is a required field */
729 
730     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
731         Resource->CommonSerialBus.TypeDataLength;
732 
733     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
734     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
735 
736     /* ResourceSourceIndex, ResourceUsage */
737 
738     AcpiOsPrintf (",\n");
739     AcpiDmIndent (Level + 1);
740     AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
741 
742     AcpiOsPrintf ("%s, ",
743         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
744 
745     /* Insert a descriptor name */
746 
747     AcpiDmDescriptorName ();
748 
749     /* Share */
750 
751     AcpiOsPrintf (", %s,\n",
752         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 2)]);
753 
754     /* Dump the vendor data */
755 
756     AcpiDmIndent (Level + 1);
757     AcpiDmDumpSerialBusVendorData (Resource, Level);
758     AcpiOsPrintf (")\n");
759 
760 #ifdef ACPI_APPLICATION
761     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
762 #endif
763 }
764 
765 
766 /*******************************************************************************
767  *
768  * FUNCTION:    AcpiDmSpiSerialBusDescriptor
769  *
770  * PARAMETERS:  Info                - Extra resource info
771  *              Resource            - Pointer to the resource descriptor
772  *              Length              - Length of the descriptor in bytes
773  *              Level               - Current source code indentation level
774  *
775  * RETURN:      None
776  *
777  * DESCRIPTION: Decode a SPI serial bus descriptor
778  *
779  ******************************************************************************/
780 
781 static void
AcpiDmSpiSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)782 AcpiDmSpiSerialBusDescriptor (
783     ACPI_OP_WALK_INFO       *Info,
784     AML_RESOURCE            *Resource,
785     UINT32                  Length,
786     UINT32                  Level)
787 {
788     UINT32                  ResourceSourceOffset;
789     char                    *DeviceName;
790 
791 
792     /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
793 
794     AcpiDmIndent (Level);
795     AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n",
796         Resource->SpiSerialBus.DeviceSelection,
797         AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
798         AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
799         Resource->SpiSerialBus.DataBitLength);
800 
801     /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
802 
803     AcpiDmIndent (Level + 1);
804     AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
805         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
806         Resource->SpiSerialBus.ConnectionSpeed,
807         AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
808 
809     AcpiDmIndent (Level + 1);
810     AcpiOsPrintf ("%s, ",
811         AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
812 
813     /* ResourceSource is a required field */
814 
815     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
816         Resource->CommonSerialBus.TypeDataLength;
817 
818     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
819     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
820 
821     /* ResourceSourceIndex, ResourceUsage */
822 
823     AcpiOsPrintf (",\n");
824     AcpiDmIndent (Level + 1);
825     AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
826 
827     AcpiOsPrintf ("%s, ",
828         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
829 
830     /* Insert a descriptor name */
831 
832     AcpiDmDescriptorName ();
833 
834     /* Share */
835 
836     AcpiOsPrintf (", %s,\n",
837         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 2)]);
838 
839     /* Dump the vendor data */
840 
841     AcpiDmIndent (Level + 1);
842     AcpiDmDumpSerialBusVendorData (Resource, Level);
843     AcpiOsPrintf (")\n");
844 
845 #ifdef ACPI_APPLICATION
846     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
847 #endif
848 }
849 
850 
851 /*******************************************************************************
852  *
853  * FUNCTION:    AcpiDmUartSerialBusDescriptor
854  *
855  * PARAMETERS:  Info                - Extra resource info
856  *              Resource            - Pointer to the resource descriptor
857  *              Length              - Length of the descriptor in bytes
858  *              Level               - Current source code indentation level
859  *
860  * RETURN:      None
861  *
862  * DESCRIPTION: Decode a UART serial bus descriptor
863  *
864  ******************************************************************************/
865 
866 static void
AcpiDmUartSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)867 AcpiDmUartSerialBusDescriptor (
868     ACPI_OP_WALK_INFO       *Info,
869     AML_RESOURCE            *Resource,
870     UINT32                  Length,
871     UINT32                  Level)
872 {
873     UINT32                  ResourceSourceOffset;
874     char                    *DeviceName;
875 
876 
877     /* ConnectionSpeed, BitsPerByte, StopBits */
878 
879     AcpiDmIndent (Level);
880     AcpiOsPrintf ("UartSerialBusV2 (0x%8.8X, %s, %s,\n",
881         Resource->UartSerialBus.DefaultBaudRate,
882         AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
883         AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
884 
885     /* LinesInUse, IsBigEndian, Parity, FlowControl */
886 
887     AcpiDmIndent (Level + 1);
888     AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
889         Resource->UartSerialBus.LinesEnabled,
890         AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
891         AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
892         AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
893 
894     /* ReceiveBufferSize, TransmitBufferSize */
895 
896     AcpiDmIndent (Level + 1);
897     AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
898         Resource->UartSerialBus.RxFifoSize,
899         Resource->UartSerialBus.TxFifoSize);
900 
901     /* ResourceSource is a required field */
902 
903     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
904         Resource->CommonSerialBus.TypeDataLength;
905 
906     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
907     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
908 
909     /* ResourceSourceIndex, ResourceUsage */
910 
911     AcpiOsPrintf (",\n");
912     AcpiDmIndent (Level + 1);
913     AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
914 
915     AcpiOsPrintf ("%s, ",
916         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
917 
918     /* Insert a descriptor name */
919 
920     AcpiDmDescriptorName ();
921 
922     /* Share */
923 
924     AcpiOsPrintf (", %s,\n",
925         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 2)]);
926 
927     /* Dump the vendor data */
928 
929     AcpiDmIndent (Level + 1);
930     AcpiDmDumpSerialBusVendorData (Resource, Level);
931     AcpiOsPrintf (")\n");
932 
933 #ifdef ACPI_APPLICATION
934     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
935 #endif
936 }
937 
938 
939 /*******************************************************************************
940  *
941  * FUNCTION:    AcpiDmSerialBusDescriptor
942  *
943  * PARAMETERS:  Info                - Extra resource info
944  *              Resource            - Pointer to the resource descriptor
945  *              Length              - Length of the descriptor in bytes
946  *              Level               - Current source code indentation level
947  *
948  * RETURN:      None
949  *
950  * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
951  *
952  ******************************************************************************/
953 
954 void
AcpiDmSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)955 AcpiDmSerialBusDescriptor (
956     ACPI_OP_WALK_INFO       *Info,
957     AML_RESOURCE            *Resource,
958     UINT32                  Length,
959     UINT32                  Level)
960 {
961 
962     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
963         Info, Resource, Length, Level);
964 }
965 
966 /*******************************************************************************
967  *
968  * FUNCTION:    AcpiDmPinConfig
969  *
970  * PARAMETERS:  PinConfigType       - Pin configuration type
971  *              PinConfigValue      - Pin configuration value
972  *
973  * RETURN:      None
974  *
975  * DESCRIPTION: Pretty prints PinConfig type and value.
976  *
977  ******************************************************************************/
978 
979 static void
AcpiDmPinConfig(UINT8 PinConfigType,UINT32 PinConfigValue)980 AcpiDmPinConfig(
981     UINT8                   PinConfigType,
982     UINT32                  PinConfigValue)
983 {
984     if (PinConfigType <= 13)
985     {
986         AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType,
987             AcpiGbl_PtypDecode[PinConfigType]);
988     }
989     else
990     {
991         AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType);
992     }
993 
994     /* PinConfigValue */
995 
996     AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue);
997 }
998 
999 /*******************************************************************************
1000  *
1001  * FUNCTION:    AcpiDmPinConfigDescriptor
1002  *
1003  * PARAMETERS:  Info                - Extra resource info
1004  *              Resource            - Pointer to the resource descriptor
1005  *              Length              - Length of the descriptor in bytes
1006  *              Level               - Current source code indentation level
1007  *
1008  * RETURN:      None
1009  *
1010  * DESCRIPTION: Decode a PinConfig descriptor
1011  *
1012  ******************************************************************************/
1013 
1014 void
AcpiDmPinConfigDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1015 AcpiDmPinConfigDescriptor (
1016     ACPI_OP_WALK_INFO       *Info,
1017     AML_RESOURCE            *Resource,
1018     UINT32                  Length,
1019     UINT32                  Level)
1020 {
1021     UINT16                  *PinList;
1022     UINT8                   *VendorData;
1023     char                    *DeviceName = NULL;
1024     UINT32                  PinCount;
1025     UINT32                  i;
1026 
1027     AcpiDmIndent (Level);
1028     AcpiOsPrintf ("PinConfig (%s, ",
1029         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]);
1030 
1031     AcpiDmPinConfig (Resource->PinConfig.PinConfigType,
1032         Resource->PinConfig.PinConfigValue);
1033 
1034     AcpiDmIndent (Level + 1);
1035 
1036     if (Resource->PinConfig.ResSourceOffset)
1037     {
1038         DeviceName = ACPI_ADD_PTR (char,
1039             Resource, Resource->PinConfig.ResSourceOffset),
1040         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
1041     }
1042 
1043     AcpiOsPrintf (", ");
1044     AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex);
1045 
1046     AcpiOsPrintf ("%s, ",
1047         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]);
1048 
1049     /* Insert a descriptor name */
1050 
1051     AcpiDmDescriptorName ();
1052 
1053     AcpiOsPrintf (",");
1054 
1055     /* Dump the vendor data */
1056 
1057     if (Resource->PinConfig.VendorLength)
1058     {
1059         AcpiOsPrintf ("\n");
1060         AcpiDmIndent (Level + 1);
1061         VendorData = ACPI_ADD_PTR (UINT8, Resource,
1062             Resource->PinConfig.VendorOffset);
1063 
1064         AcpiDmDumpRawDataBuffer (VendorData,
1065             Resource->PinConfig.VendorLength, Level);
1066     }
1067 
1068     AcpiOsPrintf (")\n");
1069 
1070     AcpiDmIndent (Level + 1);
1071 
1072     /* Dump the interrupt list */
1073 
1074     AcpiOsPrintf ("{   // Pin list\n");
1075 
1076     PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset -
1077         Resource->PinConfig.PinTableOffset)) /
1078         sizeof (UINT16);
1079 
1080     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
1081         Resource->PinConfig.PinTableOffset);
1082 
1083     for (i = 0; i < PinCount; i++)
1084     {
1085         AcpiDmIndent (Level + 2);
1086         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
1087             ((i + 1) < PinCount) ? "," : "");
1088     }
1089 
1090     AcpiDmIndent (Level + 1);
1091     AcpiOsPrintf ("}\n");
1092 }
1093 
1094 /*******************************************************************************
1095  *
1096  * FUNCTION:    AcpiDmPinGroupDescriptor
1097  *
1098  * PARAMETERS:  Info                - Extra resource info
1099  *              Resource            - Pointer to the resource descriptor
1100  *              Length              - Length of the descriptor in bytes
1101  *              Level               - Current source code indentation level
1102  *
1103  * RETURN:      None
1104  *
1105  * DESCRIPTION: Decode a PinGroup descriptor
1106  *
1107  ******************************************************************************/
1108 
1109 void
AcpiDmPinGroupDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1110 AcpiDmPinGroupDescriptor (
1111     ACPI_OP_WALK_INFO       *Info,
1112     AML_RESOURCE            *Resource,
1113     UINT32                  Length,
1114     UINT32                  Level)
1115 {
1116     char                    *Label;
1117     UINT16                  *PinList;
1118     UINT8                   *VendorData;
1119     UINT32                  PinCount;
1120     UINT32                  i;
1121 
1122     AcpiDmIndent (Level);
1123     /* Always producer */
1124     AcpiOsPrintf ("PinGroup (");
1125 
1126     Label = ACPI_ADD_PTR (char,
1127         Resource, Resource->PinGroup.LabelOffset),
1128     AcpiUtPrintString (Label, ACPI_UINT16_MAX);
1129 
1130     AcpiOsPrintf (", ");
1131 
1132     AcpiOsPrintf ("%s, ",
1133         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]);
1134 
1135     /* Insert a descriptor name */
1136 
1137     AcpiDmDescriptorName ();
1138 
1139     AcpiOsPrintf (",");
1140 
1141     /* Dump the vendor data */
1142 
1143     if (Resource->PinGroup.VendorLength)
1144     {
1145         AcpiOsPrintf ("\n");
1146         AcpiDmIndent (Level + 1);
1147         VendorData = ACPI_ADD_PTR (UINT8, Resource,
1148             Resource->PinGroup.VendorOffset);
1149 
1150         AcpiDmDumpRawDataBuffer (VendorData,
1151             Resource->PinGroup.VendorLength, Level);
1152     }
1153 
1154     AcpiOsPrintf (")\n");
1155 
1156     AcpiDmIndent (Level + 1);
1157 
1158     /* Dump the interrupt list */
1159 
1160     AcpiOsPrintf ("{   // Pin list\n");
1161 
1162     PinCount = (Resource->PinGroup.LabelOffset -
1163         Resource->PinGroup.PinTableOffset) / sizeof (UINT16);
1164 
1165     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
1166         Resource->PinGroup.PinTableOffset);
1167 
1168     for (i = 0; i < PinCount; i++)
1169     {
1170         AcpiDmIndent (Level + 2);
1171         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
1172             ((i + 1) < PinCount) ? "," : "");
1173     }
1174 
1175     AcpiDmIndent (Level + 1);
1176     AcpiOsPrintf ("}\n");
1177 }
1178 
1179 /*******************************************************************************
1180  *
1181  * FUNCTION:    AcpiDmPinGroupFunctionDescriptor
1182  *
1183  * PARAMETERS:  Info                - Extra resource info
1184  *              Resource            - Pointer to the resource descriptor
1185  *              Length              - Length of the descriptor in bytes
1186  *              Level               - Current source code indentation level
1187  *
1188  * RETURN:      None
1189  *
1190  * DESCRIPTION: Decode a PinGroupFunction descriptor
1191  *
1192  ******************************************************************************/
1193 
1194 void
AcpiDmPinGroupFunctionDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1195 AcpiDmPinGroupFunctionDescriptor (
1196     ACPI_OP_WALK_INFO       *Info,
1197     AML_RESOURCE            *Resource,
1198     UINT32                  Length,
1199     UINT32                  Level)
1200 {
1201     UINT8                   *VendorData;
1202     char                    *DeviceName = NULL;
1203     char                    *Label = NULL;
1204 
1205     AcpiDmIndent (Level);
1206     AcpiOsPrintf ("PinGroupFunction (%s, ",
1207         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]);
1208 
1209     /* FunctionNumber */
1210 
1211     AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber);
1212 
1213     DeviceName = ACPI_ADD_PTR (char,
1214         Resource, Resource->PinGroupFunction.ResSourceOffset),
1215     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
1216 
1217     AcpiOsPrintf (", ");
1218     AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex);
1219 
1220     AcpiDmIndent (Level + 1);
1221 
1222     Label = ACPI_ADD_PTR (char, Resource,
1223         Resource->PinGroupFunction.ResSourceLabelOffset);
1224     AcpiUtPrintString (Label, ACPI_UINT16_MAX);
1225 
1226     AcpiOsPrintf (", ");
1227 
1228     AcpiOsPrintf ("%s, ",
1229         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]);
1230 
1231     /* Insert a descriptor name */
1232 
1233     AcpiDmDescriptorName ();
1234 
1235     AcpiOsPrintf (",");
1236 
1237     /* Dump the vendor data */
1238 
1239     if (Resource->PinGroupFunction.VendorLength)
1240     {
1241         AcpiOsPrintf ("\n");
1242         AcpiDmIndent (Level + 1);
1243         VendorData = ACPI_ADD_PTR (UINT8, Resource,
1244             Resource->PinGroupFunction.VendorOffset);
1245 
1246         AcpiDmDumpRawDataBuffer (VendorData,
1247             Resource->PinGroupFunction.VendorLength, Level);
1248     }
1249 
1250     AcpiOsPrintf (")\n");
1251 }
1252 
1253 /*******************************************************************************
1254  *
1255  * FUNCTION:    AcpiDmPinGroupConfigDescriptor
1256  *
1257  * PARAMETERS:  Info                - Extra resource info
1258  *              Resource            - Pointer to the resource descriptor
1259  *              Length              - Length of the descriptor in bytes
1260  *              Level               - Current source code indentation level
1261  *
1262  * RETURN:      None
1263  *
1264  * DESCRIPTION: Decode a PinGroupConfig descriptor
1265  *
1266  ******************************************************************************/
1267 
1268 void
AcpiDmPinGroupConfigDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1269 AcpiDmPinGroupConfigDescriptor (
1270     ACPI_OP_WALK_INFO       *Info,
1271     AML_RESOURCE            *Resource,
1272     UINT32                  Length,
1273     UINT32                  Level)
1274 {
1275     UINT8                   *VendorData;
1276     char                    *DeviceName = NULL;
1277     char                    *Label = NULL;
1278 
1279     AcpiDmIndent (Level);
1280     AcpiOsPrintf ("PinGroupConfig (%s, ",
1281         AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]);
1282 
1283     AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType,
1284         Resource->PinGroupConfig.PinConfigValue);
1285 
1286     AcpiDmIndent (Level + 1);
1287 
1288     DeviceName = ACPI_ADD_PTR (char,
1289         Resource, Resource->PinGroupConfig.ResSourceOffset),
1290     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
1291 
1292     AcpiOsPrintf (", ");
1293     AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex);
1294 
1295     Label = ACPI_ADD_PTR (char, Resource,
1296         Resource->PinGroupConfig.ResSourceLabelOffset);
1297     AcpiUtPrintString (Label, ACPI_UINT16_MAX);
1298 
1299     AcpiOsPrintf (", ");
1300 
1301     AcpiOsPrintf ("%s, ",
1302         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]);
1303 
1304     /* Insert a descriptor name */
1305 
1306     AcpiDmDescriptorName ();
1307 
1308     AcpiOsPrintf (",");
1309 
1310     /* Dump the vendor data */
1311 
1312     if (Resource->PinGroupConfig.VendorLength)
1313     {
1314         AcpiOsPrintf ("\n");
1315         AcpiDmIndent (Level + 1);
1316         VendorData = ACPI_ADD_PTR (UINT8, Resource,
1317             Resource->PinGroupConfig.VendorOffset);
1318 
1319         AcpiDmDumpRawDataBuffer (VendorData,
1320             Resource->PinGroupConfig.VendorLength, Level);
1321     }
1322 
1323     AcpiOsPrintf (")\n");
1324 }
1325