Skip to content

Commit ad71693

Browse files
ruiwang-mtkmchehab
authored andcommitted
media: mtk-vpu: load vpu firmware from the new location
mt8173 VPU firmware has been moved to a sub-folder of linux-firmware, so load vpu-fw from the new location first, if it fails, then from the old one. Signed-off-by: Rui Wang <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 64d4fc9 commit ad71693

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

drivers/media/platform/mtk-vpu/mtk_vpu.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
/* binary firmware name */
4747
#define VPU_P_FW "vpu_p.bin"
4848
#define VPU_D_FW "vpu_d.bin"
49+
#define VPU_P_FW_NEW "mediatek/mt8173/vpu_p.bin"
50+
#define VPU_D_FW_NEW "mediatek/mt8173/vpu_d.bin"
4951

5052
#define VPU_RESET 0x0
5153
#define VPU_TCM_CFG 0x0008
@@ -477,16 +479,24 @@ static int load_requested_vpu(struct mtk_vpu *vpu,
477479
size_t tcm_size = fw_type ? VPU_DTCM_SIZE : VPU_PTCM_SIZE;
478480
size_t fw_size = fw_type ? VPU_D_FW_SIZE : VPU_P_FW_SIZE;
479481
char *fw_name = fw_type ? VPU_D_FW : VPU_P_FW;
482+
char *fw_new_name = fw_type ? VPU_D_FW_NEW : VPU_P_FW_NEW;
480483
const struct firmware *vpu_fw;
481484
size_t dl_size = 0;
482485
size_t extra_fw_size = 0;
483486
void *dest;
484487
int ret;
485488

486-
ret = request_firmware(&vpu_fw, fw_name, vpu->dev);
489+
ret = request_firmware(&vpu_fw, fw_new_name, vpu->dev);
487490
if (ret < 0) {
488-
dev_err(vpu->dev, "Failed to load %s, %d\n", fw_name, ret);
489-
return ret;
491+
dev_info(vpu->dev, "Failed to load %s, %d, retry\n",
492+
fw_new_name, ret);
493+
494+
ret = request_firmware(&vpu_fw, fw_name, vpu->dev);
495+
if (ret < 0) {
496+
dev_err(vpu->dev, "Failed to load %s, %d\n", fw_name,
497+
ret);
498+
return ret;
499+
}
490500
}
491501
dl_size = vpu_fw->size;
492502
if (dl_size > fw_size) {

0 commit comments

Comments
 (0)