162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright 2009 Advanced Micro Devices, Inc.
362306a36Sopenharmony_ci * Copyright 2009 Red Hat Inc.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
662306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
762306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
862306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
962306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
1062306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
1362306a36Sopenharmony_ci * all copies or substantial portions of the Software.
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1662306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1762306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1862306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1962306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2062306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2162306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * Authors: Dave Airlie
2462306a36Sopenharmony_ci *          Alex Deucher
2562306a36Sopenharmony_ci *          Jerome Glisse
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_ci#ifndef R600D_H
2862306a36Sopenharmony_ci#define R600D_H
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#define CP_PACKET2			0x80000000
3162306a36Sopenharmony_ci#define		PACKET2_PAD_SHIFT		0
3262306a36Sopenharmony_ci#define		PACKET2_PAD_MASK		(0x3fffffff << 0)
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define PACKET2(v)	(CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#define R6XX_MAX_SH_GPRS			256
3762306a36Sopenharmony_ci#define R6XX_MAX_TEMP_GPRS			16
3862306a36Sopenharmony_ci#define R6XX_MAX_SH_THREADS			256
3962306a36Sopenharmony_ci#define R6XX_MAX_SH_STACK_ENTRIES		4096
4062306a36Sopenharmony_ci#define R6XX_MAX_BACKENDS			8
4162306a36Sopenharmony_ci#define R6XX_MAX_BACKENDS_MASK			0xff
4262306a36Sopenharmony_ci#define R6XX_MAX_SIMDS				8
4362306a36Sopenharmony_ci#define R6XX_MAX_SIMDS_MASK			0xff
4462306a36Sopenharmony_ci#define R6XX_MAX_PIPES				8
4562306a36Sopenharmony_ci#define R6XX_MAX_PIPES_MASK			0xff
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci/* tiling bits */
4862306a36Sopenharmony_ci#define     ARRAY_LINEAR_GENERAL              0x00000000
4962306a36Sopenharmony_ci#define     ARRAY_LINEAR_ALIGNED              0x00000001
5062306a36Sopenharmony_ci#define     ARRAY_1D_TILED_THIN1              0x00000002
5162306a36Sopenharmony_ci#define     ARRAY_2D_TILED_THIN1              0x00000004
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci/* Registers */
5462306a36Sopenharmony_ci#define	ARB_POP						0x2418
5562306a36Sopenharmony_ci#define 	ENABLE_TC128					(1 << 30)
5662306a36Sopenharmony_ci#define	ARB_GDEC_RD_CNTL				0x246C
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define	CC_GC_SHADER_PIPE_CONFIG			0x8950
5962306a36Sopenharmony_ci#define	CC_RB_BACKEND_DISABLE				0x98F4
6062306a36Sopenharmony_ci#define		BACKEND_DISABLE(x)				((x) << 16)
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci#define R_028808_CB_COLOR_CONTROL			0x28808
6362306a36Sopenharmony_ci#define   S_028808_SPECIAL_OP(x)                       (((x) & 0x7) << 4)
6462306a36Sopenharmony_ci#define   G_028808_SPECIAL_OP(x)                       (((x) >> 4) & 0x7)
6562306a36Sopenharmony_ci#define   C_028808_SPECIAL_OP                          0xFFFFFF8F
6662306a36Sopenharmony_ci#define     V_028808_SPECIAL_NORMAL                     0x00
6762306a36Sopenharmony_ci#define     V_028808_SPECIAL_DISABLE                    0x01
6862306a36Sopenharmony_ci#define     V_028808_SPECIAL_RESOLVE_BOX                0x07
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define	CB_COLOR0_BASE					0x28040
7162306a36Sopenharmony_ci#define	CB_COLOR1_BASE					0x28044
7262306a36Sopenharmony_ci#define	CB_COLOR2_BASE					0x28048
7362306a36Sopenharmony_ci#define	CB_COLOR3_BASE					0x2804C
7462306a36Sopenharmony_ci#define	CB_COLOR4_BASE					0x28050
7562306a36Sopenharmony_ci#define	CB_COLOR5_BASE					0x28054
7662306a36Sopenharmony_ci#define	CB_COLOR6_BASE					0x28058
7762306a36Sopenharmony_ci#define	CB_COLOR7_BASE					0x2805C
7862306a36Sopenharmony_ci#define	CB_COLOR7_FRAG					0x280FC
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci#define CB_COLOR0_SIZE                                  0x28060
8162306a36Sopenharmony_ci#define CB_COLOR0_VIEW                                  0x28080
8262306a36Sopenharmony_ci#define R_028080_CB_COLOR0_VIEW                      0x028080
8362306a36Sopenharmony_ci#define   S_028080_SLICE_START(x)                      (((x) & 0x7FF) << 0)
8462306a36Sopenharmony_ci#define   G_028080_SLICE_START(x)                      (((x) >> 0) & 0x7FF)
8562306a36Sopenharmony_ci#define   C_028080_SLICE_START                         0xFFFFF800
8662306a36Sopenharmony_ci#define   S_028080_SLICE_MAX(x)                        (((x) & 0x7FF) << 13)
8762306a36Sopenharmony_ci#define   G_028080_SLICE_MAX(x)                        (((x) >> 13) & 0x7FF)
8862306a36Sopenharmony_ci#define   C_028080_SLICE_MAX                           0xFF001FFF
8962306a36Sopenharmony_ci#define R_028084_CB_COLOR1_VIEW                      0x028084
9062306a36Sopenharmony_ci#define R_028088_CB_COLOR2_VIEW                      0x028088
9162306a36Sopenharmony_ci#define R_02808C_CB_COLOR3_VIEW                      0x02808C
9262306a36Sopenharmony_ci#define R_028090_CB_COLOR4_VIEW                      0x028090
9362306a36Sopenharmony_ci#define R_028094_CB_COLOR5_VIEW                      0x028094
9462306a36Sopenharmony_ci#define R_028098_CB_COLOR6_VIEW                      0x028098
9562306a36Sopenharmony_ci#define R_02809C_CB_COLOR7_VIEW                      0x02809C
9662306a36Sopenharmony_ci#define R_028100_CB_COLOR0_MASK                      0x028100
9762306a36Sopenharmony_ci#define   S_028100_CMASK_BLOCK_MAX(x)                  (((x) & 0xFFF) << 0)
9862306a36Sopenharmony_ci#define   G_028100_CMASK_BLOCK_MAX(x)                  (((x) >> 0) & 0xFFF)
9962306a36Sopenharmony_ci#define   C_028100_CMASK_BLOCK_MAX                     0xFFFFF000
10062306a36Sopenharmony_ci#define   S_028100_FMASK_TILE_MAX(x)                   (((x) & 0xFFFFF) << 12)
10162306a36Sopenharmony_ci#define   G_028100_FMASK_TILE_MAX(x)                   (((x) >> 12) & 0xFFFFF)
10262306a36Sopenharmony_ci#define   C_028100_FMASK_TILE_MAX                      0x00000FFF
10362306a36Sopenharmony_ci#define R_028104_CB_COLOR1_MASK                      0x028104
10462306a36Sopenharmony_ci#define R_028108_CB_COLOR2_MASK                      0x028108
10562306a36Sopenharmony_ci#define R_02810C_CB_COLOR3_MASK                      0x02810C
10662306a36Sopenharmony_ci#define R_028110_CB_COLOR4_MASK                      0x028110
10762306a36Sopenharmony_ci#define R_028114_CB_COLOR5_MASK                      0x028114
10862306a36Sopenharmony_ci#define R_028118_CB_COLOR6_MASK                      0x028118
10962306a36Sopenharmony_ci#define R_02811C_CB_COLOR7_MASK                      0x02811C
11062306a36Sopenharmony_ci#define CB_COLOR0_INFO                                  0x280a0
11162306a36Sopenharmony_ci#	define CB_FORMAT(x)				((x) << 2)
11262306a36Sopenharmony_ci#       define CB_ARRAY_MODE(x)                         ((x) << 8)
11362306a36Sopenharmony_ci#	define CB_SOURCE_FORMAT(x)			((x) << 27)
11462306a36Sopenharmony_ci#	define CB_SF_EXPORT_FULL			0
11562306a36Sopenharmony_ci#	define CB_SF_EXPORT_NORM			1
11662306a36Sopenharmony_ci#define CB_COLOR0_TILE                                  0x280c0
11762306a36Sopenharmony_ci#define CB_COLOR0_FRAG                                  0x280e0
11862306a36Sopenharmony_ci#define CB_COLOR0_MASK                                  0x28100
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_0				0x28940
12162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_1				0x28944
12262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_2				0x28948
12362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_3				0x2894c
12462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_4				0x28950
12562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_5				0x28954
12662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_6				0x28958
12762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_7				0x2895c
12862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_8				0x28960
12962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_9				0x28964
13062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_10			0x28968
13162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_11			0x2896c
13262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_12			0x28970
13362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_13			0x28974
13462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_14			0x28978
13562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_PS_15			0x2897c
13662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_0				0x28980
13762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_1				0x28984
13862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_2				0x28988
13962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_3				0x2898c
14062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_4				0x28990
14162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_5				0x28994
14262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_6				0x28998
14362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_7				0x2899c
14462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_8				0x289a0
14562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_9				0x289a4
14662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_10			0x289a8
14762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_11			0x289ac
14862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_12			0x289b0
14962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_13			0x289b4
15062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_14			0x289b8
15162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_VS_15			0x289bc
15262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_0				0x289c0
15362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_1				0x289c4
15462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_2				0x289c8
15562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_3				0x289cc
15662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_4				0x289d0
15762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_5				0x289d4
15862306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_6				0x289d8
15962306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_7				0x289dc
16062306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_8				0x289e0
16162306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_9				0x289e4
16262306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_10			0x289e8
16362306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_11			0x289ec
16462306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_12			0x289f0
16562306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_13			0x289f4
16662306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_14			0x289f8
16762306a36Sopenharmony_ci#define SQ_ALU_CONST_CACHE_GS_15			0x289fc
16862306a36Sopenharmony_ci
16962306a36Sopenharmony_ci#define	CONFIG_MEMSIZE					0x5428
17062306a36Sopenharmony_ci#define CONFIG_CNTL					0x5424
17162306a36Sopenharmony_ci#define	CP_STALLED_STAT1			0x8674
17262306a36Sopenharmony_ci#define	CP_STALLED_STAT2			0x8678
17362306a36Sopenharmony_ci#define	CP_BUSY_STAT				0x867C
17462306a36Sopenharmony_ci#define	CP_STAT						0x8680
17562306a36Sopenharmony_ci#define	CP_COHER_BASE					0x85F8
17662306a36Sopenharmony_ci#define	CP_DEBUG					0xC1FC
17762306a36Sopenharmony_ci#define	R_0086D8_CP_ME_CNTL			0x86D8
17862306a36Sopenharmony_ci#define		S_0086D8_CP_PFP_HALT(x)			(((x) & 1)<<26)
17962306a36Sopenharmony_ci#define		C_0086D8_CP_PFP_HALT(x)			((x) & 0xFBFFFFFF)
18062306a36Sopenharmony_ci#define		S_0086D8_CP_ME_HALT(x)			(((x) & 1)<<28)
18162306a36Sopenharmony_ci#define		C_0086D8_CP_ME_HALT(x)			((x) & 0xEFFFFFFF)
18262306a36Sopenharmony_ci#define	CP_ME_RAM_DATA					0xC160
18362306a36Sopenharmony_ci#define	CP_ME_RAM_RADDR					0xC158
18462306a36Sopenharmony_ci#define	CP_ME_RAM_WADDR					0xC15C
18562306a36Sopenharmony_ci#define CP_MEQ_THRESHOLDS				0x8764
18662306a36Sopenharmony_ci#define		MEQ_END(x)					((x) << 16)
18762306a36Sopenharmony_ci#define		ROQ_END(x)					((x) << 24)
18862306a36Sopenharmony_ci#define	CP_PERFMON_CNTL					0x87FC
18962306a36Sopenharmony_ci#define	CP_PFP_UCODE_ADDR				0xC150
19062306a36Sopenharmony_ci#define	CP_PFP_UCODE_DATA				0xC154
19162306a36Sopenharmony_ci#define	CP_QUEUE_THRESHOLDS				0x8760
19262306a36Sopenharmony_ci#define		ROQ_IB1_START(x)				((x) << 0)
19362306a36Sopenharmony_ci#define		ROQ_IB2_START(x)				((x) << 8)
19462306a36Sopenharmony_ci#define	CP_RB_BASE					0xC100
19562306a36Sopenharmony_ci#define	CP_RB_CNTL					0xC104
19662306a36Sopenharmony_ci#define		RB_BUFSZ(x)					((x) << 0)
19762306a36Sopenharmony_ci#define		RB_BLKSZ(x)					((x) << 8)
19862306a36Sopenharmony_ci#define		RB_NO_UPDATE					(1 << 27)
19962306a36Sopenharmony_ci#define		RB_RPTR_WR_ENA					(1 << 31)
20062306a36Sopenharmony_ci#define		BUF_SWAP_32BIT					(2 << 16)
20162306a36Sopenharmony_ci#define	CP_RB_RPTR					0x8700
20262306a36Sopenharmony_ci#define	CP_RB_RPTR_ADDR					0xC10C
20362306a36Sopenharmony_ci#define		RB_RPTR_SWAP(x)					((x) << 0)
20462306a36Sopenharmony_ci#define	CP_RB_RPTR_ADDR_HI				0xC110
20562306a36Sopenharmony_ci#define	CP_RB_RPTR_WR					0xC108
20662306a36Sopenharmony_ci#define	CP_RB_WPTR					0xC114
20762306a36Sopenharmony_ci#define	CP_RB_WPTR_ADDR					0xC118
20862306a36Sopenharmony_ci#define	CP_RB_WPTR_ADDR_HI				0xC11C
20962306a36Sopenharmony_ci#define	CP_RB_WPTR_DELAY				0x8704
21062306a36Sopenharmony_ci#define	CP_ROQ_IB1_STAT					0x8784
21162306a36Sopenharmony_ci#define	CP_ROQ_IB2_STAT					0x8788
21262306a36Sopenharmony_ci#define	CP_SEM_WAIT_TIMER				0x85BC
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci#define	DB_DEBUG					0x9830
21562306a36Sopenharmony_ci#define		PREZ_MUST_WAIT_FOR_POSTZ_DONE			(1 << 31)
21662306a36Sopenharmony_ci#define	DB_DEPTH_BASE					0x2800C
21762306a36Sopenharmony_ci#define	DB_HTILE_DATA_BASE				0x28014
21862306a36Sopenharmony_ci#define	DB_HTILE_SURFACE				0x28D24
21962306a36Sopenharmony_ci#define   S_028D24_HTILE_WIDTH(x)                      (((x) & 0x1) << 0)
22062306a36Sopenharmony_ci#define   G_028D24_HTILE_WIDTH(x)                      (((x) >> 0) & 0x1)
22162306a36Sopenharmony_ci#define   C_028D24_HTILE_WIDTH                         0xFFFFFFFE
22262306a36Sopenharmony_ci#define   S_028D24_HTILE_HEIGHT(x)                      (((x) & 0x1) << 1)
22362306a36Sopenharmony_ci#define   G_028D24_HTILE_HEIGHT(x)                      (((x) >> 1) & 0x1)
22462306a36Sopenharmony_ci#define   C_028D24_HTILE_HEIGHT                         0xFFFFFFFD
22562306a36Sopenharmony_ci#define   G_028D24_LINEAR(x)                           (((x) >> 2) & 0x1)
22662306a36Sopenharmony_ci#define	DB_WATERMARKS					0x9838
22762306a36Sopenharmony_ci#define		DEPTH_FREE(x)					((x) << 0)
22862306a36Sopenharmony_ci#define		DEPTH_FLUSH(x)					((x) << 5)
22962306a36Sopenharmony_ci#define		DEPTH_PENDING_FREE(x)				((x) << 15)
23062306a36Sopenharmony_ci#define		DEPTH_CACHELINE_FREE(x)				((x) << 20)
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci#define	DCP_TILING_CONFIG				0x6CA0
23362306a36Sopenharmony_ci#define		PIPE_TILING(x)					((x) << 1)
23462306a36Sopenharmony_ci#define 	BANK_TILING(x)					((x) << 4)
23562306a36Sopenharmony_ci#define		GROUP_SIZE(x)					((x) << 6)
23662306a36Sopenharmony_ci#define		ROW_TILING(x)					((x) << 8)
23762306a36Sopenharmony_ci#define		BANK_SWAPS(x)					((x) << 11)
23862306a36Sopenharmony_ci#define		SAMPLE_SPLIT(x)					((x) << 14)
23962306a36Sopenharmony_ci#define		BACKEND_MAP(x)					((x) << 16)
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci#define GB_TILING_CONFIG				0x98F0
24262306a36Sopenharmony_ci#define     PIPE_TILING__SHIFT              1
24362306a36Sopenharmony_ci#define     PIPE_TILING__MASK               0x0000000e
24462306a36Sopenharmony_ci
24562306a36Sopenharmony_ci#define	GC_USER_SHADER_PIPE_CONFIG			0x8954
24662306a36Sopenharmony_ci#define		INACTIVE_QD_PIPES(x)				((x) << 8)
24762306a36Sopenharmony_ci#define		INACTIVE_QD_PIPES_MASK				0x0000FF00
24862306a36Sopenharmony_ci#define		INACTIVE_SIMDS(x)				((x) << 16)
24962306a36Sopenharmony_ci#define		INACTIVE_SIMDS_MASK				0x00FF0000
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci#define SQ_CONFIG                                         0x8c00
25262306a36Sopenharmony_ci#       define VC_ENABLE                                  (1 << 0)
25362306a36Sopenharmony_ci#       define EXPORT_SRC_C                               (1 << 1)
25462306a36Sopenharmony_ci#       define DX9_CONSTS                                 (1 << 2)
25562306a36Sopenharmony_ci#       define ALU_INST_PREFER_VECTOR                     (1 << 3)
25662306a36Sopenharmony_ci#       define DX10_CLAMP                                 (1 << 4)
25762306a36Sopenharmony_ci#       define CLAUSE_SEQ_PRIO(x)                         ((x) << 8)
25862306a36Sopenharmony_ci#       define PS_PRIO(x)                                 ((x) << 24)
25962306a36Sopenharmony_ci#       define VS_PRIO(x)                                 ((x) << 26)
26062306a36Sopenharmony_ci#       define GS_PRIO(x)                                 ((x) << 28)
26162306a36Sopenharmony_ci#       define ES_PRIO(x)                                 ((x) << 30)
26262306a36Sopenharmony_ci#define SQ_GPR_RESOURCE_MGMT_1                            0x8c04
26362306a36Sopenharmony_ci#       define NUM_PS_GPRS(x)                             ((x) << 0)
26462306a36Sopenharmony_ci#       define NUM_VS_GPRS(x)                             ((x) << 16)
26562306a36Sopenharmony_ci#       define NUM_CLAUSE_TEMP_GPRS(x)                    ((x) << 28)
26662306a36Sopenharmony_ci#define SQ_GPR_RESOURCE_MGMT_2                            0x8c08
26762306a36Sopenharmony_ci#       define NUM_GS_GPRS(x)                             ((x) << 0)
26862306a36Sopenharmony_ci#       define NUM_ES_GPRS(x)                             ((x) << 16)
26962306a36Sopenharmony_ci#define SQ_THREAD_RESOURCE_MGMT                           0x8c0c
27062306a36Sopenharmony_ci#       define NUM_PS_THREADS(x)                          ((x) << 0)
27162306a36Sopenharmony_ci#       define NUM_VS_THREADS(x)                          ((x) << 8)
27262306a36Sopenharmony_ci#       define NUM_GS_THREADS(x)                          ((x) << 16)
27362306a36Sopenharmony_ci#       define NUM_ES_THREADS(x)                          ((x) << 24)
27462306a36Sopenharmony_ci#define SQ_STACK_RESOURCE_MGMT_1                          0x8c10
27562306a36Sopenharmony_ci#       define NUM_PS_STACK_ENTRIES(x)                    ((x) << 0)
27662306a36Sopenharmony_ci#       define NUM_VS_STACK_ENTRIES(x)                    ((x) << 16)
27762306a36Sopenharmony_ci#define SQ_STACK_RESOURCE_MGMT_2                          0x8c14
27862306a36Sopenharmony_ci#       define NUM_GS_STACK_ENTRIES(x)                    ((x) << 0)
27962306a36Sopenharmony_ci#       define NUM_ES_STACK_ENTRIES(x)                    ((x) << 16)
28062306a36Sopenharmony_ci#define SQ_ESGS_RING_BASE                               0x8c40
28162306a36Sopenharmony_ci#define SQ_GSVS_RING_BASE                               0x8c48
28262306a36Sopenharmony_ci#define SQ_ESTMP_RING_BASE                              0x8c50
28362306a36Sopenharmony_ci#define SQ_GSTMP_RING_BASE                              0x8c58
28462306a36Sopenharmony_ci#define SQ_VSTMP_RING_BASE                              0x8c60
28562306a36Sopenharmony_ci#define SQ_PSTMP_RING_BASE                              0x8c68
28662306a36Sopenharmony_ci#define SQ_FBUF_RING_BASE                               0x8c70
28762306a36Sopenharmony_ci#define SQ_REDUC_RING_BASE                              0x8c78
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_ci#define GRBM_CNTL                                       0x8000
29062306a36Sopenharmony_ci#       define GRBM_READ_TIMEOUT(x)                     ((x) << 0)
29162306a36Sopenharmony_ci#define	GRBM_STATUS					0x8010
29262306a36Sopenharmony_ci#define		CMDFIFO_AVAIL_MASK				0x0000001F
29362306a36Sopenharmony_ci#define		GUI_ACTIVE					(1<<31)
29462306a36Sopenharmony_ci#define	GRBM_STATUS2					0x8014
29562306a36Sopenharmony_ci#define	GRBM_SOFT_RESET					0x8020
29662306a36Sopenharmony_ci#define		SOFT_RESET_CP					(1<<0)
29762306a36Sopenharmony_ci
29862306a36Sopenharmony_ci#define	CG_THERMAL_CTRL					0x7F0
29962306a36Sopenharmony_ci#define		DIG_THERM_DPM(x)			((x) << 12)
30062306a36Sopenharmony_ci#define		DIG_THERM_DPM_MASK			0x000FF000
30162306a36Sopenharmony_ci#define		DIG_THERM_DPM_SHIFT			12
30262306a36Sopenharmony_ci#define	CG_THERMAL_STATUS				0x7F4
30362306a36Sopenharmony_ci#define		ASIC_T(x)			        ((x) << 0)
30462306a36Sopenharmony_ci#define		ASIC_T_MASK			        0x1FF
30562306a36Sopenharmony_ci#define		ASIC_T_SHIFT			        0
30662306a36Sopenharmony_ci#define	CG_THERMAL_INT					0x7F8
30762306a36Sopenharmony_ci#define		DIG_THERM_INTH(x)			((x) << 8)
30862306a36Sopenharmony_ci#define		DIG_THERM_INTH_MASK			0x0000FF00
30962306a36Sopenharmony_ci#define		DIG_THERM_INTH_SHIFT			8
31062306a36Sopenharmony_ci#define		DIG_THERM_INTL(x)			((x) << 16)
31162306a36Sopenharmony_ci#define		DIG_THERM_INTL_MASK			0x00FF0000
31262306a36Sopenharmony_ci#define		DIG_THERM_INTL_SHIFT			16
31362306a36Sopenharmony_ci#define 	THERM_INT_MASK_HIGH			(1 << 24)
31462306a36Sopenharmony_ci#define 	THERM_INT_MASK_LOW			(1 << 25)
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci#define	RV770_CG_THERMAL_INT				0x734
31762306a36Sopenharmony_ci
31862306a36Sopenharmony_ci#define	HDP_HOST_PATH_CNTL				0x2C00
31962306a36Sopenharmony_ci#define	HDP_NONSURFACE_BASE				0x2C04
32062306a36Sopenharmony_ci#define	HDP_NONSURFACE_INFO				0x2C08
32162306a36Sopenharmony_ci#define	HDP_NONSURFACE_SIZE				0x2C0C
32262306a36Sopenharmony_ci#define HDP_REG_COHERENCY_FLUSH_CNTL			0x54A0
32362306a36Sopenharmony_ci#define	HDP_TILING_CONFIG				0x2F3C
32462306a36Sopenharmony_ci#define HDP_DEBUG1                                      0x2F34
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ci#define MC_CONFIG					0x2000
32762306a36Sopenharmony_ci#define MC_VM_AGP_TOP					0x2184
32862306a36Sopenharmony_ci#define MC_VM_AGP_BOT					0x2188
32962306a36Sopenharmony_ci#define	MC_VM_AGP_BASE					0x218C
33062306a36Sopenharmony_ci#define MC_VM_FB_LOCATION				0x2180
33162306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_RD_UVD_CNTL			0x2124
33262306a36Sopenharmony_ci#define 	ENABLE_L1_TLB					(1 << 0)
33362306a36Sopenharmony_ci#define		ENABLE_L1_FRAGMENT_PROCESSING			(1 << 1)
33462306a36Sopenharmony_ci#define		ENABLE_L1_STRICT_ORDERING			(1 << 2)
33562306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_MASK				0x000000C0
33662306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_SHIFT			6
33762306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_PA_ONLY			(0 << 6)
33862306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_USE_SYS_MAP			(1 << 6)
33962306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_IN_SYS			(2 << 6)
34062306a36Sopenharmony_ci#define		SYSTEM_ACCESS_MODE_NOT_IN_SYS			(3 << 6)
34162306a36Sopenharmony_ci#define		SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU	(0 << 8)
34262306a36Sopenharmony_ci#define		SYSTEM_APERTURE_UNMAPPED_ACCESS_DEFAULT_PAGE	(1 << 8)
34362306a36Sopenharmony_ci#define		ENABLE_SEMAPHORE_MODE				(1 << 10)
34462306a36Sopenharmony_ci#define		ENABLE_WAIT_L2_QUERY				(1 << 11)
34562306a36Sopenharmony_ci#define		EFFECTIVE_L1_TLB_SIZE(x)			(((x) & 7) << 12)
34662306a36Sopenharmony_ci#define		EFFECTIVE_L1_TLB_SIZE_MASK			0x00007000
34762306a36Sopenharmony_ci#define		EFFECTIVE_L1_TLB_SIZE_SHIFT			12
34862306a36Sopenharmony_ci#define		EFFECTIVE_L1_QUEUE_SIZE(x)			(((x) & 7) << 15)
34962306a36Sopenharmony_ci#define		EFFECTIVE_L1_QUEUE_SIZE_MASK			0x00038000
35062306a36Sopenharmony_ci#define		EFFECTIVE_L1_QUEUE_SIZE_SHIFT			15
35162306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCD_RD_A_CNTL			0x219C
35262306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCD_RD_B_CNTL			0x21A0
35362306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_RD_GFX_CNTL			0x21FC
35462306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_RD_HDP_CNTL			0x2204
35562306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_RD_PDMA_CNTL			0x2208
35662306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_RD_SEM_CNTL			0x220C
35762306a36Sopenharmony_ci#define	MC_VM_L1_TLB_MCB_RD_SYS_CNTL			0x2200
35862306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_WR_UVD_CNTL			0x212c
35962306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCD_WR_A_CNTL			0x21A4
36062306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCD_WR_B_CNTL			0x21A8
36162306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_WR_GFX_CNTL			0x2210
36262306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_WR_HDP_CNTL			0x2218
36362306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_WR_PDMA_CNTL			0x221C
36462306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_WR_SEM_CNTL			0x2220
36562306a36Sopenharmony_ci#define MC_VM_L1_TLB_MCB_WR_SYS_CNTL			0x2214
36662306a36Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_LOW_ADDR			0x2190
36762306a36Sopenharmony_ci#define		LOGICAL_PAGE_NUMBER_MASK			0x000FFFFF
36862306a36Sopenharmony_ci#define		LOGICAL_PAGE_NUMBER_SHIFT			0
36962306a36Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_HIGH_ADDR			0x2194
37062306a36Sopenharmony_ci#define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR		0x2198
37162306a36Sopenharmony_ci
37262306a36Sopenharmony_ci#define RS_DQ_RD_RET_CONF				0x2348
37362306a36Sopenharmony_ci
37462306a36Sopenharmony_ci#define	PA_CL_ENHANCE					0x8A14
37562306a36Sopenharmony_ci#define		CLIP_VTX_REORDER_ENA				(1 << 0)
37662306a36Sopenharmony_ci#define		NUM_CLIP_SEQ(x)					((x) << 1)
37762306a36Sopenharmony_ci#define PA_SC_AA_CONFIG					0x28C04
37862306a36Sopenharmony_ci#define	PA_SC_AA_SAMPLE_LOCS_2S				0x8B40
37962306a36Sopenharmony_ci#define	PA_SC_AA_SAMPLE_LOCS_4S				0x8B44
38062306a36Sopenharmony_ci#define	PA_SC_AA_SAMPLE_LOCS_8S_WD0			0x8B48
38162306a36Sopenharmony_ci#define	PA_SC_AA_SAMPLE_LOCS_8S_WD1			0x8B4C
38262306a36Sopenharmony_ci#define		S0_X(x)						((x) << 0)
38362306a36Sopenharmony_ci#define		S0_Y(x)						((x) << 4)
38462306a36Sopenharmony_ci#define		S1_X(x)						((x) << 8)
38562306a36Sopenharmony_ci#define		S1_Y(x)						((x) << 12)
38662306a36Sopenharmony_ci#define		S2_X(x)						((x) << 16)
38762306a36Sopenharmony_ci#define		S2_Y(x)						((x) << 20)
38862306a36Sopenharmony_ci#define		S3_X(x)						((x) << 24)
38962306a36Sopenharmony_ci#define		S3_Y(x)						((x) << 28)
39062306a36Sopenharmony_ci#define		S4_X(x)						((x) << 0)
39162306a36Sopenharmony_ci#define		S4_Y(x)						((x) << 4)
39262306a36Sopenharmony_ci#define		S5_X(x)						((x) << 8)
39362306a36Sopenharmony_ci#define		S5_Y(x)						((x) << 12)
39462306a36Sopenharmony_ci#define		S6_X(x)						((x) << 16)
39562306a36Sopenharmony_ci#define		S6_Y(x)						((x) << 20)
39662306a36Sopenharmony_ci#define		S7_X(x)						((x) << 24)
39762306a36Sopenharmony_ci#define		S7_Y(x)						((x) << 28)
39862306a36Sopenharmony_ci#define PA_SC_CLIPRECT_RULE				0x2820c
39962306a36Sopenharmony_ci#define	PA_SC_ENHANCE					0x8BF0
40062306a36Sopenharmony_ci#define		FORCE_EOV_MAX_CLK_CNT(x)			((x) << 0)
40162306a36Sopenharmony_ci#define		FORCE_EOV_MAX_TILE_CNT(x)			((x) << 12)
40262306a36Sopenharmony_ci#define PA_SC_LINE_STIPPLE				0x28A0C
40362306a36Sopenharmony_ci#define	PA_SC_LINE_STIPPLE_STATE			0x8B10
40462306a36Sopenharmony_ci#define PA_SC_MODE_CNTL					0x28A4C
40562306a36Sopenharmony_ci#define	PA_SC_MULTI_CHIP_CNTL				0x8B20
40662306a36Sopenharmony_ci
40762306a36Sopenharmony_ci#define PA_SC_SCREEN_SCISSOR_TL                         0x28030
40862306a36Sopenharmony_ci#define PA_SC_GENERIC_SCISSOR_TL                        0x28240
40962306a36Sopenharmony_ci#define PA_SC_WINDOW_SCISSOR_TL                         0x28204
41062306a36Sopenharmony_ci
41162306a36Sopenharmony_ci#define	PCIE_PORT_INDEX					0x0038
41262306a36Sopenharmony_ci#define	PCIE_PORT_DATA					0x003C
41362306a36Sopenharmony_ci
41462306a36Sopenharmony_ci#define CHMAP						0x2004
41562306a36Sopenharmony_ci#define		NOOFCHAN_SHIFT					12
41662306a36Sopenharmony_ci#define		NOOFCHAN_MASK					0x00003000
41762306a36Sopenharmony_ci
41862306a36Sopenharmony_ci#define RAMCFG						0x2408
41962306a36Sopenharmony_ci#define		NOOFBANK_SHIFT					0
42062306a36Sopenharmony_ci#define		NOOFBANK_MASK					0x00000001
42162306a36Sopenharmony_ci#define		NOOFRANK_SHIFT					1
42262306a36Sopenharmony_ci#define		NOOFRANK_MASK					0x00000002
42362306a36Sopenharmony_ci#define		NOOFROWS_SHIFT					2
42462306a36Sopenharmony_ci#define		NOOFROWS_MASK					0x0000001C
42562306a36Sopenharmony_ci#define		NOOFCOLS_SHIFT					5
42662306a36Sopenharmony_ci#define		NOOFCOLS_MASK					0x00000060
42762306a36Sopenharmony_ci#define		CHANSIZE_SHIFT					7
42862306a36Sopenharmony_ci#define		CHANSIZE_MASK					0x00000080
42962306a36Sopenharmony_ci#define		BURSTLENGTH_SHIFT				8
43062306a36Sopenharmony_ci#define		BURSTLENGTH_MASK				0x00000100
43162306a36Sopenharmony_ci#define		CHANSIZE_OVERRIDE				(1 << 10)
43262306a36Sopenharmony_ci
43362306a36Sopenharmony_ci#define	SCRATCH_REG0					0x8500
43462306a36Sopenharmony_ci#define	SCRATCH_REG1					0x8504
43562306a36Sopenharmony_ci#define	SCRATCH_REG2					0x8508
43662306a36Sopenharmony_ci#define	SCRATCH_REG3					0x850C
43762306a36Sopenharmony_ci#define	SCRATCH_REG4					0x8510
43862306a36Sopenharmony_ci#define	SCRATCH_REG5					0x8514
43962306a36Sopenharmony_ci#define	SCRATCH_REG6					0x8518
44062306a36Sopenharmony_ci#define	SCRATCH_REG7					0x851C
44162306a36Sopenharmony_ci#define	SCRATCH_UMSK					0x8540
44262306a36Sopenharmony_ci#define	SCRATCH_ADDR					0x8544
44362306a36Sopenharmony_ci
44462306a36Sopenharmony_ci#define	SPI_CONFIG_CNTL					0x9100
44562306a36Sopenharmony_ci#define		GPR_WRITE_PRIORITY(x)				((x) << 0)
44662306a36Sopenharmony_ci#define		DISABLE_INTERP_1				(1 << 5)
44762306a36Sopenharmony_ci#define	SPI_CONFIG_CNTL_1				0x913C
44862306a36Sopenharmony_ci#define		VTX_DONE_DELAY(x)				((x) << 0)
44962306a36Sopenharmony_ci#define		INTERP_ONE_PRIM_PER_ROW				(1 << 4)
45062306a36Sopenharmony_ci#define	SPI_INPUT_Z					0x286D8
45162306a36Sopenharmony_ci#define	SPI_PS_IN_CONTROL_0				0x286CC
45262306a36Sopenharmony_ci#define		NUM_INTERP(x)					((x)<<0)
45362306a36Sopenharmony_ci#define		POSITION_ENA					(1<<8)
45462306a36Sopenharmony_ci#define		POSITION_CENTROID				(1<<9)
45562306a36Sopenharmony_ci#define		POSITION_ADDR(x)				((x)<<10)
45662306a36Sopenharmony_ci#define		PARAM_GEN(x)					((x)<<15)
45762306a36Sopenharmony_ci#define		PARAM_GEN_ADDR(x)				((x)<<19)
45862306a36Sopenharmony_ci#define		BARYC_SAMPLE_CNTL(x)				((x)<<26)
45962306a36Sopenharmony_ci#define		PERSP_GRADIENT_ENA				(1<<28)
46062306a36Sopenharmony_ci#define		LINEAR_GRADIENT_ENA				(1<<29)
46162306a36Sopenharmony_ci#define		POSITION_SAMPLE					(1<<30)
46262306a36Sopenharmony_ci#define		BARYC_AT_SAMPLE_ENA				(1<<31)
46362306a36Sopenharmony_ci#define	SPI_PS_IN_CONTROL_1				0x286D0
46462306a36Sopenharmony_ci#define		GEN_INDEX_PIX					(1<<0)
46562306a36Sopenharmony_ci#define		GEN_INDEX_PIX_ADDR(x)				((x)<<1)
46662306a36Sopenharmony_ci#define		FRONT_FACE_ENA					(1<<8)
46762306a36Sopenharmony_ci#define		FRONT_FACE_CHAN(x)				((x)<<9)
46862306a36Sopenharmony_ci#define		FRONT_FACE_ALL_BITS				(1<<11)
46962306a36Sopenharmony_ci#define		FRONT_FACE_ADDR(x)				((x)<<12)
47062306a36Sopenharmony_ci#define		FOG_ADDR(x)					((x)<<17)
47162306a36Sopenharmony_ci#define		FIXED_PT_POSITION_ENA				(1<<24)
47262306a36Sopenharmony_ci#define		FIXED_PT_POSITION_ADDR(x)			((x)<<25)
47362306a36Sopenharmony_ci
47462306a36Sopenharmony_ci#define	SQ_MS_FIFO_SIZES				0x8CF0
47562306a36Sopenharmony_ci#define		CACHE_FIFO_SIZE(x)				((x) << 0)
47662306a36Sopenharmony_ci#define		FETCH_FIFO_HIWATER(x)				((x) << 8)
47762306a36Sopenharmony_ci#define		DONE_FIFO_HIWATER(x)				((x) << 16)
47862306a36Sopenharmony_ci#define		ALU_UPDATE_FIFO_HIWATER(x)			((x) << 24)
47962306a36Sopenharmony_ci#define	SQ_PGM_START_ES					0x28880
48062306a36Sopenharmony_ci#define	SQ_PGM_START_FS					0x28894
48162306a36Sopenharmony_ci#define	SQ_PGM_START_GS					0x2886C
48262306a36Sopenharmony_ci#define	SQ_PGM_START_PS					0x28840
48362306a36Sopenharmony_ci#define SQ_PGM_RESOURCES_PS                             0x28850
48462306a36Sopenharmony_ci#define SQ_PGM_EXPORTS_PS                               0x28854
48562306a36Sopenharmony_ci#define SQ_PGM_CF_OFFSET_PS                             0x288cc
48662306a36Sopenharmony_ci#define	SQ_PGM_START_VS					0x28858
48762306a36Sopenharmony_ci#define SQ_PGM_RESOURCES_VS                             0x28868
48862306a36Sopenharmony_ci#define SQ_PGM_CF_OFFSET_VS                             0x288d0
48962306a36Sopenharmony_ci
49062306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD0_0				0x30000
49162306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD1_0				0x30004
49262306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD2_0				0x30008
49362306a36Sopenharmony_ci#	define SQ_VTXC_BASE_ADDR_HI(x)			((x) << 0)
49462306a36Sopenharmony_ci#	define SQ_VTXC_STRIDE(x)			((x) << 8)
49562306a36Sopenharmony_ci#	define SQ_VTXC_ENDIAN_SWAP(x)			((x) << 30)
49662306a36Sopenharmony_ci#	define SQ_ENDIAN_NONE				0
49762306a36Sopenharmony_ci#	define SQ_ENDIAN_8IN16				1
49862306a36Sopenharmony_ci#	define SQ_ENDIAN_8IN32				2
49962306a36Sopenharmony_ci#define SQ_VTX_CONSTANT_WORD3_0				0x3000c
50062306a36Sopenharmony_ci#define	SQ_VTX_CONSTANT_WORD6_0				0x38018
50162306a36Sopenharmony_ci#define		S__SQ_VTX_CONSTANT_TYPE(x)			(((x) & 3) << 30)
50262306a36Sopenharmony_ci#define		G__SQ_VTX_CONSTANT_TYPE(x)			(((x) >> 30) & 3)
50362306a36Sopenharmony_ci#define			SQ_TEX_VTX_INVALID_TEXTURE			0x0
50462306a36Sopenharmony_ci#define			SQ_TEX_VTX_INVALID_BUFFER			0x1
50562306a36Sopenharmony_ci#define			SQ_TEX_VTX_VALID_TEXTURE			0x2
50662306a36Sopenharmony_ci#define			SQ_TEX_VTX_VALID_BUFFER				0x3
50762306a36Sopenharmony_ci
50862306a36Sopenharmony_ci
50962306a36Sopenharmony_ci#define	SX_MISC						0x28350
51062306a36Sopenharmony_ci#define	SX_MEMORY_EXPORT_BASE				0x9010
51162306a36Sopenharmony_ci#define	SX_DEBUG_1					0x9054
51262306a36Sopenharmony_ci#define		SMX_EVENT_RELEASE				(1 << 0)
51362306a36Sopenharmony_ci#define		ENABLE_NEW_SMX_ADDRESS				(1 << 16)
51462306a36Sopenharmony_ci
51562306a36Sopenharmony_ci#define	TA_CNTL_AUX					0x9508
51662306a36Sopenharmony_ci#define		DISABLE_CUBE_WRAP				(1 << 0)
51762306a36Sopenharmony_ci#define		DISABLE_CUBE_ANISO				(1 << 1)
51862306a36Sopenharmony_ci#define		SYNC_GRADIENT					(1 << 24)
51962306a36Sopenharmony_ci#define		SYNC_WALKER					(1 << 25)
52062306a36Sopenharmony_ci#define		SYNC_ALIGNER					(1 << 26)
52162306a36Sopenharmony_ci#define		BILINEAR_PRECISION_6_BIT			(0 << 31)
52262306a36Sopenharmony_ci#define		BILINEAR_PRECISION_8_BIT			(1 << 31)
52362306a36Sopenharmony_ci
52462306a36Sopenharmony_ci#define	TC_CNTL						0x9608
52562306a36Sopenharmony_ci#define		TC_L2_SIZE(x)					((x)<<5)
52662306a36Sopenharmony_ci#define		L2_DISABLE_LATE_HIT				(1<<9)
52762306a36Sopenharmony_ci
52862306a36Sopenharmony_ci#define	VC_ENHANCE					0x9714
52962306a36Sopenharmony_ci
53062306a36Sopenharmony_ci#define	VGT_CACHE_INVALIDATION				0x88C4
53162306a36Sopenharmony_ci#define		CACHE_INVALIDATION(x)				((x)<<0)
53262306a36Sopenharmony_ci#define			VC_ONLY						0
53362306a36Sopenharmony_ci#define			TC_ONLY						1
53462306a36Sopenharmony_ci#define			VC_AND_TC					2
53562306a36Sopenharmony_ci#define	VGT_DMA_BASE					0x287E8
53662306a36Sopenharmony_ci#define	VGT_DMA_BASE_HI					0x287E4
53762306a36Sopenharmony_ci#define	VGT_ES_PER_GS					0x88CC
53862306a36Sopenharmony_ci#define	VGT_GS_PER_ES					0x88C8
53962306a36Sopenharmony_ci#define	VGT_GS_PER_VS					0x88E8
54062306a36Sopenharmony_ci#define	VGT_GS_VERTEX_REUSE				0x88D4
54162306a36Sopenharmony_ci#define VGT_PRIMITIVE_TYPE                              0x8958
54262306a36Sopenharmony_ci#define	VGT_NUM_INSTANCES				0x8974
54362306a36Sopenharmony_ci#define	VGT_OUT_DEALLOC_CNTL				0x28C5C
54462306a36Sopenharmony_ci#define		DEALLOC_DIST_MASK				0x0000007F
54562306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_0			0x28B10
54662306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_1			0x28B14
54762306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_2			0x28B18
54862306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_3			0x28B1c
54962306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_HI_0			0x28B44
55062306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_HI_1			0x28B48
55162306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_HI_2			0x28B4c
55262306a36Sopenharmony_ci#define	VGT_STRMOUT_BASE_OFFSET_HI_3			0x28B50
55362306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_0			0x28AD8
55462306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_1			0x28AE8
55562306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_2			0x28AF8
55662306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_BASE_3			0x28B08
55762306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_OFFSET_0			0x28ADC
55862306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_OFFSET_1			0x28AEC
55962306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_OFFSET_2			0x28AFC
56062306a36Sopenharmony_ci#define	VGT_STRMOUT_BUFFER_OFFSET_3			0x28B0C
56162306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_0			0x28AD0
56262306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_1			0x28AE0
56362306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_2			0x28AF0
56462306a36Sopenharmony_ci#define VGT_STRMOUT_BUFFER_SIZE_3			0x28B00
56562306a36Sopenharmony_ci
56662306a36Sopenharmony_ci#define	VGT_STRMOUT_EN					0x28AB0
56762306a36Sopenharmony_ci#define	VGT_VERTEX_REUSE_BLOCK_CNTL			0x28C58
56862306a36Sopenharmony_ci#define		VTX_REUSE_DEPTH_MASK				0x000000FF
56962306a36Sopenharmony_ci#define VGT_EVENT_INITIATOR                             0x28a90
57062306a36Sopenharmony_ci#       define CACHE_FLUSH_AND_INV_EVENT_TS                     (0x14 << 0)
57162306a36Sopenharmony_ci#       define CACHE_FLUSH_AND_INV_EVENT                        (0x16 << 0)
57262306a36Sopenharmony_ci
57362306a36Sopenharmony_ci#define VM_CONTEXT0_CNTL				0x1410
57462306a36Sopenharmony_ci#define		ENABLE_CONTEXT					(1 << 0)
57562306a36Sopenharmony_ci#define		PAGE_TABLE_DEPTH(x)				(((x) & 3) << 1)
57662306a36Sopenharmony_ci#define		RANGE_PROTECTION_FAULT_ENABLE_DEFAULT		(1 << 4)
57762306a36Sopenharmony_ci#define VM_CONTEXT0_INVALIDATION_LOW_ADDR		0x1490
57862306a36Sopenharmony_ci#define VM_CONTEXT0_INVALIDATION_HIGH_ADDR		0x14B0
57962306a36Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_BASE_ADDR		0x1574
58062306a36Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_START_ADDR		0x1594
58162306a36Sopenharmony_ci#define VM_CONTEXT0_PAGE_TABLE_END_ADDR			0x15B4
58262306a36Sopenharmony_ci#define VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR	0x1554
58362306a36Sopenharmony_ci#define VM_CONTEXT0_REQUEST_RESPONSE			0x1470
58462306a36Sopenharmony_ci#define		REQUEST_TYPE(x)					(((x) & 0xf) << 0)
58562306a36Sopenharmony_ci#define		RESPONSE_TYPE_MASK				0x000000F0
58662306a36Sopenharmony_ci#define		RESPONSE_TYPE_SHIFT				4
58762306a36Sopenharmony_ci#define VM_L2_CNTL					0x1400
58862306a36Sopenharmony_ci#define		ENABLE_L2_CACHE					(1 << 0)
58962306a36Sopenharmony_ci#define		ENABLE_L2_FRAGMENT_PROCESSING			(1 << 1)
59062306a36Sopenharmony_ci#define		ENABLE_L2_PTE_CACHE_LRU_UPDATE_BY_WRITE		(1 << 9)
59162306a36Sopenharmony_ci#define		EFFECTIVE_L2_QUEUE_SIZE(x)			(((x) & 7) << 13)
59262306a36Sopenharmony_ci#define VM_L2_CNTL2					0x1404
59362306a36Sopenharmony_ci#define		INVALIDATE_ALL_L1_TLBS				(1 << 0)
59462306a36Sopenharmony_ci#define		INVALIDATE_L2_CACHE				(1 << 1)
59562306a36Sopenharmony_ci#define VM_L2_CNTL3					0x1408
59662306a36Sopenharmony_ci#define		BANK_SELECT_0(x)				(((x) & 0x1f) << 0)
59762306a36Sopenharmony_ci#define		BANK_SELECT_1(x)				(((x) & 0x1f) << 5)
59862306a36Sopenharmony_ci#define		L2_CACHE_UPDATE_MODE(x)				(((x) & 3) << 10)
59962306a36Sopenharmony_ci#define	VM_L2_STATUS					0x140C
60062306a36Sopenharmony_ci#define		L2_BUSY						(1 << 0)
60162306a36Sopenharmony_ci
60262306a36Sopenharmony_ci#define	WAIT_UNTIL					0x8040
60362306a36Sopenharmony_ci#define         WAIT_CP_DMA_IDLE_bit                            (1 << 8)
60462306a36Sopenharmony_ci#define         WAIT_2D_IDLE_bit                                (1 << 14)
60562306a36Sopenharmony_ci#define         WAIT_3D_IDLE_bit                                (1 << 15)
60662306a36Sopenharmony_ci#define         WAIT_2D_IDLECLEAN_bit                           (1 << 16)
60762306a36Sopenharmony_ci#define         WAIT_3D_IDLECLEAN_bit                           (1 << 17)
60862306a36Sopenharmony_ci
60962306a36Sopenharmony_ci/* async DMA */
61062306a36Sopenharmony_ci#define DMA_TILING_CONFIG                                 0x3ec4
61162306a36Sopenharmony_ci#define DMA_CONFIG                                        0x3e4c
61262306a36Sopenharmony_ci
61362306a36Sopenharmony_ci#define DMA_RB_CNTL                                       0xd000
61462306a36Sopenharmony_ci#       define DMA_RB_ENABLE                              (1 << 0)
61562306a36Sopenharmony_ci#       define DMA_RB_SIZE(x)                             ((x) << 1) /* log2 */
61662306a36Sopenharmony_ci#       define DMA_RB_SWAP_ENABLE                         (1 << 9) /* 8IN32 */
61762306a36Sopenharmony_ci#       define DMA_RPTR_WRITEBACK_ENABLE                  (1 << 12)
61862306a36Sopenharmony_ci#       define DMA_RPTR_WRITEBACK_SWAP_ENABLE             (1 << 13)  /* 8IN32 */
61962306a36Sopenharmony_ci#       define DMA_RPTR_WRITEBACK_TIMER(x)                ((x) << 16) /* log2 */
62062306a36Sopenharmony_ci#define DMA_RB_BASE                                       0xd004
62162306a36Sopenharmony_ci#define DMA_RB_RPTR                                       0xd008
62262306a36Sopenharmony_ci#define DMA_RB_WPTR                                       0xd00c
62362306a36Sopenharmony_ci
62462306a36Sopenharmony_ci#define DMA_RB_RPTR_ADDR_HI                               0xd01c
62562306a36Sopenharmony_ci#define DMA_RB_RPTR_ADDR_LO                               0xd020
62662306a36Sopenharmony_ci
62762306a36Sopenharmony_ci#define DMA_IB_CNTL                                       0xd024
62862306a36Sopenharmony_ci#       define DMA_IB_ENABLE                              (1 << 0)
62962306a36Sopenharmony_ci#       define DMA_IB_SWAP_ENABLE                         (1 << 4)
63062306a36Sopenharmony_ci#define DMA_IB_RPTR                                       0xd028
63162306a36Sopenharmony_ci#define DMA_CNTL                                          0xd02c
63262306a36Sopenharmony_ci#       define TRAP_ENABLE                                (1 << 0)
63362306a36Sopenharmony_ci#       define SEM_INCOMPLETE_INT_ENABLE                  (1 << 1)
63462306a36Sopenharmony_ci#       define SEM_WAIT_INT_ENABLE                        (1 << 2)
63562306a36Sopenharmony_ci#       define DATA_SWAP_ENABLE                           (1 << 3)
63662306a36Sopenharmony_ci#       define FENCE_SWAP_ENABLE                          (1 << 4)
63762306a36Sopenharmony_ci#       define CTXEMPTY_INT_ENABLE                        (1 << 28)
63862306a36Sopenharmony_ci#define DMA_STATUS_REG                                    0xd034
63962306a36Sopenharmony_ci#       define DMA_IDLE                                   (1 << 0)
64062306a36Sopenharmony_ci#define DMA_SEM_INCOMPLETE_TIMER_CNTL                     0xd044
64162306a36Sopenharmony_ci#define DMA_SEM_WAIT_FAIL_TIMER_CNTL                      0xd048
64262306a36Sopenharmony_ci#define DMA_MODE                                          0xd0bc
64362306a36Sopenharmony_ci
64462306a36Sopenharmony_ci/* async DMA packets */
64562306a36Sopenharmony_ci#define DMA_PACKET(cmd, t, s, n)	((((cmd) & 0xF) << 28) |	\
64662306a36Sopenharmony_ci					 (((t) & 0x1) << 23) |		\
64762306a36Sopenharmony_ci					 (((s) & 0x1) << 22) |		\
64862306a36Sopenharmony_ci					 (((n) & 0xFFFF) << 0))
64962306a36Sopenharmony_ci/* async DMA Packet types */
65062306a36Sopenharmony_ci#define	DMA_PACKET_WRITE				  0x2
65162306a36Sopenharmony_ci#define	DMA_PACKET_COPY					  0x3
65262306a36Sopenharmony_ci#define	DMA_PACKET_INDIRECT_BUFFER			  0x4
65362306a36Sopenharmony_ci#define	DMA_PACKET_SEMAPHORE				  0x5
65462306a36Sopenharmony_ci#define	DMA_PACKET_FENCE				  0x6
65562306a36Sopenharmony_ci#define	DMA_PACKET_TRAP					  0x7
65662306a36Sopenharmony_ci#define	DMA_PACKET_CONSTANT_FILL			  0xd /* 7xx only */
65762306a36Sopenharmony_ci#define	DMA_PACKET_NOP					  0xf
65862306a36Sopenharmony_ci
65962306a36Sopenharmony_ci#define IH_RB_CNTL                                        0x3e00
66062306a36Sopenharmony_ci#       define IH_RB_ENABLE                               (1 << 0)
66162306a36Sopenharmony_ci#       define IH_RB_SIZE(x)                              ((x) << 1) /* log2 */
66262306a36Sopenharmony_ci#       define IH_RB_FULL_DRAIN_ENABLE                    (1 << 6)
66362306a36Sopenharmony_ci#       define IH_WPTR_WRITEBACK_ENABLE                   (1 << 8)
66462306a36Sopenharmony_ci#       define IH_WPTR_WRITEBACK_TIMER(x)                 ((x) << 9) /* log2 */
66562306a36Sopenharmony_ci#       define IH_WPTR_OVERFLOW_ENABLE                    (1 << 16)
66662306a36Sopenharmony_ci#       define IH_WPTR_OVERFLOW_CLEAR                     (1 << 31)
66762306a36Sopenharmony_ci#define IH_RB_BASE                                        0x3e04
66862306a36Sopenharmony_ci#define IH_RB_RPTR                                        0x3e08
66962306a36Sopenharmony_ci#define IH_RB_WPTR                                        0x3e0c
67062306a36Sopenharmony_ci#       define RB_OVERFLOW                                (1 << 0)
67162306a36Sopenharmony_ci#       define WPTR_OFFSET_MASK                           0x3fffc
67262306a36Sopenharmony_ci#define IH_RB_WPTR_ADDR_HI                                0x3e10
67362306a36Sopenharmony_ci#define IH_RB_WPTR_ADDR_LO                                0x3e14
67462306a36Sopenharmony_ci#define IH_CNTL                                           0x3e18
67562306a36Sopenharmony_ci#       define ENABLE_INTR                                (1 << 0)
67662306a36Sopenharmony_ci#       define IH_MC_SWAP(x)                              ((x) << 1)
67762306a36Sopenharmony_ci#       define IH_MC_SWAP_NONE                            0
67862306a36Sopenharmony_ci#       define IH_MC_SWAP_16BIT                           1
67962306a36Sopenharmony_ci#       define IH_MC_SWAP_32BIT                           2
68062306a36Sopenharmony_ci#       define IH_MC_SWAP_64BIT                           3
68162306a36Sopenharmony_ci#       define RPTR_REARM                                 (1 << 4)
68262306a36Sopenharmony_ci#       define MC_WRREQ_CREDIT(x)                         ((x) << 15)
68362306a36Sopenharmony_ci#       define MC_WR_CLEAN_CNT(x)                         ((x) << 20)
68462306a36Sopenharmony_ci
68562306a36Sopenharmony_ci#define RLC_CNTL                                          0x3f00
68662306a36Sopenharmony_ci#       define RLC_ENABLE                                 (1 << 0)
68762306a36Sopenharmony_ci#define RLC_HB_BASE                                       0x3f10
68862306a36Sopenharmony_ci#define RLC_HB_CNTL                                       0x3f0c
68962306a36Sopenharmony_ci#define RLC_HB_RPTR                                       0x3f20
69062306a36Sopenharmony_ci#define RLC_HB_WPTR                                       0x3f1c
69162306a36Sopenharmony_ci#define RLC_HB_WPTR_LSB_ADDR                              0x3f14
69262306a36Sopenharmony_ci#define RLC_HB_WPTR_MSB_ADDR                              0x3f18
69362306a36Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_LSB				  0x3f38
69462306a36Sopenharmony_ci#define RLC_GPU_CLOCK_COUNT_MSB				  0x3f3c
69562306a36Sopenharmony_ci#define RLC_CAPTURE_GPU_CLOCK_COUNT			  0x3f40
69662306a36Sopenharmony_ci#define RLC_MC_CNTL                                       0x3f44
69762306a36Sopenharmony_ci#define RLC_UCODE_CNTL                                    0x3f48
69862306a36Sopenharmony_ci#define RLC_UCODE_ADDR                                    0x3f2c
69962306a36Sopenharmony_ci#define RLC_UCODE_DATA                                    0x3f30
70062306a36Sopenharmony_ci
70162306a36Sopenharmony_ci#define SRBM_SOFT_RESET                                   0xe60
70262306a36Sopenharmony_ci#       define SOFT_RESET_BIF                             (1 << 1)
70362306a36Sopenharmony_ci#       define SOFT_RESET_DMA                             (1 << 12)
70462306a36Sopenharmony_ci#       define SOFT_RESET_RLC                             (1 << 13)
70562306a36Sopenharmony_ci#       define SOFT_RESET_UVD                             (1 << 18)
70662306a36Sopenharmony_ci#       define RV770_SOFT_RESET_DMA                       (1 << 20)
70762306a36Sopenharmony_ci
70862306a36Sopenharmony_ci#define BIF_SCRATCH0                                      0x5438
70962306a36Sopenharmony_ci
71062306a36Sopenharmony_ci#define BUS_CNTL                                          0x5420
71162306a36Sopenharmony_ci#       define BIOS_ROM_DIS                               (1 << 1)
71262306a36Sopenharmony_ci#       define VGA_COHE_SPEC_TIMER_DIS                    (1 << 9)
71362306a36Sopenharmony_ci
71462306a36Sopenharmony_ci#define CP_INT_CNTL                                       0xc124
71562306a36Sopenharmony_ci#       define CNTX_BUSY_INT_ENABLE                       (1 << 19)
71662306a36Sopenharmony_ci#       define CNTX_EMPTY_INT_ENABLE                      (1 << 20)
71762306a36Sopenharmony_ci#       define SCRATCH_INT_ENABLE                         (1 << 25)
71862306a36Sopenharmony_ci#       define TIME_STAMP_INT_ENABLE                      (1 << 26)
71962306a36Sopenharmony_ci#       define IB2_INT_ENABLE                             (1 << 29)
72062306a36Sopenharmony_ci#       define IB1_INT_ENABLE                             (1 << 30)
72162306a36Sopenharmony_ci#       define RB_INT_ENABLE                              (1 << 31)
72262306a36Sopenharmony_ci#define CP_INT_STATUS                                     0xc128
72362306a36Sopenharmony_ci#       define SCRATCH_INT_STAT                           (1 << 25)
72462306a36Sopenharmony_ci#       define TIME_STAMP_INT_STAT                        (1 << 26)
72562306a36Sopenharmony_ci#       define IB2_INT_STAT                               (1 << 29)
72662306a36Sopenharmony_ci#       define IB1_INT_STAT                               (1 << 30)
72762306a36Sopenharmony_ci#       define RB_INT_STAT                                (1 << 31)
72862306a36Sopenharmony_ci
72962306a36Sopenharmony_ci#define GRBM_INT_CNTL                                     0x8060
73062306a36Sopenharmony_ci#       define RDERR_INT_ENABLE                           (1 << 0)
73162306a36Sopenharmony_ci#       define WAIT_COUNT_TIMEOUT_INT_ENABLE              (1 << 1)
73262306a36Sopenharmony_ci#       define GUI_IDLE_INT_ENABLE                        (1 << 19)
73362306a36Sopenharmony_ci
73462306a36Sopenharmony_ci#define INTERRUPT_CNTL                                    0x5468
73562306a36Sopenharmony_ci#       define IH_DUMMY_RD_OVERRIDE                       (1 << 0)
73662306a36Sopenharmony_ci#       define IH_DUMMY_RD_EN                             (1 << 1)
73762306a36Sopenharmony_ci#       define IH_REQ_NONSNOOP_EN                         (1 << 3)
73862306a36Sopenharmony_ci#       define GEN_IH_INT_EN                              (1 << 8)
73962306a36Sopenharmony_ci#define INTERRUPT_CNTL2                                   0x546c
74062306a36Sopenharmony_ci
74162306a36Sopenharmony_ci#define D1MODE_VBLANK_STATUS                              0x6534
74262306a36Sopenharmony_ci#define D2MODE_VBLANK_STATUS                              0x6d34
74362306a36Sopenharmony_ci#       define DxMODE_VBLANK_OCCURRED                     (1 << 0)
74462306a36Sopenharmony_ci#       define DxMODE_VBLANK_ACK                          (1 << 4)
74562306a36Sopenharmony_ci#       define DxMODE_VBLANK_STAT                         (1 << 12)
74662306a36Sopenharmony_ci#       define DxMODE_VBLANK_INTERRUPT                    (1 << 16)
74762306a36Sopenharmony_ci#       define DxMODE_VBLANK_INTERRUPT_TYPE               (1 << 17)
74862306a36Sopenharmony_ci#define D1MODE_VLINE_STATUS                               0x653c
74962306a36Sopenharmony_ci#define D2MODE_VLINE_STATUS                               0x6d3c
75062306a36Sopenharmony_ci#       define DxMODE_VLINE_OCCURRED                      (1 << 0)
75162306a36Sopenharmony_ci#       define DxMODE_VLINE_ACK                           (1 << 4)
75262306a36Sopenharmony_ci#       define DxMODE_VLINE_STAT                          (1 << 12)
75362306a36Sopenharmony_ci#       define DxMODE_VLINE_INTERRUPT                     (1 << 16)
75462306a36Sopenharmony_ci#       define DxMODE_VLINE_INTERRUPT_TYPE                (1 << 17)
75562306a36Sopenharmony_ci#define DxMODE_INT_MASK                                   0x6540
75662306a36Sopenharmony_ci#       define D1MODE_VBLANK_INT_MASK                     (1 << 0)
75762306a36Sopenharmony_ci#       define D1MODE_VLINE_INT_MASK                      (1 << 4)
75862306a36Sopenharmony_ci#       define D2MODE_VBLANK_INT_MASK                     (1 << 8)
75962306a36Sopenharmony_ci#       define D2MODE_VLINE_INT_MASK                      (1 << 12)
76062306a36Sopenharmony_ci#define DCE3_DISP_INTERRUPT_STATUS                        0x7ddc
76162306a36Sopenharmony_ci#       define DC_HPD1_INTERRUPT                          (1 << 18)
76262306a36Sopenharmony_ci#       define DC_HPD2_INTERRUPT                          (1 << 19)
76362306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS                             0x7edc
76462306a36Sopenharmony_ci#       define LB_D1_VLINE_INTERRUPT                      (1 << 2)
76562306a36Sopenharmony_ci#       define LB_D2_VLINE_INTERRUPT                      (1 << 3)
76662306a36Sopenharmony_ci#       define LB_D1_VBLANK_INTERRUPT                     (1 << 4)
76762306a36Sopenharmony_ci#       define LB_D2_VBLANK_INTERRUPT                     (1 << 5)
76862306a36Sopenharmony_ci#       define DACA_AUTODETECT_INTERRUPT                  (1 << 16)
76962306a36Sopenharmony_ci#       define DACB_AUTODETECT_INTERRUPT                  (1 << 17)
77062306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECT1_INTERRUPT              (1 << 18)
77162306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECT2_INTERRUPT              (1 << 19)
77262306a36Sopenharmony_ci#       define DC_I2C_SW_DONE_INTERRUPT                   (1 << 20)
77362306a36Sopenharmony_ci#       define DC_I2C_HW_DONE_INTERRUPT                   (1 << 21)
77462306a36Sopenharmony_ci#define DISP_INTERRUPT_STATUS_CONTINUE                    0x7ee8
77562306a36Sopenharmony_ci#define DCE3_DISP_INTERRUPT_STATUS_CONTINUE               0x7de8
77662306a36Sopenharmony_ci#       define DC_HPD4_INTERRUPT                          (1 << 14)
77762306a36Sopenharmony_ci#       define DC_HPD4_RX_INTERRUPT                       (1 << 15)
77862306a36Sopenharmony_ci#       define DC_HPD3_INTERRUPT                          (1 << 28)
77962306a36Sopenharmony_ci#       define DC_HPD1_RX_INTERRUPT                       (1 << 29)
78062306a36Sopenharmony_ci#       define DC_HPD2_RX_INTERRUPT                       (1 << 30)
78162306a36Sopenharmony_ci#define DCE3_DISP_INTERRUPT_STATUS_CONTINUE2              0x7dec
78262306a36Sopenharmony_ci#       define DC_HPD3_RX_INTERRUPT                       (1 << 0)
78362306a36Sopenharmony_ci#       define DIGA_DP_VID_STREAM_DISABLE_INTERRUPT       (1 << 1)
78462306a36Sopenharmony_ci#       define DIGA_DP_STEER_FIFO_OVERFLOW_INTERRUPT      (1 << 2)
78562306a36Sopenharmony_ci#       define DIGB_DP_VID_STREAM_DISABLE_INTERRUPT       (1 << 3)
78662306a36Sopenharmony_ci#       define DIGB_DP_STEER_FIFO_OVERFLOW_INTERRUPT      (1 << 4)
78762306a36Sopenharmony_ci#       define AUX1_SW_DONE_INTERRUPT                     (1 << 5)
78862306a36Sopenharmony_ci#       define AUX1_LS_DONE_INTERRUPT                     (1 << 6)
78962306a36Sopenharmony_ci#       define AUX2_SW_DONE_INTERRUPT                     (1 << 7)
79062306a36Sopenharmony_ci#       define AUX2_LS_DONE_INTERRUPT                     (1 << 8)
79162306a36Sopenharmony_ci#       define AUX3_SW_DONE_INTERRUPT                     (1 << 9)
79262306a36Sopenharmony_ci#       define AUX3_LS_DONE_INTERRUPT                     (1 << 10)
79362306a36Sopenharmony_ci#       define AUX4_SW_DONE_INTERRUPT                     (1 << 11)
79462306a36Sopenharmony_ci#       define AUX4_LS_DONE_INTERRUPT                     (1 << 12)
79562306a36Sopenharmony_ci#       define DIGA_DP_FAST_TRAINING_COMPLETE_INTERRUPT   (1 << 13)
79662306a36Sopenharmony_ci#       define DIGB_DP_FAST_TRAINING_COMPLETE_INTERRUPT   (1 << 14)
79762306a36Sopenharmony_ci/* DCE 3.2 */
79862306a36Sopenharmony_ci#       define AUX5_SW_DONE_INTERRUPT                     (1 << 15)
79962306a36Sopenharmony_ci#       define AUX5_LS_DONE_INTERRUPT                     (1 << 16)
80062306a36Sopenharmony_ci#       define AUX6_SW_DONE_INTERRUPT                     (1 << 17)
80162306a36Sopenharmony_ci#       define AUX6_LS_DONE_INTERRUPT                     (1 << 18)
80262306a36Sopenharmony_ci#       define DC_HPD5_INTERRUPT                          (1 << 19)
80362306a36Sopenharmony_ci#       define DC_HPD5_RX_INTERRUPT                       (1 << 20)
80462306a36Sopenharmony_ci#       define DC_HPD6_INTERRUPT                          (1 << 21)
80562306a36Sopenharmony_ci#       define DC_HPD6_RX_INTERRUPT                       (1 << 22)
80662306a36Sopenharmony_ci
80762306a36Sopenharmony_ci#define DACA_AUTO_DETECT_CONTROL                          0x7828
80862306a36Sopenharmony_ci#define DACB_AUTO_DETECT_CONTROL                          0x7a28
80962306a36Sopenharmony_ci#define DCE3_DACA_AUTO_DETECT_CONTROL                     0x7028
81062306a36Sopenharmony_ci#define DCE3_DACB_AUTO_DETECT_CONTROL                     0x7128
81162306a36Sopenharmony_ci#       define DACx_AUTODETECT_MODE(x)                    ((x) << 0)
81262306a36Sopenharmony_ci#       define DACx_AUTODETECT_MODE_NONE                  0
81362306a36Sopenharmony_ci#       define DACx_AUTODETECT_MODE_CONNECT               1
81462306a36Sopenharmony_ci#       define DACx_AUTODETECT_MODE_DISCONNECT            2
81562306a36Sopenharmony_ci#       define DACx_AUTODETECT_FRAME_TIME_COUNTER(x)      ((x) << 8)
81662306a36Sopenharmony_ci/* bit 18 = R/C, 17 = G/Y, 16 = B/Comp */
81762306a36Sopenharmony_ci#       define DACx_AUTODETECT_CHECK_MASK(x)              ((x) << 16)
81862306a36Sopenharmony_ci
81962306a36Sopenharmony_ci#define DCE3_DACA_AUTODETECT_INT_CONTROL                  0x7038
82062306a36Sopenharmony_ci#define DCE3_DACB_AUTODETECT_INT_CONTROL                  0x7138
82162306a36Sopenharmony_ci#define DACA_AUTODETECT_INT_CONTROL                       0x7838
82262306a36Sopenharmony_ci#define DACB_AUTODETECT_INT_CONTROL                       0x7a38
82362306a36Sopenharmony_ci#       define DACx_AUTODETECT_ACK                        (1 << 0)
82462306a36Sopenharmony_ci#       define DACx_AUTODETECT_INT_ENABLE                 (1 << 16)
82562306a36Sopenharmony_ci
82662306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT1_CONTROL                       0x7d00
82762306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT2_CONTROL                       0x7d10
82862306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT3_CONTROL                       0x7d24
82962306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECTx_EN                     (1 << 0)
83062306a36Sopenharmony_ci
83162306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT1_INT_STATUS                    0x7d04
83262306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT2_INT_STATUS                    0x7d14
83362306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT3_INT_STATUS                    0x7d28
83462306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECTx_INT_STATUS             (1 << 0)
83562306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECTx_SENSE                  (1 << 1)
83662306a36Sopenharmony_ci
83762306a36Sopenharmony_ci/* DCE 3.0 */
83862306a36Sopenharmony_ci#define DC_HPD1_INT_STATUS                                0x7d00
83962306a36Sopenharmony_ci#define DC_HPD2_INT_STATUS                                0x7d0c
84062306a36Sopenharmony_ci#define DC_HPD3_INT_STATUS                                0x7d18
84162306a36Sopenharmony_ci#define DC_HPD4_INT_STATUS                                0x7d24
84262306a36Sopenharmony_ci/* DCE 3.2 */
84362306a36Sopenharmony_ci#define DC_HPD5_INT_STATUS                                0x7dc0
84462306a36Sopenharmony_ci#define DC_HPD6_INT_STATUS                                0x7df4
84562306a36Sopenharmony_ci#       define DC_HPDx_INT_STATUS                         (1 << 0)
84662306a36Sopenharmony_ci#       define DC_HPDx_SENSE                              (1 << 1)
84762306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_STATUS                      (1 << 8)
84862306a36Sopenharmony_ci
84962306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT1_INT_CONTROL                   0x7d08
85062306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT2_INT_CONTROL                   0x7d18
85162306a36Sopenharmony_ci#define DC_HOT_PLUG_DETECT3_INT_CONTROL                   0x7d2c
85262306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECTx_INT_ACK                (1 << 0)
85362306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECTx_INT_POLARITY           (1 << 8)
85462306a36Sopenharmony_ci#       define DC_HOT_PLUG_DETECTx_INT_EN                 (1 << 16)
85562306a36Sopenharmony_ci/* DCE 3.0 */
85662306a36Sopenharmony_ci#define DC_HPD1_INT_CONTROL                               0x7d04
85762306a36Sopenharmony_ci#define DC_HPD2_INT_CONTROL                               0x7d10
85862306a36Sopenharmony_ci#define DC_HPD3_INT_CONTROL                               0x7d1c
85962306a36Sopenharmony_ci#define DC_HPD4_INT_CONTROL                               0x7d28
86062306a36Sopenharmony_ci/* DCE 3.2 */
86162306a36Sopenharmony_ci#define DC_HPD5_INT_CONTROL                               0x7dc4
86262306a36Sopenharmony_ci#define DC_HPD6_INT_CONTROL                               0x7df8
86362306a36Sopenharmony_ci#       define DC_HPDx_INT_ACK                            (1 << 0)
86462306a36Sopenharmony_ci#       define DC_HPDx_INT_POLARITY                       (1 << 8)
86562306a36Sopenharmony_ci#       define DC_HPDx_INT_EN                             (1 << 16)
86662306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_ACK                         (1 << 20)
86762306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_EN                          (1 << 24)
86862306a36Sopenharmony_ci
86962306a36Sopenharmony_ci/* DCE 3.0 */
87062306a36Sopenharmony_ci#define DC_HPD1_CONTROL                                   0x7d08
87162306a36Sopenharmony_ci#define DC_HPD2_CONTROL                                   0x7d14
87262306a36Sopenharmony_ci#define DC_HPD3_CONTROL                                   0x7d20
87362306a36Sopenharmony_ci#define DC_HPD4_CONTROL                                   0x7d2c
87462306a36Sopenharmony_ci/* DCE 3.2 */
87562306a36Sopenharmony_ci#define DC_HPD5_CONTROL                                   0x7dc8
87662306a36Sopenharmony_ci#define DC_HPD6_CONTROL                                   0x7dfc
87762306a36Sopenharmony_ci#       define DC_HPDx_CONNECTION_TIMER(x)                ((x) << 0)
87862306a36Sopenharmony_ci#       define DC_HPDx_RX_INT_TIMER(x)                    ((x) << 16)
87962306a36Sopenharmony_ci/* DCE 3.2 */
88062306a36Sopenharmony_ci#       define DC_HPDx_EN                                 (1 << 28)
88162306a36Sopenharmony_ci
88262306a36Sopenharmony_ci#define D1GRPH_INTERRUPT_STATUS                           0x6158
88362306a36Sopenharmony_ci#define D2GRPH_INTERRUPT_STATUS                           0x6958
88462306a36Sopenharmony_ci#       define DxGRPH_PFLIP_INT_OCCURRED                  (1 << 0)
88562306a36Sopenharmony_ci#       define DxGRPH_PFLIP_INT_CLEAR                     (1 << 8)
88662306a36Sopenharmony_ci#define D1GRPH_INTERRUPT_CONTROL                          0x615c
88762306a36Sopenharmony_ci#define D2GRPH_INTERRUPT_CONTROL                          0x695c
88862306a36Sopenharmony_ci#       define DxGRPH_PFLIP_INT_MASK                      (1 << 0)
88962306a36Sopenharmony_ci#       define DxGRPH_PFLIP_INT_TYPE                      (1 << 8)
89062306a36Sopenharmony_ci
89162306a36Sopenharmony_ci/* PCIE link stuff */
89262306a36Sopenharmony_ci#define PCIE_LC_TRAINING_CNTL                             0xa1 /* PCIE_P */
89362306a36Sopenharmony_ci#       define LC_POINT_7_PLUS_EN                         (1 << 6)
89462306a36Sopenharmony_ci#define PCIE_LC_LINK_WIDTH_CNTL                           0xa2 /* PCIE_P */
89562306a36Sopenharmony_ci#       define LC_LINK_WIDTH_SHIFT                        0
89662306a36Sopenharmony_ci#       define LC_LINK_WIDTH_MASK                         0x7
89762306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X0                           0
89862306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X1                           1
89962306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X2                           2
90062306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X4                           3
90162306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X8                           4
90262306a36Sopenharmony_ci#       define LC_LINK_WIDTH_X16                          6
90362306a36Sopenharmony_ci#       define LC_LINK_WIDTH_RD_SHIFT                     4
90462306a36Sopenharmony_ci#       define LC_LINK_WIDTH_RD_MASK                      0x70
90562306a36Sopenharmony_ci#       define LC_RECONFIG_ARC_MISSING_ESCAPE             (1 << 7)
90662306a36Sopenharmony_ci#       define LC_RECONFIG_NOW                            (1 << 8)
90762306a36Sopenharmony_ci#       define LC_RENEGOTIATION_SUPPORT                   (1 << 9)
90862306a36Sopenharmony_ci#       define LC_RENEGOTIATE_EN                          (1 << 10)
90962306a36Sopenharmony_ci#       define LC_SHORT_RECONFIG_EN                       (1 << 11)
91062306a36Sopenharmony_ci#       define LC_UPCONFIGURE_SUPPORT                     (1 << 12)
91162306a36Sopenharmony_ci#       define LC_UPCONFIGURE_DIS                         (1 << 13)
91262306a36Sopenharmony_ci#define PCIE_LC_SPEED_CNTL                                0xa4 /* PCIE_P */
91362306a36Sopenharmony_ci#       define LC_GEN2_EN_STRAP                           (1 << 0)
91462306a36Sopenharmony_ci#       define LC_TARGET_LINK_SPEED_OVERRIDE_EN           (1 << 1)
91562306a36Sopenharmony_ci#       define LC_FORCE_EN_HW_SPEED_CHANGE                (1 << 5)
91662306a36Sopenharmony_ci#       define LC_FORCE_DIS_HW_SPEED_CHANGE               (1 << 6)
91762306a36Sopenharmony_ci#       define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK      (0x3 << 8)
91862306a36Sopenharmony_ci#       define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT     3
91962306a36Sopenharmony_ci#       define LC_CURRENT_DATA_RATE                       (1 << 11)
92062306a36Sopenharmony_ci#       define LC_VOLTAGE_TIMER_SEL_MASK                  (0xf << 14)
92162306a36Sopenharmony_ci#       define LC_CLR_FAILED_SPD_CHANGE_CNT               (1 << 21)
92262306a36Sopenharmony_ci#       define LC_OTHER_SIDE_EVER_SENT_GEN2               (1 << 23)
92362306a36Sopenharmony_ci#       define LC_OTHER_SIDE_SUPPORTS_GEN2                (1 << 24)
92462306a36Sopenharmony_ci#define MM_CFGREGS_CNTL                                   0x544c
92562306a36Sopenharmony_ci#       define MM_WR_TO_CFG_EN                            (1 << 3)
92662306a36Sopenharmony_ci#define LINK_CNTL2                                        0x88 /* F0 */
92762306a36Sopenharmony_ci#       define TARGET_LINK_SPEED_MASK                     (0xf << 0)
92862306a36Sopenharmony_ci#       define SELECTABLE_DEEMPHASIS                      (1 << 6)
92962306a36Sopenharmony_ci
93062306a36Sopenharmony_ci/* Audio */
93162306a36Sopenharmony_ci#define AZ_HOT_PLUG_CONTROL               0x7300
93262306a36Sopenharmony_ci#       define AZ_FORCE_CODEC_WAKE        (1 << 0)
93362306a36Sopenharmony_ci#       define JACK_DETECTION_ENABLE      (1 << 4)
93462306a36Sopenharmony_ci#       define UNSOLICITED_RESPONSE_ENABLE (1 << 8)
93562306a36Sopenharmony_ci#       define CODEC_HOT_PLUG_ENABLE      (1 << 12)
93662306a36Sopenharmony_ci#       define AUDIO_ENABLED              (1 << 31)
93762306a36Sopenharmony_ci/* DCE3 adds */
93862306a36Sopenharmony_ci#       define PIN0_JACK_DETECTION_ENABLE (1 << 4)
93962306a36Sopenharmony_ci#       define PIN1_JACK_DETECTION_ENABLE (1 << 5)
94062306a36Sopenharmony_ci#       define PIN2_JACK_DETECTION_ENABLE (1 << 6)
94162306a36Sopenharmony_ci#       define PIN3_JACK_DETECTION_ENABLE (1 << 7)
94262306a36Sopenharmony_ci#       define PIN0_AUDIO_ENABLED         (1 << 24)
94362306a36Sopenharmony_ci#       define PIN1_AUDIO_ENABLED         (1 << 25)
94462306a36Sopenharmony_ci#       define PIN2_AUDIO_ENABLED         (1 << 26)
94562306a36Sopenharmony_ci#       define PIN3_AUDIO_ENABLED         (1 << 27)
94662306a36Sopenharmony_ci
94762306a36Sopenharmony_ci/* Audio clocks DCE 2.0/3.0 */
94862306a36Sopenharmony_ci#define AUDIO_DTO                         0x7340
94962306a36Sopenharmony_ci#       define AUDIO_DTO_PHASE(x)         (((x) & 0xffff) << 0)
95062306a36Sopenharmony_ci#       define AUDIO_DTO_MODULE(x)        (((x) & 0xffff) << 16)
95162306a36Sopenharmony_ci
95262306a36Sopenharmony_ci/* Audio clocks DCE 3.2 */
95362306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_PHASE             0x0514
95462306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_MODULE            0x0518
95562306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_LOAD              0x051c
95662306a36Sopenharmony_ci#       define DTO_LOAD                   (1 << 31)
95762306a36Sopenharmony_ci#define DCCG_AUDIO_DTO0_CNTL              0x0520
95862306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_WALLCLOCK_RATIO(x) (((x) & 7) << 0)
95962306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK 7
96062306a36Sopenharmony_ci#       define DCCG_AUDIO_DTO_WALLCLOCK_RATIO_SHIFT 0
96162306a36Sopenharmony_ci
96262306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_PHASE             0x0524
96362306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_MODULE            0x0528
96462306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_LOAD              0x052c
96562306a36Sopenharmony_ci#define DCCG_AUDIO_DTO1_CNTL              0x0530
96662306a36Sopenharmony_ci
96762306a36Sopenharmony_ci#define DCCG_AUDIO_DTO_SELECT             0x0534
96862306a36Sopenharmony_ci
96962306a36Sopenharmony_ci/* digital blocks */
97062306a36Sopenharmony_ci#define TMDSA_CNTL                       0x7880
97162306a36Sopenharmony_ci#       define TMDSA_HDMI_EN             (1 << 2)
97262306a36Sopenharmony_ci#define LVTMA_CNTL                       0x7a80
97362306a36Sopenharmony_ci#       define LVTMA_HDMI_EN             (1 << 2)
97462306a36Sopenharmony_ci#define DDIA_CNTL                        0x7200
97562306a36Sopenharmony_ci#       define DDIA_HDMI_EN              (1 << 2)
97662306a36Sopenharmony_ci#define DIG0_CNTL                        0x75a0
97762306a36Sopenharmony_ci#       define DIG_MODE(x)               (((x) & 7) << 8)
97862306a36Sopenharmony_ci#       define DIG_MODE_DP               0
97962306a36Sopenharmony_ci#       define DIG_MODE_LVDS             1
98062306a36Sopenharmony_ci#       define DIG_MODE_TMDS_DVI         2
98162306a36Sopenharmony_ci#       define DIG_MODE_TMDS_HDMI        3
98262306a36Sopenharmony_ci#       define DIG_MODE_SDVO             4
98362306a36Sopenharmony_ci#define DIG1_CNTL                        0x79a0
98462306a36Sopenharmony_ci
98562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER          0x71bc
98662306a36Sopenharmony_ci#define		SPEAKER_ALLOCATION(x)			(((x) & 0x7f) << 0)
98762306a36Sopenharmony_ci#define		SPEAKER_ALLOCATION_MASK			(0x7f << 0)
98862306a36Sopenharmony_ci#define		SPEAKER_ALLOCATION_SHIFT		0
98962306a36Sopenharmony_ci#define		HDMI_CONNECTION				(1 << 16)
99062306a36Sopenharmony_ci#define		DP_CONNECTION				(1 << 17)
99162306a36Sopenharmony_ci
99262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0        0x71c8 /* LPCM */
99362306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1        0x71cc /* AC3 */
99462306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR2        0x71d0 /* MPEG1 */
99562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR3        0x71d4 /* MP3 */
99662306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR4        0x71d8 /* MPEG2 */
99762306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR5        0x71dc /* AAC */
99862306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR6        0x71e0 /* DTS */
99962306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR7        0x71e4 /* ATRAC */
100062306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR8        0x71e8 /* one bit audio - leave at 0 (default) */
100162306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR9        0x71ec /* Dolby Digital */
100262306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR10       0x71f0 /* DTS-HD */
100362306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR11       0x71f4 /* MAT-MLP */
100462306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR12       0x71f8 /* DTS */
100562306a36Sopenharmony_ci#define AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR13       0x71fc /* WMA Pro */
100662306a36Sopenharmony_ci#       define MAX_CHANNELS(x)                            (((x) & 0x7) << 0)
100762306a36Sopenharmony_ci/* max channels minus one.  7 = 8 channels */
100862306a36Sopenharmony_ci#       define SUPPORTED_FREQUENCIES(x)                   (((x) & 0xff) << 8)
100962306a36Sopenharmony_ci#       define DESCRIPTOR_BYTE_2(x)                       (((x) & 0xff) << 16)
101062306a36Sopenharmony_ci#       define SUPPORTED_FREQUENCIES_STEREO(x)            (((x) & 0xff) << 24) /* LPCM only */
101162306a36Sopenharmony_ci/* SUPPORTED_FREQUENCIES, SUPPORTED_FREQUENCIES_STEREO
101262306a36Sopenharmony_ci * bit0 = 32 kHz
101362306a36Sopenharmony_ci * bit1 = 44.1 kHz
101462306a36Sopenharmony_ci * bit2 = 48 kHz
101562306a36Sopenharmony_ci * bit3 = 88.2 kHz
101662306a36Sopenharmony_ci * bit4 = 96 kHz
101762306a36Sopenharmony_ci * bit5 = 176.4 kHz
101862306a36Sopenharmony_ci * bit6 = 192 kHz
101962306a36Sopenharmony_ci */
102062306a36Sopenharmony_ci
102162306a36Sopenharmony_ci/* rs6xx/rs740 and r6xx share the same HDMI blocks, however, rs6xx has only one
102262306a36Sopenharmony_ci * instance of the blocks while r6xx has 2.  DCE 3.0 cards are slightly
102362306a36Sopenharmony_ci * different due to the new DIG blocks, but also have 2 instances.
102462306a36Sopenharmony_ci * DCE 3.0 HDMI blocks are part of each DIG encoder.
102562306a36Sopenharmony_ci */
102662306a36Sopenharmony_ci
102762306a36Sopenharmony_ci/* rs6xx/rs740/r6xx/dce3 */
102862306a36Sopenharmony_ci#define HDMI0_CONTROL                0x7400
102962306a36Sopenharmony_ci/* rs6xx/rs740/r6xx */
103062306a36Sopenharmony_ci#       define HDMI0_ENABLE          (1 << 0)
103162306a36Sopenharmony_ci#       define HDMI0_STREAM(x)       (((x) & 3) << 2)
103262306a36Sopenharmony_ci#       define HDMI0_STREAM_TMDSA    0
103362306a36Sopenharmony_ci#       define HDMI0_STREAM_LVTMA    1
103462306a36Sopenharmony_ci#       define HDMI0_STREAM_DVOA     2
103562306a36Sopenharmony_ci#       define HDMI0_STREAM_DDIA     3
103662306a36Sopenharmony_ci/* rs6xx/r6xx/dce3 */
103762306a36Sopenharmony_ci#       define HDMI0_ERROR_ACK       (1 << 8)
103862306a36Sopenharmony_ci#       define HDMI0_ERROR_MASK      (1 << 9)
103962306a36Sopenharmony_ci#define HDMI0_STATUS                 0x7404
104062306a36Sopenharmony_ci#       define HDMI0_ACTIVE_AVMUTE   (1 << 0)
104162306a36Sopenharmony_ci#       define HDMI0_AUDIO_ENABLE    (1 << 4)
104262306a36Sopenharmony_ci#       define HDMI0_AZ_FORMAT_WTRIG     (1 << 28)
104362306a36Sopenharmony_ci#       define HDMI0_AZ_FORMAT_WTRIG_INT (1 << 29)
104462306a36Sopenharmony_ci#define HDMI0_AUDIO_PACKET_CONTROL   0x7408
104562306a36Sopenharmony_ci#       define HDMI0_AUDIO_SAMPLE_SEND  (1 << 0)
104662306a36Sopenharmony_ci#       define HDMI0_AUDIO_DELAY_EN(x)  (((x) & 3) << 4)
104762306a36Sopenharmony_ci#       define HDMI0_AUDIO_DELAY_EN_MASK	(3 << 4)
104862306a36Sopenharmony_ci#       define HDMI0_AUDIO_SEND_MAX_PACKETS  (1 << 8)
104962306a36Sopenharmony_ci#       define HDMI0_AUDIO_TEST_EN         (1 << 12)
105062306a36Sopenharmony_ci#       define HDMI0_AUDIO_PACKETS_PER_LINE(x)  (((x) & 0x1f) << 16)
105162306a36Sopenharmony_ci#       define HDMI0_AUDIO_PACKETS_PER_LINE_MASK	(0x1f << 16)
105262306a36Sopenharmony_ci#       define HDMI0_AUDIO_CHANNEL_SWAP    (1 << 24)
105362306a36Sopenharmony_ci#       define HDMI0_60958_CS_UPDATE       (1 << 26)
105462306a36Sopenharmony_ci#       define HDMI0_AZ_FORMAT_WTRIG_MASK  (1 << 28)
105562306a36Sopenharmony_ci#       define HDMI0_AZ_FORMAT_WTRIG_ACK   (1 << 29)
105662306a36Sopenharmony_ci#define HDMI0_AUDIO_CRC_CONTROL      0x740c
105762306a36Sopenharmony_ci#       define HDMI0_AUDIO_CRC_EN    (1 << 0)
105862306a36Sopenharmony_ci#define DCE3_HDMI0_ACR_PACKET_CONTROL	0x740c
105962306a36Sopenharmony_ci#define HDMI0_VBI_PACKET_CONTROL     0x7410
106062306a36Sopenharmony_ci#       define HDMI0_NULL_SEND       (1 << 0)
106162306a36Sopenharmony_ci#       define HDMI0_GC_SEND         (1 << 4)
106262306a36Sopenharmony_ci#       define HDMI0_GC_CONT         (1 << 5) /* 0 - once; 1 - every frame */
106362306a36Sopenharmony_ci#define HDMI0_INFOFRAME_CONTROL0     0x7414
106462306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_SEND   (1 << 0)
106562306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_CONT   (1 << 1)
106662306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_SEND (1 << 4)
106762306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_CONT (1 << 5)
106862306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_SOURCE (1 << 6) /* 0 - sound block; 1 - hdmi regs */
106962306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_UPDATE (1 << 7)
107062306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_SEND  (1 << 8)
107162306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_CONT  (1 << 9)
107262306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_UPDATE  (1 << 10)
107362306a36Sopenharmony_ci#define HDMI0_INFOFRAME_CONTROL1     0x7418
107462306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_LINE(x)  (((x) & 0x3f) << 0)
107562306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_LINE_MASK		(0x3f << 0)
107662306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_LINE(x)  (((x) & 0x3f) << 8)
107762306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_LINE_MASK	(0x3f << 8)
107862306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_LINE(x)  (((x) & 0x3f) << 16)
107962306a36Sopenharmony_ci#define HDMI0_GENERIC_PACKET_CONTROL 0x741c
108062306a36Sopenharmony_ci#       define HDMI0_GENERIC0_SEND   (1 << 0)
108162306a36Sopenharmony_ci#       define HDMI0_GENERIC0_CONT   (1 << 1)
108262306a36Sopenharmony_ci#       define HDMI0_GENERIC0_UPDATE (1 << 2)
108362306a36Sopenharmony_ci#       define HDMI0_GENERIC1_SEND   (1 << 4)
108462306a36Sopenharmony_ci#       define HDMI0_GENERIC1_CONT   (1 << 5)
108562306a36Sopenharmony_ci#       define HDMI0_GENERIC0_LINE(x)  (((x) & 0x3f) << 16)
108662306a36Sopenharmony_ci#       define HDMI0_GENERIC0_LINE_MASK		(0x3f << 16)
108762306a36Sopenharmony_ci#       define HDMI0_GENERIC1_LINE(x)  (((x) & 0x3f) << 24)
108862306a36Sopenharmony_ci#       define HDMI0_GENERIC1_LINE_MASK		(0x3f << 24)
108962306a36Sopenharmony_ci#define HDMI0_GC                     0x7428
109062306a36Sopenharmony_ci#       define HDMI0_GC_AVMUTE       (1 << 0)
109162306a36Sopenharmony_ci#define HDMI0_AVI_INFO0              0x7454
109262306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_CHECKSUM(x)  (((x) & 0xff) << 0)
109362306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_S(x)   (((x) & 3) << 8)
109462306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_B(x)   (((x) & 3) << 10)
109562306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_A(x)   (((x) & 1) << 12)
109662306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_Y(x)   (((x) & 3) << 13)
109762306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_Y_RGB       0
109862306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_Y_YCBCR422  1
109962306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_Y_YCBCR444  2
110062306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_Y_A_B_S(x)   (((x) & 0xff) << 8)
110162306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_R(x)   (((x) & 0xf) << 16)
110262306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_M(x)   (((x) & 0x3) << 20)
110362306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_C(x)   (((x) & 0x3) << 22)
110462306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_C_M_R(x)   (((x) & 0xff) << 16)
110562306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_SC(x)  (((x) & 0x3) << 24)
110662306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_ITC_EC_Q_SC(x)  (((x) & 0xff) << 24)
110762306a36Sopenharmony_ci#define HDMI0_AVI_INFO1              0x7458
110862306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_VIC(x) (((x) & 0x7f) << 0) /* don't use avi infoframe v1 */
110962306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_PR(x)  (((x) & 0xf) << 8) /* don't use avi infoframe v1 */
111062306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_TOP(x) (((x) & 0xffff) << 16)
111162306a36Sopenharmony_ci#define HDMI0_AVI_INFO2              0x745c
111262306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_BOTTOM(x)  (((x) & 0xffff) << 0)
111362306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_LEFT(x)    (((x) & 0xffff) << 16)
111462306a36Sopenharmony_ci#define HDMI0_AVI_INFO3              0x7460
111562306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_RIGHT(x)    (((x) & 0xffff) << 0)
111662306a36Sopenharmony_ci#       define HDMI0_AVI_INFO_VERSION(x)  (((x) & 3) << 24)
111762306a36Sopenharmony_ci#define HDMI0_MPEG_INFO0             0x7464
111862306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_CHECKSUM(x)  (((x) & 0xff) << 0)
111962306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_MB0(x)  (((x) & 0xff) << 8)
112062306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_MB1(x)  (((x) & 0xff) << 16)
112162306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_MB2(x)  (((x) & 0xff) << 24)
112262306a36Sopenharmony_ci#define HDMI0_MPEG_INFO1             0x7468
112362306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_MB3(x)  (((x) & 0xff) << 0)
112462306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_MF(x)   (((x) & 3) << 8)
112562306a36Sopenharmony_ci#       define HDMI0_MPEG_INFO_FR(x)   (((x) & 1) << 12)
112662306a36Sopenharmony_ci#define HDMI0_GENERIC0_HDR           0x746c
112762306a36Sopenharmony_ci#define HDMI0_GENERIC0_0             0x7470
112862306a36Sopenharmony_ci#define HDMI0_GENERIC0_1             0x7474
112962306a36Sopenharmony_ci#define HDMI0_GENERIC0_2             0x7478
113062306a36Sopenharmony_ci#define HDMI0_GENERIC0_3             0x747c
113162306a36Sopenharmony_ci#define HDMI0_GENERIC0_4             0x7480
113262306a36Sopenharmony_ci#define HDMI0_GENERIC0_5             0x7484
113362306a36Sopenharmony_ci#define HDMI0_GENERIC0_6             0x7488
113462306a36Sopenharmony_ci#define HDMI0_GENERIC1_HDR           0x748c
113562306a36Sopenharmony_ci#define HDMI0_GENERIC1_0             0x7490
113662306a36Sopenharmony_ci#define HDMI0_GENERIC1_1             0x7494
113762306a36Sopenharmony_ci#define HDMI0_GENERIC1_2             0x7498
113862306a36Sopenharmony_ci#define HDMI0_GENERIC1_3             0x749c
113962306a36Sopenharmony_ci#define HDMI0_GENERIC1_4             0x74a0
114062306a36Sopenharmony_ci#define HDMI0_GENERIC1_5             0x74a4
114162306a36Sopenharmony_ci#define HDMI0_GENERIC1_6             0x74a8
114262306a36Sopenharmony_ci#define HDMI0_ACR_32_0               0x74ac
114362306a36Sopenharmony_ci#       define HDMI0_ACR_CTS_32(x)   (((x) & 0xfffff) << 12)
114462306a36Sopenharmony_ci#       define HDMI0_ACR_CTS_32_MASK		(0xfffff << 12)
114562306a36Sopenharmony_ci#define HDMI0_ACR_32_1               0x74b0
114662306a36Sopenharmony_ci#       define HDMI0_ACR_N_32(x)   (((x) & 0xfffff) << 0)
114762306a36Sopenharmony_ci#       define HDMI0_ACR_N_32_MASK		(0xfffff << 0)
114862306a36Sopenharmony_ci#define HDMI0_ACR_44_0               0x74b4
114962306a36Sopenharmony_ci#       define HDMI0_ACR_CTS_44(x)   (((x) & 0xfffff) << 12)
115062306a36Sopenharmony_ci#       define HDMI0_ACR_CTS_44_MASK		(0xfffff << 12)
115162306a36Sopenharmony_ci#define HDMI0_ACR_44_1               0x74b8
115262306a36Sopenharmony_ci#       define HDMI0_ACR_N_44(x)   (((x) & 0xfffff) << 0)
115362306a36Sopenharmony_ci#       define HDMI0_ACR_N_44_MASK		(0xfffff << 0)
115462306a36Sopenharmony_ci#define HDMI0_ACR_48_0               0x74bc
115562306a36Sopenharmony_ci#       define HDMI0_ACR_CTS_48(x)   (((x) & 0xfffff) << 12)
115662306a36Sopenharmony_ci#       define HDMI0_ACR_CTS_48_MASK		(0xfffff << 12)
115762306a36Sopenharmony_ci#define HDMI0_ACR_48_1               0x74c0
115862306a36Sopenharmony_ci#       define HDMI0_ACR_N_48(x)   (((x) & 0xfffff) << 0)
115962306a36Sopenharmony_ci#       define HDMI0_ACR_N_48_MASK		(0xfffff << 0)
116062306a36Sopenharmony_ci#define HDMI0_ACR_STATUS_0           0x74c4
116162306a36Sopenharmony_ci#define HDMI0_ACR_STATUS_1           0x74c8
116262306a36Sopenharmony_ci#define HDMI0_AUDIO_INFO0            0x74cc
116362306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_CHECKSUM(x)  (((x) & 0xff) << 0)
116462306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_CC(x)  (((x) & 7) << 8)
116562306a36Sopenharmony_ci#define HDMI0_AUDIO_INFO1            0x74d0
116662306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_CA(x)  (((x) & 0xff) << 0)
116762306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_LSV(x)  (((x) & 0xf) << 11)
116862306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_DM_INH(x)  (((x) & 1) << 15)
116962306a36Sopenharmony_ci#       define HDMI0_AUDIO_INFO_DM_INH_LSV(x)  (((x) & 0xff) << 8)
117062306a36Sopenharmony_ci#define HDMI0_60958_0                0x74d4
117162306a36Sopenharmony_ci#       define HDMI0_60958_CS_A(x)   (((x) & 1) << 0)
117262306a36Sopenharmony_ci#       define HDMI0_60958_CS_B(x)   (((x) & 1) << 1)
117362306a36Sopenharmony_ci#       define HDMI0_60958_CS_C(x)   (((x) & 1) << 2)
117462306a36Sopenharmony_ci#       define HDMI0_60958_CS_D(x)   (((x) & 3) << 3)
117562306a36Sopenharmony_ci#       define HDMI0_60958_CS_MODE(x)   (((x) & 3) << 6)
117662306a36Sopenharmony_ci#       define HDMI0_60958_CS_CATEGORY_CODE(x)      (((x) & 0xff) << 8)
117762306a36Sopenharmony_ci#       define HDMI0_60958_CS_SOURCE_NUMBER(x)      (((x) & 0xf) << 16)
117862306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_L(x)   (((x) & 0xf) << 20)
117962306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_L_MASK	(0xf << 20)
118062306a36Sopenharmony_ci#       define HDMI0_60958_CS_SAMPLING_FREQUENCY(x) (((x) & 0xf) << 24)
118162306a36Sopenharmony_ci#       define HDMI0_60958_CS_CLOCK_ACCURACY(x)     (((x) & 3) << 28)
118262306a36Sopenharmony_ci#       define HDMI0_60958_CS_CLOCK_ACCURACY_MASK	(3 << 28)
118362306a36Sopenharmony_ci#define HDMI0_60958_1                0x74d8
118462306a36Sopenharmony_ci#       define HDMI0_60958_CS_WORD_LENGTH(x)        (((x) & 0xf) << 0)
118562306a36Sopenharmony_ci#       define HDMI0_60958_CS_ORIGINAL_SAMPLING_FREQUENCY(x)   (((x) & 0xf) << 4)
118662306a36Sopenharmony_ci#       define HDMI0_60958_CS_VALID_L(x)   (((x) & 1) << 16)
118762306a36Sopenharmony_ci#       define HDMI0_60958_CS_VALID_R(x)   (((x) & 1) << 18)
118862306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_R(x)   (((x) & 0xf) << 20)
118962306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK	(0xf << 20)
119062306a36Sopenharmony_ci#define HDMI0_ACR_PACKET_CONTROL     0x74dc
119162306a36Sopenharmony_ci#       define HDMI0_ACR_SEND        (1 << 0)
119262306a36Sopenharmony_ci#       define HDMI0_ACR_CONT        (1 << 1)
119362306a36Sopenharmony_ci#       define HDMI0_ACR_SELECT(x)   (((x) & 3) << 4)
119462306a36Sopenharmony_ci#       define HDMI0_ACR_HW          0
119562306a36Sopenharmony_ci#       define HDMI0_ACR_32          1
119662306a36Sopenharmony_ci#       define HDMI0_ACR_44          2
119762306a36Sopenharmony_ci#       define HDMI0_ACR_48          3
119862306a36Sopenharmony_ci#       define HDMI0_ACR_SOURCE      (1 << 8) /* 0 - hw; 1 - cts value */
119962306a36Sopenharmony_ci#       define HDMI0_ACR_AUTO_SEND   (1 << 12)
120062306a36Sopenharmony_ci#define DCE3_HDMI0_AUDIO_CRC_CONTROL	0x74dc
120162306a36Sopenharmony_ci#define HDMI0_RAMP_CONTROL0          0x74e0
120262306a36Sopenharmony_ci#       define HDMI0_RAMP_MAX_COUNT(x)   (((x) & 0xffffff) << 0)
120362306a36Sopenharmony_ci#define HDMI0_RAMP_CONTROL1          0x74e4
120462306a36Sopenharmony_ci#       define HDMI0_RAMP_MIN_COUNT(x)   (((x) & 0xffffff) << 0)
120562306a36Sopenharmony_ci#define HDMI0_RAMP_CONTROL2          0x74e8
120662306a36Sopenharmony_ci#       define HDMI0_RAMP_INC_COUNT(x)   (((x) & 0xffffff) << 0)
120762306a36Sopenharmony_ci#define HDMI0_RAMP_CONTROL3          0x74ec
120862306a36Sopenharmony_ci#       define HDMI0_RAMP_DEC_COUNT(x)   (((x) & 0xffffff) << 0)
120962306a36Sopenharmony_ci/* HDMI0_60958_2 is r7xx only */
121062306a36Sopenharmony_ci#define HDMI0_60958_2                0x74f0
121162306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_2(x)   (((x) & 0xf) << 0)
121262306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_3(x)   (((x) & 0xf) << 4)
121362306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_4(x)   (((x) & 0xf) << 8)
121462306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_5(x)   (((x) & 0xf) << 12)
121562306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_6(x)   (((x) & 0xf) << 16)
121662306a36Sopenharmony_ci#       define HDMI0_60958_CS_CHANNEL_NUMBER_7(x)   (((x) & 0xf) << 20)
121762306a36Sopenharmony_ci/* r6xx only; second instance starts at 0x7700 */
121862306a36Sopenharmony_ci#define HDMI1_CONTROL                0x7700
121962306a36Sopenharmony_ci#define HDMI1_STATUS                 0x7704
122062306a36Sopenharmony_ci#define HDMI1_AUDIO_PACKET_CONTROL   0x7708
122162306a36Sopenharmony_ci/* DCE3; second instance starts at 0x7800 NOT 0x7700 */
122262306a36Sopenharmony_ci#define DCE3_HDMI1_CONTROL                0x7800
122362306a36Sopenharmony_ci#define DCE3_HDMI1_STATUS                 0x7804
122462306a36Sopenharmony_ci#define DCE3_HDMI1_AUDIO_PACKET_CONTROL   0x7808
122562306a36Sopenharmony_ci/* DCE3.2 (for interrupts) */
122662306a36Sopenharmony_ci#define AFMT_STATUS                          0x7600
122762306a36Sopenharmony_ci#       define AFMT_AUDIO_ENABLE             (1 << 4)
122862306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG          (1 << 28)
122962306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG_INT      (1 << 29)
123062306a36Sopenharmony_ci#       define AFMT_AZ_AUDIO_ENABLE_CHG      (1 << 30)
123162306a36Sopenharmony_ci#define AFMT_AUDIO_PACKET_CONTROL            0x7604
123262306a36Sopenharmony_ci#       define AFMT_AUDIO_SAMPLE_SEND        (1 << 0)
123362306a36Sopenharmony_ci#       define AFMT_AUDIO_TEST_EN            (1 << 12)
123462306a36Sopenharmony_ci#       define AFMT_AUDIO_CHANNEL_SWAP       (1 << 24)
123562306a36Sopenharmony_ci#       define AFMT_60958_CS_UPDATE          (1 << 26)
123662306a36Sopenharmony_ci#       define AFMT_AZ_AUDIO_ENABLE_CHG_MASK (1 << 27)
123762306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG_MASK     (1 << 28)
123862306a36Sopenharmony_ci#       define AFMT_AZ_FORMAT_WTRIG_ACK      (1 << 29)
123962306a36Sopenharmony_ci#       define AFMT_AZ_AUDIO_ENABLE_CHG_ACK  (1 << 30)
124062306a36Sopenharmony_ci
124162306a36Sopenharmony_ci/* DCE3 FMT blocks */
124262306a36Sopenharmony_ci#define FMT_CONTROL                          0x6700
124362306a36Sopenharmony_ci#       define FMT_PIXEL_ENCODING            (1 << 16)
124462306a36Sopenharmony_ci        /* 0 = RGB 4:4:4 or YCbCr 4:4:4, 1 = YCbCr 4:2:2 */
124562306a36Sopenharmony_ci#define FMT_BIT_DEPTH_CONTROL                0x6710
124662306a36Sopenharmony_ci#       define FMT_TRUNCATE_EN               (1 << 0)
124762306a36Sopenharmony_ci#       define FMT_TRUNCATE_DEPTH            (1 << 4)
124862306a36Sopenharmony_ci#       define FMT_SPATIAL_DITHER_EN         (1 << 8)
124962306a36Sopenharmony_ci#       define FMT_SPATIAL_DITHER_MODE(x)    ((x) << 9)
125062306a36Sopenharmony_ci#       define FMT_SPATIAL_DITHER_DEPTH      (1 << 12)
125162306a36Sopenharmony_ci#       define FMT_FRAME_RANDOM_ENABLE       (1 << 13)
125262306a36Sopenharmony_ci#       define FMT_RGB_RANDOM_ENABLE         (1 << 14)
125362306a36Sopenharmony_ci#       define FMT_HIGHPASS_RANDOM_ENABLE    (1 << 15)
125462306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_EN        (1 << 16)
125562306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_DEPTH     (1 << 20)
125662306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_OFFSET(x) ((x) << 21)
125762306a36Sopenharmony_ci#       define FMT_TEMPORAL_LEVEL            (1 << 24)
125862306a36Sopenharmony_ci#       define FMT_TEMPORAL_DITHER_RESET     (1 << 25)
125962306a36Sopenharmony_ci#       define FMT_25FRC_SEL(x)              ((x) << 26)
126062306a36Sopenharmony_ci#       define FMT_50FRC_SEL(x)              ((x) << 28)
126162306a36Sopenharmony_ci#       define FMT_75FRC_SEL(x)              ((x) << 30)
126262306a36Sopenharmony_ci#define FMT_CLAMP_CONTROL                    0x672c
126362306a36Sopenharmony_ci#       define FMT_CLAMP_DATA_EN             (1 << 0)
126462306a36Sopenharmony_ci#       define FMT_CLAMP_COLOR_FORMAT(x)     ((x) << 16)
126562306a36Sopenharmony_ci#       define FMT_CLAMP_6BPC                0
126662306a36Sopenharmony_ci#       define FMT_CLAMP_8BPC                1
126762306a36Sopenharmony_ci#       define FMT_CLAMP_10BPC               2
126862306a36Sopenharmony_ci
126962306a36Sopenharmony_ci/* Power management */
127062306a36Sopenharmony_ci#define CG_SPLL_FUNC_CNTL                                 0x600
127162306a36Sopenharmony_ci#       define SPLL_RESET                                (1 << 0)
127262306a36Sopenharmony_ci#       define SPLL_SLEEP                                (1 << 1)
127362306a36Sopenharmony_ci#       define SPLL_REF_DIV(x)                           ((x) << 2)
127462306a36Sopenharmony_ci#       define SPLL_REF_DIV_MASK                         (7 << 2)
127562306a36Sopenharmony_ci#       define SPLL_FB_DIV(x)                            ((x) << 5)
127662306a36Sopenharmony_ci#       define SPLL_FB_DIV_MASK                          (0xff << 5)
127762306a36Sopenharmony_ci#       define SPLL_PULSEEN                              (1 << 13)
127862306a36Sopenharmony_ci#       define SPLL_PULSENUM(x)                          ((x) << 14)
127962306a36Sopenharmony_ci#       define SPLL_PULSENUM_MASK                        (3 << 14)
128062306a36Sopenharmony_ci#       define SPLL_SW_HILEN(x)                          ((x) << 16)
128162306a36Sopenharmony_ci#       define SPLL_SW_HILEN_MASK                        (0xf << 16)
128262306a36Sopenharmony_ci#       define SPLL_SW_LOLEN(x)                          ((x) << 20)
128362306a36Sopenharmony_ci#       define SPLL_SW_LOLEN_MASK                        (0xf << 20)
128462306a36Sopenharmony_ci#       define SPLL_DIVEN                                (1 << 24)
128562306a36Sopenharmony_ci#       define SPLL_BYPASS_EN                            (1 << 25)
128662306a36Sopenharmony_ci#       define SPLL_CHG_STATUS                           (1 << 29)
128762306a36Sopenharmony_ci#       define SPLL_CTLREQ                               (1 << 30)
128862306a36Sopenharmony_ci#       define SPLL_CTLACK                               (1 << 31)
128962306a36Sopenharmony_ci
129062306a36Sopenharmony_ci#define GENERAL_PWRMGT                                    0x618
129162306a36Sopenharmony_ci#       define GLOBAL_PWRMGT_EN                           (1 << 0)
129262306a36Sopenharmony_ci#       define STATIC_PM_EN                               (1 << 1)
129362306a36Sopenharmony_ci#       define MOBILE_SU                                  (1 << 2)
129462306a36Sopenharmony_ci#       define THERMAL_PROTECTION_DIS                     (1 << 3)
129562306a36Sopenharmony_ci#       define THERMAL_PROTECTION_TYPE                    (1 << 4)
129662306a36Sopenharmony_ci#       define ENABLE_GEN2PCIE                            (1 << 5)
129762306a36Sopenharmony_ci#       define SW_GPIO_INDEX(x)                           ((x) << 6)
129862306a36Sopenharmony_ci#       define SW_GPIO_INDEX_MASK                         (3 << 6)
129962306a36Sopenharmony_ci#       define LOW_VOLT_D2_ACPI                           (1 << 8)
130062306a36Sopenharmony_ci#       define LOW_VOLT_D3_ACPI                           (1 << 9)
130162306a36Sopenharmony_ci#       define VOLT_PWRMGT_EN                             (1 << 10)
130262306a36Sopenharmony_ci#define CG_TPC                                            0x61c
130362306a36Sopenharmony_ci#       define TPCC(x)                                    ((x) << 0)
130462306a36Sopenharmony_ci#       define TPCC_MASK                                  (0x7fffff << 0)
130562306a36Sopenharmony_ci#       define TPU(x)                                     ((x) << 23)
130662306a36Sopenharmony_ci#       define TPU_MASK                                   (0x1f << 23)
130762306a36Sopenharmony_ci#define SCLK_PWRMGT_CNTL                                  0x620
130862306a36Sopenharmony_ci#       define SCLK_PWRMGT_OFF                            (1 << 0)
130962306a36Sopenharmony_ci#       define SCLK_TURNOFF                               (1 << 1)
131062306a36Sopenharmony_ci#       define SPLL_TURNOFF                               (1 << 2)
131162306a36Sopenharmony_ci#       define SU_SCLK_USE_BCLK                           (1 << 3)
131262306a36Sopenharmony_ci#       define DYNAMIC_GFX_ISLAND_PWR_DOWN                (1 << 4)
131362306a36Sopenharmony_ci#       define DYNAMIC_GFX_ISLAND_PWR_LP                  (1 << 5)
131462306a36Sopenharmony_ci#       define CLK_TURN_ON_STAGGER                        (1 << 6)
131562306a36Sopenharmony_ci#       define CLK_TURN_OFF_STAGGER                       (1 << 7)
131662306a36Sopenharmony_ci#       define FIR_FORCE_TREND_SEL                        (1 << 8)
131762306a36Sopenharmony_ci#       define FIR_TREND_MODE                             (1 << 9)
131862306a36Sopenharmony_ci#       define DYN_GFX_CLK_OFF_EN                         (1 << 10)
131962306a36Sopenharmony_ci#       define VDDC3D_TURNOFF_D1                          (1 << 11)
132062306a36Sopenharmony_ci#       define VDDC3D_TURNOFF_D2                          (1 << 12)
132162306a36Sopenharmony_ci#       define VDDC3D_TURNOFF_D3                          (1 << 13)
132262306a36Sopenharmony_ci#       define SPLL_TURNOFF_D2                            (1 << 14)
132362306a36Sopenharmony_ci#       define SCLK_LOW_D1                                (1 << 15)
132462306a36Sopenharmony_ci#       define DYN_GFX_CLK_OFF_MC_EN                      (1 << 16)
132562306a36Sopenharmony_ci#define MCLK_PWRMGT_CNTL                                  0x624
132662306a36Sopenharmony_ci#       define MPLL_PWRMGT_OFF                            (1 << 0)
132762306a36Sopenharmony_ci#       define YCLK_TURNOFF                               (1 << 1)
132862306a36Sopenharmony_ci#       define MPLL_TURNOFF                               (1 << 2)
132962306a36Sopenharmony_ci#       define SU_MCLK_USE_BCLK                           (1 << 3)
133062306a36Sopenharmony_ci#       define DLL_READY                                  (1 << 4)
133162306a36Sopenharmony_ci#       define MC_BUSY                                    (1 << 5)
133262306a36Sopenharmony_ci#       define MC_INT_CNTL                                (1 << 7)
133362306a36Sopenharmony_ci#       define MRDCKA_SLEEP                               (1 << 8)
133462306a36Sopenharmony_ci#       define MRDCKB_SLEEP                               (1 << 9)
133562306a36Sopenharmony_ci#       define MRDCKC_SLEEP                               (1 << 10)
133662306a36Sopenharmony_ci#       define MRDCKD_SLEEP                               (1 << 11)
133762306a36Sopenharmony_ci#       define MRDCKE_SLEEP                               (1 << 12)
133862306a36Sopenharmony_ci#       define MRDCKF_SLEEP                               (1 << 13)
133962306a36Sopenharmony_ci#       define MRDCKG_SLEEP                               (1 << 14)
134062306a36Sopenharmony_ci#       define MRDCKH_SLEEP                               (1 << 15)
134162306a36Sopenharmony_ci#       define MRDCKA_RESET                               (1 << 16)
134262306a36Sopenharmony_ci#       define MRDCKB_RESET                               (1 << 17)
134362306a36Sopenharmony_ci#       define MRDCKC_RESET                               (1 << 18)
134462306a36Sopenharmony_ci#       define MRDCKD_RESET                               (1 << 19)
134562306a36Sopenharmony_ci#       define MRDCKE_RESET                               (1 << 20)
134662306a36Sopenharmony_ci#       define MRDCKF_RESET                               (1 << 21)
134762306a36Sopenharmony_ci#       define MRDCKG_RESET                               (1 << 22)
134862306a36Sopenharmony_ci#       define MRDCKH_RESET                               (1 << 23)
134962306a36Sopenharmony_ci#       define DLL_READY_READ                             (1 << 24)
135062306a36Sopenharmony_ci#       define USE_DISPLAY_GAP                            (1 << 25)
135162306a36Sopenharmony_ci#       define USE_DISPLAY_URGENT_NORMAL                  (1 << 26)
135262306a36Sopenharmony_ci#       define USE_DISPLAY_GAP_CTXSW                      (1 << 27)
135362306a36Sopenharmony_ci#       define MPLL_TURNOFF_D2                            (1 << 28)
135462306a36Sopenharmony_ci#       define USE_DISPLAY_URGENT_CTXSW                   (1 << 29)
135562306a36Sopenharmony_ci
135662306a36Sopenharmony_ci#define MPLL_TIME                                         0x634
135762306a36Sopenharmony_ci#       define MPLL_LOCK_TIME(x)                          ((x) << 0)
135862306a36Sopenharmony_ci#       define MPLL_LOCK_TIME_MASK                        (0xffff << 0)
135962306a36Sopenharmony_ci#       define MPLL_RESET_TIME(x)                         ((x) << 16)
136062306a36Sopenharmony_ci#       define MPLL_RESET_TIME_MASK                       (0xffff << 16)
136162306a36Sopenharmony_ci
136262306a36Sopenharmony_ci#define SCLK_FREQ_SETTING_STEP_0_PART1                    0x648
136362306a36Sopenharmony_ci#       define STEP_0_SPLL_POST_DIV(x)                    ((x) << 0)
136462306a36Sopenharmony_ci#       define STEP_0_SPLL_POST_DIV_MASK                  (0xff << 0)
136562306a36Sopenharmony_ci#       define STEP_0_SPLL_FB_DIV(x)                      ((x) << 8)
136662306a36Sopenharmony_ci#       define STEP_0_SPLL_FB_DIV_MASK                    (0xff << 8)
136762306a36Sopenharmony_ci#       define STEP_0_SPLL_REF_DIV(x)                     ((x) << 16)
136862306a36Sopenharmony_ci#       define STEP_0_SPLL_REF_DIV_MASK                   (7 << 16)
136962306a36Sopenharmony_ci#       define STEP_0_SPLL_STEP_TIME(x)                   ((x) << 19)
137062306a36Sopenharmony_ci#       define STEP_0_SPLL_STEP_TIME_MASK                 (0x1fff << 19)
137162306a36Sopenharmony_ci#define SCLK_FREQ_SETTING_STEP_0_PART2                    0x64c
137262306a36Sopenharmony_ci#       define STEP_0_PULSE_HIGH_CNT(x)                   ((x) << 0)
137362306a36Sopenharmony_ci#       define STEP_0_PULSE_HIGH_CNT_MASK                 (0x1ff << 0)
137462306a36Sopenharmony_ci#       define STEP_0_POST_DIV_EN                         (1 << 9)
137562306a36Sopenharmony_ci#       define STEP_0_SPLL_STEP_ENABLE                    (1 << 30)
137662306a36Sopenharmony_ci#       define STEP_0_SPLL_ENTRY_VALID                    (1 << 31)
137762306a36Sopenharmony_ci
137862306a36Sopenharmony_ci#define VID_RT                                            0x6f8
137962306a36Sopenharmony_ci#       define VID_CRT(x)                                 ((x) << 0)
138062306a36Sopenharmony_ci#       define VID_CRT_MASK                               (0x1fff << 0)
138162306a36Sopenharmony_ci#       define VID_CRTU(x)                                ((x) << 13)
138262306a36Sopenharmony_ci#       define VID_CRTU_MASK                              (7 << 13)
138362306a36Sopenharmony_ci#       define SSTU(x)                                    ((x) << 16)
138462306a36Sopenharmony_ci#       define SSTU_MASK                                  (7 << 16)
138562306a36Sopenharmony_ci#define CTXSW_PROFILE_INDEX                               0x6fc
138662306a36Sopenharmony_ci#       define CTXSW_FREQ_VIDS_CFG_INDEX(x)               ((x) << 0)
138762306a36Sopenharmony_ci#       define CTXSW_FREQ_VIDS_CFG_INDEX_MASK             (3 << 0)
138862306a36Sopenharmony_ci#       define CTXSW_FREQ_VIDS_CFG_INDEX_SHIFT            0
138962306a36Sopenharmony_ci#       define CTXSW_FREQ_MCLK_CFG_INDEX(x)               ((x) << 2)
139062306a36Sopenharmony_ci#       define CTXSW_FREQ_MCLK_CFG_INDEX_MASK             (3 << 2)
139162306a36Sopenharmony_ci#       define CTXSW_FREQ_MCLK_CFG_INDEX_SHIFT            2
139262306a36Sopenharmony_ci#       define CTXSW_FREQ_SCLK_CFG_INDEX(x)               ((x) << 4)
139362306a36Sopenharmony_ci#       define CTXSW_FREQ_SCLK_CFG_INDEX_MASK             (0x1f << 4)
139462306a36Sopenharmony_ci#       define CTXSW_FREQ_SCLK_CFG_INDEX_SHIFT            4
139562306a36Sopenharmony_ci#       define CTXSW_FREQ_STATE_SPLL_RESET_EN             (1 << 9)
139662306a36Sopenharmony_ci#       define CTXSW_FREQ_STATE_ENABLE                    (1 << 10)
139762306a36Sopenharmony_ci#       define CTXSW_FREQ_DISPLAY_WATERMARK               (1 << 11)
139862306a36Sopenharmony_ci#       define CTXSW_FREQ_GEN2PCIE_VOLT                   (1 << 12)
139962306a36Sopenharmony_ci
140062306a36Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX                  0x70c
140162306a36Sopenharmony_ci#       define TARGET_PROFILE_INDEX_MASK                  (3 << 0)
140262306a36Sopenharmony_ci#       define TARGET_PROFILE_INDEX_SHIFT                 0
140362306a36Sopenharmony_ci#       define CURRENT_PROFILE_INDEX_MASK                 (3 << 2)
140462306a36Sopenharmony_ci#       define CURRENT_PROFILE_INDEX_SHIFT                2
140562306a36Sopenharmony_ci#       define DYN_PWR_ENTER_INDEX(x)                     ((x) << 4)
140662306a36Sopenharmony_ci#       define DYN_PWR_ENTER_INDEX_MASK                   (3 << 4)
140762306a36Sopenharmony_ci#       define DYN_PWR_ENTER_INDEX_SHIFT                  4
140862306a36Sopenharmony_ci#       define CURR_MCLK_INDEX_MASK                       (3 << 6)
140962306a36Sopenharmony_ci#       define CURR_MCLK_INDEX_SHIFT                      6
141062306a36Sopenharmony_ci#       define CURR_SCLK_INDEX_MASK                       (0x1f << 8)
141162306a36Sopenharmony_ci#       define CURR_SCLK_INDEX_SHIFT                      8
141262306a36Sopenharmony_ci#       define CURR_VID_INDEX_MASK                        (3 << 13)
141362306a36Sopenharmony_ci#       define CURR_VID_INDEX_SHIFT                       13
141462306a36Sopenharmony_ci
141562306a36Sopenharmony_ci#define LOWER_GPIO_ENABLE                                 0x710
141662306a36Sopenharmony_ci#define UPPER_GPIO_ENABLE                                 0x714
141762306a36Sopenharmony_ci#define CTXSW_VID_LOWER_GPIO_CNTL                         0x718
141862306a36Sopenharmony_ci
141962306a36Sopenharmony_ci#define VID_UPPER_GPIO_CNTL                               0x740
142062306a36Sopenharmony_ci#define CG_CTX_CGTT3D_R                                   0x744
142162306a36Sopenharmony_ci#       define PHC(x)                                     ((x) << 0)
142262306a36Sopenharmony_ci#       define PHC_MASK                                   (0x1ff << 0)
142362306a36Sopenharmony_ci#       define SDC(x)                                     ((x) << 9)
142462306a36Sopenharmony_ci#       define SDC_MASK                                   (0x3fff << 9)
142562306a36Sopenharmony_ci#define CG_VDDC3D_OOR                                     0x748
142662306a36Sopenharmony_ci#       define SU(x)                                      ((x) << 23)
142762306a36Sopenharmony_ci#       define SU_MASK                                    (0xf << 23)
142862306a36Sopenharmony_ci#define CG_FTV                                            0x74c
142962306a36Sopenharmony_ci#define CG_FFCT_0                                         0x750
143062306a36Sopenharmony_ci#       define UTC_0(x)                                   ((x) << 0)
143162306a36Sopenharmony_ci#       define UTC_0_MASK                                 (0x3ff << 0)
143262306a36Sopenharmony_ci#       define DTC_0(x)                                   ((x) << 10)
143362306a36Sopenharmony_ci#       define DTC_0_MASK                                 (0x3ff << 10)
143462306a36Sopenharmony_ci
143562306a36Sopenharmony_ci#define CG_BSP                                            0x78c
143662306a36Sopenharmony_ci#       define BSP(x)                                     ((x) << 0)
143762306a36Sopenharmony_ci#       define BSP_MASK                                   (0xffff << 0)
143862306a36Sopenharmony_ci#       define BSU(x)                                     ((x) << 16)
143962306a36Sopenharmony_ci#       define BSU_MASK                                   (0xf << 16)
144062306a36Sopenharmony_ci#define CG_RT                                             0x790
144162306a36Sopenharmony_ci#       define FLS(x)                                     ((x) << 0)
144262306a36Sopenharmony_ci#       define FLS_MASK                                   (0xffff << 0)
144362306a36Sopenharmony_ci#       define FMS(x)                                     ((x) << 16)
144462306a36Sopenharmony_ci#       define FMS_MASK                                   (0xffff << 16)
144562306a36Sopenharmony_ci#define CG_LT                                             0x794
144662306a36Sopenharmony_ci#       define FHS(x)                                     ((x) << 0)
144762306a36Sopenharmony_ci#       define FHS_MASK                                   (0xffff << 0)
144862306a36Sopenharmony_ci#define CG_GIT                                            0x798
144962306a36Sopenharmony_ci#       define CG_GICST(x)                                ((x) << 0)
145062306a36Sopenharmony_ci#       define CG_GICST_MASK                              (0xffff << 0)
145162306a36Sopenharmony_ci#       define CG_GIPOT(x)                                ((x) << 16)
145262306a36Sopenharmony_ci#       define CG_GIPOT_MASK                              (0xffff << 16)
145362306a36Sopenharmony_ci
145462306a36Sopenharmony_ci#define CG_SSP                                            0x7a8
145562306a36Sopenharmony_ci#       define CG_SST(x)                                  ((x) << 0)
145662306a36Sopenharmony_ci#       define CG_SST_MASK                                (0xffff << 0)
145762306a36Sopenharmony_ci#       define CG_SSTU(x)                                 ((x) << 16)
145862306a36Sopenharmony_ci#       define CG_SSTU_MASK                               (0xf << 16)
145962306a36Sopenharmony_ci
146062306a36Sopenharmony_ci#define CG_RLC_REQ_AND_RSP                                0x7c4
146162306a36Sopenharmony_ci#       define RLC_CG_REQ_TYPE_MASK                       0xf
146262306a36Sopenharmony_ci#       define RLC_CG_REQ_TYPE_SHIFT                      0
146362306a36Sopenharmony_ci#       define CG_RLC_RSP_TYPE_MASK                       0xf0
146462306a36Sopenharmony_ci#       define CG_RLC_RSP_TYPE_SHIFT                      4
146562306a36Sopenharmony_ci
146662306a36Sopenharmony_ci#define CG_FC_T                                           0x7cc
146762306a36Sopenharmony_ci#       define FC_T(x)                                    ((x) << 0)
146862306a36Sopenharmony_ci#       define FC_T_MASK                                  (0xffff << 0)
146962306a36Sopenharmony_ci#       define FC_TU(x)                                   ((x) << 16)
147062306a36Sopenharmony_ci#       define FC_TU_MASK                                 (0x1f << 16)
147162306a36Sopenharmony_ci
147262306a36Sopenharmony_ci#define GPIOPAD_MASK                                      0x1798
147362306a36Sopenharmony_ci#define GPIOPAD_A                                         0x179c
147462306a36Sopenharmony_ci#define GPIOPAD_EN                                        0x17a0
147562306a36Sopenharmony_ci
147662306a36Sopenharmony_ci#define GRBM_PWR_CNTL                                     0x800c
147762306a36Sopenharmony_ci#       define REQ_TYPE_MASK                              0xf
147862306a36Sopenharmony_ci#       define REQ_TYPE_SHIFT                             0
147962306a36Sopenharmony_ci#       define RSP_TYPE_MASK                              0xf0
148062306a36Sopenharmony_ci#       define RSP_TYPE_SHIFT                             4
148162306a36Sopenharmony_ci
148262306a36Sopenharmony_ci/*
148362306a36Sopenharmony_ci * UVD
148462306a36Sopenharmony_ci */
148562306a36Sopenharmony_ci#define UVD_SEMA_ADDR_LOW				0xef00
148662306a36Sopenharmony_ci#define UVD_SEMA_ADDR_HIGH				0xef04
148762306a36Sopenharmony_ci#define UVD_SEMA_CMD					0xef08
148862306a36Sopenharmony_ci
148962306a36Sopenharmony_ci#define UVD_GPCOM_VCPU_CMD				0xef0c
149062306a36Sopenharmony_ci#define UVD_GPCOM_VCPU_DATA0				0xef10
149162306a36Sopenharmony_ci#define UVD_GPCOM_VCPU_DATA1				0xef14
149262306a36Sopenharmony_ci#define UVD_ENGINE_CNTL					0xef18
149362306a36Sopenharmony_ci#define UVD_NO_OP					0xeffc
149462306a36Sopenharmony_ci
149562306a36Sopenharmony_ci#define UVD_SEMA_CNTL					0xf400
149662306a36Sopenharmony_ci#define UVD_RB_ARB_CTRL					0xf480
149762306a36Sopenharmony_ci
149862306a36Sopenharmony_ci#define UVD_LMI_EXT40_ADDR				0xf498
149962306a36Sopenharmony_ci#define UVD_CGC_GATE					0xf4a8
150062306a36Sopenharmony_ci#define UVD_LMI_CTRL2					0xf4f4
150162306a36Sopenharmony_ci#define UVD_MASTINT_EN					0xf500
150262306a36Sopenharmony_ci#define UVD_FW_START					0xf51C
150362306a36Sopenharmony_ci#define UVD_LMI_ADDR_EXT				0xf594
150462306a36Sopenharmony_ci#define UVD_LMI_CTRL					0xf598
150562306a36Sopenharmony_ci#define UVD_LMI_SWAP_CNTL				0xf5b4
150662306a36Sopenharmony_ci#define UVD_MP_SWAP_CNTL				0xf5bC
150762306a36Sopenharmony_ci#define UVD_MPC_CNTL					0xf5dC
150862306a36Sopenharmony_ci#define UVD_MPC_SET_MUXA0				0xf5e4
150962306a36Sopenharmony_ci#define UVD_MPC_SET_MUXA1				0xf5e8
151062306a36Sopenharmony_ci#define UVD_MPC_SET_MUXB0				0xf5eC
151162306a36Sopenharmony_ci#define UVD_MPC_SET_MUXB1				0xf5f0
151262306a36Sopenharmony_ci#define UVD_MPC_SET_MUX					0xf5f4
151362306a36Sopenharmony_ci#define UVD_MPC_SET_ALU					0xf5f8
151462306a36Sopenharmony_ci
151562306a36Sopenharmony_ci#define UVD_VCPU_CACHE_OFFSET0				0xf608
151662306a36Sopenharmony_ci#define UVD_VCPU_CACHE_SIZE0				0xf60c
151762306a36Sopenharmony_ci#define UVD_VCPU_CACHE_OFFSET1				0xf610
151862306a36Sopenharmony_ci#define UVD_VCPU_CACHE_SIZE1				0xf614
151962306a36Sopenharmony_ci#define UVD_VCPU_CACHE_OFFSET2				0xf618
152062306a36Sopenharmony_ci#define UVD_VCPU_CACHE_SIZE2				0xf61c
152162306a36Sopenharmony_ci
152262306a36Sopenharmony_ci#define UVD_VCPU_CNTL					0xf660
152362306a36Sopenharmony_ci#define UVD_SOFT_RESET					0xf680
152462306a36Sopenharmony_ci#define		RBC_SOFT_RESET					(1<<0)
152562306a36Sopenharmony_ci#define		LBSI_SOFT_RESET					(1<<1)
152662306a36Sopenharmony_ci#define		LMI_SOFT_RESET					(1<<2)
152762306a36Sopenharmony_ci#define		VCPU_SOFT_RESET					(1<<3)
152862306a36Sopenharmony_ci#define		CSM_SOFT_RESET					(1<<5)
152962306a36Sopenharmony_ci#define		CXW_SOFT_RESET					(1<<6)
153062306a36Sopenharmony_ci#define		TAP_SOFT_RESET					(1<<7)
153162306a36Sopenharmony_ci#define		LMI_UMC_SOFT_RESET				(1<<13)
153262306a36Sopenharmony_ci#define UVD_RBC_IB_BASE					0xf684
153362306a36Sopenharmony_ci#define UVD_RBC_IB_SIZE					0xf688
153462306a36Sopenharmony_ci#define UVD_RBC_RB_BASE					0xf68c
153562306a36Sopenharmony_ci#define UVD_RBC_RB_RPTR					0xf690
153662306a36Sopenharmony_ci#define UVD_RBC_RB_WPTR					0xf694
153762306a36Sopenharmony_ci#define UVD_RBC_RB_WPTR_CNTL				0xf698
153862306a36Sopenharmony_ci
153962306a36Sopenharmony_ci#define UVD_STATUS					0xf6bc
154062306a36Sopenharmony_ci
154162306a36Sopenharmony_ci#define UVD_SEMA_TIMEOUT_STATUS				0xf6c0
154262306a36Sopenharmony_ci#define UVD_SEMA_WAIT_INCOMPLETE_TIMEOUT_CNTL		0xf6c4
154362306a36Sopenharmony_ci#define UVD_SEMA_WAIT_FAULT_TIMEOUT_CNTL		0xf6c8
154462306a36Sopenharmony_ci#define UVD_SEMA_SIGNAL_INCOMPLETE_TIMEOUT_CNTL		0xf6cc
154562306a36Sopenharmony_ci
154662306a36Sopenharmony_ci#define UVD_RBC_RB_CNTL					0xf6a4
154762306a36Sopenharmony_ci#define UVD_RBC_RB_RPTR_ADDR				0xf6a8
154862306a36Sopenharmony_ci
154962306a36Sopenharmony_ci#define UVD_CONTEXT_ID					0xf6f4
155062306a36Sopenharmony_ci
155162306a36Sopenharmony_ci/* rs780 only */
155262306a36Sopenharmony_ci#define	GFX_MACRO_BYPASS_CNTL				0x30c0
155362306a36Sopenharmony_ci#define		SPLL_BYPASS_CNTL			(1 << 0)
155462306a36Sopenharmony_ci#define		UPLL_BYPASS_CNTL			(1 << 1)
155562306a36Sopenharmony_ci
155662306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL				0x7e0
155762306a36Sopenharmony_ci#	define UPLL_RESET_MASK				0x00000001
155862306a36Sopenharmony_ci#	define UPLL_SLEEP_MASK				0x00000002
155962306a36Sopenharmony_ci#	define UPLL_BYPASS_EN_MASK			0x00000004
156062306a36Sopenharmony_ci#	define UPLL_CTLREQ_MASK				0x00000008
156162306a36Sopenharmony_ci#	define UPLL_FB_DIV(x)				((x) << 4)
156262306a36Sopenharmony_ci#	define UPLL_FB_DIV_MASK				0x0000FFF0
156362306a36Sopenharmony_ci#	define UPLL_REF_DIV(x)				((x) << 16)
156462306a36Sopenharmony_ci#	define UPLL_REF_DIV_MASK			0x003F0000
156562306a36Sopenharmony_ci#	define UPLL_REFCLK_SRC_SEL_MASK			0x20000000
156662306a36Sopenharmony_ci#	define UPLL_CTLACK_MASK				0x40000000
156762306a36Sopenharmony_ci#	define UPLL_CTLACK2_MASK			0x80000000
156862306a36Sopenharmony_ci#define CG_UPLL_FUNC_CNTL_2				0x7e4
156962306a36Sopenharmony_ci#	define UPLL_SW_HILEN(x)				((x) << 0)
157062306a36Sopenharmony_ci#	define UPLL_SW_LOLEN(x)				((x) << 4)
157162306a36Sopenharmony_ci#	define UPLL_SW_HILEN2(x)			((x) << 8)
157262306a36Sopenharmony_ci#	define UPLL_SW_LOLEN2(x)			((x) << 12)
157362306a36Sopenharmony_ci#	define UPLL_DIVEN_MASK				0x00010000
157462306a36Sopenharmony_ci#	define UPLL_DIVEN2_MASK				0x00020000
157562306a36Sopenharmony_ci#	define UPLL_SW_MASK				0x0003FFFF
157662306a36Sopenharmony_ci#	define VCLK_SRC_SEL(x)				((x) << 20)
157762306a36Sopenharmony_ci#	define VCLK_SRC_SEL_MASK			0x01F00000
157862306a36Sopenharmony_ci#	define DCLK_SRC_SEL(x)				((x) << 25)
157962306a36Sopenharmony_ci#	define DCLK_SRC_SEL_MASK			0x3E000000
158062306a36Sopenharmony_ci
158162306a36Sopenharmony_ci/*
158262306a36Sopenharmony_ci * PM4
158362306a36Sopenharmony_ci */
158462306a36Sopenharmony_ci#define PACKET0(reg, n)	((RADEON_PACKET_TYPE0 << 30) |			\
158562306a36Sopenharmony_ci			 (((reg) >> 2) & 0xFFFF) |			\
158662306a36Sopenharmony_ci			 ((n) & 0x3FFF) << 16)
158762306a36Sopenharmony_ci#define PACKET3(op, n)	((RADEON_PACKET_TYPE3 << 30) |			\
158862306a36Sopenharmony_ci			 (((op) & 0xFF) << 8) |				\
158962306a36Sopenharmony_ci			 ((n) & 0x3FFF) << 16)
159062306a36Sopenharmony_ci
159162306a36Sopenharmony_ci/* Packet 3 types */
159262306a36Sopenharmony_ci#define	PACKET3_NOP					0x10
159362306a36Sopenharmony_ci#define	PACKET3_INDIRECT_BUFFER_END			0x17
159462306a36Sopenharmony_ci#define	PACKET3_SET_PREDICATION				0x20
159562306a36Sopenharmony_ci#define	PACKET3_REG_RMW					0x21
159662306a36Sopenharmony_ci#define	PACKET3_COND_EXEC				0x22
159762306a36Sopenharmony_ci#define	PACKET3_PRED_EXEC				0x23
159862306a36Sopenharmony_ci#define	PACKET3_START_3D_CMDBUF				0x24
159962306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_2				0x27
160062306a36Sopenharmony_ci#define	PACKET3_CONTEXT_CONTROL				0x28
160162306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_IMMD_BE			0x29
160262306a36Sopenharmony_ci#define	PACKET3_INDEX_TYPE				0x2A
160362306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX				0x2B
160462306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_AUTO				0x2D
160562306a36Sopenharmony_ci#define	PACKET3_DRAW_INDEX_IMMD				0x2E
160662306a36Sopenharmony_ci#define	PACKET3_NUM_INSTANCES				0x2F
160762306a36Sopenharmony_ci#define	PACKET3_STRMOUT_BUFFER_UPDATE			0x34
160862306a36Sopenharmony_ci#define	PACKET3_INDIRECT_BUFFER_MP			0x38
160962306a36Sopenharmony_ci#define	PACKET3_MEM_SEMAPHORE				0x39
161062306a36Sopenharmony_ci#              define PACKET3_SEM_WAIT_ON_SIGNAL    (0x1 << 12)
161162306a36Sopenharmony_ci#              define PACKET3_SEM_SEL_SIGNAL	    (0x6 << 29)
161262306a36Sopenharmony_ci#              define PACKET3_SEM_SEL_WAIT	    (0x7 << 29)
161362306a36Sopenharmony_ci#define	PACKET3_MPEG_INDEX				0x3A
161462306a36Sopenharmony_ci#define	PACKET3_COPY_DW					0x3B
161562306a36Sopenharmony_ci#define	PACKET3_WAIT_REG_MEM				0x3C
161662306a36Sopenharmony_ci#define	PACKET3_MEM_WRITE				0x3D
161762306a36Sopenharmony_ci#define	PACKET3_INDIRECT_BUFFER				0x32
161862306a36Sopenharmony_ci#define	PACKET3_CP_DMA					0x41
161962306a36Sopenharmony_ci/* 1. header
162062306a36Sopenharmony_ci * 2. SRC_ADDR_LO [31:0]
162162306a36Sopenharmony_ci * 3. CP_SYNC [31] | SRC_ADDR_HI [7:0]
162262306a36Sopenharmony_ci * 4. DST_ADDR_LO [31:0]
162362306a36Sopenharmony_ci * 5. DST_ADDR_HI [7:0]
162462306a36Sopenharmony_ci * 6. COMMAND [29:22] | BYTE_COUNT [20:0]
162562306a36Sopenharmony_ci */
162662306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CP_SYNC       (1 << 31)
162762306a36Sopenharmony_ci/* COMMAND */
162862306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
162962306a36Sopenharmony_ci                /* 0 - none
163062306a36Sopenharmony_ci		 * 1 - 8 in 16
163162306a36Sopenharmony_ci		 * 2 - 8 in 32
163262306a36Sopenharmony_ci		 * 3 - 8 in 64
163362306a36Sopenharmony_ci		 */
163462306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24)
163562306a36Sopenharmony_ci                /* 0 - none
163662306a36Sopenharmony_ci		 * 1 - 8 in 16
163762306a36Sopenharmony_ci		 * 2 - 8 in 32
163862306a36Sopenharmony_ci		 * 3 - 8 in 64
163962306a36Sopenharmony_ci		 */
164062306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_SAS       (1 << 26)
164162306a36Sopenharmony_ci                /* 0 - memory
164262306a36Sopenharmony_ci		 * 1 - register
164362306a36Sopenharmony_ci		 */
164462306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_DAS       (1 << 27)
164562306a36Sopenharmony_ci                /* 0 - memory
164662306a36Sopenharmony_ci		 * 1 - register
164762306a36Sopenharmony_ci		 */
164862306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_SAIC      (1 << 28)
164962306a36Sopenharmony_ci#              define PACKET3_CP_DMA_CMD_DAIC      (1 << 29)
165062306a36Sopenharmony_ci#define	PACKET3_PFP_SYNC_ME				0x42 /* r7xx+ only */
165162306a36Sopenharmony_ci#define	PACKET3_SURFACE_SYNC				0x43
165262306a36Sopenharmony_ci#              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
165362306a36Sopenharmony_ci#              define PACKET3_FULL_CACHE_ENA       (1 << 20) /* r7xx+ only */
165462306a36Sopenharmony_ci#              define PACKET3_TC_ACTION_ENA        (1 << 23)
165562306a36Sopenharmony_ci#              define PACKET3_VC_ACTION_ENA        (1 << 24)
165662306a36Sopenharmony_ci#              define PACKET3_CB_ACTION_ENA        (1 << 25)
165762306a36Sopenharmony_ci#              define PACKET3_DB_ACTION_ENA        (1 << 26)
165862306a36Sopenharmony_ci#              define PACKET3_SH_ACTION_ENA        (1 << 27)
165962306a36Sopenharmony_ci#              define PACKET3_SMX_ACTION_ENA       (1 << 28)
166062306a36Sopenharmony_ci#define	PACKET3_ME_INITIALIZE				0x44
166162306a36Sopenharmony_ci#define		PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
166262306a36Sopenharmony_ci#define	PACKET3_COND_WRITE				0x45
166362306a36Sopenharmony_ci#define	PACKET3_EVENT_WRITE				0x46
166462306a36Sopenharmony_ci#define		EVENT_TYPE(x)                           ((x) << 0)
166562306a36Sopenharmony_ci#define		EVENT_INDEX(x)                          ((x) << 8)
166662306a36Sopenharmony_ci                /* 0 - any non-TS event
166762306a36Sopenharmony_ci		 * 1 - ZPASS_DONE
166862306a36Sopenharmony_ci		 * 2 - SAMPLE_PIPELINESTAT
166962306a36Sopenharmony_ci		 * 3 - SAMPLE_STREAMOUTSTAT*
167062306a36Sopenharmony_ci		 * 4 - *S_PARTIAL_FLUSH
167162306a36Sopenharmony_ci		 * 5 - TS events
167262306a36Sopenharmony_ci		 */
167362306a36Sopenharmony_ci#define	PACKET3_EVENT_WRITE_EOP				0x47
167462306a36Sopenharmony_ci#define		DATA_SEL(x)                             ((x) << 29)
167562306a36Sopenharmony_ci                /* 0 - discard
167662306a36Sopenharmony_ci		 * 1 - send low 32bit data
167762306a36Sopenharmony_ci		 * 2 - send 64bit data
167862306a36Sopenharmony_ci		 * 3 - send 64bit counter value
167962306a36Sopenharmony_ci		 */
168062306a36Sopenharmony_ci#define		INT_SEL(x)                              ((x) << 24)
168162306a36Sopenharmony_ci                /* 0 - none
168262306a36Sopenharmony_ci		 * 1 - interrupt only (DATA_SEL = 0)
168362306a36Sopenharmony_ci		 * 2 - interrupt when data write is confirmed
168462306a36Sopenharmony_ci		 */
168562306a36Sopenharmony_ci#define	PACKET3_ONE_REG_WRITE				0x57
168662306a36Sopenharmony_ci#define	PACKET3_SET_CONFIG_REG				0x68
168762306a36Sopenharmony_ci#define		PACKET3_SET_CONFIG_REG_OFFSET			0x00008000
168862306a36Sopenharmony_ci#define		PACKET3_SET_CONFIG_REG_END			0x0000ac00
168962306a36Sopenharmony_ci#define	PACKET3_SET_CONTEXT_REG				0x69
169062306a36Sopenharmony_ci#define		PACKET3_SET_CONTEXT_REG_OFFSET			0x00028000
169162306a36Sopenharmony_ci#define		PACKET3_SET_CONTEXT_REG_END			0x00029000
169262306a36Sopenharmony_ci#define	PACKET3_SET_ALU_CONST				0x6A
169362306a36Sopenharmony_ci#define		PACKET3_SET_ALU_CONST_OFFSET			0x00030000
169462306a36Sopenharmony_ci#define		PACKET3_SET_ALU_CONST_END			0x00032000
169562306a36Sopenharmony_ci#define	PACKET3_SET_BOOL_CONST				0x6B
169662306a36Sopenharmony_ci#define		PACKET3_SET_BOOL_CONST_OFFSET			0x0003e380
169762306a36Sopenharmony_ci#define		PACKET3_SET_BOOL_CONST_END			0x00040000
169862306a36Sopenharmony_ci#define	PACKET3_SET_LOOP_CONST				0x6C
169962306a36Sopenharmony_ci#define		PACKET3_SET_LOOP_CONST_OFFSET			0x0003e200
170062306a36Sopenharmony_ci#define		PACKET3_SET_LOOP_CONST_END			0x0003e380
170162306a36Sopenharmony_ci#define	PACKET3_SET_RESOURCE				0x6D
170262306a36Sopenharmony_ci#define		PACKET3_SET_RESOURCE_OFFSET			0x00038000
170362306a36Sopenharmony_ci#define		PACKET3_SET_RESOURCE_END			0x0003c000
170462306a36Sopenharmony_ci#define	PACKET3_SET_SAMPLER				0x6E
170562306a36Sopenharmony_ci#define		PACKET3_SET_SAMPLER_OFFSET			0x0003c000
170662306a36Sopenharmony_ci#define		PACKET3_SET_SAMPLER_END				0x0003cff0
170762306a36Sopenharmony_ci#define	PACKET3_SET_CTL_CONST				0x6F
170862306a36Sopenharmony_ci#define		PACKET3_SET_CTL_CONST_OFFSET			0x0003cff0
170962306a36Sopenharmony_ci#define		PACKET3_SET_CTL_CONST_END			0x0003e200
171062306a36Sopenharmony_ci#define	PACKET3_STRMOUT_BASE_UPDATE			0x72 /* r7xx */
171162306a36Sopenharmony_ci#define	PACKET3_SURFACE_BASE_UPDATE			0x73
171262306a36Sopenharmony_ci
171362306a36Sopenharmony_ci#define R_000011_K8_FB_LOCATION                 0x11
171462306a36Sopenharmony_ci#define R_000012_MC_MISC_UMA_CNTL               0x12
171562306a36Sopenharmony_ci#define   G_000012_K8_ADDR_EXT(x)               (((x) >> 0) & 0xFF)
171662306a36Sopenharmony_ci#define R_0028F8_MC_INDEX			0x28F8
171762306a36Sopenharmony_ci#define   	S_0028F8_MC_IND_ADDR(x)                 (((x) & 0x1FF) << 0)
171862306a36Sopenharmony_ci#define   	C_0028F8_MC_IND_ADDR                    0xFFFFFE00
171962306a36Sopenharmony_ci#define   	S_0028F8_MC_IND_WR_EN(x)                (((x) & 0x1) << 9)
172062306a36Sopenharmony_ci#define R_0028FC_MC_DATA                        0x28FC
172162306a36Sopenharmony_ci
172262306a36Sopenharmony_ci#define	R_008020_GRBM_SOFT_RESET		0x8020
172362306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_CP(x)		(((x) & 1) << 0)
172462306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_CB(x)		(((x) & 1) << 1)
172562306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_CR(x)		(((x) & 1) << 2)
172662306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_DB(x)		(((x) & 1) << 3)
172762306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_PA(x)		(((x) & 1) << 5)
172862306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_SC(x)		(((x) & 1) << 6)
172962306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_SMX(x)		(((x) & 1) << 7)
173062306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_SPI(x)		(((x) & 1) << 8)
173162306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_SH(x)		(((x) & 1) << 9)
173262306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_SX(x)		(((x) & 1) << 10)
173362306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_TC(x)		(((x) & 1) << 11)
173462306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_TA(x)		(((x) & 1) << 12)
173562306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_VC(x)		(((x) & 1) << 13)
173662306a36Sopenharmony_ci#define		S_008020_SOFT_RESET_VGT(x)		(((x) & 1) << 14)
173762306a36Sopenharmony_ci#define	R_008010_GRBM_STATUS			0x8010
173862306a36Sopenharmony_ci#define		S_008010_CMDFIFO_AVAIL(x)		(((x) & 0x1F) << 0)
173962306a36Sopenharmony_ci#define		S_008010_CP_RQ_PENDING(x)		(((x) & 1) << 6)
174062306a36Sopenharmony_ci#define		S_008010_CF_RQ_PENDING(x)		(((x) & 1) << 7)
174162306a36Sopenharmony_ci#define		S_008010_PF_RQ_PENDING(x)		(((x) & 1) << 8)
174262306a36Sopenharmony_ci#define		S_008010_GRBM_EE_BUSY(x)		(((x) & 1) << 10)
174362306a36Sopenharmony_ci#define		S_008010_VC_BUSY(x)			(((x) & 1) << 11)
174462306a36Sopenharmony_ci#define		S_008010_DB03_CLEAN(x)			(((x) & 1) << 12)
174562306a36Sopenharmony_ci#define		S_008010_CB03_CLEAN(x)			(((x) & 1) << 13)
174662306a36Sopenharmony_ci#define		S_008010_VGT_BUSY_NO_DMA(x)		(((x) & 1) << 16)
174762306a36Sopenharmony_ci#define		S_008010_VGT_BUSY(x)			(((x) & 1) << 17)
174862306a36Sopenharmony_ci#define		S_008010_TA03_BUSY(x)			(((x) & 1) << 18)
174962306a36Sopenharmony_ci#define		S_008010_TC_BUSY(x)			(((x) & 1) << 19)
175062306a36Sopenharmony_ci#define		S_008010_SX_BUSY(x)			(((x) & 1) << 20)
175162306a36Sopenharmony_ci#define		S_008010_SH_BUSY(x)			(((x) & 1) << 21)
175262306a36Sopenharmony_ci#define		S_008010_SPI03_BUSY(x)			(((x) & 1) << 22)
175362306a36Sopenharmony_ci#define		S_008010_SMX_BUSY(x)			(((x) & 1) << 23)
175462306a36Sopenharmony_ci#define		S_008010_SC_BUSY(x)			(((x) & 1) << 24)
175562306a36Sopenharmony_ci#define		S_008010_PA_BUSY(x)			(((x) & 1) << 25)
175662306a36Sopenharmony_ci#define		S_008010_DB03_BUSY(x)			(((x) & 1) << 26)
175762306a36Sopenharmony_ci#define		S_008010_CR_BUSY(x)			(((x) & 1) << 27)
175862306a36Sopenharmony_ci#define		S_008010_CP_COHERENCY_BUSY(x)		(((x) & 1) << 28)
175962306a36Sopenharmony_ci#define		S_008010_CP_BUSY(x)			(((x) & 1) << 29)
176062306a36Sopenharmony_ci#define		S_008010_CB03_BUSY(x)			(((x) & 1) << 30)
176162306a36Sopenharmony_ci#define		S_008010_GUI_ACTIVE(x)			(((x) & 1) << 31)
176262306a36Sopenharmony_ci#define		G_008010_CMDFIFO_AVAIL(x)		(((x) >> 0) & 0x1F)
176362306a36Sopenharmony_ci#define		G_008010_CP_RQ_PENDING(x)		(((x) >> 6) & 1)
176462306a36Sopenharmony_ci#define		G_008010_CF_RQ_PENDING(x)		(((x) >> 7) & 1)
176562306a36Sopenharmony_ci#define		G_008010_PF_RQ_PENDING(x)		(((x) >> 8) & 1)
176662306a36Sopenharmony_ci#define		G_008010_GRBM_EE_BUSY(x)		(((x) >> 10) & 1)
176762306a36Sopenharmony_ci#define		G_008010_VC_BUSY(x)			(((x) >> 11) & 1)
176862306a36Sopenharmony_ci#define		G_008010_DB03_CLEAN(x)			(((x) >> 12) & 1)
176962306a36Sopenharmony_ci#define		G_008010_CB03_CLEAN(x)			(((x) >> 13) & 1)
177062306a36Sopenharmony_ci#define		G_008010_TA_BUSY(x)			(((x) >> 14) & 1)
177162306a36Sopenharmony_ci#define		G_008010_VGT_BUSY_NO_DMA(x)		(((x) >> 16) & 1)
177262306a36Sopenharmony_ci#define		G_008010_VGT_BUSY(x)			(((x) >> 17) & 1)
177362306a36Sopenharmony_ci#define		G_008010_TA03_BUSY(x)			(((x) >> 18) & 1)
177462306a36Sopenharmony_ci#define		G_008010_TC_BUSY(x)			(((x) >> 19) & 1)
177562306a36Sopenharmony_ci#define		G_008010_SX_BUSY(x)			(((x) >> 20) & 1)
177662306a36Sopenharmony_ci#define		G_008010_SH_BUSY(x)			(((x) >> 21) & 1)
177762306a36Sopenharmony_ci#define		G_008010_SPI03_BUSY(x)			(((x) >> 22) & 1)
177862306a36Sopenharmony_ci#define		G_008010_SMX_BUSY(x)			(((x) >> 23) & 1)
177962306a36Sopenharmony_ci#define		G_008010_SC_BUSY(x)			(((x) >> 24) & 1)
178062306a36Sopenharmony_ci#define		G_008010_PA_BUSY(x)			(((x) >> 25) & 1)
178162306a36Sopenharmony_ci#define		G_008010_DB03_BUSY(x)			(((x) >> 26) & 1)
178262306a36Sopenharmony_ci#define		G_008010_CR_BUSY(x)			(((x) >> 27) & 1)
178362306a36Sopenharmony_ci#define		G_008010_CP_COHERENCY_BUSY(x)		(((x) >> 28) & 1)
178462306a36Sopenharmony_ci#define		G_008010_CP_BUSY(x)			(((x) >> 29) & 1)
178562306a36Sopenharmony_ci#define		G_008010_CB03_BUSY(x)			(((x) >> 30) & 1)
178662306a36Sopenharmony_ci#define		G_008010_GUI_ACTIVE(x)			(((x) >> 31) & 1)
178762306a36Sopenharmony_ci#define	R_008014_GRBM_STATUS2			0x8014
178862306a36Sopenharmony_ci#define		S_008014_CR_CLEAN(x)			(((x) & 1) << 0)
178962306a36Sopenharmony_ci#define		S_008014_SMX_CLEAN(x)			(((x) & 1) << 1)
179062306a36Sopenharmony_ci#define		S_008014_SPI0_BUSY(x)			(((x) & 1) << 8)
179162306a36Sopenharmony_ci#define		S_008014_SPI1_BUSY(x)			(((x) & 1) << 9)
179262306a36Sopenharmony_ci#define		S_008014_SPI2_BUSY(x)			(((x) & 1) << 10)
179362306a36Sopenharmony_ci#define		S_008014_SPI3_BUSY(x)			(((x) & 1) << 11)
179462306a36Sopenharmony_ci#define		S_008014_TA0_BUSY(x)			(((x) & 1) << 12)
179562306a36Sopenharmony_ci#define		S_008014_TA1_BUSY(x)			(((x) & 1) << 13)
179662306a36Sopenharmony_ci#define		S_008014_TA2_BUSY(x)			(((x) & 1) << 14)
179762306a36Sopenharmony_ci#define		S_008014_TA3_BUSY(x)			(((x) & 1) << 15)
179862306a36Sopenharmony_ci#define		S_008014_DB0_BUSY(x)			(((x) & 1) << 16)
179962306a36Sopenharmony_ci#define		S_008014_DB1_BUSY(x)			(((x) & 1) << 17)
180062306a36Sopenharmony_ci#define		S_008014_DB2_BUSY(x)			(((x) & 1) << 18)
180162306a36Sopenharmony_ci#define		S_008014_DB3_BUSY(x)			(((x) & 1) << 19)
180262306a36Sopenharmony_ci#define		S_008014_CB0_BUSY(x)			(((x) & 1) << 20)
180362306a36Sopenharmony_ci#define		S_008014_CB1_BUSY(x)			(((x) & 1) << 21)
180462306a36Sopenharmony_ci#define		S_008014_CB2_BUSY(x)			(((x) & 1) << 22)
180562306a36Sopenharmony_ci#define		S_008014_CB3_BUSY(x)			(((x) & 1) << 23)
180662306a36Sopenharmony_ci#define		G_008014_CR_CLEAN(x)			(((x) >> 0) & 1)
180762306a36Sopenharmony_ci#define		G_008014_SMX_CLEAN(x)			(((x) >> 1) & 1)
180862306a36Sopenharmony_ci#define		G_008014_SPI0_BUSY(x)			(((x) >> 8) & 1)
180962306a36Sopenharmony_ci#define		G_008014_SPI1_BUSY(x)			(((x) >> 9) & 1)
181062306a36Sopenharmony_ci#define		G_008014_SPI2_BUSY(x)			(((x) >> 10) & 1)
181162306a36Sopenharmony_ci#define		G_008014_SPI3_BUSY(x)			(((x) >> 11) & 1)
181262306a36Sopenharmony_ci#define		G_008014_TA0_BUSY(x)			(((x) >> 12) & 1)
181362306a36Sopenharmony_ci#define		G_008014_TA1_BUSY(x)			(((x) >> 13) & 1)
181462306a36Sopenharmony_ci#define		G_008014_TA2_BUSY(x)			(((x) >> 14) & 1)
181562306a36Sopenharmony_ci#define		G_008014_TA3_BUSY(x)			(((x) >> 15) & 1)
181662306a36Sopenharmony_ci#define		G_008014_DB0_BUSY(x)			(((x) >> 16) & 1)
181762306a36Sopenharmony_ci#define		G_008014_DB1_BUSY(x)			(((x) >> 17) & 1)
181862306a36Sopenharmony_ci#define		G_008014_DB2_BUSY(x)			(((x) >> 18) & 1)
181962306a36Sopenharmony_ci#define		G_008014_DB3_BUSY(x)			(((x) >> 19) & 1)
182062306a36Sopenharmony_ci#define		G_008014_CB0_BUSY(x)			(((x) >> 20) & 1)
182162306a36Sopenharmony_ci#define		G_008014_CB1_BUSY(x)			(((x) >> 21) & 1)
182262306a36Sopenharmony_ci#define		G_008014_CB2_BUSY(x)			(((x) >> 22) & 1)
182362306a36Sopenharmony_ci#define		G_008014_CB3_BUSY(x)			(((x) >> 23) & 1)
182462306a36Sopenharmony_ci#define	R_000E50_SRBM_STATUS				0x0E50
182562306a36Sopenharmony_ci#define		G_000E50_RLC_RQ_PENDING(x)		(((x) >> 3) & 1)
182662306a36Sopenharmony_ci#define		G_000E50_RCU_RQ_PENDING(x)		(((x) >> 4) & 1)
182762306a36Sopenharmony_ci#define		G_000E50_GRBM_RQ_PENDING(x)		(((x) >> 5) & 1)
182862306a36Sopenharmony_ci#define		G_000E50_HI_RQ_PENDING(x)		(((x) >> 6) & 1)
182962306a36Sopenharmony_ci#define		G_000E50_IO_EXTERN_SIGNAL(x)		(((x) >> 7) & 1)
183062306a36Sopenharmony_ci#define		G_000E50_VMC_BUSY(x)			(((x) >> 8) & 1)
183162306a36Sopenharmony_ci#define		G_000E50_MCB_BUSY(x)			(((x) >> 9) & 1)
183262306a36Sopenharmony_ci#define		G_000E50_MCDZ_BUSY(x)			(((x) >> 10) & 1)
183362306a36Sopenharmony_ci#define		G_000E50_MCDY_BUSY(x)			(((x) >> 11) & 1)
183462306a36Sopenharmony_ci#define		G_000E50_MCDX_BUSY(x)			(((x) >> 12) & 1)
183562306a36Sopenharmony_ci#define		G_000E50_MCDW_BUSY(x)			(((x) >> 13) & 1)
183662306a36Sopenharmony_ci#define		G_000E50_SEM_BUSY(x)			(((x) >> 14) & 1)
183762306a36Sopenharmony_ci#define		G_000E50_RLC_BUSY(x)			(((x) >> 15) & 1)
183862306a36Sopenharmony_ci#define		G_000E50_IH_BUSY(x)			(((x) >> 17) & 1)
183962306a36Sopenharmony_ci#define		G_000E50_BIF_BUSY(x)			(((x) >> 29) & 1)
184062306a36Sopenharmony_ci#define	R_000E60_SRBM_SOFT_RESET			0x0E60
184162306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_BIF(x)		(((x) & 1) << 1)
184262306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_CG(x)		(((x) & 1) << 2)
184362306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_CMC(x)		(((x) & 1) << 3)
184462306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_CSC(x)		(((x) & 1) << 4)
184562306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_DC(x)		(((x) & 1) << 5)
184662306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_GRBM(x)		(((x) & 1) << 8)
184762306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_HDP(x)		(((x) & 1) << 9)
184862306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_IH(x)		(((x) & 1) << 10)
184962306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_MC(x)		(((x) & 1) << 11)
185062306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_RLC(x)		(((x) & 1) << 13)
185162306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_ROM(x)		(((x) & 1) << 14)
185262306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_SEM(x)		(((x) & 1) << 15)
185362306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_TSC(x)		(((x) & 1) << 16)
185462306a36Sopenharmony_ci#define		S_000E60_SOFT_RESET_VMC(x)		(((x) & 1) << 17)
185562306a36Sopenharmony_ci
185662306a36Sopenharmony_ci#define R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL		0x5480
185762306a36Sopenharmony_ci
185862306a36Sopenharmony_ci#define R_028C04_PA_SC_AA_CONFIG                     0x028C04
185962306a36Sopenharmony_ci#define   S_028C04_MSAA_NUM_SAMPLES(x)                 (((x) & 0x3) << 0)
186062306a36Sopenharmony_ci#define   G_028C04_MSAA_NUM_SAMPLES(x)                 (((x) >> 0) & 0x3)
186162306a36Sopenharmony_ci#define   C_028C04_MSAA_NUM_SAMPLES                    0xFFFFFFFC
186262306a36Sopenharmony_ci#define   S_028C04_AA_MASK_CENTROID_DTMN(x)            (((x) & 0x1) << 4)
186362306a36Sopenharmony_ci#define   G_028C04_AA_MASK_CENTROID_DTMN(x)            (((x) >> 4) & 0x1)
186462306a36Sopenharmony_ci#define   C_028C04_AA_MASK_CENTROID_DTMN               0xFFFFFFEF
186562306a36Sopenharmony_ci#define   S_028C04_MAX_SAMPLE_DIST(x)                  (((x) & 0xF) << 13)
186662306a36Sopenharmony_ci#define   G_028C04_MAX_SAMPLE_DIST(x)                  (((x) >> 13) & 0xF)
186762306a36Sopenharmony_ci#define   C_028C04_MAX_SAMPLE_DIST                     0xFFFE1FFF
186862306a36Sopenharmony_ci#define R_0280E0_CB_COLOR0_FRAG                      0x0280E0
186962306a36Sopenharmony_ci#define   S_0280E0_BASE_256B(x)                        (((x) & 0xFFFFFFFF) << 0)
187062306a36Sopenharmony_ci#define   G_0280E0_BASE_256B(x)                        (((x) >> 0) & 0xFFFFFFFF)
187162306a36Sopenharmony_ci#define   C_0280E0_BASE_256B                           0x00000000
187262306a36Sopenharmony_ci#define R_0280E4_CB_COLOR1_FRAG                      0x0280E4
187362306a36Sopenharmony_ci#define R_0280E8_CB_COLOR2_FRAG                      0x0280E8
187462306a36Sopenharmony_ci#define R_0280EC_CB_COLOR3_FRAG                      0x0280EC
187562306a36Sopenharmony_ci#define R_0280F0_CB_COLOR4_FRAG                      0x0280F0
187662306a36Sopenharmony_ci#define R_0280F4_CB_COLOR5_FRAG                      0x0280F4
187762306a36Sopenharmony_ci#define R_0280F8_CB_COLOR6_FRAG                      0x0280F8
187862306a36Sopenharmony_ci#define R_0280FC_CB_COLOR7_FRAG                      0x0280FC
187962306a36Sopenharmony_ci#define R_0280C0_CB_COLOR0_TILE                      0x0280C0
188062306a36Sopenharmony_ci#define   S_0280C0_BASE_256B(x)                        (((x) & 0xFFFFFFFF) << 0)
188162306a36Sopenharmony_ci#define   G_0280C0_BASE_256B(x)                        (((x) >> 0) & 0xFFFFFFFF)
188262306a36Sopenharmony_ci#define   C_0280C0_BASE_256B                           0x00000000
188362306a36Sopenharmony_ci#define R_0280C4_CB_COLOR1_TILE                      0x0280C4
188462306a36Sopenharmony_ci#define R_0280C8_CB_COLOR2_TILE                      0x0280C8
188562306a36Sopenharmony_ci#define R_0280CC_CB_COLOR3_TILE                      0x0280CC
188662306a36Sopenharmony_ci#define R_0280D0_CB_COLOR4_TILE                      0x0280D0
188762306a36Sopenharmony_ci#define R_0280D4_CB_COLOR5_TILE                      0x0280D4
188862306a36Sopenharmony_ci#define R_0280D8_CB_COLOR6_TILE                      0x0280D8
188962306a36Sopenharmony_ci#define R_0280DC_CB_COLOR7_TILE                      0x0280DC
189062306a36Sopenharmony_ci#define R_0280A0_CB_COLOR0_INFO                      0x0280A0
189162306a36Sopenharmony_ci#define   S_0280A0_ENDIAN(x)                           (((x) & 0x3) << 0)
189262306a36Sopenharmony_ci#define   G_0280A0_ENDIAN(x)                           (((x) >> 0) & 0x3)
189362306a36Sopenharmony_ci#define   C_0280A0_ENDIAN                              0xFFFFFFFC
189462306a36Sopenharmony_ci#define   S_0280A0_FORMAT(x)                           (((x) & 0x3F) << 2)
189562306a36Sopenharmony_ci#define   G_0280A0_FORMAT(x)                           (((x) >> 2) & 0x3F)
189662306a36Sopenharmony_ci#define   C_0280A0_FORMAT                              0xFFFFFF03
189762306a36Sopenharmony_ci#define     V_0280A0_COLOR_INVALID                     0x00000000
189862306a36Sopenharmony_ci#define     V_0280A0_COLOR_8                           0x00000001
189962306a36Sopenharmony_ci#define     V_0280A0_COLOR_4_4                         0x00000002
190062306a36Sopenharmony_ci#define     V_0280A0_COLOR_3_3_2                       0x00000003
190162306a36Sopenharmony_ci#define     V_0280A0_COLOR_16                          0x00000005
190262306a36Sopenharmony_ci#define     V_0280A0_COLOR_16_FLOAT                    0x00000006
190362306a36Sopenharmony_ci#define     V_0280A0_COLOR_8_8                         0x00000007
190462306a36Sopenharmony_ci#define     V_0280A0_COLOR_5_6_5                       0x00000008
190562306a36Sopenharmony_ci#define     V_0280A0_COLOR_6_5_5                       0x00000009
190662306a36Sopenharmony_ci#define     V_0280A0_COLOR_1_5_5_5                     0x0000000A
190762306a36Sopenharmony_ci#define     V_0280A0_COLOR_4_4_4_4                     0x0000000B
190862306a36Sopenharmony_ci#define     V_0280A0_COLOR_5_5_5_1                     0x0000000C
190962306a36Sopenharmony_ci#define     V_0280A0_COLOR_32                          0x0000000D
191062306a36Sopenharmony_ci#define     V_0280A0_COLOR_32_FLOAT                    0x0000000E
191162306a36Sopenharmony_ci#define     V_0280A0_COLOR_16_16                       0x0000000F
191262306a36Sopenharmony_ci#define     V_0280A0_COLOR_16_16_FLOAT                 0x00000010
191362306a36Sopenharmony_ci#define     V_0280A0_COLOR_8_24                        0x00000011
191462306a36Sopenharmony_ci#define     V_0280A0_COLOR_8_24_FLOAT                  0x00000012
191562306a36Sopenharmony_ci#define     V_0280A0_COLOR_24_8                        0x00000013
191662306a36Sopenharmony_ci#define     V_0280A0_COLOR_24_8_FLOAT                  0x00000014
191762306a36Sopenharmony_ci#define     V_0280A0_COLOR_10_11_11                    0x00000015
191862306a36Sopenharmony_ci#define     V_0280A0_COLOR_10_11_11_FLOAT              0x00000016
191962306a36Sopenharmony_ci#define     V_0280A0_COLOR_11_11_10                    0x00000017
192062306a36Sopenharmony_ci#define     V_0280A0_COLOR_11_11_10_FLOAT              0x00000018
192162306a36Sopenharmony_ci#define     V_0280A0_COLOR_2_10_10_10                  0x00000019
192262306a36Sopenharmony_ci#define     V_0280A0_COLOR_8_8_8_8                     0x0000001A
192362306a36Sopenharmony_ci#define     V_0280A0_COLOR_10_10_10_2                  0x0000001B
192462306a36Sopenharmony_ci#define     V_0280A0_COLOR_X24_8_32_FLOAT              0x0000001C
192562306a36Sopenharmony_ci#define     V_0280A0_COLOR_32_32                       0x0000001D
192662306a36Sopenharmony_ci#define     V_0280A0_COLOR_32_32_FLOAT                 0x0000001E
192762306a36Sopenharmony_ci#define     V_0280A0_COLOR_16_16_16_16                 0x0000001F
192862306a36Sopenharmony_ci#define     V_0280A0_COLOR_16_16_16_16_FLOAT           0x00000020
192962306a36Sopenharmony_ci#define     V_0280A0_COLOR_32_32_32_32                 0x00000022
193062306a36Sopenharmony_ci#define     V_0280A0_COLOR_32_32_32_32_FLOAT           0x00000023
193162306a36Sopenharmony_ci#define   S_0280A0_ARRAY_MODE(x)                       (((x) & 0xF) << 8)
193262306a36Sopenharmony_ci#define   G_0280A0_ARRAY_MODE(x)                       (((x) >> 8) & 0xF)
193362306a36Sopenharmony_ci#define   C_0280A0_ARRAY_MODE                          0xFFFFF0FF
193462306a36Sopenharmony_ci#define     V_0280A0_ARRAY_LINEAR_GENERAL              0x00000000
193562306a36Sopenharmony_ci#define     V_0280A0_ARRAY_LINEAR_ALIGNED              0x00000001
193662306a36Sopenharmony_ci#define     V_0280A0_ARRAY_1D_TILED_THIN1              0x00000002
193762306a36Sopenharmony_ci#define     V_0280A0_ARRAY_2D_TILED_THIN1              0x00000004
193862306a36Sopenharmony_ci#define   S_0280A0_NUMBER_TYPE(x)                      (((x) & 0x7) << 12)
193962306a36Sopenharmony_ci#define   G_0280A0_NUMBER_TYPE(x)                      (((x) >> 12) & 0x7)
194062306a36Sopenharmony_ci#define   C_0280A0_NUMBER_TYPE                         0xFFFF8FFF
194162306a36Sopenharmony_ci#define   S_0280A0_READ_SIZE(x)                        (((x) & 0x1) << 15)
194262306a36Sopenharmony_ci#define   G_0280A0_READ_SIZE(x)                        (((x) >> 15) & 0x1)
194362306a36Sopenharmony_ci#define   C_0280A0_READ_SIZE                           0xFFFF7FFF
194462306a36Sopenharmony_ci#define   S_0280A0_COMP_SWAP(x)                        (((x) & 0x3) << 16)
194562306a36Sopenharmony_ci#define   G_0280A0_COMP_SWAP(x)                        (((x) >> 16) & 0x3)
194662306a36Sopenharmony_ci#define   C_0280A0_COMP_SWAP                           0xFFFCFFFF
194762306a36Sopenharmony_ci#define   S_0280A0_TILE_MODE(x)                        (((x) & 0x3) << 18)
194862306a36Sopenharmony_ci#define   G_0280A0_TILE_MODE(x)                        (((x) >> 18) & 0x3)
194962306a36Sopenharmony_ci#define   C_0280A0_TILE_MODE                           0xFFF3FFFF
195062306a36Sopenharmony_ci#define     V_0280A0_TILE_DISABLE			0
195162306a36Sopenharmony_ci#define     V_0280A0_CLEAR_ENABLE			1
195262306a36Sopenharmony_ci#define     V_0280A0_FRAG_ENABLE			2
195362306a36Sopenharmony_ci#define   S_0280A0_BLEND_CLAMP(x)                      (((x) & 0x1) << 20)
195462306a36Sopenharmony_ci#define   G_0280A0_BLEND_CLAMP(x)                      (((x) >> 20) & 0x1)
195562306a36Sopenharmony_ci#define   C_0280A0_BLEND_CLAMP                         0xFFEFFFFF
195662306a36Sopenharmony_ci#define   S_0280A0_CLEAR_COLOR(x)                      (((x) & 0x1) << 21)
195762306a36Sopenharmony_ci#define   G_0280A0_CLEAR_COLOR(x)                      (((x) >> 21) & 0x1)
195862306a36Sopenharmony_ci#define   C_0280A0_CLEAR_COLOR                         0xFFDFFFFF
195962306a36Sopenharmony_ci#define   S_0280A0_BLEND_BYPASS(x)                     (((x) & 0x1) << 22)
196062306a36Sopenharmony_ci#define   G_0280A0_BLEND_BYPASS(x)                     (((x) >> 22) & 0x1)
196162306a36Sopenharmony_ci#define   C_0280A0_BLEND_BYPASS                        0xFFBFFFFF
196262306a36Sopenharmony_ci#define   S_0280A0_BLEND_FLOAT32(x)                    (((x) & 0x1) << 23)
196362306a36Sopenharmony_ci#define   G_0280A0_BLEND_FLOAT32(x)                    (((x) >> 23) & 0x1)
196462306a36Sopenharmony_ci#define   C_0280A0_BLEND_FLOAT32                       0xFF7FFFFF
196562306a36Sopenharmony_ci#define   S_0280A0_SIMPLE_FLOAT(x)                     (((x) & 0x1) << 24)
196662306a36Sopenharmony_ci#define   G_0280A0_SIMPLE_FLOAT(x)                     (((x) >> 24) & 0x1)
196762306a36Sopenharmony_ci#define   C_0280A0_SIMPLE_FLOAT                        0xFEFFFFFF
196862306a36Sopenharmony_ci#define   S_0280A0_ROUND_MODE(x)                       (((x) & 0x1) << 25)
196962306a36Sopenharmony_ci#define   G_0280A0_ROUND_MODE(x)                       (((x) >> 25) & 0x1)
197062306a36Sopenharmony_ci#define   C_0280A0_ROUND_MODE                          0xFDFFFFFF
197162306a36Sopenharmony_ci#define   S_0280A0_TILE_COMPACT(x)                     (((x) & 0x1) << 26)
197262306a36Sopenharmony_ci#define   G_0280A0_TILE_COMPACT(x)                     (((x) >> 26) & 0x1)
197362306a36Sopenharmony_ci#define   C_0280A0_TILE_COMPACT                        0xFBFFFFFF
197462306a36Sopenharmony_ci#define   S_0280A0_SOURCE_FORMAT(x)                    (((x) & 0x1) << 27)
197562306a36Sopenharmony_ci#define   G_0280A0_SOURCE_FORMAT(x)                    (((x) >> 27) & 0x1)
197662306a36Sopenharmony_ci#define   C_0280A0_SOURCE_FORMAT                       0xF7FFFFFF
197762306a36Sopenharmony_ci#define R_0280A4_CB_COLOR1_INFO                      0x0280A4
197862306a36Sopenharmony_ci#define R_0280A8_CB_COLOR2_INFO                      0x0280A8
197962306a36Sopenharmony_ci#define R_0280AC_CB_COLOR3_INFO                      0x0280AC
198062306a36Sopenharmony_ci#define R_0280B0_CB_COLOR4_INFO                      0x0280B0
198162306a36Sopenharmony_ci#define R_0280B4_CB_COLOR5_INFO                      0x0280B4
198262306a36Sopenharmony_ci#define R_0280B8_CB_COLOR6_INFO                      0x0280B8
198362306a36Sopenharmony_ci#define R_0280BC_CB_COLOR7_INFO                      0x0280BC
198462306a36Sopenharmony_ci#define R_028060_CB_COLOR0_SIZE                      0x028060
198562306a36Sopenharmony_ci#define   S_028060_PITCH_TILE_MAX(x)                   (((x) & 0x3FF) << 0)
198662306a36Sopenharmony_ci#define   G_028060_PITCH_TILE_MAX(x)                   (((x) >> 0) & 0x3FF)
198762306a36Sopenharmony_ci#define   C_028060_PITCH_TILE_MAX                      0xFFFFFC00
198862306a36Sopenharmony_ci#define   S_028060_SLICE_TILE_MAX(x)                   (((x) & 0xFFFFF) << 10)
198962306a36Sopenharmony_ci#define   G_028060_SLICE_TILE_MAX(x)                   (((x) >> 10) & 0xFFFFF)
199062306a36Sopenharmony_ci#define   C_028060_SLICE_TILE_MAX                      0xC00003FF
199162306a36Sopenharmony_ci#define R_028064_CB_COLOR1_SIZE                      0x028064
199262306a36Sopenharmony_ci#define R_028068_CB_COLOR2_SIZE                      0x028068
199362306a36Sopenharmony_ci#define R_02806C_CB_COLOR3_SIZE                      0x02806C
199462306a36Sopenharmony_ci#define R_028070_CB_COLOR4_SIZE                      0x028070
199562306a36Sopenharmony_ci#define R_028074_CB_COLOR5_SIZE                      0x028074
199662306a36Sopenharmony_ci#define R_028078_CB_COLOR6_SIZE                      0x028078
199762306a36Sopenharmony_ci#define R_02807C_CB_COLOR7_SIZE                      0x02807C
199862306a36Sopenharmony_ci#define R_028238_CB_TARGET_MASK                      0x028238
199962306a36Sopenharmony_ci#define   S_028238_TARGET0_ENABLE(x)                   (((x) & 0xF) << 0)
200062306a36Sopenharmony_ci#define   G_028238_TARGET0_ENABLE(x)                   (((x) >> 0) & 0xF)
200162306a36Sopenharmony_ci#define   C_028238_TARGET0_ENABLE                      0xFFFFFFF0
200262306a36Sopenharmony_ci#define   S_028238_TARGET1_ENABLE(x)                   (((x) & 0xF) << 4)
200362306a36Sopenharmony_ci#define   G_028238_TARGET1_ENABLE(x)                   (((x) >> 4) & 0xF)
200462306a36Sopenharmony_ci#define   C_028238_TARGET1_ENABLE                      0xFFFFFF0F
200562306a36Sopenharmony_ci#define   S_028238_TARGET2_ENABLE(x)                   (((x) & 0xF) << 8)
200662306a36Sopenharmony_ci#define   G_028238_TARGET2_ENABLE(x)                   (((x) >> 8) & 0xF)
200762306a36Sopenharmony_ci#define   C_028238_TARGET2_ENABLE                      0xFFFFF0FF
200862306a36Sopenharmony_ci#define   S_028238_TARGET3_ENABLE(x)                   (((x) & 0xF) << 12)
200962306a36Sopenharmony_ci#define   G_028238_TARGET3_ENABLE(x)                   (((x) >> 12) & 0xF)
201062306a36Sopenharmony_ci#define   C_028238_TARGET3_ENABLE                      0xFFFF0FFF
201162306a36Sopenharmony_ci#define   S_028238_TARGET4_ENABLE(x)                   (((x) & 0xF) << 16)
201262306a36Sopenharmony_ci#define   G_028238_TARGET4_ENABLE(x)                   (((x) >> 16) & 0xF)
201362306a36Sopenharmony_ci#define   C_028238_TARGET4_ENABLE                      0xFFF0FFFF
201462306a36Sopenharmony_ci#define   S_028238_TARGET5_ENABLE(x)                   (((x) & 0xF) << 20)
201562306a36Sopenharmony_ci#define   G_028238_TARGET5_ENABLE(x)                   (((x) >> 20) & 0xF)
201662306a36Sopenharmony_ci#define   C_028238_TARGET5_ENABLE                      0xFF0FFFFF
201762306a36Sopenharmony_ci#define   S_028238_TARGET6_ENABLE(x)                   (((x) & 0xF) << 24)
201862306a36Sopenharmony_ci#define   G_028238_TARGET6_ENABLE(x)                   (((x) >> 24) & 0xF)
201962306a36Sopenharmony_ci#define   C_028238_TARGET6_ENABLE                      0xF0FFFFFF
202062306a36Sopenharmony_ci#define   S_028238_TARGET7_ENABLE(x)                   (((x) & 0xF) << 28)
202162306a36Sopenharmony_ci#define   G_028238_TARGET7_ENABLE(x)                   (((x) >> 28) & 0xF)
202262306a36Sopenharmony_ci#define   C_028238_TARGET7_ENABLE                      0x0FFFFFFF
202362306a36Sopenharmony_ci#define R_02823C_CB_SHADER_MASK                      0x02823C
202462306a36Sopenharmony_ci#define   S_02823C_OUTPUT0_ENABLE(x)                   (((x) & 0xF) << 0)
202562306a36Sopenharmony_ci#define   G_02823C_OUTPUT0_ENABLE(x)                   (((x) >> 0) & 0xF)
202662306a36Sopenharmony_ci#define   C_02823C_OUTPUT0_ENABLE                      0xFFFFFFF0
202762306a36Sopenharmony_ci#define   S_02823C_OUTPUT1_ENABLE(x)                   (((x) & 0xF) << 4)
202862306a36Sopenharmony_ci#define   G_02823C_OUTPUT1_ENABLE(x)                   (((x) >> 4) & 0xF)
202962306a36Sopenharmony_ci#define   C_02823C_OUTPUT1_ENABLE                      0xFFFFFF0F
203062306a36Sopenharmony_ci#define   S_02823C_OUTPUT2_ENABLE(x)                   (((x) & 0xF) << 8)
203162306a36Sopenharmony_ci#define   G_02823C_OUTPUT2_ENABLE(x)                   (((x) >> 8) & 0xF)
203262306a36Sopenharmony_ci#define   C_02823C_OUTPUT2_ENABLE                      0xFFFFF0FF
203362306a36Sopenharmony_ci#define   S_02823C_OUTPUT3_ENABLE(x)                   (((x) & 0xF) << 12)
203462306a36Sopenharmony_ci#define   G_02823C_OUTPUT3_ENABLE(x)                   (((x) >> 12) & 0xF)
203562306a36Sopenharmony_ci#define   C_02823C_OUTPUT3_ENABLE                      0xFFFF0FFF
203662306a36Sopenharmony_ci#define   S_02823C_OUTPUT4_ENABLE(x)                   (((x) & 0xF) << 16)
203762306a36Sopenharmony_ci#define   G_02823C_OUTPUT4_ENABLE(x)                   (((x) >> 16) & 0xF)
203862306a36Sopenharmony_ci#define   C_02823C_OUTPUT4_ENABLE                      0xFFF0FFFF
203962306a36Sopenharmony_ci#define   S_02823C_OUTPUT5_ENABLE(x)                   (((x) & 0xF) << 20)
204062306a36Sopenharmony_ci#define   G_02823C_OUTPUT5_ENABLE(x)                   (((x) >> 20) & 0xF)
204162306a36Sopenharmony_ci#define   C_02823C_OUTPUT5_ENABLE                      0xFF0FFFFF
204262306a36Sopenharmony_ci#define   S_02823C_OUTPUT6_ENABLE(x)                   (((x) & 0xF) << 24)
204362306a36Sopenharmony_ci#define   G_02823C_OUTPUT6_ENABLE(x)                   (((x) >> 24) & 0xF)
204462306a36Sopenharmony_ci#define   C_02823C_OUTPUT6_ENABLE                      0xF0FFFFFF
204562306a36Sopenharmony_ci#define   S_02823C_OUTPUT7_ENABLE(x)                   (((x) & 0xF) << 28)
204662306a36Sopenharmony_ci#define   G_02823C_OUTPUT7_ENABLE(x)                   (((x) >> 28) & 0xF)
204762306a36Sopenharmony_ci#define   C_02823C_OUTPUT7_ENABLE                      0x0FFFFFFF
204862306a36Sopenharmony_ci#define R_028AB0_VGT_STRMOUT_EN                      0x028AB0
204962306a36Sopenharmony_ci#define   S_028AB0_STREAMOUT(x)                        (((x) & 0x1) << 0)
205062306a36Sopenharmony_ci#define   G_028AB0_STREAMOUT(x)                        (((x) >> 0) & 0x1)
205162306a36Sopenharmony_ci#define   C_028AB0_STREAMOUT                           0xFFFFFFFE
205262306a36Sopenharmony_ci#define R_028B20_VGT_STRMOUT_BUFFER_EN               0x028B20
205362306a36Sopenharmony_ci#define   S_028B20_BUFFER_0_EN(x)                      (((x) & 0x1) << 0)
205462306a36Sopenharmony_ci#define   G_028B20_BUFFER_0_EN(x)                      (((x) >> 0) & 0x1)
205562306a36Sopenharmony_ci#define   C_028B20_BUFFER_0_EN                         0xFFFFFFFE
205662306a36Sopenharmony_ci#define   S_028B20_BUFFER_1_EN(x)                      (((x) & 0x1) << 1)
205762306a36Sopenharmony_ci#define   G_028B20_BUFFER_1_EN(x)                      (((x) >> 1) & 0x1)
205862306a36Sopenharmony_ci#define   C_028B20_BUFFER_1_EN                         0xFFFFFFFD
205962306a36Sopenharmony_ci#define   S_028B20_BUFFER_2_EN(x)                      (((x) & 0x1) << 2)
206062306a36Sopenharmony_ci#define   G_028B20_BUFFER_2_EN(x)                      (((x) >> 2) & 0x1)
206162306a36Sopenharmony_ci#define   C_028B20_BUFFER_2_EN                         0xFFFFFFFB
206262306a36Sopenharmony_ci#define   S_028B20_BUFFER_3_EN(x)                      (((x) & 0x1) << 3)
206362306a36Sopenharmony_ci#define   G_028B20_BUFFER_3_EN(x)                      (((x) >> 3) & 0x1)
206462306a36Sopenharmony_ci#define   C_028B20_BUFFER_3_EN                         0xFFFFFFF7
206562306a36Sopenharmony_ci#define   S_028B20_SIZE(x)                             (((x) & 0xFFFFFFFF) << 0)
206662306a36Sopenharmony_ci#define   G_028B20_SIZE(x)                             (((x) >> 0) & 0xFFFFFFFF)
206762306a36Sopenharmony_ci#define   C_028B20_SIZE                                0x00000000
206862306a36Sopenharmony_ci#define R_038000_SQ_TEX_RESOURCE_WORD0_0             0x038000
206962306a36Sopenharmony_ci#define   S_038000_DIM(x)                              (((x) & 0x7) << 0)
207062306a36Sopenharmony_ci#define   G_038000_DIM(x)                              (((x) >> 0) & 0x7)
207162306a36Sopenharmony_ci#define   C_038000_DIM                                 0xFFFFFFF8
207262306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_1D                     0x00000000
207362306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_2D                     0x00000001
207462306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_3D                     0x00000002
207562306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_CUBEMAP                0x00000003
207662306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_1D_ARRAY               0x00000004
207762306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_2D_ARRAY               0x00000005
207862306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_2D_MSAA                0x00000006
207962306a36Sopenharmony_ci#define     V_038000_SQ_TEX_DIM_2D_ARRAY_MSAA          0x00000007
208062306a36Sopenharmony_ci#define   S_038000_TILE_MODE(x)                        (((x) & 0xF) << 3)
208162306a36Sopenharmony_ci#define   G_038000_TILE_MODE(x)                        (((x) >> 3) & 0xF)
208262306a36Sopenharmony_ci#define   C_038000_TILE_MODE                           0xFFFFFF87
208362306a36Sopenharmony_ci#define     V_038000_ARRAY_LINEAR_GENERAL              0x00000000
208462306a36Sopenharmony_ci#define     V_038000_ARRAY_LINEAR_ALIGNED              0x00000001
208562306a36Sopenharmony_ci#define     V_038000_ARRAY_1D_TILED_THIN1              0x00000002
208662306a36Sopenharmony_ci#define     V_038000_ARRAY_2D_TILED_THIN1              0x00000004
208762306a36Sopenharmony_ci#define   S_038000_TILE_TYPE(x)                        (((x) & 0x1) << 7)
208862306a36Sopenharmony_ci#define   G_038000_TILE_TYPE(x)                        (((x) >> 7) & 0x1)
208962306a36Sopenharmony_ci#define   C_038000_TILE_TYPE                           0xFFFFFF7F
209062306a36Sopenharmony_ci#define   S_038000_PITCH(x)                            (((x) & 0x7FF) << 8)
209162306a36Sopenharmony_ci#define   G_038000_PITCH(x)                            (((x) >> 8) & 0x7FF)
209262306a36Sopenharmony_ci#define   C_038000_PITCH                               0xFFF800FF
209362306a36Sopenharmony_ci#define   S_038000_TEX_WIDTH(x)                        (((x) & 0x1FFF) << 19)
209462306a36Sopenharmony_ci#define   G_038000_TEX_WIDTH(x)                        (((x) >> 19) & 0x1FFF)
209562306a36Sopenharmony_ci#define   C_038000_TEX_WIDTH                           0x0007FFFF
209662306a36Sopenharmony_ci#define R_038004_SQ_TEX_RESOURCE_WORD1_0             0x038004
209762306a36Sopenharmony_ci#define   S_038004_TEX_HEIGHT(x)                       (((x) & 0x1FFF) << 0)
209862306a36Sopenharmony_ci#define   G_038004_TEX_HEIGHT(x)                       (((x) >> 0) & 0x1FFF)
209962306a36Sopenharmony_ci#define   C_038004_TEX_HEIGHT                          0xFFFFE000
210062306a36Sopenharmony_ci#define   S_038004_TEX_DEPTH(x)                        (((x) & 0x1FFF) << 13)
210162306a36Sopenharmony_ci#define   G_038004_TEX_DEPTH(x)                        (((x) >> 13) & 0x1FFF)
210262306a36Sopenharmony_ci#define   C_038004_TEX_DEPTH                           0xFC001FFF
210362306a36Sopenharmony_ci#define   S_038004_DATA_FORMAT(x)                      (((x) & 0x3F) << 26)
210462306a36Sopenharmony_ci#define   G_038004_DATA_FORMAT(x)                      (((x) >> 26) & 0x3F)
210562306a36Sopenharmony_ci#define   C_038004_DATA_FORMAT                         0x03FFFFFF
210662306a36Sopenharmony_ci#define     V_038004_COLOR_INVALID                     0x00000000
210762306a36Sopenharmony_ci#define     V_038004_COLOR_8                           0x00000001
210862306a36Sopenharmony_ci#define     V_038004_COLOR_4_4                         0x00000002
210962306a36Sopenharmony_ci#define     V_038004_COLOR_3_3_2                       0x00000003
211062306a36Sopenharmony_ci#define     V_038004_COLOR_16                          0x00000005
211162306a36Sopenharmony_ci#define     V_038004_COLOR_16_FLOAT                    0x00000006
211262306a36Sopenharmony_ci#define     V_038004_COLOR_8_8                         0x00000007
211362306a36Sopenharmony_ci#define     V_038004_COLOR_5_6_5                       0x00000008
211462306a36Sopenharmony_ci#define     V_038004_COLOR_6_5_5                       0x00000009
211562306a36Sopenharmony_ci#define     V_038004_COLOR_1_5_5_5                     0x0000000A
211662306a36Sopenharmony_ci#define     V_038004_COLOR_4_4_4_4                     0x0000000B
211762306a36Sopenharmony_ci#define     V_038004_COLOR_5_5_5_1                     0x0000000C
211862306a36Sopenharmony_ci#define     V_038004_COLOR_32                          0x0000000D
211962306a36Sopenharmony_ci#define     V_038004_COLOR_32_FLOAT                    0x0000000E
212062306a36Sopenharmony_ci#define     V_038004_COLOR_16_16                       0x0000000F
212162306a36Sopenharmony_ci#define     V_038004_COLOR_16_16_FLOAT                 0x00000010
212262306a36Sopenharmony_ci#define     V_038004_COLOR_8_24                        0x00000011
212362306a36Sopenharmony_ci#define     V_038004_COLOR_8_24_FLOAT                  0x00000012
212462306a36Sopenharmony_ci#define     V_038004_COLOR_24_8                        0x00000013
212562306a36Sopenharmony_ci#define     V_038004_COLOR_24_8_FLOAT                  0x00000014
212662306a36Sopenharmony_ci#define     V_038004_COLOR_10_11_11                    0x00000015
212762306a36Sopenharmony_ci#define     V_038004_COLOR_10_11_11_FLOAT              0x00000016
212862306a36Sopenharmony_ci#define     V_038004_COLOR_11_11_10                    0x00000017
212962306a36Sopenharmony_ci#define     V_038004_COLOR_11_11_10_FLOAT              0x00000018
213062306a36Sopenharmony_ci#define     V_038004_COLOR_2_10_10_10                  0x00000019
213162306a36Sopenharmony_ci#define     V_038004_COLOR_8_8_8_8                     0x0000001A
213262306a36Sopenharmony_ci#define     V_038004_COLOR_10_10_10_2                  0x0000001B
213362306a36Sopenharmony_ci#define     V_038004_COLOR_X24_8_32_FLOAT              0x0000001C
213462306a36Sopenharmony_ci#define     V_038004_COLOR_32_32                       0x0000001D
213562306a36Sopenharmony_ci#define     V_038004_COLOR_32_32_FLOAT                 0x0000001E
213662306a36Sopenharmony_ci#define     V_038004_COLOR_16_16_16_16                 0x0000001F
213762306a36Sopenharmony_ci#define     V_038004_COLOR_16_16_16_16_FLOAT           0x00000020
213862306a36Sopenharmony_ci#define     V_038004_COLOR_32_32_32_32                 0x00000022
213962306a36Sopenharmony_ci#define     V_038004_COLOR_32_32_32_32_FLOAT           0x00000023
214062306a36Sopenharmony_ci#define     V_038004_FMT_1                             0x00000025
214162306a36Sopenharmony_ci#define     V_038004_FMT_GB_GR                         0x00000027
214262306a36Sopenharmony_ci#define     V_038004_FMT_BG_RG                         0x00000028
214362306a36Sopenharmony_ci#define     V_038004_FMT_32_AS_8                       0x00000029
214462306a36Sopenharmony_ci#define     V_038004_FMT_32_AS_8_8                     0x0000002A
214562306a36Sopenharmony_ci#define     V_038004_FMT_5_9_9_9_SHAREDEXP             0x0000002B
214662306a36Sopenharmony_ci#define     V_038004_FMT_8_8_8                         0x0000002C
214762306a36Sopenharmony_ci#define     V_038004_FMT_16_16_16                      0x0000002D
214862306a36Sopenharmony_ci#define     V_038004_FMT_16_16_16_FLOAT                0x0000002E
214962306a36Sopenharmony_ci#define     V_038004_FMT_32_32_32                      0x0000002F
215062306a36Sopenharmony_ci#define     V_038004_FMT_32_32_32_FLOAT                0x00000030
215162306a36Sopenharmony_ci#define     V_038004_FMT_BC1                           0x00000031
215262306a36Sopenharmony_ci#define     V_038004_FMT_BC2                           0x00000032
215362306a36Sopenharmony_ci#define     V_038004_FMT_BC3                           0x00000033
215462306a36Sopenharmony_ci#define     V_038004_FMT_BC4                           0x00000034
215562306a36Sopenharmony_ci#define     V_038004_FMT_BC5                           0x00000035
215662306a36Sopenharmony_ci#define     V_038004_FMT_BC6                           0x00000036
215762306a36Sopenharmony_ci#define     V_038004_FMT_BC7                           0x00000037
215862306a36Sopenharmony_ci#define     V_038004_FMT_32_AS_32_32_32_32             0x00000038
215962306a36Sopenharmony_ci#define R_038010_SQ_TEX_RESOURCE_WORD4_0             0x038010
216062306a36Sopenharmony_ci#define   S_038010_FORMAT_COMP_X(x)                    (((x) & 0x3) << 0)
216162306a36Sopenharmony_ci#define   G_038010_FORMAT_COMP_X(x)                    (((x) >> 0) & 0x3)
216262306a36Sopenharmony_ci#define   C_038010_FORMAT_COMP_X                       0xFFFFFFFC
216362306a36Sopenharmony_ci#define   S_038010_FORMAT_COMP_Y(x)                    (((x) & 0x3) << 2)
216462306a36Sopenharmony_ci#define   G_038010_FORMAT_COMP_Y(x)                    (((x) >> 2) & 0x3)
216562306a36Sopenharmony_ci#define   C_038010_FORMAT_COMP_Y                       0xFFFFFFF3
216662306a36Sopenharmony_ci#define   S_038010_FORMAT_COMP_Z(x)                    (((x) & 0x3) << 4)
216762306a36Sopenharmony_ci#define   G_038010_FORMAT_COMP_Z(x)                    (((x) >> 4) & 0x3)
216862306a36Sopenharmony_ci#define   C_038010_FORMAT_COMP_Z                       0xFFFFFFCF
216962306a36Sopenharmony_ci#define   S_038010_FORMAT_COMP_W(x)                    (((x) & 0x3) << 6)
217062306a36Sopenharmony_ci#define   G_038010_FORMAT_COMP_W(x)                    (((x) >> 6) & 0x3)
217162306a36Sopenharmony_ci#define   C_038010_FORMAT_COMP_W                       0xFFFFFF3F
217262306a36Sopenharmony_ci#define   S_038010_NUM_FORMAT_ALL(x)                   (((x) & 0x3) << 8)
217362306a36Sopenharmony_ci#define   G_038010_NUM_FORMAT_ALL(x)                   (((x) >> 8) & 0x3)
217462306a36Sopenharmony_ci#define   C_038010_NUM_FORMAT_ALL                      0xFFFFFCFF
217562306a36Sopenharmony_ci#define   S_038010_SRF_MODE_ALL(x)                     (((x) & 0x1) << 10)
217662306a36Sopenharmony_ci#define   G_038010_SRF_MODE_ALL(x)                     (((x) >> 10) & 0x1)
217762306a36Sopenharmony_ci#define   C_038010_SRF_MODE_ALL                        0xFFFFFBFF
217862306a36Sopenharmony_ci#define   S_038010_FORCE_DEGAMMA(x)                    (((x) & 0x1) << 11)
217962306a36Sopenharmony_ci#define   G_038010_FORCE_DEGAMMA(x)                    (((x) >> 11) & 0x1)
218062306a36Sopenharmony_ci#define   C_038010_FORCE_DEGAMMA                       0xFFFFF7FF
218162306a36Sopenharmony_ci#define   S_038010_ENDIAN_SWAP(x)                      (((x) & 0x3) << 12)
218262306a36Sopenharmony_ci#define   G_038010_ENDIAN_SWAP(x)                      (((x) >> 12) & 0x3)
218362306a36Sopenharmony_ci#define   C_038010_ENDIAN_SWAP                         0xFFFFCFFF
218462306a36Sopenharmony_ci#define   S_038010_REQUEST_SIZE(x)                     (((x) & 0x3) << 14)
218562306a36Sopenharmony_ci#define   G_038010_REQUEST_SIZE(x)                     (((x) >> 14) & 0x3)
218662306a36Sopenharmony_ci#define   C_038010_REQUEST_SIZE                        0xFFFF3FFF
218762306a36Sopenharmony_ci#define   S_038010_DST_SEL_X(x)                        (((x) & 0x7) << 16)
218862306a36Sopenharmony_ci#define   G_038010_DST_SEL_X(x)                        (((x) >> 16) & 0x7)
218962306a36Sopenharmony_ci#define   C_038010_DST_SEL_X                           0xFFF8FFFF
219062306a36Sopenharmony_ci#define   S_038010_DST_SEL_Y(x)                        (((x) & 0x7) << 19)
219162306a36Sopenharmony_ci#define   G_038010_DST_SEL_Y(x)                        (((x) >> 19) & 0x7)
219262306a36Sopenharmony_ci#define   C_038010_DST_SEL_Y                           0xFFC7FFFF
219362306a36Sopenharmony_ci#define   S_038010_DST_SEL_Z(x)                        (((x) & 0x7) << 22)
219462306a36Sopenharmony_ci#define   G_038010_DST_SEL_Z(x)                        (((x) >> 22) & 0x7)
219562306a36Sopenharmony_ci#define   C_038010_DST_SEL_Z                           0xFE3FFFFF
219662306a36Sopenharmony_ci#define   S_038010_DST_SEL_W(x)                        (((x) & 0x7) << 25)
219762306a36Sopenharmony_ci#define   G_038010_DST_SEL_W(x)                        (((x) >> 25) & 0x7)
219862306a36Sopenharmony_ci#define   C_038010_DST_SEL_W                           0xF1FFFFFF
219962306a36Sopenharmony_ci#	define SQ_SEL_X					0
220062306a36Sopenharmony_ci#	define SQ_SEL_Y					1
220162306a36Sopenharmony_ci#	define SQ_SEL_Z					2
220262306a36Sopenharmony_ci#	define SQ_SEL_W					3
220362306a36Sopenharmony_ci#	define SQ_SEL_0					4
220462306a36Sopenharmony_ci#	define SQ_SEL_1					5
220562306a36Sopenharmony_ci#define   S_038010_BASE_LEVEL(x)                       (((x) & 0xF) << 28)
220662306a36Sopenharmony_ci#define   G_038010_BASE_LEVEL(x)                       (((x) >> 28) & 0xF)
220762306a36Sopenharmony_ci#define   C_038010_BASE_LEVEL                          0x0FFFFFFF
220862306a36Sopenharmony_ci#define R_038014_SQ_TEX_RESOURCE_WORD5_0             0x038014
220962306a36Sopenharmony_ci#define   S_038014_LAST_LEVEL(x)                       (((x) & 0xF) << 0)
221062306a36Sopenharmony_ci#define   G_038014_LAST_LEVEL(x)                       (((x) >> 0) & 0xF)
221162306a36Sopenharmony_ci#define   C_038014_LAST_LEVEL                          0xFFFFFFF0
221262306a36Sopenharmony_ci#define   S_038014_BASE_ARRAY(x)                       (((x) & 0x1FFF) << 4)
221362306a36Sopenharmony_ci#define   G_038014_BASE_ARRAY(x)                       (((x) >> 4) & 0x1FFF)
221462306a36Sopenharmony_ci#define   C_038014_BASE_ARRAY                          0xFFFE000F
221562306a36Sopenharmony_ci#define   S_038014_LAST_ARRAY(x)                       (((x) & 0x1FFF) << 17)
221662306a36Sopenharmony_ci#define   G_038014_LAST_ARRAY(x)                       (((x) >> 17) & 0x1FFF)
221762306a36Sopenharmony_ci#define   C_038014_LAST_ARRAY                          0xC001FFFF
221862306a36Sopenharmony_ci#define R_0288A8_SQ_ESGS_RING_ITEMSIZE               0x0288A8
221962306a36Sopenharmony_ci#define   S_0288A8_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
222062306a36Sopenharmony_ci#define   G_0288A8_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
222162306a36Sopenharmony_ci#define   C_0288A8_ITEMSIZE                            0xFFFF8000
222262306a36Sopenharmony_ci#define R_008C44_SQ_ESGS_RING_SIZE                   0x008C44
222362306a36Sopenharmony_ci#define   S_008C44_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
222462306a36Sopenharmony_ci#define   G_008C44_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
222562306a36Sopenharmony_ci#define   C_008C44_MEM_SIZE                            0x00000000
222662306a36Sopenharmony_ci#define R_0288B0_SQ_ESTMP_RING_ITEMSIZE              0x0288B0
222762306a36Sopenharmony_ci#define   S_0288B0_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
222862306a36Sopenharmony_ci#define   G_0288B0_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
222962306a36Sopenharmony_ci#define   C_0288B0_ITEMSIZE                            0xFFFF8000
223062306a36Sopenharmony_ci#define R_008C54_SQ_ESTMP_RING_SIZE                  0x008C54
223162306a36Sopenharmony_ci#define   S_008C54_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
223262306a36Sopenharmony_ci#define   G_008C54_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
223362306a36Sopenharmony_ci#define   C_008C54_MEM_SIZE                            0x00000000
223462306a36Sopenharmony_ci#define R_0288C0_SQ_FBUF_RING_ITEMSIZE               0x0288C0
223562306a36Sopenharmony_ci#define   S_0288C0_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
223662306a36Sopenharmony_ci#define   G_0288C0_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
223762306a36Sopenharmony_ci#define   C_0288C0_ITEMSIZE                            0xFFFF8000
223862306a36Sopenharmony_ci#define R_008C74_SQ_FBUF_RING_SIZE                   0x008C74
223962306a36Sopenharmony_ci#define   S_008C74_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
224062306a36Sopenharmony_ci#define   G_008C74_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
224162306a36Sopenharmony_ci#define   C_008C74_MEM_SIZE                            0x00000000
224262306a36Sopenharmony_ci#define R_0288B4_SQ_GSTMP_RING_ITEMSIZE              0x0288B4
224362306a36Sopenharmony_ci#define   S_0288B4_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
224462306a36Sopenharmony_ci#define   G_0288B4_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
224562306a36Sopenharmony_ci#define   C_0288B4_ITEMSIZE                            0xFFFF8000
224662306a36Sopenharmony_ci#define R_008C5C_SQ_GSTMP_RING_SIZE                  0x008C5C
224762306a36Sopenharmony_ci#define   S_008C5C_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
224862306a36Sopenharmony_ci#define   G_008C5C_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
224962306a36Sopenharmony_ci#define   C_008C5C_MEM_SIZE                            0x00000000
225062306a36Sopenharmony_ci#define R_0288AC_SQ_GSVS_RING_ITEMSIZE               0x0288AC
225162306a36Sopenharmony_ci#define   S_0288AC_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
225262306a36Sopenharmony_ci#define   G_0288AC_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
225362306a36Sopenharmony_ci#define   C_0288AC_ITEMSIZE                            0xFFFF8000
225462306a36Sopenharmony_ci#define R_008C4C_SQ_GSVS_RING_SIZE                   0x008C4C
225562306a36Sopenharmony_ci#define   S_008C4C_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
225662306a36Sopenharmony_ci#define   G_008C4C_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
225762306a36Sopenharmony_ci#define   C_008C4C_MEM_SIZE                            0x00000000
225862306a36Sopenharmony_ci#define R_0288BC_SQ_PSTMP_RING_ITEMSIZE              0x0288BC
225962306a36Sopenharmony_ci#define   S_0288BC_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
226062306a36Sopenharmony_ci#define   G_0288BC_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
226162306a36Sopenharmony_ci#define   C_0288BC_ITEMSIZE                            0xFFFF8000
226262306a36Sopenharmony_ci#define R_008C6C_SQ_PSTMP_RING_SIZE                  0x008C6C
226362306a36Sopenharmony_ci#define   S_008C6C_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
226462306a36Sopenharmony_ci#define   G_008C6C_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
226562306a36Sopenharmony_ci#define   C_008C6C_MEM_SIZE                            0x00000000
226662306a36Sopenharmony_ci#define R_0288C4_SQ_REDUC_RING_ITEMSIZE              0x0288C4
226762306a36Sopenharmony_ci#define   S_0288C4_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
226862306a36Sopenharmony_ci#define   G_0288C4_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
226962306a36Sopenharmony_ci#define   C_0288C4_ITEMSIZE                            0xFFFF8000
227062306a36Sopenharmony_ci#define R_008C7C_SQ_REDUC_RING_SIZE                  0x008C7C
227162306a36Sopenharmony_ci#define   S_008C7C_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
227262306a36Sopenharmony_ci#define   G_008C7C_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
227362306a36Sopenharmony_ci#define   C_008C7C_MEM_SIZE                            0x00000000
227462306a36Sopenharmony_ci#define R_0288B8_SQ_VSTMP_RING_ITEMSIZE              0x0288B8
227562306a36Sopenharmony_ci#define   S_0288B8_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
227662306a36Sopenharmony_ci#define   G_0288B8_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
227762306a36Sopenharmony_ci#define   C_0288B8_ITEMSIZE                            0xFFFF8000
227862306a36Sopenharmony_ci#define R_008C64_SQ_VSTMP_RING_SIZE                  0x008C64
227962306a36Sopenharmony_ci#define   S_008C64_MEM_SIZE(x)                         (((x) & 0xFFFFFFFF) << 0)
228062306a36Sopenharmony_ci#define   G_008C64_MEM_SIZE(x)                         (((x) >> 0) & 0xFFFFFFFF)
228162306a36Sopenharmony_ci#define   C_008C64_MEM_SIZE                            0x00000000
228262306a36Sopenharmony_ci#define R_0288C8_SQ_GS_VERT_ITEMSIZE                 0x0288C8
228362306a36Sopenharmony_ci#define   S_0288C8_ITEMSIZE(x)                         (((x) & 0x7FFF) << 0)
228462306a36Sopenharmony_ci#define   G_0288C8_ITEMSIZE(x)                         (((x) >> 0) & 0x7FFF)
228562306a36Sopenharmony_ci#define   C_0288C8_ITEMSIZE                            0xFFFF8000
228662306a36Sopenharmony_ci#define R_028010_DB_DEPTH_INFO                       0x028010
228762306a36Sopenharmony_ci#define   S_028010_FORMAT(x)                           (((x) & 0x7) << 0)
228862306a36Sopenharmony_ci#define   G_028010_FORMAT(x)                           (((x) >> 0) & 0x7)
228962306a36Sopenharmony_ci#define   C_028010_FORMAT                              0xFFFFFFF8
229062306a36Sopenharmony_ci#define     V_028010_DEPTH_INVALID                     0x00000000
229162306a36Sopenharmony_ci#define     V_028010_DEPTH_16                          0x00000001
229262306a36Sopenharmony_ci#define     V_028010_DEPTH_X8_24                       0x00000002
229362306a36Sopenharmony_ci#define     V_028010_DEPTH_8_24                        0x00000003
229462306a36Sopenharmony_ci#define     V_028010_DEPTH_X8_24_FLOAT                 0x00000004
229562306a36Sopenharmony_ci#define     V_028010_DEPTH_8_24_FLOAT                  0x00000005
229662306a36Sopenharmony_ci#define     V_028010_DEPTH_32_FLOAT                    0x00000006
229762306a36Sopenharmony_ci#define     V_028010_DEPTH_X24_8_32_FLOAT              0x00000007
229862306a36Sopenharmony_ci#define   S_028010_READ_SIZE(x)                        (((x) & 0x1) << 3)
229962306a36Sopenharmony_ci#define   G_028010_READ_SIZE(x)                        (((x) >> 3) & 0x1)
230062306a36Sopenharmony_ci#define   C_028010_READ_SIZE                           0xFFFFFFF7
230162306a36Sopenharmony_ci#define   S_028010_ARRAY_MODE(x)                       (((x) & 0xF) << 15)
230262306a36Sopenharmony_ci#define   G_028010_ARRAY_MODE(x)                       (((x) >> 15) & 0xF)
230362306a36Sopenharmony_ci#define   C_028010_ARRAY_MODE                          0xFFF87FFF
230462306a36Sopenharmony_ci#define     V_028010_ARRAY_1D_TILED_THIN1              0x00000002
230562306a36Sopenharmony_ci#define     V_028010_ARRAY_2D_TILED_THIN1              0x00000004
230662306a36Sopenharmony_ci#define   S_028010_TILE_SURFACE_ENABLE(x)              (((x) & 0x1) << 25)
230762306a36Sopenharmony_ci#define   G_028010_TILE_SURFACE_ENABLE(x)              (((x) >> 25) & 0x1)
230862306a36Sopenharmony_ci#define   C_028010_TILE_SURFACE_ENABLE                 0xFDFFFFFF
230962306a36Sopenharmony_ci#define   S_028010_TILE_COMPACT(x)                     (((x) & 0x1) << 26)
231062306a36Sopenharmony_ci#define   G_028010_TILE_COMPACT(x)                     (((x) >> 26) & 0x1)
231162306a36Sopenharmony_ci#define   C_028010_TILE_COMPACT                        0xFBFFFFFF
231262306a36Sopenharmony_ci#define   S_028010_ZRANGE_PRECISION(x)                 (((x) & 0x1) << 31)
231362306a36Sopenharmony_ci#define   G_028010_ZRANGE_PRECISION(x)                 (((x) >> 31) & 0x1)
231462306a36Sopenharmony_ci#define   C_028010_ZRANGE_PRECISION                    0x7FFFFFFF
231562306a36Sopenharmony_ci#define R_028000_DB_DEPTH_SIZE                       0x028000
231662306a36Sopenharmony_ci#define   S_028000_PITCH_TILE_MAX(x)                   (((x) & 0x3FF) << 0)
231762306a36Sopenharmony_ci#define   G_028000_PITCH_TILE_MAX(x)                   (((x) >> 0) & 0x3FF)
231862306a36Sopenharmony_ci#define   C_028000_PITCH_TILE_MAX                      0xFFFFFC00
231962306a36Sopenharmony_ci#define   S_028000_SLICE_TILE_MAX(x)                   (((x) & 0xFFFFF) << 10)
232062306a36Sopenharmony_ci#define   G_028000_SLICE_TILE_MAX(x)                   (((x) >> 10) & 0xFFFFF)
232162306a36Sopenharmony_ci#define   C_028000_SLICE_TILE_MAX                      0xC00003FF
232262306a36Sopenharmony_ci#define R_028004_DB_DEPTH_VIEW                       0x028004
232362306a36Sopenharmony_ci#define   S_028004_SLICE_START(x)                      (((x) & 0x7FF) << 0)
232462306a36Sopenharmony_ci#define   G_028004_SLICE_START(x)                      (((x) >> 0) & 0x7FF)
232562306a36Sopenharmony_ci#define   C_028004_SLICE_START                         0xFFFFF800
232662306a36Sopenharmony_ci#define   S_028004_SLICE_MAX(x)                        (((x) & 0x7FF) << 13)
232762306a36Sopenharmony_ci#define   G_028004_SLICE_MAX(x)                        (((x) >> 13) & 0x7FF)
232862306a36Sopenharmony_ci#define   C_028004_SLICE_MAX                           0xFF001FFF
232962306a36Sopenharmony_ci#define R_028800_DB_DEPTH_CONTROL                    0x028800
233062306a36Sopenharmony_ci#define   S_028800_STENCIL_ENABLE(x)                   (((x) & 0x1) << 0)
233162306a36Sopenharmony_ci#define   G_028800_STENCIL_ENABLE(x)                   (((x) >> 0) & 0x1)
233262306a36Sopenharmony_ci#define   C_028800_STENCIL_ENABLE                      0xFFFFFFFE
233362306a36Sopenharmony_ci#define   S_028800_Z_ENABLE(x)                         (((x) & 0x1) << 1)
233462306a36Sopenharmony_ci#define   G_028800_Z_ENABLE(x)                         (((x) >> 1) & 0x1)
233562306a36Sopenharmony_ci#define   C_028800_Z_ENABLE                            0xFFFFFFFD
233662306a36Sopenharmony_ci#define   S_028800_Z_WRITE_ENABLE(x)                   (((x) & 0x1) << 2)
233762306a36Sopenharmony_ci#define   G_028800_Z_WRITE_ENABLE(x)                   (((x) >> 2) & 0x1)
233862306a36Sopenharmony_ci#define   C_028800_Z_WRITE_ENABLE                      0xFFFFFFFB
233962306a36Sopenharmony_ci#define   S_028800_ZFUNC(x)                            (((x) & 0x7) << 4)
234062306a36Sopenharmony_ci#define   G_028800_ZFUNC(x)                            (((x) >> 4) & 0x7)
234162306a36Sopenharmony_ci#define   C_028800_ZFUNC                               0xFFFFFF8F
234262306a36Sopenharmony_ci#define   S_028800_BACKFACE_ENABLE(x)                  (((x) & 0x1) << 7)
234362306a36Sopenharmony_ci#define   G_028800_BACKFACE_ENABLE(x)                  (((x) >> 7) & 0x1)
234462306a36Sopenharmony_ci#define   C_028800_BACKFACE_ENABLE                     0xFFFFFF7F
234562306a36Sopenharmony_ci#define   S_028800_STENCILFUNC(x)                      (((x) & 0x7) << 8)
234662306a36Sopenharmony_ci#define   G_028800_STENCILFUNC(x)                      (((x) >> 8) & 0x7)
234762306a36Sopenharmony_ci#define   C_028800_STENCILFUNC                         0xFFFFF8FF
234862306a36Sopenharmony_ci#define   S_028800_STENCILFAIL(x)                      (((x) & 0x7) << 11)
234962306a36Sopenharmony_ci#define   G_028800_STENCILFAIL(x)                      (((x) >> 11) & 0x7)
235062306a36Sopenharmony_ci#define   C_028800_STENCILFAIL                         0xFFFFC7FF
235162306a36Sopenharmony_ci#define   S_028800_STENCILZPASS(x)                     (((x) & 0x7) << 14)
235262306a36Sopenharmony_ci#define   G_028800_STENCILZPASS(x)                     (((x) >> 14) & 0x7)
235362306a36Sopenharmony_ci#define   C_028800_STENCILZPASS                        0xFFFE3FFF
235462306a36Sopenharmony_ci#define   S_028800_STENCILZFAIL(x)                     (((x) & 0x7) << 17)
235562306a36Sopenharmony_ci#define   G_028800_STENCILZFAIL(x)                     (((x) >> 17) & 0x7)
235662306a36Sopenharmony_ci#define   C_028800_STENCILZFAIL                        0xFFF1FFFF
235762306a36Sopenharmony_ci#define   S_028800_STENCILFUNC_BF(x)                   (((x) & 0x7) << 20)
235862306a36Sopenharmony_ci#define   G_028800_STENCILFUNC_BF(x)                   (((x) >> 20) & 0x7)
235962306a36Sopenharmony_ci#define   C_028800_STENCILFUNC_BF                      0xFF8FFFFF
236062306a36Sopenharmony_ci#define   S_028800_STENCILFAIL_BF(x)                   (((x) & 0x7) << 23)
236162306a36Sopenharmony_ci#define   G_028800_STENCILFAIL_BF(x)                   (((x) >> 23) & 0x7)
236262306a36Sopenharmony_ci#define   C_028800_STENCILFAIL_BF                      0xFC7FFFFF
236362306a36Sopenharmony_ci#define   S_028800_STENCILZPASS_BF(x)                  (((x) & 0x7) << 26)
236462306a36Sopenharmony_ci#define   G_028800_STENCILZPASS_BF(x)                  (((x) >> 26) & 0x7)
236562306a36Sopenharmony_ci#define   C_028800_STENCILZPASS_BF                     0xE3FFFFFF
236662306a36Sopenharmony_ci#define   S_028800_STENCILZFAIL_BF(x)                  (((x) & 0x7) << 29)
236762306a36Sopenharmony_ci#define   G_028800_STENCILZFAIL_BF(x)                  (((x) >> 29) & 0x7)
236862306a36Sopenharmony_ci#define   C_028800_STENCILZFAIL_BF                     0x1FFFFFFF
236962306a36Sopenharmony_ci
237062306a36Sopenharmony_ci#endif
2371