1bc36eafdSMike Gerdts /*******************************************************************************
2bc36eafdSMike Gerdts *
3bc36eafdSMike Gerdts * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
4bc36eafdSMike Gerdts *
5bc36eafdSMike Gerdts ******************************************************************************/
6bc36eafdSMike Gerdts
7*35786f68SRobert Mustacchi /******************************************************************************
8*35786f68SRobert Mustacchi *
9*35786f68SRobert Mustacchi * 1. Copyright Notice
10*35786f68SRobert Mustacchi *
11*35786f68SRobert Mustacchi * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12bc36eafdSMike Gerdts * All rights reserved.
13bc36eafdSMike Gerdts *
14*35786f68SRobert Mustacchi * 2. License
15*35786f68SRobert Mustacchi *
16*35786f68SRobert Mustacchi * 2.1. This is your license from Intel Corp. under its intellectual property
17*35786f68SRobert Mustacchi * rights. You may have additional license terms from the party that provided
18*35786f68SRobert Mustacchi * you this software, covering your right to use that party's intellectual
19*35786f68SRobert Mustacchi * property rights.
20*35786f68SRobert Mustacchi *
21*35786f68SRobert Mustacchi * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22*35786f68SRobert Mustacchi * copy of the source code appearing in this file ("Covered Code") an
23*35786f68SRobert Mustacchi * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24*35786f68SRobert Mustacchi * base code distributed originally by Intel ("Original Intel Code") to copy,
25*35786f68SRobert Mustacchi * make derivatives, distribute, use and display any portion of the Covered
26*35786f68SRobert Mustacchi * Code in any form, with the right to sublicense such rights; and
27*35786f68SRobert Mustacchi *
28*35786f68SRobert Mustacchi * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29*35786f68SRobert Mustacchi * license (with the right to sublicense), under only those claims of Intel
30*35786f68SRobert Mustacchi * patents that are infringed by the Original Intel Code, to make, use, sell,
31*35786f68SRobert Mustacchi * offer to sell, and import the Covered Code and derivative works thereof
32*35786f68SRobert Mustacchi * solely to the minimum extent necessary to exercise the above copyright
33*35786f68SRobert Mustacchi * license, and in no event shall the patent license extend to any additions
34*35786f68SRobert Mustacchi * to or modifications of the Original Intel Code. No other license or right
35*35786f68SRobert Mustacchi * is granted directly or by implication, estoppel or otherwise;
36*35786f68SRobert Mustacchi *
37*35786f68SRobert Mustacchi * The above copyright and patent license is granted only if the following
38*35786f68SRobert Mustacchi * conditions are met:
39*35786f68SRobert Mustacchi *
40*35786f68SRobert Mustacchi * 3. Conditions
41*35786f68SRobert Mustacchi *
42*35786f68SRobert Mustacchi * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43*35786f68SRobert Mustacchi * Redistribution of source code of any substantial portion of the Covered
44*35786f68SRobert Mustacchi * Code or modification with rights to further distribute source must include
45*35786f68SRobert Mustacchi * the above Copyright Notice, the above License, this list of Conditions,
46*35786f68SRobert Mustacchi * and the following Disclaimer and Export Compliance provision. In addition,
47*35786f68SRobert Mustacchi * Licensee must cause all Covered Code to which Licensee contributes to
48*35786f68SRobert Mustacchi * contain a file documenting the changes Licensee made to create that Covered
49*35786f68SRobert Mustacchi * Code and the date of any change. Licensee must include in that file the
50*35786f68SRobert Mustacchi * documentation of any changes made by any predecessor Licensee. Licensee
51*35786f68SRobert Mustacchi * must include a prominent statement that the modification is derived,
52*35786f68SRobert Mustacchi * directly or indirectly, from Original Intel Code.
53*35786f68SRobert Mustacchi *
54*35786f68SRobert Mustacchi * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55*35786f68SRobert Mustacchi * Redistribution of source code of any substantial portion of the Covered
56*35786f68SRobert Mustacchi * Code or modification without rights to further distribute source must
57*35786f68SRobert Mustacchi * include the following Disclaimer and Export Compliance provision in the
58*35786f68SRobert Mustacchi * documentation and/or other materials provided with distribution. In
59*35786f68SRobert Mustacchi * addition, Licensee may not authorize further sublicense of source of any
60*35786f68SRobert Mustacchi * portion of the Covered Code, and must include terms to the effect that the
61*35786f68SRobert Mustacchi * license from Licensee to its licensee is limited to the intellectual
62*35786f68SRobert Mustacchi * property embodied in the software Licensee provides to its licensee, and
63*35786f68SRobert Mustacchi * not to intellectual property embodied in modifications its licensee may
64*35786f68SRobert Mustacchi * make.
65*35786f68SRobert Mustacchi *
66*35786f68SRobert Mustacchi * 3.3. Redistribution of Executable. Redistribution in executable form of any
67*35786f68SRobert Mustacchi * substantial portion of the Covered Code or modification must reproduce the
68*35786f68SRobert Mustacchi * above Copyright Notice, and the following Disclaimer and Export Compliance
69*35786f68SRobert Mustacchi * provision in the documentation and/or other materials provided with the
70*35786f68SRobert Mustacchi * distribution.
71*35786f68SRobert Mustacchi *
72*35786f68SRobert Mustacchi * 3.4. Intel retains all right, title, and interest in and to the Original
73*35786f68SRobert Mustacchi * Intel Code.
74*35786f68SRobert Mustacchi *
75*35786f68SRobert Mustacchi * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76*35786f68SRobert Mustacchi * Intel shall be used in advertising or otherwise to promote the sale, use or
77*35786f68SRobert Mustacchi * other dealings in products derived from or relating to the Covered Code
78*35786f68SRobert Mustacchi * without prior written authorization from Intel.
79*35786f68SRobert Mustacchi *
80*35786f68SRobert Mustacchi * 4. Disclaimer and Export Compliance
81*35786f68SRobert Mustacchi *
82*35786f68SRobert Mustacchi * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83*35786f68SRobert Mustacchi * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84*35786f68SRobert Mustacchi * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85*35786f68SRobert Mustacchi * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86*35786f68SRobert Mustacchi * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87*35786f68SRobert Mustacchi * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88*35786f68SRobert Mustacchi * PARTICULAR PURPOSE.
89*35786f68SRobert Mustacchi *
90*35786f68SRobert Mustacchi * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91*35786f68SRobert Mustacchi * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92*35786f68SRobert Mustacchi * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93*35786f68SRobert Mustacchi * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94*35786f68SRobert Mustacchi * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95*35786f68SRobert Mustacchi * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96*35786f68SRobert Mustacchi * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97*35786f68SRobert Mustacchi * LIMITED REMEDY.
98*35786f68SRobert Mustacchi *
99*35786f68SRobert Mustacchi * 4.3. Licensee shall not export, either directly or indirectly, any of this
100*35786f68SRobert Mustacchi * software or system incorporating such software without first obtaining any
101*35786f68SRobert Mustacchi * required license or other approval from the U. S. Department of Commerce or
102*35786f68SRobert Mustacchi * any other agency or department of the United States Government. In the
103*35786f68SRobert Mustacchi * event Licensee exports any such software from the United States or
104*35786f68SRobert Mustacchi * re-exports any such software from a foreign destination, Licensee shall
105*35786f68SRobert Mustacchi * ensure that the distribution and export/re-export of the software is in
106*35786f68SRobert Mustacchi * compliance with all laws, regulations, orders, or other restrictions of the
107*35786f68SRobert Mustacchi * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108*35786f68SRobert Mustacchi * any of its subsidiaries will export/re-export any technical data, process,
109*35786f68SRobert Mustacchi * software, or service, directly or indirectly, to any country for which the
110*35786f68SRobert Mustacchi * United States government or any agency thereof requires an export license,
111*35786f68SRobert Mustacchi * other governmental approval, or letter of assurance, without first obtaining
112*35786f68SRobert Mustacchi * such license, approval or letter.
113*35786f68SRobert Mustacchi *
114*35786f68SRobert Mustacchi *****************************************************************************
115*35786f68SRobert Mustacchi *
116*35786f68SRobert Mustacchi * Alternatively, you may choose to be licensed under the terms of the
117*35786f68SRobert Mustacchi * following license:
118*35786f68SRobert Mustacchi *
119bc36eafdSMike Gerdts * Redistribution and use in source and binary forms, with or without
120bc36eafdSMike Gerdts * modification, are permitted provided that the following conditions
121bc36eafdSMike Gerdts * are met:
122bc36eafdSMike Gerdts * 1. Redistributions of source code must retain the above copyright
123bc36eafdSMike Gerdts * notice, this list of conditions, and the following disclaimer,
124bc36eafdSMike Gerdts * without modification.
125bc36eafdSMike Gerdts * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126bc36eafdSMike Gerdts * substantially similar to the "NO WARRANTY" disclaimer below
127bc36eafdSMike Gerdts * ("Disclaimer") and any redistribution must be conditioned upon
128bc36eafdSMike Gerdts * including a substantially similar Disclaimer requirement for further
129bc36eafdSMike Gerdts * binary redistribution.
130bc36eafdSMike Gerdts * 3. Neither the names of the above-listed copyright holders nor the names
131bc36eafdSMike Gerdts * of any contributors may be used to endorse or promote products derived
132bc36eafdSMike Gerdts * from this software without specific prior written permission.
133bc36eafdSMike Gerdts *
134*35786f68SRobert Mustacchi * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135*35786f68SRobert Mustacchi * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136*35786f68SRobert Mustacchi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137*35786f68SRobert Mustacchi * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138*35786f68SRobert Mustacchi * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139*35786f68SRobert Mustacchi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140*35786f68SRobert Mustacchi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141*35786f68SRobert Mustacchi * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142*35786f68SRobert Mustacchi * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143*35786f68SRobert Mustacchi * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144*35786f68SRobert Mustacchi * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145*35786f68SRobert Mustacchi *
146*35786f68SRobert Mustacchi * Alternatively, you may choose to be licensed under the terms of the
147bc36eafdSMike Gerdts * GNU General Public License ("GPL") version 2 as published by the Free
148bc36eafdSMike Gerdts * Software Foundation.
149bc36eafdSMike Gerdts *
150*35786f68SRobert Mustacchi *****************************************************************************/
151bc36eafdSMike Gerdts
152bc36eafdSMike Gerdts #include "acpi.h"
153bc36eafdSMike Gerdts #include "accommon.h"
154bc36eafdSMike Gerdts #include "acdisasm.h"
155bc36eafdSMike Gerdts
156bc36eafdSMike Gerdts
157bc36eafdSMike Gerdts #define _COMPONENT ACPI_CA_DEBUGGER
158bc36eafdSMike Gerdts ACPI_MODULE_NAME ("dbresrcl2")
159bc36eafdSMike Gerdts
160bc36eafdSMike Gerdts /* Local prototypes */
161bc36eafdSMike Gerdts
162bc36eafdSMike Gerdts static void
163bc36eafdSMike Gerdts AcpiDmI2cSerialBusDescriptor (
164bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
165bc36eafdSMike Gerdts AML_RESOURCE *Resource,
166bc36eafdSMike Gerdts UINT32 Length,
167bc36eafdSMike Gerdts UINT32 Level);
168bc36eafdSMike Gerdts
169bc36eafdSMike Gerdts static void
170bc36eafdSMike Gerdts AcpiDmSpiSerialBusDescriptor (
171bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
172bc36eafdSMike Gerdts AML_RESOURCE *Resource,
173bc36eafdSMike Gerdts UINT32 Length,
174bc36eafdSMike Gerdts UINT32 Level);
175bc36eafdSMike Gerdts
176bc36eafdSMike Gerdts static void
177bc36eafdSMike Gerdts AcpiDmUartSerialBusDescriptor (
178bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
179bc36eafdSMike Gerdts AML_RESOURCE *Resource,
180bc36eafdSMike Gerdts UINT32 Length,
181bc36eafdSMike Gerdts UINT32 Level);
182bc36eafdSMike Gerdts
183bc36eafdSMike Gerdts static void
184bc36eafdSMike Gerdts AcpiDmGpioCommon (
185bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
186bc36eafdSMike Gerdts AML_RESOURCE *Resource,
187bc36eafdSMike Gerdts UINT32 Level);
188bc36eafdSMike Gerdts
189bc36eafdSMike Gerdts static void
190bc36eafdSMike Gerdts AcpiDmDumpRawDataBuffer (
191bc36eafdSMike Gerdts UINT8 *Buffer,
192bc36eafdSMike Gerdts UINT32 Length,
193bc36eafdSMike Gerdts UINT32 Level);
194bc36eafdSMike Gerdts
195bc36eafdSMike Gerdts
196bc36eafdSMike Gerdts /* Dispatch table for the serial bus descriptors */
197bc36eafdSMike Gerdts
198bc36eafdSMike Gerdts static ACPI_RESOURCE_HANDLER SerialBusResourceDispatch [] =
199bc36eafdSMike Gerdts {
200bc36eafdSMike Gerdts NULL,
201bc36eafdSMike Gerdts AcpiDmI2cSerialBusDescriptor,
202bc36eafdSMike Gerdts AcpiDmSpiSerialBusDescriptor,
203bc36eafdSMike Gerdts AcpiDmUartSerialBusDescriptor
204bc36eafdSMike Gerdts };
205bc36eafdSMike Gerdts
206bc36eafdSMike Gerdts
207bc36eafdSMike Gerdts /*******************************************************************************
208bc36eafdSMike Gerdts *
209bc36eafdSMike Gerdts * FUNCTION: AcpiDmDumpRawDataBuffer
210bc36eafdSMike Gerdts *
211bc36eafdSMike Gerdts * PARAMETERS: Buffer - Pointer to the data bytes
212bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
213bc36eafdSMike Gerdts * Level - Current source code indentation level
214bc36eafdSMike Gerdts *
215bc36eafdSMike Gerdts * RETURN: None
216bc36eafdSMike Gerdts *
217bc36eafdSMike Gerdts * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
218bc36eafdSMike Gerdts * vendor data bytes.
219bc36eafdSMike Gerdts *
220bc36eafdSMike Gerdts ******************************************************************************/
221bc36eafdSMike Gerdts
222bc36eafdSMike Gerdts static void
AcpiDmDumpRawDataBuffer(UINT8 * Buffer,UINT32 Length,UINT32 Level)223bc36eafdSMike Gerdts AcpiDmDumpRawDataBuffer (
224bc36eafdSMike Gerdts UINT8 *Buffer,
225bc36eafdSMike Gerdts UINT32 Length,
226bc36eafdSMike Gerdts UINT32 Level)
227bc36eafdSMike Gerdts {
228bc36eafdSMike Gerdts UINT32 Index;
229bc36eafdSMike Gerdts UINT32 i;
230bc36eafdSMike Gerdts UINT32 j;
231bc36eafdSMike Gerdts
232bc36eafdSMike Gerdts
233bc36eafdSMike Gerdts if (!Length)
234bc36eafdSMike Gerdts {
235bc36eafdSMike Gerdts return;
236bc36eafdSMike Gerdts }
237bc36eafdSMike Gerdts
238bc36eafdSMike Gerdts AcpiOsPrintf ("RawDataBuffer (0x%.2X) // Vendor Data", Length);
239bc36eafdSMike Gerdts
240bc36eafdSMike Gerdts AcpiOsPrintf ("\n");
241bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
242bc36eafdSMike Gerdts AcpiOsPrintf ("{\n");
243bc36eafdSMike Gerdts AcpiDmIndent (Level + 2);
244bc36eafdSMike Gerdts
245bc36eafdSMike Gerdts for (i = 0; i < Length;)
246bc36eafdSMike Gerdts {
247bc36eafdSMike Gerdts for (j = 0; j < 8; j++)
248bc36eafdSMike Gerdts {
249bc36eafdSMike Gerdts Index = i + j;
250bc36eafdSMike Gerdts if (Index >= Length)
251bc36eafdSMike Gerdts {
252bc36eafdSMike Gerdts goto Finish;
253bc36eafdSMike Gerdts }
254bc36eafdSMike Gerdts
255bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
256bc36eafdSMike Gerdts if ((Index + 1) >= Length)
257bc36eafdSMike Gerdts {
258bc36eafdSMike Gerdts goto Finish;
259bc36eafdSMike Gerdts }
260bc36eafdSMike Gerdts
261bc36eafdSMike Gerdts AcpiOsPrintf (", ");
262bc36eafdSMike Gerdts }
263bc36eafdSMike Gerdts
264bc36eafdSMike Gerdts AcpiOsPrintf ("\n");
265bc36eafdSMike Gerdts AcpiDmIndent (Level + 2);
266bc36eafdSMike Gerdts
267bc36eafdSMike Gerdts i += 8;
268bc36eafdSMike Gerdts }
269bc36eafdSMike Gerdts
270bc36eafdSMike Gerdts Finish:
271bc36eafdSMike Gerdts AcpiOsPrintf ("\n");
272bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
273bc36eafdSMike Gerdts AcpiOsPrintf ("}");
274bc36eafdSMike Gerdts }
275bc36eafdSMike Gerdts
276bc36eafdSMike Gerdts
277bc36eafdSMike Gerdts /*******************************************************************************
278bc36eafdSMike Gerdts *
279bc36eafdSMike Gerdts * FUNCTION: AcpiDmGpioCommon
280bc36eafdSMike Gerdts *
281bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
282bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
283bc36eafdSMike Gerdts * Level - Current source code indentation level
284bc36eafdSMike Gerdts *
285bc36eafdSMike Gerdts * RETURN: None
286bc36eafdSMike Gerdts *
287bc36eafdSMike Gerdts * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
288bc36eafdSMike Gerdts *
289bc36eafdSMike Gerdts ******************************************************************************/
290bc36eafdSMike Gerdts
291bc36eafdSMike Gerdts static void
AcpiDmGpioCommon(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Level)292bc36eafdSMike Gerdts AcpiDmGpioCommon (
293bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
294bc36eafdSMike Gerdts AML_RESOURCE *Resource,
295bc36eafdSMike Gerdts UINT32 Level)
296bc36eafdSMike Gerdts {
297bc36eafdSMike Gerdts UINT16 *PinList;
298bc36eafdSMike Gerdts UINT8 *VendorData;
299bc36eafdSMike Gerdts char *DeviceName = NULL;
300bc36eafdSMike Gerdts UINT32 PinCount;
301bc36eafdSMike Gerdts UINT32 i;
302bc36eafdSMike Gerdts
303bc36eafdSMike Gerdts
304bc36eafdSMike Gerdts /* ResourceSource, ResourceSourceIndex, ResourceType */
305bc36eafdSMike Gerdts
306bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
307bc36eafdSMike Gerdts if (Resource->Gpio.ResSourceOffset)
308bc36eafdSMike Gerdts {
309bc36eafdSMike Gerdts DeviceName = ACPI_ADD_PTR (char,
310bc36eafdSMike Gerdts Resource, Resource->Gpio.ResSourceOffset),
311bc36eafdSMike Gerdts AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
312bc36eafdSMike Gerdts }
313bc36eafdSMike Gerdts
314bc36eafdSMike Gerdts AcpiOsPrintf (", ");
315bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
316bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
317bc36eafdSMike Gerdts AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
318bc36eafdSMike Gerdts
319bc36eafdSMike Gerdts /* Insert a descriptor name */
320bc36eafdSMike Gerdts
321bc36eafdSMike Gerdts AcpiDmDescriptorName ();
322bc36eafdSMike Gerdts AcpiOsPrintf (",");
323bc36eafdSMike Gerdts
324bc36eafdSMike Gerdts /* Dump the vendor data */
325bc36eafdSMike Gerdts
326bc36eafdSMike Gerdts if (Resource->Gpio.VendorOffset)
327bc36eafdSMike Gerdts {
328bc36eafdSMike Gerdts AcpiOsPrintf ("\n");
329bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
330bc36eafdSMike Gerdts VendorData = ACPI_ADD_PTR (UINT8, Resource,
331bc36eafdSMike Gerdts Resource->Gpio.VendorOffset);
332bc36eafdSMike Gerdts
333bc36eafdSMike Gerdts AcpiDmDumpRawDataBuffer (VendorData,
334bc36eafdSMike Gerdts Resource->Gpio.VendorLength, Level);
335bc36eafdSMike Gerdts }
336bc36eafdSMike Gerdts
337bc36eafdSMike Gerdts AcpiOsPrintf (")\n");
338bc36eafdSMike Gerdts
339bc36eafdSMike Gerdts /* Dump the interrupt list */
340bc36eafdSMike Gerdts
341bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
342bc36eafdSMike Gerdts AcpiOsPrintf ("{ // Pin list\n");
343bc36eafdSMike Gerdts
344bc36eafdSMike Gerdts PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
345bc36eafdSMike Gerdts Resource->Gpio.PinTableOffset)) /
346bc36eafdSMike Gerdts sizeof (UINT16);
347bc36eafdSMike Gerdts
348bc36eafdSMike Gerdts PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
349bc36eafdSMike Gerdts Resource->Gpio.PinTableOffset);
350bc36eafdSMike Gerdts
351bc36eafdSMike Gerdts for (i = 0; i < PinCount; i++)
352bc36eafdSMike Gerdts {
353bc36eafdSMike Gerdts AcpiDmIndent (Level + 2);
354bc36eafdSMike Gerdts AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
355bc36eafdSMike Gerdts ((i + 1) < PinCount) ? "," : "");
356bc36eafdSMike Gerdts }
357bc36eafdSMike Gerdts
358bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
359bc36eafdSMike Gerdts AcpiOsPrintf ("}\n");
360bc36eafdSMike Gerdts
361bc36eafdSMike Gerdts #ifdef ACPI_APPLICATION
362bc36eafdSMike Gerdts MpSaveGpioInfo (Info->MappingOp, Resource,
363bc36eafdSMike Gerdts PinCount, PinList, DeviceName);
364bc36eafdSMike Gerdts #endif
365bc36eafdSMike Gerdts }
366bc36eafdSMike Gerdts
367bc36eafdSMike Gerdts
368bc36eafdSMike Gerdts /*******************************************************************************
369bc36eafdSMike Gerdts *
370bc36eafdSMike Gerdts * FUNCTION: AcpiDmGpioIntDescriptor
371bc36eafdSMike Gerdts *
372bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
373bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
374bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
375bc36eafdSMike Gerdts * Level - Current source code indentation level
376bc36eafdSMike Gerdts *
377bc36eafdSMike Gerdts * RETURN: None
378bc36eafdSMike Gerdts *
379bc36eafdSMike Gerdts * DESCRIPTION: Decode a GPIO Interrupt descriptor
380bc36eafdSMike Gerdts *
381bc36eafdSMike Gerdts ******************************************************************************/
382bc36eafdSMike Gerdts
383bc36eafdSMike Gerdts static void
AcpiDmGpioIntDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)384bc36eafdSMike Gerdts AcpiDmGpioIntDescriptor (
385bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
386bc36eafdSMike Gerdts AML_RESOURCE *Resource,
387bc36eafdSMike Gerdts UINT32 Length,
388bc36eafdSMike Gerdts UINT32 Level)
389bc36eafdSMike Gerdts {
390bc36eafdSMike Gerdts
391bc36eafdSMike Gerdts /* Dump the GpioInt-specific portion of the descriptor */
392bc36eafdSMike Gerdts
393bc36eafdSMike Gerdts /* EdgeLevel, ActiveLevel, Shared */
394bc36eafdSMike Gerdts
395bc36eafdSMike Gerdts AcpiDmIndent (Level);
396bc36eafdSMike Gerdts AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
397bc36eafdSMike Gerdts AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
398bc36eafdSMike Gerdts AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
399bc36eafdSMike Gerdts AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
400bc36eafdSMike Gerdts
401bc36eafdSMike Gerdts /* PinConfig, DebounceTimeout */
402bc36eafdSMike Gerdts
403bc36eafdSMike Gerdts if (Resource->Gpio.PinConfig <= 3)
404bc36eafdSMike Gerdts {
405bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
406bc36eafdSMike Gerdts AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
407bc36eafdSMike Gerdts }
408bc36eafdSMike Gerdts else
409bc36eafdSMike Gerdts {
410bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
411bc36eafdSMike Gerdts }
412bc36eafdSMike Gerdts AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
413bc36eafdSMike Gerdts
414bc36eafdSMike Gerdts /* Dump the GpioInt/GpioIo common portion of the descriptor */
415bc36eafdSMike Gerdts
416bc36eafdSMike Gerdts AcpiDmGpioCommon (Info, Resource, Level);
417bc36eafdSMike Gerdts }
418bc36eafdSMike Gerdts
419bc36eafdSMike Gerdts
420bc36eafdSMike Gerdts /*******************************************************************************
421bc36eafdSMike Gerdts *
422bc36eafdSMike Gerdts * FUNCTION: AcpiDmGpioIoDescriptor
423bc36eafdSMike Gerdts *
424bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
425bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
426bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
427bc36eafdSMike Gerdts * Level - Current source code indentation level
428bc36eafdSMike Gerdts *
429bc36eafdSMike Gerdts * RETURN: None
430bc36eafdSMike Gerdts *
431bc36eafdSMike Gerdts * DESCRIPTION: Decode a GPIO I/O descriptor
432bc36eafdSMike Gerdts *
433bc36eafdSMike Gerdts ******************************************************************************/
434bc36eafdSMike Gerdts
435bc36eafdSMike Gerdts static void
AcpiDmGpioIoDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)436bc36eafdSMike Gerdts AcpiDmGpioIoDescriptor (
437bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
438bc36eafdSMike Gerdts AML_RESOURCE *Resource,
439bc36eafdSMike Gerdts UINT32 Length,
440bc36eafdSMike Gerdts UINT32 Level)
441bc36eafdSMike Gerdts {
442bc36eafdSMike Gerdts
443bc36eafdSMike Gerdts /* Dump the GpioIo-specific portion of the descriptor */
444bc36eafdSMike Gerdts
445bc36eafdSMike Gerdts /* Shared, PinConfig */
446bc36eafdSMike Gerdts
447bc36eafdSMike Gerdts AcpiDmIndent (Level);
448bc36eafdSMike Gerdts AcpiOsPrintf ("GpioIo (%s, ",
449bc36eafdSMike Gerdts AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
450bc36eafdSMike Gerdts
451bc36eafdSMike Gerdts if (Resource->Gpio.PinConfig <= 3)
452bc36eafdSMike Gerdts {
453bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
454bc36eafdSMike Gerdts AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
455bc36eafdSMike Gerdts }
456bc36eafdSMike Gerdts else
457bc36eafdSMike Gerdts {
458bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
459bc36eafdSMike Gerdts }
460bc36eafdSMike Gerdts
461bc36eafdSMike Gerdts /* DebounceTimeout, DriveStrength, IoRestriction */
462bc36eafdSMike Gerdts
463bc36eafdSMike Gerdts AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
464bc36eafdSMike Gerdts AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
465bc36eafdSMike Gerdts AcpiOsPrintf ("%s,\n",
466bc36eafdSMike Gerdts AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
467bc36eafdSMike Gerdts
468bc36eafdSMike Gerdts /* Dump the GpioInt/GpioIo common portion of the descriptor */
469bc36eafdSMike Gerdts
470bc36eafdSMike Gerdts AcpiDmGpioCommon (Info, Resource, Level);
471bc36eafdSMike Gerdts }
472bc36eafdSMike Gerdts
473bc36eafdSMike Gerdts
474bc36eafdSMike Gerdts /*******************************************************************************
475bc36eafdSMike Gerdts *
476bc36eafdSMike Gerdts * FUNCTION: AcpiDmGpioDescriptor
477bc36eafdSMike Gerdts *
478bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
479bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
480bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
481bc36eafdSMike Gerdts * Level - Current source code indentation level
482bc36eafdSMike Gerdts *
483bc36eafdSMike Gerdts * RETURN: None
484bc36eafdSMike Gerdts *
485bc36eafdSMike Gerdts * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor
486bc36eafdSMike Gerdts *
487bc36eafdSMike Gerdts ******************************************************************************/
488bc36eafdSMike Gerdts
489bc36eafdSMike Gerdts void
AcpiDmGpioDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)490bc36eafdSMike Gerdts AcpiDmGpioDescriptor (
491bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
492bc36eafdSMike Gerdts AML_RESOURCE *Resource,
493bc36eafdSMike Gerdts UINT32 Length,
494bc36eafdSMike Gerdts UINT32 Level)
495bc36eafdSMike Gerdts {
496bc36eafdSMike Gerdts UINT8 ConnectionType;
497bc36eafdSMike Gerdts
498bc36eafdSMike Gerdts
499bc36eafdSMike Gerdts ConnectionType = Resource->Gpio.ConnectionType;
500bc36eafdSMike Gerdts
501bc36eafdSMike Gerdts switch (ConnectionType)
502bc36eafdSMike Gerdts {
503bc36eafdSMike Gerdts case AML_RESOURCE_GPIO_TYPE_INT:
504bc36eafdSMike Gerdts
505bc36eafdSMike Gerdts AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
506bc36eafdSMike Gerdts break;
507bc36eafdSMike Gerdts
508bc36eafdSMike Gerdts case AML_RESOURCE_GPIO_TYPE_IO:
509bc36eafdSMike Gerdts
510bc36eafdSMike Gerdts AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
511bc36eafdSMike Gerdts break;
512bc36eafdSMike Gerdts
513bc36eafdSMike Gerdts default:
514bc36eafdSMike Gerdts
515bc36eafdSMike Gerdts AcpiOsPrintf ("Unknown GPIO type\n");
516bc36eafdSMike Gerdts break;
517bc36eafdSMike Gerdts }
518bc36eafdSMike Gerdts }
519bc36eafdSMike Gerdts
520*35786f68SRobert Mustacchi /*******************************************************************************
521*35786f68SRobert Mustacchi *
522*35786f68SRobert Mustacchi * FUNCTION: AcpiDmPinFunctionDescriptor
523*35786f68SRobert Mustacchi *
524*35786f68SRobert Mustacchi * PARAMETERS: Info - Extra resource info
525*35786f68SRobert Mustacchi * Resource - Pointer to the resource descriptor
526*35786f68SRobert Mustacchi * Length - Length of the descriptor in bytes
527*35786f68SRobert Mustacchi * Level - Current source code indentation level
528*35786f68SRobert Mustacchi *
529*35786f68SRobert Mustacchi * RETURN: None
530*35786f68SRobert Mustacchi *
531*35786f68SRobert Mustacchi * DESCRIPTION: Decode a PinFunction descriptor
532*35786f68SRobert Mustacchi *
533*35786f68SRobert Mustacchi ******************************************************************************/
534*35786f68SRobert Mustacchi
535*35786f68SRobert Mustacchi void
AcpiDmPinFunctionDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)536*35786f68SRobert Mustacchi AcpiDmPinFunctionDescriptor (
537*35786f68SRobert Mustacchi ACPI_OP_WALK_INFO *Info,
538*35786f68SRobert Mustacchi AML_RESOURCE *Resource,
539*35786f68SRobert Mustacchi UINT32 Length,
540*35786f68SRobert Mustacchi UINT32 Level)
541*35786f68SRobert Mustacchi {
542*35786f68SRobert Mustacchi UINT16 *PinList;
543*35786f68SRobert Mustacchi UINT8 *VendorData;
544*35786f68SRobert Mustacchi char *DeviceName = NULL;
545*35786f68SRobert Mustacchi UINT32 PinCount;
546*35786f68SRobert Mustacchi UINT32 i;
547*35786f68SRobert Mustacchi
548*35786f68SRobert Mustacchi AcpiDmIndent (Level);
549*35786f68SRobert Mustacchi AcpiOsPrintf ("PinFunction (%s, ",
550*35786f68SRobert Mustacchi AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]);
551*35786f68SRobert Mustacchi
552*35786f68SRobert Mustacchi if (Resource->PinFunction.PinConfig <= 3)
553*35786f68SRobert Mustacchi {
554*35786f68SRobert Mustacchi AcpiOsPrintf ("%s, ",
555*35786f68SRobert Mustacchi AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]);
556*35786f68SRobert Mustacchi }
557*35786f68SRobert Mustacchi else
558*35786f68SRobert Mustacchi {
559*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig);
560*35786f68SRobert Mustacchi }
561*35786f68SRobert Mustacchi
562*35786f68SRobert Mustacchi /* FunctionNumber */
563*35786f68SRobert Mustacchi
564*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
565*35786f68SRobert Mustacchi
566*35786f68SRobert Mustacchi if (Resource->PinFunction.ResSourceOffset)
567*35786f68SRobert Mustacchi {
568*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char,
569*35786f68SRobert Mustacchi Resource, Resource->PinFunction.ResSourceOffset),
570*35786f68SRobert Mustacchi AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
571*35786f68SRobert Mustacchi }
572*35786f68SRobert Mustacchi
573*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
574*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex);
575*35786f68SRobert Mustacchi
576*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
577*35786f68SRobert Mustacchi
578*35786f68SRobert Mustacchi /* Always ResourceConsumer */
579*35786f68SRobert Mustacchi AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]);
580*35786f68SRobert Mustacchi
581*35786f68SRobert Mustacchi /* Insert a descriptor name */
582*35786f68SRobert Mustacchi
583*35786f68SRobert Mustacchi AcpiDmDescriptorName ();
584*35786f68SRobert Mustacchi
585*35786f68SRobert Mustacchi AcpiOsPrintf (",");
586*35786f68SRobert Mustacchi
587*35786f68SRobert Mustacchi /* Dump the vendor data */
588*35786f68SRobert Mustacchi
589*35786f68SRobert Mustacchi if (Resource->PinFunction.VendorLength)
590*35786f68SRobert Mustacchi {
591*35786f68SRobert Mustacchi AcpiOsPrintf ("\n");
592*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
593*35786f68SRobert Mustacchi VendorData = ACPI_ADD_PTR (UINT8, Resource,
594*35786f68SRobert Mustacchi Resource->PinFunction.VendorOffset);
595*35786f68SRobert Mustacchi
596*35786f68SRobert Mustacchi AcpiDmDumpRawDataBuffer (VendorData,
597*35786f68SRobert Mustacchi Resource->PinFunction.VendorLength, Level);
598*35786f68SRobert Mustacchi }
599*35786f68SRobert Mustacchi
600*35786f68SRobert Mustacchi AcpiOsPrintf (")\n");
601*35786f68SRobert Mustacchi
602*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
603*35786f68SRobert Mustacchi
604*35786f68SRobert Mustacchi /* Dump the interrupt list */
605*35786f68SRobert Mustacchi
606*35786f68SRobert Mustacchi AcpiOsPrintf ("{ // Pin list\n");
607*35786f68SRobert Mustacchi
608*35786f68SRobert Mustacchi PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
609*35786f68SRobert Mustacchi Resource->PinFunction.PinTableOffset)) /
610*35786f68SRobert Mustacchi sizeof (UINT16);
611*35786f68SRobert Mustacchi
612*35786f68SRobert Mustacchi PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
613*35786f68SRobert Mustacchi Resource->PinFunction.PinTableOffset);
614*35786f68SRobert Mustacchi
615*35786f68SRobert Mustacchi for (i = 0; i < PinCount; i++)
616*35786f68SRobert Mustacchi {
617*35786f68SRobert Mustacchi AcpiDmIndent (Level + 2);
618*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
619*35786f68SRobert Mustacchi ((i + 1) < PinCount) ? "," : "");
620*35786f68SRobert Mustacchi }
621*35786f68SRobert Mustacchi
622*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
623*35786f68SRobert Mustacchi AcpiOsPrintf ("}\n");
624*35786f68SRobert Mustacchi }
625*35786f68SRobert Mustacchi
626bc36eafdSMike Gerdts
627bc36eafdSMike Gerdts /*******************************************************************************
628bc36eafdSMike Gerdts *
629bc36eafdSMike Gerdts * FUNCTION: AcpiDmDumpSerialBusVendorData
630bc36eafdSMike Gerdts *
631bc36eafdSMike Gerdts * PARAMETERS: Resource - Pointer to the resource descriptor
632bc36eafdSMike Gerdts *
633bc36eafdSMike Gerdts * RETURN: None
634bc36eafdSMike Gerdts *
635bc36eafdSMike Gerdts * DESCRIPTION: Dump optional serial bus vendor data
636bc36eafdSMike Gerdts *
637bc36eafdSMike Gerdts ******************************************************************************/
638bc36eafdSMike Gerdts
639bc36eafdSMike Gerdts static void
AcpiDmDumpSerialBusVendorData(AML_RESOURCE * Resource,UINT32 Level)640bc36eafdSMike Gerdts AcpiDmDumpSerialBusVendorData (
641bc36eafdSMike Gerdts AML_RESOURCE *Resource,
642bc36eafdSMike Gerdts UINT32 Level)
643bc36eafdSMike Gerdts {
644bc36eafdSMike Gerdts UINT8 *VendorData;
645bc36eafdSMike Gerdts UINT32 VendorLength;
646bc36eafdSMike Gerdts
647bc36eafdSMike Gerdts
648bc36eafdSMike Gerdts /* Get the (optional) vendor data and length */
649bc36eafdSMike Gerdts
650bc36eafdSMike Gerdts switch (Resource->CommonSerialBus.Type)
651bc36eafdSMike Gerdts {
652bc36eafdSMike Gerdts case AML_RESOURCE_I2C_SERIALBUSTYPE:
653bc36eafdSMike Gerdts
654bc36eafdSMike Gerdts VendorLength = Resource->CommonSerialBus.TypeDataLength -
655bc36eafdSMike Gerdts AML_RESOURCE_I2C_MIN_DATA_LEN;
656bc36eafdSMike Gerdts
657bc36eafdSMike Gerdts VendorData = ACPI_ADD_PTR (UINT8, Resource,
658bc36eafdSMike Gerdts sizeof (AML_RESOURCE_I2C_SERIALBUS));
659bc36eafdSMike Gerdts break;
660bc36eafdSMike Gerdts
661bc36eafdSMike Gerdts case AML_RESOURCE_SPI_SERIALBUSTYPE:
662bc36eafdSMike Gerdts
663bc36eafdSMike Gerdts VendorLength = Resource->CommonSerialBus.TypeDataLength -
664bc36eafdSMike Gerdts AML_RESOURCE_SPI_MIN_DATA_LEN;
665bc36eafdSMike Gerdts
666bc36eafdSMike Gerdts VendorData = ACPI_ADD_PTR (UINT8, Resource,
667bc36eafdSMike Gerdts sizeof (AML_RESOURCE_SPI_SERIALBUS));
668bc36eafdSMike Gerdts break;
669bc36eafdSMike Gerdts
670bc36eafdSMike Gerdts case AML_RESOURCE_UART_SERIALBUSTYPE:
671bc36eafdSMike Gerdts
672bc36eafdSMike Gerdts VendorLength = Resource->CommonSerialBus.TypeDataLength -
673bc36eafdSMike Gerdts AML_RESOURCE_UART_MIN_DATA_LEN;
674bc36eafdSMike Gerdts
675bc36eafdSMike Gerdts VendorData = ACPI_ADD_PTR (UINT8, Resource,
676bc36eafdSMike Gerdts sizeof (AML_RESOURCE_UART_SERIALBUS));
677bc36eafdSMike Gerdts break;
678bc36eafdSMike Gerdts
679bc36eafdSMike Gerdts default:
680bc36eafdSMike Gerdts
681bc36eafdSMike Gerdts return;
682bc36eafdSMike Gerdts }
683bc36eafdSMike Gerdts
684bc36eafdSMike Gerdts /* Dump the vendor bytes as a RawDataBuffer object */
685bc36eafdSMike Gerdts
686bc36eafdSMike Gerdts AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
687bc36eafdSMike Gerdts }
688bc36eafdSMike Gerdts
689bc36eafdSMike Gerdts
690bc36eafdSMike Gerdts /*******************************************************************************
691bc36eafdSMike Gerdts *
692bc36eafdSMike Gerdts * FUNCTION: AcpiDmI2cSerialBusDescriptor
693bc36eafdSMike Gerdts *
694bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
695bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
696bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
697bc36eafdSMike Gerdts * Level - Current source code indentation level
698bc36eafdSMike Gerdts *
699bc36eafdSMike Gerdts * RETURN: None
700bc36eafdSMike Gerdts *
701bc36eafdSMike Gerdts * DESCRIPTION: Decode a I2C serial bus descriptor
702bc36eafdSMike Gerdts *
703bc36eafdSMike Gerdts ******************************************************************************/
704bc36eafdSMike Gerdts
705bc36eafdSMike Gerdts static void
AcpiDmI2cSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)706bc36eafdSMike Gerdts AcpiDmI2cSerialBusDescriptor (
707bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
708bc36eafdSMike Gerdts AML_RESOURCE *Resource,
709bc36eafdSMike Gerdts UINT32 Length,
710bc36eafdSMike Gerdts UINT32 Level)
711bc36eafdSMike Gerdts {
712bc36eafdSMike Gerdts UINT32 ResourceSourceOffset;
713bc36eafdSMike Gerdts char *DeviceName;
714bc36eafdSMike Gerdts
715bc36eafdSMike Gerdts
716bc36eafdSMike Gerdts /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
717bc36eafdSMike Gerdts
718bc36eafdSMike Gerdts AcpiDmIndent (Level);
719bc36eafdSMike Gerdts AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
720bc36eafdSMike Gerdts Resource->I2cSerialBus.SlaveAddress,
721bc36eafdSMike Gerdts AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
722bc36eafdSMike Gerdts Resource->I2cSerialBus.ConnectionSpeed);
723bc36eafdSMike Gerdts
724bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
725bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
726bc36eafdSMike Gerdts AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
727bc36eafdSMike Gerdts
728bc36eafdSMike Gerdts /* ResourceSource is a required field */
729bc36eafdSMike Gerdts
730bc36eafdSMike Gerdts ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
731bc36eafdSMike Gerdts Resource->CommonSerialBus.TypeDataLength;
732bc36eafdSMike Gerdts
733*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
734bc36eafdSMike Gerdts AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
735bc36eafdSMike Gerdts
736bc36eafdSMike Gerdts /* ResourceSourceIndex, ResourceUsage */
737bc36eafdSMike Gerdts
738bc36eafdSMike Gerdts AcpiOsPrintf (",\n");
739bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
740bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
741bc36eafdSMike Gerdts
742bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
743bc36eafdSMike Gerdts AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
744bc36eafdSMike Gerdts
745bc36eafdSMike Gerdts /* Insert a descriptor name */
746bc36eafdSMike Gerdts
747bc36eafdSMike Gerdts AcpiDmDescriptorName ();
748bc36eafdSMike Gerdts
749bc36eafdSMike Gerdts /* Share */
750bc36eafdSMike Gerdts
751bc36eafdSMike Gerdts AcpiOsPrintf (", %s,\n",
752bc36eafdSMike Gerdts AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 2)]);
753bc36eafdSMike Gerdts
754bc36eafdSMike Gerdts /* Dump the vendor data */
755bc36eafdSMike Gerdts
756bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
757bc36eafdSMike Gerdts AcpiDmDumpSerialBusVendorData (Resource, Level);
758bc36eafdSMike Gerdts AcpiOsPrintf (")\n");
759bc36eafdSMike Gerdts
760bc36eafdSMike Gerdts #ifdef ACPI_APPLICATION
761bc36eafdSMike Gerdts MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
762bc36eafdSMike Gerdts #endif
763bc36eafdSMike Gerdts }
764bc36eafdSMike Gerdts
765bc36eafdSMike Gerdts
766bc36eafdSMike Gerdts /*******************************************************************************
767bc36eafdSMike Gerdts *
768bc36eafdSMike Gerdts * FUNCTION: AcpiDmSpiSerialBusDescriptor
769bc36eafdSMike Gerdts *
770bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
771bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
772bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
773bc36eafdSMike Gerdts * Level - Current source code indentation level
774bc36eafdSMike Gerdts *
775bc36eafdSMike Gerdts * RETURN: None
776bc36eafdSMike Gerdts *
777bc36eafdSMike Gerdts * DESCRIPTION: Decode a SPI serial bus descriptor
778bc36eafdSMike Gerdts *
779bc36eafdSMike Gerdts ******************************************************************************/
780bc36eafdSMike Gerdts
781bc36eafdSMike Gerdts static void
AcpiDmSpiSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)782bc36eafdSMike Gerdts AcpiDmSpiSerialBusDescriptor (
783bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
784bc36eafdSMike Gerdts AML_RESOURCE *Resource,
785bc36eafdSMike Gerdts UINT32 Length,
786bc36eafdSMike Gerdts UINT32 Level)
787bc36eafdSMike Gerdts {
788bc36eafdSMike Gerdts UINT32 ResourceSourceOffset;
789bc36eafdSMike Gerdts char *DeviceName;
790bc36eafdSMike Gerdts
791bc36eafdSMike Gerdts
792bc36eafdSMike Gerdts /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
793bc36eafdSMike Gerdts
794bc36eafdSMike Gerdts AcpiDmIndent (Level);
795bc36eafdSMike Gerdts AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n",
796bc36eafdSMike Gerdts Resource->SpiSerialBus.DeviceSelection,
797bc36eafdSMike Gerdts AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
798bc36eafdSMike Gerdts AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
799bc36eafdSMike Gerdts Resource->SpiSerialBus.DataBitLength);
800bc36eafdSMike Gerdts
801bc36eafdSMike Gerdts /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
802bc36eafdSMike Gerdts
803bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
804bc36eafdSMike Gerdts AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
805bc36eafdSMike Gerdts AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
806bc36eafdSMike Gerdts Resource->SpiSerialBus.ConnectionSpeed,
807bc36eafdSMike Gerdts AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
808bc36eafdSMike Gerdts
809bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
810bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
811bc36eafdSMike Gerdts AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
812bc36eafdSMike Gerdts
813bc36eafdSMike Gerdts /* ResourceSource is a required field */
814bc36eafdSMike Gerdts
815bc36eafdSMike Gerdts ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
816bc36eafdSMike Gerdts Resource->CommonSerialBus.TypeDataLength;
817bc36eafdSMike Gerdts
818*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
819bc36eafdSMike Gerdts AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
820bc36eafdSMike Gerdts
821bc36eafdSMike Gerdts /* ResourceSourceIndex, ResourceUsage */
822bc36eafdSMike Gerdts
823bc36eafdSMike Gerdts AcpiOsPrintf (",\n");
824bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
825bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
826bc36eafdSMike Gerdts
827bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
828bc36eafdSMike Gerdts AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
829bc36eafdSMike Gerdts
830bc36eafdSMike Gerdts /* Insert a descriptor name */
831bc36eafdSMike Gerdts
832bc36eafdSMike Gerdts AcpiDmDescriptorName ();
833bc36eafdSMike Gerdts
834bc36eafdSMike Gerdts /* Share */
835bc36eafdSMike Gerdts
836bc36eafdSMike Gerdts AcpiOsPrintf (", %s,\n",
837bc36eafdSMike Gerdts AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 2)]);
838bc36eafdSMike Gerdts
839bc36eafdSMike Gerdts /* Dump the vendor data */
840bc36eafdSMike Gerdts
841bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
842bc36eafdSMike Gerdts AcpiDmDumpSerialBusVendorData (Resource, Level);
843bc36eafdSMike Gerdts AcpiOsPrintf (")\n");
844bc36eafdSMike Gerdts
845bc36eafdSMike Gerdts #ifdef ACPI_APPLICATION
846bc36eafdSMike Gerdts MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
847bc36eafdSMike Gerdts #endif
848bc36eafdSMike Gerdts }
849bc36eafdSMike Gerdts
850bc36eafdSMike Gerdts
851bc36eafdSMike Gerdts /*******************************************************************************
852bc36eafdSMike Gerdts *
853bc36eafdSMike Gerdts * FUNCTION: AcpiDmUartSerialBusDescriptor
854bc36eafdSMike Gerdts *
855bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
856bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
857bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
858bc36eafdSMike Gerdts * Level - Current source code indentation level
859bc36eafdSMike Gerdts *
860bc36eafdSMike Gerdts * RETURN: None
861bc36eafdSMike Gerdts *
862bc36eafdSMike Gerdts * DESCRIPTION: Decode a UART serial bus descriptor
863bc36eafdSMike Gerdts *
864bc36eafdSMike Gerdts ******************************************************************************/
865bc36eafdSMike Gerdts
866bc36eafdSMike Gerdts static void
AcpiDmUartSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)867bc36eafdSMike Gerdts AcpiDmUartSerialBusDescriptor (
868bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
869bc36eafdSMike Gerdts AML_RESOURCE *Resource,
870bc36eafdSMike Gerdts UINT32 Length,
871bc36eafdSMike Gerdts UINT32 Level)
872bc36eafdSMike Gerdts {
873bc36eafdSMike Gerdts UINT32 ResourceSourceOffset;
874bc36eafdSMike Gerdts char *DeviceName;
875bc36eafdSMike Gerdts
876bc36eafdSMike Gerdts
877bc36eafdSMike Gerdts /* ConnectionSpeed, BitsPerByte, StopBits */
878bc36eafdSMike Gerdts
879bc36eafdSMike Gerdts AcpiDmIndent (Level);
880bc36eafdSMike Gerdts AcpiOsPrintf ("UartSerialBusV2 (0x%8.8X, %s, %s,\n",
881bc36eafdSMike Gerdts Resource->UartSerialBus.DefaultBaudRate,
882bc36eafdSMike Gerdts AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
883bc36eafdSMike Gerdts AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
884bc36eafdSMike Gerdts
885bc36eafdSMike Gerdts /* LinesInUse, IsBigEndian, Parity, FlowControl */
886bc36eafdSMike Gerdts
887bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
888bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
889bc36eafdSMike Gerdts Resource->UartSerialBus.LinesEnabled,
890bc36eafdSMike Gerdts AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
891bc36eafdSMike Gerdts AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
892bc36eafdSMike Gerdts AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
893bc36eafdSMike Gerdts
894bc36eafdSMike Gerdts /* ReceiveBufferSize, TransmitBufferSize */
895bc36eafdSMike Gerdts
896bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
897bc36eafdSMike Gerdts AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
898bc36eafdSMike Gerdts Resource->UartSerialBus.RxFifoSize,
899bc36eafdSMike Gerdts Resource->UartSerialBus.TxFifoSize);
900bc36eafdSMike Gerdts
901bc36eafdSMike Gerdts /* ResourceSource is a required field */
902bc36eafdSMike Gerdts
903bc36eafdSMike Gerdts ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
904bc36eafdSMike Gerdts Resource->CommonSerialBus.TypeDataLength;
905bc36eafdSMike Gerdts
906*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
907bc36eafdSMike Gerdts AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
908bc36eafdSMike Gerdts
909bc36eafdSMike Gerdts /* ResourceSourceIndex, ResourceUsage */
910bc36eafdSMike Gerdts
911bc36eafdSMike Gerdts AcpiOsPrintf (",\n");
912bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
913bc36eafdSMike Gerdts AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
914bc36eafdSMike Gerdts
915bc36eafdSMike Gerdts AcpiOsPrintf ("%s, ",
916bc36eafdSMike Gerdts AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
917bc36eafdSMike Gerdts
918bc36eafdSMike Gerdts /* Insert a descriptor name */
919bc36eafdSMike Gerdts
920bc36eafdSMike Gerdts AcpiDmDescriptorName ();
921bc36eafdSMike Gerdts
922bc36eafdSMike Gerdts /* Share */
923bc36eafdSMike Gerdts
924bc36eafdSMike Gerdts AcpiOsPrintf (", %s,\n",
925bc36eafdSMike Gerdts AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 2)]);
926bc36eafdSMike Gerdts
927bc36eafdSMike Gerdts /* Dump the vendor data */
928bc36eafdSMike Gerdts
929bc36eafdSMike Gerdts AcpiDmIndent (Level + 1);
930bc36eafdSMike Gerdts AcpiDmDumpSerialBusVendorData (Resource, Level);
931bc36eafdSMike Gerdts AcpiOsPrintf (")\n");
932bc36eafdSMike Gerdts
933bc36eafdSMike Gerdts #ifdef ACPI_APPLICATION
934bc36eafdSMike Gerdts MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
935bc36eafdSMike Gerdts #endif
936bc36eafdSMike Gerdts }
937bc36eafdSMike Gerdts
938bc36eafdSMike Gerdts
939bc36eafdSMike Gerdts /*******************************************************************************
940bc36eafdSMike Gerdts *
941bc36eafdSMike Gerdts * FUNCTION: AcpiDmSerialBusDescriptor
942bc36eafdSMike Gerdts *
943bc36eafdSMike Gerdts * PARAMETERS: Info - Extra resource info
944bc36eafdSMike Gerdts * Resource - Pointer to the resource descriptor
945bc36eafdSMike Gerdts * Length - Length of the descriptor in bytes
946bc36eafdSMike Gerdts * Level - Current source code indentation level
947bc36eafdSMike Gerdts *
948bc36eafdSMike Gerdts * RETURN: None
949bc36eafdSMike Gerdts *
950bc36eafdSMike Gerdts * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
951bc36eafdSMike Gerdts *
952bc36eafdSMike Gerdts ******************************************************************************/
953bc36eafdSMike Gerdts
954bc36eafdSMike Gerdts void
AcpiDmSerialBusDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)955bc36eafdSMike Gerdts AcpiDmSerialBusDescriptor (
956bc36eafdSMike Gerdts ACPI_OP_WALK_INFO *Info,
957bc36eafdSMike Gerdts AML_RESOURCE *Resource,
958bc36eafdSMike Gerdts UINT32 Length,
959bc36eafdSMike Gerdts UINT32 Level)
960bc36eafdSMike Gerdts {
961bc36eafdSMike Gerdts
962bc36eafdSMike Gerdts SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
963bc36eafdSMike Gerdts Info, Resource, Length, Level);
964bc36eafdSMike Gerdts }
965*35786f68SRobert Mustacchi
966*35786f68SRobert Mustacchi /*******************************************************************************
967*35786f68SRobert Mustacchi *
968*35786f68SRobert Mustacchi * FUNCTION: AcpiDmPinConfig
969*35786f68SRobert Mustacchi *
970*35786f68SRobert Mustacchi * PARAMETERS: PinConfigType - Pin configuration type
971*35786f68SRobert Mustacchi * PinConfigValue - Pin configuration value
972*35786f68SRobert Mustacchi *
973*35786f68SRobert Mustacchi * RETURN: None
974*35786f68SRobert Mustacchi *
975*35786f68SRobert Mustacchi * DESCRIPTION: Pretty prints PinConfig type and value.
976*35786f68SRobert Mustacchi *
977*35786f68SRobert Mustacchi ******************************************************************************/
978*35786f68SRobert Mustacchi
979*35786f68SRobert Mustacchi static void
AcpiDmPinConfig(UINT8 PinConfigType,UINT32 PinConfigValue)980*35786f68SRobert Mustacchi AcpiDmPinConfig(
981*35786f68SRobert Mustacchi UINT8 PinConfigType,
982*35786f68SRobert Mustacchi UINT32 PinConfigValue)
983*35786f68SRobert Mustacchi {
984*35786f68SRobert Mustacchi if (PinConfigType <= 13)
985*35786f68SRobert Mustacchi {
986*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType,
987*35786f68SRobert Mustacchi AcpiGbl_PtypDecode[PinConfigType]);
988*35786f68SRobert Mustacchi }
989*35786f68SRobert Mustacchi else
990*35786f68SRobert Mustacchi {
991*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType);
992*35786f68SRobert Mustacchi }
993*35786f68SRobert Mustacchi
994*35786f68SRobert Mustacchi /* PinConfigValue */
995*35786f68SRobert Mustacchi
996*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue);
997*35786f68SRobert Mustacchi }
998*35786f68SRobert Mustacchi
999*35786f68SRobert Mustacchi /*******************************************************************************
1000*35786f68SRobert Mustacchi *
1001*35786f68SRobert Mustacchi * FUNCTION: AcpiDmPinConfigDescriptor
1002*35786f68SRobert Mustacchi *
1003*35786f68SRobert Mustacchi * PARAMETERS: Info - Extra resource info
1004*35786f68SRobert Mustacchi * Resource - Pointer to the resource descriptor
1005*35786f68SRobert Mustacchi * Length - Length of the descriptor in bytes
1006*35786f68SRobert Mustacchi * Level - Current source code indentation level
1007*35786f68SRobert Mustacchi *
1008*35786f68SRobert Mustacchi * RETURN: None
1009*35786f68SRobert Mustacchi *
1010*35786f68SRobert Mustacchi * DESCRIPTION: Decode a PinConfig descriptor
1011*35786f68SRobert Mustacchi *
1012*35786f68SRobert Mustacchi ******************************************************************************/
1013*35786f68SRobert Mustacchi
1014*35786f68SRobert Mustacchi void
AcpiDmPinConfigDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1015*35786f68SRobert Mustacchi AcpiDmPinConfigDescriptor (
1016*35786f68SRobert Mustacchi ACPI_OP_WALK_INFO *Info,
1017*35786f68SRobert Mustacchi AML_RESOURCE *Resource,
1018*35786f68SRobert Mustacchi UINT32 Length,
1019*35786f68SRobert Mustacchi UINT32 Level)
1020*35786f68SRobert Mustacchi {
1021*35786f68SRobert Mustacchi UINT16 *PinList;
1022*35786f68SRobert Mustacchi UINT8 *VendorData;
1023*35786f68SRobert Mustacchi char *DeviceName = NULL;
1024*35786f68SRobert Mustacchi UINT32 PinCount;
1025*35786f68SRobert Mustacchi UINT32 i;
1026*35786f68SRobert Mustacchi
1027*35786f68SRobert Mustacchi AcpiDmIndent (Level);
1028*35786f68SRobert Mustacchi AcpiOsPrintf ("PinConfig (%s, ",
1029*35786f68SRobert Mustacchi AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]);
1030*35786f68SRobert Mustacchi
1031*35786f68SRobert Mustacchi AcpiDmPinConfig (Resource->PinConfig.PinConfigType,
1032*35786f68SRobert Mustacchi Resource->PinConfig.PinConfigValue);
1033*35786f68SRobert Mustacchi
1034*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1035*35786f68SRobert Mustacchi
1036*35786f68SRobert Mustacchi if (Resource->PinConfig.ResSourceOffset)
1037*35786f68SRobert Mustacchi {
1038*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char,
1039*35786f68SRobert Mustacchi Resource, Resource->PinConfig.ResSourceOffset),
1040*35786f68SRobert Mustacchi AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
1041*35786f68SRobert Mustacchi }
1042*35786f68SRobert Mustacchi
1043*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
1044*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex);
1045*35786f68SRobert Mustacchi
1046*35786f68SRobert Mustacchi AcpiOsPrintf ("%s, ",
1047*35786f68SRobert Mustacchi AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]);
1048*35786f68SRobert Mustacchi
1049*35786f68SRobert Mustacchi /* Insert a descriptor name */
1050*35786f68SRobert Mustacchi
1051*35786f68SRobert Mustacchi AcpiDmDescriptorName ();
1052*35786f68SRobert Mustacchi
1053*35786f68SRobert Mustacchi AcpiOsPrintf (",");
1054*35786f68SRobert Mustacchi
1055*35786f68SRobert Mustacchi /* Dump the vendor data */
1056*35786f68SRobert Mustacchi
1057*35786f68SRobert Mustacchi if (Resource->PinConfig.VendorLength)
1058*35786f68SRobert Mustacchi {
1059*35786f68SRobert Mustacchi AcpiOsPrintf ("\n");
1060*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1061*35786f68SRobert Mustacchi VendorData = ACPI_ADD_PTR (UINT8, Resource,
1062*35786f68SRobert Mustacchi Resource->PinConfig.VendorOffset);
1063*35786f68SRobert Mustacchi
1064*35786f68SRobert Mustacchi AcpiDmDumpRawDataBuffer (VendorData,
1065*35786f68SRobert Mustacchi Resource->PinConfig.VendorLength, Level);
1066*35786f68SRobert Mustacchi }
1067*35786f68SRobert Mustacchi
1068*35786f68SRobert Mustacchi AcpiOsPrintf (")\n");
1069*35786f68SRobert Mustacchi
1070*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1071*35786f68SRobert Mustacchi
1072*35786f68SRobert Mustacchi /* Dump the interrupt list */
1073*35786f68SRobert Mustacchi
1074*35786f68SRobert Mustacchi AcpiOsPrintf ("{ // Pin list\n");
1075*35786f68SRobert Mustacchi
1076*35786f68SRobert Mustacchi PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset -
1077*35786f68SRobert Mustacchi Resource->PinConfig.PinTableOffset)) /
1078*35786f68SRobert Mustacchi sizeof (UINT16);
1079*35786f68SRobert Mustacchi
1080*35786f68SRobert Mustacchi PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
1081*35786f68SRobert Mustacchi Resource->PinConfig.PinTableOffset);
1082*35786f68SRobert Mustacchi
1083*35786f68SRobert Mustacchi for (i = 0; i < PinCount; i++)
1084*35786f68SRobert Mustacchi {
1085*35786f68SRobert Mustacchi AcpiDmIndent (Level + 2);
1086*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
1087*35786f68SRobert Mustacchi ((i + 1) < PinCount) ? "," : "");
1088*35786f68SRobert Mustacchi }
1089*35786f68SRobert Mustacchi
1090*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1091*35786f68SRobert Mustacchi AcpiOsPrintf ("}\n");
1092*35786f68SRobert Mustacchi }
1093*35786f68SRobert Mustacchi
1094*35786f68SRobert Mustacchi /*******************************************************************************
1095*35786f68SRobert Mustacchi *
1096*35786f68SRobert Mustacchi * FUNCTION: AcpiDmPinGroupDescriptor
1097*35786f68SRobert Mustacchi *
1098*35786f68SRobert Mustacchi * PARAMETERS: Info - Extra resource info
1099*35786f68SRobert Mustacchi * Resource - Pointer to the resource descriptor
1100*35786f68SRobert Mustacchi * Length - Length of the descriptor in bytes
1101*35786f68SRobert Mustacchi * Level - Current source code indentation level
1102*35786f68SRobert Mustacchi *
1103*35786f68SRobert Mustacchi * RETURN: None
1104*35786f68SRobert Mustacchi *
1105*35786f68SRobert Mustacchi * DESCRIPTION: Decode a PinGroup descriptor
1106*35786f68SRobert Mustacchi *
1107*35786f68SRobert Mustacchi ******************************************************************************/
1108*35786f68SRobert Mustacchi
1109*35786f68SRobert Mustacchi void
AcpiDmPinGroupDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1110*35786f68SRobert Mustacchi AcpiDmPinGroupDescriptor (
1111*35786f68SRobert Mustacchi ACPI_OP_WALK_INFO *Info,
1112*35786f68SRobert Mustacchi AML_RESOURCE *Resource,
1113*35786f68SRobert Mustacchi UINT32 Length,
1114*35786f68SRobert Mustacchi UINT32 Level)
1115*35786f68SRobert Mustacchi {
1116*35786f68SRobert Mustacchi char *Label;
1117*35786f68SRobert Mustacchi UINT16 *PinList;
1118*35786f68SRobert Mustacchi UINT8 *VendorData;
1119*35786f68SRobert Mustacchi UINT32 PinCount;
1120*35786f68SRobert Mustacchi UINT32 i;
1121*35786f68SRobert Mustacchi
1122*35786f68SRobert Mustacchi AcpiDmIndent (Level);
1123*35786f68SRobert Mustacchi /* Always producer */
1124*35786f68SRobert Mustacchi AcpiOsPrintf ("PinGroup (");
1125*35786f68SRobert Mustacchi
1126*35786f68SRobert Mustacchi Label = ACPI_ADD_PTR (char,
1127*35786f68SRobert Mustacchi Resource, Resource->PinGroup.LabelOffset),
1128*35786f68SRobert Mustacchi AcpiUtPrintString (Label, ACPI_UINT16_MAX);
1129*35786f68SRobert Mustacchi
1130*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
1131*35786f68SRobert Mustacchi
1132*35786f68SRobert Mustacchi AcpiOsPrintf ("%s, ",
1133*35786f68SRobert Mustacchi AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]);
1134*35786f68SRobert Mustacchi
1135*35786f68SRobert Mustacchi /* Insert a descriptor name */
1136*35786f68SRobert Mustacchi
1137*35786f68SRobert Mustacchi AcpiDmDescriptorName ();
1138*35786f68SRobert Mustacchi
1139*35786f68SRobert Mustacchi AcpiOsPrintf (",");
1140*35786f68SRobert Mustacchi
1141*35786f68SRobert Mustacchi /* Dump the vendor data */
1142*35786f68SRobert Mustacchi
1143*35786f68SRobert Mustacchi if (Resource->PinGroup.VendorLength)
1144*35786f68SRobert Mustacchi {
1145*35786f68SRobert Mustacchi AcpiOsPrintf ("\n");
1146*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1147*35786f68SRobert Mustacchi VendorData = ACPI_ADD_PTR (UINT8, Resource,
1148*35786f68SRobert Mustacchi Resource->PinGroup.VendorOffset);
1149*35786f68SRobert Mustacchi
1150*35786f68SRobert Mustacchi AcpiDmDumpRawDataBuffer (VendorData,
1151*35786f68SRobert Mustacchi Resource->PinGroup.VendorLength, Level);
1152*35786f68SRobert Mustacchi }
1153*35786f68SRobert Mustacchi
1154*35786f68SRobert Mustacchi AcpiOsPrintf (")\n");
1155*35786f68SRobert Mustacchi
1156*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1157*35786f68SRobert Mustacchi
1158*35786f68SRobert Mustacchi /* Dump the interrupt list */
1159*35786f68SRobert Mustacchi
1160*35786f68SRobert Mustacchi AcpiOsPrintf ("{ // Pin list\n");
1161*35786f68SRobert Mustacchi
1162*35786f68SRobert Mustacchi PinCount = (Resource->PinGroup.LabelOffset -
1163*35786f68SRobert Mustacchi Resource->PinGroup.PinTableOffset) / sizeof (UINT16);
1164*35786f68SRobert Mustacchi
1165*35786f68SRobert Mustacchi PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
1166*35786f68SRobert Mustacchi Resource->PinGroup.PinTableOffset);
1167*35786f68SRobert Mustacchi
1168*35786f68SRobert Mustacchi for (i = 0; i < PinCount; i++)
1169*35786f68SRobert Mustacchi {
1170*35786f68SRobert Mustacchi AcpiDmIndent (Level + 2);
1171*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
1172*35786f68SRobert Mustacchi ((i + 1) < PinCount) ? "," : "");
1173*35786f68SRobert Mustacchi }
1174*35786f68SRobert Mustacchi
1175*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1176*35786f68SRobert Mustacchi AcpiOsPrintf ("}\n");
1177*35786f68SRobert Mustacchi }
1178*35786f68SRobert Mustacchi
1179*35786f68SRobert Mustacchi /*******************************************************************************
1180*35786f68SRobert Mustacchi *
1181*35786f68SRobert Mustacchi * FUNCTION: AcpiDmPinGroupFunctionDescriptor
1182*35786f68SRobert Mustacchi *
1183*35786f68SRobert Mustacchi * PARAMETERS: Info - Extra resource info
1184*35786f68SRobert Mustacchi * Resource - Pointer to the resource descriptor
1185*35786f68SRobert Mustacchi * Length - Length of the descriptor in bytes
1186*35786f68SRobert Mustacchi * Level - Current source code indentation level
1187*35786f68SRobert Mustacchi *
1188*35786f68SRobert Mustacchi * RETURN: None
1189*35786f68SRobert Mustacchi *
1190*35786f68SRobert Mustacchi * DESCRIPTION: Decode a PinGroupFunction descriptor
1191*35786f68SRobert Mustacchi *
1192*35786f68SRobert Mustacchi ******************************************************************************/
1193*35786f68SRobert Mustacchi
1194*35786f68SRobert Mustacchi void
AcpiDmPinGroupFunctionDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1195*35786f68SRobert Mustacchi AcpiDmPinGroupFunctionDescriptor (
1196*35786f68SRobert Mustacchi ACPI_OP_WALK_INFO *Info,
1197*35786f68SRobert Mustacchi AML_RESOURCE *Resource,
1198*35786f68SRobert Mustacchi UINT32 Length,
1199*35786f68SRobert Mustacchi UINT32 Level)
1200*35786f68SRobert Mustacchi {
1201*35786f68SRobert Mustacchi UINT8 *VendorData;
1202*35786f68SRobert Mustacchi char *DeviceName = NULL;
1203*35786f68SRobert Mustacchi char *Label = NULL;
1204*35786f68SRobert Mustacchi
1205*35786f68SRobert Mustacchi AcpiDmIndent (Level);
1206*35786f68SRobert Mustacchi AcpiOsPrintf ("PinGroupFunction (%s, ",
1207*35786f68SRobert Mustacchi AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]);
1208*35786f68SRobert Mustacchi
1209*35786f68SRobert Mustacchi /* FunctionNumber */
1210*35786f68SRobert Mustacchi
1211*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber);
1212*35786f68SRobert Mustacchi
1213*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char,
1214*35786f68SRobert Mustacchi Resource, Resource->PinGroupFunction.ResSourceOffset),
1215*35786f68SRobert Mustacchi AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
1216*35786f68SRobert Mustacchi
1217*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
1218*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex);
1219*35786f68SRobert Mustacchi
1220*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1221*35786f68SRobert Mustacchi
1222*35786f68SRobert Mustacchi Label = ACPI_ADD_PTR (char, Resource,
1223*35786f68SRobert Mustacchi Resource->PinGroupFunction.ResSourceLabelOffset);
1224*35786f68SRobert Mustacchi AcpiUtPrintString (Label, ACPI_UINT16_MAX);
1225*35786f68SRobert Mustacchi
1226*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
1227*35786f68SRobert Mustacchi
1228*35786f68SRobert Mustacchi AcpiOsPrintf ("%s, ",
1229*35786f68SRobert Mustacchi AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]);
1230*35786f68SRobert Mustacchi
1231*35786f68SRobert Mustacchi /* Insert a descriptor name */
1232*35786f68SRobert Mustacchi
1233*35786f68SRobert Mustacchi AcpiDmDescriptorName ();
1234*35786f68SRobert Mustacchi
1235*35786f68SRobert Mustacchi AcpiOsPrintf (",");
1236*35786f68SRobert Mustacchi
1237*35786f68SRobert Mustacchi /* Dump the vendor data */
1238*35786f68SRobert Mustacchi
1239*35786f68SRobert Mustacchi if (Resource->PinGroupFunction.VendorLength)
1240*35786f68SRobert Mustacchi {
1241*35786f68SRobert Mustacchi AcpiOsPrintf ("\n");
1242*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1243*35786f68SRobert Mustacchi VendorData = ACPI_ADD_PTR (UINT8, Resource,
1244*35786f68SRobert Mustacchi Resource->PinGroupFunction.VendorOffset);
1245*35786f68SRobert Mustacchi
1246*35786f68SRobert Mustacchi AcpiDmDumpRawDataBuffer (VendorData,
1247*35786f68SRobert Mustacchi Resource->PinGroupFunction.VendorLength, Level);
1248*35786f68SRobert Mustacchi }
1249*35786f68SRobert Mustacchi
1250*35786f68SRobert Mustacchi AcpiOsPrintf (")\n");
1251*35786f68SRobert Mustacchi }
1252*35786f68SRobert Mustacchi
1253*35786f68SRobert Mustacchi /*******************************************************************************
1254*35786f68SRobert Mustacchi *
1255*35786f68SRobert Mustacchi * FUNCTION: AcpiDmPinGroupConfigDescriptor
1256*35786f68SRobert Mustacchi *
1257*35786f68SRobert Mustacchi * PARAMETERS: Info - Extra resource info
1258*35786f68SRobert Mustacchi * Resource - Pointer to the resource descriptor
1259*35786f68SRobert Mustacchi * Length - Length of the descriptor in bytes
1260*35786f68SRobert Mustacchi * Level - Current source code indentation level
1261*35786f68SRobert Mustacchi *
1262*35786f68SRobert Mustacchi * RETURN: None
1263*35786f68SRobert Mustacchi *
1264*35786f68SRobert Mustacchi * DESCRIPTION: Decode a PinGroupConfig descriptor
1265*35786f68SRobert Mustacchi *
1266*35786f68SRobert Mustacchi ******************************************************************************/
1267*35786f68SRobert Mustacchi
1268*35786f68SRobert Mustacchi void
AcpiDmPinGroupConfigDescriptor(ACPI_OP_WALK_INFO * Info,AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)1269*35786f68SRobert Mustacchi AcpiDmPinGroupConfigDescriptor (
1270*35786f68SRobert Mustacchi ACPI_OP_WALK_INFO *Info,
1271*35786f68SRobert Mustacchi AML_RESOURCE *Resource,
1272*35786f68SRobert Mustacchi UINT32 Length,
1273*35786f68SRobert Mustacchi UINT32 Level)
1274*35786f68SRobert Mustacchi {
1275*35786f68SRobert Mustacchi UINT8 *VendorData;
1276*35786f68SRobert Mustacchi char *DeviceName = NULL;
1277*35786f68SRobert Mustacchi char *Label = NULL;
1278*35786f68SRobert Mustacchi
1279*35786f68SRobert Mustacchi AcpiDmIndent (Level);
1280*35786f68SRobert Mustacchi AcpiOsPrintf ("PinGroupConfig (%s, ",
1281*35786f68SRobert Mustacchi AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]);
1282*35786f68SRobert Mustacchi
1283*35786f68SRobert Mustacchi AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType,
1284*35786f68SRobert Mustacchi Resource->PinGroupConfig.PinConfigValue);
1285*35786f68SRobert Mustacchi
1286*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1287*35786f68SRobert Mustacchi
1288*35786f68SRobert Mustacchi DeviceName = ACPI_ADD_PTR (char,
1289*35786f68SRobert Mustacchi Resource, Resource->PinGroupConfig.ResSourceOffset),
1290*35786f68SRobert Mustacchi AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
1291*35786f68SRobert Mustacchi
1292*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
1293*35786f68SRobert Mustacchi AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex);
1294*35786f68SRobert Mustacchi
1295*35786f68SRobert Mustacchi Label = ACPI_ADD_PTR (char, Resource,
1296*35786f68SRobert Mustacchi Resource->PinGroupConfig.ResSourceLabelOffset);
1297*35786f68SRobert Mustacchi AcpiUtPrintString (Label, ACPI_UINT16_MAX);
1298*35786f68SRobert Mustacchi
1299*35786f68SRobert Mustacchi AcpiOsPrintf (", ");
1300*35786f68SRobert Mustacchi
1301*35786f68SRobert Mustacchi AcpiOsPrintf ("%s, ",
1302*35786f68SRobert Mustacchi AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]);
1303*35786f68SRobert Mustacchi
1304*35786f68SRobert Mustacchi /* Insert a descriptor name */
1305*35786f68SRobert Mustacchi
1306*35786f68SRobert Mustacchi AcpiDmDescriptorName ();
1307*35786f68SRobert Mustacchi
1308*35786f68SRobert Mustacchi AcpiOsPrintf (",");
1309*35786f68SRobert Mustacchi
1310*35786f68SRobert Mustacchi /* Dump the vendor data */
1311*35786f68SRobert Mustacchi
1312*35786f68SRobert Mustacchi if (Resource->PinGroupConfig.VendorLength)
1313*35786f68SRobert Mustacchi {
1314*35786f68SRobert Mustacchi AcpiOsPrintf ("\n");
1315*35786f68SRobert Mustacchi AcpiDmIndent (Level + 1);
1316*35786f68SRobert Mustacchi VendorData = ACPI_ADD_PTR (UINT8, Resource,
1317*35786f68SRobert Mustacchi Resource->PinGroupConfig.VendorOffset);
1318*35786f68SRobert Mustacchi
1319*35786f68SRobert Mustacchi AcpiDmDumpRawDataBuffer (VendorData,
1320*35786f68SRobert Mustacchi Resource->PinGroupConfig.VendorLength, Level);
1321*35786f68SRobert Mustacchi }
1322*35786f68SRobert Mustacchi
1323*35786f68SRobert Mustacchi AcpiOsPrintf (")\n");
1324*35786f68SRobert Mustacchi }
1325