Skip to content

Commit

Permalink
drm/amd/pp: Get and save Rv smu version
Browse files Browse the repository at this point in the history
The smu firmware is loaded by the sbios on APUs, so query it
from the smu and save the smu fw version info that is reported
to userspace.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Rex Zhu authored and Alex Deucher committed Dec 20, 2017
1 parent 82eb0f3 commit f49e9ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
else
strcpy(fw_name, "amdgpu/vega10_smc.bin");
break;
case CHIP_RAVEN:
adev->pm.fw_version = info->version;
return 0;
default:
DRM_ERROR("SMC firmware not supported\n");
return -EINVAL;
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/amd/powerplay/smumgr/rv_smumgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ static int rv_smu_fini(struct pp_hwmgr *hwmgr)

static int rv_start_smu(struct pp_hwmgr *hwmgr)
{
struct cgs_firmware_info info = {0};

smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion);
rv_read_arg_from_smc(hwmgr, &hwmgr->smu_version);
info.version = hwmgr->smu_version >> 8;

cgs_get_firmware_info(hwmgr->device, CGS_UCODE_ID_SMU, &info);

if (rv_verify_smc_interface(hwmgr))
return -EINVAL;
if (rv_smc_enable_sdma(hwmgr))
Expand Down

0 comments on commit f49e9ba

Please sign in to comment.