linux/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c

/*
 * Copyright 2015 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.
 *
 */

#include <linux/pci.h>

#include "pp_debug.h"
#include "smumgr.h"
#include "smu74.h"
#include "smu_ucode_xfer_vi.h"
#include "polaris10_smumgr.h"
#include "smu74_discrete.h"
#include "smu/smu_7_1_3_d.h"
#include "smu/smu_7_1_3_sh_mask.h"
#include "gmc/gmc_8_1_d.h"
#include "gmc/gmc_8_1_sh_mask.h"
#include "oss/oss_3_0_d.h"
#include "gca/gfx_8_0_d.h"
#include "bif/bif_5_0_d.h"
#include "bif/bif_5_0_sh_mask.h"
#include "ppatomctrl.h"
#include "cgs_common.h"
#include "smu7_ppsmc.h"
#include "smu7_smumgr.h"

#include "smu7_dyn_defaults.h"

#include "smu7_hwmgr.h"
#include "hardwaremanager.h"
#include "atombios.h"
#include "pppcielanes.h"

#include "dce/dce_10_0_d.h"
#include "dce/dce_10_0_sh_mask.h"

#define POLARIS10_SMC_SIZE
#define POWERTUNE_DEFAULT_SET_MAX
#define VDDC_VDDCI_DELTA
#define MC_CG_ARB_FREQ_F1

static const struct polaris10_pt_defaults polaris10_power_tune_data_set_array[POWERTUNE_DEFAULT_SET_MAX] =;

static const sclkFcwRange_t Range_Table[NUM_SCLK_RANGE] =;

#define PPPOLARIS10_TARGETACTIVITY_DFLT

static const SMU74_Discrete_GraphicsLevel avfs_graphics_level_polaris10[8] =;

static const SMU74_Discrete_MemoryLevel avfs_memory_level_polaris10 =;

static int polaris10_perform_btc(struct pp_hwmgr *hwmgr)
{}


static int polaris10_setup_graphics_level_structure(struct pp_hwmgr *hwmgr)
{}


static int polaris10_avfs_event_mgr(struct pp_hwmgr *hwmgr)
{}

static int polaris10_start_smu_in_protection_mode(struct pp_hwmgr *hwmgr)
{}

static int polaris10_start_smu_in_non_protection_mode(struct pp_hwmgr *hwmgr)
{}

static int polaris10_start_smu(struct pp_hwmgr *hwmgr)
{}

static bool polaris10_is_hw_avfs_present(struct pp_hwmgr *hwmgr)
{}

static int polaris10_smu_init(struct pp_hwmgr *hwmgr)
{}

static int polaris10_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr,
		struct phm_ppt_v1_clock_voltage_dependency_table *dep_table,
		uint32_t clock, SMU_VoltageLevel *voltage, uint32_t *mvdd)
{}

static uint16_t scale_fan_gain_settings(uint16_t raw_setting)
{}

static int polaris10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr)
{}

static void polaris10_populate_zero_rpm_parameters(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_svi_load_line(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_tdc_limit(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_dw8(struct pp_hwmgr *hwmgr, uint32_t fuse_table_offset)
{}

static int polaris10_populate_temperature_scaler(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_fuzzy_fan(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_gnb_lpml(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_bapm_vddc_base_leakage_sidd(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_pm_fuses(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr,
			SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_vddc_table(struct pp_hwmgr *hwmgr,
					struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_vddci_table(struct pp_hwmgr *hwmgr,
					struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_cac_table(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_voltage_tables(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_ulv_level(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_Ulv *state)
{}

static int polaris10_populate_ulv_state(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_link_level(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}


static void polaris10_get_sclk_range_table(struct pp_hwmgr *hwmgr,
				   SMU74_Discrete_DpmTable  *table)
{}

static int polaris10_calculate_sclk_params(struct pp_hwmgr *hwmgr,
		uint32_t clock, SMU_SclkSetting *sclk_setting)
{}

static int polaris10_populate_single_graphic_level(struct pp_hwmgr *hwmgr,
		uint32_t clock, struct SMU74_Discrete_GraphicsLevel *level)
{}

static void polaris10_get_vddc_shared_railinfo(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
{}


static int polaris10_populate_single_memory_level(struct pp_hwmgr *hwmgr,
		uint32_t clock, struct SMU74_Discrete_MemoryLevel *mem_level)
{}

static int polaris10_populate_all_memory_levels(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_mvdd_value(struct pp_hwmgr *hwmgr,
		uint32_t mclk, SMIO_Pattern *smio_pat)
{}

static int polaris10_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
		SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_vce_level(struct pp_hwmgr *hwmgr,
		SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_samu_level(struct pp_hwmgr *hwmgr,
		SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr,
		int32_t eng_clock, int32_t mem_clock,
		SMU74_Discrete_MCArbDramTimingTableEntry *arb_regs)
{}

static int polaris10_program_memory_timing_parameters(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_smc_uvd_level(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_boot_level(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}

static int polaris10_populate_smc_initailial_state(struct pp_hwmgr *hwmgr)
{}

#define STRAP_ASIC_RO_LSB
#define STRAP_ASIC_RO_MSB

static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)
{}

static int polaris10_populate_vr_config(struct pp_hwmgr *hwmgr,
		struct SMU74_Discrete_DpmTable *table)
{}


static int polaris10_populate_avfs_parameters(struct pp_hwmgr *hwmgr)
{}

static void polaris10_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr)
{}

static int polaris10_init_smc_table(struct pp_hwmgr *hwmgr)
{}

static int polaris10_program_mem_timing_parameters(struct pp_hwmgr *hwmgr)
{}

static int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
{}

static int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
{}

static int polaris10_update_uvd_smc_table(struct pp_hwmgr *hwmgr)
{}

static int polaris10_update_vce_smc_table(struct pp_hwmgr *hwmgr)
{}

static int polaris10_update_bif_smc_table(struct pp_hwmgr *hwmgr)
{}

static int polaris10_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)
{}

static int polaris10_update_sclk_threshold(struct pp_hwmgr *hwmgr)
{}

static uint32_t polaris10_get_offsetof(uint32_t type, uint32_t member)
{}

static uint32_t polaris10_get_mac_definition(uint32_t value)
{}

static int polaris10_process_firmware_header(struct pp_hwmgr *hwmgr)
{}

static uint8_t polaris10_get_memory_modile_index(struct pp_hwmgr *hwmgr)
{}

static int polaris10_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
{}

static bool polaris10_is_dpm_running(struct pp_hwmgr *hwmgr)
{}

static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,
				void *profile_setting)
{}

const struct pp_smumgr_func polaris10_smu_funcs =;