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