linux/drivers/gpu/drm/radeon/cypress_dpm.c

/*
 * Copyright 2011 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: Alex Deucher
 */

#include <linux/pci.h>

#include "atom.h"
#include "cypress_dpm.h"
#include "evergreen.h"
#include "evergreend.h"
#include "r600_dpm.h"
#include "rv770.h"
#include "radeon.h"
#include "radeon_asic.h"

#define SMC_RAM_END

#define MC_CG_ARB_FREQ_F0
#define MC_CG_ARB_FREQ_F1
#define MC_CG_ARB_FREQ_F2
#define MC_CG_ARB_FREQ_F3

#define MC_CG_SEQ_DRAMCONF_S0
#define MC_CG_SEQ_DRAMCONF_S1
#define MC_CG_SEQ_YCLK_SUSPEND
#define MC_CG_SEQ_YCLK_RESUME

static void cypress_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev,
						 bool enable)
{}

static void cypress_enable_dynamic_pcie_gen2(struct radeon_device *rdev,
					     bool enable)
{}

#if 0
static int cypress_enter_ulp_state(struct radeon_device *rdev)
{
	struct rv7xx_power_info *pi = rv770_get_pi(rdev);

	if (pi->gfx_clock_gating) {
		WREG32_P(SCLK_PWRMGT_CNTL, 0, ~DYN_GFX_CLK_OFF_EN);
		WREG32_P(SCLK_PWRMGT_CNTL, GFX_CLK_FORCE_ON, ~GFX_CLK_FORCE_ON);
		WREG32_P(SCLK_PWRMGT_CNTL, 0, ~GFX_CLK_FORCE_ON);

		RREG32(GB_ADDR_CONFIG);
	}

	WREG32_P(SMC_MSG, HOST_SMC_MSG(PPSMC_MSG_SwitchToMinimumPower),
		 ~HOST_SMC_MSG_MASK);

	udelay(7000);

	return 0;
}
#endif

static void cypress_gfx_clock_gating_enable(struct radeon_device *rdev,
					    bool enable)
{}

static void cypress_mg_clock_gating_enable(struct radeon_device *rdev,
					   bool enable)
{}

void cypress_enable_spread_spectrum(struct radeon_device *rdev,
				    bool enable)
{}

void cypress_start_dpm(struct radeon_device *rdev)
{}

void cypress_enable_sclk_control(struct radeon_device *rdev,
				 bool enable)
{}

void cypress_enable_mclk_control(struct radeon_device *rdev,
				 bool enable)
{}

int cypress_notify_smc_display_change(struct radeon_device *rdev,
				      bool has_display)
{}

void cypress_program_response_times(struct radeon_device *rdev)
{}

static int cypress_pcie_performance_request(struct radeon_device *rdev,
					    u8 perf_req, bool advertise)
{}

void cypress_advertise_gen2_capability(struct radeon_device *rdev)
{}

static enum radeon_pcie_gen cypress_get_maximum_link_speed(struct radeon_ps *radeon_state)
{}

void cypress_notify_link_speed_change_after_state_change(struct radeon_device *rdev,
							 struct radeon_ps *radeon_new_state,
							 struct radeon_ps *radeon_current_state)
{}

void cypress_notify_link_speed_change_before_state_change(struct radeon_device *rdev,
							  struct radeon_ps *radeon_new_state,
							  struct radeon_ps *radeon_current_state)
{}

static int cypress_populate_voltage_value(struct radeon_device *rdev,
					  struct atom_voltage_table *table,
					  u16 value, RV770_SMC_VOLTAGE_VALUE *voltage)
{}

u8 cypress_get_strobe_mode_settings(struct radeon_device *rdev, u32 mclk)
{}

u32 cypress_map_clkf_to_ibias(struct radeon_device *rdev, u32 clkf)
{}

static int cypress_populate_mclk_value(struct radeon_device *rdev,
				       u32 engine_clock, u32 memory_clock,
				       RV7XX_SMC_MCLK_VALUE *mclk,
				       bool strobe_mode, bool dll_state_on)
{}

u8 cypress_get_mclk_frequency_ratio(struct radeon_device *rdev,
				    u32 memory_clock, bool strobe_mode)
{}

static int cypress_populate_mvdd_value(struct radeon_device *rdev,
				       u32 mclk,
				       RV770_SMC_VOLTAGE_VALUE *voltage)
{}

int cypress_convert_power_level_to_smc(struct radeon_device *rdev,
				       struct rv7xx_pl *pl,
				       RV770_SMC_HW_PERFORMANCE_LEVEL *level,
				       u8 watermark_level)
{}

static int cypress_convert_power_state_to_smc(struct radeon_device *rdev,
					      struct radeon_ps *radeon_state,
					      RV770_SMC_SWSTATE *smc_state)
{}

