xref: /freebsd/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c (revision 7661de35d15f582ab33e3bd6b8d909601557e436)
1 /*******************************************************************************
2  *
3  * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
4  *
5  ******************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2013, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 
45 #include <contrib/dev/acpica/include/acpi.h>
46 #include <contrib/dev/acpica/include/accommon.h>
47 #include <contrib/dev/acpica/include/acdisasm.h>
48 
49 
50 #ifdef ACPI_DISASSEMBLER
51 
52 #define _COMPONENT          ACPI_CA_DEBUGGER
53         ACPI_MODULE_NAME    ("dbresrcl2")
54 
55 /* Local prototypes */
56 
57 static void
58 AcpiDmI2cSerialBusDescriptor (
59     AML_RESOURCE            *Resource,
60     UINT32                  Length,
61     UINT32                  Level);
62 
63 static void
64 AcpiDmSpiSerialBusDescriptor (
65     AML_RESOURCE            *Resource,
66     UINT32                  Length,
67     UINT32                  Level);
68 
69 static void
70 AcpiDmUartSerialBusDescriptor (
71     AML_RESOURCE            *Resource,
72     UINT32                  Length,
73     UINT32                  Level);
74 
75 static void
76 AcpiDmGpioCommon (
77     AML_RESOURCE            *Resource,
78     UINT32                  Level);
79 
80 static void
81 AcpiDmDumpRawDataBuffer (
82     UINT8                   *Buffer,
83     UINT32                  Length,
84     UINT32                  Level);
85 
86 
87 /* Dispatch table for the serial bus descriptors */
88 
89 static ACPI_RESOURCE_HANDLER        SerialBusResourceDispatch [] =
90 {
91     NULL,
92     AcpiDmI2cSerialBusDescriptor,
93     AcpiDmSpiSerialBusDescriptor,
94     AcpiDmUartSerialBusDescriptor
95 };
96 
97 
98 /*******************************************************************************
99  *
100  * FUNCTION:    AcpiDmDumpRawDataBuffer
101  *
102  * PARAMETERS:  Buffer              - Pointer to the data bytes
103  *              Length              - Length of the descriptor in bytes
104  *              Level               - Current source code indentation level
105  *
106  * RETURN:      None
107  *
108  * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
109  *              vendor data bytes.
110  *
111  ******************************************************************************/
112 
113 static void
114 AcpiDmDumpRawDataBuffer (
115     UINT8                   *Buffer,
116     UINT32                  Length,
117     UINT32                  Level)
118 {
119     UINT32                  Index;
120     UINT32                  i;
121     UINT32                  j;
122 
123 
124     if (!Length)
125     {
126         return;
127     }
128 
129     AcpiOsPrintf ("RawDataBuffer (0x%.2X)  // Vendor Data", Length);
130 
131     AcpiOsPrintf ("\n");
132     AcpiDmIndent (Level + 1);
133     AcpiOsPrintf ("{\n");
134     AcpiDmIndent (Level + 2);
135 
136     for (i = 0; i < Length;)
137     {
138         for (j = 0; j < 8; j++)
139         {
140             Index = i + j;
141             if (Index >= Length)
142             {
143                 goto Finish;
144             }
145 
146             AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
147             if ((Index + 1) >= Length)
148             {
149                 goto Finish;
150             }
151 
152             AcpiOsPrintf (", ");
153         }
154         AcpiOsPrintf ("\n");
155         AcpiDmIndent (Level + 2);
156 
157         i += 8;
158     }
159 
160 Finish:
161     AcpiOsPrintf ("\n");
162     AcpiDmIndent (Level + 1);
163     AcpiOsPrintf ("}");
164 }
165 
166 
167 /*******************************************************************************
168  *
169  * FUNCTION:    AcpiDmGpioCommon
170  *
171  * PARAMETERS:  Resource            - Pointer to the resource descriptor
172  *              Level               - Current source code indentation level
173  *
174  * RETURN:      None
175  *
176  * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
177  *
178  ******************************************************************************/
179 
180 static void
181 AcpiDmGpioCommon (
182     AML_RESOURCE            *Resource,
183     UINT32                  Level)
184 {
185     UINT32                  PinCount;
186     UINT16                  *PinList;
187     UINT8                   *VendorData;
188     UINT32                  i;
189 
190 
191     /* ResourceSource, ResourceSourceIndex, ResourceType */
192 
193     AcpiDmIndent (Level + 1);
194     if (Resource->Gpio.ResSourceOffset)
195     {
196         AcpiUtPrintString (
197             ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
198             ACPI_UINT16_MAX);
199     }
200 
201     AcpiOsPrintf (", ");
202     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
203     AcpiOsPrintf ("%s, ",
204         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
205 
206     /* Insert a descriptor name */
207 
208     AcpiDmDescriptorName ();
209     AcpiOsPrintf (",");
210 
211     /* Dump the vendor data */
212 
213     if (Resource->Gpio.VendorOffset)
214     {
215         AcpiOsPrintf ("\n");
216         AcpiDmIndent (Level + 1);
217         VendorData = ACPI_ADD_PTR (UINT8, Resource,
218             Resource->Gpio.VendorOffset);
219 
220         AcpiDmDumpRawDataBuffer (VendorData,
221             Resource->Gpio.VendorLength, Level);
222     }
223 
224     AcpiOsPrintf (")\n");
225 
226     /* Dump the interrupt list */
227 
228     AcpiDmIndent (Level + 1);
229     AcpiOsPrintf ("{   // Pin list\n");
230 
231     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
232         Resource->Gpio.PinTableOffset)) /
233         sizeof (UINT16);
234 
235     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
236         Resource->Gpio.PinTableOffset);
237 
238     for (i = 0; i < PinCount; i++)
239     {
240         AcpiDmIndent (Level + 2);
241         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], ((i + 1) < PinCount) ? "," : "");
242     }
243 
244     AcpiDmIndent (Level + 1);
245     AcpiOsPrintf ("}\n");
246 }
247 
248 
249 /*******************************************************************************
250  *
251  * FUNCTION:    AcpiDmGpioIntDescriptor
252  *
253  * PARAMETERS:  Resource            - Pointer to the resource descriptor
254  *              Length              - Length of the descriptor in bytes
255  *              Level               - Current source code indentation level
256  *
257  * RETURN:      None
258  *
259  * DESCRIPTION: Decode a GPIO Interrupt descriptor
260  *
261  ******************************************************************************/
262 
263 static void
264 AcpiDmGpioIntDescriptor (
265     AML_RESOURCE            *Resource,
266     UINT32                  Length,
267     UINT32                  Level)
268 {
269 
270     /* Dump the GpioInt-specific portion of the descriptor */
271 
272     /* EdgeLevel, ActiveLevel, Shared */
273 
274     AcpiDmIndent (Level);
275     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
276         AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
277         AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)],
278         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
279 
280     /* PinConfig, DebounceTimeout */
281 
282     if (Resource->Gpio.PinConfig <= 3)
283     {
284         AcpiOsPrintf ("%s, ",
285             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
286     }
287     else
288     {
289         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
290     }
291     AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
292 
293     /* Dump the GpioInt/GpioIo common portion of the descriptor */
294 
295     AcpiDmGpioCommon (Resource, Level);
296 }
297 
298 
299 /*******************************************************************************
300  *
301  * FUNCTION:    AcpiDmGpioIoDescriptor
302  *
303  * PARAMETERS:  Resource            - Pointer to the resource descriptor
304  *              Length              - Length of the descriptor in bytes
305  *              Level               - Current source code indentation level
306  *
307  * RETURN:      None
308  *
309  * DESCRIPTION: Decode a GPIO I/O descriptor
310  *
311  ******************************************************************************/
312 
313 static void
314 AcpiDmGpioIoDescriptor (
315     AML_RESOURCE            *Resource,
316     UINT32                  Length,
317     UINT32                  Level)
318 {
319 
320     /* Dump the GpioIo-specific portion of the descriptor */
321 
322     /* Shared, PinConfig */
323 
324     AcpiDmIndent (Level);
325     AcpiOsPrintf ("GpioIo (%s, ",
326         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
327 
328     if (Resource->Gpio.PinConfig <= 3)
329     {
330         AcpiOsPrintf ("%s, ",
331             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
332     }
333     else
334     {
335         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
336     }
337 
338     /* DebounceTimeout, DriveStrength, IoRestriction */
339 
340     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
341     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
342     AcpiOsPrintf ("%s,\n",
343         AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
344 
345     /* Dump the GpioInt/GpioIo common portion of the descriptor */
346 
347     AcpiDmGpioCommon (Resource, Level);
348 }
349 
350 
351 /*******************************************************************************
352  *
353  * FUNCTION:    AcpiDmGpioDescriptor
354  *
355  * PARAMETERS:  Resource            - Pointer to the resource descriptor
356  *              Length              - Length of the descriptor in bytes
357  *              Level               - Current source code indentation level
358  *
359  * RETURN:      None
360  *
361  * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor
362  *
363  ******************************************************************************/
364 
365 void
366 AcpiDmGpioDescriptor (
367     AML_RESOURCE            *Resource,
368     UINT32                  Length,
369     UINT32                  Level)
370 {
371     UINT8                   ConnectionType;
372 
373 
374     ConnectionType = Resource->Gpio.ConnectionType;
375 
376     switch (ConnectionType)
377     {
378     case AML_RESOURCE_GPIO_TYPE_INT:
379 
380         AcpiDmGpioIntDescriptor (Resource, Length, Level);
381         break;
382 
383     case AML_RESOURCE_GPIO_TYPE_IO:
384 
385         AcpiDmGpioIoDescriptor (Resource, Length, Level);
386         break;
387 
388     default:
389 
390         AcpiOsPrintf ("Unknown GPIO type\n");
391         break;
392     }
393 }
394 
395 
396 /*******************************************************************************
397  *
398  * FUNCTION:    AcpiDmDumpSerialBusVendorData
399  *
400  * PARAMETERS:  Resource            - Pointer to the resource descriptor
401  *
402  * RETURN:      None
403  *
404  * DESCRIPTION: Dump optional serial bus vendor data
405  *
406  ******************************************************************************/
407 
408 static void
409 AcpiDmDumpSerialBusVendorData (
410     AML_RESOURCE            *Resource,
411     UINT32                  Level)
412 {
413     UINT8                   *VendorData;
414     UINT32                  VendorLength;
415 
416 
417     /* Get the (optional) vendor data and length */
418 
419     switch (Resource->CommonSerialBus.Type)
420     {
421     case AML_RESOURCE_I2C_SERIALBUSTYPE:
422 
423         VendorLength = Resource->CommonSerialBus.TypeDataLength -
424             AML_RESOURCE_I2C_MIN_DATA_LEN;
425 
426         VendorData = ACPI_ADD_PTR (UINT8, Resource,
427             sizeof (AML_RESOURCE_I2C_SERIALBUS));
428         break;
429 
430     case AML_RESOURCE_SPI_SERIALBUSTYPE:
431 
432         VendorLength = Resource->CommonSerialBus.TypeDataLength -
433             AML_RESOURCE_SPI_MIN_DATA_LEN;
434 
435         VendorData = ACPI_ADD_PTR (UINT8, Resource,
436             sizeof (AML_RESOURCE_SPI_SERIALBUS));
437         break;
438 
439     case AML_RESOURCE_UART_SERIALBUSTYPE:
440 
441         VendorLength = Resource->CommonSerialBus.TypeDataLength -
442             AML_RESOURCE_UART_MIN_DATA_LEN;
443 
444         VendorData = ACPI_ADD_PTR (UINT8, Resource,
445             sizeof (AML_RESOURCE_UART_SERIALBUS));
446         break;
447 
448     default:
449 
450         return;
451     }
452 
453     /* Dump the vendor bytes as a RawDataBuffer object */
454 
455     AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
456 }
457 
458 
459 /*******************************************************************************
460  *
461  * FUNCTION:    AcpiDmI2cSerialBusDescriptor
462  *
463  * PARAMETERS:  Resource            - Pointer to the resource descriptor
464  *              Length              - Length of the descriptor in bytes
465  *              Level               - Current source code indentation level
466  *
467  * RETURN:      None
468  *
469  * DESCRIPTION: Decode a I2C serial bus descriptor
470  *
471  ******************************************************************************/
472 
473 static void
474 AcpiDmI2cSerialBusDescriptor (
475     AML_RESOURCE            *Resource,
476     UINT32                  Length,
477     UINT32                  Level)
478 {
479     UINT32                  ResourceSourceOffset;
480 
481 
482     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
483 
484     AcpiDmIndent (Level);
485     AcpiOsPrintf ("I2cSerialBus (0x%4.4X, %s, 0x%8.8X,\n",
486         Resource->I2cSerialBus.SlaveAddress,
487         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
488         Resource->I2cSerialBus.ConnectionSpeed);
489 
490     AcpiDmIndent (Level + 1);
491     AcpiOsPrintf ("%s, ",
492         AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
493 
494     /* ResourceSource is a required field */
495 
496     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
497         Resource->CommonSerialBus.TypeDataLength;
498 
499     AcpiUtPrintString (
500         ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
501         ACPI_UINT16_MAX);
502 
503     /* ResourceSourceIndex, ResourceUsage */
504 
505     AcpiOsPrintf (",\n");
506     AcpiDmIndent (Level + 1);
507     AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
508 
509     AcpiOsPrintf ("%s, ",
510         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
511 
512     /* Insert a descriptor name */
513 
514     AcpiDmDescriptorName ();
515     AcpiOsPrintf (",\n");
516 
517     /* Dump the vendor data */
518 
519     AcpiDmIndent (Level + 1);
520     AcpiDmDumpSerialBusVendorData (Resource, Level);
521     AcpiOsPrintf (")\n");
522 }
523 
524 
525 /*******************************************************************************
526  *
527  * FUNCTION:    AcpiDmSpiSerialBusDescriptor
528  *
529  * PARAMETERS:  Resource            - Pointer to the resource descriptor
530  *              Length              - Length of the descriptor in bytes
531  *              Level               - Current source code indentation level
532  *
533  * RETURN:      None
534  *
535  * DESCRIPTION: Decode a SPI serial bus descriptor
536  *
537  ******************************************************************************/
538 
539 static void
540 AcpiDmSpiSerialBusDescriptor (
541     AML_RESOURCE            *Resource,
542     UINT32                  Length,
543     UINT32                  Level)
544 {
545     UINT32                  ResourceSourceOffset;
546 
547 
548     /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
549 
550     AcpiDmIndent (Level);
551     AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n",
552         Resource->SpiSerialBus.DeviceSelection,
553         AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
554         AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
555         Resource->SpiSerialBus.DataBitLength);
556 
557     /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
558 
559     AcpiDmIndent (Level + 1);
560     AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
561         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
562         Resource->SpiSerialBus.ConnectionSpeed,
563         AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
564 
565     AcpiDmIndent (Level + 1);
566     AcpiOsPrintf ("%s, ",
567         AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
568 
569     /* ResourceSource is a required field */
570 
571     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
572         Resource->CommonSerialBus.TypeDataLength;
573 
574     AcpiUtPrintString (
575         ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
576         ACPI_UINT16_MAX);
577 
578     /* ResourceSourceIndex, ResourceUsage */
579 
580     AcpiOsPrintf (",\n");
581     AcpiDmIndent (Level + 1);
582     AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
583 
584     AcpiOsPrintf ("%s, ",
585         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
586 
587     /* Insert a descriptor name */
588 
589     AcpiDmDescriptorName ();
590     AcpiOsPrintf (",\n");
591 
592     /* Dump the vendor data */
593 
594     AcpiDmIndent (Level + 1);
595     AcpiDmDumpSerialBusVendorData (Resource, Level);
596     AcpiOsPrintf (")\n");
597 }
598 
599 
600 /*******************************************************************************
601  *
602  * FUNCTION:    AcpiDmUartSerialBusDescriptor
603  *
604  * PARAMETERS:  Resource            - Pointer to the resource descriptor
605  *              Length              - Length of the descriptor in bytes
606  *              Level               - Current source code indentation level
607  *
608  * RETURN:      None
609  *
610  * DESCRIPTION: Decode a UART serial bus descriptor
611  *
612  ******************************************************************************/
613 
614 static void
615 AcpiDmUartSerialBusDescriptor (
616     AML_RESOURCE            *Resource,
617     UINT32                  Length,
618     UINT32                  Level)
619 {
620     UINT32                  ResourceSourceOffset;
621 
622 
623     /* ConnectionSpeed, BitsPerByte, StopBits */
624 
625     AcpiDmIndent (Level);
626     AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n",
627         Resource->UartSerialBus.DefaultBaudRate,
628         AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
629         AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
630 
631     /* LinesInUse, IsBigEndian, Parity, FlowControl */
632 
633     AcpiDmIndent (Level + 1);
634     AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
635         Resource->UartSerialBus.LinesEnabled,
636         AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
637         AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
638         AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
639 
640     /* ReceiveBufferSize, TransmitBufferSize */
641 
642     AcpiDmIndent (Level + 1);
643     AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
644         Resource->UartSerialBus.RxFifoSize,
645         Resource->UartSerialBus.TxFifoSize);
646 
647     /* ResourceSource is a required field */
648 
649     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
650         Resource->CommonSerialBus.TypeDataLength;
651 
652     AcpiUtPrintString (
653         ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
654         ACPI_UINT16_MAX);
655 
656     /* ResourceSourceIndex, ResourceUsage */
657 
658     AcpiOsPrintf (",\n");
659     AcpiDmIndent (Level + 1);
660     AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
661 
662     AcpiOsPrintf ("%s, ",
663         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
664 
665     /* Insert a descriptor name */
666 
667     AcpiDmDescriptorName ();
668     AcpiOsPrintf (",\n");
669 
670     /* Dump the vendor data */
671 
672     AcpiDmIndent (Level + 1);
673     AcpiDmDumpSerialBusVendorData (Resource, Level);
674     AcpiOsPrintf (")\n");
675 }
676 
677 
678 /*******************************************************************************
679  *
680  * FUNCTION:    AcpiDmSerialBusDescriptor
681  *
682  * PARAMETERS:  Resource            - Pointer to the resource descriptor
683  *              Length              - Length of the descriptor in bytes
684  *              Level               - Current source code indentation level
685  *
686  * RETURN:      None
687  *
688  * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
689  *
690  ******************************************************************************/
691 
692 void
693 AcpiDmSerialBusDescriptor (
694     AML_RESOURCE            *Resource,
695     UINT32                  Length,
696     UINT32                  Level)
697 {
698 
699     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
700         Resource, Length, Level);
701 }
702 
703 #endif
704