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