162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright 2010 Advanced Micro Devices, Inc.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
1262306a36Sopenharmony_ci * all copies or substantial portions of the Software.
1362306a36Sopenharmony_ci *
1462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1562306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1662306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1762306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1862306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1962306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2062306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
2162306a36Sopenharmony_ci *
2262306a36Sopenharmony_ci * Authors: Alex Deucher
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci#ifndef __EVERGREEN_REG_H__
2562306a36Sopenharmony_ci#define __EVERGREEN_REG_H__
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/* trinity */
2862306a36Sopenharmony_ci#define TN_SMC_IND_INDEX_0                              0x200
2962306a36Sopenharmony_ci#define TN_SMC_IND_DATA_0                               0x204
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci/* evergreen */
3262306a36Sopenharmony_ci#define EVERGREEN_PIF_PHY0_INDEX                        0x8
3362306a36Sopenharmony_ci#define EVERGREEN_PIF_PHY0_DATA                         0xc
3462306a36Sopenharmony_ci#define EVERGREEN_PIF_PHY1_INDEX                        0x10
3562306a36Sopenharmony_ci#define EVERGREEN_PIF_PHY1_DATA                         0x14
3662306a36Sopenharmony_ci#define EVERGREEN_MM_INDEX_HI                           0x18
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#define EVERGREEN_VGA_MEMORY_BASE_ADDRESS               0x310
3962306a36Sopenharmony_ci#define EVERGREEN_VGA_MEMORY_BASE_ADDRESS_HIGH          0x324
4062306a36Sopenharmony_ci#define EVERGREEN_D3VGA_CONTROL                         0x3e0
4162306a36Sopenharmony_ci#define EVERGREEN_D4VGA_CONTROL                         0x3e4
4262306a36Sopenharmony_ci#define EVERGREEN_D5VGA_CONTROL                         0x3e8
4362306a36Sopenharmony_ci#define EVERGREEN_D6VGA_CONTROL                         0x3ec
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define EVERGREEN_P1PLL_SS_CNTL                         0x414
4662306a36Sopenharmony_ci#define EVERGREEN_P2PLL_SS_CNTL                         0x454
4762306a36Sopenharmony_ci#       define EVERGREEN_PxPLL_SS_EN                    (1 << 12)
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define EVERGREEN_AUDIO_PLL1_MUL			0x5b0
5062306a36Sopenharmony_ci#define EVERGREEN_AUDIO_PLL1_DIV			0x5b4
5162306a36Sopenharmony_ci#define EVERGREEN_AUDIO_PLL1_UNK			0x5bc
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define EVERGREEN_CG_IND_ADDR                           0x8f8
5462306a36Sopenharmony_ci#define EVERGREEN_CG_IND_DATA                           0x8fc
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define EVERGREEN_AUDIO_ENABLE				0x5e78
5762306a36Sopenharmony_ci#define EVERGREEN_AUDIO_VENDOR_ID			0x5ec0
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci/* GRPH blocks at 0x6800, 0x7400, 0x10000, 0x10c00, 0x11800, 0x12400 */
6062306a36Sopenharmony_ci#define EVERGREEN_GRPH_ENABLE                           0x6800
6162306a36Sopenharmony_ci#define EVERGREEN_GRPH_CONTROL                          0x6804
6262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_DEPTH(x)                  (((x) & 0x3) << 0)
6362306a36Sopenharmony_ci#       define EVERGREEN_GRPH_DEPTH_8BPP                0
6462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_DEPTH_16BPP               1
6562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_DEPTH_32BPP               2
6662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_NUM_BANKS(x)              (((x) & 0x3) << 2)
6762306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_2_BANK               0
6862306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_4_BANK               1
6962306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_8_BANK               2
7062306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_16_BANK              3
7162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_Z(x)                      (((x) & 0x3) << 4)
7262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BANK_WIDTH(x)             (((x) & 0x3) << 6)
7362306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_WIDTH_1         0
7462306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_WIDTH_2         1
7562306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_WIDTH_4         2
7662306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_WIDTH_8         3
7762306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT(x)                 (((x) & 0x7) << 8)
7862306a36Sopenharmony_ci/* 8 BPP */
7962306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_INDEXED            0
8062306a36Sopenharmony_ci/* 16 BPP */
8162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_ARGB1555           0
8262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_ARGB565            1
8362306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_ARGB4444           2
8462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_AI88               3
8562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_MONO16             4
8662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_BGRA5551           5
8762306a36Sopenharmony_ci/* 32 BPP */
8862306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_ARGB8888           0
8962306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_ARGB2101010        1
9062306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_32BPP_DIG          2
9162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_8B_ARGB2101010     3
9262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_BGRA1010102        4
9362306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_8B_BGRA1010102     5
9462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_RGB111110          6
9562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_FORMAT_BGR101111          7
9662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BANK_HEIGHT(x)            (((x) & 0x3) << 11)
9762306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_HEIGHT_1        0
9862306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_HEIGHT_2        1
9962306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_HEIGHT_4        2
10062306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_BANK_HEIGHT_8        3
10162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_TILE_SPLIT(x)             (((x) & 0x7) << 13)
10262306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_64B       0
10362306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_128B      1
10462306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_256B      2
10562306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_512B      3
10662306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_1KB       4
10762306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_2KB       5
10862306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_TILE_SPLIT_4KB       6
10962306a36Sopenharmony_ci#       define EVERGREEN_GRPH_MACRO_TILE_ASPECT(x)      (((x) & 0x3) << 18)
11062306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_MACRO_TILE_ASPECT_1  0
11162306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_MACRO_TILE_ASPECT_2  1
11262306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_MACRO_TILE_ASPECT_4  2
11362306a36Sopenharmony_ci#       define EVERGREEN_ADDR_SURF_MACRO_TILE_ASPECT_8  3
11462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ARRAY_MODE(x)             (((x) & 0x7) << 20)
11562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ARRAY_LINEAR_GENERAL      0
11662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ARRAY_LINEAR_ALIGNED      1
11762306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ARRAY_1D_TILED_THIN1      2
11862306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ARRAY_2D_TILED_THIN1      4
11962306a36Sopenharmony_ci#define EVERGREEN_GRPH_LUT_10BIT_BYPASS_CONTROL         0x6808
12062306a36Sopenharmony_ci#       define EVERGREEN_LUT_10BIT_BYPASS_EN            (1 << 8)
12162306a36Sopenharmony_ci#define EVERGREEN_GRPH_SWAP_CONTROL                     0x680c
12262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ENDIAN_SWAP(x)            (((x) & 0x3) << 0)
12362306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ENDIAN_NONE               0
12462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ENDIAN_8IN16              1
12562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ENDIAN_8IN32              2
12662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ENDIAN_8IN64              3
12762306a36Sopenharmony_ci#       define EVERGREEN_GRPH_RED_CROSSBAR(x)           (((x) & 0x3) << 4)
12862306a36Sopenharmony_ci#       define EVERGREEN_GRPH_RED_SEL_R                 0
12962306a36Sopenharmony_ci#       define EVERGREEN_GRPH_RED_SEL_G                 1
13062306a36Sopenharmony_ci#       define EVERGREEN_GRPH_RED_SEL_B                 2
13162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_RED_SEL_A                 3
13262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_GREEN_CROSSBAR(x)         (((x) & 0x3) << 6)
13362306a36Sopenharmony_ci#       define EVERGREEN_GRPH_GREEN_SEL_G               0
13462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_GREEN_SEL_B               1
13562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_GREEN_SEL_A               2
13662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_GREEN_SEL_R               3
13762306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BLUE_CROSSBAR(x)          (((x) & 0x3) << 8)
13862306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BLUE_SEL_B                0
13962306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BLUE_SEL_A                1
14062306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BLUE_SEL_R                2
14162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_BLUE_SEL_G                3
14262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ALPHA_CROSSBAR(x)         (((x) & 0x3) << 10)
14362306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ALPHA_SEL_A               0
14462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ALPHA_SEL_R               1
14562306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ALPHA_SEL_G               2
14662306a36Sopenharmony_ci#       define EVERGREEN_GRPH_ALPHA_SEL_B               3
14762306a36Sopenharmony_ci#define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS          0x6810
14862306a36Sopenharmony_ci#define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS        0x6814
14962306a36Sopenharmony_ci#       define EVERGREEN_GRPH_DFQ_ENABLE                (1 << 0)
15062306a36Sopenharmony_ci#       define EVERGREEN_GRPH_SURFACE_ADDRESS_MASK      0xffffff00
15162306a36Sopenharmony_ci#define EVERGREEN_GRPH_PITCH                            0x6818
15262306a36Sopenharmony_ci#define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH     0x681c
15362306a36Sopenharmony_ci#define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH   0x6820
15462306a36Sopenharmony_ci#define EVERGREEN_GRPH_SURFACE_OFFSET_X                 0x6824
15562306a36Sopenharmony_ci#define EVERGREEN_GRPH_SURFACE_OFFSET_Y                 0x6828
15662306a36Sopenharmony_ci#define EVERGREEN_GRPH_X_START                          0x682c
15762306a36Sopenharmony_ci#define EVERGREEN_GRPH_Y_START                          0x6830
15862306a36Sopenharmony_ci#define EVERGREEN_GRPH_X_END                            0x6834
15962306a36Sopenharmony_ci#define EVERGREEN_GRPH_Y_END                            0x6838
16062306a36Sopenharmony_ci#define EVERGREEN_GRPH_UPDATE                           0x6844
16162306a36Sopenharmony_ci#       define EVERGREEN_GRPH_SURFACE_UPDATE_PENDING    (1 << 2)
16262306a36Sopenharmony_ci#       define EVERGREEN_GRPH_UPDATE_LOCK               (1 << 16)
16362306a36Sopenharmony_ci#define EVERGREEN_GRPH_FLIP_CONTROL                     0x6848
16462306a36Sopenharmony_ci#       define EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN (1 << 0)
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci/* CUR blocks at 0x6998, 0x7598, 0x10198, 0x10d98, 0x11998, 0x12598 */
16762306a36Sopenharmony_ci#define EVERGREEN_CUR_CONTROL                           0x6998
16862306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_EN                      (1 << 0)
16962306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_MODE(x)                 (((x) & 0x3) << 8)
17062306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_MONO                    0
17162306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_24_1                    1
17262306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_24_8_PRE_MULT           2
17362306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_24_8_UNPRE_MULT         3
17462306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_2X_MAGNIFY              (1 << 16)
17562306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_FORCE_MC_ON             (1 << 20)
17662306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_URGENT_CONTROL(x)       (((x) & 0x7) << 24)
17762306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_URGENT_ALWAYS           0
17862306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_URGENT_1_8              1
17962306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_URGENT_1_4              2
18062306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_URGENT_3_8              3
18162306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_URGENT_1_2              4
18262306a36Sopenharmony_ci#define EVERGREEN_CUR_SURFACE_ADDRESS                   0x699c
18362306a36Sopenharmony_ci#       define EVERGREEN_CUR_SURFACE_ADDRESS_MASK       0xfffff000
18462306a36Sopenharmony_ci#define EVERGREEN_CUR_SIZE                              0x69a0
18562306a36Sopenharmony_ci#define EVERGREEN_CUR_SURFACE_ADDRESS_HIGH              0x69a4
18662306a36Sopenharmony_ci#define EVERGREEN_CUR_POSITION                          0x69a8
18762306a36Sopenharmony_ci#define EVERGREEN_CUR_HOT_SPOT                          0x69ac
18862306a36Sopenharmony_ci#define EVERGREEN_CUR_COLOR1                            0x69b0
18962306a36Sopenharmony_ci#define EVERGREEN_CUR_COLOR2                            0x69b4
19062306a36Sopenharmony_ci#define EVERGREEN_CUR_UPDATE                            0x69b8
19162306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_UPDATE_PENDING          (1 << 0)
19262306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_UPDATE_TAKEN            (1 << 1)
19362306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_UPDATE_LOCK             (1 << 16)
19462306a36Sopenharmony_ci#       define EVERGREEN_CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24)
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci/* LUT blocks at 0x69e0, 0x75e0, 0x101e0, 0x10de0, 0x119e0, 0x125e0 */
19762306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_RW_MODE                        0x69e0
19862306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_RW_INDEX                       0x69e4
19962306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_SEQ_COLOR                      0x69e8
20062306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_PWL_DATA                       0x69ec
20162306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_30_COLOR                       0x69f0
20262306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_VGA_ACCESS_ENABLE              0x69f4
20362306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_WRITE_EN_MASK                  0x69f8
20462306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_AUTOFILL                       0x69fc
20562306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_CONTROL                        0x6a00
20662306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_BLACK_OFFSET_BLUE              0x6a04
20762306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_BLACK_OFFSET_GREEN             0x6a08
20862306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_BLACK_OFFSET_RED               0x6a0c
20962306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_WHITE_OFFSET_BLUE              0x6a10
21062306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_WHITE_OFFSET_GREEN             0x6a14
21162306a36Sopenharmony_ci#define EVERGREEN_DC_LUT_WHITE_OFFSET_RED               0x6a18
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ci#define EVERGREEN_DATA_FORMAT                           0x6b00
21462306a36Sopenharmony_ci#       define EVERGREEN_INTERLEAVE_EN                  (1 << 0)
21562306a36Sopenharmony_ci#define EVERGREEN_DESKTOP_HEIGHT                        0x6b04
21662306a36Sopenharmony_ci#define EVERGREEN_VLINE_START_END                       0x6b08
21762306a36Sopenharmony_ci#define EVERGREEN_VLINE_STATUS                          0x6bb8
21862306a36Sopenharmony_ci#       define EVERGREEN_VLINE_STAT                     (1 << 12)
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci#define EVERGREEN_VIEWPORT_START                        0x6d70
22162306a36Sopenharmony_ci#define EVERGREEN_VIEWPORT_SIZE                         0x6d74
22262306a36Sopenharmony_ci
22362306a36Sopenharmony_ci/* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */
22462306a36Sopenharmony_ci#define EVERGREEN_CRTC0_REGISTER_OFFSET                 (0x6df0 - 0x6df0)
22562306a36Sopenharmony_ci#define EVERGREEN_CRTC1_REGISTER_OFFSET                 (0x79f0 - 0x6df0)
22662306a36Sopenharmony_ci#define EVERGREEN_CRTC2_REGISTER_OFFSET                 (0x105f0 - 0x6df0)
22762306a36Sopenharmony_ci#define EVERGREEN_CRTC3_REGISTER_OFFSET                 (0x111f0 - 0x6df0)
22862306a36Sopenharmony_ci#define EVERGREEN_CRTC4_REGISTER_OFFSET                 (0x11df0 - 0x6df0)
22962306a36Sopenharmony_ci#define EVERGREEN_CRTC5_REGISTER_OFFSET                 (0x129f0 - 0x6df0)
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci/* CRTC blocks at 0x6df0, 0x79f0, 0x105f0, 0x111f0, 0x11df0, 0x129f0 */
23262306a36Sopenharmony_ci#define EVERGREEN_CRTC_V_BLANK_START_END                0x6e34
23362306a36Sopenharmony_ci#define EVERGREEN_CRTC_CONTROL                          0x6e70
23462306a36Sopenharmony_ci#       define EVERGREEN_CRTC_MASTER_EN                 (1 << 0)
23562306a36Sopenharmony_ci#       define EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE (1 << 24)
23662306a36Sopenharmony_ci#define EVERGREEN_CRTC_BLANK_CONTROL                    0x6e74
23762306a36Sopenharmony_ci#       define EVERGREEN_CRTC_BLANK_DATA_EN             (1 << 8)
23862306a36Sopenharmony_ci#define EVERGREEN_CRTC_STATUS                           0x6e8c
23962306a36Sopenharmony_ci#       define EVERGREEN_CRTC_V_BLANK                   (1 << 0)
24062306a36Sopenharmony_ci#define EVERGREEN_CRTC_STATUS_POSITION                  0x6e90
24162306a36Sopenharmony_ci#define EVERGREEN_CRTC_STATUS_HV_COUNT                  0x6ea0
24262306a36Sopenharmony_ci#define EVERGREEN_CRTC_UPDATE_LOCK                      0x6ed4
24362306a36Sopenharmony_ci#define EVERGREEN_MASTER_UPDATE_LOCK                    0x6ef4
24462306a36Sopenharmony_ci#define EVERGREEN_MASTER_UPDATE_MODE                    0x6ef8
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ci#define EVERGREEN_DC_GPIO_HPD_MASK                      0x64b0
24762306a36Sopenharmony_ci#define EVERGREEN_DC_GPIO_HPD_A                         0x64b4
24862306a36Sopenharmony_ci#define EVERGREEN_DC_GPIO_HPD_EN                        0x64b8
24962306a36Sopenharmony_ci#define EVERGREEN_DC_GPIO_HPD_Y                         0x64bc
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci/* HDMI blocks at 0x7030, 0x7c30, 0x10830, 0x11430, 0x12030, 0x12c30 */
25262306a36Sopenharmony_ci#define EVERGREEN_HDMI_BASE				0x7030
25362306a36Sopenharmony_ci/*DIG block*/
25462306a36Sopenharmony_ci#define NI_DIG0_REGISTER_OFFSET                 (0x7000  - 0x7000)
25562306a36Sopenharmony_ci#define NI_DIG1_REGISTER_OFFSET                 (0x7C00  - 0x7000)
25662306a36Sopenharmony_ci#define NI_DIG2_REGISTER_OFFSET                 (0x10800 - 0x7000)
25762306a36Sopenharmony_ci#define NI_DIG3_REGISTER_OFFSET                 (0x11400 - 0x7000)
25862306a36Sopenharmony_ci#define NI_DIG4_REGISTER_OFFSET                 (0x12000 - 0x7000)
25962306a36Sopenharmony_ci#define NI_DIG5_REGISTER_OFFSET                 (0x12C00 - 0x7000)
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci
26262306a36Sopenharmony_ci#define NI_DIG_FE_CNTL                               0x7000
26362306a36Sopenharmony_ci#       define NI_DIG_FE_CNTL_SOURCE_SELECT(x)        ((x) & 0x3)
26462306a36Sopenharmony_ci#       define NI_DIG_FE_CNTL_SYMCLK_FE_ON            (1<<24)
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci#define NI_DIG_BE_CNTL                    0x7140
26862306a36Sopenharmony_ci#       define NI_DIG_BE_CNTL_FE_SOURCE_SELECT(x)     (((x) >> 8 ) & 0x3F)
26962306a36Sopenharmony_ci#       define NI_DIG_FE_CNTL_MODE(x)                 (((x) >> 16) & 0x7 )
27062306a36Sopenharmony_ci
27162306a36Sopenharmony_ci#define NI_DIG_BE_EN_CNTL                              0x7144
27262306a36Sopenharmony_ci#       define NI_DIG_BE_EN_CNTL_ENABLE               (1 << 0)
27362306a36Sopenharmony_ci#       define NI_DIG_BE_EN_CNTL_SYMBCLK_ON           (1 << 8)
27462306a36Sopenharmony_ci#       define NI_DIG_BE_DPSST 0
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci/* Display Port block */
27762306a36Sopenharmony_ci#define EVERGREEN_DP0_REGISTER_OFFSET                 (0x730C  - 0x730C)
27862306a36Sopenharmony_ci#define EVERGREEN_DP1_REGISTER_OFFSET                 (0x7F0C  - 0x730C)
27962306a36Sopenharmony_ci#define EVERGREEN_DP2_REGISTER_OFFSET                 (0x10B0C - 0x730C)
28062306a36Sopenharmony_ci#define EVERGREEN_DP3_REGISTER_OFFSET                 (0x1170C - 0x730C)
28162306a36Sopenharmony_ci#define EVERGREEN_DP4_REGISTER_OFFSET                 (0x1230C - 0x730C)
28262306a36Sopenharmony_ci#define EVERGREEN_DP5_REGISTER_OFFSET                 (0x12F0C - 0x730C)
28362306a36Sopenharmony_ci
28462306a36Sopenharmony_ci
28562306a36Sopenharmony_ci#define EVERGREEN_DP_VID_STREAM_CNTL                    0x730C
28662306a36Sopenharmony_ci#       define EVERGREEN_DP_VID_STREAM_CNTL_ENABLE     (1 << 0)
28762306a36Sopenharmony_ci#       define EVERGREEN_DP_VID_STREAM_STATUS          (1 <<16)
28862306a36Sopenharmony_ci#define EVERGREEN_DP_STEER_FIFO                         0x7310
28962306a36Sopenharmony_ci#       define EVERGREEN_DP_STEER_FIFO_RESET           (1 << 0)
29062306a36Sopenharmony_ci#define EVERGREEN_DP_SEC_CNTL                           0x7280
29162306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_STREAM_ENABLE           (1 << 0)
29262306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_ASP_ENABLE              (1 << 4)
29362306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_ATP_ENABLE              (1 << 8)
29462306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_AIP_ENABLE              (1 << 12)
29562306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_GSP_ENABLE              (1 << 20)
29662306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_AVI_ENABLE              (1 << 24)
29762306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_MPG_ENABLE              (1 << 28)
29862306a36Sopenharmony_ci#define EVERGREEN_DP_SEC_TIMESTAMP                      0x72a4
29962306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_TIMESTAMP_MODE(x)       (((x) & 0x3) << 0)
30062306a36Sopenharmony_ci#define EVERGREEN_DP_SEC_AUD_N                          0x7294
30162306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_N_BASE_MULTIPLE(x)      (((x) & 0xf) << 24)
30262306a36Sopenharmony_ci#       define EVERGREEN_DP_SEC_SS_EN                   (1 << 28)
30362306a36Sopenharmony_ci
30462306a36Sopenharmony_ci/*DCIO_UNIPHY block*/
30562306a36Sopenharmony_ci#define NI_DCIO_UNIPHY0_UNIPHY_TX_CONTROL1            (0x6600  -0x6600)
30662306a36Sopenharmony_ci#define NI_DCIO_UNIPHY1_UNIPHY_TX_CONTROL1            (0x6640  -0x6600)
30762306a36Sopenharmony_ci#define NI_DCIO_UNIPHY2_UNIPHY_TX_CONTROL1            (0x6680 - 0x6600)
30862306a36Sopenharmony_ci#define NI_DCIO_UNIPHY3_UNIPHY_TX_CONTROL1            (0x66C0 - 0x6600)
30962306a36Sopenharmony_ci#define NI_DCIO_UNIPHY4_UNIPHY_TX_CONTROL1            (0x6700 - 0x6600)
31062306a36Sopenharmony_ci#define NI_DCIO_UNIPHY5_UNIPHY_TX_CONTROL1            (0x6740 - 0x6600)
31162306a36Sopenharmony_ci
31262306a36Sopenharmony_ci#define NI_DCIO_UNIPHY0_PLL_CONTROL1                   0x6618
31362306a36Sopenharmony_ci#       define NI_DCIO_UNIPHY0_PLL_CONTROL1_ENABLE     (1 << 0)
31462306a36Sopenharmony_ci
31562306a36Sopenharmony_ci#endif
316