Home | History | Annotate | Line # | Download | only in radeon
      1  1.2  riastrad /*	$NetBSD: btcd.h,v 1.3 2021/12/18 23:45:42 riastradh Exp $	*/
      2  1.2  riastrad 
      3  1.1  riastrad /*
      4  1.1  riastrad  * Copyright 2010 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 _BTCD_H_
     27  1.1  riastrad #define _BTCD_H_
     28  1.1  riastrad 
     29  1.1  riastrad /* pm registers */
     30  1.1  riastrad 
     31  1.1  riastrad #define GENERAL_PWRMGT                                  0x63c
     32  1.1  riastrad #       define GLOBAL_PWRMGT_EN                         (1 << 0)
     33  1.1  riastrad #       define STATIC_PM_EN                             (1 << 1)
     34  1.1  riastrad #       define THERMAL_PROTECTION_DIS                   (1 << 2)
     35  1.1  riastrad #       define THERMAL_PROTECTION_TYPE                  (1 << 3)
     36  1.1  riastrad #       define ENABLE_GEN2PCIE                          (1 << 4)
     37  1.1  riastrad #       define ENABLE_GEN2XSP                           (1 << 5)
     38  1.1  riastrad #       define SW_SMIO_INDEX(x)                         ((x) << 6)
     39  1.1  riastrad #       define SW_SMIO_INDEX_MASK                       (3 << 6)
     40  1.1  riastrad #       define SW_SMIO_INDEX_SHIFT                      6
     41  1.1  riastrad #       define LOW_VOLT_D2_ACPI                         (1 << 8)
     42  1.1  riastrad #       define LOW_VOLT_D3_ACPI                         (1 << 9)
     43  1.1  riastrad #       define VOLT_PWRMGT_EN                           (1 << 10)
     44  1.1  riastrad #       define BACKBIAS_PAD_EN                          (1 << 18)
     45  1.1  riastrad #       define BACKBIAS_VALUE                           (1 << 19)
     46  1.1  riastrad #       define DYN_SPREAD_SPECTRUM_EN                   (1 << 23)
     47  1.1  riastrad #       define AC_DC_SW                                 (1 << 24)
     48  1.1  riastrad 
     49  1.1  riastrad #define TARGET_AND_CURRENT_PROFILE_INDEX                  0x66c
     50  1.1  riastrad #       define CURRENT_PROFILE_INDEX_MASK                 (0xf << 4)
     51  1.1  riastrad #       define CURRENT_PROFILE_INDEX_SHIFT                4
     52  1.1  riastrad 
     53  1.1  riastrad #define	CG_BIF_REQ_AND_RSP				0x7f4
     54  1.1  riastrad #define		CG_CLIENT_REQ(x)			((x) << 0)
     55  1.1  riastrad #define		CG_CLIENT_REQ_MASK			(0xff << 0)
     56  1.1  riastrad #define		CG_CLIENT_REQ_SHIFT			0
     57  1.1  riastrad #define		CG_CLIENT_RESP(x)			((x) << 8)
     58  1.1  riastrad #define		CG_CLIENT_RESP_MASK			(0xff << 8)
     59  1.1  riastrad #define		CG_CLIENT_RESP_SHIFT			8
     60  1.1  riastrad #define		CLIENT_CG_REQ(x)			((x) << 16)
     61  1.1  riastrad #define		CLIENT_CG_REQ_MASK			(0xff << 16)
     62  1.1  riastrad #define		CLIENT_CG_REQ_SHIFT			16
     63  1.1  riastrad #define		CLIENT_CG_RESP(x)			((x) << 24)
     64  1.1  riastrad #define		CLIENT_CG_RESP_MASK			(0xff << 24)
     65  1.1  riastrad #define		CLIENT_CG_RESP_SHIFT			24
     66  1.1  riastrad 
     67  1.1  riastrad #define	SCLK_PSKIP_CNTL					0x8c0
     68  1.1  riastrad #define		PSKIP_ON_ALLOW_STOP_HI(x)		((x) << 16)
     69  1.1  riastrad #define		PSKIP_ON_ALLOW_STOP_HI_MASK		(0xff << 16)
     70  1.1  riastrad #define		PSKIP_ON_ALLOW_STOP_HI_SHIFT		16
     71  1.1  riastrad 
     72  1.1  riastrad #define	CG_ULV_CONTROL					0x8c8
     73  1.1  riastrad #define	CG_ULV_PARAMETER				0x8cc
     74  1.1  riastrad 
     75  1.1  riastrad #define	MC_ARB_DRAM_TIMING				0x2774
     76  1.1  riastrad #define	MC_ARB_DRAM_TIMING2				0x2778
     77  1.1  riastrad 
     78  1.1  riastrad #define	MC_ARB_RFSH_RATE				0x27b0
     79  1.1  riastrad #define		POWERMODE0(x)				((x) << 0)
     80  1.1  riastrad #define		POWERMODE0_MASK				(0xff << 0)
     81  1.1  riastrad #define		POWERMODE0_SHIFT			0
     82  1.1  riastrad #define		POWERMODE1(x)				((x) << 8)
     83  1.1  riastrad #define		POWERMODE1_MASK				(0xff << 8)
     84  1.1  riastrad #define		POWERMODE1_SHIFT			8
     85  1.1  riastrad #define		POWERMODE2(x)				((x) << 16)
     86  1.1  riastrad #define		POWERMODE2_MASK				(0xff << 16)
     87  1.1  riastrad #define		POWERMODE2_SHIFT			16
     88  1.1  riastrad #define		POWERMODE3(x)				((x) << 24)
     89  1.1  riastrad #define		POWERMODE3_MASK				(0xff << 24)
     90  1.1  riastrad #define		POWERMODE3_SHIFT			24
     91  1.1  riastrad 
     92  1.1  riastrad #define MC_ARB_BURST_TIME                               0x2808
     93  1.1  riastrad #define		STATE0(x)				((x) << 0)
     94  1.1  riastrad #define		STATE0_MASK				(0x1f << 0)
     95  1.1  riastrad #define		STATE0_SHIFT				0
     96  1.1  riastrad #define		STATE1(x)				((x) << 5)
     97  1.1  riastrad #define		STATE1_MASK				(0x1f << 5)
     98  1.1  riastrad #define		STATE1_SHIFT				5
     99  1.1  riastrad #define		STATE2(x)				((x) << 10)
    100  1.1  riastrad #define		STATE2_MASK				(0x1f << 10)
    101  1.1  riastrad #define		STATE2_SHIFT				10
    102  1.1  riastrad #define		STATE3(x)				((x) << 15)
    103  1.1  riastrad #define		STATE3_MASK				(0x1f << 15)
    104  1.1  riastrad #define		STATE3_SHIFT				15
    105  1.1  riastrad 
    106  1.1  riastrad #define MC_SEQ_RAS_TIMING                               0x28a0
    107  1.1  riastrad #define MC_SEQ_CAS_TIMING                               0x28a4
    108  1.1  riastrad #define MC_SEQ_MISC_TIMING                              0x28a8
    109  1.1  riastrad #define MC_SEQ_MISC_TIMING2                             0x28ac
    110  1.1  riastrad 
    111  1.1  riastrad #define MC_SEQ_RD_CTL_D0                                0x28b4
    112  1.1  riastrad #define MC_SEQ_RD_CTL_D1                                0x28b8
    113  1.1  riastrad #define MC_SEQ_WR_CTL_D0                                0x28bc
    114  1.1  riastrad #define MC_SEQ_WR_CTL_D1                                0x28c0
    115  1.1  riastrad 
    116  1.1  riastrad #define MC_PMG_AUTO_CFG                                 0x28d4
    117  1.1  riastrad 
    118  1.1  riastrad #define MC_SEQ_STATUS_M                                 0x29f4
    119  1.1  riastrad #       define PMG_PWRSTATE                             (1 << 16)
    120  1.1  riastrad 
    121  1.1  riastrad #define MC_SEQ_MISC0                                    0x2a00
    122  1.1  riastrad #define         MC_SEQ_MISC0_GDDR5_SHIFT                28
    123  1.1  riastrad #define         MC_SEQ_MISC0_GDDR5_MASK                 0xf0000000
    124  1.1  riastrad #define         MC_SEQ_MISC0_GDDR5_VALUE                5
    125  1.1  riastrad #define MC_SEQ_MISC1                                    0x2a04
    126  1.1  riastrad #define MC_SEQ_RESERVE_M                                0x2a08
    127  1.1  riastrad #define MC_PMG_CMD_EMRS                                 0x2a0c
    128  1.1  riastrad 
    129  1.1  riastrad #define MC_SEQ_MISC3                                    0x2a2c
    130  1.1  riastrad 
    131  1.1  riastrad #define MC_SEQ_MISC5                                    0x2a54
    132  1.1  riastrad #define MC_SEQ_MISC6                                    0x2a58
    133  1.1  riastrad 
    134  1.1  riastrad #define MC_SEQ_MISC7                                    0x2a64
    135  1.1  riastrad 
    136  1.1  riastrad #define MC_SEQ_CG                                       0x2a68
    137  1.1  riastrad #define		CG_SEQ_REQ(x)				((x) << 0)
    138  1.1  riastrad #define		CG_SEQ_REQ_MASK				(0xff << 0)
    139  1.1  riastrad #define		CG_SEQ_REQ_SHIFT			0
    140  1.1  riastrad #define		CG_SEQ_RESP(x)				((x) << 8)
    141  1.1  riastrad #define		CG_SEQ_RESP_MASK			(0xff << 8)
    142  1.1  riastrad #define		CG_SEQ_RESP_SHIFT			8
    143  1.1  riastrad #define		SEQ_CG_REQ(x)				((x) << 16)
    144  1.1  riastrad #define		SEQ_CG_REQ_MASK				(0xff << 16)
    145  1.1  riastrad #define		SEQ_CG_REQ_SHIFT			16
    146  1.1  riastrad #define		SEQ_CG_RESP(x)				((x) << 24)
    147  1.1  riastrad #define		SEQ_CG_RESP_MASK			(0xff << 24)
    148  1.1  riastrad #define		SEQ_CG_RESP_SHIFT			24
    149  1.1  riastrad #define MC_SEQ_RAS_TIMING_LP                            0x2a6c
    150  1.1  riastrad #define MC_SEQ_CAS_TIMING_LP                            0x2a70
    151  1.1  riastrad #define MC_SEQ_MISC_TIMING_LP                           0x2a74
    152  1.1  riastrad #define MC_SEQ_MISC_TIMING2_LP                          0x2a78
    153  1.1  riastrad #define MC_SEQ_WR_CTL_D0_LP                             0x2a7c
    154  1.1  riastrad #define MC_SEQ_WR_CTL_D1_LP                             0x2a80
    155  1.1  riastrad #define MC_SEQ_PMG_CMD_EMRS_LP                          0x2a84
    156  1.1  riastrad #define MC_SEQ_PMG_CMD_MRS_LP                           0x2a88
    157  1.1  riastrad 
    158  1.1  riastrad #define MC_PMG_CMD_MRS                                  0x2aac
    159  1.1  riastrad 
    160  1.1  riastrad #define MC_SEQ_RD_CTL_D0_LP                             0x2b1c
    161  1.1  riastrad #define MC_SEQ_RD_CTL_D1_LP                             0x2b20
    162  1.1  riastrad 
    163  1.1  riastrad #define MC_PMG_CMD_MRS1                                 0x2b44
    164  1.1  riastrad #define MC_SEQ_PMG_CMD_MRS1_LP                          0x2b48
    165  1.1  riastrad 
    166  1.1  riastrad #define	LB_SYNC_RESET_SEL				0x6b28
    167  1.1  riastrad #define		LB_SYNC_RESET_SEL_MASK			(3 << 0)
    168  1.1  riastrad #define		LB_SYNC_RESET_SEL_SHIFT			0
    169  1.1  riastrad 
    170  1.1  riastrad /* PCIE link stuff */
    171  1.1  riastrad #define PCIE_LC_SPEED_CNTL                                0xa4 /* PCIE_P */
    172  1.1  riastrad #       define LC_GEN2_EN_STRAP                           (1 << 0)
    173  1.1  riastrad #       define LC_TARGET_LINK_SPEED_OVERRIDE_EN           (1 << 1)
    174  1.1  riastrad #       define LC_FORCE_EN_HW_SPEED_CHANGE                (1 << 5)
    175  1.1  riastrad #       define LC_FORCE_DIS_HW_SPEED_CHANGE               (1 << 6)
    176  1.1  riastrad #       define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_MASK      (0x3 << 8)
    177  1.1  riastrad #       define LC_SPEED_CHANGE_ATTEMPTS_ALLOWED_SHIFT     3
    178  1.1  riastrad #       define LC_CURRENT_DATA_RATE                       (1 << 11)
    179  1.1  riastrad #       define LC_HW_VOLTAGE_IF_CONTROL(x)                ((x) << 12)
    180  1.1  riastrad #       define LC_HW_VOLTAGE_IF_CONTROL_MASK              (3 << 12)
    181  1.1  riastrad #       define LC_HW_VOLTAGE_IF_CONTROL_SHIFT             12
    182  1.1  riastrad #       define LC_VOLTAGE_TIMER_SEL_MASK                  (0xf << 14)
    183  1.1  riastrad #       define LC_CLR_FAILED_SPD_CHANGE_CNT               (1 << 21)
    184  1.1  riastrad #       define LC_OTHER_SIDE_EVER_SENT_GEN2               (1 << 23)
    185  1.1  riastrad #       define LC_OTHER_SIDE_SUPPORTS_GEN2                (1 << 24)
    186  1.1  riastrad 
    187  1.1  riastrad #endif
    188