diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-07-18 13:28:52 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-09-20 13:10:34 -0400 |
commit | 9e05b2f49eb9484e857e9b6c70dea3bbbe564290 (patch) | |
tree | aa0f042e30138f80000ee36e2f93c86050cd9f5e /drivers/gpu/drm/radeon/radeon_acpi.h | |
parent | 9e9eb7c60d57620bfe46b2a489e7f56a5925115a (diff) |
drm/radeon: add new AMD ACPI header and update relevant code (v2)
Add a new header that defines the AMD ACPI interface used
for laptops, PowerXpress, and chipset specific functionality
and update the current code to use it.
Todo:
- properly verify the ACPI interfaces
- hook up and handle ACPI notifications
- make PX code more robust
- implement PCIe Gen and width switching using ACPI
v2: fix typo in header
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_acpi.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_acpi.h | 439 |
1 files changed, 439 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_acpi.h b/drivers/gpu/drm/radeon/radeon_acpi.h new file mode 100644 index 000000000000..642aa4719454 --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_acpi.h | |||
@@ -0,0 +1,439 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Advanced Micro Devices, Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef RADEON_ACPI_H | ||
25 | #define RADEON_ACPI_H | ||
26 | |||
27 | /* AMD hw uses four ACPI control methods: | ||
28 | * 1. ATIF | ||
29 | * ARG0: (ACPI_INTEGER) function code | ||
30 | * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes | ||
31 | * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes | ||
32 | * ATIF provides an entry point for the gfx driver to interact with the sbios. | ||
33 | * The AMD ACPI notification mechanism uses Notify (VGA, 0x81) or a custom | ||
34 | * notification. Which notification is used as indicated by the ATIF Control | ||
35 | * Method GET_SYSTEM_PARAMETERS. When the driver receives Notify (VGA, 0x81) or | ||
36 | * a custom notification it invokes ATIF Control Method GET_SYSTEM_BIOS_REQUESTS | ||
37 | * to identify pending System BIOS requests and associated parameters. For | ||
38 | * example, if one of the pending requests is DISPLAY_SWITCH_REQUEST, the driver | ||
39 | * will perform display device detection and invoke ATIF Control Method | ||
40 | * SELECT_ACTIVE_DISPLAYS. | ||
41 | * | ||
42 | * 2. ATPX | ||
43 | * ARG0: (ACPI_INTEGER) function code | ||
44 | * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes | ||
45 | * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes | ||
46 | * ATPX methods are used on PowerXpress systems to handle mux switching and | ||
47 | * discrete GPU power control. | ||
48 | * | ||
49 | * 3. ATRM | ||
50 | * ARG0: (ACPI_INTEGER) offset of vbios rom data | ||
51 | * ARG1: (ACPI_BUFFER) size of the buffer to fill (up to 4K). | ||
52 | * OUTPUT: (ACPI_BUFFER) output buffer | ||
53 | * ATRM provides an interfacess to access the discrete GPU vbios image on | ||
54 | * PowerXpress systems with multiple GPUs. | ||
55 | * | ||
56 | * 4. ATCS | ||
57 | * ARG0: (ACPI_INTEGER) function code | ||
58 | * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes | ||
59 | * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes | ||
60 | * ATCS provides an interface to AMD chipset specific functionality. | ||
61 | * | ||
62 | */ | ||
63 | /* ATIF */ | ||
64 | #define ATIF_FUNCTION_VERIFY_INTERFACE 0x0 | ||
65 | /* ARG0: ATIF_FUNCTION_VERIFY_INTERFACE | ||
66 | * ARG1: none | ||
67 | * OUTPUT: | ||
68 | * WORD - structure size in bytes (includes size field) | ||
69 | * WORD - version | ||
70 | * DWORD - supported notifications mask | ||
71 | * DWORD - supported functions bit vector | ||
72 | */ | ||
73 | /* Notifications mask */ | ||
74 | # define ATIF_DISPLAY_SWITCH_REQUEST_SUPPORTED (1 << 0) | ||
75 | # define ATIF_EXPANSION_MODE_CHANGE_REQUEST_SUPPORTED (1 << 1) | ||
76 | # define ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED (1 << 2) | ||
77 | # define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED (1 << 3) | ||
78 | # define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED (1 << 4) | ||
79 | # define ATIF_DISPLAY_CONF_CHANGE_REQUEST_SUPPORTED (1 << 5) | ||
80 | # define ATIF_PX_GFX_SWITCH_REQUEST_SUPPORTED (1 << 6) | ||
81 | # define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED (1 << 7) | ||
82 | # define ATIF_DGPU_DISPLAY_EVENT_SUPPORTED (1 << 8) | ||
83 | /* supported functions vector */ | ||
84 | # define ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED (1 << 0) | ||
85 | # define ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED (1 << 1) | ||
86 | # define ATIF_SELECT_ACTIVE_DISPLAYS_SUPPORTED (1 << 2) | ||
87 | # define ATIF_GET_LID_STATE_SUPPORTED (1 << 3) | ||
88 | # define ATIF_GET_TV_STANDARD_FROM_CMOS_SUPPORTED (1 << 4) | ||
89 | # define ATIF_SET_TV_STANDARD_IN_CMOS_SUPPORTED (1 << 5) | ||
90 | # define ATIF_GET_PANEL_EXPANSION_MODE_FROM_CMOS_SUPPORTED (1 << 6) | ||
91 | # define ATIF_SET_PANEL_EXPANSION_MODE_IN_CMOS_SUPPORTED (1 << 7) | ||
92 | # define ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED (1 << 12) | ||
93 | # define ATIF_GET_GRAPHICS_DEVICE_TYPES_SUPPORTED (1 << 14) | ||
94 | #define ATIF_FUNCTION_GET_SYSTEM_PARAMETERS 0x1 | ||
95 | /* ARG0: ATIF_FUNCTION_GET_SYSTEM_PARAMETERS | ||
96 | * ARG1: none | ||
97 | * OUTPUT: | ||
98 | * WORD - structure size in bytes (includes size field) | ||
99 | * DWORD - valid flags mask | ||
100 | * DWORD - flags | ||
101 | * | ||
102 | * OR | ||
103 | * | ||
104 | * WORD - structure size in bytes (includes size field) | ||
105 | * DWORD - valid flags mask | ||
106 | * DWORD - flags | ||
107 | * BYTE - notify command code | ||
108 | * | ||
109 | * flags | ||
110 | * bits 1:0: | ||
111 | * 0 - Notify(VGA, 0x81) is not used for notification | ||
112 | * 1 - Notify(VGA, 0x81) is used for notification | ||
113 | * 2 - Notify(VGA, n) is used for notification where | ||
114 | * n (0xd0-0xd9) is specified in notify command code. | ||
115 | * bit 2: | ||
116 | * 1 - lid changes not reported though int10 | ||
117 | */ | ||
118 | #define ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS 0x2 | ||
119 | /* ARG0: ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS | ||
120 | * ARG1: none | ||
121 | * OUTPUT: | ||
122 | * WORD - structure size in bytes (includes size field) | ||
123 | * DWORD - pending sbios requests | ||
124 | * BYTE - panel expansion mode | ||
125 | * BYTE - thermal state: target gfx controller | ||
126 | * BYTE - thermal state: state id (0: exit state, non-0: state) | ||
127 | * BYTE - forced power state: target gfx controller | ||
128 | * BYTE - forced power state: state id | ||
129 | * BYTE - system power source | ||
130 | * BYTE - panel backlight level (0-255) | ||
131 | */ | ||
132 | /* pending sbios requests */ | ||
133 | # define ATIF_DISPLAY_SWITCH_REQUEST (1 << 0) | ||
134 | # define ATIF_EXPANSION_MODE_CHANGE_REQUEST (1 << 1) | ||
135 | # define ATIF_THERMAL_STATE_CHANGE_REQUEST (1 << 2) | ||
136 | # define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST (1 << 3) | ||
137 | # define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST (1 << 4) | ||
138 | # define ATIF_DISPLAY_CONF_CHANGE_REQUEST (1 << 5) | ||
139 | # define ATIF_PX_GFX_SWITCH_REQUEST (1 << 6) | ||
140 | # define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST (1 << 7) | ||
141 | # define ATIF_DGPU_DISPLAY_EVENT (1 << 8) | ||
142 | /* panel expansion mode */ | ||
143 | # define ATIF_PANEL_EXPANSION_DISABLE 0 | ||
144 | # define ATIF_PANEL_EXPANSION_FULL 1 | ||
145 | # define ATIF_PANEL_EXPANSION_ASPECT 2 | ||
146 | /* target gfx controller */ | ||
147 | # define ATIF_TARGET_GFX_SINGLE 0 | ||
148 | # define ATIF_TARGET_GFX_PX_IGPU 1 | ||
149 | # define ATIF_TARGET_GFX_PX_DGPU 2 | ||
150 | /* system power source */ | ||
151 | # define ATIF_POWER_SOURCE_AC 1 | ||
152 | # define ATIF_POWER_SOURCE_DC 2 | ||
153 | # define ATIF_POWER_SOURCE_RESTRICTED_AC_1 3 | ||
154 | # define ATIF_POWER_SOURCE_RESTRICTED_AC_2 4 | ||
155 | #define ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS 0x3 | ||
156 | /* ARG0: ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS | ||
157 | * ARG1: | ||
158 | * WORD - structure size in bytes (includes size field) | ||
159 | * WORD - selected displays | ||
160 | * WORD - connected displays | ||
161 | * OUTPUT: | ||
162 | * WORD - structure size in bytes (includes size field) | ||
163 | * WORD - selected displays | ||
164 | */ | ||
165 | # define ATIF_LCD1 (1 << 0) | ||
166 | # define ATIF_CRT1 (1 << 1) | ||
167 | # define ATIF_TV (1 << 2) | ||
168 | # define ATIF_DFP1 (1 << 3) | ||
169 | # define ATIF_CRT2 (1 << 4) | ||
170 | # define ATIF_LCD2 (1 << 5) | ||
171 | # define ATIF_DFP2 (1 << 7) | ||
172 | # define ATIF_CV (1 << 8) | ||
173 | # define ATIF_DFP3 (1 << 9) | ||
174 | # define ATIF_DFP4 (1 << 10) | ||
175 | # define ATIF_DFP5 (1 << 11) | ||
176 | # define ATIF_DFP6 (1 << 12) | ||
177 | #define ATIF_FUNCTION_GET_LID_STATE 0x4 | ||
178 | /* ARG0: ATIF_FUNCTION_GET_LID_STATE | ||
179 | * ARG1: none | ||
180 | * OUTPUT: | ||
181 | * WORD - structure size in bytes (includes size field) | ||
182 | * BYTE - lid state (0: open, 1: closed) | ||
183 | * | ||
184 | * GET_LID_STATE only works at boot and resume, for general lid | ||
185 | * status, use the kernel provided status | ||
186 | */ | ||
187 | #define ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS 0x5 | ||
188 | /* ARG0: ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS | ||
189 | * ARG1: none | ||
190 | * OUTPUT: | ||
191 | * WORD - structure size in bytes (includes size field) | ||
192 | * BYTE - 0 | ||
193 | * BYTE - TV standard | ||
194 | */ | ||
195 | # define ATIF_TV_STD_NTSC 0 | ||
196 | # define ATIF_TV_STD_PAL 1 | ||
197 | # define ATIF_TV_STD_PALM 2 | ||
198 | # define ATIF_TV_STD_PAL60 3 | ||
199 | # define ATIF_TV_STD_NTSCJ 4 | ||
200 | # define ATIF_TV_STD_PALCN 5 | ||
201 | # define ATIF_TV_STD_PALN 6 | ||
202 | # define ATIF_TV_STD_SCART_RGB 9 | ||
203 | #define ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS 0x6 | ||
204 | /* ARG0: ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS | ||
205 | * ARG1: | ||
206 | * WORD - structure size in bytes (includes size field) | ||
207 | * BYTE - 0 | ||
208 | * BYTE - TV standard | ||
209 | * OUTPUT: none | ||
210 | */ | ||
211 | #define ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS 0x7 | ||
212 | /* ARG0: ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS | ||
213 | * ARG1: none | ||
214 | * OUTPUT: | ||
215 | * WORD - structure size in bytes (includes size field) | ||
216 | * BYTE - panel expansion mode | ||
217 | */ | ||
218 | #define ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS 0x8 | ||
219 | /* ARG0: ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS | ||
220 | * ARG1: | ||
221 | * WORD - structure size in bytes (includes size field) | ||
222 | * BYTE - panel expansion mode | ||
223 | * OUTPUT: none | ||
224 | */ | ||
225 | #define ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION 0xD | ||
226 | /* ARG0: ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION | ||
227 | * ARG1: | ||
228 | * WORD - structure size in bytes (includes size field) | ||
229 | * WORD - gfx controller id | ||
230 | * BYTE - current temperature (degress Celsius) | ||
231 | * OUTPUT: none | ||
232 | */ | ||
233 | #define ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES 0xF | ||
234 | /* ARG0: ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES | ||
235 | * ARG1: none | ||
236 | * OUTPUT: | ||
237 | * WORD - number of gfx devices | ||
238 | * WORD - device structure size in bytes (excludes device size field) | ||
239 | * DWORD - flags \ | ||
240 | * WORD - bus number } repeated structure | ||
241 | * WORD - device number / | ||
242 | */ | ||
243 | /* flags */ | ||
244 | # define ATIF_PX_REMOVABLE_GRAPHICS_DEVICE (1 << 0) | ||
245 | # define ATIF_XGP_PORT (1 << 1) | ||
246 | # define ATIF_VGA_ENABLED_GRAPHICS_DEVICE (1 << 2) | ||
247 | # define ATIF_XGP_PORT_IN_DOCK (1 << 3) | ||
248 | |||
249 | /* ATPX */ | ||
250 | #define ATPX_FUNCTION_VERIFY_INTERFACE 0x0 | ||
251 | /* ARG0: ATPX_FUNCTION_VERIFY_INTERFACE | ||
252 | * ARG1: none | ||
253 | * OUTPUT: | ||
254 | * WORD - structure size in bytes (includes size field) | ||
255 | * WORD - version | ||
256 | * DWORD - supported functions bit vector | ||
257 | */ | ||
258 | /* supported functions vector */ | ||
259 | # define ATPX_GET_PX_PARAMETERS_SUPPORTED (1 << 0) | ||
260 | # define ATPX_POWER_CONTROL_SUPPORTED (1 << 1) | ||
261 | # define ATPX_DISPLAY_MUX_CONTROL_SUPPORTED (1 << 2) | ||
262 | # define ATPX_I2C_MUX_CONTROL_SUPPORTED (1 << 3) | ||
263 | # define ATPX_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION_SUPPORTED (1 << 4) | ||
264 | # define ATPX_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION_SUPPORTED (1 << 5) | ||
265 | # define ATPX_GET_DISPLAY_CONNECTORS_MAPPING_SUPPORTED (1 << 7) | ||
266 | # define ATPX_GET_DISPLAY_DETECTION_PORTS_SUPPORTED (1 << 8) | ||
267 | #define ATPX_FUNCTION_GET_PX_PARAMETERS 0x1 | ||
268 | /* ARG0: ATPX_FUNCTION_GET_PX_PARAMETERS | ||
269 | * ARG1: none | ||
270 | * OUTPUT: | ||
271 | * WORD - structure size in bytes (includes size field) | ||
272 | * DWORD - valid flags mask | ||
273 | * DWORD - flags | ||
274 | */ | ||
275 | /* flags */ | ||
276 | # define ATPX_LVDS_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 0) | ||
277 | # define ATPX_CRT1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 1) | ||
278 | # define ATPX_DVI1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 2) | ||
279 | # define ATPX_CRT1_RGB_SIGNAL_MUXED (1 << 3) | ||
280 | # define ATPX_TV_SIGNAL_MUXED (1 << 4) | ||
281 | # define ATPX_DFP_SIGNAL_MUXED (1 << 5) | ||
282 | # define ATPX_SEPARATE_MUX_FOR_I2C (1 << 6) | ||
283 | # define ATPX_DYNAMIC_PX_SUPPORTED (1 << 7) | ||
284 | # define ATPX_ACF_NOT_SUPPORTED (1 << 8) | ||
285 | # define ATPX_FIXED_NOT_SUPPORTED (1 << 9) | ||
286 | # define ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED (1 << 10) | ||
287 | # define ATPX_DGPU_REQ_POWER_FOR_DISPLAYS (1 << 11) | ||
288 | #define ATPX_FUNCTION_POWER_CONTROL 0x2 | ||
289 | /* ARG0: ATPX_FUNCTION_POWER_CONTROL | ||
290 | * ARG1: | ||
291 | * WORD - structure size in bytes (includes size field) | ||
292 | * BYTE - dGPU power state (0: power off, 1: power on) | ||
293 | * OUTPUT: none | ||
294 | */ | ||
295 | #define ATPX_FUNCTION_DISPLAY_MUX_CONTROL 0x3 | ||
296 | /* ARG0: ATPX_FUNCTION_DISPLAY_MUX_CONTROL | ||
297 | * ARG1: | ||
298 | * WORD - structure size in bytes (includes size field) | ||
299 | * WORD - display mux control (0: iGPU, 1: dGPU) | ||
300 | * OUTPUT: none | ||
301 | */ | ||
302 | # define ATPX_INTEGRATED_GPU 0 | ||
303 | # define ATPX_DISCRETE_GPU 1 | ||
304 | #define ATPX_FUNCTION_I2C_MUX_CONTROL 0x4 | ||
305 | /* ARG0: ATPX_FUNCTION_I2C_MUX_CONTROL | ||
306 | * ARG1: | ||
307 | * WORD - structure size in bytes (includes size field) | ||
308 | * WORD - i2c/aux/hpd mux control (0: iGPU, 1: dGPU) | ||
309 | * OUTPUT: none | ||
310 | */ | ||
311 | #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION 0x5 | ||
312 | /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION | ||
313 | * ARG1: | ||
314 | * WORD - structure size in bytes (includes size field) | ||
315 | * WORD - target gpu (0: iGPU, 1: dGPU) | ||
316 | * OUTPUT: none | ||
317 | */ | ||
318 | #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION 0x6 | ||
319 | /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION | ||
320 | * ARG1: | ||
321 | * WORD - structure size in bytes (includes size field) | ||
322 | * WORD - target gpu (0: iGPU, 1: dGPU) | ||
323 | * OUTPUT: none | ||
324 | */ | ||
325 | #define ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING 0x8 | ||
326 | /* ARG0: ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING | ||
327 | * ARG1: none | ||
328 | * OUTPUT: | ||
329 | * WORD - number of display connectors | ||
330 | * WORD - connector structure size in bytes (excludes connector size field) | ||
331 | * BYTE - flags \ | ||
332 | * BYTE - ATIF display vector bit position } repeated | ||
333 | * BYTE - adapter id (0: iGPU, 1-n: dGPU ordered by pcie bus number) } structure | ||
334 | * WORD - connector ACPI id / | ||
335 | */ | ||
336 | /* flags */ | ||
337 | # define ATPX_DISPLAY_OUTPUT_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 0) | ||
338 | # define ATPX_DISPLAY_HPD_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 1) | ||
339 | # define ATPX_DISPLAY_I2C_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 2) | ||
340 | #define ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS 0x9 | ||
341 | /* ARG0: ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS | ||
342 | * ARG1: none | ||
343 | * OUTPUT: | ||
344 | * WORD - number of HPD/DDC ports | ||
345 | * WORD - port structure size in bytes (excludes port size field) | ||
346 | * BYTE - ATIF display vector bit position \ | ||
347 | * BYTE - hpd id } reapeated structure | ||
348 | * BYTE - ddc id / | ||
349 | * | ||
350 | * available on A+A systems only | ||
351 | */ | ||
352 | /* hpd id */ | ||
353 | # define ATPX_HPD_NONE 0 | ||
354 | # define ATPX_HPD1 1 | ||
355 | # define ATPX_HPD2 2 | ||
356 | # define ATPX_HPD3 3 | ||
357 | # define ATPX_HPD4 4 | ||
358 | # define ATPX_HPD5 5 | ||
359 | # define ATPX_HPD6 6 | ||
360 | /* ddc id */ | ||
361 | # define ATPX_DDC_NONE 0 | ||
362 | # define ATPX_DDC1 1 | ||
363 | # define ATPX_DDC2 2 | ||
364 | # define ATPX_DDC3 3 | ||
365 | # define ATPX_DDC4 4 | ||
366 | # define ATPX_DDC5 5 | ||
367 | # define ATPX_DDC6 6 | ||
368 | # define ATPX_DDC7 7 | ||
369 | # define ATPX_DDC8 8 | ||
370 | |||
371 | /* ATCS */ | ||
372 | #define ATCS_FUNCTION_VERIFY_INTERFACE 0x0 | ||
373 | /* ARG0: ATCS_FUNCTION_VERIFY_INTERFACE | ||
374 | * ARG1: none | ||
375 | * OUTPUT: | ||
376 | * WORD - structure size in bytes (includes size field) | ||
377 | * WORD - version | ||
378 | * DWORD - supported functions bit vector | ||
379 | */ | ||
380 | /* supported functions vector */ | ||
381 | # define ATCS_GET_EXTERNAL_STATE_SUPPORTED (1 << 0) | ||
382 | # define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED (1 << 1) | ||
383 | # define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED (1 << 2) | ||
384 | # define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED (1 << 3) | ||
385 | #define ATCS_FUNCTION_GET_EXTERNAL_STATE 0x1 | ||
386 | /* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE | ||
387 | * ARG1: none | ||
388 | * OUTPUT: | ||
389 | * WORD - structure size in bytes (includes size field) | ||
390 | * DWORD - valid flags mask | ||
391 | * DWORD - flags (0: undocked, 1: docked) | ||
392 | */ | ||
393 | /* flags */ | ||
394 | # define ATCS_DOCKED (1 << 0) | ||
395 | #define ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST 0x2 | ||
396 | /* ARG0: ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST | ||
397 | * ARG1: | ||
398 | * WORD - structure size in bytes (includes size field) | ||
399 | * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) | ||
400 | * WORD - valid flags mask | ||
401 | * WORD - flags | ||
402 | * BYTE - request type | ||
403 | * BYTE - performance request | ||
404 | * OUTPUT: | ||
405 | * WORD - structure size in bytes (includes size field) | ||
406 | * BYTE - return value | ||
407 | */ | ||
408 | /* flags */ | ||
409 | # define ATCS_ADVERTISE_CAPS (1 << 0) | ||
410 | # define ATCS_WAIT_FOR_COMPLETION (1 << 1) | ||
411 | /* request type */ | ||
412 | # define ATCS_PCIE_LINK_SPEED 1 | ||
413 | /* performance request */ | ||
414 | # define ATCS_REMOVE 0 | ||
415 | # define ATCS_FORCE_LOW_POWER 1 | ||
416 | # define ATCS_PERF_LEVEL_1 2 /* PCIE Gen 1 */ | ||
417 | # define ATCS_PERF_LEVEL_2 3 /* PCIE Gen 2 */ | ||
418 | # define ATCS_PERF_LEVEL_3 4 /* PCIE Gen 3 */ | ||
419 | /* return value */ | ||
420 | # define ATCS_REQUEST_REFUSED 1 | ||
421 | # define ATCS_REQUEST_COMPLETE 2 | ||
422 | # define ATCS_REQUEST_IN_PROGRESS 3 | ||
423 | #define ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION 0x3 | ||
424 | /* ARG0: ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION | ||
425 | * ARG1: none | ||
426 | * OUTPUT: none | ||
427 | */ | ||
428 | #define ATCS_FUNCTION_SET_PCIE_BUS_WIDTH 0x4 | ||
429 | /* ARG0: ATCS_FUNCTION_SET_PCIE_BUS_WIDTH | ||
430 | * ARG1: | ||
431 | * WORD - structure size in bytes (includes size field) | ||
432 | * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) | ||
433 | * BYTE - number of active lanes | ||
434 | * OUTPUT: | ||
435 | * WORD - structure size in bytes (includes size field) | ||
436 | * BYTE - number of active lanes | ||
437 | */ | ||
438 | |||
439 | #endif | ||