xref: /linux/drivers/gpu/drm/radeon/ci_dpm.h (revision b7e1e969c887c897947fdc3754fe9b0c24acb155)
1cc8dbbb4SAlex Deucher /*
2cc8dbbb4SAlex Deucher  * Copyright 2013 Advanced Micro Devices, Inc.
3cc8dbbb4SAlex Deucher  *
4cc8dbbb4SAlex Deucher  * Permission is hereby granted, free of charge, to any person obtaining a
5cc8dbbb4SAlex Deucher  * copy of this software and associated documentation files (the "Software"),
6cc8dbbb4SAlex Deucher  * to deal in the Software without restriction, including without limitation
7cc8dbbb4SAlex Deucher  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8cc8dbbb4SAlex Deucher  * and/or sell copies of the Software, and to permit persons to whom the
9cc8dbbb4SAlex Deucher  * Software is furnished to do so, subject to the following conditions:
10cc8dbbb4SAlex Deucher  *
11cc8dbbb4SAlex Deucher  * The above copyright notice and this permission notice shall be included in
12cc8dbbb4SAlex Deucher  * all copies or substantial portions of the Software.
13cc8dbbb4SAlex Deucher  *
14cc8dbbb4SAlex Deucher  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15cc8dbbb4SAlex Deucher  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16cc8dbbb4SAlex Deucher  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17cc8dbbb4SAlex Deucher  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18cc8dbbb4SAlex Deucher  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19cc8dbbb4SAlex Deucher  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20cc8dbbb4SAlex Deucher  * OTHER DEALINGS IN THE SOFTWARE.
21cc8dbbb4SAlex Deucher  *
22cc8dbbb4SAlex Deucher  */
23cc8dbbb4SAlex Deucher #ifndef __CI_DPM_H__
24cc8dbbb4SAlex Deucher #define __CI_DPM_H__
25cc8dbbb4SAlex Deucher 
26cc8dbbb4SAlex Deucher #include "ppsmc.h"
2788f489d2SSam Ravnborg #include "radeon.h"
28cc8dbbb4SAlex Deucher 
29cc8dbbb4SAlex Deucher #define SMU__NUM_SCLK_DPM_STATE  8
30cc8dbbb4SAlex Deucher #define SMU__NUM_MCLK_DPM_LEVELS 6
31cc8dbbb4SAlex Deucher #define SMU__NUM_LCLK_DPM_LEVELS 8
32cc8dbbb4SAlex Deucher #define SMU__NUM_PCIE_DPM_LEVELS 8
33cc8dbbb4SAlex Deucher #include "smu7_discrete.h"
34cc8dbbb4SAlex Deucher 
35cc8dbbb4SAlex Deucher #define CISLANDS_MAX_HARDWARE_POWERLEVELS 2
36cc8dbbb4SAlex Deucher 
3734fc0b58SAlex Deucher #define CISLANDS_UNUSED_GPIO_PIN 0x7F
3834fc0b58SAlex Deucher 
39cc8dbbb4SAlex Deucher struct ci_pl {
40cc8dbbb4SAlex Deucher 	u32 mclk;
41cc8dbbb4SAlex Deucher 	u32 sclk;
42cc8dbbb4SAlex Deucher 	enum radeon_pcie_gen pcie_gen;
43cc8dbbb4SAlex Deucher 	u16 pcie_lane;
44cc8dbbb4SAlex Deucher };
45cc8dbbb4SAlex Deucher 
46cc8dbbb4SAlex Deucher struct ci_ps {
47cc8dbbb4SAlex Deucher 	u16 performance_level_count;
48cc8dbbb4SAlex Deucher 	bool dc_compatible;
49cc8dbbb4SAlex Deucher 	u32 sclk_t;
50cc8dbbb4SAlex Deucher 	struct ci_pl performance_levels[CISLANDS_MAX_HARDWARE_POWERLEVELS];
51cc8dbbb4SAlex Deucher };
52cc8dbbb4SAlex Deucher 
53cc8dbbb4SAlex Deucher struct ci_dpm_level {
54cc8dbbb4SAlex Deucher 	bool enabled;
55cc8dbbb4SAlex Deucher 	u32 value;
56cc8dbbb4SAlex Deucher 	u32 param1;
57cc8dbbb4SAlex Deucher };
58cc8dbbb4SAlex Deucher 
59cc8dbbb4SAlex Deucher #define CISLAND_MAX_DEEPSLEEP_DIVIDER_ID 5
60cc8dbbb4SAlex Deucher #define MAX_REGULAR_DPM_NUMBER 8
61cc8dbbb4SAlex Deucher #define CISLAND_MINIMUM_ENGINE_CLOCK 800
62cc8dbbb4SAlex Deucher 
63cc8dbbb4SAlex Deucher struct ci_single_dpm_table {
64cc8dbbb4SAlex Deucher 	u32 count;
65cc8dbbb4SAlex Deucher 	struct ci_dpm_level dpm_levels[MAX_REGULAR_DPM_NUMBER];
66cc8dbbb4SAlex Deucher };
67cc8dbbb4SAlex Deucher 
68cc8dbbb4SAlex Deucher struct ci_dpm_table {
69cc8dbbb4SAlex Deucher 	struct ci_single_dpm_table sclk_table;
70cc8dbbb4SAlex Deucher 	struct ci_single_dpm_table mclk_table;
71cc8dbbb4SAlex Deucher 	struct ci_single_dpm_table pcie_speed_table;
72cc8dbbb4SAlex Deucher 	struct ci_single_dpm_table vddc_table;
73cc8dbbb4SAlex Deucher 	struct ci_single_dpm_table vddci_table;
74cc8dbbb4SAlex Deucher 	struct ci_single_dpm_table mvdd_table;
75cc8dbbb4SAlex Deucher };
76cc8dbbb4SAlex Deucher 
77cc8dbbb4SAlex Deucher struct ci_mc_reg_entry {
78cc8dbbb4SAlex Deucher 	u32 mclk_max;
79cc8dbbb4SAlex Deucher 	u32 mc_data[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
80cc8dbbb4SAlex Deucher };
81cc8dbbb4SAlex Deucher 
82cc8dbbb4SAlex Deucher struct ci_mc_reg_table {
83cc8dbbb4SAlex Deucher 	u8 last;
84cc8dbbb4SAlex Deucher 	u8 num_entries;
85cc8dbbb4SAlex Deucher 	u16 valid_flag;
86cc8dbbb4SAlex Deucher 	struct ci_mc_reg_entry mc_reg_table_entry[MAX_AC_TIMING_ENTRIES];
87cc8dbbb4SAlex Deucher 	SMU7_Discrete_MCRegisterAddress mc_reg_address[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
88cc8dbbb4SAlex Deucher };
89cc8dbbb4SAlex Deucher 
90*c435ebd0SXueBing Chen struct ci_ulv_parm {
91cc8dbbb4SAlex Deucher 	bool supported;
92cc8dbbb4SAlex Deucher 	u32 cg_ulv_parameter;
93cc8dbbb4SAlex Deucher 	u32 volt_change_delay;
94cc8dbbb4SAlex Deucher 	struct ci_pl pl;
95cc8dbbb4SAlex Deucher };
96cc8dbbb4SAlex Deucher 
97cc8dbbb4SAlex Deucher #define CISLANDS_MAX_LEAKAGE_COUNT  8
98cc8dbbb4SAlex Deucher 
99cc8dbbb4SAlex Deucher struct ci_leakage_voltage {
100cc8dbbb4SAlex Deucher 	u16 count;
101cc8dbbb4SAlex Deucher 	u16 leakage_id[CISLANDS_MAX_LEAKAGE_COUNT];
102cc8dbbb4SAlex Deucher 	u16 actual_voltage[CISLANDS_MAX_LEAKAGE_COUNT];
103cc8dbbb4SAlex Deucher };
104cc8dbbb4SAlex Deucher 
105cc8dbbb4SAlex Deucher struct ci_dpm_level_enable_mask {
106cc8dbbb4SAlex Deucher 	u32 uvd_dpm_enable_mask;
107cc8dbbb4SAlex Deucher 	u32 vce_dpm_enable_mask;
108cc8dbbb4SAlex Deucher 	u32 acp_dpm_enable_mask;
109cc8dbbb4SAlex Deucher 	u32 samu_dpm_enable_mask;
110cc8dbbb4SAlex Deucher 	u32 sclk_dpm_enable_mask;
111cc8dbbb4SAlex Deucher 	u32 mclk_dpm_enable_mask;
112cc8dbbb4SAlex Deucher 	u32 pcie_dpm_enable_mask;
113cc8dbbb4SAlex Deucher };
114cc8dbbb4SAlex Deucher 
115*c435ebd0SXueBing Chen struct ci_vbios_boot_state {
116cc8dbbb4SAlex Deucher 	u16 mvdd_bootup_value;
117cc8dbbb4SAlex Deucher 	u16 vddc_bootup_value;
118cc8dbbb4SAlex Deucher 	u16 vddci_bootup_value;
119cc8dbbb4SAlex Deucher 	u32 sclk_bootup_value;
120cc8dbbb4SAlex Deucher 	u32 mclk_bootup_value;
121cc8dbbb4SAlex Deucher 	u16 pcie_gen_bootup_value;
122cc8dbbb4SAlex Deucher 	u16 pcie_lane_bootup_value;
123cc8dbbb4SAlex Deucher };
124cc8dbbb4SAlex Deucher 
125cc8dbbb4SAlex Deucher struct ci_clock_registers {
126cc8dbbb4SAlex Deucher 	u32 cg_spll_func_cntl;
127cc8dbbb4SAlex Deucher 	u32 cg_spll_func_cntl_2;
128cc8dbbb4SAlex Deucher 	u32 cg_spll_func_cntl_3;
129cc8dbbb4SAlex Deucher 	u32 cg_spll_func_cntl_4;
130cc8dbbb4SAlex Deucher 	u32 cg_spll_spread_spectrum;
131cc8dbbb4SAlex Deucher 	u32 cg_spll_spread_spectrum_2;
132cc8dbbb4SAlex Deucher 	u32 dll_cntl;
133cc8dbbb4SAlex Deucher 	u32 mclk_pwrmgt_cntl;
134cc8dbbb4SAlex Deucher 	u32 mpll_ad_func_cntl;
135cc8dbbb4SAlex Deucher 	u32 mpll_dq_func_cntl;
136cc8dbbb4SAlex Deucher 	u32 mpll_func_cntl;
137cc8dbbb4SAlex Deucher 	u32 mpll_func_cntl_1;
138cc8dbbb4SAlex Deucher 	u32 mpll_func_cntl_2;
139cc8dbbb4SAlex Deucher 	u32 mpll_ss1;
140cc8dbbb4SAlex Deucher 	u32 mpll_ss2;
141cc8dbbb4SAlex Deucher };
142cc8dbbb4SAlex Deucher 
143cc8dbbb4SAlex Deucher struct ci_thermal_temperature_setting {
144cc8dbbb4SAlex Deucher 	s32 temperature_low;
145cc8dbbb4SAlex Deucher 	s32 temperature_high;
146cc8dbbb4SAlex Deucher 	s32 temperature_shutdown;
147cc8dbbb4SAlex Deucher };
148cc8dbbb4SAlex Deucher 
149cc8dbbb4SAlex Deucher struct ci_pcie_perf_range {
150cc8dbbb4SAlex Deucher 	u16 max;
151cc8dbbb4SAlex Deucher 	u16 min;
152cc8dbbb4SAlex Deucher };
153cc8dbbb4SAlex Deucher 
154cc8dbbb4SAlex Deucher enum ci_pt_config_reg_type {
155cc8dbbb4SAlex Deucher 	CISLANDS_CONFIGREG_MMR = 0,
156cc8dbbb4SAlex Deucher 	CISLANDS_CONFIGREG_SMC_IND,
157cc8dbbb4SAlex Deucher 	CISLANDS_CONFIGREG_DIDT_IND,
158cc8dbbb4SAlex Deucher 	CISLANDS_CONFIGREG_CACHE,
159cc8dbbb4SAlex Deucher 	CISLANDS_CONFIGREG_MAX
160cc8dbbb4SAlex Deucher };
161cc8dbbb4SAlex Deucher 
162cc8dbbb4SAlex Deucher #define POWERCONTAINMENT_FEATURE_BAPM            0x00000001
163cc8dbbb4SAlex Deucher #define POWERCONTAINMENT_FEATURE_TDCLimit        0x00000002
164cc8dbbb4SAlex Deucher #define POWERCONTAINMENT_FEATURE_PkgPwrLimit     0x00000004
165cc8dbbb4SAlex Deucher 
166cc8dbbb4SAlex Deucher struct ci_pt_config_reg {
167cc8dbbb4SAlex Deucher 	u32 offset;
168cc8dbbb4SAlex Deucher 	u32 mask;
169cc8dbbb4SAlex Deucher 	u32 shift;
170cc8dbbb4SAlex Deucher 	u32 value;
171cc8dbbb4SAlex Deucher 	enum ci_pt_config_reg_type type;
172cc8dbbb4SAlex Deucher };
173cc8dbbb4SAlex Deucher 
174cc8dbbb4SAlex Deucher struct ci_pt_defaults {
175cc8dbbb4SAlex Deucher 	u8 svi_load_line_en;
176cc8dbbb4SAlex Deucher 	u8 svi_load_line_vddc;
177cc8dbbb4SAlex Deucher 	u8 tdc_vddc_throttle_release_limit_perc;
178cc8dbbb4SAlex Deucher 	u8 tdc_mawt;
179cc8dbbb4SAlex Deucher 	u8 tdc_waterfall_ctl;
180cc8dbbb4SAlex Deucher 	u8 dte_ambient_temp_base;
181cc8dbbb4SAlex Deucher 	u32 display_cac;
182cc8dbbb4SAlex Deucher 	u32 bapm_temp_gradient;
183cc8dbbb4SAlex Deucher 	u16 bapmti_r[SMU7_DTE_ITERATIONS * SMU7_DTE_SOURCES * SMU7_DTE_SINKS];
184cc8dbbb4SAlex Deucher 	u16 bapmti_rc[SMU7_DTE_ITERATIONS * SMU7_DTE_SOURCES * SMU7_DTE_SINKS];
185cc8dbbb4SAlex Deucher };
186cc8dbbb4SAlex Deucher 
187cc8dbbb4SAlex Deucher #define DPMTABLE_OD_UPDATE_SCLK     0x00000001
188cc8dbbb4SAlex Deucher #define DPMTABLE_OD_UPDATE_MCLK     0x00000002
189cc8dbbb4SAlex Deucher #define DPMTABLE_UPDATE_SCLK        0x00000004
190cc8dbbb4SAlex Deucher #define DPMTABLE_UPDATE_MCLK        0x00000008
191cc8dbbb4SAlex Deucher 
192cc8dbbb4SAlex Deucher struct ci_power_info {
193cc8dbbb4SAlex Deucher 	struct ci_dpm_table dpm_table;
194cc8dbbb4SAlex Deucher 	u32 voltage_control;
195cc8dbbb4SAlex Deucher 	u32 mvdd_control;
196cc8dbbb4SAlex Deucher 	u32 vddci_control;
197cc8dbbb4SAlex Deucher 	u32 active_auto_throttle_sources;
198cc8dbbb4SAlex Deucher 	struct ci_clock_registers clock_registers;
199cc8dbbb4SAlex Deucher 	u16 acpi_vddc;
200cc8dbbb4SAlex Deucher 	u16 acpi_vddci;
201cc8dbbb4SAlex Deucher 	enum radeon_pcie_gen force_pcie_gen;
202cc8dbbb4SAlex Deucher 	enum radeon_pcie_gen acpi_pcie_gen;
203cc8dbbb4SAlex Deucher 	struct ci_leakage_voltage vddc_leakage;
204cc8dbbb4SAlex Deucher 	struct ci_leakage_voltage vddci_leakage;
205cc8dbbb4SAlex Deucher 	u16 max_vddc_in_pp_table;
206cc8dbbb4SAlex Deucher 	u16 min_vddc_in_pp_table;
207cc8dbbb4SAlex Deucher 	u16 max_vddci_in_pp_table;
208cc8dbbb4SAlex Deucher 	u16 min_vddci_in_pp_table;
209cc8dbbb4SAlex Deucher 	u32 mclk_strobe_mode_threshold;
210cc8dbbb4SAlex Deucher 	u32 mclk_stutter_mode_threshold;
211cc8dbbb4SAlex Deucher 	u32 mclk_edc_enable_threshold;
212cc8dbbb4SAlex Deucher 	u32 mclk_edc_wr_enable_threshold;
213cc8dbbb4SAlex Deucher 	struct ci_vbios_boot_state vbios_boot_state;
214cc8dbbb4SAlex Deucher 	/* smc offsets */
215cc8dbbb4SAlex Deucher 	u32 sram_end;
216cc8dbbb4SAlex Deucher 	u32 dpm_table_start;
217cc8dbbb4SAlex Deucher 	u32 soft_regs_start;
218cc8dbbb4SAlex Deucher 	u32 mc_reg_table_start;
219cc8dbbb4SAlex Deucher 	u32 fan_table_start;
220cc8dbbb4SAlex Deucher 	u32 arb_table_start;
221cc8dbbb4SAlex Deucher 	/* smc tables */
222cc8dbbb4SAlex Deucher 	SMU7_Discrete_DpmTable smc_state_table;
223cc8dbbb4SAlex Deucher 	SMU7_Discrete_MCRegisters smc_mc_reg_table;
224cc8dbbb4SAlex Deucher 	SMU7_Discrete_PmFuses smc_powertune_table;
225cc8dbbb4SAlex Deucher 	/* other stuff */
226cc8dbbb4SAlex Deucher 	struct ci_mc_reg_table mc_reg_table;
227cc8dbbb4SAlex Deucher 	struct atom_voltage_table vddc_voltage_table;
228cc8dbbb4SAlex Deucher 	struct atom_voltage_table vddci_voltage_table;
229cc8dbbb4SAlex Deucher 	struct atom_voltage_table mvdd_voltage_table;
230cc8dbbb4SAlex Deucher 	struct ci_ulv_parm ulv;
231cc8dbbb4SAlex Deucher 	u32 power_containment_features;
232cc8dbbb4SAlex Deucher 	const struct ci_pt_defaults *powertune_defaults;
233cc8dbbb4SAlex Deucher 	u32 dte_tj_offset;
234cc8dbbb4SAlex Deucher 	bool vddc_phase_shed_control;
235cc8dbbb4SAlex Deucher 	struct ci_thermal_temperature_setting thermal_temp_setting;
236cc8dbbb4SAlex Deucher 	struct ci_dpm_level_enable_mask dpm_level_enable_mask;
237cc8dbbb4SAlex Deucher 	u32 need_update_smu7_dpm_table;
238cc8dbbb4SAlex Deucher 	u32 sclk_dpm_key_disabled;
239cc8dbbb4SAlex Deucher 	u32 mclk_dpm_key_disabled;
240cc8dbbb4SAlex Deucher 	u32 pcie_dpm_key_disabled;
2410e4ed1c1SAlex Deucher 	u32 thermal_sclk_dpm_enabled;
242cc8dbbb4SAlex Deucher 	struct ci_pcie_perf_range pcie_gen_performance;
243cc8dbbb4SAlex Deucher 	struct ci_pcie_perf_range pcie_lane_performance;
244cc8dbbb4SAlex Deucher 	struct ci_pcie_perf_range pcie_gen_powersaving;
245cc8dbbb4SAlex Deucher 	struct ci_pcie_perf_range pcie_lane_powersaving;
246cc8dbbb4SAlex Deucher 	u32 activity_target[SMU7_MAX_LEVELS_GRAPHICS];
247cc8dbbb4SAlex Deucher 	u32 mclk_activity_target;
248cc8dbbb4SAlex Deucher 	u32 low_sclk_interrupt_t;
249cc8dbbb4SAlex Deucher 	u32 last_mclk_dpm_enable_mask;
250cc8dbbb4SAlex Deucher 	u32 sys_pcie_mask;
251cc8dbbb4SAlex Deucher 	/* caps */
252cc8dbbb4SAlex Deucher 	bool caps_power_containment;
253cc8dbbb4SAlex Deucher 	bool caps_cac;
254cc8dbbb4SAlex Deucher 	bool caps_sq_ramping;
255cc8dbbb4SAlex Deucher 	bool caps_db_ramping;
256cc8dbbb4SAlex Deucher 	bool caps_td_ramping;
257cc8dbbb4SAlex Deucher 	bool caps_tcp_ramping;
258cc8dbbb4SAlex Deucher 	bool caps_fps;
259cc8dbbb4SAlex Deucher 	bool caps_sclk_ds;
260cc8dbbb4SAlex Deucher 	bool caps_sclk_ss_support;
261cc8dbbb4SAlex Deucher 	bool caps_mclk_ss_support;
262cc8dbbb4SAlex Deucher 	bool caps_uvd_dpm;
263cc8dbbb4SAlex Deucher 	bool caps_vce_dpm;
264cc8dbbb4SAlex Deucher 	bool caps_samu_dpm;
265cc8dbbb4SAlex Deucher 	bool caps_acp_dpm;
266cc8dbbb4SAlex Deucher 	bool caps_automatic_dc_transition;
267cc8dbbb4SAlex Deucher 	bool caps_sclk_throttle_low_notification;
268cc8dbbb4SAlex Deucher 	bool caps_dynamic_ac_timing;
269e03cea36SAlex Deucher 	bool caps_od_fuzzy_fan_control_support;
270cc8dbbb4SAlex Deucher 	/* flags */
271cc8dbbb4SAlex Deucher 	bool thermal_protection;
272cc8dbbb4SAlex Deucher 	bool pcie_performance_request;
273cc8dbbb4SAlex Deucher 	bool dynamic_ss;
274cc8dbbb4SAlex Deucher 	bool dll_default_on;
275cc8dbbb4SAlex Deucher 	bool cac_enabled;
276cc8dbbb4SAlex Deucher 	bool uvd_enabled;
277cc8dbbb4SAlex Deucher 	bool battery_state;
278cc8dbbb4SAlex Deucher 	bool pspp_notify_required;
279cc8dbbb4SAlex Deucher 	bool mem_gddr5;
280cc8dbbb4SAlex Deucher 	bool enable_bapm_feature;
281cc8dbbb4SAlex Deucher 	bool enable_tdc_limit_feature;
282cc8dbbb4SAlex Deucher 	bool enable_pkg_pwr_tracking_feature;
283cc8dbbb4SAlex Deucher 	bool use_pcie_performance_levels;
284cc8dbbb4SAlex Deucher 	bool use_pcie_powersaving_levels;
28547acb1ffSAlex Deucher 	bool uvd_power_gated;
286cc8dbbb4SAlex Deucher 	/* driver states */
287cc8dbbb4SAlex Deucher 	struct radeon_ps current_rps;
288cc8dbbb4SAlex Deucher 	struct ci_ps current_ps;
289cc8dbbb4SAlex Deucher 	struct radeon_ps requested_rps;
290cc8dbbb4SAlex Deucher 	struct ci_ps requested_ps;
291e03cea36SAlex Deucher 	/* fan control */
292e03cea36SAlex Deucher 	bool fan_ctrl_is_in_default_mode;
29336689e57SOleg Chernovskiy 	bool fan_is_controlled_by_smc;
294e03cea36SAlex Deucher 	u32 t_min;
295e03cea36SAlex Deucher 	u32 fan_ctrl_default_mode;
296cc8dbbb4SAlex Deucher };
297cc8dbbb4SAlex Deucher 
298cc8dbbb4SAlex Deucher #define CISLANDS_VOLTAGE_CONTROL_NONE                   0x0
299cc8dbbb4SAlex Deucher #define CISLANDS_VOLTAGE_CONTROL_BY_GPIO                0x1
300cc8dbbb4SAlex Deucher #define CISLANDS_VOLTAGE_CONTROL_BY_SVID2               0x2
301cc8dbbb4SAlex Deucher 
302cc8dbbb4SAlex Deucher #define CISLANDS_Q88_FORMAT_CONVERSION_UNIT             256
303cc8dbbb4SAlex Deucher 
304cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT0                              0x3FFFC000
305cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT1                              0x000400
306cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT2                              0xC00080
307cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT3                              0xC00200
308cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT4                              0xC01680
309cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT5                              0xC00033
310cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT6                              0xC00033
311cc8dbbb4SAlex Deucher #define CISLANDS_VRC_DFLT7                              0x3FFFC000
312cc8dbbb4SAlex Deucher 
313cc8dbbb4SAlex Deucher #define CISLANDS_CGULVPARAMETER_DFLT                    0x00040035
314cc8dbbb4SAlex Deucher #define CISLAND_TARGETACTIVITY_DFLT                     30
315cc8dbbb4SAlex Deucher #define CISLAND_MCLK_TARGETACTIVITY_DFLT                10
316cc8dbbb4SAlex Deucher 
317cc8dbbb4SAlex Deucher #define PCIE_PERF_REQ_REMOVE_REGISTRY   0
318cc8dbbb4SAlex Deucher #define PCIE_PERF_REQ_FORCE_LOWPOWER    1
319cc8dbbb4SAlex Deucher #define PCIE_PERF_REQ_PECI_GEN1         2
320cc8dbbb4SAlex Deucher #define PCIE_PERF_REQ_PECI_GEN2         3
321cc8dbbb4SAlex Deucher #define PCIE_PERF_REQ_PECI_GEN3         4
322cc8dbbb4SAlex Deucher 
323cc8dbbb4SAlex Deucher int ci_copy_bytes_to_smc(struct radeon_device *rdev,
324cc8dbbb4SAlex Deucher 			 u32 smc_start_address,
325cc8dbbb4SAlex Deucher 			 const u8 *src, u32 byte_count, u32 limit);
326cc8dbbb4SAlex Deucher void ci_start_smc(struct radeon_device *rdev);
327cc8dbbb4SAlex Deucher void ci_reset_smc(struct radeon_device *rdev);
328cc8dbbb4SAlex Deucher int ci_program_jump_on_start(struct radeon_device *rdev);
329cc8dbbb4SAlex Deucher void ci_stop_smc_clock(struct radeon_device *rdev);
330cc8dbbb4SAlex Deucher void ci_start_smc_clock(struct radeon_device *rdev);
331cc8dbbb4SAlex Deucher bool ci_is_smc_running(struct radeon_device *rdev);
332cc8dbbb4SAlex Deucher PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev);
333cc8dbbb4SAlex Deucher int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit);
334cc8dbbb4SAlex Deucher int ci_read_smc_sram_dword(struct radeon_device *rdev,
335cc8dbbb4SAlex Deucher 			   u32 smc_address, u32 *value, u32 limit);
336cc8dbbb4SAlex Deucher int ci_write_smc_sram_dword(struct radeon_device *rdev,
337cc8dbbb4SAlex Deucher 			    u32 smc_address, u32 value, u32 limit);
338cc8dbbb4SAlex Deucher 
339cc8dbbb4SAlex Deucher #endif
340