xref: /linux/drivers/gpu/drm/radeon/ni_reg.h (revision 8c57a5e7b2820f349c95b8c8393fec1e0f4070d2)
158c2e9f0SAlex Deucher /*
258c2e9f0SAlex Deucher  * Copyright 2010 Advanced Micro Devices, Inc.
358c2e9f0SAlex Deucher  *
458c2e9f0SAlex Deucher  * Permission is hereby granted, free of charge, to any person obtaining a
558c2e9f0SAlex Deucher  * copy of this software and associated documentation files (the "Software"),
658c2e9f0SAlex Deucher  * to deal in the Software without restriction, including without limitation
758c2e9f0SAlex Deucher  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
858c2e9f0SAlex Deucher  * and/or sell copies of the Software, and to permit persons to whom the
958c2e9f0SAlex Deucher  * Software is furnished to do so, subject to the following conditions:
1058c2e9f0SAlex Deucher  *
1158c2e9f0SAlex Deucher  * The above copyright notice and this permission notice shall be included in
1258c2e9f0SAlex Deucher  * all copies or substantial portions of the Software.
1358c2e9f0SAlex Deucher  *
1458c2e9f0SAlex Deucher  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1558c2e9f0SAlex Deucher  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1658c2e9f0SAlex Deucher  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1758c2e9f0SAlex Deucher  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1858c2e9f0SAlex Deucher  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1958c2e9f0SAlex Deucher  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2058c2e9f0SAlex Deucher  * OTHER DEALINGS IN THE SOFTWARE.
2158c2e9f0SAlex Deucher  *
2258c2e9f0SAlex Deucher  * Authors: Alex Deucher
2358c2e9f0SAlex Deucher  */
2458c2e9f0SAlex Deucher #ifndef __NI_REG_H__
2558c2e9f0SAlex Deucher #define __NI_REG_H__
2658c2e9f0SAlex Deucher 
2758c2e9f0SAlex Deucher /* northern islands - DCE5 */
2858c2e9f0SAlex Deucher 
2958c2e9f0SAlex Deucher #define NI_INPUT_GAMMA_CONTROL                         0x6840
3058c2e9f0SAlex Deucher #       define NI_GRPH_INPUT_GAMMA_MODE(x)             (((x) & 0x3) << 0)
3158c2e9f0SAlex Deucher #       define NI_INPUT_GAMMA_USE_LUT                  0
3258c2e9f0SAlex Deucher #       define NI_INPUT_GAMMA_BYPASS                   1
3358c2e9f0SAlex Deucher #       define NI_INPUT_GAMMA_SRGB_24                  2
3458c2e9f0SAlex Deucher #       define NI_INPUT_GAMMA_XVYCC_222                3
3558c2e9f0SAlex Deucher #       define NI_OVL_INPUT_GAMMA_MODE(x)              (((x) & 0x3) << 4)
3658c2e9f0SAlex Deucher 
3758c2e9f0SAlex Deucher #define NI_PRESCALE_GRPH_CONTROL                       0x68b4
3858c2e9f0SAlex Deucher #       define NI_GRPH_PRESCALE_BYPASS                 (1 << 4)
3958c2e9f0SAlex Deucher 
4058c2e9f0SAlex Deucher #define NI_PRESCALE_OVL_CONTROL                        0x68c4
4158c2e9f0SAlex Deucher #       define NI_OVL_PRESCALE_BYPASS                  (1 << 4)
4258c2e9f0SAlex Deucher 
4358c2e9f0SAlex Deucher #define NI_INPUT_CSC_CONTROL                           0x68d4
4458c2e9f0SAlex Deucher #       define NI_INPUT_CSC_GRPH_MODE(x)               (((x) & 0x3) << 0)
4558c2e9f0SAlex Deucher #       define NI_INPUT_CSC_BYPASS                     0
4658c2e9f0SAlex Deucher #       define NI_INPUT_CSC_PROG_COEFF                 1
4758c2e9f0SAlex Deucher #       define NI_INPUT_CSC_PROG_SHARED_MATRIXA        2
4858c2e9f0SAlex Deucher #       define NI_INPUT_CSC_OVL_MODE(x)                (((x) & 0x3) << 4)
4958c2e9f0SAlex Deucher 
5058c2e9f0SAlex Deucher #define NI_OUTPUT_CSC_CONTROL                          0x68f0
5158c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_GRPH_MODE(x)              (((x) & 0x7) << 0)
5258c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_BYPASS                    0
5358c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_TV_RGB                    1
5458c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_YCBCR_601                 2
5558c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_YCBCR_709                 3
5658c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_PROG_COEFF                4
5758c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_PROG_SHARED_MATRIXB       5
5858c2e9f0SAlex Deucher #       define NI_OUTPUT_CSC_OVL_MODE(x)               (((x) & 0x7) << 4)
5958c2e9f0SAlex Deucher 
6058c2e9f0SAlex Deucher #define NI_DEGAMMA_CONTROL                             0x6960
6158c2e9f0SAlex Deucher #       define NI_GRPH_DEGAMMA_MODE(x)                 (((x) & 0x3) << 0)
6258c2e9f0SAlex Deucher #       define NI_DEGAMMA_BYPASS                       0
6358c2e9f0SAlex Deucher #       define NI_DEGAMMA_SRGB_24                      1
6458c2e9f0SAlex Deucher #       define NI_DEGAMMA_XVYCC_222                    2
6558c2e9f0SAlex Deucher #       define NI_OVL_DEGAMMA_MODE(x)                  (((x) & 0x3) << 4)
6658c2e9f0SAlex Deucher #       define NI_ICON_DEGAMMA_MODE(x)                 (((x) & 0x3) << 8)
6758c2e9f0SAlex Deucher #       define NI_CURSOR_DEGAMMA_MODE(x)               (((x) & 0x3) << 12)
6858c2e9f0SAlex Deucher 
6958c2e9f0SAlex Deucher #define NI_GAMUT_REMAP_CONTROL                         0x6964
7058c2e9f0SAlex Deucher #       define NI_GRPH_GAMUT_REMAP_MODE(x)             (((x) & 0x3) << 0)
7158c2e9f0SAlex Deucher #       define NI_GAMUT_REMAP_BYPASS                   0
7258c2e9f0SAlex Deucher #       define NI_GAMUT_REMAP_PROG_COEFF               1
7358c2e9f0SAlex Deucher #       define NI_GAMUT_REMAP_PROG_SHARED_MATRIXA      2
7458c2e9f0SAlex Deucher #       define NI_GAMUT_REMAP_PROG_SHARED_MATRIXB      3
7558c2e9f0SAlex Deucher #       define NI_OVL_GAMUT_REMAP_MODE(x)              (((x) & 0x3) << 4)
7658c2e9f0SAlex Deucher 
7758c2e9f0SAlex Deucher #define NI_REGAMMA_CONTROL                             0x6a80
7858c2e9f0SAlex Deucher #       define NI_GRPH_REGAMMA_MODE(x)                 (((x) & 0x7) << 0)
7958c2e9f0SAlex Deucher #       define NI_REGAMMA_BYPASS                       0
8058c2e9f0SAlex Deucher #       define NI_REGAMMA_SRGB_24                      1
8158c2e9f0SAlex Deucher #       define NI_REGAMMA_XVYCC_222                    2
8258c2e9f0SAlex Deucher #       define NI_REGAMMA_PROG_A                       3
8358c2e9f0SAlex Deucher #       define NI_REGAMMA_PROG_B                       4
8458c2e9f0SAlex Deucher #       define NI_OVL_REGAMMA_MODE(x)                  (((x) & 0x7) << 4)
8558c2e9f0SAlex Deucher 
8600a014e8SDave Airlie #define NI_DP_MSE_LINK_TIMING                          0x73a0
8700a014e8SDave Airlie #	define NI_DP_MSE_LINK_FRAME			(((x) & 0x3ff) << 0)
8800a014e8SDave Airlie #	define NI_DP_MSE_LINK_LINE                      (((x) & 0x3) << 16)
8900a014e8SDave Airlie 
9000a014e8SDave Airlie #define NI_DP_MSE_MISC_CNTL                            0x736c
9100a014e8SDave Airlie #       define NI_DP_MSE_BLANK_CODE                    (((x) & 0x1) << 0)
9200a014e8SDave Airlie #       define NI_DP_MSE_TIMESTAMP_MODE                (((x) & 0x1) << 4)
9300a014e8SDave Airlie #       define NI_DP_MSE_ZERO_ENCODER                  (((x) & 0x1) << 8)
9400a014e8SDave Airlie 
9500a014e8SDave Airlie #define NI_DP_MSE_RATE_CNTL                            0x7384
969843ead0SDave Airlie #       define NI_DP_MSE_RATE_Y(x)                   (((x) & 0x3ffffff) << 0)
979843ead0SDave Airlie #       define NI_DP_MSE_RATE_X(x)                   (((x) & 0x3f) << 26)
9800a014e8SDave Airlie 
9900a014e8SDave Airlie #define NI_DP_MSE_RATE_UPDATE                          0x738c
10000a014e8SDave Airlie 
10100a014e8SDave Airlie #define NI_DP_MSE_SAT0                                 0x7390
10200a014e8SDave Airlie #       define NI_DP_MSE_SAT_SRC0(x)                   (((x) & 0x7) << 0)
10300a014e8SDave Airlie #       define NI_DP_MSE_SAT_SLOT_COUNT0(x)            (((x) & 0x3f) << 8)
10400a014e8SDave Airlie #       define NI_DP_MSE_SAT_SRC1(x)                   (((x) & 0x7) << 16)
10500a014e8SDave Airlie #       define NI_DP_MSE_SAT_SLOT_COUNT1(x)            (((x) & 0x3f) << 24)
10600a014e8SDave Airlie 
10700a014e8SDave Airlie #define NI_DP_MSE_SAT1                                 0x7394
10800a014e8SDave Airlie 
10900a014e8SDave Airlie #define NI_DP_MSE_SAT2                                 0x7398
11000a014e8SDave Airlie 
11100a014e8SDave Airlie #define NI_DP_MSE_SAT_UPDATE                           0x739c
112*4b814aacSDave Airlie #       define NI_DP_MSE_SAT_UPDATE_MASK               0x3
113*4b814aacSDave Airlie #       define NI_DP_MSE_16_MTP_KEEPOUT                0x100
11400a014e8SDave Airlie 
11500a014e8SDave Airlie #define NI_DIG_BE_CNTL                                 0x7140
11600a014e8SDave Airlie #       define NI_DIG_FE_SOURCE_SELECT(x)              (((x) & 0x7f) << 8)
11700a014e8SDave Airlie #       define NI_DIG_FE_DIG_MODE(x)                   (((x) & 0x7) << 16)
1189843ead0SDave Airlie #       define NI_DIG_MODE_DP_SST                      0
1199843ead0SDave Airlie #       define NI_DIG_MODE_LVDS                        1
1209843ead0SDave Airlie #       define NI_DIG_MODE_TMDS_DVI                    2
1219843ead0SDave Airlie #       define NI_DIG_MODE_TMDS_HDMI                   3
1229843ead0SDave Airlie #       define NI_DIG_MODE_DP_MST                      5
12300a014e8SDave Airlie #       define NI_DIG_HPD_SELECT(x)                    (((x) & 0x7) << 28)
12400a014e8SDave Airlie 
12500a014e8SDave Airlie #define NI_DIG_FE_CNTL                                 0x7000
12600a014e8SDave Airlie #       define NI_DIG_SOURCE_SELECT(x)                 (((x) & 0x3) << 0)
12700a014e8SDave Airlie #       define NI_DIG_STEREOSYNC_SELECT(x)             (((x) & 0x3) << 4)
12800a014e8SDave Airlie #       define NI_DIG_STEREOSYNC_GATE_EN(x)            (((x) & 0x1) << 8)
12900a014e8SDave Airlie #       define NI_DIG_DUAL_LINK_ENABLE(x)              (((x) & 0x1) << 16)
13000a014e8SDave Airlie #       define NI_DIG_SWAP(x)                          (((x) & 0x1) << 18)
13100a014e8SDave Airlie #       define NI_DIG_SYMCLK_FE_ON                     (0x1 << 24)
13258c2e9f0SAlex Deucher #endif
133