diff options
author | Huang Rui <ray.huang@amd.com> | 2017-02-15 22:53:38 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:54:49 -0400 |
commit | d1de1ed3dfa672e7f79ebef1f7321e17cb6d3a0c (patch) | |
tree | 0a8f88c2a0cdbeb350e4f3a2af6e1fa35f36f59f | |
parent | 6a7ed07e272d058a72910571a0d189bd04f92b49 (diff) |
drm/amdgpu: add SMC firmware into global ucode list for psp loading
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index f0e36240365a..7836cd6fc3d4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | |||
@@ -837,6 +837,8 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | |||
837 | uint32_t ucode_start_address; | 837 | uint32_t ucode_start_address; |
838 | const uint8_t *src; | 838 | const uint8_t *src; |
839 | const struct smc_firmware_header_v1_0 *hdr; | 839 | const struct smc_firmware_header_v1_0 *hdr; |
840 | const struct common_firmware_header *header; | ||
841 | struct amdgpu_firmware_info *ucode = NULL; | ||
840 | 842 | ||
841 | if (CGS_UCODE_ID_SMU_SK == type) | 843 | if (CGS_UCODE_ID_SMU_SK == type) |
842 | amdgpu_cgs_rel_firmware(cgs_device, CGS_UCODE_ID_SMU); | 844 | amdgpu_cgs_rel_firmware(cgs_device, CGS_UCODE_ID_SMU); |
@@ -919,6 +921,15 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | |||
919 | adev->pm.fw = NULL; | 921 | adev->pm.fw = NULL; |
920 | return err; | 922 | return err; |
921 | } | 923 | } |
924 | |||
925 | if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { | ||
926 | ucode = &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC]; | ||
927 | ucode->ucode_id = AMDGPU_UCODE_ID_SMC; | ||
928 | ucode->fw = adev->pm.fw; | ||
929 | header = (const struct common_firmware_header *)ucode->fw->data; | ||
930 | adev->firmware.fw_size += | ||
931 | ALIGN(le32_to_cpu(header->ucode_size_bytes), PAGE_SIZE); | ||
932 | } | ||
922 | } | 933 | } |
923 | 934 | ||
924 | hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data; | 935 | hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data; |