Home | History | Annotate | Line # | Download | only in radeon
      1  1.2  riastrad /*	$NetBSD: trinityd.h,v 1.3 2021/12/18 23:45:43 riastradh Exp $	*/
      2  1.2  riastrad 
      3  1.1  riastrad /*
      4  1.1  riastrad  * Copyright 2012 Advanced Micro Devices, Inc.
      5  1.1  riastrad  *
      6  1.1  riastrad  * Permission is hereby granted, free of charge, to any person obtaining a
      7  1.1  riastrad  * copy of this software and associated documentation files (the "Software"),
      8  1.1  riastrad  * to deal in the Software without restriction, including without limitation
      9  1.1  riastrad  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     10  1.1  riastrad  * and/or sell copies of the Software, and to permit persons to whom the
     11  1.1  riastrad  * Software is furnished to do so, subject to the following conditions:
     12  1.1  riastrad  *
     13  1.1  riastrad  * The above copyright notice and this permission notice shall be included in
     14  1.1  riastrad  * all copies or substantial portions of the Software.
     15  1.1  riastrad  *
     16  1.1  riastrad  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  1.1  riastrad  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  1.1  riastrad  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     19  1.1  riastrad  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
     20  1.1  riastrad  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     21  1.1  riastrad  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     22  1.1  riastrad  * OTHER DEALINGS IN THE SOFTWARE.
     23  1.1  riastrad  *
     24  1.1  riastrad  * Authors: Alex Deucher
     25  1.1  riastrad  */
     26  1.1  riastrad #ifndef _TRINITYD_H_
     27  1.1  riastrad #define _TRINITYD_H_
     28  1.1  riastrad 
     29  1.1  riastrad /* pm registers */
     30  1.1  riastrad 
     31  1.1  riastrad /* cg */
     32  1.1  riastrad #define CG_CGTT_LOCAL_0                                 0x0
     33  1.1  riastrad #define CG_CGTT_LOCAL_1                                 0x1
     34  1.1  riastrad 
     35  1.1  riastrad /* smc */
     36  1.1  riastrad #define SMU_SCLK_DPM_STATE_0_CNTL_0                     0x1f000
     37  1.1  riastrad #       define STATE_VALID(x)                           ((x) << 0)
     38  1.1  riastrad #       define STATE_VALID_MASK                         (0xff << 0)
     39  1.1  riastrad #       define STATE_VALID_SHIFT                        0
     40  1.1  riastrad #       define CLK_DIVIDER(x)                           ((x) << 8)
     41  1.1  riastrad #       define CLK_DIVIDER_MASK                         (0xff << 8)
     42  1.1  riastrad #       define CLK_DIVIDER_SHIFT                        8
     43  1.1  riastrad #       define VID(x)                                   ((x) << 16)
     44  1.1  riastrad #       define VID_MASK                                 (0xff << 16)
     45  1.1  riastrad #       define VID_SHIFT                                16
     46  1.1  riastrad #       define LVRT(x)                                  ((x) << 24)
     47  1.1  riastrad #       define LVRT_MASK                                (0xff << 24)
     48  1.1  riastrad #       define LVRT_SHIFT                               24
     49  1.1  riastrad #define SMU_SCLK_DPM_STATE_0_CNTL_1                     0x1f004
     50  1.1  riastrad #       define DS_DIV(x)                                ((x) << 0)
     51  1.1  riastrad #       define DS_DIV_MASK                              (0xff << 0)
     52  1.1  riastrad #       define DS_DIV_SHIFT                             0
     53  1.1  riastrad #       define DS_SH_DIV(x)                             ((x) << 8)
     54  1.1  riastrad #       define DS_SH_DIV_MASK                           (0xff << 8)
     55  1.1  riastrad #       define DS_SH_DIV_SHIFT                          8
     56  1.1  riastrad #       define DISPLAY_WM(x)                            ((x) << 16)
     57  1.1  riastrad #       define DISPLAY_WM_MASK                          (0xff << 16)
     58  1.1  riastrad #       define DISPLAY_WM_SHIFT                         16
     59  1.1  riastrad #       define VCE_WM(x)                                ((x) << 24)
     60  1.1  riastrad #       define VCE_WM_MASK                              (0xff << 24)
     61  1.1  riastrad #       define VCE_WM_SHIFT                             24
     62  1.1  riastrad 
     63  1.1  riastrad #define SMU_SCLK_DPM_STATE_0_CNTL_3                     0x1f00c
     64  1.1  riastrad #       define GNB_SLOW(x)                              ((x) << 0)
     65  1.1  riastrad #       define GNB_SLOW_MASK                            (0xff << 0)
     66  1.1  riastrad #       define GNB_SLOW_SHIFT                           0
     67  1.1  riastrad #       define FORCE_NBPS1(x)                           ((x) << 8)
     68  1.1  riastrad #       define FORCE_NBPS1_MASK                         (0xff << 8)
     69  1.1  riastrad #       define FORCE_NBPS1_SHIFT                        8
     70  1.1  riastrad #define SMU_SCLK_DPM_STATE_0_AT                         0x1f010
     71  1.1  riastrad #       define AT(x)                                    ((x) << 0)
     72  1.1  riastrad #       define AT_MASK                                  (0xff << 0)
     73  1.1  riastrad #       define AT_SHIFT                                 0
     74  1.1  riastrad 
     75  1.1  riastrad #define SMU_SCLK_DPM_STATE_0_PG_CNTL                    0x1f014
     76  1.1  riastrad #       define PD_SCLK_DIVIDER(x)                       ((x) << 16)
     77  1.1  riastrad #       define PD_SCLK_DIVIDER_MASK                     (0xff << 16)
     78  1.1  riastrad #       define PD_SCLK_DIVIDER_SHIFT                    16
     79  1.1  riastrad 
     80  1.1  riastrad #define SMU_SCLK_DPM_STATE_1_CNTL_0                     0x1f020
     81  1.1  riastrad 
     82  1.1  riastrad #define SMU_SCLK_DPM_CNTL                               0x1f100
     83  1.1  riastrad #       define SCLK_DPM_EN(x)                           ((x) << 0)
     84  1.1  riastrad #       define SCLK_DPM_EN_MASK                         (0xff << 0)
     85  1.1  riastrad #       define SCLK_DPM_EN_SHIFT                        0
     86  1.1  riastrad #       define SCLK_DPM_BOOT_STATE(x)                   ((x) << 16)
     87  1.1  riastrad #       define SCLK_DPM_BOOT_STATE_MASK                 (0xff << 16)
     88  1.1  riastrad #       define SCLK_DPM_BOOT_STATE_SHIFT                16
     89  1.1  riastrad #       define VOLTAGE_CHG_EN(x)                        ((x) << 24)
     90  1.1  riastrad #       define VOLTAGE_CHG_EN_MASK                      (0xff << 24)
     91  1.1  riastrad #       define VOLTAGE_CHG_EN_SHIFT                     24
     92  1.1  riastrad 
     93  1.1  riastrad #define SMU_SCLK_DPM_TT_CNTL                            0x1f108
     94  1.1  riastrad #       define SCLK_TT_EN(x)                            ((x) << 0)
     95  1.1  riastrad #       define SCLK_TT_EN_MASK                          (0xff << 0)
     96  1.1  riastrad #       define SCLK_TT_EN_SHIFT                         0
     97  1.1  riastrad #define SMU_SCLK_DPM_TTT                                0x1f10c
     98  1.1  riastrad #       define LT(x)                                    ((x) << 0)
     99  1.1  riastrad #       define LT_MASK                                  (0xffff << 0)
    100  1.1  riastrad #       define LT_SHIFT                                 0
    101  1.1  riastrad #       define HT(x)                                    ((x) << 16)
    102  1.1  riastrad #       define HT_MASK                                  (0xffff << 16)
    103  1.1  riastrad #       define HT_SHIFT                                 16
    104  1.1  riastrad 
    105  1.1  riastrad #define SMU_UVD_DPM_STATES                              0x1f1a0
    106  1.1  riastrad #define SMU_UVD_DPM_CNTL                                0x1f1a4
    107  1.1  riastrad 
    108  1.1  riastrad #define SMU_S_PG_CNTL                                   0x1f118
    109  1.1  riastrad #       define DS_PG_EN(x)                              ((x) << 16)
    110  1.1  riastrad #       define DS_PG_EN_MASK                            (0xff << 16)
    111  1.1  riastrad #       define DS_PG_EN_SHIFT                           16
    112  1.1  riastrad 
    113  1.1  riastrad #define GFX_POWER_GATING_CNTL                           0x1f38c
    114  1.1  riastrad #       define PDS_DIV(x)                               ((x) << 0)
    115  1.1  riastrad #       define PDS_DIV_MASK                             (0xff << 0)
    116  1.1  riastrad #       define PDS_DIV_SHIFT                            0
    117  1.1  riastrad #       define SSSD(x)                                  ((x) << 8)
    118  1.1  riastrad #       define SSSD_MASK                                (0xff << 8)
    119  1.1  riastrad #       define SSSD_SHIFT                               8
    120  1.1  riastrad 
    121  1.1  riastrad #define PM_CONFIG                                       0x1f428
    122  1.1  riastrad #       define SVI_Mode                                 (1 << 29)
    123  1.1  riastrad 
    124  1.1  riastrad #define PM_I_CNTL_1                                     0x1f464
    125  1.1  riastrad #       define SCLK_DPM(x)                              ((x) << 0)
    126  1.1  riastrad #       define SCLK_DPM_MASK                            (0xff << 0)
    127  1.1  riastrad #       define SCLK_DPM_SHIFT                           0
    128  1.1  riastrad #       define DS_PG_CNTL(x)                            ((x) << 16)
    129  1.1  riastrad #       define DS_PG_CNTL_MASK                          (0xff << 16)
    130  1.1  riastrad #       define DS_PG_CNTL_SHIFT                         16
    131  1.1  riastrad #define PM_TP                                           0x1f468
    132  1.1  riastrad 
    133  1.1  riastrad #define NB_PSTATE_CONFIG                                0x1f5f8
    134  1.1  riastrad #       define Dpm0PgNbPsLo(x)                          ((x) << 0)
    135  1.1  riastrad #       define Dpm0PgNbPsLo_MASK                        (3 << 0)
    136  1.1  riastrad #       define Dpm0PgNbPsLo_SHIFT                       0
    137  1.1  riastrad #       define Dpm0PgNbPsHi(x)                          ((x) << 2)
    138  1.1  riastrad #       define Dpm0PgNbPsHi_MASK                        (3 << 2)
    139  1.1  riastrad #       define Dpm0PgNbPsHi_SHIFT                       2
    140  1.1  riastrad #       define DpmXNbPsLo(x)                            ((x) << 4)
    141  1.1  riastrad #       define DpmXNbPsLo_MASK                          (3 << 4)
    142  1.1  riastrad #       define DpmXNbPsLo_SHIFT                         4
    143  1.1  riastrad #       define DpmXNbPsHi(x)                            ((x) << 6)
    144  1.1  riastrad #       define DpmXNbPsHi_MASK                          (3 << 6)
    145  1.1  riastrad #       define DpmXNbPsHi_SHIFT                         6
    146  1.1  riastrad 
    147  1.1  riastrad #define DC_CAC_VALUE                                    0x1f908
    148  1.1  riastrad 
    149  1.1  riastrad #define GPU_CAC_AVRG_CNTL                               0x1f920
    150  1.1  riastrad #       define WINDOW_SIZE(x)                           ((x) << 0)
    151  1.1  riastrad #       define WINDOW_SIZE_MASK                         (0xff << 0)
    152  1.1  riastrad #       define WINDOW_SIZE_SHIFT                        0
    153  1.1  riastrad 
    154  1.1  riastrad #define CC_SMU_MISC_FUSES                               0xe0001004
    155  1.1  riastrad #       define MinSClkDid(x)                   ((x) << 2)
    156  1.1  riastrad #       define MinSClkDid_MASK                 (0x7f << 2)
    157  1.1  riastrad #       define MinSClkDid_SHIFT                2
    158  1.1  riastrad 
    159  1.1  riastrad #define CC_SMU_TST_EFUSE1_MISC                          0xe000101c
    160  1.1  riastrad #       define RB_BACKEND_DISABLE(x)                    ((x) << 16)
    161  1.1  riastrad #       define RB_BACKEND_DISABLE_MASK                  (3 << 16)
    162  1.1  riastrad #       define RB_BACKEND_DISABLE_SHIFT                 16
    163  1.1  riastrad 
    164  1.1  riastrad #define SMU_SCRATCH_A                                   0xe0003024
    165  1.1  riastrad 
    166  1.1  riastrad #define SMU_SCRATCH0                                    0xe0003040
    167  1.1  riastrad 
    168  1.1  riastrad /* mmio */
    169  1.1  riastrad #define SMC_INT_REQ                                     0x220
    170  1.1  riastrad 
    171  1.1  riastrad #define SMC_MESSAGE_0                                   0x22c
    172  1.1  riastrad #define SMC_RESP_0                                      0x230
    173  1.1  riastrad 
    174  1.1  riastrad #define GENERAL_PWRMGT                                  0x670
    175  1.1  riastrad #       define GLOBAL_PWRMGT_EN                         (1 << 0)
    176  1.1  riastrad 
    177  1.1  riastrad #define SCLK_PWRMGT_CNTL                                0x678
    178  1.1  riastrad #       define DYN_PWR_DOWN_EN                          (1 << 2)
    179  1.1  riastrad #       define RESET_BUSY_CNT                           (1 << 4)
    180  1.1  riastrad #       define RESET_SCLK_CNT                           (1 << 5)
    181  1.1  riastrad #       define DYN_GFX_CLK_OFF_EN                       (1 << 7)
    182  1.1  riastrad #       define GFX_CLK_FORCE_ON                         (1 << 8)
    183  1.1  riastrad #       define DYNAMIC_PM_EN                            (1 << 21)
    184  1.1  riastrad 
    185  1.1  riastrad #define TARGET_AND_CURRENT_PROFILE_INDEX                0x684
    186  1.1  riastrad #       define TARGET_STATE(x)                          ((x) << 0)
    187  1.1  riastrad #       define TARGET_STATE_MASK                        (0xf << 0)
    188  1.1  riastrad #       define TARGET_STATE_SHIFT                       0
    189  1.1  riastrad #       define CURRENT_STATE(x)                         ((x) << 4)
    190  1.1  riastrad #       define CURRENT_STATE_MASK                       (0xf << 4)
    191  1.1  riastrad #       define CURRENT_STATE_SHIFT                      4
    192  1.1  riastrad 
    193  1.1  riastrad #define CG_GIPOTS                                       0x6d8
    194  1.1  riastrad #       define CG_GIPOT(x)                              ((x) << 16)
    195  1.1  riastrad #       define CG_GIPOT_MASK                            (0xffff << 16)
    196  1.1  riastrad #       define CG_GIPOT_SHIFT                           16
    197  1.1  riastrad 
    198  1.1  riastrad #define CG_PG_CTRL                                      0x6e0
    199  1.1  riastrad #       define SP(x)                                    ((x) << 0)
    200  1.1  riastrad #       define SP_MASK                                  (0xffff << 0)
    201  1.1  riastrad #       define SP_SHIFT                                 0
    202  1.1  riastrad #       define SU(x)                                    ((x) << 16)
    203  1.1  riastrad #       define SU_MASK                                  (0xffff << 16)
    204  1.1  riastrad #       define SU_SHIFT                                 16
    205  1.1  riastrad 
    206  1.1  riastrad #define CG_MISC_REG                                     0x708
    207  1.1  riastrad 
    208  1.1  riastrad #define CG_THERMAL_INT_CTRL                             0x738
    209  1.1  riastrad #       define DIG_THERM_INTH(x)                        ((x) << 0)
    210  1.1  riastrad #       define DIG_THERM_INTH_MASK                      (0xff << 0)
    211  1.1  riastrad #       define DIG_THERM_INTH_SHIFT                     0
    212  1.1  riastrad #       define DIG_THERM_INTL(x)                        ((x) << 8)
    213  1.1  riastrad #       define DIG_THERM_INTL_MASK                      (0xff << 8)
    214  1.1  riastrad #       define DIG_THERM_INTL_SHIFT                     8
    215  1.1  riastrad #       define THERM_INTH_MASK                          (1 << 24)
    216  1.1  riastrad #       define THERM_INTL_MASK                          (1 << 25)
    217  1.1  riastrad 
    218  1.1  riastrad #define CG_CG_VOLTAGE_CNTL                              0x770
    219  1.1  riastrad #       define EN                                       (1 << 9)
    220  1.1  riastrad 
    221  1.1  riastrad #define HW_REV   					0x5564
    222  1.1  riastrad #       define ATI_REV_ID_MASK                          (0xf << 28)
    223  1.1  riastrad #       define ATI_REV_ID_SHIFT                         28
    224  1.1  riastrad /* 0 = A0, 1 = A1, 2 = B0, 3 = C0, etc. */
    225  1.1  riastrad 
    226  1.1  riastrad #define CGTS_SM_CTRL_REG                                0x9150
    227  1.1  riastrad 
    228  1.1  riastrad #define GB_ADDR_CONFIG                                  0x98f8
    229  1.1  riastrad 
    230  1.1  riastrad #endif
    231