#include "radeon.h"
#include "radeon_asic.h"
#include "sumod.h"
#include "r600_dpm.h"
#include "cypress_dpm.h"
#include "sumo_dpm.h"
#include <linux/seq_file.h>
#define SUMO_MAX_DEEPSLEEP_DIVIDER_ID …
#define SUMO_MINIMUM_ENGINE_CLOCK …
#define BOOST_DPM_LEVEL …
static const u32 sumo_utc[SUMO_PM_NUMBER_OF_TC] = …;
static const u32 sumo_dtc[SUMO_PM_NUMBER_OF_TC] = …;
static struct sumo_ps *sumo_get_ps(struct radeon_ps *rps)
{ … }
struct sumo_power_info *sumo_get_pi(struct radeon_device *rdev)
{ … }
static void sumo_gfx_clockgating_enable(struct radeon_device *rdev, bool enable)
{ … }
#define CGCG_CGTT_LOCAL0_MASK …
#define CGCG_CGTT_LOCAL1_MASK …
static void sumo_mg_clockgating_enable(struct radeon_device *rdev, bool enable)
{ … }
static void sumo_program_git(struct radeon_device *rdev)
{ … }
static void sumo_program_grsd(struct radeon_device *rdev)
{ … }
void sumo_gfx_clockgating_initialize(struct radeon_device *rdev)
{ … }
static void sumo_gfx_powergating_initialize(struct radeon_device *rdev)
{ … }
static void sumo_gfx_powergating_enable(struct radeon_device *rdev, bool enable)
{ … }
static int sumo_enable_clock_power_gating(struct radeon_device *rdev)
{ … }
static void sumo_disable_clock_power_gating(struct radeon_device *rdev)
{ … }
static void sumo_calculate_bsp(struct radeon_device *rdev,
u32 high_clk)
{ … }
static void sumo_init_bsp(struct radeon_device *rdev)
{ … }
static void sumo_program_bsp(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
static void sumo_write_at(struct radeon_device *rdev,
u32 index, u32 value)
{ … }
static void sumo_program_at(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
static void sumo_program_tp(struct radeon_device *rdev)
{ … }
void sumo_program_vc(struct radeon_device *rdev, u32 vrc)
{ … }
void sumo_clear_vc(struct radeon_device *rdev)
{ … }
void sumo_program_sstp(struct radeon_device *rdev)
{ … }
static void sumo_set_divider_value(struct radeon_device *rdev,
u32 index, u32 divider)
{ … }
static void sumo_set_ds_dividers(struct radeon_device *rdev,
u32 index, u32 divider)
{ … }
static void sumo_set_ss_dividers(struct radeon_device *rdev,
u32 index, u32 divider)
{ … }
static void sumo_set_vid(struct radeon_device *rdev, u32 index, u32 vid)
{ … }
static void sumo_set_allos_gnb_slow(struct radeon_device *rdev, u32 index, u32 gnb_slow)
{ … }
static void sumo_program_power_level(struct radeon_device *rdev,
struct sumo_pl *pl, u32 index)
{ … }
static void sumo_power_level_enable(struct radeon_device *rdev, u32 index, bool enable)
{ … }
static bool sumo_dpm_enabled(struct radeon_device *rdev)
{ … }
static void sumo_start_dpm(struct radeon_device *rdev)
{ … }
static void sumo_stop_dpm(struct radeon_device *rdev)
{ … }
static void sumo_set_forced_mode(struct radeon_device *rdev, bool enable)
{ … }
static void sumo_set_forced_mode_enabled(struct radeon_device *rdev)
{ … }
static void sumo_wait_for_level_0(struct radeon_device *rdev)
{ … }
static void sumo_set_forced_mode_disabled(struct radeon_device *rdev)
{ … }
static void sumo_enable_power_level_0(struct radeon_device *rdev)
{ … }
static void sumo_patch_boost_state(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
static void sumo_pre_notify_alt_vddnb_change(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
static void sumo_post_notify_alt_vddnb_change(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
static void sumo_enable_boost(struct radeon_device *rdev,
struct radeon_ps *rps,
bool enable)
{ … }
static void sumo_set_forced_level(struct radeon_device *rdev, u32 index)
{ … }
static void sumo_set_forced_level_0(struct radeon_device *rdev)
{ … }
static void sumo_program_wl(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
static void sumo_program_power_levels_0_to_n(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
static void sumo_enable_acpi_pm(struct radeon_device *rdev)
{ … }
static void sumo_program_power_level_enter_state(struct radeon_device *rdev)
{ … }
static void sumo_program_acpi_power_level(struct radeon_device *rdev)
{ … }
static void sumo_program_bootup_state(struct radeon_device *rdev)
{ … }
static void sumo_setup_uvd_clocks(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
static void sumo_set_uvd_clock_before_set_eng_clock(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
static void sumo_set_uvd_clock_after_set_eng_clock(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
void sumo_take_smu_control(struct radeon_device *rdev, bool enable)
{ … }
static void sumo_enable_sclk_ds(struct radeon_device *rdev, bool enable)
{ … }
static void sumo_program_bootup_at(struct radeon_device *rdev)
{ … }
static void sumo_reset_am(struct radeon_device *rdev)
{ … }
static void sumo_start_am(struct radeon_device *rdev)
{ … }
static void sumo_program_ttp(struct radeon_device *rdev)
{ … }
static void sumo_program_ttt(struct radeon_device *rdev)
{ … }
static void sumo_enable_voltage_scaling(struct radeon_device *rdev, bool enable)
{ … }
static void sumo_override_cnb_thermal_events(struct radeon_device *rdev)
{ … }
static void sumo_program_dc_hto(struct radeon_device *rdev)
{ … }
static void sumo_force_nbp_state(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
u32 sumo_get_sleep_divider_from_id(u32 id)
{ … }
u32 sumo_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
u32 sclk,
u32 min_sclk_in_sr)
{ … }
static u32 sumo_get_valid_engine_clock(struct radeon_device *rdev,
u32 lower_limit)
{ … }
static void sumo_patch_thermal_state(struct radeon_device *rdev,
struct sumo_ps *ps,
struct sumo_ps *current_ps)
{ … }
static void sumo_apply_state_adjust_rules(struct radeon_device *rdev,
struct radeon_ps *new_rps,
struct radeon_ps *old_rps)
{ … }
static void sumo_cleanup_asic(struct radeon_device *rdev)
{ … }
static int sumo_set_thermal_temperature_range(struct radeon_device *rdev,
int min_temp, int max_temp)
{ … }
static void sumo_update_current_ps(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
static void sumo_update_requested_ps(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
int sumo_dpm_enable(struct radeon_device *rdev)
{ … }
int sumo_dpm_late_enable(struct radeon_device *rdev)
{ … }
void sumo_dpm_disable(struct radeon_device *rdev)
{ … }
int sumo_dpm_pre_set_power_state(struct radeon_device *rdev)
{ … }
int sumo_dpm_set_power_state(struct radeon_device *rdev)
{ … }
void sumo_dpm_post_set_power_state(struct radeon_device *rdev)
{ … }
#if 0
void sumo_dpm_reset_asic(struct radeon_device *rdev)
{
sumo_program_bootup_state(rdev);
sumo_enable_power_level_0(rdev);
sumo_set_forced_level_0(rdev);
sumo_set_forced_mode_enabled(rdev);
sumo_wait_for_level_0(rdev);
sumo_set_forced_mode_disabled(rdev);
sumo_set_forced_mode_enabled(rdev);
sumo_set_forced_mode_disabled(rdev);
}
#endif
void sumo_dpm_setup_asic(struct radeon_device *rdev)
{ … }
void sumo_dpm_display_configuration_changed(struct radeon_device *rdev)
{ … }
power_info;
pplib_clock_info;
pplib_power_state;
static void sumo_patch_boot_state(struct radeon_device *rdev,
struct sumo_ps *ps)
{ … }
static void sumo_parse_pplib_non_clock_info(struct radeon_device *rdev,
struct radeon_ps *rps,
struct _ATOM_PPLIB_NONCLOCK_INFO *non_clock_info,
u8 table_rev)
{ … }
static void sumo_parse_pplib_clock_info(struct radeon_device *rdev,
struct radeon_ps *rps, int index,
union pplib_clock_info *clock_info)
{ … }
static int sumo_parse_power_table(struct radeon_device *rdev)
{ … }
u32 sumo_convert_vid2_to_vid7(struct radeon_device *rdev,
struct sumo_vid_mapping_table *vid_mapping_table,
u32 vid_2bit)
{ … }
#if 0
u32 sumo_convert_vid7_to_vid2(struct radeon_device *rdev,
struct sumo_vid_mapping_table *vid_mapping_table,
u32 vid_7bit)
{
u32 i;
for (i = 0; i < vid_mapping_table->num_entries; i++) {
if (vid_mapping_table->entries[i].vid_7bit == vid_7bit)
return vid_mapping_table->entries[i].vid_2bit;
}
return vid_mapping_table->entries[vid_mapping_table->num_entries - 1].vid_2bit;
}
#endif
static u16 sumo_convert_voltage_index_to_value(struct radeon_device *rdev,
u32 vid_2bit)
{ … }
static void sumo_construct_display_voltage_mapping_table(struct radeon_device *rdev,
struct sumo_disp_clock_voltage_mapping_table *disp_clk_voltage_mapping_table,
ATOM_CLK_VOLT_CAPABILITY *table)
{ … }
void sumo_construct_sclk_voltage_mapping_table(struct radeon_device *rdev,
struct sumo_sclk_voltage_mapping_table *sclk_voltage_mapping_table,
ATOM_AVAILABLE_SCLK_LIST *table)
{ … }
void sumo_construct_vid_mapping_table(struct radeon_device *rdev,
struct sumo_vid_mapping_table *vid_mapping_table,
ATOM_AVAILABLE_SCLK_LIST *table)
{ … }
igp_info;
static int sumo_parse_sys_info_table(struct radeon_device *rdev)
{ … }
static void sumo_construct_boot_and_acpi_state(struct radeon_device *rdev)
{ … }
int sumo_dpm_init(struct radeon_device *rdev)
{ … }
void sumo_dpm_print_power_state(struct radeon_device *rdev,
struct radeon_ps *rps)
{ … }
void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m)
{ … }
u32 sumo_dpm_get_current_sclk(struct radeon_device *rdev)
{ … }
u32 sumo_dpm_get_current_mclk(struct radeon_device *rdev)
{ … }
u16 sumo_dpm_get_current_vddc(struct radeon_device *rdev)
{ … }
void sumo_dpm_fini(struct radeon_device *rdev)
{ … }
u32 sumo_dpm_get_sclk(struct radeon_device *rdev, bool low)
{ … }
u32 sumo_dpm_get_mclk(struct radeon_device *rdev, bool low)
{ … }
int sumo_dpm_force_performance_level(struct radeon_device *rdev,
enum radeon_dpm_forced_level level)
{ … }