diff options
author | Sarah Walker <sarah.walker@imgtec.com> | 2025-04-10 10:55:13 +0100 |
---|---|---|
committer | Matt Coster <matt.coster@imgtec.com> | 2025-04-15 12:21:52 +0100 |
commit | 171f378d2a23db92d3443173f5fd7f25633ec39d (patch) | |
tree | d58f62a4f57030ac6fac00d616fc4e168ad0b6c0 /drivers/gpu/drm/imagination/pvr_fw.c | |
parent | f48485ab506850b4e35ff56550568f710a22a586 (diff) |
drm/imagination: Add RISC-V firmware processor support
Newer PowerVR GPUs (such as the BXS-4-64 MC1) use a RISC-V firmware
processor instead of the previous MIPS or META.
The current version of this patch depends on a patch[1] which exists in
drm-misc-fixes, but has not yet made it back to drm-misc-next (the
target of this patch). That patch adds the function pvr_vm_unmap_obj()
which is used here.
[1]: https://lore.kernel.org/r/20250226-hold-drm_gem_gpuva-lock-for-unmap-v2-1-3fdacded227f@imgtec.com
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Link: https://lore.kernel.org/r/20250410-sets-bxs-4-64-patch-v1-v6-14-eda620c5865f@imgtec.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Diffstat (limited to 'drivers/gpu/drm/imagination/pvr_fw.c')
-rw-r--r-- | drivers/gpu/drm/imagination/pvr_fw.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/gpu/drm/imagination/pvr_fw.c b/drivers/gpu/drm/imagination/pvr_fw.c index 962b8cb2119e..b2f8cba77346 100644 --- a/drivers/gpu/drm/imagination/pvr_fw.c +++ b/drivers/gpu/drm/imagination/pvr_fw.c @@ -941,7 +941,7 @@ pvr_fw_init(struct pvr_device *pvr_dev) static const struct pvr_fw_defs *fw_defs[PVR_FW_PROCESSOR_TYPE_COUNT] = { [PVR_FW_PROCESSOR_TYPE_META] = &pvr_fw_defs_meta, [PVR_FW_PROCESSOR_TYPE_MIPS] = &pvr_fw_defs_mips, - [PVR_FW_PROCESSOR_TYPE_RISCV] = NULL, + [PVR_FW_PROCESSOR_TYPE_RISCV] = &pvr_fw_defs_riscv, }; u32 kccb_size_log2 = ROGUE_FWIF_KCCB_NUMCMDS_LOG2_DEFAULT; @@ -954,13 +954,6 @@ pvr_fw_init(struct pvr_device *pvr_dev) fw_dev->defs = fw_defs[fw_dev->processor_type]; - /* - * Not all firmware processor types are currently supported. - * Once they are, this check can be removed. - */ - if (!fw_dev->defs) - return -EINVAL; - err = fw_dev->defs->init(pvr_dev); if (err) return err; @@ -1466,6 +1459,15 @@ void pvr_fw_object_get_fw_addr_offset(struct pvr_fw_object *fw_obj, u32 offset, *fw_addr_out = pvr_dev->fw_dev.defs->get_fw_addr_with_offset(fw_obj, offset); } +u64 +pvr_fw_obj_get_gpu_addr(struct pvr_fw_object *fw_obj) +{ + struct pvr_device *pvr_dev = to_pvr_device(gem_from_pvr_gem(fw_obj->gem)->dev); + struct pvr_fw_device *fw_dev = &pvr_dev->fw_dev; + + return fw_dev->fw_heap_info.gpu_addr + fw_obj->fw_addr_offset; +} + /* * pvr_fw_hard_reset() - Re-initialise the FW code and data segments, and reset all global FW * structures |