xref: /linux/drivers/gpu/drm/radeon/sumod.h (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
180ea2c12SAlex Deucher /*
280ea2c12SAlex Deucher  * Copyright 2012 Advanced Micro Devices, Inc.
380ea2c12SAlex Deucher  *
480ea2c12SAlex Deucher  * Permission is hereby granted, free of charge, to any person obtaining a
580ea2c12SAlex Deucher  * copy of this software and associated documentation files (the "Software"),
680ea2c12SAlex Deucher  * to deal in the Software without restriction, including without limitation
780ea2c12SAlex Deucher  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
880ea2c12SAlex Deucher  * and/or sell copies of the Software, and to permit persons to whom the
980ea2c12SAlex Deucher  * Software is furnished to do so, subject to the following conditions:
1080ea2c12SAlex Deucher  *
1180ea2c12SAlex Deucher  * The above copyright notice and this permission notice shall be included in
1280ea2c12SAlex Deucher  * all copies or substantial portions of the Software.
1380ea2c12SAlex Deucher  *
1480ea2c12SAlex Deucher  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1580ea2c12SAlex Deucher  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1680ea2c12SAlex Deucher  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1780ea2c12SAlex Deucher  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1880ea2c12SAlex Deucher  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1980ea2c12SAlex Deucher  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2080ea2c12SAlex Deucher  * OTHER DEALINGS IN THE SOFTWARE.
2180ea2c12SAlex Deucher  *
2280ea2c12SAlex Deucher  * Authors: Alex Deucher
2380ea2c12SAlex Deucher  */
2480ea2c12SAlex Deucher #ifndef _SUMOD_H_
2580ea2c12SAlex Deucher #define _SUMOD_H_
2680ea2c12SAlex Deucher 
2780ea2c12SAlex Deucher /* pm registers */
2880ea2c12SAlex Deucher 
2980ea2c12SAlex Deucher /* rcu */
3080ea2c12SAlex Deucher #define RCU_FW_VERSION                                  0x30c
3180ea2c12SAlex Deucher 
3280ea2c12SAlex Deucher #define RCU_PWR_GATING_SEQ0                             0x408
3380ea2c12SAlex Deucher #define RCU_PWR_GATING_SEQ1                             0x40c
3480ea2c12SAlex Deucher #define RCU_PWR_GATING_CNTL                             0x410
3580ea2c12SAlex Deucher #       define PWR_GATING_EN                            (1 << 0)
3680ea2c12SAlex Deucher #       define RSVD_MASK                                (0x3 << 1)
3780ea2c12SAlex Deucher #       define PCV(x)                                   ((x) << 3)
3880ea2c12SAlex Deucher #       define PCV_MASK                                 (0x1f << 3)
3980ea2c12SAlex Deucher #       define PCV_SHIFT                                3
4080ea2c12SAlex Deucher #       define PCP(x)                                   ((x) << 8)
4180ea2c12SAlex Deucher #       define PCP_MASK                                 (0xf << 8)
4280ea2c12SAlex Deucher #       define PCP_SHIFT                                8
4380ea2c12SAlex Deucher #       define RPW(x)                                   ((x) << 16)
4480ea2c12SAlex Deucher #       define RPW_MASK                                 (0xf << 16)
4580ea2c12SAlex Deucher #       define RPW_SHIFT                                16
4680ea2c12SAlex Deucher #       define ID(x)                                    ((x) << 24)
4780ea2c12SAlex Deucher #       define ID_MASK                                  (0xf << 24)
4880ea2c12SAlex Deucher #       define ID_SHIFT                                 24
4980ea2c12SAlex Deucher #       define PGS(x)                                   ((x) << 28)
5080ea2c12SAlex Deucher #       define PGS_MASK                                 (0xf << 28)
5180ea2c12SAlex Deucher #       define PGS_SHIFT                                28
5280ea2c12SAlex Deucher 
5380ea2c12SAlex Deucher #define RCU_ALTVDDNB_NOTIFY                             0x430
5480ea2c12SAlex Deucher #define RCU_LCLK_SCALING_CNTL                           0x434
5580ea2c12SAlex Deucher #       define LCLK_SCALING_EN                          (1 << 0)
5680ea2c12SAlex Deucher #       define LCLK_SCALING_TYPE                        (1 << 1)
5780ea2c12SAlex Deucher #       define LCLK_SCALING_TIMER_PRESCALER(x)          ((x) << 4)
5880ea2c12SAlex Deucher #       define LCLK_SCALING_TIMER_PRESCALER_MASK        (0xf << 4)
5980ea2c12SAlex Deucher #       define LCLK_SCALING_TIMER_PRESCALER_SHIFT       4
6080ea2c12SAlex Deucher #       define LCLK_SCALING_TIMER_PERIOD(x)             ((x) << 16)
6180ea2c12SAlex Deucher #       define LCLK_SCALING_TIMER_PERIOD_MASK           (0xf << 16)
6280ea2c12SAlex Deucher #       define LCLK_SCALING_TIMER_PERIOD_SHIFT          16
6380ea2c12SAlex Deucher 
6480ea2c12SAlex Deucher #define RCU_PWR_GATING_CNTL_2                           0x4a0
6580ea2c12SAlex Deucher #       define MPPU(x)                                  ((x) << 0)
6680ea2c12SAlex Deucher #       define MPPU_MASK                                (0xffff << 0)
6780ea2c12SAlex Deucher #       define MPPU_SHIFT                               0
6880ea2c12SAlex Deucher #       define MPPD(x)                                  ((x) << 16)
6980ea2c12SAlex Deucher #       define MPPD_MASK                                (0xffff << 16)
7080ea2c12SAlex Deucher #       define MPPD_SHIFT                               16
7180ea2c12SAlex Deucher #define RCU_PWR_GATING_CNTL_3                           0x4a4
7280ea2c12SAlex Deucher #       define DPPU(x)                                  ((x) << 0)
7380ea2c12SAlex Deucher #       define DPPU_MASK                                (0xffff << 0)
7480ea2c12SAlex Deucher #       define DPPU_SHIFT                               0
7580ea2c12SAlex Deucher #       define DPPD(x)                                  ((x) << 16)
7680ea2c12SAlex Deucher #       define DPPD_MASK                                (0xffff << 16)
7780ea2c12SAlex Deucher #       define DPPD_SHIFT                               16
7880ea2c12SAlex Deucher #define RCU_PWR_GATING_CNTL_4                           0x4a8
7980ea2c12SAlex Deucher #       define RT(x)                                    ((x) << 0)
8080ea2c12SAlex Deucher #       define RT_MASK                                  (0xffff << 0)
8180ea2c12SAlex Deucher #       define RT_SHIFT                                 0
8280ea2c12SAlex Deucher #       define IT(x)                                    ((x) << 16)
8380ea2c12SAlex Deucher #       define IT_MASK                                  (0xffff << 16)
8480ea2c12SAlex Deucher #       define IT_SHIFT                                 16
8580ea2c12SAlex Deucher 
8680ea2c12SAlex Deucher /* yes these two have the same address */
8780ea2c12SAlex Deucher #define RCU_PWR_GATING_CNTL_5                           0x504
8880ea2c12SAlex Deucher #define RCU_GPU_BOOST_DISABLE                           0x508
8980ea2c12SAlex Deucher 
9080ea2c12SAlex Deucher #define MCU_M3ARB_INDEX                                 0x504
9180ea2c12SAlex Deucher #define MCU_M3ARB_PARAMS                                0x508
9280ea2c12SAlex Deucher 
9380ea2c12SAlex Deucher #define RCU_GNB_PWR_REP_TIMER_CNTL                      0x50C
9480ea2c12SAlex Deucher 
9580ea2c12SAlex Deucher #define RCU_SclkDpmTdpLimit01                           0x514
9680ea2c12SAlex Deucher #define RCU_SclkDpmTdpLimit23                           0x518
9780ea2c12SAlex Deucher #define RCU_SclkDpmTdpLimit47                           0x51C
9880ea2c12SAlex Deucher #define RCU_SclkDpmTdpLimitPG                           0x520
9980ea2c12SAlex Deucher 
10080ea2c12SAlex Deucher #define GNB_TDP_LIMIT                                   0x540
10180ea2c12SAlex Deucher #define RCU_BOOST_MARGIN                                0x544
10280ea2c12SAlex Deucher #define RCU_THROTTLE_MARGIN                             0x548
10380ea2c12SAlex Deucher 
10480ea2c12SAlex Deucher #define SMU_PCIE_PG_ARGS                                0x58C
10580ea2c12SAlex Deucher #define SMU_PCIE_PG_ARGS_2                              0x598
10680ea2c12SAlex Deucher #define SMU_PCIE_PG_ARGS_3                              0x59C
10780ea2c12SAlex Deucher 
10880ea2c12SAlex Deucher /* mmio */
10980ea2c12SAlex Deucher #define RCU_STATUS                                      0x11c
11080ea2c12SAlex Deucher #       define GMC_PWR_GATER_BUSY                       (1 << 8)
11180ea2c12SAlex Deucher #       define GFX_PWR_GATER_BUSY                       (1 << 9)
11280ea2c12SAlex Deucher #       define UVD_PWR_GATER_BUSY                       (1 << 10)
11380ea2c12SAlex Deucher #       define PCIE_PWR_GATER_BUSY                      (1 << 11)
11480ea2c12SAlex Deucher #       define GMC_PWR_GATER_STATE                      (1 << 12)
11580ea2c12SAlex Deucher #       define GFX_PWR_GATER_STATE                      (1 << 13)
11680ea2c12SAlex Deucher #       define UVD_PWR_GATER_STATE                      (1 << 14)
11780ea2c12SAlex Deucher #       define PCIE_PWR_GATER_STATE                     (1 << 15)
11880ea2c12SAlex Deucher #       define GFX1_PWR_GATER_BUSY                      (1 << 16)
11980ea2c12SAlex Deucher #       define GFX2_PWR_GATER_BUSY                      (1 << 17)
12080ea2c12SAlex Deucher #       define GFX1_PWR_GATER_STATE                     (1 << 18)
12180ea2c12SAlex Deucher #       define GFX2_PWR_GATER_STATE                     (1 << 19)
12280ea2c12SAlex Deucher 
12380ea2c12SAlex Deucher #define GFX_INT_REQ                                     0x120
12480ea2c12SAlex Deucher #       define INT_REQ                                  (1 << 0)
12580ea2c12SAlex Deucher #       define SERV_INDEX(x)                            ((x) << 1)
12680ea2c12SAlex Deucher #       define SERV_INDEX_MASK                          (0xff << 1)
12780ea2c12SAlex Deucher #       define SERV_INDEX_SHIFT                         1
12880ea2c12SAlex Deucher #define GFX_INT_STATUS                                  0x124
12980ea2c12SAlex Deucher #       define INT_ACK                                  (1 << 0)
13080ea2c12SAlex Deucher #       define INT_DONE                                 (1 << 1)
13180ea2c12SAlex Deucher 
13280ea2c12SAlex Deucher #define CG_SCLK_CNTL                                    0x600
13380ea2c12SAlex Deucher #       define SCLK_DIVIDER(x)                          ((x) << 0)
13480ea2c12SAlex Deucher #       define SCLK_DIVIDER_MASK                        (0x7f << 0)
13580ea2c12SAlex Deucher #       define SCLK_DIVIDER_SHIFT                       0
13680ea2c12SAlex Deucher #define CG_SCLK_STATUS                                  0x604
13780ea2c12SAlex Deucher #       define SCLK_OVERCLK_DETECT                      (1 << 2)
13880ea2c12SAlex Deucher 
139*06793dfbSAlex Deucher #define CG_DCLK_CNTL                                    0x610
140*06793dfbSAlex Deucher #       define DCLK_DIVIDER_MASK                        0x7f
141*06793dfbSAlex Deucher #       define DCLK_DIR_CNTL_EN                         (1 << 8)
142*06793dfbSAlex Deucher #define CG_DCLK_STATUS                                  0x614
143*06793dfbSAlex Deucher #       define DCLK_STATUS                              (1 << 0)
144*06793dfbSAlex Deucher #define CG_VCLK_CNTL                                    0x618
145*06793dfbSAlex Deucher #       define VCLK_DIVIDER_MASK                        0x7f
146*06793dfbSAlex Deucher #       define VCLK_DIR_CNTL_EN                         (1 << 8)
147*06793dfbSAlex Deucher #define CG_VCLK_STATUS                                  0x61c
148*06793dfbSAlex Deucher 
14980ea2c12SAlex Deucher #define GENERAL_PWRMGT                                  0x63c
15080ea2c12SAlex Deucher #       define STATIC_PM_EN                             (1 << 1)
15180ea2c12SAlex Deucher 
15280ea2c12SAlex Deucher #define SCLK_PWRMGT_CNTL                                0x644
15380ea2c12SAlex Deucher #       define SCLK_PWRMGT_OFF                          (1 << 0)
15480ea2c12SAlex Deucher #       define SCLK_LOW_D1                              (1 << 1)
15580ea2c12SAlex Deucher #       define FIR_RESET                                (1 << 4)
15680ea2c12SAlex Deucher #       define FIR_FORCE_TREND_SEL                      (1 << 5)
15780ea2c12SAlex Deucher #       define FIR_TREND_MODE                           (1 << 6)
15880ea2c12SAlex Deucher #       define DYN_GFX_CLK_OFF_EN                       (1 << 7)
15980ea2c12SAlex Deucher #       define GFX_CLK_FORCE_ON                         (1 << 8)
16080ea2c12SAlex Deucher #       define GFX_CLK_REQUEST_OFF                      (1 << 9)
16180ea2c12SAlex Deucher #       define GFX_CLK_FORCE_OFF                        (1 << 10)
16280ea2c12SAlex Deucher #       define GFX_CLK_OFF_ACPI_D1                      (1 << 11)
16380ea2c12SAlex Deucher #       define GFX_CLK_OFF_ACPI_D2                      (1 << 12)
16480ea2c12SAlex Deucher #       define GFX_CLK_OFF_ACPI_D3                      (1 << 13)
16580ea2c12SAlex Deucher #       define GFX_VOLTAGE_CHANGE_EN                    (1 << 16)
16680ea2c12SAlex Deucher #       define GFX_VOLTAGE_CHANGE_MODE                  (1 << 17)
16780ea2c12SAlex Deucher 
16880ea2c12SAlex Deucher #define TARGET_AND_CURRENT_PROFILE_INDEX                0x66c
16980ea2c12SAlex Deucher #       define TARG_SCLK_INDEX(x)                       ((x) << 6)
17080ea2c12SAlex Deucher #       define TARG_SCLK_INDEX_MASK                     (0x7 << 6)
17180ea2c12SAlex Deucher #       define TARG_SCLK_INDEX_SHIFT                    6
17280ea2c12SAlex Deucher #       define CURR_SCLK_INDEX(x)                       ((x) << 9)
17380ea2c12SAlex Deucher #       define CURR_SCLK_INDEX_MASK                     (0x7 << 9)
17480ea2c12SAlex Deucher #       define CURR_SCLK_INDEX_SHIFT                    9
17580ea2c12SAlex Deucher #       define TARG_INDEX(x)                            ((x) << 12)
17680ea2c12SAlex Deucher #       define TARG_INDEX_MASK                          (0x7 << 12)
17780ea2c12SAlex Deucher #       define TARG_INDEX_SHIFT                         12
17880ea2c12SAlex Deucher #       define CURR_INDEX(x)                            ((x) << 15)
17980ea2c12SAlex Deucher #       define CURR_INDEX_MASK                          (0x7 << 15)
18080ea2c12SAlex Deucher #       define CURR_INDEX_SHIFT                         15
18180ea2c12SAlex Deucher 
18280ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL                                0x684
18380ea2c12SAlex Deucher #       define SCLK_FSTATE_0_DIV(x)                     ((x) << 0)
18480ea2c12SAlex Deucher #       define SCLK_FSTATE_0_DIV_MASK                   (0x7f << 0)
18580ea2c12SAlex Deucher #       define SCLK_FSTATE_0_DIV_SHIFT                  0
18680ea2c12SAlex Deucher #       define SCLK_FSTATE_0_VLD                        (1 << 7)
18780ea2c12SAlex Deucher #       define SCLK_FSTATE_1_DIV(x)                     ((x) << 8)
18880ea2c12SAlex Deucher #       define SCLK_FSTATE_1_DIV_MASK                   (0x7f << 8)
18980ea2c12SAlex Deucher #       define SCLK_FSTATE_1_DIV_SHIFT                  8
19080ea2c12SAlex Deucher #       define SCLK_FSTATE_1_VLD                        (1 << 15)
19180ea2c12SAlex Deucher #       define SCLK_FSTATE_2_DIV(x)                     ((x) << 16)
19280ea2c12SAlex Deucher #       define SCLK_FSTATE_2_DIV_MASK                   (0x7f << 16)
19380ea2c12SAlex Deucher #       define SCLK_FSTATE_2_DIV_SHIFT                  16
19480ea2c12SAlex Deucher #       define SCLK_FSTATE_2_VLD                        (1 << 23)
19580ea2c12SAlex Deucher #       define SCLK_FSTATE_3_DIV(x)                     ((x) << 24)
19680ea2c12SAlex Deucher #       define SCLK_FSTATE_3_DIV_MASK                   (0x7f << 24)
19780ea2c12SAlex Deucher #       define SCLK_FSTATE_3_DIV_SHIFT                  24
19880ea2c12SAlex Deucher #       define SCLK_FSTATE_3_VLD                        (1 << 31)
19980ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL_2                              0x688
20080ea2c12SAlex Deucher #define CG_GCOOR                                        0x68c
20180ea2c12SAlex Deucher #       define PHC(x)                                   ((x) << 0)
20280ea2c12SAlex Deucher #       define PHC_MASK                                 (0x1f << 0)
20380ea2c12SAlex Deucher #       define PHC_SHIFT                                0
20480ea2c12SAlex Deucher #       define SDC(x)                                   ((x) << 9)
20580ea2c12SAlex Deucher #       define SDC_MASK                                 (0x3ff << 9)
20680ea2c12SAlex Deucher #       define SDC_SHIFT                                9
20780ea2c12SAlex Deucher #       define SU(x)                                    ((x) << 23)
20880ea2c12SAlex Deucher #       define SU_MASK                                  (0xf << 23)
20980ea2c12SAlex Deucher #       define SU_SHIFT                                 23
21080ea2c12SAlex Deucher #       define DIV_ID(x)                                ((x) << 28)
21180ea2c12SAlex Deucher #       define DIV_ID_MASK                              (0x7 << 28)
21280ea2c12SAlex Deucher #       define DIV_ID_SHIFT                             28
21380ea2c12SAlex Deucher 
21480ea2c12SAlex Deucher #define CG_FTV                                          0x690
21580ea2c12SAlex Deucher #define CG_FFCT_0                                       0x694
21680ea2c12SAlex Deucher #       define UTC_0(x)                                 ((x) << 0)
21780ea2c12SAlex Deucher #       define UTC_0_MASK                               (0x3ff << 0)
21880ea2c12SAlex Deucher #       define UTC_0_SHIFT                              0
21980ea2c12SAlex Deucher #       define DTC_0(x)                                 ((x) << 10)
22080ea2c12SAlex Deucher #       define DTC_0_MASK                               (0x3ff << 10)
22180ea2c12SAlex Deucher #       define DTC_0_SHIFT                              10
22280ea2c12SAlex Deucher 
22380ea2c12SAlex Deucher #define CG_GIT                                          0x6d8
22480ea2c12SAlex Deucher #       define CG_GICST(x)                              ((x) << 0)
22580ea2c12SAlex Deucher #       define CG_GICST_MASK                            (0xffff << 0)
22680ea2c12SAlex Deucher #       define CG_GICST_SHIFT                           0
22780ea2c12SAlex Deucher #       define CG_GIPOT(x)                              ((x) << 16)
22880ea2c12SAlex Deucher #       define CG_GIPOT_MASK                            (0xffff << 16)
22980ea2c12SAlex Deucher #       define CG_GIPOT_SHIFT                           16
23080ea2c12SAlex Deucher 
23180ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL_3                              0x6e0
23280ea2c12SAlex Deucher #       define FORCE_SCLK_STATE(x)                      ((x) << 0)
23380ea2c12SAlex Deucher #       define FORCE_SCLK_STATE_MASK                    (0x7 << 0)
23480ea2c12SAlex Deucher #       define FORCE_SCLK_STATE_SHIFT                   0
23580ea2c12SAlex Deucher #       define FORCE_SCLK_STATE_EN                      (1 << 3)
23680ea2c12SAlex Deucher #       define GNB_TT(x)                                ((x) << 8)
23780ea2c12SAlex Deucher #       define GNB_TT_MASK                              (0xff << 8)
23880ea2c12SAlex Deucher #       define GNB_TT_SHIFT                             8
23980ea2c12SAlex Deucher #       define GNB_THERMTHRO_MASK                       (1 << 16)
24080ea2c12SAlex Deucher #       define CNB_THERMTHRO_MASK_SCLK                  (1 << 17)
24180ea2c12SAlex Deucher #       define DPM_SCLK_ENABLE                          (1 << 18)
24280ea2c12SAlex Deucher #       define GNB_SLOW_FSTATE_0_MASK                   (1 << 23)
24380ea2c12SAlex Deucher #       define GNB_SLOW_FSTATE_0_SHIFT                  23
24480ea2c12SAlex Deucher #       define FORCE_NB_PSTATE_1                        (1 << 31)
24580ea2c12SAlex Deucher 
24680ea2c12SAlex Deucher #define CG_SSP                                          0x6e8
24780ea2c12SAlex Deucher #       define SST(x)                                   ((x) << 0)
24880ea2c12SAlex Deucher #       define SST_MASK                                 (0xffff << 0)
24980ea2c12SAlex Deucher #       define SST_SHIFT                                0
25080ea2c12SAlex Deucher #       define SSTU(x)                                  ((x) << 16)
25180ea2c12SAlex Deucher #       define SSTU_MASK                                (0xffff << 16)
25280ea2c12SAlex Deucher #       define SSTU_SHIFT                               16
25380ea2c12SAlex Deucher 
25480ea2c12SAlex Deucher #define CG_ACPI_CNTL                                    0x70c
25580ea2c12SAlex Deucher #       define SCLK_ACPI_DIV(x)                         ((x) << 0)
25680ea2c12SAlex Deucher #       define SCLK_ACPI_DIV_MASK                       (0x7f << 0)
25780ea2c12SAlex Deucher #       define SCLK_ACPI_DIV_SHIFT                      0
25880ea2c12SAlex Deucher 
25980ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL_4                              0x71c
26080ea2c12SAlex Deucher #       define DC_HDC(x)                                ((x) << 14)
26180ea2c12SAlex Deucher #       define DC_HDC_MASK                              (0x3fff << 14)
26280ea2c12SAlex Deucher #       define DC_HDC_SHIFT                             14
26380ea2c12SAlex Deucher #       define DC_HU(x)                                 ((x) << 28)
26480ea2c12SAlex Deucher #       define DC_HU_MASK                               (0xf << 28)
26580ea2c12SAlex Deucher #       define DC_HU_SHIFT                              28
26680ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL_5                              0x720
26780ea2c12SAlex Deucher #       define SCLK_FSTATE_BOOTUP(x)                    ((x) << 0)
26880ea2c12SAlex Deucher #       define SCLK_FSTATE_BOOTUP_MASK                  (0x7 << 0)
26980ea2c12SAlex Deucher #       define SCLK_FSTATE_BOOTUP_SHIFT                 0
27080ea2c12SAlex Deucher #       define TT_TP(x)                                 ((x) << 3)
27180ea2c12SAlex Deucher #       define TT_TP_MASK                               (0xffff << 3)
27280ea2c12SAlex Deucher #       define TT_TP_SHIFT                              3
27380ea2c12SAlex Deucher #       define TT_TU(x)                                 ((x) << 19)
27480ea2c12SAlex Deucher #       define TT_TU_MASK                               (0xff << 19)
27580ea2c12SAlex Deucher #       define TT_TU_SHIFT                              19
27680ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL_6                              0x724
27780ea2c12SAlex Deucher #define CG_AT_0                                         0x728
27880ea2c12SAlex Deucher #       define CG_R(x)                                  ((x) << 0)
27980ea2c12SAlex Deucher #       define CG_R_MASK                                (0xffff << 0)
28080ea2c12SAlex Deucher #       define CG_R_SHIFT                               0
28180ea2c12SAlex Deucher #       define CG_L(x)                                  ((x) << 16)
28280ea2c12SAlex Deucher #       define CG_L_MASK                                (0xffff << 16)
28380ea2c12SAlex Deucher #       define CG_L_SHIFT                               16
28480ea2c12SAlex Deucher #define CG_AT_1                                         0x72c
28580ea2c12SAlex Deucher #define CG_AT_2                                         0x730
28680ea2c12SAlex Deucher #define	CG_THERMAL_INT					0x734
28780ea2c12SAlex Deucher #define		DIG_THERM_INTH(x)			((x) << 8)
28880ea2c12SAlex Deucher #define		DIG_THERM_INTH_MASK			0x0000FF00
28980ea2c12SAlex Deucher #define		DIG_THERM_INTH_SHIFT			8
29080ea2c12SAlex Deucher #define		DIG_THERM_INTL(x)			((x) << 16)
29180ea2c12SAlex Deucher #define		DIG_THERM_INTL_MASK			0x00FF0000
29280ea2c12SAlex Deucher #define		DIG_THERM_INTL_SHIFT			16
29380ea2c12SAlex Deucher #define 	THERM_INT_MASK_HIGH			(1 << 24)
29480ea2c12SAlex Deucher #define 	THERM_INT_MASK_LOW			(1 << 25)
29580ea2c12SAlex Deucher #define CG_AT_3                                         0x738
29680ea2c12SAlex Deucher #define CG_AT_4                                         0x73c
29780ea2c12SAlex Deucher #define CG_AT_5                                         0x740
29880ea2c12SAlex Deucher #define CG_AT_6                                         0x744
29980ea2c12SAlex Deucher #define CG_AT_7                                         0x748
30080ea2c12SAlex Deucher 
30180ea2c12SAlex Deucher #define CG_BSP_0                                        0x750
30280ea2c12SAlex Deucher #       define BSP(x)                                   ((x) << 0)
30380ea2c12SAlex Deucher #       define BSP_MASK                                 (0xffff << 0)
30480ea2c12SAlex Deucher #       define BSP_SHIFT                                0
30580ea2c12SAlex Deucher #       define BSU(x)                                   ((x) << 16)
30680ea2c12SAlex Deucher #       define BSU_MASK                                 (0xf << 16)
30780ea2c12SAlex Deucher #       define BSU_SHIFT                                16
30880ea2c12SAlex Deucher 
30980ea2c12SAlex Deucher #define CG_CG_VOLTAGE_CNTL                              0x770
31080ea2c12SAlex Deucher #       define REQ                                      (1 << 0)
31180ea2c12SAlex Deucher #       define LEVEL(x)                                 ((x) << 1)
31280ea2c12SAlex Deucher #       define LEVEL_MASK                               (0x3 << 1)
31380ea2c12SAlex Deucher #       define LEVEL_SHIFT                              1
31480ea2c12SAlex Deucher #       define CG_VOLTAGE_EN                            (1 << 3)
31580ea2c12SAlex Deucher #       define FORCE                                    (1 << 4)
31680ea2c12SAlex Deucher #       define PERIOD(x)                                ((x) << 8)
31780ea2c12SAlex Deucher #       define PERIOD_MASK                              (0xffff << 8)
31880ea2c12SAlex Deucher #       define PERIOD_SHIFT                             8
31980ea2c12SAlex Deucher #       define UNIT(x)                                  ((x) << 24)
32080ea2c12SAlex Deucher #       define UNIT_MASK                                (0xf << 24)
32180ea2c12SAlex Deucher #       define UNIT_SHIFT                               24
32280ea2c12SAlex Deucher 
32380ea2c12SAlex Deucher #define CG_ACPI_VOLTAGE_CNTL                            0x780
32480ea2c12SAlex Deucher #       define ACPI_VOLTAGE_EN                          (1 << 8)
32580ea2c12SAlex Deucher 
32680ea2c12SAlex Deucher #define CG_DPM_VOLTAGE_CNTL                             0x788
32780ea2c12SAlex Deucher #       define DPM_STATE0_LEVEL_MASK                    (0x3 << 0)
32880ea2c12SAlex Deucher #       define DPM_STATE0_LEVEL_SHIFT                   0
32980ea2c12SAlex Deucher #       define DPM_VOLTAGE_EN                           (1 << 16)
33080ea2c12SAlex Deucher 
33180ea2c12SAlex Deucher #define CG_PWR_GATING_CNTL                              0x7ac
33280ea2c12SAlex Deucher #       define DYN_PWR_DOWN_EN                          (1 << 0)
33380ea2c12SAlex Deucher #       define ACPI_PWR_DOWN_EN                         (1 << 1)
33480ea2c12SAlex Deucher #       define GFX_CLK_OFF_PWR_DOWN_EN                  (1 << 2)
33580ea2c12SAlex Deucher #       define IOC_DISGPU_PWR_DOWN_EN                   (1 << 3)
33680ea2c12SAlex Deucher #       define FORCE_POWR_ON                            (1 << 4)
33780ea2c12SAlex Deucher #       define PGP(x)                                   ((x) << 8)
33880ea2c12SAlex Deucher #       define PGP_MASK                                 (0xffff << 8)
33980ea2c12SAlex Deucher #       define PGP_SHIFT                                8
34080ea2c12SAlex Deucher #       define PGU(x)                                   ((x) << 24)
34180ea2c12SAlex Deucher #       define PGU_MASK                                 (0xf << 24)
34280ea2c12SAlex Deucher #       define PGU_SHIFT                                24
34380ea2c12SAlex Deucher 
34480ea2c12SAlex Deucher #define CG_CGTT_LOCAL_0                                 0x7d0
34580ea2c12SAlex Deucher #define CG_CGTT_LOCAL_1                                 0x7d4
34680ea2c12SAlex Deucher 
34780ea2c12SAlex Deucher #define DEEP_SLEEP_CNTL                                 0x818
34880ea2c12SAlex Deucher #       define R_DIS                                    (1 << 3)
34980ea2c12SAlex Deucher #       define HS(x)                                    ((x) << 4)
35080ea2c12SAlex Deucher #       define HS_MASK                                  (0xfff << 4)
35180ea2c12SAlex Deucher #       define HS_SHIFT                                 4
35280ea2c12SAlex Deucher #       define ENABLE_DS                                (1 << 31)
35380ea2c12SAlex Deucher #define DEEP_SLEEP_CNTL2                                0x81c
35480ea2c12SAlex Deucher #       define LB_UFP_EN                                (1 << 0)
35580ea2c12SAlex Deucher #       define INOUT_C(x)                               ((x) << 4)
35680ea2c12SAlex Deucher #       define INOUT_C_MASK                             (0xff << 4)
35780ea2c12SAlex Deucher #       define INOUT_C_SHIFT                            4
35880ea2c12SAlex Deucher 
35980ea2c12SAlex Deucher #define CG_SCRATCH2                                     0x824
36080ea2c12SAlex Deucher 
36180ea2c12SAlex Deucher #define CG_SCLK_DPM_CTRL_11                             0x830
36280ea2c12SAlex Deucher 
36380ea2c12SAlex Deucher #define HW_REV   					0x5564
36480ea2c12SAlex Deucher #       define ATI_REV_ID_MASK                          (0xf << 28)
36580ea2c12SAlex Deucher #       define ATI_REV_ID_SHIFT                         28
36680ea2c12SAlex Deucher /* 0 = A0, 1 = A1, 2 = B0, 3 = C0, etc. */
36780ea2c12SAlex Deucher 
36880ea2c12SAlex Deucher #define DOUT_SCRATCH3   				0x611c
36980ea2c12SAlex Deucher 
37080ea2c12SAlex Deucher #define GB_ADDR_CONFIG  				0x98f8
37180ea2c12SAlex Deucher 
37280ea2c12SAlex Deucher #endif
373