2 * Copyright 2012 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef __TRINITY_DPM_H__
24 #define __TRINITY_DPM_H__
28 #define TRINITY_SIZEOF_DPM_STATE_TABLE (SMU_SCLK_DPM_STATE_1_CNTL_0 - SMU_SCLK_DPM_STATE_0_CNTL_0)
41 #define TRINITY_POWERSTATE_FLAGS_NBPS_FORCEHIGH (1 << 0)
42 #define TRINITY_POWERSTATE_FLAGS_NBPS_LOCKTOHIGH (1 << 1)
43 #define TRINITY_POWERSTATE_FLAGS_NBPS_LOCKTOLOW (1 << 2)
45 #define TRINITY_POWERSTATE_FLAGS_BAPM_DISABLE (1 << 0)
49 struct trinity_pl levels
[SUMO_MAX_HARDWARE_POWERLEVELS
];
60 #define TRINITY_NUM_NBPSTATES 4
62 struct trinity_sys_info
{
67 u32 nbp_mclk
[TRINITY_NUM_NBPSTATES
];
68 u32 nbp_nclk
[TRINITY_NUM_NBPSTATES
];
69 u16 nbp_voltage_index
[TRINITY_NUM_NBPSTATES
];
70 u16 bootup_nb_voltage_index
;
73 struct sumo_sclk_voltage_mapping_table sclk_voltage_mapping_table
;
74 struct sumo_vid_mapping_table vid_mapping_table
;
75 u32 uma_channel_number
;
78 struct trinity_power_info
{
79 u32 at
[SUMO_MAX_HARDWARE_POWERLEVELS
];
81 u32 thermal_auto_throttling
;
82 struct trinity_sys_info sys_info
;
83 struct trinity_pl boot_pl
;
84 struct trinity_ps current_ps
;
86 bool enable_nbps_policy
;
87 bool voltage_drop_in_dce
;
88 bool override_dynamic_mgpg
;
89 bool enable_gfx_clock_gating
;
90 bool enable_gfx_power_gating
;
91 bool enable_mg_clock_gating
;
92 bool enable_gfx_dynamic_mgpg
;
93 bool enable_auto_thermal_throttling
;
98 #define TRINITY_AT_DFLT 30
101 int trinity_dpm_config(struct radeon_device
*rdev
, bool enable
);
102 int trinity_dpm_force_state(struct radeon_device
*rdev
, u32 n
);
103 int trinity_dpm_no_forced_level(struct radeon_device
*rdev
);
104 int trinity_dce_enable_voltage_adjustment(struct radeon_device
*rdev
,
106 int trinity_gfx_dynamic_mgpg_config(struct radeon_device
*rdev
);
107 void trinity_acquire_mutex(struct radeon_device
*rdev
);
108 void trinity_release_mutex(struct radeon_device
*rdev
);