18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright 2012 Advanced Micro Devices, Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation 78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 218c2ecf20Sopenharmony_ci * 228c2ecf20Sopenharmony_ci */ 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#ifndef RADEON_ACPI_H 258c2ecf20Sopenharmony_ci#define RADEON_ACPI_H 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistruct radeon_device; 288c2ecf20Sopenharmony_cistruct acpi_bus_event; 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* AMD hw uses four ACPI control methods: 318c2ecf20Sopenharmony_ci * 1. ATIF 328c2ecf20Sopenharmony_ci * ARG0: (ACPI_INTEGER) function code 338c2ecf20Sopenharmony_ci * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes 348c2ecf20Sopenharmony_ci * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes 358c2ecf20Sopenharmony_ci * ATIF provides an entry point for the gfx driver to interact with the sbios. 368c2ecf20Sopenharmony_ci * The AMD ACPI notification mechanism uses Notify (VGA, 0x81) or a custom 378c2ecf20Sopenharmony_ci * notification. Which notification is used as indicated by the ATIF Control 388c2ecf20Sopenharmony_ci * Method GET_SYSTEM_PARAMETERS. When the driver receives Notify (VGA, 0x81) or 398c2ecf20Sopenharmony_ci * a custom notification it invokes ATIF Control Method GET_SYSTEM_BIOS_REQUESTS 408c2ecf20Sopenharmony_ci * to identify pending System BIOS requests and associated parameters. For 418c2ecf20Sopenharmony_ci * example, if one of the pending requests is DISPLAY_SWITCH_REQUEST, the driver 428c2ecf20Sopenharmony_ci * will perform display device detection and invoke ATIF Control Method 438c2ecf20Sopenharmony_ci * SELECT_ACTIVE_DISPLAYS. 448c2ecf20Sopenharmony_ci * 458c2ecf20Sopenharmony_ci * 2. ATPX 468c2ecf20Sopenharmony_ci * ARG0: (ACPI_INTEGER) function code 478c2ecf20Sopenharmony_ci * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes 488c2ecf20Sopenharmony_ci * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes 498c2ecf20Sopenharmony_ci * ATPX methods are used on PowerXpress systems to handle mux switching and 508c2ecf20Sopenharmony_ci * discrete GPU power control. 518c2ecf20Sopenharmony_ci * 528c2ecf20Sopenharmony_ci * 3. ATRM 538c2ecf20Sopenharmony_ci * ARG0: (ACPI_INTEGER) offset of vbios rom data 548c2ecf20Sopenharmony_ci * ARG1: (ACPI_BUFFER) size of the buffer to fill (up to 4K). 558c2ecf20Sopenharmony_ci * OUTPUT: (ACPI_BUFFER) output buffer 568c2ecf20Sopenharmony_ci * ATRM provides an interfacess to access the discrete GPU vbios image on 578c2ecf20Sopenharmony_ci * PowerXpress systems with multiple GPUs. 588c2ecf20Sopenharmony_ci * 598c2ecf20Sopenharmony_ci * 4. ATCS 608c2ecf20Sopenharmony_ci * ARG0: (ACPI_INTEGER) function code 618c2ecf20Sopenharmony_ci * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes 628c2ecf20Sopenharmony_ci * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes 638c2ecf20Sopenharmony_ci * ATCS provides an interface to AMD chipset specific functionality. 648c2ecf20Sopenharmony_ci * 658c2ecf20Sopenharmony_ci */ 668c2ecf20Sopenharmony_ci/* ATIF */ 678c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_VERIFY_INTERFACE 0x0 688c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_VERIFY_INTERFACE 698c2ecf20Sopenharmony_ci * ARG1: none 708c2ecf20Sopenharmony_ci * OUTPUT: 718c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 728c2ecf20Sopenharmony_ci * WORD - version 738c2ecf20Sopenharmony_ci * DWORD - supported notifications mask 748c2ecf20Sopenharmony_ci * DWORD - supported functions bit vector 758c2ecf20Sopenharmony_ci */ 768c2ecf20Sopenharmony_ci/* Notifications mask */ 778c2ecf20Sopenharmony_ci# define ATIF_DISPLAY_SWITCH_REQUEST_SUPPORTED (1 << 0) 788c2ecf20Sopenharmony_ci# define ATIF_EXPANSION_MODE_CHANGE_REQUEST_SUPPORTED (1 << 1) 798c2ecf20Sopenharmony_ci# define ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED (1 << 2) 808c2ecf20Sopenharmony_ci# define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED (1 << 3) 818c2ecf20Sopenharmony_ci# define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED (1 << 4) 828c2ecf20Sopenharmony_ci# define ATIF_DISPLAY_CONF_CHANGE_REQUEST_SUPPORTED (1 << 5) 838c2ecf20Sopenharmony_ci# define ATIF_PX_GFX_SWITCH_REQUEST_SUPPORTED (1 << 6) 848c2ecf20Sopenharmony_ci# define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED (1 << 7) 858c2ecf20Sopenharmony_ci# define ATIF_DGPU_DISPLAY_EVENT_SUPPORTED (1 << 8) 868c2ecf20Sopenharmony_ci/* supported functions vector */ 878c2ecf20Sopenharmony_ci# define ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED (1 << 0) 888c2ecf20Sopenharmony_ci# define ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED (1 << 1) 898c2ecf20Sopenharmony_ci# define ATIF_SELECT_ACTIVE_DISPLAYS_SUPPORTED (1 << 2) 908c2ecf20Sopenharmony_ci# define ATIF_GET_LID_STATE_SUPPORTED (1 << 3) 918c2ecf20Sopenharmony_ci# define ATIF_GET_TV_STANDARD_FROM_CMOS_SUPPORTED (1 << 4) 928c2ecf20Sopenharmony_ci# define ATIF_SET_TV_STANDARD_IN_CMOS_SUPPORTED (1 << 5) 938c2ecf20Sopenharmony_ci# define ATIF_GET_PANEL_EXPANSION_MODE_FROM_CMOS_SUPPORTED (1 << 6) 948c2ecf20Sopenharmony_ci# define ATIF_SET_PANEL_EXPANSION_MODE_IN_CMOS_SUPPORTED (1 << 7) 958c2ecf20Sopenharmony_ci# define ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED (1 << 12) 968c2ecf20Sopenharmony_ci# define ATIF_GET_GRAPHICS_DEVICE_TYPES_SUPPORTED (1 << 14) 978c2ecf20Sopenharmony_ci# define ATIF_GET_EXTERNAL_GPU_INFORMATION_SUPPORTED (1 << 20) 988c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_SYSTEM_PARAMETERS 0x1 998c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_SYSTEM_PARAMETERS 1008c2ecf20Sopenharmony_ci * ARG1: none 1018c2ecf20Sopenharmony_ci * OUTPUT: 1028c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1038c2ecf20Sopenharmony_ci * DWORD - valid flags mask 1048c2ecf20Sopenharmony_ci * DWORD - flags 1058c2ecf20Sopenharmony_ci * 1068c2ecf20Sopenharmony_ci * OR 1078c2ecf20Sopenharmony_ci * 1088c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1098c2ecf20Sopenharmony_ci * DWORD - valid flags mask 1108c2ecf20Sopenharmony_ci * DWORD - flags 1118c2ecf20Sopenharmony_ci * BYTE - notify command code 1128c2ecf20Sopenharmony_ci * 1138c2ecf20Sopenharmony_ci * flags 1148c2ecf20Sopenharmony_ci * bits 1:0: 1158c2ecf20Sopenharmony_ci * 0 - Notify(VGA, 0x81) is not used for notification 1168c2ecf20Sopenharmony_ci * 1 - Notify(VGA, 0x81) is used for notification 1178c2ecf20Sopenharmony_ci * 2 - Notify(VGA, n) is used for notification where 1188c2ecf20Sopenharmony_ci * n (0xd0-0xd9) is specified in notify command code. 1198c2ecf20Sopenharmony_ci * bit 2: 1208c2ecf20Sopenharmony_ci * 1 - lid changes not reported though int10 1218c2ecf20Sopenharmony_ci */ 1228c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS 0x2 1238c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS 1248c2ecf20Sopenharmony_ci * ARG1: none 1258c2ecf20Sopenharmony_ci * OUTPUT: 1268c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1278c2ecf20Sopenharmony_ci * DWORD - pending sbios requests 1288c2ecf20Sopenharmony_ci * BYTE - panel expansion mode 1298c2ecf20Sopenharmony_ci * BYTE - thermal state: target gfx controller 1308c2ecf20Sopenharmony_ci * BYTE - thermal state: state id (0: exit state, non-0: state) 1318c2ecf20Sopenharmony_ci * BYTE - forced power state: target gfx controller 1328c2ecf20Sopenharmony_ci * BYTE - forced power state: state id 1338c2ecf20Sopenharmony_ci * BYTE - system power source 1348c2ecf20Sopenharmony_ci * BYTE - panel backlight level (0-255) 1358c2ecf20Sopenharmony_ci */ 1368c2ecf20Sopenharmony_ci/* pending sbios requests */ 1378c2ecf20Sopenharmony_ci# define ATIF_DISPLAY_SWITCH_REQUEST (1 << 0) 1388c2ecf20Sopenharmony_ci# define ATIF_EXPANSION_MODE_CHANGE_REQUEST (1 << 1) 1398c2ecf20Sopenharmony_ci# define ATIF_THERMAL_STATE_CHANGE_REQUEST (1 << 2) 1408c2ecf20Sopenharmony_ci# define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST (1 << 3) 1418c2ecf20Sopenharmony_ci# define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST (1 << 4) 1428c2ecf20Sopenharmony_ci# define ATIF_DISPLAY_CONF_CHANGE_REQUEST (1 << 5) 1438c2ecf20Sopenharmony_ci# define ATIF_PX_GFX_SWITCH_REQUEST (1 << 6) 1448c2ecf20Sopenharmony_ci# define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST (1 << 7) 1458c2ecf20Sopenharmony_ci# define ATIF_DGPU_DISPLAY_EVENT (1 << 8) 1468c2ecf20Sopenharmony_ci/* panel expansion mode */ 1478c2ecf20Sopenharmony_ci# define ATIF_PANEL_EXPANSION_DISABLE 0 1488c2ecf20Sopenharmony_ci# define ATIF_PANEL_EXPANSION_FULL 1 1498c2ecf20Sopenharmony_ci# define ATIF_PANEL_EXPANSION_ASPECT 2 1508c2ecf20Sopenharmony_ci/* target gfx controller */ 1518c2ecf20Sopenharmony_ci# define ATIF_TARGET_GFX_SINGLE 0 1528c2ecf20Sopenharmony_ci# define ATIF_TARGET_GFX_PX_IGPU 1 1538c2ecf20Sopenharmony_ci# define ATIF_TARGET_GFX_PX_DGPU 2 1548c2ecf20Sopenharmony_ci/* system power source */ 1558c2ecf20Sopenharmony_ci# define ATIF_POWER_SOURCE_AC 1 1568c2ecf20Sopenharmony_ci# define ATIF_POWER_SOURCE_DC 2 1578c2ecf20Sopenharmony_ci# define ATIF_POWER_SOURCE_RESTRICTED_AC_1 3 1588c2ecf20Sopenharmony_ci# define ATIF_POWER_SOURCE_RESTRICTED_AC_2 4 1598c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS 0x3 1608c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS 1618c2ecf20Sopenharmony_ci * ARG1: 1628c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1638c2ecf20Sopenharmony_ci * WORD - selected displays 1648c2ecf20Sopenharmony_ci * WORD - connected displays 1658c2ecf20Sopenharmony_ci * OUTPUT: 1668c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1678c2ecf20Sopenharmony_ci * WORD - selected displays 1688c2ecf20Sopenharmony_ci */ 1698c2ecf20Sopenharmony_ci# define ATIF_LCD1 (1 << 0) 1708c2ecf20Sopenharmony_ci# define ATIF_CRT1 (1 << 1) 1718c2ecf20Sopenharmony_ci# define ATIF_TV (1 << 2) 1728c2ecf20Sopenharmony_ci# define ATIF_DFP1 (1 << 3) 1738c2ecf20Sopenharmony_ci# define ATIF_CRT2 (1 << 4) 1748c2ecf20Sopenharmony_ci# define ATIF_LCD2 (1 << 5) 1758c2ecf20Sopenharmony_ci# define ATIF_DFP2 (1 << 7) 1768c2ecf20Sopenharmony_ci# define ATIF_CV (1 << 8) 1778c2ecf20Sopenharmony_ci# define ATIF_DFP3 (1 << 9) 1788c2ecf20Sopenharmony_ci# define ATIF_DFP4 (1 << 10) 1798c2ecf20Sopenharmony_ci# define ATIF_DFP5 (1 << 11) 1808c2ecf20Sopenharmony_ci# define ATIF_DFP6 (1 << 12) 1818c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_LID_STATE 0x4 1828c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_LID_STATE 1838c2ecf20Sopenharmony_ci * ARG1: none 1848c2ecf20Sopenharmony_ci * OUTPUT: 1858c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1868c2ecf20Sopenharmony_ci * BYTE - lid state (0: open, 1: closed) 1878c2ecf20Sopenharmony_ci * 1888c2ecf20Sopenharmony_ci * GET_LID_STATE only works at boot and resume, for general lid 1898c2ecf20Sopenharmony_ci * status, use the kernel provided status 1908c2ecf20Sopenharmony_ci */ 1918c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS 0x5 1928c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS 1938c2ecf20Sopenharmony_ci * ARG1: none 1948c2ecf20Sopenharmony_ci * OUTPUT: 1958c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 1968c2ecf20Sopenharmony_ci * BYTE - 0 1978c2ecf20Sopenharmony_ci * BYTE - TV standard 1988c2ecf20Sopenharmony_ci */ 1998c2ecf20Sopenharmony_ci# define ATIF_TV_STD_NTSC 0 2008c2ecf20Sopenharmony_ci# define ATIF_TV_STD_PAL 1 2018c2ecf20Sopenharmony_ci# define ATIF_TV_STD_PALM 2 2028c2ecf20Sopenharmony_ci# define ATIF_TV_STD_PAL60 3 2038c2ecf20Sopenharmony_ci# define ATIF_TV_STD_NTSCJ 4 2048c2ecf20Sopenharmony_ci# define ATIF_TV_STD_PALCN 5 2058c2ecf20Sopenharmony_ci# define ATIF_TV_STD_PALN 6 2068c2ecf20Sopenharmony_ci# define ATIF_TV_STD_SCART_RGB 9 2078c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS 0x6 2088c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS 2098c2ecf20Sopenharmony_ci * ARG1: 2108c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 2118c2ecf20Sopenharmony_ci * BYTE - 0 2128c2ecf20Sopenharmony_ci * BYTE - TV standard 2138c2ecf20Sopenharmony_ci * OUTPUT: none 2148c2ecf20Sopenharmony_ci */ 2158c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS 0x7 2168c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS 2178c2ecf20Sopenharmony_ci * ARG1: none 2188c2ecf20Sopenharmony_ci * OUTPUT: 2198c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 2208c2ecf20Sopenharmony_ci * BYTE - panel expansion mode 2218c2ecf20Sopenharmony_ci */ 2228c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS 0x8 2238c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS 2248c2ecf20Sopenharmony_ci * ARG1: 2258c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 2268c2ecf20Sopenharmony_ci * BYTE - panel expansion mode 2278c2ecf20Sopenharmony_ci * OUTPUT: none 2288c2ecf20Sopenharmony_ci */ 2298c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION 0xD 2308c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION 2318c2ecf20Sopenharmony_ci * ARG1: 2328c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 2338c2ecf20Sopenharmony_ci * WORD - gfx controller id 2348c2ecf20Sopenharmony_ci * BYTE - current temperature (degress Celsius) 2358c2ecf20Sopenharmony_ci * OUTPUT: none 2368c2ecf20Sopenharmony_ci */ 2378c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES 0xF 2388c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES 2398c2ecf20Sopenharmony_ci * ARG1: none 2408c2ecf20Sopenharmony_ci * OUTPUT: 2418c2ecf20Sopenharmony_ci * WORD - number of gfx devices 2428c2ecf20Sopenharmony_ci * WORD - device structure size in bytes (excludes device size field) 2438c2ecf20Sopenharmony_ci * DWORD - flags \ 2448c2ecf20Sopenharmony_ci * WORD - bus number } repeated structure 2458c2ecf20Sopenharmony_ci * WORD - device number / 2468c2ecf20Sopenharmony_ci */ 2478c2ecf20Sopenharmony_ci/* flags */ 2488c2ecf20Sopenharmony_ci# define ATIF_PX_REMOVABLE_GRAPHICS_DEVICE (1 << 0) 2498c2ecf20Sopenharmony_ci# define ATIF_XGP_PORT (1 << 1) 2508c2ecf20Sopenharmony_ci# define ATIF_VGA_ENABLED_GRAPHICS_DEVICE (1 << 2) 2518c2ecf20Sopenharmony_ci# define ATIF_XGP_PORT_IN_DOCK (1 << 3) 2528c2ecf20Sopenharmony_ci#define ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION 0x15 2538c2ecf20Sopenharmony_ci/* ARG0: ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION 2548c2ecf20Sopenharmony_ci * ARG1: none 2558c2ecf20Sopenharmony_ci * OUTPUT: 2568c2ecf20Sopenharmony_ci * WORD - number of reported external gfx devices 2578c2ecf20Sopenharmony_ci * WORD - device structure size in bytes (excludes device size field) 2588c2ecf20Sopenharmony_ci * WORD - flags \ 2598c2ecf20Sopenharmony_ci * WORD - bus number / repeated structure 2608c2ecf20Sopenharmony_ci */ 2618c2ecf20Sopenharmony_ci/* flags */ 2628c2ecf20Sopenharmony_ci# define ATIF_EXTERNAL_GRAPHICS_PORT (1 << 0) 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_ci/* ATPX */ 2658c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_VERIFY_INTERFACE 0x0 2668c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_VERIFY_INTERFACE 2678c2ecf20Sopenharmony_ci * ARG1: none 2688c2ecf20Sopenharmony_ci * OUTPUT: 2698c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 2708c2ecf20Sopenharmony_ci * WORD - version 2718c2ecf20Sopenharmony_ci * DWORD - supported functions bit vector 2728c2ecf20Sopenharmony_ci */ 2738c2ecf20Sopenharmony_ci/* supported functions vector */ 2748c2ecf20Sopenharmony_ci# define ATPX_GET_PX_PARAMETERS_SUPPORTED (1 << 0) 2758c2ecf20Sopenharmony_ci# define ATPX_POWER_CONTROL_SUPPORTED (1 << 1) 2768c2ecf20Sopenharmony_ci# define ATPX_DISPLAY_MUX_CONTROL_SUPPORTED (1 << 2) 2778c2ecf20Sopenharmony_ci# define ATPX_I2C_MUX_CONTROL_SUPPORTED (1 << 3) 2788c2ecf20Sopenharmony_ci# define ATPX_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION_SUPPORTED (1 << 4) 2798c2ecf20Sopenharmony_ci# define ATPX_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION_SUPPORTED (1 << 5) 2808c2ecf20Sopenharmony_ci# define ATPX_GET_DISPLAY_CONNECTORS_MAPPING_SUPPORTED (1 << 7) 2818c2ecf20Sopenharmony_ci# define ATPX_GET_DISPLAY_DETECTION_PORTS_SUPPORTED (1 << 8) 2828c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_GET_PX_PARAMETERS 0x1 2838c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_GET_PX_PARAMETERS 2848c2ecf20Sopenharmony_ci * ARG1: none 2858c2ecf20Sopenharmony_ci * OUTPUT: 2868c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 2878c2ecf20Sopenharmony_ci * DWORD - valid flags mask 2888c2ecf20Sopenharmony_ci * DWORD - flags 2898c2ecf20Sopenharmony_ci */ 2908c2ecf20Sopenharmony_ci/* flags */ 2918c2ecf20Sopenharmony_ci# define ATPX_LVDS_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 0) 2928c2ecf20Sopenharmony_ci# define ATPX_CRT1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 1) 2938c2ecf20Sopenharmony_ci# define ATPX_DVI1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 2) 2948c2ecf20Sopenharmony_ci# define ATPX_CRT1_RGB_SIGNAL_MUXED (1 << 3) 2958c2ecf20Sopenharmony_ci# define ATPX_TV_SIGNAL_MUXED (1 << 4) 2968c2ecf20Sopenharmony_ci# define ATPX_DFP_SIGNAL_MUXED (1 << 5) 2978c2ecf20Sopenharmony_ci# define ATPX_SEPARATE_MUX_FOR_I2C (1 << 6) 2988c2ecf20Sopenharmony_ci# define ATPX_DYNAMIC_PX_SUPPORTED (1 << 7) 2998c2ecf20Sopenharmony_ci# define ATPX_ACF_NOT_SUPPORTED (1 << 8) 3008c2ecf20Sopenharmony_ci# define ATPX_FIXED_NOT_SUPPORTED (1 << 9) 3018c2ecf20Sopenharmony_ci# define ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED (1 << 10) 3028c2ecf20Sopenharmony_ci# define ATPX_DGPU_REQ_POWER_FOR_DISPLAYS (1 << 11) 3038c2ecf20Sopenharmony_ci# define ATPX_DGPU_CAN_DRIVE_DISPLAYS (1 << 12) 3048c2ecf20Sopenharmony_ci# define ATPX_MS_HYBRID_GFX_SUPPORTED (1 << 14) 3058c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_POWER_CONTROL 0x2 3068c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_POWER_CONTROL 3078c2ecf20Sopenharmony_ci * ARG1: 3088c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 3098c2ecf20Sopenharmony_ci * BYTE - dGPU power state (0: power off, 1: power on) 3108c2ecf20Sopenharmony_ci * OUTPUT: none 3118c2ecf20Sopenharmony_ci */ 3128c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_DISPLAY_MUX_CONTROL 0x3 3138c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_DISPLAY_MUX_CONTROL 3148c2ecf20Sopenharmony_ci * ARG1: 3158c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 3168c2ecf20Sopenharmony_ci * WORD - display mux control (0: iGPU, 1: dGPU) 3178c2ecf20Sopenharmony_ci * OUTPUT: none 3188c2ecf20Sopenharmony_ci */ 3198c2ecf20Sopenharmony_ci# define ATPX_INTEGRATED_GPU 0 3208c2ecf20Sopenharmony_ci# define ATPX_DISCRETE_GPU 1 3218c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_I2C_MUX_CONTROL 0x4 3228c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_I2C_MUX_CONTROL 3238c2ecf20Sopenharmony_ci * ARG1: 3248c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 3258c2ecf20Sopenharmony_ci * WORD - i2c/aux/hpd mux control (0: iGPU, 1: dGPU) 3268c2ecf20Sopenharmony_ci * OUTPUT: none 3278c2ecf20Sopenharmony_ci */ 3288c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION 0x5 3298c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION 3308c2ecf20Sopenharmony_ci * ARG1: 3318c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 3328c2ecf20Sopenharmony_ci * WORD - target gpu (0: iGPU, 1: dGPU) 3338c2ecf20Sopenharmony_ci * OUTPUT: none 3348c2ecf20Sopenharmony_ci */ 3358c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION 0x6 3368c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION 3378c2ecf20Sopenharmony_ci * ARG1: 3388c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 3398c2ecf20Sopenharmony_ci * WORD - target gpu (0: iGPU, 1: dGPU) 3408c2ecf20Sopenharmony_ci * OUTPUT: none 3418c2ecf20Sopenharmony_ci */ 3428c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING 0x8 3438c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING 3448c2ecf20Sopenharmony_ci * ARG1: none 3458c2ecf20Sopenharmony_ci * OUTPUT: 3468c2ecf20Sopenharmony_ci * WORD - number of display connectors 3478c2ecf20Sopenharmony_ci * WORD - connector structure size in bytes (excludes connector size field) 3488c2ecf20Sopenharmony_ci * BYTE - flags \ 3498c2ecf20Sopenharmony_ci * BYTE - ATIF display vector bit position } repeated 3508c2ecf20Sopenharmony_ci * BYTE - adapter id (0: iGPU, 1-n: dGPU ordered by pcie bus number) } structure 3518c2ecf20Sopenharmony_ci * WORD - connector ACPI id / 3528c2ecf20Sopenharmony_ci */ 3538c2ecf20Sopenharmony_ci/* flags */ 3548c2ecf20Sopenharmony_ci# define ATPX_DISPLAY_OUTPUT_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 0) 3558c2ecf20Sopenharmony_ci# define ATPX_DISPLAY_HPD_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 1) 3568c2ecf20Sopenharmony_ci# define ATPX_DISPLAY_I2C_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 2) 3578c2ecf20Sopenharmony_ci#define ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS 0x9 3588c2ecf20Sopenharmony_ci/* ARG0: ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS 3598c2ecf20Sopenharmony_ci * ARG1: none 3608c2ecf20Sopenharmony_ci * OUTPUT: 3618c2ecf20Sopenharmony_ci * WORD - number of HPD/DDC ports 3628c2ecf20Sopenharmony_ci * WORD - port structure size in bytes (excludes port size field) 3638c2ecf20Sopenharmony_ci * BYTE - ATIF display vector bit position \ 3648c2ecf20Sopenharmony_ci * BYTE - hpd id } reapeated structure 3658c2ecf20Sopenharmony_ci * BYTE - ddc id / 3668c2ecf20Sopenharmony_ci * 3678c2ecf20Sopenharmony_ci * available on A+A systems only 3688c2ecf20Sopenharmony_ci */ 3698c2ecf20Sopenharmony_ci/* hpd id */ 3708c2ecf20Sopenharmony_ci# define ATPX_HPD_NONE 0 3718c2ecf20Sopenharmony_ci# define ATPX_HPD1 1 3728c2ecf20Sopenharmony_ci# define ATPX_HPD2 2 3738c2ecf20Sopenharmony_ci# define ATPX_HPD3 3 3748c2ecf20Sopenharmony_ci# define ATPX_HPD4 4 3758c2ecf20Sopenharmony_ci# define ATPX_HPD5 5 3768c2ecf20Sopenharmony_ci# define ATPX_HPD6 6 3778c2ecf20Sopenharmony_ci/* ddc id */ 3788c2ecf20Sopenharmony_ci# define ATPX_DDC_NONE 0 3798c2ecf20Sopenharmony_ci# define ATPX_DDC1 1 3808c2ecf20Sopenharmony_ci# define ATPX_DDC2 2 3818c2ecf20Sopenharmony_ci# define ATPX_DDC3 3 3828c2ecf20Sopenharmony_ci# define ATPX_DDC4 4 3838c2ecf20Sopenharmony_ci# define ATPX_DDC5 5 3848c2ecf20Sopenharmony_ci# define ATPX_DDC6 6 3858c2ecf20Sopenharmony_ci# define ATPX_DDC7 7 3868c2ecf20Sopenharmony_ci# define ATPX_DDC8 8 3878c2ecf20Sopenharmony_ci 3888c2ecf20Sopenharmony_ci/* ATCS */ 3898c2ecf20Sopenharmony_ci#define ATCS_FUNCTION_VERIFY_INTERFACE 0x0 3908c2ecf20Sopenharmony_ci/* ARG0: ATCS_FUNCTION_VERIFY_INTERFACE 3918c2ecf20Sopenharmony_ci * ARG1: none 3928c2ecf20Sopenharmony_ci * OUTPUT: 3938c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 3948c2ecf20Sopenharmony_ci * WORD - version 3958c2ecf20Sopenharmony_ci * DWORD - supported functions bit vector 3968c2ecf20Sopenharmony_ci */ 3978c2ecf20Sopenharmony_ci/* supported functions vector */ 3988c2ecf20Sopenharmony_ci# define ATCS_GET_EXTERNAL_STATE_SUPPORTED (1 << 0) 3998c2ecf20Sopenharmony_ci# define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED (1 << 1) 4008c2ecf20Sopenharmony_ci# define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED (1 << 2) 4018c2ecf20Sopenharmony_ci# define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED (1 << 3) 4028c2ecf20Sopenharmony_ci#define ATCS_FUNCTION_GET_EXTERNAL_STATE 0x1 4038c2ecf20Sopenharmony_ci/* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE 4048c2ecf20Sopenharmony_ci * ARG1: none 4058c2ecf20Sopenharmony_ci * OUTPUT: 4068c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 4078c2ecf20Sopenharmony_ci * DWORD - valid flags mask 4088c2ecf20Sopenharmony_ci * DWORD - flags (0: undocked, 1: docked) 4098c2ecf20Sopenharmony_ci */ 4108c2ecf20Sopenharmony_ci/* flags */ 4118c2ecf20Sopenharmony_ci# define ATCS_DOCKED (1 << 0) 4128c2ecf20Sopenharmony_ci#define ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST 0x2 4138c2ecf20Sopenharmony_ci/* ARG0: ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST 4148c2ecf20Sopenharmony_ci * ARG1: 4158c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 4168c2ecf20Sopenharmony_ci * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) 4178c2ecf20Sopenharmony_ci * WORD - valid flags mask 4188c2ecf20Sopenharmony_ci * WORD - flags 4198c2ecf20Sopenharmony_ci * BYTE - request type 4208c2ecf20Sopenharmony_ci * BYTE - performance request 4218c2ecf20Sopenharmony_ci * OUTPUT: 4228c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 4238c2ecf20Sopenharmony_ci * BYTE - return value 4248c2ecf20Sopenharmony_ci */ 4258c2ecf20Sopenharmony_ci/* flags */ 4268c2ecf20Sopenharmony_ci# define ATCS_ADVERTISE_CAPS (1 << 0) 4278c2ecf20Sopenharmony_ci# define ATCS_WAIT_FOR_COMPLETION (1 << 1) 4288c2ecf20Sopenharmony_ci/* request type */ 4298c2ecf20Sopenharmony_ci# define ATCS_PCIE_LINK_SPEED 1 4308c2ecf20Sopenharmony_ci/* performance request */ 4318c2ecf20Sopenharmony_ci# define ATCS_REMOVE 0 4328c2ecf20Sopenharmony_ci# define ATCS_FORCE_LOW_POWER 1 4338c2ecf20Sopenharmony_ci# define ATCS_PERF_LEVEL_1 2 /* PCIE Gen 1 */ 4348c2ecf20Sopenharmony_ci# define ATCS_PERF_LEVEL_2 3 /* PCIE Gen 2 */ 4358c2ecf20Sopenharmony_ci# define ATCS_PERF_LEVEL_3 4 /* PCIE Gen 3 */ 4368c2ecf20Sopenharmony_ci/* return value */ 4378c2ecf20Sopenharmony_ci# define ATCS_REQUEST_REFUSED 1 4388c2ecf20Sopenharmony_ci# define ATCS_REQUEST_COMPLETE 2 4398c2ecf20Sopenharmony_ci# define ATCS_REQUEST_IN_PROGRESS 3 4408c2ecf20Sopenharmony_ci#define ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION 0x3 4418c2ecf20Sopenharmony_ci/* ARG0: ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION 4428c2ecf20Sopenharmony_ci * ARG1: none 4438c2ecf20Sopenharmony_ci * OUTPUT: none 4448c2ecf20Sopenharmony_ci */ 4458c2ecf20Sopenharmony_ci#define ATCS_FUNCTION_SET_PCIE_BUS_WIDTH 0x4 4468c2ecf20Sopenharmony_ci/* ARG0: ATCS_FUNCTION_SET_PCIE_BUS_WIDTH 4478c2ecf20Sopenharmony_ci * ARG1: 4488c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 4498c2ecf20Sopenharmony_ci * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) 4508c2ecf20Sopenharmony_ci * BYTE - number of active lanes 4518c2ecf20Sopenharmony_ci * OUTPUT: 4528c2ecf20Sopenharmony_ci * WORD - structure size in bytes (includes size field) 4538c2ecf20Sopenharmony_ci * BYTE - number of active lanes 4548c2ecf20Sopenharmony_ci */ 4558c2ecf20Sopenharmony_ci 4568c2ecf20Sopenharmony_ci#endif 457