diff options
author | Lang Yu <Lang.Yu@amd.com> | 2023-10-07 07:43:13 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-10-13 17:59:24 +0300 |
commit | 617b472431ad42d437fe3ad94efc0b61397252ec (patch) | |
tree | a901bd48fa022bdc7e64beaa1e93448f81dc669a /drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h | |
parent | 558fcb7d1157a902c5ca880289e78d121fc3a484 (diff) | |
download | linux-617b472431ad42d437fe3ad94efc0b61397252ec.tar.xz |
drm/amdgpu/umsch: fix psp frontdoor loading
These changes are missed in rebase.
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h index d83fdf2da464..8258a43a6236 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h @@ -150,6 +150,7 @@ struct amdgpu_umsch_mm { struct amdgpu_bo *cmd_buf_obj; uint64_t cmd_buf_gpu_addr; uint32_t *cmd_buf_ptr; + uint32_t *cmd_buf_curr_ptr; uint32_t wb_index; uint64_t sch_ctx_gpu_addr; @@ -167,19 +168,28 @@ struct amdgpu_umsch_mm { struct mutex mutex_hidden; }; -int umsch_mm_psp_update_sram(struct amdgpu_device *adev, u32 ucode_size); - int amdgpu_umsch_mm_submit_pkt(struct amdgpu_umsch_mm *umsch, void *pkt, int ndws); int amdgpu_umsch_mm_query_fence(struct amdgpu_umsch_mm *umsch); int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch); int amdgpu_umsch_mm_allocate_ucode_buffer(struct amdgpu_umsch_mm *umsch); int amdgpu_umsch_mm_allocate_ucode_data_buffer(struct amdgpu_umsch_mm *umsch); -void* amdgpu_umsch_mm_add_cmd(struct amdgpu_umsch_mm *umsch, - void* cmd_ptr, uint32_t reg_offset, uint32_t reg_data); + +int amdgpu_umsch_mm_psp_execute_cmd_buf(struct amdgpu_umsch_mm *umsch); int amdgpu_umsch_mm_ring_init(struct amdgpu_umsch_mm *umsch); +#define WREG32_SOC15_UMSCH(reg, value) \ + do { \ + uint32_t reg_offset = adev->reg_offset[VCN_HWIP][0][reg##_BASE_IDX] + reg; \ + if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { \ + *adev->umsch_mm.cmd_buf_curr_ptr++ = (reg_offset << 2); \ + *adev->umsch_mm.cmd_buf_curr_ptr++ = value; \ + } else { \ + WREG32(reg_offset, value); \ + } \ + } while (0) + #define umsch_mm_set_hw_resources(umsch) \ ((umsch)->funcs->set_hw_resources ? (umsch)->funcs->set_hw_resources((umsch)) : 0) #define umsch_mm_add_queue(umsch, input) \ |