18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright 2011 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 SI_H 258c2ecf20Sopenharmony_ci#define SI_H 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define TAHITI_RB_BITMAP_WIDTH_PER_SH 2 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define TAHITI_GB_ADDR_CONFIG_GOLDEN 0x12011003 308c2ecf20Sopenharmony_ci#define VERDE_GB_ADDR_CONFIG_GOLDEN 0x12010002 318c2ecf20Sopenharmony_ci#define HAINAN_GB_ADDR_CONFIG_GOLDEN 0x02010001 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define SI_MAX_SH_GPRS 256 348c2ecf20Sopenharmony_ci#define SI_MAX_TEMP_GPRS 16 358c2ecf20Sopenharmony_ci#define SI_MAX_SH_THREADS 256 368c2ecf20Sopenharmony_ci#define SI_MAX_SH_STACK_ENTRIES 4096 378c2ecf20Sopenharmony_ci#define SI_MAX_FRC_EOV_CNT 16384 388c2ecf20Sopenharmony_ci#define SI_MAX_BACKENDS 8 398c2ecf20Sopenharmony_ci#define SI_MAX_BACKENDS_MASK 0xFF 408c2ecf20Sopenharmony_ci#define SI_MAX_BACKENDS_PER_SE_MASK 0x0F 418c2ecf20Sopenharmony_ci#define SI_MAX_SIMDS 12 428c2ecf20Sopenharmony_ci#define SI_MAX_SIMDS_MASK 0x0FFF 438c2ecf20Sopenharmony_ci#define SI_MAX_SIMDS_PER_SE_MASK 0x00FF 448c2ecf20Sopenharmony_ci#define SI_MAX_PIPES 8 458c2ecf20Sopenharmony_ci#define SI_MAX_PIPES_MASK 0xFF 468c2ecf20Sopenharmony_ci#define SI_MAX_PIPES_PER_SIMD_MASK 0x3F 478c2ecf20Sopenharmony_ci#define SI_MAX_LDS_NUM 0xFFFF 488c2ecf20Sopenharmony_ci#define SI_MAX_TCC 16 498c2ecf20Sopenharmony_ci#define SI_MAX_TCC_MASK 0xFFFF 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci/* SMC IND accessor regs */ 528c2ecf20Sopenharmony_ci#define SMC_IND_INDEX_0 0x200 538c2ecf20Sopenharmony_ci#define SMC_IND_DATA_0 0x204 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci#define SMC_IND_ACCESS_CNTL 0x228 568c2ecf20Sopenharmony_ci# define AUTO_INCREMENT_IND_0 (1 << 0) 578c2ecf20Sopenharmony_ci#define SMC_MESSAGE_0 0x22c 588c2ecf20Sopenharmony_ci#define SMC_RESP_0 0x230 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci/* CG IND registers are accessed via SMC indirect space + SMC_CG_IND_START */ 618c2ecf20Sopenharmony_ci#define SMC_CG_IND_START 0xc0030000 628c2ecf20Sopenharmony_ci#define SMC_CG_IND_END 0xc0040000 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci#define CG_CGTT_LOCAL_0 0x400 658c2ecf20Sopenharmony_ci#define CG_CGTT_LOCAL_1 0x401 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci/* SMC IND registers */ 688c2ecf20Sopenharmony_ci#define SMC_SYSCON_RESET_CNTL 0x80000000 698c2ecf20Sopenharmony_ci# define RST_REG (1 << 0) 708c2ecf20Sopenharmony_ci#define SMC_SYSCON_CLOCK_CNTL_0 0x80000004 718c2ecf20Sopenharmony_ci# define CK_DISABLE (1 << 0) 728c2ecf20Sopenharmony_ci# define CKEN (1 << 24) 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#define VGA_HDP_CONTROL 0x328 758c2ecf20Sopenharmony_ci#define VGA_MEMORY_DISABLE (1 << 4) 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#define DCCG_DISP_SLOW_SELECT_REG 0x4fc 788c2ecf20Sopenharmony_ci#define DCCG_DISP1_SLOW_SELECT(x) ((x) << 0) 798c2ecf20Sopenharmony_ci#define DCCG_DISP1_SLOW_SELECT_MASK (7 << 0) 808c2ecf20Sopenharmony_ci#define DCCG_DISP1_SLOW_SELECT_SHIFT 0 818c2ecf20Sopenharmony_ci#define DCCG_DISP2_SLOW_SELECT(x) ((x) << 4) 828c2ecf20Sopenharmony_ci#define DCCG_DISP2_SLOW_SELECT_MASK (7 << 4) 838c2ecf20Sopenharmony_ci#define DCCG_DISP2_SLOW_SELECT_SHIFT 4 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL 0x600 868c2ecf20Sopenharmony_ci#define SPLL_RESET (1 << 0) 878c2ecf20Sopenharmony_ci#define SPLL_SLEEP (1 << 1) 888c2ecf20Sopenharmony_ci#define SPLL_BYPASS_EN (1 << 3) 898c2ecf20Sopenharmony_ci#define SPLL_REF_DIV(x) ((x) << 4) 908c2ecf20Sopenharmony_ci#define SPLL_REF_DIV_MASK (0x3f << 4) 918c2ecf20Sopenharmony_ci#define SPLL_PDIV_A(x) ((x) << 20) 928c2ecf20Sopenharmony_ci#define SPLL_PDIV_A_MASK (0x7f << 20) 938c2ecf20Sopenharmony_ci#define SPLL_PDIV_A_SHIFT 20 948c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_2 0x604 958c2ecf20Sopenharmony_ci#define SCLK_MUX_SEL(x) ((x) << 0) 968c2ecf20Sopenharmony_ci#define SCLK_MUX_SEL_MASK (0x1ff << 0) 978c2ecf20Sopenharmony_ci#define SPLL_CTLREQ_CHG (1 << 23) 988c2ecf20Sopenharmony_ci#define SCLK_MUX_UPDATE (1 << 26) 998c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_3 0x608 1008c2ecf20Sopenharmony_ci#define SPLL_FB_DIV(x) ((x) << 0) 1018c2ecf20Sopenharmony_ci#define SPLL_FB_DIV_MASK (0x3ffffff << 0) 1028c2ecf20Sopenharmony_ci#define SPLL_FB_DIV_SHIFT 0 1038c2ecf20Sopenharmony_ci#define SPLL_DITHEN (1 << 28) 1048c2ecf20Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_4 0x60c 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci#define SPLL_STATUS 0x614 1078c2ecf20Sopenharmony_ci#define SPLL_CHG_STATUS (1 << 1) 1088c2ecf20Sopenharmony_ci#define SPLL_CNTL_MODE 0x618 1098c2ecf20Sopenharmony_ci#define SPLL_SW_DIR_CONTROL (1 << 0) 1108c2ecf20Sopenharmony_ci# define SPLL_REFCLK_SEL(x) ((x) << 26) 1118c2ecf20Sopenharmony_ci# define SPLL_REFCLK_SEL_MASK (3 << 26) 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM 0x620 1148c2ecf20Sopenharmony_ci#define SSEN (1 << 0) 1158c2ecf20Sopenharmony_ci#define CLK_S(x) ((x) << 4) 1168c2ecf20Sopenharmony_ci#define CLK_S_MASK (0xfff << 4) 1178c2ecf20Sopenharmony_ci#define CLK_S_SHIFT 4 1188c2ecf20Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM_2 0x624 1198c2ecf20Sopenharmony_ci#define CLK_V(x) ((x) << 0) 1208c2ecf20Sopenharmony_ci#define CLK_V_MASK (0x3ffffff << 0) 1218c2ecf20Sopenharmony_ci#define CLK_V_SHIFT 0 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci#define CG_SPLL_AUTOSCALE_CNTL 0x62c 1248c2ecf20Sopenharmony_ci# define AUTOSCALE_ON_SS_CLEAR (1 << 9) 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci/* discrete uvd clocks */ 1278c2ecf20Sopenharmony_ci#define CG_UPLL_FUNC_CNTL 0x634 1288c2ecf20Sopenharmony_ci# define UPLL_RESET_MASK 0x00000001 1298c2ecf20Sopenharmony_ci# define UPLL_SLEEP_MASK 0x00000002 1308c2ecf20Sopenharmony_ci# define UPLL_BYPASS_EN_MASK 0x00000004 1318c2ecf20Sopenharmony_ci# define UPLL_CTLREQ_MASK 0x00000008 1328c2ecf20Sopenharmony_ci# define UPLL_VCO_MODE_MASK 0x00000600 1338c2ecf20Sopenharmony_ci# define UPLL_REF_DIV_MASK 0x003F0000 1348c2ecf20Sopenharmony_ci# define UPLL_CTLACK_MASK 0x40000000 1358c2ecf20Sopenharmony_ci# define UPLL_CTLACK2_MASK 0x80000000 1368c2ecf20Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_2 0x638 1378c2ecf20Sopenharmony_ci# define UPLL_PDIV_A(x) ((x) << 0) 1388c2ecf20Sopenharmony_ci# define UPLL_PDIV_A_MASK 0x0000007F 1398c2ecf20Sopenharmony_ci# define UPLL_PDIV_B(x) ((x) << 8) 1408c2ecf20Sopenharmony_ci# define UPLL_PDIV_B_MASK 0x00007F00 1418c2ecf20Sopenharmony_ci# define VCLK_SRC_SEL(x) ((x) << 20) 1428c2ecf20Sopenharmony_ci# define VCLK_SRC_SEL_MASK 0x01F00000 1438c2ecf20Sopenharmony_ci# define DCLK_SRC_SEL(x) ((x) << 25) 1448c2ecf20Sopenharmony_ci# define DCLK_SRC_SEL_MASK 0x3E000000 1458c2ecf20Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_3 0x63C 1468c2ecf20Sopenharmony_ci# define UPLL_FB_DIV(x) ((x) << 0) 1478c2ecf20Sopenharmony_ci# define UPLL_FB_DIV_MASK 0x01FFFFFF 1488c2ecf20Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_4 0x644 1498c2ecf20Sopenharmony_ci# define UPLL_SPARE_ISPARE9 0x00020000 1508c2ecf20Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_5 0x648 1518c2ecf20Sopenharmony_ci# define RESET_ANTI_MUX_MASK 0x00000200 1528c2ecf20Sopenharmony_ci#define CG_UPLL_SPREAD_SPECTRUM 0x650 1538c2ecf20Sopenharmony_ci# define SSEN_MASK 0x00000001 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci#define MPLL_BYPASSCLK_SEL 0x65c 1568c2ecf20Sopenharmony_ci# define MPLL_CLKOUT_SEL(x) ((x) << 8) 1578c2ecf20Sopenharmony_ci# define MPLL_CLKOUT_SEL_MASK 0xFF00 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ci#define CG_CLKPIN_CNTL 0x660 1608c2ecf20Sopenharmony_ci# define XTALIN_DIVIDE (1 << 1) 1618c2ecf20Sopenharmony_ci# define BCLK_AS_XCLK (1 << 2) 1628c2ecf20Sopenharmony_ci#define CG_CLKPIN_CNTL_2 0x664 1638c2ecf20Sopenharmony_ci# define FORCE_BIF_REFCLK_EN (1 << 3) 1648c2ecf20Sopenharmony_ci# define MUX_TCLK_TO_XCLK (1 << 8) 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci#define THM_CLK_CNTL 0x66c 1678c2ecf20Sopenharmony_ci# define CMON_CLK_SEL(x) ((x) << 0) 1688c2ecf20Sopenharmony_ci# define CMON_CLK_SEL_MASK 0xFF 1698c2ecf20Sopenharmony_ci# define TMON_CLK_SEL(x) ((x) << 8) 1708c2ecf20Sopenharmony_ci# define TMON_CLK_SEL_MASK 0xFF00 1718c2ecf20Sopenharmony_ci#define MISC_CLK_CNTL 0x670 1728c2ecf20Sopenharmony_ci# define DEEP_SLEEP_CLK_SEL(x) ((x) << 0) 1738c2ecf20Sopenharmony_ci# define DEEP_SLEEP_CLK_SEL_MASK 0xFF 1748c2ecf20Sopenharmony_ci# define ZCLK_SEL(x) ((x) << 8) 1758c2ecf20Sopenharmony_ci# define ZCLK_SEL_MASK 0xFF00 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci#define CG_THERMAL_CTRL 0x700 1788c2ecf20Sopenharmony_ci#define DPM_EVENT_SRC(x) ((x) << 0) 1798c2ecf20Sopenharmony_ci#define DPM_EVENT_SRC_MASK (7 << 0) 1808c2ecf20Sopenharmony_ci#define DIG_THERM_DPM(x) ((x) << 14) 1818c2ecf20Sopenharmony_ci#define DIG_THERM_DPM_MASK 0x003FC000 1828c2ecf20Sopenharmony_ci#define DIG_THERM_DPM_SHIFT 14 1838c2ecf20Sopenharmony_ci#define CG_THERMAL_STATUS 0x704 1848c2ecf20Sopenharmony_ci#define FDO_PWM_DUTY(x) ((x) << 9) 1858c2ecf20Sopenharmony_ci#define FDO_PWM_DUTY_MASK (0xff << 9) 1868c2ecf20Sopenharmony_ci#define FDO_PWM_DUTY_SHIFT 9 1878c2ecf20Sopenharmony_ci#define CG_THERMAL_INT 0x708 1888c2ecf20Sopenharmony_ci#define DIG_THERM_INTH(x) ((x) << 8) 1898c2ecf20Sopenharmony_ci#define DIG_THERM_INTH_MASK 0x0000FF00 1908c2ecf20Sopenharmony_ci#define DIG_THERM_INTH_SHIFT 8 1918c2ecf20Sopenharmony_ci#define DIG_THERM_INTL(x) ((x) << 16) 1928c2ecf20Sopenharmony_ci#define DIG_THERM_INTL_MASK 0x00FF0000 1938c2ecf20Sopenharmony_ci#define DIG_THERM_INTL_SHIFT 16 1948c2ecf20Sopenharmony_ci#define THERM_INT_MASK_HIGH (1 << 24) 1958c2ecf20Sopenharmony_ci#define THERM_INT_MASK_LOW (1 << 25) 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_ci#define CG_MULT_THERMAL_CTRL 0x710 1988c2ecf20Sopenharmony_ci#define TEMP_SEL(x) ((x) << 20) 1998c2ecf20Sopenharmony_ci#define TEMP_SEL_MASK (0xff << 20) 2008c2ecf20Sopenharmony_ci#define TEMP_SEL_SHIFT 20 2018c2ecf20Sopenharmony_ci#define CG_MULT_THERMAL_STATUS 0x714 2028c2ecf20Sopenharmony_ci#define ASIC_MAX_TEMP(x) ((x) << 0) 2038c2ecf20Sopenharmony_ci#define ASIC_MAX_TEMP_MASK 0x000001ff 2048c2ecf20Sopenharmony_ci#define ASIC_MAX_TEMP_SHIFT 0 2058c2ecf20Sopenharmony_ci#define CTF_TEMP(x) ((x) << 9) 2068c2ecf20Sopenharmony_ci#define CTF_TEMP_MASK 0x0003fe00 2078c2ecf20Sopenharmony_ci#define CTF_TEMP_SHIFT 9 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_ci#define CG_FDO_CTRL0 0x754 2108c2ecf20Sopenharmony_ci#define FDO_STATIC_DUTY(x) ((x) << 0) 2118c2ecf20Sopenharmony_ci#define FDO_STATIC_DUTY_MASK 0x000000FF 2128c2ecf20Sopenharmony_ci#define FDO_STATIC_DUTY_SHIFT 0 2138c2ecf20Sopenharmony_ci#define CG_FDO_CTRL1 0x758 2148c2ecf20Sopenharmony_ci#define FMAX_DUTY100(x) ((x) << 0) 2158c2ecf20Sopenharmony_ci#define FMAX_DUTY100_MASK 0x000000FF 2168c2ecf20Sopenharmony_ci#define FMAX_DUTY100_SHIFT 0 2178c2ecf20Sopenharmony_ci#define CG_FDO_CTRL2 0x75C 2188c2ecf20Sopenharmony_ci#define TMIN(x) ((x) << 0) 2198c2ecf20Sopenharmony_ci#define TMIN_MASK 0x000000FF 2208c2ecf20Sopenharmony_ci#define TMIN_SHIFT 0 2218c2ecf20Sopenharmony_ci#define FDO_PWM_MODE(x) ((x) << 11) 2228c2ecf20Sopenharmony_ci#define FDO_PWM_MODE_MASK (7 << 11) 2238c2ecf20Sopenharmony_ci#define FDO_PWM_MODE_SHIFT 11 2248c2ecf20Sopenharmony_ci#define TACH_PWM_RESP_RATE(x) ((x) << 25) 2258c2ecf20Sopenharmony_ci#define TACH_PWM_RESP_RATE_MASK (0x7f << 25) 2268c2ecf20Sopenharmony_ci#define TACH_PWM_RESP_RATE_SHIFT 25 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_ci#define CG_TACH_CTRL 0x770 2298c2ecf20Sopenharmony_ci# define EDGE_PER_REV(x) ((x) << 0) 2308c2ecf20Sopenharmony_ci# define EDGE_PER_REV_MASK (0x7 << 0) 2318c2ecf20Sopenharmony_ci# define EDGE_PER_REV_SHIFT 0 2328c2ecf20Sopenharmony_ci# define TARGET_PERIOD(x) ((x) << 3) 2338c2ecf20Sopenharmony_ci# define TARGET_PERIOD_MASK 0xfffffff8 2348c2ecf20Sopenharmony_ci# define TARGET_PERIOD_SHIFT 3 2358c2ecf20Sopenharmony_ci#define CG_TACH_STATUS 0x774 2368c2ecf20Sopenharmony_ci# define TACH_PERIOD(x) ((x) << 0) 2378c2ecf20Sopenharmony_ci# define TACH_PERIOD_MASK 0xffffffff 2388c2ecf20Sopenharmony_ci# define TACH_PERIOD_SHIFT 0 2398c2ecf20Sopenharmony_ci 2408c2ecf20Sopenharmony_ci#define GENERAL_PWRMGT 0x780 2418c2ecf20Sopenharmony_ci# define GLOBAL_PWRMGT_EN (1 << 0) 2428c2ecf20Sopenharmony_ci# define STATIC_PM_EN (1 << 1) 2438c2ecf20Sopenharmony_ci# define THERMAL_PROTECTION_DIS (1 << 2) 2448c2ecf20Sopenharmony_ci# define THERMAL_PROTECTION_TYPE (1 << 3) 2458c2ecf20Sopenharmony_ci# define SW_SMIO_INDEX(x) ((x) << 6) 2468c2ecf20Sopenharmony_ci# define SW_SMIO_INDEX_MASK (1 << 6) 2478c2ecf20Sopenharmony_ci# define SW_SMIO_INDEX_SHIFT 6 2488c2ecf20Sopenharmony_ci# define VOLT_PWRMGT_EN (1 << 10) 2498c2ecf20Sopenharmony_ci# define DYN_SPREAD_SPECTRUM_EN (1 << 23) 2508c2ecf20Sopenharmony_ci#define CG_TPC 0x784 2518c2ecf20Sopenharmony_ci#define SCLK_PWRMGT_CNTL 0x788 2528c2ecf20Sopenharmony_ci# define SCLK_PWRMGT_OFF (1 << 0) 2538c2ecf20Sopenharmony_ci# define SCLK_LOW_D1 (1 << 1) 2548c2ecf20Sopenharmony_ci# define FIR_RESET (1 << 4) 2558c2ecf20Sopenharmony_ci# define FIR_FORCE_TREND_SEL (1 << 5) 2568c2ecf20Sopenharmony_ci# define FIR_TREND_MODE (1 << 6) 2578c2ecf20Sopenharmony_ci# define DYN_GFX_CLK_OFF_EN (1 << 7) 2588c2ecf20Sopenharmony_ci# define GFX_CLK_FORCE_ON (1 << 8) 2598c2ecf20Sopenharmony_ci# define GFX_CLK_REQUEST_OFF (1 << 9) 2608c2ecf20Sopenharmony_ci# define GFX_CLK_FORCE_OFF (1 << 10) 2618c2ecf20Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D1 (1 << 11) 2628c2ecf20Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D2 (1 << 12) 2638c2ecf20Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D3 (1 << 13) 2648c2ecf20Sopenharmony_ci# define DYN_LIGHT_SLEEP_EN (1 << 14) 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX 0x798 2678c2ecf20Sopenharmony_ci# define CURRENT_STATE_INDEX_MASK (0xf << 4) 2688c2ecf20Sopenharmony_ci# define CURRENT_STATE_INDEX_SHIFT 4 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci#define CG_FTV 0x7bc 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci#define CG_FFCT_0 0x7c0 2738c2ecf20Sopenharmony_ci# define UTC_0(x) ((x) << 0) 2748c2ecf20Sopenharmony_ci# define UTC_0_MASK (0x3ff << 0) 2758c2ecf20Sopenharmony_ci# define DTC_0(x) ((x) << 10) 2768c2ecf20Sopenharmony_ci# define DTC_0_MASK (0x3ff << 10) 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_ci#define CG_BSP 0x7fc 2798c2ecf20Sopenharmony_ci# define BSP(x) ((x) << 0) 2808c2ecf20Sopenharmony_ci# define BSP_MASK (0xffff << 0) 2818c2ecf20Sopenharmony_ci# define BSU(x) ((x) << 16) 2828c2ecf20Sopenharmony_ci# define BSU_MASK (0xf << 16) 2838c2ecf20Sopenharmony_ci#define CG_AT 0x800 2848c2ecf20Sopenharmony_ci# define CG_R(x) ((x) << 0) 2858c2ecf20Sopenharmony_ci# define CG_R_MASK (0xffff << 0) 2868c2ecf20Sopenharmony_ci# define CG_L(x) ((x) << 16) 2878c2ecf20Sopenharmony_ci# define CG_L_MASK (0xffff << 16) 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci#define CG_GIT 0x804 2908c2ecf20Sopenharmony_ci# define CG_GICST(x) ((x) << 0) 2918c2ecf20Sopenharmony_ci# define CG_GICST_MASK (0xffff << 0) 2928c2ecf20Sopenharmony_ci# define CG_GIPOT(x) ((x) << 16) 2938c2ecf20Sopenharmony_ci# define CG_GIPOT_MASK (0xffff << 16) 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci#define CG_SSP 0x80c 2968c2ecf20Sopenharmony_ci# define SST(x) ((x) << 0) 2978c2ecf20Sopenharmony_ci# define SST_MASK (0xffff << 0) 2988c2ecf20Sopenharmony_ci# define SSTU(x) ((x) << 16) 2998c2ecf20Sopenharmony_ci# define SSTU_MASK (0xf << 16) 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_ci#define CG_DISPLAY_GAP_CNTL 0x828 3028c2ecf20Sopenharmony_ci# define DISP1_GAP(x) ((x) << 0) 3038c2ecf20Sopenharmony_ci# define DISP1_GAP_MASK (3 << 0) 3048c2ecf20Sopenharmony_ci# define DISP2_GAP(x) ((x) << 2) 3058c2ecf20Sopenharmony_ci# define DISP2_GAP_MASK (3 << 2) 3068c2ecf20Sopenharmony_ci# define VBI_TIMER_COUNT(x) ((x) << 4) 3078c2ecf20Sopenharmony_ci# define VBI_TIMER_COUNT_MASK (0x3fff << 4) 3088c2ecf20Sopenharmony_ci# define VBI_TIMER_UNIT(x) ((x) << 20) 3098c2ecf20Sopenharmony_ci# define VBI_TIMER_UNIT_MASK (7 << 20) 3108c2ecf20Sopenharmony_ci# define DISP1_GAP_MCHG(x) ((x) << 24) 3118c2ecf20Sopenharmony_ci# define DISP1_GAP_MCHG_MASK (3 << 24) 3128c2ecf20Sopenharmony_ci# define DISP2_GAP_MCHG(x) ((x) << 26) 3138c2ecf20Sopenharmony_ci# define DISP2_GAP_MCHG_MASK (3 << 26) 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci#define CG_ULV_CONTROL 0x878 3168c2ecf20Sopenharmony_ci#define CG_ULV_PARAMETER 0x87c 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci#define SMC_SCRATCH0 0x884 3198c2ecf20Sopenharmony_ci 3208c2ecf20Sopenharmony_ci#define CG_CAC_CTRL 0x8b8 3218c2ecf20Sopenharmony_ci# define CAC_WINDOW(x) ((x) << 0) 3228c2ecf20Sopenharmony_ci# define CAC_WINDOW_MASK 0x00ffffff 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_ci#define DMIF_ADDR_CONFIG 0xBD4 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_ci#define DMIF_ADDR_CALC 0xC00 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ci#define PIPE0_DMIF_BUFFER_CONTROL 0x0ca0 3298c2ecf20Sopenharmony_ci# define DMIF_BUFFERS_ALLOCATED(x) ((x) << 0) 3308c2ecf20Sopenharmony_ci# define DMIF_BUFFERS_ALLOCATED_COMPLETED (1 << 4) 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ci#define SRBM_STATUS 0xE50 3338c2ecf20Sopenharmony_ci#define GRBM_RQ_PENDING (1 << 5) 3348c2ecf20Sopenharmony_ci#define VMC_BUSY (1 << 8) 3358c2ecf20Sopenharmony_ci#define MCB_BUSY (1 << 9) 3368c2ecf20Sopenharmony_ci#define MCB_NON_DISPLAY_BUSY (1 << 10) 3378c2ecf20Sopenharmony_ci#define MCC_BUSY (1 << 11) 3388c2ecf20Sopenharmony_ci#define MCD_BUSY (1 << 12) 3398c2ecf20Sopenharmony_ci#define SEM_BUSY (1 << 14) 3408c2ecf20Sopenharmony_ci#define IH_BUSY (1 << 17) 3418c2ecf20Sopenharmony_ci 3428c2ecf20Sopenharmony_ci#define SRBM_SOFT_RESET 0x0E60 3438c2ecf20Sopenharmony_ci#define SOFT_RESET_BIF (1 << 1) 3448c2ecf20Sopenharmony_ci#define SOFT_RESET_DC (1 << 5) 3458c2ecf20Sopenharmony_ci#define SOFT_RESET_DMA1 (1 << 6) 3468c2ecf20Sopenharmony_ci#define SOFT_RESET_GRBM (1 << 8) 3478c2ecf20Sopenharmony_ci#define SOFT_RESET_HDP (1 << 9) 3488c2ecf20Sopenharmony_ci#define SOFT_RESET_IH (1 << 10) 3498c2ecf20Sopenharmony_ci#define SOFT_RESET_MC (1 << 11) 3508c2ecf20Sopenharmony_ci#define SOFT_RESET_ROM (1 << 14) 3518c2ecf20Sopenharmony_ci#define SOFT_RESET_SEM (1 << 15) 3528c2ecf20Sopenharmony_ci#define SOFT_RESET_VMC (1 << 17) 3538c2ecf20Sopenharmony_ci#define SOFT_RESET_DMA (1 << 20) 3548c2ecf20Sopenharmony_ci#define SOFT_RESET_TST (1 << 21) 3558c2ecf20Sopenharmony_ci#define SOFT_RESET_REGBB (1 << 22) 3568c2ecf20Sopenharmony_ci#define SOFT_RESET_ORB (1 << 23) 3578c2ecf20Sopenharmony_ci 3588c2ecf20Sopenharmony_ci#define CC_SYS_RB_BACKEND_DISABLE 0xe80 3598c2ecf20Sopenharmony_ci#define GC_USER_SYS_RB_BACKEND_DISABLE 0xe84 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ci#define SRBM_READ_ERROR 0xE98 3628c2ecf20Sopenharmony_ci#define SRBM_INT_CNTL 0xEA0 3638c2ecf20Sopenharmony_ci#define SRBM_INT_ACK 0xEA8 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_ci#define SRBM_STATUS2 0x0EC4 3668c2ecf20Sopenharmony_ci#define DMA_BUSY (1 << 5) 3678c2ecf20Sopenharmony_ci#define DMA1_BUSY (1 << 6) 3688c2ecf20Sopenharmony_ci 3698c2ecf20Sopenharmony_ci#define VM_L2_CNTL 0x1400 3708c2ecf20Sopenharmony_ci#define ENABLE_L2_CACHE (1 << 0) 3718c2ecf20Sopenharmony_ci#define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1) 3728c2ecf20Sopenharmony_ci#define L2_CACHE_PTE_ENDIAN_SWAP_MODE(x) ((x) << 2) 3738c2ecf20Sopenharmony_ci#define L2_CACHE_PDE_ENDIAN_SWAP_MODE(x) ((x) << 4) 3748c2ecf20Sopenharmony_ci#define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9) 3758c2ecf20Sopenharmony_ci#define ENABLE_L2_PDE0_CACHE_LRU_UPDATE_BY_WRITE (1 << 10) 3768c2ecf20Sopenharmony_ci#define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 15) 3778c2ecf20Sopenharmony_ci#define CONTEXT1_IDENTITY_ACCESS_MODE(x) (((x) & 3) << 19) 3788c2ecf20Sopenharmony_ci#define VM_L2_CNTL2 0x1404 3798c2ecf20Sopenharmony_ci#define INVALIDATE_ALL_L1_TLBS (1 << 0) 3808c2ecf20Sopenharmony_ci#define INVALIDATE_L2_CACHE (1 << 1) 3818c2ecf20Sopenharmony_ci#define INVALIDATE_CACHE_MODE(x) ((x) << 26) 3828c2ecf20Sopenharmony_ci#define INVALIDATE_PTE_AND_PDE_CACHES 0 3838c2ecf20Sopenharmony_ci#define INVALIDATE_ONLY_PTE_CACHES 1 3848c2ecf20Sopenharmony_ci#define INVALIDATE_ONLY_PDE_CACHES 2 3858c2ecf20Sopenharmony_ci#define VM_L2_CNTL3 0x1408 3868c2ecf20Sopenharmony_ci#define BANK_SELECT(x) ((x) << 0) 3878c2ecf20Sopenharmony_ci#define L2_CACHE_UPDATE_MODE(x) ((x) << 6) 3888c2ecf20Sopenharmony_ci#define L2_CACHE_BIGK_FRAGMENT_SIZE(x) ((x) << 15) 3898c2ecf20Sopenharmony_ci#define L2_CACHE_BIGK_ASSOCIATIVITY (1 << 20) 3908c2ecf20Sopenharmony_ci#define VM_L2_STATUS 0x140C 3918c2ecf20Sopenharmony_ci#define L2_BUSY (1 << 0) 3928c2ecf20Sopenharmony_ci#define VM_CONTEXT0_CNTL 0x1410 3938c2ecf20Sopenharmony_ci#define ENABLE_CONTEXT (1 << 0) 3948c2ecf20Sopenharmony_ci#define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1) 3958c2ecf20Sopenharmony_ci#define RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 3) 3968c2ecf20Sopenharmony_ci#define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4) 3978c2ecf20Sopenharmony_ci#define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 6) 3988c2ecf20Sopenharmony_ci#define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 7) 3998c2ecf20Sopenharmony_ci#define PDE0_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 9) 4008c2ecf20Sopenharmony_ci#define PDE0_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 10) 4018c2ecf20Sopenharmony_ci#define VALID_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 12) 4028c2ecf20Sopenharmony_ci#define VALID_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 13) 4038c2ecf20Sopenharmony_ci#define READ_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 15) 4048c2ecf20Sopenharmony_ci#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) 4058c2ecf20Sopenharmony_ci#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) 4068c2ecf20Sopenharmony_ci#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) 4078c2ecf20Sopenharmony_ci#define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24) 4088c2ecf20Sopenharmony_ci#define VM_CONTEXT1_CNTL 0x1414 4098c2ecf20Sopenharmony_ci#define VM_CONTEXT0_CNTL2 0x1430 4108c2ecf20Sopenharmony_ci#define VM_CONTEXT1_CNTL2 0x1434 4118c2ecf20Sopenharmony_ci#define VM_CONTEXT8_PAGE_TABLE_BASE_ADDR 0x1438 4128c2ecf20Sopenharmony_ci#define VM_CONTEXT9_PAGE_TABLE_BASE_ADDR 0x143c 4138c2ecf20Sopenharmony_ci#define VM_CONTEXT10_PAGE_TABLE_BASE_ADDR 0x1440 4148c2ecf20Sopenharmony_ci#define VM_CONTEXT11_PAGE_TABLE_BASE_ADDR 0x1444 4158c2ecf20Sopenharmony_ci#define VM_CONTEXT12_PAGE_TABLE_BASE_ADDR 0x1448 4168c2ecf20Sopenharmony_ci#define VM_CONTEXT13_PAGE_TABLE_BASE_ADDR 0x144c 4178c2ecf20Sopenharmony_ci#define VM_CONTEXT14_PAGE_TABLE_BASE_ADDR 0x1450 4188c2ecf20Sopenharmony_ci#define VM_CONTEXT15_PAGE_TABLE_BASE_ADDR 0x1454 4198c2ecf20Sopenharmony_ci 4208c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x14FC 4218c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x14DC 4228c2ecf20Sopenharmony_ci#define PROTECTIONS_MASK (0xf << 0) 4238c2ecf20Sopenharmony_ci#define PROTECTIONS_SHIFT 0 4248c2ecf20Sopenharmony_ci /* bit 0: range 4258c2ecf20Sopenharmony_ci * bit 1: pde0 4268c2ecf20Sopenharmony_ci * bit 2: valid 4278c2ecf20Sopenharmony_ci * bit 3: read 4288c2ecf20Sopenharmony_ci * bit 4: write 4298c2ecf20Sopenharmony_ci */ 4308c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_ID_MASK (0xff << 12) 4318c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_ID_SHIFT 12 4328c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_RW_MASK (1 << 24) 4338c2ecf20Sopenharmony_ci#define MEMORY_CLIENT_RW_SHIFT 24 4348c2ecf20Sopenharmony_ci#define FAULT_VMID_MASK (0xf << 25) 4358c2ecf20Sopenharmony_ci#define FAULT_VMID_SHIFT 25 4368c2ecf20Sopenharmony_ci 4378c2ecf20Sopenharmony_ci#define VM_INVALIDATE_REQUEST 0x1478 4388c2ecf20Sopenharmony_ci#define VM_INVALIDATE_RESPONSE 0x147c 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518 4418c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR 0x151c 4428c2ecf20Sopenharmony_ci 4438c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153c 4448c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_BASE_ADDR 0x1540 4458c2ecf20Sopenharmony_ci#define VM_CONTEXT2_PAGE_TABLE_BASE_ADDR 0x1544 4468c2ecf20Sopenharmony_ci#define VM_CONTEXT3_PAGE_TABLE_BASE_ADDR 0x1548 4478c2ecf20Sopenharmony_ci#define VM_CONTEXT4_PAGE_TABLE_BASE_ADDR 0x154c 4488c2ecf20Sopenharmony_ci#define VM_CONTEXT5_PAGE_TABLE_BASE_ADDR 0x1550 4498c2ecf20Sopenharmony_ci#define VM_CONTEXT6_PAGE_TABLE_BASE_ADDR 0x1554 4508c2ecf20Sopenharmony_ci#define VM_CONTEXT7_PAGE_TABLE_BASE_ADDR 0x1558 4518c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155c 4528c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_START_ADDR 0x1560 4538c2ecf20Sopenharmony_ci 4548c2ecf20Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C 4558c2ecf20Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_END_ADDR 0x1580 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci#define VM_L2_CG 0x15c0 4588c2ecf20Sopenharmony_ci#define MC_CG_ENABLE (1 << 18) 4598c2ecf20Sopenharmony_ci#define MC_LS_ENABLE (1 << 19) 4608c2ecf20Sopenharmony_ci 4618c2ecf20Sopenharmony_ci#define MC_SHARED_CHMAP 0x2004 4628c2ecf20Sopenharmony_ci#define NOOFCHAN_SHIFT 12 4638c2ecf20Sopenharmony_ci#define NOOFCHAN_MASK 0x0000f000 4648c2ecf20Sopenharmony_ci#define MC_SHARED_CHREMAP 0x2008 4658c2ecf20Sopenharmony_ci 4668c2ecf20Sopenharmony_ci#define MC_VM_FB_LOCATION 0x2024 4678c2ecf20Sopenharmony_ci#define MC_VM_AGP_TOP 0x2028 4688c2ecf20Sopenharmony_ci#define MC_VM_AGP_BOT 0x202C 4698c2ecf20Sopenharmony_ci#define MC_VM_AGP_BASE 0x2030 4708c2ecf20Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 4718c2ecf20Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 4728c2ecf20Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C 4738c2ecf20Sopenharmony_ci 4748c2ecf20Sopenharmony_ci#define MC_VM_MX_L1_TLB_CNTL 0x2064 4758c2ecf20Sopenharmony_ci#define ENABLE_L1_TLB (1 << 0) 4768c2ecf20Sopenharmony_ci#define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1) 4778c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3) 4788c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3) 4798c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3) 4808c2ecf20Sopenharmony_ci#define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3) 4818c2ecf20Sopenharmony_ci#define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5) 4828c2ecf20Sopenharmony_ci#define ENABLE_ADVANCED_DRIVER_MODEL (1 << 6) 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ci#define MC_SHARED_BLACKOUT_CNTL 0x20ac 4858c2ecf20Sopenharmony_ci 4868c2ecf20Sopenharmony_ci#define MC_HUB_MISC_HUB_CG 0x20b8 4878c2ecf20Sopenharmony_ci#define MC_HUB_MISC_VM_CG 0x20bc 4888c2ecf20Sopenharmony_ci 4898c2ecf20Sopenharmony_ci#define MC_HUB_MISC_SIP_CG 0x20c0 4908c2ecf20Sopenharmony_ci 4918c2ecf20Sopenharmony_ci#define MC_XPB_CLK_GAT 0x2478 4928c2ecf20Sopenharmony_ci 4938c2ecf20Sopenharmony_ci#define MC_CITF_MISC_RD_CG 0x2648 4948c2ecf20Sopenharmony_ci#define MC_CITF_MISC_WR_CG 0x264c 4958c2ecf20Sopenharmony_ci#define MC_CITF_MISC_VM_CG 0x2650 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci#define MC_ARB_RAMCFG 0x2760 4988c2ecf20Sopenharmony_ci#define NOOFBANK_SHIFT 0 4998c2ecf20Sopenharmony_ci#define NOOFBANK_MASK 0x00000003 5008c2ecf20Sopenharmony_ci#define NOOFRANK_SHIFT 2 5018c2ecf20Sopenharmony_ci#define NOOFRANK_MASK 0x00000004 5028c2ecf20Sopenharmony_ci#define NOOFROWS_SHIFT 3 5038c2ecf20Sopenharmony_ci#define NOOFROWS_MASK 0x00000038 5048c2ecf20Sopenharmony_ci#define NOOFCOLS_SHIFT 6 5058c2ecf20Sopenharmony_ci#define NOOFCOLS_MASK 0x000000C0 5068c2ecf20Sopenharmony_ci#define CHANSIZE_SHIFT 8 5078c2ecf20Sopenharmony_ci#define CHANSIZE_MASK 0x00000100 5088c2ecf20Sopenharmony_ci#define CHANSIZE_OVERRIDE (1 << 11) 5098c2ecf20Sopenharmony_ci#define NOOFGROUPS_SHIFT 12 5108c2ecf20Sopenharmony_ci#define NOOFGROUPS_MASK 0x00001000 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_ci#define MC_ARB_DRAM_TIMING 0x2774 5138c2ecf20Sopenharmony_ci#define MC_ARB_DRAM_TIMING2 0x2778 5148c2ecf20Sopenharmony_ci 5158c2ecf20Sopenharmony_ci#define MC_ARB_BURST_TIME 0x2808 5168c2ecf20Sopenharmony_ci#define STATE0(x) ((x) << 0) 5178c2ecf20Sopenharmony_ci#define STATE0_MASK (0x1f << 0) 5188c2ecf20Sopenharmony_ci#define STATE0_SHIFT 0 5198c2ecf20Sopenharmony_ci#define STATE1(x) ((x) << 5) 5208c2ecf20Sopenharmony_ci#define STATE1_MASK (0x1f << 5) 5218c2ecf20Sopenharmony_ci#define STATE1_SHIFT 5 5228c2ecf20Sopenharmony_ci#define STATE2(x) ((x) << 10) 5238c2ecf20Sopenharmony_ci#define STATE2_MASK (0x1f << 10) 5248c2ecf20Sopenharmony_ci#define STATE2_SHIFT 10 5258c2ecf20Sopenharmony_ci#define STATE3(x) ((x) << 15) 5268c2ecf20Sopenharmony_ci#define STATE3_MASK (0x1f << 15) 5278c2ecf20Sopenharmony_ci#define STATE3_SHIFT 15 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_ci#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x28e8 5308c2ecf20Sopenharmony_ci#define TRAIN_DONE_D0 (1 << 30) 5318c2ecf20Sopenharmony_ci#define TRAIN_DONE_D1 (1 << 31) 5328c2ecf20Sopenharmony_ci 5338c2ecf20Sopenharmony_ci#define MC_SEQ_SUP_CNTL 0x28c8 5348c2ecf20Sopenharmony_ci#define RUN_MASK (1 << 0) 5358c2ecf20Sopenharmony_ci#define MC_SEQ_SUP_PGM 0x28cc 5368c2ecf20Sopenharmony_ci#define MC_PMG_AUTO_CMD 0x28d0 5378c2ecf20Sopenharmony_ci 5388c2ecf20Sopenharmony_ci#define MC_IO_PAD_CNTL_D0 0x29d0 5398c2ecf20Sopenharmony_ci#define MEM_FALL_OUT_CMD (1 << 8) 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_ci#define MC_SEQ_RAS_TIMING 0x28a0 5428c2ecf20Sopenharmony_ci#define MC_SEQ_CAS_TIMING 0x28a4 5438c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING 0x28a8 5448c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING2 0x28ac 5458c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_TIMING 0x28b0 5468c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D0 0x28b4 5478c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D1 0x28b8 5488c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D0 0x28bc 5498c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D1 0x28c0 5508c2ecf20Sopenharmony_ci 5518c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0 0x2a00 5528c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_SHIFT 8 5538c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_MASK 0x00000f00 5548c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_VALUE 3 5558c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_SHIFT 12 5568c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_MASK 0x0000f000 5578c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_VALUE 1 5588c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_SHIFT 28 5598c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000 5608c2ecf20Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_VALUE 5 5618c2ecf20Sopenharmony_ci#define MC_SEQ_MISC1 0x2a04 5628c2ecf20Sopenharmony_ci#define MC_SEQ_RESERVE_M 0x2a08 5638c2ecf20Sopenharmony_ci#define MC_PMG_CMD_EMRS 0x2a0c 5648c2ecf20Sopenharmony_ci 5658c2ecf20Sopenharmony_ci#define MC_SEQ_IO_DEBUG_INDEX 0x2a44 5668c2ecf20Sopenharmony_ci#define MC_SEQ_IO_DEBUG_DATA 0x2a48 5678c2ecf20Sopenharmony_ci 5688c2ecf20Sopenharmony_ci#define MC_SEQ_MISC5 0x2a54 5698c2ecf20Sopenharmony_ci#define MC_SEQ_MISC6 0x2a58 5708c2ecf20Sopenharmony_ci 5718c2ecf20Sopenharmony_ci#define MC_SEQ_MISC7 0x2a64 5728c2ecf20Sopenharmony_ci 5738c2ecf20Sopenharmony_ci#define MC_SEQ_RAS_TIMING_LP 0x2a6c 5748c2ecf20Sopenharmony_ci#define MC_SEQ_CAS_TIMING_LP 0x2a70 5758c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING_LP 0x2a74 5768c2ecf20Sopenharmony_ci#define MC_SEQ_MISC_TIMING2_LP 0x2a78 5778c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D0_LP 0x2a7c 5788c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_D1_LP 0x2a80 5798c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_EMRS_LP 0x2a84 5808c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS_LP 0x2a88 5818c2ecf20Sopenharmony_ci 5828c2ecf20Sopenharmony_ci#define MC_PMG_CMD_MRS 0x2aac 5838c2ecf20Sopenharmony_ci 5848c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D0_LP 0x2b1c 5858c2ecf20Sopenharmony_ci#define MC_SEQ_RD_CTL_D1_LP 0x2b20 5868c2ecf20Sopenharmony_ci 5878c2ecf20Sopenharmony_ci#define MC_PMG_CMD_MRS1 0x2b44 5888c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS1_LP 0x2b48 5898c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_TIMING_LP 0x2b4c 5908c2ecf20Sopenharmony_ci 5918c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_2 0x2b54 5928c2ecf20Sopenharmony_ci#define MC_SEQ_WR_CTL_2_LP 0x2b58 5938c2ecf20Sopenharmony_ci#define MC_PMG_CMD_MRS2 0x2b5c 5948c2ecf20Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS2_LP 0x2b60 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_ci#define MCLK_PWRMGT_CNTL 0x2ba0 5978c2ecf20Sopenharmony_ci# define DLL_SPEED(x) ((x) << 0) 5988c2ecf20Sopenharmony_ci# define DLL_SPEED_MASK (0x1f << 0) 5998c2ecf20Sopenharmony_ci# define DLL_READY (1 << 6) 6008c2ecf20Sopenharmony_ci# define MC_INT_CNTL (1 << 7) 6018c2ecf20Sopenharmony_ci# define MRDCK0_PDNB (1 << 8) 6028c2ecf20Sopenharmony_ci# define MRDCK1_PDNB (1 << 9) 6038c2ecf20Sopenharmony_ci# define MRDCK0_RESET (1 << 16) 6048c2ecf20Sopenharmony_ci# define MRDCK1_RESET (1 << 17) 6058c2ecf20Sopenharmony_ci# define DLL_READY_READ (1 << 24) 6068c2ecf20Sopenharmony_ci#define DLL_CNTL 0x2ba4 6078c2ecf20Sopenharmony_ci# define MRDCK0_BYPASS (1 << 24) 6088c2ecf20Sopenharmony_ci# define MRDCK1_BYPASS (1 << 25) 6098c2ecf20Sopenharmony_ci 6108c2ecf20Sopenharmony_ci#define MPLL_CNTL_MODE 0x2bb0 6118c2ecf20Sopenharmony_ci# define MPLL_MCLK_SEL (1 << 11) 6128c2ecf20Sopenharmony_ci#define MPLL_FUNC_CNTL 0x2bb4 6138c2ecf20Sopenharmony_ci#define BWCTRL(x) ((x) << 20) 6148c2ecf20Sopenharmony_ci#define BWCTRL_MASK (0xff << 20) 6158c2ecf20Sopenharmony_ci#define MPLL_FUNC_CNTL_1 0x2bb8 6168c2ecf20Sopenharmony_ci#define VCO_MODE(x) ((x) << 0) 6178c2ecf20Sopenharmony_ci#define VCO_MODE_MASK (3 << 0) 6188c2ecf20Sopenharmony_ci#define CLKFRAC(x) ((x) << 4) 6198c2ecf20Sopenharmony_ci#define CLKFRAC_MASK (0xfff << 4) 6208c2ecf20Sopenharmony_ci#define CLKF(x) ((x) << 16) 6218c2ecf20Sopenharmony_ci#define CLKF_MASK (0xfff << 16) 6228c2ecf20Sopenharmony_ci#define MPLL_FUNC_CNTL_2 0x2bbc 6238c2ecf20Sopenharmony_ci#define MPLL_AD_FUNC_CNTL 0x2bc0 6248c2ecf20Sopenharmony_ci#define YCLK_POST_DIV(x) ((x) << 0) 6258c2ecf20Sopenharmony_ci#define YCLK_POST_DIV_MASK (7 << 0) 6268c2ecf20Sopenharmony_ci#define MPLL_DQ_FUNC_CNTL 0x2bc4 6278c2ecf20Sopenharmony_ci#define YCLK_SEL(x) ((x) << 4) 6288c2ecf20Sopenharmony_ci#define YCLK_SEL_MASK (1 << 4) 6298c2ecf20Sopenharmony_ci 6308c2ecf20Sopenharmony_ci#define MPLL_SS1 0x2bcc 6318c2ecf20Sopenharmony_ci#define CLKV(x) ((x) << 0) 6328c2ecf20Sopenharmony_ci#define CLKV_MASK (0x3ffffff << 0) 6338c2ecf20Sopenharmony_ci#define MPLL_SS2 0x2bd0 6348c2ecf20Sopenharmony_ci#define CLKS(x) ((x) << 0) 6358c2ecf20Sopenharmony_ci#define CLKS_MASK (0xfff << 0) 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci#define HDP_HOST_PATH_CNTL 0x2C00 6388c2ecf20Sopenharmony_ci#define CLOCK_GATING_DIS (1 << 23) 6398c2ecf20Sopenharmony_ci#define HDP_NONSURFACE_BASE 0x2C04 6408c2ecf20Sopenharmony_ci#define HDP_NONSURFACE_INFO 0x2C08 6418c2ecf20Sopenharmony_ci#define HDP_NONSURFACE_SIZE 0x2C0C 6428c2ecf20Sopenharmony_ci 6438c2ecf20Sopenharmony_ci#define HDP_ADDR_CONFIG 0x2F48 6448c2ecf20Sopenharmony_ci#define HDP_MISC_CNTL 0x2F4C 6458c2ecf20Sopenharmony_ci#define HDP_FLUSH_INVALIDATE_CACHE (1 << 0) 6468c2ecf20Sopenharmony_ci#define HDP_MEM_POWER_LS 0x2F50 6478c2ecf20Sopenharmony_ci#define HDP_LS_ENABLE (1 << 0) 6488c2ecf20Sopenharmony_ci 6498c2ecf20Sopenharmony_ci#define ATC_MISC_CG 0x3350 6508c2ecf20Sopenharmony_ci 6518c2ecf20Sopenharmony_ci#define IH_RB_CNTL 0x3e00 6528c2ecf20Sopenharmony_ci# define IH_RB_ENABLE (1 << 0) 6538c2ecf20Sopenharmony_ci# define IH_IB_SIZE(x) ((x) << 1) /* log2 */ 6548c2ecf20Sopenharmony_ci# define IH_RB_FULL_DRAIN_ENABLE (1 << 6) 6558c2ecf20Sopenharmony_ci# define IH_WPTR_WRITEBACK_ENABLE (1 << 8) 6568c2ecf20Sopenharmony_ci# define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */ 6578c2ecf20Sopenharmony_ci# define IH_WPTR_OVERFLOW_ENABLE (1 << 16) 6588c2ecf20Sopenharmony_ci# define IH_WPTR_OVERFLOW_CLEAR (1 << 31) 6598c2ecf20Sopenharmony_ci#define IH_RB_BASE 0x3e04 6608c2ecf20Sopenharmony_ci#define IH_RB_RPTR 0x3e08 6618c2ecf20Sopenharmony_ci#define IH_RB_WPTR 0x3e0c 6628c2ecf20Sopenharmony_ci# define RB_OVERFLOW (1 << 0) 6638c2ecf20Sopenharmony_ci# define WPTR_OFFSET_MASK 0x3fffc 6648c2ecf20Sopenharmony_ci#define IH_RB_WPTR_ADDR_HI 0x3e10 6658c2ecf20Sopenharmony_ci#define IH_RB_WPTR_ADDR_LO 0x3e14 6668c2ecf20Sopenharmony_ci#define IH_CNTL 0x3e18 6678c2ecf20Sopenharmony_ci# define ENABLE_INTR (1 << 0) 6688c2ecf20Sopenharmony_ci# define IH_MC_SWAP(x) ((x) << 1) 6698c2ecf20Sopenharmony_ci# define IH_MC_SWAP_NONE 0 6708c2ecf20Sopenharmony_ci# define IH_MC_SWAP_16BIT 1 6718c2ecf20Sopenharmony_ci# define IH_MC_SWAP_32BIT 2 6728c2ecf20Sopenharmony_ci# define IH_MC_SWAP_64BIT 3 6738c2ecf20Sopenharmony_ci# define RPTR_REARM (1 << 4) 6748c2ecf20Sopenharmony_ci# define MC_WRREQ_CREDIT(x) ((x) << 15) 6758c2ecf20Sopenharmony_ci# define MC_WR_CLEAN_CNT(x) ((x) << 20) 6768c2ecf20Sopenharmony_ci# define MC_VMID(x) ((x) << 25) 6778c2ecf20Sopenharmony_ci 6788c2ecf20Sopenharmony_ci#define CONFIG_MEMSIZE 0x5428 6798c2ecf20Sopenharmony_ci 6808c2ecf20Sopenharmony_ci#define INTERRUPT_CNTL 0x5468 6818c2ecf20Sopenharmony_ci# define IH_DUMMY_RD_OVERRIDE (1 << 0) 6828c2ecf20Sopenharmony_ci# define IH_DUMMY_RD_EN (1 << 1) 6838c2ecf20Sopenharmony_ci# define IH_REQ_NONSNOOP_EN (1 << 3) 6848c2ecf20Sopenharmony_ci# define GEN_IH_INT_EN (1 << 8) 6858c2ecf20Sopenharmony_ci#define INTERRUPT_CNTL2 0x546c 6868c2ecf20Sopenharmony_ci 6878c2ecf20Sopenharmony_ci#define HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480 6888c2ecf20Sopenharmony_ci 6898c2ecf20Sopenharmony_ci#define BIF_FB_EN 0x5490 6908c2ecf20Sopenharmony_ci#define FB_READ_EN (1 << 0) 6918c2ecf20Sopenharmony_ci#define FB_WRITE_EN (1 << 1) 6928c2ecf20Sopenharmony_ci 6938c2ecf20Sopenharmony_ci#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 6948c2ecf20Sopenharmony_ci 6958c2ecf20Sopenharmony_ci/* DCE6 ELD audio interface */ 6968c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_ENDPOINT_INDEX 0x5E00 6978c2ecf20Sopenharmony_ci# define AZ_ENDPOINT_REG_INDEX(x) (((x) & 0xff) << 0) 6988c2ecf20Sopenharmony_ci# define AZ_ENDPOINT_REG_WRITE_EN (1 << 8) 6998c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_ENDPOINT_DATA 0x5E04 7008c2ecf20Sopenharmony_ci 7018c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER 0x25 7028c2ecf20Sopenharmony_ci#define SPEAKER_ALLOCATION(x) (((x) & 0x7f) << 0) 7038c2ecf20Sopenharmony_ci#define SPEAKER_ALLOCATION_MASK (0x7f << 0) 7048c2ecf20Sopenharmony_ci#define SPEAKER_ALLOCATION_SHIFT 0 7058c2ecf20Sopenharmony_ci#define HDMI_CONNECTION (1 << 16) 7068c2ecf20Sopenharmony_ci#define DP_CONNECTION (1 << 17) 7078c2ecf20Sopenharmony_ci 7088c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR0 0x28 /* LPCM */ 7098c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR1 0x29 /* AC3 */ 7108c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR2 0x2A /* MPEG1 */ 7118c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR3 0x2B /* MP3 */ 7128c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR4 0x2C /* MPEG2 */ 7138c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR5 0x2D /* AAC */ 7148c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR6 0x2E /* DTS */ 7158c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR7 0x2F /* ATRAC */ 7168c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR8 0x30 /* one bit audio - leave at 0 (default) */ 7178c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR9 0x31 /* Dolby Digital */ 7188c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR10 0x32 /* DTS-HD */ 7198c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR11 0x33 /* MAT-MLP */ 7208c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR12 0x34 /* DTS */ 7218c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR13 0x35 /* WMA Pro */ 7228c2ecf20Sopenharmony_ci# define MAX_CHANNELS(x) (((x) & 0x7) << 0) 7238c2ecf20Sopenharmony_ci/* max channels minus one. 7 = 8 channels */ 7248c2ecf20Sopenharmony_ci# define SUPPORTED_FREQUENCIES(x) (((x) & 0xff) << 8) 7258c2ecf20Sopenharmony_ci# define DESCRIPTOR_BYTE_2(x) (((x) & 0xff) << 16) 7268c2ecf20Sopenharmony_ci# define SUPPORTED_FREQUENCIES_STEREO(x) (((x) & 0xff) << 24) /* LPCM only */ 7278c2ecf20Sopenharmony_ci/* SUPPORTED_FREQUENCIES, SUPPORTED_FREQUENCIES_STEREO 7288c2ecf20Sopenharmony_ci * bit0 = 32 kHz 7298c2ecf20Sopenharmony_ci * bit1 = 44.1 kHz 7308c2ecf20Sopenharmony_ci * bit2 = 48 kHz 7318c2ecf20Sopenharmony_ci * bit3 = 88.2 kHz 7328c2ecf20Sopenharmony_ci * bit4 = 96 kHz 7338c2ecf20Sopenharmony_ci * bit5 = 176.4 kHz 7348c2ecf20Sopenharmony_ci * bit6 = 192 kHz 7358c2ecf20Sopenharmony_ci */ 7368c2ecf20Sopenharmony_ci 7378c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC 0x37 7388c2ecf20Sopenharmony_ci# define VIDEO_LIPSYNC(x) (((x) & 0xff) << 0) 7398c2ecf20Sopenharmony_ci# define AUDIO_LIPSYNC(x) (((x) & 0xff) << 8) 7408c2ecf20Sopenharmony_ci/* VIDEO_LIPSYNC, AUDIO_LIPSYNC 7418c2ecf20Sopenharmony_ci * 0 = invalid 7428c2ecf20Sopenharmony_ci * x = legal delay value 7438c2ecf20Sopenharmony_ci * 255 = sync not supported 7448c2ecf20Sopenharmony_ci */ 7458c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_HBR 0x38 7468c2ecf20Sopenharmony_ci# define HBR_CAPABLE (1 << 0) /* enabled by default */ 7478c2ecf20Sopenharmony_ci 7488c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO0 0x3a 7498c2ecf20Sopenharmony_ci# define MANUFACTURER_ID(x) (((x) & 0xffff) << 0) 7508c2ecf20Sopenharmony_ci# define PRODUCT_ID(x) (((x) & 0xffff) << 16) 7518c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO1 0x3b 7528c2ecf20Sopenharmony_ci# define SINK_DESCRIPTION_LEN(x) (((x) & 0xff) << 0) 7538c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO2 0x3c 7548c2ecf20Sopenharmony_ci# define PORT_ID0(x) (((x) & 0xffffffff) << 0) 7558c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO3 0x3d 7568c2ecf20Sopenharmony_ci# define PORT_ID1(x) (((x) & 0xffffffff) << 0) 7578c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO4 0x3e 7588c2ecf20Sopenharmony_ci# define DESCRIPTION0(x) (((x) & 0xff) << 0) 7598c2ecf20Sopenharmony_ci# define DESCRIPTION1(x) (((x) & 0xff) << 8) 7608c2ecf20Sopenharmony_ci# define DESCRIPTION2(x) (((x) & 0xff) << 16) 7618c2ecf20Sopenharmony_ci# define DESCRIPTION3(x) (((x) & 0xff) << 24) 7628c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO5 0x3f 7638c2ecf20Sopenharmony_ci# define DESCRIPTION4(x) (((x) & 0xff) << 0) 7648c2ecf20Sopenharmony_ci# define DESCRIPTION5(x) (((x) & 0xff) << 8) 7658c2ecf20Sopenharmony_ci# define DESCRIPTION6(x) (((x) & 0xff) << 16) 7668c2ecf20Sopenharmony_ci# define DESCRIPTION7(x) (((x) & 0xff) << 24) 7678c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO6 0x40 7688c2ecf20Sopenharmony_ci# define DESCRIPTION8(x) (((x) & 0xff) << 0) 7698c2ecf20Sopenharmony_ci# define DESCRIPTION9(x) (((x) & 0xff) << 8) 7708c2ecf20Sopenharmony_ci# define DESCRIPTION10(x) (((x) & 0xff) << 16) 7718c2ecf20Sopenharmony_ci# define DESCRIPTION11(x) (((x) & 0xff) << 24) 7728c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO7 0x41 7738c2ecf20Sopenharmony_ci# define DESCRIPTION12(x) (((x) & 0xff) << 0) 7748c2ecf20Sopenharmony_ci# define DESCRIPTION13(x) (((x) & 0xff) << 8) 7758c2ecf20Sopenharmony_ci# define DESCRIPTION14(x) (((x) & 0xff) << 16) 7768c2ecf20Sopenharmony_ci# define DESCRIPTION15(x) (((x) & 0xff) << 24) 7778c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO8 0x42 7788c2ecf20Sopenharmony_ci# define DESCRIPTION16(x) (((x) & 0xff) << 0) 7798c2ecf20Sopenharmony_ci# define DESCRIPTION17(x) (((x) & 0xff) << 8) 7808c2ecf20Sopenharmony_ci 7818c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL 0x54 7828c2ecf20Sopenharmony_ci# define AUDIO_ENABLED (1 << 31) 7838c2ecf20Sopenharmony_ci 7848c2ecf20Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_CONFIGURATION_DEFAULT 0x56 7858c2ecf20Sopenharmony_ci#define PORT_CONNECTIVITY_MASK (3 << 30) 7868c2ecf20Sopenharmony_ci#define PORT_CONNECTIVITY_SHIFT 30 7878c2ecf20Sopenharmony_ci 7888c2ecf20Sopenharmony_ci#define DC_LB_MEMORY_SPLIT 0x6b0c 7898c2ecf20Sopenharmony_ci#define DC_LB_MEMORY_CONFIG(x) ((x) << 20) 7908c2ecf20Sopenharmony_ci 7918c2ecf20Sopenharmony_ci#define PRIORITY_A_CNT 0x6b18 7928c2ecf20Sopenharmony_ci#define PRIORITY_MARK_MASK 0x7fff 7938c2ecf20Sopenharmony_ci#define PRIORITY_OFF (1 << 16) 7948c2ecf20Sopenharmony_ci#define PRIORITY_ALWAYS_ON (1 << 20) 7958c2ecf20Sopenharmony_ci#define PRIORITY_B_CNT 0x6b1c 7968c2ecf20Sopenharmony_ci 7978c2ecf20Sopenharmony_ci#define DPG_PIPE_ARBITRATION_CONTROL3 0x6cc8 7988c2ecf20Sopenharmony_ci# define LATENCY_WATERMARK_MASK(x) ((x) << 16) 7998c2ecf20Sopenharmony_ci#define DPG_PIPE_LATENCY_CONTROL 0x6ccc 8008c2ecf20Sopenharmony_ci# define LATENCY_LOW_WATERMARK(x) ((x) << 0) 8018c2ecf20Sopenharmony_ci# define LATENCY_HIGH_WATERMARK(x) ((x) << 16) 8028c2ecf20Sopenharmony_ci 8038c2ecf20Sopenharmony_ci/* 0x6bb8, 0x77b8, 0x103b8, 0x10fb8, 0x11bb8, 0x127b8 */ 8048c2ecf20Sopenharmony_ci#define VLINE_STATUS 0x6bb8 8058c2ecf20Sopenharmony_ci# define VLINE_OCCURRED (1 << 0) 8068c2ecf20Sopenharmony_ci# define VLINE_ACK (1 << 4) 8078c2ecf20Sopenharmony_ci# define VLINE_STAT (1 << 12) 8088c2ecf20Sopenharmony_ci# define VLINE_INTERRUPT (1 << 16) 8098c2ecf20Sopenharmony_ci# define VLINE_INTERRUPT_TYPE (1 << 17) 8108c2ecf20Sopenharmony_ci/* 0x6bbc, 0x77bc, 0x103bc, 0x10fbc, 0x11bbc, 0x127bc */ 8118c2ecf20Sopenharmony_ci#define VBLANK_STATUS 0x6bbc 8128c2ecf20Sopenharmony_ci# define VBLANK_OCCURRED (1 << 0) 8138c2ecf20Sopenharmony_ci# define VBLANK_ACK (1 << 4) 8148c2ecf20Sopenharmony_ci# define VBLANK_STAT (1 << 12) 8158c2ecf20Sopenharmony_ci# define VBLANK_INTERRUPT (1 << 16) 8168c2ecf20Sopenharmony_ci# define VBLANK_INTERRUPT_TYPE (1 << 17) 8178c2ecf20Sopenharmony_ci 8188c2ecf20Sopenharmony_ci/* 0x6b40, 0x7740, 0x10340, 0x10f40, 0x11b40, 0x12740 */ 8198c2ecf20Sopenharmony_ci#define INT_MASK 0x6b40 8208c2ecf20Sopenharmony_ci# define VBLANK_INT_MASK (1 << 0) 8218c2ecf20Sopenharmony_ci# define VLINE_INT_MASK (1 << 4) 8228c2ecf20Sopenharmony_ci 8238c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS 0x60f4 8248c2ecf20Sopenharmony_ci# define LB_D1_VLINE_INTERRUPT (1 << 2) 8258c2ecf20Sopenharmony_ci# define LB_D1_VBLANK_INTERRUPT (1 << 3) 8268c2ecf20Sopenharmony_ci# define DC_HPD1_INTERRUPT (1 << 17) 8278c2ecf20Sopenharmony_ci# define DC_HPD1_RX_INTERRUPT (1 << 18) 8288c2ecf20Sopenharmony_ci# define DACA_AUTODETECT_INTERRUPT (1 << 22) 8298c2ecf20Sopenharmony_ci# define DACB_AUTODETECT_INTERRUPT (1 << 23) 8308c2ecf20Sopenharmony_ci# define DC_I2C_SW_DONE_INTERRUPT (1 << 24) 8318c2ecf20Sopenharmony_ci# define DC_I2C_HW_DONE_INTERRUPT (1 << 25) 8328c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE 0x60f8 8338c2ecf20Sopenharmony_ci# define LB_D2_VLINE_INTERRUPT (1 << 2) 8348c2ecf20Sopenharmony_ci# define LB_D2_VBLANK_INTERRUPT (1 << 3) 8358c2ecf20Sopenharmony_ci# define DC_HPD2_INTERRUPT (1 << 17) 8368c2ecf20Sopenharmony_ci# define DC_HPD2_RX_INTERRUPT (1 << 18) 8378c2ecf20Sopenharmony_ci# define DISP_TIMER_INTERRUPT (1 << 24) 8388c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE2 0x60fc 8398c2ecf20Sopenharmony_ci# define LB_D3_VLINE_INTERRUPT (1 << 2) 8408c2ecf20Sopenharmony_ci# define LB_D3_VBLANK_INTERRUPT (1 << 3) 8418c2ecf20Sopenharmony_ci# define DC_HPD3_INTERRUPT (1 << 17) 8428c2ecf20Sopenharmony_ci# define DC_HPD3_RX_INTERRUPT (1 << 18) 8438c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE3 0x6100 8448c2ecf20Sopenharmony_ci# define LB_D4_VLINE_INTERRUPT (1 << 2) 8458c2ecf20Sopenharmony_ci# define LB_D4_VBLANK_INTERRUPT (1 << 3) 8468c2ecf20Sopenharmony_ci# define DC_HPD4_INTERRUPT (1 << 17) 8478c2ecf20Sopenharmony_ci# define DC_HPD4_RX_INTERRUPT (1 << 18) 8488c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE4 0x614c 8498c2ecf20Sopenharmony_ci# define LB_D5_VLINE_INTERRUPT (1 << 2) 8508c2ecf20Sopenharmony_ci# define LB_D5_VBLANK_INTERRUPT (1 << 3) 8518c2ecf20Sopenharmony_ci# define DC_HPD5_INTERRUPT (1 << 17) 8528c2ecf20Sopenharmony_ci# define DC_HPD5_RX_INTERRUPT (1 << 18) 8538c2ecf20Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE5 0x6150 8548c2ecf20Sopenharmony_ci# define LB_D6_VLINE_INTERRUPT (1 << 2) 8558c2ecf20Sopenharmony_ci# define LB_D6_VBLANK_INTERRUPT (1 << 3) 8568c2ecf20Sopenharmony_ci# define DC_HPD6_INTERRUPT (1 << 17) 8578c2ecf20Sopenharmony_ci# define DC_HPD6_RX_INTERRUPT (1 << 18) 8588c2ecf20Sopenharmony_ci 8598c2ecf20Sopenharmony_ci/* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */ 8608c2ecf20Sopenharmony_ci#define GRPH_INT_STATUS 0x6858 8618c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_OCCURRED (1 << 0) 8628c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_CLEAR (1 << 8) 8638c2ecf20Sopenharmony_ci/* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */ 8648c2ecf20Sopenharmony_ci#define GRPH_INT_CONTROL 0x685c 8658c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_MASK (1 << 0) 8668c2ecf20Sopenharmony_ci# define GRPH_PFLIP_INT_TYPE (1 << 8) 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_ci#define DAC_AUTODETECT_INT_CONTROL 0x67c8 8698c2ecf20Sopenharmony_ci 8708c2ecf20Sopenharmony_ci#define DC_HPD1_INT_STATUS 0x601c 8718c2ecf20Sopenharmony_ci#define DC_HPD2_INT_STATUS 0x6028 8728c2ecf20Sopenharmony_ci#define DC_HPD3_INT_STATUS 0x6034 8738c2ecf20Sopenharmony_ci#define DC_HPD4_INT_STATUS 0x6040 8748c2ecf20Sopenharmony_ci#define DC_HPD5_INT_STATUS 0x604c 8758c2ecf20Sopenharmony_ci#define DC_HPD6_INT_STATUS 0x6058 8768c2ecf20Sopenharmony_ci# define DC_HPDx_INT_STATUS (1 << 0) 8778c2ecf20Sopenharmony_ci# define DC_HPDx_SENSE (1 << 1) 8788c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_STATUS (1 << 8) 8798c2ecf20Sopenharmony_ci 8808c2ecf20Sopenharmony_ci#define DC_HPD1_INT_CONTROL 0x6020 8818c2ecf20Sopenharmony_ci#define DC_HPD2_INT_CONTROL 0x602c 8828c2ecf20Sopenharmony_ci#define DC_HPD3_INT_CONTROL 0x6038 8838c2ecf20Sopenharmony_ci#define DC_HPD4_INT_CONTROL 0x6044 8848c2ecf20Sopenharmony_ci#define DC_HPD5_INT_CONTROL 0x6050 8858c2ecf20Sopenharmony_ci#define DC_HPD6_INT_CONTROL 0x605c 8868c2ecf20Sopenharmony_ci# define DC_HPDx_INT_ACK (1 << 0) 8878c2ecf20Sopenharmony_ci# define DC_HPDx_INT_POLARITY (1 << 8) 8888c2ecf20Sopenharmony_ci# define DC_HPDx_INT_EN (1 << 16) 8898c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_ACK (1 << 20) 8908c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_EN (1 << 24) 8918c2ecf20Sopenharmony_ci 8928c2ecf20Sopenharmony_ci#define DC_HPD1_CONTROL 0x6024 8938c2ecf20Sopenharmony_ci#define DC_HPD2_CONTROL 0x6030 8948c2ecf20Sopenharmony_ci#define DC_HPD3_CONTROL 0x603c 8958c2ecf20Sopenharmony_ci#define DC_HPD4_CONTROL 0x6048 8968c2ecf20Sopenharmony_ci#define DC_HPD5_CONTROL 0x6054 8978c2ecf20Sopenharmony_ci#define DC_HPD6_CONTROL 0x6060 8988c2ecf20Sopenharmony_ci# define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0) 8998c2ecf20Sopenharmony_ci# define DC_HPDx_RX_INT_TIMER(x) ((x) << 16) 9008c2ecf20Sopenharmony_ci# define DC_HPDx_EN (1 << 28) 9018c2ecf20Sopenharmony_ci 9028c2ecf20Sopenharmony_ci#define DPG_PIPE_STUTTER_CONTROL 0x6cd4 9038c2ecf20Sopenharmony_ci# define STUTTER_ENABLE (1 << 0) 9048c2ecf20Sopenharmony_ci 9058c2ecf20Sopenharmony_ci/* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */ 9068c2ecf20Sopenharmony_ci#define CRTC_STATUS_FRAME_COUNT 0x6e98 9078c2ecf20Sopenharmony_ci 9088c2ecf20Sopenharmony_ci/* Audio clocks */ 9098c2ecf20Sopenharmony_ci#define DCCG_AUDIO_DTO_SOURCE 0x05ac 9108c2ecf20Sopenharmony_ci# define DCCG_AUDIO_DTO0_SOURCE_SEL(x) ((x) << 0) /* crtc0 - crtc5 */ 9118c2ecf20Sopenharmony_ci# define DCCG_AUDIO_DTO_SEL (1 << 4) /* 0=dto0 1=dto1 */ 9128c2ecf20Sopenharmony_ci 9138c2ecf20Sopenharmony_ci#define DCCG_AUDIO_DTO0_PHASE 0x05b0 9148c2ecf20Sopenharmony_ci#define DCCG_AUDIO_DTO0_MODULE 0x05b4 9158c2ecf20Sopenharmony_ci#define DCCG_AUDIO_DTO1_PHASE 0x05c0 9168c2ecf20Sopenharmony_ci#define DCCG_AUDIO_DTO1_MODULE 0x05c4 9178c2ecf20Sopenharmony_ci 9188c2ecf20Sopenharmony_ci#define DENTIST_DISPCLK_CNTL 0x0490 9198c2ecf20Sopenharmony_ci# define DENTIST_DPREFCLK_WDIVIDER(x) (((x) & 0x7f) << 24) 9208c2ecf20Sopenharmony_ci# define DENTIST_DPREFCLK_WDIVIDER_MASK (0x7f << 24) 9218c2ecf20Sopenharmony_ci# define DENTIST_DPREFCLK_WDIVIDER_SHIFT 24 9228c2ecf20Sopenharmony_ci 9238c2ecf20Sopenharmony_ci#define AFMT_AUDIO_SRC_CONTROL 0x713c 9248c2ecf20Sopenharmony_ci#define AFMT_AUDIO_SRC_SELECT(x) (((x) & 7) << 0) 9258c2ecf20Sopenharmony_ci/* AFMT_AUDIO_SRC_SELECT 9268c2ecf20Sopenharmony_ci * 0 = stream0 9278c2ecf20Sopenharmony_ci * 1 = stream1 9288c2ecf20Sopenharmony_ci * 2 = stream2 9298c2ecf20Sopenharmony_ci * 3 = stream3 9308c2ecf20Sopenharmony_ci * 4 = stream4 9318c2ecf20Sopenharmony_ci * 5 = stream5 9328c2ecf20Sopenharmony_ci */ 9338c2ecf20Sopenharmony_ci 9348c2ecf20Sopenharmony_ci#define GRBM_CNTL 0x8000 9358c2ecf20Sopenharmony_ci#define GRBM_READ_TIMEOUT(x) ((x) << 0) 9368c2ecf20Sopenharmony_ci 9378c2ecf20Sopenharmony_ci#define GRBM_STATUS2 0x8008 9388c2ecf20Sopenharmony_ci#define RLC_RQ_PENDING (1 << 0) 9398c2ecf20Sopenharmony_ci#define RLC_BUSY (1 << 8) 9408c2ecf20Sopenharmony_ci#define TC_BUSY (1 << 9) 9418c2ecf20Sopenharmony_ci 9428c2ecf20Sopenharmony_ci#define GRBM_STATUS 0x8010 9438c2ecf20Sopenharmony_ci#define CMDFIFO_AVAIL_MASK 0x0000000F 9448c2ecf20Sopenharmony_ci#define RING2_RQ_PENDING (1 << 4) 9458c2ecf20Sopenharmony_ci#define SRBM_RQ_PENDING (1 << 5) 9468c2ecf20Sopenharmony_ci#define RING1_RQ_PENDING (1 << 6) 9478c2ecf20Sopenharmony_ci#define CF_RQ_PENDING (1 << 7) 9488c2ecf20Sopenharmony_ci#define PF_RQ_PENDING (1 << 8) 9498c2ecf20Sopenharmony_ci#define GDS_DMA_RQ_PENDING (1 << 9) 9508c2ecf20Sopenharmony_ci#define GRBM_EE_BUSY (1 << 10) 9518c2ecf20Sopenharmony_ci#define DB_CLEAN (1 << 12) 9528c2ecf20Sopenharmony_ci#define CB_CLEAN (1 << 13) 9538c2ecf20Sopenharmony_ci#define TA_BUSY (1 << 14) 9548c2ecf20Sopenharmony_ci#define GDS_BUSY (1 << 15) 9558c2ecf20Sopenharmony_ci#define VGT_BUSY (1 << 17) 9568c2ecf20Sopenharmony_ci#define IA_BUSY_NO_DMA (1 << 18) 9578c2ecf20Sopenharmony_ci#define IA_BUSY (1 << 19) 9588c2ecf20Sopenharmony_ci#define SX_BUSY (1 << 20) 9598c2ecf20Sopenharmony_ci#define SPI_BUSY (1 << 22) 9608c2ecf20Sopenharmony_ci#define BCI_BUSY (1 << 23) 9618c2ecf20Sopenharmony_ci#define SC_BUSY (1 << 24) 9628c2ecf20Sopenharmony_ci#define PA_BUSY (1 << 25) 9638c2ecf20Sopenharmony_ci#define DB_BUSY (1 << 26) 9648c2ecf20Sopenharmony_ci#define CP_COHERENCY_BUSY (1 << 28) 9658c2ecf20Sopenharmony_ci#define CP_BUSY (1 << 29) 9668c2ecf20Sopenharmony_ci#define CB_BUSY (1 << 30) 9678c2ecf20Sopenharmony_ci#define GUI_ACTIVE (1 << 31) 9688c2ecf20Sopenharmony_ci#define GRBM_STATUS_SE0 0x8014 9698c2ecf20Sopenharmony_ci#define GRBM_STATUS_SE1 0x8018 9708c2ecf20Sopenharmony_ci#define SE_DB_CLEAN (1 << 1) 9718c2ecf20Sopenharmony_ci#define SE_CB_CLEAN (1 << 2) 9728c2ecf20Sopenharmony_ci#define SE_BCI_BUSY (1 << 22) 9738c2ecf20Sopenharmony_ci#define SE_VGT_BUSY (1 << 23) 9748c2ecf20Sopenharmony_ci#define SE_PA_BUSY (1 << 24) 9758c2ecf20Sopenharmony_ci#define SE_TA_BUSY (1 << 25) 9768c2ecf20Sopenharmony_ci#define SE_SX_BUSY (1 << 26) 9778c2ecf20Sopenharmony_ci#define SE_SPI_BUSY (1 << 27) 9788c2ecf20Sopenharmony_ci#define SE_SC_BUSY (1 << 29) 9798c2ecf20Sopenharmony_ci#define SE_DB_BUSY (1 << 30) 9808c2ecf20Sopenharmony_ci#define SE_CB_BUSY (1 << 31) 9818c2ecf20Sopenharmony_ci 9828c2ecf20Sopenharmony_ci#define GRBM_SOFT_RESET 0x8020 9838c2ecf20Sopenharmony_ci#define SOFT_RESET_CP (1 << 0) 9848c2ecf20Sopenharmony_ci#define SOFT_RESET_CB (1 << 1) 9858c2ecf20Sopenharmony_ci#define SOFT_RESET_RLC (1 << 2) 9868c2ecf20Sopenharmony_ci#define SOFT_RESET_DB (1 << 3) 9878c2ecf20Sopenharmony_ci#define SOFT_RESET_GDS (1 << 4) 9888c2ecf20Sopenharmony_ci#define SOFT_RESET_PA (1 << 5) 9898c2ecf20Sopenharmony_ci#define SOFT_RESET_SC (1 << 6) 9908c2ecf20Sopenharmony_ci#define SOFT_RESET_BCI (1 << 7) 9918c2ecf20Sopenharmony_ci#define SOFT_RESET_SPI (1 << 8) 9928c2ecf20Sopenharmony_ci#define SOFT_RESET_SX (1 << 10) 9938c2ecf20Sopenharmony_ci#define SOFT_RESET_TC (1 << 11) 9948c2ecf20Sopenharmony_ci#define SOFT_RESET_TA (1 << 12) 9958c2ecf20Sopenharmony_ci#define SOFT_RESET_VGT (1 << 14) 9968c2ecf20Sopenharmony_ci#define SOFT_RESET_IA (1 << 15) 9978c2ecf20Sopenharmony_ci 9988c2ecf20Sopenharmony_ci#define GRBM_GFX_INDEX 0x802C 9998c2ecf20Sopenharmony_ci#define INSTANCE_INDEX(x) ((x) << 0) 10008c2ecf20Sopenharmony_ci#define SH_INDEX(x) ((x) << 8) 10018c2ecf20Sopenharmony_ci#define SE_INDEX(x) ((x) << 16) 10028c2ecf20Sopenharmony_ci#define SH_BROADCAST_WRITES (1 << 29) 10038c2ecf20Sopenharmony_ci#define INSTANCE_BROADCAST_WRITES (1 << 30) 10048c2ecf20Sopenharmony_ci#define SE_BROADCAST_WRITES (1 << 31) 10058c2ecf20Sopenharmony_ci 10068c2ecf20Sopenharmony_ci#define GRBM_INT_CNTL 0x8060 10078c2ecf20Sopenharmony_ci# define RDERR_INT_ENABLE (1 << 0) 10088c2ecf20Sopenharmony_ci# define GUI_IDLE_INT_ENABLE (1 << 19) 10098c2ecf20Sopenharmony_ci 10108c2ecf20Sopenharmony_ci#define CP_STRMOUT_CNTL 0x84FC 10118c2ecf20Sopenharmony_ci#define SCRATCH_REG0 0x8500 10128c2ecf20Sopenharmony_ci#define SCRATCH_REG1 0x8504 10138c2ecf20Sopenharmony_ci#define SCRATCH_REG2 0x8508 10148c2ecf20Sopenharmony_ci#define SCRATCH_REG3 0x850C 10158c2ecf20Sopenharmony_ci#define SCRATCH_REG4 0x8510 10168c2ecf20Sopenharmony_ci#define SCRATCH_REG5 0x8514 10178c2ecf20Sopenharmony_ci#define SCRATCH_REG6 0x8518 10188c2ecf20Sopenharmony_ci#define SCRATCH_REG7 0x851C 10198c2ecf20Sopenharmony_ci 10208c2ecf20Sopenharmony_ci#define SCRATCH_UMSK 0x8540 10218c2ecf20Sopenharmony_ci#define SCRATCH_ADDR 0x8544 10228c2ecf20Sopenharmony_ci 10238c2ecf20Sopenharmony_ci#define CP_SEM_WAIT_TIMER 0x85BC 10248c2ecf20Sopenharmony_ci 10258c2ecf20Sopenharmony_ci#define CP_SEM_INCOMPLETE_TIMER_CNTL 0x85C8 10268c2ecf20Sopenharmony_ci 10278c2ecf20Sopenharmony_ci#define CP_ME_CNTL 0x86D8 10288c2ecf20Sopenharmony_ci#define CP_CE_HALT (1 << 24) 10298c2ecf20Sopenharmony_ci#define CP_PFP_HALT (1 << 26) 10308c2ecf20Sopenharmony_ci#define CP_ME_HALT (1 << 28) 10318c2ecf20Sopenharmony_ci 10328c2ecf20Sopenharmony_ci#define CP_COHER_CNTL2 0x85E8 10338c2ecf20Sopenharmony_ci 10348c2ecf20Sopenharmony_ci#define CP_RB2_RPTR 0x86f8 10358c2ecf20Sopenharmony_ci#define CP_RB1_RPTR 0x86fc 10368c2ecf20Sopenharmony_ci#define CP_RB0_RPTR 0x8700 10378c2ecf20Sopenharmony_ci#define CP_RB_WPTR_DELAY 0x8704 10388c2ecf20Sopenharmony_ci 10398c2ecf20Sopenharmony_ci#define CP_QUEUE_THRESHOLDS 0x8760 10408c2ecf20Sopenharmony_ci#define ROQ_IB1_START(x) ((x) << 0) 10418c2ecf20Sopenharmony_ci#define ROQ_IB2_START(x) ((x) << 8) 10428c2ecf20Sopenharmony_ci#define CP_MEQ_THRESHOLDS 0x8764 10438c2ecf20Sopenharmony_ci#define MEQ1_START(x) ((x) << 0) 10448c2ecf20Sopenharmony_ci#define MEQ2_START(x) ((x) << 8) 10458c2ecf20Sopenharmony_ci 10468c2ecf20Sopenharmony_ci#define CP_PERFMON_CNTL 0x87FC 10478c2ecf20Sopenharmony_ci 10488c2ecf20Sopenharmony_ci#define VGT_VTX_VECT_EJECT_REG 0x88B0 10498c2ecf20Sopenharmony_ci 10508c2ecf20Sopenharmony_ci#define VGT_CACHE_INVALIDATION 0x88C4 10518c2ecf20Sopenharmony_ci#define CACHE_INVALIDATION(x) ((x) << 0) 10528c2ecf20Sopenharmony_ci#define VC_ONLY 0 10538c2ecf20Sopenharmony_ci#define TC_ONLY 1 10548c2ecf20Sopenharmony_ci#define VC_AND_TC 2 10558c2ecf20Sopenharmony_ci#define AUTO_INVLD_EN(x) ((x) << 6) 10568c2ecf20Sopenharmony_ci#define NO_AUTO 0 10578c2ecf20Sopenharmony_ci#define ES_AUTO 1 10588c2ecf20Sopenharmony_ci#define GS_AUTO 2 10598c2ecf20Sopenharmony_ci#define ES_AND_GS_AUTO 3 10608c2ecf20Sopenharmony_ci#define VGT_ESGS_RING_SIZE 0x88C8 10618c2ecf20Sopenharmony_ci#define VGT_GSVS_RING_SIZE 0x88CC 10628c2ecf20Sopenharmony_ci 10638c2ecf20Sopenharmony_ci#define VGT_GS_VERTEX_REUSE 0x88D4 10648c2ecf20Sopenharmony_ci 10658c2ecf20Sopenharmony_ci#define VGT_PRIMITIVE_TYPE 0x8958 10668c2ecf20Sopenharmony_ci#define VGT_INDEX_TYPE 0x895C 10678c2ecf20Sopenharmony_ci 10688c2ecf20Sopenharmony_ci#define VGT_NUM_INDICES 0x8970 10698c2ecf20Sopenharmony_ci#define VGT_NUM_INSTANCES 0x8974 10708c2ecf20Sopenharmony_ci 10718c2ecf20Sopenharmony_ci#define VGT_TF_RING_SIZE 0x8988 10728c2ecf20Sopenharmony_ci 10738c2ecf20Sopenharmony_ci#define VGT_HS_OFFCHIP_PARAM 0x89B0 10748c2ecf20Sopenharmony_ci 10758c2ecf20Sopenharmony_ci#define VGT_TF_MEMORY_BASE 0x89B8 10768c2ecf20Sopenharmony_ci 10778c2ecf20Sopenharmony_ci#define CC_GC_SHADER_ARRAY_CONFIG 0x89bc 10788c2ecf20Sopenharmony_ci#define INACTIVE_CUS_MASK 0xFFFF0000 10798c2ecf20Sopenharmony_ci#define INACTIVE_CUS_SHIFT 16 10808c2ecf20Sopenharmony_ci#define GC_USER_SHADER_ARRAY_CONFIG 0x89c0 10818c2ecf20Sopenharmony_ci 10828c2ecf20Sopenharmony_ci#define PA_CL_ENHANCE 0x8A14 10838c2ecf20Sopenharmony_ci#define CLIP_VTX_REORDER_ENA (1 << 0) 10848c2ecf20Sopenharmony_ci#define NUM_CLIP_SEQ(x) ((x) << 1) 10858c2ecf20Sopenharmony_ci 10868c2ecf20Sopenharmony_ci#define PA_SU_LINE_STIPPLE_VALUE 0x8A60 10878c2ecf20Sopenharmony_ci 10888c2ecf20Sopenharmony_ci#define PA_SC_LINE_STIPPLE_STATE 0x8B10 10898c2ecf20Sopenharmony_ci 10908c2ecf20Sopenharmony_ci#define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24 10918c2ecf20Sopenharmony_ci#define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) 10928c2ecf20Sopenharmony_ci#define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) 10938c2ecf20Sopenharmony_ci 10948c2ecf20Sopenharmony_ci#define PA_SC_FIFO_SIZE 0x8BCC 10958c2ecf20Sopenharmony_ci#define SC_FRONTEND_PRIM_FIFO_SIZE(x) ((x) << 0) 10968c2ecf20Sopenharmony_ci#define SC_BACKEND_PRIM_FIFO_SIZE(x) ((x) << 6) 10978c2ecf20Sopenharmony_ci#define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 15) 10988c2ecf20Sopenharmony_ci#define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 23) 10998c2ecf20Sopenharmony_ci 11008c2ecf20Sopenharmony_ci#define PA_SC_ENHANCE 0x8BF0 11018c2ecf20Sopenharmony_ci 11028c2ecf20Sopenharmony_ci#define SQ_CONFIG 0x8C00 11038c2ecf20Sopenharmony_ci 11048c2ecf20Sopenharmony_ci#define SQC_CACHES 0x8C08 11058c2ecf20Sopenharmony_ci 11068c2ecf20Sopenharmony_ci#define SQ_POWER_THROTTLE 0x8e58 11078c2ecf20Sopenharmony_ci#define MIN_POWER(x) ((x) << 0) 11088c2ecf20Sopenharmony_ci#define MIN_POWER_MASK (0x3fff << 0) 11098c2ecf20Sopenharmony_ci#define MIN_POWER_SHIFT 0 11108c2ecf20Sopenharmony_ci#define MAX_POWER(x) ((x) << 16) 11118c2ecf20Sopenharmony_ci#define MAX_POWER_MASK (0x3fff << 16) 11128c2ecf20Sopenharmony_ci#define MAX_POWER_SHIFT 0 11138c2ecf20Sopenharmony_ci#define SQ_POWER_THROTTLE2 0x8e5c 11148c2ecf20Sopenharmony_ci#define MAX_POWER_DELTA(x) ((x) << 0) 11158c2ecf20Sopenharmony_ci#define MAX_POWER_DELTA_MASK (0x3fff << 0) 11168c2ecf20Sopenharmony_ci#define MAX_POWER_DELTA_SHIFT 0 11178c2ecf20Sopenharmony_ci#define STI_SIZE(x) ((x) << 16) 11188c2ecf20Sopenharmony_ci#define STI_SIZE_MASK (0x3ff << 16) 11198c2ecf20Sopenharmony_ci#define STI_SIZE_SHIFT 16 11208c2ecf20Sopenharmony_ci#define LTI_RATIO(x) ((x) << 27) 11218c2ecf20Sopenharmony_ci#define LTI_RATIO_MASK (0xf << 27) 11228c2ecf20Sopenharmony_ci#define LTI_RATIO_SHIFT 27 11238c2ecf20Sopenharmony_ci 11248c2ecf20Sopenharmony_ci#define SX_DEBUG_1 0x9060 11258c2ecf20Sopenharmony_ci 11268c2ecf20Sopenharmony_ci#define SPI_STATIC_THREAD_MGMT_1 0x90E0 11278c2ecf20Sopenharmony_ci#define SPI_STATIC_THREAD_MGMT_2 0x90E4 11288c2ecf20Sopenharmony_ci#define SPI_STATIC_THREAD_MGMT_3 0x90E8 11298c2ecf20Sopenharmony_ci#define SPI_PS_MAX_WAVE_ID 0x90EC 11308c2ecf20Sopenharmony_ci 11318c2ecf20Sopenharmony_ci#define SPI_CONFIG_CNTL 0x9100 11328c2ecf20Sopenharmony_ci 11338c2ecf20Sopenharmony_ci#define SPI_CONFIG_CNTL_1 0x913C 11348c2ecf20Sopenharmony_ci#define VTX_DONE_DELAY(x) ((x) << 0) 11358c2ecf20Sopenharmony_ci#define INTERP_ONE_PRIM_PER_ROW (1 << 4) 11368c2ecf20Sopenharmony_ci 11378c2ecf20Sopenharmony_ci#define CGTS_TCC_DISABLE 0x9148 11388c2ecf20Sopenharmony_ci#define CGTS_USER_TCC_DISABLE 0x914C 11398c2ecf20Sopenharmony_ci#define TCC_DISABLE_MASK 0xFFFF0000 11408c2ecf20Sopenharmony_ci#define TCC_DISABLE_SHIFT 16 11418c2ecf20Sopenharmony_ci#define CGTS_SM_CTRL_REG 0x9150 11428c2ecf20Sopenharmony_ci#define OVERRIDE (1 << 21) 11438c2ecf20Sopenharmony_ci#define LS_OVERRIDE (1 << 22) 11448c2ecf20Sopenharmony_ci 11458c2ecf20Sopenharmony_ci#define SPI_LB_CU_MASK 0x9354 11468c2ecf20Sopenharmony_ci 11478c2ecf20Sopenharmony_ci#define TA_CNTL_AUX 0x9508 11488c2ecf20Sopenharmony_ci#define TA_CS_BC_BASE_ADDR 0x950C 11498c2ecf20Sopenharmony_ci 11508c2ecf20Sopenharmony_ci#define CC_RB_BACKEND_DISABLE 0x98F4 11518c2ecf20Sopenharmony_ci#define BACKEND_DISABLE(x) ((x) << 16) 11528c2ecf20Sopenharmony_ci#define GB_ADDR_CONFIG 0x98F8 11538c2ecf20Sopenharmony_ci#define NUM_PIPES(x) ((x) << 0) 11548c2ecf20Sopenharmony_ci#define NUM_PIPES_MASK 0x00000007 11558c2ecf20Sopenharmony_ci#define NUM_PIPES_SHIFT 0 11568c2ecf20Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE(x) ((x) << 4) 11578c2ecf20Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE_MASK 0x00000070 11588c2ecf20Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE_SHIFT 4 11598c2ecf20Sopenharmony_ci#define NUM_SHADER_ENGINES(x) ((x) << 12) 11608c2ecf20Sopenharmony_ci#define NUM_SHADER_ENGINES_MASK 0x00003000 11618c2ecf20Sopenharmony_ci#define NUM_SHADER_ENGINES_SHIFT 12 11628c2ecf20Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16) 11638c2ecf20Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000 11648c2ecf20Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE_SHIFT 16 11658c2ecf20Sopenharmony_ci#define NUM_GPUS(x) ((x) << 20) 11668c2ecf20Sopenharmony_ci#define NUM_GPUS_MASK 0x00700000 11678c2ecf20Sopenharmony_ci#define NUM_GPUS_SHIFT 20 11688c2ecf20Sopenharmony_ci#define MULTI_GPU_TILE_SIZE(x) ((x) << 24) 11698c2ecf20Sopenharmony_ci#define MULTI_GPU_TILE_SIZE_MASK 0x03000000 11708c2ecf20Sopenharmony_ci#define MULTI_GPU_TILE_SIZE_SHIFT 24 11718c2ecf20Sopenharmony_ci#define ROW_SIZE(x) ((x) << 28) 11728c2ecf20Sopenharmony_ci#define ROW_SIZE_MASK 0x30000000 11738c2ecf20Sopenharmony_ci#define ROW_SIZE_SHIFT 28 11748c2ecf20Sopenharmony_ci 11758c2ecf20Sopenharmony_ci#define GB_TILE_MODE0 0x9910 11768c2ecf20Sopenharmony_ci# define MICRO_TILE_MODE(x) ((x) << 0) 11778c2ecf20Sopenharmony_ci# define ADDR_SURF_DISPLAY_MICRO_TILING 0 11788c2ecf20Sopenharmony_ci# define ADDR_SURF_THIN_MICRO_TILING 1 11798c2ecf20Sopenharmony_ci# define ADDR_SURF_DEPTH_MICRO_TILING 2 11808c2ecf20Sopenharmony_ci# define ARRAY_MODE(x) ((x) << 2) 11818c2ecf20Sopenharmony_ci# define ARRAY_LINEAR_GENERAL 0 11828c2ecf20Sopenharmony_ci# define ARRAY_LINEAR_ALIGNED 1 11838c2ecf20Sopenharmony_ci# define ARRAY_1D_TILED_THIN1 2 11848c2ecf20Sopenharmony_ci# define ARRAY_2D_TILED_THIN1 4 11858c2ecf20Sopenharmony_ci# define PIPE_CONFIG(x) ((x) << 6) 11868c2ecf20Sopenharmony_ci# define ADDR_SURF_P2 0 11878c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_8x16 4 11888c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_16x16 5 11898c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_16x32 6 11908c2ecf20Sopenharmony_ci# define ADDR_SURF_P4_32x32 7 11918c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_16x16_8x16 8 11928c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_16x32_8x16 9 11938c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x32_8x16 10 11948c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_16x32_16x16 11 11958c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x32_16x16 12 11968c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x32_16x32 13 11978c2ecf20Sopenharmony_ci# define ADDR_SURF_P8_32x64_32x32 14 11988c2ecf20Sopenharmony_ci# define TILE_SPLIT(x) ((x) << 11) 11998c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_64B 0 12008c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_128B 1 12018c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_256B 2 12028c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_512B 3 12038c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_1KB 4 12048c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_2KB 5 12058c2ecf20Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_4KB 6 12068c2ecf20Sopenharmony_ci# define BANK_WIDTH(x) ((x) << 14) 12078c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_1 0 12088c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_2 1 12098c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_4 2 12108c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_8 3 12118c2ecf20Sopenharmony_ci# define BANK_HEIGHT(x) ((x) << 16) 12128c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_1 0 12138c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_2 1 12148c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_4 2 12158c2ecf20Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_8 3 12168c2ecf20Sopenharmony_ci# define MACRO_TILE_ASPECT(x) ((x) << 18) 12178c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_1 0 12188c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_2 1 12198c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_4 2 12208c2ecf20Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_8 3 12218c2ecf20Sopenharmony_ci# define NUM_BANKS(x) ((x) << 20) 12228c2ecf20Sopenharmony_ci# define ADDR_SURF_2_BANK 0 12238c2ecf20Sopenharmony_ci# define ADDR_SURF_4_BANK 1 12248c2ecf20Sopenharmony_ci# define ADDR_SURF_8_BANK 2 12258c2ecf20Sopenharmony_ci# define ADDR_SURF_16_BANK 3 12268c2ecf20Sopenharmony_ci 12278c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER0_SELECT0 0x9a20 12288c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER0_SELECT1 0x9a24 12298c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER1_SELECT0 0x9a28 12308c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER1_SELECT1 0x9a2c 12318c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER2_SELECT0 0x9a30 12328c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER2_SELECT1 0x9a34 12338c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER3_SELECT0 0x9a38 12348c2ecf20Sopenharmony_ci#define CB_PERFCOUNTER3_SELECT1 0x9a3c 12358c2ecf20Sopenharmony_ci 12368c2ecf20Sopenharmony_ci#define CB_CGTT_SCLK_CTRL 0x9a60 12378c2ecf20Sopenharmony_ci 12388c2ecf20Sopenharmony_ci#define GC_USER_RB_BACKEND_DISABLE 0x9B7C 12398c2ecf20Sopenharmony_ci#define BACKEND_DISABLE_MASK 0x00FF0000 12408c2ecf20Sopenharmony_ci#define BACKEND_DISABLE_SHIFT 16 12418c2ecf20Sopenharmony_ci 12428c2ecf20Sopenharmony_ci#define TCP_CHAN_STEER_LO 0xac0c 12438c2ecf20Sopenharmony_ci#define TCP_CHAN_STEER_HI 0xac10 12448c2ecf20Sopenharmony_ci 12458c2ecf20Sopenharmony_ci#define CP_RB0_BASE 0xC100 12468c2ecf20Sopenharmony_ci#define CP_RB0_CNTL 0xC104 12478c2ecf20Sopenharmony_ci#define RB_BUFSZ(x) ((x) << 0) 12488c2ecf20Sopenharmony_ci#define RB_BLKSZ(x) ((x) << 8) 12498c2ecf20Sopenharmony_ci#define BUF_SWAP_32BIT (2 << 16) 12508c2ecf20Sopenharmony_ci#define RB_NO_UPDATE (1 << 27) 12518c2ecf20Sopenharmony_ci#define RB_RPTR_WR_ENA (1 << 31) 12528c2ecf20Sopenharmony_ci 12538c2ecf20Sopenharmony_ci#define CP_RB0_RPTR_ADDR 0xC10C 12548c2ecf20Sopenharmony_ci#define CP_RB0_RPTR_ADDR_HI 0xC110 12558c2ecf20Sopenharmony_ci#define CP_RB0_WPTR 0xC114 12568c2ecf20Sopenharmony_ci 12578c2ecf20Sopenharmony_ci#define CP_PFP_UCODE_ADDR 0xC150 12588c2ecf20Sopenharmony_ci#define CP_PFP_UCODE_DATA 0xC154 12598c2ecf20Sopenharmony_ci#define CP_ME_RAM_RADDR 0xC158 12608c2ecf20Sopenharmony_ci#define CP_ME_RAM_WADDR 0xC15C 12618c2ecf20Sopenharmony_ci#define CP_ME_RAM_DATA 0xC160 12628c2ecf20Sopenharmony_ci 12638c2ecf20Sopenharmony_ci#define CP_CE_UCODE_ADDR 0xC168 12648c2ecf20Sopenharmony_ci#define CP_CE_UCODE_DATA 0xC16C 12658c2ecf20Sopenharmony_ci 12668c2ecf20Sopenharmony_ci#define CP_RB1_BASE 0xC180 12678c2ecf20Sopenharmony_ci#define CP_RB1_CNTL 0xC184 12688c2ecf20Sopenharmony_ci#define CP_RB1_RPTR_ADDR 0xC188 12698c2ecf20Sopenharmony_ci#define CP_RB1_RPTR_ADDR_HI 0xC18C 12708c2ecf20Sopenharmony_ci#define CP_RB1_WPTR 0xC190 12718c2ecf20Sopenharmony_ci#define CP_RB2_BASE 0xC194 12728c2ecf20Sopenharmony_ci#define CP_RB2_CNTL 0xC198 12738c2ecf20Sopenharmony_ci#define CP_RB2_RPTR_ADDR 0xC19C 12748c2ecf20Sopenharmony_ci#define CP_RB2_RPTR_ADDR_HI 0xC1A0 12758c2ecf20Sopenharmony_ci#define CP_RB2_WPTR 0xC1A4 12768c2ecf20Sopenharmony_ci#define CP_INT_CNTL_RING0 0xC1A8 12778c2ecf20Sopenharmony_ci#define CP_INT_CNTL_RING1 0xC1AC 12788c2ecf20Sopenharmony_ci#define CP_INT_CNTL_RING2 0xC1B0 12798c2ecf20Sopenharmony_ci# define CNTX_BUSY_INT_ENABLE (1 << 19) 12808c2ecf20Sopenharmony_ci# define CNTX_EMPTY_INT_ENABLE (1 << 20) 12818c2ecf20Sopenharmony_ci# define WAIT_MEM_SEM_INT_ENABLE (1 << 21) 12828c2ecf20Sopenharmony_ci# define TIME_STAMP_INT_ENABLE (1 << 26) 12838c2ecf20Sopenharmony_ci# define CP_RINGID2_INT_ENABLE (1 << 29) 12848c2ecf20Sopenharmony_ci# define CP_RINGID1_INT_ENABLE (1 << 30) 12858c2ecf20Sopenharmony_ci# define CP_RINGID0_INT_ENABLE (1 << 31) 12868c2ecf20Sopenharmony_ci#define CP_INT_STATUS_RING0 0xC1B4 12878c2ecf20Sopenharmony_ci#define CP_INT_STATUS_RING1 0xC1B8 12888c2ecf20Sopenharmony_ci#define CP_INT_STATUS_RING2 0xC1BC 12898c2ecf20Sopenharmony_ci# define WAIT_MEM_SEM_INT_STAT (1 << 21) 12908c2ecf20Sopenharmony_ci# define TIME_STAMP_INT_STAT (1 << 26) 12918c2ecf20Sopenharmony_ci# define CP_RINGID2_INT_STAT (1 << 29) 12928c2ecf20Sopenharmony_ci# define CP_RINGID1_INT_STAT (1 << 30) 12938c2ecf20Sopenharmony_ci# define CP_RINGID0_INT_STAT (1 << 31) 12948c2ecf20Sopenharmony_ci 12958c2ecf20Sopenharmony_ci#define CP_MEM_SLP_CNTL 0xC1E4 12968c2ecf20Sopenharmony_ci# define CP_MEM_LS_EN (1 << 0) 12978c2ecf20Sopenharmony_ci 12988c2ecf20Sopenharmony_ci#define CP_DEBUG 0xC1FC 12998c2ecf20Sopenharmony_ci 13008c2ecf20Sopenharmony_ci#define RLC_CNTL 0xC300 13018c2ecf20Sopenharmony_ci# define RLC_ENABLE (1 << 0) 13028c2ecf20Sopenharmony_ci#define RLC_RL_BASE 0xC304 13038c2ecf20Sopenharmony_ci#define RLC_RL_SIZE 0xC308 13048c2ecf20Sopenharmony_ci#define RLC_LB_CNTL 0xC30C 13058c2ecf20Sopenharmony_ci# define LOAD_BALANCE_ENABLE (1 << 0) 13068c2ecf20Sopenharmony_ci#define RLC_SAVE_AND_RESTORE_BASE 0xC310 13078c2ecf20Sopenharmony_ci#define RLC_LB_CNTR_MAX 0xC314 13088c2ecf20Sopenharmony_ci#define RLC_LB_CNTR_INIT 0xC318 13098c2ecf20Sopenharmony_ci 13108c2ecf20Sopenharmony_ci#define RLC_CLEAR_STATE_RESTORE_BASE 0xC320 13118c2ecf20Sopenharmony_ci 13128c2ecf20Sopenharmony_ci#define RLC_UCODE_ADDR 0xC32C 13138c2ecf20Sopenharmony_ci#define RLC_UCODE_DATA 0xC330 13148c2ecf20Sopenharmony_ci 13158c2ecf20Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_LSB 0xC338 13168c2ecf20Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_MSB 0xC33C 13178c2ecf20Sopenharmony_ci#define RLC_CAPTURE_GPU_CLOCK_COUNT 0xC340 13188c2ecf20Sopenharmony_ci#define RLC_MC_CNTL 0xC344 13198c2ecf20Sopenharmony_ci#define RLC_UCODE_CNTL 0xC348 13208c2ecf20Sopenharmony_ci#define RLC_STAT 0xC34C 13218c2ecf20Sopenharmony_ci# define RLC_BUSY_STATUS (1 << 0) 13228c2ecf20Sopenharmony_ci# define GFX_POWER_STATUS (1 << 1) 13238c2ecf20Sopenharmony_ci# define GFX_CLOCK_STATUS (1 << 2) 13248c2ecf20Sopenharmony_ci# define GFX_LS_STATUS (1 << 3) 13258c2ecf20Sopenharmony_ci 13268c2ecf20Sopenharmony_ci#define RLC_PG_CNTL 0xC35C 13278c2ecf20Sopenharmony_ci# define GFX_PG_ENABLE (1 << 0) 13288c2ecf20Sopenharmony_ci# define GFX_PG_SRC (1 << 1) 13298c2ecf20Sopenharmony_ci 13308c2ecf20Sopenharmony_ci#define RLC_CGTT_MGCG_OVERRIDE 0xC400 13318c2ecf20Sopenharmony_ci#define RLC_CGCG_CGLS_CTRL 0xC404 13328c2ecf20Sopenharmony_ci# define CGCG_EN (1 << 0) 13338c2ecf20Sopenharmony_ci# define CGLS_EN (1 << 1) 13348c2ecf20Sopenharmony_ci 13358c2ecf20Sopenharmony_ci#define RLC_TTOP_D 0xC414 13368c2ecf20Sopenharmony_ci# define RLC_PUD(x) ((x) << 0) 13378c2ecf20Sopenharmony_ci# define RLC_PUD_MASK (0xff << 0) 13388c2ecf20Sopenharmony_ci# define RLC_PDD(x) ((x) << 8) 13398c2ecf20Sopenharmony_ci# define RLC_PDD_MASK (0xff << 8) 13408c2ecf20Sopenharmony_ci# define RLC_TTPD(x) ((x) << 16) 13418c2ecf20Sopenharmony_ci# define RLC_TTPD_MASK (0xff << 16) 13428c2ecf20Sopenharmony_ci# define RLC_MSD(x) ((x) << 24) 13438c2ecf20Sopenharmony_ci# define RLC_MSD_MASK (0xff << 24) 13448c2ecf20Sopenharmony_ci 13458c2ecf20Sopenharmony_ci#define RLC_LB_INIT_CU_MASK 0xC41C 13468c2ecf20Sopenharmony_ci 13478c2ecf20Sopenharmony_ci#define RLC_PG_AO_CU_MASK 0xC42C 13488c2ecf20Sopenharmony_ci#define RLC_MAX_PG_CU 0xC430 13498c2ecf20Sopenharmony_ci# define MAX_PU_CU(x) ((x) << 0) 13508c2ecf20Sopenharmony_ci# define MAX_PU_CU_MASK (0xff << 0) 13518c2ecf20Sopenharmony_ci#define RLC_AUTO_PG_CTRL 0xC434 13528c2ecf20Sopenharmony_ci# define AUTO_PG_EN (1 << 0) 13538c2ecf20Sopenharmony_ci# define GRBM_REG_SGIT(x) ((x) << 3) 13548c2ecf20Sopenharmony_ci# define GRBM_REG_SGIT_MASK (0xffff << 3) 13558c2ecf20Sopenharmony_ci# define PG_AFTER_GRBM_REG_ST(x) ((x) << 19) 13568c2ecf20Sopenharmony_ci# define PG_AFTER_GRBM_REG_ST_MASK (0x1fff << 19) 13578c2ecf20Sopenharmony_ci 13588c2ecf20Sopenharmony_ci#define RLC_SERDES_WR_MASTER_MASK_0 0xC454 13598c2ecf20Sopenharmony_ci#define RLC_SERDES_WR_MASTER_MASK_1 0xC458 13608c2ecf20Sopenharmony_ci#define RLC_SERDES_WR_CTRL 0xC45C 13618c2ecf20Sopenharmony_ci 13628c2ecf20Sopenharmony_ci#define RLC_SERDES_MASTER_BUSY_0 0xC464 13638c2ecf20Sopenharmony_ci#define RLC_SERDES_MASTER_BUSY_1 0xC468 13648c2ecf20Sopenharmony_ci 13658c2ecf20Sopenharmony_ci#define RLC_GCPM_GENERAL_3 0xC478 13668c2ecf20Sopenharmony_ci 13678c2ecf20Sopenharmony_ci#define DB_RENDER_CONTROL 0x28000 13688c2ecf20Sopenharmony_ci 13698c2ecf20Sopenharmony_ci#define DB_DEPTH_INFO 0x2803c 13708c2ecf20Sopenharmony_ci 13718c2ecf20Sopenharmony_ci#define PA_SC_RASTER_CONFIG 0x28350 13728c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_0 0 13738c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_1 1 13748c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_2 2 13758c2ecf20Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_3 3 13768c2ecf20Sopenharmony_ci 13778c2ecf20Sopenharmony_ci#define VGT_EVENT_INITIATOR 0x28a90 13788c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS1 (1 << 0) 13798c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS2 (2 << 0) 13808c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS3 (3 << 0) 13818c2ecf20Sopenharmony_ci# define CACHE_FLUSH_TS (4 << 0) 13828c2ecf20Sopenharmony_ci# define CACHE_FLUSH (6 << 0) 13838c2ecf20Sopenharmony_ci# define CS_PARTIAL_FLUSH (7 << 0) 13848c2ecf20Sopenharmony_ci# define VGT_STREAMOUT_RESET (10 << 0) 13858c2ecf20Sopenharmony_ci# define END_OF_PIPE_INCR_DE (11 << 0) 13868c2ecf20Sopenharmony_ci# define END_OF_PIPE_IB_END (12 << 0) 13878c2ecf20Sopenharmony_ci# define RST_PIX_CNT (13 << 0) 13888c2ecf20Sopenharmony_ci# define VS_PARTIAL_FLUSH (15 << 0) 13898c2ecf20Sopenharmony_ci# define PS_PARTIAL_FLUSH (16 << 0) 13908c2ecf20Sopenharmony_ci# define CACHE_FLUSH_AND_INV_TS_EVENT (20 << 0) 13918c2ecf20Sopenharmony_ci# define ZPASS_DONE (21 << 0) 13928c2ecf20Sopenharmony_ci# define CACHE_FLUSH_AND_INV_EVENT (22 << 0) 13938c2ecf20Sopenharmony_ci# define PERFCOUNTER_START (23 << 0) 13948c2ecf20Sopenharmony_ci# define PERFCOUNTER_STOP (24 << 0) 13958c2ecf20Sopenharmony_ci# define PIPELINESTAT_START (25 << 0) 13968c2ecf20Sopenharmony_ci# define PIPELINESTAT_STOP (26 << 0) 13978c2ecf20Sopenharmony_ci# define PERFCOUNTER_SAMPLE (27 << 0) 13988c2ecf20Sopenharmony_ci# define SAMPLE_PIPELINESTAT (30 << 0) 13998c2ecf20Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS (32 << 0) 14008c2ecf20Sopenharmony_ci# define RESET_VTX_CNT (33 << 0) 14018c2ecf20Sopenharmony_ci# define VGT_FLUSH (36 << 0) 14028c2ecf20Sopenharmony_ci# define BOTTOM_OF_PIPE_TS (40 << 0) 14038c2ecf20Sopenharmony_ci# define DB_CACHE_FLUSH_AND_INV (42 << 0) 14048c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_DB_DATA_TS (43 << 0) 14058c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_DB_META (44 << 0) 14068c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_CB_DATA_TS (45 << 0) 14078c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_CB_META (46 << 0) 14088c2ecf20Sopenharmony_ci# define CS_DONE (47 << 0) 14098c2ecf20Sopenharmony_ci# define PS_DONE (48 << 0) 14108c2ecf20Sopenharmony_ci# define FLUSH_AND_INV_CB_PIXEL_DATA (49 << 0) 14118c2ecf20Sopenharmony_ci# define THREAD_TRACE_START (51 << 0) 14128c2ecf20Sopenharmony_ci# define THREAD_TRACE_STOP (52 << 0) 14138c2ecf20Sopenharmony_ci# define THREAD_TRACE_FLUSH (54 << 0) 14148c2ecf20Sopenharmony_ci# define THREAD_TRACE_FINISH (55 << 0) 14158c2ecf20Sopenharmony_ci 14168c2ecf20Sopenharmony_ci/* PIF PHY0 registers idx/data 0x8/0xc */ 14178c2ecf20Sopenharmony_ci#define PB0_PIF_CNTL 0x10 14188c2ecf20Sopenharmony_ci# define LS2_EXIT_TIME(x) ((x) << 17) 14198c2ecf20Sopenharmony_ci# define LS2_EXIT_TIME_MASK (0x7 << 17) 14208c2ecf20Sopenharmony_ci# define LS2_EXIT_TIME_SHIFT 17 14218c2ecf20Sopenharmony_ci#define PB0_PIF_PAIRING 0x11 14228c2ecf20Sopenharmony_ci# define MULTI_PIF (1 << 25) 14238c2ecf20Sopenharmony_ci#define PB0_PIF_PWRDOWN_0 0x12 14248c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0(x) ((x) << 7) 14258c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0_MASK (0x7 << 7) 14268c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0_SHIFT 7 14278c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0(x) ((x) << 10) 14288c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0_MASK (0x7 << 10) 14298c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0_SHIFT 10 14308c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_0(x) ((x) << 24) 14318c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_0_MASK (0x7 << 24) 14328c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_0_SHIFT 24 14338c2ecf20Sopenharmony_ci#define PB0_PIF_PWRDOWN_1 0x13 14348c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1(x) ((x) << 7) 14358c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1_MASK (0x7 << 7) 14368c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1_SHIFT 7 14378c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1(x) ((x) << 10) 14388c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1_MASK (0x7 << 10) 14398c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1_SHIFT 10 14408c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_1(x) ((x) << 24) 14418c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_1_MASK (0x7 << 24) 14428c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_1_SHIFT 24 14438c2ecf20Sopenharmony_ci 14448c2ecf20Sopenharmony_ci#define PB0_PIF_PWRDOWN_2 0x17 14458c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_2(x) ((x) << 7) 14468c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_2_MASK (0x7 << 7) 14478c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_2_SHIFT 7 14488c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_2(x) ((x) << 10) 14498c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_2_MASK (0x7 << 10) 14508c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_2_SHIFT 10 14518c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_2(x) ((x) << 24) 14528c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_2_MASK (0x7 << 24) 14538c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_2_SHIFT 24 14548c2ecf20Sopenharmony_ci#define PB0_PIF_PWRDOWN_3 0x18 14558c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_3(x) ((x) << 7) 14568c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_3_MASK (0x7 << 7) 14578c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_3_SHIFT 7 14588c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_3(x) ((x) << 10) 14598c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_3_MASK (0x7 << 10) 14608c2ecf20Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_3_SHIFT 10 14618c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_3(x) ((x) << 24) 14628c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_3_MASK (0x7 << 24) 14638c2ecf20Sopenharmony_ci# define PLL_RAMP_UP_TIME_3_SHIFT 24 14648c2ecf20Sopenharmony_ci/* PIF PHY1 registers idx/data 0x10/0x14 */ 14658c2ecf20Sopenharmony_ci#define PB1_PIF_CNTL 0x10 14668c2ecf20Sopenharmony_ci#define PB1_PIF_PAIRING 0x11 14678c2ecf20Sopenharmony_ci#define PB1_PIF_PWRDOWN_0 0x12 14688c2ecf20Sopenharmony_ci#define PB1_PIF_PWRDOWN_1 0x13 14698c2ecf20Sopenharmony_ci 14708c2ecf20Sopenharmony_ci#define PB1_PIF_PWRDOWN_2 0x17 14718c2ecf20Sopenharmony_ci#define PB1_PIF_PWRDOWN_3 0x18 14728c2ecf20Sopenharmony_ci/* PCIE registers idx/data 0x30/0x34 */ 14738c2ecf20Sopenharmony_ci#define PCIE_CNTL2 0x1c /* PCIE */ 14748c2ecf20Sopenharmony_ci# define SLV_MEM_LS_EN (1 << 16) 14758c2ecf20Sopenharmony_ci# define SLV_MEM_AGGRESSIVE_LS_EN (1 << 17) 14768c2ecf20Sopenharmony_ci# define MST_MEM_LS_EN (1 << 18) 14778c2ecf20Sopenharmony_ci# define REPLAY_MEM_LS_EN (1 << 19) 14788c2ecf20Sopenharmony_ci#define PCIE_LC_STATUS1 0x28 /* PCIE */ 14798c2ecf20Sopenharmony_ci# define LC_REVERSE_RCVR (1 << 0) 14808c2ecf20Sopenharmony_ci# define LC_REVERSE_XMIT (1 << 1) 14818c2ecf20Sopenharmony_ci# define LC_OPERATING_LINK_WIDTH_MASK (0x7 << 2) 14828c2ecf20Sopenharmony_ci# define LC_OPERATING_LINK_WIDTH_SHIFT 2 14838c2ecf20Sopenharmony_ci# define LC_DETECTED_LINK_WIDTH_MASK (0x7 << 5) 14848c2ecf20Sopenharmony_ci# define LC_DETECTED_LINK_WIDTH_SHIFT 5 14858c2ecf20Sopenharmony_ci 14868c2ecf20Sopenharmony_ci#define PCIE_P_CNTL 0x40 /* PCIE */ 14878c2ecf20Sopenharmony_ci# define P_IGNORE_EDB_ERR (1 << 6) 14888c2ecf20Sopenharmony_ci 14898c2ecf20Sopenharmony_ci/* PCIE PORT registers idx/data 0x38/0x3c */ 14908c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL 0xa0 14918c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY(x) ((x) << 8) 14928c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY_MASK (0xf << 8) 14938c2ecf20Sopenharmony_ci# define LC_L0S_INACTIVITY_SHIFT 8 14948c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY(x) ((x) << 12) 14958c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY_MASK (0xf << 12) 14968c2ecf20Sopenharmony_ci# define LC_L1_INACTIVITY_SHIFT 12 14978c2ecf20Sopenharmony_ci# define LC_PMI_TO_L1_DIS (1 << 16) 14988c2ecf20Sopenharmony_ci# define LC_ASPM_TO_L1_DIS (1 << 24) 14998c2ecf20Sopenharmony_ci#define PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE_P */ 15008c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_SHIFT 0 15018c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_MASK 0x7 15028c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X0 0 15038c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X1 1 15048c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X2 2 15058c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X4 3 15068c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X8 4 15078c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_X16 6 15088c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_RD_SHIFT 4 15098c2ecf20Sopenharmony_ci# define LC_LINK_WIDTH_RD_MASK 0x70 15108c2ecf20Sopenharmony_ci# define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) 15118c2ecf20Sopenharmony_ci# define LC_RECONFIG_NOW (1 << 8) 15128c2ecf20Sopenharmony_ci# define LC_RENEGOTIATION_SUPPORT (1 << 9) 15138c2ecf20Sopenharmony_ci# define LC_RENEGOTIATE_EN (1 << 10) 15148c2ecf20Sopenharmony_ci# define LC_SHORT_RECONFIG_EN (1 << 11) 15158c2ecf20Sopenharmony_ci# define LC_UPCONFIGURE_SUPPORT (1 << 12) 15168c2ecf20Sopenharmony_ci# define LC_UPCONFIGURE_DIS (1 << 13) 15178c2ecf20Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE(x) ((x) << 21) 15188c2ecf20Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE_MASK (0x3 << 21) 15198c2ecf20Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE_SHIFT 21 15208c2ecf20Sopenharmony_ci#define PCIE_LC_N_FTS_CNTL 0xa3 /* PCIE_P */ 15218c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS(x) ((x) << 0) 15228c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS_MASK (0xff << 0) 15238c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS_SHIFT 0 15248c2ecf20Sopenharmony_ci# define LC_XMIT_N_FTS_OVERRIDE_EN (1 << 8) 15258c2ecf20Sopenharmony_ci# define LC_N_FTS_MASK (0xff << 24) 15268c2ecf20Sopenharmony_ci#define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */ 15278c2ecf20Sopenharmony_ci# define LC_GEN2_EN_STRAP (1 << 0) 15288c2ecf20Sopenharmony_ci# define LC_GEN3_EN_STRAP (1 << 1) 15298c2ecf20Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 2) 15308c2ecf20Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_MASK (0x3 << 3) 15318c2ecf20Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_SHIFT 3 15328c2ecf20Sopenharmony_ci# define LC_FORCE_EN_SW_SPEED_CHANGE (1 << 5) 15338c2ecf20Sopenharmony_ci# define LC_FORCE_DIS_SW_SPEED_CHANGE (1 << 6) 15348c2ecf20Sopenharmony_ci# define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 7) 15358c2ecf20Sopenharmony_ci# define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 8) 15368c2ecf20Sopenharmony_ci# define LC_INITIATE_LINK_SPEED_CHANGE (1 << 9) 15378c2ecf20Sopenharmony_ci# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 10) 15388c2ecf20Sopenharmony_ci# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 10 15398c2ecf20Sopenharmony_ci# define LC_CURRENT_DATA_RATE_MASK (0x3 << 13) /* 0/1/2 = gen1/2/3 */ 15408c2ecf20Sopenharmony_ci# define LC_CURRENT_DATA_RATE_SHIFT 13 15418c2ecf20Sopenharmony_ci# define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 16) 15428c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 18) 15438c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 19) 15448c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN3 (1 << 20) 15458c2ecf20Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN3 (1 << 21) 15468c2ecf20Sopenharmony_ci 15478c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL2 0xb1 15488c2ecf20Sopenharmony_ci# define LC_ALLOW_PDWN_IN_L1 (1 << 17) 15498c2ecf20Sopenharmony_ci# define LC_ALLOW_PDWN_IN_L23 (1 << 18) 15508c2ecf20Sopenharmony_ci 15518c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL3 0xb5 /* PCIE_P */ 15528c2ecf20Sopenharmony_ci# define LC_GO_TO_RECOVERY (1 << 30) 15538c2ecf20Sopenharmony_ci#define PCIE_LC_CNTL4 0xb6 /* PCIE_P */ 15548c2ecf20Sopenharmony_ci# define LC_REDO_EQ (1 << 5) 15558c2ecf20Sopenharmony_ci# define LC_SET_QUIESCE (1 << 13) 15568c2ecf20Sopenharmony_ci 15578c2ecf20Sopenharmony_ci/* 15588c2ecf20Sopenharmony_ci * UVD 15598c2ecf20Sopenharmony_ci */ 15608c2ecf20Sopenharmony_ci#define UVD_UDEC_ADDR_CONFIG 0xEF4C 15618c2ecf20Sopenharmony_ci#define UVD_UDEC_DB_ADDR_CONFIG 0xEF50 15628c2ecf20Sopenharmony_ci#define UVD_UDEC_DBW_ADDR_CONFIG 0xEF54 15638c2ecf20Sopenharmony_ci#define UVD_NO_OP 0xEFFC 15648c2ecf20Sopenharmony_ci#define UVD_RBC_RB_RPTR 0xF690 15658c2ecf20Sopenharmony_ci#define UVD_RBC_RB_WPTR 0xF694 15668c2ecf20Sopenharmony_ci#define UVD_STATUS 0xf6bc 15678c2ecf20Sopenharmony_ci 15688c2ecf20Sopenharmony_ci#define UVD_CGC_CTRL 0xF4B0 15698c2ecf20Sopenharmony_ci# define DCM (1 << 0) 15708c2ecf20Sopenharmony_ci# define CG_DT(x) ((x) << 2) 15718c2ecf20Sopenharmony_ci# define CG_DT_MASK (0xf << 2) 15728c2ecf20Sopenharmony_ci# define CLK_OD(x) ((x) << 6) 15738c2ecf20Sopenharmony_ci# define CLK_OD_MASK (0x1f << 6) 15748c2ecf20Sopenharmony_ci 15758c2ecf20Sopenharmony_ci /* UVD CTX indirect */ 15768c2ecf20Sopenharmony_ci#define UVD_CGC_MEM_CTRL 0xC0 15778c2ecf20Sopenharmony_ci#define UVD_CGC_CTRL2 0xC1 15788c2ecf20Sopenharmony_ci# define DYN_OR_EN (1 << 0) 15798c2ecf20Sopenharmony_ci# define DYN_RR_EN (1 << 1) 15808c2ecf20Sopenharmony_ci# define G_DIV_ID(x) ((x) << 2) 15818c2ecf20Sopenharmony_ci# define G_DIV_ID_MASK (0x7 << 2) 15828c2ecf20Sopenharmony_ci 15838c2ecf20Sopenharmony_ci/* 15848c2ecf20Sopenharmony_ci * PM4 15858c2ecf20Sopenharmony_ci */ 15868c2ecf20Sopenharmony_ci#define PACKET0(reg, n) ((RADEON_PACKET_TYPE0 << 30) | \ 15878c2ecf20Sopenharmony_ci (((reg) >> 2) & 0xFFFF) | \ 15888c2ecf20Sopenharmony_ci ((n) & 0x3FFF) << 16) 15898c2ecf20Sopenharmony_ci#define CP_PACKET2 0x80000000 15908c2ecf20Sopenharmony_ci#define PACKET2_PAD_SHIFT 0 15918c2ecf20Sopenharmony_ci#define PACKET2_PAD_MASK (0x3fffffff << 0) 15928c2ecf20Sopenharmony_ci 15938c2ecf20Sopenharmony_ci#define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) 15948c2ecf20Sopenharmony_ci 15958c2ecf20Sopenharmony_ci#define PACKET3(op, n) ((RADEON_PACKET_TYPE3 << 30) | \ 15968c2ecf20Sopenharmony_ci (((op) & 0xFF) << 8) | \ 15978c2ecf20Sopenharmony_ci ((n) & 0x3FFF) << 16) 15988c2ecf20Sopenharmony_ci 15998c2ecf20Sopenharmony_ci#define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1) 16008c2ecf20Sopenharmony_ci 16018c2ecf20Sopenharmony_ci/* Packet 3 types */ 16028c2ecf20Sopenharmony_ci#define PACKET3_NOP 0x10 16038c2ecf20Sopenharmony_ci#define PACKET3_SET_BASE 0x11 16048c2ecf20Sopenharmony_ci#define PACKET3_BASE_INDEX(x) ((x) << 0) 16058c2ecf20Sopenharmony_ci#define GDS_PARTITION_BASE 2 16068c2ecf20Sopenharmony_ci#define CE_PARTITION_BASE 3 16078c2ecf20Sopenharmony_ci#define PACKET3_CLEAR_STATE 0x12 16088c2ecf20Sopenharmony_ci#define PACKET3_INDEX_BUFFER_SIZE 0x13 16098c2ecf20Sopenharmony_ci#define PACKET3_DISPATCH_DIRECT 0x15 16108c2ecf20Sopenharmony_ci#define PACKET3_DISPATCH_INDIRECT 0x16 16118c2ecf20Sopenharmony_ci#define PACKET3_ALLOC_GDS 0x1B 16128c2ecf20Sopenharmony_ci#define PACKET3_WRITE_GDS_RAM 0x1C 16138c2ecf20Sopenharmony_ci#define PACKET3_ATOMIC_GDS 0x1D 16148c2ecf20Sopenharmony_ci#define PACKET3_ATOMIC 0x1E 16158c2ecf20Sopenharmony_ci#define PACKET3_OCCLUSION_QUERY 0x1F 16168c2ecf20Sopenharmony_ci#define PACKET3_SET_PREDICATION 0x20 16178c2ecf20Sopenharmony_ci#define PACKET3_REG_RMW 0x21 16188c2ecf20Sopenharmony_ci#define PACKET3_COND_EXEC 0x22 16198c2ecf20Sopenharmony_ci#define PACKET3_PRED_EXEC 0x23 16208c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDIRECT 0x24 16218c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_INDIRECT 0x25 16228c2ecf20Sopenharmony_ci#define PACKET3_INDEX_BASE 0x26 16238c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_2 0x27 16248c2ecf20Sopenharmony_ci#define PACKET3_CONTEXT_CONTROL 0x28 16258c2ecf20Sopenharmony_ci#define PACKET3_INDEX_TYPE 0x2A 16268c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDIRECT_MULTI 0x2C 16278c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_AUTO 0x2D 16288c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_IMMD 0x2E 16298c2ecf20Sopenharmony_ci#define PACKET3_NUM_INSTANCES 0x2F 16308c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 16318c2ecf20Sopenharmony_ci#define PACKET3_INDIRECT_BUFFER_CONST 0x31 16328c2ecf20Sopenharmony_ci#define PACKET3_INDIRECT_BUFFER 0x32 16338c2ecf20Sopenharmony_ci#define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 16348c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_OFFSET_2 0x35 16358c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_MULTI_ELEMENT 0x36 16368c2ecf20Sopenharmony_ci#define PACKET3_WRITE_DATA 0x37 16378c2ecf20Sopenharmony_ci#define WRITE_DATA_DST_SEL(x) ((x) << 8) 16388c2ecf20Sopenharmony_ci /* 0 - register 16398c2ecf20Sopenharmony_ci * 1 - memory (sync - via GRBM) 16408c2ecf20Sopenharmony_ci * 2 - tc/l2 16418c2ecf20Sopenharmony_ci * 3 - gds 16428c2ecf20Sopenharmony_ci * 4 - reserved 16438c2ecf20Sopenharmony_ci * 5 - memory (async - direct) 16448c2ecf20Sopenharmony_ci */ 16458c2ecf20Sopenharmony_ci#define WR_ONE_ADDR (1 << 16) 16468c2ecf20Sopenharmony_ci#define WR_CONFIRM (1 << 20) 16478c2ecf20Sopenharmony_ci#define WRITE_DATA_ENGINE_SEL(x) ((x) << 30) 16488c2ecf20Sopenharmony_ci /* 0 - me 16498c2ecf20Sopenharmony_ci * 1 - pfp 16508c2ecf20Sopenharmony_ci * 2 - ce 16518c2ecf20Sopenharmony_ci */ 16528c2ecf20Sopenharmony_ci#define PACKET3_DRAW_INDEX_INDIRECT_MULTI 0x38 16538c2ecf20Sopenharmony_ci#define PACKET3_MEM_SEMAPHORE 0x39 16548c2ecf20Sopenharmony_ci#define PACKET3_MPEG_INDEX 0x3A 16558c2ecf20Sopenharmony_ci#define PACKET3_COPY_DW 0x3B 16568c2ecf20Sopenharmony_ci#define PACKET3_WAIT_REG_MEM 0x3C 16578c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) 16588c2ecf20Sopenharmony_ci /* 0 - always 16598c2ecf20Sopenharmony_ci * 1 - < 16608c2ecf20Sopenharmony_ci * 2 - <= 16618c2ecf20Sopenharmony_ci * 3 - == 16628c2ecf20Sopenharmony_ci * 4 - != 16638c2ecf20Sopenharmony_ci * 5 - >= 16648c2ecf20Sopenharmony_ci * 6 - > 16658c2ecf20Sopenharmony_ci */ 16668c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) 16678c2ecf20Sopenharmony_ci /* 0 - reg 16688c2ecf20Sopenharmony_ci * 1 - mem 16698c2ecf20Sopenharmony_ci */ 16708c2ecf20Sopenharmony_ci#define WAIT_REG_MEM_ENGINE(x) ((x) << 8) 16718c2ecf20Sopenharmony_ci /* 0 - me 16728c2ecf20Sopenharmony_ci * 1 - pfp 16738c2ecf20Sopenharmony_ci */ 16748c2ecf20Sopenharmony_ci#define PACKET3_MEM_WRITE 0x3D 16758c2ecf20Sopenharmony_ci#define PACKET3_COPY_DATA 0x40 16768c2ecf20Sopenharmony_ci#define PACKET3_CP_DMA 0x41 16778c2ecf20Sopenharmony_ci/* 1. header 16788c2ecf20Sopenharmony_ci * 2. SRC_ADDR_LO or DATA [31:0] 16798c2ecf20Sopenharmony_ci * 3. CP_SYNC [31] | SRC_SEL [30:29] | ENGINE [27] | DST_SEL [21:20] | 16808c2ecf20Sopenharmony_ci * SRC_ADDR_HI [7:0] 16818c2ecf20Sopenharmony_ci * 4. DST_ADDR_LO [31:0] 16828c2ecf20Sopenharmony_ci * 5. DST_ADDR_HI [7:0] 16838c2ecf20Sopenharmony_ci * 6. COMMAND [30:21] | BYTE_COUNT [20:0] 16848c2ecf20Sopenharmony_ci */ 16858c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) 16868c2ecf20Sopenharmony_ci /* 0 - DST_ADDR 16878c2ecf20Sopenharmony_ci * 1 - GDS 16888c2ecf20Sopenharmony_ci */ 16898c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) 16908c2ecf20Sopenharmony_ci /* 0 - ME 16918c2ecf20Sopenharmony_ci * 1 - PFP 16928c2ecf20Sopenharmony_ci */ 16938c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_SRC_SEL(x) ((x) << 29) 16948c2ecf20Sopenharmony_ci /* 0 - SRC_ADDR 16958c2ecf20Sopenharmony_ci * 1 - GDS 16968c2ecf20Sopenharmony_ci * 2 - DATA 16978c2ecf20Sopenharmony_ci */ 16988c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CP_SYNC (1 << 31) 16998c2ecf20Sopenharmony_ci/* COMMAND */ 17008c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_DIS_WC (1 << 21) 17018c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22) 17028c2ecf20Sopenharmony_ci /* 0 - none 17038c2ecf20Sopenharmony_ci * 1 - 8 in 16 17048c2ecf20Sopenharmony_ci * 2 - 8 in 32 17058c2ecf20Sopenharmony_ci * 3 - 8 in 64 17068c2ecf20Sopenharmony_ci */ 17078c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24) 17088c2ecf20Sopenharmony_ci /* 0 - none 17098c2ecf20Sopenharmony_ci * 1 - 8 in 16 17108c2ecf20Sopenharmony_ci * 2 - 8 in 32 17118c2ecf20Sopenharmony_ci * 3 - 8 in 64 17128c2ecf20Sopenharmony_ci */ 17138c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_SAS (1 << 26) 17148c2ecf20Sopenharmony_ci /* 0 - memory 17158c2ecf20Sopenharmony_ci * 1 - register 17168c2ecf20Sopenharmony_ci */ 17178c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_DAS (1 << 27) 17188c2ecf20Sopenharmony_ci /* 0 - memory 17198c2ecf20Sopenharmony_ci * 1 - register 17208c2ecf20Sopenharmony_ci */ 17218c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_SAIC (1 << 28) 17228c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_DAIC (1 << 29) 17238c2ecf20Sopenharmony_ci# define PACKET3_CP_DMA_CMD_RAW_WAIT (1 << 30) 17248c2ecf20Sopenharmony_ci#define PACKET3_PFP_SYNC_ME 0x42 17258c2ecf20Sopenharmony_ci#define PACKET3_SURFACE_SYNC 0x43 17268c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_0_ENA (1 << 0) 17278c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_1_ENA (1 << 1) 17288c2ecf20Sopenharmony_ci# define PACKET3_CB0_DEST_BASE_ENA (1 << 6) 17298c2ecf20Sopenharmony_ci# define PACKET3_CB1_DEST_BASE_ENA (1 << 7) 17308c2ecf20Sopenharmony_ci# define PACKET3_CB2_DEST_BASE_ENA (1 << 8) 17318c2ecf20Sopenharmony_ci# define PACKET3_CB3_DEST_BASE_ENA (1 << 9) 17328c2ecf20Sopenharmony_ci# define PACKET3_CB4_DEST_BASE_ENA (1 << 10) 17338c2ecf20Sopenharmony_ci# define PACKET3_CB5_DEST_BASE_ENA (1 << 11) 17348c2ecf20Sopenharmony_ci# define PACKET3_CB6_DEST_BASE_ENA (1 << 12) 17358c2ecf20Sopenharmony_ci# define PACKET3_CB7_DEST_BASE_ENA (1 << 13) 17368c2ecf20Sopenharmony_ci# define PACKET3_DB_DEST_BASE_ENA (1 << 14) 17378c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_2_ENA (1 << 19) 17388c2ecf20Sopenharmony_ci# define PACKET3_DEST_BASE_3_ENA (1 << 21) 17398c2ecf20Sopenharmony_ci# define PACKET3_TCL1_ACTION_ENA (1 << 22) 17408c2ecf20Sopenharmony_ci# define PACKET3_TC_ACTION_ENA (1 << 23) 17418c2ecf20Sopenharmony_ci# define PACKET3_CB_ACTION_ENA (1 << 25) 17428c2ecf20Sopenharmony_ci# define PACKET3_DB_ACTION_ENA (1 << 26) 17438c2ecf20Sopenharmony_ci# define PACKET3_SH_KCACHE_ACTION_ENA (1 << 27) 17448c2ecf20Sopenharmony_ci# define PACKET3_SH_ICACHE_ACTION_ENA (1 << 29) 17458c2ecf20Sopenharmony_ci#define PACKET3_ME_INITIALIZE 0x44 17468c2ecf20Sopenharmony_ci#define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16) 17478c2ecf20Sopenharmony_ci#define PACKET3_COND_WRITE 0x45 17488c2ecf20Sopenharmony_ci#define PACKET3_EVENT_WRITE 0x46 17498c2ecf20Sopenharmony_ci#define EVENT_TYPE(x) ((x) << 0) 17508c2ecf20Sopenharmony_ci#define EVENT_INDEX(x) ((x) << 8) 17518c2ecf20Sopenharmony_ci /* 0 - any non-TS event 17528c2ecf20Sopenharmony_ci * 1 - ZPASS_DONE 17538c2ecf20Sopenharmony_ci * 2 - SAMPLE_PIPELINESTAT 17548c2ecf20Sopenharmony_ci * 3 - SAMPLE_STREAMOUTSTAT* 17558c2ecf20Sopenharmony_ci * 4 - *S_PARTIAL_FLUSH 17568c2ecf20Sopenharmony_ci * 5 - EOP events 17578c2ecf20Sopenharmony_ci * 6 - EOS events 17588c2ecf20Sopenharmony_ci * 7 - CACHE_FLUSH, CACHE_FLUSH_AND_INV_EVENT 17598c2ecf20Sopenharmony_ci */ 17608c2ecf20Sopenharmony_ci#define INV_L2 (1 << 20) 17618c2ecf20Sopenharmony_ci /* INV TC L2 cache when EVENT_INDEX = 7 */ 17628c2ecf20Sopenharmony_ci#define PACKET3_EVENT_WRITE_EOP 0x47 17638c2ecf20Sopenharmony_ci#define DATA_SEL(x) ((x) << 29) 17648c2ecf20Sopenharmony_ci /* 0 - discard 17658c2ecf20Sopenharmony_ci * 1 - send low 32bit data 17668c2ecf20Sopenharmony_ci * 2 - send 64bit data 17678c2ecf20Sopenharmony_ci * 3 - send 64bit counter value 17688c2ecf20Sopenharmony_ci */ 17698c2ecf20Sopenharmony_ci#define INT_SEL(x) ((x) << 24) 17708c2ecf20Sopenharmony_ci /* 0 - none 17718c2ecf20Sopenharmony_ci * 1 - interrupt only (DATA_SEL = 0) 17728c2ecf20Sopenharmony_ci * 2 - interrupt when data write is confirmed 17738c2ecf20Sopenharmony_ci */ 17748c2ecf20Sopenharmony_ci#define PACKET3_EVENT_WRITE_EOS 0x48 17758c2ecf20Sopenharmony_ci#define PACKET3_PREAMBLE_CNTL 0x4A 17768c2ecf20Sopenharmony_ci# define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) 17778c2ecf20Sopenharmony_ci# define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) 17788c2ecf20Sopenharmony_ci#define PACKET3_ONE_REG_WRITE 0x57 17798c2ecf20Sopenharmony_ci#define PACKET3_LOAD_CONFIG_REG 0x5F 17808c2ecf20Sopenharmony_ci#define PACKET3_LOAD_CONTEXT_REG 0x60 17818c2ecf20Sopenharmony_ci#define PACKET3_LOAD_SH_REG 0x61 17828c2ecf20Sopenharmony_ci#define PACKET3_SET_CONFIG_REG 0x68 17838c2ecf20Sopenharmony_ci#define PACKET3_SET_CONFIG_REG_START 0x00008000 17848c2ecf20Sopenharmony_ci#define PACKET3_SET_CONFIG_REG_END 0x0000b000 17858c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG 0x69 17868c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_START 0x00028000 17878c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_END 0x00029000 17888c2ecf20Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 17898c2ecf20Sopenharmony_ci#define PACKET3_SET_RESOURCE_INDIRECT 0x74 17908c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG 0x76 17918c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG_START 0x0000b000 17928c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG_END 0x0000c000 17938c2ecf20Sopenharmony_ci#define PACKET3_SET_SH_REG_OFFSET 0x77 17948c2ecf20Sopenharmony_ci#define PACKET3_ME_WRITE 0x7A 17958c2ecf20Sopenharmony_ci#define PACKET3_SCRATCH_RAM_WRITE 0x7D 17968c2ecf20Sopenharmony_ci#define PACKET3_SCRATCH_RAM_READ 0x7E 17978c2ecf20Sopenharmony_ci#define PACKET3_CE_WRITE 0x7F 17988c2ecf20Sopenharmony_ci#define PACKET3_LOAD_CONST_RAM 0x80 17998c2ecf20Sopenharmony_ci#define PACKET3_WRITE_CONST_RAM 0x81 18008c2ecf20Sopenharmony_ci#define PACKET3_WRITE_CONST_RAM_OFFSET 0x82 18018c2ecf20Sopenharmony_ci#define PACKET3_DUMP_CONST_RAM 0x83 18028c2ecf20Sopenharmony_ci#define PACKET3_INCREMENT_CE_COUNTER 0x84 18038c2ecf20Sopenharmony_ci#define PACKET3_INCREMENT_DE_COUNTER 0x85 18048c2ecf20Sopenharmony_ci#define PACKET3_WAIT_ON_CE_COUNTER 0x86 18058c2ecf20Sopenharmony_ci#define PACKET3_WAIT_ON_DE_COUNTER 0x87 18068c2ecf20Sopenharmony_ci#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 18078c2ecf20Sopenharmony_ci#define PACKET3_SET_CE_DE_COUNTERS 0x89 18088c2ecf20Sopenharmony_ci#define PACKET3_WAIT_ON_AVAIL_BUFFER 0x8A 18098c2ecf20Sopenharmony_ci#define PACKET3_SWITCH_BUFFER 0x8B 18108c2ecf20Sopenharmony_ci 18118c2ecf20Sopenharmony_ci/* ASYNC DMA - first instance at 0xd000, second at 0xd800 */ 18128c2ecf20Sopenharmony_ci#define DMA0_REGISTER_OFFSET 0x0 /* not a register */ 18138c2ecf20Sopenharmony_ci#define DMA1_REGISTER_OFFSET 0x800 /* not a register */ 18148c2ecf20Sopenharmony_ci 18158c2ecf20Sopenharmony_ci#define DMA_RB_CNTL 0xd000 18168c2ecf20Sopenharmony_ci# define DMA_RB_ENABLE (1 << 0) 18178c2ecf20Sopenharmony_ci# define DMA_RB_SIZE(x) ((x) << 1) /* log2 */ 18188c2ecf20Sopenharmony_ci# define DMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */ 18198c2ecf20Sopenharmony_ci# define DMA_RPTR_WRITEBACK_ENABLE (1 << 12) 18208c2ecf20Sopenharmony_ci# define DMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */ 18218c2ecf20Sopenharmony_ci# define DMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */ 18228c2ecf20Sopenharmony_ci#define DMA_RB_BASE 0xd004 18238c2ecf20Sopenharmony_ci#define DMA_RB_RPTR 0xd008 18248c2ecf20Sopenharmony_ci#define DMA_RB_WPTR 0xd00c 18258c2ecf20Sopenharmony_ci 18268c2ecf20Sopenharmony_ci#define DMA_RB_RPTR_ADDR_HI 0xd01c 18278c2ecf20Sopenharmony_ci#define DMA_RB_RPTR_ADDR_LO 0xd020 18288c2ecf20Sopenharmony_ci 18298c2ecf20Sopenharmony_ci#define DMA_IB_CNTL 0xd024 18308c2ecf20Sopenharmony_ci# define DMA_IB_ENABLE (1 << 0) 18318c2ecf20Sopenharmony_ci# define DMA_IB_SWAP_ENABLE (1 << 4) 18328c2ecf20Sopenharmony_ci#define DMA_IB_RPTR 0xd028 18338c2ecf20Sopenharmony_ci#define DMA_CNTL 0xd02c 18348c2ecf20Sopenharmony_ci# define TRAP_ENABLE (1 << 0) 18358c2ecf20Sopenharmony_ci# define SEM_INCOMPLETE_INT_ENABLE (1 << 1) 18368c2ecf20Sopenharmony_ci# define SEM_WAIT_INT_ENABLE (1 << 2) 18378c2ecf20Sopenharmony_ci# define DATA_SWAP_ENABLE (1 << 3) 18388c2ecf20Sopenharmony_ci# define FENCE_SWAP_ENABLE (1 << 4) 18398c2ecf20Sopenharmony_ci# define CTXEMPTY_INT_ENABLE (1 << 28) 18408c2ecf20Sopenharmony_ci#define DMA_STATUS_REG 0xd034 18418c2ecf20Sopenharmony_ci# define DMA_IDLE (1 << 0) 18428c2ecf20Sopenharmony_ci#define DMA_TILING_CONFIG 0xd0b8 18438c2ecf20Sopenharmony_ci 18448c2ecf20Sopenharmony_ci#define DMA_POWER_CNTL 0xd0bc 18458c2ecf20Sopenharmony_ci# define MEM_POWER_OVERRIDE (1 << 8) 18468c2ecf20Sopenharmony_ci#define DMA_CLK_CTRL 0xd0c0 18478c2ecf20Sopenharmony_ci 18488c2ecf20Sopenharmony_ci#define DMA_PG 0xd0d4 18498c2ecf20Sopenharmony_ci# define PG_CNTL_ENABLE (1 << 0) 18508c2ecf20Sopenharmony_ci#define DMA_PGFSM_CONFIG 0xd0d8 18518c2ecf20Sopenharmony_ci#define DMA_PGFSM_WRITE 0xd0dc 18528c2ecf20Sopenharmony_ci 18538c2ecf20Sopenharmony_ci#define DMA_PACKET(cmd, b, t, s, n) ((((cmd) & 0xF) << 28) | \ 18548c2ecf20Sopenharmony_ci (((b) & 0x1) << 26) | \ 18558c2ecf20Sopenharmony_ci (((t) & 0x1) << 23) | \ 18568c2ecf20Sopenharmony_ci (((s) & 0x1) << 22) | \ 18578c2ecf20Sopenharmony_ci (((n) & 0xFFFFF) << 0)) 18588c2ecf20Sopenharmony_ci 18598c2ecf20Sopenharmony_ci#define DMA_IB_PACKET(cmd, vmid, n) ((((cmd) & 0xF) << 28) | \ 18608c2ecf20Sopenharmony_ci (((vmid) & 0xF) << 20) | \ 18618c2ecf20Sopenharmony_ci (((n) & 0xFFFFF) << 0)) 18628c2ecf20Sopenharmony_ci 18638c2ecf20Sopenharmony_ci#define DMA_PTE_PDE_PACKET(n) ((2 << 28) | \ 18648c2ecf20Sopenharmony_ci (1 << 26) | \ 18658c2ecf20Sopenharmony_ci (1 << 21) | \ 18668c2ecf20Sopenharmony_ci (((n) & 0xFFFFF) << 0)) 18678c2ecf20Sopenharmony_ci 18688c2ecf20Sopenharmony_ci/* async DMA Packet types */ 18698c2ecf20Sopenharmony_ci#define DMA_PACKET_WRITE 0x2 18708c2ecf20Sopenharmony_ci#define DMA_PACKET_COPY 0x3 18718c2ecf20Sopenharmony_ci#define DMA_PACKET_INDIRECT_BUFFER 0x4 18728c2ecf20Sopenharmony_ci#define DMA_PACKET_SEMAPHORE 0x5 18738c2ecf20Sopenharmony_ci#define DMA_PACKET_FENCE 0x6 18748c2ecf20Sopenharmony_ci#define DMA_PACKET_TRAP 0x7 18758c2ecf20Sopenharmony_ci#define DMA_PACKET_SRBM_WRITE 0x9 18768c2ecf20Sopenharmony_ci#define DMA_PACKET_CONSTANT_FILL 0xd 18778c2ecf20Sopenharmony_ci#define DMA_PACKET_POLL_REG_MEM 0xe 18788c2ecf20Sopenharmony_ci#define DMA_PACKET_NOP 0xf 18798c2ecf20Sopenharmony_ci 18808c2ecf20Sopenharmony_ci#define VCE_STATUS 0x20004 18818c2ecf20Sopenharmony_ci#define VCE_VCPU_CNTL 0x20014 18828c2ecf20Sopenharmony_ci#define VCE_CLK_EN (1 << 0) 18838c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET0 0x20024 18848c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE0 0x20028 18858c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET1 0x2002c 18868c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE1 0x20030 18878c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET2 0x20034 18888c2ecf20Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE2 0x20038 18898c2ecf20Sopenharmony_ci#define VCE_VCPU_SCRATCH7 0x200dc 18908c2ecf20Sopenharmony_ci#define VCE_SOFT_RESET 0x20120 18918c2ecf20Sopenharmony_ci#define VCE_ECPU_SOFT_RESET (1 << 0) 18928c2ecf20Sopenharmony_ci#define VCE_FME_SOFT_RESET (1 << 2) 18938c2ecf20Sopenharmony_ci#define VCE_RB_BASE_LO2 0x2016c 18948c2ecf20Sopenharmony_ci#define VCE_RB_BASE_HI2 0x20170 18958c2ecf20Sopenharmony_ci#define VCE_RB_SIZE2 0x20174 18968c2ecf20Sopenharmony_ci#define VCE_RB_RPTR2 0x20178 18978c2ecf20Sopenharmony_ci#define VCE_RB_WPTR2 0x2017c 18988c2ecf20Sopenharmony_ci#define VCE_RB_BASE_LO 0x20180 18998c2ecf20Sopenharmony_ci#define VCE_RB_BASE_HI 0x20184 19008c2ecf20Sopenharmony_ci#define VCE_RB_SIZE 0x20188 19018c2ecf20Sopenharmony_ci#define VCE_RB_RPTR 0x2018c 19028c2ecf20Sopenharmony_ci#define VCE_RB_WPTR 0x20190 19038c2ecf20Sopenharmony_ci#define VCE_CLOCK_GATING_A 0x202f8 19048c2ecf20Sopenharmony_ci# define CGC_DYN_CLOCK_MODE (1 << 16) 19058c2ecf20Sopenharmony_ci#define VCE_CLOCK_GATING_B 0x202fc 19068c2ecf20Sopenharmony_ci#define VCE_UENC_CLOCK_GATING 0x205bc 19078c2ecf20Sopenharmony_ci#define VCE_UENC_REG_CLOCK_GATING 0x205c0 19088c2ecf20Sopenharmony_ci#define VCE_FW_REG_STATUS 0x20e10 19098c2ecf20Sopenharmony_ci# define VCE_FW_REG_STATUS_BUSY (1 << 0) 19108c2ecf20Sopenharmony_ci# define VCE_FW_REG_STATUS_PASS (1 << 3) 19118c2ecf20Sopenharmony_ci# define VCE_FW_REG_STATUS_DONE (1 << 11) 19128c2ecf20Sopenharmony_ci#define VCE_LMI_FW_START_KEYSEL 0x20e18 19138c2ecf20Sopenharmony_ci#define VCE_LMI_FW_PERIODIC_CTRL 0x20e20 19148c2ecf20Sopenharmony_ci#define VCE_LMI_CTRL2 0x20e74 19158c2ecf20Sopenharmony_ci#define VCE_LMI_CTRL 0x20e98 19168c2ecf20Sopenharmony_ci#define VCE_LMI_VM_CTRL 0x20ea0 19178c2ecf20Sopenharmony_ci#define VCE_LMI_SWAP_CNTL 0x20eb4 19188c2ecf20Sopenharmony_ci#define VCE_LMI_SWAP_CNTL1 0x20eb8 19198c2ecf20Sopenharmony_ci#define VCE_LMI_CACHE_CTRL 0x20ef4 19208c2ecf20Sopenharmony_ci 19218c2ecf20Sopenharmony_ci#define VCE_CMD_NO_OP 0x00000000 19228c2ecf20Sopenharmony_ci#define VCE_CMD_END 0x00000001 19238c2ecf20Sopenharmony_ci#define VCE_CMD_IB 0x00000002 19248c2ecf20Sopenharmony_ci#define VCE_CMD_FENCE 0x00000003 19258c2ecf20Sopenharmony_ci#define VCE_CMD_TRAP 0x00000004 19268c2ecf20Sopenharmony_ci#define VCE_CMD_IB_AUTO 0x00000005 19278c2ecf20Sopenharmony_ci#define VCE_CMD_SEMAPHORE 0x00000006 19288c2ecf20Sopenharmony_ci 19298c2ecf20Sopenharmony_ci/* discrete vce clocks */ 19308c2ecf20Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL 0xc0030600 19318c2ecf20Sopenharmony_ci# define VCEPLL_RESET_MASK 0x00000001 19328c2ecf20Sopenharmony_ci# define VCEPLL_SLEEP_MASK 0x00000002 19338c2ecf20Sopenharmony_ci# define VCEPLL_BYPASS_EN_MASK 0x00000004 19348c2ecf20Sopenharmony_ci# define VCEPLL_CTLREQ_MASK 0x00000008 19358c2ecf20Sopenharmony_ci# define VCEPLL_VCO_MODE_MASK 0x00000600 19368c2ecf20Sopenharmony_ci# define VCEPLL_REF_DIV_MASK 0x003F0000 19378c2ecf20Sopenharmony_ci# define VCEPLL_CTLACK_MASK 0x40000000 19388c2ecf20Sopenharmony_ci# define VCEPLL_CTLACK2_MASK 0x80000000 19398c2ecf20Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_2 0xc0030601 19408c2ecf20Sopenharmony_ci# define VCEPLL_PDIV_A(x) ((x) << 0) 19418c2ecf20Sopenharmony_ci# define VCEPLL_PDIV_A_MASK 0x0000007F 19428c2ecf20Sopenharmony_ci# define VCEPLL_PDIV_B(x) ((x) << 8) 19438c2ecf20Sopenharmony_ci# define VCEPLL_PDIV_B_MASK 0x00007F00 19448c2ecf20Sopenharmony_ci# define EVCLK_SRC_SEL(x) ((x) << 20) 19458c2ecf20Sopenharmony_ci# define EVCLK_SRC_SEL_MASK 0x01F00000 19468c2ecf20Sopenharmony_ci# define ECCLK_SRC_SEL(x) ((x) << 25) 19478c2ecf20Sopenharmony_ci# define ECCLK_SRC_SEL_MASK 0x3E000000 19488c2ecf20Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_3 0xc0030602 19498c2ecf20Sopenharmony_ci# define VCEPLL_FB_DIV(x) ((x) << 0) 19508c2ecf20Sopenharmony_ci# define VCEPLL_FB_DIV_MASK 0x01FFFFFF 19518c2ecf20Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_4 0xc0030603 19528c2ecf20Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_5 0xc0030604 19538c2ecf20Sopenharmony_ci#define CG_VCEPLL_SPREAD_SPECTRUM 0xc0030606 19548c2ecf20Sopenharmony_ci# define VCEPLL_SSEN_MASK 0x00000001 19558c2ecf20Sopenharmony_ci 19568c2ecf20Sopenharmony_ci#endif 1957