diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 5b39d1399630..25d2f3e757f1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include "soc15_common.h" | 31 | #include "soc15_common.h" |
| 32 | #include "psp_v3_1.h" | 32 | #include "psp_v3_1.h" |
| 33 | #include "psp_v10_0.h" | 33 | #include "psp_v10_0.h" |
| 34 | #include "psp_v11_0.h" | ||
| 34 | 35 | ||
| 35 | static void psp_set_funcs(struct amdgpu_device *adev); | 36 | static void psp_set_funcs(struct amdgpu_device *adev); |
| 36 | 37 | ||
| @@ -52,12 +53,14 @@ static int psp_sw_init(void *handle) | |||
| 52 | switch (adev->asic_type) { | 53 | switch (adev->asic_type) { |
| 53 | case CHIP_VEGA10: | 54 | case CHIP_VEGA10: |
| 54 | case CHIP_VEGA12: | 55 | case CHIP_VEGA12: |
| 55 | case CHIP_VEGA20: | ||
| 56 | psp_v3_1_set_psp_funcs(psp); | 56 | psp_v3_1_set_psp_funcs(psp); |
| 57 | break; | 57 | break; |
| 58 | case CHIP_RAVEN: | 58 | case CHIP_RAVEN: |
| 59 | psp_v10_0_set_psp_funcs(psp); | 59 | psp_v10_0_set_psp_funcs(psp); |
| 60 | break; | 60 | break; |
| 61 | case CHIP_VEGA20: | ||
| 62 | psp_v11_0_set_psp_funcs(psp); | ||
| 63 | break; | ||
| 61 | default: | 64 | default: |
| 62 | return -EINVAL; | 65 | return -EINVAL; |
| 63 | } | 66 | } |
| @@ -131,6 +134,13 @@ psp_cmd_submit_buf(struct psp_context *psp, | |||
| 131 | msleep(1); | 134 | msleep(1); |
| 132 | } | 135 | } |
| 133 | 136 | ||
| 137 | /* the status field must be 0 after FW is loaded */ | ||
| 138 | if (ucode && psp->cmd_buf_mem->resp.status) { | ||
| 139 | DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n", | ||
| 140 | psp->cmd_buf_mem->resp.status, ucode->ucode_id); | ||
| 141 | return -EINVAL; | ||
| 142 | } | ||
| 143 | |||
| 134 | if (ucode) { | 144 | if (ucode) { |
| 135 | ucode->tmr_mc_addr_lo = psp->cmd_buf_mem->resp.fw_addr_lo; | 145 | ucode->tmr_mc_addr_lo = psp->cmd_buf_mem->resp.fw_addr_lo; |
| 136 | ucode->tmr_mc_addr_hi = psp->cmd_buf_mem->resp.fw_addr_hi; | 146 | ucode->tmr_mc_addr_hi = psp->cmd_buf_mem->resp.fw_addr_hi; |
| @@ -160,7 +170,7 @@ static int psp_tmr_init(struct psp_context *psp) | |||
| 160 | * Note: this memory need be reserved till the driver | 170 | * Note: this memory need be reserved till the driver |
| 161 | * uninitializes. | 171 | * uninitializes. |
| 162 | */ | 172 | */ |
| 163 | ret = amdgpu_bo_create_kernel(psp->adev, 0x300000, 0x100000, | 173 | ret = amdgpu_bo_create_kernel(psp->adev, PSP_TMR_SIZE, 0x100000, |
| 164 | AMDGPU_GEM_DOMAIN_VRAM, | 174 | AMDGPU_GEM_DOMAIN_VRAM, |
| 165 | &psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); | 175 | &psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); |
| 166 | 176 | ||
| @@ -176,7 +186,9 @@ static int psp_tmr_load(struct psp_context *psp) | |||
| 176 | if (!cmd) | 186 | if (!cmd) |
| 177 | return -ENOMEM; | 187 | return -ENOMEM; |
| 178 | 188 | ||
| 179 | psp_prep_tmr_cmd_buf(cmd, psp->tmr_mc_addr, 0x300000); | 189 | psp_prep_tmr_cmd_buf(cmd, psp->tmr_mc_addr, PSP_TMR_SIZE); |
| 190 | DRM_INFO("reserve 0x%x from 0x%llx for PSP TMR SIZE\n", | ||
| 191 | PSP_TMR_SIZE, psp->tmr_mc_addr); | ||
| 180 | 192 | ||
| 181 | ret = psp_cmd_submit_buf(psp, NULL, cmd, | 193 | ret = psp_cmd_submit_buf(psp, NULL, cmd, |
| 182 | psp->fence_buf_mc_addr, 1); | 194 | psp->fence_buf_mc_addr, 1); |
| @@ -440,8 +452,6 @@ static int psp_hw_fini(void *handle) | |||
| 440 | if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) | 452 | if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) |
| 441 | return 0; | 453 | return 0; |
| 442 | 454 | ||
| 443 | amdgpu_ucode_fini_bo(adev); | ||
| 444 | |||
| 445 | psp_ring_destroy(psp, PSP_RING_TYPE__KM); | 455 | psp_ring_destroy(psp, PSP_RING_TYPE__KM); |
| 446 | 456 | ||
| 447 | amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); | 457 | amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); |
| @@ -594,3 +604,12 @@ const struct amdgpu_ip_block_version psp_v10_0_ip_block = | |||
| 594 | .rev = 0, | 604 | .rev = 0, |
| 595 | .funcs = &psp_ip_funcs, | 605 | .funcs = &psp_ip_funcs, |
| 596 | }; | 606 | }; |
| 607 | |||
| 608 | const struct amdgpu_ip_block_version psp_v11_0_ip_block = | ||
| 609 | { | ||
| 610 | .type = AMD_IP_BLOCK_TYPE_PSP, | ||
| 611 | .major = 11, | ||
| 612 | .minor = 0, | ||
| 613 | .rev = 0, | ||
| 614 | .funcs = &psp_ip_funcs, | ||
| 615 | }; | ||
