#define SWSMU_CODE_LAYER_L2
#include "amdgpu.h"
#include "amdgpu_smu.h"
#include "smu_v13_0.h"
#include "smu13_driver_if_yellow_carp.h"
#include "yellow_carp_ppt.h"
#include "smu_v13_0_1_ppsmc.h"
#include "smu_v13_0_1_pmfw.h"
#include "smu_cmn.h"
#undef pr_err
#undef pr_warn
#undef pr_info
#undef pr_debug
#define regSMUIO_GFX_MISC_CNTL …
#define regSMUIO_GFX_MISC_CNTL_BASE_IDX …
#define SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS_MASK …
#define SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS__SHIFT …
#define SMU_13_0_8_UMD_PSTATE_GFXCLK …
#define SMU_13_0_8_UMD_PSTATE_SOCCLK …
#define SMU_13_0_8_UMD_PSTATE_FCLK …
#define SMU_13_0_1_UMD_PSTATE_GFXCLK …
#define SMU_13_0_1_UMD_PSTATE_SOCCLK …
#define SMU_13_0_1_UMD_PSTATE_FCLK …
#define FEATURE_MASK(feature) …
#define SMC_DPM_FEATURE …
static struct cmn2asic_msg_mapping yellow_carp_message_map[SMU_MSG_MAX_COUNT] = …;
static struct cmn2asic_mapping yellow_carp_feature_mask_map[SMU_FEATURE_COUNT] = …;
static struct cmn2asic_mapping yellow_carp_table_map[SMU_TABLE_COUNT] = …;
static int yellow_carp_init_smc_tables(struct smu_context *smu)
{ … }
static int yellow_carp_fini_smc_tables(struct smu_context *smu)
{ … }
static int yellow_carp_system_features_control(struct smu_context *smu, bool en)
{ … }
static int yellow_carp_dpm_set_vcn_enable(struct smu_context *smu, bool enable)
{ … }
static int yellow_carp_dpm_set_jpeg_enable(struct smu_context *smu, bool enable)
{ … }
static bool yellow_carp_is_dpm_running(struct smu_context *smu)
{ … }
static int yellow_carp_post_smu_init(struct smu_context *smu)
{ … }
static int yellow_carp_mode_reset(struct smu_context *smu, int type)
{ … }
static int yellow_carp_mode2_reset(struct smu_context *smu)
{ … }
static void yellow_carp_get_ss_power_percent(SmuMetrics_t *metrics,
uint32_t *apu_percent, uint32_t *dgpu_percent)
{ … }
static int yellow_carp_get_smu_metrics_data(struct smu_context *smu,
MetricsMember_t member,
uint32_t *value)
{ … }
static int yellow_carp_read_sensor(struct smu_context *smu,
enum amd_pp_sensors sensor,
void *data, uint32_t *size)
{ … }
static int yellow_carp_set_watermarks_table(struct smu_context *smu,
struct pp_smu_wm_range_sets *clock_ranges)
{ … }
static ssize_t yellow_carp_get_gpu_metrics(struct smu_context *smu,
void **table)
{ … }
static uint32_t yellow_carp_get_gfxoff_status(struct smu_context *smu)
{ … }
static int yellow_carp_set_default_dpm_tables(struct smu_context *smu)
{ … }
static int yellow_carp_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TABLE_COMMAND type,
long input[], uint32_t size)
{ … }
static int yellow_carp_get_current_clk_freq(struct smu_context *smu,
enum smu_clk_type clk_type,
uint32_t *value)
{ … }
static int yellow_carp_get_dpm_level_count(struct smu_context *smu,
enum smu_clk_type clk_type,
uint32_t *count)
{ … }
static int yellow_carp_get_dpm_freq_by_index(struct smu_context *smu,
enum smu_clk_type clk_type,
uint32_t dpm_level,
uint32_t *freq)
{ … }
static bool yellow_carp_clk_dpm_is_enabled(struct smu_context *smu,
enum smu_clk_type clk_type)
{ … }
static int yellow_carp_get_dpm_ultimate_freq(struct smu_context *smu,
enum smu_clk_type clk_type,
uint32_t *min,
uint32_t *max)
{ … }
static int yellow_carp_set_soft_freq_limited_range(struct smu_context *smu,
enum smu_clk_type clk_type,
uint32_t min,
uint32_t max)
{ … }
static uint32_t yellow_carp_get_umd_pstate_clk_default(struct smu_context *smu,
enum smu_clk_type clk_type)
{ … }
static int yellow_carp_print_clk_levels(struct smu_context *smu,
enum smu_clk_type clk_type, char *buf)
{ … }
static int yellow_carp_force_clk_levels(struct smu_context *smu,
enum smu_clk_type clk_type, uint32_t mask)
{ … }
static int yellow_carp_get_dpm_profile_freq(struct smu_context *smu,
enum amd_dpm_forced_level level,
enum smu_clk_type clk_type,
uint32_t *min_clk,
uint32_t *max_clk)
{ … }
static int yellow_carp_set_performance_level(struct smu_context *smu,
enum amd_dpm_forced_level level)
{ … }
static int yellow_carp_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
{ … }
static const struct pptable_funcs yellow_carp_ppt_funcs = …;
void yellow_carp_set_ppt_funcs(struct smu_context *smu)
{ … }