162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright 2008 Advanced Micro Devices, Inc.
362306a36Sopenharmony_ci * Copyright 2008 Red Hat Inc.
462306a36Sopenharmony_ci * Copyright 2009 Jerome Glisse.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
762306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
862306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
962306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1062306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
1162306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1262306a36Sopenharmony_ci *
1362306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
1462306a36Sopenharmony_ci * all copies or substantial portions of the Software.
1562306a36Sopenharmony_ci *
1662306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1762306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1862306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1962306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
2062306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2162306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2262306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
2362306a36Sopenharmony_ci *
2462306a36Sopenharmony_ci * Authors: Dave Airlie
2562306a36Sopenharmony_ci *          Alex Deucher
2662306a36Sopenharmony_ci *          Jerome Glisse
2762306a36Sopenharmony_ci */
2862306a36Sopenharmony_ci#ifndef __R300D_H__
2962306a36Sopenharmony_ci#define __R300D_H__
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define CP_PACKET0			0x00000000
3262306a36Sopenharmony_ci#define		PACKET0_BASE_INDEX_SHIFT	0
3362306a36Sopenharmony_ci#define		PACKET0_BASE_INDEX_MASK		(0x1ffff << 0)
3462306a36Sopenharmony_ci#define		PACKET0_COUNT_SHIFT		16
3562306a36Sopenharmony_ci#define		PACKET0_COUNT_MASK		(0x3fff << 16)
3662306a36Sopenharmony_ci#define CP_PACKET1			0x40000000
3762306a36Sopenharmony_ci#define CP_PACKET2			0x80000000
3862306a36Sopenharmony_ci#define		PACKET2_PAD_SHIFT		0
3962306a36Sopenharmony_ci#define		PACKET2_PAD_MASK		(0x3fffffff << 0)
4062306a36Sopenharmony_ci#define CP_PACKET3			0xC0000000
4162306a36Sopenharmony_ci#define		PACKET3_IT_OPCODE_SHIFT		8
4262306a36Sopenharmony_ci#define		PACKET3_IT_OPCODE_MASK		(0xff << 8)
4362306a36Sopenharmony_ci#define		PACKET3_COUNT_SHIFT		16
4462306a36Sopenharmony_ci#define		PACKET3_COUNT_MASK		(0x3fff << 16)
4562306a36Sopenharmony_ci/* PACKET3 op code */
4662306a36Sopenharmony_ci#define		PACKET3_NOP			0x10
4762306a36Sopenharmony_ci#define		PACKET3_3D_DRAW_VBUF		0x28
4862306a36Sopenharmony_ci#define		PACKET3_3D_DRAW_IMMD		0x29
4962306a36Sopenharmony_ci#define		PACKET3_3D_DRAW_INDX		0x2A
5062306a36Sopenharmony_ci#define		PACKET3_3D_LOAD_VBPNTR		0x2F
5162306a36Sopenharmony_ci#define		PACKET3_3D_CLEAR_ZMASK		0x32
5262306a36Sopenharmony_ci#define		PACKET3_INDX_BUFFER		0x33
5362306a36Sopenharmony_ci#define		PACKET3_3D_DRAW_VBUF_2		0x34
5462306a36Sopenharmony_ci#define		PACKET3_3D_DRAW_IMMD_2		0x35
5562306a36Sopenharmony_ci#define		PACKET3_3D_DRAW_INDX_2		0x36
5662306a36Sopenharmony_ci#define		PACKET3_3D_CLEAR_HIZ		0x37
5762306a36Sopenharmony_ci#define		PACKET3_3D_CLEAR_CMASK		0x38
5862306a36Sopenharmony_ci#define		PACKET3_BITBLT_MULTI		0x9B
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#define PACKET0(reg, n)	(CP_PACKET0 |					\
6162306a36Sopenharmony_ci			 REG_SET(PACKET0_BASE_INDEX, (reg) >> 2) |	\
6262306a36Sopenharmony_ci			 REG_SET(PACKET0_COUNT, (n)))
6362306a36Sopenharmony_ci#define PACKET2(v)	(CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
6462306a36Sopenharmony_ci#define PACKET3(op, n)	(CP_PACKET3 |					\
6562306a36Sopenharmony_ci			 REG_SET(PACKET3_IT_OPCODE, (op)) |		\
6662306a36Sopenharmony_ci			 REG_SET(PACKET3_COUNT, (n)))
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci/* Registers */
6962306a36Sopenharmony_ci#define R_000148_MC_FB_LOCATION                      0x000148
7062306a36Sopenharmony_ci#define   S_000148_MC_FB_START(x)                      (((x) & 0xFFFF) << 0)
7162306a36Sopenharmony_ci#define   G_000148_MC_FB_START(x)                      (((x) >> 0) & 0xFFFF)
7262306a36Sopenharmony_ci#define   C_000148_MC_FB_START                         0xFFFF0000
7362306a36Sopenharmony_ci#define   S_000148_MC_FB_TOP(x)                        (((x) & 0xFFFF) << 16)
7462306a36Sopenharmony_ci#define   G_000148_MC_FB_TOP(x)                        (((x) >> 16) & 0xFFFF)
7562306a36Sopenharmony_ci#define   C_000148_MC_FB_TOP                           0x0000FFFF
7662306a36Sopenharmony_ci#define R_00014C_MC_AGP_LOCATION                     0x00014C
7762306a36Sopenharmony_ci#define   S_00014C_MC_AGP_START(x)                     (((x) & 0xFFFF) << 0)
7862306a36Sopenharmony_ci#define   G_00014C_MC_AGP_START(x)                     (((x) >> 0) & 0xFFFF)
7962306a36Sopenharmony_ci#define   C_00014C_MC_AGP_START                        0xFFFF0000
8062306a36Sopenharmony_ci#define   S_00014C_MC_AGP_TOP(x)                       (((x) & 0xFFFF) << 16)
8162306a36Sopenharmony_ci#define   G_00014C_MC_AGP_TOP(x)                       (((x) >> 16) & 0xFFFF)
8262306a36Sopenharmony_ci#define   C_00014C_MC_AGP_TOP                          0x0000FFFF
8362306a36Sopenharmony_ci#define R_00015C_AGP_BASE_2                          0x00015C
8462306a36Sopenharmony_ci#define   S_00015C_AGP_BASE_ADDR_2(x)                  (((x) & 0xF) << 0)
8562306a36Sopenharmony_ci#define   G_00015C_AGP_BASE_ADDR_2(x)                  (((x) >> 0) & 0xF)
8662306a36Sopenharmony_ci#define   C_00015C_AGP_BASE_ADDR_2                     0xFFFFFFF0
8762306a36Sopenharmony_ci#define R_000170_AGP_BASE                            0x000170
8862306a36Sopenharmony_ci#define   S_000170_AGP_BASE_ADDR(x)                    (((x) & 0xFFFFFFFF) << 0)
8962306a36Sopenharmony_ci#define   G_000170_AGP_BASE_ADDR(x)                    (((x) >> 0) & 0xFFFFFFFF)
9062306a36Sopenharmony_ci#define   C_000170_AGP_BASE_ADDR                       0x00000000
9162306a36Sopenharmony_ci#define R_0007C0_CP_STAT                             0x0007C0
9262306a36Sopenharmony_ci#define   S_0007C0_MRU_BUSY(x)                         (((x) & 0x1) << 0)
9362306a36Sopenharmony_ci#define   G_0007C0_MRU_BUSY(x)                         (((x) >> 0) & 0x1)
9462306a36Sopenharmony_ci#define   C_0007C0_MRU_BUSY                            0xFFFFFFFE
9562306a36Sopenharmony_ci#define   S_0007C0_MWU_BUSY(x)                         (((x) & 0x1) << 1)
9662306a36Sopenharmony_ci#define   G_0007C0_MWU_BUSY(x)                         (((x) >> 1) & 0x1)
9762306a36Sopenharmony_ci#define   C_0007C0_MWU_BUSY                            0xFFFFFFFD
9862306a36Sopenharmony_ci#define   S_0007C0_RSIU_BUSY(x)                        (((x) & 0x1) << 2)
9962306a36Sopenharmony_ci#define   G_0007C0_RSIU_BUSY(x)                        (((x) >> 2) & 0x1)
10062306a36Sopenharmony_ci#define   C_0007C0_RSIU_BUSY                           0xFFFFFFFB
10162306a36Sopenharmony_ci#define   S_0007C0_RCIU_BUSY(x)                        (((x) & 0x1) << 3)
10262306a36Sopenharmony_ci#define   G_0007C0_RCIU_BUSY(x)                        (((x) >> 3) & 0x1)
10362306a36Sopenharmony_ci#define   C_0007C0_RCIU_BUSY                           0xFFFFFFF7
10462306a36Sopenharmony_ci#define   S_0007C0_CSF_PRIMARY_BUSY(x)                 (((x) & 0x1) << 9)
10562306a36Sopenharmony_ci#define   G_0007C0_CSF_PRIMARY_BUSY(x)                 (((x) >> 9) & 0x1)
10662306a36Sopenharmony_ci#define   C_0007C0_CSF_PRIMARY_BUSY                    0xFFFFFDFF
10762306a36Sopenharmony_ci#define   S_0007C0_CSF_INDIRECT_BUSY(x)                (((x) & 0x1) << 10)
10862306a36Sopenharmony_ci#define   G_0007C0_CSF_INDIRECT_BUSY(x)                (((x) >> 10) & 0x1)
10962306a36Sopenharmony_ci#define   C_0007C0_CSF_INDIRECT_BUSY                   0xFFFFFBFF
11062306a36Sopenharmony_ci#define   S_0007C0_CSQ_PRIMARY_BUSY(x)                 (((x) & 0x1) << 11)
11162306a36Sopenharmony_ci#define   G_0007C0_CSQ_PRIMARY_BUSY(x)                 (((x) >> 11) & 0x1)
11262306a36Sopenharmony_ci#define   C_0007C0_CSQ_PRIMARY_BUSY                    0xFFFFF7FF
11362306a36Sopenharmony_ci#define   S_0007C0_CSQ_INDIRECT_BUSY(x)                (((x) & 0x1) << 12)
11462306a36Sopenharmony_ci#define   G_0007C0_CSQ_INDIRECT_BUSY(x)                (((x) >> 12) & 0x1)
11562306a36Sopenharmony_ci#define   C_0007C0_CSQ_INDIRECT_BUSY                   0xFFFFEFFF
11662306a36Sopenharmony_ci#define   S_0007C0_CSI_BUSY(x)                         (((x) & 0x1) << 13)
11762306a36Sopenharmony_ci#define   G_0007C0_CSI_BUSY(x)                         (((x) >> 13) & 0x1)
11862306a36Sopenharmony_ci#define   C_0007C0_CSI_BUSY                            0xFFFFDFFF
11962306a36Sopenharmony_ci#define   S_0007C0_CSF_INDIRECT2_BUSY(x)               (((x) & 0x1) << 14)
12062306a36Sopenharmony_ci#define   G_0007C0_CSF_INDIRECT2_BUSY(x)               (((x) >> 14) & 0x1)
12162306a36Sopenharmony_ci#define   C_0007C0_CSF_INDIRECT2_BUSY                  0xFFFFBFFF
12262306a36Sopenharmony_ci#define   S_0007C0_CSQ_INDIRECT2_BUSY(x)               (((x) & 0x1) << 15)
12362306a36Sopenharmony_ci#define   G_0007C0_CSQ_INDIRECT2_BUSY(x)               (((x) >> 15) & 0x1)
12462306a36Sopenharmony_ci#define   C_0007C0_CSQ_INDIRECT2_BUSY                  0xFFFF7FFF
12562306a36Sopenharmony_ci#define   S_0007C0_GUIDMA_BUSY(x)                      (((x) & 0x1) << 28)
12662306a36Sopenharmony_ci#define   G_0007C0_GUIDMA_BUSY(x)                      (((x) >> 28) & 0x1)
12762306a36Sopenharmony_ci#define   C_0007C0_GUIDMA_BUSY                         0xEFFFFFFF
12862306a36Sopenharmony_ci#define   S_0007C0_VIDDMA_BUSY(x)                      (((x) & 0x1) << 29)
12962306a36Sopenharmony_ci#define   G_0007C0_VIDDMA_BUSY(x)                      (((x) >> 29) & 0x1)
13062306a36Sopenharmony_ci#define   C_0007C0_VIDDMA_BUSY                         0xDFFFFFFF
13162306a36Sopenharmony_ci#define   S_0007C0_CMDSTRM_BUSY(x)                     (((x) & 0x1) << 30)
13262306a36Sopenharmony_ci#define   G_0007C0_CMDSTRM_BUSY(x)                     (((x) >> 30) & 0x1)
13362306a36Sopenharmony_ci#define   C_0007C0_CMDSTRM_BUSY                        0xBFFFFFFF
13462306a36Sopenharmony_ci#define   S_0007C0_CP_BUSY(x)                          (((x) & 0x1) << 31)
13562306a36Sopenharmony_ci#define   G_0007C0_CP_BUSY(x)                          (((x) >> 31) & 0x1)
13662306a36Sopenharmony_ci#define   C_0007C0_CP_BUSY                             0x7FFFFFFF
13762306a36Sopenharmony_ci#define R_000E40_RBBM_STATUS                         0x000E40
13862306a36Sopenharmony_ci#define   S_000E40_CMDFIFO_AVAIL(x)                    (((x) & 0x7F) << 0)
13962306a36Sopenharmony_ci#define   G_000E40_CMDFIFO_AVAIL(x)                    (((x) >> 0) & 0x7F)
14062306a36Sopenharmony_ci#define   C_000E40_CMDFIFO_AVAIL                       0xFFFFFF80
14162306a36Sopenharmony_ci#define   S_000E40_HIRQ_ON_RBB(x)                      (((x) & 0x1) << 8)
14262306a36Sopenharmony_ci#define   G_000E40_HIRQ_ON_RBB(x)                      (((x) >> 8) & 0x1)
14362306a36Sopenharmony_ci#define   C_000E40_HIRQ_ON_RBB                         0xFFFFFEFF
14462306a36Sopenharmony_ci#define   S_000E40_CPRQ_ON_RBB(x)                      (((x) & 0x1) << 9)
14562306a36Sopenharmony_ci#define   G_000E40_CPRQ_ON_RBB(x)                      (((x) >> 9) & 0x1)
14662306a36Sopenharmony_ci#define   C_000E40_CPRQ_ON_RBB                         0xFFFFFDFF
14762306a36Sopenharmony_ci#define   S_000E40_CFRQ_ON_RBB(x)                      (((x) & 0x1) << 10)
14862306a36Sopenharmony_ci#define   G_000E40_CFRQ_ON_RBB(x)                      (((x) >> 10) & 0x1)
14962306a36Sopenharmony_ci#define   C_000E40_CFRQ_ON_RBB                         0xFFFFFBFF
15062306a36Sopenharmony_ci#define   S_000E40_HIRQ_IN_RTBUF(x)                    (((x) & 0x1) << 11)
15162306a36Sopenharmony_ci#define   G_000E40_HIRQ_IN_RTBUF(x)                    (((x) >> 11) & 0x1)
15262306a36Sopenharmony_ci#define   C_000E40_HIRQ_IN_RTBUF                       0xFFFFF7FF
15362306a36Sopenharmony_ci#define   S_000E40_CPRQ_IN_RTBUF(x)                    (((x) & 0x1) << 12)
15462306a36Sopenharmony_ci#define   G_000E40_CPRQ_IN_RTBUF(x)                    (((x) >> 12) & 0x1)
15562306a36Sopenharmony_ci#define   C_000E40_CPRQ_IN_RTBUF                       0xFFFFEFFF
15662306a36Sopenharmony_ci#define   S_000E40_CFRQ_IN_RTBUF(x)                    (((x) & 0x1) << 13)
15762306a36Sopenharmony_ci#define   G_000E40_CFRQ_IN_RTBUF(x)                    (((x) >> 13) & 0x1)
15862306a36Sopenharmony_ci#define   C_000E40_CFRQ_IN_RTBUF                       0xFFFFDFFF
15962306a36Sopenharmony_ci#define   S_000E40_CF_PIPE_BUSY(x)                     (((x) & 0x1) << 14)
16062306a36Sopenharmony_ci#define   G_000E40_CF_PIPE_BUSY(x)                     (((x) >> 14) & 0x1)
16162306a36Sopenharmony_ci#define   C_000E40_CF_PIPE_BUSY                        0xFFFFBFFF
16262306a36Sopenharmony_ci#define   S_000E40_ENG_EV_BUSY(x)                      (((x) & 0x1) << 15)
16362306a36Sopenharmony_ci#define   G_000E40_ENG_EV_BUSY(x)                      (((x) >> 15) & 0x1)
16462306a36Sopenharmony_ci#define   C_000E40_ENG_EV_BUSY                         0xFFFF7FFF
16562306a36Sopenharmony_ci#define   S_000E40_CP_CMDSTRM_BUSY(x)                  (((x) & 0x1) << 16)
16662306a36Sopenharmony_ci#define   G_000E40_CP_CMDSTRM_BUSY(x)                  (((x) >> 16) & 0x1)
16762306a36Sopenharmony_ci#define   C_000E40_CP_CMDSTRM_BUSY                     0xFFFEFFFF
16862306a36Sopenharmony_ci#define   S_000E40_E2_BUSY(x)                          (((x) & 0x1) << 17)
16962306a36Sopenharmony_ci#define   G_000E40_E2_BUSY(x)                          (((x) >> 17) & 0x1)
17062306a36Sopenharmony_ci#define   C_000E40_E2_BUSY                             0xFFFDFFFF
17162306a36Sopenharmony_ci#define   S_000E40_RB2D_BUSY(x)                        (((x) & 0x1) << 18)
17262306a36Sopenharmony_ci#define   G_000E40_RB2D_BUSY(x)                        (((x) >> 18) & 0x1)
17362306a36Sopenharmony_ci#define   C_000E40_RB2D_BUSY                           0xFFFBFFFF
17462306a36Sopenharmony_ci#define   S_000E40_RB3D_BUSY(x)                        (((x) & 0x1) << 19)
17562306a36Sopenharmony_ci#define   G_000E40_RB3D_BUSY(x)                        (((x) >> 19) & 0x1)
17662306a36Sopenharmony_ci#define   C_000E40_RB3D_BUSY                           0xFFF7FFFF
17762306a36Sopenharmony_ci#define   S_000E40_VAP_BUSY(x)                         (((x) & 0x1) << 20)
17862306a36Sopenharmony_ci#define   G_000E40_VAP_BUSY(x)                         (((x) >> 20) & 0x1)
17962306a36Sopenharmony_ci#define   C_000E40_VAP_BUSY                            0xFFEFFFFF
18062306a36Sopenharmony_ci#define   S_000E40_RE_BUSY(x)                          (((x) & 0x1) << 21)
18162306a36Sopenharmony_ci#define   G_000E40_RE_BUSY(x)                          (((x) >> 21) & 0x1)
18262306a36Sopenharmony_ci#define   C_000E40_RE_BUSY                             0xFFDFFFFF
18362306a36Sopenharmony_ci#define   S_000E40_TAM_BUSY(x)                         (((x) & 0x1) << 22)
18462306a36Sopenharmony_ci#define   G_000E40_TAM_BUSY(x)                         (((x) >> 22) & 0x1)
18562306a36Sopenharmony_ci#define   C_000E40_TAM_BUSY                            0xFFBFFFFF
18662306a36Sopenharmony_ci#define   S_000E40_TDM_BUSY(x)                         (((x) & 0x1) << 23)
18762306a36Sopenharmony_ci#define   G_000E40_TDM_BUSY(x)                         (((x) >> 23) & 0x1)
18862306a36Sopenharmony_ci#define   C_000E40_TDM_BUSY                            0xFF7FFFFF
18962306a36Sopenharmony_ci#define   S_000E40_PB_BUSY(x)                          (((x) & 0x1) << 24)
19062306a36Sopenharmony_ci#define   G_000E40_PB_BUSY(x)                          (((x) >> 24) & 0x1)
19162306a36Sopenharmony_ci#define   C_000E40_PB_BUSY                             0xFEFFFFFF
19262306a36Sopenharmony_ci#define   S_000E40_TIM_BUSY(x)                         (((x) & 0x1) << 25)
19362306a36Sopenharmony_ci#define   G_000E40_TIM_BUSY(x)                         (((x) >> 25) & 0x1)
19462306a36Sopenharmony_ci#define   C_000E40_TIM_BUSY                            0xFDFFFFFF
19562306a36Sopenharmony_ci#define   S_000E40_GA_BUSY(x)                          (((x) & 0x1) << 26)
19662306a36Sopenharmony_ci#define   G_000E40_GA_BUSY(x)                          (((x) >> 26) & 0x1)
19762306a36Sopenharmony_ci#define   C_000E40_GA_BUSY                             0xFBFFFFFF
19862306a36Sopenharmony_ci#define   S_000E40_CBA2D_BUSY(x)                       (((x) & 0x1) << 27)
19962306a36Sopenharmony_ci#define   G_000E40_CBA2D_BUSY(x)                       (((x) >> 27) & 0x1)
20062306a36Sopenharmony_ci#define   C_000E40_CBA2D_BUSY                          0xF7FFFFFF
20162306a36Sopenharmony_ci#define   S_000E40_GUI_ACTIVE(x)                       (((x) & 0x1) << 31)
20262306a36Sopenharmony_ci#define   G_000E40_GUI_ACTIVE(x)                       (((x) >> 31) & 0x1)
20362306a36Sopenharmony_ci#define   C_000E40_GUI_ACTIVE                          0x7FFFFFFF
20462306a36Sopenharmony_ci#define R_0000F0_RBBM_SOFT_RESET                     0x0000F0
20562306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_CP(x)                    (((x) & 0x1) << 0)
20662306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_CP(x)                    (((x) >> 0) & 0x1)
20762306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_CP                       0xFFFFFFFE
20862306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_HI(x)                    (((x) & 0x1) << 1)
20962306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_HI(x)                    (((x) >> 1) & 0x1)
21062306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_HI                       0xFFFFFFFD
21162306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_VAP(x)                   (((x) & 0x1) << 2)
21262306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_VAP(x)                   (((x) >> 2) & 0x1)
21362306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_VAP                      0xFFFFFFFB
21462306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_RE(x)                    (((x) & 0x1) << 3)
21562306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_RE(x)                    (((x) >> 3) & 0x1)
21662306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_RE                       0xFFFFFFF7
21762306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_PP(x)                    (((x) & 0x1) << 4)
21862306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_PP(x)                    (((x) >> 4) & 0x1)
21962306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_PP                       0xFFFFFFEF
22062306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_E2(x)                    (((x) & 0x1) << 5)
22162306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_E2(x)                    (((x) >> 5) & 0x1)
22262306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_E2                       0xFFFFFFDF
22362306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_RB(x)                    (((x) & 0x1) << 6)
22462306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_RB(x)                    (((x) >> 6) & 0x1)
22562306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_RB                       0xFFFFFFBF
22662306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_HDP(x)                   (((x) & 0x1) << 7)
22762306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_HDP(x)                   (((x) >> 7) & 0x1)
22862306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_HDP                      0xFFFFFF7F
22962306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_MC(x)                    (((x) & 0x1) << 8)
23062306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_MC(x)                    (((x) >> 8) & 0x1)
23162306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_MC                       0xFFFFFEFF
23262306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_AIC(x)                   (((x) & 0x1) << 9)
23362306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_AIC(x)                   (((x) >> 9) & 0x1)
23462306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_AIC                      0xFFFFFDFF
23562306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_VIP(x)                   (((x) & 0x1) << 10)
23662306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_VIP(x)                   (((x) >> 10) & 0x1)
23762306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_VIP                      0xFFFFFBFF
23862306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_DISP(x)                  (((x) & 0x1) << 11)
23962306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_DISP(x)                  (((x) >> 11) & 0x1)
24062306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_DISP                     0xFFFFF7FF
24162306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_CG(x)                    (((x) & 0x1) << 12)
24262306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_CG(x)                    (((x) >> 12) & 0x1)
24362306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_CG                       0xFFFFEFFF
24462306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_GA(x)                    (((x) & 0x1) << 13)
24562306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_GA(x)                    (((x) >> 13) & 0x1)
24662306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_GA                       0xFFFFDFFF
24762306a36Sopenharmony_ci#define   S_0000F0_SOFT_RESET_IDCT(x)                  (((x) & 0x1) << 14)
24862306a36Sopenharmony_ci#define   G_0000F0_SOFT_RESET_IDCT(x)                  (((x) >> 14) & 0x1)
24962306a36Sopenharmony_ci#define   C_0000F0_SOFT_RESET_IDCT                     0xFFFFBFFF
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci#define R_00000D_SCLK_CNTL                           0x00000D
25262306a36Sopenharmony_ci#define   S_00000D_SCLK_SRC_SEL(x)                     (((x) & 0x7) << 0)
25362306a36Sopenharmony_ci#define   G_00000D_SCLK_SRC_SEL(x)                     (((x) >> 0) & 0x7)
25462306a36Sopenharmony_ci#define   C_00000D_SCLK_SRC_SEL                        0xFFFFFFF8
25562306a36Sopenharmony_ci#define   S_00000D_CP_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 3)
25662306a36Sopenharmony_ci#define   G_00000D_CP_MAX_DYN_STOP_LAT(x)              (((x) >> 3) & 0x1)
25762306a36Sopenharmony_ci#define   C_00000D_CP_MAX_DYN_STOP_LAT                 0xFFFFFFF7
25862306a36Sopenharmony_ci#define   S_00000D_HDP_MAX_DYN_STOP_LAT(x)             (((x) & 0x1) << 4)
25962306a36Sopenharmony_ci#define   G_00000D_HDP_MAX_DYN_STOP_LAT(x)             (((x) >> 4) & 0x1)
26062306a36Sopenharmony_ci#define   C_00000D_HDP_MAX_DYN_STOP_LAT                0xFFFFFFEF
26162306a36Sopenharmony_ci#define   S_00000D_TV_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 5)
26262306a36Sopenharmony_ci#define   G_00000D_TV_MAX_DYN_STOP_LAT(x)              (((x) >> 5) & 0x1)
26362306a36Sopenharmony_ci#define   C_00000D_TV_MAX_DYN_STOP_LAT                 0xFFFFFFDF
26462306a36Sopenharmony_ci#define   S_00000D_E2_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 6)
26562306a36Sopenharmony_ci#define   G_00000D_E2_MAX_DYN_STOP_LAT(x)              (((x) >> 6) & 0x1)
26662306a36Sopenharmony_ci#define   C_00000D_E2_MAX_DYN_STOP_LAT                 0xFFFFFFBF
26762306a36Sopenharmony_ci#define   S_00000D_SE_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 7)
26862306a36Sopenharmony_ci#define   G_00000D_SE_MAX_DYN_STOP_LAT(x)              (((x) >> 7) & 0x1)
26962306a36Sopenharmony_ci#define   C_00000D_SE_MAX_DYN_STOP_LAT                 0xFFFFFF7F
27062306a36Sopenharmony_ci#define   S_00000D_IDCT_MAX_DYN_STOP_LAT(x)            (((x) & 0x1) << 8)
27162306a36Sopenharmony_ci#define   G_00000D_IDCT_MAX_DYN_STOP_LAT(x)            (((x) >> 8) & 0x1)
27262306a36Sopenharmony_ci#define   C_00000D_IDCT_MAX_DYN_STOP_LAT               0xFFFFFEFF
27362306a36Sopenharmony_ci#define   S_00000D_VIP_MAX_DYN_STOP_LAT(x)             (((x) & 0x1) << 9)
27462306a36Sopenharmony_ci#define   G_00000D_VIP_MAX_DYN_STOP_LAT(x)             (((x) >> 9) & 0x1)
27562306a36Sopenharmony_ci#define   C_00000D_VIP_MAX_DYN_STOP_LAT                0xFFFFFDFF
27662306a36Sopenharmony_ci#define   S_00000D_RE_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 10)
27762306a36Sopenharmony_ci#define   G_00000D_RE_MAX_DYN_STOP_LAT(x)              (((x) >> 10) & 0x1)
27862306a36Sopenharmony_ci#define   C_00000D_RE_MAX_DYN_STOP_LAT                 0xFFFFFBFF
27962306a36Sopenharmony_ci#define   S_00000D_PB_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 11)
28062306a36Sopenharmony_ci#define   G_00000D_PB_MAX_DYN_STOP_LAT(x)              (((x) >> 11) & 0x1)
28162306a36Sopenharmony_ci#define   C_00000D_PB_MAX_DYN_STOP_LAT                 0xFFFFF7FF
28262306a36Sopenharmony_ci#define   S_00000D_TAM_MAX_DYN_STOP_LAT(x)             (((x) & 0x1) << 12)
28362306a36Sopenharmony_ci#define   G_00000D_TAM_MAX_DYN_STOP_LAT(x)             (((x) >> 12) & 0x1)
28462306a36Sopenharmony_ci#define   C_00000D_TAM_MAX_DYN_STOP_LAT                0xFFFFEFFF
28562306a36Sopenharmony_ci#define   S_00000D_TDM_MAX_DYN_STOP_LAT(x)             (((x) & 0x1) << 13)
28662306a36Sopenharmony_ci#define   G_00000D_TDM_MAX_DYN_STOP_LAT(x)             (((x) >> 13) & 0x1)
28762306a36Sopenharmony_ci#define   C_00000D_TDM_MAX_DYN_STOP_LAT                0xFFFFDFFF
28862306a36Sopenharmony_ci#define   S_00000D_RB_MAX_DYN_STOP_LAT(x)              (((x) & 0x1) << 14)
28962306a36Sopenharmony_ci#define   G_00000D_RB_MAX_DYN_STOP_LAT(x)              (((x) >> 14) & 0x1)
29062306a36Sopenharmony_ci#define   C_00000D_RB_MAX_DYN_STOP_LAT                 0xFFFFBFFF
29162306a36Sopenharmony_ci#define   S_00000D_FORCE_DISP2(x)                      (((x) & 0x1) << 15)
29262306a36Sopenharmony_ci#define   G_00000D_FORCE_DISP2(x)                      (((x) >> 15) & 0x1)
29362306a36Sopenharmony_ci#define   C_00000D_FORCE_DISP2                         0xFFFF7FFF
29462306a36Sopenharmony_ci#define   S_00000D_FORCE_CP(x)                         (((x) & 0x1) << 16)
29562306a36Sopenharmony_ci#define   G_00000D_FORCE_CP(x)                         (((x) >> 16) & 0x1)
29662306a36Sopenharmony_ci#define   C_00000D_FORCE_CP                            0xFFFEFFFF
29762306a36Sopenharmony_ci#define   S_00000D_FORCE_HDP(x)                        (((x) & 0x1) << 17)
29862306a36Sopenharmony_ci#define   G_00000D_FORCE_HDP(x)                        (((x) >> 17) & 0x1)
29962306a36Sopenharmony_ci#define   C_00000D_FORCE_HDP                           0xFFFDFFFF
30062306a36Sopenharmony_ci#define   S_00000D_FORCE_DISP1(x)                      (((x) & 0x1) << 18)
30162306a36Sopenharmony_ci#define   G_00000D_FORCE_DISP1(x)                      (((x) >> 18) & 0x1)
30262306a36Sopenharmony_ci#define   C_00000D_FORCE_DISP1                         0xFFFBFFFF
30362306a36Sopenharmony_ci#define   S_00000D_FORCE_TOP(x)                        (((x) & 0x1) << 19)
30462306a36Sopenharmony_ci#define   G_00000D_FORCE_TOP(x)                        (((x) >> 19) & 0x1)
30562306a36Sopenharmony_ci#define   C_00000D_FORCE_TOP                           0xFFF7FFFF
30662306a36Sopenharmony_ci#define   S_00000D_FORCE_E2(x)                         (((x) & 0x1) << 20)
30762306a36Sopenharmony_ci#define   G_00000D_FORCE_E2(x)                         (((x) >> 20) & 0x1)
30862306a36Sopenharmony_ci#define   C_00000D_FORCE_E2                            0xFFEFFFFF
30962306a36Sopenharmony_ci#define   S_00000D_FORCE_SE(x)                         (((x) & 0x1) << 21)
31062306a36Sopenharmony_ci#define   G_00000D_FORCE_SE(x)                         (((x) >> 21) & 0x1)
31162306a36Sopenharmony_ci#define   C_00000D_FORCE_SE                            0xFFDFFFFF
31262306a36Sopenharmony_ci#define   S_00000D_FORCE_IDCT(x)                       (((x) & 0x1) << 22)
31362306a36Sopenharmony_ci#define   G_00000D_FORCE_IDCT(x)                       (((x) >> 22) & 0x1)
31462306a36Sopenharmony_ci#define   C_00000D_FORCE_IDCT                          0xFFBFFFFF
31562306a36Sopenharmony_ci#define   S_00000D_FORCE_VIP(x)                        (((x) & 0x1) << 23)
31662306a36Sopenharmony_ci#define   G_00000D_FORCE_VIP(x)                        (((x) >> 23) & 0x1)
31762306a36Sopenharmony_ci#define   C_00000D_FORCE_VIP                           0xFF7FFFFF
31862306a36Sopenharmony_ci#define   S_00000D_FORCE_RE(x)                         (((x) & 0x1) << 24)
31962306a36Sopenharmony_ci#define   G_00000D_FORCE_RE(x)                         (((x) >> 24) & 0x1)
32062306a36Sopenharmony_ci#define   C_00000D_FORCE_RE                            0xFEFFFFFF
32162306a36Sopenharmony_ci#define   S_00000D_FORCE_PB(x)                         (((x) & 0x1) << 25)
32262306a36Sopenharmony_ci#define   G_00000D_FORCE_PB(x)                         (((x) >> 25) & 0x1)
32362306a36Sopenharmony_ci#define   C_00000D_FORCE_PB                            0xFDFFFFFF
32462306a36Sopenharmony_ci#define   S_00000D_FORCE_TAM(x)                        (((x) & 0x1) << 26)
32562306a36Sopenharmony_ci#define   G_00000D_FORCE_TAM(x)                        (((x) >> 26) & 0x1)
32662306a36Sopenharmony_ci#define   C_00000D_FORCE_TAM                           0xFBFFFFFF
32762306a36Sopenharmony_ci#define   S_00000D_FORCE_TDM(x)                        (((x) & 0x1) << 27)
32862306a36Sopenharmony_ci#define   G_00000D_FORCE_TDM(x)                        (((x) >> 27) & 0x1)
32962306a36Sopenharmony_ci#define   C_00000D_FORCE_TDM                           0xF7FFFFFF
33062306a36Sopenharmony_ci#define   S_00000D_FORCE_RB(x)                         (((x) & 0x1) << 28)
33162306a36Sopenharmony_ci#define   G_00000D_FORCE_RB(x)                         (((x) >> 28) & 0x1)
33262306a36Sopenharmony_ci#define   C_00000D_FORCE_RB                            0xEFFFFFFF
33362306a36Sopenharmony_ci#define   S_00000D_FORCE_TV_SCLK(x)                    (((x) & 0x1) << 29)
33462306a36Sopenharmony_ci#define   G_00000D_FORCE_TV_SCLK(x)                    (((x) >> 29) & 0x1)
33562306a36Sopenharmony_ci#define   C_00000D_FORCE_TV_SCLK                       0xDFFFFFFF
33662306a36Sopenharmony_ci#define   S_00000D_FORCE_SUBPIC(x)                     (((x) & 0x1) << 30)
33762306a36Sopenharmony_ci#define   G_00000D_FORCE_SUBPIC(x)                     (((x) >> 30) & 0x1)
33862306a36Sopenharmony_ci#define   C_00000D_FORCE_SUBPIC                        0xBFFFFFFF
33962306a36Sopenharmony_ci#define   S_00000D_FORCE_OV0(x)                        (((x) & 0x1) << 31)
34062306a36Sopenharmony_ci#define   G_00000D_FORCE_OV0(x)                        (((x) >> 31) & 0x1)
34162306a36Sopenharmony_ci#define   C_00000D_FORCE_OV0                           0x7FFFFFFF
34262306a36Sopenharmony_ci
34362306a36Sopenharmony_ci#endif
344