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