1 /*******************************************************************************
2  *
3  * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
4  *
5  ******************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2016, 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 #include "acpi.h"
45 #include "accommon.h"
46 #include "acdisasm.h"
47 
48 
49 #ifdef ACPI_DISASSEMBLER
50 
51 #define _COMPONENT          ACPI_CA_DEBUGGER
52         ACPI_MODULE_NAME    ("dbresrcl2")
53 
54 /* Local prototypes */
55 
56 static void
57 AcpiDmI2cSerialBusDescriptor (
58     ACPI_OP_WALK_INFO       *Info,
59     AML_RESOURCE            *Resource,
60     UINT32                  Length,
61     UINT32                  Level);
62 
63 static void
64 AcpiDmSpiSerialBusDescriptor (
65     ACPI_OP_WALK_INFO       *Info,
66     AML_RESOURCE            *Resource,
67     UINT32                  Length,
68     UINT32                  Level);
69 
70 static void
71 AcpiDmUartSerialBusDescriptor (
72     ACPI_OP_WALK_INFO       *Info,
73     AML_RESOURCE            *Resource,
74     UINT32                  Length,
75     UINT32                  Level);
76 
77 static void
78 AcpiDmGpioCommon (
79     ACPI_OP_WALK_INFO       *Info,
80     AML_RESOURCE            *Resource,
81     UINT32                  Level);
82 
83 static void
84 AcpiDmDumpRawDataBuffer (
85     UINT8                   *Buffer,
86     UINT32                  Length,
87     UINT32                  Level);
88 
89 
90 /* Dispatch table for the serial bus descriptors */
91 
92 static ACPI_RESOURCE_HANDLER        SerialBusResourceDispatch [] =
93 {
94     NULL,
95     AcpiDmI2cSerialBusDescriptor,
96     AcpiDmSpiSerialBusDescriptor,
97     AcpiDmUartSerialBusDescriptor
98 };
99 
100 
101 /*******************************************************************************
102  *
103  * FUNCTION:    AcpiDmDumpRawDataBuffer
104  *
105  * PARAMETERS:  Buffer              - Pointer to the data bytes
106  *              Length              - Length of the descriptor in bytes
107  *              Level               - Current source code indentation level
108  *
109  * RETURN:      None
110  *
111  * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
112  *              vendor data bytes.
113  *
114  ******************************************************************************/
115 
116 static void
117 AcpiDmDumpRawDataBuffer (
118     UINT8                   *Buffer,
119     UINT32                  Length,
120     UINT32                  Level)
121 {
122     UINT32                  Index;
123     UINT32                  i;
124     UINT32                  j;
125 
126 
127     if (!Length)
128     {
129         return;
130     }
131 
132     AcpiOsPrintf ("RawDataBuffer (0x%.2X)  // Vendor Data", Length);
133 
134     AcpiOsPrintf ("\n");
135     AcpiDmIndent (Level + 1);
136     AcpiOsPrintf ("{\n");
137     AcpiDmIndent (Level + 2);
138 
139     for (i = 0; i < Length;)
140     {
141         for (j = 0; j < 8; j++)
142         {
143             Index = i + j;
144             if (Index >= Length)
145             {
146                 goto Finish;
147             }
148 
149             AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
150             if ((Index + 1) >= Length)
151             {
152                 goto Finish;
153             }
154 
155             AcpiOsPrintf (", ");
156         }
157 
158         AcpiOsPrintf ("\n");
159         AcpiDmIndent (Level + 2);
160 
161         i += 8;
162     }
163 
164 Finish:
165     AcpiOsPrintf ("\n");
166     AcpiDmIndent (Level + 1);
167     AcpiOsPrintf ("}");
168 }
169 
170 
171 /*******************************************************************************
172  *
173  * FUNCTION:    AcpiDmGpioCommon
174  *
175  * PARAMETERS:  Info                - Extra resource info
176  *              Resource            - Pointer to the resource descriptor
177  *              Level               - Current source code indentation level
178  *
179  * RETURN:      None
180  *
181  * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
182  *
183  ******************************************************************************/
184 
185 static void
186 AcpiDmGpioCommon (
187     ACPI_OP_WALK_INFO       *Info,
188     AML_RESOURCE            *Resource,
189     UINT32                  Level)
190 {
191     UINT16                  *PinList;
192     UINT8                   *VendorData;
193     char                    *DeviceName = NULL;
194     UINT32                  PinCount;
195     UINT32                  i;
196 
197 
198     /* ResourceSource, ResourceSourceIndex, ResourceType */
199 
200     AcpiDmIndent (Level + 1);
201     if (Resource->Gpio.ResSourceOffset)
202     {
203         DeviceName = ACPI_ADD_PTR (char,
204             Resource, Resource->Gpio.ResSourceOffset),
205         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
206     }
207 
208     AcpiOsPrintf (", ");
209     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
210     AcpiOsPrintf ("%s, ",
211         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
212 
213     /* Insert a descriptor name */
214 
215     AcpiDmDescriptorName ();
216     AcpiOsPrintf (",");
217 
218     /* Dump the vendor data */
219 
220     if (Resource->Gpio.VendorOffset)
221     {
222         AcpiOsPrintf ("\n");
223         AcpiDmIndent (Level + 1);
224         VendorData = ACPI_ADD_PTR (UINT8, Resource,
225             Resource->Gpio.VendorOffset);
226 
227         AcpiDmDumpRawDataBuffer (VendorData,
228             Resource->Gpio.VendorLength, Level);
229     }
230 
231     AcpiOsPrintf (")\n");
232 
233     /* Dump the interrupt list */
234 
235     AcpiDmIndent (Level + 1);
236     AcpiOsPrintf ("{   // Pin list\n");
237 
238     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
239         Resource->Gpio.PinTableOffset)) /
240         sizeof (UINT16);
241 
242     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
243         Resource->Gpio.PinTableOffset);
244 
245     for (i = 0; i < PinCount; i++)
246     {
247         AcpiDmIndent (Level + 2);
248         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
249             ((i + 1) < PinCount) ? "," : "");
250     }
251 
252     AcpiDmIndent (Level + 1);
253     AcpiOsPrintf ("}\n");
254 
255 #ifndef _KERNEL
256     MpSaveGpioInfo (Info->MappingOp, Resource,
257         PinCount, PinList, DeviceName);
258 #endif
259 }
260 
261 
262 /*******************************************************************************
263  *
264  * FUNCTION:    AcpiDmGpioIntDescriptor
265  *
266  * PARAMETERS:  Info                - Extra resource info
267  *              Resource            - Pointer to the resource descriptor
268  *              Length              - Length of the descriptor in bytes
269  *              Level               - Current source code indentation level
270  *
271  * RETURN:      None
272  *
273  * DESCRIPTION: Decode a GPIO Interrupt descriptor
274  *
275  ******************************************************************************/
276 
277 static void
278 AcpiDmGpioIntDescriptor (
279     ACPI_OP_WALK_INFO       *Info,
280     AML_RESOURCE            *Resource,
281     UINT32                  Length,
282     UINT32                  Level)
283 {
284 
285     /* Dump the GpioInt-specific portion of the descriptor */
286 
287     /* EdgeLevel, ActiveLevel, Shared */
288 
289     AcpiDmIndent (Level);
290     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
291         AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
292         AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
293         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
294 
295     /* PinConfig, DebounceTimeout */
296 
297     if (Resource->Gpio.PinConfig <= 3)
298     {
299         AcpiOsPrintf ("%s, ",
300             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
301     }
302     else
303     {
304         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
305     }
306     AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
307 
308     /* Dump the GpioInt/GpioIo common portion of the descriptor */
309 
310     AcpiDmGpioCommon (Info, Resource, Level);
311 }
312 
313 
314 /*******************************************************************************
315  *
316  * FUNCTION:    AcpiDmGpioIoDescriptor
317  *
318  * PARAMETERS:  Info                - Extra resource info
319  *              Resource            - Pointer to the resource descriptor
320  *              Length              - Length of the descriptor in bytes
321  *              Level               - Current source code indentation level
322  *
323  * RETURN:      None
324  *
325  * DESCRIPTION: Decode a GPIO I/O descriptor
326  *
327  ******************************************************************************/
328 
329 static void
330 AcpiDmGpioIoDescriptor (
331     ACPI_OP_WALK_INFO       *Info,
332     AML_RESOURCE            *Resource,
333     UINT32                  Length,
334     UINT32                  Level)
335 {
336 
337     /* Dump the GpioIo-specific portion of the descriptor */
338 
339     /* Shared, PinConfig */
340 
341     AcpiDmIndent (Level);
342     AcpiOsPrintf ("GpioIo (%s, ",
343         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
344 
345     if (Resource->Gpio.PinConfig <= 3)
346     {
347         AcpiOsPrintf ("%s, ",
348             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
349     }
350     else
351     {
352         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
353     }
354 
355     /* DebounceTimeout, DriveStrength, IoRestriction */
356 
357     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
358     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
359     AcpiOsPrintf ("%s,\n",
360         AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
361 
362     /* Dump the GpioInt/GpioIo common portion of the descriptor */
363 
364     AcpiDmGpioCommon (Info, Resource, Level);
365 }
366 
367 
368 /*******************************************************************************
369  *
370  * FUNCTION:    AcpiDmGpioDescriptor
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 GpioInt/GpioIo GPIO Interrupt/IO descriptor
380  *
381  ******************************************************************************/
382 
383 void
384 AcpiDmGpioDescriptor (
385     ACPI_OP_WALK_INFO       *Info,
386     AML_RESOURCE            *Resource,
387     UINT32                  Length,
388     UINT32                  Level)
389 {
390     UINT8                   ConnectionType;
391 
392 
393     ConnectionType = Resource->Gpio.ConnectionType;
394 
395     switch (ConnectionType)
396     {
397     case AML_RESOURCE_GPIO_TYPE_INT:
398 
399         AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
400         break;
401 
402     case AML_RESOURCE_GPIO_TYPE_IO:
403 
404         AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
405         break;
406 
407     default:
408 
409         AcpiOsPrintf ("Unknown GPIO type\n");
410         break;
411     }
412 }
413 
414 
415 /*******************************************************************************
416  *
417  * FUNCTION:    AcpiDmDumpSerialBusVendorData
418  *
419  * PARAMETERS:  Resource            - Pointer to the resource descriptor
420  *
421  * RETURN:      None
422  *
423  * DESCRIPTION: Dump optional serial bus vendor data
424  *
425  ******************************************************************************/
426 
427 static void
428 AcpiDmDumpSerialBusVendorData (
429     AML_RESOURCE            *Resource,
430     UINT32                  Level)
431 {
432     UINT8                   *VendorData;
433     UINT32                  VendorLength;
434 
435 
436     /* Get the (optional) vendor data and length */
437 
438     switch (Resource->CommonSerialBus.Type)
439     {
440     case AML_RESOURCE_I2C_SERIALBUSTYPE:
441 
442         VendorLength = Resource->CommonSerialBus.TypeDataLength -
443             AML_RESOURCE_I2C_MIN_DATA_LEN;
444 
445         VendorData = ACPI_ADD_PTR (UINT8, Resource,
446             sizeof (AML_RESOURCE_I2C_SERIALBUS));
447         break;
448 
449     case AML_RESOURCE_SPI_SERIALBUSTYPE:
450 
451         VendorLength = Resource->CommonSerialBus.TypeDataLength -
452             AML_RESOURCE_SPI_MIN_DATA_LEN;
453 
454         VendorData = ACPI_ADD_PTR (UINT8, Resource,
455             sizeof (AML_RESOURCE_SPI_SERIALBUS));
456         break;
457 
458     case AML_RESOURCE_UART_SERIALBUSTYPE:
459 
460         VendorLength = Resource->CommonSerialBus.TypeDataLength -
461             AML_RESOURCE_UART_MIN_DATA_LEN;
462 
463         VendorData = ACPI_ADD_PTR (UINT8, Resource,
464             sizeof (AML_RESOURCE_UART_SERIALBUS));
465         break;
466 
467     default:
468 
469         return;
470     }
471 
472     /* Dump the vendor bytes as a RawDataBuffer object */
473 
474     AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
475 }
476 
477 
478 /*******************************************************************************
479  *
480  * FUNCTION:    AcpiDmI2cSerialBusDescriptor
481  *
482  * PARAMETERS:  Info                - Extra resource info
483  *              Resource            - Pointer to the resource descriptor
484  *              Length              - Length of the descriptor in bytes
485  *              Level               - Current source code indentation level
486  *
487  * RETURN:      None
488  *
489  * DESCRIPTION: Decode a I2C serial bus descriptor
490  *
491  ******************************************************************************/
492 
493 static void
494 AcpiDmI2cSerialBusDescriptor (
495     ACPI_OP_WALK_INFO       *Info,
496     AML_RESOURCE            *Resource,
497     UINT32                  Length,
498     UINT32                  Level)
499 {
500     UINT32                  ResourceSourceOffset;
501     char                    *DeviceName;
502 
503 
504     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
505 
506     AcpiDmIndent (Level);
507     AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
508         Resource->I2cSerialBus.SlaveAddress,
509         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
510         Resource->I2cSerialBus.ConnectionSpeed);
511 
512     AcpiDmIndent (Level + 1);
513     AcpiOsPrintf ("%s, ",
514         AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
515 
516     /* ResourceSource is a required field */
517 
518     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
519         Resource->CommonSerialBus.TypeDataLength;
520 
521     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
522     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
523 
524     /* ResourceSourceIndex, ResourceUsage */
525 
526     AcpiOsPrintf (",\n");
527     AcpiDmIndent (Level + 1);
528     AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
529 
530     AcpiOsPrintf ("%s, ",
531         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
532 
533     /* Insert a descriptor name */
534 
535     AcpiDmDescriptorName ();
536 
537     /* Share */
538 
539     AcpiOsPrintf (", %s,\n",
540         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 2)]);
541 
542     /* Dump the vendor data */
543 
544     AcpiDmIndent (Level + 1);
545     AcpiDmDumpSerialBusVendorData (Resource, Level);
546     AcpiOsPrintf (")\n");
547 
548 #ifndef _KERNEL
549     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
550 #endif
551 }
552 
553 
554 /*******************************************************************************
555  *
556  * FUNCTION:    AcpiDmSpiSerialBusDescriptor
557  *
558  * PARAMETERS:  Info                - Extra resource info
559  *              Resource            - Pointer to the resource descriptor
560  *              Length              - Length of the descriptor in bytes
561  *              Level               - Current source code indentation level
562  *
563  * RETURN:      None
564  *
565  * DESCRIPTION: Decode a SPI serial bus descriptor
566  *
567  ******************************************************************************/
568 
569 static void
570 AcpiDmSpiSerialBusDescriptor (
571     ACPI_OP_WALK_INFO       *Info,
572     AML_RESOURCE            *Resource,
573     UINT32                  Length,
574     UINT32                  Level)
575 {
576     UINT32                  ResourceSourceOffset;
577     char                    *DeviceName;
578 
579 
580     /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
581 
582     AcpiDmIndent (Level);
583     AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n",
584         Resource->SpiSerialBus.DeviceSelection,
585         AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
586         AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
587         Resource->SpiSerialBus.DataBitLength);
588 
589     /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
590 
591     AcpiDmIndent (Level + 1);
592     AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
593         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
594         Resource->SpiSerialBus.ConnectionSpeed,
595         AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
596 
597     AcpiDmIndent (Level + 1);
598     AcpiOsPrintf ("%s, ",
599         AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
600 
601     /* ResourceSource is a required field */
602 
603     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
604         Resource->CommonSerialBus.TypeDataLength;
605 
606     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
607     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
608 
609     /* ResourceSourceIndex, ResourceUsage */
610 
611     AcpiOsPrintf (",\n");
612     AcpiDmIndent (Level + 1);
613     AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
614 
615     AcpiOsPrintf ("%s, ",
616         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
617 
618     /* Insert a descriptor name */
619 
620     AcpiDmDescriptorName ();
621 
622     /* Share */
623 
624     AcpiOsPrintf (", %s,\n",
625         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 2)]);
626 
627     /* Dump the vendor data */
628 
629     AcpiDmIndent (Level + 1);
630     AcpiDmDumpSerialBusVendorData (Resource, Level);
631     AcpiOsPrintf (")\n");
632 
633 #ifndef _KERNEL
634     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
635 #endif
636 }
637 
638 
639 /*******************************************************************************
640  *
641  * FUNCTION:    AcpiDmUartSerialBusDescriptor
642  *
643  * PARAMETERS:  Info                - Extra resource info
644  *              Resource            - Pointer to the resource descriptor
645  *              Length              - Length of the descriptor in bytes
646  *              Level               - Current source code indentation level
647  *
648  * RETURN:      None
649  *
650  * DESCRIPTION: Decode a UART serial bus descriptor
651  *
652  ******************************************************************************/
653 
654 static void
655 AcpiDmUartSerialBusDescriptor (
656     ACPI_OP_WALK_INFO       *Info,
657     AML_RESOURCE            *Resource,
658     UINT32                  Length,
659     UINT32                  Level)
660 {
661     UINT32                  ResourceSourceOffset;
662     char                    *DeviceName;
663 
664 
665     /* ConnectionSpeed, BitsPerByte, StopBits */
666 
667     AcpiDmIndent (Level);
668     AcpiOsPrintf ("UartSerialBusV2 (0x%8.8X, %s, %s,\n",
669         Resource->UartSerialBus.DefaultBaudRate,
670         AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
671         AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
672 
673     /* LinesInUse, IsBigEndian, Parity, FlowControl */
674 
675     AcpiDmIndent (Level + 1);
676     AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
677         Resource->UartSerialBus.LinesEnabled,
678         AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
679         AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
680         AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
681 
682     /* ReceiveBufferSize, TransmitBufferSize */
683 
684     AcpiDmIndent (Level + 1);
685     AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
686         Resource->UartSerialBus.RxFifoSize,
687         Resource->UartSerialBus.TxFifoSize);
688 
689     /* ResourceSource is a required field */
690 
691     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
692         Resource->CommonSerialBus.TypeDataLength;
693 
694     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
695     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
696 
697     /* ResourceSourceIndex, ResourceUsage */
698 
699     AcpiOsPrintf (",\n");
700     AcpiDmIndent (Level + 1);
701     AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
702 
703     AcpiOsPrintf ("%s, ",
704         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
705 
706     /* Insert a descriptor name */
707 
708     AcpiDmDescriptorName ();
709 
710     /* Share */
711 
712     AcpiOsPrintf (", %s,\n",
713         AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 2)]);
714 
715     /* Dump the vendor data */
716 
717     AcpiDmIndent (Level + 1);
718     AcpiDmDumpSerialBusVendorData (Resource, Level);
719     AcpiOsPrintf (")\n");
720 
721 #ifndef _KERNEL
722     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
723 #endif
724 }
725 
726 
727 /*******************************************************************************
728  *
729  * FUNCTION:    AcpiDmSerialBusDescriptor
730  *
731  * PARAMETERS:  Info                - Extra resource info
732  *              Resource            - Pointer to the resource descriptor
733  *              Length              - Length of the descriptor in bytes
734  *              Level               - Current source code indentation level
735  *
736  * RETURN:      None
737  *
738  * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
739  *
740  ******************************************************************************/
741 
742 void
743 AcpiDmSerialBusDescriptor (
744     ACPI_OP_WALK_INFO       *Info,
745     AML_RESOURCE            *Resource,
746     UINT32                  Length,
747     UINT32                  Level)
748 {
749 
750     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
751         Info, Resource, Length, Level);
752 }
753 
754 #endif
755