@@ -134,6 +134,7 @@ static const struct cmn2asic_msg_mapping aldebaran_message_map[SMU_MSG_MAX_COUNT
134134 MSG_MAP (DisableDeterminism , PPSMC_MSG_DisableDeterminism , 0 ),
135135 MSG_MAP (SetUclkDpmMode , PPSMC_MSG_SetUclkDpmMode , 0 ),
136136 MSG_MAP (GfxDriverResetRecovery , PPSMC_MSG_GfxDriverResetRecovery , 0 ),
137+ MSG_MAP (BoardPowerCalibration , PPSMC_MSG_BoardPowerCalibration , 0 ),
137138};
138139
139140static const struct cmn2asic_mapping aldebaran_clk_map [SMU_CLK_COUNT ] = {
@@ -440,13 +441,48 @@ static int aldebaran_setup_pptable(struct smu_context *smu)
440441 return ret ;
441442}
442443
444+ static bool aldebaran_is_primary (struct smu_context * smu )
445+ {
446+ struct amdgpu_device * adev = smu -> adev ;
447+
448+ if (adev -> smuio .funcs && adev -> smuio .funcs -> get_die_id )
449+ return adev -> smuio .funcs -> get_die_id (adev ) == 0 ;
450+
451+ return true;
452+ }
453+
454+ static int aldebaran_run_board_btc (struct smu_context * smu )
455+ {
456+ u32 smu_version ;
457+ int ret ;
458+
459+ if (!aldebaran_is_primary (smu ))
460+ return 0 ;
461+
462+ ret = smu_cmn_get_smc_version (smu , NULL , & smu_version );
463+ if (ret ) {
464+ dev_err (smu -> adev -> dev , "Failed to get smu version!\n" );
465+ return ret ;
466+ }
467+ if (smu_version <= 0x00441d00 )
468+ return 0 ;
469+
470+ ret = smu_cmn_send_smc_msg (smu , SMU_MSG_BoardPowerCalibration , NULL );
471+ if (ret )
472+ dev_err (smu -> adev -> dev , "Board power calibration failed!\n" );
473+
474+ return ret ;
475+ }
476+
443477static int aldebaran_run_btc (struct smu_context * smu )
444478{
445479 int ret ;
446480
447481 ret = smu_cmn_send_smc_msg (smu , SMU_MSG_RunDcBtc , NULL );
448482 if (ret )
449483 dev_err (smu -> adev -> dev , "RunDcBtc failed!\n" );
484+ else
485+ ret = aldebaran_run_board_btc (smu );
450486
451487 return ret ;
452488}
@@ -524,16 +560,6 @@ static int aldebaran_freqs_in_same_level(int32_t frequency1,
524560 return (abs (frequency1 - frequency2 ) <= EPSILON );
525561}
526562
527- static bool aldebaran_is_primary (struct smu_context * smu )
528- {
529- struct amdgpu_device * adev = smu -> adev ;
530-
531- if (adev -> smuio .funcs && adev -> smuio .funcs -> get_die_id )
532- return adev -> smuio .funcs -> get_die_id (adev ) == 0 ;
533-
534- return true;
535- }
536-
537563static int aldebaran_get_smu_metrics_data (struct smu_context * smu ,
538564 MetricsMember_t member ,
539565 uint32_t * value )
0 commit comments