162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright 2011 Advanced Micro Devices, Inc. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation 762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 1062306a36Sopenharmony_ci * 1162306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 1262306a36Sopenharmony_ci * all copies or substantial portions of the Software. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1562306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1662306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1762306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 1862306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1962306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2062306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 2162306a36Sopenharmony_ci * 2262306a36Sopenharmony_ci * Authors: Alex Deucher 2362306a36Sopenharmony_ci */ 2462306a36Sopenharmony_ci#ifndef SI_H 2562306a36Sopenharmony_ci#define SI_H 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define TAHITI_RB_BITMAP_WIDTH_PER_SH 2 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci#define TAHITI_GB_ADDR_CONFIG_GOLDEN 0x12011003 3062306a36Sopenharmony_ci#define VERDE_GB_ADDR_CONFIG_GOLDEN 0x12010002 3162306a36Sopenharmony_ci#define HAINAN_GB_ADDR_CONFIG_GOLDEN 0x02010001 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#define SI_MAX_SH_GPRS 256 3462306a36Sopenharmony_ci#define SI_MAX_TEMP_GPRS 16 3562306a36Sopenharmony_ci#define SI_MAX_SH_THREADS 256 3662306a36Sopenharmony_ci#define SI_MAX_SH_STACK_ENTRIES 4096 3762306a36Sopenharmony_ci#define SI_MAX_FRC_EOV_CNT 16384 3862306a36Sopenharmony_ci#define SI_MAX_BACKENDS 8 3962306a36Sopenharmony_ci#define SI_MAX_BACKENDS_MASK 0xFF 4062306a36Sopenharmony_ci#define SI_MAX_BACKENDS_PER_SE_MASK 0x0F 4162306a36Sopenharmony_ci#define SI_MAX_SIMDS 12 4262306a36Sopenharmony_ci#define SI_MAX_SIMDS_MASK 0x0FFF 4362306a36Sopenharmony_ci#define SI_MAX_SIMDS_PER_SE_MASK 0x00FF 4462306a36Sopenharmony_ci#define SI_MAX_PIPES 8 4562306a36Sopenharmony_ci#define SI_MAX_PIPES_MASK 0xFF 4662306a36Sopenharmony_ci#define SI_MAX_PIPES_PER_SIMD_MASK 0x3F 4762306a36Sopenharmony_ci#define SI_MAX_LDS_NUM 0xFFFF 4862306a36Sopenharmony_ci#define SI_MAX_TCC 16 4962306a36Sopenharmony_ci#define SI_MAX_TCC_MASK 0xFFFF 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci/* SMC IND accessor regs */ 5262306a36Sopenharmony_ci#define SMC_IND_INDEX_0 0x200 5362306a36Sopenharmony_ci#define SMC_IND_DATA_0 0x204 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci#define SMC_IND_ACCESS_CNTL 0x228 5662306a36Sopenharmony_ci# define AUTO_INCREMENT_IND_0 (1 << 0) 5762306a36Sopenharmony_ci#define SMC_MESSAGE_0 0x22c 5862306a36Sopenharmony_ci#define SMC_RESP_0 0x230 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci/* CG IND registers are accessed via SMC indirect space + SMC_CG_IND_START */ 6162306a36Sopenharmony_ci#define SMC_CG_IND_START 0xc0030000 6262306a36Sopenharmony_ci#define SMC_CG_IND_END 0xc0040000 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define CG_CGTT_LOCAL_0 0x400 6562306a36Sopenharmony_ci#define CG_CGTT_LOCAL_1 0x401 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci/* SMC IND registers */ 6862306a36Sopenharmony_ci#define SMC_SYSCON_RESET_CNTL 0x80000000 6962306a36Sopenharmony_ci# define RST_REG (1 << 0) 7062306a36Sopenharmony_ci#define SMC_SYSCON_CLOCK_CNTL_0 0x80000004 7162306a36Sopenharmony_ci# define CK_DISABLE (1 << 0) 7262306a36Sopenharmony_ci# define CKEN (1 << 24) 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci#define VGA_HDP_CONTROL 0x328 7562306a36Sopenharmony_ci#define VGA_MEMORY_DISABLE (1 << 4) 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci#define DCCG_DISP_SLOW_SELECT_REG 0x4fc 7862306a36Sopenharmony_ci#define DCCG_DISP1_SLOW_SELECT(x) ((x) << 0) 7962306a36Sopenharmony_ci#define DCCG_DISP1_SLOW_SELECT_MASK (7 << 0) 8062306a36Sopenharmony_ci#define DCCG_DISP1_SLOW_SELECT_SHIFT 0 8162306a36Sopenharmony_ci#define DCCG_DISP2_SLOW_SELECT(x) ((x) << 4) 8262306a36Sopenharmony_ci#define DCCG_DISP2_SLOW_SELECT_MASK (7 << 4) 8362306a36Sopenharmony_ci#define DCCG_DISP2_SLOW_SELECT_SHIFT 4 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci#define CG_SPLL_FUNC_CNTL 0x600 8662306a36Sopenharmony_ci#define SPLL_RESET (1 << 0) 8762306a36Sopenharmony_ci#define SPLL_SLEEP (1 << 1) 8862306a36Sopenharmony_ci#define SPLL_BYPASS_EN (1 << 3) 8962306a36Sopenharmony_ci#define SPLL_REF_DIV(x) ((x) << 4) 9062306a36Sopenharmony_ci#define SPLL_REF_DIV_MASK (0x3f << 4) 9162306a36Sopenharmony_ci#define SPLL_PDIV_A(x) ((x) << 20) 9262306a36Sopenharmony_ci#define SPLL_PDIV_A_MASK (0x7f << 20) 9362306a36Sopenharmony_ci#define SPLL_PDIV_A_SHIFT 20 9462306a36Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_2 0x604 9562306a36Sopenharmony_ci#define SCLK_MUX_SEL(x) ((x) << 0) 9662306a36Sopenharmony_ci#define SCLK_MUX_SEL_MASK (0x1ff << 0) 9762306a36Sopenharmony_ci#define SPLL_CTLREQ_CHG (1 << 23) 9862306a36Sopenharmony_ci#define SCLK_MUX_UPDATE (1 << 26) 9962306a36Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_3 0x608 10062306a36Sopenharmony_ci#define SPLL_FB_DIV(x) ((x) << 0) 10162306a36Sopenharmony_ci#define SPLL_FB_DIV_MASK (0x3ffffff << 0) 10262306a36Sopenharmony_ci#define SPLL_FB_DIV_SHIFT 0 10362306a36Sopenharmony_ci#define SPLL_DITHEN (1 << 28) 10462306a36Sopenharmony_ci#define CG_SPLL_FUNC_CNTL_4 0x60c 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci#define SPLL_STATUS 0x614 10762306a36Sopenharmony_ci#define SPLL_CHG_STATUS (1 << 1) 10862306a36Sopenharmony_ci#define SPLL_CNTL_MODE 0x618 10962306a36Sopenharmony_ci#define SPLL_SW_DIR_CONTROL (1 << 0) 11062306a36Sopenharmony_ci# define SPLL_REFCLK_SEL(x) ((x) << 26) 11162306a36Sopenharmony_ci# define SPLL_REFCLK_SEL_MASK (3 << 26) 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM 0x620 11462306a36Sopenharmony_ci#define SSEN (1 << 0) 11562306a36Sopenharmony_ci#define CLK_S(x) ((x) << 4) 11662306a36Sopenharmony_ci#define CLK_S_MASK (0xfff << 4) 11762306a36Sopenharmony_ci#define CLK_S_SHIFT 4 11862306a36Sopenharmony_ci#define CG_SPLL_SPREAD_SPECTRUM_2 0x624 11962306a36Sopenharmony_ci#define CLK_V(x) ((x) << 0) 12062306a36Sopenharmony_ci#define CLK_V_MASK (0x3ffffff << 0) 12162306a36Sopenharmony_ci#define CLK_V_SHIFT 0 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci#define CG_SPLL_AUTOSCALE_CNTL 0x62c 12462306a36Sopenharmony_ci# define AUTOSCALE_ON_SS_CLEAR (1 << 9) 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci/* discrete uvd clocks */ 12762306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL 0x634 12862306a36Sopenharmony_ci# define UPLL_RESET_MASK 0x00000001 12962306a36Sopenharmony_ci# define UPLL_SLEEP_MASK 0x00000002 13062306a36Sopenharmony_ci# define UPLL_BYPASS_EN_MASK 0x00000004 13162306a36Sopenharmony_ci# define UPLL_CTLREQ_MASK 0x00000008 13262306a36Sopenharmony_ci# define UPLL_VCO_MODE_MASK 0x00000600 13362306a36Sopenharmony_ci# define UPLL_REF_DIV_MASK 0x003F0000 13462306a36Sopenharmony_ci# define UPLL_CTLACK_MASK 0x40000000 13562306a36Sopenharmony_ci# define UPLL_CTLACK2_MASK 0x80000000 13662306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_2 0x638 13762306a36Sopenharmony_ci# define UPLL_PDIV_A(x) ((x) << 0) 13862306a36Sopenharmony_ci# define UPLL_PDIV_A_MASK 0x0000007F 13962306a36Sopenharmony_ci# define UPLL_PDIV_B(x) ((x) << 8) 14062306a36Sopenharmony_ci# define UPLL_PDIV_B_MASK 0x00007F00 14162306a36Sopenharmony_ci# define VCLK_SRC_SEL(x) ((x) << 20) 14262306a36Sopenharmony_ci# define VCLK_SRC_SEL_MASK 0x01F00000 14362306a36Sopenharmony_ci# define DCLK_SRC_SEL(x) ((x) << 25) 14462306a36Sopenharmony_ci# define DCLK_SRC_SEL_MASK 0x3E000000 14562306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_3 0x63C 14662306a36Sopenharmony_ci# define UPLL_FB_DIV(x) ((x) << 0) 14762306a36Sopenharmony_ci# define UPLL_FB_DIV_MASK 0x01FFFFFF 14862306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_4 0x644 14962306a36Sopenharmony_ci# define UPLL_SPARE_ISPARE9 0x00020000 15062306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_5 0x648 15162306a36Sopenharmony_ci# define RESET_ANTI_MUX_MASK 0x00000200 15262306a36Sopenharmony_ci#define CG_UPLL_SPREAD_SPECTRUM 0x650 15362306a36Sopenharmony_ci# define SSEN_MASK 0x00000001 15462306a36Sopenharmony_ci 15562306a36Sopenharmony_ci#define MPLL_BYPASSCLK_SEL 0x65c 15662306a36Sopenharmony_ci# define MPLL_CLKOUT_SEL(x) ((x) << 8) 15762306a36Sopenharmony_ci# define MPLL_CLKOUT_SEL_MASK 0xFF00 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci#define CG_CLKPIN_CNTL 0x660 16062306a36Sopenharmony_ci# define XTALIN_DIVIDE (1 << 1) 16162306a36Sopenharmony_ci# define BCLK_AS_XCLK (1 << 2) 16262306a36Sopenharmony_ci#define CG_CLKPIN_CNTL_2 0x664 16362306a36Sopenharmony_ci# define FORCE_BIF_REFCLK_EN (1 << 3) 16462306a36Sopenharmony_ci# define MUX_TCLK_TO_XCLK (1 << 8) 16562306a36Sopenharmony_ci 16662306a36Sopenharmony_ci#define THM_CLK_CNTL 0x66c 16762306a36Sopenharmony_ci# define CMON_CLK_SEL(x) ((x) << 0) 16862306a36Sopenharmony_ci# define CMON_CLK_SEL_MASK 0xFF 16962306a36Sopenharmony_ci# define TMON_CLK_SEL(x) ((x) << 8) 17062306a36Sopenharmony_ci# define TMON_CLK_SEL_MASK 0xFF00 17162306a36Sopenharmony_ci#define MISC_CLK_CNTL 0x670 17262306a36Sopenharmony_ci# define DEEP_SLEEP_CLK_SEL(x) ((x) << 0) 17362306a36Sopenharmony_ci# define DEEP_SLEEP_CLK_SEL_MASK 0xFF 17462306a36Sopenharmony_ci# define ZCLK_SEL(x) ((x) << 8) 17562306a36Sopenharmony_ci# define ZCLK_SEL_MASK 0xFF00 17662306a36Sopenharmony_ci 17762306a36Sopenharmony_ci#define CG_THERMAL_CTRL 0x700 17862306a36Sopenharmony_ci#define DPM_EVENT_SRC(x) ((x) << 0) 17962306a36Sopenharmony_ci#define DPM_EVENT_SRC_MASK (7 << 0) 18062306a36Sopenharmony_ci#define DIG_THERM_DPM(x) ((x) << 14) 18162306a36Sopenharmony_ci#define DIG_THERM_DPM_MASK 0x003FC000 18262306a36Sopenharmony_ci#define DIG_THERM_DPM_SHIFT 14 18362306a36Sopenharmony_ci#define CG_THERMAL_STATUS 0x704 18462306a36Sopenharmony_ci#define FDO_PWM_DUTY(x) ((x) << 9) 18562306a36Sopenharmony_ci#define FDO_PWM_DUTY_MASK (0xff << 9) 18662306a36Sopenharmony_ci#define FDO_PWM_DUTY_SHIFT 9 18762306a36Sopenharmony_ci#define CG_THERMAL_INT 0x708 18862306a36Sopenharmony_ci#define DIG_THERM_INTH(x) ((x) << 8) 18962306a36Sopenharmony_ci#define DIG_THERM_INTH_MASK 0x0000FF00 19062306a36Sopenharmony_ci#define DIG_THERM_INTH_SHIFT 8 19162306a36Sopenharmony_ci#define DIG_THERM_INTL(x) ((x) << 16) 19262306a36Sopenharmony_ci#define DIG_THERM_INTL_MASK 0x00FF0000 19362306a36Sopenharmony_ci#define DIG_THERM_INTL_SHIFT 16 19462306a36Sopenharmony_ci#define THERM_INT_MASK_HIGH (1 << 24) 19562306a36Sopenharmony_ci#define THERM_INT_MASK_LOW (1 << 25) 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ci#define CG_MULT_THERMAL_CTRL 0x710 19862306a36Sopenharmony_ci#define TEMP_SEL(x) ((x) << 20) 19962306a36Sopenharmony_ci#define TEMP_SEL_MASK (0xff << 20) 20062306a36Sopenharmony_ci#define TEMP_SEL_SHIFT 20 20162306a36Sopenharmony_ci#define CG_MULT_THERMAL_STATUS 0x714 20262306a36Sopenharmony_ci#define ASIC_MAX_TEMP(x) ((x) << 0) 20362306a36Sopenharmony_ci#define ASIC_MAX_TEMP_MASK 0x000001ff 20462306a36Sopenharmony_ci#define ASIC_MAX_TEMP_SHIFT 0 20562306a36Sopenharmony_ci#define CTF_TEMP(x) ((x) << 9) 20662306a36Sopenharmony_ci#define CTF_TEMP_MASK 0x0003fe00 20762306a36Sopenharmony_ci#define CTF_TEMP_SHIFT 9 20862306a36Sopenharmony_ci 20962306a36Sopenharmony_ci#define CG_FDO_CTRL0 0x754 21062306a36Sopenharmony_ci#define FDO_STATIC_DUTY(x) ((x) << 0) 21162306a36Sopenharmony_ci#define FDO_STATIC_DUTY_MASK 0x000000FF 21262306a36Sopenharmony_ci#define FDO_STATIC_DUTY_SHIFT 0 21362306a36Sopenharmony_ci#define CG_FDO_CTRL1 0x758 21462306a36Sopenharmony_ci#define FMAX_DUTY100(x) ((x) << 0) 21562306a36Sopenharmony_ci#define FMAX_DUTY100_MASK 0x000000FF 21662306a36Sopenharmony_ci#define FMAX_DUTY100_SHIFT 0 21762306a36Sopenharmony_ci#define CG_FDO_CTRL2 0x75C 21862306a36Sopenharmony_ci#define TMIN(x) ((x) << 0) 21962306a36Sopenharmony_ci#define TMIN_MASK 0x000000FF 22062306a36Sopenharmony_ci#define TMIN_SHIFT 0 22162306a36Sopenharmony_ci#define FDO_PWM_MODE(x) ((x) << 11) 22262306a36Sopenharmony_ci#define FDO_PWM_MODE_MASK (7 << 11) 22362306a36Sopenharmony_ci#define FDO_PWM_MODE_SHIFT 11 22462306a36Sopenharmony_ci#define TACH_PWM_RESP_RATE(x) ((x) << 25) 22562306a36Sopenharmony_ci#define TACH_PWM_RESP_RATE_MASK (0x7f << 25) 22662306a36Sopenharmony_ci#define TACH_PWM_RESP_RATE_SHIFT 25 22762306a36Sopenharmony_ci 22862306a36Sopenharmony_ci#define CG_TACH_CTRL 0x770 22962306a36Sopenharmony_ci# define EDGE_PER_REV(x) ((x) << 0) 23062306a36Sopenharmony_ci# define EDGE_PER_REV_MASK (0x7 << 0) 23162306a36Sopenharmony_ci# define EDGE_PER_REV_SHIFT 0 23262306a36Sopenharmony_ci# define TARGET_PERIOD(x) ((x) << 3) 23362306a36Sopenharmony_ci# define TARGET_PERIOD_MASK 0xfffffff8 23462306a36Sopenharmony_ci# define TARGET_PERIOD_SHIFT 3 23562306a36Sopenharmony_ci#define CG_TACH_STATUS 0x774 23662306a36Sopenharmony_ci# define TACH_PERIOD(x) ((x) << 0) 23762306a36Sopenharmony_ci# define TACH_PERIOD_MASK 0xffffffff 23862306a36Sopenharmony_ci# define TACH_PERIOD_SHIFT 0 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci#define GENERAL_PWRMGT 0x780 24162306a36Sopenharmony_ci# define GLOBAL_PWRMGT_EN (1 << 0) 24262306a36Sopenharmony_ci# define STATIC_PM_EN (1 << 1) 24362306a36Sopenharmony_ci# define THERMAL_PROTECTION_DIS (1 << 2) 24462306a36Sopenharmony_ci# define THERMAL_PROTECTION_TYPE (1 << 3) 24562306a36Sopenharmony_ci# define SW_SMIO_INDEX(x) ((x) << 6) 24662306a36Sopenharmony_ci# define SW_SMIO_INDEX_MASK (1 << 6) 24762306a36Sopenharmony_ci# define SW_SMIO_INDEX_SHIFT 6 24862306a36Sopenharmony_ci# define VOLT_PWRMGT_EN (1 << 10) 24962306a36Sopenharmony_ci# define DYN_SPREAD_SPECTRUM_EN (1 << 23) 25062306a36Sopenharmony_ci#define CG_TPC 0x784 25162306a36Sopenharmony_ci#define SCLK_PWRMGT_CNTL 0x788 25262306a36Sopenharmony_ci# define SCLK_PWRMGT_OFF (1 << 0) 25362306a36Sopenharmony_ci# define SCLK_LOW_D1 (1 << 1) 25462306a36Sopenharmony_ci# define FIR_RESET (1 << 4) 25562306a36Sopenharmony_ci# define FIR_FORCE_TREND_SEL (1 << 5) 25662306a36Sopenharmony_ci# define FIR_TREND_MODE (1 << 6) 25762306a36Sopenharmony_ci# define DYN_GFX_CLK_OFF_EN (1 << 7) 25862306a36Sopenharmony_ci# define GFX_CLK_FORCE_ON (1 << 8) 25962306a36Sopenharmony_ci# define GFX_CLK_REQUEST_OFF (1 << 9) 26062306a36Sopenharmony_ci# define GFX_CLK_FORCE_OFF (1 << 10) 26162306a36Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D1 (1 << 11) 26262306a36Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D2 (1 << 12) 26362306a36Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D3 (1 << 13) 26462306a36Sopenharmony_ci# define DYN_LIGHT_SLEEP_EN (1 << 14) 26562306a36Sopenharmony_ci 26662306a36Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX 0x798 26762306a36Sopenharmony_ci# define CURRENT_STATE_INDEX_MASK (0xf << 4) 26862306a36Sopenharmony_ci# define CURRENT_STATE_INDEX_SHIFT 4 26962306a36Sopenharmony_ci 27062306a36Sopenharmony_ci#define CG_FTV 0x7bc 27162306a36Sopenharmony_ci 27262306a36Sopenharmony_ci#define CG_FFCT_0 0x7c0 27362306a36Sopenharmony_ci# define UTC_0(x) ((x) << 0) 27462306a36Sopenharmony_ci# define UTC_0_MASK (0x3ff << 0) 27562306a36Sopenharmony_ci# define DTC_0(x) ((x) << 10) 27662306a36Sopenharmony_ci# define DTC_0_MASK (0x3ff << 10) 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci#define CG_BSP 0x7fc 27962306a36Sopenharmony_ci# define BSP(x) ((x) << 0) 28062306a36Sopenharmony_ci# define BSP_MASK (0xffff << 0) 28162306a36Sopenharmony_ci# define BSU(x) ((x) << 16) 28262306a36Sopenharmony_ci# define BSU_MASK (0xf << 16) 28362306a36Sopenharmony_ci#define CG_AT 0x800 28462306a36Sopenharmony_ci# define CG_R(x) ((x) << 0) 28562306a36Sopenharmony_ci# define CG_R_MASK (0xffff << 0) 28662306a36Sopenharmony_ci# define CG_L(x) ((x) << 16) 28762306a36Sopenharmony_ci# define CG_L_MASK (0xffff << 16) 28862306a36Sopenharmony_ci 28962306a36Sopenharmony_ci#define CG_GIT 0x804 29062306a36Sopenharmony_ci# define CG_GICST(x) ((x) << 0) 29162306a36Sopenharmony_ci# define CG_GICST_MASK (0xffff << 0) 29262306a36Sopenharmony_ci# define CG_GIPOT(x) ((x) << 16) 29362306a36Sopenharmony_ci# define CG_GIPOT_MASK (0xffff << 16) 29462306a36Sopenharmony_ci 29562306a36Sopenharmony_ci#define CG_SSP 0x80c 29662306a36Sopenharmony_ci# define SST(x) ((x) << 0) 29762306a36Sopenharmony_ci# define SST_MASK (0xffff << 0) 29862306a36Sopenharmony_ci# define SSTU(x) ((x) << 16) 29962306a36Sopenharmony_ci# define SSTU_MASK (0xf << 16) 30062306a36Sopenharmony_ci 30162306a36Sopenharmony_ci#define CG_DISPLAY_GAP_CNTL 0x828 30262306a36Sopenharmony_ci# define DISP1_GAP(x) ((x) << 0) 30362306a36Sopenharmony_ci# define DISP1_GAP_MASK (3 << 0) 30462306a36Sopenharmony_ci# define DISP2_GAP(x) ((x) << 2) 30562306a36Sopenharmony_ci# define DISP2_GAP_MASK (3 << 2) 30662306a36Sopenharmony_ci# define VBI_TIMER_COUNT(x) ((x) << 4) 30762306a36Sopenharmony_ci# define VBI_TIMER_COUNT_MASK (0x3fff << 4) 30862306a36Sopenharmony_ci# define VBI_TIMER_UNIT(x) ((x) << 20) 30962306a36Sopenharmony_ci# define VBI_TIMER_UNIT_MASK (7 << 20) 31062306a36Sopenharmony_ci# define DISP1_GAP_MCHG(x) ((x) << 24) 31162306a36Sopenharmony_ci# define DISP1_GAP_MCHG_MASK (3 << 24) 31262306a36Sopenharmony_ci# define DISP2_GAP_MCHG(x) ((x) << 26) 31362306a36Sopenharmony_ci# define DISP2_GAP_MCHG_MASK (3 << 26) 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_ci#define CG_ULV_CONTROL 0x878 31662306a36Sopenharmony_ci#define CG_ULV_PARAMETER 0x87c 31762306a36Sopenharmony_ci 31862306a36Sopenharmony_ci#define SMC_SCRATCH0 0x884 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci#define CG_CAC_CTRL 0x8b8 32162306a36Sopenharmony_ci# define CAC_WINDOW(x) ((x) << 0) 32262306a36Sopenharmony_ci# define CAC_WINDOW_MASK 0x00ffffff 32362306a36Sopenharmony_ci 32462306a36Sopenharmony_ci#define DMIF_ADDR_CONFIG 0xBD4 32562306a36Sopenharmony_ci 32662306a36Sopenharmony_ci#define DMIF_ADDR_CALC 0xC00 32762306a36Sopenharmony_ci 32862306a36Sopenharmony_ci#define PIPE0_DMIF_BUFFER_CONTROL 0x0ca0 32962306a36Sopenharmony_ci# define DMIF_BUFFERS_ALLOCATED(x) ((x) << 0) 33062306a36Sopenharmony_ci# define DMIF_BUFFERS_ALLOCATED_COMPLETED (1 << 4) 33162306a36Sopenharmony_ci 33262306a36Sopenharmony_ci#define SRBM_STATUS 0xE50 33362306a36Sopenharmony_ci#define GRBM_RQ_PENDING (1 << 5) 33462306a36Sopenharmony_ci#define VMC_BUSY (1 << 8) 33562306a36Sopenharmony_ci#define MCB_BUSY (1 << 9) 33662306a36Sopenharmony_ci#define MCB_NON_DISPLAY_BUSY (1 << 10) 33762306a36Sopenharmony_ci#define MCC_BUSY (1 << 11) 33862306a36Sopenharmony_ci#define MCD_BUSY (1 << 12) 33962306a36Sopenharmony_ci#define SEM_BUSY (1 << 14) 34062306a36Sopenharmony_ci#define IH_BUSY (1 << 17) 34162306a36Sopenharmony_ci 34262306a36Sopenharmony_ci#define SRBM_SOFT_RESET 0x0E60 34362306a36Sopenharmony_ci#define SOFT_RESET_BIF (1 << 1) 34462306a36Sopenharmony_ci#define SOFT_RESET_DC (1 << 5) 34562306a36Sopenharmony_ci#define SOFT_RESET_DMA1 (1 << 6) 34662306a36Sopenharmony_ci#define SOFT_RESET_GRBM (1 << 8) 34762306a36Sopenharmony_ci#define SOFT_RESET_HDP (1 << 9) 34862306a36Sopenharmony_ci#define SOFT_RESET_IH (1 << 10) 34962306a36Sopenharmony_ci#define SOFT_RESET_MC (1 << 11) 35062306a36Sopenharmony_ci#define SOFT_RESET_ROM (1 << 14) 35162306a36Sopenharmony_ci#define SOFT_RESET_SEM (1 << 15) 35262306a36Sopenharmony_ci#define SOFT_RESET_VMC (1 << 17) 35362306a36Sopenharmony_ci#define SOFT_RESET_DMA (1 << 20) 35462306a36Sopenharmony_ci#define SOFT_RESET_TST (1 << 21) 35562306a36Sopenharmony_ci#define SOFT_RESET_REGBB (1 << 22) 35662306a36Sopenharmony_ci#define SOFT_RESET_ORB (1 << 23) 35762306a36Sopenharmony_ci 35862306a36Sopenharmony_ci#define CC_SYS_RB_BACKEND_DISABLE 0xe80 35962306a36Sopenharmony_ci#define GC_USER_SYS_RB_BACKEND_DISABLE 0xe84 36062306a36Sopenharmony_ci 36162306a36Sopenharmony_ci#define SRBM_READ_ERROR 0xE98 36262306a36Sopenharmony_ci#define SRBM_INT_CNTL 0xEA0 36362306a36Sopenharmony_ci#define SRBM_INT_ACK 0xEA8 36462306a36Sopenharmony_ci 36562306a36Sopenharmony_ci#define SRBM_STATUS2 0x0EC4 36662306a36Sopenharmony_ci#define DMA_BUSY (1 << 5) 36762306a36Sopenharmony_ci#define DMA1_BUSY (1 << 6) 36862306a36Sopenharmony_ci 36962306a36Sopenharmony_ci#define VM_L2_CNTL 0x1400 37062306a36Sopenharmony_ci#define ENABLE_L2_CACHE (1 << 0) 37162306a36Sopenharmony_ci#define ENABLE_L2_FRAGMENT_PROCESSING (1 << 1) 37262306a36Sopenharmony_ci#define L2_CACHE_PTE_ENDIAN_SWAP_MODE(x) ((x) << 2) 37362306a36Sopenharmony_ci#define L2_CACHE_PDE_ENDIAN_SWAP_MODE(x) ((x) << 4) 37462306a36Sopenharmony_ci#define ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE (1 << 9) 37562306a36Sopenharmony_ci#define ENABLE_L2_PDE0_CACHE_LRU_UPDATE_BY_WRITE (1 << 10) 37662306a36Sopenharmony_ci#define EFFECTIVE_L2_QUEUE_SIZE(x) (((x) & 7) << 15) 37762306a36Sopenharmony_ci#define CONTEXT1_IDENTITY_ACCESS_MODE(x) (((x) & 3) << 19) 37862306a36Sopenharmony_ci#define VM_L2_CNTL2 0x1404 37962306a36Sopenharmony_ci#define INVALIDATE_ALL_L1_TLBS (1 << 0) 38062306a36Sopenharmony_ci#define INVALIDATE_L2_CACHE (1 << 1) 38162306a36Sopenharmony_ci#define INVALIDATE_CACHE_MODE(x) ((x) << 26) 38262306a36Sopenharmony_ci#define INVALIDATE_PTE_AND_PDE_CACHES 0 38362306a36Sopenharmony_ci#define INVALIDATE_ONLY_PTE_CACHES 1 38462306a36Sopenharmony_ci#define INVALIDATE_ONLY_PDE_CACHES 2 38562306a36Sopenharmony_ci#define VM_L2_CNTL3 0x1408 38662306a36Sopenharmony_ci#define BANK_SELECT(x) ((x) << 0) 38762306a36Sopenharmony_ci#define L2_CACHE_UPDATE_MODE(x) ((x) << 6) 38862306a36Sopenharmony_ci#define L2_CACHE_BIGK_FRAGMENT_SIZE(x) ((x) << 15) 38962306a36Sopenharmony_ci#define L2_CACHE_BIGK_ASSOCIATIVITY (1 << 20) 39062306a36Sopenharmony_ci#define VM_L2_STATUS 0x140C 39162306a36Sopenharmony_ci#define L2_BUSY (1 << 0) 39262306a36Sopenharmony_ci#define VM_CONTEXT0_CNTL 0x1410 39362306a36Sopenharmony_ci#define ENABLE_CONTEXT (1 << 0) 39462306a36Sopenharmony_ci#define PAGE_TABLE_DEPTH(x) (((x) & 3) << 1) 39562306a36Sopenharmony_ci#define RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 3) 39662306a36Sopenharmony_ci#define RANGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 4) 39762306a36Sopenharmony_ci#define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 6) 39862306a36Sopenharmony_ci#define DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 7) 39962306a36Sopenharmony_ci#define PDE0_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 9) 40062306a36Sopenharmony_ci#define PDE0_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 10) 40162306a36Sopenharmony_ci#define VALID_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 12) 40262306a36Sopenharmony_ci#define VALID_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 13) 40362306a36Sopenharmony_ci#define READ_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 15) 40462306a36Sopenharmony_ci#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) 40562306a36Sopenharmony_ci#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) 40662306a36Sopenharmony_ci#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) 40762306a36Sopenharmony_ci#define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24) 40862306a36Sopenharmony_ci#define VM_CONTEXT1_CNTL 0x1414 40962306a36Sopenharmony_ci#define VM_CONTEXT0_CNTL2 0x1430 41062306a36Sopenharmony_ci#define VM_CONTEXT1_CNTL2 0x1434 41162306a36Sopenharmony_ci#define VM_CONTEXT8_PAGE_TABLE_BASE_ADDR 0x1438 41262306a36Sopenharmony_ci#define VM_CONTEXT9_PAGE_TABLE_BASE_ADDR 0x143c 41362306a36Sopenharmony_ci#define VM_CONTEXT10_PAGE_TABLE_BASE_ADDR 0x1440 41462306a36Sopenharmony_ci#define VM_CONTEXT11_PAGE_TABLE_BASE_ADDR 0x1444 41562306a36Sopenharmony_ci#define VM_CONTEXT12_PAGE_TABLE_BASE_ADDR 0x1448 41662306a36Sopenharmony_ci#define VM_CONTEXT13_PAGE_TABLE_BASE_ADDR 0x144c 41762306a36Sopenharmony_ci#define VM_CONTEXT14_PAGE_TABLE_BASE_ADDR 0x1450 41862306a36Sopenharmony_ci#define VM_CONTEXT15_PAGE_TABLE_BASE_ADDR 0x1454 41962306a36Sopenharmony_ci 42062306a36Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x14FC 42162306a36Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x14DC 42262306a36Sopenharmony_ci#define PROTECTIONS_MASK (0xf << 0) 42362306a36Sopenharmony_ci#define PROTECTIONS_SHIFT 0 42462306a36Sopenharmony_ci /* bit 0: range 42562306a36Sopenharmony_ci * bit 1: pde0 42662306a36Sopenharmony_ci * bit 2: valid 42762306a36Sopenharmony_ci * bit 3: read 42862306a36Sopenharmony_ci * bit 4: write 42962306a36Sopenharmony_ci */ 43062306a36Sopenharmony_ci#define MEMORY_CLIENT_ID_MASK (0xff << 12) 43162306a36Sopenharmony_ci#define MEMORY_CLIENT_ID_SHIFT 12 43262306a36Sopenharmony_ci#define MEMORY_CLIENT_RW_MASK (1 << 24) 43362306a36Sopenharmony_ci#define MEMORY_CLIENT_RW_SHIFT 24 43462306a36Sopenharmony_ci#define FAULT_VMID_MASK (0xf << 25) 43562306a36Sopenharmony_ci#define FAULT_VMID_SHIFT 25 43662306a36Sopenharmony_ci 43762306a36Sopenharmony_ci#define VM_INVALIDATE_REQUEST 0x1478 43862306a36Sopenharmony_ci#define VM_INVALIDATE_RESPONSE 0x147c 43962306a36Sopenharmony_ci 44062306a36Sopenharmony_ci#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR 0x1518 44162306a36Sopenharmony_ci#define VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR 0x151c 44262306a36Sopenharmony_ci 44362306a36Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR 0x153c 44462306a36Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_BASE_ADDR 0x1540 44562306a36Sopenharmony_ci#define VM_CONTEXT2_PAGE_TABLE_BASE_ADDR 0x1544 44662306a36Sopenharmony_ci#define VM_CONTEXT3_PAGE_TABLE_BASE_ADDR 0x1548 44762306a36Sopenharmony_ci#define VM_CONTEXT4_PAGE_TABLE_BASE_ADDR 0x154c 44862306a36Sopenharmony_ci#define VM_CONTEXT5_PAGE_TABLE_BASE_ADDR 0x1550 44962306a36Sopenharmony_ci#define VM_CONTEXT6_PAGE_TABLE_BASE_ADDR 0x1554 45062306a36Sopenharmony_ci#define VM_CONTEXT7_PAGE_TABLE_BASE_ADDR 0x1558 45162306a36Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_START_ADDR 0x155c 45262306a36Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_START_ADDR 0x1560 45362306a36Sopenharmony_ci 45462306a36Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_END_ADDR 0x157C 45562306a36Sopenharmony_ci#define VM_CONTEXT1_PAGE_TABLE_END_ADDR 0x1580 45662306a36Sopenharmony_ci 45762306a36Sopenharmony_ci#define VM_L2_CG 0x15c0 45862306a36Sopenharmony_ci#define MC_CG_ENABLE (1 << 18) 45962306a36Sopenharmony_ci#define MC_LS_ENABLE (1 << 19) 46062306a36Sopenharmony_ci 46162306a36Sopenharmony_ci#define MC_SHARED_CHMAP 0x2004 46262306a36Sopenharmony_ci#define NOOFCHAN_SHIFT 12 46362306a36Sopenharmony_ci#define NOOFCHAN_MASK 0x0000f000 46462306a36Sopenharmony_ci#define MC_SHARED_CHREMAP 0x2008 46562306a36Sopenharmony_ci 46662306a36Sopenharmony_ci#define MC_VM_FB_LOCATION 0x2024 46762306a36Sopenharmony_ci#define MC_VM_AGP_TOP 0x2028 46862306a36Sopenharmony_ci#define MC_VM_AGP_BOT 0x202C 46962306a36Sopenharmony_ci#define MC_VM_AGP_BASE 0x2030 47062306a36Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 47162306a36Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 47262306a36Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C 47362306a36Sopenharmony_ci 47462306a36Sopenharmony_ci#define MC_VM_MX_L1_TLB_CNTL 0x2064 47562306a36Sopenharmony_ci#define ENABLE_L1_TLB (1 << 0) 47662306a36Sopenharmony_ci#define ENABLE_L1_FRAGMENT_PROCESSING (1 << 1) 47762306a36Sopenharmony_ci#define SYSTEM_ACCESS_MODE_PA_ONLY (0 << 3) 47862306a36Sopenharmony_ci#define SYSTEM_ACCESS_MODE_USE_SYS_MAP (1 << 3) 47962306a36Sopenharmony_ci#define SYSTEM_ACCESS_MODE_IN_SYS (2 << 3) 48062306a36Sopenharmony_ci#define SYSTEM_ACCESS_MODE_NOT_IN_SYS (3 << 3) 48162306a36Sopenharmony_ci#define SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU (0 << 5) 48262306a36Sopenharmony_ci#define ENABLE_ADVANCED_DRIVER_MODEL (1 << 6) 48362306a36Sopenharmony_ci 48462306a36Sopenharmony_ci#define MC_SHARED_BLACKOUT_CNTL 0x20ac 48562306a36Sopenharmony_ci 48662306a36Sopenharmony_ci#define MC_HUB_MISC_HUB_CG 0x20b8 48762306a36Sopenharmony_ci#define MC_HUB_MISC_VM_CG 0x20bc 48862306a36Sopenharmony_ci 48962306a36Sopenharmony_ci#define MC_HUB_MISC_SIP_CG 0x20c0 49062306a36Sopenharmony_ci 49162306a36Sopenharmony_ci#define MC_XPB_CLK_GAT 0x2478 49262306a36Sopenharmony_ci 49362306a36Sopenharmony_ci#define MC_CITF_MISC_RD_CG 0x2648 49462306a36Sopenharmony_ci#define MC_CITF_MISC_WR_CG 0x264c 49562306a36Sopenharmony_ci#define MC_CITF_MISC_VM_CG 0x2650 49662306a36Sopenharmony_ci 49762306a36Sopenharmony_ci#define MC_ARB_RAMCFG 0x2760 49862306a36Sopenharmony_ci#define NOOFBANK_SHIFT 0 49962306a36Sopenharmony_ci#define NOOFBANK_MASK 0x00000003 50062306a36Sopenharmony_ci#define NOOFRANK_SHIFT 2 50162306a36Sopenharmony_ci#define NOOFRANK_MASK 0x00000004 50262306a36Sopenharmony_ci#define NOOFROWS_SHIFT 3 50362306a36Sopenharmony_ci#define NOOFROWS_MASK 0x00000038 50462306a36Sopenharmony_ci#define NOOFCOLS_SHIFT 6 50562306a36Sopenharmony_ci#define NOOFCOLS_MASK 0x000000C0 50662306a36Sopenharmony_ci#define CHANSIZE_SHIFT 8 50762306a36Sopenharmony_ci#define CHANSIZE_MASK 0x00000100 50862306a36Sopenharmony_ci#define CHANSIZE_OVERRIDE (1 << 11) 50962306a36Sopenharmony_ci#define NOOFGROUPS_SHIFT 12 51062306a36Sopenharmony_ci#define NOOFGROUPS_MASK 0x00001000 51162306a36Sopenharmony_ci 51262306a36Sopenharmony_ci#define MC_ARB_DRAM_TIMING 0x2774 51362306a36Sopenharmony_ci#define MC_ARB_DRAM_TIMING2 0x2778 51462306a36Sopenharmony_ci 51562306a36Sopenharmony_ci#define MC_ARB_BURST_TIME 0x2808 51662306a36Sopenharmony_ci#define STATE0(x) ((x) << 0) 51762306a36Sopenharmony_ci#define STATE0_MASK (0x1f << 0) 51862306a36Sopenharmony_ci#define STATE0_SHIFT 0 51962306a36Sopenharmony_ci#define STATE1(x) ((x) << 5) 52062306a36Sopenharmony_ci#define STATE1_MASK (0x1f << 5) 52162306a36Sopenharmony_ci#define STATE1_SHIFT 5 52262306a36Sopenharmony_ci#define STATE2(x) ((x) << 10) 52362306a36Sopenharmony_ci#define STATE2_MASK (0x1f << 10) 52462306a36Sopenharmony_ci#define STATE2_SHIFT 10 52562306a36Sopenharmony_ci#define STATE3(x) ((x) << 15) 52662306a36Sopenharmony_ci#define STATE3_MASK (0x1f << 15) 52762306a36Sopenharmony_ci#define STATE3_SHIFT 15 52862306a36Sopenharmony_ci 52962306a36Sopenharmony_ci#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x28e8 53062306a36Sopenharmony_ci#define TRAIN_DONE_D0 (1 << 30) 53162306a36Sopenharmony_ci#define TRAIN_DONE_D1 (1 << 31) 53262306a36Sopenharmony_ci 53362306a36Sopenharmony_ci#define MC_SEQ_SUP_CNTL 0x28c8 53462306a36Sopenharmony_ci#define RUN_MASK (1 << 0) 53562306a36Sopenharmony_ci#define MC_SEQ_SUP_PGM 0x28cc 53662306a36Sopenharmony_ci#define MC_PMG_AUTO_CMD 0x28d0 53762306a36Sopenharmony_ci 53862306a36Sopenharmony_ci#define MC_IO_PAD_CNTL_D0 0x29d0 53962306a36Sopenharmony_ci#define MEM_FALL_OUT_CMD (1 << 8) 54062306a36Sopenharmony_ci 54162306a36Sopenharmony_ci#define MC_SEQ_RAS_TIMING 0x28a0 54262306a36Sopenharmony_ci#define MC_SEQ_CAS_TIMING 0x28a4 54362306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING 0x28a8 54462306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING2 0x28ac 54562306a36Sopenharmony_ci#define MC_SEQ_PMG_TIMING 0x28b0 54662306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D0 0x28b4 54762306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D1 0x28b8 54862306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D0 0x28bc 54962306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D1 0x28c0 55062306a36Sopenharmony_ci 55162306a36Sopenharmony_ci#define MC_SEQ_MISC0 0x2a00 55262306a36Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_SHIFT 8 55362306a36Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_MASK 0x00000f00 55462306a36Sopenharmony_ci#define MC_SEQ_MISC0_VEN_ID_VALUE 3 55562306a36Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_SHIFT 12 55662306a36Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_MASK 0x0000f000 55762306a36Sopenharmony_ci#define MC_SEQ_MISC0_REV_ID_VALUE 1 55862306a36Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_SHIFT 28 55962306a36Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_MASK 0xf0000000 56062306a36Sopenharmony_ci#define MC_SEQ_MISC0_GDDR5_VALUE 5 56162306a36Sopenharmony_ci#define MC_SEQ_MISC1 0x2a04 56262306a36Sopenharmony_ci#define MC_SEQ_RESERVE_M 0x2a08 56362306a36Sopenharmony_ci#define MC_PMG_CMD_EMRS 0x2a0c 56462306a36Sopenharmony_ci 56562306a36Sopenharmony_ci#define MC_SEQ_IO_DEBUG_INDEX 0x2a44 56662306a36Sopenharmony_ci#define MC_SEQ_IO_DEBUG_DATA 0x2a48 56762306a36Sopenharmony_ci 56862306a36Sopenharmony_ci#define MC_SEQ_MISC5 0x2a54 56962306a36Sopenharmony_ci#define MC_SEQ_MISC6 0x2a58 57062306a36Sopenharmony_ci 57162306a36Sopenharmony_ci#define MC_SEQ_MISC7 0x2a64 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci#define MC_SEQ_RAS_TIMING_LP 0x2a6c 57462306a36Sopenharmony_ci#define MC_SEQ_CAS_TIMING_LP 0x2a70 57562306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING_LP 0x2a74 57662306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING2_LP 0x2a78 57762306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D0_LP 0x2a7c 57862306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D1_LP 0x2a80 57962306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_EMRS_LP 0x2a84 58062306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS_LP 0x2a88 58162306a36Sopenharmony_ci 58262306a36Sopenharmony_ci#define MC_PMG_CMD_MRS 0x2aac 58362306a36Sopenharmony_ci 58462306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D0_LP 0x2b1c 58562306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D1_LP 0x2b20 58662306a36Sopenharmony_ci 58762306a36Sopenharmony_ci#define MC_PMG_CMD_MRS1 0x2b44 58862306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS1_LP 0x2b48 58962306a36Sopenharmony_ci#define MC_SEQ_PMG_TIMING_LP 0x2b4c 59062306a36Sopenharmony_ci 59162306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_2 0x2b54 59262306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_2_LP 0x2b58 59362306a36Sopenharmony_ci#define MC_PMG_CMD_MRS2 0x2b5c 59462306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS2_LP 0x2b60 59562306a36Sopenharmony_ci 59662306a36Sopenharmony_ci#define MCLK_PWRMGT_CNTL 0x2ba0 59762306a36Sopenharmony_ci# define DLL_SPEED(x) ((x) << 0) 59862306a36Sopenharmony_ci# define DLL_SPEED_MASK (0x1f << 0) 59962306a36Sopenharmony_ci# define DLL_READY (1 << 6) 60062306a36Sopenharmony_ci# define MC_INT_CNTL (1 << 7) 60162306a36Sopenharmony_ci# define MRDCK0_PDNB (1 << 8) 60262306a36Sopenharmony_ci# define MRDCK1_PDNB (1 << 9) 60362306a36Sopenharmony_ci# define MRDCK0_RESET (1 << 16) 60462306a36Sopenharmony_ci# define MRDCK1_RESET (1 << 17) 60562306a36Sopenharmony_ci# define DLL_READY_READ (1 << 24) 60662306a36Sopenharmony_ci#define DLL_CNTL 0x2ba4 60762306a36Sopenharmony_ci# define MRDCK0_BYPASS (1 << 24) 60862306a36Sopenharmony_ci# define MRDCK1_BYPASS (1 << 25) 60962306a36Sopenharmony_ci 61062306a36Sopenharmony_ci#define MPLL_CNTL_MODE 0x2bb0 61162306a36Sopenharmony_ci# define MPLL_MCLK_SEL (1 << 11) 61262306a36Sopenharmony_ci#define MPLL_FUNC_CNTL 0x2bb4 61362306a36Sopenharmony_ci#define BWCTRL(x) ((x) << 20) 61462306a36Sopenharmony_ci#define BWCTRL_MASK (0xff << 20) 61562306a36Sopenharmony_ci#define MPLL_FUNC_CNTL_1 0x2bb8 61662306a36Sopenharmony_ci#define VCO_MODE(x) ((x) << 0) 61762306a36Sopenharmony_ci#define VCO_MODE_MASK (3 << 0) 61862306a36Sopenharmony_ci#define CLKFRAC(x) ((x) << 4) 61962306a36Sopenharmony_ci#define CLKFRAC_MASK (0xfff << 4) 62062306a36Sopenharmony_ci#define CLKF(x) ((x) << 16) 62162306a36Sopenharmony_ci#define CLKF_MASK (0xfff << 16) 62262306a36Sopenharmony_ci#define MPLL_FUNC_CNTL_2 0x2bbc 62362306a36Sopenharmony_ci#define MPLL_AD_FUNC_CNTL 0x2bc0 62462306a36Sopenharmony_ci#define YCLK_POST_DIV(x) ((x) << 0) 62562306a36Sopenharmony_ci#define YCLK_POST_DIV_MASK (7 << 0) 62662306a36Sopenharmony_ci#define MPLL_DQ_FUNC_CNTL 0x2bc4 62762306a36Sopenharmony_ci#define YCLK_SEL(x) ((x) << 4) 62862306a36Sopenharmony_ci#define YCLK_SEL_MASK (1 << 4) 62962306a36Sopenharmony_ci 63062306a36Sopenharmony_ci#define MPLL_SS1 0x2bcc 63162306a36Sopenharmony_ci#define CLKV(x) ((x) << 0) 63262306a36Sopenharmony_ci#define CLKV_MASK (0x3ffffff << 0) 63362306a36Sopenharmony_ci#define MPLL_SS2 0x2bd0 63462306a36Sopenharmony_ci#define CLKS(x) ((x) << 0) 63562306a36Sopenharmony_ci#define CLKS_MASK (0xfff << 0) 63662306a36Sopenharmony_ci 63762306a36Sopenharmony_ci#define HDP_HOST_PATH_CNTL 0x2C00 63862306a36Sopenharmony_ci#define CLOCK_GATING_DIS (1 << 23) 63962306a36Sopenharmony_ci#define HDP_NONSURFACE_BASE 0x2C04 64062306a36Sopenharmony_ci#define HDP_NONSURFACE_INFO 0x2C08 64162306a36Sopenharmony_ci#define HDP_NONSURFACE_SIZE 0x2C0C 64262306a36Sopenharmony_ci 64362306a36Sopenharmony_ci#define HDP_ADDR_CONFIG 0x2F48 64462306a36Sopenharmony_ci#define HDP_MISC_CNTL 0x2F4C 64562306a36Sopenharmony_ci#define HDP_FLUSH_INVALIDATE_CACHE (1 << 0) 64662306a36Sopenharmony_ci#define HDP_MEM_POWER_LS 0x2F50 64762306a36Sopenharmony_ci#define HDP_LS_ENABLE (1 << 0) 64862306a36Sopenharmony_ci 64962306a36Sopenharmony_ci#define ATC_MISC_CG 0x3350 65062306a36Sopenharmony_ci 65162306a36Sopenharmony_ci#define IH_RB_CNTL 0x3e00 65262306a36Sopenharmony_ci# define IH_RB_ENABLE (1 << 0) 65362306a36Sopenharmony_ci# define IH_IB_SIZE(x) ((x) << 1) /* log2 */ 65462306a36Sopenharmony_ci# define IH_RB_FULL_DRAIN_ENABLE (1 << 6) 65562306a36Sopenharmony_ci# define IH_WPTR_WRITEBACK_ENABLE (1 << 8) 65662306a36Sopenharmony_ci# define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */ 65762306a36Sopenharmony_ci# define IH_WPTR_OVERFLOW_ENABLE (1 << 16) 65862306a36Sopenharmony_ci# define IH_WPTR_OVERFLOW_CLEAR (1 << 31) 65962306a36Sopenharmony_ci#define IH_RB_BASE 0x3e04 66062306a36Sopenharmony_ci#define IH_RB_RPTR 0x3e08 66162306a36Sopenharmony_ci#define IH_RB_WPTR 0x3e0c 66262306a36Sopenharmony_ci# define RB_OVERFLOW (1 << 0) 66362306a36Sopenharmony_ci# define WPTR_OFFSET_MASK 0x3fffc 66462306a36Sopenharmony_ci#define IH_RB_WPTR_ADDR_HI 0x3e10 66562306a36Sopenharmony_ci#define IH_RB_WPTR_ADDR_LO 0x3e14 66662306a36Sopenharmony_ci#define IH_CNTL 0x3e18 66762306a36Sopenharmony_ci# define ENABLE_INTR (1 << 0) 66862306a36Sopenharmony_ci# define IH_MC_SWAP(x) ((x) << 1) 66962306a36Sopenharmony_ci# define IH_MC_SWAP_NONE 0 67062306a36Sopenharmony_ci# define IH_MC_SWAP_16BIT 1 67162306a36Sopenharmony_ci# define IH_MC_SWAP_32BIT 2 67262306a36Sopenharmony_ci# define IH_MC_SWAP_64BIT 3 67362306a36Sopenharmony_ci# define RPTR_REARM (1 << 4) 67462306a36Sopenharmony_ci# define MC_WRREQ_CREDIT(x) ((x) << 15) 67562306a36Sopenharmony_ci# define MC_WR_CLEAN_CNT(x) ((x) << 20) 67662306a36Sopenharmony_ci# define MC_VMID(x) ((x) << 25) 67762306a36Sopenharmony_ci 67862306a36Sopenharmony_ci#define CONFIG_MEMSIZE 0x5428 67962306a36Sopenharmony_ci 68062306a36Sopenharmony_ci#define INTERRUPT_CNTL 0x5468 68162306a36Sopenharmony_ci# define IH_DUMMY_RD_OVERRIDE (1 << 0) 68262306a36Sopenharmony_ci# define IH_DUMMY_RD_EN (1 << 1) 68362306a36Sopenharmony_ci# define IH_REQ_NONSNOOP_EN (1 << 3) 68462306a36Sopenharmony_ci# define GEN_IH_INT_EN (1 << 8) 68562306a36Sopenharmony_ci#define INTERRUPT_CNTL2 0x546c 68662306a36Sopenharmony_ci 68762306a36Sopenharmony_ci#define HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480 68862306a36Sopenharmony_ci 68962306a36Sopenharmony_ci#define BIF_FB_EN 0x5490 69062306a36Sopenharmony_ci#define FB_READ_EN (1 << 0) 69162306a36Sopenharmony_ci#define FB_WRITE_EN (1 << 1) 69262306a36Sopenharmony_ci 69362306a36Sopenharmony_ci#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 69462306a36Sopenharmony_ci 69562306a36Sopenharmony_ci/* DCE6 ELD audio interface */ 69662306a36Sopenharmony_ci#define AZ_F0_CODEC_ENDPOINT_INDEX 0x5E00 69762306a36Sopenharmony_ci# define AZ_ENDPOINT_REG_INDEX(x) (((x) & 0xff) << 0) 69862306a36Sopenharmony_ci# define AZ_ENDPOINT_REG_WRITE_EN (1 << 8) 69962306a36Sopenharmony_ci#define AZ_F0_CODEC_ENDPOINT_DATA 0x5E04 70062306a36Sopenharmony_ci 70162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER 0x25 70262306a36Sopenharmony_ci#define SPEAKER_ALLOCATION(x) (((x) & 0x7f) << 0) 70362306a36Sopenharmony_ci#define SPEAKER_ALLOCATION_MASK (0x7f << 0) 70462306a36Sopenharmony_ci#define SPEAKER_ALLOCATION_SHIFT 0 70562306a36Sopenharmony_ci#define HDMI_CONNECTION (1 << 16) 70662306a36Sopenharmony_ci#define DP_CONNECTION (1 << 17) 70762306a36Sopenharmony_ci 70862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR0 0x28 /* LPCM */ 70962306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR1 0x29 /* AC3 */ 71062306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR2 0x2A /* MPEG1 */ 71162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR3 0x2B /* MP3 */ 71262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR4 0x2C /* MPEG2 */ 71362306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR5 0x2D /* AAC */ 71462306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR6 0x2E /* DTS */ 71562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR7 0x2F /* ATRAC */ 71662306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR8 0x30 /* one bit audio - leave at 0 (default) */ 71762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR9 0x31 /* Dolby Digital */ 71862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR10 0x32 /* DTS-HD */ 71962306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR11 0x33 /* MAT-MLP */ 72062306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR12 0x34 /* DTS */ 72162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR13 0x35 /* WMA Pro */ 72262306a36Sopenharmony_ci# define MAX_CHANNELS(x) (((x) & 0x7) << 0) 72362306a36Sopenharmony_ci/* max channels minus one. 7 = 8 channels */ 72462306a36Sopenharmony_ci# define SUPPORTED_FREQUENCIES(x) (((x) & 0xff) << 8) 72562306a36Sopenharmony_ci# define DESCRIPTOR_BYTE_2(x) (((x) & 0xff) << 16) 72662306a36Sopenharmony_ci# define SUPPORTED_FREQUENCIES_STEREO(x) (((x) & 0xff) << 24) /* LPCM only */ 72762306a36Sopenharmony_ci/* SUPPORTED_FREQUENCIES, SUPPORTED_FREQUENCIES_STEREO 72862306a36Sopenharmony_ci * bit0 = 32 kHz 72962306a36Sopenharmony_ci * bit1 = 44.1 kHz 73062306a36Sopenharmony_ci * bit2 = 48 kHz 73162306a36Sopenharmony_ci * bit3 = 88.2 kHz 73262306a36Sopenharmony_ci * bit4 = 96 kHz 73362306a36Sopenharmony_ci * bit5 = 176.4 kHz 73462306a36Sopenharmony_ci * bit6 = 192 kHz 73562306a36Sopenharmony_ci */ 73662306a36Sopenharmony_ci 73762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC 0x37 73862306a36Sopenharmony_ci# define VIDEO_LIPSYNC(x) (((x) & 0xff) << 0) 73962306a36Sopenharmony_ci# define AUDIO_LIPSYNC(x) (((x) & 0xff) << 8) 74062306a36Sopenharmony_ci/* VIDEO_LIPSYNC, AUDIO_LIPSYNC 74162306a36Sopenharmony_ci * 0 = invalid 74262306a36Sopenharmony_ci * x = legal delay value 74362306a36Sopenharmony_ci * 255 = sync not supported 74462306a36Sopenharmony_ci */ 74562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_HBR 0x38 74662306a36Sopenharmony_ci# define HBR_CAPABLE (1 << 0) /* enabled by default */ 74762306a36Sopenharmony_ci 74862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO0 0x3a 74962306a36Sopenharmony_ci# define MANUFACTURER_ID(x) (((x) & 0xffff) << 0) 75062306a36Sopenharmony_ci# define PRODUCT_ID(x) (((x) & 0xffff) << 16) 75162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO1 0x3b 75262306a36Sopenharmony_ci# define SINK_DESCRIPTION_LEN(x) (((x) & 0xff) << 0) 75362306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO2 0x3c 75462306a36Sopenharmony_ci# define PORT_ID0(x) (((x) & 0xffffffff) << 0) 75562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO3 0x3d 75662306a36Sopenharmony_ci# define PORT_ID1(x) (((x) & 0xffffffff) << 0) 75762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO4 0x3e 75862306a36Sopenharmony_ci# define DESCRIPTION0(x) (((x) & 0xff) << 0) 75962306a36Sopenharmony_ci# define DESCRIPTION1(x) (((x) & 0xff) << 8) 76062306a36Sopenharmony_ci# define DESCRIPTION2(x) (((x) & 0xff) << 16) 76162306a36Sopenharmony_ci# define DESCRIPTION3(x) (((x) & 0xff) << 24) 76262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO5 0x3f 76362306a36Sopenharmony_ci# define DESCRIPTION4(x) (((x) & 0xff) << 0) 76462306a36Sopenharmony_ci# define DESCRIPTION5(x) (((x) & 0xff) << 8) 76562306a36Sopenharmony_ci# define DESCRIPTION6(x) (((x) & 0xff) << 16) 76662306a36Sopenharmony_ci# define DESCRIPTION7(x) (((x) & 0xff) << 24) 76762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO6 0x40 76862306a36Sopenharmony_ci# define DESCRIPTION8(x) (((x) & 0xff) << 0) 76962306a36Sopenharmony_ci# define DESCRIPTION9(x) (((x) & 0xff) << 8) 77062306a36Sopenharmony_ci# define DESCRIPTION10(x) (((x) & 0xff) << 16) 77162306a36Sopenharmony_ci# define DESCRIPTION11(x) (((x) & 0xff) << 24) 77262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO7 0x41 77362306a36Sopenharmony_ci# define DESCRIPTION12(x) (((x) & 0xff) << 0) 77462306a36Sopenharmony_ci# define DESCRIPTION13(x) (((x) & 0xff) << 8) 77562306a36Sopenharmony_ci# define DESCRIPTION14(x) (((x) & 0xff) << 16) 77662306a36Sopenharmony_ci# define DESCRIPTION15(x) (((x) & 0xff) << 24) 77762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO8 0x42 77862306a36Sopenharmony_ci# define DESCRIPTION16(x) (((x) & 0xff) << 0) 77962306a36Sopenharmony_ci# define DESCRIPTION17(x) (((x) & 0xff) << 8) 78062306a36Sopenharmony_ci 78162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL 0x54 78262306a36Sopenharmony_ci# define AUDIO_ENABLED (1 << 31) 78362306a36Sopenharmony_ci 78462306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_CONFIGURATION_DEFAULT 0x56 78562306a36Sopenharmony_ci#define PORT_CONNECTIVITY_MASK (3 << 30) 78662306a36Sopenharmony_ci#define PORT_CONNECTIVITY_SHIFT 30 78762306a36Sopenharmony_ci 78862306a36Sopenharmony_ci#define DC_LB_MEMORY_SPLIT 0x6b0c 78962306a36Sopenharmony_ci#define DC_LB_MEMORY_CONFIG(x) ((x) << 20) 79062306a36Sopenharmony_ci 79162306a36Sopenharmony_ci#define PRIORITY_A_CNT 0x6b18 79262306a36Sopenharmony_ci#define PRIORITY_MARK_MASK 0x7fff 79362306a36Sopenharmony_ci#define PRIORITY_OFF (1 << 16) 79462306a36Sopenharmony_ci#define PRIORITY_ALWAYS_ON (1 << 20) 79562306a36Sopenharmony_ci#define PRIORITY_B_CNT 0x6b1c 79662306a36Sopenharmony_ci 79762306a36Sopenharmony_ci#define DPG_PIPE_ARBITRATION_CONTROL3 0x6cc8 79862306a36Sopenharmony_ci# define LATENCY_WATERMARK_MASK(x) ((x) << 16) 79962306a36Sopenharmony_ci#define DPG_PIPE_LATENCY_CONTROL 0x6ccc 80062306a36Sopenharmony_ci# define LATENCY_LOW_WATERMARK(x) ((x) << 0) 80162306a36Sopenharmony_ci# define LATENCY_HIGH_WATERMARK(x) ((x) << 16) 80262306a36Sopenharmony_ci 80362306a36Sopenharmony_ci/* 0x6bb8, 0x77b8, 0x103b8, 0x10fb8, 0x11bb8, 0x127b8 */ 80462306a36Sopenharmony_ci#define VLINE_STATUS 0x6bb8 80562306a36Sopenharmony_ci# define VLINE_OCCURRED (1 << 0) 80662306a36Sopenharmony_ci# define VLINE_ACK (1 << 4) 80762306a36Sopenharmony_ci# define VLINE_STAT (1 << 12) 80862306a36Sopenharmony_ci# define VLINE_INTERRUPT (1 << 16) 80962306a36Sopenharmony_ci# define VLINE_INTERRUPT_TYPE (1 << 17) 81062306a36Sopenharmony_ci/* 0x6bbc, 0x77bc, 0x103bc, 0x10fbc, 0x11bbc, 0x127bc */ 81162306a36Sopenharmony_ci#define VBLANK_STATUS 0x6bbc 81262306a36Sopenharmony_ci# define VBLANK_OCCURRED (1 << 0) 81362306a36Sopenharmony_ci# define VBLANK_ACK (1 << 4) 81462306a36Sopenharmony_ci# define VBLANK_STAT (1 << 12) 81562306a36Sopenharmony_ci# define VBLANK_INTERRUPT (1 << 16) 81662306a36Sopenharmony_ci# define VBLANK_INTERRUPT_TYPE (1 << 17) 81762306a36Sopenharmony_ci 81862306a36Sopenharmony_ci/* 0x6b40, 0x7740, 0x10340, 0x10f40, 0x11b40, 0x12740 */ 81962306a36Sopenharmony_ci#define INT_MASK 0x6b40 82062306a36Sopenharmony_ci# define VBLANK_INT_MASK (1 << 0) 82162306a36Sopenharmony_ci# define VLINE_INT_MASK (1 << 4) 82262306a36Sopenharmony_ci 82362306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS 0x60f4 82462306a36Sopenharmony_ci# define LB_D1_VLINE_INTERRUPT (1 << 2) 82562306a36Sopenharmony_ci# define LB_D1_VBLANK_INTERRUPT (1 << 3) 82662306a36Sopenharmony_ci# define DC_HPD1_INTERRUPT (1 << 17) 82762306a36Sopenharmony_ci# define DC_HPD1_RX_INTERRUPT (1 << 18) 82862306a36Sopenharmony_ci# define DACA_AUTODETECT_INTERRUPT (1 << 22) 82962306a36Sopenharmony_ci# define DACB_AUTODETECT_INTERRUPT (1 << 23) 83062306a36Sopenharmony_ci# define DC_I2C_SW_DONE_INTERRUPT (1 << 24) 83162306a36Sopenharmony_ci# define DC_I2C_HW_DONE_INTERRUPT (1 << 25) 83262306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE 0x60f8 83362306a36Sopenharmony_ci# define LB_D2_VLINE_INTERRUPT (1 << 2) 83462306a36Sopenharmony_ci# define LB_D2_VBLANK_INTERRUPT (1 << 3) 83562306a36Sopenharmony_ci# define DC_HPD2_INTERRUPT (1 << 17) 83662306a36Sopenharmony_ci# define DC_HPD2_RX_INTERRUPT (1 << 18) 83762306a36Sopenharmony_ci# define DISP_TIMER_INTERRUPT (1 << 24) 83862306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE2 0x60fc 83962306a36Sopenharmony_ci# define LB_D3_VLINE_INTERRUPT (1 << 2) 84062306a36Sopenharmony_ci# define LB_D3_VBLANK_INTERRUPT (1 << 3) 84162306a36Sopenharmony_ci# define DC_HPD3_INTERRUPT (1 << 17) 84262306a36Sopenharmony_ci# define DC_HPD3_RX_INTERRUPT (1 << 18) 84362306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE3 0x6100 84462306a36Sopenharmony_ci# define LB_D4_VLINE_INTERRUPT (1 << 2) 84562306a36Sopenharmony_ci# define LB_D4_VBLANK_INTERRUPT (1 << 3) 84662306a36Sopenharmony_ci# define DC_HPD4_INTERRUPT (1 << 17) 84762306a36Sopenharmony_ci# define DC_HPD4_RX_INTERRUPT (1 << 18) 84862306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE4 0x614c 84962306a36Sopenharmony_ci# define LB_D5_VLINE_INTERRUPT (1 << 2) 85062306a36Sopenharmony_ci# define LB_D5_VBLANK_INTERRUPT (1 << 3) 85162306a36Sopenharmony_ci# define DC_HPD5_INTERRUPT (1 << 17) 85262306a36Sopenharmony_ci# define DC_HPD5_RX_INTERRUPT (1 << 18) 85362306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE5 0x6150 85462306a36Sopenharmony_ci# define LB_D6_VLINE_INTERRUPT (1 << 2) 85562306a36Sopenharmony_ci# define LB_D6_VBLANK_INTERRUPT (1 << 3) 85662306a36Sopenharmony_ci# define DC_HPD6_INTERRUPT (1 << 17) 85762306a36Sopenharmony_ci# define DC_HPD6_RX_INTERRUPT (1 << 18) 85862306a36Sopenharmony_ci 85962306a36Sopenharmony_ci/* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */ 86062306a36Sopenharmony_ci#define GRPH_INT_STATUS 0x6858 86162306a36Sopenharmony_ci# define GRPH_PFLIP_INT_OCCURRED (1 << 0) 86262306a36Sopenharmony_ci# define GRPH_PFLIP_INT_CLEAR (1 << 8) 86362306a36Sopenharmony_ci/* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */ 86462306a36Sopenharmony_ci#define GRPH_INT_CONTROL 0x685c 86562306a36Sopenharmony_ci# define GRPH_PFLIP_INT_MASK (1 << 0) 86662306a36Sopenharmony_ci# define GRPH_PFLIP_INT_TYPE (1 << 8) 86762306a36Sopenharmony_ci 86862306a36Sopenharmony_ci#define DAC_AUTODETECT_INT_CONTROL 0x67c8 86962306a36Sopenharmony_ci 87062306a36Sopenharmony_ci#define DC_HPD1_INT_STATUS 0x601c 87162306a36Sopenharmony_ci#define DC_HPD2_INT_STATUS 0x6028 87262306a36Sopenharmony_ci#define DC_HPD3_INT_STATUS 0x6034 87362306a36Sopenharmony_ci#define DC_HPD4_INT_STATUS 0x6040 87462306a36Sopenharmony_ci#define DC_HPD5_INT_STATUS 0x604c 87562306a36Sopenharmony_ci#define DC_HPD6_INT_STATUS 0x6058 87662306a36Sopenharmony_ci# define DC_HPDx_INT_STATUS (1 << 0) 87762306a36Sopenharmony_ci# define DC_HPDx_SENSE (1 << 1) 87862306a36Sopenharmony_ci# define DC_HPDx_RX_INT_STATUS (1 << 8) 87962306a36Sopenharmony_ci 88062306a36Sopenharmony_ci#define DC_HPD1_INT_CONTROL 0x6020 88162306a36Sopenharmony_ci#define DC_HPD2_INT_CONTROL 0x602c 88262306a36Sopenharmony_ci#define DC_HPD3_INT_CONTROL 0x6038 88362306a36Sopenharmony_ci#define DC_HPD4_INT_CONTROL 0x6044 88462306a36Sopenharmony_ci#define DC_HPD5_INT_CONTROL 0x6050 88562306a36Sopenharmony_ci#define DC_HPD6_INT_CONTROL 0x605c 88662306a36Sopenharmony_ci# define DC_HPDx_INT_ACK (1 << 0) 88762306a36Sopenharmony_ci# define DC_HPDx_INT_POLARITY (1 << 8) 88862306a36Sopenharmony_ci# define DC_HPDx_INT_EN (1 << 16) 88962306a36Sopenharmony_ci# define DC_HPDx_RX_INT_ACK (1 << 20) 89062306a36Sopenharmony_ci# define DC_HPDx_RX_INT_EN (1 << 24) 89162306a36Sopenharmony_ci 89262306a36Sopenharmony_ci#define DC_HPD1_CONTROL 0x6024 89362306a36Sopenharmony_ci#define DC_HPD2_CONTROL 0x6030 89462306a36Sopenharmony_ci#define DC_HPD3_CONTROL 0x603c 89562306a36Sopenharmony_ci#define DC_HPD4_CONTROL 0x6048 89662306a36Sopenharmony_ci#define DC_HPD5_CONTROL 0x6054 89762306a36Sopenharmony_ci#define DC_HPD6_CONTROL 0x6060 89862306a36Sopenharmony_ci# define DC_HPDx_CONNECTION_TIMER(x) ((x) << 0) 89962306a36Sopenharmony_ci# define DC_HPDx_RX_INT_TIMER(x) ((x) << 16) 90062306a36Sopenharmony_ci# define DC_HPDx_EN (1 << 28) 90162306a36Sopenharmony_ci 90262306a36Sopenharmony_ci#define DPG_PIPE_STUTTER_CONTROL 0x6cd4 90362306a36Sopenharmony_ci# define STUTTER_ENABLE (1 << 0) 90462306a36Sopenharmony_ci 90562306a36Sopenharmony_ci/* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */ 90662306a36Sopenharmony_ci#define CRTC_STATUS_FRAME_COUNT 0x6e98 90762306a36Sopenharmony_ci 90862306a36Sopenharmony_ci/* Audio clocks */ 90962306a36Sopenharmony_ci#define DCCG_AUDIO_DTO_SOURCE 0x05ac 91062306a36Sopenharmony_ci# define DCCG_AUDIO_DTO0_SOURCE_SEL(x) ((x) << 0) /* crtc0 - crtc5 */ 91162306a36Sopenharmony_ci# define DCCG_AUDIO_DTO_SEL (1 << 4) /* 0=dto0 1=dto1 */ 91262306a36Sopenharmony_ci 91362306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_PHASE 0x05b0 91462306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_MODULE 0x05b4 91562306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_PHASE 0x05c0 91662306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_MODULE 0x05c4 91762306a36Sopenharmony_ci 91862306a36Sopenharmony_ci#define DENTIST_DISPCLK_CNTL 0x0490 91962306a36Sopenharmony_ci# define DENTIST_DPREFCLK_WDIVIDER(x) (((x) & 0x7f) << 24) 92062306a36Sopenharmony_ci# define DENTIST_DPREFCLK_WDIVIDER_MASK (0x7f << 24) 92162306a36Sopenharmony_ci# define DENTIST_DPREFCLK_WDIVIDER_SHIFT 24 92262306a36Sopenharmony_ci 92362306a36Sopenharmony_ci#define AFMT_AUDIO_SRC_CONTROL 0x713c 92462306a36Sopenharmony_ci#define AFMT_AUDIO_SRC_SELECT(x) (((x) & 7) << 0) 92562306a36Sopenharmony_ci/* AFMT_AUDIO_SRC_SELECT 92662306a36Sopenharmony_ci * 0 = stream0 92762306a36Sopenharmony_ci * 1 = stream1 92862306a36Sopenharmony_ci * 2 = stream2 92962306a36Sopenharmony_ci * 3 = stream3 93062306a36Sopenharmony_ci * 4 = stream4 93162306a36Sopenharmony_ci * 5 = stream5 93262306a36Sopenharmony_ci */ 93362306a36Sopenharmony_ci 93462306a36Sopenharmony_ci#define GRBM_CNTL 0x8000 93562306a36Sopenharmony_ci#define GRBM_READ_TIMEOUT(x) ((x) << 0) 93662306a36Sopenharmony_ci 93762306a36Sopenharmony_ci#define GRBM_STATUS2 0x8008 93862306a36Sopenharmony_ci#define RLC_RQ_PENDING (1 << 0) 93962306a36Sopenharmony_ci#define RLC_BUSY (1 << 8) 94062306a36Sopenharmony_ci#define TC_BUSY (1 << 9) 94162306a36Sopenharmony_ci 94262306a36Sopenharmony_ci#define GRBM_STATUS 0x8010 94362306a36Sopenharmony_ci#define CMDFIFO_AVAIL_MASK 0x0000000F 94462306a36Sopenharmony_ci#define RING2_RQ_PENDING (1 << 4) 94562306a36Sopenharmony_ci#define SRBM_RQ_PENDING (1 << 5) 94662306a36Sopenharmony_ci#define RING1_RQ_PENDING (1 << 6) 94762306a36Sopenharmony_ci#define CF_RQ_PENDING (1 << 7) 94862306a36Sopenharmony_ci#define PF_RQ_PENDING (1 << 8) 94962306a36Sopenharmony_ci#define GDS_DMA_RQ_PENDING (1 << 9) 95062306a36Sopenharmony_ci#define GRBM_EE_BUSY (1 << 10) 95162306a36Sopenharmony_ci#define DB_CLEAN (1 << 12) 95262306a36Sopenharmony_ci#define CB_CLEAN (1 << 13) 95362306a36Sopenharmony_ci#define TA_BUSY (1 << 14) 95462306a36Sopenharmony_ci#define GDS_BUSY (1 << 15) 95562306a36Sopenharmony_ci#define VGT_BUSY (1 << 17) 95662306a36Sopenharmony_ci#define IA_BUSY_NO_DMA (1 << 18) 95762306a36Sopenharmony_ci#define IA_BUSY (1 << 19) 95862306a36Sopenharmony_ci#define SX_BUSY (1 << 20) 95962306a36Sopenharmony_ci#define SPI_BUSY (1 << 22) 96062306a36Sopenharmony_ci#define BCI_BUSY (1 << 23) 96162306a36Sopenharmony_ci#define SC_BUSY (1 << 24) 96262306a36Sopenharmony_ci#define PA_BUSY (1 << 25) 96362306a36Sopenharmony_ci#define DB_BUSY (1 << 26) 96462306a36Sopenharmony_ci#define CP_COHERENCY_BUSY (1 << 28) 96562306a36Sopenharmony_ci#define CP_BUSY (1 << 29) 96662306a36Sopenharmony_ci#define CB_BUSY (1 << 30) 96762306a36Sopenharmony_ci#define GUI_ACTIVE (1 << 31) 96862306a36Sopenharmony_ci#define GRBM_STATUS_SE0 0x8014 96962306a36Sopenharmony_ci#define GRBM_STATUS_SE1 0x8018 97062306a36Sopenharmony_ci#define SE_DB_CLEAN (1 << 1) 97162306a36Sopenharmony_ci#define SE_CB_CLEAN (1 << 2) 97262306a36Sopenharmony_ci#define SE_BCI_BUSY (1 << 22) 97362306a36Sopenharmony_ci#define SE_VGT_BUSY (1 << 23) 97462306a36Sopenharmony_ci#define SE_PA_BUSY (1 << 24) 97562306a36Sopenharmony_ci#define SE_TA_BUSY (1 << 25) 97662306a36Sopenharmony_ci#define SE_SX_BUSY (1 << 26) 97762306a36Sopenharmony_ci#define SE_SPI_BUSY (1 << 27) 97862306a36Sopenharmony_ci#define SE_SC_BUSY (1 << 29) 97962306a36Sopenharmony_ci#define SE_DB_BUSY (1 << 30) 98062306a36Sopenharmony_ci#define SE_CB_BUSY (1 << 31) 98162306a36Sopenharmony_ci 98262306a36Sopenharmony_ci#define GRBM_SOFT_RESET 0x8020 98362306a36Sopenharmony_ci#define SOFT_RESET_CP (1 << 0) 98462306a36Sopenharmony_ci#define SOFT_RESET_CB (1 << 1) 98562306a36Sopenharmony_ci#define SOFT_RESET_RLC (1 << 2) 98662306a36Sopenharmony_ci#define SOFT_RESET_DB (1 << 3) 98762306a36Sopenharmony_ci#define SOFT_RESET_GDS (1 << 4) 98862306a36Sopenharmony_ci#define SOFT_RESET_PA (1 << 5) 98962306a36Sopenharmony_ci#define SOFT_RESET_SC (1 << 6) 99062306a36Sopenharmony_ci#define SOFT_RESET_BCI (1 << 7) 99162306a36Sopenharmony_ci#define SOFT_RESET_SPI (1 << 8) 99262306a36Sopenharmony_ci#define SOFT_RESET_SX (1 << 10) 99362306a36Sopenharmony_ci#define SOFT_RESET_TC (1 << 11) 99462306a36Sopenharmony_ci#define SOFT_RESET_TA (1 << 12) 99562306a36Sopenharmony_ci#define SOFT_RESET_VGT (1 << 14) 99662306a36Sopenharmony_ci#define SOFT_RESET_IA (1 << 15) 99762306a36Sopenharmony_ci 99862306a36Sopenharmony_ci#define GRBM_GFX_INDEX 0x802C 99962306a36Sopenharmony_ci#define INSTANCE_INDEX(x) ((x) << 0) 100062306a36Sopenharmony_ci#define SH_INDEX(x) ((x) << 8) 100162306a36Sopenharmony_ci#define SE_INDEX(x) ((x) << 16) 100262306a36Sopenharmony_ci#define SH_BROADCAST_WRITES (1 << 29) 100362306a36Sopenharmony_ci#define INSTANCE_BROADCAST_WRITES (1 << 30) 100462306a36Sopenharmony_ci#define SE_BROADCAST_WRITES (1 << 31) 100562306a36Sopenharmony_ci 100662306a36Sopenharmony_ci#define GRBM_INT_CNTL 0x8060 100762306a36Sopenharmony_ci# define RDERR_INT_ENABLE (1 << 0) 100862306a36Sopenharmony_ci# define GUI_IDLE_INT_ENABLE (1 << 19) 100962306a36Sopenharmony_ci 101062306a36Sopenharmony_ci#define CP_STRMOUT_CNTL 0x84FC 101162306a36Sopenharmony_ci#define SCRATCH_REG0 0x8500 101262306a36Sopenharmony_ci#define SCRATCH_REG1 0x8504 101362306a36Sopenharmony_ci#define SCRATCH_REG2 0x8508 101462306a36Sopenharmony_ci#define SCRATCH_REG3 0x850C 101562306a36Sopenharmony_ci#define SCRATCH_REG4 0x8510 101662306a36Sopenharmony_ci#define SCRATCH_REG5 0x8514 101762306a36Sopenharmony_ci#define SCRATCH_REG6 0x8518 101862306a36Sopenharmony_ci#define SCRATCH_REG7 0x851C 101962306a36Sopenharmony_ci 102062306a36Sopenharmony_ci#define SCRATCH_UMSK 0x8540 102162306a36Sopenharmony_ci#define SCRATCH_ADDR 0x8544 102262306a36Sopenharmony_ci 102362306a36Sopenharmony_ci#define CP_SEM_WAIT_TIMER 0x85BC 102462306a36Sopenharmony_ci 102562306a36Sopenharmony_ci#define CP_SEM_INCOMPLETE_TIMER_CNTL 0x85C8 102662306a36Sopenharmony_ci 102762306a36Sopenharmony_ci#define CP_ME_CNTL 0x86D8 102862306a36Sopenharmony_ci#define CP_CE_HALT (1 << 24) 102962306a36Sopenharmony_ci#define CP_PFP_HALT (1 << 26) 103062306a36Sopenharmony_ci#define CP_ME_HALT (1 << 28) 103162306a36Sopenharmony_ci 103262306a36Sopenharmony_ci#define CP_COHER_CNTL2 0x85E8 103362306a36Sopenharmony_ci 103462306a36Sopenharmony_ci#define CP_RB2_RPTR 0x86f8 103562306a36Sopenharmony_ci#define CP_RB1_RPTR 0x86fc 103662306a36Sopenharmony_ci#define CP_RB0_RPTR 0x8700 103762306a36Sopenharmony_ci#define CP_RB_WPTR_DELAY 0x8704 103862306a36Sopenharmony_ci 103962306a36Sopenharmony_ci#define CP_QUEUE_THRESHOLDS 0x8760 104062306a36Sopenharmony_ci#define ROQ_IB1_START(x) ((x) << 0) 104162306a36Sopenharmony_ci#define ROQ_IB2_START(x) ((x) << 8) 104262306a36Sopenharmony_ci#define CP_MEQ_THRESHOLDS 0x8764 104362306a36Sopenharmony_ci#define MEQ1_START(x) ((x) << 0) 104462306a36Sopenharmony_ci#define MEQ2_START(x) ((x) << 8) 104562306a36Sopenharmony_ci 104662306a36Sopenharmony_ci#define CP_PERFMON_CNTL 0x87FC 104762306a36Sopenharmony_ci 104862306a36Sopenharmony_ci#define VGT_VTX_VECT_EJECT_REG 0x88B0 104962306a36Sopenharmony_ci 105062306a36Sopenharmony_ci#define VGT_CACHE_INVALIDATION 0x88C4 105162306a36Sopenharmony_ci#define CACHE_INVALIDATION(x) ((x) << 0) 105262306a36Sopenharmony_ci#define VC_ONLY 0 105362306a36Sopenharmony_ci#define TC_ONLY 1 105462306a36Sopenharmony_ci#define VC_AND_TC 2 105562306a36Sopenharmony_ci#define AUTO_INVLD_EN(x) ((x) << 6) 105662306a36Sopenharmony_ci#define NO_AUTO 0 105762306a36Sopenharmony_ci#define ES_AUTO 1 105862306a36Sopenharmony_ci#define GS_AUTO 2 105962306a36Sopenharmony_ci#define ES_AND_GS_AUTO 3 106062306a36Sopenharmony_ci#define VGT_ESGS_RING_SIZE 0x88C8 106162306a36Sopenharmony_ci#define VGT_GSVS_RING_SIZE 0x88CC 106262306a36Sopenharmony_ci 106362306a36Sopenharmony_ci#define VGT_GS_VERTEX_REUSE 0x88D4 106462306a36Sopenharmony_ci 106562306a36Sopenharmony_ci#define VGT_PRIMITIVE_TYPE 0x8958 106662306a36Sopenharmony_ci#define VGT_INDEX_TYPE 0x895C 106762306a36Sopenharmony_ci 106862306a36Sopenharmony_ci#define VGT_NUM_INDICES 0x8970 106962306a36Sopenharmony_ci#define VGT_NUM_INSTANCES 0x8974 107062306a36Sopenharmony_ci 107162306a36Sopenharmony_ci#define VGT_TF_RING_SIZE 0x8988 107262306a36Sopenharmony_ci 107362306a36Sopenharmony_ci#define VGT_HS_OFFCHIP_PARAM 0x89B0 107462306a36Sopenharmony_ci 107562306a36Sopenharmony_ci#define VGT_TF_MEMORY_BASE 0x89B8 107662306a36Sopenharmony_ci 107762306a36Sopenharmony_ci#define CC_GC_SHADER_ARRAY_CONFIG 0x89bc 107862306a36Sopenharmony_ci#define INACTIVE_CUS_MASK 0xFFFF0000 107962306a36Sopenharmony_ci#define INACTIVE_CUS_SHIFT 16 108062306a36Sopenharmony_ci#define GC_USER_SHADER_ARRAY_CONFIG 0x89c0 108162306a36Sopenharmony_ci 108262306a36Sopenharmony_ci#define PA_CL_ENHANCE 0x8A14 108362306a36Sopenharmony_ci#define CLIP_VTX_REORDER_ENA (1 << 0) 108462306a36Sopenharmony_ci#define NUM_CLIP_SEQ(x) ((x) << 1) 108562306a36Sopenharmony_ci 108662306a36Sopenharmony_ci#define PA_SU_LINE_STIPPLE_VALUE 0x8A60 108762306a36Sopenharmony_ci 108862306a36Sopenharmony_ci#define PA_SC_LINE_STIPPLE_STATE 0x8B10 108962306a36Sopenharmony_ci 109062306a36Sopenharmony_ci#define PA_SC_FORCE_EOV_MAX_CNTS 0x8B24 109162306a36Sopenharmony_ci#define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) 109262306a36Sopenharmony_ci#define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) 109362306a36Sopenharmony_ci 109462306a36Sopenharmony_ci#define PA_SC_FIFO_SIZE 0x8BCC 109562306a36Sopenharmony_ci#define SC_FRONTEND_PRIM_FIFO_SIZE(x) ((x) << 0) 109662306a36Sopenharmony_ci#define SC_BACKEND_PRIM_FIFO_SIZE(x) ((x) << 6) 109762306a36Sopenharmony_ci#define SC_HIZ_TILE_FIFO_SIZE(x) ((x) << 15) 109862306a36Sopenharmony_ci#define SC_EARLYZ_TILE_FIFO_SIZE(x) ((x) << 23) 109962306a36Sopenharmony_ci 110062306a36Sopenharmony_ci#define PA_SC_ENHANCE 0x8BF0 110162306a36Sopenharmony_ci 110262306a36Sopenharmony_ci#define SQ_CONFIG 0x8C00 110362306a36Sopenharmony_ci 110462306a36Sopenharmony_ci#define SQC_CACHES 0x8C08 110562306a36Sopenharmony_ci 110662306a36Sopenharmony_ci#define SQ_POWER_THROTTLE 0x8e58 110762306a36Sopenharmony_ci#define MIN_POWER(x) ((x) << 0) 110862306a36Sopenharmony_ci#define MIN_POWER_MASK (0x3fff << 0) 110962306a36Sopenharmony_ci#define MIN_POWER_SHIFT 0 111062306a36Sopenharmony_ci#define MAX_POWER(x) ((x) << 16) 111162306a36Sopenharmony_ci#define MAX_POWER_MASK (0x3fff << 16) 111262306a36Sopenharmony_ci#define MAX_POWER_SHIFT 0 111362306a36Sopenharmony_ci#define SQ_POWER_THROTTLE2 0x8e5c 111462306a36Sopenharmony_ci#define MAX_POWER_DELTA(x) ((x) << 0) 111562306a36Sopenharmony_ci#define MAX_POWER_DELTA_MASK (0x3fff << 0) 111662306a36Sopenharmony_ci#define MAX_POWER_DELTA_SHIFT 0 111762306a36Sopenharmony_ci#define STI_SIZE(x) ((x) << 16) 111862306a36Sopenharmony_ci#define STI_SIZE_MASK (0x3ff << 16) 111962306a36Sopenharmony_ci#define STI_SIZE_SHIFT 16 112062306a36Sopenharmony_ci#define LTI_RATIO(x) ((x) << 27) 112162306a36Sopenharmony_ci#define LTI_RATIO_MASK (0xf << 27) 112262306a36Sopenharmony_ci#define LTI_RATIO_SHIFT 27 112362306a36Sopenharmony_ci 112462306a36Sopenharmony_ci#define SX_DEBUG_1 0x9060 112562306a36Sopenharmony_ci 112662306a36Sopenharmony_ci#define SPI_STATIC_THREAD_MGMT_1 0x90E0 112762306a36Sopenharmony_ci#define SPI_STATIC_THREAD_MGMT_2 0x90E4 112862306a36Sopenharmony_ci#define SPI_STATIC_THREAD_MGMT_3 0x90E8 112962306a36Sopenharmony_ci#define SPI_PS_MAX_WAVE_ID 0x90EC 113062306a36Sopenharmony_ci 113162306a36Sopenharmony_ci#define SPI_CONFIG_CNTL 0x9100 113262306a36Sopenharmony_ci 113362306a36Sopenharmony_ci#define SPI_CONFIG_CNTL_1 0x913C 113462306a36Sopenharmony_ci#define VTX_DONE_DELAY(x) ((x) << 0) 113562306a36Sopenharmony_ci#define INTERP_ONE_PRIM_PER_ROW (1 << 4) 113662306a36Sopenharmony_ci 113762306a36Sopenharmony_ci#define CGTS_TCC_DISABLE 0x9148 113862306a36Sopenharmony_ci#define CGTS_USER_TCC_DISABLE 0x914C 113962306a36Sopenharmony_ci#define TCC_DISABLE_MASK 0xFFFF0000 114062306a36Sopenharmony_ci#define TCC_DISABLE_SHIFT 16 114162306a36Sopenharmony_ci#define CGTS_SM_CTRL_REG 0x9150 114262306a36Sopenharmony_ci#define OVERRIDE (1 << 21) 114362306a36Sopenharmony_ci#define LS_OVERRIDE (1 << 22) 114462306a36Sopenharmony_ci 114562306a36Sopenharmony_ci#define SPI_LB_CU_MASK 0x9354 114662306a36Sopenharmony_ci 114762306a36Sopenharmony_ci#define TA_CNTL_AUX 0x9508 114862306a36Sopenharmony_ci#define TA_CS_BC_BASE_ADDR 0x950C 114962306a36Sopenharmony_ci 115062306a36Sopenharmony_ci#define CC_RB_BACKEND_DISABLE 0x98F4 115162306a36Sopenharmony_ci#define BACKEND_DISABLE(x) ((x) << 16) 115262306a36Sopenharmony_ci#define GB_ADDR_CONFIG 0x98F8 115362306a36Sopenharmony_ci#define NUM_PIPES(x) ((x) << 0) 115462306a36Sopenharmony_ci#define NUM_PIPES_MASK 0x00000007 115562306a36Sopenharmony_ci#define NUM_PIPES_SHIFT 0 115662306a36Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE(x) ((x) << 4) 115762306a36Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE_MASK 0x00000070 115862306a36Sopenharmony_ci#define PIPE_INTERLEAVE_SIZE_SHIFT 4 115962306a36Sopenharmony_ci#define NUM_SHADER_ENGINES(x) ((x) << 12) 116062306a36Sopenharmony_ci#define NUM_SHADER_ENGINES_MASK 0x00003000 116162306a36Sopenharmony_ci#define NUM_SHADER_ENGINES_SHIFT 12 116262306a36Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE(x) ((x) << 16) 116362306a36Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE_MASK 0x00070000 116462306a36Sopenharmony_ci#define SHADER_ENGINE_TILE_SIZE_SHIFT 16 116562306a36Sopenharmony_ci#define NUM_GPUS(x) ((x) << 20) 116662306a36Sopenharmony_ci#define NUM_GPUS_MASK 0x00700000 116762306a36Sopenharmony_ci#define NUM_GPUS_SHIFT 20 116862306a36Sopenharmony_ci#define MULTI_GPU_TILE_SIZE(x) ((x) << 24) 116962306a36Sopenharmony_ci#define MULTI_GPU_TILE_SIZE_MASK 0x03000000 117062306a36Sopenharmony_ci#define MULTI_GPU_TILE_SIZE_SHIFT 24 117162306a36Sopenharmony_ci#define ROW_SIZE(x) ((x) << 28) 117262306a36Sopenharmony_ci#define ROW_SIZE_MASK 0x30000000 117362306a36Sopenharmony_ci#define ROW_SIZE_SHIFT 28 117462306a36Sopenharmony_ci 117562306a36Sopenharmony_ci#define GB_TILE_MODE0 0x9910 117662306a36Sopenharmony_ci# define MICRO_TILE_MODE(x) ((x) << 0) 117762306a36Sopenharmony_ci# define ADDR_SURF_DISPLAY_MICRO_TILING 0 117862306a36Sopenharmony_ci# define ADDR_SURF_THIN_MICRO_TILING 1 117962306a36Sopenharmony_ci# define ADDR_SURF_DEPTH_MICRO_TILING 2 118062306a36Sopenharmony_ci# define ARRAY_MODE(x) ((x) << 2) 118162306a36Sopenharmony_ci# define ARRAY_LINEAR_GENERAL 0 118262306a36Sopenharmony_ci# define ARRAY_LINEAR_ALIGNED 1 118362306a36Sopenharmony_ci# define ARRAY_1D_TILED_THIN1 2 118462306a36Sopenharmony_ci# define ARRAY_2D_TILED_THIN1 4 118562306a36Sopenharmony_ci# define PIPE_CONFIG(x) ((x) << 6) 118662306a36Sopenharmony_ci# define ADDR_SURF_P2 0 118762306a36Sopenharmony_ci# define ADDR_SURF_P4_8x16 4 118862306a36Sopenharmony_ci# define ADDR_SURF_P4_16x16 5 118962306a36Sopenharmony_ci# define ADDR_SURF_P4_16x32 6 119062306a36Sopenharmony_ci# define ADDR_SURF_P4_32x32 7 119162306a36Sopenharmony_ci# define ADDR_SURF_P8_16x16_8x16 8 119262306a36Sopenharmony_ci# define ADDR_SURF_P8_16x32_8x16 9 119362306a36Sopenharmony_ci# define ADDR_SURF_P8_32x32_8x16 10 119462306a36Sopenharmony_ci# define ADDR_SURF_P8_16x32_16x16 11 119562306a36Sopenharmony_ci# define ADDR_SURF_P8_32x32_16x16 12 119662306a36Sopenharmony_ci# define ADDR_SURF_P8_32x32_16x32 13 119762306a36Sopenharmony_ci# define ADDR_SURF_P8_32x64_32x32 14 119862306a36Sopenharmony_ci# define TILE_SPLIT(x) ((x) << 11) 119962306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_64B 0 120062306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_128B 1 120162306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_256B 2 120262306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_512B 3 120362306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_1KB 4 120462306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_2KB 5 120562306a36Sopenharmony_ci# define ADDR_SURF_TILE_SPLIT_4KB 6 120662306a36Sopenharmony_ci# define BANK_WIDTH(x) ((x) << 14) 120762306a36Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_1 0 120862306a36Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_2 1 120962306a36Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_4 2 121062306a36Sopenharmony_ci# define ADDR_SURF_BANK_WIDTH_8 3 121162306a36Sopenharmony_ci# define BANK_HEIGHT(x) ((x) << 16) 121262306a36Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_1 0 121362306a36Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_2 1 121462306a36Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_4 2 121562306a36Sopenharmony_ci# define ADDR_SURF_BANK_HEIGHT_8 3 121662306a36Sopenharmony_ci# define MACRO_TILE_ASPECT(x) ((x) << 18) 121762306a36Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_1 0 121862306a36Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_2 1 121962306a36Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_4 2 122062306a36Sopenharmony_ci# define ADDR_SURF_MACRO_ASPECT_8 3 122162306a36Sopenharmony_ci# define NUM_BANKS(x) ((x) << 20) 122262306a36Sopenharmony_ci# define ADDR_SURF_2_BANK 0 122362306a36Sopenharmony_ci# define ADDR_SURF_4_BANK 1 122462306a36Sopenharmony_ci# define ADDR_SURF_8_BANK 2 122562306a36Sopenharmony_ci# define ADDR_SURF_16_BANK 3 122662306a36Sopenharmony_ci 122762306a36Sopenharmony_ci#define CB_PERFCOUNTER0_SELECT0 0x9a20 122862306a36Sopenharmony_ci#define CB_PERFCOUNTER0_SELECT1 0x9a24 122962306a36Sopenharmony_ci#define CB_PERFCOUNTER1_SELECT0 0x9a28 123062306a36Sopenharmony_ci#define CB_PERFCOUNTER1_SELECT1 0x9a2c 123162306a36Sopenharmony_ci#define CB_PERFCOUNTER2_SELECT0 0x9a30 123262306a36Sopenharmony_ci#define CB_PERFCOUNTER2_SELECT1 0x9a34 123362306a36Sopenharmony_ci#define CB_PERFCOUNTER3_SELECT0 0x9a38 123462306a36Sopenharmony_ci#define CB_PERFCOUNTER3_SELECT1 0x9a3c 123562306a36Sopenharmony_ci 123662306a36Sopenharmony_ci#define CB_CGTT_SCLK_CTRL 0x9a60 123762306a36Sopenharmony_ci 123862306a36Sopenharmony_ci#define GC_USER_RB_BACKEND_DISABLE 0x9B7C 123962306a36Sopenharmony_ci#define BACKEND_DISABLE_MASK 0x00FF0000 124062306a36Sopenharmony_ci#define BACKEND_DISABLE_SHIFT 16 124162306a36Sopenharmony_ci 124262306a36Sopenharmony_ci#define TCP_CHAN_STEER_LO 0xac0c 124362306a36Sopenharmony_ci#define TCP_CHAN_STEER_HI 0xac10 124462306a36Sopenharmony_ci 124562306a36Sopenharmony_ci#define CP_RB0_BASE 0xC100 124662306a36Sopenharmony_ci#define CP_RB0_CNTL 0xC104 124762306a36Sopenharmony_ci#define RB_BUFSZ(x) ((x) << 0) 124862306a36Sopenharmony_ci#define RB_BLKSZ(x) ((x) << 8) 124962306a36Sopenharmony_ci#define BUF_SWAP_32BIT (2 << 16) 125062306a36Sopenharmony_ci#define RB_NO_UPDATE (1 << 27) 125162306a36Sopenharmony_ci#define RB_RPTR_WR_ENA (1 << 31) 125262306a36Sopenharmony_ci 125362306a36Sopenharmony_ci#define CP_RB0_RPTR_ADDR 0xC10C 125462306a36Sopenharmony_ci#define CP_RB0_RPTR_ADDR_HI 0xC110 125562306a36Sopenharmony_ci#define CP_RB0_WPTR 0xC114 125662306a36Sopenharmony_ci 125762306a36Sopenharmony_ci#define CP_PFP_UCODE_ADDR 0xC150 125862306a36Sopenharmony_ci#define CP_PFP_UCODE_DATA 0xC154 125962306a36Sopenharmony_ci#define CP_ME_RAM_RADDR 0xC158 126062306a36Sopenharmony_ci#define CP_ME_RAM_WADDR 0xC15C 126162306a36Sopenharmony_ci#define CP_ME_RAM_DATA 0xC160 126262306a36Sopenharmony_ci 126362306a36Sopenharmony_ci#define CP_CE_UCODE_ADDR 0xC168 126462306a36Sopenharmony_ci#define CP_CE_UCODE_DATA 0xC16C 126562306a36Sopenharmony_ci 126662306a36Sopenharmony_ci#define CP_RB1_BASE 0xC180 126762306a36Sopenharmony_ci#define CP_RB1_CNTL 0xC184 126862306a36Sopenharmony_ci#define CP_RB1_RPTR_ADDR 0xC188 126962306a36Sopenharmony_ci#define CP_RB1_RPTR_ADDR_HI 0xC18C 127062306a36Sopenharmony_ci#define CP_RB1_WPTR 0xC190 127162306a36Sopenharmony_ci#define CP_RB2_BASE 0xC194 127262306a36Sopenharmony_ci#define CP_RB2_CNTL 0xC198 127362306a36Sopenharmony_ci#define CP_RB2_RPTR_ADDR 0xC19C 127462306a36Sopenharmony_ci#define CP_RB2_RPTR_ADDR_HI 0xC1A0 127562306a36Sopenharmony_ci#define CP_RB2_WPTR 0xC1A4 127662306a36Sopenharmony_ci#define CP_INT_CNTL_RING0 0xC1A8 127762306a36Sopenharmony_ci#define CP_INT_CNTL_RING1 0xC1AC 127862306a36Sopenharmony_ci#define CP_INT_CNTL_RING2 0xC1B0 127962306a36Sopenharmony_ci# define CNTX_BUSY_INT_ENABLE (1 << 19) 128062306a36Sopenharmony_ci# define CNTX_EMPTY_INT_ENABLE (1 << 20) 128162306a36Sopenharmony_ci# define WAIT_MEM_SEM_INT_ENABLE (1 << 21) 128262306a36Sopenharmony_ci# define TIME_STAMP_INT_ENABLE (1 << 26) 128362306a36Sopenharmony_ci# define CP_RINGID2_INT_ENABLE (1 << 29) 128462306a36Sopenharmony_ci# define CP_RINGID1_INT_ENABLE (1 << 30) 128562306a36Sopenharmony_ci# define CP_RINGID0_INT_ENABLE (1 << 31) 128662306a36Sopenharmony_ci#define CP_INT_STATUS_RING0 0xC1B4 128762306a36Sopenharmony_ci#define CP_INT_STATUS_RING1 0xC1B8 128862306a36Sopenharmony_ci#define CP_INT_STATUS_RING2 0xC1BC 128962306a36Sopenharmony_ci# define WAIT_MEM_SEM_INT_STAT (1 << 21) 129062306a36Sopenharmony_ci# define TIME_STAMP_INT_STAT (1 << 26) 129162306a36Sopenharmony_ci# define CP_RINGID2_INT_STAT (1 << 29) 129262306a36Sopenharmony_ci# define CP_RINGID1_INT_STAT (1 << 30) 129362306a36Sopenharmony_ci# define CP_RINGID0_INT_STAT (1 << 31) 129462306a36Sopenharmony_ci 129562306a36Sopenharmony_ci#define CP_MEM_SLP_CNTL 0xC1E4 129662306a36Sopenharmony_ci# define CP_MEM_LS_EN (1 << 0) 129762306a36Sopenharmony_ci 129862306a36Sopenharmony_ci#define CP_DEBUG 0xC1FC 129962306a36Sopenharmony_ci 130062306a36Sopenharmony_ci#define RLC_CNTL 0xC300 130162306a36Sopenharmony_ci# define RLC_ENABLE (1 << 0) 130262306a36Sopenharmony_ci#define RLC_RL_BASE 0xC304 130362306a36Sopenharmony_ci#define RLC_RL_SIZE 0xC308 130462306a36Sopenharmony_ci#define RLC_LB_CNTL 0xC30C 130562306a36Sopenharmony_ci# define LOAD_BALANCE_ENABLE (1 << 0) 130662306a36Sopenharmony_ci#define RLC_SAVE_AND_RESTORE_BASE 0xC310 130762306a36Sopenharmony_ci#define RLC_LB_CNTR_MAX 0xC314 130862306a36Sopenharmony_ci#define RLC_LB_CNTR_INIT 0xC318 130962306a36Sopenharmony_ci 131062306a36Sopenharmony_ci#define RLC_CLEAR_STATE_RESTORE_BASE 0xC320 131162306a36Sopenharmony_ci 131262306a36Sopenharmony_ci#define RLC_UCODE_ADDR 0xC32C 131362306a36Sopenharmony_ci#define RLC_UCODE_DATA 0xC330 131462306a36Sopenharmony_ci 131562306a36Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_LSB 0xC338 131662306a36Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_MSB 0xC33C 131762306a36Sopenharmony_ci#define RLC_CAPTURE_GPU_CLOCK_COUNT 0xC340 131862306a36Sopenharmony_ci#define RLC_MC_CNTL 0xC344 131962306a36Sopenharmony_ci#define RLC_UCODE_CNTL 0xC348 132062306a36Sopenharmony_ci#define RLC_STAT 0xC34C 132162306a36Sopenharmony_ci# define RLC_BUSY_STATUS (1 << 0) 132262306a36Sopenharmony_ci# define GFX_POWER_STATUS (1 << 1) 132362306a36Sopenharmony_ci# define GFX_CLOCK_STATUS (1 << 2) 132462306a36Sopenharmony_ci# define GFX_LS_STATUS (1 << 3) 132562306a36Sopenharmony_ci 132662306a36Sopenharmony_ci#define RLC_PG_CNTL 0xC35C 132762306a36Sopenharmony_ci# define GFX_PG_ENABLE (1 << 0) 132862306a36Sopenharmony_ci# define GFX_PG_SRC (1 << 1) 132962306a36Sopenharmony_ci 133062306a36Sopenharmony_ci#define RLC_CGTT_MGCG_OVERRIDE 0xC400 133162306a36Sopenharmony_ci#define RLC_CGCG_CGLS_CTRL 0xC404 133262306a36Sopenharmony_ci# define CGCG_EN (1 << 0) 133362306a36Sopenharmony_ci# define CGLS_EN (1 << 1) 133462306a36Sopenharmony_ci 133562306a36Sopenharmony_ci#define RLC_TTOP_D 0xC414 133662306a36Sopenharmony_ci# define RLC_PUD(x) ((x) << 0) 133762306a36Sopenharmony_ci# define RLC_PUD_MASK (0xff << 0) 133862306a36Sopenharmony_ci# define RLC_PDD(x) ((x) << 8) 133962306a36Sopenharmony_ci# define RLC_PDD_MASK (0xff << 8) 134062306a36Sopenharmony_ci# define RLC_TTPD(x) ((x) << 16) 134162306a36Sopenharmony_ci# define RLC_TTPD_MASK (0xff << 16) 134262306a36Sopenharmony_ci# define RLC_MSD(x) ((x) << 24) 134362306a36Sopenharmony_ci# define RLC_MSD_MASK (0xff << 24) 134462306a36Sopenharmony_ci 134562306a36Sopenharmony_ci#define RLC_LB_INIT_CU_MASK 0xC41C 134662306a36Sopenharmony_ci 134762306a36Sopenharmony_ci#define RLC_PG_AO_CU_MASK 0xC42C 134862306a36Sopenharmony_ci#define RLC_MAX_PG_CU 0xC430 134962306a36Sopenharmony_ci# define MAX_PU_CU(x) ((x) << 0) 135062306a36Sopenharmony_ci# define MAX_PU_CU_MASK (0xff << 0) 135162306a36Sopenharmony_ci#define RLC_AUTO_PG_CTRL 0xC434 135262306a36Sopenharmony_ci# define AUTO_PG_EN (1 << 0) 135362306a36Sopenharmony_ci# define GRBM_REG_SGIT(x) ((x) << 3) 135462306a36Sopenharmony_ci# define GRBM_REG_SGIT_MASK (0xffff << 3) 135562306a36Sopenharmony_ci# define PG_AFTER_GRBM_REG_ST(x) ((x) << 19) 135662306a36Sopenharmony_ci# define PG_AFTER_GRBM_REG_ST_MASK (0x1fff << 19) 135762306a36Sopenharmony_ci 135862306a36Sopenharmony_ci#define RLC_SERDES_WR_MASTER_MASK_0 0xC454 135962306a36Sopenharmony_ci#define RLC_SERDES_WR_MASTER_MASK_1 0xC458 136062306a36Sopenharmony_ci#define RLC_SERDES_WR_CTRL 0xC45C 136162306a36Sopenharmony_ci 136262306a36Sopenharmony_ci#define RLC_SERDES_MASTER_BUSY_0 0xC464 136362306a36Sopenharmony_ci#define RLC_SERDES_MASTER_BUSY_1 0xC468 136462306a36Sopenharmony_ci 136562306a36Sopenharmony_ci#define RLC_GCPM_GENERAL_3 0xC478 136662306a36Sopenharmony_ci 136762306a36Sopenharmony_ci#define DB_RENDER_CONTROL 0x28000 136862306a36Sopenharmony_ci 136962306a36Sopenharmony_ci#define DB_DEPTH_INFO 0x2803c 137062306a36Sopenharmony_ci 137162306a36Sopenharmony_ci#define PA_SC_RASTER_CONFIG 0x28350 137262306a36Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_0 0 137362306a36Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_1 1 137462306a36Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_2 2 137562306a36Sopenharmony_ci# define RASTER_CONFIG_RB_MAP_3 3 137662306a36Sopenharmony_ci 137762306a36Sopenharmony_ci#define VGT_EVENT_INITIATOR 0x28a90 137862306a36Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS1 (1 << 0) 137962306a36Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS2 (2 << 0) 138062306a36Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS3 (3 << 0) 138162306a36Sopenharmony_ci# define CACHE_FLUSH_TS (4 << 0) 138262306a36Sopenharmony_ci# define CACHE_FLUSH (6 << 0) 138362306a36Sopenharmony_ci# define CS_PARTIAL_FLUSH (7 << 0) 138462306a36Sopenharmony_ci# define VGT_STREAMOUT_RESET (10 << 0) 138562306a36Sopenharmony_ci# define END_OF_PIPE_INCR_DE (11 << 0) 138662306a36Sopenharmony_ci# define END_OF_PIPE_IB_END (12 << 0) 138762306a36Sopenharmony_ci# define RST_PIX_CNT (13 << 0) 138862306a36Sopenharmony_ci# define VS_PARTIAL_FLUSH (15 << 0) 138962306a36Sopenharmony_ci# define PS_PARTIAL_FLUSH (16 << 0) 139062306a36Sopenharmony_ci# define CACHE_FLUSH_AND_INV_TS_EVENT (20 << 0) 139162306a36Sopenharmony_ci# define ZPASS_DONE (21 << 0) 139262306a36Sopenharmony_ci# define CACHE_FLUSH_AND_INV_EVENT (22 << 0) 139362306a36Sopenharmony_ci# define PERFCOUNTER_START (23 << 0) 139462306a36Sopenharmony_ci# define PERFCOUNTER_STOP (24 << 0) 139562306a36Sopenharmony_ci# define PIPELINESTAT_START (25 << 0) 139662306a36Sopenharmony_ci# define PIPELINESTAT_STOP (26 << 0) 139762306a36Sopenharmony_ci# define PERFCOUNTER_SAMPLE (27 << 0) 139862306a36Sopenharmony_ci# define SAMPLE_PIPELINESTAT (30 << 0) 139962306a36Sopenharmony_ci# define SAMPLE_STREAMOUTSTATS (32 << 0) 140062306a36Sopenharmony_ci# define RESET_VTX_CNT (33 << 0) 140162306a36Sopenharmony_ci# define VGT_FLUSH (36 << 0) 140262306a36Sopenharmony_ci# define BOTTOM_OF_PIPE_TS (40 << 0) 140362306a36Sopenharmony_ci# define DB_CACHE_FLUSH_AND_INV (42 << 0) 140462306a36Sopenharmony_ci# define FLUSH_AND_INV_DB_DATA_TS (43 << 0) 140562306a36Sopenharmony_ci# define FLUSH_AND_INV_DB_META (44 << 0) 140662306a36Sopenharmony_ci# define FLUSH_AND_INV_CB_DATA_TS (45 << 0) 140762306a36Sopenharmony_ci# define FLUSH_AND_INV_CB_META (46 << 0) 140862306a36Sopenharmony_ci# define CS_DONE (47 << 0) 140962306a36Sopenharmony_ci# define PS_DONE (48 << 0) 141062306a36Sopenharmony_ci# define FLUSH_AND_INV_CB_PIXEL_DATA (49 << 0) 141162306a36Sopenharmony_ci# define THREAD_TRACE_START (51 << 0) 141262306a36Sopenharmony_ci# define THREAD_TRACE_STOP (52 << 0) 141362306a36Sopenharmony_ci# define THREAD_TRACE_FLUSH (54 << 0) 141462306a36Sopenharmony_ci# define THREAD_TRACE_FINISH (55 << 0) 141562306a36Sopenharmony_ci 141662306a36Sopenharmony_ci/* PIF PHY0 registers idx/data 0x8/0xc */ 141762306a36Sopenharmony_ci#define PB0_PIF_CNTL 0x10 141862306a36Sopenharmony_ci# define LS2_EXIT_TIME(x) ((x) << 17) 141962306a36Sopenharmony_ci# define LS2_EXIT_TIME_MASK (0x7 << 17) 142062306a36Sopenharmony_ci# define LS2_EXIT_TIME_SHIFT 17 142162306a36Sopenharmony_ci#define PB0_PIF_PAIRING 0x11 142262306a36Sopenharmony_ci# define MULTI_PIF (1 << 25) 142362306a36Sopenharmony_ci#define PB0_PIF_PWRDOWN_0 0x12 142462306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0(x) ((x) << 7) 142562306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0_MASK (0x7 << 7) 142662306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_0_SHIFT 7 142762306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0(x) ((x) << 10) 142862306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0_MASK (0x7 << 10) 142962306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_0_SHIFT 10 143062306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_0(x) ((x) << 24) 143162306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_0_MASK (0x7 << 24) 143262306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_0_SHIFT 24 143362306a36Sopenharmony_ci#define PB0_PIF_PWRDOWN_1 0x13 143462306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1(x) ((x) << 7) 143562306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1_MASK (0x7 << 7) 143662306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_1_SHIFT 7 143762306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1(x) ((x) << 10) 143862306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1_MASK (0x7 << 10) 143962306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_1_SHIFT 10 144062306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_1(x) ((x) << 24) 144162306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_1_MASK (0x7 << 24) 144262306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_1_SHIFT 24 144362306a36Sopenharmony_ci 144462306a36Sopenharmony_ci#define PB0_PIF_PWRDOWN_2 0x17 144562306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_2(x) ((x) << 7) 144662306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_2_MASK (0x7 << 7) 144762306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_2_SHIFT 7 144862306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_2(x) ((x) << 10) 144962306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_2_MASK (0x7 << 10) 145062306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_2_SHIFT 10 145162306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_2(x) ((x) << 24) 145262306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_2_MASK (0x7 << 24) 145362306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_2_SHIFT 24 145462306a36Sopenharmony_ci#define PB0_PIF_PWRDOWN_3 0x18 145562306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_3(x) ((x) << 7) 145662306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_3_MASK (0x7 << 7) 145762306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_TXS2_3_SHIFT 7 145862306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_3(x) ((x) << 10) 145962306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_3_MASK (0x7 << 10) 146062306a36Sopenharmony_ci# define PLL_POWER_STATE_IN_OFF_3_SHIFT 10 146162306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_3(x) ((x) << 24) 146262306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_3_MASK (0x7 << 24) 146362306a36Sopenharmony_ci# define PLL_RAMP_UP_TIME_3_SHIFT 24 146462306a36Sopenharmony_ci/* PIF PHY1 registers idx/data 0x10/0x14 */ 146562306a36Sopenharmony_ci#define PB1_PIF_CNTL 0x10 146662306a36Sopenharmony_ci#define PB1_PIF_PAIRING 0x11 146762306a36Sopenharmony_ci#define PB1_PIF_PWRDOWN_0 0x12 146862306a36Sopenharmony_ci#define PB1_PIF_PWRDOWN_1 0x13 146962306a36Sopenharmony_ci 147062306a36Sopenharmony_ci#define PB1_PIF_PWRDOWN_2 0x17 147162306a36Sopenharmony_ci#define PB1_PIF_PWRDOWN_3 0x18 147262306a36Sopenharmony_ci/* PCIE registers idx/data 0x30/0x34 */ 147362306a36Sopenharmony_ci#define PCIE_CNTL2 0x1c /* PCIE */ 147462306a36Sopenharmony_ci# define SLV_MEM_LS_EN (1 << 16) 147562306a36Sopenharmony_ci# define SLV_MEM_AGGRESSIVE_LS_EN (1 << 17) 147662306a36Sopenharmony_ci# define MST_MEM_LS_EN (1 << 18) 147762306a36Sopenharmony_ci# define REPLAY_MEM_LS_EN (1 << 19) 147862306a36Sopenharmony_ci#define PCIE_LC_STATUS1 0x28 /* PCIE */ 147962306a36Sopenharmony_ci# define LC_REVERSE_RCVR (1 << 0) 148062306a36Sopenharmony_ci# define LC_REVERSE_XMIT (1 << 1) 148162306a36Sopenharmony_ci# define LC_OPERATING_LINK_WIDTH_MASK (0x7 << 2) 148262306a36Sopenharmony_ci# define LC_OPERATING_LINK_WIDTH_SHIFT 2 148362306a36Sopenharmony_ci# define LC_DETECTED_LINK_WIDTH_MASK (0x7 << 5) 148462306a36Sopenharmony_ci# define LC_DETECTED_LINK_WIDTH_SHIFT 5 148562306a36Sopenharmony_ci 148662306a36Sopenharmony_ci#define PCIE_P_CNTL 0x40 /* PCIE */ 148762306a36Sopenharmony_ci# define P_IGNORE_EDB_ERR (1 << 6) 148862306a36Sopenharmony_ci 148962306a36Sopenharmony_ci/* PCIE PORT registers idx/data 0x38/0x3c */ 149062306a36Sopenharmony_ci#define PCIE_LC_CNTL 0xa0 149162306a36Sopenharmony_ci# define LC_L0S_INACTIVITY(x) ((x) << 8) 149262306a36Sopenharmony_ci# define LC_L0S_INACTIVITY_MASK (0xf << 8) 149362306a36Sopenharmony_ci# define LC_L0S_INACTIVITY_SHIFT 8 149462306a36Sopenharmony_ci# define LC_L1_INACTIVITY(x) ((x) << 12) 149562306a36Sopenharmony_ci# define LC_L1_INACTIVITY_MASK (0xf << 12) 149662306a36Sopenharmony_ci# define LC_L1_INACTIVITY_SHIFT 12 149762306a36Sopenharmony_ci# define LC_PMI_TO_L1_DIS (1 << 16) 149862306a36Sopenharmony_ci# define LC_ASPM_TO_L1_DIS (1 << 24) 149962306a36Sopenharmony_ci#define PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE_P */ 150062306a36Sopenharmony_ci# define LC_LINK_WIDTH_SHIFT 0 150162306a36Sopenharmony_ci# define LC_LINK_WIDTH_MASK 0x7 150262306a36Sopenharmony_ci# define LC_LINK_WIDTH_X0 0 150362306a36Sopenharmony_ci# define LC_LINK_WIDTH_X1 1 150462306a36Sopenharmony_ci# define LC_LINK_WIDTH_X2 2 150562306a36Sopenharmony_ci# define LC_LINK_WIDTH_X4 3 150662306a36Sopenharmony_ci# define LC_LINK_WIDTH_X8 4 150762306a36Sopenharmony_ci# define LC_LINK_WIDTH_X16 6 150862306a36Sopenharmony_ci# define LC_LINK_WIDTH_RD_SHIFT 4 150962306a36Sopenharmony_ci# define LC_LINK_WIDTH_RD_MASK 0x70 151062306a36Sopenharmony_ci# define LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) 151162306a36Sopenharmony_ci# define LC_RECONFIG_NOW (1 << 8) 151262306a36Sopenharmony_ci# define LC_RENEGOTIATION_SUPPORT (1 << 9) 151362306a36Sopenharmony_ci# define LC_RENEGOTIATE_EN (1 << 10) 151462306a36Sopenharmony_ci# define LC_SHORT_RECONFIG_EN (1 << 11) 151562306a36Sopenharmony_ci# define LC_UPCONFIGURE_SUPPORT (1 << 12) 151662306a36Sopenharmony_ci# define LC_UPCONFIGURE_DIS (1 << 13) 151762306a36Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE(x) ((x) << 21) 151862306a36Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE_MASK (0x3 << 21) 151962306a36Sopenharmony_ci# define LC_DYN_LANES_PWR_STATE_SHIFT 21 152062306a36Sopenharmony_ci#define PCIE_LC_N_FTS_CNTL 0xa3 /* PCIE_P */ 152162306a36Sopenharmony_ci# define LC_XMIT_N_FTS(x) ((x) << 0) 152262306a36Sopenharmony_ci# define LC_XMIT_N_FTS_MASK (0xff << 0) 152362306a36Sopenharmony_ci# define LC_XMIT_N_FTS_SHIFT 0 152462306a36Sopenharmony_ci# define LC_XMIT_N_FTS_OVERRIDE_EN (1 << 8) 152562306a36Sopenharmony_ci# define LC_N_FTS_MASK (0xff << 24) 152662306a36Sopenharmony_ci#define PCIE_LC_SPEED_CNTL 0xa4 /* PCIE_P */ 152762306a36Sopenharmony_ci# define LC_GEN2_EN_STRAP (1 << 0) 152862306a36Sopenharmony_ci# define LC_GEN3_EN_STRAP (1 << 1) 152962306a36Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_EN (1 << 2) 153062306a36Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_MASK (0x3 << 3) 153162306a36Sopenharmony_ci# define LC_TARGET_LINK_SPEED_OVERRIDE_SHIFT 3 153262306a36Sopenharmony_ci# define LC_FORCE_EN_SW_SPEED_CHANGE (1 << 5) 153362306a36Sopenharmony_ci# define LC_FORCE_DIS_SW_SPEED_CHANGE (1 << 6) 153462306a36Sopenharmony_ci# define LC_FORCE_EN_HW_SPEED_CHANGE (1 << 7) 153562306a36Sopenharmony_ci# define LC_FORCE_DIS_HW_SPEED_CHANGE (1 << 8) 153662306a36Sopenharmony_ci# define LC_INITIATE_LINK_SPEED_CHANGE (1 << 9) 153762306a36Sopenharmony_ci# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK (0x3 << 10) 153862306a36Sopenharmony_ci# define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT 10 153962306a36Sopenharmony_ci# define LC_CURRENT_DATA_RATE_MASK (0x3 << 13) /* 0/1/2 = gen1/2/3 */ 154062306a36Sopenharmony_ci# define LC_CURRENT_DATA_RATE_SHIFT 13 154162306a36Sopenharmony_ci# define LC_CLR_FAILED_SPD_CHANGE_CNT (1 << 16) 154262306a36Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN2 (1 << 18) 154362306a36Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN2 (1 << 19) 154462306a36Sopenharmony_ci# define LC_OTHER_SIDE_EVER_SENT_GEN3 (1 << 20) 154562306a36Sopenharmony_ci# define LC_OTHER_SIDE_SUPPORTS_GEN3 (1 << 21) 154662306a36Sopenharmony_ci 154762306a36Sopenharmony_ci#define PCIE_LC_CNTL2 0xb1 154862306a36Sopenharmony_ci# define LC_ALLOW_PDWN_IN_L1 (1 << 17) 154962306a36Sopenharmony_ci# define LC_ALLOW_PDWN_IN_L23 (1 << 18) 155062306a36Sopenharmony_ci 155162306a36Sopenharmony_ci#define PCIE_LC_CNTL3 0xb5 /* PCIE_P */ 155262306a36Sopenharmony_ci# define LC_GO_TO_RECOVERY (1 << 30) 155362306a36Sopenharmony_ci#define PCIE_LC_CNTL4 0xb6 /* PCIE_P */ 155462306a36Sopenharmony_ci# define LC_REDO_EQ (1 << 5) 155562306a36Sopenharmony_ci# define LC_SET_QUIESCE (1 << 13) 155662306a36Sopenharmony_ci 155762306a36Sopenharmony_ci/* 155862306a36Sopenharmony_ci * UVD 155962306a36Sopenharmony_ci */ 156062306a36Sopenharmony_ci#define UVD_UDEC_ADDR_CONFIG 0xEF4C 156162306a36Sopenharmony_ci#define UVD_UDEC_DB_ADDR_CONFIG 0xEF50 156262306a36Sopenharmony_ci#define UVD_UDEC_DBW_ADDR_CONFIG 0xEF54 156362306a36Sopenharmony_ci#define UVD_NO_OP 0xEFFC 156462306a36Sopenharmony_ci#define UVD_RBC_RB_RPTR 0xF690 156562306a36Sopenharmony_ci#define UVD_RBC_RB_WPTR 0xF694 156662306a36Sopenharmony_ci#define UVD_STATUS 0xf6bc 156762306a36Sopenharmony_ci 156862306a36Sopenharmony_ci#define UVD_CGC_CTRL 0xF4B0 156962306a36Sopenharmony_ci# define DCM (1 << 0) 157062306a36Sopenharmony_ci# define CG_DT(x) ((x) << 2) 157162306a36Sopenharmony_ci# define CG_DT_MASK (0xf << 2) 157262306a36Sopenharmony_ci# define CLK_OD(x) ((x) << 6) 157362306a36Sopenharmony_ci# define CLK_OD_MASK (0x1f << 6) 157462306a36Sopenharmony_ci 157562306a36Sopenharmony_ci /* UVD CTX indirect */ 157662306a36Sopenharmony_ci#define UVD_CGC_MEM_CTRL 0xC0 157762306a36Sopenharmony_ci#define UVD_CGC_CTRL2 0xC1 157862306a36Sopenharmony_ci# define DYN_OR_EN (1 << 0) 157962306a36Sopenharmony_ci# define DYN_RR_EN (1 << 1) 158062306a36Sopenharmony_ci# define G_DIV_ID(x) ((x) << 2) 158162306a36Sopenharmony_ci# define G_DIV_ID_MASK (0x7 << 2) 158262306a36Sopenharmony_ci 158362306a36Sopenharmony_ci/* 158462306a36Sopenharmony_ci * PM4 158562306a36Sopenharmony_ci */ 158662306a36Sopenharmony_ci#define PACKET0(reg, n) ((RADEON_PACKET_TYPE0 << 30) | \ 158762306a36Sopenharmony_ci (((reg) >> 2) & 0xFFFF) | \ 158862306a36Sopenharmony_ci ((n) & 0x3FFF) << 16) 158962306a36Sopenharmony_ci#define CP_PACKET2 0x80000000 159062306a36Sopenharmony_ci#define PACKET2_PAD_SHIFT 0 159162306a36Sopenharmony_ci#define PACKET2_PAD_MASK (0x3fffffff << 0) 159262306a36Sopenharmony_ci 159362306a36Sopenharmony_ci#define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) 159462306a36Sopenharmony_ci 159562306a36Sopenharmony_ci#define PACKET3(op, n) ((RADEON_PACKET_TYPE3 << 30) | \ 159662306a36Sopenharmony_ci (((op) & 0xFF) << 8) | \ 159762306a36Sopenharmony_ci ((n) & 0x3FFF) << 16) 159862306a36Sopenharmony_ci 159962306a36Sopenharmony_ci#define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1) 160062306a36Sopenharmony_ci 160162306a36Sopenharmony_ci/* Packet 3 types */ 160262306a36Sopenharmony_ci#define PACKET3_NOP 0x10 160362306a36Sopenharmony_ci#define PACKET3_SET_BASE 0x11 160462306a36Sopenharmony_ci#define PACKET3_BASE_INDEX(x) ((x) << 0) 160562306a36Sopenharmony_ci#define GDS_PARTITION_BASE 2 160662306a36Sopenharmony_ci#define CE_PARTITION_BASE 3 160762306a36Sopenharmony_ci#define PACKET3_CLEAR_STATE 0x12 160862306a36Sopenharmony_ci#define PACKET3_INDEX_BUFFER_SIZE 0x13 160962306a36Sopenharmony_ci#define PACKET3_DISPATCH_DIRECT 0x15 161062306a36Sopenharmony_ci#define PACKET3_DISPATCH_INDIRECT 0x16 161162306a36Sopenharmony_ci#define PACKET3_ALLOC_GDS 0x1B 161262306a36Sopenharmony_ci#define PACKET3_WRITE_GDS_RAM 0x1C 161362306a36Sopenharmony_ci#define PACKET3_ATOMIC_GDS 0x1D 161462306a36Sopenharmony_ci#define PACKET3_ATOMIC 0x1E 161562306a36Sopenharmony_ci#define PACKET3_OCCLUSION_QUERY 0x1F 161662306a36Sopenharmony_ci#define PACKET3_SET_PREDICATION 0x20 161762306a36Sopenharmony_ci#define PACKET3_REG_RMW 0x21 161862306a36Sopenharmony_ci#define PACKET3_COND_EXEC 0x22 161962306a36Sopenharmony_ci#define PACKET3_PRED_EXEC 0x23 162062306a36Sopenharmony_ci#define PACKET3_DRAW_INDIRECT 0x24 162162306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_INDIRECT 0x25 162262306a36Sopenharmony_ci#define PACKET3_INDEX_BASE 0x26 162362306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_2 0x27 162462306a36Sopenharmony_ci#define PACKET3_CONTEXT_CONTROL 0x28 162562306a36Sopenharmony_ci#define PACKET3_INDEX_TYPE 0x2A 162662306a36Sopenharmony_ci#define PACKET3_DRAW_INDIRECT_MULTI 0x2C 162762306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_AUTO 0x2D 162862306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_IMMD 0x2E 162962306a36Sopenharmony_ci#define PACKET3_NUM_INSTANCES 0x2F 163062306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 163162306a36Sopenharmony_ci#define PACKET3_INDIRECT_BUFFER_CONST 0x31 163262306a36Sopenharmony_ci#define PACKET3_INDIRECT_BUFFER 0x32 163362306a36Sopenharmony_ci#define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 163462306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_OFFSET_2 0x35 163562306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_MULTI_ELEMENT 0x36 163662306a36Sopenharmony_ci#define PACKET3_WRITE_DATA 0x37 163762306a36Sopenharmony_ci#define WRITE_DATA_DST_SEL(x) ((x) << 8) 163862306a36Sopenharmony_ci /* 0 - register 163962306a36Sopenharmony_ci * 1 - memory (sync - via GRBM) 164062306a36Sopenharmony_ci * 2 - tc/l2 164162306a36Sopenharmony_ci * 3 - gds 164262306a36Sopenharmony_ci * 4 - reserved 164362306a36Sopenharmony_ci * 5 - memory (async - direct) 164462306a36Sopenharmony_ci */ 164562306a36Sopenharmony_ci#define WR_ONE_ADDR (1 << 16) 164662306a36Sopenharmony_ci#define WR_CONFIRM (1 << 20) 164762306a36Sopenharmony_ci#define WRITE_DATA_ENGINE_SEL(x) ((x) << 30) 164862306a36Sopenharmony_ci /* 0 - me 164962306a36Sopenharmony_ci * 1 - pfp 165062306a36Sopenharmony_ci * 2 - ce 165162306a36Sopenharmony_ci */ 165262306a36Sopenharmony_ci#define PACKET3_DRAW_INDEX_INDIRECT_MULTI 0x38 165362306a36Sopenharmony_ci#define PACKET3_MEM_SEMAPHORE 0x39 165462306a36Sopenharmony_ci#define PACKET3_MPEG_INDEX 0x3A 165562306a36Sopenharmony_ci#define PACKET3_COPY_DW 0x3B 165662306a36Sopenharmony_ci#define PACKET3_WAIT_REG_MEM 0x3C 165762306a36Sopenharmony_ci#define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) 165862306a36Sopenharmony_ci /* 0 - always 165962306a36Sopenharmony_ci * 1 - < 166062306a36Sopenharmony_ci * 2 - <= 166162306a36Sopenharmony_ci * 3 - == 166262306a36Sopenharmony_ci * 4 - != 166362306a36Sopenharmony_ci * 5 - >= 166462306a36Sopenharmony_ci * 6 - > 166562306a36Sopenharmony_ci */ 166662306a36Sopenharmony_ci#define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) 166762306a36Sopenharmony_ci /* 0 - reg 166862306a36Sopenharmony_ci * 1 - mem 166962306a36Sopenharmony_ci */ 167062306a36Sopenharmony_ci#define WAIT_REG_MEM_ENGINE(x) ((x) << 8) 167162306a36Sopenharmony_ci /* 0 - me 167262306a36Sopenharmony_ci * 1 - pfp 167362306a36Sopenharmony_ci */ 167462306a36Sopenharmony_ci#define PACKET3_MEM_WRITE 0x3D 167562306a36Sopenharmony_ci#define PACKET3_COPY_DATA 0x40 167662306a36Sopenharmony_ci#define PACKET3_CP_DMA 0x41 167762306a36Sopenharmony_ci/* 1. header 167862306a36Sopenharmony_ci * 2. SRC_ADDR_LO or DATA [31:0] 167962306a36Sopenharmony_ci * 3. CP_SYNC [31] | SRC_SEL [30:29] | ENGINE [27] | DST_SEL [21:20] | 168062306a36Sopenharmony_ci * SRC_ADDR_HI [7:0] 168162306a36Sopenharmony_ci * 4. DST_ADDR_LO [31:0] 168262306a36Sopenharmony_ci * 5. DST_ADDR_HI [7:0] 168362306a36Sopenharmony_ci * 6. COMMAND [30:21] | BYTE_COUNT [20:0] 168462306a36Sopenharmony_ci */ 168562306a36Sopenharmony_ci# define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) 168662306a36Sopenharmony_ci /* 0 - DST_ADDR 168762306a36Sopenharmony_ci * 1 - GDS 168862306a36Sopenharmony_ci */ 168962306a36Sopenharmony_ci# define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) 169062306a36Sopenharmony_ci /* 0 - ME 169162306a36Sopenharmony_ci * 1 - PFP 169262306a36Sopenharmony_ci */ 169362306a36Sopenharmony_ci# define PACKET3_CP_DMA_SRC_SEL(x) ((x) << 29) 169462306a36Sopenharmony_ci /* 0 - SRC_ADDR 169562306a36Sopenharmony_ci * 1 - GDS 169662306a36Sopenharmony_ci * 2 - DATA 169762306a36Sopenharmony_ci */ 169862306a36Sopenharmony_ci# define PACKET3_CP_DMA_CP_SYNC (1 << 31) 169962306a36Sopenharmony_ci/* COMMAND */ 170062306a36Sopenharmony_ci# define PACKET3_CP_DMA_DIS_WC (1 << 21) 170162306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22) 170262306a36Sopenharmony_ci /* 0 - none 170362306a36Sopenharmony_ci * 1 - 8 in 16 170462306a36Sopenharmony_ci * 2 - 8 in 32 170562306a36Sopenharmony_ci * 3 - 8 in 64 170662306a36Sopenharmony_ci */ 170762306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24) 170862306a36Sopenharmony_ci /* 0 - none 170962306a36Sopenharmony_ci * 1 - 8 in 16 171062306a36Sopenharmony_ci * 2 - 8 in 32 171162306a36Sopenharmony_ci * 3 - 8 in 64 171262306a36Sopenharmony_ci */ 171362306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_SAS (1 << 26) 171462306a36Sopenharmony_ci /* 0 - memory 171562306a36Sopenharmony_ci * 1 - register 171662306a36Sopenharmony_ci */ 171762306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_DAS (1 << 27) 171862306a36Sopenharmony_ci /* 0 - memory 171962306a36Sopenharmony_ci * 1 - register 172062306a36Sopenharmony_ci */ 172162306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_SAIC (1 << 28) 172262306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_DAIC (1 << 29) 172362306a36Sopenharmony_ci# define PACKET3_CP_DMA_CMD_RAW_WAIT (1 << 30) 172462306a36Sopenharmony_ci#define PACKET3_PFP_SYNC_ME 0x42 172562306a36Sopenharmony_ci#define PACKET3_SURFACE_SYNC 0x43 172662306a36Sopenharmony_ci# define PACKET3_DEST_BASE_0_ENA (1 << 0) 172762306a36Sopenharmony_ci# define PACKET3_DEST_BASE_1_ENA (1 << 1) 172862306a36Sopenharmony_ci# define PACKET3_CB0_DEST_BASE_ENA (1 << 6) 172962306a36Sopenharmony_ci# define PACKET3_CB1_DEST_BASE_ENA (1 << 7) 173062306a36Sopenharmony_ci# define PACKET3_CB2_DEST_BASE_ENA (1 << 8) 173162306a36Sopenharmony_ci# define PACKET3_CB3_DEST_BASE_ENA (1 << 9) 173262306a36Sopenharmony_ci# define PACKET3_CB4_DEST_BASE_ENA (1 << 10) 173362306a36Sopenharmony_ci# define PACKET3_CB5_DEST_BASE_ENA (1 << 11) 173462306a36Sopenharmony_ci# define PACKET3_CB6_DEST_BASE_ENA (1 << 12) 173562306a36Sopenharmony_ci# define PACKET3_CB7_DEST_BASE_ENA (1 << 13) 173662306a36Sopenharmony_ci# define PACKET3_DB_DEST_BASE_ENA (1 << 14) 173762306a36Sopenharmony_ci# define PACKET3_DEST_BASE_2_ENA (1 << 19) 173862306a36Sopenharmony_ci# define PACKET3_DEST_BASE_3_ENA (1 << 21) 173962306a36Sopenharmony_ci# define PACKET3_TCL1_ACTION_ENA (1 << 22) 174062306a36Sopenharmony_ci# define PACKET3_TC_ACTION_ENA (1 << 23) 174162306a36Sopenharmony_ci# define PACKET3_CB_ACTION_ENA (1 << 25) 174262306a36Sopenharmony_ci# define PACKET3_DB_ACTION_ENA (1 << 26) 174362306a36Sopenharmony_ci# define PACKET3_SH_KCACHE_ACTION_ENA (1 << 27) 174462306a36Sopenharmony_ci# define PACKET3_SH_ICACHE_ACTION_ENA (1 << 29) 174562306a36Sopenharmony_ci#define PACKET3_ME_INITIALIZE 0x44 174662306a36Sopenharmony_ci#define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16) 174762306a36Sopenharmony_ci#define PACKET3_COND_WRITE 0x45 174862306a36Sopenharmony_ci#define PACKET3_EVENT_WRITE 0x46 174962306a36Sopenharmony_ci#define EVENT_TYPE(x) ((x) << 0) 175062306a36Sopenharmony_ci#define EVENT_INDEX(x) ((x) << 8) 175162306a36Sopenharmony_ci /* 0 - any non-TS event 175262306a36Sopenharmony_ci * 1 - ZPASS_DONE 175362306a36Sopenharmony_ci * 2 - SAMPLE_PIPELINESTAT 175462306a36Sopenharmony_ci * 3 - SAMPLE_STREAMOUTSTAT* 175562306a36Sopenharmony_ci * 4 - *S_PARTIAL_FLUSH 175662306a36Sopenharmony_ci * 5 - EOP events 175762306a36Sopenharmony_ci * 6 - EOS events 175862306a36Sopenharmony_ci * 7 - CACHE_FLUSH, CACHE_FLUSH_AND_INV_EVENT 175962306a36Sopenharmony_ci */ 176062306a36Sopenharmony_ci#define INV_L2 (1 << 20) 176162306a36Sopenharmony_ci /* INV TC L2 cache when EVENT_INDEX = 7 */ 176262306a36Sopenharmony_ci#define PACKET3_EVENT_WRITE_EOP 0x47 176362306a36Sopenharmony_ci#define DATA_SEL(x) ((x) << 29) 176462306a36Sopenharmony_ci /* 0 - discard 176562306a36Sopenharmony_ci * 1 - send low 32bit data 176662306a36Sopenharmony_ci * 2 - send 64bit data 176762306a36Sopenharmony_ci * 3 - send 64bit counter value 176862306a36Sopenharmony_ci */ 176962306a36Sopenharmony_ci#define INT_SEL(x) ((x) << 24) 177062306a36Sopenharmony_ci /* 0 - none 177162306a36Sopenharmony_ci * 1 - interrupt only (DATA_SEL = 0) 177262306a36Sopenharmony_ci * 2 - interrupt when data write is confirmed 177362306a36Sopenharmony_ci */ 177462306a36Sopenharmony_ci#define PACKET3_EVENT_WRITE_EOS 0x48 177562306a36Sopenharmony_ci#define PACKET3_PREAMBLE_CNTL 0x4A 177662306a36Sopenharmony_ci# define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) 177762306a36Sopenharmony_ci# define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) 177862306a36Sopenharmony_ci#define PACKET3_ONE_REG_WRITE 0x57 177962306a36Sopenharmony_ci#define PACKET3_LOAD_CONFIG_REG 0x5F 178062306a36Sopenharmony_ci#define PACKET3_LOAD_CONTEXT_REG 0x60 178162306a36Sopenharmony_ci#define PACKET3_LOAD_SH_REG 0x61 178262306a36Sopenharmony_ci#define PACKET3_SET_CONFIG_REG 0x68 178362306a36Sopenharmony_ci#define PACKET3_SET_CONFIG_REG_START 0x00008000 178462306a36Sopenharmony_ci#define PACKET3_SET_CONFIG_REG_END 0x0000b000 178562306a36Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG 0x69 178662306a36Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_START 0x00028000 178762306a36Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_END 0x00029000 178862306a36Sopenharmony_ci#define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 178962306a36Sopenharmony_ci#define PACKET3_SET_RESOURCE_INDIRECT 0x74 179062306a36Sopenharmony_ci#define PACKET3_SET_SH_REG 0x76 179162306a36Sopenharmony_ci#define PACKET3_SET_SH_REG_START 0x0000b000 179262306a36Sopenharmony_ci#define PACKET3_SET_SH_REG_END 0x0000c000 179362306a36Sopenharmony_ci#define PACKET3_SET_SH_REG_OFFSET 0x77 179462306a36Sopenharmony_ci#define PACKET3_ME_WRITE 0x7A 179562306a36Sopenharmony_ci#define PACKET3_SCRATCH_RAM_WRITE 0x7D 179662306a36Sopenharmony_ci#define PACKET3_SCRATCH_RAM_READ 0x7E 179762306a36Sopenharmony_ci#define PACKET3_CE_WRITE 0x7F 179862306a36Sopenharmony_ci#define PACKET3_LOAD_CONST_RAM 0x80 179962306a36Sopenharmony_ci#define PACKET3_WRITE_CONST_RAM 0x81 180062306a36Sopenharmony_ci#define PACKET3_WRITE_CONST_RAM_OFFSET 0x82 180162306a36Sopenharmony_ci#define PACKET3_DUMP_CONST_RAM 0x83 180262306a36Sopenharmony_ci#define PACKET3_INCREMENT_CE_COUNTER 0x84 180362306a36Sopenharmony_ci#define PACKET3_INCREMENT_DE_COUNTER 0x85 180462306a36Sopenharmony_ci#define PACKET3_WAIT_ON_CE_COUNTER 0x86 180562306a36Sopenharmony_ci#define PACKET3_WAIT_ON_DE_COUNTER 0x87 180662306a36Sopenharmony_ci#define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 180762306a36Sopenharmony_ci#define PACKET3_SET_CE_DE_COUNTERS 0x89 180862306a36Sopenharmony_ci#define PACKET3_WAIT_ON_AVAIL_BUFFER 0x8A 180962306a36Sopenharmony_ci#define PACKET3_SWITCH_BUFFER 0x8B 181062306a36Sopenharmony_ci 181162306a36Sopenharmony_ci/* ASYNC DMA - first instance at 0xd000, second at 0xd800 */ 181262306a36Sopenharmony_ci#define DMA0_REGISTER_OFFSET 0x0 /* not a register */ 181362306a36Sopenharmony_ci#define DMA1_REGISTER_OFFSET 0x800 /* not a register */ 181462306a36Sopenharmony_ci 181562306a36Sopenharmony_ci#define DMA_RB_CNTL 0xd000 181662306a36Sopenharmony_ci# define DMA_RB_ENABLE (1 << 0) 181762306a36Sopenharmony_ci# define DMA_RB_SIZE(x) ((x) << 1) /* log2 */ 181862306a36Sopenharmony_ci# define DMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */ 181962306a36Sopenharmony_ci# define DMA_RPTR_WRITEBACK_ENABLE (1 << 12) 182062306a36Sopenharmony_ci# define DMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */ 182162306a36Sopenharmony_ci# define DMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */ 182262306a36Sopenharmony_ci#define DMA_RB_BASE 0xd004 182362306a36Sopenharmony_ci#define DMA_RB_RPTR 0xd008 182462306a36Sopenharmony_ci#define DMA_RB_WPTR 0xd00c 182562306a36Sopenharmony_ci 182662306a36Sopenharmony_ci#define DMA_RB_RPTR_ADDR_HI 0xd01c 182762306a36Sopenharmony_ci#define DMA_RB_RPTR_ADDR_LO 0xd020 182862306a36Sopenharmony_ci 182962306a36Sopenharmony_ci#define DMA_IB_CNTL 0xd024 183062306a36Sopenharmony_ci# define DMA_IB_ENABLE (1 << 0) 183162306a36Sopenharmony_ci# define DMA_IB_SWAP_ENABLE (1 << 4) 183262306a36Sopenharmony_ci#define DMA_IB_RPTR 0xd028 183362306a36Sopenharmony_ci#define DMA_CNTL 0xd02c 183462306a36Sopenharmony_ci# define TRAP_ENABLE (1 << 0) 183562306a36Sopenharmony_ci# define SEM_INCOMPLETE_INT_ENABLE (1 << 1) 183662306a36Sopenharmony_ci# define SEM_WAIT_INT_ENABLE (1 << 2) 183762306a36Sopenharmony_ci# define DATA_SWAP_ENABLE (1 << 3) 183862306a36Sopenharmony_ci# define FENCE_SWAP_ENABLE (1 << 4) 183962306a36Sopenharmony_ci# define CTXEMPTY_INT_ENABLE (1 << 28) 184062306a36Sopenharmony_ci#define DMA_STATUS_REG 0xd034 184162306a36Sopenharmony_ci# define DMA_IDLE (1 << 0) 184262306a36Sopenharmony_ci#define DMA_TILING_CONFIG 0xd0b8 184362306a36Sopenharmony_ci 184462306a36Sopenharmony_ci#define DMA_POWER_CNTL 0xd0bc 184562306a36Sopenharmony_ci# define MEM_POWER_OVERRIDE (1 << 8) 184662306a36Sopenharmony_ci#define DMA_CLK_CTRL 0xd0c0 184762306a36Sopenharmony_ci 184862306a36Sopenharmony_ci#define DMA_PG 0xd0d4 184962306a36Sopenharmony_ci# define PG_CNTL_ENABLE (1 << 0) 185062306a36Sopenharmony_ci#define DMA_PGFSM_CONFIG 0xd0d8 185162306a36Sopenharmony_ci#define DMA_PGFSM_WRITE 0xd0dc 185262306a36Sopenharmony_ci 185362306a36Sopenharmony_ci#define DMA_PACKET(cmd, b, t, s, n) ((((cmd) & 0xF) << 28) | \ 185462306a36Sopenharmony_ci (((b) & 0x1) << 26) | \ 185562306a36Sopenharmony_ci (((t) & 0x1) << 23) | \ 185662306a36Sopenharmony_ci (((s) & 0x1) << 22) | \ 185762306a36Sopenharmony_ci (((n) & 0xFFFFF) << 0)) 185862306a36Sopenharmony_ci 185962306a36Sopenharmony_ci#define DMA_IB_PACKET(cmd, vmid, n) ((((cmd) & 0xF) << 28) | \ 186062306a36Sopenharmony_ci (((vmid) & 0xF) << 20) | \ 186162306a36Sopenharmony_ci (((n) & 0xFFFFF) << 0)) 186262306a36Sopenharmony_ci 186362306a36Sopenharmony_ci#define DMA_PTE_PDE_PACKET(n) ((2 << 28) | \ 186462306a36Sopenharmony_ci (1 << 26) | \ 186562306a36Sopenharmony_ci (1 << 21) | \ 186662306a36Sopenharmony_ci (((n) & 0xFFFFF) << 0)) 186762306a36Sopenharmony_ci 186862306a36Sopenharmony_ci/* async DMA Packet types */ 186962306a36Sopenharmony_ci#define DMA_PACKET_WRITE 0x2 187062306a36Sopenharmony_ci#define DMA_PACKET_COPY 0x3 187162306a36Sopenharmony_ci#define DMA_PACKET_INDIRECT_BUFFER 0x4 187262306a36Sopenharmony_ci#define DMA_PACKET_SEMAPHORE 0x5 187362306a36Sopenharmony_ci#define DMA_PACKET_FENCE 0x6 187462306a36Sopenharmony_ci#define DMA_PACKET_TRAP 0x7 187562306a36Sopenharmony_ci#define DMA_PACKET_SRBM_WRITE 0x9 187662306a36Sopenharmony_ci#define DMA_PACKET_CONSTANT_FILL 0xd 187762306a36Sopenharmony_ci#define DMA_PACKET_POLL_REG_MEM 0xe 187862306a36Sopenharmony_ci#define DMA_PACKET_NOP 0xf 187962306a36Sopenharmony_ci 188062306a36Sopenharmony_ci#define VCE_STATUS 0x20004 188162306a36Sopenharmony_ci#define VCE_VCPU_CNTL 0x20014 188262306a36Sopenharmony_ci#define VCE_CLK_EN (1 << 0) 188362306a36Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET0 0x20024 188462306a36Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE0 0x20028 188562306a36Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET1 0x2002c 188662306a36Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE1 0x20030 188762306a36Sopenharmony_ci#define VCE_VCPU_CACHE_OFFSET2 0x20034 188862306a36Sopenharmony_ci#define VCE_VCPU_CACHE_SIZE2 0x20038 188962306a36Sopenharmony_ci#define VCE_VCPU_SCRATCH7 0x200dc 189062306a36Sopenharmony_ci#define VCE_SOFT_RESET 0x20120 189162306a36Sopenharmony_ci#define VCE_ECPU_SOFT_RESET (1 << 0) 189262306a36Sopenharmony_ci#define VCE_FME_SOFT_RESET (1 << 2) 189362306a36Sopenharmony_ci#define VCE_RB_BASE_LO2 0x2016c 189462306a36Sopenharmony_ci#define VCE_RB_BASE_HI2 0x20170 189562306a36Sopenharmony_ci#define VCE_RB_SIZE2 0x20174 189662306a36Sopenharmony_ci#define VCE_RB_RPTR2 0x20178 189762306a36Sopenharmony_ci#define VCE_RB_WPTR2 0x2017c 189862306a36Sopenharmony_ci#define VCE_RB_BASE_LO 0x20180 189962306a36Sopenharmony_ci#define VCE_RB_BASE_HI 0x20184 190062306a36Sopenharmony_ci#define VCE_RB_SIZE 0x20188 190162306a36Sopenharmony_ci#define VCE_RB_RPTR 0x2018c 190262306a36Sopenharmony_ci#define VCE_RB_WPTR 0x20190 190362306a36Sopenharmony_ci#define VCE_CLOCK_GATING_A 0x202f8 190462306a36Sopenharmony_ci# define CGC_DYN_CLOCK_MODE (1 << 16) 190562306a36Sopenharmony_ci#define VCE_CLOCK_GATING_B 0x202fc 190662306a36Sopenharmony_ci#define VCE_UENC_CLOCK_GATING 0x205bc 190762306a36Sopenharmony_ci#define VCE_UENC_REG_CLOCK_GATING 0x205c0 190862306a36Sopenharmony_ci#define VCE_FW_REG_STATUS 0x20e10 190962306a36Sopenharmony_ci# define VCE_FW_REG_STATUS_BUSY (1 << 0) 191062306a36Sopenharmony_ci# define VCE_FW_REG_STATUS_PASS (1 << 3) 191162306a36Sopenharmony_ci# define VCE_FW_REG_STATUS_DONE (1 << 11) 191262306a36Sopenharmony_ci#define VCE_LMI_FW_START_KEYSEL 0x20e18 191362306a36Sopenharmony_ci#define VCE_LMI_FW_PERIODIC_CTRL 0x20e20 191462306a36Sopenharmony_ci#define VCE_LMI_CTRL2 0x20e74 191562306a36Sopenharmony_ci#define VCE_LMI_CTRL 0x20e98 191662306a36Sopenharmony_ci#define VCE_LMI_VM_CTRL 0x20ea0 191762306a36Sopenharmony_ci#define VCE_LMI_SWAP_CNTL 0x20eb4 191862306a36Sopenharmony_ci#define VCE_LMI_SWAP_CNTL1 0x20eb8 191962306a36Sopenharmony_ci#define VCE_LMI_CACHE_CTRL 0x20ef4 192062306a36Sopenharmony_ci 192162306a36Sopenharmony_ci#define VCE_CMD_NO_OP 0x00000000 192262306a36Sopenharmony_ci#define VCE_CMD_END 0x00000001 192362306a36Sopenharmony_ci#define VCE_CMD_IB 0x00000002 192462306a36Sopenharmony_ci#define VCE_CMD_FENCE 0x00000003 192562306a36Sopenharmony_ci#define VCE_CMD_TRAP 0x00000004 192662306a36Sopenharmony_ci#define VCE_CMD_IB_AUTO 0x00000005 192762306a36Sopenharmony_ci#define VCE_CMD_SEMAPHORE 0x00000006 192862306a36Sopenharmony_ci 192962306a36Sopenharmony_ci/* discrete vce clocks */ 193062306a36Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL 0xc0030600 193162306a36Sopenharmony_ci# define VCEPLL_RESET_MASK 0x00000001 193262306a36Sopenharmony_ci# define VCEPLL_SLEEP_MASK 0x00000002 193362306a36Sopenharmony_ci# define VCEPLL_BYPASS_EN_MASK 0x00000004 193462306a36Sopenharmony_ci# define VCEPLL_CTLREQ_MASK 0x00000008 193562306a36Sopenharmony_ci# define VCEPLL_VCO_MODE_MASK 0x00000600 193662306a36Sopenharmony_ci# define VCEPLL_REF_DIV_MASK 0x003F0000 193762306a36Sopenharmony_ci# define VCEPLL_CTLACK_MASK 0x40000000 193862306a36Sopenharmony_ci# define VCEPLL_CTLACK2_MASK 0x80000000 193962306a36Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_2 0xc0030601 194062306a36Sopenharmony_ci# define VCEPLL_PDIV_A(x) ((x) << 0) 194162306a36Sopenharmony_ci# define VCEPLL_PDIV_A_MASK 0x0000007F 194262306a36Sopenharmony_ci# define VCEPLL_PDIV_B(x) ((x) << 8) 194362306a36Sopenharmony_ci# define VCEPLL_PDIV_B_MASK 0x00007F00 194462306a36Sopenharmony_ci# define EVCLK_SRC_SEL(x) ((x) << 20) 194562306a36Sopenharmony_ci# define EVCLK_SRC_SEL_MASK 0x01F00000 194662306a36Sopenharmony_ci# define ECCLK_SRC_SEL(x) ((x) << 25) 194762306a36Sopenharmony_ci# define ECCLK_SRC_SEL_MASK 0x3E000000 194862306a36Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_3 0xc0030602 194962306a36Sopenharmony_ci# define VCEPLL_FB_DIV(x) ((x) << 0) 195062306a36Sopenharmony_ci# define VCEPLL_FB_DIV_MASK 0x01FFFFFF 195162306a36Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_4 0xc0030603 195262306a36Sopenharmony_ci#define CG_VCEPLL_FUNC_CNTL_5 0xc0030604 195362306a36Sopenharmony_ci#define CG_VCEPLL_SPREAD_SPECTRUM 0xc0030606 195462306a36Sopenharmony_ci# define VCEPLL_SSEN_MASK 0x00000001 195562306a36Sopenharmony_ci 195662306a36Sopenharmony_ci#endif 1957