18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright 2016 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 SMU9_H 258c2ecf20Sopenharmony_ci#define SMU9_H 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#pragma pack(push, 1) 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define ENABLE_DEBUG_FEATURES 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci/* Feature Control Defines */ 328c2ecf20Sopenharmony_ci#define FEATURE_DPM_PREFETCHER_BIT 0 338c2ecf20Sopenharmony_ci#define FEATURE_DPM_GFXCLK_BIT 1 348c2ecf20Sopenharmony_ci#define FEATURE_DPM_UCLK_BIT 2 358c2ecf20Sopenharmony_ci#define FEATURE_DPM_SOCCLK_BIT 3 368c2ecf20Sopenharmony_ci#define FEATURE_DPM_UVD_BIT 4 378c2ecf20Sopenharmony_ci#define FEATURE_DPM_VCE_BIT 5 388c2ecf20Sopenharmony_ci#define FEATURE_ULV_BIT 6 398c2ecf20Sopenharmony_ci#define FEATURE_DPM_MP0CLK_BIT 7 408c2ecf20Sopenharmony_ci#define FEATURE_DPM_LINK_BIT 8 418c2ecf20Sopenharmony_ci#define FEATURE_DPM_DCEFCLK_BIT 9 428c2ecf20Sopenharmony_ci#define FEATURE_AVFS_BIT 10 438c2ecf20Sopenharmony_ci#define FEATURE_DS_GFXCLK_BIT 11 448c2ecf20Sopenharmony_ci#define FEATURE_DS_SOCCLK_BIT 12 458c2ecf20Sopenharmony_ci#define FEATURE_DS_LCLK_BIT 13 468c2ecf20Sopenharmony_ci#define FEATURE_PPT_BIT 14 478c2ecf20Sopenharmony_ci#define FEATURE_TDC_BIT 15 488c2ecf20Sopenharmony_ci#define FEATURE_THERMAL_BIT 16 498c2ecf20Sopenharmony_ci#define FEATURE_GFX_PER_CU_CG_BIT 17 508c2ecf20Sopenharmony_ci#define FEATURE_RM_BIT 18 518c2ecf20Sopenharmony_ci#define FEATURE_DS_DCEFCLK_BIT 19 528c2ecf20Sopenharmony_ci#define FEATURE_ACDC_BIT 20 538c2ecf20Sopenharmony_ci#define FEATURE_VR0HOT_BIT 21 548c2ecf20Sopenharmony_ci#define FEATURE_VR1HOT_BIT 22 558c2ecf20Sopenharmony_ci#define FEATURE_FW_CTF_BIT 23 568c2ecf20Sopenharmony_ci#define FEATURE_LED_DISPLAY_BIT 24 578c2ecf20Sopenharmony_ci#define FEATURE_FAN_CONTROL_BIT 25 588c2ecf20Sopenharmony_ci#define FEATURE_FAST_PPT_BIT 26 598c2ecf20Sopenharmony_ci#define FEATURE_GFX_EDC_BIT 27 608c2ecf20Sopenharmony_ci#define FEATURE_ACG_BIT 28 618c2ecf20Sopenharmony_ci#define FEATURE_PCC_LIMIT_CONTROL_BIT 29 628c2ecf20Sopenharmony_ci#define FEATURE_SPARE_30_BIT 30 638c2ecf20Sopenharmony_ci#define FEATURE_SPARE_31_BIT 31 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci#define NUM_FEATURES 32 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#define FFEATURE_DPM_PREFETCHER_MASK (1 << FEATURE_DPM_PREFETCHER_BIT ) 688c2ecf20Sopenharmony_ci#define FFEATURE_DPM_GFXCLK_MASK (1 << FEATURE_DPM_GFXCLK_BIT ) 698c2ecf20Sopenharmony_ci#define FFEATURE_DPM_UCLK_MASK (1 << FEATURE_DPM_UCLK_BIT ) 708c2ecf20Sopenharmony_ci#define FFEATURE_DPM_SOCCLK_MASK (1 << FEATURE_DPM_SOCCLK_BIT ) 718c2ecf20Sopenharmony_ci#define FFEATURE_DPM_UVD_MASK (1 << FEATURE_DPM_UVD_BIT ) 728c2ecf20Sopenharmony_ci#define FFEATURE_DPM_VCE_MASK (1 << FEATURE_DPM_VCE_BIT ) 738c2ecf20Sopenharmony_ci#define FFEATURE_ULV_MASK (1 << FEATURE_ULV_BIT ) 748c2ecf20Sopenharmony_ci#define FFEATURE_DPM_MP0CLK_MASK (1 << FEATURE_DPM_MP0CLK_BIT ) 758c2ecf20Sopenharmony_ci#define FFEATURE_DPM_LINK_MASK (1 << FEATURE_DPM_LINK_BIT ) 768c2ecf20Sopenharmony_ci#define FFEATURE_DPM_DCEFCLK_MASK (1 << FEATURE_DPM_DCEFCLK_BIT ) 778c2ecf20Sopenharmony_ci#define FFEATURE_AVFS_MASK (1 << FEATURE_AVFS_BIT ) 788c2ecf20Sopenharmony_ci#define FFEATURE_DS_GFXCLK_MASK (1 << FEATURE_DS_GFXCLK_BIT ) 798c2ecf20Sopenharmony_ci#define FFEATURE_DS_SOCCLK_MASK (1 << FEATURE_DS_SOCCLK_BIT ) 808c2ecf20Sopenharmony_ci#define FFEATURE_DS_LCLK_MASK (1 << FEATURE_DS_LCLK_BIT ) 818c2ecf20Sopenharmony_ci#define FFEATURE_PPT_MASK (1 << FEATURE_PPT_BIT ) 828c2ecf20Sopenharmony_ci#define FFEATURE_TDC_MASK (1 << FEATURE_TDC_BIT ) 838c2ecf20Sopenharmony_ci#define FFEATURE_THERMAL_MASK (1 << FEATURE_THERMAL_BIT ) 848c2ecf20Sopenharmony_ci#define FFEATURE_GFX_PER_CU_CG_MASK (1 << FEATURE_GFX_PER_CU_CG_BIT ) 858c2ecf20Sopenharmony_ci#define FFEATURE_RM_MASK (1 << FEATURE_RM_BIT ) 868c2ecf20Sopenharmony_ci#define FFEATURE_DS_DCEFCLK_MASK (1 << FEATURE_DS_DCEFCLK_BIT ) 878c2ecf20Sopenharmony_ci#define FFEATURE_ACDC_MASK (1 << FEATURE_ACDC_BIT ) 888c2ecf20Sopenharmony_ci#define FFEATURE_VR0HOT_MASK (1 << FEATURE_VR0HOT_BIT ) 898c2ecf20Sopenharmony_ci#define FFEATURE_VR1HOT_MASK (1 << FEATURE_VR1HOT_BIT ) 908c2ecf20Sopenharmony_ci#define FFEATURE_FW_CTF_MASK (1 << FEATURE_FW_CTF_BIT ) 918c2ecf20Sopenharmony_ci#define FFEATURE_LED_DISPLAY_MASK (1 << FEATURE_LED_DISPLAY_BIT ) 928c2ecf20Sopenharmony_ci#define FFEATURE_FAN_CONTROL_MASK (1 << FEATURE_FAN_CONTROL_BIT ) 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci#define FEATURE_FAST_PPT_MASK (1 << FAST_PPT_BIT ) 958c2ecf20Sopenharmony_ci#define FEATURE_GFX_EDC_MASK (1 << FEATURE_GFX_EDC_BIT ) 968c2ecf20Sopenharmony_ci#define FEATURE_ACG_MASK (1 << FEATURE_ACG_BIT ) 978c2ecf20Sopenharmony_ci#define FEATURE_PCC_LIMIT_CONTROL_MASK (1 << FEATURE_PCC_LIMIT_CONTROL_BIT ) 988c2ecf20Sopenharmony_ci#define FFEATURE_SPARE_30_MASK (1 << FEATURE_SPARE_30_BIT ) 998c2ecf20Sopenharmony_ci#define FFEATURE_SPARE_31_MASK (1 << FEATURE_SPARE_31_BIT ) 1008c2ecf20Sopenharmony_ci/* Workload types */ 1018c2ecf20Sopenharmony_ci#define WORKLOAD_VR_BIT 0 1028c2ecf20Sopenharmony_ci#define WORKLOAD_FRTC_BIT 1 1038c2ecf20Sopenharmony_ci#define WORKLOAD_VIDEO_BIT 2 1048c2ecf20Sopenharmony_ci#define WORKLOAD_COMPUTE_BIT 3 1058c2ecf20Sopenharmony_ci#define NUM_WORKLOADS 4 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci/* ULV Client Masks */ 1088c2ecf20Sopenharmony_ci#define ULV_CLIENT_RLC_MASK 0x00000001 1098c2ecf20Sopenharmony_ci#define ULV_CLIENT_UVD_MASK 0x00000002 1108c2ecf20Sopenharmony_ci#define ULV_CLIENT_VCE_MASK 0x00000004 1118c2ecf20Sopenharmony_ci#define ULV_CLIENT_SDMA0_MASK 0x00000008 1128c2ecf20Sopenharmony_ci#define ULV_CLIENT_SDMA1_MASK 0x00000010 1138c2ecf20Sopenharmony_ci#define ULV_CLIENT_JPEG_MASK 0x00000020 1148c2ecf20Sopenharmony_ci#define ULV_CLIENT_GFXCLK_DPM_MASK 0x00000040 1158c2ecf20Sopenharmony_ci#define ULV_CLIENT_UVD_DPM_MASK 0x00000080 1168c2ecf20Sopenharmony_ci#define ULV_CLIENT_VCE_DPM_MASK 0x00000100 1178c2ecf20Sopenharmony_ci#define ULV_CLIENT_MP0CLK_DPM_MASK 0x00000200 1188c2ecf20Sopenharmony_ci#define ULV_CLIENT_UCLK_DPM_MASK 0x00000400 1198c2ecf20Sopenharmony_ci#define ULV_CLIENT_SOCCLK_DPM_MASK 0x00000800 1208c2ecf20Sopenharmony_ci#define ULV_CLIENT_DCEFCLK_DPM_MASK 0x00001000 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_citypedef struct { 1238c2ecf20Sopenharmony_ci /* MP1_EXT_SCRATCH0 */ 1248c2ecf20Sopenharmony_ci uint32_t CurrLevel_GFXCLK : 4; 1258c2ecf20Sopenharmony_ci uint32_t CurrLevel_UVD : 4; 1268c2ecf20Sopenharmony_ci uint32_t CurrLevel_VCE : 4; 1278c2ecf20Sopenharmony_ci uint32_t CurrLevel_LCLK : 4; 1288c2ecf20Sopenharmony_ci uint32_t CurrLevel_MP0CLK : 4; 1298c2ecf20Sopenharmony_ci uint32_t CurrLevel_UCLK : 4; 1308c2ecf20Sopenharmony_ci uint32_t CurrLevel_SOCCLK : 4; 1318c2ecf20Sopenharmony_ci uint32_t CurrLevel_DCEFCLK : 4; 1328c2ecf20Sopenharmony_ci /* MP1_EXT_SCRATCH1 */ 1338c2ecf20Sopenharmony_ci uint32_t TargLevel_GFXCLK : 4; 1348c2ecf20Sopenharmony_ci uint32_t TargLevel_UVD : 4; 1358c2ecf20Sopenharmony_ci uint32_t TargLevel_VCE : 4; 1368c2ecf20Sopenharmony_ci uint32_t TargLevel_LCLK : 4; 1378c2ecf20Sopenharmony_ci uint32_t TargLevel_MP0CLK : 4; 1388c2ecf20Sopenharmony_ci uint32_t TargLevel_UCLK : 4; 1398c2ecf20Sopenharmony_ci uint32_t TargLevel_SOCCLK : 4; 1408c2ecf20Sopenharmony_ci uint32_t TargLevel_DCEFCLK : 4; 1418c2ecf20Sopenharmony_ci /* MP1_EXT_SCRATCH2-7 */ 1428c2ecf20Sopenharmony_ci uint32_t Reserved[6]; 1438c2ecf20Sopenharmony_ci} FwStatus_t; 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci#pragma pack(pop) 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci#endif 1488c2ecf20Sopenharmony_ci 149