162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright 2010 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 EVERGREEND_H
2562306a36Sopenharmony_ci#define EVERGREEND_H
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#define EVERGREEN_MAX_SH_GPRS           256
2862306a36Sopenharmony_ci#define EVERGREEN_MAX_TEMP_GPRS         16
2962306a36Sopenharmony_ci#define EVERGREEN_MAX_SH_THREADS        256
3062306a36Sopenharmony_ci#define EVERGREEN_MAX_SH_STACK_ENTRIES  4096
3162306a36Sopenharmony_ci#define EVERGREEN_MAX_FRC_EOV_CNT       16384
3262306a36Sopenharmony_ci#define EVERGREEN_MAX_BACKENDS          8
3362306a36Sopenharmony_ci#define EVERGREEN_MAX_BACKENDS_MASK     0xFF
3462306a36Sopenharmony_ci#define EVERGREEN_MAX_SIMDS             16
3562306a36Sopenharmony_ci#define EVERGREEN_MAX_SIMDS_MASK        0xFFFF
3662306a36Sopenharmony_ci#define EVERGREEN_MAX_PIPES             8
3762306a36Sopenharmony_ci#define EVERGREEN_MAX_PIPES_MASK        0xFF
3862306a36Sopenharmony_ci#define EVERGREEN_MAX_LDS_NUM           0xFFFF
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci#define CYPRESS_GB_ADDR_CONFIG_GOLDEN        0x02011003
4162306a36Sopenharmony_ci#define BARTS_GB_ADDR_CONFIG_GOLDEN          0x02011003
4262306a36Sopenharmony_ci#define CAYMAN_GB_ADDR_CONFIG_GOLDEN         0x02011003
4362306a36Sopenharmony_ci#define JUNIPER_GB_ADDR_CONFIG_GOLDEN        0x02010002
4462306a36Sopenharmony_ci#define REDWOOD_GB_ADDR_CONFIG_GOLDEN        0x02010002
4562306a36Sopenharmony_ci#define TURKS_GB_ADDR_CONFIG_GOLDEN          0x02010002
4662306a36Sopenharmony_ci#define CEDAR_GB_ADDR_CONFIG_GOLDEN          0x02010001
4762306a36Sopenharmony_ci#define CAICOS_GB_ADDR_CONFIG_GOLDEN         0x02010001
4862306a36Sopenharmony_ci#define SUMO_GB_ADDR_CONFIG_GOLDEN           0x02010002
4962306a36Sopenharmony_ci#define SUMO2_GB_ADDR_CONFIG_GOLDEN          0x02010002
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci/* pm registers */
5262306a36Sopenharmony_ci#define	SMC_MSG						0x20c
5362306a36Sopenharmony_ci#define		HOST_SMC_MSG(x)				((x) << 0)
5462306a36Sopenharmony_ci#define		HOST_SMC_MSG_MASK			(0xff << 0)
5562306a36Sopenharmony_ci#define		HOST_SMC_MSG_SHIFT			0
5662306a36Sopenharmony_ci#define		HOST_SMC_RESP(x)			((x) << 8)
5762306a36Sopenharmony_ci#define		HOST_SMC_RESP_MASK			(0xff << 8)
5862306a36Sopenharmony_ci#define		HOST_SMC_RESP_SHIFT			8
5962306a36Sopenharmony_ci#define		SMC_HOST_MSG(x)				((x) << 16)
6062306a36Sopenharmony_ci#define		SMC_HOST_MSG_MASK			(0xff << 16)
6162306a36Sopenharmony_ci#define		SMC_HOST_MSG_SHIFT			16
6262306a36Sopenharmony_ci#define		SMC_HOST_RESP(x)			((x) << 24)
6362306a36Sopenharmony_ci#define		SMC_HOST_RESP_MASK			(0xff << 24)
6462306a36Sopenharmony_ci#define		SMC_HOST_RESP_SHIFT			24
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define DCCG_DISP_SLOW_SELECT_REG                       0x4fc
6762306a36Sopenharmony_ci#define		DCCG_DISP1_SLOW_SELECT(x)		((x) << 0)
6862306a36Sopenharmony_ci#define		DCCG_DISP1_SLOW_SELECT_MASK		(7 << 0)
6962306a36Sopenharmony_ci#define		DCCG_DISP1_SLOW_SELECT_SHIFT		0
7062306a36Sopenharmony_ci#define		DCCG_DISP2_SLOW_SELECT(x)		((x) << 4)
7162306a36Sopenharmony_ci#define		DCCG_DISP2_SLOW_SELECT_MASK		(7 << 4)
7262306a36Sopenharmony_ci#define		DCCG_DISP2_SLOW_SELECT_SHIFT		4
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define	CG_SPLL_FUNC_CNTL				0x600
7562306a36Sopenharmony_ci#define		SPLL_RESET				(1 << 0)
7662306a36Sopenharmony_ci#define		SPLL_SLEEP				(1 << 1)
7762306a36Sopenharmony_ci#define		SPLL_BYPASS_EN				(1 << 3)
7862306a36Sopenharmony_ci#define		SPLL_REF_DIV(x)				((x) << 4)
7962306a36Sopenharmony_ci#define		SPLL_REF_DIV_MASK			(0x3f << 4)
8062306a36Sopenharmony_ci#define		SPLL_PDIV_A(x)				((x) << 20)
8162306a36Sopenharmony_ci#define		SPLL_PDIV_A_MASK			(0x7f << 20)
8262306a36Sopenharmony_ci#define	CG_SPLL_FUNC_CNTL_2				0x604
8362306a36Sopenharmony_ci#define		SCLK_MUX_SEL(x)				((x) << 0)
8462306a36Sopenharmony_ci#define		SCLK_MUX_SEL_MASK			(0x1ff << 0)
8562306a36Sopenharmony_ci#define		SCLK_MUX_UPDATE				(1 << 26)
8662306a36Sopenharmony_ci#define	CG_SPLL_FUNC_CNTL_3				0x608
8762306a36Sopenharmony_ci#define		SPLL_FB_DIV(x)				((x) << 0)
8862306a36Sopenharmony_ci#define		SPLL_FB_DIV_MASK			(0x3ffffff << 0)
8962306a36Sopenharmony_ci#define		SPLL_DITHEN				(1 << 28)
9062306a36Sopenharmony_ci#define	CG_SPLL_STATUS					0x60c
9162306a36Sopenharmony_ci#define		SPLL_CHG_STATUS				(1 << 1)
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define MPLL_CNTL_MODE                                  0x61c
9462306a36Sopenharmony_ci#       define MPLL_MCLK_SEL                            (1 << 11)
9562306a36Sopenharmony_ci#       define SS_SSEN                                  (1 << 24)
9662306a36Sopenharmony_ci#       define SS_DSMODE_EN                             (1 << 25)
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci#define	MPLL_AD_FUNC_CNTL				0x624
9962306a36Sopenharmony_ci#define		CLKF(x)					((x) << 0)
10062306a36Sopenharmony_ci#define		CLKF_MASK				(0x7f << 0)
10162306a36Sopenharmony_ci#define		CLKR(x)					((x) << 7)
10262306a36Sopenharmony_ci#define		CLKR_MASK				(0x1f << 7)
10362306a36Sopenharmony_ci#define		CLKFRAC(x)				((x) << 12)
10462306a36Sopenharmony_ci#define		CLKFRAC_MASK				(0x1f << 12)
10562306a36Sopenharmony_ci#define		YCLK_POST_DIV(x)			((x) << 17)
10662306a36Sopenharmony_ci#define		YCLK_POST_DIV_MASK			(3 << 17)
10762306a36Sopenharmony_ci#define		IBIAS(x)				((x) << 20)
10862306a36Sopenharmony_ci#define		IBIAS_MASK				(0x3ff << 20)
10962306a36Sopenharmony_ci#define		RESET					(1 << 30)
11062306a36Sopenharmony_ci#define		PDNB					(1 << 31)
11162306a36Sopenharmony_ci#define	MPLL_AD_FUNC_CNTL_2				0x628
11262306a36Sopenharmony_ci#define		BYPASS					(1 << 19)
11362306a36Sopenharmony_ci#define		BIAS_GEN_PDNB				(1 << 24)
11462306a36Sopenharmony_ci#define		RESET_EN				(1 << 25)
11562306a36Sopenharmony_ci#define		VCO_MODE				(1 << 29)
11662306a36Sopenharmony_ci#define	MPLL_DQ_FUNC_CNTL				0x62c
11762306a36Sopenharmony_ci#define	MPLL_DQ_FUNC_CNTL_2				0x630
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci#define GENERAL_PWRMGT                                  0x63c
12062306a36Sopenharmony_ci#       define GLOBAL_PWRMGT_EN                         (1 << 0)
12162306a36Sopenharmony_ci#       define STATIC_PM_EN                             (1 << 1)
12262306a36Sopenharmony_ci#       define THERMAL_PROTECTION_DIS                   (1 << 2)
12362306a36Sopenharmony_ci#       define THERMAL_PROTECTION_TYPE                  (1 << 3)
12462306a36Sopenharmony_ci#       define ENABLE_GEN2PCIE                          (1 << 4)
12562306a36Sopenharmony_ci#       define ENABLE_GEN2XSP                           (1 << 5)
12662306a36Sopenharmony_ci#       define SW_SMIO_INDEX(x)                         ((x) << 6)
12762306a36Sopenharmony_ci#       define SW_SMIO_INDEX_MASK                       (3 << 6)
12862306a36Sopenharmony_ci#       define SW_SMIO_INDEX_SHIFT                      6
12962306a36Sopenharmony_ci#       define LOW_VOLT_D2_ACPI                         (1 << 8)
13062306a36Sopenharmony_ci#       define LOW_VOLT_D3_ACPI                         (1 << 9)
13162306a36Sopenharmony_ci#       define VOLT_PWRMGT_EN                           (1 << 10)
13262306a36Sopenharmony_ci#       define BACKBIAS_PAD_EN                          (1 << 18)
13362306a36Sopenharmony_ci#       define BACKBIAS_VALUE                           (1 << 19)
13462306a36Sopenharmony_ci#       define DYN_SPREAD_SPECTRUM_EN                   (1 << 23)
13562306a36Sopenharmony_ci#       define AC_DC_SW                                 (1 << 24)
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_ci#define SCLK_PWRMGT_CNTL                                  0x644
13862306a36Sopenharmony_ci#       define SCLK_PWRMGT_OFF                            (1 << 0)
13962306a36Sopenharmony_ci#       define SCLK_LOW_D1                                (1 << 1)
14062306a36Sopenharmony_ci#       define FIR_RESET                                  (1 << 4)
14162306a36Sopenharmony_ci#       define FIR_FORCE_TREND_SEL                        (1 << 5)
14262306a36Sopenharmony_ci#       define FIR_TREND_MODE                             (1 << 6)
14362306a36Sopenharmony_ci#       define DYN_GFX_CLK_OFF_EN                         (1 << 7)
14462306a36Sopenharmony_ci#       define GFX_CLK_FORCE_ON                           (1 << 8)
14562306a36Sopenharmony_ci#       define GFX_CLK_REQUEST_OFF                        (1 << 9)
14662306a36Sopenharmony_ci#       define GFX_CLK_FORCE_OFF                          (1 << 10)
14762306a36Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D1                        (1 << 11)
14862306a36Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D2                        (1 << 12)
14962306a36Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D3                        (1 << 13)
15062306a36Sopenharmony_ci#       define DYN_LIGHT_SLEEP_EN                         (1 << 14)
15162306a36Sopenharmony_ci#define	MCLK_PWRMGT_CNTL				0x648
15262306a36Sopenharmony_ci#       define DLL_SPEED(x)				((x) << 0)
15362306a36Sopenharmony_ci#       define DLL_SPEED_MASK				(0x1f << 0)
15462306a36Sopenharmony_ci#       define MPLL_PWRMGT_OFF                          (1 << 5)
15562306a36Sopenharmony_ci#       define DLL_READY                                (1 << 6)
15662306a36Sopenharmony_ci#       define MC_INT_CNTL                              (1 << 7)
15762306a36Sopenharmony_ci#       define MRDCKA0_PDNB                             (1 << 8)
15862306a36Sopenharmony_ci#       define MRDCKA1_PDNB                             (1 << 9)
15962306a36Sopenharmony_ci#       define MRDCKB0_PDNB                             (1 << 10)
16062306a36Sopenharmony_ci#       define MRDCKB1_PDNB                             (1 << 11)
16162306a36Sopenharmony_ci#       define MRDCKC0_PDNB                             (1 << 12)
16262306a36Sopenharmony_ci#       define MRDCKC1_PDNB                             (1 << 13)
16362306a36Sopenharmony_ci#       define MRDCKD0_PDNB                             (1 << 14)
16462306a36Sopenharmony_ci#       define MRDCKD1_PDNB                             (1 << 15)
16562306a36Sopenharmony_ci#       define MRDCKA0_RESET                            (1 << 16)
16662306a36Sopenharmony_ci#       define MRDCKA1_RESET                            (1 << 17)
16762306a36Sopenharmony_ci#       define MRDCKB0_RESET                            (1 << 18)
16862306a36Sopenharmony_ci#       define MRDCKB1_RESET                            (1 << 19)
16962306a36Sopenharmony_ci#       define MRDCKC0_RESET                            (1 << 20)
17062306a36Sopenharmony_ci#       define MRDCKC1_RESET                            (1 << 21)
17162306a36Sopenharmony_ci#       define MRDCKD0_RESET                            (1 << 22)
17262306a36Sopenharmony_ci#       define MRDCKD1_RESET                            (1 << 23)
17362306a36Sopenharmony_ci#       define DLL_READY_READ                           (1 << 24)
17462306a36Sopenharmony_ci#       define USE_DISPLAY_GAP                          (1 << 25)
17562306a36Sopenharmony_ci#       define USE_DISPLAY_URGENT_NORMAL                (1 << 26)
17662306a36Sopenharmony_ci#       define MPLL_TURNOFF_D2                          (1 << 28)
17762306a36Sopenharmony_ci#define	DLL_CNTL					0x64c
17862306a36Sopenharmony_ci#       define MRDCKA0_BYPASS                           (1 << 24)
17962306a36Sopenharmony_ci#       define MRDCKA1_BYPASS                           (1 << 25)
18062306a36Sopenharmony_ci#       define MRDCKB0_BYPASS                           (1 << 26)
18162306a36Sopenharmony_ci#       define MRDCKB1_BYPASS                           (1 << 27)
18262306a36Sopenharmony_ci#       define MRDCKC0_BYPASS                           (1 << 28)
18362306a36Sopenharmony_ci#       define MRDCKC1_BYPASS                           (1 << 29)
18462306a36Sopenharmony_ci#       define MRDCKD0_BYPASS                           (1 << 30)
18562306a36Sopenharmony_ci#       define MRDCKD1_BYPASS                           (1 << 31)
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_ci#define CG_AT                                           0x6d4
18862306a36Sopenharmony_ci#       define CG_R(x)					((x) << 0)
18962306a36Sopenharmony_ci#       define CG_R_MASK				(0xffff << 0)
19062306a36Sopenharmony_ci#       define CG_L(x)					((x) << 16)
19162306a36Sopenharmony_ci#       define CG_L_MASK				(0xffff << 16)
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ci#define CG_DISPLAY_GAP_CNTL                               0x714
19462306a36Sopenharmony_ci#       define DISP1_GAP(x)                               ((x) << 0)
19562306a36Sopenharmony_ci#       define DISP1_GAP_MASK                             (3 << 0)
19662306a36Sopenharmony_ci#       define DISP2_GAP(x)                               ((x) << 2)
19762306a36Sopenharmony_ci#       define DISP2_GAP_MASK                             (3 << 2)
19862306a36Sopenharmony_ci#       define VBI_TIMER_COUNT(x)                         ((x) << 4)
19962306a36Sopenharmony_ci#       define VBI_TIMER_COUNT_MASK                       (0x3fff << 4)
20062306a36Sopenharmony_ci#       define VBI_TIMER_UNIT(x)                          ((x) << 20)
20162306a36Sopenharmony_ci#       define VBI_TIMER_UNIT_MASK                        (7 << 20)
20262306a36Sopenharmony_ci#       define DISP1_GAP_MCHG(x)                          ((x) << 24)
20362306a36Sopenharmony_ci#       define DISP1_GAP_MCHG_MASK                        (3 << 24)
20462306a36Sopenharmony_ci#       define DISP2_GAP_MCHG(x)                          ((x) << 26)
20562306a36Sopenharmony_ci#       define DISP2_GAP_MCHG_MASK                        (3 << 26)
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci#define	CG_BIF_REQ_AND_RSP				0x7f4
20862306a36Sopenharmony_ci#define		CG_CLIENT_REQ(x)			((x) << 0)
20962306a36Sopenharmony_ci#define		CG_CLIENT_REQ_MASK			(0xff << 0)
21062306a36Sopenharmony_ci#define		CG_CLIENT_REQ_SHIFT			0
21162306a36Sopenharmony_ci#define		CG_CLIENT_RESP(x)			((x) << 8)
21262306a36Sopenharmony_ci#define		CG_CLIENT_RESP_MASK			(0xff << 8)
21362306a36Sopenharmony_ci#define		CG_CLIENT_RESP_SHIFT			8
21462306a36Sopenharmony_ci#define		CLIENT_CG_REQ(x)			((x) << 16)
21562306a36Sopenharmony_ci#define		CLIENT_CG_REQ_MASK			(0xff << 16)
21662306a36Sopenharmony_ci#define		CLIENT_CG_REQ_SHIFT			16
21762306a36Sopenharmony_ci#define		CLIENT_CG_RESP(x)			((x) << 24)
21862306a36Sopenharmony_ci#define		CLIENT_CG_RESP_MASK			(0xff << 24)
21962306a36Sopenharmony_ci#define		CLIENT_CG_RESP_SHIFT			24
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_ci#define	CG_SPLL_SPREAD_SPECTRUM				0x790
22262306a36Sopenharmony_ci#define		SSEN					(1 << 0)
22362306a36Sopenharmony_ci#define	CG_SPLL_SPREAD_SPECTRUM_2			0x794
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci#define	MPLL_SS1					0x85c
22662306a36Sopenharmony_ci#define		CLKV(x)					((x) << 0)
22762306a36Sopenharmony_ci#define		CLKV_MASK				(0x3ffffff << 0)
22862306a36Sopenharmony_ci#define	MPLL_SS2					0x860
22962306a36Sopenharmony_ci#define		CLKS(x)					((x) << 0)
23062306a36Sopenharmony_ci#define		CLKS_MASK				(0xfff << 0)
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci#define	CG_IND_ADDR					0x8f8
23362306a36Sopenharmony_ci#define	CG_IND_DATA					0x8fc
23462306a36Sopenharmony_ci/* CGIND regs */
23562306a36Sopenharmony_ci#define	CG_CGTT_LOCAL_0					0x00
23662306a36Sopenharmony_ci#define	CG_CGTT_LOCAL_1					0x01
23762306a36Sopenharmony_ci#define	CG_CGTT_LOCAL_2					0x02
23862306a36Sopenharmony_ci#define	CG_CGTT_LOCAL_3					0x03
23962306a36Sopenharmony_ci#define	CG_CGLS_TILE_0					0x20
24062306a36Sopenharmony_ci#define	CG_CGLS_TILE_1					0x21
24162306a36Sopenharmony_ci#define	CG_CGLS_TILE_2					0x22
24262306a36Sopenharmony_ci#define	CG_CGLS_TILE_3					0x23
24362306a36Sopenharmony_ci#define	CG_CGLS_TILE_4					0x24
24462306a36Sopenharmony_ci#define	CG_CGLS_TILE_5					0x25
24562306a36Sopenharmony_ci#define	CG_CGLS_TILE_6					0x26
24662306a36Sopenharmony_ci#define	CG_CGLS_TILE_7					0x27
24762306a36Sopenharmony_ci#define	CG_CGLS_TILE_8					0x28
24862306a36Sopenharmony_ci#define	CG_CGLS_TILE_9					0x29
24962306a36Sopenharmony_ci#define	CG_CGLS_TILE_10					0x2a
25062306a36Sopenharmony_ci#define	CG_CGLS_TILE_11					0x2b
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_ci#define VM_L2_CG                                        0x15c0
25362306a36Sopenharmony_ci
25462306a36Sopenharmony_ci#define MC_CONFIG                                       0x2000
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci#define MC_CONFIG_MCD                                   0x20a0
25762306a36Sopenharmony_ci#define MC_CG_CONFIG_MCD                                0x20a4
25862306a36Sopenharmony_ci#define		MC_RD_ENABLE_MCD(x)			((x) << 8)
25962306a36Sopenharmony_ci#define		MC_RD_ENABLE_MCD_MASK			(7 << 8)
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci#define MC_HUB_MISC_HUB_CG                              0x20b8
26262306a36Sopenharmony_ci#define MC_HUB_MISC_VM_CG                               0x20bc
26362306a36Sopenharmony_ci#define MC_HUB_MISC_SIP_CG                              0x20c0
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ci#define MC_XPB_CLK_GAT                                  0x2478
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci#define MC_CG_CONFIG                                    0x25bc
26862306a36Sopenharmony_ci#define		MC_RD_ENABLE(x)				((x) << 4)
26962306a36Sopenharmony_ci#define		MC_RD_ENABLE_MASK			(3 << 4)
27062306a36Sopenharmony_ci
27162306a36Sopenharmony_ci#define MC_CITF_MISC_RD_CG                              0x2648
27262306a36Sopenharmony_ci#define MC_CITF_MISC_WR_CG                              0x264c
27362306a36Sopenharmony_ci#define MC_CITF_MISC_VM_CG                              0x2650
27462306a36Sopenharmony_ci#       define MEM_LS_ENABLE                            (1 << 19)
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci#define MC_ARB_BURST_TIME                               0x2808
27762306a36Sopenharmony_ci#define		STATE0(x)				((x) << 0)
27862306a36Sopenharmony_ci#define		STATE0_MASK				(0x1f << 0)
27962306a36Sopenharmony_ci#define		STATE1(x)				((x) << 5)
28062306a36Sopenharmony_ci#define		STATE1_MASK				(0x1f << 5)
28162306a36Sopenharmony_ci#define		STATE2(x)				((x) << 10)
28262306a36Sopenharmony_ci#define		STATE2_MASK				(0x1f << 10)
28362306a36Sopenharmony_ci#define		STATE3(x)				((x) << 15)
28462306a36Sopenharmony_ci#define		STATE3_MASK				(0x1f << 15)
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_ci#define MC_SEQ_RAS_TIMING                               0x28a0
28762306a36Sopenharmony_ci#define MC_SEQ_CAS_TIMING                               0x28a4
28862306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING                              0x28a8
28962306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING2                             0x28ac
29062306a36Sopenharmony_ci
29162306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D0                                0x28b4
29262306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D1                                0x28b8
29362306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D0                                0x28bc
29462306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D1                                0x28c0
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ci#define MC_SEQ_STATUS_M                                 0x29f4
29762306a36Sopenharmony_ci#       define PMG_PWRSTATE                             (1 << 16)
29862306a36Sopenharmony_ci
29962306a36Sopenharmony_ci#define MC_SEQ_MISC1                                    0x2a04
30062306a36Sopenharmony_ci#define MC_SEQ_RESERVE_M                                0x2a08
30162306a36Sopenharmony_ci#define MC_PMG_CMD_EMRS                                 0x2a0c
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_ci#define MC_SEQ_MISC3                                    0x2a2c
30462306a36Sopenharmony_ci
30562306a36Sopenharmony_ci#define MC_SEQ_MISC5                                    0x2a54
30662306a36Sopenharmony_ci#define MC_SEQ_MISC6                                    0x2a58
30762306a36Sopenharmony_ci
30862306a36Sopenharmony_ci#define MC_SEQ_MISC7                                    0x2a64
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci#define MC_SEQ_CG                                       0x2a68
31162306a36Sopenharmony_ci#define		CG_SEQ_REQ(x)				((x) << 0)
31262306a36Sopenharmony_ci#define		CG_SEQ_REQ_MASK				(0xff << 0)
31362306a36Sopenharmony_ci#define		CG_SEQ_REQ_SHIFT			0
31462306a36Sopenharmony_ci#define		CG_SEQ_RESP(x)				((x) << 8)
31562306a36Sopenharmony_ci#define		CG_SEQ_RESP_MASK			(0xff << 8)
31662306a36Sopenharmony_ci#define		CG_SEQ_RESP_SHIFT			8
31762306a36Sopenharmony_ci#define		SEQ_CG_REQ(x)				((x) << 16)
31862306a36Sopenharmony_ci#define		SEQ_CG_REQ_MASK				(0xff << 16)
31962306a36Sopenharmony_ci#define		SEQ_CG_REQ_SHIFT			16
32062306a36Sopenharmony_ci#define		SEQ_CG_RESP(x)				((x) << 24)
32162306a36Sopenharmony_ci#define		SEQ_CG_RESP_MASK			(0xff << 24)
32262306a36Sopenharmony_ci#define		SEQ_CG_RESP_SHIFT			24
32362306a36Sopenharmony_ci#define MC_SEQ_RAS_TIMING_LP                            0x2a6c
32462306a36Sopenharmony_ci#define MC_SEQ_CAS_TIMING_LP                            0x2a70
32562306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING_LP                           0x2a74
32662306a36Sopenharmony_ci#define MC_SEQ_MISC_TIMING2_LP                          0x2a78
32762306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D0_LP                             0x2a7c
32862306a36Sopenharmony_ci#define MC_SEQ_WR_CTL_D1_LP                             0x2a80
32962306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_EMRS_LP                          0x2a84
33062306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS_LP                           0x2a88
33162306a36Sopenharmony_ci
33262306a36Sopenharmony_ci#define MC_PMG_CMD_MRS                                  0x2aac
33362306a36Sopenharmony_ci
33462306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D0_LP                             0x2b1c
33562306a36Sopenharmony_ci#define MC_SEQ_RD_CTL_D1_LP                             0x2b20
33662306a36Sopenharmony_ci
33762306a36Sopenharmony_ci#define MC_PMG_CMD_MRS1                                 0x2b44
33862306a36Sopenharmony_ci#define MC_SEQ_PMG_CMD_MRS1_LP                          0x2b48
33962306a36Sopenharmony_ci
34062306a36Sopenharmony_ci#define CGTS_SM_CTRL_REG                                0x9150
34162306a36Sopenharmony_ci
34262306a36Sopenharmony_ci/* Registers */
34362306a36Sopenharmony_ci
34462306a36Sopenharmony_ci#define RCU_IND_INDEX           			0x100
34562306a36Sopenharmony_ci#define RCU_IND_DATA            			0x104
34662306a36Sopenharmony_ci
34762306a36Sopenharmony_ci/* discrete uvd clocks */
34862306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL				0x718
34962306a36Sopenharmony_ci#	define UPLL_RESET_MASK				0x00000001
35062306a36Sopenharmony_ci#	define UPLL_SLEEP_MASK				0x00000002
35162306a36Sopenharmony_ci#	define UPLL_BYPASS_EN_MASK			0x00000004
35262306a36Sopenharmony_ci#	define UPLL_CTLREQ_MASK				0x00000008
35362306a36Sopenharmony_ci#	define UPLL_REF_DIV_MASK			0x003F0000
35462306a36Sopenharmony_ci#	define UPLL_VCO_MODE_MASK			0x00000200
35562306a36Sopenharmony_ci#	define UPLL_CTLACK_MASK				0x40000000
35662306a36Sopenharmony_ci#	define UPLL_CTLACK2_MASK			0x80000000
35762306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_2				0x71c
35862306a36Sopenharmony_ci#	define UPLL_PDIV_A(x)				((x) << 0)
35962306a36Sopenharmony_ci#	define UPLL_PDIV_A_MASK				0x0000007F
36062306a36Sopenharmony_ci#	define UPLL_PDIV_B(x)				((x) << 8)
36162306a36Sopenharmony_ci#	define UPLL_PDIV_B_MASK				0x00007F00
36262306a36Sopenharmony_ci#	define VCLK_SRC_SEL(x)				((x) << 20)
36362306a36Sopenharmony_ci#	define VCLK_SRC_SEL_MASK			0x01F00000
36462306a36Sopenharmony_ci#	define DCLK_SRC_SEL(x)				((x) << 25)
36562306a36Sopenharmony_ci#	define DCLK_SRC_SEL_MASK			0x3E000000
36662306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_3				0x720
36762306a36Sopenharmony_ci#	define UPLL_FB_DIV(x)				((x) << 0)
36862306a36Sopenharmony_ci#	define UPLL_FB_DIV_MASK				0x01FFFFFF
36962306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_4				0x854
37062306a36Sopenharmony_ci#	define UPLL_SPARE_ISPARE9			0x00020000
37162306a36Sopenharmony_ci#define CG_UPLL_SPREAD_SPECTRUM				0x79c
37262306a36Sopenharmony_ci#	define SSEN_MASK				0x00000001
37362306a36Sopenharmony_ci
37462306a36Sopenharmony_ci/* fusion uvd clocks */
37562306a36Sopenharmony_ci#define CG_DCLK_CNTL                                    0x610
37662306a36Sopenharmony_ci#       define DCLK_DIVIDER_MASK                        0x7f
37762306a36Sopenharmony_ci#       define DCLK_DIR_CNTL_EN                         (1 << 8)
37862306a36Sopenharmony_ci#define CG_DCLK_STATUS                                  0x614
37962306a36Sopenharmony_ci#       define DCLK_STATUS                              (1 << 0)
38062306a36Sopenharmony_ci#define CG_VCLK_CNTL                                    0x618
38162306a36Sopenharmony_ci#define CG_VCLK_STATUS                                  0x61c
38262306a36Sopenharmony_ci#define	CG_SCRATCH1					0x820
38362306a36Sopenharmony_ci
38462306a36Sopenharmony_ci#define RLC_CNTL                                        0x3f00
38562306a36Sopenharmony_ci#       define RLC_ENABLE                               (1 << 0)
38662306a36Sopenharmony_ci#       define GFX_POWER_GATING_ENABLE                  (1 << 7)
38762306a36Sopenharmony_ci#       define GFX_POWER_GATING_SRC                     (1 << 8)
38862306a36Sopenharmony_ci#       define DYN_PER_SIMD_PG_ENABLE                   (1 << 27)
38962306a36Sopenharmony_ci#       define LB_CNT_SPIM_ACTIVE                       (1 << 30)
39062306a36Sopenharmony_ci#       define LOAD_BALANCE_ENABLE                      (1 << 31)
39162306a36Sopenharmony_ci
39262306a36Sopenharmony_ci#define RLC_HB_BASE                                       0x3f10
39362306a36Sopenharmony_ci#define RLC_HB_CNTL                                       0x3f0c
39462306a36Sopenharmony_ci#define RLC_HB_RPTR                                       0x3f20
39562306a36Sopenharmony_ci#define RLC_HB_WPTR                                       0x3f1c
39662306a36Sopenharmony_ci#define RLC_HB_WPTR_LSB_ADDR                              0x3f14
39762306a36Sopenharmony_ci#define RLC_HB_WPTR_MSB_ADDR                              0x3f18
39862306a36Sopenharmony_ci#define RLC_MC_CNTL                                       0x3f44
39962306a36Sopenharmony_ci#define RLC_UCODE_CNTL                                    0x3f48
40062306a36Sopenharmony_ci#define RLC_UCODE_ADDR                                    0x3f2c
40162306a36Sopenharmony_ci#define RLC_UCODE_DATA                                    0x3f30
40262306a36Sopenharmony_ci
40362306a36Sopenharmony_ci/* new for TN */
40462306a36Sopenharmony_ci#define TN_RLC_SAVE_AND_RESTORE_BASE                      0x3f10
40562306a36Sopenharmony_ci#define TN_RLC_LB_CNTR_MAX                                0x3f14
40662306a36Sopenharmony_ci#define TN_RLC_LB_CNTR_INIT                               0x3f18
40762306a36Sopenharmony_ci#define TN_RLC_CLEAR_STATE_RESTORE_BASE                   0x3f20
40862306a36Sopenharmony_ci#define TN_RLC_LB_INIT_SIMD_MASK                          0x3fe4
40962306a36Sopenharmony_ci#define TN_RLC_LB_ALWAYS_ACTIVE_SIMD_MASK                 0x3fe8
41062306a36Sopenharmony_ci#define TN_RLC_LB_PARAMS                                  0x3fec
41162306a36Sopenharmony_ci
41262306a36Sopenharmony_ci#define GRBM_GFX_INDEX          			0x802C
41362306a36Sopenharmony_ci#define		INSTANCE_INDEX(x)			((x) << 0)
41462306a36Sopenharmony_ci#define		SE_INDEX(x)     			((x) << 16)
41562306a36Sopenharmony_ci#define		INSTANCE_BROADCAST_WRITES      		(1 << 30)
41662306a36Sopenharmony_ci#define		SE_BROADCAST_WRITES      		(1 << 31)
41762306a36Sopenharmony_ci#define RLC_GFX_INDEX           			0x3fC4
41862306a36Sopenharmony_ci#define CC_GC_SHADER_PIPE_CONFIG			0x8950
41962306a36Sopenharmony_ci#define		WRITE_DIS      				(1 << 0)
42062306a36Sopenharmony_ci#define CC_RB_BACKEND_DISABLE				0x98F4
42162306a36Sopenharmony_ci#define		BACKEND_DISABLE(x)     			((x) << 16)
42262306a36Sopenharmony_ci#define GB_ADDR_CONFIG  				0x98F8
42362306a36Sopenharmony_ci#define		NUM_PIPES(x)				((x) << 0)
42462306a36Sopenharmony_ci#define		NUM_PIPES_MASK				0x0000000f
42562306a36Sopenharmony_ci#define		PIPE_INTERLEAVE_SIZE(x)			((x) << 4)
42662306a36Sopenharmony_ci#define		BANK_INTERLEAVE_SIZE(x)			((x) << 8)
42762306a36Sopenharmony_ci#define		NUM_SHADER_ENGINES(x)			((x) << 12)
42862306a36Sopenharmony_ci#define		SHADER_ENGINE_TILE_SIZE(x)     		((x) << 16)
42962306a36Sopenharmony_ci#define		NUM_GPUS(x)     			((x) << 20)
43062306a36Sopenharmony_ci#define		MULTI_GPU_TILE_SIZE(x)     		((x) << 24)
43162306a36Sopenharmony_ci#define		ROW_SIZE(x)             		((x) << 28)
43262306a36Sopenharmony_ci#define GB_BACKEND_MAP  				0x98FC
43362306a36Sopenharmony_ci#define DMIF_ADDR_CONFIG  				0xBD4
43462306a36Sopenharmony_ci#define HDP_ADDR_CONFIG  				0x2F48
43562306a36Sopenharmony_ci#define HDP_MISC_CNTL  					0x2F4C
43662306a36Sopenharmony_ci#define		HDP_FLUSH_INVALIDATE_CACHE      	(1 << 0)
43762306a36Sopenharmony_ci
43862306a36Sopenharmony_ci#define	CC_SYS_RB_BACKEND_DISABLE			0x3F88
43962306a36Sopenharmony_ci#define	GC_USER_RB_BACKEND_DISABLE			0x9B7C
44062306a36Sopenharmony_ci
44162306a36Sopenharmony_ci#define	CGTS_SYS_TCC_DISABLE				0x3F90
44262306a36Sopenharmony_ci#define	CGTS_TCC_DISABLE				0x9148
44362306a36Sopenharmony_ci#define	CGTS_USER_SYS_TCC_DISABLE			0x3F94
44462306a36Sopenharmony_ci#define	CGTS_USER_TCC_DISABLE				0x914C
44562306a36Sopenharmony_ci
44662306a36Sopenharmony_ci#define	CONFIG_MEMSIZE					0x5428
44762306a36Sopenharmony_ci
44862306a36Sopenharmony_ci#define	BIF_FB_EN						0x5490
44962306a36Sopenharmony_ci#define		FB_READ_EN					(1 << 0)
45062306a36Sopenharmony_ci#define		FB_WRITE_EN					(1 << 1)
45162306a36Sopenharmony_ci
45262306a36Sopenharmony_ci#define	CP_STRMOUT_CNTL					0x84FC
45362306a36Sopenharmony_ci
45462306a36Sopenharmony_ci#define	CP_COHER_CNTL					0x85F0
45562306a36Sopenharmony_ci#define	CP_COHER_SIZE					0x85F4
45662306a36Sopenharmony_ci#define	CP_COHER_BASE					0x85F8
45762306a36Sopenharmony_ci#define	CP_STALLED_STAT1			0x8674
45862306a36Sopenharmony_ci#define	CP_STALLED_STAT2			0x8678
45962306a36Sopenharmony_ci#define	CP_BUSY_STAT				0x867C
46062306a36Sopenharmony_ci#define	CP_STAT						0x8680
46162306a36Sopenharmony_ci#define CP_ME_CNTL					0x86D8
46262306a36Sopenharmony_ci#define		CP_ME_HALT					(1 << 28)
46362306a36Sopenharmony_ci#define		CP_PFP_HALT					(1 << 26)
46462306a36Sopenharmony_ci#define	CP_ME_RAM_DATA					0xC160
46562306a36Sopenharmony_ci#define	CP_ME_RAM_RADDR					0xC158
46662306a36Sopenharmony_ci#define	CP_ME_RAM_WADDR					0xC15C
46762306a36Sopenharmony_ci#define CP_MEQ_THRESHOLDS				0x8764
46862306a36Sopenharmony_ci#define		STQ_SPLIT(x)					((x) << 0)
46962306a36Sopenharmony_ci#define	CP_PERFMON_CNTL					0x87FC
47062306a36Sopenharmony_ci#define	CP_PFP_UCODE_ADDR				0xC150
47162306a36Sopenharmony_ci#define	CP_PFP_UCODE_DATA				0xC154
47262306a36Sopenharmony_ci#define	CP_QUEUE_THRESHOLDS				0x8760
47362306a36Sopenharmony_ci#define		ROQ_IB1_START(x)				((x) << 0)
47462306a36Sopenharmony_ci#define		ROQ_IB2_START(x)				((x) << 8)
47562306a36Sopenharmony_ci#define	CP_RB_BASE					0xC100
47662306a36Sopenharmony_ci#define	CP_RB_CNTL					0xC104
47762306a36Sopenharmony_ci#define		RB_BUFSZ(x)					((x) << 0)
47862306a36Sopenharmony_ci#define		RB_BLKSZ(x)					((x) << 8)
47962306a36Sopenharmony_ci#define		RB_NO_UPDATE					(1 << 27)
48062306a36Sopenharmony_ci#define		RB_RPTR_WR_ENA					(1 << 31)
48162306a36Sopenharmony_ci#define		BUF_SWAP_32BIT					(2 << 16)
48262306a36Sopenharmony_ci#define	CP_RB_RPTR					0x8700
48362306a36Sopenharmony_ci#define	CP_RB_RPTR_ADDR					0xC10C
48462306a36Sopenharmony_ci#define		RB_RPTR_SWAP(x)					((x) << 0)
48562306a36Sopenharmony_ci#define	CP_RB_RPTR_ADDR_HI				0xC110
48662306a36Sopenharmony_ci#define	CP_RB_RPTR_WR					0xC108
48762306a36Sopenharmony_ci#define	CP_RB_WPTR					0xC114
48862306a36Sopenharmony_ci#define	CP_RB_WPTR_ADDR					0xC118
48962306a36Sopenharmony_ci#define	CP_RB_WPTR_ADDR_HI				0xC11C
49062306a36Sopenharmony_ci#define	CP_RB_WPTR_DELAY				0x8704
49162306a36Sopenharmony_ci#define	CP_SEM_WAIT_TIMER				0x85BC
49262306a36Sopenharmony_ci#define	CP_SEM_INCOMPLETE_TIMER_CNTL			0x85C8
49362306a36Sopenharmony_ci#define	CP_DEBUG					0xC1FC
49462306a36Sopenharmony_ci
49562306a36Sopenharmony_ci/* Audio clocks */
49662306a36Sopenharmony_ci#define DCCG_AUDIO_DTO_SOURCE             0x05ac
49762306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO0_SOURCE_SEL(x) ((x) << 0) /* crtc0 - crtc5 */
49862306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_SEL         (1 << 4) /* 0=dto0 1=dto1 */
49962306a36Sopenharmony_ci
50062306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_PHASE             0x05b0
50162306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_MODULE            0x05b4
50262306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_LOAD              0x05b8
50362306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_CNTL              0x05bc
50462306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_WALLCLOCK_RATIO(x) (((x) & 7) << 0)
50562306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK 7
50662306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_WALLCLOCK_RATIO_SHIFT 0
50762306a36Sopenharmony_ci
50862306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_PHASE             0x05c0
50962306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_MODULE            0x05c4
51062306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_LOAD              0x05c8
51162306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_CNTL              0x05cc
51262306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO1_USE_512FBR_DTO (1 << 3)
51362306a36Sopenharmony_ci
51462306a36Sopenharmony_ci#define DCE41_DENTIST_DISPCLK_CNTL			0x049c
51562306a36Sopenharmony_ci#       define DENTIST_DPREFCLK_WDIVIDER(x)		(((x) & 0x7f) << 24)
51662306a36Sopenharmony_ci#       define DENTIST_DPREFCLK_WDIVIDER_MASK		(0x7f << 24)
51762306a36Sopenharmony_ci#       define DENTIST_DPREFCLK_WDIVIDER_SHIFT		24
51862306a36Sopenharmony_ci
51962306a36Sopenharmony_ci/* DCE 4.0 AFMT */
52062306a36Sopenharmony_ci#define HDMI_CONTROL                         0x7030
52162306a36Sopenharmony_ci#       define HDMI_KEEPOUT_MODE             (1 << 0)
52262306a36Sopenharmony_ci#       define HDMI_PACKET_GEN_VERSION       (1 << 4) /* 0 = r6xx compat */
52362306a36Sopenharmony_ci#       define HDMI_ERROR_ACK                (1 << 8)
52462306a36Sopenharmony_ci#       define HDMI_ERROR_MASK               (1 << 9)
52562306a36Sopenharmony_ci#       define HDMI_DEEP_COLOR_ENABLE        (1 << 24)
52662306a36Sopenharmony_ci#       define HDMI_DEEP_COLOR_DEPTH(x)      (((x) & 3) << 28)
52762306a36Sopenharmony_ci#       define HDMI_24BIT_DEEP_COLOR         0
52862306a36Sopenharmony_ci#       define HDMI_30BIT_DEEP_COLOR         1
52962306a36Sopenharmony_ci#       define HDMI_36BIT_DEEP_COLOR         2
53062306a36Sopenharmony_ci#       define HDMI_DEEP_COLOR_DEPTH_MASK    (3 << 28)
53162306a36Sopenharmony_ci#define HDMI_STATUS                          0x7034
53262306a36Sopenharmony_ci#       define HDMI_ACTIVE_AVMUTE            (1 << 0)
53362306a36Sopenharmony_ci#       define HDMI_AUDIO_PACKET_ERROR       (1 << 16)
53462306a36Sopenharmony_ci#       define HDMI_VBI_PACKET_ERROR         (1 << 20)
53562306a36Sopenharmony_ci#define HDMI_AUDIO_PACKET_CONTROL            0x7038
53662306a36Sopenharmony_ci#       define HDMI_AUDIO_DELAY_EN(x)        (((x) & 3) << 4)
53762306a36Sopenharmony_ci#       define HDMI_AUDIO_PACKETS_PER_LINE(x)  (((x) & 0x1f) << 16)
53862306a36Sopenharmony_ci#define HDMI_ACR_PACKET_CONTROL              0x703c
53962306a36Sopenharmony_ci#       define HDMI_ACR_SEND                 (1 << 0)
54062306a36Sopenharmony_ci#       define HDMI_ACR_CONT                 (1 << 1)
54162306a36Sopenharmony_ci#       define HDMI_ACR_SELECT(x)            (((x) & 3) << 4)
54262306a36Sopenharmony_ci#       define HDMI_ACR_HW                   0
54362306a36Sopenharmony_ci#       define HDMI_ACR_32                   1
54462306a36Sopenharmony_ci#       define HDMI_ACR_44                   2
54562306a36Sopenharmony_ci#       define HDMI_ACR_48                   3
54662306a36Sopenharmony_ci#       define HDMI_ACR_SOURCE               (1 << 8) /* 0 - hw; 1 - cts value */
54762306a36Sopenharmony_ci#       define HDMI_ACR_AUTO_SEND            (1 << 12)
54862306a36Sopenharmony_ci#       define HDMI_ACR_N_MULTIPLE(x)        (((x) & 7) << 16)
54962306a36Sopenharmony_ci#       define HDMI_ACR_X1                   1
55062306a36Sopenharmony_ci#       define HDMI_ACR_X2                   2
55162306a36Sopenharmony_ci#       define HDMI_ACR_X4                   4
55262306a36Sopenharmony_ci#       define HDMI_ACR_AUDIO_PRIORITY       (1 << 31)
55362306a36Sopenharmony_ci#define HDMI_VBI_PACKET_CONTROL              0x7040
55462306a36Sopenharmony_ci#       define HDMI_NULL_SEND                (1 << 0)
55562306a36Sopenharmony_ci#       define HDMI_GC_SEND                  (1 << 4)
55662306a36Sopenharmony_ci#       define HDMI_GC_CONT                  (1 << 5) /* 0 - once; 1 - every frame */
55762306a36Sopenharmony_ci#define HDMI_INFOFRAME_CONTROL0              0x7044
55862306a36Sopenharmony_ci#       define HDMI_AVI_INFO_SEND            (1 << 0)
55962306a36Sopenharmony_ci#       define HDMI_AVI_INFO_CONT            (1 << 1)
56062306a36Sopenharmony_ci#       define HDMI_AUDIO_INFO_SEND          (1 << 4)
56162306a36Sopenharmony_ci#       define HDMI_AUDIO_INFO_CONT          (1 << 5)
56262306a36Sopenharmony_ci#       define HDMI_MPEG_INFO_SEND           (1 << 8)
56362306a36Sopenharmony_ci#       define HDMI_MPEG_INFO_CONT           (1 << 9)
56462306a36Sopenharmony_ci#define HDMI_INFOFRAME_CONTROL1              0x7048
56562306a36Sopenharmony_ci#       define HDMI_AVI_INFO_LINE(x)         (((x) & 0x3f) << 0)
56662306a36Sopenharmony_ci#       define HDMI_AVI_INFO_LINE_MASK       (0x3f << 0)
56762306a36Sopenharmony_ci#       define HDMI_AUDIO_INFO_LINE(x)       (((x) & 0x3f) << 8)
56862306a36Sopenharmony_ci#       define HDMI_MPEG_INFO_LINE(x)        (((x) & 0x3f) << 16)
56962306a36Sopenharmony_ci#define HDMI_GENERIC_PACKET_CONTROL          0x704c
57062306a36Sopenharmony_ci#       define HDMI_GENERIC0_SEND            (1 << 0)
57162306a36Sopenharmony_ci#       define HDMI_GENERIC0_CONT            (1 << 1)
57262306a36Sopenharmony_ci#       define HDMI_GENERIC1_SEND            (1 << 4)
57362306a36Sopenharmony_ci#       define HDMI_GENERIC1_CONT            (1 << 5)
57462306a36Sopenharmony_ci#       define HDMI_GENERIC0_LINE(x)         (((x) & 0x3f) << 16)
57562306a36Sopenharmony_ci#       define HDMI_GENERIC1_LINE(x)         (((x) & 0x3f) << 24)
57662306a36Sopenharmony_ci#define HDMI_GC                              0x7058
57762306a36Sopenharmony_ci#       define HDMI_GC_AVMUTE                (1 << 0)
57862306a36Sopenharmony_ci#       define HDMI_GC_AVMUTE_CONT           (1 << 2)
57962306a36Sopenharmony_ci#define AFMT_AUDIO_PACKET_CONTROL2           0x705c
58062306a36Sopenharmony_ci#       define AFMT_AUDIO_LAYOUT_OVRD        (1 << 0)
58162306a36Sopenharmony_ci#       define AFMT_AUDIO_LAYOUT_SELECT      (1 << 1)
58262306a36Sopenharmony_ci#       define AFMT_60958_CS_SOURCE          (1 << 4)
58362306a36Sopenharmony_ci#       define AFMT_AUDIO_CHANNEL_ENABLE(x)  (((x) & 0xff) << 8)
58462306a36Sopenharmony_ci#       define AFMT_DP_AUDIO_STREAM_ID(x)    (((x) & 0xff) << 16)
58562306a36Sopenharmony_ci#define AFMT_AVI_INFO0                       0x7084
58662306a36Sopenharmony_ci#       define AFMT_AVI_INFO_CHECKSUM(x)     (((x) & 0xff) << 0)
58762306a36Sopenharmony_ci#       define AFMT_AVI_INFO_S(x)            (((x) & 3) << 8)
58862306a36Sopenharmony_ci#       define AFMT_AVI_INFO_B(x)            (((x) & 3) << 10)
58962306a36Sopenharmony_ci#       define AFMT_AVI_INFO_A(x)            (((x) & 1) << 12)
59062306a36Sopenharmony_ci#       define AFMT_AVI_INFO_Y(x)            (((x) & 3) << 13)
59162306a36Sopenharmony_ci#       define AFMT_AVI_INFO_Y_RGB           0
59262306a36Sopenharmony_ci#       define AFMT_AVI_INFO_Y_YCBCR422      1
59362306a36Sopenharmony_ci#       define AFMT_AVI_INFO_Y_YCBCR444      2
59462306a36Sopenharmony_ci#       define AFMT_AVI_INFO_Y_A_B_S(x)      (((x) & 0xff) << 8)
59562306a36Sopenharmony_ci#       define AFMT_AVI_INFO_R(x)            (((x) & 0xf) << 16)
59662306a36Sopenharmony_ci#       define AFMT_AVI_INFO_M(x)            (((x) & 0x3) << 20)
59762306a36Sopenharmony_ci#       define AFMT_AVI_INFO_C(x)            (((x) & 0x3) << 22)
59862306a36Sopenharmony_ci#       define AFMT_AVI_INFO_C_M_R(x)        (((x) & 0xff) << 16)
59962306a36Sopenharmony_ci#       define AFMT_AVI_INFO_SC(x)           (((x) & 0x3) << 24)
60062306a36Sopenharmony_ci#       define AFMT_AVI_INFO_Q(x)            (((x) & 0x3) << 26)
60162306a36Sopenharmony_ci#       define AFMT_AVI_INFO_EC(x)           (((x) & 0x3) << 28)
60262306a36Sopenharmony_ci#       define AFMT_AVI_INFO_ITC(x)          (((x) & 0x1) << 31)
60362306a36Sopenharmony_ci#       define AFMT_AVI_INFO_ITC_EC_Q_SC(x)  (((x) & 0xff) << 24)
60462306a36Sopenharmony_ci#define AFMT_AVI_INFO1                       0x7088
60562306a36Sopenharmony_ci#       define AFMT_AVI_INFO_VIC(x)          (((x) & 0x7f) << 0) /* don't use avi infoframe v1 */
60662306a36Sopenharmony_ci#       define AFMT_AVI_INFO_PR(x)           (((x) & 0xf) << 8) /* don't use avi infoframe v1 */
60762306a36Sopenharmony_ci#       define AFMT_AVI_INFO_CN(x)           (((x) & 0x3) << 12)
60862306a36Sopenharmony_ci#       define AFMT_AVI_INFO_YQ(x)           (((x) & 0x3) << 14)
60962306a36Sopenharmony_ci#       define AFMT_AVI_INFO_TOP(x)          (((x) & 0xffff) << 16)
61062306a36Sopenharmony_ci#define AFMT_AVI_INFO2                       0x708c
61162306a36Sopenharmony_ci#       define AFMT_AVI_INFO_BOTTOM(x)       (((x) & 0xffff) << 0)
61262306a36Sopenharmony_ci#       define AFMT_AVI_INFO_LEFT(x)         (((x) & 0xffff) << 16)
61362306a36Sopenharmony_ci#define AFMT_AVI_INFO3                       0x7090
61462306a36Sopenharmony_ci#       define AFMT_AVI_INFO_RIGHT(x)        (((x) & 0xffff) << 0)
61562306a36Sopenharmony_ci#       define AFMT_AVI_INFO_VERSION(x)      (((x) & 3) << 24)
61662306a36Sopenharmony_ci#define AFMT_MPEG_INFO0                      0x7094
61762306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_CHECKSUM(x)    (((x) & 0xff) << 0)
61862306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_MB0(x)         (((x) & 0xff) << 8)
61962306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_MB1(x)         (((x) & 0xff) << 16)
62062306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_MB2(x)         (((x) & 0xff) << 24)
62162306a36Sopenharmony_ci#define AFMT_MPEG_INFO1                      0x7098
62262306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_MB3(x)         (((x) & 0xff) << 0)
62362306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_MF(x)          (((x) & 3) << 8)
62462306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_FR(x)          (((x) & 1) << 12)
62562306a36Sopenharmony_ci#define AFMT_GENERIC0_HDR                    0x709c
62662306a36Sopenharmony_ci#define AFMT_GENERIC0_0                      0x70a0
62762306a36Sopenharmony_ci#define AFMT_GENERIC0_1                      0x70a4
62862306a36Sopenharmony_ci#define AFMT_GENERIC0_2                      0x70a8
62962306a36Sopenharmony_ci#define AFMT_GENERIC0_3                      0x70ac
63062306a36Sopenharmony_ci#define AFMT_GENERIC0_4                      0x70b0
63162306a36Sopenharmony_ci#define AFMT_GENERIC0_5                      0x70b4
63262306a36Sopenharmony_ci#define AFMT_GENERIC0_6                      0x70b8
63362306a36Sopenharmony_ci#define AFMT_GENERIC1_HDR                    0x70bc
63462306a36Sopenharmony_ci#define AFMT_GENERIC1_0                      0x70c0
63562306a36Sopenharmony_ci#define AFMT_GENERIC1_1                      0x70c4
63662306a36Sopenharmony_ci#define AFMT_GENERIC1_2                      0x70c8
63762306a36Sopenharmony_ci#define AFMT_GENERIC1_3                      0x70cc
63862306a36Sopenharmony_ci#define AFMT_GENERIC1_4                      0x70d0
63962306a36Sopenharmony_ci#define AFMT_GENERIC1_5                      0x70d4
64062306a36Sopenharmony_ci#define AFMT_GENERIC1_6                      0x70d8
64162306a36Sopenharmony_ci#define HDMI_ACR_32_0                        0x70dc
64262306a36Sopenharmony_ci#       define HDMI_ACR_CTS_32(x)            (((x) & 0xfffff) << 12)
64362306a36Sopenharmony_ci#define HDMI_ACR_32_1                        0x70e0
64462306a36Sopenharmony_ci#       define HDMI_ACR_N_32(x)              (((x) & 0xfffff) << 0)
64562306a36Sopenharmony_ci#define HDMI_ACR_44_0                        0x70e4
64662306a36Sopenharmony_ci#       define HDMI_ACR_CTS_44(x)            (((x) & 0xfffff) << 12)
64762306a36Sopenharmony_ci#define HDMI_ACR_44_1                        0x70e8
64862306a36Sopenharmony_ci#       define HDMI_ACR_N_44(x)              (((x) & 0xfffff) << 0)
64962306a36Sopenharmony_ci#define HDMI_ACR_48_0                        0x70ec
65062306a36Sopenharmony_ci#       define HDMI_ACR_CTS_48(x)            (((x) & 0xfffff) << 12)
65162306a36Sopenharmony_ci#define HDMI_ACR_48_1                        0x70f0
65262306a36Sopenharmony_ci#       define HDMI_ACR_N_48(x)              (((x) & 0xfffff) << 0)
65362306a36Sopenharmony_ci#define HDMI_ACR_STATUS_0                    0x70f4
65462306a36Sopenharmony_ci#define HDMI_ACR_STATUS_1                    0x70f8
65562306a36Sopenharmony_ci#define AFMT_AUDIO_INFO0                     0x70fc
65662306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_CHECKSUM(x)   (((x) & 0xff) << 0)
65762306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_CC(x)         (((x) & 7) << 8)
65862306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_CT(x)         (((x) & 0xf) << 11)
65962306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_CHECKSUM_OFFSET(x)   (((x) & 0xff) << 16)
66062306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_CXT(x)        (((x) & 0x1f) << 24)
66162306a36Sopenharmony_ci#define AFMT_AUDIO_INFO1                     0x7100
66262306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_CA(x)         (((x) & 0xff) << 0)
66362306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_LSV(x)        (((x) & 0xf) << 11)
66462306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_DM_INH(x)     (((x) & 1) << 15)
66562306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_DM_INH_LSV(x) (((x) & 0xff) << 8)
66662306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_LFEBPL(x)     (((x) & 3) << 16)
66762306a36Sopenharmony_ci#define AFMT_60958_0                         0x7104
66862306a36Sopenharmony_ci#       define AFMT_60958_CS_A(x)            (((x) & 1) << 0)
66962306a36Sopenharmony_ci#       define AFMT_60958_CS_B(x)            (((x) & 1) << 1)
67062306a36Sopenharmony_ci#       define AFMT_60958_CS_C(x)            (((x) & 1) << 2)
67162306a36Sopenharmony_ci#       define AFMT_60958_CS_D(x)            (((x) & 3) << 3)
67262306a36Sopenharmony_ci#       define AFMT_60958_CS_MODE(x)         (((x) & 3) << 6)
67362306a36Sopenharmony_ci#       define AFMT_60958_CS_CATEGORY_CODE(x)      (((x) & 0xff) << 8)
67462306a36Sopenharmony_ci#       define AFMT_60958_CS_SOURCE_NUMBER(x)      (((x) & 0xf) << 16)
67562306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_L(x)   (((x) & 0xf) << 20)
67662306a36Sopenharmony_ci#       define AFMT_60958_CS_SAMPLING_FREQUENCY(x) (((x) & 0xf) << 24)
67762306a36Sopenharmony_ci#       define AFMT_60958_CS_CLOCK_ACCURACY(x)     (((x) & 3) << 28)
67862306a36Sopenharmony_ci#define AFMT_60958_1                         0x7108
67962306a36Sopenharmony_ci#       define AFMT_60958_CS_WORD_LENGTH(x)  (((x) & 0xf) << 0)
68062306a36Sopenharmony_ci#       define AFMT_60958_CS_ORIGINAL_SAMPLING_FREQUENCY(x)   (((x) & 0xf) << 4)
68162306a36Sopenharmony_ci#       define AFMT_60958_CS_VALID_L(x)      (((x) & 1) << 16)
68262306a36Sopenharmony_ci#       define AFMT_60958_CS_VALID_R(x)      (((x) & 1) << 18)
68362306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_R(x)   (((x) & 0xf) << 20)
68462306a36Sopenharmony_ci#define AFMT_AUDIO_CRC_CONTROL               0x710c
68562306a36Sopenharmony_ci#       define AFMT_AUDIO_CRC_EN             (1 << 0)
68662306a36Sopenharmony_ci#define AFMT_RAMP_CONTROL0                   0x7110
68762306a36Sopenharmony_ci#       define AFMT_RAMP_MAX_COUNT(x)        (((x) & 0xffffff) << 0)
68862306a36Sopenharmony_ci#       define AFMT_RAMP_DATA_SIGN           (1 << 31)
68962306a36Sopenharmony_ci#define AFMT_RAMP_CONTROL1                   0x7114
69062306a36Sopenharmony_ci#       define AFMT_RAMP_MIN_COUNT(x)        (((x) & 0xffffff) << 0)
69162306a36Sopenharmony_ci#       define AFMT_AUDIO_TEST_CH_DISABLE(x) (((x) & 0xff) << 24)
69262306a36Sopenharmony_ci#define AFMT_RAMP_CONTROL2                   0x7118
69362306a36Sopenharmony_ci#       define AFMT_RAMP_INC_COUNT(x)        (((x) & 0xffffff) << 0)
69462306a36Sopenharmony_ci#define AFMT_RAMP_CONTROL3                   0x711c
69562306a36Sopenharmony_ci#       define AFMT_RAMP_DEC_COUNT(x)        (((x) & 0xffffff) << 0)
69662306a36Sopenharmony_ci#define AFMT_60958_2                         0x7120
69762306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_2(x)   (((x) & 0xf) << 0)
69862306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_3(x)   (((x) & 0xf) << 4)
69962306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_4(x)   (((x) & 0xf) << 8)
70062306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_5(x)   (((x) & 0xf) << 12)
70162306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_6(x)   (((x) & 0xf) << 16)
70262306a36Sopenharmony_ci#       define AFMT_60958_CS_CHANNEL_NUMBER_7(x)   (((x) & 0xf) << 20)
70362306a36Sopenharmony_ci#define AFMT_STATUS                          0x7128
70462306a36Sopenharmony_ci#       define AFMT_AUDIO_ENABLE             (1 << 4)
70562306a36Sopenharmony_ci#       define AFMT_AUDIO_HBR_ENABLE         (1 << 8)
70662306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG          (1 << 28)
70762306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG_INT      (1 << 29)
70862306a36Sopenharmony_ci#       define AFMT_AZ_AUDIO_ENABLE_CHG      (1 << 30)
70962306a36Sopenharmony_ci#define AFMT_AUDIO_PACKET_CONTROL            0x712c
71062306a36Sopenharmony_ci#       define AFMT_AUDIO_SAMPLE_SEND        (1 << 0)
71162306a36Sopenharmony_ci#       define AFMT_RESET_FIFO_WHEN_AUDIO_DIS (1 << 11) /* set to 1 */
71262306a36Sopenharmony_ci#       define AFMT_AUDIO_TEST_EN            (1 << 12)
71362306a36Sopenharmony_ci#       define AFMT_AUDIO_CHANNEL_SWAP       (1 << 24)
71462306a36Sopenharmony_ci#       define AFMT_60958_CS_UPDATE          (1 << 26)
71562306a36Sopenharmony_ci#       define AFMT_AZ_AUDIO_ENABLE_CHG_MASK (1 << 27)
71662306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG_MASK     (1 << 28)
71762306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG_ACK      (1 << 29)
71862306a36Sopenharmony_ci#       define AFMT_AZ_AUDIO_ENABLE_CHG_ACK  (1 << 30)
71962306a36Sopenharmony_ci#define AFMT_VBI_PACKET_CONTROL              0x7130
72062306a36Sopenharmony_ci#       define AFMT_GENERIC0_UPDATE          (1 << 2)
72162306a36Sopenharmony_ci#define AFMT_INFOFRAME_CONTROL0              0x7134
72262306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_SOURCE        (1 << 6) /* 0 - sound block; 1 - afmt regs */
72362306a36Sopenharmony_ci#       define AFMT_AUDIO_INFO_UPDATE        (1 << 7)
72462306a36Sopenharmony_ci#       define AFMT_MPEG_INFO_UPDATE         (1 << 10)
72562306a36Sopenharmony_ci#define AFMT_GENERIC0_7                      0x7138
72662306a36Sopenharmony_ci
72762306a36Sopenharmony_ci/* DCE4/5 ELD audio interface */
72862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER          0x5f78
72962306a36Sopenharmony_ci#define		SPEAKER_ALLOCATION(x)			(((x) & 0x7f) << 0)
73062306a36Sopenharmony_ci#define		SPEAKER_ALLOCATION_MASK			(0x7f << 0)
73162306a36Sopenharmony_ci#define		SPEAKER_ALLOCATION_SHIFT		0
73262306a36Sopenharmony_ci#define		HDMI_CONNECTION				(1 << 16)
73362306a36Sopenharmony_ci#define		DP_CONNECTION				(1 << 17)
73462306a36Sopenharmony_ci
73562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0        0x5f84 /* LPCM */
73662306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1        0x5f88 /* AC3 */
73762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR2        0x5f8c /* MPEG1 */
73862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR3        0x5f90 /* MP3 */
73962306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR4        0x5f94 /* MPEG2 */
74062306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR5        0x5f98 /* AAC */
74162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR6        0x5f9c /* DTS */
74262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR7        0x5fa0 /* ATRAC */
74362306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR8        0x5fa4 /* one bit audio - leave at 0 (default) */
74462306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR9        0x5fa8 /* Dolby Digital */
74562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR10       0x5fac /* DTS-HD */
74662306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR11       0x5fb0 /* MAT-MLP */
74762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR12       0x5fb4 /* DTS */
74862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR13       0x5fb8 /* WMA Pro */
74962306a36Sopenharmony_ci#       define MAX_CHANNELS(x)                            (((x) & 0x7) << 0)
75062306a36Sopenharmony_ci/* max channels minus one.  7 = 8 channels */
75162306a36Sopenharmony_ci#       define SUPPORTED_FREQUENCIES(x)                   (((x) & 0xff) << 8)
75262306a36Sopenharmony_ci#       define DESCRIPTOR_BYTE_2(x)                       (((x) & 0xff) << 16)
75362306a36Sopenharmony_ci#       define SUPPORTED_FREQUENCIES_STEREO(x)            (((x) & 0xff) << 24) /* LPCM only */
75462306a36Sopenharmony_ci/* SUPPORTED_FREQUENCIES, SUPPORTED_FREQUENCIES_STEREO
75562306a36Sopenharmony_ci * bit0 = 32 kHz
75662306a36Sopenharmony_ci * bit1 = 44.1 kHz
75762306a36Sopenharmony_ci * bit2 = 48 kHz
75862306a36Sopenharmony_ci * bit3 = 88.2 kHz
75962306a36Sopenharmony_ci * bit4 = 96 kHz
76062306a36Sopenharmony_ci * bit5 = 176.4 kHz
76162306a36Sopenharmony_ci * bit6 = 192 kHz
76262306a36Sopenharmony_ci */
76362306a36Sopenharmony_ci
76462306a36Sopenharmony_ci#define AZ_CHANNEL_COUNT_CONTROL                          0x5fe4
76562306a36Sopenharmony_ci#       define HBR_CHANNEL_COUNT(x)                       (((x) & 0x7) << 0)
76662306a36Sopenharmony_ci#       define COMPRESSED_CHANNEL_COUNT(x)                (((x) & 0x7) << 4)
76762306a36Sopenharmony_ci/* HBR_CHANNEL_COUNT, COMPRESSED_CHANNEL_COUNT
76862306a36Sopenharmony_ci * 0   = use stream header
76962306a36Sopenharmony_ci * 1-7 = channel count - 1
77062306a36Sopenharmony_ci */
77162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_LIPSYNC         0x5fe8
77262306a36Sopenharmony_ci#       define VIDEO_LIPSYNC(x)                           (((x) & 0xff) << 0)
77362306a36Sopenharmony_ci#       define AUDIO_LIPSYNC(x)                           (((x) & 0xff) << 8)
77462306a36Sopenharmony_ci/* VIDEO_LIPSYNC, AUDIO_LIPSYNC
77562306a36Sopenharmony_ci * 0   = invalid
77662306a36Sopenharmony_ci * x   = legal delay value
77762306a36Sopenharmony_ci * 255 = sync not supported
77862306a36Sopenharmony_ci */
77962306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_HBR             0x5fec
78062306a36Sopenharmony_ci#       define HBR_CAPABLE                                (1 << 0) /* enabled by default */
78162306a36Sopenharmony_ci
78262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_AV_ASSOCIATION0 0x5ff4
78362306a36Sopenharmony_ci#       define DISPLAY0_TYPE(x)                           (((x) & 0x3) << 0)
78462306a36Sopenharmony_ci#       define DISPLAY_TYPE_NONE                   0
78562306a36Sopenharmony_ci#       define DISPLAY_TYPE_HDMI                   1
78662306a36Sopenharmony_ci#       define DISPLAY_TYPE_DP                     2
78762306a36Sopenharmony_ci#       define DISPLAY0_ID(x)                             (((x) & 0x3f) << 2)
78862306a36Sopenharmony_ci#       define DISPLAY1_TYPE(x)                           (((x) & 0x3) << 8)
78962306a36Sopenharmony_ci#       define DISPLAY1_ID(x)                             (((x) & 0x3f) << 10)
79062306a36Sopenharmony_ci#       define DISPLAY2_TYPE(x)                           (((x) & 0x3) << 16)
79162306a36Sopenharmony_ci#       define DISPLAY2_ID(x)                             (((x) & 0x3f) << 18)
79262306a36Sopenharmony_ci#       define DISPLAY3_TYPE(x)                           (((x) & 0x3) << 24)
79362306a36Sopenharmony_ci#       define DISPLAY3_ID(x)                             (((x) & 0x3f) << 26)
79462306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_AV_ASSOCIATION1 0x5ff8
79562306a36Sopenharmony_ci#       define DISPLAY4_TYPE(x)                           (((x) & 0x3) << 0)
79662306a36Sopenharmony_ci#       define DISPLAY4_ID(x)                             (((x) & 0x3f) << 2)
79762306a36Sopenharmony_ci#       define DISPLAY5_TYPE(x)                           (((x) & 0x3) << 8)
79862306a36Sopenharmony_ci#       define DISPLAY5_ID(x)                             (((x) & 0x3f) << 10)
79962306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_AV_NUMBER       0x5ffc
80062306a36Sopenharmony_ci#       define NUMBER_OF_DISPLAY_ID(x)                    (((x) & 0x7) << 0)
80162306a36Sopenharmony_ci
80262306a36Sopenharmony_ci#define AZ_HOT_PLUG_CONTROL                               0x5e78
80362306a36Sopenharmony_ci#       define AZ_FORCE_CODEC_WAKE                        (1 << 0)
80462306a36Sopenharmony_ci#       define PIN0_JACK_DETECTION_ENABLE                 (1 << 4)
80562306a36Sopenharmony_ci#       define PIN1_JACK_DETECTION_ENABLE                 (1 << 5)
80662306a36Sopenharmony_ci#       define PIN2_JACK_DETECTION_ENABLE                 (1 << 6)
80762306a36Sopenharmony_ci#       define PIN3_JACK_DETECTION_ENABLE                 (1 << 7)
80862306a36Sopenharmony_ci#       define PIN0_UNSOLICITED_RESPONSE_ENABLE           (1 << 8)
80962306a36Sopenharmony_ci#       define PIN1_UNSOLICITED_RESPONSE_ENABLE           (1 << 9)
81062306a36Sopenharmony_ci#       define PIN2_UNSOLICITED_RESPONSE_ENABLE           (1 << 10)
81162306a36Sopenharmony_ci#       define PIN3_UNSOLICITED_RESPONSE_ENABLE           (1 << 11)
81262306a36Sopenharmony_ci#       define CODEC_HOT_PLUG_ENABLE                      (1 << 12)
81362306a36Sopenharmony_ci#       define PIN0_AUDIO_ENABLED                         (1 << 24)
81462306a36Sopenharmony_ci#       define PIN1_AUDIO_ENABLED                         (1 << 25)
81562306a36Sopenharmony_ci#       define PIN2_AUDIO_ENABLED                         (1 << 26)
81662306a36Sopenharmony_ci#       define PIN3_AUDIO_ENABLED                         (1 << 27)
81762306a36Sopenharmony_ci#       define AUDIO_ENABLED                              (1 << 31)
81862306a36Sopenharmony_ci
81962306a36Sopenharmony_ci
82062306a36Sopenharmony_ci#define	GC_USER_SHADER_PIPE_CONFIG			0x8954
82162306a36Sopenharmony_ci#define		INACTIVE_QD_PIPES(x)				((x) << 8)
82262306a36Sopenharmony_ci#define		INACTIVE_QD_PIPES_MASK				0x0000FF00
82362306a36Sopenharmony_ci#define		INACTIVE_SIMDS(x)				((x) << 16)
82462306a36Sopenharmony_ci#define		INACTIVE_SIMDS_MASK				0x00FF0000
82562306a36Sopenharmony_ci
82662306a36Sopenharmony_ci#define	GRBM_CNTL					0x8000
82762306a36Sopenharmony_ci#define		GRBM_READ_TIMEOUT(x)				((x) << 0)
82862306a36Sopenharmony_ci#define	GRBM_SOFT_RESET					0x8020
82962306a36Sopenharmony_ci#define		SOFT_RESET_CP					(1 << 0)
83062306a36Sopenharmony_ci#define		SOFT_RESET_CB					(1 << 1)
83162306a36Sopenharmony_ci#define		SOFT_RESET_DB					(1 << 3)
83262306a36Sopenharmony_ci#define		SOFT_RESET_PA					(1 << 5)
83362306a36Sopenharmony_ci#define		SOFT_RESET_SC					(1 << 6)
83462306a36Sopenharmony_ci#define		SOFT_RESET_SPI					(1 << 8)
83562306a36Sopenharmony_ci#define		SOFT_RESET_SH					(1 << 9)
83662306a36Sopenharmony_ci#define		SOFT_RESET_SX					(1 << 10)
83762306a36Sopenharmony_ci#define		SOFT_RESET_TC					(1 << 11)
83862306a36Sopenharmony_ci#define		SOFT_RESET_TA					(1 << 12)
83962306a36Sopenharmony_ci#define		SOFT_RESET_VC					(1 << 13)
84062306a36Sopenharmony_ci#define		SOFT_RESET_VGT					(1 << 14)
84162306a36Sopenharmony_ci
84262306a36Sopenharmony_ci#define	GRBM_STATUS					0x8010
84362306a36Sopenharmony_ci#define		CMDFIFO_AVAIL_MASK				0x0000000F
84462306a36Sopenharmony_ci#define		SRBM_RQ_PENDING					(1 << 5)
84562306a36Sopenharmony_ci#define		CF_RQ_PENDING					(1 << 7)
84662306a36Sopenharmony_ci#define		PF_RQ_PENDING					(1 << 8)
84762306a36Sopenharmony_ci#define		GRBM_EE_BUSY					(1 << 10)
84862306a36Sopenharmony_ci#define		SX_CLEAN					(1 << 11)
84962306a36Sopenharmony_ci#define		DB_CLEAN					(1 << 12)
85062306a36Sopenharmony_ci#define		CB_CLEAN					(1 << 13)
85162306a36Sopenharmony_ci#define		TA_BUSY 					(1 << 14)
85262306a36Sopenharmony_ci#define		VGT_BUSY_NO_DMA					(1 << 16)
85362306a36Sopenharmony_ci#define		VGT_BUSY					(1 << 17)
85462306a36Sopenharmony_ci#define		SX_BUSY 					(1 << 20)
85562306a36Sopenharmony_ci#define		SH_BUSY 					(1 << 21)
85662306a36Sopenharmony_ci#define		SPI_BUSY					(1 << 22)
85762306a36Sopenharmony_ci#define		SC_BUSY 					(1 << 24)
85862306a36Sopenharmony_ci#define		PA_BUSY 					(1 << 25)
85962306a36Sopenharmony_ci#define		DB_BUSY 					(1 << 26)
86062306a36Sopenharmony_ci#define		CP_COHERENCY_BUSY      				(1 << 28)
86162306a36Sopenharmony_ci#define		CP_BUSY 					(1 << 29)
86262306a36Sopenharmony_ci#define		CB_BUSY 					(1 << 30)
86362306a36Sopenharmony_ci#define		GUI_ACTIVE					(1 << 31)
86462306a36Sopenharmony_ci#define	GRBM_STATUS_SE0					0x8014
86562306a36Sopenharmony_ci#define	GRBM_STATUS_SE1					0x8018
86662306a36Sopenharmony_ci#define		SE_SX_CLEAN					(1 << 0)
86762306a36Sopenharmony_ci#define		SE_DB_CLEAN					(1 << 1)
86862306a36Sopenharmony_ci#define		SE_CB_CLEAN					(1 << 2)
86962306a36Sopenharmony_ci#define		SE_TA_BUSY					(1 << 25)
87062306a36Sopenharmony_ci#define		SE_SX_BUSY					(1 << 26)
87162306a36Sopenharmony_ci#define		SE_SPI_BUSY					(1 << 27)
87262306a36Sopenharmony_ci#define		SE_SH_BUSY					(1 << 28)
87362306a36Sopenharmony_ci#define		SE_SC_BUSY					(1 << 29)
87462306a36Sopenharmony_ci#define		SE_DB_BUSY					(1 << 30)
87562306a36Sopenharmony_ci#define		SE_CB_BUSY					(1 << 31)
87662306a36Sopenharmony_ci/* evergreen */
87762306a36Sopenharmony_ci#define	CG_THERMAL_CTRL					0x72c
87862306a36Sopenharmony_ci#define		TOFFSET_MASK			        0x00003FE0
87962306a36Sopenharmony_ci#define		TOFFSET_SHIFT			        5
88062306a36Sopenharmony_ci#define		DIG_THERM_DPM(x)			((x) << 14)
88162306a36Sopenharmony_ci#define		DIG_THERM_DPM_MASK			0x003FC000
88262306a36Sopenharmony_ci#define		DIG_THERM_DPM_SHIFT			14
88362306a36Sopenharmony_ci
88462306a36Sopenharmony_ci#define	CG_THERMAL_INT					0x734
88562306a36Sopenharmony_ci#define		DIG_THERM_INTH(x)			((x) << 8)
88662306a36Sopenharmony_ci#define		DIG_THERM_INTH_MASK			0x0000FF00
88762306a36Sopenharmony_ci#define		DIG_THERM_INTH_SHIFT			8
88862306a36Sopenharmony_ci#define		DIG_THERM_INTL(x)			((x) << 16)
88962306a36Sopenharmony_ci#define		DIG_THERM_INTL_MASK			0x00FF0000
89062306a36Sopenharmony_ci#define		DIG_THERM_INTL_SHIFT			16
89162306a36Sopenharmony_ci#define 	THERM_INT_MASK_HIGH			(1 << 24)
89262306a36Sopenharmony_ci#define 	THERM_INT_MASK_LOW			(1 << 25)
89362306a36Sopenharmony_ci
89462306a36Sopenharmony_ci#define	TN_CG_THERMAL_INT_CTRL				0x738
89562306a36Sopenharmony_ci#define		TN_DIG_THERM_INTH(x)			((x) << 0)
89662306a36Sopenharmony_ci#define		TN_DIG_THERM_INTH_MASK			0x000000FF
89762306a36Sopenharmony_ci#define		TN_DIG_THERM_INTH_SHIFT			0
89862306a36Sopenharmony_ci#define		TN_DIG_THERM_INTL(x)			((x) << 8)
89962306a36Sopenharmony_ci#define		TN_DIG_THERM_INTL_MASK			0x0000FF00
90062306a36Sopenharmony_ci#define		TN_DIG_THERM_INTL_SHIFT			8
90162306a36Sopenharmony_ci#define 	TN_THERM_INT_MASK_HIGH			(1 << 24)
90262306a36Sopenharmony_ci#define 	TN_THERM_INT_MASK_LOW			(1 << 25)
90362306a36Sopenharmony_ci
90462306a36Sopenharmony_ci#define	CG_MULT_THERMAL_STATUS				0x740
90562306a36Sopenharmony_ci#define		ASIC_T(x)			        ((x) << 16)
90662306a36Sopenharmony_ci#define		ASIC_T_MASK			        0x07FF0000
90762306a36Sopenharmony_ci#define		ASIC_T_SHIFT			        16
90862306a36Sopenharmony_ci#define	CG_TS0_STATUS					0x760
90962306a36Sopenharmony_ci#define		TS0_ADC_DOUT_MASK			0x000003FF
91062306a36Sopenharmony_ci#define		TS0_ADC_DOUT_SHIFT			0
91162306a36Sopenharmony_ci
91262306a36Sopenharmony_ci/* APU */
91362306a36Sopenharmony_ci#define	CG_THERMAL_STATUS			        0x678
91462306a36Sopenharmony_ci
91562306a36Sopenharmony_ci#define	HDP_HOST_PATH_CNTL				0x2C00
91662306a36Sopenharmony_ci#define	HDP_NONSURFACE_BASE				0x2C04
91762306a36Sopenharmony_ci#define	HDP_NONSURFACE_INFO				0x2C08
91862306a36Sopenharmony_ci#define	HDP_NONSURFACE_SIZE				0x2C0C
91962306a36Sopenharmony_ci#define HDP_MEM_COHERENCY_FLUSH_CNTL			0x5480
92062306a36Sopenharmony_ci#define HDP_REG_COHERENCY_FLUSH_CNTL			0x54A0
92162306a36Sopenharmony_ci#define	HDP_TILING_CONFIG				0x2F3C
92262306a36Sopenharmony_ci
92362306a36Sopenharmony_ci#define MC_SHARED_CHMAP						0x2004
92462306a36Sopenharmony_ci#define		NOOFCHAN_SHIFT					12
92562306a36Sopenharmony_ci#define		NOOFCHAN_MASK					0x00003000
92662306a36Sopenharmony_ci#define MC_SHARED_CHREMAP					0x2008
92762306a36Sopenharmony_ci
92862306a36Sopenharmony_ci#define MC_SHARED_BLACKOUT_CNTL           		0x20ac
92962306a36Sopenharmony_ci#define		BLACKOUT_MODE_MASK			0x00000007
93062306a36Sopenharmony_ci
93162306a36Sopenharmony_ci#define	MC_ARB_RAMCFG					0x2760
93262306a36Sopenharmony_ci#define		NOOFBANK_SHIFT					0
93362306a36Sopenharmony_ci#define		NOOFBANK_MASK					0x00000003
93462306a36Sopenharmony_ci#define		NOOFRANK_SHIFT					2
93562306a36Sopenharmony_ci#define		NOOFRANK_MASK					0x00000004
93662306a36Sopenharmony_ci#define		NOOFROWS_SHIFT					3
93762306a36Sopenharmony_ci#define		NOOFROWS_MASK					0x00000038
93862306a36Sopenharmony_ci#define		NOOFCOLS_SHIFT					6
93962306a36Sopenharmony_ci#define		NOOFCOLS_MASK					0x000000C0
94062306a36Sopenharmony_ci#define		CHANSIZE_SHIFT					8
94162306a36Sopenharmony_ci#define		CHANSIZE_MASK					0x00000100
94262306a36Sopenharmony_ci#define		BURSTLENGTH_SHIFT				9
94362306a36Sopenharmony_ci#define		BURSTLENGTH_MASK				0x00000200
94462306a36Sopenharmony_ci#define		CHANSIZE_OVERRIDE				(1 << 11)
94562306a36Sopenharmony_ci#define	FUS_MC_ARB_RAMCFG				0x2768
94662306a36Sopenharmony_ci#define	MC_VM_AGP_TOP					0x2028
94762306a36Sopenharmony_ci#define	MC_VM_AGP_BOT					0x202C
94862306a36Sopenharmony_ci#define	MC_VM_AGP_BASE					0x2030
94962306a36Sopenharmony_ci#define	MC_VM_FB_LOCATION				0x2024
95062306a36Sopenharmony_ci#define	MC_FUS_VM_FB_OFFSET				0x2898
95162306a36Sopenharmony_ci#define	MC_VM_MB_L1_TLB0_CNTL				0x2234
95262306a36Sopenharmony_ci#define	MC_VM_MB_L1_TLB1_CNTL				0x2238
95362306a36Sopenharmony_ci#define	MC_VM_MB_L1_TLB2_CNTL				0x223C
95462306a36Sopenharmony_ci#define	MC_VM_MB_L1_TLB3_CNTL				0x2240
95562306a36Sopenharmony_ci#define		ENABLE_L1_TLB					(1 << 0)
95662306a36Sopenharmony_ci#define		ENABLE_L1_FRAGMENT_PROCESSING			(1 << 1)
95762306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_PA_ONLY			(0 << 3)
95862306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_USE_SYS_MAP			(1 << 3)
95962306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_IN_SYS			(2 << 3)
96062306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_NOT_IN_SYS			(3 << 3)
96162306a36Sopenharmony_ci#define		SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU	(0 << 5)
96262306a36Sopenharmony_ci#define		EFFECTIVE_L1_TLB_SIZE(x)			((x)<<15)
96362306a36Sopenharmony_ci#define		EFFECTIVE_L1_QUEUE_SIZE(x)			((x)<<18)
96462306a36Sopenharmony_ci#define	MC_VM_MD_L1_TLB0_CNTL				0x2654
96562306a36Sopenharmony_ci#define	MC_VM_MD_L1_TLB1_CNTL				0x2658
96662306a36Sopenharmony_ci#define	MC_VM_MD_L1_TLB2_CNTL				0x265C
96762306a36Sopenharmony_ci#define	MC_VM_MD_L1_TLB3_CNTL				0x2698
96862306a36Sopenharmony_ci
96962306a36Sopenharmony_ci#define	FUS_MC_VM_MD_L1_TLB0_CNTL			0x265C
97062306a36Sopenharmony_ci#define	FUS_MC_VM_MD_L1_TLB1_CNTL			0x2660
97162306a36Sopenharmony_ci#define	FUS_MC_VM_MD_L1_TLB2_CNTL			0x2664
97262306a36Sopenharmony_ci
97362306a36Sopenharmony_ci#define	MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR		0x203C
97462306a36Sopenharmony_ci#define	MC_VM_SYSTEM_APERTURE_HIGH_ADDR			0x2038
97562306a36Sopenharmony_ci#define	MC_VM_SYSTEM_APERTURE_LOW_ADDR			0x2034
97662306a36Sopenharmony_ci
97762306a36Sopenharmony_ci#define	PA_CL_ENHANCE					0x8A14
97862306a36Sopenharmony_ci#define		CLIP_VTX_REORDER_ENA				(1 << 0)
97962306a36Sopenharmony_ci#define		NUM_CLIP_SEQ(x)					((x) << 1)
98062306a36Sopenharmony_ci#define	PA_SC_ENHANCE					0x8BF0
98162306a36Sopenharmony_ci#define PA_SC_AA_CONFIG					0x28C04
98262306a36Sopenharmony_ci#define         MSAA_NUM_SAMPLES_SHIFT                  0
98362306a36Sopenharmony_ci#define         MSAA_NUM_SAMPLES_MASK                   0x3
98462306a36Sopenharmony_ci#define PA_SC_CLIPRECT_RULE				0x2820C
98562306a36Sopenharmony_ci#define	PA_SC_EDGERULE					0x28230
98662306a36Sopenharmony_ci#define	PA_SC_FIFO_SIZE					0x8BCC
98762306a36Sopenharmony_ci#define		SC_PRIM_FIFO_SIZE(x)				((x) << 0)
98862306a36Sopenharmony_ci#define		SC_HIZ_TILE_FIFO_SIZE(x)			((x) << 12)
98962306a36Sopenharmony_ci#define		SC_EARLYZ_TILE_FIFO_SIZE(x)			((x) << 20)
99062306a36Sopenharmony_ci#define	PA_SC_FORCE_EOV_MAX_CNTS			0x8B24
99162306a36Sopenharmony_ci#define		FORCE_EOV_MAX_CLK_CNT(x)			((x) << 0)
99262306a36Sopenharmony_ci#define		FORCE_EOV_MAX_REZ_CNT(x)			((x) << 16)
99362306a36Sopenharmony_ci#define PA_SC_LINE_STIPPLE				0x28A0C
99462306a36Sopenharmony_ci#define	PA_SU_LINE_STIPPLE_VALUE			0x8A60
99562306a36Sopenharmony_ci#define	PA_SC_LINE_STIPPLE_STATE			0x8B10
99662306a36Sopenharmony_ci
99762306a36Sopenharmony_ci#define	SCRATCH_REG0					0x8500
99862306a36Sopenharmony_ci#define	SCRATCH_REG1					0x8504
99962306a36Sopenharmony_ci#define	SCRATCH_REG2					0x8508
100062306a36Sopenharmony_ci#define	SCRATCH_REG3					0x850C
100162306a36Sopenharmony_ci#define	SCRATCH_REG4					0x8510
100262306a36Sopenharmony_ci#define	SCRATCH_REG5					0x8514
100362306a36Sopenharmony_ci#define	SCRATCH_REG6					0x8518
100462306a36Sopenharmony_ci#define	SCRATCH_REG7					0x851C
100562306a36Sopenharmony_ci#define	SCRATCH_UMSK					0x8540
100662306a36Sopenharmony_ci#define	SCRATCH_ADDR					0x8544
100762306a36Sopenharmony_ci
100862306a36Sopenharmony_ci#define	SMX_SAR_CTL0					0xA008
100962306a36Sopenharmony_ci#define	SMX_DC_CTL0					0xA020
101062306a36Sopenharmony_ci#define		USE_HASH_FUNCTION				(1 << 0)
101162306a36Sopenharmony_ci#define		NUMBER_OF_SETS(x)				((x) << 1)
101262306a36Sopenharmony_ci#define		FLUSH_ALL_ON_EVENT				(1 << 10)
101362306a36Sopenharmony_ci#define		STALL_ON_EVENT					(1 << 11)
101462306a36Sopenharmony_ci#define	SMX_EVENT_CTL					0xA02C
101562306a36Sopenharmony_ci#define		ES_FLUSH_CTL(x)					((x) << 0)
101662306a36Sopenharmony_ci#define		GS_FLUSH_CTL(x)					((x) << 3)
101762306a36Sopenharmony_ci#define		ACK_FLUSH_CTL(x)				((x) << 6)
101862306a36Sopenharmony_ci#define		SYNC_FLUSH_CTL					(1 << 8)
101962306a36Sopenharmony_ci
102062306a36Sopenharmony_ci#define	SPI_CONFIG_CNTL					0x9100
102162306a36Sopenharmony_ci#define		GPR_WRITE_PRIORITY(x)				((x) << 0)
102262306a36Sopenharmony_ci#define	SPI_CONFIG_CNTL_1				0x913C
102362306a36Sopenharmony_ci#define		VTX_DONE_DELAY(x)				((x) << 0)
102462306a36Sopenharmony_ci#define		INTERP_ONE_PRIM_PER_ROW				(1 << 4)
102562306a36Sopenharmony_ci#define	SPI_INPUT_Z					0x286D8
102662306a36Sopenharmony_ci#define	SPI_PS_IN_CONTROL_0				0x286CC
102762306a36Sopenharmony_ci#define		NUM_INTERP(x)					((x)<<0)
102862306a36Sopenharmony_ci#define		POSITION_ENA					(1<<8)
102962306a36Sopenharmony_ci#define		POSITION_CENTROID				(1<<9)
103062306a36Sopenharmony_ci#define		POSITION_ADDR(x)				((x)<<10)
103162306a36Sopenharmony_ci#define		PARAM_GEN(x)					((x)<<15)
103262306a36Sopenharmony_ci#define		PARAM_GEN_ADDR(x)				((x)<<19)
103362306a36Sopenharmony_ci#define		BARYC_SAMPLE_CNTL(x)				((x)<<26)
103462306a36Sopenharmony_ci#define		PERSP_GRADIENT_ENA				(1<<28)
103562306a36Sopenharmony_ci#define		LINEAR_GRADIENT_ENA				(1<<29)
103662306a36Sopenharmony_ci#define		POSITION_SAMPLE					(1<<30)
103762306a36Sopenharmony_ci#define		BARYC_AT_SAMPLE_ENA				(1<<31)
103862306a36Sopenharmony_ci
103962306a36Sopenharmony_ci#define	SQ_CONFIG					0x8C00
104062306a36Sopenharmony_ci#define		VC_ENABLE					(1 << 0)
104162306a36Sopenharmony_ci#define		EXPORT_SRC_C					(1 << 1)
104262306a36Sopenharmony_ci#define		CS_PRIO(x)					((x) << 18)
104362306a36Sopenharmony_ci#define		LS_PRIO(x)					((x) << 20)
104462306a36Sopenharmony_ci#define		HS_PRIO(x)					((x) << 22)
104562306a36Sopenharmony_ci#define		PS_PRIO(x)					((x) << 24)
104662306a36Sopenharmony_ci#define		VS_PRIO(x)					((x) << 26)
104762306a36Sopenharmony_ci#define		GS_PRIO(x)					((x) << 28)
104862306a36Sopenharmony_ci#define		ES_PRIO(x)					((x) << 30)
104962306a36Sopenharmony_ci#define	SQ_GPR_RESOURCE_MGMT_1				0x8C04
105062306a36Sopenharmony_ci#define		NUM_PS_GPRS(x)					((x) << 0)
105162306a36Sopenharmony_ci#define		NUM_VS_GPRS(x)					((x) << 16)
105262306a36Sopenharmony_ci#define		NUM_CLAUSE_TEMP_GPRS(x)				((x) << 28)
105362306a36Sopenharmony_ci#define	SQ_GPR_RESOURCE_MGMT_2				0x8C08
105462306a36Sopenharmony_ci#define		NUM_GS_GPRS(x)					((x) << 0)
105562306a36Sopenharmony_ci#define		NUM_ES_GPRS(x)					((x) << 16)
105662306a36Sopenharmony_ci#define	SQ_GPR_RESOURCE_MGMT_3				0x8C0C
105762306a36Sopenharmony_ci#define		NUM_HS_GPRS(x)					((x) << 0)
105862306a36Sopenharmony_ci#define		NUM_LS_GPRS(x)					((x) << 16)
105962306a36Sopenharmony_ci#define	SQ_GLOBAL_GPR_RESOURCE_MGMT_1			0x8C10
106062306a36Sopenharmony_ci#define	SQ_GLOBAL_GPR_RESOURCE_MGMT_2			0x8C14
106162306a36Sopenharmony_ci#define	SQ_THREAD_RESOURCE_MGMT				0x8C18
106262306a36Sopenharmony_ci#define		NUM_PS_THREADS(x)				((x) << 0)
106362306a36Sopenharmony_ci#define		NUM_VS_THREADS(x)				((x) << 8)
106462306a36Sopenharmony_ci#define		NUM_GS_THREADS(x)				((x) << 16)
106562306a36Sopenharmony_ci#define		NUM_ES_THREADS(x)				((x) << 24)
106662306a36Sopenharmony_ci#define	SQ_THREAD_RESOURCE_MGMT_2			0x8C1C
106762306a36Sopenharmony_ci#define		NUM_HS_THREADS(x)				((x) << 0)
106862306a36Sopenharmony_ci#define		NUM_LS_THREADS(x)				((x) << 8)
106962306a36Sopenharmony_ci#define	SQ_STACK_RESOURCE_MGMT_1			0x8C20
107062306a36Sopenharmony_ci#define		NUM_PS_STACK_ENTRIES(x)				((x) << 0)
107162306a36Sopenharmony_ci#define		NUM_VS_STACK_ENTRIES(x)				((x) << 16)
107262306a36Sopenharmony_ci#define	SQ_STACK_RESOURCE_MGMT_2			0x8C24
107362306a36Sopenharmony_ci#define		NUM_GS_STACK_ENTRIES(x)				((x) << 0)
107462306a36Sopenharmony_ci#define		NUM_ES_STACK_ENTRIES(x)				((x) << 16)
107562306a36Sopenharmony_ci#define	SQ_STACK_RESOURCE_MGMT_3			0x8C28
107662306a36Sopenharmony_ci#define		NUM_HS_STACK_ENTRIES(x)				((x) << 0)
107762306a36Sopenharmony_ci#define		NUM_LS_STACK_ENTRIES(x)				((x) << 16)
107862306a36Sopenharmony_ci#define	SQ_DYN_GPR_CNTL_PS_FLUSH_REQ    		0x8D8C
107962306a36Sopenharmony_ci#define	SQ_DYN_GPR_SIMD_LOCK_EN    			0x8D94
108062306a36Sopenharmony_ci#define	SQ_STATIC_THREAD_MGMT_1    			0x8E20
108162306a36Sopenharmony_ci#define	SQ_STATIC_THREAD_MGMT_2    			0x8E24
108262306a36Sopenharmony_ci#define	SQ_STATIC_THREAD_MGMT_3    			0x8E28
108362306a36Sopenharmony_ci#define	SQ_LDS_RESOURCE_MGMT    			0x8E2C
108462306a36Sopenharmony_ci
108562306a36Sopenharmony_ci#define	SQ_MS_FIFO_SIZES				0x8CF0
108662306a36Sopenharmony_ci#define		CACHE_FIFO_SIZE(x)				((x) << 0)
108762306a36Sopenharmony_ci#define		FETCH_FIFO_HIWATER(x)				((x) << 8)
108862306a36Sopenharmony_ci#define		DONE_FIFO_HIWATER(x)				((x) << 16)
108962306a36Sopenharmony_ci#define		ALU_UPDATE_FIFO_HIWATER(x)			((x) << 24)
109062306a36Sopenharmony_ci
109162306a36Sopenharmony_ci#define	SX_DEBUG_1					0x9058
109262306a36Sopenharmony_ci#define		ENABLE_NEW_SMX_ADDRESS				(1 << 16)
109362306a36Sopenharmony_ci#define	SX_EXPORT_BUFFER_SIZES				0x900C
109462306a36Sopenharmony_ci#define		COLOR_BUFFER_SIZE(x)				((x) << 0)
109562306a36Sopenharmony_ci#define		POSITION_BUFFER_SIZE(x)				((x) << 8)
109662306a36Sopenharmony_ci#define		SMX_BUFFER_SIZE(x)				((x) << 16)
109762306a36Sopenharmony_ci#define	SX_MEMORY_EXPORT_BASE				0x9010
109862306a36Sopenharmony_ci#define	SX_MISC						0x28350
109962306a36Sopenharmony_ci
110062306a36Sopenharmony_ci#define CB_PERF_CTR0_SEL_0				0x9A20
110162306a36Sopenharmony_ci#define CB_PERF_CTR0_SEL_1				0x9A24
110262306a36Sopenharmony_ci#define CB_PERF_CTR1_SEL_0				0x9A28
110362306a36Sopenharmony_ci#define CB_PERF_CTR1_SEL_1				0x9A2C
110462306a36Sopenharmony_ci#define CB_PERF_CTR2_SEL_0				0x9A30
110562306a36Sopenharmony_ci#define CB_PERF_CTR2_SEL_1				0x9A34
110662306a36Sopenharmony_ci#define CB_PERF_CTR3_SEL_0				0x9A38
110762306a36Sopenharmony_ci#define CB_PERF_CTR3_SEL_1				0x9A3C
110862306a36Sopenharmony_ci
110962306a36Sopenharmony_ci#define	TA_CNTL_AUX					0x9508
111062306a36Sopenharmony_ci#define		DISABLE_CUBE_WRAP				(1 << 0)
111162306a36Sopenharmony_ci#define		DISABLE_CUBE_ANISO				(1 << 1)
111262306a36Sopenharmony_ci#define		SYNC_GRADIENT					(1 << 24)
111362306a36Sopenharmony_ci#define		SYNC_WALKER					(1 << 25)
111462306a36Sopenharmony_ci#define		SYNC_ALIGNER					(1 << 26)
111562306a36Sopenharmony_ci
111662306a36Sopenharmony_ci#define	TCP_CHAN_STEER_LO				0x960c
111762306a36Sopenharmony_ci#define	TCP_CHAN_STEER_HI				0x9610
111862306a36Sopenharmony_ci
111962306a36Sopenharmony_ci#define	VGT_CACHE_INVALIDATION				0x88C4
112062306a36Sopenharmony_ci#define		CACHE_INVALIDATION(x)				((x) << 0)
112162306a36Sopenharmony_ci#define			VC_ONLY						0
112262306a36Sopenharmony_ci#define			TC_ONLY						1
112362306a36Sopenharmony_ci#define			VC_AND_TC					2
112462306a36Sopenharmony_ci#define		AUTO_INVLD_EN(x)				((x) << 6)
112562306a36Sopenharmony_ci#define			NO_AUTO						0
112662306a36Sopenharmony_ci#define			ES_AUTO						1
112762306a36Sopenharmony_ci#define			GS_AUTO						2
112862306a36Sopenharmony_ci#define			ES_AND_GS_AUTO					3
112962306a36Sopenharmony_ci#define	VGT_GS_VERTEX_REUSE				0x88D4
113062306a36Sopenharmony_ci#define	VGT_NUM_INSTANCES				0x8974
113162306a36Sopenharmony_ci#define	VGT_OUT_DEALLOC_CNTL				0x28C5C
113262306a36Sopenharmony_ci#define		DEALLOC_DIST_MASK				0x0000007F
113362306a36Sopenharmony_ci#define	VGT_VERTEX_REUSE_BLOCK_CNTL			0x28C58
113462306a36Sopenharmony_ci#define		VTX_REUSE_DEPTH_MASK				0x000000FF
113562306a36Sopenharmony_ci
113662306a36Sopenharmony_ci#define VM_CONTEXT0_CNTL				0x1410
113762306a36Sopenharmony_ci#define		ENABLE_CONTEXT					(1 << 0)
113862306a36Sopenharmony_ci#define		PAGE_TABLE_DEPTH(x)				(((x) & 3) << 1)
113962306a36Sopenharmony_ci#define		RANGE_PROTECTION_FAULT_ENABLE_DEFAULT		(1 << 4)
114062306a36Sopenharmony_ci#define VM_CONTEXT1_CNTL				0x1414
114162306a36Sopenharmony_ci#define VM_CONTEXT1_CNTL2				0x1434
114262306a36Sopenharmony_ci#define	VM_CONTEXT0_PAGE_TABLE_BASE_ADDR		0x153C
114362306a36Sopenharmony_ci#define	VM_CONTEXT0_PAGE_TABLE_END_ADDR			0x157C
114462306a36Sopenharmony_ci#define	VM_CONTEXT0_PAGE_TABLE_START_ADDR		0x155C
114562306a36Sopenharmony_ci#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR	0x1518
114662306a36Sopenharmony_ci#define VM_CONTEXT0_REQUEST_RESPONSE			0x1470
114762306a36Sopenharmony_ci#define		REQUEST_TYPE(x)					(((x) & 0xf) << 0)
114862306a36Sopenharmony_ci#define		RESPONSE_TYPE_MASK				0x000000F0
114962306a36Sopenharmony_ci#define		RESPONSE_TYPE_SHIFT				4
115062306a36Sopenharmony_ci#define VM_L2_CNTL					0x1400
115162306a36Sopenharmony_ci#define		ENABLE_L2_CACHE					(1 << 0)
115262306a36Sopenharmony_ci#define		ENABLE_L2_FRAGMENT_PROCESSING			(1 << 1)
115362306a36Sopenharmony_ci#define		ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE		(1 << 9)
115462306a36Sopenharmony_ci#define		EFFECTIVE_L2_QUEUE_SIZE(x)			(((x) & 7) << 14)
115562306a36Sopenharmony_ci#define VM_L2_CNTL2					0x1404
115662306a36Sopenharmony_ci#define		INVALIDATE_ALL_L1_TLBS				(1 << 0)
115762306a36Sopenharmony_ci#define		INVALIDATE_L2_CACHE				(1 << 1)
115862306a36Sopenharmony_ci#define VM_L2_CNTL3					0x1408
115962306a36Sopenharmony_ci#define		BANK_SELECT(x)					((x) << 0)
116062306a36Sopenharmony_ci#define		CACHE_UPDATE_MODE(x)				((x) << 6)
116162306a36Sopenharmony_ci#define	VM_L2_STATUS					0x140C
116262306a36Sopenharmony_ci#define		L2_BUSY						(1 << 0)
116362306a36Sopenharmony_ci#define	VM_CONTEXT1_PROTECTION_FAULT_ADDR		0x14FC
116462306a36Sopenharmony_ci#define	VM_CONTEXT1_PROTECTION_FAULT_STATUS		0x14DC
116562306a36Sopenharmony_ci
116662306a36Sopenharmony_ci#define	WAIT_UNTIL					0x8040
116762306a36Sopenharmony_ci
116862306a36Sopenharmony_ci#define	SRBM_STATUS				        0x0E50
116962306a36Sopenharmony_ci#define		RLC_RQ_PENDING 				(1 << 3)
117062306a36Sopenharmony_ci#define		GRBM_RQ_PENDING 			(1 << 5)
117162306a36Sopenharmony_ci#define		VMC_BUSY 				(1 << 8)
117262306a36Sopenharmony_ci#define		MCB_BUSY 				(1 << 9)
117362306a36Sopenharmony_ci#define		MCB_NON_DISPLAY_BUSY 			(1 << 10)
117462306a36Sopenharmony_ci#define		MCC_BUSY 				(1 << 11)
117562306a36Sopenharmony_ci#define		MCD_BUSY 				(1 << 12)
117662306a36Sopenharmony_ci#define		SEM_BUSY 				(1 << 14)
117762306a36Sopenharmony_ci#define		RLC_BUSY 				(1 << 15)
117862306a36Sopenharmony_ci#define		IH_BUSY 				(1 << 17)
117962306a36Sopenharmony_ci#define	SRBM_STATUS2				        0x0EC4
118062306a36Sopenharmony_ci#define		DMA_BUSY 				(1 << 5)
118162306a36Sopenharmony_ci#define	SRBM_SOFT_RESET				        0x0E60
118262306a36Sopenharmony_ci#define		SRBM_SOFT_RESET_ALL_MASK    	       	0x00FEEFA6
118362306a36Sopenharmony_ci#define		SOFT_RESET_BIF				(1 << 1)
118462306a36Sopenharmony_ci#define		SOFT_RESET_CG				(1 << 2)
118562306a36Sopenharmony_ci#define		SOFT_RESET_DC				(1 << 5)
118662306a36Sopenharmony_ci#define		SOFT_RESET_GRBM				(1 << 8)
118762306a36Sopenharmony_ci#define		SOFT_RESET_HDP				(1 << 9)
118862306a36Sopenharmony_ci#define		SOFT_RESET_IH				(1 << 10)
118962306a36Sopenharmony_ci#define		SOFT_RESET_MC				(1 << 11)
119062306a36Sopenharmony_ci#define		SOFT_RESET_RLC				(1 << 13)
119162306a36Sopenharmony_ci#define		SOFT_RESET_ROM				(1 << 14)
119262306a36Sopenharmony_ci#define		SOFT_RESET_SEM				(1 << 15)
119362306a36Sopenharmony_ci#define		SOFT_RESET_VMC				(1 << 17)
119462306a36Sopenharmony_ci#define		SOFT_RESET_DMA				(1 << 20)
119562306a36Sopenharmony_ci#define		SOFT_RESET_TST				(1 << 21)
119662306a36Sopenharmony_ci#define		SOFT_RESET_REGBB			(1 << 22)
119762306a36Sopenharmony_ci#define		SOFT_RESET_ORB				(1 << 23)
119862306a36Sopenharmony_ci
119962306a36Sopenharmony_ci#define SRBM_READ_ERROR					0xE98
120062306a36Sopenharmony_ci#define SRBM_INT_CNTL					0xEA0
120162306a36Sopenharmony_ci#define SRBM_INT_ACK					0xEA8
120262306a36Sopenharmony_ci
120362306a36Sopenharmony_ci/* display watermarks */
120462306a36Sopenharmony_ci#define	DC_LB_MEMORY_SPLIT				  0x6b0c
120562306a36Sopenharmony_ci#define	PRIORITY_A_CNT			                  0x6b18
120662306a36Sopenharmony_ci#define		PRIORITY_MARK_MASK			  0x7fff
120762306a36Sopenharmony_ci#define		PRIORITY_OFF				  (1 << 16)
120862306a36Sopenharmony_ci#define		PRIORITY_ALWAYS_ON			  (1 << 20)
120962306a36Sopenharmony_ci#define	PRIORITY_B_CNT			                  0x6b1c
121062306a36Sopenharmony_ci#define	PIPE0_ARBITRATION_CONTROL3			  0x0bf0
121162306a36Sopenharmony_ci#       define LATENCY_WATERMARK_MASK(x)                  ((x) << 16)
121262306a36Sopenharmony_ci#define	PIPE0_LATENCY_CONTROL			          0x0bf4
121362306a36Sopenharmony_ci#       define LATENCY_LOW_WATERMARK(x)                   ((x) << 0)
121462306a36Sopenharmony_ci#       define LATENCY_HIGH_WATERMARK(x)                  ((x) << 16)
121562306a36Sopenharmony_ci
121662306a36Sopenharmony_ci#define	PIPE0_DMIF_BUFFER_CONTROL			  0x0ca0
121762306a36Sopenharmony_ci#       define DMIF_BUFFERS_ALLOCATED(x)                  ((x) << 0)
121862306a36Sopenharmony_ci#       define DMIF_BUFFERS_ALLOCATED_COMPLETED           (1 << 4)
121962306a36Sopenharmony_ci
122062306a36Sopenharmony_ci#define IH_RB_CNTL                                        0x3e00
122162306a36Sopenharmony_ci#       define IH_RB_ENABLE                               (1 << 0)
122262306a36Sopenharmony_ci#       define IH_IB_SIZE(x)                              ((x) << 1) /* log2 */
122362306a36Sopenharmony_ci#       define IH_RB_FULL_DRAIN_ENABLE                    (1 << 6)
122462306a36Sopenharmony_ci#       define IH_WPTR_WRITEBACK_ENABLE                   (1 << 8)
122562306a36Sopenharmony_ci#       define IH_WPTR_WRITEBACK_TIMER(x)                 ((x) << 9) /* log2 */
122662306a36Sopenharmony_ci#       define IH_WPTR_OVERFLOW_ENABLE                    (1 << 16)
122762306a36Sopenharmony_ci#       define IH_WPTR_OVERFLOW_CLEAR                     (1 << 31)
122862306a36Sopenharmony_ci#define IH_RB_BASE                                        0x3e04
122962306a36Sopenharmony_ci#define IH_RB_RPTR                                        0x3e08
123062306a36Sopenharmony_ci#define IH_RB_WPTR                                        0x3e0c
123162306a36Sopenharmony_ci#       define RB_OVERFLOW                                (1 << 0)
123262306a36Sopenharmony_ci#       define WPTR_OFFSET_MASK                           0x3fffc
123362306a36Sopenharmony_ci#define IH_RB_WPTR_ADDR_HI                                0x3e10
123462306a36Sopenharmony_ci#define IH_RB_WPTR_ADDR_LO                                0x3e14
123562306a36Sopenharmony_ci#define IH_CNTL                                           0x3e18
123662306a36Sopenharmony_ci#       define ENABLE_INTR                                (1 << 0)
123762306a36Sopenharmony_ci#       define IH_MC_SWAP(x)                              ((x) << 1)
123862306a36Sopenharmony_ci#       define IH_MC_SWAP_NONE                            0
123962306a36Sopenharmony_ci#       define IH_MC_SWAP_16BIT                           1
124062306a36Sopenharmony_ci#       define IH_MC_SWAP_32BIT                           2
124162306a36Sopenharmony_ci#       define IH_MC_SWAP_64BIT                           3
124262306a36Sopenharmony_ci#       define RPTR_REARM                                 (1 << 4)
124362306a36Sopenharmony_ci#       define MC_WRREQ_CREDIT(x)                         ((x) << 15)
124462306a36Sopenharmony_ci#       define MC_WR_CLEAN_CNT(x)                         ((x) << 20)
124562306a36Sopenharmony_ci
124662306a36Sopenharmony_ci#define CP_INT_CNTL                                     0xc124
124762306a36Sopenharmony_ci#       define CNTX_BUSY_INT_ENABLE                     (1 << 19)
124862306a36Sopenharmony_ci#       define CNTX_EMPTY_INT_ENABLE                    (1 << 20)
124962306a36Sopenharmony_ci#       define SCRATCH_INT_ENABLE                       (1 << 25)
125062306a36Sopenharmony_ci#       define TIME_STAMP_INT_ENABLE                    (1 << 26)
125162306a36Sopenharmony_ci#       define IB2_INT_ENABLE                           (1 << 29)
125262306a36Sopenharmony_ci#       define IB1_INT_ENABLE                           (1 << 30)
125362306a36Sopenharmony_ci#       define RB_INT_ENABLE                            (1 << 31)
125462306a36Sopenharmony_ci#define CP_INT_STATUS                                   0xc128
125562306a36Sopenharmony_ci#       define SCRATCH_INT_STAT                         (1 << 25)
125662306a36Sopenharmony_ci#       define TIME_STAMP_INT_STAT                      (1 << 26)
125762306a36Sopenharmony_ci#       define IB2_INT_STAT                             (1 << 29)
125862306a36Sopenharmony_ci#       define IB1_INT_STAT                             (1 << 30)
125962306a36Sopenharmony_ci#       define RB_INT_STAT                              (1 << 31)
126062306a36Sopenharmony_ci
126162306a36Sopenharmony_ci#define GRBM_INT_CNTL                                   0x8060
126262306a36Sopenharmony_ci#       define RDERR_INT_ENABLE                         (1 << 0)
126362306a36Sopenharmony_ci#       define GUI_IDLE_INT_ENABLE                      (1 << 19)
126462306a36Sopenharmony_ci
126562306a36Sopenharmony_ci/* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */
126662306a36Sopenharmony_ci#define CRTC_STATUS_FRAME_COUNT                         0x6e98
126762306a36Sopenharmony_ci
126862306a36Sopenharmony_ci/* 0x6bb8, 0x77b8, 0x103b8, 0x10fb8, 0x11bb8, 0x127b8 */
126962306a36Sopenharmony_ci#define VLINE_STATUS                                    0x6bb8
127062306a36Sopenharmony_ci#       define VLINE_OCCURRED                           (1 << 0)
127162306a36Sopenharmony_ci#       define VLINE_ACK                                (1 << 4)
127262306a36Sopenharmony_ci#       define VLINE_STAT                               (1 << 12)
127362306a36Sopenharmony_ci#       define VLINE_INTERRUPT                          (1 << 16)
127462306a36Sopenharmony_ci#       define VLINE_INTERRUPT_TYPE                     (1 << 17)
127562306a36Sopenharmony_ci/* 0x6bbc, 0x77bc, 0x103bc, 0x10fbc, 0x11bbc, 0x127bc */
127662306a36Sopenharmony_ci#define VBLANK_STATUS                                   0x6bbc
127762306a36Sopenharmony_ci#       define VBLANK_OCCURRED                          (1 << 0)
127862306a36Sopenharmony_ci#       define VBLANK_ACK                               (1 << 4)
127962306a36Sopenharmony_ci#       define VBLANK_STAT                              (1 << 12)
128062306a36Sopenharmony_ci#       define VBLANK_INTERRUPT                         (1 << 16)
128162306a36Sopenharmony_ci#       define VBLANK_INTERRUPT_TYPE                    (1 << 17)
128262306a36Sopenharmony_ci
128362306a36Sopenharmony_ci/* 0x6b40, 0x7740, 0x10340, 0x10f40, 0x11b40, 0x12740 */
128462306a36Sopenharmony_ci#define INT_MASK                                        0x6b40
128562306a36Sopenharmony_ci#       define VBLANK_INT_MASK                          (1 << 0)
128662306a36Sopenharmony_ci#       define VLINE_INT_MASK                           (1 << 4)
128762306a36Sopenharmony_ci
128862306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS                           0x60f4
128962306a36Sopenharmony_ci#       define LB_D1_VLINE_INTERRUPT                    (1 << 2)
129062306a36Sopenharmony_ci#       define LB_D1_VBLANK_INTERRUPT                   (1 << 3)
129162306a36Sopenharmony_ci#       define DC_HPD1_INTERRUPT                        (1 << 17)
129262306a36Sopenharmony_ci#       define DC_HPD1_RX_INTERRUPT                     (1 << 18)
129362306a36Sopenharmony_ci#       define DACA_AUTODETECT_INTERRUPT                (1 << 22)
129462306a36Sopenharmony_ci#       define DACB_AUTODETECT_INTERRUPT                (1 << 23)
129562306a36Sopenharmony_ci#       define DC_I2C_SW_DONE_INTERRUPT                 (1 << 24)
129662306a36Sopenharmony_ci#       define DC_I2C_HW_DONE_INTERRUPT                 (1 << 25)
129762306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE                  0x60f8
129862306a36Sopenharmony_ci#       define LB_D2_VLINE_INTERRUPT                    (1 << 2)
129962306a36Sopenharmony_ci#       define LB_D2_VBLANK_INTERRUPT                   (1 << 3)
130062306a36Sopenharmony_ci#       define DC_HPD2_INTERRUPT                        (1 << 17)
130162306a36Sopenharmony_ci#       define DC_HPD2_RX_INTERRUPT                     (1 << 18)
130262306a36Sopenharmony_ci#       define DISP_TIMER_INTERRUPT                     (1 << 24)
130362306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE2                 0x60fc
130462306a36Sopenharmony_ci#       define LB_D3_VLINE_INTERRUPT                    (1 << 2)
130562306a36Sopenharmony_ci#       define LB_D3_VBLANK_INTERRUPT                   (1 << 3)
130662306a36Sopenharmony_ci#       define DC_HPD3_INTERRUPT                        (1 << 17)
130762306a36Sopenharmony_ci#       define DC_HPD3_RX_INTERRUPT                     (1 << 18)
130862306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE3                 0x6100
130962306a36Sopenharmony_ci#       define LB_D4_VLINE_INTERRUPT                    (1 << 2)
131062306a36Sopenharmony_ci#       define LB_D4_VBLANK_INTERRUPT                   (1 << 3)
131162306a36Sopenharmony_ci#       define DC_HPD4_INTERRUPT                        (1 << 17)
131262306a36Sopenharmony_ci#       define DC_HPD4_RX_INTERRUPT                     (1 << 18)
131362306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE4                 0x614c
131462306a36Sopenharmony_ci#       define LB_D5_VLINE_INTERRUPT                    (1 << 2)
131562306a36Sopenharmony_ci#       define LB_D5_VBLANK_INTERRUPT                   (1 << 3)
131662306a36Sopenharmony_ci#       define DC_HPD5_INTERRUPT                        (1 << 17)
131762306a36Sopenharmony_ci#       define DC_HPD5_RX_INTERRUPT                     (1 << 18)
131862306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE5                 0x6150
131962306a36Sopenharmony_ci#       define LB_D6_VLINE_INTERRUPT                    (1 << 2)
132062306a36Sopenharmony_ci#       define LB_D6_VBLANK_INTERRUPT                   (1 << 3)
132162306a36Sopenharmony_ci#       define DC_HPD6_INTERRUPT                        (1 << 17)
132262306a36Sopenharmony_ci#       define DC_HPD6_RX_INTERRUPT                     (1 << 18)
132362306a36Sopenharmony_ci
132462306a36Sopenharmony_ci/* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */
132562306a36Sopenharmony_ci#define GRPH_INT_STATUS                                 0x6858
132662306a36Sopenharmony_ci#       define GRPH_PFLIP_INT_OCCURRED                  (1 << 0)
132762306a36Sopenharmony_ci#       define GRPH_PFLIP_INT_CLEAR                     (1 << 8)
132862306a36Sopenharmony_ci/* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */
132962306a36Sopenharmony_ci#define	GRPH_INT_CONTROL			        0x685c
133062306a36Sopenharmony_ci#       define GRPH_PFLIP_INT_MASK                      (1 << 0)
133162306a36Sopenharmony_ci#       define GRPH_PFLIP_INT_TYPE                      (1 << 8)
133262306a36Sopenharmony_ci
133362306a36Sopenharmony_ci#define	DACA_AUTODETECT_INT_CONTROL			0x66c8
133462306a36Sopenharmony_ci#define	DACB_AUTODETECT_INT_CONTROL			0x67c8
133562306a36Sopenharmony_ci
133662306a36Sopenharmony_ci#define DC_HPD1_INT_STATUS                              0x601c
133762306a36Sopenharmony_ci#define DC_HPD2_INT_STATUS                              0x6028
133862306a36Sopenharmony_ci#define DC_HPD3_INT_STATUS                              0x6034
133962306a36Sopenharmony_ci#define DC_HPD4_INT_STATUS                              0x6040
134062306a36Sopenharmony_ci#define DC_HPD5_INT_STATUS                              0x604c
134162306a36Sopenharmony_ci#define DC_HPD6_INT_STATUS                              0x6058
134262306a36Sopenharmony_ci#       define DC_HPDx_INT_STATUS                       (1 << 0)
134362306a36Sopenharmony_ci#       define DC_HPDx_SENSE                            (1 << 1)
134462306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_STATUS                    (1 << 8)
134562306a36Sopenharmony_ci
134662306a36Sopenharmony_ci#define DC_HPD1_INT_CONTROL                             0x6020
134762306a36Sopenharmony_ci#define DC_HPD2_INT_CONTROL                             0x602c
134862306a36Sopenharmony_ci#define DC_HPD3_INT_CONTROL                             0x6038
134962306a36Sopenharmony_ci#define DC_HPD4_INT_CONTROL                             0x6044
135062306a36Sopenharmony_ci#define DC_HPD5_INT_CONTROL                             0x6050
135162306a36Sopenharmony_ci#define DC_HPD6_INT_CONTROL                             0x605c
135262306a36Sopenharmony_ci#       define DC_HPDx_INT_ACK                          (1 << 0)
135362306a36Sopenharmony_ci#       define DC_HPDx_INT_POLARITY                     (1 << 8)
135462306a36Sopenharmony_ci#       define DC_HPDx_INT_EN                           (1 << 16)
135562306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_ACK                       (1 << 20)
135662306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_EN                        (1 << 24)
135762306a36Sopenharmony_ci
135862306a36Sopenharmony_ci#define DC_HPD1_CONTROL                                   0x6024
135962306a36Sopenharmony_ci#define DC_HPD2_CONTROL                                   0x6030
136062306a36Sopenharmony_ci#define DC_HPD3_CONTROL                                   0x603c
136162306a36Sopenharmony_ci#define DC_HPD4_CONTROL                                   0x6048
136262306a36Sopenharmony_ci#define DC_HPD5_CONTROL                                   0x6054
136362306a36Sopenharmony_ci#define DC_HPD6_CONTROL                                   0x6060
136462306a36Sopenharmony_ci#       define DC_HPDx_CONNECTION_TIMER(x)                ((x) << 0)
136562306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_TIMER(x)                    ((x) << 16)
136662306a36Sopenharmony_ci#       define DC_HPDx_EN                                 (1 << 28)
136762306a36Sopenharmony_ci
136862306a36Sopenharmony_ci/* DCE4/5/6 FMT blocks */
136962306a36Sopenharmony_ci#define FMT_DYNAMIC_EXP_CNTL                 0x6fb4
137062306a36Sopenharmony_ci#       define FMT_DYNAMIC_EXP_EN            (1 << 0)
137162306a36Sopenharmony_ci#       define FMT_DYNAMIC_EXP_MODE          (1 << 4)
137262306a36Sopenharmony_ci        /* 0 = 10bit -> 12bit, 1 = 8bit -> 12bit */
137362306a36Sopenharmony_ci#define FMT_CONTROL                          0x6fb8
137462306a36Sopenharmony_ci#       define FMT_PIXEL_ENCODING            (1 << 16)
137562306a36Sopenharmony_ci        /* 0 = RGB 4:4:4 or YCbCr 4:4:4, 1 = YCbCr 4:2:2 */
137662306a36Sopenharmony_ci#define FMT_BIT_DEPTH_CONTROL                0x6fc8
137762306a36Sopenharmony_ci#       define FMT_TRUNCATE_EN               (1 << 0)
137862306a36Sopenharmony_ci#       define FMT_TRUNCATE_DEPTH            (1 << 4)
137962306a36Sopenharmony_ci#       define FMT_SPATIAL_DITHER_EN         (1 << 8)
138062306a36Sopenharmony_ci#       define FMT_SPATIAL_DITHER_MODE(x)    ((x) << 9)
138162306a36Sopenharmony_ci#       define FMT_SPATIAL_DITHER_DEPTH      (1 << 12)
138262306a36Sopenharmony_ci#       define FMT_FRAME_RANDOM_ENABLE       (1 << 13)
138362306a36Sopenharmony_ci#       define FMT_RGB_RANDOM_ENABLE         (1 << 14)
138462306a36Sopenharmony_ci#       define FMT_HIGHPASS_RANDOM_ENABLE    (1 << 15)
138562306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_EN        (1 << 16)
138662306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_DEPTH     (1 << 20)
138762306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_OFFSET(x) ((x) << 21)
138862306a36Sopenharmony_ci#       define FMT_TEMPORAL_LEVEL            (1 << 24)
138962306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_RESET     (1 << 25)
139062306a36Sopenharmony_ci#       define FMT_25FRC_SEL(x)              ((x) << 26)
139162306a36Sopenharmony_ci#       define FMT_50FRC_SEL(x)              ((x) << 28)
139262306a36Sopenharmony_ci#       define FMT_75FRC_SEL(x)              ((x) << 30)
139362306a36Sopenharmony_ci#define FMT_CLAMP_CONTROL                    0x6fe4
139462306a36Sopenharmony_ci#       define FMT_CLAMP_DATA_EN             (1 << 0)
139562306a36Sopenharmony_ci#       define FMT_CLAMP_COLOR_FORMAT(x)     ((x) << 16)
139662306a36Sopenharmony_ci#       define FMT_CLAMP_6BPC                0
139762306a36Sopenharmony_ci#       define FMT_CLAMP_8BPC                1
139862306a36Sopenharmony_ci#       define FMT_CLAMP_10BPC               2
139962306a36Sopenharmony_ci
140062306a36Sopenharmony_ci/* ASYNC DMA */
140162306a36Sopenharmony_ci#define DMA_RB_RPTR                                       0xd008
140262306a36Sopenharmony_ci#define DMA_RB_WPTR                                       0xd00c
140362306a36Sopenharmony_ci
140462306a36Sopenharmony_ci#define DMA_CNTL                                          0xd02c
140562306a36Sopenharmony_ci#       define TRAP_ENABLE                                (1 << 0)
140662306a36Sopenharmony_ci#       define SEM_INCOMPLETE_INT_ENABLE                  (1 << 1)
140762306a36Sopenharmony_ci#       define SEM_WAIT_INT_ENABLE                        (1 << 2)
140862306a36Sopenharmony_ci#       define DATA_SWAP_ENABLE                           (1 << 3)
140962306a36Sopenharmony_ci#       define FENCE_SWAP_ENABLE                          (1 << 4)
141062306a36Sopenharmony_ci#       define CTXEMPTY_INT_ENABLE                        (1 << 28)
141162306a36Sopenharmony_ci#define DMA_TILING_CONFIG  				  0xD0B8
141262306a36Sopenharmony_ci
141362306a36Sopenharmony_ci#define CAYMAN_DMA1_CNTL                                  0xd82c
141462306a36Sopenharmony_ci
141562306a36Sopenharmony_ci/* async DMA packets */
141662306a36Sopenharmony_ci#define DMA_PACKET(cmd, sub_cmd, n) ((((cmd) & 0xF) << 28) |    \
141762306a36Sopenharmony_ci                                    (((sub_cmd) & 0xFF) << 20) |\
141862306a36Sopenharmony_ci                                    (((n) & 0xFFFFF) << 0))
141962306a36Sopenharmony_ci#define GET_DMA_CMD(h) (((h) & 0xf0000000) >> 28)
142062306a36Sopenharmony_ci#define GET_DMA_COUNT(h) ((h) & 0x000fffff)
142162306a36Sopenharmony_ci#define GET_DMA_SUB_CMD(h) (((h) & 0x0ff00000) >> 20)
142262306a36Sopenharmony_ci
142362306a36Sopenharmony_ci/* async DMA Packet types */
142462306a36Sopenharmony_ci#define	DMA_PACKET_WRITE                        0x2
142562306a36Sopenharmony_ci#define	DMA_PACKET_COPY                         0x3
142662306a36Sopenharmony_ci#define	DMA_PACKET_INDIRECT_BUFFER              0x4
142762306a36Sopenharmony_ci#define	DMA_PACKET_SEMAPHORE                    0x5
142862306a36Sopenharmony_ci#define	DMA_PACKET_FENCE                        0x6
142962306a36Sopenharmony_ci#define	DMA_PACKET_TRAP                         0x7
143062306a36Sopenharmony_ci#define	DMA_PACKET_SRBM_WRITE                   0x9
143162306a36Sopenharmony_ci#define	DMA_PACKET_CONSTANT_FILL                0xd
143262306a36Sopenharmony_ci#define	DMA_PACKET_NOP                          0xf
143362306a36Sopenharmony_ci
143462306a36Sopenharmony_ci/* PIF PHY0 indirect regs */
143562306a36Sopenharmony_ci#define PB0_PIF_CNTL                                      0x10
143662306a36Sopenharmony_ci#       define LS2_EXIT_TIME(x)                           ((x) << 17)
143762306a36Sopenharmony_ci#       define LS2_EXIT_TIME_MASK                         (0x7 << 17)
143862306a36Sopenharmony_ci#       define LS2_EXIT_TIME_SHIFT                        17
143962306a36Sopenharmony_ci#define PB0_PIF_PAIRING                                   0x11
144062306a36Sopenharmony_ci#       define MULTI_PIF                                  (1 << 25)
144162306a36Sopenharmony_ci#define PB0_PIF_PWRDOWN_0                                 0x12
144262306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_TXS2_0(x)               ((x) << 7)
144362306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_TXS2_0_MASK             (0x7 << 7)
144462306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_TXS2_0_SHIFT            7
144562306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_OFF_0(x)                ((x) << 10)
144662306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_OFF_0_MASK              (0x7 << 10)
144762306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_OFF_0_SHIFT             10
144862306a36Sopenharmony_ci#       define PLL_RAMP_UP_TIME_0(x)                      ((x) << 24)
144962306a36Sopenharmony_ci#       define PLL_RAMP_UP_TIME_0_MASK                    (0x7 << 24)
145062306a36Sopenharmony_ci#       define PLL_RAMP_UP_TIME_0_SHIFT                   24
145162306a36Sopenharmony_ci#define PB0_PIF_PWRDOWN_1                                 0x13
145262306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_TXS2_1(x)               ((x) << 7)
145362306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_TXS2_1_MASK             (0x7 << 7)
145462306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_TXS2_1_SHIFT            7
145562306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_OFF_1(x)                ((x) << 10)
145662306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_OFF_1_MASK              (0x7 << 10)
145762306a36Sopenharmony_ci#       define PLL_POWER_STATE_IN_OFF_1_SHIFT             10
145862306a36Sopenharmony_ci#       define PLL_RAMP_UP_TIME_1(x)                      ((x) << 24)
145962306a36Sopenharmony_ci#       define PLL_RAMP_UP_TIME_1_MASK                    (0x7 << 24)
146062306a36Sopenharmony_ci#       define PLL_RAMP_UP_TIME_1_SHIFT                   24
146162306a36Sopenharmony_ci/* PIF PHY1 indirect regs */
146262306a36Sopenharmony_ci#define PB1_PIF_CNTL                                      0x10
146362306a36Sopenharmony_ci#define PB1_PIF_PAIRING                                   0x11
146462306a36Sopenharmony_ci#define PB1_PIF_PWRDOWN_0                                 0x12
146562306a36Sopenharmony_ci#define PB1_PIF_PWRDOWN_1                                 0x13
146662306a36Sopenharmony_ci/* PCIE PORT indirect regs */
146762306a36Sopenharmony_ci#define PCIE_LC_CNTL                                      0xa0
146862306a36Sopenharmony_ci#       define LC_L0S_INACTIVITY(x)                       ((x) << 8)
146962306a36Sopenharmony_ci#       define LC_L0S_INACTIVITY_MASK                     (0xf << 8)
147062306a36Sopenharmony_ci#       define LC_L0S_INACTIVITY_SHIFT                    8
147162306a36Sopenharmony_ci#       define LC_L1_INACTIVITY(x)                        ((x) << 12)
147262306a36Sopenharmony_ci#       define LC_L1_INACTIVITY_MASK                      (0xf << 12)
147362306a36Sopenharmony_ci#       define LC_L1_INACTIVITY_SHIFT                     12
147462306a36Sopenharmony_ci#       define LC_PMI_TO_L1_DIS                           (1 << 16)
147562306a36Sopenharmony_ci#       define LC_ASPM_TO_L1_DIS                          (1 << 24)
147662306a36Sopenharmony_ci#define PCIE_LC_TRAINING_CNTL                             0xa1 /* PCIE_P */
147762306a36Sopenharmony_ci#define PCIE_LC_LINK_WIDTH_CNTL                           0xa2 /* PCIE_P */
147862306a36Sopenharmony_ci#       define LC_LINK_WIDTH_SHIFT                        0
147962306a36Sopenharmony_ci#       define LC_LINK_WIDTH_MASK                         0x7
148062306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X0                           0
148162306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X1                           1
148262306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X2                           2
148362306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X4                           3
148462306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X8                           4
148562306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X16                          6
148662306a36Sopenharmony_ci#       define LC_LINK_WIDTH_RD_SHIFT                     4
148762306a36Sopenharmony_ci#       define LC_LINK_WIDTH_RD_MASK                      0x70
148862306a36Sopenharmony_ci#       define LC_RECONFIG_ARC_MISSING_ESCAPE             (1 << 7)
148962306a36Sopenharmony_ci#       define LC_RECONFIG_NOW                            (1 << 8)
149062306a36Sopenharmony_ci#       define LC_RENEGOTIATION_SUPPORT                   (1 << 9)
149162306a36Sopenharmony_ci#       define LC_RENEGOTIATE_EN                          (1 << 10)
149262306a36Sopenharmony_ci#       define LC_SHORT_RECONFIG_EN                       (1 << 11)
149362306a36Sopenharmony_ci#       define LC_UPCONFIGURE_SUPPORT                     (1 << 12)
149462306a36Sopenharmony_ci#       define LC_UPCONFIGURE_DIS                         (1 << 13)
149562306a36Sopenharmony_ci#       define LC_DYN_LANES_PWR_STATE(x)                  ((x) << 21)
149662306a36Sopenharmony_ci#       define LC_DYN_LANES_PWR_STATE_MASK                (0x3 << 21)
149762306a36Sopenharmony_ci#       define LC_DYN_LANES_PWR_STATE_SHIFT               21
149862306a36Sopenharmony_ci#define PCIE_LC_SPEED_CNTL                                0xa4 /* PCIE_P */
149962306a36Sopenharmony_ci#       define LC_GEN2_EN_STRAP                           (1 << 0)
150062306a36Sopenharmony_ci#       define LC_TARGET_LINK_SPEED_OVERRIDE_EN           (1 << 1)
150162306a36Sopenharmony_ci#       define LC_FORCE_EN_HW_SPEED_CHANGE                (1 << 5)
150262306a36Sopenharmony_ci#       define LC_FORCE_DIS_HW_SPEED_CHANGE               (1 << 6)
150362306a36Sopenharmony_ci#       define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK      (0x3 << 8)
150462306a36Sopenharmony_ci#       define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT     3
150562306a36Sopenharmony_ci#       define LC_CURRENT_DATA_RATE                       (1 << 11)
150662306a36Sopenharmony_ci#       define LC_HW_VOLTAGE_IF_CONTROL(x)                ((x) << 12)
150762306a36Sopenharmony_ci#       define LC_HW_VOLTAGE_IF_CONTROL_MASK              (3 << 12)
150862306a36Sopenharmony_ci#       define LC_HW_VOLTAGE_IF_CONTROL_SHIFT             12
150962306a36Sopenharmony_ci#       define LC_VOLTAGE_TIMER_SEL_MASK                  (0xf << 14)
151062306a36Sopenharmony_ci#       define LC_CLR_FAILED_SPD_CHANGE_CNT               (1 << 21)
151162306a36Sopenharmony_ci#       define LC_OTHER_SIDE_EVER_SENT_GEN2               (1 << 23)
151262306a36Sopenharmony_ci#       define LC_OTHER_SIDE_SUPPORTS_GEN2                (1 << 24)
151362306a36Sopenharmony_ci#define MM_CFGREGS_CNTL                                   0x544c
151462306a36Sopenharmony_ci#       define MM_WR_TO_CFG_EN                            (1 << 3)
151562306a36Sopenharmony_ci#define LINK_CNTL2                                        0x88 /* F0 */
151662306a36Sopenharmony_ci#       define TARGET_LINK_SPEED_MASK                     (0xf << 0)
151762306a36Sopenharmony_ci#       define SELECTABLE_DEEMPHASIS                      (1 << 6)
151862306a36Sopenharmony_ci
151962306a36Sopenharmony_ci
152062306a36Sopenharmony_ci/*
152162306a36Sopenharmony_ci * UVD
152262306a36Sopenharmony_ci */
152362306a36Sopenharmony_ci#define UVD_UDEC_ADDR_CONFIG				0xef4c
152462306a36Sopenharmony_ci#define UVD_UDEC_DB_ADDR_CONFIG				0xef50
152562306a36Sopenharmony_ci#define UVD_UDEC_DBW_ADDR_CONFIG			0xef54
152662306a36Sopenharmony_ci#define UVD_NO_OP					0xeffc
152762306a36Sopenharmony_ci#define UVD_RBC_RB_RPTR					0xf690
152862306a36Sopenharmony_ci#define UVD_RBC_RB_WPTR					0xf694
152962306a36Sopenharmony_ci#define UVD_STATUS					0xf6bc
153062306a36Sopenharmony_ci
153162306a36Sopenharmony_ci/*
153262306a36Sopenharmony_ci * PM4
153362306a36Sopenharmony_ci */
153462306a36Sopenharmony_ci#define PACKET0(reg, n)	((RADEON_PACKET_TYPE0 << 30) |			\
153562306a36Sopenharmony_ci			 (((reg) >> 2) & 0xFFFF) |			\
153662306a36Sopenharmony_ci			 ((n) & 0x3FFF) << 16)
153762306a36Sopenharmony_ci#define CP_PACKET2			0x80000000
153862306a36Sopenharmony_ci#define		PACKET2_PAD_SHIFT		0
153962306a36Sopenharmony_ci#define		PACKET2_PAD_MASK		(0x3fffffff << 0)
154062306a36Sopenharmony_ci
154162306a36Sopenharmony_ci#define PACKET2(v)	(CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
154262306a36Sopenharmony_ci
154362306a36Sopenharmony_ci#define PACKET3(op, n)	((RADEON_PACKET_TYPE3 << 30) |			\
154462306a36Sopenharmony_ci			 (((op) & 0xFF) << 8) |				\
154562306a36Sopenharmony_ci			 ((n) & 0x3FFF) << 16)
154662306a36Sopenharmony_ci
154762306a36Sopenharmony_ci/* Packet 3 types */
154862306a36Sopenharmony_ci#define	PACKET3_NOP					0x10
154962306a36Sopenharmony_ci#define	PACKET3_SET_BASE				0x11
155062306a36Sopenharmony_ci#define	PACKET3_CLEAR_STATE				0x12
155162306a36Sopenharmony_ci#define	PACKET3_INDEX_BUFFER_SIZE			0x13
155262306a36Sopenharmony_ci#define	PACKET3_DISPATCH_DIRECT				0x15
155362306a36Sopenharmony_ci#define	PACKET3_DISPATCH_INDIRECT			0x16
155462306a36Sopenharmony_ci#define	PACKET3_INDIRECT_BUFFER_END			0x17
155562306a36Sopenharmony_ci#define	PACKET3_MODE_CONTROL				0x18
155662306a36Sopenharmony_ci#define	PACKET3_SET_PREDICATION				0x20
155762306a36Sopenharmony_ci#define	PACKET3_REG_RMW					0x21
155862306a36Sopenharmony_ci#define	PACKET3_COND_EXEC				0x22
155962306a36Sopenharmony_ci#define	PACKET3_PRED_EXEC				0x23
156062306a36Sopenharmony_ci#define	PACKET3_DRAW_INDIRECT				0x24
156162306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_INDIRECT			0x25
156262306a36Sopenharmony_ci#define	PACKET3_INDEX_BASE				0x26
156362306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_2				0x27
156462306a36Sopenharmony_ci#define	PACKET3_CONTEXT_CONTROL				0x28
156562306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_OFFSET			0x29
156662306a36Sopenharmony_ci#define	PACKET3_INDEX_TYPE				0x2A
156762306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX				0x2B
156862306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_AUTO				0x2D
156962306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_IMMD				0x2E
157062306a36Sopenharmony_ci#define	PACKET3_NUM_INSTANCES				0x2F
157162306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_MULTI_AUTO			0x30
157262306a36Sopenharmony_ci#define	PACKET3_STRMOUT_BUFFER_UPDATE			0x34
157362306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_OFFSET_2			0x35
157462306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_MULTI_ELEMENT		0x36
157562306a36Sopenharmony_ci#define	PACKET3_MEM_SEMAPHORE				0x39
157662306a36Sopenharmony_ci#define	PACKET3_MPEG_INDEX				0x3A
157762306a36Sopenharmony_ci#define	PACKET3_COPY_DW					0x3B
157862306a36Sopenharmony_ci#define	PACKET3_WAIT_REG_MEM				0x3C
157962306a36Sopenharmony_ci#define	PACKET3_MEM_WRITE				0x3D
158062306a36Sopenharmony_ci#define	PACKET3_INDIRECT_BUFFER				0x32
158162306a36Sopenharmony_ci#define	PACKET3_CP_DMA					0x41
158262306a36Sopenharmony_ci/* 1. header
158362306a36Sopenharmony_ci * 2. SRC_ADDR_LO or DATA [31:0]
158462306a36Sopenharmony_ci * 3. CP_SYNC [31] | SRC_SEL [30:29] | ENGINE [27] | DST_SEL [21:20] |
158562306a36Sopenharmony_ci *    SRC_ADDR_HI [7:0]
158662306a36Sopenharmony_ci * 4. DST_ADDR_LO [31:0]
158762306a36Sopenharmony_ci * 5. DST_ADDR_HI [7:0]
158862306a36Sopenharmony_ci * 6. COMMAND [29:22] | BYTE_COUNT [20:0]
158962306a36Sopenharmony_ci */
159062306a36Sopenharmony_ci#              define PACKET3_CP_DMA_DST_SEL(x)    ((x) << 20)
159162306a36Sopenharmony_ci                /* 0 - DST_ADDR
159262306a36Sopenharmony_ci		 * 1 - GDS
159362306a36Sopenharmony_ci		 */
159462306a36Sopenharmony_ci#              define PACKET3_CP_DMA_ENGINE(x)     ((x) << 27)
159562306a36Sopenharmony_ci                /* 0 - ME
159662306a36Sopenharmony_ci		 * 1 - PFP
159762306a36Sopenharmony_ci		 */
159862306a36Sopenharmony_ci#              define PACKET3_CP_DMA_SRC_SEL(x)    ((x) << 29)
159962306a36Sopenharmony_ci                /* 0 - SRC_ADDR
160062306a36Sopenharmony_ci		 * 1 - GDS
160162306a36Sopenharmony_ci		 * 2 - DATA
160262306a36Sopenharmony_ci		 */
160362306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CP_SYNC       (1 << 31)
160462306a36Sopenharmony_ci/* COMMAND */
160562306a36Sopenharmony_ci#              define PACKET3_CP_DMA_DIS_WC        (1 << 21)
160662306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
160762306a36Sopenharmony_ci                /* 0 - none
160862306a36Sopenharmony_ci		 * 1 - 8 in 16
160962306a36Sopenharmony_ci		 * 2 - 8 in 32
161062306a36Sopenharmony_ci		 * 3 - 8 in 64
161162306a36Sopenharmony_ci		 */
161262306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24)
161362306a36Sopenharmony_ci                /* 0 - none
161462306a36Sopenharmony_ci		 * 1 - 8 in 16
161562306a36Sopenharmony_ci		 * 2 - 8 in 32
161662306a36Sopenharmony_ci		 * 3 - 8 in 64
161762306a36Sopenharmony_ci		 */
161862306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_SAS       (1 << 26)
161962306a36Sopenharmony_ci                /* 0 - memory
162062306a36Sopenharmony_ci		 * 1 - register
162162306a36Sopenharmony_ci		 */
162262306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_DAS       (1 << 27)
162362306a36Sopenharmony_ci                /* 0 - memory
162462306a36Sopenharmony_ci		 * 1 - register
162562306a36Sopenharmony_ci		 */
162662306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_SAIC      (1 << 28)
162762306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_DAIC      (1 << 29)
162862306a36Sopenharmony_ci#define	PACKET3_PFP_SYNC_ME				0x42
162962306a36Sopenharmony_ci#define	PACKET3_SURFACE_SYNC				0x43
163062306a36Sopenharmony_ci#              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
163162306a36Sopenharmony_ci#              define PACKET3_CB1_DEST_BASE_ENA    (1 << 7)
163262306a36Sopenharmony_ci#              define PACKET3_CB2_DEST_BASE_ENA    (1 << 8)
163362306a36Sopenharmony_ci#              define PACKET3_CB3_DEST_BASE_ENA    (1 << 9)
163462306a36Sopenharmony_ci#              define PACKET3_CB4_DEST_BASE_ENA    (1 << 10)
163562306a36Sopenharmony_ci#              define PACKET3_CB5_DEST_BASE_ENA    (1 << 11)
163662306a36Sopenharmony_ci#              define PACKET3_CB6_DEST_BASE_ENA    (1 << 12)
163762306a36Sopenharmony_ci#              define PACKET3_CB7_DEST_BASE_ENA    (1 << 13)
163862306a36Sopenharmony_ci#              define PACKET3_DB_DEST_BASE_ENA     (1 << 14)
163962306a36Sopenharmony_ci#              define PACKET3_CB8_DEST_BASE_ENA    (1 << 15)
164062306a36Sopenharmony_ci#              define PACKET3_CB9_DEST_BASE_ENA    (1 << 16)
164162306a36Sopenharmony_ci#              define PACKET3_CB10_DEST_BASE_ENA   (1 << 17)
164262306a36Sopenharmony_ci#              define PACKET3_CB11_DEST_BASE_ENA   (1 << 18)
164362306a36Sopenharmony_ci#              define PACKET3_FULL_CACHE_ENA       (1 << 20)
164462306a36Sopenharmony_ci#              define PACKET3_TC_ACTION_ENA        (1 << 23)
164562306a36Sopenharmony_ci#              define PACKET3_VC_ACTION_ENA        (1 << 24)
164662306a36Sopenharmony_ci#              define PACKET3_CB_ACTION_ENA        (1 << 25)
164762306a36Sopenharmony_ci#              define PACKET3_DB_ACTION_ENA        (1 << 26)
164862306a36Sopenharmony_ci#              define PACKET3_SH_ACTION_ENA        (1 << 27)
164962306a36Sopenharmony_ci#              define PACKET3_SX_ACTION_ENA        (1 << 28)
165062306a36Sopenharmony_ci#define	PACKET3_ME_INITIALIZE				0x44
165162306a36Sopenharmony_ci#define		PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
165262306a36Sopenharmony_ci#define	PACKET3_COND_WRITE				0x45
165362306a36Sopenharmony_ci#define	PACKET3_EVENT_WRITE				0x46
165462306a36Sopenharmony_ci#define	PACKET3_EVENT_WRITE_EOP				0x47
165562306a36Sopenharmony_ci#define	PACKET3_EVENT_WRITE_EOS				0x48
165662306a36Sopenharmony_ci#define	PACKET3_PREAMBLE_CNTL				0x4A
165762306a36Sopenharmony_ci#              define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE     (2 << 28)
165862306a36Sopenharmony_ci#              define PACKET3_PREAMBLE_END_CLEAR_STATE       (3 << 28)
165962306a36Sopenharmony_ci#define	PACKET3_RB_OFFSET				0x4B
166062306a36Sopenharmony_ci#define	PACKET3_ALU_PS_CONST_BUFFER_COPY		0x4C
166162306a36Sopenharmony_ci#define	PACKET3_ALU_VS_CONST_BUFFER_COPY		0x4D
166262306a36Sopenharmony_ci#define	PACKET3_ALU_PS_CONST_UPDATE		        0x4E
166362306a36Sopenharmony_ci#define	PACKET3_ALU_VS_CONST_UPDATE		        0x4F
166462306a36Sopenharmony_ci#define	PACKET3_ONE_REG_WRITE				0x57
166562306a36Sopenharmony_ci#define	PACKET3_SET_CONFIG_REG				0x68
166662306a36Sopenharmony_ci#define		PACKET3_SET_CONFIG_REG_START			0x00008000
166762306a36Sopenharmony_ci#define		PACKET3_SET_CONFIG_REG_END			0x0000ac00
166862306a36Sopenharmony_ci#define	PACKET3_SET_CONTEXT_REG				0x69
166962306a36Sopenharmony_ci#define		PACKET3_SET_CONTEXT_REG_START			0x00028000
167062306a36Sopenharmony_ci#define		PACKET3_SET_CONTEXT_REG_END			0x00029000
167162306a36Sopenharmony_ci#define	PACKET3_SET_ALU_CONST				0x6A
167262306a36Sopenharmony_ci/* alu const buffers only; no reg file */
167362306a36Sopenharmony_ci#define	PACKET3_SET_BOOL_CONST				0x6B
167462306a36Sopenharmony_ci#define		PACKET3_SET_BOOL_CONST_START			0x0003a500
167562306a36Sopenharmony_ci#define		PACKET3_SET_BOOL_CONST_END			0x0003a518
167662306a36Sopenharmony_ci#define	PACKET3_SET_LOOP_CONST				0x6C
167762306a36Sopenharmony_ci#define		PACKET3_SET_LOOP_CONST_START			0x0003a200
167862306a36Sopenharmony_ci#define		PACKET3_SET_LOOP_CONST_END			0x0003a500
167962306a36Sopenharmony_ci#define	PACKET3_SET_RESOURCE				0x6D
168062306a36Sopenharmony_ci#define		PACKET3_SET_RESOURCE_START			0x00030000
168162306a36Sopenharmony_ci#define		PACKET3_SET_RESOURCE_END			0x00038000
168262306a36Sopenharmony_ci#define	PACKET3_SET_SAMPLER				0x6E
168362306a36Sopenharmony_ci#define		PACKET3_SET_SAMPLER_START			0x0003c000
168462306a36Sopenharmony_ci#define		PACKET3_SET_SAMPLER_END				0x0003c600
168562306a36Sopenharmony_ci#define	PACKET3_SET_CTL_CONST				0x6F
168662306a36Sopenharmony_ci#define		PACKET3_SET_CTL_CONST_START			0x0003cff0
168762306a36Sopenharmony_ci#define		PACKET3_SET_CTL_CONST_END			0x0003ff0c
168862306a36Sopenharmony_ci#define	PACKET3_SET_RESOURCE_OFFSET			0x70
168962306a36Sopenharmony_ci#define	PACKET3_SET_ALU_CONST_VS			0x71
169062306a36Sopenharmony_ci#define	PACKET3_SET_ALU_CONST_DI			0x72
169162306a36Sopenharmony_ci#define	PACKET3_SET_CONTEXT_REG_INDIRECT		0x73
169262306a36Sopenharmony_ci#define	PACKET3_SET_RESOURCE_INDIRECT			0x74
169362306a36Sopenharmony_ci#define	PACKET3_SET_APPEND_CNT			        0x75
169462306a36Sopenharmony_ci/* SET_APPEND_CNT - documentation
169562306a36Sopenharmony_ci * 1. header
169662306a36Sopenharmony_ci * 2. COMMAND
169762306a36Sopenharmony_ci *  1:0 - SOURCE SEL
169862306a36Sopenharmony_ci *  15:2 - Reserved
169962306a36Sopenharmony_ci *  31:16 - WR_REG_OFFSET - context register to write source data to.
170062306a36Sopenharmony_ci *          (one of R_02872C_GDS_APPEND_COUNT_0-11)
170162306a36Sopenharmony_ci * 3. CONTROL
170262306a36Sopenharmony_ci *  (for source == mem)
170362306a36Sopenharmony_ci *  31:2 SRC_ADDRESS_LO
170462306a36Sopenharmony_ci *  0:1 SWAP
170562306a36Sopenharmony_ci *  (for source == GDS)
170662306a36Sopenharmony_ci *  31:0 GDS offset
170762306a36Sopenharmony_ci *  (for source == DATA)
170862306a36Sopenharmony_ci *  31:0 DATA
170962306a36Sopenharmony_ci *  (for source == REG)
171062306a36Sopenharmony_ci *  31:0 REG
171162306a36Sopenharmony_ci * 4. SRC_ADDRESS_HI[7:0]
171262306a36Sopenharmony_ci * kernel driver 2.44 only supports SRC == MEM.
171362306a36Sopenharmony_ci */
171462306a36Sopenharmony_ci#define PACKET3_SET_APPEND_CNT_SRC_SELECT(x) ((x) << 0)
171562306a36Sopenharmony_ci#define G_PACKET3_SET_APPEND_CNT_SRC_SELECT(x) ((x & 0x3) >> 0)
171662306a36Sopenharmony_ci/* source is from the data in CONTROL */
171762306a36Sopenharmony_ci#define PACKET3_SAC_SRC_SEL_DATA 0x0
171862306a36Sopenharmony_ci/* source is from register */
171962306a36Sopenharmony_ci#define PACKET3_SAC_SRC_SEL_REG  0x1
172062306a36Sopenharmony_ci/* source is from GDS offset in CONTROL */
172162306a36Sopenharmony_ci#define PACKET3_SAC_SRC_SEL_GDS  0x2
172262306a36Sopenharmony_ci/* source is from memory address */
172362306a36Sopenharmony_ci#define PACKET3_SAC_SRC_SEL_MEM  0x3
172462306a36Sopenharmony_ci
172562306a36Sopenharmony_ci#define	SQ_RESOURCE_CONSTANT_WORD7_0				0x3001c
172662306a36Sopenharmony_ci#define		S__SQ_CONSTANT_TYPE(x)			(((x) & 3) << 30)
172762306a36Sopenharmony_ci#define		G__SQ_CONSTANT_TYPE(x)			(((x) >> 30) & 3)
172862306a36Sopenharmony_ci#define			SQ_TEX_VTX_INVALID_TEXTURE			0x0
172962306a36Sopenharmony_ci#define			SQ_TEX_VTX_INVALID_BUFFER			0x1
173062306a36Sopenharmony_ci#define			SQ_TEX_VTX_VALID_TEXTURE			0x2
173162306a36Sopenharmony_ci#define			SQ_TEX_VTX_VALID_BUFFER				0x3
173262306a36Sopenharmony_ci
173362306a36Sopenharmony_ci#define VGT_VTX_VECT_EJECT_REG				0x88b0
173462306a36Sopenharmony_ci
173562306a36Sopenharmony_ci#define SQ_CONST_MEM_BASE				0x8df8
173662306a36Sopenharmony_ci
173762306a36Sopenharmony_ci#define SQ_ESGS_RING_BASE				0x8c40
173862306a36Sopenharmony_ci#define SQ_ESGS_RING_SIZE				0x8c44
173962306a36Sopenharmony_ci#define SQ_GSVS_RING_BASE				0x8c48
174062306a36Sopenharmony_ci#define SQ_GSVS_RING_SIZE				0x8c4c
174162306a36Sopenharmony_ci#define SQ_ESTMP_RING_BASE				0x8c50
174262306a36Sopenharmony_ci#define SQ_ESTMP_RING_SIZE				0x8c54
174362306a36Sopenharmony_ci#define SQ_GSTMP_RING_BASE				0x8c58
174462306a36Sopenharmony_ci#define SQ_GSTMP_RING_SIZE				0x8c5c
174562306a36Sopenharmony_ci#define SQ_VSTMP_RING_BASE				0x8c60
174662306a36Sopenharmony_ci#define SQ_VSTMP_RING_SIZE				0x8c64
174762306a36Sopenharmony_ci#define SQ_PSTMP_RING_BASE				0x8c68
174862306a36Sopenharmony_ci#define SQ_PSTMP_RING_SIZE				0x8c6c
174962306a36Sopenharmony_ci#define SQ_LSTMP_RING_BASE				0x8e10
175062306a36Sopenharmony_ci#define SQ_LSTMP_RING_SIZE				0x8e14
175162306a36Sopenharmony_ci#define SQ_HSTMP_RING_BASE				0x8e18
175262306a36Sopenharmony_ci#define SQ_HSTMP_RING_SIZE				0x8e1c
175362306a36Sopenharmony_ci#define VGT_TF_RING_SIZE				0x8988
175462306a36Sopenharmony_ci
175562306a36Sopenharmony_ci#define SQ_ESGS_RING_ITEMSIZE				0x28900
175662306a36Sopenharmony_ci#define SQ_GSVS_RING_ITEMSIZE				0x28904
175762306a36Sopenharmony_ci#define SQ_ESTMP_RING_ITEMSIZE				0x28908
175862306a36Sopenharmony_ci#define SQ_GSTMP_RING_ITEMSIZE				0x2890c
175962306a36Sopenharmony_ci#define SQ_VSTMP_RING_ITEMSIZE				0x28910
176062306a36Sopenharmony_ci#define SQ_PSTMP_RING_ITEMSIZE				0x28914
176162306a36Sopenharmony_ci#define SQ_LSTMP_RING_ITEMSIZE				0x28830
176262306a36Sopenharmony_ci#define SQ_HSTMP_RING_ITEMSIZE				0x28834
176362306a36Sopenharmony_ci
176462306a36Sopenharmony_ci#define SQ_GS_VERT_ITEMSIZE				0x2891c
176562306a36Sopenharmony_ci#define SQ_GS_VERT_ITEMSIZE_1				0x28920
176662306a36Sopenharmony_ci#define SQ_GS_VERT_ITEMSIZE_2				0x28924
176762306a36Sopenharmony_ci#define SQ_GS_VERT_ITEMSIZE_3				0x28928
176862306a36Sopenharmony_ci#define SQ_GSVS_RING_OFFSET_1				0x2892c
176962306a36Sopenharmony_ci#define SQ_GSVS_RING_OFFSET_2				0x28930
177062306a36Sopenharmony_ci#define SQ_GSVS_RING_OFFSET_3				0x28934
177162306a36Sopenharmony_ci
177262306a36Sopenharmony_ci#define SQ_ALU_CONST_BUFFER_SIZE_PS_0			0x28140
177362306a36Sopenharmony_ci#define SQ_ALU_CONST_BUFFER_SIZE_HS_0			0x28f80
177462306a36Sopenharmony_ci
177562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_0				0x28940
177662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_1				0x28944
177762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_2				0x28948
177862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_3				0x2894c
177962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_4				0x28950
178062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_5				0x28954
178162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_6				0x28958
178262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_7				0x2895c
178362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_8				0x28960
178462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_9				0x28964
178562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_10			0x28968
178662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_11			0x2896c
178762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_12			0x28970
178862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_13			0x28974
178962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_14			0x28978
179062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_15			0x2897c
179162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_0				0x28980
179262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_1				0x28984
179362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_2				0x28988
179462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_3				0x2898c
179562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_4				0x28990
179662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_5				0x28994
179762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_6				0x28998
179862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_7				0x2899c
179962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_8				0x289a0
180062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_9				0x289a4
180162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_10			0x289a8
180262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_11			0x289ac
180362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_12			0x289b0
180462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_13			0x289b4
180562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_14			0x289b8
180662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_15			0x289bc
180762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_0				0x289c0
180862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_1				0x289c4
180962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_2				0x289c8
181062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_3				0x289cc
181162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_4				0x289d0
181262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_5				0x289d4
181362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_6				0x289d8
181462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_7				0x289dc
181562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_8				0x289e0
181662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_9				0x289e4
181762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_10			0x289e8
181862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_11			0x289ec
181962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_12			0x289f0
182062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_13			0x289f4
182162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_14			0x289f8
182262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_15			0x289fc
182362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_0				0x28f00
182462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_1				0x28f04
182562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_2				0x28f08
182662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_3				0x28f0c
182762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_4				0x28f10
182862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_5				0x28f14
182962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_6				0x28f18
183062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_7				0x28f1c
183162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_8				0x28f20
183262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_9				0x28f24
183362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_10			0x28f28
183462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_11			0x28f2c
183562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_12			0x28f30
183662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_13			0x28f34
183762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_14			0x28f38
183862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_HS_15			0x28f3c
183962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_0				0x28f40
184062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_1				0x28f44
184162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_2				0x28f48
184262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_3				0x28f4c
184362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_4				0x28f50
184462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_5				0x28f54
184562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_6				0x28f58
184662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_7				0x28f5c
184762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_8				0x28f60
184862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_9				0x28f64
184962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_10			0x28f68
185062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_11			0x28f6c
185162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_12			0x28f70
185262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_13			0x28f74
185362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_14			0x28f78
185462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_LS_15			0x28f7c
185562306a36Sopenharmony_ci
185662306a36Sopenharmony_ci#define PA_SC_SCREEN_SCISSOR_TL                         0x28030
185762306a36Sopenharmony_ci#define PA_SC_GENERIC_SCISSOR_TL                        0x28240
185862306a36Sopenharmony_ci#define PA_SC_WINDOW_SCISSOR_TL                         0x28204
185962306a36Sopenharmony_ci
186062306a36Sopenharmony_ci#define VGT_PRIMITIVE_TYPE                              0x8958
186162306a36Sopenharmony_ci#define VGT_INDEX_TYPE                                  0x895C
186262306a36Sopenharmony_ci
186362306a36Sopenharmony_ci#define VGT_NUM_INDICES                                 0x8970
186462306a36Sopenharmony_ci
186562306a36Sopenharmony_ci#define VGT_COMPUTE_DIM_X                               0x8990
186662306a36Sopenharmony_ci#define VGT_COMPUTE_DIM_Y                               0x8994
186762306a36Sopenharmony_ci#define VGT_COMPUTE_DIM_Z                               0x8998
186862306a36Sopenharmony_ci#define VGT_COMPUTE_START_X                             0x899C
186962306a36Sopenharmony_ci#define VGT_COMPUTE_START_Y                             0x89A0
187062306a36Sopenharmony_ci#define VGT_COMPUTE_START_Z                             0x89A4
187162306a36Sopenharmony_ci#define VGT_COMPUTE_INDEX                               0x89A8
187262306a36Sopenharmony_ci#define VGT_COMPUTE_THREAD_GROUP_SIZE                   0x89AC
187362306a36Sopenharmony_ci#define VGT_HS_OFFCHIP_PARAM                            0x89B0
187462306a36Sopenharmony_ci
187562306a36Sopenharmony_ci#define DB_DEBUG					0x9830
187662306a36Sopenharmony_ci#define DB_DEBUG2					0x9834
187762306a36Sopenharmony_ci#define DB_DEBUG3					0x9838
187862306a36Sopenharmony_ci#define DB_DEBUG4					0x983C
187962306a36Sopenharmony_ci#define DB_WATERMARKS					0x9854
188062306a36Sopenharmony_ci#define DB_DEPTH_CONTROL				0x28800
188162306a36Sopenharmony_ci#define R_028800_DB_DEPTH_CONTROL                    0x028800
188262306a36Sopenharmony_ci#define   S_028800_STENCIL_ENABLE(x)                   (((x) & 0x1) << 0)
188362306a36Sopenharmony_ci#define   G_028800_STENCIL_ENABLE(x)                   (((x) >> 0) & 0x1)
188462306a36Sopenharmony_ci#define   C_028800_STENCIL_ENABLE                      0xFFFFFFFE
188562306a36Sopenharmony_ci#define   S_028800_Z_ENABLE(x)                         (((x) & 0x1) << 1)
188662306a36Sopenharmony_ci#define   G_028800_Z_ENABLE(x)                         (((x) >> 1) & 0x1)
188762306a36Sopenharmony_ci#define   C_028800_Z_ENABLE                            0xFFFFFFFD
188862306a36Sopenharmony_ci#define   S_028800_Z_WRITE_ENABLE(x)                   (((x) & 0x1) << 2)
188962306a36Sopenharmony_ci#define   G_028800_Z_WRITE_ENABLE(x)                   (((x) >> 2) & 0x1)
189062306a36Sopenharmony_ci#define   C_028800_Z_WRITE_ENABLE                      0xFFFFFFFB
189162306a36Sopenharmony_ci#define   S_028800_ZFUNC(x)                            (((x) & 0x7) << 4)
189262306a36Sopenharmony_ci#define   G_028800_ZFUNC(x)                            (((x) >> 4) & 0x7)
189362306a36Sopenharmony_ci#define   C_028800_ZFUNC                               0xFFFFFF8F
189462306a36Sopenharmony_ci#define   S_028800_BACKFACE_ENABLE(x)                  (((x) & 0x1) << 7)
189562306a36Sopenharmony_ci#define   G_028800_BACKFACE_ENABLE(x)                  (((x) >> 7) & 0x1)
189662306a36Sopenharmony_ci#define   C_028800_BACKFACE_ENABLE                     0xFFFFFF7F
189762306a36Sopenharmony_ci#define   S_028800_STENCILFUNC(x)                      (((x) & 0x7) << 8)
189862306a36Sopenharmony_ci#define   G_028800_STENCILFUNC(x)                      (((x) >> 8) & 0x7)
189962306a36Sopenharmony_ci#define   C_028800_STENCILFUNC                         0xFFFFF8FF
190062306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_NEVER                 0x00000000
190162306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_LESS                  0x00000001
190262306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_EQUAL                 0x00000002
190362306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_LEQUAL                0x00000003
190462306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_GREATER               0x00000004
190562306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_NOTEQUAL              0x00000005
190662306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_GEQUAL                0x00000006
190762306a36Sopenharmony_ci#define     V_028800_STENCILFUNC_ALWAYS                0x00000007
190862306a36Sopenharmony_ci#define   S_028800_STENCILFAIL(x)                      (((x) & 0x7) << 11)
190962306a36Sopenharmony_ci#define   G_028800_STENCILFAIL(x)                      (((x) >> 11) & 0x7)
191062306a36Sopenharmony_ci#define   C_028800_STENCILFAIL                         0xFFFFC7FF
191162306a36Sopenharmony_ci#define     V_028800_STENCIL_KEEP                      0x00000000
191262306a36Sopenharmony_ci#define     V_028800_STENCIL_ZERO                      0x00000001
191362306a36Sopenharmony_ci#define     V_028800_STENCIL_REPLACE                   0x00000002
191462306a36Sopenharmony_ci#define     V_028800_STENCIL_INCR                      0x00000003
191562306a36Sopenharmony_ci#define     V_028800_STENCIL_DECR                      0x00000004
191662306a36Sopenharmony_ci#define     V_028800_STENCIL_INVERT                    0x00000005
191762306a36Sopenharmony_ci#define     V_028800_STENCIL_INCR_WRAP                 0x00000006
191862306a36Sopenharmony_ci#define     V_028800_STENCIL_DECR_WRAP                 0x00000007
191962306a36Sopenharmony_ci#define   S_028800_STENCILZPASS(x)                     (((x) & 0x7) << 14)
192062306a36Sopenharmony_ci#define   G_028800_STENCILZPASS(x)                     (((x) >> 14) & 0x7)
192162306a36Sopenharmony_ci#define   C_028800_STENCILZPASS                        0xFFFE3FFF
192262306a36Sopenharmony_ci#define   S_028800_STENCILZFAIL(x)                     (((x) & 0x7) << 17)
192362306a36Sopenharmony_ci#define   G_028800_STENCILZFAIL(x)                     (((x) >> 17) & 0x7)
192462306a36Sopenharmony_ci#define   C_028800_STENCILZFAIL                        0xFFF1FFFF
192562306a36Sopenharmony_ci#define   S_028800_STENCILFUNC_BF(x)                   (((x) & 0x7) << 20)
192662306a36Sopenharmony_ci#define   G_028800_STENCILFUNC_BF(x)                   (((x) >> 20) & 0x7)
192762306a36Sopenharmony_ci#define   C_028800_STENCILFUNC_BF                      0xFF8FFFFF
192862306a36Sopenharmony_ci#define   S_028800_STENCILFAIL_BF(x)                   (((x) & 0x7) << 23)
192962306a36Sopenharmony_ci#define   G_028800_STENCILFAIL_BF(x)                   (((x) >> 23) & 0x7)
193062306a36Sopenharmony_ci#define   C_028800_STENCILFAIL_BF                      0xFC7FFFFF
193162306a36Sopenharmony_ci#define   S_028800_STENCILZPASS_BF(x)                  (((x) & 0x7) << 26)
193262306a36Sopenharmony_ci#define   G_028800_STENCILZPASS_BF(x)                  (((x) >> 26) & 0x7)
193362306a36Sopenharmony_ci#define   C_028800_STENCILZPASS_BF                     0xE3FFFFFF
193462306a36Sopenharmony_ci#define   S_028800_STENCILZFAIL_BF(x)                  (((x) & 0x7) << 29)
193562306a36Sopenharmony_ci#define   G_028800_STENCILZFAIL_BF(x)                  (((x) >> 29) & 0x7)
193662306a36Sopenharmony_ci#define   C_028800_STENCILZFAIL_BF                     0x1FFFFFFF
193762306a36Sopenharmony_ci#define DB_DEPTH_VIEW					0x28008
193862306a36Sopenharmony_ci#define R_028008_DB_DEPTH_VIEW                       0x00028008
193962306a36Sopenharmony_ci#define   S_028008_SLICE_START(x)                      (((x) & 0x7FF) << 0)
194062306a36Sopenharmony_ci#define   G_028008_SLICE_START(x)                      (((x) >> 0) & 0x7FF)
194162306a36Sopenharmony_ci#define   C_028008_SLICE_START                         0xFFFFF800
194262306a36Sopenharmony_ci#define   S_028008_SLICE_MAX(x)                        (((x) & 0x7FF) << 13)
194362306a36Sopenharmony_ci#define   G_028008_SLICE_MAX(x)                        (((x) >> 13) & 0x7FF)
194462306a36Sopenharmony_ci#define   C_028008_SLICE_MAX                           0xFF001FFF
194562306a36Sopenharmony_ci#define DB_HTILE_DATA_BASE				0x28014
194662306a36Sopenharmony_ci#define DB_HTILE_SURFACE				0x28abc
194762306a36Sopenharmony_ci#define   S_028ABC_HTILE_WIDTH(x)                      (((x) & 0x1) << 0)
194862306a36Sopenharmony_ci#define   G_028ABC_HTILE_WIDTH(x)                      (((x) >> 0) & 0x1)
194962306a36Sopenharmony_ci#define   C_028ABC_HTILE_WIDTH                         0xFFFFFFFE
195062306a36Sopenharmony_ci#define   S_028ABC_HTILE_HEIGHT(x)                      (((x) & 0x1) << 1)
195162306a36Sopenharmony_ci#define   G_028ABC_HTILE_HEIGHT(x)                      (((x) >> 1) & 0x1)
195262306a36Sopenharmony_ci#define   C_028ABC_HTILE_HEIGHT                         0xFFFFFFFD
195362306a36Sopenharmony_ci#define   G_028ABC_LINEAR(x)                           (((x) >> 2) & 0x1)
195462306a36Sopenharmony_ci#define DB_Z_INFO					0x28040
195562306a36Sopenharmony_ci#       define Z_ARRAY_MODE(x)                          ((x) << 4)
195662306a36Sopenharmony_ci#       define DB_TILE_SPLIT(x)                         (((x) & 0x7) << 8)
195762306a36Sopenharmony_ci#       define DB_NUM_BANKS(x)                          (((x) & 0x3) << 12)
195862306a36Sopenharmony_ci#       define DB_BANK_WIDTH(x)                         (((x) & 0x3) << 16)
195962306a36Sopenharmony_ci#       define DB_BANK_HEIGHT(x)                        (((x) & 0x3) << 20)
196062306a36Sopenharmony_ci#       define DB_MACRO_TILE_ASPECT(x)                  (((x) & 0x3) << 24)
196162306a36Sopenharmony_ci#define R_028040_DB_Z_INFO                       0x028040
196262306a36Sopenharmony_ci#define   S_028040_FORMAT(x)                           (((x) & 0x3) << 0)
196362306a36Sopenharmony_ci#define   G_028040_FORMAT(x)                           (((x) >> 0) & 0x3)
196462306a36Sopenharmony_ci#define   C_028040_FORMAT                              0xFFFFFFFC
196562306a36Sopenharmony_ci#define     V_028040_Z_INVALID                     0x00000000
196662306a36Sopenharmony_ci#define     V_028040_Z_16                          0x00000001
196762306a36Sopenharmony_ci#define     V_028040_Z_24                          0x00000002
196862306a36Sopenharmony_ci#define     V_028040_Z_32_FLOAT                    0x00000003
196962306a36Sopenharmony_ci#define   S_028040_ARRAY_MODE(x)                       (((x) & 0xF) << 4)
197062306a36Sopenharmony_ci#define   G_028040_ARRAY_MODE(x)                       (((x) >> 4) & 0xF)
197162306a36Sopenharmony_ci#define   C_028040_ARRAY_MODE                          0xFFFFFF0F
197262306a36Sopenharmony_ci#define   S_028040_READ_SIZE(x)                        (((x) & 0x1) << 28)
197362306a36Sopenharmony_ci#define   G_028040_READ_SIZE(x)                        (((x) >> 28) & 0x1)
197462306a36Sopenharmony_ci#define   C_028040_READ_SIZE                           0xEFFFFFFF
197562306a36Sopenharmony_ci#define   S_028040_TILE_SURFACE_ENABLE(x)              (((x) & 0x1) << 29)
197662306a36Sopenharmony_ci#define   G_028040_TILE_SURFACE_ENABLE(x)              (((x) >> 29) & 0x1)
197762306a36Sopenharmony_ci#define   C_028040_TILE_SURFACE_ENABLE                 0xDFFFFFFF
197862306a36Sopenharmony_ci#define   S_028040_ZRANGE_PRECISION(x)                 (((x) & 0x1) << 31)
197962306a36Sopenharmony_ci#define   G_028040_ZRANGE_PRECISION(x)                 (((x) >> 31) & 0x1)
198062306a36Sopenharmony_ci#define   C_028040_ZRANGE_PRECISION                    0x7FFFFFFF
198162306a36Sopenharmony_ci#define   S_028040_TILE_SPLIT(x)                       (((x) & 0x7) << 8)
198262306a36Sopenharmony_ci#define   G_028040_TILE_SPLIT(x)                       (((x) >> 8) & 0x7)
198362306a36Sopenharmony_ci#define   S_028040_NUM_BANKS(x)                        (((x) & 0x3) << 12)
198462306a36Sopenharmony_ci#define   G_028040_NUM_BANKS(x)                        (((x) >> 12) & 0x3)
198562306a36Sopenharmony_ci#define   S_028040_BANK_WIDTH(x)                       (((x) & 0x3) << 16)
198662306a36Sopenharmony_ci#define   G_028040_BANK_WIDTH(x)                       (((x) >> 16) & 0x3)
198762306a36Sopenharmony_ci#define   S_028040_BANK_HEIGHT(x)                      (((x) & 0x3) << 20)
198862306a36Sopenharmony_ci#define   G_028040_BANK_HEIGHT(x)                      (((x) >> 20) & 0x3)
198962306a36Sopenharmony_ci#define   S_028040_MACRO_TILE_ASPECT(x)                (((x) & 0x3) << 24)
199062306a36Sopenharmony_ci#define   G_028040_MACRO_TILE_ASPECT(x)                (((x) >> 24) & 0x3)
199162306a36Sopenharmony_ci#define DB_STENCIL_INFO					0x28044
199262306a36Sopenharmony_ci#define R_028044_DB_STENCIL_INFO                     0x028044
199362306a36Sopenharmony_ci#define   S_028044_FORMAT(x)                           (((x) & 0x1) << 0)
199462306a36Sopenharmony_ci#define   G_028044_FORMAT(x)                           (((x) >> 0) & 0x1)
199562306a36Sopenharmony_ci#define   C_028044_FORMAT                              0xFFFFFFFE
199662306a36Sopenharmony_ci#define	    V_028044_STENCIL_INVALID			0
199762306a36Sopenharmony_ci#define	    V_028044_STENCIL_8				1
199862306a36Sopenharmony_ci#define   G_028044_TILE_SPLIT(x)                       (((x) >> 8) & 0x7)
199962306a36Sopenharmony_ci#define DB_Z_READ_BASE					0x28048
200062306a36Sopenharmony_ci#define DB_STENCIL_READ_BASE				0x2804c
200162306a36Sopenharmony_ci#define DB_Z_WRITE_BASE					0x28050
200262306a36Sopenharmony_ci#define DB_STENCIL_WRITE_BASE				0x28054
200362306a36Sopenharmony_ci#define DB_DEPTH_SIZE					0x28058
200462306a36Sopenharmony_ci#define R_028058_DB_DEPTH_SIZE                       0x028058
200562306a36Sopenharmony_ci#define   S_028058_PITCH_TILE_MAX(x)                   (((x) & 0x7FF) << 0)
200662306a36Sopenharmony_ci#define   G_028058_PITCH_TILE_MAX(x)                   (((x) >> 0) & 0x7FF)
200762306a36Sopenharmony_ci#define   C_028058_PITCH_TILE_MAX                      0xFFFFF800
200862306a36Sopenharmony_ci#define   S_028058_HEIGHT_TILE_MAX(x)                   (((x) & 0x7FF) << 11)
200962306a36Sopenharmony_ci#define   G_028058_HEIGHT_TILE_MAX(x)                   (((x) >> 11) & 0x7FF)
201062306a36Sopenharmony_ci#define   C_028058_HEIGHT_TILE_MAX                      0xFFC007FF
201162306a36Sopenharmony_ci#define R_02805C_DB_DEPTH_SLICE                      0x02805C
201262306a36Sopenharmony_ci#define   S_02805C_SLICE_TILE_MAX(x)                   (((x) & 0x3FFFFF) << 0)
201362306a36Sopenharmony_ci#define   G_02805C_SLICE_TILE_MAX(x)                   (((x) >> 0) & 0x3FFFFF)
201462306a36Sopenharmony_ci#define   C_02805C_SLICE_TILE_MAX                      0xFFC00000
201562306a36Sopenharmony_ci
201662306a36Sopenharmony_ci#define SQ_PGM_START_PS					0x28840
201762306a36Sopenharmony_ci#define SQ_PGM_START_VS					0x2885c
201862306a36Sopenharmony_ci#define SQ_PGM_START_GS					0x28874
201962306a36Sopenharmony_ci#define SQ_PGM_START_ES					0x2888c
202062306a36Sopenharmony_ci#define SQ_PGM_START_FS					0x288a4
202162306a36Sopenharmony_ci#define SQ_PGM_START_HS					0x288b8
202262306a36Sopenharmony_ci#define SQ_PGM_START_LS					0x288d0
202362306a36Sopenharmony_ci
202462306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_0			0x28AD8
202562306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_1			0x28AE8
202662306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_2			0x28AF8
202762306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_3			0x28B08
202862306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_0			0x28AD0
202962306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_1			0x28AE0
203062306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_2			0x28AF0
203162306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_3			0x28B00
203262306a36Sopenharmony_ci#define VGT_STRMOUT_CONFIG				0x28b94
203362306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_CONFIG			0x28b98
203462306a36Sopenharmony_ci
203562306a36Sopenharmony_ci#define CB_TARGET_MASK					0x28238
203662306a36Sopenharmony_ci#define CB_SHADER_MASK					0x2823c
203762306a36Sopenharmony_ci
203862306a36Sopenharmony_ci#define GDS_ADDR_BASE					0x28720
203962306a36Sopenharmony_ci
204062306a36Sopenharmony_ci#define GDS_APPEND_COUNT_0				0x2872C
204162306a36Sopenharmony_ci#define GDS_APPEND_COUNT_1				0x28730
204262306a36Sopenharmony_ci#define GDS_APPEND_COUNT_2				0x28734
204362306a36Sopenharmony_ci#define GDS_APPEND_COUNT_3				0x28738
204462306a36Sopenharmony_ci#define GDS_APPEND_COUNT_4				0x2873C
204562306a36Sopenharmony_ci#define GDS_APPEND_COUNT_5				0x28740
204662306a36Sopenharmony_ci#define GDS_APPEND_COUNT_6				0x28744
204762306a36Sopenharmony_ci#define GDS_APPEND_COUNT_7				0x28748
204862306a36Sopenharmony_ci#define GDS_APPEND_COUNT_8				0x2874c
204962306a36Sopenharmony_ci#define GDS_APPEND_COUNT_9				0x28750
205062306a36Sopenharmony_ci#define GDS_APPEND_COUNT_10				0x28754
205162306a36Sopenharmony_ci#define GDS_APPEND_COUNT_11				0x28758
205262306a36Sopenharmony_ci
205362306a36Sopenharmony_ci#define	CB_IMMED0_BASE					0x28b9c
205462306a36Sopenharmony_ci#define	CB_IMMED1_BASE					0x28ba0
205562306a36Sopenharmony_ci#define	CB_IMMED2_BASE					0x28ba4
205662306a36Sopenharmony_ci#define	CB_IMMED3_BASE					0x28ba8
205762306a36Sopenharmony_ci#define	CB_IMMED4_BASE					0x28bac
205862306a36Sopenharmony_ci#define	CB_IMMED5_BASE					0x28bb0
205962306a36Sopenharmony_ci#define	CB_IMMED6_BASE					0x28bb4
206062306a36Sopenharmony_ci#define	CB_IMMED7_BASE					0x28bb8
206162306a36Sopenharmony_ci#define	CB_IMMED8_BASE					0x28bbc
206262306a36Sopenharmony_ci#define	CB_IMMED9_BASE					0x28bc0
206362306a36Sopenharmony_ci#define	CB_IMMED10_BASE					0x28bc4
206462306a36Sopenharmony_ci#define	CB_IMMED11_BASE					0x28bc8
206562306a36Sopenharmony_ci
206662306a36Sopenharmony_ci/* all 12 CB blocks have these regs */
206762306a36Sopenharmony_ci#define	CB_COLOR0_BASE					0x28c60
206862306a36Sopenharmony_ci#define	CB_COLOR0_PITCH					0x28c64
206962306a36Sopenharmony_ci#define	CB_COLOR0_SLICE					0x28c68
207062306a36Sopenharmony_ci#define	CB_COLOR0_VIEW					0x28c6c
207162306a36Sopenharmony_ci#define R_028C6C_CB_COLOR0_VIEW                      0x00028C6C
207262306a36Sopenharmony_ci#define   S_028C6C_SLICE_START(x)                      (((x) & 0x7FF) << 0)
207362306a36Sopenharmony_ci#define   G_028C6C_SLICE_START(x)                      (((x) >> 0) & 0x7FF)
207462306a36Sopenharmony_ci#define   C_028C6C_SLICE_START                         0xFFFFF800
207562306a36Sopenharmony_ci#define   S_028C6C_SLICE_MAX(x)                        (((x) & 0x7FF) << 13)
207662306a36Sopenharmony_ci#define   G_028C6C_SLICE_MAX(x)                        (((x) >> 13) & 0x7FF)
207762306a36Sopenharmony_ci#define   C_028C6C_SLICE_MAX                           0xFF001FFF
207862306a36Sopenharmony_ci#define R_028C70_CB_COLOR0_INFO                      0x028C70
207962306a36Sopenharmony_ci#define   S_028C70_ENDIAN(x)                           (((x) & 0x3) << 0)
208062306a36Sopenharmony_ci#define   G_028C70_ENDIAN(x)                           (((x) >> 0) & 0x3)
208162306a36Sopenharmony_ci#define   C_028C70_ENDIAN                              0xFFFFFFFC
208262306a36Sopenharmony_ci#define   S_028C70_FORMAT(x)                           (((x) & 0x3F) << 2)
208362306a36Sopenharmony_ci#define   G_028C70_FORMAT(x)                           (((x) >> 2) & 0x3F)
208462306a36Sopenharmony_ci#define   C_028C70_FORMAT                              0xFFFFFF03
208562306a36Sopenharmony_ci#define     V_028C70_COLOR_INVALID                     0x00000000
208662306a36Sopenharmony_ci#define     V_028C70_COLOR_8                           0x00000001
208762306a36Sopenharmony_ci#define     V_028C70_COLOR_4_4                         0x00000002
208862306a36Sopenharmony_ci#define     V_028C70_COLOR_3_3_2                       0x00000003
208962306a36Sopenharmony_ci#define     V_028C70_COLOR_16                          0x00000005
209062306a36Sopenharmony_ci#define     V_028C70_COLOR_16_FLOAT                    0x00000006
209162306a36Sopenharmony_ci#define     V_028C70_COLOR_8_8                         0x00000007
209262306a36Sopenharmony_ci#define     V_028C70_COLOR_5_6_5                       0x00000008
209362306a36Sopenharmony_ci#define     V_028C70_COLOR_6_5_5                       0x00000009
209462306a36Sopenharmony_ci#define     V_028C70_COLOR_1_5_5_5                     0x0000000A
209562306a36Sopenharmony_ci#define     V_028C70_COLOR_4_4_4_4                     0x0000000B
209662306a36Sopenharmony_ci#define     V_028C70_COLOR_5_5_5_1                     0x0000000C
209762306a36Sopenharmony_ci#define     V_028C70_COLOR_32                          0x0000000D
209862306a36Sopenharmony_ci#define     V_028C70_COLOR_32_FLOAT                    0x0000000E
209962306a36Sopenharmony_ci#define     V_028C70_COLOR_16_16                       0x0000000F
210062306a36Sopenharmony_ci#define     V_028C70_COLOR_16_16_FLOAT                 0x00000010
210162306a36Sopenharmony_ci#define     V_028C70_COLOR_8_24                        0x00000011
210262306a36Sopenharmony_ci#define     V_028C70_COLOR_8_24_FLOAT                  0x00000012
210362306a36Sopenharmony_ci#define     V_028C70_COLOR_24_8                        0x00000013
210462306a36Sopenharmony_ci#define     V_028C70_COLOR_24_8_FLOAT                  0x00000014
210562306a36Sopenharmony_ci#define     V_028C70_COLOR_10_11_11                    0x00000015
210662306a36Sopenharmony_ci#define     V_028C70_COLOR_10_11_11_FLOAT              0x00000016
210762306a36Sopenharmony_ci#define     V_028C70_COLOR_11_11_10                    0x00000017
210862306a36Sopenharmony_ci#define     V_028C70_COLOR_11_11_10_FLOAT              0x00000018
210962306a36Sopenharmony_ci#define     V_028C70_COLOR_2_10_10_10                  0x00000019
211062306a36Sopenharmony_ci#define     V_028C70_COLOR_8_8_8_8                     0x0000001A
211162306a36Sopenharmony_ci#define     V_028C70_COLOR_10_10_10_2                  0x0000001B
211262306a36Sopenharmony_ci#define     V_028C70_COLOR_X24_8_32_FLOAT              0x0000001C
211362306a36Sopenharmony_ci#define     V_028C70_COLOR_32_32                       0x0000001D
211462306a36Sopenharmony_ci#define     V_028C70_COLOR_32_32_FLOAT                 0x0000001E
211562306a36Sopenharmony_ci#define     V_028C70_COLOR_16_16_16_16                 0x0000001F
211662306a36Sopenharmony_ci#define     V_028C70_COLOR_16_16_16_16_FLOAT           0x00000020
211762306a36Sopenharmony_ci#define     V_028C70_COLOR_32_32_32_32                 0x00000022
211862306a36Sopenharmony_ci#define     V_028C70_COLOR_32_32_32_32_FLOAT           0x00000023
211962306a36Sopenharmony_ci#define     V_028C70_COLOR_32_32_32_FLOAT              0x00000030
212062306a36Sopenharmony_ci#define   S_028C70_ARRAY_MODE(x)                       (((x) & 0xF) << 8)
212162306a36Sopenharmony_ci#define   G_028C70_ARRAY_MODE(x)                       (((x) >> 8) & 0xF)
212262306a36Sopenharmony_ci#define   C_028C70_ARRAY_MODE                          0xFFFFF0FF
212362306a36Sopenharmony_ci#define     V_028C70_ARRAY_LINEAR_GENERAL              0x00000000
212462306a36Sopenharmony_ci#define     V_028C70_ARRAY_LINEAR_ALIGNED              0x00000001
212562306a36Sopenharmony_ci#define     V_028C70_ARRAY_1D_TILED_THIN1              0x00000002
212662306a36Sopenharmony_ci#define     V_028C70_ARRAY_2D_TILED_THIN1              0x00000004
212762306a36Sopenharmony_ci#define   S_028C70_NUMBER_TYPE(x)                      (((x) & 0x7) << 12)
212862306a36Sopenharmony_ci#define   G_028C70_NUMBER_TYPE(x)                      (((x) >> 12) & 0x7)
212962306a36Sopenharmony_ci#define   C_028C70_NUMBER_TYPE                         0xFFFF8FFF
213062306a36Sopenharmony_ci#define     V_028C70_NUMBER_UNORM                      0x00000000
213162306a36Sopenharmony_ci#define     V_028C70_NUMBER_SNORM                      0x00000001
213262306a36Sopenharmony_ci#define     V_028C70_NUMBER_USCALED                    0x00000002
213362306a36Sopenharmony_ci#define     V_028C70_NUMBER_SSCALED                    0x00000003
213462306a36Sopenharmony_ci#define     V_028C70_NUMBER_UINT                       0x00000004
213562306a36Sopenharmony_ci#define     V_028C70_NUMBER_SINT                       0x00000005
213662306a36Sopenharmony_ci#define     V_028C70_NUMBER_SRGB                       0x00000006
213762306a36Sopenharmony_ci#define     V_028C70_NUMBER_FLOAT                      0x00000007
213862306a36Sopenharmony_ci#define   S_028C70_COMP_SWAP(x)                        (((x) & 0x3) << 15)
213962306a36Sopenharmony_ci#define   G_028C70_COMP_SWAP(x)                        (((x) >> 15) & 0x3)
214062306a36Sopenharmony_ci#define   C_028C70_COMP_SWAP                           0xFFFE7FFF
214162306a36Sopenharmony_ci#define     V_028C70_SWAP_STD                          0x00000000
214262306a36Sopenharmony_ci#define     V_028C70_SWAP_ALT                          0x00000001
214362306a36Sopenharmony_ci#define     V_028C70_SWAP_STD_REV                      0x00000002
214462306a36Sopenharmony_ci#define     V_028C70_SWAP_ALT_REV                      0x00000003
214562306a36Sopenharmony_ci#define   S_028C70_FAST_CLEAR(x)                       (((x) & 0x1) << 17)
214662306a36Sopenharmony_ci#define   G_028C70_FAST_CLEAR(x)                       (((x) >> 17) & 0x1)
214762306a36Sopenharmony_ci#define   C_028C70_FAST_CLEAR                          0xFFFDFFFF
214862306a36Sopenharmony_ci#define   S_028C70_COMPRESSION(x)                      (((x) & 0x3) << 18)
214962306a36Sopenharmony_ci#define   G_028C70_COMPRESSION(x)                      (((x) >> 18) & 0x3)
215062306a36Sopenharmony_ci#define   C_028C70_COMPRESSION                         0xFFF3FFFF
215162306a36Sopenharmony_ci#define   S_028C70_BLEND_CLAMP(x)                      (((x) & 0x1) << 19)
215262306a36Sopenharmony_ci#define   G_028C70_BLEND_CLAMP(x)                      (((x) >> 19) & 0x1)
215362306a36Sopenharmony_ci#define   C_028C70_BLEND_CLAMP                         0xFFF7FFFF
215462306a36Sopenharmony_ci#define   S_028C70_BLEND_BYPASS(x)                     (((x) & 0x1) << 20)
215562306a36Sopenharmony_ci#define   G_028C70_BLEND_BYPASS(x)                     (((x) >> 20) & 0x1)
215662306a36Sopenharmony_ci#define   C_028C70_BLEND_BYPASS                        0xFFEFFFFF
215762306a36Sopenharmony_ci#define   S_028C70_SIMPLE_FLOAT(x)                     (((x) & 0x1) << 21)
215862306a36Sopenharmony_ci#define   G_028C70_SIMPLE_FLOAT(x)                     (((x) >> 21) & 0x1)
215962306a36Sopenharmony_ci#define   C_028C70_SIMPLE_FLOAT                        0xFFDFFFFF
216062306a36Sopenharmony_ci#define   S_028C70_ROUND_MODE(x)                       (((x) & 0x1) << 22)
216162306a36Sopenharmony_ci#define   G_028C70_ROUND_MODE(x)                       (((x) >> 22) & 0x1)
216262306a36Sopenharmony_ci#define   C_028C70_ROUND_MODE                          0xFFBFFFFF
216362306a36Sopenharmony_ci#define   S_028C70_TILE_COMPACT(x)                     (((x) & 0x1) << 23)
216462306a36Sopenharmony_ci#define   G_028C70_TILE_COMPACT(x)                     (((x) >> 23) & 0x1)
216562306a36Sopenharmony_ci#define   C_028C70_TILE_COMPACT                        0xFF7FFFFF
216662306a36Sopenharmony_ci#define   S_028C70_SOURCE_FORMAT(x)                    (((x) & 0x3) << 24)
216762306a36Sopenharmony_ci#define   G_028C70_SOURCE_FORMAT(x)                    (((x) >> 24) & 0x3)
216862306a36Sopenharmony_ci#define   C_028C70_SOURCE_FORMAT                       0xFCFFFFFF
216962306a36Sopenharmony_ci#define     V_028C70_EXPORT_4C_32BPC                   0x0
217062306a36Sopenharmony_ci#define     V_028C70_EXPORT_4C_16BPC                   0x1
217162306a36Sopenharmony_ci#define     V_028C70_EXPORT_2C_32BPC                   0x2 /* Do not use */
217262306a36Sopenharmony_ci#define   S_028C70_RAT(x)                              (((x) & 0x1) << 26)
217362306a36Sopenharmony_ci#define   G_028C70_RAT(x)                              (((x) >> 26) & 0x1)
217462306a36Sopenharmony_ci#define   C_028C70_RAT                                 0xFBFFFFFF
217562306a36Sopenharmony_ci#define   S_028C70_RESOURCE_TYPE(x)                    (((x) & 0x7) << 27)
217662306a36Sopenharmony_ci#define   G_028C70_RESOURCE_TYPE(x)                    (((x) >> 27) & 0x7)
217762306a36Sopenharmony_ci#define   C_028C70_RESOURCE_TYPE                       0xC7FFFFFF
217862306a36Sopenharmony_ci
217962306a36Sopenharmony_ci#define	CB_COLOR0_INFO					0x28c70
218062306a36Sopenharmony_ci#	define CB_FORMAT(x)				((x) << 2)
218162306a36Sopenharmony_ci#       define CB_ARRAY_MODE(x)                         ((x) << 8)
218262306a36Sopenharmony_ci#       define ARRAY_LINEAR_GENERAL                     0
218362306a36Sopenharmony_ci#       define ARRAY_LINEAR_ALIGNED                     1
218462306a36Sopenharmony_ci#       define ARRAY_1D_TILED_THIN1                     2
218562306a36Sopenharmony_ci#       define ARRAY_2D_TILED_THIN1                     4
218662306a36Sopenharmony_ci#	define CB_SOURCE_FORMAT(x)			((x) << 24)
218762306a36Sopenharmony_ci#	define CB_SF_EXPORT_FULL			0
218862306a36Sopenharmony_ci#	define CB_SF_EXPORT_NORM			1
218962306a36Sopenharmony_ci#define R_028C74_CB_COLOR0_ATTRIB                      0x028C74
219062306a36Sopenharmony_ci#define   S_028C74_NON_DISP_TILING_ORDER(x)            (((x) & 0x1) << 4)
219162306a36Sopenharmony_ci#define   G_028C74_NON_DISP_TILING_ORDER(x)            (((x) >> 4) & 0x1)
219262306a36Sopenharmony_ci#define   C_028C74_NON_DISP_TILING_ORDER               0xFFFFFFEF
219362306a36Sopenharmony_ci#define   S_028C74_TILE_SPLIT(x)                       (((x) & 0xf) << 5)
219462306a36Sopenharmony_ci#define   G_028C74_TILE_SPLIT(x)                       (((x) >> 5) & 0xf)
219562306a36Sopenharmony_ci#define   S_028C74_NUM_BANKS(x)                        (((x) & 0x3) << 10)
219662306a36Sopenharmony_ci#define   G_028C74_NUM_BANKS(x)                        (((x) >> 10) & 0x3)
219762306a36Sopenharmony_ci#define   S_028C74_BANK_WIDTH(x)                       (((x) & 0x3) << 13)
219862306a36Sopenharmony_ci#define   G_028C74_BANK_WIDTH(x)                       (((x) >> 13) & 0x3)
219962306a36Sopenharmony_ci#define   S_028C74_BANK_HEIGHT(x)                      (((x) & 0x3) << 16)
220062306a36Sopenharmony_ci#define   G_028C74_BANK_HEIGHT(x)                      (((x) >> 16) & 0x3)
220162306a36Sopenharmony_ci#define   S_028C74_MACRO_TILE_ASPECT(x)                (((x) & 0x3) << 19)
220262306a36Sopenharmony_ci#define   G_028C74_MACRO_TILE_ASPECT(x)                (((x) >> 19) & 0x3)
220362306a36Sopenharmony_ci#define	CB_COLOR0_ATTRIB				0x28c74
220462306a36Sopenharmony_ci#       define CB_TILE_SPLIT(x)                         (((x) & 0x7) << 5)
220562306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_64B                 0
220662306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_128B                1
220762306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_256B                2
220862306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_512B                3
220962306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_1KB                 4
221062306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_2KB                 5
221162306a36Sopenharmony_ci#       define ADDR_SURF_TILE_SPLIT_4KB                 6
221262306a36Sopenharmony_ci#       define CB_NUM_BANKS(x)                          (((x) & 0x3) << 10)
221362306a36Sopenharmony_ci#       define ADDR_SURF_2_BANK                         0
221462306a36Sopenharmony_ci#       define ADDR_SURF_4_BANK                         1
221562306a36Sopenharmony_ci#       define ADDR_SURF_8_BANK                         2
221662306a36Sopenharmony_ci#       define ADDR_SURF_16_BANK                        3
221762306a36Sopenharmony_ci#       define CB_BANK_WIDTH(x)                         (((x) & 0x3) << 13)
221862306a36Sopenharmony_ci#       define ADDR_SURF_BANK_WIDTH_1                   0
221962306a36Sopenharmony_ci#       define ADDR_SURF_BANK_WIDTH_2                   1
222062306a36Sopenharmony_ci#       define ADDR_SURF_BANK_WIDTH_4                   2
222162306a36Sopenharmony_ci#       define ADDR_SURF_BANK_WIDTH_8                   3
222262306a36Sopenharmony_ci#       define CB_BANK_HEIGHT(x)                        (((x) & 0x3) << 16)
222362306a36Sopenharmony_ci#       define ADDR_SURF_BANK_HEIGHT_1                  0
222462306a36Sopenharmony_ci#       define ADDR_SURF_BANK_HEIGHT_2                  1
222562306a36Sopenharmony_ci#       define ADDR_SURF_BANK_HEIGHT_4                  2
222662306a36Sopenharmony_ci#       define ADDR_SURF_BANK_HEIGHT_8                  3
222762306a36Sopenharmony_ci#       define CB_MACRO_TILE_ASPECT(x)                  (((x) & 0x3) << 19)
222862306a36Sopenharmony_ci#define	CB_COLOR0_DIM					0x28c78
222962306a36Sopenharmony_ci/* only CB0-7 blocks have these regs */
223062306a36Sopenharmony_ci#define	CB_COLOR0_CMASK					0x28c7c
223162306a36Sopenharmony_ci#define	CB_COLOR0_CMASK_SLICE				0x28c80
223262306a36Sopenharmony_ci#define	CB_COLOR0_FMASK					0x28c84
223362306a36Sopenharmony_ci#define	CB_COLOR0_FMASK_SLICE				0x28c88
223462306a36Sopenharmony_ci#define	CB_COLOR0_CLEAR_WORD0				0x28c8c
223562306a36Sopenharmony_ci#define	CB_COLOR0_CLEAR_WORD1				0x28c90
223662306a36Sopenharmony_ci#define	CB_COLOR0_CLEAR_WORD2				0x28c94
223762306a36Sopenharmony_ci#define	CB_COLOR0_CLEAR_WORD3				0x28c98
223862306a36Sopenharmony_ci
223962306a36Sopenharmony_ci#define	CB_COLOR1_BASE					0x28c9c
224062306a36Sopenharmony_ci#define	CB_COLOR2_BASE					0x28cd8
224162306a36Sopenharmony_ci#define	CB_COLOR3_BASE					0x28d14
224262306a36Sopenharmony_ci#define	CB_COLOR4_BASE					0x28d50
224362306a36Sopenharmony_ci#define	CB_COLOR5_BASE					0x28d8c
224462306a36Sopenharmony_ci#define	CB_COLOR6_BASE					0x28dc8
224562306a36Sopenharmony_ci#define	CB_COLOR7_BASE					0x28e04
224662306a36Sopenharmony_ci#define	CB_COLOR8_BASE					0x28e40
224762306a36Sopenharmony_ci#define	CB_COLOR9_BASE					0x28e5c
224862306a36Sopenharmony_ci#define	CB_COLOR10_BASE					0x28e78
224962306a36Sopenharmony_ci#define	CB_COLOR11_BASE					0x28e94
225062306a36Sopenharmony_ci
225162306a36Sopenharmony_ci#define	CB_COLOR1_PITCH					0x28ca0
225262306a36Sopenharmony_ci#define	CB_COLOR2_PITCH					0x28cdc
225362306a36Sopenharmony_ci#define	CB_COLOR3_PITCH					0x28d18
225462306a36Sopenharmony_ci#define	CB_COLOR4_PITCH					0x28d54
225562306a36Sopenharmony_ci#define	CB_COLOR5_PITCH					0x28d90
225662306a36Sopenharmony_ci#define	CB_COLOR6_PITCH					0x28dcc
225762306a36Sopenharmony_ci#define	CB_COLOR7_PITCH					0x28e08
225862306a36Sopenharmony_ci#define	CB_COLOR8_PITCH					0x28e44
225962306a36Sopenharmony_ci#define	CB_COLOR9_PITCH					0x28e60
226062306a36Sopenharmony_ci#define	CB_COLOR10_PITCH				0x28e7c
226162306a36Sopenharmony_ci#define	CB_COLOR11_PITCH				0x28e98
226262306a36Sopenharmony_ci
226362306a36Sopenharmony_ci#define	CB_COLOR1_SLICE					0x28ca4
226462306a36Sopenharmony_ci#define	CB_COLOR2_SLICE					0x28ce0
226562306a36Sopenharmony_ci#define	CB_COLOR3_SLICE					0x28d1c
226662306a36Sopenharmony_ci#define	CB_COLOR4_SLICE					0x28d58
226762306a36Sopenharmony_ci#define	CB_COLOR5_SLICE					0x28d94
226862306a36Sopenharmony_ci#define	CB_COLOR6_SLICE					0x28dd0
226962306a36Sopenharmony_ci#define	CB_COLOR7_SLICE					0x28e0c
227062306a36Sopenharmony_ci#define	CB_COLOR8_SLICE					0x28e48
227162306a36Sopenharmony_ci#define	CB_COLOR9_SLICE					0x28e64
227262306a36Sopenharmony_ci#define	CB_COLOR10_SLICE				0x28e80
227362306a36Sopenharmony_ci#define	CB_COLOR11_SLICE				0x28e9c
227462306a36Sopenharmony_ci
227562306a36Sopenharmony_ci#define	CB_COLOR1_VIEW					0x28ca8
227662306a36Sopenharmony_ci#define	CB_COLOR2_VIEW					0x28ce4
227762306a36Sopenharmony_ci#define	CB_COLOR3_VIEW					0x28d20
227862306a36Sopenharmony_ci#define	CB_COLOR4_VIEW					0x28d5c
227962306a36Sopenharmony_ci#define	CB_COLOR5_VIEW					0x28d98
228062306a36Sopenharmony_ci#define	CB_COLOR6_VIEW					0x28dd4
228162306a36Sopenharmony_ci#define	CB_COLOR7_VIEW					0x28e10
228262306a36Sopenharmony_ci#define	CB_COLOR8_VIEW					0x28e4c
228362306a36Sopenharmony_ci#define	CB_COLOR9_VIEW					0x28e68
228462306a36Sopenharmony_ci#define	CB_COLOR10_VIEW					0x28e84
228562306a36Sopenharmony_ci#define	CB_COLOR11_VIEW					0x28ea0
228662306a36Sopenharmony_ci
228762306a36Sopenharmony_ci#define	CB_COLOR1_INFO					0x28cac
228862306a36Sopenharmony_ci#define	CB_COLOR2_INFO					0x28ce8
228962306a36Sopenharmony_ci#define	CB_COLOR3_INFO					0x28d24
229062306a36Sopenharmony_ci#define	CB_COLOR4_INFO					0x28d60
229162306a36Sopenharmony_ci#define	CB_COLOR5_INFO					0x28d9c
229262306a36Sopenharmony_ci#define	CB_COLOR6_INFO					0x28dd8
229362306a36Sopenharmony_ci#define	CB_COLOR7_INFO					0x28e14
229462306a36Sopenharmony_ci#define	CB_COLOR8_INFO					0x28e50
229562306a36Sopenharmony_ci#define	CB_COLOR9_INFO					0x28e6c
229662306a36Sopenharmony_ci#define	CB_COLOR10_INFO					0x28e88
229762306a36Sopenharmony_ci#define	CB_COLOR11_INFO					0x28ea4
229862306a36Sopenharmony_ci
229962306a36Sopenharmony_ci#define	CB_COLOR1_ATTRIB				0x28cb0
230062306a36Sopenharmony_ci#define	CB_COLOR2_ATTRIB				0x28cec
230162306a36Sopenharmony_ci#define	CB_COLOR3_ATTRIB				0x28d28
230262306a36Sopenharmony_ci#define	CB_COLOR4_ATTRIB				0x28d64
230362306a36Sopenharmony_ci#define	CB_COLOR5_ATTRIB				0x28da0
230462306a36Sopenharmony_ci#define	CB_COLOR6_ATTRIB				0x28ddc
230562306a36Sopenharmony_ci#define	CB_COLOR7_ATTRIB				0x28e18
230662306a36Sopenharmony_ci#define	CB_COLOR8_ATTRIB				0x28e54
230762306a36Sopenharmony_ci#define	CB_COLOR9_ATTRIB				0x28e70
230862306a36Sopenharmony_ci#define	CB_COLOR10_ATTRIB				0x28e8c
230962306a36Sopenharmony_ci#define	CB_COLOR11_ATTRIB				0x28ea8
231062306a36Sopenharmony_ci
231162306a36Sopenharmony_ci#define	CB_COLOR1_DIM					0x28cb4
231262306a36Sopenharmony_ci#define	CB_COLOR2_DIM					0x28cf0
231362306a36Sopenharmony_ci#define	CB_COLOR3_DIM					0x28d2c
231462306a36Sopenharmony_ci#define	CB_COLOR4_DIM					0x28d68
231562306a36Sopenharmony_ci#define	CB_COLOR5_DIM					0x28da4
231662306a36Sopenharmony_ci#define	CB_COLOR6_DIM					0x28de0
231762306a36Sopenharmony_ci#define	CB_COLOR7_DIM					0x28e1c
231862306a36Sopenharmony_ci#define	CB_COLOR8_DIM					0x28e58
231962306a36Sopenharmony_ci#define	CB_COLOR9_DIM					0x28e74
232062306a36Sopenharmony_ci#define	CB_COLOR10_DIM					0x28e90
232162306a36Sopenharmony_ci#define	CB_COLOR11_DIM					0x28eac
232262306a36Sopenharmony_ci
232362306a36Sopenharmony_ci#define	CB_COLOR1_CMASK					0x28cb8
232462306a36Sopenharmony_ci#define	CB_COLOR2_CMASK					0x28cf4
232562306a36Sopenharmony_ci#define	CB_COLOR3_CMASK					0x28d30
232662306a36Sopenharmony_ci#define	CB_COLOR4_CMASK					0x28d6c
232762306a36Sopenharmony_ci#define	CB_COLOR5_CMASK					0x28da8
232862306a36Sopenharmony_ci#define	CB_COLOR6_CMASK					0x28de4
232962306a36Sopenharmony_ci#define	CB_COLOR7_CMASK					0x28e20
233062306a36Sopenharmony_ci
233162306a36Sopenharmony_ci#define	CB_COLOR1_CMASK_SLICE				0x28cbc
233262306a36Sopenharmony_ci#define	CB_COLOR2_CMASK_SLICE				0x28cf8
233362306a36Sopenharmony_ci#define	CB_COLOR3_CMASK_SLICE				0x28d34
233462306a36Sopenharmony_ci#define	CB_COLOR4_CMASK_SLICE				0x28d70
233562306a36Sopenharmony_ci#define	CB_COLOR5_CMASK_SLICE				0x28dac
233662306a36Sopenharmony_ci#define	CB_COLOR6_CMASK_SLICE				0x28de8
233762306a36Sopenharmony_ci#define	CB_COLOR7_CMASK_SLICE				0x28e24
233862306a36Sopenharmony_ci
233962306a36Sopenharmony_ci#define	CB_COLOR1_FMASK					0x28cc0
234062306a36Sopenharmony_ci#define	CB_COLOR2_FMASK					0x28cfc
234162306a36Sopenharmony_ci#define	CB_COLOR3_FMASK					0x28d38
234262306a36Sopenharmony_ci#define	CB_COLOR4_FMASK					0x28d74
234362306a36Sopenharmony_ci#define	CB_COLOR5_FMASK					0x28db0
234462306a36Sopenharmony_ci#define	CB_COLOR6_FMASK					0x28dec
234562306a36Sopenharmony_ci#define	CB_COLOR7_FMASK					0x28e28
234662306a36Sopenharmony_ci
234762306a36Sopenharmony_ci#define	CB_COLOR1_FMASK_SLICE				0x28cc4
234862306a36Sopenharmony_ci#define	CB_COLOR2_FMASK_SLICE				0x28d00
234962306a36Sopenharmony_ci#define	CB_COLOR3_FMASK_SLICE				0x28d3c
235062306a36Sopenharmony_ci#define	CB_COLOR4_FMASK_SLICE				0x28d78
235162306a36Sopenharmony_ci#define	CB_COLOR5_FMASK_SLICE				0x28db4
235262306a36Sopenharmony_ci#define	CB_COLOR6_FMASK_SLICE				0x28df0
235362306a36Sopenharmony_ci#define	CB_COLOR7_FMASK_SLICE				0x28e2c
235462306a36Sopenharmony_ci
235562306a36Sopenharmony_ci#define	CB_COLOR1_CLEAR_WORD0				0x28cc8
235662306a36Sopenharmony_ci#define	CB_COLOR2_CLEAR_WORD0				0x28d04
235762306a36Sopenharmony_ci#define	CB_COLOR3_CLEAR_WORD0				0x28d40
235862306a36Sopenharmony_ci#define	CB_COLOR4_CLEAR_WORD0				0x28d7c
235962306a36Sopenharmony_ci#define	CB_COLOR5_CLEAR_WORD0				0x28db8
236062306a36Sopenharmony_ci#define	CB_COLOR6_CLEAR_WORD0				0x28df4
236162306a36Sopenharmony_ci#define	CB_COLOR7_CLEAR_WORD0				0x28e30
236262306a36Sopenharmony_ci
236362306a36Sopenharmony_ci#define	CB_COLOR1_CLEAR_WORD1				0x28ccc
236462306a36Sopenharmony_ci#define	CB_COLOR2_CLEAR_WORD1				0x28d08
236562306a36Sopenharmony_ci#define	CB_COLOR3_CLEAR_WORD1				0x28d44
236662306a36Sopenharmony_ci#define	CB_COLOR4_CLEAR_WORD1				0x28d80
236762306a36Sopenharmony_ci#define	CB_COLOR5_CLEAR_WORD1				0x28dbc
236862306a36Sopenharmony_ci#define	CB_COLOR6_CLEAR_WORD1				0x28df8
236962306a36Sopenharmony_ci#define	CB_COLOR7_CLEAR_WORD1				0x28e34
237062306a36Sopenharmony_ci
237162306a36Sopenharmony_ci#define	CB_COLOR1_CLEAR_WORD2				0x28cd0
237262306a36Sopenharmony_ci#define	CB_COLOR2_CLEAR_WORD2				0x28d0c
237362306a36Sopenharmony_ci#define	CB_COLOR3_CLEAR_WORD2				0x28d48
237462306a36Sopenharmony_ci#define	CB_COLOR4_CLEAR_WORD2				0x28d84
237562306a36Sopenharmony_ci#define	CB_COLOR5_CLEAR_WORD2				0x28dc0
237662306a36Sopenharmony_ci#define	CB_COLOR6_CLEAR_WORD2				0x28dfc
237762306a36Sopenharmony_ci#define	CB_COLOR7_CLEAR_WORD2				0x28e38
237862306a36Sopenharmony_ci
237962306a36Sopenharmony_ci#define	CB_COLOR1_CLEAR_WORD3				0x28cd4
238062306a36Sopenharmony_ci#define	CB_COLOR2_CLEAR_WORD3				0x28d10
238162306a36Sopenharmony_ci#define	CB_COLOR3_CLEAR_WORD3				0x28d4c
238262306a36Sopenharmony_ci#define	CB_COLOR4_CLEAR_WORD3				0x28d88
238362306a36Sopenharmony_ci#define	CB_COLOR5_CLEAR_WORD3				0x28dc4
238462306a36Sopenharmony_ci#define	CB_COLOR6_CLEAR_WORD3				0x28e00
238562306a36Sopenharmony_ci#define	CB_COLOR7_CLEAR_WORD3				0x28e3c
238662306a36Sopenharmony_ci
238762306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD0_0                         0x30000
238862306a36Sopenharmony_ci#	define TEX_DIM(x)				((x) << 0)
238962306a36Sopenharmony_ci#	define SQ_TEX_DIM_1D				0
239062306a36Sopenharmony_ci#	define SQ_TEX_DIM_2D				1
239162306a36Sopenharmony_ci#	define SQ_TEX_DIM_3D				2
239262306a36Sopenharmony_ci#	define SQ_TEX_DIM_CUBEMAP			3
239362306a36Sopenharmony_ci#	define SQ_TEX_DIM_1D_ARRAY			4
239462306a36Sopenharmony_ci#	define SQ_TEX_DIM_2D_ARRAY			5
239562306a36Sopenharmony_ci#	define SQ_TEX_DIM_2D_MSAA			6
239662306a36Sopenharmony_ci#	define SQ_TEX_DIM_2D_ARRAY_MSAA			7
239762306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD1_0                         0x30004
239862306a36Sopenharmony_ci#       define TEX_ARRAY_MODE(x)                        ((x) << 28)
239962306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD2_0                         0x30008
240062306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD3_0                         0x3000C
240162306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD4_0                         0x30010
240262306a36Sopenharmony_ci#	define TEX_DST_SEL_X(x)				((x) << 16)
240362306a36Sopenharmony_ci#	define TEX_DST_SEL_Y(x)				((x) << 19)
240462306a36Sopenharmony_ci#	define TEX_DST_SEL_Z(x)				((x) << 22)
240562306a36Sopenharmony_ci#	define TEX_DST_SEL_W(x)				((x) << 25)
240662306a36Sopenharmony_ci#	define SQ_SEL_X					0
240762306a36Sopenharmony_ci#	define SQ_SEL_Y					1
240862306a36Sopenharmony_ci#	define SQ_SEL_Z					2
240962306a36Sopenharmony_ci#	define SQ_SEL_W					3
241062306a36Sopenharmony_ci#	define SQ_SEL_0					4
241162306a36Sopenharmony_ci#	define SQ_SEL_1					5
241262306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD5_0                         0x30014
241362306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD6_0                         0x30018
241462306a36Sopenharmony_ci#       define TEX_TILE_SPLIT(x)                        (((x) & 0x7) << 29)
241562306a36Sopenharmony_ci#define SQ_TEX_RESOURCE_WORD7_0                         0x3001c
241662306a36Sopenharmony_ci#       define MACRO_TILE_ASPECT(x)                     (((x) & 0x3) << 6)
241762306a36Sopenharmony_ci#       define TEX_BANK_WIDTH(x)                        (((x) & 0x3) << 8)
241862306a36Sopenharmony_ci#       define TEX_BANK_HEIGHT(x)                       (((x) & 0x3) << 10)
241962306a36Sopenharmony_ci#       define TEX_NUM_BANKS(x)                         (((x) & 0x3) << 16)
242062306a36Sopenharmony_ci#define R_030000_SQ_TEX_RESOURCE_WORD0_0             0x030000
242162306a36Sopenharmony_ci#define   S_030000_DIM(x)                              (((x) & 0x7) << 0)
242262306a36Sopenharmony_ci#define   G_030000_DIM(x)                              (((x) >> 0) & 0x7)
242362306a36Sopenharmony_ci#define   C_030000_DIM                                 0xFFFFFFF8
242462306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_1D                     0x00000000
242562306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_2D                     0x00000001
242662306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_3D                     0x00000002
242762306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_CUBEMAP                0x00000003
242862306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_1D_ARRAY               0x00000004
242962306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_2D_ARRAY               0x00000005
243062306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_2D_MSAA                0x00000006
243162306a36Sopenharmony_ci#define     V_030000_SQ_TEX_DIM_2D_ARRAY_MSAA          0x00000007
243262306a36Sopenharmony_ci#define   S_030000_NON_DISP_TILING_ORDER(x)            (((x) & 0x1) << 5)
243362306a36Sopenharmony_ci#define   G_030000_NON_DISP_TILING_ORDER(x)            (((x) >> 5) & 0x1)
243462306a36Sopenharmony_ci#define   C_030000_NON_DISP_TILING_ORDER               0xFFFFFFDF
243562306a36Sopenharmony_ci#define   S_030000_PITCH(x)                            (((x) & 0xFFF) << 6)
243662306a36Sopenharmony_ci#define   G_030000_PITCH(x)                            (((x) >> 6) & 0xFFF)
243762306a36Sopenharmony_ci#define   C_030000_PITCH                               0xFFFC003F
243862306a36Sopenharmony_ci#define   S_030000_TEX_WIDTH(x)                        (((x) & 0x3FFF) << 18)
243962306a36Sopenharmony_ci#define   G_030000_TEX_WIDTH(x)                        (((x) >> 18) & 0x3FFF)
244062306a36Sopenharmony_ci#define   C_030000_TEX_WIDTH                           0x0003FFFF
244162306a36Sopenharmony_ci#define R_030004_SQ_TEX_RESOURCE_WORD1_0             0x030004
244262306a36Sopenharmony_ci#define   S_030004_TEX_HEIGHT(x)                       (((x) & 0x3FFF) << 0)
244362306a36Sopenharmony_ci#define   G_030004_TEX_HEIGHT(x)                       (((x) >> 0) & 0x3FFF)
244462306a36Sopenharmony_ci#define   C_030004_TEX_HEIGHT                          0xFFFFC000
244562306a36Sopenharmony_ci#define   S_030004_TEX_DEPTH(x)                        (((x) & 0x1FFF) << 14)
244662306a36Sopenharmony_ci#define   G_030004_TEX_DEPTH(x)                        (((x) >> 14) & 0x1FFF)
244762306a36Sopenharmony_ci#define   C_030004_TEX_DEPTH                           0xF8003FFF
244862306a36Sopenharmony_ci#define   S_030004_ARRAY_MODE(x)                       (((x) & 0xF) << 28)
244962306a36Sopenharmony_ci#define   G_030004_ARRAY_MODE(x)                       (((x) >> 28) & 0xF)
245062306a36Sopenharmony_ci#define   C_030004_ARRAY_MODE                          0x0FFFFFFF
245162306a36Sopenharmony_ci#define R_030008_SQ_TEX_RESOURCE_WORD2_0             0x030008
245262306a36Sopenharmony_ci#define   S_030008_BASE_ADDRESS(x)                     (((x) & 0xFFFFFFFF) << 0)
245362306a36Sopenharmony_ci#define   G_030008_BASE_ADDRESS(x)                     (((x) >> 0) & 0xFFFFFFFF)
245462306a36Sopenharmony_ci#define   C_030008_BASE_ADDRESS                        0x00000000
245562306a36Sopenharmony_ci#define R_03000C_SQ_TEX_RESOURCE_WORD3_0             0x03000C
245662306a36Sopenharmony_ci#define   S_03000C_MIP_ADDRESS(x)                      (((x) & 0xFFFFFFFF) << 0)
245762306a36Sopenharmony_ci#define   G_03000C_MIP_ADDRESS(x)                      (((x) >> 0) & 0xFFFFFFFF)
245862306a36Sopenharmony_ci#define   C_03000C_MIP_ADDRESS                         0x00000000
245962306a36Sopenharmony_ci#define R_030010_SQ_TEX_RESOURCE_WORD4_0             0x030010
246062306a36Sopenharmony_ci#define   S_030010_FORMAT_COMP_X(x)                    (((x) & 0x3) << 0)
246162306a36Sopenharmony_ci#define   G_030010_FORMAT_COMP_X(x)                    (((x) >> 0) & 0x3)
246262306a36Sopenharmony_ci#define   C_030010_FORMAT_COMP_X                       0xFFFFFFFC
246362306a36Sopenharmony_ci#define     V_030010_SQ_FORMAT_COMP_UNSIGNED           0x00000000
246462306a36Sopenharmony_ci#define     V_030010_SQ_FORMAT_COMP_SIGNED             0x00000001
246562306a36Sopenharmony_ci#define     V_030010_SQ_FORMAT_COMP_UNSIGNED_BIASED    0x00000002
246662306a36Sopenharmony_ci#define   S_030010_FORMAT_COMP_Y(x)                    (((x) & 0x3) << 2)
246762306a36Sopenharmony_ci#define   G_030010_FORMAT_COMP_Y(x)                    (((x) >> 2) & 0x3)
246862306a36Sopenharmony_ci#define   C_030010_FORMAT_COMP_Y                       0xFFFFFFF3
246962306a36Sopenharmony_ci#define   S_030010_FORMAT_COMP_Z(x)                    (((x) & 0x3) << 4)
247062306a36Sopenharmony_ci#define   G_030010_FORMAT_COMP_Z(x)                    (((x) >> 4) & 0x3)
247162306a36Sopenharmony_ci#define   C_030010_FORMAT_COMP_Z                       0xFFFFFFCF
247262306a36Sopenharmony_ci#define   S_030010_FORMAT_COMP_W(x)                    (((x) & 0x3) << 6)
247362306a36Sopenharmony_ci#define   G_030010_FORMAT_COMP_W(x)                    (((x) >> 6) & 0x3)
247462306a36Sopenharmony_ci#define   C_030010_FORMAT_COMP_W                       0xFFFFFF3F
247562306a36Sopenharmony_ci#define   S_030010_NUM_FORMAT_ALL(x)                   (((x) & 0x3) << 8)
247662306a36Sopenharmony_ci#define   G_030010_NUM_FORMAT_ALL(x)                   (((x) >> 8) & 0x3)
247762306a36Sopenharmony_ci#define   C_030010_NUM_FORMAT_ALL                      0xFFFFFCFF
247862306a36Sopenharmony_ci#define     V_030010_SQ_NUM_FORMAT_NORM                0x00000000
247962306a36Sopenharmony_ci#define     V_030010_SQ_NUM_FORMAT_INT                 0x00000001
248062306a36Sopenharmony_ci#define     V_030010_SQ_NUM_FORMAT_SCALED              0x00000002
248162306a36Sopenharmony_ci#define   S_030010_SRF_MODE_ALL(x)                     (((x) & 0x1) << 10)
248262306a36Sopenharmony_ci#define   G_030010_SRF_MODE_ALL(x)                     (((x) >> 10) & 0x1)
248362306a36Sopenharmony_ci#define   C_030010_SRF_MODE_ALL                        0xFFFFFBFF
248462306a36Sopenharmony_ci#define     V_030010_SRF_MODE_ZERO_CLAMP_MINUS_ONE     0x00000000
248562306a36Sopenharmony_ci#define     V_030010_SRF_MODE_NO_ZERO                  0x00000001
248662306a36Sopenharmony_ci#define   S_030010_FORCE_DEGAMMA(x)                    (((x) & 0x1) << 11)
248762306a36Sopenharmony_ci#define   G_030010_FORCE_DEGAMMA(x)                    (((x) >> 11) & 0x1)
248862306a36Sopenharmony_ci#define   C_030010_FORCE_DEGAMMA                       0xFFFFF7FF
248962306a36Sopenharmony_ci#define   S_030010_ENDIAN_SWAP(x)                      (((x) & 0x3) << 12)
249062306a36Sopenharmony_ci#define   G_030010_ENDIAN_SWAP(x)                      (((x) >> 12) & 0x3)
249162306a36Sopenharmony_ci#define   C_030010_ENDIAN_SWAP                         0xFFFFCFFF
249262306a36Sopenharmony_ci#define   S_030010_DST_SEL_X(x)                        (((x) & 0x7) << 16)
249362306a36Sopenharmony_ci#define   G_030010_DST_SEL_X(x)                        (((x) >> 16) & 0x7)
249462306a36Sopenharmony_ci#define   C_030010_DST_SEL_X                           0xFFF8FFFF
249562306a36Sopenharmony_ci#define     V_030010_SQ_SEL_X                          0x00000000
249662306a36Sopenharmony_ci#define     V_030010_SQ_SEL_Y                          0x00000001
249762306a36Sopenharmony_ci#define     V_030010_SQ_SEL_Z                          0x00000002
249862306a36Sopenharmony_ci#define     V_030010_SQ_SEL_W                          0x00000003
249962306a36Sopenharmony_ci#define     V_030010_SQ_SEL_0                          0x00000004
250062306a36Sopenharmony_ci#define     V_030010_SQ_SEL_1                          0x00000005
250162306a36Sopenharmony_ci#define   S_030010_DST_SEL_Y(x)                        (((x) & 0x7) << 19)
250262306a36Sopenharmony_ci#define   G_030010_DST_SEL_Y(x)                        (((x) >> 19) & 0x7)
250362306a36Sopenharmony_ci#define   C_030010_DST_SEL_Y                           0xFFC7FFFF
250462306a36Sopenharmony_ci#define   S_030010_DST_SEL_Z(x)                        (((x) & 0x7) << 22)
250562306a36Sopenharmony_ci#define   G_030010_DST_SEL_Z(x)                        (((x) >> 22) & 0x7)
250662306a36Sopenharmony_ci#define   C_030010_DST_SEL_Z                           0xFE3FFFFF
250762306a36Sopenharmony_ci#define   S_030010_DST_SEL_W(x)                        (((x) & 0x7) << 25)
250862306a36Sopenharmony_ci#define   G_030010_DST_SEL_W(x)                        (((x) >> 25) & 0x7)
250962306a36Sopenharmony_ci#define   C_030010_DST_SEL_W                           0xF1FFFFFF
251062306a36Sopenharmony_ci#define   S_030010_BASE_LEVEL(x)                       (((x) & 0xF) << 28)
251162306a36Sopenharmony_ci#define   G_030010_BASE_LEVEL(x)                       (((x) >> 28) & 0xF)
251262306a36Sopenharmony_ci#define   C_030010_BASE_LEVEL                          0x0FFFFFFF
251362306a36Sopenharmony_ci#define R_030014_SQ_TEX_RESOURCE_WORD5_0             0x030014
251462306a36Sopenharmony_ci#define   S_030014_LAST_LEVEL(x)                       (((x) & 0xF) << 0)
251562306a36Sopenharmony_ci#define   G_030014_LAST_LEVEL(x)                       (((x) >> 0) & 0xF)
251662306a36Sopenharmony_ci#define   C_030014_LAST_LEVEL                          0xFFFFFFF0
251762306a36Sopenharmony_ci#define   S_030014_BASE_ARRAY(x)                       (((x) & 0x1FFF) << 4)
251862306a36Sopenharmony_ci#define   G_030014_BASE_ARRAY(x)                       (((x) >> 4) & 0x1FFF)
251962306a36Sopenharmony_ci#define   C_030014_BASE_ARRAY                          0xFFFE000F
252062306a36Sopenharmony_ci#define   S_030014_LAST_ARRAY(x)                       (((x) & 0x1FFF) << 17)
252162306a36Sopenharmony_ci#define   G_030014_LAST_ARRAY(x)                       (((x) >> 17) & 0x1FFF)
252262306a36Sopenharmony_ci#define   C_030014_LAST_ARRAY                          0xC001FFFF
252362306a36Sopenharmony_ci#define R_030018_SQ_TEX_RESOURCE_WORD6_0             0x030018
252462306a36Sopenharmony_ci#define   S_030018_MAX_ANISO(x)                        (((x) & 0x7) << 0)
252562306a36Sopenharmony_ci#define   G_030018_MAX_ANISO(x)                        (((x) >> 0) & 0x7)
252662306a36Sopenharmony_ci#define   C_030018_MAX_ANISO                           0xFFFFFFF8
252762306a36Sopenharmony_ci#define   S_030018_PERF_MODULATION(x)                  (((x) & 0x7) << 3)
252862306a36Sopenharmony_ci#define   G_030018_PERF_MODULATION(x)                  (((x) >> 3) & 0x7)
252962306a36Sopenharmony_ci#define   C_030018_PERF_MODULATION                     0xFFFFFFC7
253062306a36Sopenharmony_ci#define   S_030018_INTERLACED(x)                       (((x) & 0x1) << 6)
253162306a36Sopenharmony_ci#define   G_030018_INTERLACED(x)                       (((x) >> 6) & 0x1)
253262306a36Sopenharmony_ci#define   C_030018_INTERLACED                          0xFFFFFFBF
253362306a36Sopenharmony_ci#define   S_030018_TILE_SPLIT(x)                       (((x) & 0x7) << 29)
253462306a36Sopenharmony_ci#define   G_030018_TILE_SPLIT(x)                       (((x) >> 29) & 0x7)
253562306a36Sopenharmony_ci#define R_03001C_SQ_TEX_RESOURCE_WORD7_0             0x03001C
253662306a36Sopenharmony_ci#define   S_03001C_MACRO_TILE_ASPECT(x)                (((x) & 0x3) << 6)
253762306a36Sopenharmony_ci#define   G_03001C_MACRO_TILE_ASPECT(x)                (((x) >> 6) & 0x3)
253862306a36Sopenharmony_ci#define   S_03001C_BANK_WIDTH(x)                       (((x) & 0x3) << 8)
253962306a36Sopenharmony_ci#define   G_03001C_BANK_WIDTH(x)                       (((x) >> 8) & 0x3)
254062306a36Sopenharmony_ci#define   S_03001C_BANK_HEIGHT(x)                      (((x) & 0x3) << 10)
254162306a36Sopenharmony_ci#define   G_03001C_BANK_HEIGHT(x)                      (((x) >> 10) & 0x3)
254262306a36Sopenharmony_ci#define   S_03001C_NUM_BANKS(x)                        (((x) & 0x3) << 16)
254362306a36Sopenharmony_ci#define   G_03001C_NUM_BANKS(x)                        (((x) >> 16) & 0x3)
254462306a36Sopenharmony_ci#define   S_03001C_TYPE(x)                             (((x) & 0x3) << 30)
254562306a36Sopenharmony_ci#define   G_03001C_TYPE(x)                             (((x) >> 30) & 0x3)
254662306a36Sopenharmony_ci#define   C_03001C_TYPE                                0x3FFFFFFF
254762306a36Sopenharmony_ci#define     V_03001C_SQ_TEX_VTX_INVALID_TEXTURE        0x00000000
254862306a36Sopenharmony_ci#define     V_03001C_SQ_TEX_VTX_INVALID_BUFFER         0x00000001
254962306a36Sopenharmony_ci#define     V_03001C_SQ_TEX_VTX_VALID_TEXTURE          0x00000002
255062306a36Sopenharmony_ci#define     V_03001C_SQ_TEX_VTX_VALID_BUFFER           0x00000003
255162306a36Sopenharmony_ci#define   S_03001C_DATA_FORMAT(x)                      (((x) & 0x3F) << 0)
255262306a36Sopenharmony_ci#define   G_03001C_DATA_FORMAT(x)                      (((x) >> 0) & 0x3F)
255362306a36Sopenharmony_ci#define   C_03001C_DATA_FORMAT                         0xFFFFFFC0
255462306a36Sopenharmony_ci
255562306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD0_0				0x30000
255662306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD1_0				0x30004
255762306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD2_0				0x30008
255862306a36Sopenharmony_ci#	define SQ_VTXC_BASE_ADDR_HI(x)			((x) << 0)
255962306a36Sopenharmony_ci#	define SQ_VTXC_STRIDE(x)			((x) << 8)
256062306a36Sopenharmony_ci#	define SQ_VTXC_ENDIAN_SWAP(x)			((x) << 30)
256162306a36Sopenharmony_ci#	define SQ_ENDIAN_NONE				0
256262306a36Sopenharmony_ci#	define SQ_ENDIAN_8IN16				1
256362306a36Sopenharmony_ci#	define SQ_ENDIAN_8IN32				2
256462306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD3_0				0x3000C
256562306a36Sopenharmony_ci#	define SQ_VTCX_SEL_X(x)				((x) << 3)
256662306a36Sopenharmony_ci#	define SQ_VTCX_SEL_Y(x)				((x) << 6)
256762306a36Sopenharmony_ci#	define SQ_VTCX_SEL_Z(x)				((x) << 9)
256862306a36Sopenharmony_ci#	define SQ_VTCX_SEL_W(x)				((x) << 12)
256962306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD4_0				0x30010
257062306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD5_0                         0x30014
257162306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD6_0                         0x30018
257262306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD7_0                         0x3001c
257362306a36Sopenharmony_ci
257462306a36Sopenharmony_ci#define TD_PS_BORDER_COLOR_INDEX                        0xA400
257562306a36Sopenharmony_ci#define TD_PS_BORDER_COLOR_RED                          0xA404
257662306a36Sopenharmony_ci#define TD_PS_BORDER_COLOR_GREEN                        0xA408
257762306a36Sopenharmony_ci#define TD_PS_BORDER_COLOR_BLUE                         0xA40C
257862306a36Sopenharmony_ci#define TD_PS_BORDER_COLOR_ALPHA                        0xA410
257962306a36Sopenharmony_ci#define TD_VS_BORDER_COLOR_INDEX                        0xA414
258062306a36Sopenharmony_ci#define TD_VS_BORDER_COLOR_RED                          0xA418
258162306a36Sopenharmony_ci#define TD_VS_BORDER_COLOR_GREEN                        0xA41C
258262306a36Sopenharmony_ci#define TD_VS_BORDER_COLOR_BLUE                         0xA420
258362306a36Sopenharmony_ci#define TD_VS_BORDER_COLOR_ALPHA                        0xA424
258462306a36Sopenharmony_ci#define TD_GS_BORDER_COLOR_INDEX                        0xA428
258562306a36Sopenharmony_ci#define TD_GS_BORDER_COLOR_RED                          0xA42C
258662306a36Sopenharmony_ci#define TD_GS_BORDER_COLOR_GREEN                        0xA430
258762306a36Sopenharmony_ci#define TD_GS_BORDER_COLOR_BLUE                         0xA434
258862306a36Sopenharmony_ci#define TD_GS_BORDER_COLOR_ALPHA                        0xA438
258962306a36Sopenharmony_ci#define TD_HS_BORDER_COLOR_INDEX                        0xA43C
259062306a36Sopenharmony_ci#define TD_HS_BORDER_COLOR_RED                          0xA440
259162306a36Sopenharmony_ci#define TD_HS_BORDER_COLOR_GREEN                        0xA444
259262306a36Sopenharmony_ci#define TD_HS_BORDER_COLOR_BLUE                         0xA448
259362306a36Sopenharmony_ci#define TD_HS_BORDER_COLOR_ALPHA                        0xA44C
259462306a36Sopenharmony_ci#define TD_LS_BORDER_COLOR_INDEX                        0xA450
259562306a36Sopenharmony_ci#define TD_LS_BORDER_COLOR_RED                          0xA454
259662306a36Sopenharmony_ci#define TD_LS_BORDER_COLOR_GREEN                        0xA458
259762306a36Sopenharmony_ci#define TD_LS_BORDER_COLOR_BLUE                         0xA45C
259862306a36Sopenharmony_ci#define TD_LS_BORDER_COLOR_ALPHA                        0xA460
259962306a36Sopenharmony_ci#define TD_CS_BORDER_COLOR_INDEX                        0xA464
260062306a36Sopenharmony_ci#define TD_CS_BORDER_COLOR_RED                          0xA468
260162306a36Sopenharmony_ci#define TD_CS_BORDER_COLOR_GREEN                        0xA46C
260262306a36Sopenharmony_ci#define TD_CS_BORDER_COLOR_BLUE                         0xA470
260362306a36Sopenharmony_ci#define TD_CS_BORDER_COLOR_ALPHA                        0xA474
260462306a36Sopenharmony_ci
260562306a36Sopenharmony_ci/* cayman 3D regs */
260662306a36Sopenharmony_ci#define CAYMAN_VGT_OFFCHIP_LDS_BASE			0x89B4
260762306a36Sopenharmony_ci#define CAYMAN_SQ_EX_ALLOC_TABLE_SLOTS			0x8E48
260862306a36Sopenharmony_ci#define CAYMAN_DB_EQAA					0x28804
260962306a36Sopenharmony_ci#define CAYMAN_DB_DEPTH_INFO				0x2803C
261062306a36Sopenharmony_ci#define CAYMAN_PA_SC_AA_CONFIG				0x28BE0
261162306a36Sopenharmony_ci#define         CAYMAN_MSAA_NUM_SAMPLES_SHIFT           0
261262306a36Sopenharmony_ci#define         CAYMAN_MSAA_NUM_SAMPLES_MASK            0x7
261362306a36Sopenharmony_ci#define CAYMAN_SX_SCATTER_EXPORT_BASE			0x28358
261462306a36Sopenharmony_ci/* cayman packet3 addition */
261562306a36Sopenharmony_ci#define	CAYMAN_PACKET3_DEALLOC_STATE			0x14
261662306a36Sopenharmony_ci
261762306a36Sopenharmony_ci/* DMA regs common on r6xx/r7xx/evergreen/ni */
261862306a36Sopenharmony_ci#define DMA_RB_CNTL                                       0xd000
261962306a36Sopenharmony_ci#       define DMA_RB_ENABLE                              (1 << 0)
262062306a36Sopenharmony_ci#       define DMA_RB_SIZE(x)                             ((x) << 1) /* log2 */
262162306a36Sopenharmony_ci#       define DMA_RB_SWAP_ENABLE                         (1 << 9) /* 8IN32 */
262262306a36Sopenharmony_ci#       define DMA_RPTR_WRITEBACK_ENABLE                  (1 << 12)
262362306a36Sopenharmony_ci#       define DMA_RPTR_WRITEBACK_SWAP_ENABLE             (1 << 13)  /* 8IN32 */
262462306a36Sopenharmony_ci#       define DMA_RPTR_WRITEBACK_TIMER(x)                ((x) << 16) /* log2 */
262562306a36Sopenharmony_ci#define DMA_STATUS_REG                                    0xd034
262662306a36Sopenharmony_ci#       define DMA_IDLE                                   (1 << 0)
262762306a36Sopenharmony_ci
262862306a36Sopenharmony_ci#endif
2629