mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
accel/ivpu: Load firmware on cold boot
Load the firmware image immediately before each cold boot instead of during probe or cold-boot preparation. This moves image loading to a single call site and aligns code for future driver changes. Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com> Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com> Link: https://patch.msgid.link/20261014101545.3298558-1-andrzej.kacprowski@linux.intel.com
This commit is contained in:
parent
489a8539ca
commit
902fdc5e66
|
|
@ -520,6 +520,14 @@ int ivpu_boot(struct ivpu_device *vdev)
|
|||
ivpu_fw_boot_params_setup(vdev, ivpu_bo_vaddr(vdev->fw->mem_bp));
|
||||
vdev->fw->last_boot_mode = vdev->fw->next_boot_mode;
|
||||
|
||||
if (!ivpu_fw_is_warm_boot(vdev)) {
|
||||
ret = ivpu_fw_load(vdev);
|
||||
if (ret) {
|
||||
ivpu_err(vdev, "Failed to load the firmware: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = ivpu_hw_boot_fw(vdev);
|
||||
if (ret) {
|
||||
ivpu_err(vdev, "Failed to start the firmware: %d\n", ret);
|
||||
|
|
|
|||
|
|
@ -473,8 +473,6 @@ int ivpu_fw_init(struct ivpu_device *vdev)
|
|||
if (ret)
|
||||
goto err_fw_release;
|
||||
|
||||
ivpu_fw_load(vdev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_fw_release:
|
||||
|
|
@ -488,7 +486,7 @@ void ivpu_fw_fini(struct ivpu_device *vdev)
|
|||
ivpu_fw_release(vdev);
|
||||
}
|
||||
|
||||
void ivpu_fw_load(struct ivpu_device *vdev)
|
||||
int ivpu_fw_load(struct ivpu_device *vdev)
|
||||
{
|
||||
struct ivpu_fw_info *fw = vdev->fw;
|
||||
u64 image_end_offset = fw->image_load_offset + fw->image_size;
|
||||
|
|
@ -505,6 +503,7 @@ void ivpu_fw_load(struct ivpu_device *vdev)
|
|||
}
|
||||
|
||||
wmb(); /* Flush WC buffers after writing fw->mem */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_params *boot_params)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ struct ivpu_fw_info {
|
|||
bool ivpu_is_within_range(u64 addr, size_t size, struct ivpu_addr_range *range);
|
||||
int ivpu_fw_init(struct ivpu_device *vdev);
|
||||
void ivpu_fw_fini(struct ivpu_device *vdev);
|
||||
void ivpu_fw_load(struct ivpu_device *vdev);
|
||||
int ivpu_fw_load(struct ivpu_device *vdev);
|
||||
void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params *boot_params);
|
||||
|
||||
static inline bool ivpu_fw_is_warm_boot(struct ivpu_device *vdev)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ static void ivpu_pm_prepare_cold_boot(struct ivpu_device *vdev)
|
|||
ivpu_cmdq_reset_all_contexts(vdev);
|
||||
ivpu_ipc_reset(vdev);
|
||||
ivpu_fw_log_reset(vdev);
|
||||
ivpu_fw_load(vdev);
|
||||
fw->last_heartbeat = 0;
|
||||
|
||||
ivpu_dbg(vdev, FW_BOOT, "Cold boot entry point 0x%llx", vdev->fw->cold_boot_entry_point);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user