static void cypress_convert_mc_registers(struct evergreen_mc_reg_entry *entry,
					 SMC_Evergreen_MCRegisterSet *data,
					 u32 num_entries, u32 valid_flag)
{}

static void cypress_convert_mc_reg_table_entry_to_smc(struct radeon_device *rdev,
						      struct rv7xx_pl *pl,
						      SMC_Evergreen_MCRegisterSet *mc_reg_table_data)
{}

static void cypress_convert_mc_reg_table_to_smc(struct radeon_device *rdev,
						struct radeon_ps *radeon_state,
						SMC_Evergreen_MCRegisters *mc_reg_table)
{}

int cypress_upload_sw_state(struct radeon_device *rdev,
			    struct radeon_ps *radeon_new_state)
{}

int cypress_upload_mc_reg_table(struct radeon_device *rdev,
				struct radeon_ps *radeon_new_state)
{}

u32 cypress_calculate_burst_time(struct radeon_device *rdev,
				 u32 engine_clock, u32 memory_clock)
{}

void cypress_program_memory_timing_parameters(struct radeon_device *rdev,
					      struct radeon_ps *radeon_new_state)
{}

static void cypress_populate_mc_reg_addresses(struct radeon_device *rdev,
					      SMC_Evergreen_MCRegisters *mc_reg_table)
{}

static void cypress_set_mc_reg_address_table(struct radeon_device *rdev)
{}

static void cypress_retrieve_ac_timing_for_one_entry(struct radeon_device *rdev,
						     struct evergreen_mc_reg_entry *entry)
{}

static void cypress_retrieve_ac_timing_for_all_ranges(struct radeon_device *rdev,
						      struct atom_memory_clock_range_table *range_table)
{}

static int cypress_initialize_mc_reg_table(struct radeon_device *rdev)
{}

static void cypress_wait_for_mc_sequencer(struct radeon_device *rdev, u8 value)
{}

static void cypress_force_mc_use_s1(struct radeon_device *rdev,
				    struct radeon_ps *radeon_boot_state)
{}

static void cypress_copy_ac_timing_from_s1_to_s0(struct radeon_device *rdev)
{}

static void cypress_force_mc_use_s0(struct radeon_device *rdev,
				    struct radeon_ps *radeon_boot_state)
{}

static int cypress_populate_initial_mvdd_value(struct radeon_device *rdev,
					       RV770_SMC_VOLTAGE_VALUE *voltage)
{}

int cypress_populate_smc_initial_state(struct radeon_device *rdev,
				       struct radeon_ps *radeon_initial_state,
				       RV770_SMC_STATETABLE *table)
{}

int cypress_populate_smc_acpi_state(struct radeon_device *rdev,
				    RV770_SMC_STATETABLE *table)
{}

static void cypress_trim_voltage_table_to_fit_state_table(struct radeon_device *rdev,
							  struct atom_voltage_table *voltage_table)
{}

int cypress_construct_voltage_tables(struct radeon_device *rdev)
{}

static void cypress_populate_smc_voltage_table(struct radeon_device *rdev,
					       struct atom_voltage_table *voltage_table,
					       RV770_SMC_STATETABLE *table)
{}

int cypress_populate_smc_voltage_tables(struct radeon_device *rdev,
					RV770_SMC_STATETABLE *table)
{}

static u32 cypress_get_mclk_split_point(struct atom_memory_info *memory_info)
{}

int cypress_get_mvdd_configuration(struct radeon_device *rdev)
{}

static int cypress_init_smc_table(struct radeon_device *rdev,
				  struct radeon_ps *radeon_boot_state)
{}

int cypress_populate_mc_reg_table(struct radeon_device *rdev,
				  struct radeon_ps *radeon_boot_state)
{}

int cypress_get_table_locations(struct radeon_device *rdev)
{}

void cypress_enable_display_gap(struct radeon_device *rdev)
{}

static void cypress_program_display_gap(struct radeon_device *rdev)
{}

void cypress_dpm_setup_asic(struct radeon_device *rdev)
{}

int cypress_dpm_enable(struct radeon_device *rdev)
{}

void cypress_dpm_disable(struct radeon_device *rdev)
{}

int cypress_dpm_set_power_state(struct radeon_device *rdev)
{}

#if 0
void cypress_dpm_reset_asic(struct radeon_device *rdev)
{
	rv770_restrict_performance_levels_before_switch(rdev);
	rv770_set_boot_state(rdev);
}
#endif

void cypress_dpm_display_configuration_changed(struct radeon_device *rdev)
{}

int cypress_dpm_init(struct radeon_device *rdev)
{}

void cypress_dpm_fini(struct radeon_device *rdev)
{}

bool cypress_dpm_vblank_too_short(struct radeon_device *rdev)
{}