15fc3aeebSyanyang1 /* 25fc3aeebSyanyang1 * Copyright 2015 Advanced Micro Devices, Inc. 35fc3aeebSyanyang1 * 45fc3aeebSyanyang1 * Permission is hereby granted, free of charge, to any person obtaining a 55fc3aeebSyanyang1 * copy of this software and associated documentation files (the "Software"), 65fc3aeebSyanyang1 * to deal in the Software without restriction, including without limitation 75fc3aeebSyanyang1 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 85fc3aeebSyanyang1 * and/or sell copies of the Software, and to permit persons to whom the 95fc3aeebSyanyang1 * Software is furnished to do so, subject to the following conditions: 105fc3aeebSyanyang1 * 115fc3aeebSyanyang1 * The above copyright notice and this permission notice shall be included in 125fc3aeebSyanyang1 * all copies or substantial portions of the Software. 135fc3aeebSyanyang1 * 145fc3aeebSyanyang1 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 155fc3aeebSyanyang1 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 165fc3aeebSyanyang1 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 175fc3aeebSyanyang1 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 185fc3aeebSyanyang1 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 195fc3aeebSyanyang1 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 205fc3aeebSyanyang1 * OTHER DEALINGS IN THE SOFTWARE. 215fc3aeebSyanyang1 */ 225fc3aeebSyanyang1 235fc3aeebSyanyang1 #ifndef __AMD_SHARED_H__ 245fc3aeebSyanyang1 #define __AMD_SHARED_H__ 255fc3aeebSyanyang1 26f674bd28SAkshu Agrawal #include <drm/amd_asic_type.h> 270b2daf09SJammy Zhou 28cfa289fdSRex Zhu 29617a64dcSEvan Quan #define AMD_MAX_USEC_TIMEOUT 1000000 /* 1000 ms */ 302f7d10b3SJammy Zhou 312f7d10b3SJammy Zhou /* 322f7d10b3SJammy Zhou * Chip flags 332f7d10b3SJammy Zhou */ 342f7d10b3SJammy Zhou enum amd_chip_flags { 352f7d10b3SJammy Zhou AMD_ASIC_MASK = 0x0000ffffUL, 362f7d10b3SJammy Zhou AMD_FLAGS_MASK = 0xffff0000UL, 372f7d10b3SJammy Zhou AMD_IS_MOBILITY = 0x00010000UL, 382f7d10b3SJammy Zhou AMD_IS_APU = 0x00020000UL, 392f7d10b3SJammy Zhou AMD_IS_PX = 0x00040000UL, 402f7d10b3SJammy Zhou AMD_EXP_HW_SUPPORT = 0x00080000UL, 412f7d10b3SJammy Zhou }; 422f7d10b3SJammy Zhou 4354f78a76SAlex Deucher enum amd_apu_flags { 4454f78a76SAlex Deucher AMD_APU_IS_RAVEN = 0x00000001UL, 4554f78a76SAlex Deucher AMD_APU_IS_RAVEN2 = 0x00000002UL, 4654f78a76SAlex Deucher AMD_APU_IS_PICASSO = 0x00000004UL, 4754f78a76SAlex Deucher AMD_APU_IS_RENOIR = 0x00000008UL, 48d205c3ccSAlex Deucher AMD_APU_IS_GREEN_SARDINE = 0x00000010UL, 49c345c89bSHuang Rui AMD_APU_IS_VANGOGH = 0x00000020UL, 50d0f56dc2STao Zhou AMD_APU_IS_CYAN_SKILLFISH2 = 0x00000040UL, 5154f78a76SAlex Deucher }; 5254f78a76SAlex Deucher 5352ef3a1aSRyan Taylor /** 5452ef3a1aSRyan Taylor * DOC: IP Blocks 5552ef3a1aSRyan Taylor * 5652ef3a1aSRyan Taylor * GPUs are composed of IP (intellectual property) blocks. These 5752ef3a1aSRyan Taylor * IP blocks provide various functionalities: display, graphics, 5852ef3a1aSRyan Taylor * video decode, etc. The IP blocks that comprise a particular GPU 5952ef3a1aSRyan Taylor * are listed in the GPU's respective SoC file. amdgpu_device.c 6052ef3a1aSRyan Taylor * acquires the list of IP blocks for the GPU in use on initialization. 6152ef3a1aSRyan Taylor * It can then operate on this list to perform standard driver operations 6252ef3a1aSRyan Taylor * such as: init, fini, suspend, resume, etc. 6352ef3a1aSRyan Taylor * 6452ef3a1aSRyan Taylor * 6552ef3a1aSRyan Taylor * IP block implementations are named using the following convention: 6652ef3a1aSRyan Taylor * <functionality>_v<version> (E.g.: gfx_v6_0). 6752ef3a1aSRyan Taylor */ 6852ef3a1aSRyan Taylor 6952ef3a1aSRyan Taylor /** 7052ef3a1aSRyan Taylor * enum amd_ip_block_type - Used to classify IP blocks by functionality. 7152ef3a1aSRyan Taylor * 7252ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_COMMON: GPU Family 7352ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_GMC: Graphics Memory Controller 7452ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_IH: Interrupt Handler 7552ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_SMC: System Management Controller 7652ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_PSP: Platform Security Processor 7752ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_DCE: Display and Compositing Engine 7852ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_GFX: Graphics and Compute Engine 7952ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_SDMA: System DMA Engine 8052ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_UVD: Unified Video Decoder 8152ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_VCE: Video Compression Engine 8252ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_ACP: Audio Co-Processor 8352ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_VCN: Video Core/Codec Next 8452ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_MES: Micro-Engine Scheduler 8552ef3a1aSRyan Taylor * @AMD_IP_BLOCK_TYPE_JPEG: JPEG Engine 86239d6de3SEvan Quan * @AMD_IP_BLOCK_TYPE_NUM: Total number of IP block types 8752ef3a1aSRyan Taylor */ 885fc3aeebSyanyang1 enum amd_ip_block_type { 895fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_COMMON, 905fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_GMC, 915fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_IH, 925fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_SMC, 930e5ca0d1SHuang Rui AMD_IP_BLOCK_TYPE_PSP, 945fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_DCE, 955fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_GFX, 965fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_SDMA, 975fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_UVD, 985fc3aeebSyanyang1 AMD_IP_BLOCK_TYPE_VCE, 99a8fe58ceSMaruthi Bayyavarapu AMD_IP_BLOCK_TYPE_ACP, 100886f82aaSJack Xiao AMD_IP_BLOCK_TYPE_VCN, 1018d1b04a6SLeo Liu AMD_IP_BLOCK_TYPE_MES, 1026c08e0efSEvan Quan AMD_IP_BLOCK_TYPE_JPEG, 1036c08e0efSEvan Quan AMD_IP_BLOCK_TYPE_NUM, 1045fc3aeebSyanyang1 }; 1055fc3aeebSyanyang1 1065fc3aeebSyanyang1 enum amd_clockgating_state { 1075fc3aeebSyanyang1 AMD_CG_STATE_GATE = 0, 1085fc3aeebSyanyang1 AMD_CG_STATE_UNGATE, 1095fc3aeebSyanyang1 }; 1105fc3aeebSyanyang1 111e5d03ac2SRex Zhu 1125fc3aeebSyanyang1 enum amd_powergating_state { 1135fc3aeebSyanyang1 AMD_PG_STATE_GATE = 0, 1145fc3aeebSyanyang1 AMD_PG_STATE_UNGATE, 1155fc3aeebSyanyang1 }; 1165fc3aeebSyanyang1 117cfa289fdSRex Zhu 118e3b04bc7SAlex Deucher /* CG flags */ 11925faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_MGCG (1ULL << 0) 12025faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_MGLS (1ULL << 1) 12125faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_CGCG (1ULL << 2) 12225faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_CGLS (1ULL << 3) 12325faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_CGTS (1ULL << 4) 12425faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_CGTS_LS (1ULL << 5) 12525faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_CP_LS (1ULL << 6) 12625faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_RLC_LS (1ULL << 7) 12725faeddcSEvan Quan #define AMD_CG_SUPPORT_MC_LS (1ULL << 8) 12825faeddcSEvan Quan #define AMD_CG_SUPPORT_MC_MGCG (1ULL << 9) 12925faeddcSEvan Quan #define AMD_CG_SUPPORT_SDMA_LS (1ULL << 10) 13025faeddcSEvan Quan #define AMD_CG_SUPPORT_SDMA_MGCG (1ULL << 11) 13125faeddcSEvan Quan #define AMD_CG_SUPPORT_BIF_LS (1ULL << 12) 13225faeddcSEvan Quan #define AMD_CG_SUPPORT_UVD_MGCG (1ULL << 13) 13325faeddcSEvan Quan #define AMD_CG_SUPPORT_VCE_MGCG (1ULL << 14) 13425faeddcSEvan Quan #define AMD_CG_SUPPORT_HDP_LS (1ULL << 15) 13525faeddcSEvan Quan #define AMD_CG_SUPPORT_HDP_MGCG (1ULL << 16) 13625faeddcSEvan Quan #define AMD_CG_SUPPORT_ROM_MGCG (1ULL << 17) 13725faeddcSEvan Quan #define AMD_CG_SUPPORT_DRM_LS (1ULL << 18) 13825faeddcSEvan Quan #define AMD_CG_SUPPORT_BIF_MGCG (1ULL << 19) 13925faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_3D_CGCG (1ULL << 20) 14025faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_3D_CGLS (1ULL << 21) 14125faeddcSEvan Quan #define AMD_CG_SUPPORT_DRM_MGCG (1ULL << 22) 14225faeddcSEvan Quan #define AMD_CG_SUPPORT_DF_MGCG (1ULL << 23) 14325faeddcSEvan Quan #define AMD_CG_SUPPORT_VCN_MGCG (1ULL << 24) 14425faeddcSEvan Quan #define AMD_CG_SUPPORT_HDP_DS (1ULL << 25) 14525faeddcSEvan Quan #define AMD_CG_SUPPORT_HDP_SD (1ULL << 26) 14625faeddcSEvan Quan #define AMD_CG_SUPPORT_IH_CG (1ULL << 27) 14725faeddcSEvan Quan #define AMD_CG_SUPPORT_ATHUB_LS (1ULL << 28) 14825faeddcSEvan Quan #define AMD_CG_SUPPORT_ATHUB_MGCG (1ULL << 29) 14925faeddcSEvan Quan #define AMD_CG_SUPPORT_JPEG_MGCG (1ULL << 30) 15025faeddcSEvan Quan #define AMD_CG_SUPPORT_GFX_FGCG (1ULL << 31) 151e3b04bc7SAlex Deucher /* PG flags */ 152e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_GFX_PG (1 << 0) 153e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_GFX_SMG (1 << 1) 154e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_GFX_DMG (1 << 2) 155e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_UVD (1 << 3) 156e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_VCE (1 << 4) 157e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_CP (1 << 5) 158e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_GDS (1 << 6) 159e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_RLC_SMU_HS (1 << 7) 160e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_SDMA (1 << 8) 161e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_ACP (1 << 9) 162e3b04bc7SAlex Deucher #define AMD_PG_SUPPORT_SAMU (1 << 10) 1636b0432b7SAlex Deucher #define AMD_PG_SUPPORT_GFX_QUICK_MG (1 << 11) 1646b0432b7SAlex Deucher #define AMD_PG_SUPPORT_GFX_PIPELINE (1 << 12) 165f8386b35SHawking Zhang #define AMD_PG_SUPPORT_MMHUB (1 << 13) 1668dbb8cdfSRex Zhu #define AMD_PG_SUPPORT_VCN (1 << 14) 167f28ff062SJames Zhu #define AMD_PG_SUPPORT_VCN_DPG (1 << 15) 168a201b6acSHuang Rui #define AMD_PG_SUPPORT_ATHUB (1 << 16) 16918e6d414SLeo Liu #define AMD_PG_SUPPORT_JPEG (1 << 17) 170e3b04bc7SAlex Deucher 171549750a3SRyan Taylor /** 172549750a3SRyan Taylor * enum PP_FEATURE_MASK - Used to mask power play features. 173549750a3SRyan Taylor * 174549750a3SRyan Taylor * @PP_SCLK_DPM_MASK: Dynamic adjustment of the system (graphics) clock. 175549750a3SRyan Taylor * @PP_MCLK_DPM_MASK: Dynamic adjustment of the memory clock. 176549750a3SRyan Taylor * @PP_PCIE_DPM_MASK: Dynamic adjustment of PCIE clocks and lanes. 177549750a3SRyan Taylor * @PP_SCLK_DEEP_SLEEP_MASK: System (graphics) clock deep sleep. 178549750a3SRyan Taylor * @PP_POWER_CONTAINMENT_MASK: Power containment. 179549750a3SRyan Taylor * @PP_UVD_HANDSHAKE_MASK: Unified video decoder handshake. 180549750a3SRyan Taylor * @PP_SMC_VOLTAGE_CONTROL_MASK: Dynamic voltage control. 181549750a3SRyan Taylor * @PP_VBI_TIME_SUPPORT_MASK: Vertical blank interval support. 182549750a3SRyan Taylor * @PP_ULV_MASK: Ultra low voltage. 183549750a3SRyan Taylor * @PP_ENABLE_GFX_CG_THRU_SMU: SMU control of GFX engine clockgating. 184549750a3SRyan Taylor * @PP_CLOCK_STRETCH_MASK: Clock stretching. 185549750a3SRyan Taylor * @PP_OD_FUZZY_FAN_CONTROL_MASK: Overdrive fuzzy fan control. 186549750a3SRyan Taylor * @PP_SOCCLK_DPM_MASK: Dynamic adjustment of the SoC clock. 187549750a3SRyan Taylor * @PP_DCEFCLK_DPM_MASK: Dynamic adjustment of the Display Controller Engine Fabric clock. 188549750a3SRyan Taylor * @PP_OVERDRIVE_MASK: Over- and under-clocking support. 189549750a3SRyan Taylor * @PP_GFXOFF_MASK: Dynamic graphics engine power control. 190549750a3SRyan Taylor * @PP_ACG_MASK: Adaptive clock generator. 191549750a3SRyan Taylor * @PP_STUTTER_MODE: Stutter mode. 192549750a3SRyan Taylor * @PP_AVFS_MASK: Adaptive voltage and frequency scaling. 193549750a3SRyan Taylor * 194549750a3SRyan Taylor * To override these settings on boot, append amdgpu.ppfeaturemask=<mask> to 195549750a3SRyan Taylor * the kernel's command line parameters. This is usually done through a system's 196549750a3SRyan Taylor * boot loader (E.g. GRUB). If manually loading the driver, pass 197549750a3SRyan Taylor * ppfeaturemask=<mask> as a modprobe parameter. 198549750a3SRyan Taylor */ 199fa7bd27dSHuang Rui enum PP_FEATURE_MASK { 200fa7bd27dSHuang Rui PP_SCLK_DPM_MASK = 0x1, 201fa7bd27dSHuang Rui PP_MCLK_DPM_MASK = 0x2, 202fa7bd27dSHuang Rui PP_PCIE_DPM_MASK = 0x4, 203fa7bd27dSHuang Rui PP_SCLK_DEEP_SLEEP_MASK = 0x8, 204fa7bd27dSHuang Rui PP_POWER_CONTAINMENT_MASK = 0x10, 205fa7bd27dSHuang Rui PP_UVD_HANDSHAKE_MASK = 0x20, 206fa7bd27dSHuang Rui PP_SMC_VOLTAGE_CONTROL_MASK = 0x40, 207fa7bd27dSHuang Rui PP_VBI_TIME_SUPPORT_MASK = 0x80, 208fa7bd27dSHuang Rui PP_ULV_MASK = 0x100, 209fa7bd27dSHuang Rui PP_ENABLE_GFX_CG_THRU_SMU = 0x200, 210fa7bd27dSHuang Rui PP_CLOCK_STRETCH_MASK = 0x400, 211fa7bd27dSHuang Rui PP_OD_FUZZY_FAN_CONTROL_MASK = 0x800, 212fa7bd27dSHuang Rui PP_SOCCLK_DPM_MASK = 0x1000, 213fa7bd27dSHuang Rui PP_DCEFCLK_DPM_MASK = 0x2000, 214fa7bd27dSHuang Rui PP_OVERDRIVE_MASK = 0x4000, 2156f92ad2aSHuang Rui PP_GFXOFF_MASK = 0x8000, 216fa7bd27dSHuang Rui PP_ACG_MASK = 0x10000, 21722994e16Srex zhu PP_STUTTER_MODE = 0x20000, 218a4ead3e5SAlex Deucher PP_AVFS_MASK = 0x40000, 219680602d6SKenneth Feng PP_GFX_DCS_MASK = 0x80000, 220fa7bd27dSHuang Rui }; 221fa7bd27dSHuang Rui 22283a0b863SLikun GAO enum amd_harvest_ip_mask { 22383a0b863SLikun GAO AMD_HARVEST_IP_VCN_MASK = 0x1, 22483a0b863SLikun GAO AMD_HARVEST_IP_JPEG_MASK = 0x2, 22583a0b863SLikun GAO AMD_HARVEST_IP_DMU_MASK = 0x4, 22683a0b863SLikun GAO }; 22783a0b863SLikun GAO 2287875a226SAlex Deucher enum DC_FEATURE_MASK { 229a5148245SZhan Liu //Default value can be found at "uint amdgpu_dc_feature_mask" 230a5148245SZhan Liu DC_FBC_MASK = (1 << 0), //0x1, disabled by default 231a5148245SZhan Liu DC_MULTI_MON_PP_MCLK_SWITCH_MASK = (1 << 1), //0x2, enabled by default 232a5148245SZhan Liu DC_DISABLE_FRACTIONAL_PWM_MASK = (1 << 2), //0x4, disabled by default 2339470620eSNicholas Kazlauskas DC_PSR_MASK = (1 << 3), //0x8, disabled by default for dcn < 3.1 234a5148245SZhan Liu DC_EDP_NO_POWER_SEQUENCING = (1 << 4), //0x10, disabled by default 23512320274SAurabindo Pillai DC_DISABLE_LTTPR_DP1_4A = (1 << 5), //0x20, disabled by default 23612320274SAurabindo Pillai DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default 237*5533347dSDavid Zhang DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default 238*5533347dSDavid Zhang DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by default 2397875a226SAlex Deucher }; 2407875a226SAlex Deucher 2418a791dabSHarry Wentland enum DC_DEBUG_MASK { 2428a791dabSHarry Wentland DC_DISABLE_PIPE_SPLIT = 0x1, 2438a791dabSHarry Wentland DC_DISABLE_STUTTER = 0x2, 2448a791dabSHarry Wentland DC_DISABLE_DSC = 0x4, 2459470620eSNicholas Kazlauskas DC_DISABLE_CLOCK_GATING = 0x8, 2469470620eSNicholas Kazlauskas DC_DISABLE_PSR = 0x10, 2478a791dabSHarry Wentland }; 2488a791dabSHarry Wentland 24949d27e91SChengming Gui enum amd_dpm_forced_level; 25052ef3a1aSRyan Taylor 25143911fb6SDarren Powell /** 25243911fb6SDarren Powell * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks 25352ef3a1aSRyan Taylor * @name: Name of IP block 25452ef3a1aSRyan Taylor * @early_init: sets up early driver state (pre sw_init), 25552ef3a1aSRyan Taylor * does not configure hw - Optional 25652ef3a1aSRyan Taylor * @late_init: sets up late driver/hw state (post hw_init) - Optional 25752ef3a1aSRyan Taylor * @sw_init: sets up driver state, does not configure hw 25852ef3a1aSRyan Taylor * @sw_fini: tears down driver state, does not configure hw 259e9669fb7SAndrey Grodzovsky * @early_fini: tears down stuff before dev detached from driver 26052ef3a1aSRyan Taylor * @hw_init: sets up the hw state 26152ef3a1aSRyan Taylor * @hw_fini: tears down the hw state 26252ef3a1aSRyan Taylor * @late_fini: final cleanup 26352ef3a1aSRyan Taylor * @suspend: handles IP specific hw/sw changes for suspend 26452ef3a1aSRyan Taylor * @resume: handles IP specific hw/sw changes for resume 26552ef3a1aSRyan Taylor * @is_idle: returns current IP block idle status 26652ef3a1aSRyan Taylor * @wait_for_idle: poll for idle 26752ef3a1aSRyan Taylor * @check_soft_reset: check soft reset the IP block 26852ef3a1aSRyan Taylor * @pre_soft_reset: pre soft reset the IP block 26952ef3a1aSRyan Taylor * @soft_reset: soft reset the IP block 27052ef3a1aSRyan Taylor * @post_soft_reset: post soft reset the IP block 27152ef3a1aSRyan Taylor * @set_clockgating_state: enable/disable cg for the IP block 27252ef3a1aSRyan Taylor * @set_powergating_state: enable/disable pg for the IP block 27352ef3a1aSRyan Taylor * @get_clockgating_state: get current clockgating status 27452ef3a1aSRyan Taylor * 27552ef3a1aSRyan Taylor * These hooks provide an interface for controlling the operational state 27652ef3a1aSRyan Taylor * of IP blocks. After acquiring a list of IP blocks for the GPU in use, 27752ef3a1aSRyan Taylor * the driver can make chip-wide state changes by walking this list and 27852ef3a1aSRyan Taylor * making calls to hooks from each IP block. This list is ordered to ensure 27952ef3a1aSRyan Taylor * that the driver initializes the IP blocks in a safe sequence. 28043911fb6SDarren Powell */ 2815fc3aeebSyanyang1 struct amd_ip_funcs { 28288a907d6STom St Denis char *name; 2835fc3aeebSyanyang1 int (*early_init)(void *handle); 2845fc3aeebSyanyang1 int (*late_init)(void *handle); 2855fc3aeebSyanyang1 int (*sw_init)(void *handle); 2865fc3aeebSyanyang1 int (*sw_fini)(void *handle); 287e9669fb7SAndrey Grodzovsky int (*early_fini)(void *handle); 2885fc3aeebSyanyang1 int (*hw_init)(void *handle); 2895fc3aeebSyanyang1 int (*hw_fini)(void *handle); 290212cb3b6SMonk Liu void (*late_fini)(void *handle); 2915fc3aeebSyanyang1 int (*suspend)(void *handle); 2925fc3aeebSyanyang1 int (*resume)(void *handle); 2935fc3aeebSyanyang1 bool (*is_idle)(void *handle); 2945fc3aeebSyanyang1 int (*wait_for_idle)(void *handle); 295da146d3bSAlex Deucher bool (*check_soft_reset)(void *handle); 296d31a501eSChunming Zhou int (*pre_soft_reset)(void *handle); 2975fc3aeebSyanyang1 int (*soft_reset)(void *handle); 29835d782feSChunming Zhou int (*post_soft_reset)(void *handle); 2995fc3aeebSyanyang1 int (*set_clockgating_state)(void *handle, 3005fc3aeebSyanyang1 enum amd_clockgating_state state); 3015fc3aeebSyanyang1 int (*set_powergating_state)(void *handle, 3025fc3aeebSyanyang1 enum amd_powergating_state state); 30325faeddcSEvan Quan void (*get_clockgating_state)(void *handle, u64 *flags); 3045fc3aeebSyanyang1 }; 3055fc3aeebSyanyang1 306f93f0c3aSRex Zhu 3075fc3aeebSyanyang1 #endif /* __AMD_SHARED_H__ */ 308