drm/amdgpu: initialize PSP before IH under SR-IOV
authorTrigger Huang <Trigger.Huang@amd.com>
Wed, 24 Apr 2019 07:23:41 +0000 (15:23 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:50 +0000 (12:20 -0500)
In order to support new PSP feature that PSP may provide interface
to program IH CNTL register, initialize PSP before IH under Vega10
SR-IOV VF

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/soc15.c

index 4f4e2a453b1849f8b01959797c695bca9bee3f02..309461d0c275a6968e730d39a115fd49e197b4fe 100644 (file)
@@ -1580,6 +1580,7 @@ static int amdgpu_device_ip_hw_init_phase1(struct amdgpu_device *adev)
                if (adev->ip_blocks[i].status.hw)
                        continue;
                if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON ||
+                   (amdgpu_sriov_vf(adev) && (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)) ||
                    adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH) {
                        r = adev->ip_blocks[i].version->funcs->hw_init(adev);
                        if (r) {
index 78b27c03b8c21419886bfb571dc9ed97e0270280..c1785843f0de6392b2fff66fcd94259c36e7ae5c 100644 (file)
@@ -608,12 +608,24 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
        case CHIP_VEGA20:
                amdgpu_device_ip_block_add(adev, &vega10_common_ip_block);
                amdgpu_device_ip_block_add(adev, &gmc_v9_0_ip_block);
-               amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block);
-               if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) {
-                       if (adev->asic_type == CHIP_VEGA20)
-                               amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block);
-                       else
-                               amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block);
+
+               /* For Vega10 SR-IOV, PSP need to be initialized before IH */
+               if (amdgpu_sriov_vf(adev)) {
+                       if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) {
+                               if (adev->asic_type == CHIP_VEGA20)
+                                       amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block);
+                               else
+                                       amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block);
+                       }
+                       amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block);
+               } else {
+                       amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block);
+                       if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) {
+                               if (adev->asic_type == CHIP_VEGA20)
+                                       amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block);
+                               else
+                                       amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block);
+                       }
                }
                amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
                amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);