1 /*******************************************************************************
2  *
3  * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
4  *
5  ******************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2015, 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 ("I2cSerialBus (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     AcpiOsPrintf (",\n");
537 
538     /* Dump the vendor data */
539 
540     AcpiDmIndent (Level + 1);
541     AcpiDmDumpSerialBusVendorData (Resource, Level);
542     AcpiOsPrintf (")\n");
543 
544 #ifndef _KERNEL
545     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
546 #endif
547 }
548 
549 
550 /*******************************************************************************
551  *
552  * FUNCTION:    AcpiDmSpiSerialBusDescriptor
553  *
554  * PARAMETERS:  Info                - Extra resource info
555  *              Resource            - Pointer to the resource descriptor
556  *              Length              - Length of the descriptor in bytes
557  *              Level               - Current source code indentation level
558  *
559  * RETURN:      None
560  *
561  * DESCRIPTION: Decode a SPI serial bus descriptor
562  *
563  ******************************************************************************/
564 
565 static void
566 AcpiDmSpiSerialBusDescriptor (
567     ACPI_OP_WALK_INFO       *Info,
568     AML_RESOURCE            *Resource,
569     UINT32                  Length,
570     UINT32                  Level)
571 {
572     UINT32                  ResourceSourceOffset;
573     char                    *DeviceName;
574 
575 
576     /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
577 
578     AcpiDmIndent (Level);
579     AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n",
580         Resource->SpiSerialBus.DeviceSelection,
581         AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
582         AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
583         Resource->SpiSerialBus.DataBitLength);
584 
585     /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
586 
587     AcpiDmIndent (Level + 1);
588     AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
589         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
590         Resource->SpiSerialBus.ConnectionSpeed,
591         AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
592 
593     AcpiDmIndent (Level + 1);
594     AcpiOsPrintf ("%s, ",
595         AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
596 
597     /* ResourceSource is a required field */
598 
599     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
600         Resource->CommonSerialBus.TypeDataLength;
601 
602     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
603     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
604 
605     /* ResourceSourceIndex, ResourceUsage */
606 
607     AcpiOsPrintf (",\n");
608     AcpiDmIndent (Level + 1);
609     AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
610 
611     AcpiOsPrintf ("%s, ",
612         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
613 
614     /* Insert a descriptor name */
615 
616     AcpiDmDescriptorName ();
617     AcpiOsPrintf (",\n");
618 
619     /* Dump the vendor data */
620 
621     AcpiDmIndent (Level + 1);
622     AcpiDmDumpSerialBusVendorData (Resource, Level);
623     AcpiOsPrintf (")\n");
624 
625 #ifndef _KERNEL
626     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
627 #endif
628 }
629 
630 
631 /*******************************************************************************
632  *
633  * FUNCTION:    AcpiDmUartSerialBusDescriptor
634  *
635  * PARAMETERS:  Info                - Extra resource info
636  *              Resource            - Pointer to the resource descriptor
637  *              Length              - Length of the descriptor in bytes
638  *              Level               - Current source code indentation level
639  *
640  * RETURN:      None
641  *
642  * DESCRIPTION: Decode a UART serial bus descriptor
643  *
644  ******************************************************************************/
645 
646 static void
647 AcpiDmUartSerialBusDescriptor (
648     ACPI_OP_WALK_INFO       *Info,
649     AML_RESOURCE            *Resource,
650     UINT32                  Length,
651     UINT32                  Level)
652 {
653     UINT32                  ResourceSourceOffset;
654     char                    *DeviceName;
655 
656 
657     /* ConnectionSpeed, BitsPerByte, StopBits */
658 
659     AcpiDmIndent (Level);
660     AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n",
661         Resource->UartSerialBus.DefaultBaudRate,
662         AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
663         AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
664 
665     /* LinesInUse, IsBigEndian, Parity, FlowControl */
666 
667     AcpiDmIndent (Level + 1);
668     AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
669         Resource->UartSerialBus.LinesEnabled,
670         AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
671         AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
672         AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
673 
674     /* ReceiveBufferSize, TransmitBufferSize */
675 
676     AcpiDmIndent (Level + 1);
677     AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
678         Resource->UartSerialBus.RxFifoSize,
679         Resource->UartSerialBus.TxFifoSize);
680 
681     /* ResourceSource is a required field */
682 
683     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
684         Resource->CommonSerialBus.TypeDataLength;
685 
686     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
687     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
688 
689     /* ResourceSourceIndex, ResourceUsage */
690 
691     AcpiOsPrintf (",\n");
692     AcpiDmIndent (Level + 1);
693     AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
694 
695     AcpiOsPrintf ("%s, ",
696         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
697 
698     /* Insert a descriptor name */
699 
700     AcpiDmDescriptorName ();
701     AcpiOsPrintf (",\n");
702 
703     /* Dump the vendor data */
704 
705     AcpiDmIndent (Level + 1);
706     AcpiDmDumpSerialBusVendorData (Resource, Level);
707     AcpiOsPrintf (")\n");
708 
709 #ifndef _KERNEL
710     MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
711 #endif
712 }
713 
714 
715 /*******************************************************************************
716  *
717  * FUNCTION:    AcpiDmSerialBusDescriptor
718  *
719  * PARAMETERS:  Info                - Extra resource info
720  *              Resource            - Pointer to the resource descriptor
721  *              Length              - Length of the descriptor in bytes
722  *              Level               - Current source code indentation level
723  *
724  * RETURN:      None
725  *
726  * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
727  *
728  ******************************************************************************/
729 
730 void
731 AcpiDmSerialBusDescriptor (
732     ACPI_OP_WALK_INFO       *Info,
733     AML_RESOURCE            *Resource,
734     UINT32                  Length,
735     UINT32                  Level)
736 {
737 
738     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
739         Info, Resource, Length, Level);
740 }
741 
742 #endif
743