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