Skip to content

Commit 9ab43e9

Browse files
jlawrynosgruszka
authored andcommitted
accel/ivpu: Switch to generation based FW names
Use VPU IP generation for naming FW instead of the platform name. Signed-off-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 51d66a7 commit 9ab43e9

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,18 @@ static char *ivpu_firmware;
4343
module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644);
4444
MODULE_PARM_DESC(firmware, "VPU firmware binary in /lib/firmware/..");
4545

46+
/* TODO: Remove mtl_vpu.bin from names after transition to generation based FW names */
47+
static struct {
48+
int gen;
49+
const char *name;
50+
} fw_names[] = {
51+
{ IVPU_HW_37XX, "vpu_37xx.bin" },
52+
{ IVPU_HW_37XX, "mtl_vpu.bin" },
53+
{ IVPU_HW_37XX, "intel/vpu/vpu_37xx_v0.0.bin" },
54+
};
55+
4656
static int ivpu_fw_request(struct ivpu_device *vdev)
4757
{
48-
static const char * const fw_names[] = {
49-
"mtl_vpu.bin",
50-
"intel/vpu/mtl_vpu_v0.0.bin"
51-
};
5258
int ret = -ENOENT;
5359
int i;
5460

@@ -60,9 +66,12 @@ static int ivpu_fw_request(struct ivpu_device *vdev)
6066
}
6167

6268
for (i = 0; i < ARRAY_SIZE(fw_names); i++) {
63-
ret = firmware_request_nowarn(&vdev->fw->file, fw_names[i], vdev->drm.dev);
69+
if (fw_names[i].gen != ivpu_hw_gen(vdev))
70+
continue;
71+
72+
ret = firmware_request_nowarn(&vdev->fw->file, fw_names[i].name, vdev->drm.dev);
6473
if (!ret) {
65-
vdev->fw->name = fw_names[i];
74+
vdev->fw->name = fw_names[i].name;
6675
return 0;
6776
}
6877
}

0 commit comments

Comments
 (0)