Home | History | Annotate | Line # | Download | only in inc
      1  1.1  riastrad /*	$NetBSD: smu9.h,v 1.2 2021/12/18 23:45:26 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad /*
      4  1.1  riastrad  * Copyright 2016 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  */
     25  1.1  riastrad 
     26  1.1  riastrad #ifndef SMU9_H
     27  1.1  riastrad #define SMU9_H
     28  1.1  riastrad 
     29  1.1  riastrad #pragma pack(push, 1)
     30  1.1  riastrad 
     31  1.1  riastrad #define ENABLE_DEBUG_FEATURES
     32  1.1  riastrad 
     33  1.1  riastrad /* Feature Control Defines */
     34  1.1  riastrad #define FEATURE_DPM_PREFETCHER_BIT      0
     35  1.1  riastrad #define FEATURE_DPM_GFXCLK_BIT          1
     36  1.1  riastrad #define FEATURE_DPM_UCLK_BIT            2
     37  1.1  riastrad #define FEATURE_DPM_SOCCLK_BIT          3
     38  1.1  riastrad #define FEATURE_DPM_UVD_BIT             4
     39  1.1  riastrad #define FEATURE_DPM_VCE_BIT             5
     40  1.1  riastrad #define FEATURE_ULV_BIT                 6
     41  1.1  riastrad #define FEATURE_DPM_MP0CLK_BIT          7
     42  1.1  riastrad #define FEATURE_DPM_LINK_BIT            8
     43  1.1  riastrad #define FEATURE_DPM_DCEFCLK_BIT         9
     44  1.1  riastrad #define FEATURE_AVFS_BIT                10
     45  1.1  riastrad #define FEATURE_DS_GFXCLK_BIT           11
     46  1.1  riastrad #define FEATURE_DS_SOCCLK_BIT           12
     47  1.1  riastrad #define FEATURE_DS_LCLK_BIT             13
     48  1.1  riastrad #define FEATURE_PPT_BIT                 14
     49  1.1  riastrad #define FEATURE_TDC_BIT                 15
     50  1.1  riastrad #define FEATURE_THERMAL_BIT             16
     51  1.1  riastrad #define FEATURE_GFX_PER_CU_CG_BIT       17
     52  1.1  riastrad #define FEATURE_RM_BIT                  18
     53  1.1  riastrad #define FEATURE_DS_DCEFCLK_BIT          19
     54  1.1  riastrad #define FEATURE_ACDC_BIT                20
     55  1.1  riastrad #define FEATURE_VR0HOT_BIT              21
     56  1.1  riastrad #define FEATURE_VR1HOT_BIT              22
     57  1.1  riastrad #define FEATURE_FW_CTF_BIT              23
     58  1.1  riastrad #define FEATURE_LED_DISPLAY_BIT         24
     59  1.1  riastrad #define FEATURE_FAN_CONTROL_BIT         25
     60  1.1  riastrad #define FEATURE_FAST_PPT_BIT            26
     61  1.1  riastrad #define FEATURE_GFX_EDC_BIT             27
     62  1.1  riastrad #define FEATURE_ACG_BIT                 28
     63  1.1  riastrad #define FEATURE_PCC_LIMIT_CONTROL_BIT   29
     64  1.1  riastrad #define FEATURE_SPARE_30_BIT            30
     65  1.1  riastrad #define FEATURE_SPARE_31_BIT            31
     66  1.1  riastrad 
     67  1.1  riastrad #define NUM_FEATURES                    32
     68  1.1  riastrad 
     69  1.1  riastrad #define FFEATURE_DPM_PREFETCHER_MASK     (1 << FEATURE_DPM_PREFETCHER_BIT     )
     70  1.1  riastrad #define FFEATURE_DPM_GFXCLK_MASK         (1 << FEATURE_DPM_GFXCLK_BIT         )
     71  1.1  riastrad #define FFEATURE_DPM_UCLK_MASK           (1 << FEATURE_DPM_UCLK_BIT           )
     72  1.1  riastrad #define FFEATURE_DPM_SOCCLK_MASK         (1 << FEATURE_DPM_SOCCLK_BIT         )
     73  1.1  riastrad #define FFEATURE_DPM_UVD_MASK            (1 << FEATURE_DPM_UVD_BIT            )
     74  1.1  riastrad #define FFEATURE_DPM_VCE_MASK            (1 << FEATURE_DPM_VCE_BIT            )
     75  1.1  riastrad #define FFEATURE_ULV_MASK                (1 << FEATURE_ULV_BIT                )
     76  1.1  riastrad #define FFEATURE_DPM_MP0CLK_MASK         (1 << FEATURE_DPM_MP0CLK_BIT         )
     77  1.1  riastrad #define FFEATURE_DPM_LINK_MASK           (1 << FEATURE_DPM_LINK_BIT           )
     78  1.1  riastrad #define FFEATURE_DPM_DCEFCLK_MASK        (1 << FEATURE_DPM_DCEFCLK_BIT        )
     79  1.1  riastrad #define FFEATURE_AVFS_MASK               (1 << FEATURE_AVFS_BIT               )
     80  1.1  riastrad #define FFEATURE_DS_GFXCLK_MASK          (1 << FEATURE_DS_GFXCLK_BIT          )
     81  1.1  riastrad #define FFEATURE_DS_SOCCLK_MASK          (1 << FEATURE_DS_SOCCLK_BIT          )
     82  1.1  riastrad #define FFEATURE_DS_LCLK_MASK            (1 << FEATURE_DS_LCLK_BIT            )
     83  1.1  riastrad #define FFEATURE_PPT_MASK                (1 << FEATURE_PPT_BIT                )
     84  1.1  riastrad #define FFEATURE_TDC_MASK                (1 << FEATURE_TDC_BIT                )
     85  1.1  riastrad #define FFEATURE_THERMAL_MASK            (1 << FEATURE_THERMAL_BIT            )
     86  1.1  riastrad #define FFEATURE_GFX_PER_CU_CG_MASK      (1 << FEATURE_GFX_PER_CU_CG_BIT      )
     87  1.1  riastrad #define FFEATURE_RM_MASK                 (1 << FEATURE_RM_BIT                 )
     88  1.1  riastrad #define FFEATURE_DS_DCEFCLK_MASK         (1 << FEATURE_DS_DCEFCLK_BIT         )
     89  1.1  riastrad #define FFEATURE_ACDC_MASK               (1 << FEATURE_ACDC_BIT               )
     90  1.1  riastrad #define FFEATURE_VR0HOT_MASK             (1 << FEATURE_VR0HOT_BIT             )
     91  1.1  riastrad #define FFEATURE_VR1HOT_MASK             (1 << FEATURE_VR1HOT_BIT             )
     92  1.1  riastrad #define FFEATURE_FW_CTF_MASK             (1 << FEATURE_FW_CTF_BIT             )
     93  1.1  riastrad #define FFEATURE_LED_DISPLAY_MASK        (1 << FEATURE_LED_DISPLAY_BIT        )
     94  1.1  riastrad #define FFEATURE_FAN_CONTROL_MASK        (1 << FEATURE_FAN_CONTROL_BIT        )
     95  1.1  riastrad 
     96  1.1  riastrad #define FEATURE_FAST_PPT_MASK            (1 << FAST_PPT_BIT                   )
     97  1.1  riastrad #define FEATURE_GFX_EDC_MASK             (1 << FEATURE_GFX_EDC_BIT            )
     98  1.1  riastrad #define FEATURE_ACG_MASK                 (1 << FEATURE_ACG_BIT                )
     99  1.1  riastrad #define FEATURE_PCC_LIMIT_CONTROL_MASK   (1 << FEATURE_PCC_LIMIT_CONTROL_BIT  )
    100  1.1  riastrad #define FFEATURE_SPARE_30_MASK           (1 << FEATURE_SPARE_30_BIT           )
    101  1.1  riastrad #define FFEATURE_SPARE_31_MASK           (1 << FEATURE_SPARE_31_BIT           )
    102  1.1  riastrad /* Workload types */
    103  1.1  riastrad #define WORKLOAD_VR_BIT                 0
    104  1.1  riastrad #define WORKLOAD_FRTC_BIT               1
    105  1.1  riastrad #define WORKLOAD_VIDEO_BIT              2
    106  1.1  riastrad #define WORKLOAD_COMPUTE_BIT            3
    107  1.1  riastrad #define NUM_WORKLOADS                   4
    108  1.1  riastrad 
    109  1.1  riastrad /* ULV Client Masks */
    110  1.1  riastrad #define ULV_CLIENT_RLC_MASK         0x00000001
    111  1.1  riastrad #define ULV_CLIENT_UVD_MASK         0x00000002
    112  1.1  riastrad #define ULV_CLIENT_VCE_MASK         0x00000004
    113  1.1  riastrad #define ULV_CLIENT_SDMA0_MASK       0x00000008
    114  1.1  riastrad #define ULV_CLIENT_SDMA1_MASK       0x00000010
    115  1.1  riastrad #define ULV_CLIENT_JPEG_MASK        0x00000020
    116  1.1  riastrad #define ULV_CLIENT_GFXCLK_DPM_MASK  0x00000040
    117  1.1  riastrad #define ULV_CLIENT_UVD_DPM_MASK     0x00000080
    118  1.1  riastrad #define ULV_CLIENT_VCE_DPM_MASK     0x00000100
    119  1.1  riastrad #define ULV_CLIENT_MP0CLK_DPM_MASK  0x00000200
    120  1.1  riastrad #define ULV_CLIENT_UCLK_DPM_MASK    0x00000400
    121  1.1  riastrad #define ULV_CLIENT_SOCCLK_DPM_MASK  0x00000800
    122  1.1  riastrad #define ULV_CLIENT_DCEFCLK_DPM_MASK 0x00001000
    123  1.1  riastrad 
    124  1.1  riastrad typedef struct {
    125  1.1  riastrad 	/* MP1_EXT_SCRATCH0 */
    126  1.1  riastrad 	uint32_t CurrLevel_GFXCLK  : 4;
    127  1.1  riastrad 	uint32_t CurrLevel_UVD     : 4;
    128  1.1  riastrad 	uint32_t CurrLevel_VCE     : 4;
    129  1.1  riastrad 	uint32_t CurrLevel_LCLK    : 4;
    130  1.1  riastrad 	uint32_t CurrLevel_MP0CLK  : 4;
    131  1.1  riastrad 	uint32_t CurrLevel_UCLK    : 4;
    132  1.1  riastrad 	uint32_t CurrLevel_SOCCLK  : 4;
    133  1.1  riastrad 	uint32_t CurrLevel_DCEFCLK : 4;
    134  1.1  riastrad 	/* MP1_EXT_SCRATCH1 */
    135  1.1  riastrad 	uint32_t TargLevel_GFXCLK  : 4;
    136  1.1  riastrad 	uint32_t TargLevel_UVD     : 4;
    137  1.1  riastrad 	uint32_t TargLevel_VCE     : 4;
    138  1.1  riastrad 	uint32_t TargLevel_LCLK    : 4;
    139  1.1  riastrad 	uint32_t TargLevel_MP0CLK  : 4;
    140  1.1  riastrad 	uint32_t TargLevel_UCLK    : 4;
    141  1.1  riastrad 	uint32_t TargLevel_SOCCLK  : 4;
    142  1.1  riastrad 	uint32_t TargLevel_DCEFCLK : 4;
    143  1.1  riastrad 	/* MP1_EXT_SCRATCH2-7 */
    144  1.1  riastrad 	uint32_t Reserved[6];
    145  1.1  riastrad } FwStatus_t;
    146  1.1  riastrad 
    147  1.1  riastrad #pragma pack(pop)
    148  1.1  riastrad 
    149  1.1  riastrad #endif
    150  1.1  riastrad 
    151