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 * Authors: Alex Deucher 238c2ecf20Sopenharmony_ci */ 248c2ecf20Sopenharmony_ci#ifndef CIK_H 258c2ecf20Sopenharmony_ci#define CIK_H 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define BONAIRE_GB_ADDR_CONFIG_GOLDEN 0x12010001 288c2ecf20Sopenharmony_ci#define HAWAII_GB_ADDR_CONFIG_GOLDEN 0x12011003 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define CIK_RB_BITMAP_WIDTH_PER_SH 2 318c2ecf20Sopenharmony_ci#define HAWAII_RB_BITMAP_WIDTH_PER_SH 4 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci/* DIDT IND registers */ 348c2ecf20Sopenharmony_ci#define DIDT_SQ_CTRL0 0x0 358c2ecf20Sopenharmony_ci# define DIDT_CTRL_EN (1 << 0) 368c2ecf20Sopenharmony_ci#define DIDT_DB_CTRL0 0x20 378c2ecf20Sopenharmony_ci#define DIDT_TD_CTRL0 0x40 388c2ecf20Sopenharmony_ci#define DIDT_TCP_CTRL0 0x60 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/* SMC IND registers */ 418c2ecf20Sopenharmony_ci#define DPM_TABLE_475 0x3F768 428c2ecf20Sopenharmony_ci# define SamuBootLevel(x) ((x) << 0) 438c2ecf20Sopenharmony_ci# define SamuBootLevel_MASK 0x000000ff 448c2ecf20Sopenharmony_ci# define SamuBootLevel_SHIFT 0 458c2ecf20Sopenharmony_ci# define AcpBootLevel(x) ((x) << 8) 468c2ecf20Sopenharmony_ci# define AcpBootLevel_MASK 0x0000ff00 478c2ecf20Sopenharmony_ci# define AcpBootLevel_SHIFT 8 488c2ecf20Sopenharmony_ci# define VceBootLevel(x) ((x) << 16) 498c2ecf20Sopenharmony_ci# define VceBootLevel_MASK 0x00ff0000 508c2ecf20Sopenharmony_ci# define VceBootLevel_SHIFT 16 518c2ecf20Sopenharmony_ci# define UvdBootLevel(x) ((x) << 24) 528c2ecf20Sopenharmony_ci# define UvdBootLevel_MASK 0xff000000 538c2ecf20Sopenharmony_ci# define UvdBootLevel_SHIFT 24 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci#define FIRMWARE_FLAGS 0x3F800 568c2ecf20Sopenharmony_ci# define INTERRUPTS_ENABLED (1 << 0) 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#define NB_DPM_CONFIG_1 0x3F9E8 598c2ecf20Sopenharmony_ci# define Dpm0PgNbPsLo(x) ((x) << 0) 608c2ecf20Sopenharmony_ci# define Dpm0PgNbPsLo_MASK 0x000000ff 618c2ecf20Sopenharmony_ci# define Dpm0PgNbPsLo_SHIFT 0 628c2ecf20Sopenharmony_ci# define Dpm0PgNbPsHi(x) ((x) << 8) 638c2ecf20Sopenharmony_ci# define Dpm0PgNbPsHi_MASK 0x0000ff00 648c2ecf20Sopenharmony_ci# define Dpm0PgNbPsHi_SHIFT 8 658c2ecf20Sopenharmony_ci# define DpmXNbPsLo(x) ((x) << 16) 668c2ecf20Sopenharmony_ci# define DpmXNbPsLo_MASK 0x00ff0000 678c2ecf20Sopenharmony_ci# define DpmXNbPsLo_SHIFT 16 688c2ecf20Sopenharmony_ci# define DpmXNbPsHi(x) ((x) << 24) 698c2ecf20Sopenharmony_ci# define DpmXNbPsHi_MASK 0xff000000 708c2ecf20Sopenharmony_ci# define DpmXNbPsHi_SHIFT 24 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci#define SMC_SYSCON_RESET_CNTL 0x80000000 738c2ecf20Sopenharmony_ci# define RST_REG (1 << 0) 748c2ecf20Sopenharmony_ci#define SMC_SYSCON_CLOCK_CNTL_0 0x80000004 758c2ecf20Sopenharmony_ci# define CK_DISABLE (1 << 0) 768c2ecf20Sopenharmony_ci# define CKEN (1 << 24) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define SMC_SYSCON_MISC_CNTL 0x80000010 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci#define SMC_SYSCON_MSG_ARG_0 0x80000068 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define SMC_PC_C 0x80000370 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#define SMC_SCRATCH9 0x80000424 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#define RCU_UC_EVENTS 0xC0000004 878c2ecf20Sopenharmony_ci# define BOOT_SEQ_DONE (1 << 7) 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci#define GENERAL_PWRMGT 0xC0200000 908c2ecf20Sopenharmony_ci# define GLOBAL_PWRMGT_EN (1 << 0) 918c2ecf20Sopenharmony_ci# define STATIC_PM_EN (1 << 1) 928c2ecf20Sopenharmony_ci# define THERMAL_PROTECTION_DIS (1 << 2) 938c2ecf20Sopenharmony_ci# define THERMAL_PROTECTION_TYPE (1 << 3) 948c2ecf20Sopenharmony_ci# define SW_SMIO_INDEX(x) ((x) << 6) 958c2ecf20Sopenharmony_ci# define SW_SMIO_INDEX_MASK (1 << 6) 968c2ecf20Sopenharmony_ci# define SW_SMIO_INDEX_SHIFT 6 978c2ecf20Sopenharmony_ci# define VOLT_PWRMGT_EN (1 << 10) 988c2ecf20Sopenharmony_ci# define GPU_COUNTER_CLK (1 << 15) 998c2ecf20Sopenharmony_ci# define DYN_SPREAD_SPECTRUM_EN (1 << 23) 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#define CNB_PWRMGT_CNTL 0xC0200004 1028c2ecf20Sopenharmony_ci# define GNB_SLOW_MODE(x) ((x) << 0) 1038c2ecf20Sopenharmony_ci# define GNB_SLOW_MODE_MASK (3 << 0) 1048c2ecf20Sopenharmony_ci# define GNB_SLOW_MODE_SHIFT 0 1058c2ecf20Sopenharmony_ci# define GNB_SLOW (1 << 2) 1068c2ecf20Sopenharmony_ci# define FORCE_NB_PS1 (1 << 3) 1078c2ecf20Sopenharmony_ci# define DPM_ENABLED (1 << 4) 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci#define SCLK_PWRMGT_CNTL 0xC0200008 1108c2ecf20Sopenharmony_ci# define SCLK_PWRMGT_OFF (1 << 0) 1118c2ecf20Sopenharmony_ci# define RESET_BUSY_CNT (1 << 4) 1128c2ecf20Sopenharmony_ci# define RESET_SCLK_CNT (1 << 5) 1138c2ecf20Sopenharmony_ci# define DYNAMIC_PM_EN (1 << 21) 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX 0xC0200014 1168c2ecf20Sopenharmony_ci# define CURRENT_STATE_MASK (0xf << 4) 1178c2ecf20Sopenharmony_ci# define CURRENT_STATE_SHIFT 4 1188c2ecf20Sopenharmony_ci# define CURR_MCLK_INDEX_MASK (0xf << 8) 1198c2ecf20Sopenharmony_ci# define CURR_MCLK_INDEX_SHIFT 8 1208c2ecf20Sopenharmony_ci# define CURR_SCLK_INDEX_MASK (0x1f << 16) 1218c2ecf20Sopenharmony_ci# define CURR_SCLK_INDEX_SHIFT 16 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci#define CG_SSP 0xC0200044 1248c2ecf20Sopenharmony_ci# define SST(x) ((x) << 0) 1258c2ecf20Sopenharmony_ci# define SST_MASK (0xffff << 0) 1268c2ecf20Sopenharmony_ci# define SSTU(x) ((x) << 16) 1278c2ecf20Sopenharmony_ci# define SSTU_MASK (0xf << 16) 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci#define CG_DISPLAY_GAP_CNTL 0xC0200060 1308c2ecf20Sopenharmony_ci# define DISP_GAP(x) ((x) << 0) 1318c2ecf20Sopenharmony_ci# define DISP_GAP_MASK (3 << 0) 1328c2ecf20Sopenharmony_ci# define VBI_TIMER_COUNT(x) ((x) << 4) 1338c2ecf20Sopenharmony_ci# define VBI_TIMER_COUNT_MASK (0x3fff << 4) 1348c2ecf20Sopenharmony_ci# define VBI_TIMER_UNIT(x) ((x) << 20) 1358c2ecf20Sopenharmony_ci# define VBI_TIMER_UNIT_MASK (7 << 20) 1368c2ecf20Sopenharmony_ci# define DISP_GAP_MCHG(x) ((x) << 24) 1378c2ecf20Sopenharmony_ci# define DISP_GAP_MCHG_MASK (3 << 24) 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ci#define SMU_VOLTAGE_STATUS 0xC0200094 1408c2ecf20Sopenharmony_ci# define SMU_VOLTAGE_CURRENT_LEVEL_MASK (0xff << 1) 1418c2ecf20Sopenharmony_ci# define SMU_VOLTAGE_CURRENT_LEVEL_SHIFT 1 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX_1 0xC02000F0 1448c2ecf20Sopenharmony_ci# define CURR_PCIE_INDEX_MASK (0xf << 24) 1458c2ecf20Sopenharmony_ci# define CURR_PCIE_INDEX_SHIFT 24 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci#define CG_ULV_PARAMETER 0xC0200158 1488c2ecf20Sopenharmony_ci 1498c2ecf20Sopenharmony_ci#define CG_FTV_0 0xC02001A8 1508c2ecf20Sopenharmony_ci#define CG_FTV_1 0xC02001AC 1518c2ecf20Sopenharmony_ci#define CG_FTV_2 0xC02001B0 1528c2ecf20Sopenharmony_ci#define CG_FTV_3 0xC02001B4 1538c2ecf20Sopenharmony_ci#define CG_FTV_4 0xC02001B8 1548c2ecf20Sopenharmony_ci#define CG_FTV_5 0xC02001BC 1558c2ecf20Sopenharmony_ci#define CG_FTV_6 0xC02001C0 1568c2ecf20Sopenharmony_ci#define CG_FTV_7 0xC02001C4 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci#define CG_DISPLAY_GAP_CNTL2 0xC0200230 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci#define LCAC_SX0_OVR_SEL 0xC0400D04 1618c2ecf20Sopenharmony_ci#define LCAC_SX0_OVR_VAL 0xC0400D08 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ci#define LCAC_MC0_CNTL 0xC0400D30 1648c2ecf20Sopenharmony_ci#define LCAC_MC0_OVR_SEL 0xC0400D34 1658c2ecf20Sopenharmony_ci#define LCAC_MC0_OVR_VAL 0xC0400D38 1668c2ecf20Sopenharmony_ci#define LCAC_MC1_CNTL 0xC0400D3C 1678c2ecf20Sopenharmony_ci#define LCAC_MC1_OVR_SEL 0xC0400D40 1688c2ecf20Sopenharmony_ci#define LCAC_MC1_OVR_VAL 0xC0400D44 1698c2ecf20Sopenharmony_ci 1708c2ecf20Sopenharmony_ci#define LCAC_MC2_OVR_SEL 0xC0400D4C 1718c2ecf20Sopenharmony_ci#define LCAC_MC2_OVR_VAL 0xC0400D50 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci#define LCAC_MC3_OVR_SEL 0xC0400D58 1748c2ecf20Sopenharmony_ci#define LCAC_MC3_OVR_VAL 0xC0400D5C 1758c2ecf20Sopenharmony_ci 1768c2ecf20Sopenharmony_ci#define LCAC_CPL_CNTL 0xC0400D80 1778c2ecf20Sopenharmony_ci#define LCAC_CPL_OVR_SEL 0xC0400D84 1788c2ecf20Sopenharmony_ci#define LCAC_CPL_OVR_VAL 0xC0400D88 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_ci/* dGPU */ 1818c2ecf20Sopenharmony_ci#define CG_THERMAL_CTRL 0xC0300004 1828c2ecf20Sopenharmony_ci#define DPM_EVENT_SRC(x) ((x) << 0) 1838c2ecf20Sopenharmony_ci#define DPM_EVENT_SRC_MASK (7 << 0) 1848c2ecf20Sopenharmony_ci#define DIG_THERM_DPM(x) ((x) << 14) 1858c2ecf20Sopenharmony_ci#define DIG_THERM_DPM_MASK 0x003FC000 1868c2ecf20Sopenharmony_ci#define DIG_THERM_DPM_SHIFT 14 1878c2ecf20Sopenharmony_ci#define CG_THERMAL_STATUS 0xC0300008 1888c2ecf20Sopenharmony_ci#define FDO_PWM_DUTY(x) ((x) << 9) 1898c2ecf20Sopenharmony_ci#define FDO_PWM_DUTY_MASK (0xff << 9) 1908c2ecf20Sopenharmony_ci#define FDO_PWM_DUTY_SHIFT 9 1918c2ecf20Sopenharmony_ci#define CG_THERMAL_INT 0xC030000C 1928c2ecf20Sopenharmony_ci#define CI_DIG_THERM_INTH(x) ((x) << 8) 1938c2ecf20Sopenharmony_ci#define CI_DIG_THERM_INTH_MASK 0x0000FF00 1948c2ecf20Sopenharmony_ci#define CI_DIG_THERM_INTH_SHIFT 8 1958c2ecf20Sopenharmony_ci#define CI_DIG_THERM_INTL(x) ((x) << 16) 1968c2ecf20Sopenharmony_ci#define CI_DIG_THERM_INTL_MASK 0x00FF0000 1978c2ecf20Sopenharmony_ci#define CI_DIG_THERM_INTL_SHIFT 16 1988c2ecf20Sopenharmony_ci#define THERM_INT_MASK_HIGH (1 << 24) 1998c2ecf20Sopenharmony_ci#define THERM_INT_MASK_LOW (1 << 25) 2008c2ecf20Sopenharmony_ci#define CG_MULT_THERMAL_CTRL 0xC0300010 2018c2ecf20Sopenharmony_ci#define TEMP_SEL(x) ((x) << 20) 2028c2ecf20Sopenharmony_ci#define TEMP_SEL_MASK (0xff << 20) 2038c2ecf20Sopenharmony_ci#define TEMP_SEL_SHIFT 20 2048c2ecf20Sopenharmony_ci#define CG_MULT_THERMAL_STATUS 0xC0300014 2058c2ecf20Sopenharmony_ci#define ASIC_MAX_TEMP(x) ((x) << 0) 2068c2ecf20Sopenharmony_ci#define ASIC_MAX_TEMP_MASK 0x000001ff 2078c2ecf20Sopenharmony_ci#define ASIC_MAX_TEMP_SHIFT 0 2088c2ecf20Sopenharmony_ci#define CTF_TEMP(x) ((x) << 9) 2098c2ecf20Sopenharmony_ci#define CTF_TEMP_MASK 0x0003fe00 2108c2ecf20Sopenharmony_ci#define CTF_TEMP_SHIFT 9 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_ci#define CG_FDO_CTRL0 0xC0300064 2138c2ecf20Sopenharmony_ci#define FDO_STATIC_DUTY(x) ((x) << 0) 2148c2ecf20Sopenharmony_ci#define FDO_STATIC_DUTY_MASK 0x000000FF 2158c2ecf20Sopenharmony_ci#define FDO_STATIC_DUTY_SHIFT 0 2168c2ecf20Sopenharmony_ci#define CG_FDO_CTRL1 0xC0300068 2178c2ecf20Sopenharmony_ci#define FMAX_DUTY100(x) ((x) << 0) 2188c2ecf20Sopenharmony_ci#define FMAX_DUTY100_MASK 0x000000FF 2198c2ecf20Sopenharmony_ci#define FMAX_DUTY100_SHIFT 0 2208c2ecf20Sopenharmony_ci#define CG_FDO_CTRL2 0xC030006C 2218c2ecf20Sopenharmony_ci#define TMIN(x) ((x) << 0) 2228c2ecf20Sopenharmony_ci#define TMIN_MASK 0x000000FF 2238c2ecf20Sopenharmony_ci#define TMIN_SHIFT 0 2248c2ecf20Sopenharmony_ci#define FDO_PWM_MODE(x) ((x) << 11) 2258c2ecf20Sopenharmony_ci#define FDO_PWM_MODE_MASK (7 << 11) 2268c2ecf20Sopenharmony_ci#define FDO_PWM_MODE_SHIFT 11 2278c2ecf20Sopenharmony_ci#define TACH_PWM_RESP_RATE(x) ((x) << 25) 2288c2ecf20Sopenharmony_ci#define TACH_PWM_RESP_RATE_MASK (0x7f << 25) 2298c2ecf20Sopenharmony_ci#define TACH_PWM_RESP_RATE_SHIFT 25 2308c2ecf20Sopenharmony_ci#define CG_TACH_CTRL 0xC0300070 2318c2ecf20Sopenharmony_ci# define EDGE_PER_REV(x) ((x) << 0) 2328c2ecf20Sopenharmony_ci# define EDGE_PER_REV_MASK (0x7 << 0) 2338c2ecf20Sopenharmony_ci# define EDGE_PER_REV_SHIFT 0 2348c2ecf20Sopenharmony_ci# define TARGET_PERIOD(x) ((x) << 3) 2358c2ecf20Sopenharmony_ci# define TARGET_PERIOD_MASK 0xfffffff8 2368c2ecf20Sopenharmony_ci# define TARGET_PERIOD_SHIFT 3 2378c2ecf20Sopenharmony_ci#define CG_TACH_STATUS 0xC0300074 2388c2ecf20Sopenharmony_ci# define TACH_PERIOD(x) ((x) << 0) 2398c2ecf20Sopenharmony_ci# define TACH_PERIOD_MASK 0xffffffff 2408c2ecf20Sopenharmony_ci# define TACH_PERIOD_SHIFT 0 2418c2ecf20Sopenharmony_ci 2428c2ecf20Sopenharmony_ci#define CG_ECLK_CNTL 0xC05000AC 2438c2ecf20Sopenharmony_ci# define ECLK_DIVIDER_MASK 0x7f 2448c2ecf20Sopenharmony_ci# define ECLK_DIR_CNTL_EN (1 << 8) 2458c2ecf20Sopenharmony_ci#define CG_ECLK_STATUS 0xC05000B0 2468c2ecf20Sopenharmony_ci# define ECLK_STATUS (1 << 0) 2478c2ecf20Sopenharmony_ci 2488c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL 0xC0500140 2498c2ecf20Sopenharmony_ci#define SPLL_RESET (1 << 0) 2508c2ecf20Sopenharmony_ci#define SPLL_PWRON (1 << 1) 2518c2ecf20Sopenharmony_ci#define SPLL_BYPASS_EN (1 << 3) 2528c2ecf20Sopenharmony_ci#define SPLL_REF_DIV(x) ((x) << 5) 2538c2ecf20Sopenharmony_ci#define SPLL_REF_DIV_MASK (0x3f << 5) 2548c2ecf20Sopenharmony_ci#define SPLL_PDIV_A(x) ((x) << 20) 2558c2ecf20Sopenharmony_ci#define SPLL_PDIV_A_MASK (0x7f << 20) 2568c2ecf20Sopenharmony_ci#define SPLL_PDIV_A_SHIFT 20 2578c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_2 0xC0500144 2588c2ecf20Sopenharmony_ci#define SCLK_MUX_SEL(x) ((x) << 0) 2598c2ecf20Sopenharmony_ci#define SCLK_MUX_SEL_MASK (0x1ff << 0) 2608c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_3 0xC0500148 2618c2ecf20Sopenharmony_ci#define SPLL_FB_DIV(x) ((x) << 0) 2628c2ecf20Sopenharmony_ci#define SPLL_FB_DIV_MASK (0x3ffffff << 0) 2638c2ecf20Sopenharmony_ci#define SPLL_FB_DIV_SHIFT 0 2648c2ecf20Sopenharmony_ci#define SPLL_DITHEN (1 << 28) 2658c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_4 0xC050014C 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM 0xC0500164 2688c2ecf20Sopenharmony_ci#define SSEN (1 << 0) 2698c2ecf20Sopenharmony_ci#define CLK_S(x) ((x) << 4) 2708c2ecf20Sopenharmony_ci#define CLK_S_MASK (0xfff << 4) 2718c2ecf20Sopenharmony_ci#define CLK_S_SHIFT 4 2728c2ecf20Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM_2 0xC0500168 2738c2ecf20Sopenharmony_ci#define CLK_V(x) ((x) << 0) 2748c2ecf20Sopenharmony_ci#define CLK_V_MASK (0x3ffffff << 0) 2758c2ecf20Sopenharmony_ci#define CLK_V_SHIFT 0 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci#define MPLL_BYPASSCLK_SEL 0xC050019C 2788c2ecf20Sopenharmony_ci# define MPLL_CLKOUT_SEL(x) ((x) << 8) 2798c2ecf20Sopenharmony_ci# define MPLL_CLKOUT_SEL_MASK 0xFF00 2808c2ecf20Sopenharmony_ci#define CG_CLKPIN_CNTL 0xC05001A0 2818c2ecf20Sopenharmony_ci# define XTALIN_DIVIDE (1 << 1) 2828c2ecf20Sopenharmony_ci# define BCLK_AS_XCLK (1 << 2) 2838c2ecf20Sopenharmony_ci#define CG_CLKPIN_CNTL_2 0xC05001A4 2848c2ecf20Sopenharmony_ci# define FORCE_BIF_REFCLK_EN (1 << 3) 2858c2ecf20Sopenharmony_ci# define MUX_TCLK_TO_XCLK (1 << 8) 2868c2ecf20Sopenharmony_ci#define THM_CLK_CNTL 0xC05001A8 2878c2ecf20Sopenharmony_ci# define CMON_CLK_SEL(x) ((x) << 0) 2888c2ecf20Sopenharmony_ci# define CMON_CLK_SEL_MASK 0xFF 2898c2ecf20Sopenharmony_ci# define TMON_CLK_SEL(x) ((x) << 8) 2908c2ecf20Sopenharmony_ci# define TMON_CLK_SEL_MASK 0xFF00 2918c2ecf20Sopenharmony_ci#define MISC_CLK_CTRL 0xC05001AC 2928c2ecf20Sopenharmony_ci# define DEEP_SLEEP_CLK_SEL(x) ((x) << 0) 2938c2ecf20Sopenharmony_ci# define DEEP_SLEEP_CLK_SEL_MASK 0xFF 2948c2ecf20Sopenharmony_ci# define ZCLK_SEL(x) ((x) << 8) 2958c2ecf20Sopenharmony_ci# define ZCLK_SEL_MASK 0xFF00 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_ci/* KV/KB */ 2988c2ecf20Sopenharmony_ci#define CG_THERMAL_INT_CTRL 0xC2100028 2998c2ecf20Sopenharmony_ci#define DIG_THERM_INTH(x) ((x) << 0) 3008c2ecf20Sopenharmony_ci#define DIG_THERM_INTH_MASK 0x000000FF 3018c2ecf20Sopenharmony_ci#define DIG_THERM_INTH_SHIFT 0 3028c2ecf20Sopenharmony_ci#define DIG_THERM_INTL(x) ((x) << 8) 3038c2ecf20Sopenharmony_ci#define DIG_THERM_INTL_MASK 0x0000FF00 3048c2ecf20Sopenharmony_ci#define DIG_THERM_INTL_SHIFT 8 3058c2ecf20Sopenharmony_ci#define THERM_INTH_MASK (1 << 24) 3068c2ecf20Sopenharmony_ci#define THERM_INTL_MASK (1 << 25) 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci/* PCIE registers idx/data 0x38/0x3c */ 3098c2ecf20Sopenharmony_ci#define PB0_PIF_PWRDOWN_0 0x1100012 /* PCIE */ 3108c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0(x) ((x) << 7) 3118c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0_MASK (0x7 << 7) 3128c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0_SHIFT 7 3138c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0(x) ((x) << 10) 3148c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0_MASK (0x7 << 10) 3158c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0_SHIFT 10 3168c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_0(x) ((x) << 24) 3178c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_0_MASK (0x7 << 24) 3188c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_0_SHIFT 24 3198c2ecf20Sopenharmony_ci#define PB0_PIF_PWRDOWN_1 0x1100013 /* PCIE */ 3208c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1(x) ((x) << 7) 3218c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1_MASK (0x7 << 7) 3228c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1_SHIFT 7 3238c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1(x) ((x) << 10) 3248c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1_MASK (0x7 << 10) 3258c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1_SHIFT 10 3268c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_1(x) ((x) << 24) 3278c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_1_MASK (0x7 << 24) 3288c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_1_SHIFT 24 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_ci#define PCIE_CNTL2 0x1001001c /* PCIE */ 3318c2ecf20Sopenharmony_ci# define SLV_MEM_LS_EN (1 << 16) 3328c2ecf20Sopenharmony_ci# define SLV_MEM_AGGRESSIVE_LS_EN (1 << 17) 3338c2ecf20Sopenharmony_ci# define MST_MEM_LS_EN (1 << 18) 3348c2ecf20Sopenharmony_ci# define REPLAY_MEM_LS_EN (1 << 19) 3358c2ecf20Sopenharmony_ci 3368c2ecf20Sopenharmony_ci#define PCIE_LC_STATUS1 0x1400028 /* PCIE */ 3378c2ecf20Sopenharmony_ci# define LC_REVERSE_RCVR (1 << 0) 3388c2ecf20Sopenharmony_ci# define LC_REVERSE_XMIT (1 << 1) 3398c2ecf20Sopenharmony_ci# define LC_OPERATING_LINK_WIDTH_MASK (0x7 << 2) 3408c2ecf20Sopenharmony_ci# define LC_OPERATING_LINK_WIDTH_SHIFT 2 3418c2ecf20Sopenharmony_ci# define LC_DETECTED_LINK_WIDTH_MASK (0x7 << 5) 3428c2ecf20Sopenharmony_ci# define LC_DETECTED_LINK_WIDTH_SHIFT 5 3438c2ecf20Sopenharmony_ci 3448c2ecf20Sopenharmony_ci#define PCIE_P_CNTL 0x1400040 /* PCIE */ 3458c2ecf20Sopenharmony_ci# define P_IGNORE_EDB_ERR (1 << 6) 3468c2ecf20Sopenharmony_ci 3478c2ecf20Sopenharmony_ci#define PB1_PIF_PWRDOWN_0 0x2100012 /* PCIE */ 3488c2ecf20Sopenharmony_ci#define PB1_PIF_PWRDOWN_1 0x2100013 /* PCIE */ 3498c2ecf20Sopenharmony_ci 3508c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL 0x100100A0 /* PCIE */ 3518c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY(x) ((x) << 8) 3528c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY_MASK (0xf << 8) 3538c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY_SHIFT 8 3548c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY(x) ((x) << 12) 3558c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY_MASK (0xf << 12) 3568c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY_SHIFT 12 3578c2ecf20Sopenharmony_ci# define LC_PMI_TO_L1_DIS (1 << 16) 3588c2ecf20Sopenharmony_ci# define LC_ASPM_TO_L1_DIS (1 << 24) 3598c2ecf20Sopenharmony_ci 3608c2ecf20Sopenharmony_ci#define PCIE_LC_LINK_WIDTH_CNTL 0x100100A2 /* PCIE */ 3618c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_SHIFT 0 3628c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_MASK 0x7 3638c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X0 0 3648c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X1 1 3658c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X2 2 3668c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X4 3 3678c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X8 4 3688c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X16 6 3698c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_RD_SHIFT 4 3708c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_RD_MASK 0x70 3718c2ecf20Sopenharmony_ci# define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) 3728c2ecf20Sopenharmony_ci# define LC_RECONFIG_NOW (1 << 8) 3738c2ecf20Sopenharmony_ci# define LC_RENEGOTIATION_SUPPORT (1 << 9) 3748c2ecf20Sopenharmony_ci# define LC_RENEGOTIATE_EN (1 << 10) 3758c2ecf20Sopenharmony_ci# define LC_SHORT_RECONFIG_EN (1 << 11) 3768c2ecf20Sopenharmony_ci# define LC_UPCONFIGURE_SUPPORT (1 << 12) 3778c2ecf20Sopenharmony_ci# define LC_UPCONFIGURE_DIS (1 << 13) 3788c2ecf20Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE(x) ((x) << 21) 3798c2ecf20Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE_MASK (0x3 << 21) 3808c2ecf20Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE_SHIFT 21 3818c2ecf20Sopenharmony_ci#define PCIE_LC_N_FTS_CNTL 0x100100a3 /* PCIE */ 3828c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS(x) ((x) << 0) 3838c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS_MASK (0xff << 0) 3848c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS_SHIFT 0 3858c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS_OVERRIDE_EN (1 << 8) 3868c2ecf20Sopenharmony_ci# define LC_N_FTS_MASK (0xff << 24) 3878c2ecf20Sopenharmony_ci#define PCIE_LC_SPEED_CNTL 0x100100A4 /* PCIE */ 3888c2ecf20Sopenharmony_ci# define LC_GEN2_EN_STRAP (1 << 0) 3898c2ecf20Sopenharmony_ci# define LC_GEN3_EN_STRAP (1 << 1) 3908c2ecf20Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 2) 3918c2ecf20Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_MASK (0x3 << 3) 3928c2ecf20Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_SHIFT 3 3938c2ecf20Sopenharmony_ci# define LC_FORCE_EN_SW_SPEED_CHANGE (1 << 5) 3948c2ecf20Sopenharmony_ci# define LC_FORCE_DIS_SW_SPEED_CHANGE (1 << 6) 3958c2ecf20Sopenharmony_ci# define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 7) 3968c2ecf20Sopenharmony_ci# define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 8) 3978c2ecf20Sopenharmony_ci# define LC_INITIATE_LINK_SPEED_CHANGE (1 << 9) 3988c2ecf20Sopenharmony_ci# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 10) 3998c2ecf20Sopenharmony_ci# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 10 4008c2ecf20Sopenharmony_ci# define LC_CURRENT_DATA_RATE_MASK (0x3 << 13) /* 0/1/2 = gen1/2/3 */ 4018c2ecf20Sopenharmony_ci# define LC_CURRENT_DATA_RATE_SHIFT 13 4028c2ecf20Sopenharmony_ci# define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 16) 4038c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 18) 4048c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 19) 4058c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN3 (1 << 20) 4068c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN3 (1 << 21) 4078c2ecf20Sopenharmony_ci 4088c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL2 0x100100B1 /* PCIE */ 4098c2ecf20Sopenharmony_ci# define LC_ALLOW_PDWN_IN_L1 (1 << 17) 4108c2ecf20Sopenharmony_ci# define LC_ALLOW_PDWN_IN_L23 (1 << 18) 4118c2ecf20Sopenharmony_ci 4128c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL3 0x100100B5 /* PCIE */ 4138c2ecf20Sopenharmony_ci# define LC_GO_TO_RECOVERY (1 << 30) 4148c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL4 0x100100B6 /* PCIE */ 4158c2ecf20Sopenharmony_ci# define LC_REDO_EQ (1 << 5) 4168c2ecf20Sopenharmony_ci# define LC_SET_QUIESCE (1 << 13) 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci/* direct registers */ 4198c2ecf20Sopenharmony_ci#define PCIE_INDEX 0x38 4208c2ecf20Sopenharmony_ci#define PCIE_DATA 0x3C 4218c2ecf20Sopenharmony_ci 4228c2ecf20Sopenharmony_ci#define SMC_IND_INDEX_0 0x200 4238c2ecf20Sopenharmony_ci#define SMC_IND_DATA_0 0x204 4248c2ecf20Sopenharmony_ci 4258c2ecf20Sopenharmony_ci#define SMC_IND_ACCESS_CNTL 0x240 4268c2ecf20Sopenharmony_ci#define AUTO_INCREMENT_IND_0 (1 << 0) 4278c2ecf20Sopenharmony_ci 4288c2ecf20Sopenharmony_ci#define SMC_MESSAGE_0 0x250 4298c2ecf20Sopenharmony_ci#define SMC_MSG_MASK 0xffff 4308c2ecf20Sopenharmony_ci#define SMC_RESP_0 0x254 4318c2ecf20Sopenharmony_ci#define SMC_RESP_MASK 0xffff 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_ci#define SMC_MSG_ARG_0 0x290 4348c2ecf20Sopenharmony_ci 4358c2ecf20Sopenharmony_ci#define VGA_HDP_CONTROL 0x328 4368c2ecf20Sopenharmony_ci#define VGA_MEMORY_DISABLE (1 << 4) 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_ci#define DMIF_ADDR_CALC 0xC00 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ci#define PIPE0_DMIF_BUFFER_CONTROL 0x0ca0 4418c2ecf20Sopenharmony_ci# define DMIF_BUFFERS_ALLOCATED(x) ((x) << 0) 4428c2ecf20Sopenharmony_ci# define DMIF_BUFFERS_ALLOCATED_COMPLETED (1 << 4) 4438c2ecf20Sopenharmony_ci 4448c2ecf20Sopenharmony_ci#define SRBM_GFX_CNTL 0xE44 4458c2ecf20Sopenharmony_ci#define PIPEID(x) ((x) << 0) 4468c2ecf20Sopenharmony_ci#define MEID(x) ((x) << 2) 4478c2ecf20Sopenharmony_ci#define VMID(x) ((x) << 4) 4488c2ecf20Sopenharmony_ci#define QUEUEID(x) ((x) << 8) 4498c2ecf20Sopenharmony_ci 4508c2ecf20Sopenharmony_ci#define SRBM_STATUS2 0xE4C 4518c2ecf20Sopenharmony_ci#define SDMA_BUSY (1 << 5) 4528c2ecf20Sopenharmony_ci#define SDMA1_BUSY (1 << 6) 4538c2ecf20Sopenharmony_ci#define SRBM_STATUS 0xE50 4548c2ecf20Sopenharmony_ci#define UVD_RQ_PENDING (1 << 1) 4558c2ecf20Sopenharmony_ci#define GRBM_RQ_PENDING (1 << 5) 4568c2ecf20Sopenharmony_ci#define VMC_BUSY (1 << 8) 4578c2ecf20Sopenharmony_ci#define MCB_BUSY (1 << 9) 4588c2ecf20Sopenharmony_ci#define MCB_NON_DISPLAY_BUSY (1 << 10) 4598c2ecf20Sopenharmony_ci#define MCC_BUSY (1 << 11) 4608c2ecf20Sopenharmony_ci#define MCD_BUSY (1 << 12) 4618c2ecf20Sopenharmony_ci#define SEM_BUSY (1 << 14) 4628c2ecf20Sopenharmony_ci#define IH_BUSY (1 << 17) 4638c2ecf20Sopenharmony_ci#define UVD_BUSY (1 << 19) 4648c2ecf20Sopenharmony_ci 4658c2ecf20Sopenharmony_ci#define SRBM_SOFT_RESET 0xE60 4668c2ecf20Sopenharmony_ci#define SOFT_RESET_BIF (1 << 1) 4678c2ecf20Sopenharmony_ci#define SOFT_RESET_R0PLL (1 << 4) 4688c2ecf20Sopenharmony_ci#define SOFT_RESET_DC (1 << 5) 4698c2ecf20Sopenharmony_ci#define SOFT_RESET_SDMA1 (1 << 6) 4708c2ecf20Sopenharmony_ci#define SOFT_RESET_GRBM (1 << 8) 4718c2ecf20Sopenharmony_ci#define SOFT_RESET_HDP (1 << 9) 4728c2ecf20Sopenharmony_ci#define SOFT_RESET_IH (1 << 10) 4738c2ecf20Sopenharmony_ci#define SOFT_RESET_MC (1 << 11) 4748c2ecf20Sopenharmony_ci#define SOFT_RESET_ROM (1 << 14) 4758c2ecf20Sopenharmony_ci#define SOFT_RESET_SEM (1 << 15) 4768c2ecf20Sopenharmony_ci#define SOFT_RESET_VMC (1 << 17) 4778c2ecf20Sopenharmony_ci#define SOFT_RESET_SDMA (1 << 20) 4788c2ecf20Sopenharmony_ci#define SOFT_RESET_TST (1 << 21) 4798c2ecf20Sopenharmony_ci#define SOFT_RESET_REGBB (1 << 22) 4808c2ecf20Sopenharmony_ci#define SOFT_RESET_ORB (1 << 23) 4818c2ecf20Sopenharmony_ci#define SOFT_RESET_VCE (1 << 24) 4828c2ecf20Sopenharmony_ci 4838c2ecf20Sopenharmony_ci#define SRBM_READ_ERROR 0xE98 4848c2ecf20Sopenharmony_ci#define SRBM_INT_CNTL 0xEA0 4858c2ecf20Sopenharmony_ci#define SRBM_INT_ACK 0xEA8 4868c2ecf20Sopenharmony_ci 4878c2ecf20Sopenharmony_ci#define VM_L2_CNTL 0x1400 4888c2ecf20Sopenharmony_ci#define ENABLE_L2_CACHE (1 << 0) 4898c2ecf20Sopenharmony_ci#define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1) 4908c2ecf20Sopenharmony_ci#define L2_CACHE_PTE_ENDIAN_SWAP_MODE(x) ((x) << 2) 4918c2ecf20Sopenharmony_ci#define L2_CACHE_PDE_ENDIAN_SWAP_MODE(x) ((x) << 4) 4928c2ecf20Sopenharmony_ci#define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9) 4938c2ecf20Sopenharmony_ci#define ENABLE_L2_PDE0_CACHE_LRU_UPDATE_BY_WRITE (1 << 10) 4948c2ecf20Sopenharmony_ci#define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 15) 4958c2ecf20Sopenharmony_ci#define CONTEXT1_IDENTITY_ACCESS_MODE(x) (((x) & 3) << 19) 4968c2ecf20Sopenharmony_ci#define VM_L2_CNTL2 0x1404 4978c2ecf20Sopenharmony_ci#define INVALIDATE_ALL_L1_TLBS (1 << 0) 4988c2ecf20Sopenharmony_ci#define INVALIDATE_L2_CACHE (1 << 1) 4998c2ecf20Sopenharmony_ci#define INVALIDATE_CACHE_MODE(x) ((x) << 26) 5008c2ecf20Sopenharmony_ci#define INVALIDATE_PTE_AND_PDE_CACHES 0 5018c2ecf20Sopenharmony_ci#define INVALIDATE_ONLY_PTE_CACHES 1 5028c2ecf20Sopenharmony_ci#define INVALIDATE_ONLY_PDE_CACHES 2 5038c2ecf20Sopenharmony_ci#define VM_L2_CNTL3 0x1408 5048c2ecf20Sopenharmony_ci#define BANK_SELECT(x) ((x) << 0) 5058c2ecf20Sopenharmony_ci#define L2_CACHE_UPDATE_MODE(x) ((x) << 6) 5068c2ecf20Sopenharmony_ci#define L2_CACHE_BIGK_FRAGMENT_SIZE(x) ((x) << 15) 5078c2ecf20Sopenharmony_ci#define L2_CACHE_BIGK_ASSOCIATIVITY (1 << 20) 5088c2ecf20Sopenharmony_ci#define VM_L2_STATUS 0x140C 5098c2ecf20Sopenharmony_ci#define L2_BUSY (1 << 0) 5108c2ecf20Sopenharmony_ci#define VM_CONTEXT0_CNTL 0x1410 5118c2ecf20Sopenharmony_ci#define ENABLE_CONTEXT (1 << 0) 5128c2ecf20Sopenharmony_ci#define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1) 5138c2ecf20Sopenharmony_ci#define RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 3) 5148c2ecf20Sopenharmony_ci#define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4) 5158c2ecf20Sopenharmony_ci#define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 6) 5168c2ecf20Sopenharmony_ci#define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 7) 5178c2ecf20Sopenharmony_ci#define PDE0_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 9) 5188c2ecf20Sopenharmony_ci#define PDE0_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 10) 5198c2ecf20Sopenharmony_ci#define VALID_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 12) 5208c2ecf20Sopenharmony_ci#define VALID_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 13) 5218c2ecf20Sopenharmony_ci#define READ_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 15) 5228c2ecf20Sopenharmony_ci#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) 5238c2ecf20Sopenharmony_ci#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) 5248c2ecf20Sopenharmony_ci#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) 5258c2ecf20Sopenharmony_ci#define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24) 5268c2ecf20Sopenharmony_ci#define VM_CONTEXT1_CNTL 0x1414 5278c2ecf20Sopenharmony_ci#define VM_CONTEXT0_CNTL2 0x1430 5288c2ecf20Sopenharmony_ci#define VM_CONTEXT1_CNTL2 0x1434 5298c2ecf20Sopenharmony_ci#define VM_CONTEXT8_PAGE_TABLE_BASE_ADDR 0x1438 5308c2ecf20Sopenharmony_ci#define VM_CONTEXT9_PAGE_TABLE_BASE_ADDR 0x143c 5318c2ecf20Sopenharmony_ci#define VM_CONTEXT10_PAGE_TABLE_BASE_ADDR 0x1440 5328c2ecf20Sopenharmony_ci#define VM_CONTEXT11_PAGE_TABLE_BASE_ADDR 0x1444 5338c2ecf20Sopenharmony_ci#define VM_CONTEXT12_PAGE_TABLE_BASE_ADDR 0x1448 5348c2ecf20Sopenharmony_ci#define VM_CONTEXT13_PAGE_TABLE_BASE_ADDR 0x144c 5358c2ecf20Sopenharmony_ci#define VM_CONTEXT14_PAGE_TABLE_BASE_ADDR 0x1450 5368c2ecf20Sopenharmony_ci#define VM_CONTEXT15_PAGE_TABLE_BASE_ADDR 0x1454 5378c2ecf20Sopenharmony_ci 5388c2ecf20Sopenharmony_ci#define VM_INVALIDATE_REQUEST 0x1478 5398c2ecf20Sopenharmony_ci#define VM_INVALIDATE_RESPONSE 0x147c 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x14DC 5428c2ecf20Sopenharmony_ci#define PROTECTIONS_MASK (0xf << 0) 5438c2ecf20Sopenharmony_ci#define PROTECTIONS_SHIFT 0 5448c2ecf20Sopenharmony_ci /* bit 0: range 5458c2ecf20Sopenharmony_ci * bit 1: pde0 5468c2ecf20Sopenharmony_ci * bit 2: valid 5478c2ecf20Sopenharmony_ci * bit 3: read 5488c2ecf20Sopenharmony_ci * bit 4: write 5498c2ecf20Sopenharmony_ci */ 5508c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_ID_MASK (0xff << 12) 5518c2ecf20Sopenharmony_ci#define HAWAII_MEMORY_CLIENT_ID_MASK (0x1ff << 12) 5528c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_ID_SHIFT 12 5538c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_RW_MASK (1 << 24) 5548c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_RW_SHIFT 24 5558c2ecf20Sopenharmony_ci#define FAULT_VMID_MASK (0xf << 25) 5568c2ecf20Sopenharmony_ci#define FAULT_VMID_SHIFT 25 5578c2ecf20Sopenharmony_ci 5588c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT 0x14E4 5598c2ecf20Sopenharmony_ci 5608c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x14FC 5618c2ecf20Sopenharmony_ci 5628c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518 5638c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR 0x151c 5648c2ecf20Sopenharmony_ci 5658c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153c 5668c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_BASE_ADDR 0x1540 5678c2ecf20Sopenharmony_ci#define VM_CONTEXT2_PAGE_TABLE_BASE_ADDR 0x1544 5688c2ecf20Sopenharmony_ci#define VM_CONTEXT3_PAGE_TABLE_BASE_ADDR 0x1548 5698c2ecf20Sopenharmony_ci#define VM_CONTEXT4_PAGE_TABLE_BASE_ADDR 0x154c 5708c2ecf20Sopenharmony_ci#define VM_CONTEXT5_PAGE_TABLE_BASE_ADDR 0x1550 5718c2ecf20Sopenharmony_ci#define VM_CONTEXT6_PAGE_TABLE_BASE_ADDR 0x1554 5728c2ecf20Sopenharmony_ci#define VM_CONTEXT7_PAGE_TABLE_BASE_ADDR 0x1558 5738c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155c 5748c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_START_ADDR 0x1560 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C 5778c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_END_ADDR 0x1580 5788c2ecf20Sopenharmony_ci 5798c2ecf20Sopenharmony_ci#define VM_L2_CG 0x15c0 5808c2ecf20Sopenharmony_ci#define MC_CG_ENABLE (1 << 18) 5818c2ecf20Sopenharmony_ci#define MC_LS_ENABLE (1 << 19) 5828c2ecf20Sopenharmony_ci 5838c2ecf20Sopenharmony_ci#define MC_SHARED_CHMAP 0x2004 5848c2ecf20Sopenharmony_ci#define NOOFCHAN_SHIFT 12 5858c2ecf20Sopenharmony_ci#define NOOFCHAN_MASK 0x0000f000 5868c2ecf20Sopenharmony_ci#define MC_SHARED_CHREMAP 0x2008 5878c2ecf20Sopenharmony_ci 5888c2ecf20Sopenharmony_ci#define CHUB_CONTROL 0x1864 5898c2ecf20Sopenharmony_ci#define BYPASS_VM (1 << 0) 5908c2ecf20Sopenharmony_ci 5918c2ecf20Sopenharmony_ci#define MC_VM_FB_LOCATION 0x2024 5928c2ecf20Sopenharmony_ci#define MC_VM_AGP_TOP 0x2028 5938c2ecf20Sopenharmony_ci#define MC_VM_AGP_BOT 0x202C 5948c2ecf20Sopenharmony_ci#define MC_VM_AGP_BASE 0x2030 5958c2ecf20Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 5968c2ecf20Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 5978c2ecf20Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C 5988c2ecf20Sopenharmony_ci 5998c2ecf20Sopenharmony_ci#define MC_VM_MX_L1_TLB_CNTL 0x2064 6008c2ecf20Sopenharmony_ci#define ENABLE_L1_TLB (1 << 0) 6018c2ecf20Sopenharmony_ci#define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1) 6028c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3) 6038c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3) 6048c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3) 6058c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3) 6068c2ecf20Sopenharmony_ci#define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5) 6078c2ecf20Sopenharmony_ci#define ENABLE_ADVANCED_DRIVER_MODEL (1 << 6) 6088c2ecf20Sopenharmony_ci#define MC_VM_FB_OFFSET 0x2068 6098c2ecf20Sopenharmony_ci 6108c2ecf20Sopenharmony_ci#define MC_SHARED_BLACKOUT_CNTL 0x20ac 6118c2ecf20Sopenharmony_ci 6128c2ecf20Sopenharmony_ci#define MC_HUB_MISC_HUB_CG 0x20b8 6138c2ecf20Sopenharmony_ci#define MC_HUB_MISC_VM_CG 0x20bc 6148c2ecf20Sopenharmony_ci 6158c2ecf20Sopenharmony_ci#define MC_HUB_MISC_SIP_CG 0x20c0 6168c2ecf20Sopenharmony_ci 6178c2ecf20Sopenharmony_ci#define MC_XPB_CLK_GAT 0x2478 6188c2ecf20Sopenharmony_ci 6198c2ecf20Sopenharmony_ci#define MC_CITF_MISC_RD_CG 0x2648 6208c2ecf20Sopenharmony_ci#define MC_CITF_MISC_WR_CG 0x264c 6218c2ecf20Sopenharmony_ci#define MC_CITF_MISC_VM_CG 0x2650 6228c2ecf20Sopenharmony_ci 6238c2ecf20Sopenharmony_ci#define MC_ARB_RAMCFG 0x2760 6248c2ecf20Sopenharmony_ci#define NOOFBANK_SHIFT 0 6258c2ecf20Sopenharmony_ci#define NOOFBANK_MASK 0x00000003 6268c2ecf20Sopenharmony_ci#define NOOFRANK_SHIFT 2 6278c2ecf20Sopenharmony_ci#define NOOFRANK_MASK 0x00000004 6288c2ecf20Sopenharmony_ci#define NOOFROWS_SHIFT 3 6298c2ecf20Sopenharmony_ci#define NOOFROWS_MASK 0x00000038 6308c2ecf20Sopenharmony_ci#define NOOFCOLS_SHIFT 6 6318c2ecf20Sopenharmony_ci#define NOOFCOLS_MASK 0x000000C0 6328c2ecf20Sopenharmony_ci#define CHANSIZE_SHIFT 8 6338c2ecf20Sopenharmony_ci#define CHANSIZE_MASK 0x00000100 6348c2ecf20Sopenharmony_ci#define NOOFGROUPS_SHIFT 12 6358c2ecf20Sopenharmony_ci#define NOOFGROUPS_MASK 0x00001000 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci#define MC_ARB_DRAM_TIMING 0x2774 6388c2ecf20Sopenharmony_ci#define MC_ARB_DRAM_TIMING2 0x2778 6398c2ecf20Sopenharmony_ci 6408c2ecf20Sopenharmony_ci#define MC_ARB_BURST_TIME 0x2808 6418c2ecf20Sopenharmony_ci#define STATE0(x) ((x) << 0) 6428c2ecf20Sopenharmony_ci#define STATE0_MASK (0x1f << 0) 6438c2ecf20Sopenharmony_ci#define STATE0_SHIFT 0 6448c2ecf20Sopenharmony_ci#define STATE1(x) ((x) << 5) 6458c2ecf20Sopenharmony_ci#define STATE1_MASK (0x1f << 5) 6468c2ecf20Sopenharmony_ci#define STATE1_SHIFT 5 6478c2ecf20Sopenharmony_ci#define STATE2(x) ((x) << 10) 6488c2ecf20Sopenharmony_ci#define STATE2_MASK (0x1f << 10) 6498c2ecf20Sopenharmony_ci#define STATE2_SHIFT 10 6508c2ecf20Sopenharmony_ci#define STATE3(x) ((x) << 15) 6518c2ecf20Sopenharmony_ci#define STATE3_MASK (0x1f << 15) 6528c2ecf20Sopenharmony_ci#define STATE3_SHIFT 15 6538c2ecf20Sopenharmony_ci 6548c2ecf20Sopenharmony_ci#define MC_SEQ_RAS_TIMING 0x28a0 6558c2ecf20Sopenharmony_ci#define MC_SEQ_CAS_TIMING 0x28a4 6568c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING 0x28a8 6578c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING2 0x28ac 6588c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_TIMING 0x28b0 6598c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D0 0x28b4 6608c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D1 0x28b8 6618c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D0 0x28bc 6628c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D1 0x28c0 6638c2ecf20Sopenharmony_ci 6648c2ecf20Sopenharmony_ci#define MC_SEQ_SUP_CNTL 0x28c8 6658c2ecf20Sopenharmony_ci#define RUN_MASK (1 << 0) 6668c2ecf20Sopenharmony_ci#define MC_SEQ_SUP_PGM 0x28cc 6678c2ecf20Sopenharmony_ci#define MC_PMG_AUTO_CMD 0x28d0 6688c2ecf20Sopenharmony_ci 6698c2ecf20Sopenharmony_ci#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x28e8 6708c2ecf20Sopenharmony_ci#define TRAIN_DONE_D0 (1 << 30) 6718c2ecf20Sopenharmony_ci#define TRAIN_DONE_D1 (1 << 31) 6728c2ecf20Sopenharmony_ci 6738c2ecf20Sopenharmony_ci#define MC_IO_PAD_CNTL_D0 0x29d0 6748c2ecf20Sopenharmony_ci#define MEM_FALL_OUT_CMD (1 << 8) 6758c2ecf20Sopenharmony_ci 6768c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0 0x2a00 6778c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_SHIFT 8 6788c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_MASK 0x00000f00 6798c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_VALUE 3 6808c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_SHIFT 12 6818c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_MASK 0x0000f000 6828c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_VALUE 1 6838c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_SHIFT 28 6848c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000 6858c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_VALUE 5 6868c2ecf20Sopenharmony_ci#define MC_SEQ_MISC1 0x2a04 6878c2ecf20Sopenharmony_ci#define MC_SEQ_RESERVE_M 0x2a08 6888c2ecf20Sopenharmony_ci#define MC_PMG_CMD_EMRS 0x2a0c 6898c2ecf20Sopenharmony_ci 6908c2ecf20Sopenharmony_ci#define MC_SEQ_IO_DEBUG_INDEX 0x2a44 6918c2ecf20Sopenharmony_ci#define MC_SEQ_IO_DEBUG_DATA 0x2a48 6928c2ecf20Sopenharmony_ci 6938c2ecf20Sopenharmony_ci#define MC_SEQ_MISC5 0x2a54 6948c2ecf20Sopenharmony_ci#define MC_SEQ_MISC6 0x2a58 6958c2ecf20Sopenharmony_ci 6968c2ecf20Sopenharmony_ci#define MC_SEQ_MISC7 0x2a64 6978c2ecf20Sopenharmony_ci 6988c2ecf20Sopenharmony_ci#define MC_SEQ_RAS_TIMING_LP 0x2a6c 6998c2ecf20Sopenharmony_ci#define MC_SEQ_CAS_TIMING_LP 0x2a70 7008c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING_LP 0x2a74 7018c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING2_LP 0x2a78 7028c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D0_LP 0x2a7c 7038c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D1_LP 0x2a80 7048c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_EMRS_LP 0x2a84 7058c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS_LP 0x2a88 7068c2ecf20Sopenharmony_ci 7078c2ecf20Sopenharmony_ci#define MC_PMG_CMD_MRS 0x2aac 7088c2ecf20Sopenharmony_ci 7098c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D0_LP 0x2b1c 7108c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D1_LP 0x2b20 7118c2ecf20Sopenharmony_ci 7128c2ecf20Sopenharmony_ci#define MC_PMG_CMD_MRS1 0x2b44 7138c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS1_LP 0x2b48 7148c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_TIMING_LP 0x2b4c 7158c2ecf20Sopenharmony_ci 7168c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_2 0x2b54 7178c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_2_LP 0x2b58 7188c2ecf20Sopenharmony_ci#define MC_PMG_CMD_MRS2 0x2b5c 7198c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS2_LP 0x2b60 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_ci#define MCLK_PWRMGT_CNTL 0x2ba0 7228c2ecf20Sopenharmony_ci# define DLL_SPEED(x) ((x) << 0) 7238c2ecf20Sopenharmony_ci# define DLL_SPEED_MASK (0x1f << 0) 7248c2ecf20Sopenharmony_ci# define DLL_READY (1 << 6) 7258c2ecf20Sopenharmony_ci# define MC_INT_CNTL (1 << 7) 7268c2ecf20Sopenharmony_ci# define MRDCK0_PDNB (1 << 8) 7278c2ecf20Sopenharmony_ci# define MRDCK1_PDNB (1 << 9) 7288c2ecf20Sopenharmony_ci# define MRDCK0_RESET (1 << 16) 7298c2ecf20Sopenharmony_ci# define MRDCK1_RESET (1 << 17) 7308c2ecf20Sopenharmony_ci# define DLL_READY_READ (1 << 24) 7318c2ecf20Sopenharmony_ci#define DLL_CNTL 0x2ba4 7328c2ecf20Sopenharmony_ci# define MRDCK0_BYPASS (1 << 24) 7338c2ecf20Sopenharmony_ci# define MRDCK1_BYPASS (1 << 25) 7348c2ecf20Sopenharmony_ci 7358c2ecf20Sopenharmony_ci#define MPLL_FUNC_CNTL 0x2bb4 7368c2ecf20Sopenharmony_ci#define BWCTRL(x) ((x) << 20) 7378c2ecf20Sopenharmony_ci#define BWCTRL_MASK (0xff << 20) 7388c2ecf20Sopenharmony_ci#define MPLL_FUNC_CNTL_1 0x2bb8 7398c2ecf20Sopenharmony_ci#define VCO_MODE(x) ((x) << 0) 7408c2ecf20Sopenharmony_ci#define VCO_MODE_MASK (3 << 0) 7418c2ecf20Sopenharmony_ci#define CLKFRAC(x) ((x) << 4) 7428c2ecf20Sopenharmony_ci#define CLKFRAC_MASK (0xfff << 4) 7438c2ecf20Sopenharmony_ci#define CLKF(x) ((x) << 16) 7448c2ecf20Sopenharmony_ci#define CLKF_MASK (0xfff << 16) 7458c2ecf20Sopenharmony_ci#define MPLL_FUNC_CNTL_2 0x2bbc 7468c2ecf20Sopenharmony_ci#define MPLL_AD_FUNC_CNTL 0x2bc0 7478c2ecf20Sopenharmony_ci#define YCLK_POST_DIV(x) ((x) << 0) 7488c2ecf20Sopenharmony_ci#define YCLK_POST_DIV_MASK (7 << 0) 7498c2ecf20Sopenharmony_ci#define MPLL_DQ_FUNC_CNTL 0x2bc4 7508c2ecf20Sopenharmony_ci#define YCLK_SEL(x) ((x) << 4) 7518c2ecf20Sopenharmony_ci#define YCLK_SEL_MASK (1 << 4) 7528c2ecf20Sopenharmony_ci 7538c2ecf20Sopenharmony_ci#define MPLL_SS1 0x2bcc 7548c2ecf20Sopenharmony_ci#define CLKV(x) ((x) << 0) 7558c2ecf20Sopenharmony_ci#define CLKV_MASK (0x3ffffff << 0) 7568c2ecf20Sopenharmony_ci#define MPLL_SS2 0x2bd0 7578c2ecf20Sopenharmony_ci#define CLKS(x) ((x) << 0) 7588c2ecf20Sopenharmony_ci#define CLKS_MASK (0xfff << 0) 7598c2ecf20Sopenharmony_ci 7608c2ecf20Sopenharmony_ci#define HDP_HOST_PATH_CNTL 0x2C00 7618c2ecf20Sopenharmony_ci#define CLOCK_GATING_DIS (1 << 23) 7628c2ecf20Sopenharmony_ci#define HDP_NONSURFACE_BASE 0x2C04 7638c2ecf20Sopenharmony_ci#define HDP_NONSURFACE_INFO 0x2C08 7648c2ecf20Sopenharmony_ci#define HDP_NONSURFACE_SIZE 0x2C0C 7658c2ecf20Sopenharmony_ci 7668c2ecf20Sopenharmony_ci#define HDP_ADDR_CONFIG 0x2F48 7678c2ecf20Sopenharmony_ci#define HDP_MISC_CNTL 0x2F4C 7688c2ecf20Sopenharmony_ci#define HDP_FLUSH_INVALIDATE_CACHE (1 << 0) 7698c2ecf20Sopenharmony_ci#define HDP_MEM_POWER_LS 0x2F50 7708c2ecf20Sopenharmony_ci#define HDP_LS_ENABLE (1 << 0) 7718c2ecf20Sopenharmony_ci 7728c2ecf20Sopenharmony_ci#define ATC_MISC_CG 0x3350 7738c2ecf20Sopenharmony_ci 7748c2ecf20Sopenharmony_ci#define GMCON_RENG_EXECUTE 0x3508 7758c2ecf20Sopenharmony_ci#define RENG_EXECUTE_ON_PWR_UP (1 << 0) 7768c2ecf20Sopenharmony_ci#define GMCON_MISC 0x350c 7778c2ecf20Sopenharmony_ci#define RENG_EXECUTE_ON_REG_UPDATE (1 << 11) 7788c2ecf20Sopenharmony_ci#define STCTRL_STUTTER_EN (1 << 16) 7798c2ecf20Sopenharmony_ci 7808c2ecf20Sopenharmony_ci#define GMCON_PGFSM_CONFIG 0x3538 7818c2ecf20Sopenharmony_ci#define GMCON_PGFSM_WRITE 0x353c 7828c2ecf20Sopenharmony_ci#define GMCON_PGFSM_READ 0x3540 7838c2ecf20Sopenharmony_ci#define GMCON_MISC3 0x3544 7848c2ecf20Sopenharmony_ci 7858c2ecf20Sopenharmony_ci#define MC_SEQ_CNTL_3 0x3600 7868c2ecf20Sopenharmony_ci# define CAC_EN (1 << 31) 7878c2ecf20Sopenharmony_ci#define MC_SEQ_G5PDX_CTRL 0x3604 7888c2ecf20Sopenharmony_ci#define MC_SEQ_G5PDX_CTRL_LP 0x3608 7898c2ecf20Sopenharmony_ci#define MC_SEQ_G5PDX_CMD0 0x360c 7908c2ecf20Sopenharmony_ci#define MC_SEQ_G5PDX_CMD0_LP 0x3610 7918c2ecf20Sopenharmony_ci#define MC_SEQ_G5PDX_CMD1 0x3614 7928c2ecf20Sopenharmony_ci#define MC_SEQ_G5PDX_CMD1_LP 0x3618 7938c2ecf20Sopenharmony_ci 7948c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_DVS_CTL 0x3628 7958c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_DVS_CTL_LP 0x362c 7968c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_DVS_CMD 0x3630 7978c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_DVS_CMD_LP 0x3634 7988c2ecf20Sopenharmony_ci#define MC_SEQ_DLL_STBY 0x3638 7998c2ecf20Sopenharmony_ci#define MC_SEQ_DLL_STBY_LP 0x363c 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ci#define IH_RB_CNTL 0x3e00 8028c2ecf20Sopenharmony_ci# define IH_RB_ENABLE (1 << 0) 8038c2ecf20Sopenharmony_ci# define IH_RB_SIZE(x) ((x) << 1) /* log2 */ 8048c2ecf20Sopenharmony_ci# define IH_RB_FULL_DRAIN_ENABLE (1 << 6) 8058c2ecf20Sopenharmony_ci# define IH_WPTR_WRITEBACK_ENABLE (1 << 8) 8068c2ecf20Sopenharmony_ci# define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */ 8078c2ecf20Sopenharmony_ci# define IH_WPTR_OVERFLOW_ENABLE (1 << 16) 8088c2ecf20Sopenharmony_ci# define IH_WPTR_OVERFLOW_CLEAR (1 << 31) 8098c2ecf20Sopenharmony_ci#define IH_RB_BASE 0x3e04 8108c2ecf20Sopenharmony_ci#define IH_RB_RPTR 0x3e08 8118c2ecf20Sopenharmony_ci#define IH_RB_WPTR 0x3e0c 8128c2ecf20Sopenharmony_ci# define RB_OVERFLOW (1 << 0) 8138c2ecf20Sopenharmony_ci# define WPTR_OFFSET_MASK 0x3fffc 8148c2ecf20Sopenharmony_ci#define IH_RB_WPTR_ADDR_HI 0x3e10 8158c2ecf20Sopenharmony_ci#define IH_RB_WPTR_ADDR_LO 0x3e14 8168c2ecf20Sopenharmony_ci#define IH_CNTL 0x3e18 8178c2ecf20Sopenharmony_ci# define ENABLE_INTR (1 << 0) 8188c2ecf20Sopenharmony_ci# define IH_MC_SWAP(x) ((x) << 1) 8198c2ecf20Sopenharmony_ci# define IH_MC_SWAP_NONE 0 8208c2ecf20Sopenharmony_ci# define IH_MC_SWAP_16BIT 1 8218c2ecf20Sopenharmony_ci# define IH_MC_SWAP_32BIT 2 8228c2ecf20Sopenharmony_ci# define IH_MC_SWAP_64BIT 3 8238c2ecf20Sopenharmony_ci# define RPTR_REARM (1 << 4) 8248c2ecf20Sopenharmony_ci# define MC_WRREQ_CREDIT(x) ((x) << 15) 8258c2ecf20Sopenharmony_ci# define MC_WR_CLEAN_CNT(x) ((x) << 20) 8268c2ecf20Sopenharmony_ci# define MC_VMID(x) ((x) << 25) 8278c2ecf20Sopenharmony_ci 8288c2ecf20Sopenharmony_ci#define BIF_LNCNT_RESET 0x5220 8298c2ecf20Sopenharmony_ci# define RESET_LNCNT_EN (1 << 0) 8308c2ecf20Sopenharmony_ci 8318c2ecf20Sopenharmony_ci#define CONFIG_MEMSIZE 0x5428 8328c2ecf20Sopenharmony_ci 8338c2ecf20Sopenharmony_ci#define INTERRUPT_CNTL 0x5468 8348c2ecf20Sopenharmony_ci# define IH_DUMMY_RD_OVERRIDE (1 << 0) 8358c2ecf20Sopenharmony_ci# define IH_DUMMY_RD_EN (1 << 1) 8368c2ecf20Sopenharmony_ci# define IH_REQ_NONSNOOP_EN (1 << 3) 8378c2ecf20Sopenharmony_ci# define GEN_IH_INT_EN (1 << 8) 8388c2ecf20Sopenharmony_ci#define INTERRUPT_CNTL2 0x546c 8398c2ecf20Sopenharmony_ci 8408c2ecf20Sopenharmony_ci#define HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480 8418c2ecf20Sopenharmony_ci 8428c2ecf20Sopenharmony_ci#define BIF_FB_EN 0x5490 8438c2ecf20Sopenharmony_ci#define FB_READ_EN (1 << 0) 8448c2ecf20Sopenharmony_ci#define FB_WRITE_EN (1 << 1) 8458c2ecf20Sopenharmony_ci 8468c2ecf20Sopenharmony_ci#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 8478c2ecf20Sopenharmony_ci 8488c2ecf20Sopenharmony_ci#define GPU_HDP_FLUSH_REQ 0x54DC 8498c2ecf20Sopenharmony_ci#define GPU_HDP_FLUSH_DONE 0x54E0 8508c2ecf20Sopenharmony_ci#define CP0 (1 << 0) 8518c2ecf20Sopenharmony_ci#define CP1 (1 << 1) 8528c2ecf20Sopenharmony_ci#define CP2 (1 << 2) 8538c2ecf20Sopenharmony_ci#define CP3 (1 << 3) 8548c2ecf20Sopenharmony_ci#define CP4 (1 << 4) 8558c2ecf20Sopenharmony_ci#define CP5 (1 << 5) 8568c2ecf20Sopenharmony_ci#define CP6 (1 << 6) 8578c2ecf20Sopenharmony_ci#define CP7 (1 << 7) 8588c2ecf20Sopenharmony_ci#define CP8 (1 << 8) 8598c2ecf20Sopenharmony_ci#define CP9 (1 << 9) 8608c2ecf20Sopenharmony_ci#define SDMA0 (1 << 10) 8618c2ecf20Sopenharmony_ci#define SDMA1 (1 << 11) 8628c2ecf20Sopenharmony_ci 8638c2ecf20Sopenharmony_ci/* 0x6b04, 0x7704, 0x10304, 0x10f04, 0x11b04, 0x12704 */ 8648c2ecf20Sopenharmony_ci#define LB_MEMORY_CTRL 0x6b04 8658c2ecf20Sopenharmony_ci#define LB_MEMORY_SIZE(x) ((x) << 0) 8668c2ecf20Sopenharmony_ci#define LB_MEMORY_CONFIG(x) ((x) << 20) 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_ci#define DPG_WATERMARK_MASK_CONTROL 0x6cc8 8698c2ecf20Sopenharmony_ci# define LATENCY_WATERMARK_MASK(x) ((x) << 8) 8708c2ecf20Sopenharmony_ci#define DPG_PIPE_LATENCY_CONTROL 0x6ccc 8718c2ecf20Sopenharmony_ci# define LATENCY_LOW_WATERMARK(x) ((x) << 0) 8728c2ecf20Sopenharmony_ci# define LATENCY_HIGH_WATERMARK(x) ((x) << 16) 8738c2ecf20Sopenharmony_ci 8748c2ecf20Sopenharmony_ci/* 0x6b24, 0x7724, 0x10324, 0x10f24, 0x11b24, 0x12724 */ 8758c2ecf20Sopenharmony_ci#define LB_VLINE_STATUS 0x6b24 8768c2ecf20Sopenharmony_ci# define VLINE_OCCURRED (1 << 0) 8778c2ecf20Sopenharmony_ci# define VLINE_ACK (1 << 4) 8788c2ecf20Sopenharmony_ci# define VLINE_STAT (1 << 12) 8798c2ecf20Sopenharmony_ci# define VLINE_INTERRUPT (1 << 16) 8808c2ecf20Sopenharmony_ci# define VLINE_INTERRUPT_TYPE (1 << 17) 8818c2ecf20Sopenharmony_ci/* 0x6b2c, 0x772c, 0x1032c, 0x10f2c, 0x11b2c, 0x1272c */ 8828c2ecf20Sopenharmony_ci#define LB_VBLANK_STATUS 0x6b2c 8838c2ecf20Sopenharmony_ci# define VBLANK_OCCURRED (1 << 0) 8848c2ecf20Sopenharmony_ci# define VBLANK_ACK (1 << 4) 8858c2ecf20Sopenharmony_ci# define VBLANK_STAT (1 << 12) 8868c2ecf20Sopenharmony_ci# define VBLANK_INTERRUPT (1 << 16) 8878c2ecf20Sopenharmony_ci# define VBLANK_INTERRUPT_TYPE (1 << 17) 8888c2ecf20Sopenharmony_ci 8898c2ecf20Sopenharmony_ci/* 0x6b20, 0x7720, 0x10320, 0x10f20, 0x11b20, 0x12720 */ 8908c2ecf20Sopenharmony_ci#define LB_INTERRUPT_MASK 0x6b20 8918c2ecf20Sopenharmony_ci# define VBLANK_INTERRUPT_MASK (1 << 0) 8928c2ecf20Sopenharmony_ci# define VLINE_INTERRUPT_MASK (1 << 4) 8938c2ecf20Sopenharmony_ci# define VLINE2_INTERRUPT_MASK (1 << 8) 8948c2ecf20Sopenharmony_ci 8958c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS 0x60f4 8968c2ecf20Sopenharmony_ci# define LB_D1_VLINE_INTERRUPT (1 << 2) 8978c2ecf20Sopenharmony_ci# define LB_D1_VBLANK_INTERRUPT (1 << 3) 8988c2ecf20Sopenharmony_ci# define DC_HPD1_INTERRUPT (1 << 17) 8998c2ecf20Sopenharmony_ci# define DC_HPD1_RX_INTERRUPT (1 << 18) 9008c2ecf20Sopenharmony_ci# define DACA_AUTODETECT_INTERRUPT (1 << 22) 9018c2ecf20Sopenharmony_ci# define DACB_AUTODETECT_INTERRUPT (1 << 23) 9028c2ecf20Sopenharmony_ci# define DC_I2C_SW_DONE_INTERRUPT (1 << 24) 9038c2ecf20Sopenharmony_ci# define DC_I2C_HW_DONE_INTERRUPT (1 << 25) 9048c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE 0x60f8 9058c2ecf20Sopenharmony_ci# define LB_D2_VLINE_INTERRUPT (1 << 2) 9068c2ecf20Sopenharmony_ci# define LB_D2_VBLANK_INTERRUPT (1 << 3) 9078c2ecf20Sopenharmony_ci# define DC_HPD2_INTERRUPT (1 << 17) 9088c2ecf20Sopenharmony_ci# define DC_HPD2_RX_INTERRUPT (1 << 18) 9098c2ecf20Sopenharmony_ci# define DISP_TIMER_INTERRUPT (1 << 24) 9108c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE2 0x60fc 9118c2ecf20Sopenharmony_ci# define LB_D3_VLINE_INTERRUPT (1 << 2) 9128c2ecf20Sopenharmony_ci# define LB_D3_VBLANK_INTERRUPT (1 << 3) 9138c2ecf20Sopenharmony_ci# define DC_HPD3_INTERRUPT (1 << 17) 9148c2ecf20Sopenharmony_ci# define DC_HPD3_RX_INTERRUPT (1 << 18) 9158c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE3 0x6100 9168c2ecf20Sopenharmony_ci# define LB_D4_VLINE_INTERRUPT (1 << 2) 9178c2ecf20Sopenharmony_ci# define LB_D4_VBLANK_INTERRUPT (1 << 3) 9188c2ecf20Sopenharmony_ci# define DC_HPD4_INTERRUPT (1 << 17) 9198c2ecf20Sopenharmony_ci# define DC_HPD4_RX_INTERRUPT (1 << 18) 9208c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE4 0x614c 9218c2ecf20Sopenharmony_ci# define LB_D5_VLINE_INTERRUPT (1 << 2) 9228c2ecf20Sopenharmony_ci# define LB_D5_VBLANK_INTERRUPT (1 << 3) 9238c2ecf20Sopenharmony_ci# define DC_HPD5_INTERRUPT (1 << 17) 9248c2ecf20Sopenharmony_ci# define DC_HPD5_RX_INTERRUPT (1 << 18) 9258c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE5 0x6150 9268c2ecf20Sopenharmony_ci# define LB_D6_VLINE_INTERRUPT (1 << 2) 9278c2ecf20Sopenharmony_ci# define LB_D6_VBLANK_INTERRUPT (1 << 3) 9288c2ecf20Sopenharmony_ci# define DC_HPD6_INTERRUPT (1 << 17) 9298c2ecf20Sopenharmony_ci# define DC_HPD6_RX_INTERRUPT (1 << 18) 9308c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE6 0x6780 9318c2ecf20Sopenharmony_ci 9328c2ecf20Sopenharmony_ci/* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */ 9338c2ecf20Sopenharmony_ci#define GRPH_INT_STATUS 0x6858 9348c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_OCCURRED (1 << 0) 9358c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_CLEAR (1 << 8) 9368c2ecf20Sopenharmony_ci/* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */ 9378c2ecf20Sopenharmony_ci#define GRPH_INT_CONTROL 0x685c 9388c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_MASK (1 << 0) 9398c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_TYPE (1 << 8) 9408c2ecf20Sopenharmony_ci 9418c2ecf20Sopenharmony_ci#define DAC_AUTODETECT_INT_CONTROL 0x67c8 9428c2ecf20Sopenharmony_ci 9438c2ecf20Sopenharmony_ci#define DC_HPD1_INT_STATUS 0x601c 9448c2ecf20Sopenharmony_ci#define DC_HPD2_INT_STATUS 0x6028 9458c2ecf20Sopenharmony_ci#define DC_HPD3_INT_STATUS 0x6034 9468c2ecf20Sopenharmony_ci#define DC_HPD4_INT_STATUS 0x6040 9478c2ecf20Sopenharmony_ci#define DC_HPD5_INT_STATUS 0x604c 9488c2ecf20Sopenharmony_ci#define DC_HPD6_INT_STATUS 0x6058 9498c2ecf20Sopenharmony_ci# define DC_HPDx_INT_STATUS (1 << 0) 9508c2ecf20Sopenharmony_ci# define DC_HPDx_SENSE (1 << 1) 9518c2ecf20Sopenharmony_ci# define DC_HPDx_SENSE_DELAYED (1 << 4) 9528c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_STATUS (1 << 8) 9538c2ecf20Sopenharmony_ci 9548c2ecf20Sopenharmony_ci#define DC_HPD1_INT_CONTROL 0x6020 9558c2ecf20Sopenharmony_ci#define DC_HPD2_INT_CONTROL 0x602c 9568c2ecf20Sopenharmony_ci#define DC_HPD3_INT_CONTROL 0x6038 9578c2ecf20Sopenharmony_ci#define DC_HPD4_INT_CONTROL 0x6044 9588c2ecf20Sopenharmony_ci#define DC_HPD5_INT_CONTROL 0x6050 9598c2ecf20Sopenharmony_ci#define DC_HPD6_INT_CONTROL 0x605c 9608c2ecf20Sopenharmony_ci# define DC_HPDx_INT_ACK (1 << 0) 9618c2ecf20Sopenharmony_ci# define DC_HPDx_INT_POLARITY (1 << 8) 9628c2ecf20Sopenharmony_ci# define DC_HPDx_INT_EN (1 << 16) 9638c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_ACK (1 << 20) 9648c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_EN (1 << 24) 9658c2ecf20Sopenharmony_ci 9668c2ecf20Sopenharmony_ci#define DC_HPD1_CONTROL 0x6024 9678c2ecf20Sopenharmony_ci#define DC_HPD2_CONTROL 0x6030 9688c2ecf20Sopenharmony_ci#define DC_HPD3_CONTROL 0x603c 9698c2ecf20Sopenharmony_ci#define DC_HPD4_CONTROL 0x6048 9708c2ecf20Sopenharmony_ci#define DC_HPD5_CONTROL 0x6054 9718c2ecf20Sopenharmony_ci#define DC_HPD6_CONTROL 0x6060 9728c2ecf20Sopenharmony_ci# define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0) 9738c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_TIMER(x) ((x) << 16) 9748c2ecf20Sopenharmony_ci# define DC_HPDx_EN (1 << 28) 9758c2ecf20Sopenharmony_ci 9768c2ecf20Sopenharmony_ci#define DPG_PIPE_STUTTER_CONTROL 0x6cd4 9778c2ecf20Sopenharmony_ci# define STUTTER_ENABLE (1 << 0) 9788c2ecf20Sopenharmony_ci 9798c2ecf20Sopenharmony_ci/* DCE8 FMT blocks */ 9808c2ecf20Sopenharmony_ci#define FMT_DYNAMIC_EXP_CNTL 0x6fb4 9818c2ecf20Sopenharmony_ci# define FMT_DYNAMIC_EXP_EN (1 << 0) 9828c2ecf20Sopenharmony_ci# define FMT_DYNAMIC_EXP_MODE (1 << 4) 9838c2ecf20Sopenharmony_ci /* 0 = 10bit -> 12bit, 1 = 8bit -> 12bit */ 9848c2ecf20Sopenharmony_ci#define FMT_CONTROL 0x6fb8 9858c2ecf20Sopenharmony_ci# define FMT_PIXEL_ENCODING (1 << 16) 9868c2ecf20Sopenharmony_ci /* 0 = RGB 4:4:4 or YCbCr 4:4:4, 1 = YCbCr 4:2:2 */ 9878c2ecf20Sopenharmony_ci#define FMT_BIT_DEPTH_CONTROL 0x6fc8 9888c2ecf20Sopenharmony_ci# define FMT_TRUNCATE_EN (1 << 0) 9898c2ecf20Sopenharmony_ci# define FMT_TRUNCATE_MODE (1 << 1) 9908c2ecf20Sopenharmony_ci# define FMT_TRUNCATE_DEPTH(x) ((x) << 4) /* 0 - 18bpp, 1 - 24bpp, 2 - 30bpp */ 9918c2ecf20Sopenharmony_ci# define FMT_SPATIAL_DITHER_EN (1 << 8) 9928c2ecf20Sopenharmony_ci# define FMT_SPATIAL_DITHER_MODE(x) ((x) << 9) 9938c2ecf20Sopenharmony_ci# define FMT_SPATIAL_DITHER_DEPTH(x) ((x) << 11) /* 0 - 18bpp, 1 - 24bpp, 2 - 30bpp */ 9948c2ecf20Sopenharmony_ci# define FMT_FRAME_RANDOM_ENABLE (1 << 13) 9958c2ecf20Sopenharmony_ci# define FMT_RGB_RANDOM_ENABLE (1 << 14) 9968c2ecf20Sopenharmony_ci# define FMT_HIGHPASS_RANDOM_ENABLE (1 << 15) 9978c2ecf20Sopenharmony_ci# define FMT_TEMPORAL_DITHER_EN (1 << 16) 9988c2ecf20Sopenharmony_ci# define FMT_TEMPORAL_DITHER_DEPTH(x) ((x) << 17) /* 0 - 18bpp, 1 - 24bpp, 2 - 30bpp */ 9998c2ecf20Sopenharmony_ci# define FMT_TEMPORAL_DITHER_OFFSET(x) ((x) << 21) 10008c2ecf20Sopenharmony_ci# define FMT_TEMPORAL_LEVEL (1 << 24) 10018c2ecf20Sopenharmony_ci# define FMT_TEMPORAL_DITHER_RESET (1 << 25) 10028c2ecf20Sopenharmony_ci# define FMT_25FRC_SEL(x) ((x) << 26) 10038c2ecf20Sopenharmony_ci# define FMT_50FRC_SEL(x) ((x) << 28) 10048c2ecf20Sopenharmony_ci# define FMT_75FRC_SEL(x) ((x) << 30) 10058c2ecf20Sopenharmony_ci#define FMT_CLAMP_CONTROL 0x6fe4 10068c2ecf20Sopenharmony_ci# define FMT_CLAMP_DATA_EN (1 << 0) 10078c2ecf20Sopenharmony_ci# define FMT_CLAMP_COLOR_FORMAT(x) ((x) << 16) 10088c2ecf20Sopenharmony_ci# define FMT_CLAMP_6BPC 0 10098c2ecf20Sopenharmony_ci# define FMT_CLAMP_8BPC 1 10108c2ecf20Sopenharmony_ci# define FMT_CLAMP_10BPC 2 10118c2ecf20Sopenharmony_ci 10128c2ecf20Sopenharmony_ci#define GRBM_CNTL 0x8000 10138c2ecf20Sopenharmony_ci#define GRBM_READ_TIMEOUT(x) ((x) << 0) 10148c2ecf20Sopenharmony_ci 10158c2ecf20Sopenharmony_ci#define GRBM_STATUS2 0x8008 10168c2ecf20Sopenharmony_ci#define ME0PIPE1_CMDFIFO_AVAIL_MASK 0x0000000F 10178c2ecf20Sopenharmony_ci#define ME0PIPE1_CF_RQ_PENDING (1 << 4) 10188c2ecf20Sopenharmony_ci#define ME0PIPE1_PF_RQ_PENDING (1 << 5) 10198c2ecf20Sopenharmony_ci#define ME1PIPE0_RQ_PENDING (1 << 6) 10208c2ecf20Sopenharmony_ci#define ME1PIPE1_RQ_PENDING (1 << 7) 10218c2ecf20Sopenharmony_ci#define ME1PIPE2_RQ_PENDING (1 << 8) 10228c2ecf20Sopenharmony_ci#define ME1PIPE3_RQ_PENDING (1 << 9) 10238c2ecf20Sopenharmony_ci#define ME2PIPE0_RQ_PENDING (1 << 10) 10248c2ecf20Sopenharmony_ci#define ME2PIPE1_RQ_PENDING (1 << 11) 10258c2ecf20Sopenharmony_ci#define ME2PIPE2_RQ_PENDING (1 << 12) 10268c2ecf20Sopenharmony_ci#define ME2PIPE3_RQ_PENDING (1 << 13) 10278c2ecf20Sopenharmony_ci#define RLC_RQ_PENDING (1 << 14) 10288c2ecf20Sopenharmony_ci#define RLC_BUSY (1 << 24) 10298c2ecf20Sopenharmony_ci#define TC_BUSY (1 << 25) 10308c2ecf20Sopenharmony_ci#define CPF_BUSY (1 << 28) 10318c2ecf20Sopenharmony_ci#define CPC_BUSY (1 << 29) 10328c2ecf20Sopenharmony_ci#define CPG_BUSY (1 << 30) 10338c2ecf20Sopenharmony_ci 10348c2ecf20Sopenharmony_ci#define GRBM_STATUS 0x8010 10358c2ecf20Sopenharmony_ci#define ME0PIPE0_CMDFIFO_AVAIL_MASK 0x0000000F 10368c2ecf20Sopenharmony_ci#define SRBM_RQ_PENDING (1 << 5) 10378c2ecf20Sopenharmony_ci#define ME0PIPE0_CF_RQ_PENDING (1 << 7) 10388c2ecf20Sopenharmony_ci#define ME0PIPE0_PF_RQ_PENDING (1 << 8) 10398c2ecf20Sopenharmony_ci#define GDS_DMA_RQ_PENDING (1 << 9) 10408c2ecf20Sopenharmony_ci#define DB_CLEAN (1 << 12) 10418c2ecf20Sopenharmony_ci#define CB_CLEAN (1 << 13) 10428c2ecf20Sopenharmony_ci#define TA_BUSY (1 << 14) 10438c2ecf20Sopenharmony_ci#define GDS_BUSY (1 << 15) 10448c2ecf20Sopenharmony_ci#define WD_BUSY_NO_DMA (1 << 16) 10458c2ecf20Sopenharmony_ci#define VGT_BUSY (1 << 17) 10468c2ecf20Sopenharmony_ci#define IA_BUSY_NO_DMA (1 << 18) 10478c2ecf20Sopenharmony_ci#define IA_BUSY (1 << 19) 10488c2ecf20Sopenharmony_ci#define SX_BUSY (1 << 20) 10498c2ecf20Sopenharmony_ci#define WD_BUSY (1 << 21) 10508c2ecf20Sopenharmony_ci#define SPI_BUSY (1 << 22) 10518c2ecf20Sopenharmony_ci#define BCI_BUSY (1 << 23) 10528c2ecf20Sopenharmony_ci#define SC_BUSY (1 << 24) 10538c2ecf20Sopenharmony_ci#define PA_BUSY (1 << 25) 10548c2ecf20Sopenharmony_ci#define DB_BUSY (1 << 26) 10558c2ecf20Sopenharmony_ci#define CP_COHERENCY_BUSY (1 << 28) 10568c2ecf20Sopenharmony_ci#define CP_BUSY (1 << 29) 10578c2ecf20Sopenharmony_ci#define CB_BUSY (1 << 30) 10588c2ecf20Sopenharmony_ci#define GUI_ACTIVE (1 << 31) 10598c2ecf20Sopenharmony_ci#define GRBM_STATUS_SE0 0x8014 10608c2ecf20Sopenharmony_ci#define GRBM_STATUS_SE1 0x8018 10618c2ecf20Sopenharmony_ci#define GRBM_STATUS_SE2 0x8038 10628c2ecf20Sopenharmony_ci#define GRBM_STATUS_SE3 0x803C 10638c2ecf20Sopenharmony_ci#define SE_DB_CLEAN (1 << 1) 10648c2ecf20Sopenharmony_ci#define SE_CB_CLEAN (1 << 2) 10658c2ecf20Sopenharmony_ci#define SE_BCI_BUSY (1 << 22) 10668c2ecf20Sopenharmony_ci#define SE_VGT_BUSY (1 << 23) 10678c2ecf20Sopenharmony_ci#define SE_PA_BUSY (1 << 24) 10688c2ecf20Sopenharmony_ci#define SE_TA_BUSY (1 << 25) 10698c2ecf20Sopenharmony_ci#define SE_SX_BUSY (1 << 26) 10708c2ecf20Sopenharmony_ci#define SE_SPI_BUSY (1 << 27) 10718c2ecf20Sopenharmony_ci#define SE_SC_BUSY (1 << 29) 10728c2ecf20Sopenharmony_ci#define SE_DB_BUSY (1 << 30) 10738c2ecf20Sopenharmony_ci#define SE_CB_BUSY (1 << 31) 10748c2ecf20Sopenharmony_ci 10758c2ecf20Sopenharmony_ci#define GRBM_SOFT_RESET 0x8020 10768c2ecf20Sopenharmony_ci#define SOFT_RESET_CP (1 << 0) /* All CP blocks */ 10778c2ecf20Sopenharmony_ci#define SOFT_RESET_RLC (1 << 2) /* RLC */ 10788c2ecf20Sopenharmony_ci#define SOFT_RESET_GFX (1 << 16) /* GFX */ 10798c2ecf20Sopenharmony_ci#define SOFT_RESET_CPF (1 << 17) /* CP fetcher shared by gfx and compute */ 10808c2ecf20Sopenharmony_ci#define SOFT_RESET_CPC (1 << 18) /* CP Compute (MEC1/2) */ 10818c2ecf20Sopenharmony_ci#define SOFT_RESET_CPG (1 << 19) /* CP GFX (PFP, ME, CE) */ 10828c2ecf20Sopenharmony_ci 10838c2ecf20Sopenharmony_ci#define GRBM_INT_CNTL 0x8060 10848c2ecf20Sopenharmony_ci# define RDERR_INT_ENABLE (1 << 0) 10858c2ecf20Sopenharmony_ci# define GUI_IDLE_INT_ENABLE (1 << 19) 10868c2ecf20Sopenharmony_ci 10878c2ecf20Sopenharmony_ci#define CP_CPC_STATUS 0x8210 10888c2ecf20Sopenharmony_ci#define CP_CPC_BUSY_STAT 0x8214 10898c2ecf20Sopenharmony_ci#define CP_CPC_STALLED_STAT1 0x8218 10908c2ecf20Sopenharmony_ci#define CP_CPF_STATUS 0x821c 10918c2ecf20Sopenharmony_ci#define CP_CPF_BUSY_STAT 0x8220 10928c2ecf20Sopenharmony_ci#define CP_CPF_STALLED_STAT1 0x8224 10938c2ecf20Sopenharmony_ci 10948c2ecf20Sopenharmony_ci#define CP_MEC_CNTL 0x8234 10958c2ecf20Sopenharmony_ci#define MEC_ME2_HALT (1 << 28) 10968c2ecf20Sopenharmony_ci#define MEC_ME1_HALT (1 << 30) 10978c2ecf20Sopenharmony_ci 10988c2ecf20Sopenharmony_ci#define CP_MEC_CNTL 0x8234 10998c2ecf20Sopenharmony_ci#define MEC_ME2_HALT (1 << 28) 11008c2ecf20Sopenharmony_ci#define MEC_ME1_HALT (1 << 30) 11018c2ecf20Sopenharmony_ci 11028c2ecf20Sopenharmony_ci#define CP_STALLED_STAT3 0x8670 11038c2ecf20Sopenharmony_ci#define CP_STALLED_STAT1 0x8674 11048c2ecf20Sopenharmony_ci#define CP_STALLED_STAT2 0x8678 11058c2ecf20Sopenharmony_ci 11068c2ecf20Sopenharmony_ci#define CP_STAT 0x8680 11078c2ecf20Sopenharmony_ci 11088c2ecf20Sopenharmony_ci#define CP_ME_CNTL 0x86D8 11098c2ecf20Sopenharmony_ci#define CP_CE_HALT (1 << 24) 11108c2ecf20Sopenharmony_ci#define CP_PFP_HALT (1 << 26) 11118c2ecf20Sopenharmony_ci#define CP_ME_HALT (1 << 28) 11128c2ecf20Sopenharmony_ci 11138c2ecf20Sopenharmony_ci#define CP_RB0_RPTR 0x8700 11148c2ecf20Sopenharmony_ci#define CP_RB_WPTR_DELAY 0x8704 11158c2ecf20Sopenharmony_ci#define CP_RB_WPTR_POLL_CNTL 0x8708 11168c2ecf20Sopenharmony_ci#define IDLE_POLL_COUNT(x) ((x) << 16) 11178c2ecf20Sopenharmony_ci#define IDLE_POLL_COUNT_MASK (0xffff << 16) 11188c2ecf20Sopenharmony_ci 11198c2ecf20Sopenharmony_ci#define CP_MEQ_THRESHOLDS 0x8764 11208c2ecf20Sopenharmony_ci#define MEQ1_START(x) ((x) << 0) 11218c2ecf20Sopenharmony_ci#define MEQ2_START(x) ((x) << 8) 11228c2ecf20Sopenharmony_ci 11238c2ecf20Sopenharmony_ci#define VGT_VTX_VECT_EJECT_REG 0x88B0 11248c2ecf20Sopenharmony_ci 11258c2ecf20Sopenharmony_ci#define VGT_CACHE_INVALIDATION 0x88C4 11268c2ecf20Sopenharmony_ci#define CACHE_INVALIDATION(x) ((x) << 0) 11278c2ecf20Sopenharmony_ci#define VC_ONLY 0 11288c2ecf20Sopenharmony_ci#define TC_ONLY 1 11298c2ecf20Sopenharmony_ci#define VC_AND_TC 2 11308c2ecf20Sopenharmony_ci#define AUTO_INVLD_EN(x) ((x) << 6) 11318c2ecf20Sopenharmony_ci#define NO_AUTO 0 11328c2ecf20Sopenharmony_ci#define ES_AUTO 1 11338c2ecf20Sopenharmony_ci#define GS_AUTO 2 11348c2ecf20Sopenharmony_ci#define ES_AND_GS_AUTO 3 11358c2ecf20Sopenharmony_ci 11368c2ecf20Sopenharmony_ci#define VGT_GS_VERTEX_REUSE 0x88D4 11378c2ecf20Sopenharmony_ci 11388c2ecf20Sopenharmony_ci#define CC_GC_SHADER_ARRAY_CONFIG 0x89bc 11398c2ecf20Sopenharmony_ci#define INACTIVE_CUS_MASK 0xFFFF0000 11408c2ecf20Sopenharmony_ci#define INACTIVE_CUS_SHIFT 16 11418c2ecf20Sopenharmony_ci#define GC_USER_SHADER_ARRAY_CONFIG 0x89c0 11428c2ecf20Sopenharmony_ci 11438c2ecf20Sopenharmony_ci#define PA_CL_ENHANCE 0x8A14 11448c2ecf20Sopenharmony_ci#define CLIP_VTX_REORDER_ENA (1 << 0) 11458c2ecf20Sopenharmony_ci#define NUM_CLIP_SEQ(x) ((x) << 1) 11468c2ecf20Sopenharmony_ci 11478c2ecf20Sopenharmony_ci#define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24 11488c2ecf20Sopenharmony_ci#define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) 11498c2ecf20Sopenharmony_ci#define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) 11508c2ecf20Sopenharmony_ci 11518c2ecf20Sopenharmony_ci#define PA_SC_FIFO_SIZE 0x8BCC 11528c2ecf20Sopenharmony_ci#define SC_FRONTEND_PRIM_FIFO_SIZE(x) ((x) << 0) 11538c2ecf20Sopenharmony_ci#define SC_BACKEND_PRIM_FIFO_SIZE(x) ((x) << 6) 11548c2ecf20Sopenharmony_ci#define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 15) 11558c2ecf20Sopenharmony_ci#define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 23) 11568c2ecf20Sopenharmony_ci 11578c2ecf20Sopenharmony_ci#define PA_SC_ENHANCE 0x8BF0 11588c2ecf20Sopenharmony_ci#define ENABLE_PA_SC_OUT_OF_ORDER (1 << 0) 11598c2ecf20Sopenharmony_ci#define DISABLE_PA_SC_GUIDANCE (1 << 13) 11608c2ecf20Sopenharmony_ci 11618c2ecf20Sopenharmony_ci#define SQ_CONFIG 0x8C00 11628c2ecf20Sopenharmony_ci 11638c2ecf20Sopenharmony_ci#define SH_MEM_BASES 0x8C28 11648c2ecf20Sopenharmony_ci/* if PTR32, these are the bases for scratch and lds */ 11658c2ecf20Sopenharmony_ci#define PRIVATE_BASE(x) ((x) << 0) /* scratch */ 11668c2ecf20Sopenharmony_ci#define SHARED_BASE(x) ((x) << 16) /* LDS */ 11678c2ecf20Sopenharmony_ci#define SH_MEM_APE1_BASE 0x8C2C 11688c2ecf20Sopenharmony_ci/* if PTR32, this is the base location of GPUVM */ 11698c2ecf20Sopenharmony_ci#define SH_MEM_APE1_LIMIT 0x8C30 11708c2ecf20Sopenharmony_ci/* if PTR32, this is the upper limit of GPUVM */ 11718c2ecf20Sopenharmony_ci#define SH_MEM_CONFIG 0x8C34 11728c2ecf20Sopenharmony_ci#define PTR32 (1 << 0) 11738c2ecf20Sopenharmony_ci#define ALIGNMENT_MODE(x) ((x) << 2) 11748c2ecf20Sopenharmony_ci#define SH_MEM_ALIGNMENT_MODE_DWORD 0 11758c2ecf20Sopenharmony_ci#define SH_MEM_ALIGNMENT_MODE_DWORD_STRICT 1 11768c2ecf20Sopenharmony_ci#define SH_MEM_ALIGNMENT_MODE_STRICT 2 11778c2ecf20Sopenharmony_ci#define SH_MEM_ALIGNMENT_MODE_UNALIGNED 3 11788c2ecf20Sopenharmony_ci#define DEFAULT_MTYPE(x) ((x) << 4) 11798c2ecf20Sopenharmony_ci#define APE1_MTYPE(x) ((x) << 7) 11808c2ecf20Sopenharmony_ci/* valid for both DEFAULT_MTYPE and APE1_MTYPE */ 11818c2ecf20Sopenharmony_ci#define MTYPE_CACHED 0 11828c2ecf20Sopenharmony_ci#define MTYPE_NONCACHED 3 11838c2ecf20Sopenharmony_ci 11848c2ecf20Sopenharmony_ci#define SX_DEBUG_1 0x9060 11858c2ecf20Sopenharmony_ci 11868c2ecf20Sopenharmony_ci#define SPI_CONFIG_CNTL 0x9100 11878c2ecf20Sopenharmony_ci 11888c2ecf20Sopenharmony_ci#define SPI_CONFIG_CNTL_1 0x913C 11898c2ecf20Sopenharmony_ci#define VTX_DONE_DELAY(x) ((x) << 0) 11908c2ecf20Sopenharmony_ci#define INTERP_ONE_PRIM_PER_ROW (1 << 4) 11918c2ecf20Sopenharmony_ci 11928c2ecf20Sopenharmony_ci#define TA_CNTL_AUX 0x9508 11938c2ecf20Sopenharmony_ci 11948c2ecf20Sopenharmony_ci#define DB_DEBUG 0x9830 11958c2ecf20Sopenharmony_ci#define DB_DEBUG2 0x9834 11968c2ecf20Sopenharmony_ci#define DB_DEBUG3 0x9838 11978c2ecf20Sopenharmony_ci 11988c2ecf20Sopenharmony_ci#define CC_RB_BACKEND_DISABLE 0x98F4 11998c2ecf20Sopenharmony_ci#define BACKEND_DISABLE(x) ((x) << 16) 12008c2ecf20Sopenharmony_ci#define GB_ADDR_CONFIG 0x98F8 12018c2ecf20Sopenharmony_ci#define NUM_PIPES(x) ((x) << 0) 12028c2ecf20Sopenharmony_ci#define NUM_PIPES_MASK 0x00000007 12038c2ecf20Sopenharmony_ci#define NUM_PIPES_SHIFT 0 12048c2ecf20Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE(x) ((x) << 4) 12058c2ecf20Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE_MASK 0x00000070 12068c2ecf20Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE_SHIFT 4 12078c2ecf20Sopenharmony_ci#define NUM_SHADER_ENGINES(x) ((x) << 12) 12088c2ecf20Sopenharmony_ci#define NUM_SHADER_ENGINES_MASK 0x00003000 12098c2ecf20Sopenharmony_ci#define NUM_SHADER_ENGINES_SHIFT 12 12108c2ecf20Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16) 12118c2ecf20Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000 12128c2ecf20Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE_SHIFT 16 12138c2ecf20Sopenharmony_ci#define ROW_SIZE(x) ((x) << 28) 12148c2ecf20Sopenharmony_ci#define ROW_SIZE_MASK 0x30000000 12158c2ecf20Sopenharmony_ci#define ROW_SIZE_SHIFT 28 12168c2ecf20Sopenharmony_ci 12178c2ecf20Sopenharmony_ci#define GB_TILE_MODE0 0x9910 12188c2ecf20Sopenharmony_ci# define ARRAY_MODE(x) ((x) << 2) 12198c2ecf20Sopenharmony_ci# define ARRAY_LINEAR_GENERAL 0 12208c2ecf20Sopenharmony_ci# define ARRAY_LINEAR_ALIGNED 1 12218c2ecf20Sopenharmony_ci# define ARRAY_1D_TILED_THIN1 2 12228c2ecf20Sopenharmony_ci# define ARRAY_2D_TILED_THIN1 4 12238c2ecf20Sopenharmony_ci# define ARRAY_PRT_TILED_THIN1 5 12248c2ecf20Sopenharmony_ci# define ARRAY_PRT_2D_TILED_THIN1 6 12258c2ecf20Sopenharmony_ci# define PIPE_CONFIG(x) ((x) << 6) 12268c2ecf20Sopenharmony_ci# define ADDR_SURF_P2 0 12278c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_8x16 4 12288c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_16x16 5 12298c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_16x32 6 12308c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_32x32 7 12318c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_16x16_8x16 8 12328c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_16x32_8x16 9 12338c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x32_8x16 10 12348c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_16x32_16x16 11 12358c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x32_16x16 12 12368c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x32_16x32 13 12378c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x64_32x32 14 12388c2ecf20Sopenharmony_ci# define ADDR_SURF_P16_32x32_8x16 16 12398c2ecf20Sopenharmony_ci# define ADDR_SURF_P16_32x32_16x16 17 12408c2ecf20Sopenharmony_ci# define TILE_SPLIT(x) ((x) << 11) 12418c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_64B 0 12428c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_128B 1 12438c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_256B 2 12448c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_512B 3 12458c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_1KB 4 12468c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_2KB 5 12478c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_4KB 6 12488c2ecf20Sopenharmony_ci# define MICRO_TILE_MODE_NEW(x) ((x) << 22) 12498c2ecf20Sopenharmony_ci# define ADDR_SURF_DISPLAY_MICRO_TILING 0 12508c2ecf20Sopenharmony_ci# define ADDR_SURF_THIN_MICRO_TILING 1 12518c2ecf20Sopenharmony_ci# define ADDR_SURF_DEPTH_MICRO_TILING 2 12528c2ecf20Sopenharmony_ci# define ADDR_SURF_ROTATED_MICRO_TILING 3 12538c2ecf20Sopenharmony_ci# define SAMPLE_SPLIT(x) ((x) << 25) 12548c2ecf20Sopenharmony_ci# define ADDR_SURF_SAMPLE_SPLIT_1 0 12558c2ecf20Sopenharmony_ci# define ADDR_SURF_SAMPLE_SPLIT_2 1 12568c2ecf20Sopenharmony_ci# define ADDR_SURF_SAMPLE_SPLIT_4 2 12578c2ecf20Sopenharmony_ci# define ADDR_SURF_SAMPLE_SPLIT_8 3 12588c2ecf20Sopenharmony_ci 12598c2ecf20Sopenharmony_ci#define GB_MACROTILE_MODE0 0x9990 12608c2ecf20Sopenharmony_ci# define BANK_WIDTH(x) ((x) << 0) 12618c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_1 0 12628c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_2 1 12638c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_4 2 12648c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_8 3 12658c2ecf20Sopenharmony_ci# define BANK_HEIGHT(x) ((x) << 2) 12668c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_1 0 12678c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_2 1 12688c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_4 2 12698c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_8 3 12708c2ecf20Sopenharmony_ci# define MACRO_TILE_ASPECT(x) ((x) << 4) 12718c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_1 0 12728c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_2 1 12738c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_4 2 12748c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_8 3 12758c2ecf20Sopenharmony_ci# define NUM_BANKS(x) ((x) << 6) 12768c2ecf20Sopenharmony_ci# define ADDR_SURF_2_BANK 0 12778c2ecf20Sopenharmony_ci# define ADDR_SURF_4_BANK 1 12788c2ecf20Sopenharmony_ci# define ADDR_SURF_8_BANK 2 12798c2ecf20Sopenharmony_ci# define ADDR_SURF_16_BANK 3 12808c2ecf20Sopenharmony_ci 12818c2ecf20Sopenharmony_ci#define CB_HW_CONTROL 0x9A10 12828c2ecf20Sopenharmony_ci 12838c2ecf20Sopenharmony_ci#define GC_USER_RB_BACKEND_DISABLE 0x9B7C 12848c2ecf20Sopenharmony_ci#define BACKEND_DISABLE_MASK 0x00FF0000 12858c2ecf20Sopenharmony_ci#define BACKEND_DISABLE_SHIFT 16 12868c2ecf20Sopenharmony_ci 12878c2ecf20Sopenharmony_ci#define TCP_CHAN_STEER_LO 0xac0c 12888c2ecf20Sopenharmony_ci#define TCP_CHAN_STEER_HI 0xac10 12898c2ecf20Sopenharmony_ci 12908c2ecf20Sopenharmony_ci#define TC_CFG_L1_LOAD_POLICY0 0xAC68 12918c2ecf20Sopenharmony_ci#define TC_CFG_L1_LOAD_POLICY1 0xAC6C 12928c2ecf20Sopenharmony_ci#define TC_CFG_L1_STORE_POLICY 0xAC70 12938c2ecf20Sopenharmony_ci#define TC_CFG_L2_LOAD_POLICY0 0xAC74 12948c2ecf20Sopenharmony_ci#define TC_CFG_L2_LOAD_POLICY1 0xAC78 12958c2ecf20Sopenharmony_ci#define TC_CFG_L2_STORE_POLICY0 0xAC7C 12968c2ecf20Sopenharmony_ci#define TC_CFG_L2_STORE_POLICY1 0xAC80 12978c2ecf20Sopenharmony_ci#define TC_CFG_L2_ATOMIC_POLICY 0xAC84 12988c2ecf20Sopenharmony_ci#define TC_CFG_L1_VOLATILE 0xAC88 12998c2ecf20Sopenharmony_ci#define TC_CFG_L2_VOLATILE 0xAC8C 13008c2ecf20Sopenharmony_ci 13018c2ecf20Sopenharmony_ci#define CP_RB0_BASE 0xC100 13028c2ecf20Sopenharmony_ci#define CP_RB0_CNTL 0xC104 13038c2ecf20Sopenharmony_ci#define RB_BUFSZ(x) ((x) << 0) 13048c2ecf20Sopenharmony_ci#define RB_BLKSZ(x) ((x) << 8) 13058c2ecf20Sopenharmony_ci#define BUF_SWAP_32BIT (2 << 16) 13068c2ecf20Sopenharmony_ci#define RB_NO_UPDATE (1 << 27) 13078c2ecf20Sopenharmony_ci#define RB_RPTR_WR_ENA (1 << 31) 13088c2ecf20Sopenharmony_ci 13098c2ecf20Sopenharmony_ci#define CP_RB0_RPTR_ADDR 0xC10C 13108c2ecf20Sopenharmony_ci#define RB_RPTR_SWAP_32BIT (2 << 0) 13118c2ecf20Sopenharmony_ci#define CP_RB0_RPTR_ADDR_HI 0xC110 13128c2ecf20Sopenharmony_ci#define CP_RB0_WPTR 0xC114 13138c2ecf20Sopenharmony_ci 13148c2ecf20Sopenharmony_ci#define CP_DEVICE_ID 0xC12C 13158c2ecf20Sopenharmony_ci#define CP_ENDIAN_SWAP 0xC140 13168c2ecf20Sopenharmony_ci#define CP_RB_VMID 0xC144 13178c2ecf20Sopenharmony_ci 13188c2ecf20Sopenharmony_ci#define CP_PFP_UCODE_ADDR 0xC150 13198c2ecf20Sopenharmony_ci#define CP_PFP_UCODE_DATA 0xC154 13208c2ecf20Sopenharmony_ci#define CP_ME_RAM_RADDR 0xC158 13218c2ecf20Sopenharmony_ci#define CP_ME_RAM_WADDR 0xC15C 13228c2ecf20Sopenharmony_ci#define CP_ME_RAM_DATA 0xC160 13238c2ecf20Sopenharmony_ci 13248c2ecf20Sopenharmony_ci#define CP_CE_UCODE_ADDR 0xC168 13258c2ecf20Sopenharmony_ci#define CP_CE_UCODE_DATA 0xC16C 13268c2ecf20Sopenharmony_ci#define CP_MEC_ME1_UCODE_ADDR 0xC170 13278c2ecf20Sopenharmony_ci#define CP_MEC_ME1_UCODE_DATA 0xC174 13288c2ecf20Sopenharmony_ci#define CP_MEC_ME2_UCODE_ADDR 0xC178 13298c2ecf20Sopenharmony_ci#define CP_MEC_ME2_UCODE_DATA 0xC17C 13308c2ecf20Sopenharmony_ci 13318c2ecf20Sopenharmony_ci#define CP_INT_CNTL_RING0 0xC1A8 13328c2ecf20Sopenharmony_ci# define CNTX_BUSY_INT_ENABLE (1 << 19) 13338c2ecf20Sopenharmony_ci# define CNTX_EMPTY_INT_ENABLE (1 << 20) 13348c2ecf20Sopenharmony_ci# define PRIV_INSTR_INT_ENABLE (1 << 22) 13358c2ecf20Sopenharmony_ci# define PRIV_REG_INT_ENABLE (1 << 23) 13368c2ecf20Sopenharmony_ci# define OPCODE_ERROR_INT_ENABLE (1 << 24) 13378c2ecf20Sopenharmony_ci# define TIME_STAMP_INT_ENABLE (1 << 26) 13388c2ecf20Sopenharmony_ci# define CP_RINGID2_INT_ENABLE (1 << 29) 13398c2ecf20Sopenharmony_ci# define CP_RINGID1_INT_ENABLE (1 << 30) 13408c2ecf20Sopenharmony_ci# define CP_RINGID0_INT_ENABLE (1 << 31) 13418c2ecf20Sopenharmony_ci 13428c2ecf20Sopenharmony_ci#define CP_INT_STATUS_RING0 0xC1B4 13438c2ecf20Sopenharmony_ci# define PRIV_INSTR_INT_STAT (1 << 22) 13448c2ecf20Sopenharmony_ci# define PRIV_REG_INT_STAT (1 << 23) 13458c2ecf20Sopenharmony_ci# define TIME_STAMP_INT_STAT (1 << 26) 13468c2ecf20Sopenharmony_ci# define CP_RINGID2_INT_STAT (1 << 29) 13478c2ecf20Sopenharmony_ci# define CP_RINGID1_INT_STAT (1 << 30) 13488c2ecf20Sopenharmony_ci# define CP_RINGID0_INT_STAT (1 << 31) 13498c2ecf20Sopenharmony_ci 13508c2ecf20Sopenharmony_ci#define CP_MEM_SLP_CNTL 0xC1E4 13518c2ecf20Sopenharmony_ci# define CP_MEM_LS_EN (1 << 0) 13528c2ecf20Sopenharmony_ci 13538c2ecf20Sopenharmony_ci#define CP_CPF_DEBUG 0xC200 13548c2ecf20Sopenharmony_ci 13558c2ecf20Sopenharmony_ci#define CP_PQ_WPTR_POLL_CNTL 0xC20C 13568c2ecf20Sopenharmony_ci#define WPTR_POLL_EN (1 << 31) 13578c2ecf20Sopenharmony_ci 13588c2ecf20Sopenharmony_ci#define CP_ME1_PIPE0_INT_CNTL 0xC214 13598c2ecf20Sopenharmony_ci#define CP_ME1_PIPE1_INT_CNTL 0xC218 13608c2ecf20Sopenharmony_ci#define CP_ME1_PIPE2_INT_CNTL 0xC21C 13618c2ecf20Sopenharmony_ci#define CP_ME1_PIPE3_INT_CNTL 0xC220 13628c2ecf20Sopenharmony_ci#define CP_ME2_PIPE0_INT_CNTL 0xC224 13638c2ecf20Sopenharmony_ci#define CP_ME2_PIPE1_INT_CNTL 0xC228 13648c2ecf20Sopenharmony_ci#define CP_ME2_PIPE2_INT_CNTL 0xC22C 13658c2ecf20Sopenharmony_ci#define CP_ME2_PIPE3_INT_CNTL 0xC230 13668c2ecf20Sopenharmony_ci# define DEQUEUE_REQUEST_INT_ENABLE (1 << 13) 13678c2ecf20Sopenharmony_ci# define WRM_POLL_TIMEOUT_INT_ENABLE (1 << 17) 13688c2ecf20Sopenharmony_ci# define PRIV_REG_INT_ENABLE (1 << 23) 13698c2ecf20Sopenharmony_ci# define TIME_STAMP_INT_ENABLE (1 << 26) 13708c2ecf20Sopenharmony_ci# define GENERIC2_INT_ENABLE (1 << 29) 13718c2ecf20Sopenharmony_ci# define GENERIC1_INT_ENABLE (1 << 30) 13728c2ecf20Sopenharmony_ci# define GENERIC0_INT_ENABLE (1 << 31) 13738c2ecf20Sopenharmony_ci#define CP_ME1_PIPE0_INT_STATUS 0xC214 13748c2ecf20Sopenharmony_ci#define CP_ME1_PIPE1_INT_STATUS 0xC218 13758c2ecf20Sopenharmony_ci#define CP_ME1_PIPE2_INT_STATUS 0xC21C 13768c2ecf20Sopenharmony_ci#define CP_ME1_PIPE3_INT_STATUS 0xC220 13778c2ecf20Sopenharmony_ci#define CP_ME2_PIPE0_INT_STATUS 0xC224 13788c2ecf20Sopenharmony_ci#define CP_ME2_PIPE1_INT_STATUS 0xC228 13798c2ecf20Sopenharmony_ci#define CP_ME2_PIPE2_INT_STATUS 0xC22C 13808c2ecf20Sopenharmony_ci#define CP_ME2_PIPE3_INT_STATUS 0xC230 13818c2ecf20Sopenharmony_ci# define DEQUEUE_REQUEST_INT_STATUS (1 << 13) 13828c2ecf20Sopenharmony_ci# define WRM_POLL_TIMEOUT_INT_STATUS (1 << 17) 13838c2ecf20Sopenharmony_ci# define PRIV_REG_INT_STATUS (1 << 23) 13848c2ecf20Sopenharmony_ci# define TIME_STAMP_INT_STATUS (1 << 26) 13858c2ecf20Sopenharmony_ci# define GENERIC2_INT_STATUS (1 << 29) 13868c2ecf20Sopenharmony_ci# define GENERIC1_INT_STATUS (1 << 30) 13878c2ecf20Sopenharmony_ci# define GENERIC0_INT_STATUS (1 << 31) 13888c2ecf20Sopenharmony_ci 13898c2ecf20Sopenharmony_ci#define CP_MAX_CONTEXT 0xC2B8 13908c2ecf20Sopenharmony_ci 13918c2ecf20Sopenharmony_ci#define CP_RB0_BASE_HI 0xC2C4 13928c2ecf20Sopenharmony_ci 13938c2ecf20Sopenharmony_ci#define RLC_CNTL 0xC300 13948c2ecf20Sopenharmony_ci# define RLC_ENABLE (1 << 0) 13958c2ecf20Sopenharmony_ci 13968c2ecf20Sopenharmony_ci#define RLC_MC_CNTL 0xC30C 13978c2ecf20Sopenharmony_ci 13988c2ecf20Sopenharmony_ci#define RLC_MEM_SLP_CNTL 0xC318 13998c2ecf20Sopenharmony_ci# define RLC_MEM_LS_EN (1 << 0) 14008c2ecf20Sopenharmony_ci 14018c2ecf20Sopenharmony_ci#define RLC_LB_CNTR_MAX 0xC348 14028c2ecf20Sopenharmony_ci 14038c2ecf20Sopenharmony_ci#define RLC_LB_CNTL 0xC364 14048c2ecf20Sopenharmony_ci# define LOAD_BALANCE_ENABLE (1 << 0) 14058c2ecf20Sopenharmony_ci 14068c2ecf20Sopenharmony_ci#define RLC_LB_CNTR_INIT 0xC36C 14078c2ecf20Sopenharmony_ci 14088c2ecf20Sopenharmony_ci#define RLC_SAVE_AND_RESTORE_BASE 0xC374 14098c2ecf20Sopenharmony_ci#define RLC_DRIVER_DMA_STATUS 0xC378 /* dGPU */ 14108c2ecf20Sopenharmony_ci#define RLC_CP_TABLE_RESTORE 0xC378 /* APU */ 14118c2ecf20Sopenharmony_ci#define RLC_PG_DELAY_2 0xC37C 14128c2ecf20Sopenharmony_ci 14138c2ecf20Sopenharmony_ci#define RLC_GPM_UCODE_ADDR 0xC388 14148c2ecf20Sopenharmony_ci#define RLC_GPM_UCODE_DATA 0xC38C 14158c2ecf20Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_LSB 0xC390 14168c2ecf20Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_MSB 0xC394 14178c2ecf20Sopenharmony_ci#define RLC_CAPTURE_GPU_CLOCK_COUNT 0xC398 14188c2ecf20Sopenharmony_ci#define RLC_UCODE_CNTL 0xC39C 14198c2ecf20Sopenharmony_ci 14208c2ecf20Sopenharmony_ci#define RLC_GPM_STAT 0xC400 14218c2ecf20Sopenharmony_ci# define RLC_GPM_BUSY (1 << 0) 14228c2ecf20Sopenharmony_ci# define GFX_POWER_STATUS (1 << 1) 14238c2ecf20Sopenharmony_ci# define GFX_CLOCK_STATUS (1 << 2) 14248c2ecf20Sopenharmony_ci 14258c2ecf20Sopenharmony_ci#define RLC_PG_CNTL 0xC40C 14268c2ecf20Sopenharmony_ci# define GFX_PG_ENABLE (1 << 0) 14278c2ecf20Sopenharmony_ci# define GFX_PG_SRC (1 << 1) 14288c2ecf20Sopenharmony_ci# define DYN_PER_CU_PG_ENABLE (1 << 2) 14298c2ecf20Sopenharmony_ci# define STATIC_PER_CU_PG_ENABLE (1 << 3) 14308c2ecf20Sopenharmony_ci# define DISABLE_GDS_PG (1 << 13) 14318c2ecf20Sopenharmony_ci# define DISABLE_CP_PG (1 << 15) 14328c2ecf20Sopenharmony_ci# define SMU_CLK_SLOWDOWN_ON_PU_ENABLE (1 << 17) 14338c2ecf20Sopenharmony_ci# define SMU_CLK_SLOWDOWN_ON_PD_ENABLE (1 << 18) 14348c2ecf20Sopenharmony_ci 14358c2ecf20Sopenharmony_ci#define RLC_CGTT_MGCG_OVERRIDE 0xC420 14368c2ecf20Sopenharmony_ci#define RLC_CGCG_CGLS_CTRL 0xC424 14378c2ecf20Sopenharmony_ci# define CGCG_EN (1 << 0) 14388c2ecf20Sopenharmony_ci# define CGLS_EN (1 << 1) 14398c2ecf20Sopenharmony_ci 14408c2ecf20Sopenharmony_ci#define RLC_PG_DELAY 0xC434 14418c2ecf20Sopenharmony_ci 14428c2ecf20Sopenharmony_ci#define RLC_LB_INIT_CU_MASK 0xC43C 14438c2ecf20Sopenharmony_ci 14448c2ecf20Sopenharmony_ci#define RLC_LB_PARAMS 0xC444 14458c2ecf20Sopenharmony_ci 14468c2ecf20Sopenharmony_ci#define RLC_PG_AO_CU_MASK 0xC44C 14478c2ecf20Sopenharmony_ci 14488c2ecf20Sopenharmony_ci#define RLC_MAX_PG_CU 0xC450 14498c2ecf20Sopenharmony_ci# define MAX_PU_CU(x) ((x) << 0) 14508c2ecf20Sopenharmony_ci# define MAX_PU_CU_MASK (0xff << 0) 14518c2ecf20Sopenharmony_ci#define RLC_AUTO_PG_CTRL 0xC454 14528c2ecf20Sopenharmony_ci# define AUTO_PG_EN (1 << 0) 14538c2ecf20Sopenharmony_ci# define GRBM_REG_SGIT(x) ((x) << 3) 14548c2ecf20Sopenharmony_ci# define GRBM_REG_SGIT_MASK (0xffff << 3) 14558c2ecf20Sopenharmony_ci 14568c2ecf20Sopenharmony_ci#define RLC_SERDES_WR_CU_MASTER_MASK 0xC474 14578c2ecf20Sopenharmony_ci#define RLC_SERDES_WR_NONCU_MASTER_MASK 0xC478 14588c2ecf20Sopenharmony_ci#define RLC_SERDES_WR_CTRL 0xC47C 14598c2ecf20Sopenharmony_ci#define BPM_ADDR(x) ((x) << 0) 14608c2ecf20Sopenharmony_ci#define BPM_ADDR_MASK (0xff << 0) 14618c2ecf20Sopenharmony_ci#define CGLS_ENABLE (1 << 16) 14628c2ecf20Sopenharmony_ci#define CGCG_OVERRIDE_0 (1 << 20) 14638c2ecf20Sopenharmony_ci#define MGCG_OVERRIDE_0 (1 << 22) 14648c2ecf20Sopenharmony_ci#define MGCG_OVERRIDE_1 (1 << 23) 14658c2ecf20Sopenharmony_ci 14668c2ecf20Sopenharmony_ci#define RLC_SERDES_CU_MASTER_BUSY 0xC484 14678c2ecf20Sopenharmony_ci#define RLC_SERDES_NONCU_MASTER_BUSY 0xC488 14688c2ecf20Sopenharmony_ci# define SE_MASTER_BUSY_MASK 0x0000ffff 14698c2ecf20Sopenharmony_ci# define GC_MASTER_BUSY (1 << 16) 14708c2ecf20Sopenharmony_ci# define TC0_MASTER_BUSY (1 << 17) 14718c2ecf20Sopenharmony_ci# define TC1_MASTER_BUSY (1 << 18) 14728c2ecf20Sopenharmony_ci 14738c2ecf20Sopenharmony_ci#define RLC_GPM_SCRATCH_ADDR 0xC4B0 14748c2ecf20Sopenharmony_ci#define RLC_GPM_SCRATCH_DATA 0xC4B4 14758c2ecf20Sopenharmony_ci 14768c2ecf20Sopenharmony_ci#define RLC_GPR_REG2 0xC4E8 14778c2ecf20Sopenharmony_ci#define REQ 0x00000001 14788c2ecf20Sopenharmony_ci#define MESSAGE(x) ((x) << 1) 14798c2ecf20Sopenharmony_ci#define MESSAGE_MASK 0x0000001e 14808c2ecf20Sopenharmony_ci#define MSG_ENTER_RLC_SAFE_MODE 1 14818c2ecf20Sopenharmony_ci#define MSG_EXIT_RLC_SAFE_MODE 0 14828c2ecf20Sopenharmony_ci 14838c2ecf20Sopenharmony_ci#define CP_HPD_EOP_BASE_ADDR 0xC904 14848c2ecf20Sopenharmony_ci#define CP_HPD_EOP_BASE_ADDR_HI 0xC908 14858c2ecf20Sopenharmony_ci#define CP_HPD_EOP_VMID 0xC90C 14868c2ecf20Sopenharmony_ci#define CP_HPD_EOP_CONTROL 0xC910 14878c2ecf20Sopenharmony_ci#define EOP_SIZE(x) ((x) << 0) 14888c2ecf20Sopenharmony_ci#define EOP_SIZE_MASK (0x3f << 0) 14898c2ecf20Sopenharmony_ci#define CP_MQD_BASE_ADDR 0xC914 14908c2ecf20Sopenharmony_ci#define CP_MQD_BASE_ADDR_HI 0xC918 14918c2ecf20Sopenharmony_ci#define CP_HQD_ACTIVE 0xC91C 14928c2ecf20Sopenharmony_ci#define CP_HQD_VMID 0xC920 14938c2ecf20Sopenharmony_ci 14948c2ecf20Sopenharmony_ci#define CP_HQD_PERSISTENT_STATE 0xC924u 14958c2ecf20Sopenharmony_ci#define DEFAULT_CP_HQD_PERSISTENT_STATE (0x33U << 8) 14968c2ecf20Sopenharmony_ci 14978c2ecf20Sopenharmony_ci#define CP_HQD_PIPE_PRIORITY 0xC928u 14988c2ecf20Sopenharmony_ci#define CP_HQD_QUEUE_PRIORITY 0xC92Cu 14998c2ecf20Sopenharmony_ci#define CP_HQD_QUANTUM 0xC930u 15008c2ecf20Sopenharmony_ci#define QUANTUM_EN 1U 15018c2ecf20Sopenharmony_ci#define QUANTUM_SCALE_1MS (1U << 4) 15028c2ecf20Sopenharmony_ci#define QUANTUM_DURATION(x) ((x) << 8) 15038c2ecf20Sopenharmony_ci 15048c2ecf20Sopenharmony_ci#define CP_HQD_PQ_BASE 0xC934 15058c2ecf20Sopenharmony_ci#define CP_HQD_PQ_BASE_HI 0xC938 15068c2ecf20Sopenharmony_ci#define CP_HQD_PQ_RPTR 0xC93C 15078c2ecf20Sopenharmony_ci#define CP_HQD_PQ_RPTR_REPORT_ADDR 0xC940 15088c2ecf20Sopenharmony_ci#define CP_HQD_PQ_RPTR_REPORT_ADDR_HI 0xC944 15098c2ecf20Sopenharmony_ci#define CP_HQD_PQ_WPTR_POLL_ADDR 0xC948 15108c2ecf20Sopenharmony_ci#define CP_HQD_PQ_WPTR_POLL_ADDR_HI 0xC94C 15118c2ecf20Sopenharmony_ci#define CP_HQD_PQ_DOORBELL_CONTROL 0xC950 15128c2ecf20Sopenharmony_ci#define DOORBELL_OFFSET(x) ((x) << 2) 15138c2ecf20Sopenharmony_ci#define DOORBELL_OFFSET_MASK (0x1fffff << 2) 15148c2ecf20Sopenharmony_ci#define DOORBELL_SOURCE (1 << 28) 15158c2ecf20Sopenharmony_ci#define DOORBELL_SCHD_HIT (1 << 29) 15168c2ecf20Sopenharmony_ci#define DOORBELL_EN (1 << 30) 15178c2ecf20Sopenharmony_ci#define DOORBELL_HIT (1 << 31) 15188c2ecf20Sopenharmony_ci#define CP_HQD_PQ_WPTR 0xC954 15198c2ecf20Sopenharmony_ci#define CP_HQD_PQ_CONTROL 0xC958 15208c2ecf20Sopenharmony_ci#define QUEUE_SIZE(x) ((x) << 0) 15218c2ecf20Sopenharmony_ci#define QUEUE_SIZE_MASK (0x3f << 0) 15228c2ecf20Sopenharmony_ci#define RPTR_BLOCK_SIZE(x) ((x) << 8) 15238c2ecf20Sopenharmony_ci#define RPTR_BLOCK_SIZE_MASK (0x3f << 8) 15248c2ecf20Sopenharmony_ci#define PQ_VOLATILE (1 << 26) 15258c2ecf20Sopenharmony_ci#define NO_UPDATE_RPTR (1 << 27) 15268c2ecf20Sopenharmony_ci#define UNORD_DISPATCH (1 << 28) 15278c2ecf20Sopenharmony_ci#define ROQ_PQ_IB_FLIP (1 << 29) 15288c2ecf20Sopenharmony_ci#define PRIV_STATE (1 << 30) 15298c2ecf20Sopenharmony_ci#define KMD_QUEUE (1 << 31) 15308c2ecf20Sopenharmony_ci 15318c2ecf20Sopenharmony_ci#define CP_HQD_IB_BASE_ADDR 0xC95Cu 15328c2ecf20Sopenharmony_ci#define CP_HQD_IB_BASE_ADDR_HI 0xC960u 15338c2ecf20Sopenharmony_ci#define CP_HQD_IB_RPTR 0xC964u 15348c2ecf20Sopenharmony_ci#define CP_HQD_IB_CONTROL 0xC968u 15358c2ecf20Sopenharmony_ci#define IB_ATC_EN (1U << 23) 15368c2ecf20Sopenharmony_ci#define DEFAULT_MIN_IB_AVAIL_SIZE (3U << 20) 15378c2ecf20Sopenharmony_ci 15388c2ecf20Sopenharmony_ci#define CP_HQD_DEQUEUE_REQUEST 0xC974 15398c2ecf20Sopenharmony_ci#define DEQUEUE_REQUEST_DRAIN 1 15408c2ecf20Sopenharmony_ci#define DEQUEUE_REQUEST_RESET 2 15418c2ecf20Sopenharmony_ci 15428c2ecf20Sopenharmony_ci#define CP_MQD_CONTROL 0xC99C 15438c2ecf20Sopenharmony_ci#define MQD_VMID(x) ((x) << 0) 15448c2ecf20Sopenharmony_ci#define MQD_VMID_MASK (0xf << 0) 15458c2ecf20Sopenharmony_ci 15468c2ecf20Sopenharmony_ci#define CP_HQD_SEMA_CMD 0xC97Cu 15478c2ecf20Sopenharmony_ci#define CP_HQD_MSG_TYPE 0xC980u 15488c2ecf20Sopenharmony_ci#define CP_HQD_ATOMIC0_PREOP_LO 0xC984u 15498c2ecf20Sopenharmony_ci#define CP_HQD_ATOMIC0_PREOP_HI 0xC988u 15508c2ecf20Sopenharmony_ci#define CP_HQD_ATOMIC1_PREOP_LO 0xC98Cu 15518c2ecf20Sopenharmony_ci#define CP_HQD_ATOMIC1_PREOP_HI 0xC990u 15528c2ecf20Sopenharmony_ci#define CP_HQD_HQ_SCHEDULER0 0xC994u 15538c2ecf20Sopenharmony_ci#define CP_HQD_HQ_SCHEDULER1 0xC998u 15548c2ecf20Sopenharmony_ci 15558c2ecf20Sopenharmony_ci#define SH_STATIC_MEM_CONFIG 0x9604u 15568c2ecf20Sopenharmony_ci 15578c2ecf20Sopenharmony_ci#define DB_RENDER_CONTROL 0x28000 15588c2ecf20Sopenharmony_ci 15598c2ecf20Sopenharmony_ci#define PA_SC_RASTER_CONFIG 0x28350 15608c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_0 0 15618c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_1 1 15628c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_2 2 15638c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_3 3 15648c2ecf20Sopenharmony_ci#define PKR_MAP(x) ((x) << 8) 15658c2ecf20Sopenharmony_ci 15668c2ecf20Sopenharmony_ci#define VGT_EVENT_INITIATOR 0x28a90 15678c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS1 (1 << 0) 15688c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS2 (2 << 0) 15698c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS3 (3 << 0) 15708c2ecf20Sopenharmony_ci# define CACHE_FLUSH_TS (4 << 0) 15718c2ecf20Sopenharmony_ci# define CACHE_FLUSH (6 << 0) 15728c2ecf20Sopenharmony_ci# define CS_PARTIAL_FLUSH (7 << 0) 15738c2ecf20Sopenharmony_ci# define VGT_STREAMOUT_RESET (10 << 0) 15748c2ecf20Sopenharmony_ci# define END_OF_PIPE_INCR_DE (11 << 0) 15758c2ecf20Sopenharmony_ci# define END_OF_PIPE_IB_END (12 << 0) 15768c2ecf20Sopenharmony_ci# define RST_PIX_CNT (13 << 0) 15778c2ecf20Sopenharmony_ci# define VS_PARTIAL_FLUSH (15 << 0) 15788c2ecf20Sopenharmony_ci# define PS_PARTIAL_FLUSH (16 << 0) 15798c2ecf20Sopenharmony_ci# define CACHE_FLUSH_AND_INV_TS_EVENT (20 << 0) 15808c2ecf20Sopenharmony_ci# define ZPASS_DONE (21 << 0) 15818c2ecf20Sopenharmony_ci# define CACHE_FLUSH_AND_INV_EVENT (22 << 0) 15828c2ecf20Sopenharmony_ci# define PERFCOUNTER_START (23 << 0) 15838c2ecf20Sopenharmony_ci# define PERFCOUNTER_STOP (24 << 0) 15848c2ecf20Sopenharmony_ci# define PIPELINESTAT_START (25 << 0) 15858c2ecf20Sopenharmony_ci# define PIPELINESTAT_STOP (26 << 0) 15868c2ecf20Sopenharmony_ci# define PERFCOUNTER_SAMPLE (27 << 0) 15878c2ecf20Sopenharmony_ci# define SAMPLE_PIPELINESTAT (30 << 0) 15888c2ecf20Sopenharmony_ci# define SO_VGT_STREAMOUT_FLUSH (31 << 0) 15898c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS (32 << 0) 15908c2ecf20Sopenharmony_ci# define RESET_VTX_CNT (33 << 0) 15918c2ecf20Sopenharmony_ci# define VGT_FLUSH (36 << 0) 15928c2ecf20Sopenharmony_ci# define BOTTOM_OF_PIPE_TS (40 << 0) 15938c2ecf20Sopenharmony_ci# define DB_CACHE_FLUSH_AND_INV (42 << 0) 15948c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_DB_DATA_TS (43 << 0) 15958c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_DB_META (44 << 0) 15968c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_CB_DATA_TS (45 << 0) 15978c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_CB_META (46 << 0) 15988c2ecf20Sopenharmony_ci# define CS_DONE (47 << 0) 15998c2ecf20Sopenharmony_ci# define PS_DONE (48 << 0) 16008c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_CB_PIXEL_DATA (49 << 0) 16018c2ecf20Sopenharmony_ci# define THREAD_TRACE_START (51 << 0) 16028c2ecf20Sopenharmony_ci# define THREAD_TRACE_STOP (52 << 0) 16038c2ecf20Sopenharmony_ci# define THREAD_TRACE_FLUSH (54 << 0) 16048c2ecf20Sopenharmony_ci# define THREAD_TRACE_FINISH (55 << 0) 16058c2ecf20Sopenharmony_ci# define PIXEL_PIPE_STAT_CONTROL (56 << 0) 16068c2ecf20Sopenharmony_ci# define PIXEL_PIPE_STAT_DUMP (57 << 0) 16078c2ecf20Sopenharmony_ci# define PIXEL_PIPE_STAT_RESET (58 << 0) 16088c2ecf20Sopenharmony_ci 16098c2ecf20Sopenharmony_ci#define SCRATCH_REG0 0x30100 16108c2ecf20Sopenharmony_ci#define SCRATCH_REG1 0x30104 16118c2ecf20Sopenharmony_ci#define SCRATCH_REG2 0x30108 16128c2ecf20Sopenharmony_ci#define SCRATCH_REG3 0x3010C 16138c2ecf20Sopenharmony_ci#define SCRATCH_REG4 0x30110 16148c2ecf20Sopenharmony_ci#define SCRATCH_REG5 0x30114 16158c2ecf20Sopenharmony_ci#define SCRATCH_REG6 0x30118 16168c2ecf20Sopenharmony_ci#define SCRATCH_REG7 0x3011C 16178c2ecf20Sopenharmony_ci 16188c2ecf20Sopenharmony_ci#define SCRATCH_UMSK 0x30140 16198c2ecf20Sopenharmony_ci#define SCRATCH_ADDR 0x30144 16208c2ecf20Sopenharmony_ci 16218c2ecf20Sopenharmony_ci#define CP_SEM_WAIT_TIMER 0x301BC 16228c2ecf20Sopenharmony_ci 16238c2ecf20Sopenharmony_ci#define CP_SEM_INCOMPLETE_TIMER_CNTL 0x301C8 16248c2ecf20Sopenharmony_ci 16258c2ecf20Sopenharmony_ci#define CP_WAIT_REG_MEM_TIMEOUT 0x301D0 16268c2ecf20Sopenharmony_ci 16278c2ecf20Sopenharmony_ci#define GRBM_GFX_INDEX 0x30800 16288c2ecf20Sopenharmony_ci#define INSTANCE_INDEX(x) ((x) << 0) 16298c2ecf20Sopenharmony_ci#define SH_INDEX(x) ((x) << 8) 16308c2ecf20Sopenharmony_ci#define SE_INDEX(x) ((x) << 16) 16318c2ecf20Sopenharmony_ci#define SH_BROADCAST_WRITES (1 << 29) 16328c2ecf20Sopenharmony_ci#define INSTANCE_BROADCAST_WRITES (1 << 30) 16338c2ecf20Sopenharmony_ci#define SE_BROADCAST_WRITES (1 << 31) 16348c2ecf20Sopenharmony_ci 16358c2ecf20Sopenharmony_ci#define VGT_ESGS_RING_SIZE 0x30900 16368c2ecf20Sopenharmony_ci#define VGT_GSVS_RING_SIZE 0x30904 16378c2ecf20Sopenharmony_ci#define VGT_PRIMITIVE_TYPE 0x30908 16388c2ecf20Sopenharmony_ci#define VGT_INDEX_TYPE 0x3090C 16398c2ecf20Sopenharmony_ci 16408c2ecf20Sopenharmony_ci#define VGT_NUM_INDICES 0x30930 16418c2ecf20Sopenharmony_ci#define VGT_NUM_INSTANCES 0x30934 16428c2ecf20Sopenharmony_ci#define VGT_TF_RING_SIZE 0x30938 16438c2ecf20Sopenharmony_ci#define VGT_HS_OFFCHIP_PARAM 0x3093C 16448c2ecf20Sopenharmony_ci#define VGT_TF_MEMORY_BASE 0x30940 16458c2ecf20Sopenharmony_ci 16468c2ecf20Sopenharmony_ci#define PA_SU_LINE_STIPPLE_VALUE 0x30a00 16478c2ecf20Sopenharmony_ci#define PA_SC_LINE_STIPPLE_STATE 0x30a04 16488c2ecf20Sopenharmony_ci 16498c2ecf20Sopenharmony_ci#define SQC_CACHES 0x30d20 16508c2ecf20Sopenharmony_ci 16518c2ecf20Sopenharmony_ci#define CP_PERFMON_CNTL 0x36020 16528c2ecf20Sopenharmony_ci 16538c2ecf20Sopenharmony_ci#define CGTS_SM_CTRL_REG 0x3c000 16548c2ecf20Sopenharmony_ci#define SM_MODE(x) ((x) << 17) 16558c2ecf20Sopenharmony_ci#define SM_MODE_MASK (0x7 << 17) 16568c2ecf20Sopenharmony_ci#define SM_MODE_ENABLE (1 << 20) 16578c2ecf20Sopenharmony_ci#define CGTS_OVERRIDE (1 << 21) 16588c2ecf20Sopenharmony_ci#define CGTS_LS_OVERRIDE (1 << 22) 16598c2ecf20Sopenharmony_ci#define ON_MONITOR_ADD_EN (1 << 23) 16608c2ecf20Sopenharmony_ci#define ON_MONITOR_ADD(x) ((x) << 24) 16618c2ecf20Sopenharmony_ci#define ON_MONITOR_ADD_MASK (0xff << 24) 16628c2ecf20Sopenharmony_ci 16638c2ecf20Sopenharmony_ci#define CGTS_TCC_DISABLE 0x3c00c 16648c2ecf20Sopenharmony_ci#define CGTS_USER_TCC_DISABLE 0x3c010 16658c2ecf20Sopenharmony_ci#define TCC_DISABLE_MASK 0xFFFF0000 16668c2ecf20Sopenharmony_ci#define TCC_DISABLE_SHIFT 16 16678c2ecf20Sopenharmony_ci 16688c2ecf20Sopenharmony_ci#define CB_CGTT_SCLK_CTRL 0x3c2a0 16698c2ecf20Sopenharmony_ci 16708c2ecf20Sopenharmony_ci/* 16718c2ecf20Sopenharmony_ci * PM4 16728c2ecf20Sopenharmony_ci */ 16738c2ecf20Sopenharmony_ci#define PACKET_TYPE0 0 16748c2ecf20Sopenharmony_ci#define PACKET_TYPE1 1 16758c2ecf20Sopenharmony_ci#define PACKET_TYPE2 2 16768c2ecf20Sopenharmony_ci#define PACKET_TYPE3 3 16778c2ecf20Sopenharmony_ci 16788c2ecf20Sopenharmony_ci#define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3) 16798c2ecf20Sopenharmony_ci#define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF) 16808c2ecf20Sopenharmony_ci#define CP_PACKET0_GET_REG(h) (((h) & 0xFFFF) << 2) 16818c2ecf20Sopenharmony_ci#define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF) 16828c2ecf20Sopenharmony_ci#define PACKET0(reg, n) ((PACKET_TYPE0 << 30) | \ 16838c2ecf20Sopenharmony_ci (((reg) >> 2) & 0xFFFF) | \ 16848c2ecf20Sopenharmony_ci ((n) & 0x3FFF) << 16) 16858c2ecf20Sopenharmony_ci#define CP_PACKET2 0x80000000 16868c2ecf20Sopenharmony_ci#define PACKET2_PAD_SHIFT 0 16878c2ecf20Sopenharmony_ci#define PACKET2_PAD_MASK (0x3fffffff << 0) 16888c2ecf20Sopenharmony_ci 16898c2ecf20Sopenharmony_ci#define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) 16908c2ecf20Sopenharmony_ci 16918c2ecf20Sopenharmony_ci#define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \ 16928c2ecf20Sopenharmony_ci (((op) & 0xFF) << 8) | \ 16938c2ecf20Sopenharmony_ci ((n) & 0x3FFF) << 16) 16948c2ecf20Sopenharmony_ci 16958c2ecf20Sopenharmony_ci#define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1) 16968c2ecf20Sopenharmony_ci 16978c2ecf20Sopenharmony_ci/* Packet 3 types */ 16988c2ecf20Sopenharmony_ci#define PACKET3_NOP 0x10 16998c2ecf20Sopenharmony_ci#define PACKET3_SET_BASE 0x11 17008c2ecf20Sopenharmony_ci#define PACKET3_BASE_INDEX(x) ((x) << 0) 17018c2ecf20Sopenharmony_ci#define CE_PARTITION_BASE 3 17028c2ecf20Sopenharmony_ci#define PACKET3_CLEAR_STATE 0x12 17038c2ecf20Sopenharmony_ci#define PACKET3_INDEX_BUFFER_SIZE 0x13 17048c2ecf20Sopenharmony_ci#define PACKET3_DISPATCH_DIRECT 0x15 17058c2ecf20Sopenharmony_ci#define PACKET3_DISPATCH_INDIRECT 0x16 17068c2ecf20Sopenharmony_ci#define PACKET3_ATOMIC_GDS 0x1D 17078c2ecf20Sopenharmony_ci#define PACKET3_ATOMIC_MEM 0x1E 17088c2ecf20Sopenharmony_ci#define PACKET3_OCCLUSION_QUERY 0x1F 17098c2ecf20Sopenharmony_ci#define PACKET3_SET_PREDICATION 0x20 17108c2ecf20Sopenharmony_ci#define PACKET3_REG_RMW 0x21 17118c2ecf20Sopenharmony_ci#define PACKET3_COND_EXEC 0x22 17128c2ecf20Sopenharmony_ci#define PACKET3_PRED_EXEC 0x23 17138c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDIRECT 0x24 17148c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_INDIRECT 0x25 17158c2ecf20Sopenharmony_ci#define PACKET3_INDEX_BASE 0x26 17168c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_2 0x27 17178c2ecf20Sopenharmony_ci#define PACKET3_CONTEXT_CONTROL 0x28 17188c2ecf20Sopenharmony_ci#define PACKET3_INDEX_TYPE 0x2A 17198c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDIRECT_MULTI 0x2C 17208c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_AUTO 0x2D 17218c2ecf20Sopenharmony_ci#define PACKET3_NUM_INSTANCES 0x2F 17228c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 17238c2ecf20Sopenharmony_ci#define PACKET3_INDIRECT_BUFFER_CONST 0x33 17248c2ecf20Sopenharmony_ci#define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 17258c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_OFFSET_2 0x35 17268c2ecf20Sopenharmony_ci#define PACKET3_DRAW_PREAMBLE 0x36 17278c2ecf20Sopenharmony_ci#define PACKET3_WRITE_DATA 0x37 17288c2ecf20Sopenharmony_ci#define WRITE_DATA_DST_SEL(x) ((x) << 8) 17298c2ecf20Sopenharmony_ci /* 0 - register 17308c2ecf20Sopenharmony_ci * 1 - memory (sync - via GRBM) 17318c2ecf20Sopenharmony_ci * 2 - gl2 17328c2ecf20Sopenharmony_ci * 3 - gds 17338c2ecf20Sopenharmony_ci * 4 - reserved 17348c2ecf20Sopenharmony_ci * 5 - memory (async - direct) 17358c2ecf20Sopenharmony_ci */ 17368c2ecf20Sopenharmony_ci#define WR_ONE_ADDR (1 << 16) 17378c2ecf20Sopenharmony_ci#define WR_CONFIRM (1 << 20) 17388c2ecf20Sopenharmony_ci#define WRITE_DATA_CACHE_POLICY(x) ((x) << 25) 17398c2ecf20Sopenharmony_ci /* 0 - LRU 17408c2ecf20Sopenharmony_ci * 1 - Stream 17418c2ecf20Sopenharmony_ci */ 17428c2ecf20Sopenharmony_ci#define WRITE_DATA_ENGINE_SEL(x) ((x) << 30) 17438c2ecf20Sopenharmony_ci /* 0 - me 17448c2ecf20Sopenharmony_ci * 1 - pfp 17458c2ecf20Sopenharmony_ci * 2 - ce 17468c2ecf20Sopenharmony_ci */ 17478c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_INDIRECT_MULTI 0x38 17488c2ecf20Sopenharmony_ci#define PACKET3_MEM_SEMAPHORE 0x39 17498c2ecf20Sopenharmony_ci# define PACKET3_SEM_USE_MAILBOX (0x1 << 16) 17508c2ecf20Sopenharmony_ci# define PACKET3_SEM_SEL_SIGNAL_TYPE (0x1 << 20) /* 0 = increment, 1 = write 1 */ 17518c2ecf20Sopenharmony_ci# define PACKET3_SEM_CLIENT_CODE ((x) << 24) /* 0 = CP, 1 = CB, 2 = DB */ 17528c2ecf20Sopenharmony_ci# define PACKET3_SEM_SEL_SIGNAL (0x6 << 29) 17538c2ecf20Sopenharmony_ci# define PACKET3_SEM_SEL_WAIT (0x7 << 29) 17548c2ecf20Sopenharmony_ci#define PACKET3_COPY_DW 0x3B 17558c2ecf20Sopenharmony_ci#define PACKET3_WAIT_REG_MEM 0x3C 17568c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) 17578c2ecf20Sopenharmony_ci /* 0 - always 17588c2ecf20Sopenharmony_ci * 1 - < 17598c2ecf20Sopenharmony_ci * 2 - <= 17608c2ecf20Sopenharmony_ci * 3 - == 17618c2ecf20Sopenharmony_ci * 4 - != 17628c2ecf20Sopenharmony_ci * 5 - >= 17638c2ecf20Sopenharmony_ci * 6 - > 17648c2ecf20Sopenharmony_ci */ 17658c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) 17668c2ecf20Sopenharmony_ci /* 0 - reg 17678c2ecf20Sopenharmony_ci * 1 - mem 17688c2ecf20Sopenharmony_ci */ 17698c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_OPERATION(x) ((x) << 6) 17708c2ecf20Sopenharmony_ci /* 0 - wait_reg_mem 17718c2ecf20Sopenharmony_ci * 1 - wr_wait_wr_reg 17728c2ecf20Sopenharmony_ci */ 17738c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_ENGINE(x) ((x) << 8) 17748c2ecf20Sopenharmony_ci /* 0 - me 17758c2ecf20Sopenharmony_ci * 1 - pfp 17768c2ecf20Sopenharmony_ci */ 17778c2ecf20Sopenharmony_ci#define PACKET3_INDIRECT_BUFFER 0x3F 17788c2ecf20Sopenharmony_ci#define INDIRECT_BUFFER_TCL2_VOLATILE (1 << 22) 17798c2ecf20Sopenharmony_ci#define INDIRECT_BUFFER_VALID (1 << 23) 17808c2ecf20Sopenharmony_ci#define INDIRECT_BUFFER_CACHE_POLICY(x) ((x) << 28) 17818c2ecf20Sopenharmony_ci /* 0 - LRU 17828c2ecf20Sopenharmony_ci * 1 - Stream 17838c2ecf20Sopenharmony_ci * 2 - Bypass 17848c2ecf20Sopenharmony_ci */ 17858c2ecf20Sopenharmony_ci#define PACKET3_COPY_DATA 0x40 17868c2ecf20Sopenharmony_ci#define PACKET3_PFP_SYNC_ME 0x42 17878c2ecf20Sopenharmony_ci#define PACKET3_SURFACE_SYNC 0x43 17888c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_0_ENA (1 << 0) 17898c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_1_ENA (1 << 1) 17908c2ecf20Sopenharmony_ci# define PACKET3_CB0_DEST_BASE_ENA (1 << 6) 17918c2ecf20Sopenharmony_ci# define PACKET3_CB1_DEST_BASE_ENA (1 << 7) 17928c2ecf20Sopenharmony_ci# define PACKET3_CB2_DEST_BASE_ENA (1 << 8) 17938c2ecf20Sopenharmony_ci# define PACKET3_CB3_DEST_BASE_ENA (1 << 9) 17948c2ecf20Sopenharmony_ci# define PACKET3_CB4_DEST_BASE_ENA (1 << 10) 17958c2ecf20Sopenharmony_ci# define PACKET3_CB5_DEST_BASE_ENA (1 << 11) 17968c2ecf20Sopenharmony_ci# define PACKET3_CB6_DEST_BASE_ENA (1 << 12) 17978c2ecf20Sopenharmony_ci# define PACKET3_CB7_DEST_BASE_ENA (1 << 13) 17988c2ecf20Sopenharmony_ci# define PACKET3_DB_DEST_BASE_ENA (1 << 14) 17998c2ecf20Sopenharmony_ci# define PACKET3_TCL1_VOL_ACTION_ENA (1 << 15) 18008c2ecf20Sopenharmony_ci# define PACKET3_TC_VOL_ACTION_ENA (1 << 16) /* L2 */ 18018c2ecf20Sopenharmony_ci# define PACKET3_TC_WB_ACTION_ENA (1 << 18) /* L2 */ 18028c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_2_ENA (1 << 19) 18038c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_3_ENA (1 << 21) 18048c2ecf20Sopenharmony_ci# define PACKET3_TCL1_ACTION_ENA (1 << 22) 18058c2ecf20Sopenharmony_ci# define PACKET3_TC_ACTION_ENA (1 << 23) /* L2 */ 18068c2ecf20Sopenharmony_ci# define PACKET3_CB_ACTION_ENA (1 << 25) 18078c2ecf20Sopenharmony_ci# define PACKET3_DB_ACTION_ENA (1 << 26) 18088c2ecf20Sopenharmony_ci# define PACKET3_SH_KCACHE_ACTION_ENA (1 << 27) 18098c2ecf20Sopenharmony_ci# define PACKET3_SH_KCACHE_VOL_ACTION_ENA (1 << 28) 18108c2ecf20Sopenharmony_ci# define PACKET3_SH_ICACHE_ACTION_ENA (1 << 29) 18118c2ecf20Sopenharmony_ci#define PACKET3_COND_WRITE 0x45 18128c2ecf20Sopenharmony_ci#define PACKET3_EVENT_WRITE 0x46 18138c2ecf20Sopenharmony_ci#define EVENT_TYPE(x) ((x) << 0) 18148c2ecf20Sopenharmony_ci#define EVENT_INDEX(x) ((x) << 8) 18158c2ecf20Sopenharmony_ci /* 0 - any non-TS event 18168c2ecf20Sopenharmony_ci * 1 - ZPASS_DONE, PIXEL_PIPE_STAT_* 18178c2ecf20Sopenharmony_ci * 2 - SAMPLE_PIPELINESTAT 18188c2ecf20Sopenharmony_ci * 3 - SAMPLE_STREAMOUTSTAT* 18198c2ecf20Sopenharmony_ci * 4 - *S_PARTIAL_FLUSH 18208c2ecf20Sopenharmony_ci * 5 - EOP events 18218c2ecf20Sopenharmony_ci * 6 - EOS events 18228c2ecf20Sopenharmony_ci */ 18238c2ecf20Sopenharmony_ci#define PACKET3_EVENT_WRITE_EOP 0x47 18248c2ecf20Sopenharmony_ci#define EOP_TCL1_VOL_ACTION_EN (1 << 12) 18258c2ecf20Sopenharmony_ci#define EOP_TC_VOL_ACTION_EN (1 << 13) /* L2 */ 18268c2ecf20Sopenharmony_ci#define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */ 18278c2ecf20Sopenharmony_ci#define EOP_TCL1_ACTION_EN (1 << 16) 18288c2ecf20Sopenharmony_ci#define EOP_TC_ACTION_EN (1 << 17) /* L2 */ 18298c2ecf20Sopenharmony_ci#define EOP_TCL2_VOLATILE (1 << 24) 18308c2ecf20Sopenharmony_ci#define EOP_CACHE_POLICY(x) ((x) << 25) 18318c2ecf20Sopenharmony_ci /* 0 - LRU 18328c2ecf20Sopenharmony_ci * 1 - Stream 18338c2ecf20Sopenharmony_ci * 2 - Bypass 18348c2ecf20Sopenharmony_ci */ 18358c2ecf20Sopenharmony_ci#define DATA_SEL(x) ((x) << 29) 18368c2ecf20Sopenharmony_ci /* 0 - discard 18378c2ecf20Sopenharmony_ci * 1 - send low 32bit data 18388c2ecf20Sopenharmony_ci * 2 - send 64bit data 18398c2ecf20Sopenharmony_ci * 3 - send 64bit GPU counter value 18408c2ecf20Sopenharmony_ci * 4 - send 64bit sys counter value 18418c2ecf20Sopenharmony_ci */ 18428c2ecf20Sopenharmony_ci#define INT_SEL(x) ((x) << 24) 18438c2ecf20Sopenharmony_ci /* 0 - none 18448c2ecf20Sopenharmony_ci * 1 - interrupt only (DATA_SEL = 0) 18458c2ecf20Sopenharmony_ci * 2 - interrupt when data write is confirmed 18468c2ecf20Sopenharmony_ci */ 18478c2ecf20Sopenharmony_ci#define DST_SEL(x) ((x) << 16) 18488c2ecf20Sopenharmony_ci /* 0 - MC 18498c2ecf20Sopenharmony_ci * 1 - TC/L2 18508c2ecf20Sopenharmony_ci */ 18518c2ecf20Sopenharmony_ci#define PACKET3_EVENT_WRITE_EOS 0x48 18528c2ecf20Sopenharmony_ci#define PACKET3_RELEASE_MEM 0x49 18538c2ecf20Sopenharmony_ci#define PACKET3_PREAMBLE_CNTL 0x4A 18548c2ecf20Sopenharmony_ci# define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) 18558c2ecf20Sopenharmony_ci# define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) 18568c2ecf20Sopenharmony_ci#define PACKET3_DMA_DATA 0x50 18578c2ecf20Sopenharmony_ci/* 1. header 18588c2ecf20Sopenharmony_ci * 2. CONTROL 18598c2ecf20Sopenharmony_ci * 3. SRC_ADDR_LO or DATA [31:0] 18608c2ecf20Sopenharmony_ci * 4. SRC_ADDR_HI [31:0] 18618c2ecf20Sopenharmony_ci * 5. DST_ADDR_LO [31:0] 18628c2ecf20Sopenharmony_ci * 6. DST_ADDR_HI [7:0] 18638c2ecf20Sopenharmony_ci * 7. COMMAND [30:21] | BYTE_COUNT [20:0] 18648c2ecf20Sopenharmony_ci */ 18658c2ecf20Sopenharmony_ci/* CONTROL */ 18668c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_ENGINE(x) ((x) << 0) 18678c2ecf20Sopenharmony_ci /* 0 - ME 18688c2ecf20Sopenharmony_ci * 1 - PFP 18698c2ecf20Sopenharmony_ci */ 18708c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_SRC_CACHE_POLICY(x) ((x) << 13) 18718c2ecf20Sopenharmony_ci /* 0 - LRU 18728c2ecf20Sopenharmony_ci * 1 - Stream 18738c2ecf20Sopenharmony_ci * 2 - Bypass 18748c2ecf20Sopenharmony_ci */ 18758c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_SRC_VOLATILE (1 << 15) 18768c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_DST_SEL(x) ((x) << 20) 18778c2ecf20Sopenharmony_ci /* 0 - DST_ADDR using DAS 18788c2ecf20Sopenharmony_ci * 1 - GDS 18798c2ecf20Sopenharmony_ci * 3 - DST_ADDR using L2 18808c2ecf20Sopenharmony_ci */ 18818c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_DST_CACHE_POLICY(x) ((x) << 25) 18828c2ecf20Sopenharmony_ci /* 0 - LRU 18838c2ecf20Sopenharmony_ci * 1 - Stream 18848c2ecf20Sopenharmony_ci * 2 - Bypass 18858c2ecf20Sopenharmony_ci */ 18868c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_DST_VOLATILE (1 << 27) 18878c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_SRC_SEL(x) ((x) << 29) 18888c2ecf20Sopenharmony_ci /* 0 - SRC_ADDR using SAS 18898c2ecf20Sopenharmony_ci * 1 - GDS 18908c2ecf20Sopenharmony_ci * 2 - DATA 18918c2ecf20Sopenharmony_ci * 3 - SRC_ADDR using L2 18928c2ecf20Sopenharmony_ci */ 18938c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CP_SYNC (1 << 31) 18948c2ecf20Sopenharmony_ci/* COMMAND */ 18958c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_DIS_WC (1 << 21) 18968c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_SRC_SWAP(x) ((x) << 22) 18978c2ecf20Sopenharmony_ci /* 0 - none 18988c2ecf20Sopenharmony_ci * 1 - 8 in 16 18998c2ecf20Sopenharmony_ci * 2 - 8 in 32 19008c2ecf20Sopenharmony_ci * 3 - 8 in 64 19018c2ecf20Sopenharmony_ci */ 19028c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_DST_SWAP(x) ((x) << 24) 19038c2ecf20Sopenharmony_ci /* 0 - none 19048c2ecf20Sopenharmony_ci * 1 - 8 in 16 19058c2ecf20Sopenharmony_ci * 2 - 8 in 32 19068c2ecf20Sopenharmony_ci * 3 - 8 in 64 19078c2ecf20Sopenharmony_ci */ 19088c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_SAS (1 << 26) 19098c2ecf20Sopenharmony_ci /* 0 - memory 19108c2ecf20Sopenharmony_ci * 1 - register 19118c2ecf20Sopenharmony_ci */ 19128c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_DAS (1 << 27) 19138c2ecf20Sopenharmony_ci /* 0 - memory 19148c2ecf20Sopenharmony_ci * 1 - register 19158c2ecf20Sopenharmony_ci */ 19168c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_SAIC (1 << 28) 19178c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_DAIC (1 << 29) 19188c2ecf20Sopenharmony_ci# define PACKET3_DMA_DATA_CMD_RAW_WAIT (1 << 30) 19198c2ecf20Sopenharmony_ci#define PACKET3_AQUIRE_MEM 0x58 19208c2ecf20Sopenharmony_ci#define PACKET3_REWIND 0x59 19218c2ecf20Sopenharmony_ci#define PACKET3_LOAD_UCONFIG_REG 0x5E 19228c2ecf20Sopenharmony_ci#define PACKET3_LOAD_SH_REG 0x5F 19238c2ecf20Sopenharmony_ci#define PACKET3_LOAD_CONFIG_REG 0x60 19248c2ecf20Sopenharmony_ci#define PACKET3_LOAD_CONTEXT_REG 0x61 19258c2ecf20Sopenharmony_ci#define PACKET3_SET_CONFIG_REG 0x68 19268c2ecf20Sopenharmony_ci#define PACKET3_SET_CONFIG_REG_START 0x00008000 19278c2ecf20Sopenharmony_ci#define PACKET3_SET_CONFIG_REG_END 0x0000b000 19288c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG 0x69 19298c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_START 0x00028000 19308c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_END 0x00029000 19318c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 19328c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG 0x76 19338c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG_START 0x0000b000 19348c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG_END 0x0000c000 19358c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG_OFFSET 0x77 19368c2ecf20Sopenharmony_ci#define PACKET3_SET_QUEUE_REG 0x78 19378c2ecf20Sopenharmony_ci#define PACKET3_SET_UCONFIG_REG 0x79 19388c2ecf20Sopenharmony_ci#define PACKET3_SET_UCONFIG_REG_START 0x00030000 19398c2ecf20Sopenharmony_ci#define PACKET3_SET_UCONFIG_REG_END 0x00031000 19408c2ecf20Sopenharmony_ci#define PACKET3_SCRATCH_RAM_WRITE 0x7D 19418c2ecf20Sopenharmony_ci#define PACKET3_SCRATCH_RAM_READ 0x7E 19428c2ecf20Sopenharmony_ci#define PACKET3_LOAD_CONST_RAM 0x80 19438c2ecf20Sopenharmony_ci#define PACKET3_WRITE_CONST_RAM 0x81 19448c2ecf20Sopenharmony_ci#define PACKET3_DUMP_CONST_RAM 0x83 19458c2ecf20Sopenharmony_ci#define PACKET3_INCREMENT_CE_COUNTER 0x84 19468c2ecf20Sopenharmony_ci#define PACKET3_INCREMENT_DE_COUNTER 0x85 19478c2ecf20Sopenharmony_ci#define PACKET3_WAIT_ON_CE_COUNTER 0x86 19488c2ecf20Sopenharmony_ci#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 19498c2ecf20Sopenharmony_ci#define PACKET3_SWITCH_BUFFER 0x8B 19508c2ecf20Sopenharmony_ci 19518c2ecf20Sopenharmony_ci/* SDMA - first instance at 0xd000, second at 0xd800 */ 19528c2ecf20Sopenharmony_ci#define SDMA0_REGISTER_OFFSET 0x0 /* not a register */ 19538c2ecf20Sopenharmony_ci#define SDMA1_REGISTER_OFFSET 0x800 /* not a register */ 19548c2ecf20Sopenharmony_ci 19558c2ecf20Sopenharmony_ci#define SDMA0_UCODE_ADDR 0xD000 19568c2ecf20Sopenharmony_ci#define SDMA0_UCODE_DATA 0xD004 19578c2ecf20Sopenharmony_ci#define SDMA0_POWER_CNTL 0xD008 19588c2ecf20Sopenharmony_ci#define SDMA0_CLK_CTRL 0xD00C 19598c2ecf20Sopenharmony_ci 19608c2ecf20Sopenharmony_ci#define SDMA0_CNTL 0xD010 19618c2ecf20Sopenharmony_ci# define TRAP_ENABLE (1 << 0) 19628c2ecf20Sopenharmony_ci# define SEM_INCOMPLETE_INT_ENABLE (1 << 1) 19638c2ecf20Sopenharmony_ci# define SEM_WAIT_INT_ENABLE (1 << 2) 19648c2ecf20Sopenharmony_ci# define DATA_SWAP_ENABLE (1 << 3) 19658c2ecf20Sopenharmony_ci# define FENCE_SWAP_ENABLE (1 << 4) 19668c2ecf20Sopenharmony_ci# define AUTO_CTXSW_ENABLE (1 << 18) 19678c2ecf20Sopenharmony_ci# define CTXEMPTY_INT_ENABLE (1 << 28) 19688c2ecf20Sopenharmony_ci 19698c2ecf20Sopenharmony_ci#define SDMA0_TILING_CONFIG 0xD018 19708c2ecf20Sopenharmony_ci 19718c2ecf20Sopenharmony_ci#define SDMA0_SEM_INCOMPLETE_TIMER_CNTL 0xD020 19728c2ecf20Sopenharmony_ci#define SDMA0_SEM_WAIT_FAIL_TIMER_CNTL 0xD024 19738c2ecf20Sopenharmony_ci 19748c2ecf20Sopenharmony_ci#define SDMA0_STATUS_REG 0xd034 19758c2ecf20Sopenharmony_ci# define SDMA_IDLE (1 << 0) 19768c2ecf20Sopenharmony_ci 19778c2ecf20Sopenharmony_ci#define SDMA0_ME_CNTL 0xD048 19788c2ecf20Sopenharmony_ci# define SDMA_HALT (1 << 0) 19798c2ecf20Sopenharmony_ci 19808c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_CNTL 0xD200 19818c2ecf20Sopenharmony_ci# define SDMA_RB_ENABLE (1 << 0) 19828c2ecf20Sopenharmony_ci# define SDMA_RB_SIZE(x) ((x) << 1) /* log2 */ 19838c2ecf20Sopenharmony_ci# define SDMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */ 19848c2ecf20Sopenharmony_ci# define SDMA_RPTR_WRITEBACK_ENABLE (1 << 12) 19858c2ecf20Sopenharmony_ci# define SDMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */ 19868c2ecf20Sopenharmony_ci# define SDMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */ 19878c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_BASE 0xD204 19888c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_BASE_HI 0xD208 19898c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_RPTR 0xD20C 19908c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_WPTR 0xD210 19918c2ecf20Sopenharmony_ci 19928c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_RPTR_ADDR_HI 0xD220 19938c2ecf20Sopenharmony_ci#define SDMA0_GFX_RB_RPTR_ADDR_LO 0xD224 19948c2ecf20Sopenharmony_ci#define SDMA0_GFX_IB_CNTL 0xD228 19958c2ecf20Sopenharmony_ci# define SDMA_IB_ENABLE (1 << 0) 19968c2ecf20Sopenharmony_ci# define SDMA_IB_SWAP_ENABLE (1 << 4) 19978c2ecf20Sopenharmony_ci# define SDMA_SWITCH_INSIDE_IB (1 << 8) 19988c2ecf20Sopenharmony_ci# define SDMA_CMD_VMID(x) ((x) << 16) 19998c2ecf20Sopenharmony_ci 20008c2ecf20Sopenharmony_ci#define SDMA0_GFX_VIRTUAL_ADDR 0xD29C 20018c2ecf20Sopenharmony_ci#define SDMA0_GFX_APE1_CNTL 0xD2A0 20028c2ecf20Sopenharmony_ci 20038c2ecf20Sopenharmony_ci#define SDMA_PACKET(op, sub_op, e) ((((e) & 0xFFFF) << 16) | \ 20048c2ecf20Sopenharmony_ci (((sub_op) & 0xFF) << 8) | \ 20058c2ecf20Sopenharmony_ci (((op) & 0xFF) << 0)) 20068c2ecf20Sopenharmony_ci/* sDMA opcodes */ 20078c2ecf20Sopenharmony_ci#define SDMA_OPCODE_NOP 0 20088c2ecf20Sopenharmony_ci#define SDMA_OPCODE_COPY 1 20098c2ecf20Sopenharmony_ci# define SDMA_COPY_SUB_OPCODE_LINEAR 0 20108c2ecf20Sopenharmony_ci# define SDMA_COPY_SUB_OPCODE_TILED 1 20118c2ecf20Sopenharmony_ci# define SDMA_COPY_SUB_OPCODE_SOA 3 20128c2ecf20Sopenharmony_ci# define SDMA_COPY_SUB_OPCODE_LINEAR_SUB_WINDOW 4 20138c2ecf20Sopenharmony_ci# define SDMA_COPY_SUB_OPCODE_TILED_SUB_WINDOW 5 20148c2ecf20Sopenharmony_ci# define SDMA_COPY_SUB_OPCODE_T2T_SUB_WINDOW 6 20158c2ecf20Sopenharmony_ci#define SDMA_OPCODE_WRITE 2 20168c2ecf20Sopenharmony_ci# define SDMA_WRITE_SUB_OPCODE_LINEAR 0 20178c2ecf20Sopenharmony_ci# define SDMA_WRITE_SUB_OPCODE_TILED 1 20188c2ecf20Sopenharmony_ci#define SDMA_OPCODE_INDIRECT_BUFFER 4 20198c2ecf20Sopenharmony_ci#define SDMA_OPCODE_FENCE 5 20208c2ecf20Sopenharmony_ci#define SDMA_OPCODE_TRAP 6 20218c2ecf20Sopenharmony_ci#define SDMA_OPCODE_SEMAPHORE 7 20228c2ecf20Sopenharmony_ci# define SDMA_SEMAPHORE_EXTRA_O (1 << 13) 20238c2ecf20Sopenharmony_ci /* 0 - increment 20248c2ecf20Sopenharmony_ci * 1 - write 1 20258c2ecf20Sopenharmony_ci */ 20268c2ecf20Sopenharmony_ci# define SDMA_SEMAPHORE_EXTRA_S (1 << 14) 20278c2ecf20Sopenharmony_ci /* 0 - wait 20288c2ecf20Sopenharmony_ci * 1 - signal 20298c2ecf20Sopenharmony_ci */ 20308c2ecf20Sopenharmony_ci# define SDMA_SEMAPHORE_EXTRA_M (1 << 15) 20318c2ecf20Sopenharmony_ci /* mailbox */ 20328c2ecf20Sopenharmony_ci#define SDMA_OPCODE_POLL_REG_MEM 8 20338c2ecf20Sopenharmony_ci# define SDMA_POLL_REG_MEM_EXTRA_OP(x) ((x) << 10) 20348c2ecf20Sopenharmony_ci /* 0 - wait_reg_mem 20358c2ecf20Sopenharmony_ci * 1 - wr_wait_wr_reg 20368c2ecf20Sopenharmony_ci */ 20378c2ecf20Sopenharmony_ci# define SDMA_POLL_REG_MEM_EXTRA_FUNC(x) ((x) << 12) 20388c2ecf20Sopenharmony_ci /* 0 - always 20398c2ecf20Sopenharmony_ci * 1 - < 20408c2ecf20Sopenharmony_ci * 2 - <= 20418c2ecf20Sopenharmony_ci * 3 - == 20428c2ecf20Sopenharmony_ci * 4 - != 20438c2ecf20Sopenharmony_ci * 5 - >= 20448c2ecf20Sopenharmony_ci * 6 - > 20458c2ecf20Sopenharmony_ci */ 20468c2ecf20Sopenharmony_ci# define SDMA_POLL_REG_MEM_EXTRA_M (1 << 15) 20478c2ecf20Sopenharmony_ci /* 0 = register 20488c2ecf20Sopenharmony_ci * 1 = memory 20498c2ecf20Sopenharmony_ci */ 20508c2ecf20Sopenharmony_ci#define SDMA_OPCODE_COND_EXEC 9 20518c2ecf20Sopenharmony_ci#define SDMA_OPCODE_CONSTANT_FILL 11 20528c2ecf20Sopenharmony_ci# define SDMA_CONSTANT_FILL_EXTRA_SIZE(x) ((x) << 14) 20538c2ecf20Sopenharmony_ci /* 0 = byte fill 20548c2ecf20Sopenharmony_ci * 2 = DW fill 20558c2ecf20Sopenharmony_ci */ 20568c2ecf20Sopenharmony_ci#define SDMA_OPCODE_GENERATE_PTE_PDE 12 20578c2ecf20Sopenharmony_ci#define SDMA_OPCODE_TIMESTAMP 13 20588c2ecf20Sopenharmony_ci# define SDMA_TIMESTAMP_SUB_OPCODE_SET_LOCAL 0 20598c2ecf20Sopenharmony_ci# define SDMA_TIMESTAMP_SUB_OPCODE_GET_LOCAL 1 20608c2ecf20Sopenharmony_ci# define SDMA_TIMESTAMP_SUB_OPCODE_GET_GLOBAL 2 20618c2ecf20Sopenharmony_ci#define SDMA_OPCODE_SRBM_WRITE 14 20628c2ecf20Sopenharmony_ci# define SDMA_SRBM_WRITE_EXTRA_BYTE_ENABLE(x) ((x) << 12) 20638c2ecf20Sopenharmony_ci /* byte mask */ 20648c2ecf20Sopenharmony_ci 20658c2ecf20Sopenharmony_ci/* UVD */ 20668c2ecf20Sopenharmony_ci 20678c2ecf20Sopenharmony_ci#define UVD_UDEC_ADDR_CONFIG 0xef4c 20688c2ecf20Sopenharmony_ci#define UVD_UDEC_DB_ADDR_CONFIG 0xef50 20698c2ecf20Sopenharmony_ci#define UVD_UDEC_DBW_ADDR_CONFIG 0xef54 20708c2ecf20Sopenharmony_ci#define UVD_NO_OP 0xeffc 20718c2ecf20Sopenharmony_ci 20728c2ecf20Sopenharmony_ci#define UVD_LMI_EXT40_ADDR 0xf498 20738c2ecf20Sopenharmony_ci#define UVD_GP_SCRATCH4 0xf4e0 20748c2ecf20Sopenharmony_ci#define UVD_LMI_ADDR_EXT 0xf594 20758c2ecf20Sopenharmony_ci#define UVD_VCPU_CACHE_OFFSET0 0xf608 20768c2ecf20Sopenharmony_ci#define UVD_VCPU_CACHE_SIZE0 0xf60c 20778c2ecf20Sopenharmony_ci#define UVD_VCPU_CACHE_OFFSET1 0xf610 20788c2ecf20Sopenharmony_ci#define UVD_VCPU_CACHE_SIZE1 0xf614 20798c2ecf20Sopenharmony_ci#define UVD_VCPU_CACHE_OFFSET2 0xf618 20808c2ecf20Sopenharmony_ci#define UVD_VCPU_CACHE_SIZE2 0xf61c 20818c2ecf20Sopenharmony_ci 20828c2ecf20Sopenharmony_ci#define UVD_RBC_RB_RPTR 0xf690 20838c2ecf20Sopenharmony_ci#define UVD_RBC_RB_WPTR 0xf694 20848c2ecf20Sopenharmony_ci 20858c2ecf20Sopenharmony_ci#define UVD_CGC_CTRL 0xF4B0 20868c2ecf20Sopenharmony_ci# define DCM (1 << 0) 20878c2ecf20Sopenharmony_ci# define CG_DT(x) ((x) << 2) 20888c2ecf20Sopenharmony_ci# define CG_DT_MASK (0xf << 2) 20898c2ecf20Sopenharmony_ci# define CLK_OD(x) ((x) << 6) 20908c2ecf20Sopenharmony_ci# define CLK_OD_MASK (0x1f << 6) 20918c2ecf20Sopenharmony_ci 20928c2ecf20Sopenharmony_ci#define UVD_STATUS 0xf6bc 20938c2ecf20Sopenharmony_ci 20948c2ecf20Sopenharmony_ci/* UVD clocks */ 20958c2ecf20Sopenharmony_ci 20968c2ecf20Sopenharmony_ci#define CG_DCLK_CNTL 0xC050009C 20978c2ecf20Sopenharmony_ci# define DCLK_DIVIDER_MASK 0x7f 20988c2ecf20Sopenharmony_ci# define DCLK_DIR_CNTL_EN (1 << 8) 20998c2ecf20Sopenharmony_ci#define CG_DCLK_STATUS 0xC05000A0 21008c2ecf20Sopenharmony_ci# define DCLK_STATUS (1 << 0) 21018c2ecf20Sopenharmony_ci#define CG_VCLK_CNTL 0xC05000A4 21028c2ecf20Sopenharmony_ci#define CG_VCLK_STATUS 0xC05000A8 21038c2ecf20Sopenharmony_ci 21048c2ecf20Sopenharmony_ci/* UVD CTX indirect */ 21058c2ecf20Sopenharmony_ci#define UVD_CGC_MEM_CTRL 0xC0 21068c2ecf20Sopenharmony_ci 21078c2ecf20Sopenharmony_ci/* VCE */ 21088c2ecf20Sopenharmony_ci 21098c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET0 0x20024 21108c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE0 0x20028 21118c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET1 0x2002c 21128c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE1 0x20030 21138c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET2 0x20034 21148c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE2 0x20038 21158c2ecf20Sopenharmony_ci#define VCE_RB_RPTR2 0x20178 21168c2ecf20Sopenharmony_ci#define VCE_RB_WPTR2 0x2017c 21178c2ecf20Sopenharmony_ci#define VCE_RB_RPTR 0x2018c 21188c2ecf20Sopenharmony_ci#define VCE_RB_WPTR 0x20190 21198c2ecf20Sopenharmony_ci#define VCE_CLOCK_GATING_A 0x202f8 21208c2ecf20Sopenharmony_ci# define CGC_CLK_GATE_DLY_TIMER_MASK (0xf << 0) 21218c2ecf20Sopenharmony_ci# define CGC_CLK_GATE_DLY_TIMER(x) ((x) << 0) 21228c2ecf20Sopenharmony_ci# define CGC_CLK_GATER_OFF_DLY_TIMER_MASK (0xff << 4) 21238c2ecf20Sopenharmony_ci# define CGC_CLK_GATER_OFF_DLY_TIMER(x) ((x) << 4) 21248c2ecf20Sopenharmony_ci# define CGC_UENC_WAIT_AWAKE (1 << 18) 21258c2ecf20Sopenharmony_ci#define VCE_CLOCK_GATING_B 0x202fc 21268c2ecf20Sopenharmony_ci#define VCE_CGTT_CLK_OVERRIDE 0x207a0 21278c2ecf20Sopenharmony_ci#define VCE_UENC_CLOCK_GATING 0x207bc 21288c2ecf20Sopenharmony_ci# define CLOCK_ON_DELAY_MASK (0xf << 0) 21298c2ecf20Sopenharmony_ci# define CLOCK_ON_DELAY(x) ((x) << 0) 21308c2ecf20Sopenharmony_ci# define CLOCK_OFF_DELAY_MASK (0xff << 4) 21318c2ecf20Sopenharmony_ci# define CLOCK_OFF_DELAY(x) ((x) << 4) 21328c2ecf20Sopenharmony_ci#define VCE_UENC_REG_CLOCK_GATING 0x207c0 21338c2ecf20Sopenharmony_ci#define VCE_SYS_INT_EN 0x21300 21348c2ecf20Sopenharmony_ci# define VCE_SYS_INT_TRAP_INTERRUPT_EN (1 << 3) 21358c2ecf20Sopenharmony_ci#define VCE_LMI_VCPU_CACHE_40BIT_BAR 0x2145c 21368c2ecf20Sopenharmony_ci#define VCE_LMI_CTRL2 0x21474 21378c2ecf20Sopenharmony_ci#define VCE_LMI_CTRL 0x21498 21388c2ecf20Sopenharmony_ci#define VCE_LMI_VM_CTRL 0x214a0 21398c2ecf20Sopenharmony_ci#define VCE_LMI_SWAP_CNTL 0x214b4 21408c2ecf20Sopenharmony_ci#define VCE_LMI_SWAP_CNTL1 0x214b8 21418c2ecf20Sopenharmony_ci#define VCE_LMI_CACHE_CTRL 0x214f4 21428c2ecf20Sopenharmony_ci 21438c2ecf20Sopenharmony_ci#define VCE_CMD_NO_OP 0x00000000 21448c2ecf20Sopenharmony_ci#define VCE_CMD_END 0x00000001 21458c2ecf20Sopenharmony_ci#define VCE_CMD_IB 0x00000002 21468c2ecf20Sopenharmony_ci#define VCE_CMD_FENCE 0x00000003 21478c2ecf20Sopenharmony_ci#define VCE_CMD_TRAP 0x00000004 21488c2ecf20Sopenharmony_ci#define VCE_CMD_IB_AUTO 0x00000005 21498c2ecf20Sopenharmony_ci#define VCE_CMD_SEMAPHORE 0x00000006 21508c2ecf20Sopenharmony_ci 21518c2ecf20Sopenharmony_ci#define ATC_VMID_PASID_MAPPING_UPDATE_STATUS 0x3398u 21528c2ecf20Sopenharmony_ci#define ATC_VMID0_PASID_MAPPING 0x339Cu 21538c2ecf20Sopenharmony_ci#define ATC_VMID_PASID_MAPPING_PASID_MASK (0xFFFF) 21548c2ecf20Sopenharmony_ci#define ATC_VMID_PASID_MAPPING_PASID_SHIFT 0 21558c2ecf20Sopenharmony_ci#define ATC_VMID_PASID_MAPPING_VALID_MASK (0x1 << 31) 21568c2ecf20Sopenharmony_ci#define ATC_VMID_PASID_MAPPING_VALID_SHIFT 31 21578c2ecf20Sopenharmony_ci 21588c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE0_CNTL 0x3310u 21598c2ecf20Sopenharmony_ci#define ATS_ACCESS_MODE_NEVER 0 21608c2ecf20Sopenharmony_ci#define ATS_ACCESS_MODE_ALWAYS 1 21618c2ecf20Sopenharmony_ci 21628c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE0_CNTL2 0x3318u 21638c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE0_HIGH_ADDR 0x3308u 21648c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE0_LOW_ADDR 0x3300u 21658c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE1_CNTL 0x3314u 21668c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE1_CNTL2 0x331Cu 21678c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE1_HIGH_ADDR 0x330Cu 21688c2ecf20Sopenharmony_ci#define ATC_VM_APERTURE1_LOW_ADDR 0x3304u 21698c2ecf20Sopenharmony_ci 21708c2ecf20Sopenharmony_ci#define IH_VMID_0_LUT 0x3D40u 21718c2ecf20Sopenharmony_ci 21728c2ecf20Sopenharmony_ci#endif 2173