/* * Copyright 2017 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: AMD *
*/
#ifndef DM_PP_SMU_IF__H #define DM_PP_SMU_IF__H
/* * interface to PPLIB/SMU to setup clocks and pstate requirements on SoC
*/
enum pp_smu_ver { /* * PP_SMU_INTERFACE_X should be interpreted as the interface defined * starting from X, where X is some family of ASICs. This is as * opposed to interfaces used only for X. There will be some degree * of interface sharing between families of ASIcs.
*/
PP_SMU_UNSUPPORTED,
PP_SMU_VER_RV,
PP_SMU_VER_NV,
/* This structure is a copy of WatermarkRowGeneric_t defined by smuxx_driver_if.h*/ struct pp_smu_wm_set_range {
uint16_t min_fill_clk_mhz;
uint16_t max_fill_clk_mhz;
uint16_t min_drain_clk_mhz;
uint16_t max_drain_clk_mhz;
void (*set_display_count)(struct pp_smu *pp, int count);
/* reader and writer WM's are sent together as part of one table*/ /* * PPSMC_MSG_SetDriverDramAddrHigh * PPSMC_MSG_SetDriverDramAddrLow * PPSMC_MSG_TransferTableDram2Smu *
* */ void (*set_wm_ranges)(struct pp_smu *pp, struct pp_smu_wm_range_sets *ranges);
/* PPSMC_MSG_SetHardMinDcfclkByFreq * fixed clock at requested freq, either from FCH bypass or DFS
*/ void (*set_hard_min_dcfclk_by_freq)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetMinDeepSleepDcfclk * when DF is in cstate, dcf clock is further divided down * to just above given frequency
*/ void (*set_min_deep_sleep_dcfclk)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetHardMinFclkByFreq * FCLK will vary with DPM, but never below requested hard min
*/ void (*set_hard_min_fclk_by_freq)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetHardMinSocclkByFreq * Needed for DWB support
*/ void (*set_hard_min_socclk_by_freq)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetHardMinDcfclkByFreq * fixed clock at requested freq, either from FCH bypass or DFS
*/ enum pp_smu_status (*set_hard_min_dcfclk_by_freq)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetMinDeepSleepDcfclk * when DF is in cstate, dcf clock is further divided down * to just above given frequency
*/ enum pp_smu_status (*set_min_deep_sleep_dcfclk)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetHardMinUclkByFreq * UCLK will vary with DPM, but never below requested hard min
*/ enum pp_smu_status (*set_hard_min_uclk_by_freq)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetHardMinSocclkByFreq * Needed for DWB support
*/ enum pp_smu_status (*set_hard_min_socclk_by_freq)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetHardMinByFreq * Needed to set ASIC voltages for clocks programmed by DAL
*/ enum pp_smu_status (*set_voltage_by_freq)(struct pp_smu *pp, enum pp_smu_nv_clock_id clock_id, int Mhz);
/* reader and writer WM's are sent together as part of one table*/ /* * PPSMC_MSG_SetDriverDramAddrHigh * PPSMC_MSG_SetDriverDramAddrLow * PPSMC_MSG_TransferTableDram2Smu * * on DCN20: * reader fill clk = uclk * reader drain clk = dcfclk * writer fill clk = socclk * writer drain clk = uclk
* */ enum pp_smu_status (*set_wm_ranges)(struct pp_smu *pp, struct pp_smu_wm_range_sets *ranges);
/* Not a single SMU message. This call should return maximum sustainable limit for all * clocks that DC depends on. These will be used as basis for mode enumeration.
*/ enum pp_smu_status (*get_maximum_sustainable_clocks)(struct pp_smu *pp, struct pp_smu_nv_clock_table *max_clocks);
/* This call should return the discrete uclk DPM states available
*/ enum pp_smu_status (*get_uclk_dpm_states)(struct pp_smu *pp, unsignedint *clock_values_in_khz, unsignedint *num_states);
/* Not a single SMU message. This call informs PPLIB that display will not be able * to perform pstate handshaking in its current state. Typically this handshake * is used to perform uCLK switching, so disabling pstate disables uCLK switching. * * Note that when setting handshake to unsupported, the call is pre-emptive. That means * DC will make the call BEFORE setting up the display state which would cause pstate * request to go un-acked. Only when the call completes should such a state be applied to * DC hardware
*/ enum pp_smu_status (*set_pstate_handshake_support)(struct pp_smu *pp, bool pstate_handshake_supported);
};
struct dpm_clock {
uint32_t Freq; // In MHz
uint32_t Vol; // Millivolts with 2 fractional bits
};
/* this is a copy of the structure defined in smuxx_driver_if.h*/ struct dpm_clocks { struct dpm_clock DcfClocks[PP_SMU_NUM_DCFCLK_DPM_LEVELS]; struct dpm_clock SocClocks[PP_SMU_NUM_SOCCLK_DPM_LEVELS]; struct dpm_clock FClocks[PP_SMU_NUM_FCLK_DPM_LEVELS]; struct dpm_clock MemClocks[PP_SMU_NUM_MEMCLK_DPM_LEVELS]; struct dpm_clock VClocks[PP_SMU_NUM_VCLK_DPM_LEVELS]; struct dpm_clock DClocks[PP_SMU_NUM_DCLK_DPM_LEVELS]; struct dpm_clock VPEClocks[PP_SMU_NUM_VPECLK_DPM_LEVELS];
};
struct pp_smu_funcs_rn { struct pp_smu pp_smu;
/* * reader and writer WM's are sent together as part of one table * * PPSMC_MSG_SetDriverDramAddrHigh * PPSMC_MSG_SetDriverDramAddrLow * PPSMC_MSG_TransferTableDram2Smu *
*/ enum pp_smu_status (*set_wm_ranges)(struct pp_smu *pp, struct pp_smu_wm_range_sets *ranges);
/* * reader and writer WM's are sent together as part of one table * * PPSMC_MSG_SetDriverDramAddrHigh * PPSMC_MSG_SetDriverDramAddrLow * PPSMC_MSG_TransferTableDram2Smu *
*/ // TODO: Check whether this is moved to DAL, and remove as needed enum pp_smu_status (*set_wm_ranges)(struct pp_smu *pp, struct pp_smu_wm_range_sets *ranges);
// TODO: Check whether this is moved to DAL, and remove as needed enum pp_smu_status (*get_dpm_clock_table) (struct pp_smu *pp, struct dpm_clocks *clock_table);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.