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