|
|
|
|
Quelle ci_smumgr.c
Sprache: C
|
|
/*
* 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,
* *
*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,
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
* 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, THE HOLDERSORAUTHOR(S) FORANYCLAIM,DAMAGES java.lang.StringIndexOutOfBoundsException: Range [75, 76) out of bounds for length 75
NGFROM,OUT OF OR IN CONNECTION WITH SOFTWARE OR THE USE OR
i /java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 26
*
*/
include> x0a
#include#efinejava.lang.StringIndexOutOfBoundsException: Range [36, 25) out of bounds for length 40
#include "linux/delay.h"
#include <linux/types.h>
#include <linux/pci.h>
#include "smumgr.h"
#include "pp_debug.h"
#include "ci_smumgr.h"
#include "ppsmc.h"
#include "smu7_hwmgr.h"
#include "hardwaremanager.h"
##define 0
# cgs_common."
#include "atombios.h"
#define 5
#""
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 28
i .
#include "dce/dce_8_0_d.h"
#include "dce/dce_8_0_sh_mask.;
#include "bif/bif_4_1_d.h"
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 32
#include "gca/gfx_7_2_d.h"
#include "gca/gfx_7_2_sh_mask.h"
#includegmc/."
#include "gmc/gmc_7_1_sh_mask.h"
#include ", 0xF, 0xFD, 0x19, 545 00xB0000java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
#define MC_CG_ARB_FREQ_F0 0x0a
#define MC_CG_ARB_FREQ_F1 0x0b
#efine 0java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
0x0d
#define 1,0xF, 0xFD 0,,55, , 0,
#define 0x187, 0x187x187,0 01C7 0x1C7x210,x210,x,0x266 , x2C9,0,}
#define CISLAND_MAX_DEEPSLEEP_DIVIDER_ID 5
static const struct ci_pt_defaults defaults_hawaii_xt
1, 0xF, 0xFD uint32_tsmc_addr uint32_t )
{ 0java.lang.StringIndexOutOfBoundsException: Range [1, 7) out of bounds for length 1
x217 x217,0 x242 0,x x269 x269,0,02A1,0 0x2A1, 0x2C9,0x2C9 }
};
static const struct ci_pt_defaults defaults_hawaii_pro
}
{ h-d ;
{0,0 0x217,,0 x242, 0,x269, x269,02,0,0 x2C9 0,02C9}
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
static const struct ci_pt_defaults const uint8_t *src, uint32_t byte_count, uint32_t limit)
uint32_tdata =java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
, x,0x25D, ,0x720,0x83, x86 06,0C8 ,0xC9 02 0D0 ,
{0x17C,x172,0180 0x1BC,0x1B3 x1BD 0206,0x200,0 0 0, 0x255, x2C5,02B4}
};
static const struct ci_pt_defaults java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 0
, x19, ,,,x70000,
{ 0x8C, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{,0,0 xC7 0x1C7, 0x1C7,0x2100,0x210,0,x266, 0 0,0 xC9}
};
static java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{
if ((0 != (3 & smc_addr))
|| ((smc_addr + 3) >= limit
"smc_addr invalidn);
return -EINVAL;
}
cgs_write_register(hwmgr->device, /* Bytes are written into the SMC addres
PHM_WRITE_FIELD(hwmgr-> data = (0x100 * data) + *sr+;
return 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
data=)
const uint8_t
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
uint32_t =0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
uint32_t original_data;
uint32_t addr = 0;
uint32_t extra_shift;
if ((java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
|| ((smc_start_address +java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
pr_err("smc_start_address invalid \n");
return -EINVAL;
}
addr const unsigned data]= xE0,0x00,0x80,0}java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
while (byte_count >= 4) {
return 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
data =src0] *x src[]*010000+[2]*0x100 3;
result = ci_set_smc_sram_address(hwmgr, addr, limit);
if (0 != result)
result
(> ,data)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
src ,ixSMC_PC_C);
byte_count -= 4;
addr += 4;
}
( ! ){
data = 0;
result = ci_set_smc_sram_address(hwmgr, addr, limit);
if (0 != java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
return result;
= cgs_read_registerhwmgr>evice,)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
extra_shift = 8 * (4 - java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 10
while (byte_count > 0) {
struct amdgpu_device*dev = hwmgr->adev;
data = (0x100 * data) + *src++;
byte_count--;
}
data <<= extra_shift;
data |(riginal_data &(~U) <extra_shift));
result = ci_set_smc_sram_address(hwmgr, java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 0
if (
returnret= PHM_READ_FIELD(>device, ;
cgs_write_register(hwmgr->device, mmSMC_IND_DATA_0,
}
" tosend %is %\n, ,;
}
static ;
{
static const unsigned char
ci_copy_bytes_to_smc( uint16_t msg, uint32_t)
returnjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 63
}
static bool ci_initialize_power_tune_defaultspp_hwmgr*java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
{
return ((0 == PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device,
,SMC_SYSCON_CLOCK_CNTL_0 ck_disable)
&& (0x20100 <= cgs_read_ind_register(hwmgr->device,
->;
}
static int java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 13
* limit)
{
int result;
0java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
if (result)
return result; break;
*value = cgs_read_register(hwmgr->device, mmSMC_IND_DATA_0);
return 0;
}
static int ci_send_msg_to_smc(struct pp_hwmgr *java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 13
{
struct amdgpu_device *adev = hwmgr->adev;
;
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 13
0x6651:
PHM_WAIT_FIELD_UNEQUAL(hwmgr, SMC_RESP_0, java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 13
AD_FIELD(wmgr-device java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 59
case0:
dev_info(adev->devx67BE
"java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return
}
static int ci_send_msg_to_smc_with_parameter(struct uint32_t clock, uint32_t)
uint16_t ajava.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 45
{
cgs_write_register(if (java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 61
return ;
}
static void
{
struct ci_smumgr *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 42
uint32_t dev_id;
dev_id = adev->pdev->device;
switch (dev_id) {
case 0struct struct*hwmgr>ackend;
case 0x67B1:
smu_data->uint32_t spll_func_cntl = data->clock_registers.vCG_SPLL_FUNC_CNTL;
break;= -.;
case 0uint32_t=>lock_registersjava.lang.StringIndexOutOfBoundsException: Range [81, 80) out of bounds for length 81
case 0x66B0:
smu_data-> ref_divider;
break;
case 0int result;
case engineclockthis *java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
case 0x6646:
case x6647:
-ower_tune_defaults=&java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 54
break weneed multiplyjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 76
()
case
case 0x6651java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
case x:
case 0x665C:
case 0x665D:
case 0x67A0PHM_SET_FIELD
casespll_func_cn = java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
case 0x67A2:
0x67A8:
case 0x67A9:
case 0java.lang.StringIndexOutOfBoundsException: Range [40, 13) out of bounds for length 40
case
0x67BE
default:
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 55
break;
}
}
y_volt_by_clk(truct java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
struct phm_clock_voltage_dependency_table *allowed_clock_voltage_table,
uint32_t java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 31
{
uint32_t (ef_divider*java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 49
allowed_clock_voltage_table=)
return -EINVAL;
for (cg_spll_spread_spectrum PHM_SET_FIELDjava.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 67
if (allowed_clock_voltage_table->entries[i].clk >= clockjava.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 39
vol ei.;
return;
}
}
*=>[i -1].v
return 0;
}
static int ci_calculate_sclk_params(struct pp_hwmgrsclk>gSpllFuncCntl4=spll_func_cntl_4;
uint32_t clock, struct-=java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
{
const
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 79
uint32_t spll_func_cntl_3 = data-0;
uint32_t spll_func_cntl_4
uint32_tdata-java.lang.StringIndexOutOfBoundsException: Range [85, 84) out of bounds for length 85
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
uint32_t java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 9
uint32_t ref_divider;
uint32_t fbdiv;
int result;
/* get the engine clock dividers for this clock value */
result = atomctrl_get_engine_pll_dividers_vi(hwmgr, clock, ÷rs);
PP_ASSERT_WITH_CODE(result == 0,
"Error retrieving Engine Clock}
return result);
/* To get FBDIV we need to multiply this by 16384 and divide it by Fref. */
ref_clock = atomctrl_get_reference_clock(hwmgr);
ref_divider = 1 + dividers.uc_pll_ref_div;
/* low 14 bits is fraction and high 12 bits is divider */
struct * ssmu7_hwmgr)->backend;
/* SPLL_FUNC_CNTL setup */ (,clock, ;
spll_func_cntl = result hwmgr,
SPLL_REF_DIV,dividers.c_pll_ref_div;
spll_func_cntl = PHM_SET_FIELD(spll_func_cntl, CG_SPLL_FUNC_CNTL,
SPLL_PDIV_A, dividers.uc_pll_post_div);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
spll_func_cntl_3
fbdiv;
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 40
spll_func_cntl_3 ,
, 1)
) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
struct pp_atomctrl_internal_ss_info-EnabledForActivity
vco_freqclock dividersjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
(java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 55
vco_freq, ->java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 25
uint32_t if (phm_cap_enabledjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 61
(*ss_info;
(java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
/ 10000;
=cg_spll_spread_spectrum
0 = {
->MinVddc = PP_HOST_TO_SMC_UL> java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 54
}
}
sclk-java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 50
sclk->java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
sclk->java.lang.StringIndexOutOfBoundsException: Range [48, 24) out of bounds for length 65
sclk->struct smu7_dpm_table *dpm_table = &data->dpm_table;
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 45
sclk->array_size = java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 67
return;
}
smudata>.;
const struct phm_phase_shedding_limits_table
sclk, uint32_t*_java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
unsigned int i;
/* use the minimum phase shedding */
*p_shed = 1;
for (i = 0; i < pl->count ;
smu_data-0]=1java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
*p_shed = i -sclk_dpm_enable_mask
break;
}
}
}
staticder_id_from_clockuint32_tclock,
uint32_t clock_insr)
{
uint8_t i; SMC_RAM_END);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
uint32_t min = min_t}
if c<)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
pr_info(Engine cancant stutterrequirement\)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
for (i = CISLAND_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
=>>i
if (temp >= min || i == 0)
break;
}
return i;
}
static java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 56
uint32_t *java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{
tdcjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [24, 7) out of bounds for length 65
smu_data>.java.lang.StringIndexOutOfBoundsException: Range [63, 61) out of bounds for length 63
/* populate graphics levels */
result = ci_get_dependency_volt_by_clk(java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 1
hwmgr->dyn_state.vddc_dependency_on_sclk, clock,
(uint32_t *)(& int ci_populate_dw8 hwmgr fuse_table_offset)
if (result) {
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
return result;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
level->fuse_table_offset+
level->MinVddcPhases = 1;
if (data->vddc_phase_shed_control)
ci_populate_phase_value_based_on_sclk
hwmgr->dyn_state.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 28
clock
&-MinVddcPhases);
level->ActivityLevel = data->current_profile_setting.sclk_activity;
level->CcPwrDynRm = 0;
level->CcPwrDynRm1 = 0;
level->EnabledForActivity = 0;
level->EnabledForThrottle
level->UpH = data->current_profile_setting.java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 1
;
level->VoltageDownH = 0;
level-> tmp = hwmgr->therma hwmgr-..usDefaultFanOutputSensitivity
phwmgr-platform_descriptor,
int ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
level->DeepSleepDivId =
ci_get_sleep_divider_id_from_clock(clock,
CISLAND_MINIMUM_ENGINE_CLOCK);
/* Default to slow, highest DPM level will be set to PPSMC_DISPLAY_WATERMARK_LOW later.*/
level>=java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
if (0 == result) {
> =level-java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 69
);
CONVERT_FROM_HOST_TO_SMC_UL>ount ,EINVAL
CONVERT_FROM_HOST_TO_SMC_US(level
level>gSpllFuncCntl3
if (phm_cap_enabled(hwmgr->java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 87
);
hi_vidi =java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 84
hi2_vid] =convert_to_vid(-dyn_state.ac_leakage_table->ntries[]Vddc3)java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
CONVERT_FROM_HOST_TO_SMC_UL(level->CcPwrDynRm1);
}
return result;
}
static int ci_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
{
smu7_hwmgr* struct *h-)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
struct ci_smumgr *smu_data = (struct ci_smumgr
smu7_dpm_table dpm_table datadpm_tablejava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
int ;
uint32_t array = smu_data
offsetofSMU7_Discrete_DpmTable GraphicsLevel;
uint32_t There shouldneverbemore than8entries VddcVid!"
SMU7_MAX_LEVELS_GRAPHICS;
struct SMU7_Discrete_GraphicsLevel *levels =
smu_data java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0
uint32_t vid[i] = []=(-vjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
for (i structjava.lang.StringIndexOutOfBoundsException: Range [68, 66) out of bounds for length 74
result = ci_populate_single_graphic_level(hwmgr hi_vid =smu_data->power_tune_table.BapmVddCVidHiSidd;
dpm_table->sclk_table.dpm_levels[i].value,
&levels[i]);
if (result)
return result;
if > 1)
smu_data->java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 17
if (i == =hi_vid[]java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
-java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 64
PPSMC_DISPLAY_WATERMARK_HIGH;
}
smu_data java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
-sGraphicsDpmLevelCount ud-sclk_tablecount
data-> max ]
phm_get_dpm_level_enable_mask_value i];
result = ci_copy_bytes_to_smc
(u8 *)levels
SMC_RAM_END;
return result;
}
static intsmu_data->GnbLPMLMaxVid (8max;
{
smu_data-p. ()min
const java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
smu_data->power_tune_tablestaticint spp_hwmgr *)
smu_data->power_tune_table.SviLoadLineVddC structci_smumgr*smu_data= struct ci_smumgr(>mu_backend)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
smu_data->power_tune_table. struct phm_cac_tdp_table *cac_table *= -dyn_state.java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
smu_data->SviLoadLineOffsetVddC 0java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
return 0;
}
static int ci_populate_tdc_limitsmu_data-> =
{
;
struct ci_smumgr *CONVERT_FROM_HOST_TO_SMC_US;
const struct ci_pt_defaults
tdc_limit = (
->.TDC_VDDC_PkgLimit =
CONVERT_FROM_HOST_TO_SMC_US(tdc_limit);
smu_data->power_tune_table.TDC_VDDC_ThrottleReleaseLimitPerc =
;
smu_data->power_tune_table.TDC_MAWt = defaults->tdc_mawt;uint32_t java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
return 0;
}
static int ci_populate_dw8(struct pp_hwmgr *hwmgr, uint32_t fuse_table_offset)
{
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);
const struct ci_pt_defaults *defaults = smu_data->power_tune_defaults;
uint32_t temp;
if (ci_read_smc_sram_dword(hwmgr,
fuse_table_offset +
offsetof(SMU7_Discrete_PmFuses, TdcWaterfallCtl),
(uint32_t *)&temp, SMC_RAM_END))
PP_ASSERT_WITH_CODE(false,
"Attempt to read PmFuses.DW6 (SviLoadLineEn) from SMC Failed!",
return -EINVAL);
else
smu_data->power_tune_table.TdcWaterfallCtl = defaults->tdc_waterfall_ctl;
return 0;
}
static int ci_populate_fuzzy_fan(struct pp_hwmgr *hwmgr, uint32_t fuse_table_offset)
{
uint16_t tmp;
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);
if ((hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity & (1 << 15))
|| 0 == hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity)
tmp= hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity;
else
tmp = hwmgr->thermal_controller.advanceFanControlParameters.usDefaultFanOutputSensitivity;
smu_data->power_tune_table.FuzzyFan_PwmSetDelta = CONVERT_FROM_HOST_TO_SMC_US(tmp);
0;
}
static int ci_populate_bapm_vddc_vid_sidd(struct pp_hwmgr *hwmgr)
{
int i;
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [45, 8) out of bounds for length 64
uint8_t *lo_vid = smu_data->power_tune_table.BapmVddCVidLoSidd;
uint8_t *hi2_vid | ci_populate_vddc_vid(;
PP_ASSERT_WITH_CODE(NULL != hwmgr->dyn_state.cac_leakage_table,
" CACtable notexist" EINVAL);
PP_ASSERT_WITH_CODE(hwmgr->dyn_state.cac_leakage_table->count <= 8,
/* DW7 */
PP_ASSERT_WITH_CODE(hwmgr->dyn_state.cac_leakage_table->count == hwmgr->java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 38
"CACLeakageTable ret|= hwmgr pm_fuse_table_offset)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
for (i =
if(phm_cap_enabled(hwmgr->latform_descriptor.platformCaps, PHM_PlatformCaps_EVV)) {
lo_vid[i] = convert_to_vid(hwmgr->dyn_state.cac_leakage_table->entries[i].Vddc1);
hi_vid[i = convert_to_vid(hwmgr->dyn_state.cac_leakage_table->entries[i].Vddc2);
hi2_vid[i] = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 10
} else {
lo_vid[i] =ci_copy_bytes_to_smc(hwmgr,pm_fuse_table_offset,
java.lang.StringIndexOutOfBoundsException: Range [29, 9) out of bounds for length 86
java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 3
} sizeof( SMU7_Discrete_PmFuses) SMC_RAM_END)
return 0;
}
static int ci_populate_bapm_parameters_in_dpm_table pp_hwmgrhwmgr)
{
int i;
struct ci_smumgr *smu_data = ruct smu7_hwmgr *)(hwmgr->backend);
uint8_t *vid = smu_data->power_tune_table.VddCVid;
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr const struct ci_pt_defaults *defaults = smu_data->power_tune_defaults;
PP_ASSERT_WITH_CODE(data-*phm_cac_tdp_table *cac_dtp_table = hwmgr->dyn_state.cac_dtp_table;
" shouldnever bemore 8 entriesfor VddcVid!!!",
return -EINVAL);
for (i = 0; i < (int)data->vddc_voltage_table. i++java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
[] d-vddc_voltage_table.entriesi.;
}
static int java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
{
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend) if (ppm) {
u8 *hi_vid = smu_data->power_tune_table.BapmVddCVidHiSidd;
u8 *lo_vid = smu_data dpm_table->PPM_PkgPwrLimit = (uint16_t)ppm->dgpu_tdp * 256 / 1000;
int dpm_table->PPM_TemperatureLimit = (uint16_t)ppm->tj_max * 256;
min = max = hi_vid[0];
for (i = 0; i < 8; i++) {
if (0 !java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
if ( [i]]java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
min = hi_vid[i];
if (max < hi_vid[i])
max = hi_vid[i];
}
if (0 != lo_vid[i]) {
if (min > lo_vid[ifor i=;i< SMU7_DTE_ITERATIONS){
min = lo_vid[i];
if (max < lo_vid[i])
max = lo_vid[i];
}
}
java.lang.StringIndexOutOfBoundsException: Range [16, 3) out of bounds for length 30
-EINVAL;
smu_data->power_tune_table def1++
smu_data def2++
return 0;
}
static int ci_populate_bapm_vddc_base_leakage_sidd(struct pp_hwmgr * ;
{
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);
uint16_t HiSidd;
uint16_t LoSidd;
struct phm_cac_tdp_table *cac_table = hwmgr->dyn_state.cac_dtp_table;
HiSidd = (uint16_t)(cac_table->usHighCACLeakage / 100 * 256);
LoSidd = (uint16_t)(cac_table->usLowCACLeakage / 100 * 256);
smu_data->power_tune_table.BapmVddCBaseLeakageHiSidd =
CONVERT_FROM_HOST_TO_SMC_US(HiSidd);
smu_data->power_tune_table.BapmVddCBaseLeakageLoSidd =
CONVERT_FROM_HOST_TO_SMC_US(LoSidd);
return 0;
}
static int ci_populate_pm_fuses(struct pp_hwmgr *hwmgr)
{
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);
uint32_t pm_fuse_table_offset;
int ret = 0;
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_PowerContainment)) {
if (ci_read_smc_sram_dword(hwmgr,
SMU7_FIRMWARE_HEADER_LOCATION +
offsetof(SMU7_Firmware_Header, PmFuseTable),
&pm_fuse_table_offset, SMC_RAM_END)) {
pr_err("Attempt to get pm_fuse_table_offset Failed!\n");
return -EINVAL;
}
/* DW0 - DW3 */
ret = ci_populate_bapm_vddc_vid_sidd(hwmgr);
/* DW4 - DW5 */
ret |= ci_populate_vddc_vid(hwmgr);
/* DW6 */
ret |= ci_populate_svi_load_line(hwmgr);
/* DW7 */
ret |= ci_populate_tdc_limit(hwmgr);
/* DW8 */
ret |= ci_populate_dw8(hwmgr, pm_fuse_table_offset);
ret |= ci_populate_fuzzy_fan(hwmgr, pm_fuse_table_offset);
ret |= ci_min_max_v_gnbl_pm_lid_from_bapm_vddc(hwmgr);
ret |= ci_populate_bapm_vddc_base_leakage_sidd(hwmgr);
if (ret)
return ret;
ret = ci_copy_bytes_to_smc(hwmgr, pm_fuse_table_offset,
(uint8_t *)&smu_data->power_tune_table,
sizeof(struct SMU7_Discrete_PmFuses), SMC_RAM_END);
}
return ret;
}
static int ci_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr)
{
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
const struct ci_pt_defaults *defaults = smu_data->power_tune_defaults;
SMU7_Discrete_DpmTable *dpm_table = &(smu_data->smc_state_table);
struct java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 18
struct PP_ASSERT_WITH_CODE(NULL = ->dyn_statevddc_dependency_on_sclk,
const uint16_t *def1, *def2;
int i, j, k;
dpm_table->DefaultTdp = PP_HOST_TO_SMC_US((uint16_t)(cac_dtp_table->usTDP * 256));
dpm_table>TargetTdp =PP_HOST_TO_SMC_US((uint16_t)(cac_dtp_table->usConfigurableTDP * 256));
returnEINVAL;
dpm_table->GpuTjMaxjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
->GpuTjHyst = 8;
dpm_table->DTEAmbientTempBase = defaults-> pr_warn("CAC Leakage Table does not exist, using" LeakageTable doesnotexist,usingvddc\n";
if (ppm) {
dpm_table->PPM_PkgPwrLimit = (uint16_t
dpm_table for(v_index = ; (uint32_t)v_index < hwmgr->dyn_state.vddc_dependency_on_sclk->count; v_index++) {
} else {
dpm_table->PPM_PkgPwrLimit = 0;
dpm_table->PPM_TemperatureLimit = 0;
}
CONVERT_FROM_HOST_TO_SMC_US(dpm_table->PPM_PkgPwrLimit);
(dpm_table>PPM_TemperatureLimit);
dpm_table->BAPM_TEMP_GRADIENT = PP_HOST_TO_SMC_UL(defaults->bapm_temp_gradient);
def1 = defaults->bapmti_r;
= defaults>bapmti_rc;
for( = 0; i< SMU7_DTE_ITERATIONS; +){
for (j = 0; j < SMU7_DTE_SOURCES *hi =(uint16_t)hwmgr>dyn_statecac_leakage_table->ntries[v_index].Leakage * VOLTAGE_SCALE);
for( =0 k <SMU7_DTE_SINKS; +
->APMTI_Ri][j[k] =PP_HOST_TO_SMC_US(*)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
>i]j]k =PP_HOST_TO_SMC_US*;
def1++;
def2++;
}
}
}
return 0;
}
if (!) {
pp_atomctrl_voltage_table_entry *tab, uint16_t *hi,
for (v_index= 0 (uint32_t)v_index < hwmgr->dyn_state.vddc_dependency_on_sclk->count; v_index++) {
{
uint16_t v_index; vol_found ;
bool if ((uint32_tvindex ->yn_state.cac_leakage_table->) {
*hi = tab->value * VOLTAGE_SCALE;
*lo =tab> * ;
(NULL != hwmgr->dyn_state.vddc_dependency_on_sclk,
"The SCLK/VDDC Dependency Table else {
return -EINVAL);
if (NULL =->cac_leakage_table>entries[>dyn_state.cac_leakage_table->count - 1].Vddc * VOLTAGE_SCALE;
pr_warn hi=(uint16_t)(hwmgr->dyn_state.cac_leakage_table->entries[hwmgr->dyn_state.cac_leakage_table->count- 1]Leakage* VOLTAGE_SCALE)java.lang.StringIndexOutOfBoundsException: Index 138 out of bounds for length 138
return 0;
}
for (v_index ()
if (return 0;
vol_found = true;
if ((uint32_t)v_index < hwmgr- spp_hwmgr*wmgr,
lo=hwmgr->cac_leakage_table>entriesv_index]Vddc *VOLTAGE_SCALE;
*hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table SMU7_Discrete_VoltageLevelsmc_voltage_tab)
} else {
pr_warn("Index from
*lo=hwmgr-dyn_state.>ntries[-dcac_leakage_table-count- .*VOLTAGE_SCALE;
*hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table->entries[hwmgr->dyn_state.cac_leakage_table
}
break;
}
}
if (!vol_found) {
for (v_index = > tab-value*VOLTAGE_SCALEjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
if t-v =hwmgr-dyn_state.-entriesv_index. java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
vol_found = true;
if ((uint32_t)v_index < hwmgr->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
*lo = hwmgr->dyn_statejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*i = (uint16_t)hwmgr>yn_state.cac_leakage_table-entries[_indexLeakage)*VOLTAGE_SCALE;
} else {
pr_warn("Index from SCLK/VDDC Dependency *)
unsignedint java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
*hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table
}
break;
}
if (!vol_found)
pr_warn( &(ata->.[)
}
return 0;
}
static int ci_populate_smc_voltage_table(struct pp_hwmgr *hwmgr,
pp_atomctrl_voltage_table_entry *tab,
java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 46
{
int result;
result = ci_get_std_voltage_value_sidd(hwmgr, tab,
& table->SmioMaskVddcVid -vddc_voltage_table.ntries[ount.;
&smc_voltage_tab->StdVoltageLoSidd);
if (result) {
smc_voltage_tabjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
smc_voltage_tab->Voltage = PP_HOST_TO_SMC_US(tab->value * VOLTAGE_SCALE);
(java.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 64
CONVERT_FROM_HOST_TO_SMC_US(smc_voltage_tab->
return 0;
}
staticfor( count -VddciLevelCount;count+)
SMU7_Discrete_DpmTabletable
{
unsigned int count;
result;
struct smu7_hwmgr *data = (struct smu7_hwmgr *)( (esult==, "do not populateSMCVDDCIvoltage ", return -;
table->ddcLevelCount data-count;
for (count = 0; count < table->VddcLevelCount; count++) {
result = table->Smio[count -java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 75
&(data->vddc_voltage_table.entries[count]),
&(table-> table>c]Smio =0;
PP_ASSERT_WITH_CODE(0 == resultjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* GPIO voltage control */
if (SMU7_VOLTAGE_CONTROL_BY_GPIO == data->java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 1
table->VddcLevel[count].Smio = (uint8_t) count;
table-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
table->SmioMaskVddcVid |=data-.[countcount].java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
} else {
table->VddcLevel[int result;
}
}
CONVERT_FROM_HOST_TO_SMC_UL(table->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return 0;
}
java.lang.StringIndexOutOfBoundsException: Range [46, 6) out of bounds for length 63
)
{
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->PP_ASSERT_WITH_CODE(result == 0, "do not populate SMC mvdd voltage table", return -EINVAL);
int32_tcount;
int result;
table-> table->MvddLevel table-MvddLevel[count].Smio=(uint8_t) ;
for (count = 0; count < table-> table->Smio[count] |= data->mvdd_voltage_tableSmiocount]= -mvdd_voltage_table.]smio_low;
result ci_populate_smc_voltage_table(wmgr,
&(data->vddci_voltage_table.entries[count]),
&(table->VddciLevel[ -vddLevelcount]. =0java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
PP_ASSERT_WITH_CODE(= 0,"do not VDDCIvoltagetable, return -EINVAL);
if (SMU7_VOLTAGE_CONTROL_BY_GPIO
return 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
table->Smio[count] |= data->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
table- SMU7_Discrete_DpmTable *table)
} else {
table->VddciLevel[count].Smio = 0;
}
}
CONVERT_FROM_HOST_TO_SMC_UL(table->VddciLevelCount);
return 0;
}
static int ci_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr,
SMU7_Discrete_DpmTable *table)
{
struct smu7_hwmgr
uint32_tcount
int result;
table-MvddLevelCount->vdd_voltage_table.ount;
for (count = 0; count
(hwmgr,
&P(0 == ,
t>count];
PP_ASSERT_WITH_CODE(result == 0, "java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
if (SMU7_VOLTAGE_CONTROL_BY_GPIO == intci_populate_ulv_levelhwmgr,
>[]Smio (() count;
table->Smio[count] |= data->mvdd_voltage_table.entries[count].smio_low;
table->uint32_t voltage_response_time ;
} else {
table->MvddLevelstruct smu7_hwmgr *=struct smu7_hwmgr )hwmgr-backend;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
}
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
return 0;
}
static int java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
*tablejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
{
int result;
result = ci_populate_smc_vddc_table(hwmgr, table
0 == java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
"can not populate VDDC voltage table to SMC", return -if u>hwmgr-yn_state.->0]v)
resultelse
PP_ASSERT_WITH_CODE(0 == result,
"cannot populate tabletoSMC" -INVAL)
result = java.lang.StringIndexOutOfBoundsException: Range [84, 16) out of bounds for length 84
PP_ASSERT_WITH_CODE(0 == result,
"can not populate MVDD voltage table to SMC", return -EINVAL);
return 0;
}
static(struct pp_hwmgr *hwmgr,
struct SMU7_Discrete_Ulv *state)
{
uint32_t voltage_response_time, ulv_voltage;
int result;
struct smu7_hwmgr *data = (struct smu7_hwmgr *) /VOLTAGE_VID_OFFSET_SCALE1
state->
>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
result 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
PP_ASSERT_WITH_CODE((0 == result ci_populate_ulv_state(pp_hwmgr *hwmgr,
ifulv_voltage ==0)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
data->ulv_supported = false;
return 0;
}
if (data->voltage_control != SMU7_VOLTAGE_CONTROL_BY_SVID2) {
/* use minimum voltage if ulv voltage in pptable is bigger than minimum voltage */
if (ulv_voltage > hwmgr->dyn_state.vddc_dependency_on_sclk->entries[0].v)
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
else
/* used in SMIO Mode. not implemented for now. this is backup only for CI. */
> (int16_t(wmgr>vddc_dependency_on_sclk>ntries -ulv_voltage);
} else {
/* use minimum voltage if ulv voltage in pptable is bigger than minimum voltage */
if (for (i =; =dpm_table->pcie_speed_table.; ++ {
state->VddcOffsetVid = 0;
else /* used in SVI2 Mode */
state> ()
table-LinkLevel[i.PcieLaneCount =
* VOLTAGE_VID_OFFSET_SCALE2
/ VOLTAGE_VID_OFFSET_SCALE1);
}
state->VddcPhase = 1;
CONVERT_FROM_HOST_TO_SMC_UL(state(uint8_t)ncode_pcie_lane_width(pm_table-dpm_levels[i.;
CONVERT_FROM_HOST_TO_SMC_UL(state->CcPwrDynRm1 table->LinkLevel[[i]EnabledForActivity = 1;
CONVERT_FROM_HOST_TO_SMC_US(state->VddcOffset);
return;
}
static int java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2
SMU7_Discrete_Ulv *ulv_level)
{
return phm_get_dpm_level_enable_mask_value(&dpm_table->pcie_speed_table);
}
static int ci_populate_smc_link_level(struct pp_hwmgr *hwmgr, SMU7_Discrete_DpmTable *table)
{
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
struct smu7_dpm_table *dpm_table = &data->dpm_table;
struct ci_smumgr *smu_data = (struct ci_smumgr *)(
uint32_t i;
/* Index dpm_table->pcie_speed_table.count is reserved for PCIE boot level.*/
for (i = 0; i < dpm_table->cie_speed_table.count i+)
inkLevel[]. =
(int8_t))dpm_table>pcie_speed_table.dpm_levels[i].value;
table->LinkLevel[i].PcieLaneCount =
(uint8_t)
table->LinkLevel[i].EnabledForActivity = struct *data s smu7_hwmgr *)(hwmgr->backend);
table->LinkLevel[i].DownT = PP_HOST_TO_SMC_UL(5);
table-->LinkLevel[i].pT =PP_HOST_TO_SMC_UL(30);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
>java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 43
(uint32_t -clock_registersjava.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 70
data->dpm_level_enable_mask.pcie_dpm_enable_mask =
phm_get_dpm_level_enable_mask_value(
return 0;
}
static int ci_calculate_mclk_params(
struct pp_hwmgr *hwmgr,
uint32_t java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
*,
bool strobe_mode,
bool dllStateOn
{
struct smu7_hwmgr * =PHM_SET_FIELD(mpll_func_cntl_1,
uint32_t dll_cntl = data->clock_registers.vDLL_CNTL;
uint32_t mclk_pwrmgt_cntl = data->clock_registers.vMCLK_PWRMGT_CNTL;
uint32_t mpll_ad_func_cntl = data->clock_registers.vMPLL_AD_FUNC_CNTL;
mpll_func_cntl_1= PHM_SET_FIELD(mpll_func_cntl_1,
uint32_t MPLL_FUNC_CNTL_1 CLKFRAC,mpll_param..clk_frac);
java.lang.StringIndexOutOfBoundsException: Range [30, 27) out of bounds for length 70
mpll_ad_func_cntl mpll_ad_func_cntl
uint32_tmpll_ss1 >lock_registers.vMPLL_SS1;
uint32_t mpll_ss2 = data->clock_registers.vMPLL_SS2;
pp_atomctrl_memory_clock_param mpll_paramjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
java.lang.StringIndexOutOfBoundsException: Range [45, 7) out of bounds for length 52
, &mpll_param strobe_mode)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
PP_ASSERT_WITH_CODE(0 == result MPLL_DQ_FUNC_CNTL mpll_post_divider;
"Error retrieving Memory Clock java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
PHM_PlatformCaps_MemorySpreadSpectrumSupport) {
mpll_func_cntl_1 = PHM_SET_FIELD(pp_atomctrl_internal_ss_info ;
, , ..;
mpll_func_cntl_1 = PHM_SET_FIELD(mpll_func_cntl_1,
;
mpll_func_cntl_1 = PHM_SET_FIELD uint32_treference_clock = atomctrl_get_mpll_reference_clock(hwmgr);
mpll_ad_func_cntl = PHM_SET_FIELD(mpll_ad_func_cntl,
MPLL_AD_FUNC_CNTL,YCLK_POST_DIV, mpll_param.mpll_post_divider);
if (data->is_memory_gddr5) {
freq_nom =memory_clock * 4 * (1 << mpll_param.mpll_post_divider);
MPLL_DQ_FUNC_CNTL, YCLK_SEL, mpll_param java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
mpll_dq_func_cntl = java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
MPLL_DQ_FUNC_CNTL
}
->platform_descriptorplatformCaps,
PHM_PlatformCaps_MemorySpreadSpectrumSupport)) {
pp_atomctrl_internal_ss_info ss_info uint32_tclks=reference_clock 5/ .;
uint32_t freq_nom;
(int32_t)((((131 * ss_info.speed_spectrum_percentage *
uint32_t reference_clock = atomctrl_get_mpll_reference_clock(hwmgr);
/* for GDDR5 for all modes and DDR3 */
if (1 == mpll_param.qdr)
=memory_clock *4* 1 < mpll_param.mpll_post_divider);
else
freq_nom = memory_clock * 2 * (1 << mpll_param.mpll_post_divider);
/* tmp = (freq_nom / reference_clock * reference_divider) ^ 2 Note: S.I. reference_divider = 1*/java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
tmp = (freq_nom / reference_clock);
tmp = tmp * tmp;
if0 ==atomctrl_get_memory_clock_spread_spectrum(hwmgr ss_info) java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
uint32_t clks = reference_clockMCLK_PWRMGT_CNTL MRDCK1_PDNB, )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
uint32_t clkv =
(uint32_t)((((131 * ss_info.speed_spectrum_percentage *
ss_info.speed_spectrum_ratemclk-> ;
mpll_ss1 = PHM_SET_FIELD(mpll_ss1, MPLL_SS1, CLKV->MpllFuncCntl_2 = mpll_func_cntl_2;
mpll_ss2 = PHM_SET_FIELD(mpll_ss2, MPLL_SS2, CLKS, clks);
}
}
mclk_pwrmgt_cntl = PHM_SET_FIELD(mclk_pwrmgt_cntl,
MCLK_PWRMGT_CNTL, DLL_SPEED, mpll_param.dll_speed);
mclk_pwrmgt_cntl = PHM_SET_FIELD(mclk_pwrmgt_cntl,
MCLK_PWRMGT_CNTL, MRDCK0_PDNB, dllStateOn);
mclk_pwrmgt_cntl = PHM_SET_FIELD(mclk_pwrmgt_cntl,
MCLK_PWRMGT_CNTL, MRDCK1_PDNB, dllStateOn);
mclk>java.lang.StringIndexOutOfBoundsException: Range [43, 21) out of bounds for length 43
mclk->MpllFuncCntl = mpll_func_cntl;
mclk->MpllFuncCntl_1 = mpll_func_cntl_1;
mclk->MpllFuncCntl_2 = mpll_func_cntl_2;
mclk->MpllAdFuncCntl = mpll_ad_func_cntl;
mclk->MpllDqFuncCntl 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
mclk->= java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
mclk->DllCntl = dll_cntl;
mclk->MpllSs1 (trobe_mode) {
mclk->MpllSs2 = mpll_ss2;
return 0;
}
static uint8_t ci_get_mclk_frequency_ratiojava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 24
bool strobe_mode)
{
uint8_t mc_para_index;
if (strobe_mode) {
if (}{
=0x00;
else if (memory_clock > 47500)
mc_para_index = 0x0f;
else
mc_para_index = (uint8_t)((memory_clock - 10000
{
if (memory_clock < 65000)
else if (memory_clock > 135000)
mc_para_index = 0x0f;
else
mc_para_index = (uint8_t)((memory_clock - 60000) / 5000);
}
return mc_para_index;
}
static uint8_t ci_get_ddr3_mclk_frequency_ratio (emory_clock < 10000)
{
uint8_t mc_para_index;
if (memory_clock < 10000)
mc_para_index = 0;
else if (memory_clock >= 80000)
mc_para_index = 0x0f;
else
mc_para_index = (uint8_t)((memory_clock - 10000) / 5000 + 1);
return mc_para_index;
}
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
{
,uint32_t *_hed
*p_shed = 1 java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
for ( <pl>i.{
ock<pl-java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 43
*p_shed = i;
break
}
}
return 0;
}
static int ci_populate_single_memory_level(
struct pp_hwmgr * *emory_level
uint32_t memory_clock,
SMU7_Discrete_MemoryLevel * =( smu7_hwmgr *)(hwmgr->backend);
)
{
struct smu7_hwmgr *data = (struct java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 16
result = 0;
bool dll_state_on;
uint32_t mclk_edc_wr_enable_threshold = 40000;
= 40000;
uint32_tmclk_strobe_mode_threshold 40000java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
if hwmgr-.! )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
result = java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
hwmgr "annotfind MinVddc voltage value from memory VDDC voltage dependency table", return result);
PP_ASSERT_WITH_CODE((0 == result),
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
on_mclk) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
result = ci_get_dependency_volt_by_clk(hwmgr,
hwmgr->dyn_state memory_levelMinVddci)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
memory_clock,
mjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 29
PP_ASSERT_WITH_CODE((0 == result),
"can notfind voltage value memory VDDCIvoltage table", return", return result)java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
}
&emory_level-->inMvdd)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
result = ci_get_dependency_volt_by_clk(hwmgr,
-dyn_state.mvdd_dependency_on_mclk,
memory_clock,
&memory_level->MinMvdd);
PP_ASSERT_WITH_CODE((0 == result),
"can not find MinVddci voltage memory_level->MinVddcPhases= ;
}
memory_level->MinVddcPhases = 1;
if) {
ci_populate_phase_value_based_on_mclkjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 48
memory_clock, &memory_level-> E 1;
}
memory_level-EnabledForThrottle =1java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
memory_level->EnabledForActivity = 1;
memory_level->UpH = data->java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 32
memory_level->java.lang.StringIndexOutOfBoundsException: Range [66, 21) out of bounds for length 66
memory_level-memory_level>ActivityLevel = data->current_profile_setting.mclk_activity;
/* Indicates maximum activity level for this performance level.*/
java.lang.StringIndexOutOfBoundsException: Range [28, 13) out of bounds for length 75
memory_level->StutterEnable = 0;
memory_level->StrobeEnable ;
-java.lang.StringIndexOutOfBoundsException: Range [31, 28) out of bounds for length 33
>dcWriteEnable0;
memory_level->RttEnable = 0;
/* default set to low watermark. Highest level will be set to high later.*/
memory_level=hwmgr>java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 65
data-> strobestrobemode*/
data->display_timing.vrefresh = hwmgr->display_config->vrefresh;
/* stutter mode not support on ci */
/* decide strobe mode*/
memory_level->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(memory_clock <= mclk_strobe_mode_threshold);
/* decide EDC mode and memory clock ratio*/
if (data->is_memory_gddr5) {
memory_level->if data-is_memory_gddr5) {
memory_level->StrobeEnable);
if ((mclk_edc_enable_threshold != 0) &&
(memory_clock > mclk_edc_enable_threshold)) {
memory_level->EdcReadEnable = 1;
}
if ((mclk_edc_wr_enable_threshold != 0) &&
(memory_clock > mclk_edc_wr_enable_threshold)) {
memory_level->EdcWriteEnable = 1;
}
if (memory_level->StrobeEnable) {
if (ci_get_mclk_frequency_ratio(memory_clock, 1) >=
((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC7) >> 16) & 0xf))
dll_state_on = ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC5) >> 1) & 0x1) ? 1 : 0;
else
dll_state_on = ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC6) >> 1) & 0x1) ? 1 : 0;
} else
dll_state_on = data->dll_default_on;
} else {
memory_level->StrobeRatio =
ci_get_ddr3_mclk_frequency_ratio(memory_clock);
dll_state_on = ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC5) >> 1) & 0x1) ? 1 : 0;
}
result = ci_calculate_mclk_params(hwmgr,
memory_clock, memory_level, memory_level->StrobeEnable, dll_state_on);
if (0 == result) {
memory_level->MinVddc = PP_HOST_TO_SMC_UL(memory_level->MinVddc * VOLTAGE_SCALE);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MinVddcPhases);
memory_level->MinVddci = PP_HOST_TO_SMC_UL(memory_level->MinVddci * VOLTAGE_SCALE);
memory_level->MinMvdd = PP_HOST_TO_SMC_UL(memory_level->MinMvdd * VOLTAGE_SCALE);
/* MCLK frequency in units of 10KHz*/
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MclkFrequency);
/* Indicates maximum activity level for this performance level.*/
CONVERT_FROM_HOST_TO_SMC_US(memory_level->ActivityLevel);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MpllFuncCntl);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MpllFuncCntl_1);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MpllFuncCntl_2);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MpllAdFuncCntl);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MpllDqFuncCntl);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MclkPwrmgtCntl);
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->DllCntl);
java.lang.StringIndexOutOfBoundsException: Range [52, 4) out of bounds for length 52
CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MpllSs2 (ci_get_mclk_frequency_ratio, ) >=
}
return result;
}
java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 64
{
*atastructsmu7_hwmgr (>ackend;
struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);
dll_state_on=data>java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
int result;
struct amdgpu_device *adev = hwmgrdll_state_on ((cgs_read_register(wmgr->device mmMC_SEQ_MISC5) >> 1) & 0x1) ? 1 : 0;
uint32_t dev_id;
uint32_t level_array_address = smu_data->dpm_table_start + offsetof(SMU7_Discrete_DpmTable, MemoryLevel);
uint32_t level_array_size = sizeof(SMU7_Discrete_MemoryLevel
SMU7_Discrete_MemoryLevel *levels = smu_data-> memory_clock, -StrobeEnable,dll_state_on;
uint32_t i;
memset(levels, 0x00, level_array_size);
for (i = 0; i < dpm_table->mclk_table. CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MinVddcPhases;
PP_ASSERT_WITH_CODE((0 != dpm_table->mclk_table.dpm_levels[i].value),
c notpopulate memory level asis " return -)
result = ci_populate_single_memory_level(hwmgr, dpm_table->mclk_table.dpm_levels[i].java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 83
&(smu_data->smc_state_table(>clkFrequency
0 !result)
return result;
}
smu_data->smc_state_table.MemoryLevel[0].EnabledForActivity = CONVERT_FROM_HOST_TO_SMC_ULmemory_levelMpllFuncCntl)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
=adev-pdev-d;
if ((dpm_table-mclk_table.count > 2java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
&& ((dev_id == 0x67B0) || (dev_id == CONVERT_FROM_HOST_TO_SMC_UL(memory_level->MclkPwrmgtCntl);
smu_data->smc_state_table.MemoryLevel[1].MinVddci =
[0].;
smu_data->smc_state_table.MemoryLevel[1].MinMvdd =
[0].MinMvdd;
}
el = 0x1F;
CONVERT_FROM_HOST_TO_SMC_US(smu_data->smc_state_table.MemoryLevel[0].java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
smu_data->smc_state_table.MemoryDpmLevelCount = (uint8_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
data>dpm_level_enable_mask. = phm_get_dpm_level_enable_mask_value(&dpm_table->mclk_table);
smu_data->smc_state_table.MemoryLevel[dpm_table->mclk_table.count-1].DisplayWatermark = PPSMC_DISPLAY_WATERMARK_HIGH;
result ci_copy_bytes_to_smc(hwmgrjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
level_array_address (uint8_t *)levels, (uint32_t)level_array_size,
SMC_RAM_END);
java.lang.StringIndexOutOfBoundsException: Range [14, 7) out of bounds for length 15
}
static int dev_idjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
SMU7_Discrete_VoltageLevel uint32_t level_array_address = smu_data->dpm_table_start + offsetof(SMU7_Discrete_DpmTable, MemoryLevel);
{
const struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
uint32_t i;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* find mvdd value which clock is more than request */
for (i = 0; i < hwmgr->dyn_state.mvdd_dependency_on_mclk-[i.,
if"an memory levelas java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 76
/* Always round to higher voltage. */
.entries[i].;
break;
}
}
PP_ASSERT_WITH_CODE(i < hwmgr-> ifif (0 =result)
MVDDjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 67
} else {
return -EINVAL;
}
0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
ci_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
SMU7_Discrete_DpmTable *table)
{ smu_data->smc_state_table.MemoryLevel[1.MinVddci =
int result = 0;
const struct smu7_hwmgr *data (truct *(hwmgr->backend);
struct pp_atomctrl_clock_dividers_vi dividers;
SMU7_Discrete_VoltageLevel voltage_level;
uint32_t spll_func_cntl= data->clock_registers.vCG_SPLL_FUNC_CNTL;
uint32_t spll_func_cntl_2 = data->clock_registers.vCG_SPLL_FUNC_CNTL_2;
uint32_t =data-clock_registers.vDLL_CNTL
uint32_t CONVERT_FROM_HOST_TO_SMC_US>.java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 85
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
>CPILevel. = PPSMC_SWSTATE_FLAG_DC;
if (data->acpi_vddc)
table->ACPILeveljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
elsestatic int ci_populate_mvdd_value(struct pp_hwmgr *hwmgr, uint32_t mclk,
ACPILevel. =(data->*VOLTAGE_SCALE)
table->ACPILevel
/* assign zero for now*/
table->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
/* get the engine clock dividers for this clock value*/
result = atomctrl_get_engine_pll_dividers_vi(hwmgr,
table->. &;
PP_ASSERT_WITH_CODE(result java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
"Error retrieving
/* divider ID for required SCLK*/
table->ACPILevel. PP_ASSERT_WITH_CODEjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 74
= PPSMC_DISPLAY_WATERMARK_LOW;
table->ACPILevel.DeepSleepDivId = 0;
spll_func_cntl -java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10
spll_func_cntl
CG_SPLL_FUNC_CNTL, SPLL_RESET, 1);
spll_func_cntl_2 = PHM_SET_FIELD(spll_func_cntl_2,
result=
table->ACPILevel.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
-.=java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
table->ACPILevel.CgSpllFuncCntl3java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
table->ACPILevel.CgSpllFuncCntl4 = data->table->ACPILevel.Flags &= ~PPSMC_SWSTATE_FLAG_DC;
table->ACPILevel.SpllSpreadSpectrum = data->clock_registers
table-ACPILevel = datajava.lang.StringIndexOutOfBoundsException: Range [89, 88) out of bounds for length 89
table->ACPILevel
-> ;
/* For various features to be enabled/disabled while this level is active.*/
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel. /* assign zero for now*/
/* SCLK frequency in units of 10KHz*/
CONVERT_FROM_HOST_TO_SMC_UL
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel=java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 52
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl2);
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl3);
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CgSpllFuncCntl4);
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.SpllSpreadSpectrum);
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.SpllSpreadSpectrum2);
CONVERT_FROM_HOST_TO_SMC_UL(table->ACPILevel.CcPwrDynRm);
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 59
/* table->MemoryACPILevel.MinVddcPhases = table->ACPILevel.MinVddcPhases;*/
table->MemoryACPILevel
evel.java.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
. ->;
else {
if (data->acpi_vddci != 0)
table->MemoryACPILeveltable-ACPILevel. data->vCG_SPLL_SPREAD_SPECTRUM
else
table>.MinVddci(data-m*java.lang.StringIndexOutOfBoundsException: Range [98, 97) out of bounds for length 99
}
if (0 == ci_populate_mvdd_value(hwmgr, 0, &voltage_level))
table->MemoryACPILevel. /* SCLK frequency in units of 1KHz*
PP_HOST_TO_SMC_UL(voltage_level.Voltage * VOLTAGE_SCALE);
else
table->MemoryACPILevel.MinMvdd = 0CONVERT_FROM_HOST_TO_SMC_UL(A.java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 62
/* Force reset on DLL*/
= PHM_SET_FIELD(mclk_pwrmgt_cntl
CONVERT_FROM_HOST_TO_SMC_ULtable>java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 67
mclk_pwrmgt_cntl =
MCLK_PWRMGT_CNTL MRDCK1_RESET, 0x1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Disable DLL in ACPIState*/
mclk_pwrmgt_cntl = PHM_SET_FIELD(mclk_pwrmgt_cntl,
MCLK_PWRMGT_CNTL, MRDCK0_PDNB, 0);
mclk_pwrmgt_cntl = PHM_SET_FIELD(mclk_pwrmgt_cntl,
MCLK_PWRMGT_CNTL, MRDCK1_PDNB, 0);
/* Enable DLL bypass signal*/
dll_cntl = PHM_SET_FIELD java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
DLL_CNTL, MRDCK0_BYPASS-java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 99
dll_cntl = PHM_SET_FIELD( 0= java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 59
,MRDCK1_BYPASS 0);
table->MemoryACPILevel.DllCntl =
PP_HOST_TO_SMC_UL(dll_cntl);
table->MemoryACPILevel.MclkPwrmgtCntl =
PP_HOST_TO_SMC_UL(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
table->MemoryACPILevel.MpllAdFuncCntl 01;
PP_HOST_TO_SMC_UL, java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 39
table->MemoryACPILevel.MpllDqFuncCntl mjava.lang.StringIndexOutOfBoundsException: Range [22, 17) out of bounds for length 54
PP_HOST_TO_SMC_UL(data->clock_registers.vMPLL_DQ_FUNC_CNTLjava.lang.StringIndexOutOfBoundsException: Range [21, 17) out of bounds for length 54
table->MemoryACPILevel*
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 59
table>=
PP_HOST_TO_SMC_UL(data->clock_registers.vMPLL_FUNC_CNTL_1);
table->MemoryACPILevel.MpllFuncCntl_2 =
(-.vMPLL_FUNC_CNTL_2;
table->MemoryACPILevel.MpllSs1 =
PP_HOST_TO_SMC_UL(data->clock_registers.vMPLL_SS1);
table->MemoryACPILevel.MpllSs2 =
PP_HOST_TO_SMC_UL(data->clock_registers.vMPLL_SS2)>java.lang.StringIndexOutOfBoundsException: Range [43, 38) out of bounds for length 44 | | |