dmresrcl2.c revision 1.1.1.6 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 #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
156 AcpiOsPrintf ("\n");
157 AcpiDmIndent (Level + 2);
158
159 i += 8;
160 }
161
162 Finish:
163 AcpiOsPrintf ("\n");
164 AcpiDmIndent (Level + 1);
165 AcpiOsPrintf ("}");
166 }
167
168
169 /*******************************************************************************
170 *
171 * FUNCTION: AcpiDmGpioCommon
172 *
173 * PARAMETERS: Info - Extra resource info
174 * Resource - Pointer to the resource descriptor
175 * Level - Current source code indentation level
176 *
177 * RETURN: None
178 *
179 * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
180 *
181 ******************************************************************************/
182
183 static void
184 AcpiDmGpioCommon (
185 ACPI_OP_WALK_INFO *Info,
186 AML_RESOURCE *Resource,
187 UINT32 Level)
188 {
189 UINT16 *PinList;
190 UINT8 *VendorData;
191 char *DeviceName = NULL;
192 UINT32 PinCount;
193 UINT32 i;
194
195
196 /* ResourceSource, ResourceSourceIndex, ResourceType */
197
198 AcpiDmIndent (Level + 1);
199 if (Resource->Gpio.ResSourceOffset)
200 {
201 DeviceName = ACPI_ADD_PTR (char,
202 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],
247 ((i + 1) < PinCount) ? "," : "");
248 }
249
250 AcpiDmIndent (Level + 1);
251 AcpiOsPrintf ("}\n");
252
253 MpSaveGpioInfo (Info->MappingOp, Resource,
254 PinCount, PinList, DeviceName);
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 ("I2cSerialBusV2 (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
533 /* Share */
534
535 AcpiOsPrintf (", %s,\n",
536 AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 2)]);
537
538 /* Dump the vendor data */
539
540 AcpiDmIndent (Level + 1);
541 AcpiDmDumpSerialBusVendorData (Resource, Level);
542 AcpiOsPrintf (")\n");
543
544 MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
545 }
546
547
548 /*******************************************************************************
549 *
550 * FUNCTION: AcpiDmSpiSerialBusDescriptor
551 *
552 * PARAMETERS: Info - Extra resource info
553 * Resource - Pointer to the resource descriptor
554 * Length - Length of the descriptor in bytes
555 * Level - Current source code indentation level
556 *
557 * RETURN: None
558 *
559 * DESCRIPTION: Decode a SPI serial bus descriptor
560 *
561 ******************************************************************************/
562
563 static void
564 AcpiDmSpiSerialBusDescriptor (
565 ACPI_OP_WALK_INFO *Info,
566 AML_RESOURCE *Resource,
567 UINT32 Length,
568 UINT32 Level)
569 {
570 UINT32 ResourceSourceOffset;
571 char *DeviceName;
572
573
574 /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
575
576 AcpiDmIndent (Level);
577 AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n",
578 Resource->SpiSerialBus.DeviceSelection,
579 AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
580 AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
581 Resource->SpiSerialBus.DataBitLength);
582
583 /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
584
585 AcpiDmIndent (Level + 1);
586 AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
587 AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
588 Resource->SpiSerialBus.ConnectionSpeed,
589 AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
590
591 AcpiDmIndent (Level + 1);
592 AcpiOsPrintf ("%s, ",
593 AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
594
595 /* ResourceSource is a required field */
596
597 ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
598 Resource->CommonSerialBus.TypeDataLength;
599
600 DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
601 AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
602
603 /* ResourceSourceIndex, ResourceUsage */
604
605 AcpiOsPrintf (",\n");
606 AcpiDmIndent (Level + 1);
607 AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
608
609 AcpiOsPrintf ("%s, ",
610 AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
611
612 /* Insert a descriptor name */
613
614 AcpiDmDescriptorName ();
615
616 /* Share */
617
618 AcpiOsPrintf (", %s,\n",
619 AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 2)]);
620
621 /* Dump the vendor data */
622
623 AcpiDmIndent (Level + 1);
624 AcpiDmDumpSerialBusVendorData (Resource, Level);
625 AcpiOsPrintf (")\n");
626
627 MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
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 ("UartSerialBusV2 (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
702 /* Share */
703
704 AcpiOsPrintf (", %s,\n",
705 AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 2)]);
706
707 /* Dump the vendor data */
708
709 AcpiDmIndent (Level + 1);
710 AcpiDmDumpSerialBusVendorData (Resource, Level);
711 AcpiOsPrintf (")\n");
712
713 MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
714 }
715
716
717 /*******************************************************************************
718 *
719 * FUNCTION: AcpiDmSerialBusDescriptor
720 *
721 * PARAMETERS: Info - Extra resource info
722 * Resource - Pointer to the resource descriptor
723 * Length - Length of the descriptor in bytes
724 * Level - Current source code indentation level
725 *
726 * RETURN: None
727 *
728 * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
729 *
730 ******************************************************************************/
731
732 void
733 AcpiDmSerialBusDescriptor (
734 ACPI_OP_WALK_INFO *Info,
735 AML_RESOURCE *Resource,
736 UINT32 Length,
737 UINT32 Level)
738 {
739
740 SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
741 Info, Resource, Length, Level);
742 }
743