• Home
  • Raw
  • Download

Lines Matching refs:hwmgr

102 static void iceland_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr)  in iceland_initialize_power_tune_defaults()  argument
104 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_initialize_power_tune_defaults()
110 cgs_query_system_info(hwmgr->device, &sys_info); in iceland_initialize_power_tune_defaults()
131 static int iceland_populate_svi_load_line(struct pp_hwmgr *hwmgr) in iceland_populate_svi_load_line() argument
133 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_svi_load_line()
144 static int iceland_populate_tdc_limit(struct pp_hwmgr *hwmgr) in iceland_populate_tdc_limit() argument
147 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_tdc_limit()
150 tdc_limit = (uint16_t)(hwmgr->dyn_state.cac_dtp_table->usTDC * 256); in iceland_populate_tdc_limit()
160 static int iceland_populate_dw8(struct pp_hwmgr *hwmgr, uint32_t fuse_table_offset) in iceland_populate_dw8() argument
162 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_dw8()
166 if (smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_populate_dw8()
179 static int iceland_populate_temperature_scaler(struct pp_hwmgr *hwmgr) in iceland_populate_temperature_scaler() argument
184 static int iceland_populate_gnb_lpml(struct pp_hwmgr *hwmgr) in iceland_populate_gnb_lpml() argument
187 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_gnb_lpml()
196 static int iceland_min_max_vgnb_lpml_id_from_bapm_vddc(struct pp_hwmgr *hwmgr) in iceland_min_max_vgnb_lpml_id_from_bapm_vddc() argument
201 static int iceland_populate_bapm_vddc_base_leakage_sidd(struct pp_hwmgr *hwmgr) in iceland_populate_bapm_vddc_base_leakage_sidd() argument
203 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_bapm_vddc_base_leakage_sidd()
206 struct phm_cac_tdp_table *cac_table = hwmgr->dyn_state.cac_dtp_table; in iceland_populate_bapm_vddc_base_leakage_sidd()
219 static int iceland_populate_bapm_vddc_vid_sidd(struct pp_hwmgr *hwmgr) in iceland_populate_bapm_vddc_vid_sidd() argument
222 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_bapm_vddc_vid_sidd()
226 PP_ASSERT_WITH_CODE(NULL != hwmgr->dyn_state.cac_leakage_table, in iceland_populate_bapm_vddc_vid_sidd()
228 PP_ASSERT_WITH_CODE(hwmgr->dyn_state.cac_leakage_table->count <= 8, in iceland_populate_bapm_vddc_vid_sidd()
230 …PP_ASSERT_WITH_CODE(hwmgr->dyn_state.cac_leakage_table->count == hwmgr->dyn_state.vddc_dependency_… in iceland_populate_bapm_vddc_vid_sidd()
233 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_EVV)) { in iceland_populate_bapm_vddc_vid_sidd()
234 for (i = 0; (uint32_t) i < hwmgr->dyn_state.cac_leakage_table->count; i++) { in iceland_populate_bapm_vddc_vid_sidd()
235 lo_vid[i] = convert_to_vid(hwmgr->dyn_state.cac_leakage_table->entries[i].Vddc1); in iceland_populate_bapm_vddc_vid_sidd()
236 hi_vid[i] = convert_to_vid(hwmgr->dyn_state.cac_leakage_table->entries[i].Vddc2); in iceland_populate_bapm_vddc_vid_sidd()
245 static int iceland_populate_vddc_vid(struct pp_hwmgr *hwmgr) in iceland_populate_vddc_vid() argument
248 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_vddc_vid()
250 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_vddc_vid()
265 static int iceland_populate_pm_fuses(struct pp_hwmgr *hwmgr) in iceland_populate_pm_fuses() argument
267 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_pm_fuses()
270 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_populate_pm_fuses()
272 if (smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_populate_pm_fuses()
281 if (iceland_populate_bapm_vddc_vid_sidd(hwmgr)) in iceland_populate_pm_fuses()
287 if (iceland_populate_vddc_vid(hwmgr)) in iceland_populate_pm_fuses()
293 if (iceland_populate_svi_load_line(hwmgr)) in iceland_populate_pm_fuses()
298 if (iceland_populate_tdc_limit(hwmgr)) in iceland_populate_pm_fuses()
302 if (iceland_populate_dw8(hwmgr, pm_fuse_table_offset)) in iceland_populate_pm_fuses()
309 if (0 != iceland_populate_temperature_scaler(hwmgr)) in iceland_populate_pm_fuses()
315 if (iceland_populate_gnb_lpml(hwmgr)) in iceland_populate_pm_fuses()
321 if (iceland_min_max_vgnb_lpml_id_from_bapm_vddc(hwmgr)) in iceland_populate_pm_fuses()
327 if (iceland_populate_bapm_vddc_base_leakage_sidd(hwmgr)) in iceland_populate_pm_fuses()
332 if (smu7_copy_bytes_to_smc(hwmgr->smumgr, pm_fuse_table_offset, in iceland_populate_pm_fuses()
342 static int iceland_get_dependecy_volt_by_clk(struct pp_hwmgr *hwmgr, in iceland_get_dependecy_volt_by_clk() argument
366 static int iceland_get_std_voltage_value_sidd(struct pp_hwmgr *hwmgr, in iceland_get_std_voltage_value_sidd() argument
376 PP_ASSERT_WITH_CODE(NULL != hwmgr->dyn_state.vddc_dependency_on_sclk, in iceland_get_std_voltage_value_sidd()
380 if (NULL == hwmgr->dyn_state.cac_leakage_table) { in iceland_get_std_voltage_value_sidd()
390 for (v_index = 0; (uint32_t)v_index < hwmgr->dyn_state.vddc_dependency_on_sclk->count; v_index++) { in iceland_get_std_voltage_value_sidd()
391 if (tab->value == hwmgr->dyn_state.vddc_dependency_on_sclk->entries[v_index].v) { in iceland_get_std_voltage_value_sidd()
393 if ((uint32_t)v_index < hwmgr->dyn_state.cac_leakage_table->count) { in iceland_get_std_voltage_value_sidd()
394 *lo = hwmgr->dyn_state.cac_leakage_table->entries[v_index].Vddc * VOLTAGE_SCALE; in iceland_get_std_voltage_value_sidd()
395 *hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table->entries[v_index].Leakage * VOLTAGE_SCALE); in iceland_get_std_voltage_value_sidd()
398 …*lo = hwmgr->dyn_state.cac_leakage_table->entries[hwmgr->dyn_state.cac_leakage_table->count - 1].V… in iceland_get_std_voltage_value_sidd()
399 …*hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table->entries[hwmgr->dyn_state.cac_leakage_table->c… in iceland_get_std_voltage_value_sidd()
410 …for (v_index = 0; (uint32_t)v_index < hwmgr->dyn_state.vddc_dependency_on_sclk->count; v_index++) { in iceland_get_std_voltage_value_sidd()
411 if (tab->value <= hwmgr->dyn_state.vddc_dependency_on_sclk->entries[v_index].v) { in iceland_get_std_voltage_value_sidd()
413 if ((uint32_t)v_index < hwmgr->dyn_state.cac_leakage_table->count) { in iceland_get_std_voltage_value_sidd()
414 *lo = hwmgr->dyn_state.cac_leakage_table->entries[v_index].Vddc * VOLTAGE_SCALE; in iceland_get_std_voltage_value_sidd()
415 *hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table->entries[v_index].Leakage) * VOLTAGE_SCALE; in iceland_get_std_voltage_value_sidd()
418 …*lo = hwmgr->dyn_state.cac_leakage_table->entries[hwmgr->dyn_state.cac_leakage_table->count - 1].V… in iceland_get_std_voltage_value_sidd()
419 …*hi = (uint16_t)(hwmgr->dyn_state.cac_leakage_table->entries[hwmgr->dyn_state.cac_leakage_table->c… in iceland_get_std_voltage_value_sidd()
432 static int iceland_populate_smc_voltage_table(struct pp_hwmgr *hwmgr, in iceland_populate_smc_voltage_table() argument
438 result = iceland_get_std_voltage_value_sidd(hwmgr, tab, in iceland_populate_smc_voltage_table()
453 static int iceland_populate_smc_vddc_table(struct pp_hwmgr *hwmgr, in iceland_populate_smc_vddc_table() argument
458 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_vddc_table()
462 result = iceland_populate_smc_voltage_table(hwmgr, in iceland_populate_smc_vddc_table()
479 static int iceland_populate_smc_vdd_ci_table(struct pp_hwmgr *hwmgr, in iceland_populate_smc_vdd_ci_table() argument
482 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_vdd_ci_table()
489 result = iceland_populate_smc_voltage_table(hwmgr, in iceland_populate_smc_vdd_ci_table()
504 static int iceland_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr, in iceland_populate_smc_mvdd_table() argument
507 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_mvdd_table()
514 result = iceland_populate_smc_voltage_table(hwmgr, in iceland_populate_smc_mvdd_table()
530 static int iceland_populate_smc_voltage_tables(struct pp_hwmgr *hwmgr, in iceland_populate_smc_voltage_tables() argument
535 result = iceland_populate_smc_vddc_table(hwmgr, table); in iceland_populate_smc_voltage_tables()
539 result = iceland_populate_smc_vdd_ci_table(hwmgr, table); in iceland_populate_smc_voltage_tables()
543 result = iceland_populate_smc_mvdd_table(hwmgr, table); in iceland_populate_smc_voltage_tables()
550 static int iceland_populate_ulv_level(struct pp_hwmgr *hwmgr, in iceland_populate_ulv_level() argument
555 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_ulv_level()
560 result = pp_tables_get_response_times(hwmgr, &voltage_response_time, &ulv_voltage); in iceland_populate_ulv_level()
570 if (ulv_voltage > hwmgr->dyn_state.vddc_dependency_on_sclk->entries[0].v) in iceland_populate_ulv_level()
574 …state->VddcOffset = (uint16_t)(hwmgr->dyn_state.vddc_dependency_on_sclk->entries[0].v - ulv_voltag… in iceland_populate_ulv_level()
577 if (ulv_voltage > hwmgr->dyn_state.vddc_dependency_on_sclk->entries[0].v) in iceland_populate_ulv_level()
581 (hwmgr->dyn_state.vddc_dependency_on_sclk->entries[0].v - ulv_voltage) in iceland_populate_ulv_level()
594 static int iceland_populate_ulv_state(struct pp_hwmgr *hwmgr, in iceland_populate_ulv_state() argument
597 return iceland_populate_ulv_level(hwmgr, ulv_level); in iceland_populate_ulv_state()
600 static int iceland_populate_smc_link_level(struct pp_hwmgr *hwmgr, SMU71_Discrete_DpmTable *table) in iceland_populate_smc_link_level() argument
602 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_link_level()
604 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_smc_link_level()
638 static int iceland_calculate_sclk_params(struct pp_hwmgr *hwmgr, in iceland_calculate_sclk_params() argument
641 const struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_calculate_sclk_params()
654 result = atomctrl_get_engine_pll_dividers_vi(hwmgr, engine_clock, &dividers); in iceland_calculate_sclk_params()
660 reference_clock = atomctrl_get_reference_clock(hwmgr); in iceland_calculate_sclk_params()
681 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_calculate_sclk_params()
686 if (0 == atomctrl_get_engine_clock_spread_spectrum(hwmgr, vcoFreq, &ss_info)) { in iceland_calculate_sclk_params()
716 static int iceland_populate_phase_value_based_on_sclk(struct pp_hwmgr *hwmgr, in iceland_populate_phase_value_based_on_sclk() argument
741 static int iceland_populate_single_graphic_level(struct pp_hwmgr *hwmgr, in iceland_populate_single_graphic_level() argument
747 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_single_graphic_level()
749 result = iceland_calculate_sclk_params(hwmgr, engine_clock, graphic_level); in iceland_populate_single_graphic_level()
752 result = iceland_get_dependecy_volt_by_clk(hwmgr, in iceland_populate_single_graphic_level()
753 hwmgr->dyn_state.vddc_dependency_on_sclk, engine_clock, in iceland_populate_single_graphic_level()
764 iceland_populate_phase_value_based_on_sclk(hwmgr, in iceland_populate_single_graphic_level()
765 hwmgr->dyn_state.vddc_phase_shed_limits_table, in iceland_populate_single_graphic_level()
784 hwmgr->display_config.min_core_set_clock_in_sr; in iceland_populate_single_graphic_level()
786 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_populate_single_graphic_level()
816 int iceland_populate_all_graphic_levels(struct pp_hwmgr *hwmgr) in iceland_populate_all_graphic_levels() argument
818 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_all_graphic_levels()
819 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_all_graphic_levels()
838 result = iceland_populate_single_graphic_level(hwmgr, in iceland_populate_all_graphic_levels()
895 result = smu7_copy_bytes_to_smc(hwmgr->smumgr, level_array_adress, in iceland_populate_all_graphic_levels()
910 struct pp_hwmgr *hwmgr, in iceland_calculate_mclk_params() argument
917 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_calculate_mclk_params()
932 result = atomctrl_get_memory_pll_dividers_si(hwmgr, in iceland_calculate_mclk_params()
960 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_calculate_mclk_params()
980 uint32_t reference_clock = atomctrl_get_mpll_reference_clock(hwmgr); in iceland_calculate_mclk_params()
992 if (0 == atomctrl_get_memory_clock_spread_spectrum(hwmgr, freq_nom, &ss_info)) { in iceland_calculate_mclk_params()
1075 static int iceland_populate_phase_value_based_on_mclk(struct pp_hwmgr *hwmgr, const struct phm_phas… in iceland_populate_phase_value_based_on_mclk() argument
1093 struct pp_hwmgr *hwmgr, in iceland_populate_single_memory_level() argument
1098 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_single_memory_level()
1106 if (hwmgr->dyn_state.vddc_dependency_on_mclk != NULL) { in iceland_populate_single_memory_level()
1107 result = iceland_get_dependecy_volt_by_clk(hwmgr, in iceland_populate_single_memory_level()
1108 hwmgr->dyn_state.vddc_dependency_on_mclk, memory_clock, &memory_level->MinVddc); in iceland_populate_single_memory_level()
1115 } else if (NULL != hwmgr->dyn_state.vddci_dependency_on_mclk) { in iceland_populate_single_memory_level()
1116 result = iceland_get_dependecy_volt_by_clk(hwmgr, in iceland_populate_single_memory_level()
1117 hwmgr->dyn_state.vddci_dependency_on_mclk, in iceland_populate_single_memory_level()
1127 iceland_populate_phase_value_based_on_mclk(hwmgr, hwmgr->dyn_state.vddc_phase_shed_limits_table, in iceland_populate_single_memory_level()
1148 cgs_get_active_displays_info(hwmgr->device, &info); in iceland_populate_single_memory_level()
1174 ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC7) >> 16) & 0xf)) in iceland_populate_single_memory_level()
1175 dll_state_on = ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC5) >> 1) & 0x1) ? 1 : 0; in iceland_populate_single_memory_level()
1177 dll_state_on = ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC6) >> 1) & 0x1) ? 1 : 0; in iceland_populate_single_memory_level()
1183 dll_state_on = ((cgs_read_register(hwmgr->device, mmMC_SEQ_MISC5) >> 1) & 0x1) ? 1 : 0; in iceland_populate_single_memory_level()
1186 result = iceland_calculate_mclk_params(hwmgr, in iceland_populate_single_memory_level()
1218 int iceland_populate_all_memory_levels(struct pp_hwmgr *hwmgr) in iceland_populate_all_memory_levels() argument
1220 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_all_memory_levels()
1221 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_all_memory_levels()
1236 result = iceland_populate_single_memory_level(hwmgr, dpm_table->mclk_table.dpm_levels[i].value, in iceland_populate_all_memory_levels()
1260 result = smu7_copy_bytes_to_smc(hwmgr->smumgr, in iceland_populate_all_memory_levels()
1267 static int iceland_populate_mvdd_value(struct pp_hwmgr *hwmgr, uint32_t mclk, in iceland_populate_mvdd_value() argument
1270 const struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_mvdd_value()
1276 for (i = 0; i < hwmgr->dyn_state.mvdd_dependency_on_mclk->count; i++) { in iceland_populate_mvdd_value()
1277 if (mclk <= hwmgr->dyn_state.mvdd_dependency_on_mclk->entries[i].clk) { in iceland_populate_mvdd_value()
1284 PP_ASSERT_WITH_CODE(i < hwmgr->dyn_state.mvdd_dependency_on_mclk->count, in iceland_populate_mvdd_value()
1294 static int iceland_populate_smc_acpi_level(struct pp_hwmgr *hwmgr, in iceland_populate_smc_acpi_level() argument
1298 const struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_acpi_level()
1319 table->ACPILevel.SclkFrequency = atomctrl_get_reference_clock(hwmgr); in iceland_populate_smc_acpi_level()
1322 result = atomctrl_get_engine_pll_dividers_vi(hwmgr, in iceland_populate_smc_acpi_level()
1376 if (0 == iceland_populate_mvdd_value(hwmgr, 0, &voltage_level)) in iceland_populate_smc_acpi_level()
1436 static int iceland_populate_smc_uvd_level(struct pp_hwmgr *hwmgr, in iceland_populate_smc_uvd_level() argument
1442 static int iceland_populate_smc_vce_level(struct pp_hwmgr *hwmgr, in iceland_populate_smc_vce_level() argument
1448 static int iceland_populate_smc_acp_level(struct pp_hwmgr *hwmgr, in iceland_populate_smc_acp_level() argument
1454 static int iceland_populate_smc_samu_level(struct pp_hwmgr *hwmgr, in iceland_populate_smc_samu_level() argument
1461 struct pp_hwmgr *hwmgr, in iceland_populate_memory_timing_parameters() argument
1472 result = atomctrl_set_engine_dram_timings_rv770(hwmgr, in iceland_populate_memory_timing_parameters()
1478 dramTiming = cgs_read_register(hwmgr->device, mmMC_ARB_DRAM_TIMING); in iceland_populate_memory_timing_parameters()
1479 dramTiming2 = cgs_read_register(hwmgr->device, mmMC_ARB_DRAM_TIMING2); in iceland_populate_memory_timing_parameters()
1480 burstTime = PHM_READ_FIELD(hwmgr->device, MC_ARB_BURST_TIME, STATE0); in iceland_populate_memory_timing_parameters()
1496 static int iceland_program_memory_timing_parameters(struct pp_hwmgr *hwmgr) in iceland_program_memory_timing_parameters() argument
1498 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_program_memory_timing_parameters()
1499 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_program_memory_timing_parameters()
1509 (hwmgr, data->dpm_table.sclk_table.dpm_levels[i].value, in iceland_program_memory_timing_parameters()
1521 hwmgr->smumgr, in iceland_program_memory_timing_parameters()
1532 static int iceland_populate_smc_boot_level(struct pp_hwmgr *hwmgr, in iceland_populate_smc_boot_level() argument
1536 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_boot_level()
1537 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_smc_boot_level()
1641 static int iceland_convert_mc_reg_table_to_smc(struct pp_hwmgr *hwmgr, in iceland_convert_mc_reg_table_to_smc() argument
1645 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_convert_mc_reg_table_to_smc()
1651 hwmgr->smumgr, in iceland_convert_mc_reg_table_to_smc()
1663 static int iceland_update_and_upload_mc_reg_table(struct pp_hwmgr *hwmgr) in iceland_update_and_upload_mc_reg_table() argument
1665 struct pp_smumgr *smumgr = hwmgr->smumgr; in iceland_update_and_upload_mc_reg_table()
1667 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_update_and_upload_mc_reg_table()
1677 result = iceland_convert_mc_reg_table_to_smc(hwmgr, &(smu_data->mc_regs)); in iceland_update_and_upload_mc_reg_table()
1685 return smu7_copy_bytes_to_smc(hwmgr->smumgr, address, in iceland_update_and_upload_mc_reg_table()
1691 static int iceland_populate_initial_mc_reg_table(struct pp_hwmgr *hwmgr) in iceland_populate_initial_mc_reg_table() argument
1694 struct pp_smumgr *smumgr = hwmgr->smumgr; in iceland_populate_initial_mc_reg_table()
1702 result = iceland_convert_mc_reg_table_to_smc(hwmgr, &smu_data->mc_regs); in iceland_populate_initial_mc_reg_table()
1710 static int iceland_populate_smc_initial_state(struct pp_hwmgr *hwmgr) in iceland_populate_smc_initial_state() argument
1712 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_initial_state()
1713 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_smc_initial_state()
1716 count = (uint8_t)(hwmgr->dyn_state.vddc_dependency_on_sclk->count); in iceland_populate_smc_initial_state()
1719 if (hwmgr->dyn_state.vddc_dependency_on_sclk->entries[level].clk in iceland_populate_smc_initial_state()
1726 count = (uint8_t)(hwmgr->dyn_state.vddc_dependency_on_mclk->count); in iceland_populate_smc_initial_state()
1729 if (hwmgr->dyn_state.vddc_dependency_on_mclk->entries[level].clk in iceland_populate_smc_initial_state()
1739 static int iceland_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr) in iceland_populate_bapm_parameters_in_dpm_table() argument
1741 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_bapm_parameters_in_dpm_table()
1742 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_populate_bapm_parameters_in_dpm_table()
1745 struct phm_cac_tdp_table *cac_dtp_table = hwmgr->dyn_state.cac_dtp_table; in iceland_populate_bapm_parameters_in_dpm_table()
1746 struct phm_ppm_table *ppm = hwmgr->dyn_state.ppm_parameter_table; in iceland_populate_bapm_parameters_in_dpm_table()
1797 static int iceland_populate_smc_svi2_config(struct pp_hwmgr *hwmgr, in iceland_populate_smc_svi2_config() argument
1800 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_populate_smc_svi2_config()
1826 int iceland_init_smc_table(struct pp_hwmgr *hwmgr) in iceland_init_smc_table() argument
1829 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_init_smc_table()
1830 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_init_smc_table()
1834 iceland_initialize_power_tune_defaults(hwmgr); in iceland_init_smc_table()
1838 iceland_populate_smc_voltage_tables(hwmgr, table); in iceland_init_smc_table()
1841 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_init_smc_table()
1846 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_init_smc_table()
1855 result = iceland_populate_ulv_state(hwmgr, &(smu_data->ulv_setting)); in iceland_init_smc_table()
1859 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, in iceland_init_smc_table()
1863 result = iceland_populate_smc_link_level(hwmgr, table); in iceland_init_smc_table()
1867 result = iceland_populate_all_graphic_levels(hwmgr); in iceland_init_smc_table()
1871 result = iceland_populate_all_memory_levels(hwmgr); in iceland_init_smc_table()
1875 result = iceland_populate_smc_acpi_level(hwmgr, table); in iceland_init_smc_table()
1879 result = iceland_populate_smc_vce_level(hwmgr, table); in iceland_init_smc_table()
1883 result = iceland_populate_smc_acp_level(hwmgr, table); in iceland_init_smc_table()
1887 result = iceland_populate_smc_samu_level(hwmgr, table); in iceland_init_smc_table()
1893 result = iceland_program_memory_timing_parameters(hwmgr); in iceland_init_smc_table()
1897 result = iceland_populate_smc_uvd_level(hwmgr, table); in iceland_init_smc_table()
1904 result = iceland_populate_smc_boot_level(hwmgr, table); in iceland_init_smc_table()
1908 result = iceland_populate_smc_initial_state(hwmgr); in iceland_init_smc_table()
1911 result = iceland_populate_bapm_parameters_in_dpm_table(hwmgr); in iceland_init_smc_table()
1935 result = iceland_populate_smc_svi2_config(hwmgr, table); in iceland_init_smc_table()
1958 result = smu7_copy_bytes_to_smc(hwmgr->smumgr, smu_data->smu7_data.dpm_table_start + in iceland_init_smc_table()
1968 result = smu7_copy_bytes_to_smc(hwmgr->smumgr, in iceland_init_smc_table()
1975 result = iceland_populate_initial_mc_reg_table(hwmgr); in iceland_init_smc_table()
1979 result = iceland_populate_pm_fuses(hwmgr); in iceland_init_smc_table()
1995 int iceland_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) in iceland_thermal_setup_fan_table() argument
1997 struct smu7_smumgr *smu7_data = (struct smu7_smumgr *)(hwmgr->smumgr->backend); in iceland_thermal_setup_fan_table()
2006 …if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl… in iceland_thermal_setup_fan_table()
2009 if (hwmgr->thermal_controller.fanInfo.bNoFan) { in iceland_thermal_setup_fan_table()
2010 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, in iceland_thermal_setup_fan_table()
2016 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl); in iceland_thermal_setup_fan_table()
2020 …duty100 = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_FDO_CTRL1, FMAX_DUTY100… in iceland_thermal_setup_fan_table()
2023 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl); in iceland_thermal_setup_fan_table()
2027 tmp64 = hwmgr->thermal_controller.advanceFanControlParameters.usPWMMin * duty100; in iceland_thermal_setup_fan_table()
2031 …t_diff1 = hwmgr->thermal_controller.advanceFanControlParameters.usTMed - hwmgr->thermal_controller… in iceland_thermal_setup_fan_table()
2032 …t_diff2 = hwmgr->thermal_controller.advanceFanControlParameters.usTHigh - hwmgr->thermal_controlle… in iceland_thermal_setup_fan_table()
2034 …pwm_diff1 = hwmgr->thermal_controller.advanceFanControlParameters.usPWMMed - hwmgr->thermal_contro… in iceland_thermal_setup_fan_table()
2035 …pwm_diff2 = hwmgr->thermal_controller.advanceFanControlParameters.usPWMHigh - hwmgr->thermal_contr… in iceland_thermal_setup_fan_table()
2040 …fan_table.TempMin = cpu_to_be16((50 + hwmgr->thermal_controller.advanceFanControlParameters.usTMin… in iceland_thermal_setup_fan_table()
2041 …fan_table.TempMed = cpu_to_be16((50 + hwmgr->thermal_controller.advanceFanControlParameters.usTMed… in iceland_thermal_setup_fan_table()
2042 …fan_table.TempMax = cpu_to_be16((50 + hwmgr->thermal_controller.advanceFanControlParameters.usTMax… in iceland_thermal_setup_fan_table()
2049 fan_table.HystDown = cpu_to_be16(hwmgr->thermal_controller.advanceFanControlParameters.ucTHyst); in iceland_thermal_setup_fan_table()
2057 reference_clock = smu7_get_xclk(hwmgr); in iceland_thermal_setup_fan_table()
2059 …fan_table.RefreshPeriod = cpu_to_be32((hwmgr->thermal_controller.advanceFanControlParameters.ulCyc… in iceland_thermal_setup_fan_table()
2063 …fan_table.TempSrc = (uint8_t)PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_MULT… in iceland_thermal_setup_fan_table()
2067 …res = smu7_copy_bytes_to_smc(hwmgr->smumgr, smu7_data->fan_table_start, (uint8_t *)&fan_table, (ui… in iceland_thermal_setup_fan_table()
2073 static int iceland_program_mem_timing_parameters(struct pp_hwmgr *hwmgr) in iceland_program_mem_timing_parameters() argument
2075 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_program_mem_timing_parameters()
2079 return iceland_program_memory_timing_parameters(hwmgr); in iceland_program_mem_timing_parameters()
2084 int iceland_update_sclk_threshold(struct pp_hwmgr *hwmgr) in iceland_update_sclk_threshold() argument
2086 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_update_sclk_threshold()
2087 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_update_sclk_threshold()
2092 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in iceland_update_sclk_threshold()
2094 && (hwmgr->gfx_arbiter.sclk_threshold != in iceland_update_sclk_threshold()
2097 hwmgr->gfx_arbiter.sclk_threshold; in iceland_update_sclk_threshold()
2104 hwmgr->smumgr, in iceland_update_sclk_threshold()
2113 result = iceland_update_and_upload_mc_reg_table(hwmgr); in iceland_update_sclk_threshold()
2117 result = iceland_program_mem_timing_parameters(hwmgr); in iceland_update_sclk_threshold()
2182 int iceland_process_firmware_header(struct pp_hwmgr *hwmgr) in iceland_process_firmware_header() argument
2184 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_process_firmware_header()
2185 struct smu7_smumgr *smu7_data = (struct smu7_smumgr *)(hwmgr->smumgr->backend); in iceland_process_firmware_header()
2191 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2202 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2215 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2224 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2235 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2247 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2253 hwmgr->microcode_version_info.SMC = tmp; in iceland_process_firmware_header()
2258 result = smu7_read_smc_sram_dword(hwmgr->smumgr, in iceland_process_firmware_header()
2274 static uint8_t iceland_get_memory_modile_index(struct pp_hwmgr *hwmgr) in iceland_get_memory_modile_index() argument
2276 return (uint8_t) (0xFF & (cgs_read_register(hwmgr->device, mmBIOS_SCRATCH_4) >> 16)); in iceland_get_memory_modile_index()
2425 static int iceland_set_mc_special_registers(struct pp_hwmgr *hwmgr, in iceland_set_mc_special_registers() argument
2430 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in iceland_set_mc_special_registers()
2439 temp_reg = cgs_read_register(hwmgr->device, mmMC_PMG_CMD_EMRS); in iceland_set_mc_special_registers()
2451 temp_reg = cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS); in iceland_set_mc_special_registers()
2482 temp_reg = cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS1); in iceland_set_mc_special_registers()
2522 int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) in iceland_initialize_mc_reg_table() argument
2525 struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smumgr->backend); in iceland_initialize_mc_reg_table()
2528 uint8_t module_index = iceland_get_memory_modile_index(hwmgr); in iceland_initialize_mc_reg_table()
2536 …cgs_write_register(hwmgr->device, mmMC_SEQ_RAS_TIMING_LP, cgs_read_register(hwmgr->device, mmMC_SE… in iceland_initialize_mc_reg_table()
2537 …cgs_write_register(hwmgr->device, mmMC_SEQ_CAS_TIMING_LP, cgs_read_register(hwmgr->device, mmMC_SE… in iceland_initialize_mc_reg_table()
2538 …cgs_write_register(hwmgr->device, mmMC_SEQ_DLL_STBY_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_… in iceland_initialize_mc_reg_table()
2539 …cgs_write_register(hwmgr->device, mmMC_SEQ_G5PDX_CMD0_LP, cgs_read_register(hwmgr->device, mmMC_SE… in iceland_initialize_mc_reg_table()
2540 …cgs_write_register(hwmgr->device, mmMC_SEQ_G5PDX_CMD1_LP, cgs_read_register(hwmgr->device, mmMC_SE… in iceland_initialize_mc_reg_table()
2541 …cgs_write_register(hwmgr->device, mmMC_SEQ_G5PDX_CTRL_LP, cgs_read_register(hwmgr->device, mmMC_SE… in iceland_initialize_mc_reg_table()
2542 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_DVS_CMD_LP, cgs_read_register(hwmgr->device, mmMC_S… in iceland_initialize_mc_reg_table()
2543 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_DVS_CTL_LP, cgs_read_register(hwmgr->device, mmMC_S… in iceland_initialize_mc_reg_table()
2544 …cgs_write_register(hwmgr->device, mmMC_SEQ_MISC_TIMING_LP, cgs_read_register(hwmgr->device, mmMC_S… in iceland_initialize_mc_reg_table()
2545 …cgs_write_register(hwmgr->device, mmMC_SEQ_MISC_TIMING2_LP, cgs_read_register(hwmgr->device, mmMC_… in iceland_initialize_mc_reg_table()
2546 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_EMRS_LP, cgs_read_register(hwmgr->device, mmMC_… in iceland_initialize_mc_reg_table()
2547 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS_LP, cgs_read_register(hwmgr->device, mmMC_P… in iceland_initialize_mc_reg_table()
2548 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS1_LP, cgs_read_register(hwmgr->device, mmMC_… in iceland_initialize_mc_reg_table()
2549 …cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_D0_LP, cgs_read_register(hwmgr->device, mmMC_SEQ… in iceland_initialize_mc_reg_table()
2550 …cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_D1_LP, cgs_read_register(hwmgr->device, mmMC_SEQ… in iceland_initialize_mc_reg_table()
2551 …cgs_write_register(hwmgr->device, mmMC_SEQ_RD_CTL_D0_LP, cgs_read_register(hwmgr->device, mmMC_SEQ… in iceland_initialize_mc_reg_table()
2552 …cgs_write_register(hwmgr->device, mmMC_SEQ_RD_CTL_D1_LP, cgs_read_register(hwmgr->device, mmMC_SEQ… in iceland_initialize_mc_reg_table()
2553 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_TIMING_LP, cgs_read_register(hwmgr->device, mmMC_SE… in iceland_initialize_mc_reg_table()
2554 …cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_… in iceland_initialize_mc_reg_table()
2555 …cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_… in iceland_initialize_mc_reg_table()
2559 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); in iceland_initialize_mc_reg_table()
2566 result = iceland_set_mc_special_registers(hwmgr, ni_table); in iceland_initialize_mc_reg_table()
2577 bool iceland_is_dpm_running(struct pp_hwmgr *hwmgr) in iceland_is_dpm_running() argument
2579 return (1 == PHM_READ_INDIRECT_FIELD(hwmgr->device, in iceland_is_dpm_running()