18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2013 Advanced Micro Devices, Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci#ifndef __CI_DPM_H__
248c2ecf20Sopenharmony_ci#define __CI_DPM_H__
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#include "ppsmc.h"
278c2ecf20Sopenharmony_ci#include "radeon.h"
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#define SMU__NUM_SCLK_DPM_STATE  8
308c2ecf20Sopenharmony_ci#define SMU__NUM_MCLK_DPM_LEVELS 6
318c2ecf20Sopenharmony_ci#define SMU__NUM_LCLK_DPM_LEVELS 8
328c2ecf20Sopenharmony_ci#define SMU__NUM_PCIE_DPM_LEVELS 8
338c2ecf20Sopenharmony_ci#include "smu7_discrete.h"
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define CISLANDS_MAX_HARDWARE_POWERLEVELS 2
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define CISLANDS_UNUSED_GPIO_PIN 0x7F
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cistruct ci_pl {
408c2ecf20Sopenharmony_ci	u32 mclk;
418c2ecf20Sopenharmony_ci	u32 sclk;
428c2ecf20Sopenharmony_ci	enum radeon_pcie_gen pcie_gen;
438c2ecf20Sopenharmony_ci	u16 pcie_lane;
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_cistruct ci_ps {
478c2ecf20Sopenharmony_ci	u16 performance_level_count;
488c2ecf20Sopenharmony_ci	bool dc_compatible;
498c2ecf20Sopenharmony_ci	u32 sclk_t;
508c2ecf20Sopenharmony_ci	struct ci_pl performance_levels[CISLANDS_MAX_HARDWARE_POWERLEVELS];
518c2ecf20Sopenharmony_ci};
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_cistruct ci_dpm_level {
548c2ecf20Sopenharmony_ci	bool enabled;
558c2ecf20Sopenharmony_ci	u32 value;
568c2ecf20Sopenharmony_ci	u32 param1;
578c2ecf20Sopenharmony_ci};
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci#define CISLAND_MAX_DEEPSLEEP_DIVIDER_ID 5
608c2ecf20Sopenharmony_ci#define MAX_REGULAR_DPM_NUMBER 8
618c2ecf20Sopenharmony_ci#define CISLAND_MINIMUM_ENGINE_CLOCK 800
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_cistruct ci_single_dpm_table {
648c2ecf20Sopenharmony_ci	u32 count;
658c2ecf20Sopenharmony_ci	struct ci_dpm_level dpm_levels[MAX_REGULAR_DPM_NUMBER];
668c2ecf20Sopenharmony_ci};
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_cistruct ci_dpm_table {
698c2ecf20Sopenharmony_ci	struct ci_single_dpm_table sclk_table;
708c2ecf20Sopenharmony_ci	struct ci_single_dpm_table mclk_table;
718c2ecf20Sopenharmony_ci	struct ci_single_dpm_table pcie_speed_table;
728c2ecf20Sopenharmony_ci	struct ci_single_dpm_table vddc_table;
738c2ecf20Sopenharmony_ci	struct ci_single_dpm_table vddci_table;
748c2ecf20Sopenharmony_ci	struct ci_single_dpm_table mvdd_table;
758c2ecf20Sopenharmony_ci};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_cistruct ci_mc_reg_entry {
788c2ecf20Sopenharmony_ci	u32 mclk_max;
798c2ecf20Sopenharmony_ci	u32 mc_data[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
808c2ecf20Sopenharmony_ci};
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_cistruct ci_mc_reg_table {
838c2ecf20Sopenharmony_ci	u8 last;
848c2ecf20Sopenharmony_ci	u8 num_entries;
858c2ecf20Sopenharmony_ci	u16 valid_flag;
868c2ecf20Sopenharmony_ci	struct ci_mc_reg_entry mc_reg_table_entry[MAX_AC_TIMING_ENTRIES];
878c2ecf20Sopenharmony_ci	SMU7_Discrete_MCRegisterAddress mc_reg_address[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
888c2ecf20Sopenharmony_ci};
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_cistruct ci_ulv_parm
918c2ecf20Sopenharmony_ci{
928c2ecf20Sopenharmony_ci	bool supported;
938c2ecf20Sopenharmony_ci	u32 cg_ulv_parameter;
948c2ecf20Sopenharmony_ci	u32 volt_change_delay;
958c2ecf20Sopenharmony_ci	struct ci_pl pl;
968c2ecf20Sopenharmony_ci};
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define CISLANDS_MAX_LEAKAGE_COUNT  8
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_cistruct ci_leakage_voltage {
1018c2ecf20Sopenharmony_ci	u16 count;
1028c2ecf20Sopenharmony_ci	u16 leakage_id[CISLANDS_MAX_LEAKAGE_COUNT];
1038c2ecf20Sopenharmony_ci	u16 actual_voltage[CISLANDS_MAX_LEAKAGE_COUNT];
1048c2ecf20Sopenharmony_ci};
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_cistruct ci_dpm_level_enable_mask {
1078c2ecf20Sopenharmony_ci	u32 uvd_dpm_enable_mask;
1088c2ecf20Sopenharmony_ci	u32 vce_dpm_enable_mask;
1098c2ecf20Sopenharmony_ci	u32 acp_dpm_enable_mask;
1108c2ecf20Sopenharmony_ci	u32 samu_dpm_enable_mask;
1118c2ecf20Sopenharmony_ci	u32 sclk_dpm_enable_mask;
1128c2ecf20Sopenharmony_ci	u32 mclk_dpm_enable_mask;
1138c2ecf20Sopenharmony_ci	u32 pcie_dpm_enable_mask;
1148c2ecf20Sopenharmony_ci};
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_cistruct ci_vbios_boot_state
1178c2ecf20Sopenharmony_ci{
1188c2ecf20Sopenharmony_ci	u16 mvdd_bootup_value;
1198c2ecf20Sopenharmony_ci	u16 vddc_bootup_value;
1208c2ecf20Sopenharmony_ci	u16 vddci_bootup_value;
1218c2ecf20Sopenharmony_ci	u32 sclk_bootup_value;
1228c2ecf20Sopenharmony_ci	u32 mclk_bootup_value;
1238c2ecf20Sopenharmony_ci	u16 pcie_gen_bootup_value;
1248c2ecf20Sopenharmony_ci	u16 pcie_lane_bootup_value;
1258c2ecf20Sopenharmony_ci};
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_cistruct ci_clock_registers {
1288c2ecf20Sopenharmony_ci	u32 cg_spll_func_cntl;
1298c2ecf20Sopenharmony_ci	u32 cg_spll_func_cntl_2;
1308c2ecf20Sopenharmony_ci	u32 cg_spll_func_cntl_3;
1318c2ecf20Sopenharmony_ci	u32 cg_spll_func_cntl_4;
1328c2ecf20Sopenharmony_ci	u32 cg_spll_spread_spectrum;
1338c2ecf20Sopenharmony_ci	u32 cg_spll_spread_spectrum_2;
1348c2ecf20Sopenharmony_ci	u32 dll_cntl;
1358c2ecf20Sopenharmony_ci	u32 mclk_pwrmgt_cntl;
1368c2ecf20Sopenharmony_ci	u32 mpll_ad_func_cntl;
1378c2ecf20Sopenharmony_ci	u32 mpll_dq_func_cntl;
1388c2ecf20Sopenharmony_ci	u32 mpll_func_cntl;
1398c2ecf20Sopenharmony_ci	u32 mpll_func_cntl_1;
1408c2ecf20Sopenharmony_ci	u32 mpll_func_cntl_2;
1418c2ecf20Sopenharmony_ci	u32 mpll_ss1;
1428c2ecf20Sopenharmony_ci	u32 mpll_ss2;
1438c2ecf20Sopenharmony_ci};
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_cistruct ci_thermal_temperature_setting {
1468c2ecf20Sopenharmony_ci	s32 temperature_low;
1478c2ecf20Sopenharmony_ci	s32 temperature_high;
1488c2ecf20Sopenharmony_ci	s32 temperature_shutdown;
1498c2ecf20Sopenharmony_ci};
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_cistruct ci_pcie_perf_range {
1528c2ecf20Sopenharmony_ci	u16 max;
1538c2ecf20Sopenharmony_ci	u16 min;
1548c2ecf20Sopenharmony_ci};
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_cienum ci_pt_config_reg_type {
1578c2ecf20Sopenharmony_ci	CISLANDS_CONFIGREG_MMR = 0,
1588c2ecf20Sopenharmony_ci	CISLANDS_CONFIGREG_SMC_IND,
1598c2ecf20Sopenharmony_ci	CISLANDS_CONFIGREG_DIDT_IND,
1608c2ecf20Sopenharmony_ci	CISLANDS_CONFIGREG_CACHE,
1618c2ecf20Sopenharmony_ci	CISLANDS_CONFIGREG_MAX
1628c2ecf20Sopenharmony_ci};
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define POWERCONTAINMENT_FEATURE_BAPM            0x00000001
1658c2ecf20Sopenharmony_ci#define POWERCONTAINMENT_FEATURE_TDCLimit        0x00000002
1668c2ecf20Sopenharmony_ci#define POWERCONTAINMENT_FEATURE_PkgPwrLimit     0x00000004
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_cistruct ci_pt_config_reg {
1698c2ecf20Sopenharmony_ci	u32 offset;
1708c2ecf20Sopenharmony_ci	u32 mask;
1718c2ecf20Sopenharmony_ci	u32 shift;
1728c2ecf20Sopenharmony_ci	u32 value;
1738c2ecf20Sopenharmony_ci	enum ci_pt_config_reg_type type;
1748c2ecf20Sopenharmony_ci};
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_cistruct ci_pt_defaults {
1778c2ecf20Sopenharmony_ci	u8 svi_load_line_en;
1788c2ecf20Sopenharmony_ci	u8 svi_load_line_vddc;
1798c2ecf20Sopenharmony_ci	u8 tdc_vddc_throttle_release_limit_perc;
1808c2ecf20Sopenharmony_ci	u8 tdc_mawt;
1818c2ecf20Sopenharmony_ci	u8 tdc_waterfall_ctl;
1828c2ecf20Sopenharmony_ci	u8 dte_ambient_temp_base;
1838c2ecf20Sopenharmony_ci	u32 display_cac;
1848c2ecf20Sopenharmony_ci	u32 bapm_temp_gradient;
1858c2ecf20Sopenharmony_ci	u16 bapmti_r[SMU7_DTE_ITERATIONS * SMU7_DTE_SOURCES * SMU7_DTE_SINKS];
1868c2ecf20Sopenharmony_ci	u16 bapmti_rc[SMU7_DTE_ITERATIONS * SMU7_DTE_SOURCES * SMU7_DTE_SINKS];
1878c2ecf20Sopenharmony_ci};
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci#define DPMTABLE_OD_UPDATE_SCLK     0x00000001
1908c2ecf20Sopenharmony_ci#define DPMTABLE_OD_UPDATE_MCLK     0x00000002
1918c2ecf20Sopenharmony_ci#define DPMTABLE_UPDATE_SCLK        0x00000004
1928c2ecf20Sopenharmony_ci#define DPMTABLE_UPDATE_MCLK        0x00000008
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_cistruct ci_power_info {
1958c2ecf20Sopenharmony_ci	struct ci_dpm_table dpm_table;
1968c2ecf20Sopenharmony_ci	u32 voltage_control;
1978c2ecf20Sopenharmony_ci	u32 mvdd_control;
1988c2ecf20Sopenharmony_ci	u32 vddci_control;
1998c2ecf20Sopenharmony_ci	u32 active_auto_throttle_sources;
2008c2ecf20Sopenharmony_ci	struct ci_clock_registers clock_registers;
2018c2ecf20Sopenharmony_ci	u16 acpi_vddc;
2028c2ecf20Sopenharmony_ci	u16 acpi_vddci;
2038c2ecf20Sopenharmony_ci	enum radeon_pcie_gen force_pcie_gen;
2048c2ecf20Sopenharmony_ci	enum radeon_pcie_gen acpi_pcie_gen;
2058c2ecf20Sopenharmony_ci	struct ci_leakage_voltage vddc_leakage;
2068c2ecf20Sopenharmony_ci	struct ci_leakage_voltage vddci_leakage;
2078c2ecf20Sopenharmony_ci	u16 max_vddc_in_pp_table;
2088c2ecf20Sopenharmony_ci	u16 min_vddc_in_pp_table;
2098c2ecf20Sopenharmony_ci	u16 max_vddci_in_pp_table;
2108c2ecf20Sopenharmony_ci	u16 min_vddci_in_pp_table;
2118c2ecf20Sopenharmony_ci	u32 mclk_strobe_mode_threshold;
2128c2ecf20Sopenharmony_ci	u32 mclk_stutter_mode_threshold;
2138c2ecf20Sopenharmony_ci	u32 mclk_edc_enable_threshold;
2148c2ecf20Sopenharmony_ci	u32 mclk_edc_wr_enable_threshold;
2158c2ecf20Sopenharmony_ci	struct ci_vbios_boot_state vbios_boot_state;
2168c2ecf20Sopenharmony_ci	/* smc offsets */
2178c2ecf20Sopenharmony_ci	u32 sram_end;
2188c2ecf20Sopenharmony_ci	u32 dpm_table_start;
2198c2ecf20Sopenharmony_ci	u32 soft_regs_start;
2208c2ecf20Sopenharmony_ci	u32 mc_reg_table_start;
2218c2ecf20Sopenharmony_ci	u32 fan_table_start;
2228c2ecf20Sopenharmony_ci	u32 arb_table_start;
2238c2ecf20Sopenharmony_ci	/* smc tables */
2248c2ecf20Sopenharmony_ci	SMU7_Discrete_DpmTable smc_state_table;
2258c2ecf20Sopenharmony_ci	SMU7_Discrete_MCRegisters smc_mc_reg_table;
2268c2ecf20Sopenharmony_ci	SMU7_Discrete_PmFuses smc_powertune_table;
2278c2ecf20Sopenharmony_ci	/* other stuff */
2288c2ecf20Sopenharmony_ci	struct ci_mc_reg_table mc_reg_table;
2298c2ecf20Sopenharmony_ci	struct atom_voltage_table vddc_voltage_table;
2308c2ecf20Sopenharmony_ci	struct atom_voltage_table vddci_voltage_table;
2318c2ecf20Sopenharmony_ci	struct atom_voltage_table mvdd_voltage_table;
2328c2ecf20Sopenharmony_ci	struct ci_ulv_parm ulv;
2338c2ecf20Sopenharmony_ci	u32 power_containment_features;
2348c2ecf20Sopenharmony_ci	const struct ci_pt_defaults *powertune_defaults;
2358c2ecf20Sopenharmony_ci	u32 dte_tj_offset;
2368c2ecf20Sopenharmony_ci	bool vddc_phase_shed_control;
2378c2ecf20Sopenharmony_ci	struct ci_thermal_temperature_setting thermal_temp_setting;
2388c2ecf20Sopenharmony_ci	struct ci_dpm_level_enable_mask dpm_level_enable_mask;
2398c2ecf20Sopenharmony_ci	u32 need_update_smu7_dpm_table;
2408c2ecf20Sopenharmony_ci	u32 sclk_dpm_key_disabled;
2418c2ecf20Sopenharmony_ci	u32 mclk_dpm_key_disabled;
2428c2ecf20Sopenharmony_ci	u32 pcie_dpm_key_disabled;
2438c2ecf20Sopenharmony_ci	u32 thermal_sclk_dpm_enabled;
2448c2ecf20Sopenharmony_ci	struct ci_pcie_perf_range pcie_gen_performance;
2458c2ecf20Sopenharmony_ci	struct ci_pcie_perf_range pcie_lane_performance;
2468c2ecf20Sopenharmony_ci	struct ci_pcie_perf_range pcie_gen_powersaving;
2478c2ecf20Sopenharmony_ci	struct ci_pcie_perf_range pcie_lane_powersaving;
2488c2ecf20Sopenharmony_ci	u32 activity_target[SMU7_MAX_LEVELS_GRAPHICS];
2498c2ecf20Sopenharmony_ci	u32 mclk_activity_target;
2508c2ecf20Sopenharmony_ci	u32 low_sclk_interrupt_t;
2518c2ecf20Sopenharmony_ci	u32 last_mclk_dpm_enable_mask;
2528c2ecf20Sopenharmony_ci	u32 sys_pcie_mask;
2538c2ecf20Sopenharmony_ci	/* caps */
2548c2ecf20Sopenharmony_ci	bool caps_power_containment;
2558c2ecf20Sopenharmony_ci	bool caps_cac;
2568c2ecf20Sopenharmony_ci	bool caps_sq_ramping;
2578c2ecf20Sopenharmony_ci	bool caps_db_ramping;
2588c2ecf20Sopenharmony_ci	bool caps_td_ramping;
2598c2ecf20Sopenharmony_ci	bool caps_tcp_ramping;
2608c2ecf20Sopenharmony_ci	bool caps_fps;
2618c2ecf20Sopenharmony_ci	bool caps_sclk_ds;
2628c2ecf20Sopenharmony_ci	bool caps_sclk_ss_support;
2638c2ecf20Sopenharmony_ci	bool caps_mclk_ss_support;
2648c2ecf20Sopenharmony_ci	bool caps_uvd_dpm;
2658c2ecf20Sopenharmony_ci	bool caps_vce_dpm;
2668c2ecf20Sopenharmony_ci	bool caps_samu_dpm;
2678c2ecf20Sopenharmony_ci	bool caps_acp_dpm;
2688c2ecf20Sopenharmony_ci	bool caps_automatic_dc_transition;
2698c2ecf20Sopenharmony_ci	bool caps_sclk_throttle_low_notification;
2708c2ecf20Sopenharmony_ci	bool caps_dynamic_ac_timing;
2718c2ecf20Sopenharmony_ci	bool caps_od_fuzzy_fan_control_support;
2728c2ecf20Sopenharmony_ci	/* flags */
2738c2ecf20Sopenharmony_ci	bool thermal_protection;
2748c2ecf20Sopenharmony_ci	bool pcie_performance_request;
2758c2ecf20Sopenharmony_ci	bool dynamic_ss;
2768c2ecf20Sopenharmony_ci	bool dll_default_on;
2778c2ecf20Sopenharmony_ci	bool cac_enabled;
2788c2ecf20Sopenharmony_ci	bool uvd_enabled;
2798c2ecf20Sopenharmony_ci	bool battery_state;
2808c2ecf20Sopenharmony_ci	bool pspp_notify_required;
2818c2ecf20Sopenharmony_ci	bool mem_gddr5;
2828c2ecf20Sopenharmony_ci	bool enable_bapm_feature;
2838c2ecf20Sopenharmony_ci	bool enable_tdc_limit_feature;
2848c2ecf20Sopenharmony_ci	bool enable_pkg_pwr_tracking_feature;
2858c2ecf20Sopenharmony_ci	bool use_pcie_performance_levels;
2868c2ecf20Sopenharmony_ci	bool use_pcie_powersaving_levels;
2878c2ecf20Sopenharmony_ci	bool uvd_power_gated;
2888c2ecf20Sopenharmony_ci	/* driver states */
2898c2ecf20Sopenharmony_ci	struct radeon_ps current_rps;
2908c2ecf20Sopenharmony_ci	struct ci_ps current_ps;
2918c2ecf20Sopenharmony_ci	struct radeon_ps requested_rps;
2928c2ecf20Sopenharmony_ci	struct ci_ps requested_ps;
2938c2ecf20Sopenharmony_ci	/* fan control */
2948c2ecf20Sopenharmony_ci	bool fan_ctrl_is_in_default_mode;
2958c2ecf20Sopenharmony_ci	bool fan_is_controlled_by_smc;
2968c2ecf20Sopenharmony_ci	u32 t_min;
2978c2ecf20Sopenharmony_ci	u32 fan_ctrl_default_mode;
2988c2ecf20Sopenharmony_ci};
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci#define CISLANDS_VOLTAGE_CONTROL_NONE                   0x0
3018c2ecf20Sopenharmony_ci#define CISLANDS_VOLTAGE_CONTROL_BY_GPIO                0x1
3028c2ecf20Sopenharmony_ci#define CISLANDS_VOLTAGE_CONTROL_BY_SVID2               0x2
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci#define CISLANDS_Q88_FORMAT_CONVERSION_UNIT             256
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT0                              0x3FFFC000
3078c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT1                              0x000400
3088c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT2                              0xC00080
3098c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT3                              0xC00200
3108c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT4                              0xC01680
3118c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT5                              0xC00033
3128c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT6                              0xC00033
3138c2ecf20Sopenharmony_ci#define CISLANDS_VRC_DFLT7                              0x3FFFC000
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci#define CISLANDS_CGULVPARAMETER_DFLT                    0x00040035
3168c2ecf20Sopenharmony_ci#define CISLAND_TARGETACTIVITY_DFLT                     30
3178c2ecf20Sopenharmony_ci#define CISLAND_MCLK_TARGETACTIVITY_DFLT                10
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci#define PCIE_PERF_REQ_REMOVE_REGISTRY   0
3208c2ecf20Sopenharmony_ci#define PCIE_PERF_REQ_FORCE_LOWPOWER    1
3218c2ecf20Sopenharmony_ci#define PCIE_PERF_REQ_PECI_GEN1         2
3228c2ecf20Sopenharmony_ci#define PCIE_PERF_REQ_PECI_GEN2         3
3238c2ecf20Sopenharmony_ci#define PCIE_PERF_REQ_PECI_GEN3         4
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ciint ci_copy_bytes_to_smc(struct radeon_device *rdev,
3268c2ecf20Sopenharmony_ci			 u32 smc_start_address,
3278c2ecf20Sopenharmony_ci			 const u8 *src, u32 byte_count, u32 limit);
3288c2ecf20Sopenharmony_civoid ci_start_smc(struct radeon_device *rdev);
3298c2ecf20Sopenharmony_civoid ci_reset_smc(struct radeon_device *rdev);
3308c2ecf20Sopenharmony_ciint ci_program_jump_on_start(struct radeon_device *rdev);
3318c2ecf20Sopenharmony_civoid ci_stop_smc_clock(struct radeon_device *rdev);
3328c2ecf20Sopenharmony_civoid ci_start_smc_clock(struct radeon_device *rdev);
3338c2ecf20Sopenharmony_cibool ci_is_smc_running(struct radeon_device *rdev);
3348c2ecf20Sopenharmony_ciPPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev);
3358c2ecf20Sopenharmony_ciint ci_load_smc_ucode(struct radeon_device *rdev, u32 limit);
3368c2ecf20Sopenharmony_ciint ci_read_smc_sram_dword(struct radeon_device *rdev,
3378c2ecf20Sopenharmony_ci			   u32 smc_address, u32 *value, u32 limit);
3388c2ecf20Sopenharmony_ciint ci_write_smc_sram_dword(struct radeon_device *rdev,
3398c2ecf20Sopenharmony_ci			    u32 smc_address, u32 value, u32 limit);
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci#endif
342