Home | History | Annotate | Line # | Download | only in radeon
      1  1.2  riastrad /*	$NetBSD: rs780_dpm.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 2011 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 #ifndef __RS780_DPM_H__
     26  1.1  riastrad #define __RS780_DPM_H__
     27  1.1  riastrad 
     28  1.1  riastrad enum rs780_vddc_level {
     29  1.1  riastrad 	RS780_VDDC_LEVEL_UNKNOWN = 0,
     30  1.1  riastrad 	RS780_VDDC_LEVEL_LOW = 1,
     31  1.1  riastrad 	RS780_VDDC_LEVEL_HIGH = 2,
     32  1.1  riastrad };
     33  1.1  riastrad 
     34  1.1  riastrad struct igp_power_info {
     35  1.1  riastrad 	/* flags */
     36  1.1  riastrad 	bool invert_pwm_required;
     37  1.1  riastrad 	bool pwm_voltage_control;
     38  1.1  riastrad 	bool voltage_control;
     39  1.1  riastrad 	bool gfx_clock_gating;
     40  1.1  riastrad 	/* stored values */
     41  1.1  riastrad 	u32 system_config;
     42  1.1  riastrad 	u32 bootup_uma_clk;
     43  1.1  riastrad 	u16 max_voltage;
     44  1.1  riastrad 	u16 min_voltage;
     45  1.1  riastrad 	u16 boot_voltage;
     46  1.1  riastrad 	u16 inter_voltage_low;
     47  1.1  riastrad 	u16 inter_voltage_high;
     48  1.1  riastrad 	u16 num_of_cycles_in_period;
     49  1.1  riastrad 	/* variable */
     50  1.1  riastrad 	int crtc_id;
     51  1.1  riastrad 	int refresh_rate;
     52  1.1  riastrad };
     53  1.1  riastrad 
     54  1.1  riastrad struct igp_ps {
     55  1.1  riastrad 	enum rs780_vddc_level min_voltage;
     56  1.1  riastrad 	enum rs780_vddc_level max_voltage;
     57  1.1  riastrad 	u32 sclk_low;
     58  1.1  riastrad 	u32 sclk_high;
     59  1.1  riastrad 	u32 flags;
     60  1.1  riastrad };
     61  1.1  riastrad 
     62  1.1  riastrad #define RS780_CGFTV_DFLT                 0x0303000f
     63  1.1  riastrad #define RS780_FBDIVTIMERVAL_DFLT         0x2710
     64  1.1  riastrad 
     65  1.1  riastrad #define RS780_FVTHROTUTC0_DFLT   0x04010040
     66  1.1  riastrad #define RS780_FVTHROTUTC1_DFLT   0x04010040
     67  1.1  riastrad #define RS780_FVTHROTUTC2_DFLT   0x04010040
     68  1.1  riastrad #define RS780_FVTHROTUTC3_DFLT   0x04010040
     69  1.1  riastrad #define RS780_FVTHROTUTC4_DFLT   0x04010040
     70  1.1  riastrad 
     71  1.1  riastrad #define RS780_FVTHROTDTC0_DFLT 0x04010040
     72  1.1  riastrad #define RS780_FVTHROTDTC1_DFLT 0x04010040
     73  1.1  riastrad #define RS780_FVTHROTDTC2_DFLT 0x04010040
     74  1.1  riastrad #define RS780_FVTHROTDTC3_DFLT 0x04010040
     75  1.1  riastrad #define RS780_FVTHROTDTC4_DFLT 0x04010040
     76  1.1  riastrad 
     77  1.1  riastrad #define RS780_FVTHROTFBUSREG0_DFLT       0x00001001
     78  1.1  riastrad #define RS780_FVTHROTFBUSREG1_DFLT       0x00002002
     79  1.1  riastrad #define RS780_FVTHROTFBDSREG0_DFLT       0x00004001
     80  1.1  riastrad #define RS780_FVTHROTFBDSREG1_DFLT       0x00020010
     81  1.1  riastrad 
     82  1.1  riastrad #define RS780_FVTHROTPWMUSREG0_DFLT      0x00002001
     83  1.1  riastrad #define RS780_FVTHROTPWMUSREG1_DFLT      0x00004003
     84  1.1  riastrad #define RS780_FVTHROTPWMDSREG0_DFLT      0x00002001
     85  1.1  riastrad #define RS780_FVTHROTPWMDSREG1_DFLT      0x00004003
     86  1.1  riastrad 
     87  1.1  riastrad #define RS780_FVTHROTPWMFBDIVRANGEREG0_DFLT  0x37
     88  1.1  riastrad #define RS780_FVTHROTPWMFBDIVRANGEREG1_DFLT  0x4b
     89  1.1  riastrad #define RS780_FVTHROTPWMFBDIVRANGEREG2_DFLT  0x8b
     90  1.1  riastrad 
     91  1.1  riastrad #define RS780D_FVTHROTPWMFBDIVRANGEREG0_DFLT  0x8b
     92  1.1  riastrad #define RS780D_FVTHROTPWMFBDIVRANGEREG1_DFLT  0x8c
     93  1.1  riastrad #define RS780D_FVTHROTPWMFBDIVRANGEREG2_DFLT  0xb5
     94  1.1  riastrad 
     95  1.1  riastrad #define RS880D_FVTHROTPWMFBDIVRANGEREG0_DFLT  0x8d
     96  1.1  riastrad #define RS880D_FVTHROTPWMFBDIVRANGEREG1_DFLT  0x8e
     97  1.1  riastrad #define RS880D_FVTHROTPWMFBDIVRANGEREG2_DFLT  0xBa
     98  1.1  riastrad 
     99  1.1  riastrad #define RS780_FVTHROTPWMRANGE0_GPIO_DFLT  0x1a
    100  1.1  riastrad #define RS780_FVTHROTPWMRANGE1_GPIO_DFLT  0x1a
    101  1.1  riastrad #define RS780_FVTHROTPWMRANGE2_GPIO_DFLT  0x0
    102  1.1  riastrad #define RS780_FVTHROTPWMRANGE3_GPIO_DFLT  0x0
    103  1.1  riastrad 
    104  1.1  riastrad #define RS780_SLOWCLKFEEDBACKDIV_DFLT 110
    105  1.1  riastrad 
    106  1.1  riastrad #define RS780_CGCLKGATING_DFLT           0x0000E204
    107  1.1  riastrad 
    108  1.1  riastrad #define RS780_DEFAULT_VCLK_FREQ  53300 /* 10 khz */
    109  1.1  riastrad #define RS780_DEFAULT_DCLK_FREQ  40000 /* 10 khz */
    110  1.1  riastrad 
    111  1.1  riastrad #endif
    112