Lines Matching refs:hwmgr

82 static int vegam_smu_init(struct pp_hwmgr *hwmgr)  in vegam_smu_init()  argument
90 hwmgr->smu_backend = smu_data; in vegam_smu_init()
92 if (smu7_init(hwmgr)) { in vegam_smu_init()
100 static int vegam_start_smu_in_protection_mode(struct pp_hwmgr *hwmgr) in vegam_start_smu_in_protection_mode() argument
108 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_protection_mode()
111 result = smu7_upload_smu_firmware_image(hwmgr); in vegam_start_smu_in_protection_mode()
116 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMU_STATUS, 0); in vegam_start_smu_in_protection_mode()
118 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_protection_mode()
122 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_protection_mode()
126 PHM_WAIT_VFPF_INDIRECT_FIELD(hwmgr, SMC_IND, RCU_UC_EVENTS, INTERRUPTS_ENABLED, 1); in vegam_start_smu_in_protection_mode()
130 smu7_send_msg_to_smc_offset(hwmgr); in vegam_start_smu_in_protection_mode()
135 PHM_WAIT_VFPF_INDIRECT_FIELD_UNEQUAL(hwmgr, SMC_IND, SMU_STATUS, SMU_DONE, 0); in vegam_start_smu_in_protection_mode()
137 if (1 != PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_protection_mode()
141 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixFIRMWARE_FLAGS, 0); in vegam_start_smu_in_protection_mode()
143 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_protection_mode()
146 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_protection_mode()
150 PHM_WAIT_VFPF_INDIRECT_FIELD(hwmgr, SMC_IND, FIRMWARE_FLAGS, INTERRUPTS_ENABLED, 1); in vegam_start_smu_in_protection_mode()
155 static int vegam_start_smu_in_non_protection_mode(struct pp_hwmgr *hwmgr) in vegam_start_smu_in_non_protection_mode() argument
160 PHM_WAIT_VFPF_INDIRECT_FIELD_UNEQUAL(hwmgr, SMC_IND, RCU_UC_EVENTS, boot_seq_done, 0); in vegam_start_smu_in_non_protection_mode()
164 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_non_protection_mode()
167 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_non_protection_mode()
171 result = smu7_upload_smu_firmware_image(hwmgr); in vegam_start_smu_in_non_protection_mode()
176 smu7_program_jump_on_start(hwmgr); in vegam_start_smu_in_non_protection_mode()
178 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_non_protection_mode()
181 PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, in vegam_start_smu_in_non_protection_mode()
186 PHM_WAIT_VFPF_INDIRECT_FIELD(hwmgr, SMC_IND, in vegam_start_smu_in_non_protection_mode()
192 static int vegam_start_smu(struct pp_hwmgr *hwmgr) in vegam_start_smu() argument
195 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_start_smu()
198 if (!smu7_is_smc_ram_running(hwmgr) && hwmgr->not_vf) { in vegam_start_smu()
199 smu_data->protected_mode = (uint8_t)(PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, in vegam_start_smu()
202 hwmgr->device, CGS_IND_REG__SMC, SMU_FIRMWARE, SMU_SEL)); in vegam_start_smu()
206 result = vegam_start_smu_in_non_protection_mode(hwmgr); in vegam_start_smu()
208 result = vegam_start_smu_in_protection_mode(hwmgr); in vegam_start_smu()
215 smu7_read_smc_sram_dword(hwmgr, in vegam_start_smu()
220 result = smu7_request_smu_load_fw(hwmgr); in vegam_start_smu()
225 static int vegam_process_firmware_header(struct pp_hwmgr *hwmgr) in vegam_process_firmware_header() argument
227 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_process_firmware_header()
228 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_process_firmware_header()
233 result = smu7_read_smc_sram_dword(hwmgr, in vegam_process_firmware_header()
243 result = smu7_read_smc_sram_dword(hwmgr, in vegam_process_firmware_header()
255 result = smu7_read_smc_sram_dword(hwmgr, in vegam_process_firmware_header()
263 result = smu7_read_smc_sram_dword(hwmgr, in vegam_process_firmware_header()
273 result = smu7_read_smc_sram_dword(hwmgr, in vegam_process_firmware_header()
283 result = smu7_read_smc_sram_dword(hwmgr, in vegam_process_firmware_header()
289 hwmgr->microcode_version_info.SMC = tmp; in vegam_process_firmware_header()
296 static bool vegam_is_dpm_running(struct pp_hwmgr *hwmgr) in vegam_is_dpm_running() argument
298 return 1 == PHM_READ_INDIRECT_FIELD(hwmgr->device, in vegam_is_dpm_running()
330 static int vegam_update_uvd_smc_table(struct pp_hwmgr *hwmgr) in vegam_update_uvd_smc_table() argument
332 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_update_uvd_smc_table()
335 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_update_uvd_smc_table()
345 mm_boot_level_value = cgs_read_ind_register(hwmgr->device, in vegam_update_uvd_smc_table()
349 cgs_write_ind_register(hwmgr->device, in vegam_update_uvd_smc_table()
352 if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_update_uvd_smc_table()
354 phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_update_uvd_smc_table()
356 smum_send_msg_to_smc_with_parameter(hwmgr, in vegam_update_uvd_smc_table()
363 static int vegam_update_vce_smc_table(struct pp_hwmgr *hwmgr) in vegam_update_vce_smc_table() argument
365 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_update_vce_smc_table()
368 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_update_vce_smc_table()
370 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_update_vce_smc_table()
381 mm_boot_level_value = cgs_read_ind_register(hwmgr->device, in vegam_update_vce_smc_table()
385 cgs_write_ind_register(hwmgr->device, in vegam_update_vce_smc_table()
388 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState)) in vegam_update_vce_smc_table()
389 smum_send_msg_to_smc_with_parameter(hwmgr, in vegam_update_vce_smc_table()
396 static int vegam_update_bif_smc_table(struct pp_hwmgr *hwmgr) in vegam_update_bif_smc_table() argument
398 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_update_bif_smc_table()
400 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_update_bif_smc_table()
413 static int vegam_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type) in vegam_update_smc_table() argument
417 vegam_update_uvd_smc_table(hwmgr); in vegam_update_smc_table()
420 vegam_update_vce_smc_table(hwmgr); in vegam_update_smc_table()
423 vegam_update_bif_smc_table(hwmgr); in vegam_update_smc_table()
431 static void vegam_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr) in vegam_initialize_power_tune_defaults() argument
433 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_initialize_power_tune_defaults()
435 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_initialize_power_tune_defaults()
448 static int vegam_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr, in vegam_populate_smc_mvdd_table() argument
451 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_mvdd_table()
475 static int vegam_populate_smc_vddci_table(struct pp_hwmgr *hwmgr, in vegam_populate_smc_vddci_table() argument
479 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_vddci_table()
500 static int vegam_populate_cac_table(struct pp_hwmgr *hwmgr, in vegam_populate_cac_table() argument
505 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_cac_table()
507 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_cac_table()
529 static int vegam_populate_smc_voltage_tables(struct pp_hwmgr *hwmgr, in vegam_populate_smc_voltage_tables() argument
532 vegam_populate_smc_vddci_table(hwmgr, table); in vegam_populate_smc_voltage_tables()
533 vegam_populate_smc_mvdd_table(hwmgr, table); in vegam_populate_smc_voltage_tables()
534 vegam_populate_cac_table(hwmgr, table); in vegam_populate_smc_voltage_tables()
539 static int vegam_populate_ulv_level(struct pp_hwmgr *hwmgr, in vegam_populate_ulv_level() argument
542 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_ulv_level()
544 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_ulv_level()
562 static int vegam_populate_ulv_state(struct pp_hwmgr *hwmgr, in vegam_populate_ulv_state() argument
565 return vegam_populate_ulv_level(hwmgr, &table->Ulv); in vegam_populate_ulv_state()
568 static int vegam_populate_smc_link_level(struct pp_hwmgr *hwmgr, in vegam_populate_smc_link_level() argument
571 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_link_level()
573 (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_smc_link_level()
600 static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr, in vegam_get_dependency_volt_by_clk() argument
606 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_get_dependency_volt_by_clk()
669 static void vegam_get_sclk_range_table(struct pp_hwmgr *hwmgr, in vegam_get_sclk_range_table() argument
672 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_get_sclk_range_table()
677 ref_clk = amdgpu_asic_get_xclk((struct amdgpu_device *)hwmgr->adev); in vegam_get_sclk_range_table()
679 if (0 == atomctrl_get_smc_sclk_range_table(hwmgr, &range_table_from_vbios)) { in vegam_get_sclk_range_table()
719 static int vegam_calculate_sclk_params(struct pp_hwmgr *hwmgr, in vegam_calculate_sclk_params() argument
722 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_calculate_sclk_params()
733 result = atomctrl_get_engine_pll_dividers_ai(hwmgr, clock, &dividers); in vegam_calculate_sclk_params()
749 ref_clock = amdgpu_asic_get_xclk((struct amdgpu_device *)hwmgr->adev); in vegam_calculate_sclk_params()
809 static int vegam_populate_single_graphic_level(struct pp_hwmgr *hwmgr, in vegam_populate_single_graphic_level() argument
815 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_single_graphic_level()
817 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_single_graphic_level()
820 result = vegam_calculate_sclk_params(hwmgr, clock, &curr_sclk_setting); in vegam_populate_single_graphic_level()
823 result = vegam_get_dependency_volt_by_clk(hwmgr, in vegam_populate_single_graphic_level()
839 data->display_timing.min_clock_in_sr = hwmgr->display_config->min_core_set_clock_in_sr; in vegam_populate_single_graphic_level()
841 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep)) in vegam_populate_single_graphic_level()
843 hwmgr->display_config->min_core_set_clock_in_sr); in vegam_populate_single_graphic_level()
864 static int vegam_populate_all_graphic_levels(struct pp_hwmgr *hwmgr) in vegam_populate_all_graphic_levels() argument
866 struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_all_graphic_levels()
867 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_all_graphic_levels()
870 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_all_graphic_levels()
886 vegam_get_sclk_range_table(hwmgr, &(smu_data->smc_state_table)); in vegam_populate_all_graphic_levels()
890 result = vegam_populate_single_graphic_level(hwmgr, in vegam_populate_all_graphic_levels()
904 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_populate_all_graphic_levels()
957 result = smu7_copy_bytes_to_smc(hwmgr, array, (uint8_t *)levels, in vegam_populate_all_graphic_levels()
963 static int vegam_calculate_mclk_params(struct pp_hwmgr *hwmgr, in vegam_calculate_mclk_params() argument
968 PP_ASSERT_WITH_CODE(!atomctrl_get_memory_pll_dividers_ai(hwmgr, in vegam_calculate_mclk_params()
981 static int vegam_populate_single_memory_level(struct pp_hwmgr *hwmgr, in vegam_populate_single_memory_level() argument
984 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_single_memory_level()
986 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_single_memory_level()
992 result = vegam_get_dependency_volt_by_clk(hwmgr, in vegam_populate_single_memory_level()
1000 result = vegam_calculate_mclk_params(hwmgr, clock, mem_level); in vegam_populate_single_memory_level()
1013 data->display_timing.num_existing_displays = hwmgr->display_config->num_display; in vegam_populate_single_memory_level()
1014 data->display_timing.vrefresh = hwmgr->display_config->vrefresh; in vegam_populate_single_memory_level()
1018 (PHM_READ_FIELD(hwmgr->device, DPG_PIPE_STUTTER_CONTROL, in vegam_populate_single_memory_level()
1034 static int vegam_populate_all_memory_levels(struct pp_hwmgr *hwmgr) in vegam_populate_all_memory_levels() argument
1036 struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_all_memory_levels()
1037 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_all_memory_levels()
1053 result = vegam_populate_single_memory_level(hwmgr, in vegam_populate_all_memory_levels()
1079 result = smu7_copy_bytes_to_smc(hwmgr, array, (uint8_t *)levels, in vegam_populate_all_memory_levels()
1085 static int vegam_populate_mvdd_value(struct pp_hwmgr *hwmgr, in vegam_populate_mvdd_value() argument
1088 const struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_mvdd_value()
1090 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_mvdd_value()
1110 static int vegam_populate_smc_acpi_level(struct pp_hwmgr *hwmgr, in vegam_populate_smc_acpi_level() argument
1115 const struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_acpi_level()
1117 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_smc_acpi_level()
1126 result = vegam_get_dependency_volt_by_clk(hwmgr, in vegam_populate_smc_acpi_level()
1135 result = vegam_calculate_sclk_params(hwmgr, sclk_frequency, in vegam_populate_smc_acpi_level()
1164 result = vegam_get_dependency_volt_by_clk(hwmgr, in vegam_populate_smc_acpi_level()
1173 if (!vegam_populate_mvdd_value(hwmgr, 0, &vol_level)) in vegam_populate_smc_acpi_level()
1194 static int vegam_populate_smc_vce_level(struct pp_hwmgr *hwmgr, in vegam_populate_smc_vce_level() argument
1201 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_smc_vce_level()
1204 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_vce_level()
1230 result = atomctrl_get_dfs_pll_dividers_vi(hwmgr, in vegam_populate_smc_vce_level()
1244 static int vegam_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr, in vegam_populate_memory_timing_parameters() argument
1256 result = atomctrl_set_engine_dram_timings_rv770(hwmgr, in vegam_populate_memory_timing_parameters()
1262 dram_timing = cgs_read_register(hwmgr->device, mmMC_ARB_DRAM_TIMING); in vegam_populate_memory_timing_parameters()
1263 dram_timing2 = cgs_read_register(hwmgr->device, mmMC_ARB_DRAM_TIMING2); in vegam_populate_memory_timing_parameters()
1264 burst_time = cgs_read_register(hwmgr->device, mmMC_ARB_BURST_TIME); in vegam_populate_memory_timing_parameters()
1265 rfsh_rate = cgs_read_register(hwmgr->device, mmMC_ARB_RFSH_RATE); in vegam_populate_memory_timing_parameters()
1266 misc3 = cgs_read_register(hwmgr->device, mmMC_ARB_MISC3); in vegam_populate_memory_timing_parameters()
1277 static int vegam_program_memory_timing_parameters(struct pp_hwmgr *hwmgr) in vegam_program_memory_timing_parameters() argument
1279 struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_program_memory_timing_parameters()
1280 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_program_memory_timing_parameters()
1289 result = vegam_populate_memory_timing_parameters(hwmgr, in vegam_program_memory_timing_parameters()
1299 hwmgr, in vegam_program_memory_timing_parameters()
1307 static int vegam_populate_smc_uvd_level(struct pp_hwmgr *hwmgr, in vegam_populate_smc_uvd_level() argument
1314 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_smc_uvd_level()
1317 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_uvd_level()
1342 result = atomctrl_get_dfs_pll_dividers_vi(hwmgr, in vegam_populate_smc_uvd_level()
1349 result = atomctrl_get_dfs_pll_dividers_vi(hwmgr, in vegam_populate_smc_uvd_level()
1364 static int vegam_populate_smc_boot_level(struct pp_hwmgr *hwmgr, in vegam_populate_smc_boot_level() argument
1368 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_boot_level()
1401 static int vegam_populate_smc_initial_state(struct pp_hwmgr *hwmgr) in vegam_populate_smc_initial_state() argument
1403 struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_smc_initial_state()
1404 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_smc_initial_state()
1406 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_smc_initial_state()
1438 static int vegam_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr) in vegam_populate_bapm_parameters_in_dpm_table() argument
1440 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_bapm_parameters_in_dpm_table()
1445 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_bapm_parameters_in_dpm_table()
1448 &hwmgr->thermal_controller.advanceFanControlParameters; in vegam_populate_bapm_parameters_in_dpm_table()
1486 static int vegam_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr) in vegam_populate_clock_stretcher_data_table() argument
1490 (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_clock_stretcher_data_table()
1494 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_clock_stretcher_data_table()
1500 atomctrl_read_efuse(hwmgr, STRAP_ASIC_RO_LSB, STRAP_ASIC_RO_MSB, in vegam_populate_clock_stretcher_data_table()
1533 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, in vegam_populate_clock_stretcher_data_table()
1540 value = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixPWR_CKS_CNTL); in vegam_populate_clock_stretcher_data_table()
1542 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixPWR_CKS_CNTL, value); in vegam_populate_clock_stretcher_data_table()
1547 static bool vegam_is_hw_avfs_present(struct pp_hwmgr *hwmgr) in vegam_is_hw_avfs_present() argument
1551 efuse = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, in vegam_is_hw_avfs_present()
1561 static int vegam_populate_avfs_parameters(struct pp_hwmgr *hwmgr) in vegam_populate_avfs_parameters() argument
1563 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_avfs_parameters()
1564 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_avfs_parameters()
1574 (struct phm_ppt_v1_information *)hwmgr->pptable; in vegam_populate_avfs_parameters()
1578 if (!hwmgr->avfs_supported) in vegam_populate_avfs_parameters()
1581 result = atomctrl_get_avfs_information(hwmgr, &avfs_params); in vegam_populate_avfs_parameters()
1636 result = smu7_read_smc_sram_dword(hwmgr, in vegam_populate_avfs_parameters()
1640 smu7_copy_bytes_to_smc(hwmgr, in vegam_populate_avfs_parameters()
1646 result = smu7_read_smc_sram_dword(hwmgr, in vegam_populate_avfs_parameters()
1650 smu7_copy_bytes_to_smc(hwmgr, in vegam_populate_avfs_parameters()
1667 static int vegam_populate_vr_config(struct pp_hwmgr *hwmgr, in vegam_populate_vr_config() argument
1670 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_populate_vr_config()
1672 (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_vr_config()
1703 cgs_write_ind_register(hwmgr->device, in vegam_populate_vr_config()
1717 cgs_write_ind_register(hwmgr->device, in vegam_populate_vr_config()
1730 static int vegam_populate_svi_load_line(struct pp_hwmgr *hwmgr) in vegam_populate_svi_load_line() argument
1732 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_svi_load_line()
1743 static int vegam_populate_tdc_limit(struct pp_hwmgr *hwmgr) in vegam_populate_tdc_limit() argument
1746 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_tdc_limit()
1748 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_tdc_limit()
1761 static int vegam_populate_dw8(struct pp_hwmgr *hwmgr, uint32_t fuse_table_offset) in vegam_populate_dw8() argument
1763 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_dw8()
1767 if (smu7_read_smc_sram_dword(hwmgr, in vegam_populate_dw8()
1785 static int vegam_populate_temperature_scaler(struct pp_hwmgr *hwmgr) in vegam_populate_temperature_scaler() argument
1788 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_temperature_scaler()
1797 static int vegam_populate_fuzzy_fan(struct pp_hwmgr *hwmgr) in vegam_populate_fuzzy_fan() argument
1799 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_fuzzy_fan()
1802 if ((hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity & (1 << 15)) in vegam_populate_fuzzy_fan()
1803 || 0 == hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity) in vegam_populate_fuzzy_fan()
1804 hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity = in vegam_populate_fuzzy_fan()
1805 hwmgr->thermal_controller.advanceFanControlParameters.usDefaultFanOutputSensitivity; in vegam_populate_fuzzy_fan()
1808 hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity); in vegam_populate_fuzzy_fan()
1812 static int vegam_populate_gnb_lpml(struct pp_hwmgr *hwmgr) in vegam_populate_gnb_lpml() argument
1815 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_gnb_lpml()
1824 static int vegam_populate_bapm_vddc_base_leakage_sidd(struct pp_hwmgr *hwmgr) in vegam_populate_bapm_vddc_base_leakage_sidd() argument
1826 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_bapm_vddc_base_leakage_sidd()
1828 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_populate_bapm_vddc_base_leakage_sidd()
1844 static int vegam_populate_pm_fuses(struct pp_hwmgr *hwmgr) in vegam_populate_pm_fuses() argument
1846 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_populate_pm_fuses()
1849 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_populate_pm_fuses()
1851 if (smu7_read_smc_sram_dword(hwmgr, in vegam_populate_pm_fuses()
1859 if (vegam_populate_svi_load_line(hwmgr)) in vegam_populate_pm_fuses()
1864 if (vegam_populate_tdc_limit(hwmgr)) in vegam_populate_pm_fuses()
1868 if (vegam_populate_dw8(hwmgr, pm_fuse_table_offset)) in vegam_populate_pm_fuses()
1874 if (0 != vegam_populate_temperature_scaler(hwmgr)) in vegam_populate_pm_fuses()
1879 if (vegam_populate_fuzzy_fan(hwmgr)) in vegam_populate_pm_fuses()
1884 if (vegam_populate_gnb_lpml(hwmgr)) in vegam_populate_pm_fuses()
1889 if (vegam_populate_bapm_vddc_base_leakage_sidd(hwmgr)) in vegam_populate_pm_fuses()
1894 if (smu7_copy_bytes_to_smc(hwmgr, pm_fuse_table_offset, in vegam_populate_pm_fuses()
1905 static int vegam_enable_reconfig_cus(struct pp_hwmgr *hwmgr) in vegam_enable_reconfig_cus() argument
1907 struct amdgpu_device *adev = hwmgr->adev; in vegam_enable_reconfig_cus()
1909 smum_send_msg_to_smc_with_parameter(hwmgr, in vegam_enable_reconfig_cus()
1917 static int vegam_init_smc_table(struct pp_hwmgr *hwmgr) in vegam_init_smc_table() argument
1920 struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_init_smc_table()
1921 struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_init_smc_table()
1924 (struct phm_ppt_v1_information *)(hwmgr->pptable); in vegam_init_smc_table()
1932 phm_cap_set(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
1935 vegam_initialize_power_tune_defaults(hwmgr); in vegam_init_smc_table()
1938 vegam_populate_smc_voltage_tables(hwmgr, table); in vegam_init_smc_table()
1941 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
1945 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
1953 result = vegam_populate_ulv_state(hwmgr, table); in vegam_init_smc_table()
1956 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, in vegam_init_smc_table()
1960 result = vegam_populate_smc_link_level(hwmgr, table); in vegam_init_smc_table()
1964 result = vegam_populate_all_graphic_levels(hwmgr); in vegam_init_smc_table()
1968 result = vegam_populate_all_memory_levels(hwmgr); in vegam_init_smc_table()
1972 result = vegam_populate_smc_acpi_level(hwmgr, table); in vegam_init_smc_table()
1976 result = vegam_populate_smc_vce_level(hwmgr, table); in vegam_init_smc_table()
1984 result = vegam_program_memory_timing_parameters(hwmgr); in vegam_init_smc_table()
1988 result = vegam_populate_smc_uvd_level(hwmgr, table); in vegam_init_smc_table()
1992 result = vegam_populate_smc_boot_level(hwmgr, table); in vegam_init_smc_table()
1996 result = vegam_populate_smc_initial_state(hwmgr); in vegam_init_smc_table()
2000 result = vegam_populate_bapm_parameters_in_dpm_table(hwmgr); in vegam_init_smc_table()
2004 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2006 result = vegam_populate_clock_stretcher_data_table(hwmgr); in vegam_init_smc_table()
2012 result = vegam_populate_avfs_parameters(hwmgr); in vegam_init_smc_table()
2042 result = vegam_populate_vr_config(hwmgr, table); in vegam_init_smc_table()
2049 if (atomctrl_get_pp_assign_pin(hwmgr, in vegam_init_smc_table()
2057 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2061 if (atomctrl_get_pp_assign_pin(hwmgr, in vegam_init_smc_table()
2064 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2066 !smum_send_msg_to_smc(hwmgr, PPSMC_MSG_UseNewGPIOScheme, NULL)) in vegam_init_smc_table()
2067 phm_cap_set(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2071 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2076 if (atomctrl_get_pp_assign_pin(hwmgr, in vegam_init_smc_table()
2086 (0 == (cgs_read_register(hwmgr->device, mmGPIOPAD_A) & in vegam_init_smc_table()
2091 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2093 phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_init_smc_table()
2104 result = atomctrl_get_dfs_pll_dividers_vi(hwmgr, in vegam_init_smc_table()
2133 result = smu7_copy_bytes_to_smc(hwmgr, in vegam_init_smc_table()
2142 result = vegam_populate_pm_fuses(hwmgr); in vegam_init_smc_table()
2146 result = vegam_enable_reconfig_cus(hwmgr); in vegam_init_smc_table()
2199 static int vegam_program_mem_timing_parameters(struct pp_hwmgr *hwmgr) in vegam_program_mem_timing_parameters() argument
2201 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_program_mem_timing_parameters()
2207 return vegam_program_memory_timing_parameters(hwmgr); in vegam_program_mem_timing_parameters()
2212 static int vegam_update_sclk_threshold(struct pp_hwmgr *hwmgr) in vegam_update_sclk_threshold() argument
2214 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_update_sclk_threshold()
2216 (struct vegam_smumgr *)(hwmgr->smu_backend); in vegam_update_sclk_threshold()
2220 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, in vegam_update_sclk_threshold()
2229 hwmgr, in vegam_update_sclk_threshold()
2240 result = vegam_program_mem_timing_parameters(hwmgr); in vegam_update_sclk_threshold()
2248 static int vegam_thermal_avfs_enable(struct pp_hwmgr *hwmgr) in vegam_thermal_avfs_enable() argument
2250 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); in vegam_thermal_avfs_enable()
2253 if (!hwmgr->avfs_supported) in vegam_thermal_avfs_enable()
2256 ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs, NULL); in vegam_thermal_avfs_enable()
2259 ret = smum_send_msg_to_smc(hwmgr, in vegam_thermal_avfs_enable()
2267 static int vegam_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) in vegam_thermal_setup_fan_table() argument
2269 PP_ASSERT_WITH_CODE(hwmgr->thermal_controller.fanInfo.bNoFan, in vegam_thermal_setup_fan_table()
2272 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, in vegam_thermal_setup_fan_table()