From patchwork Tue Mar 24 12:48:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gtk_ruiwang@mediatek.com X-Patchwork-Id: 210486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54561C4332B for ; Tue, 24 Mar 2020 12:48:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 293EA20870 for ; Tue, 24 Mar 2020 12:48:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="EtIkbkmz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727338AbgCXMsx (ORCPT ); Tue, 24 Mar 2020 08:48:53 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:64123 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727323AbgCXMsx (ORCPT ); Tue, 24 Mar 2020 08:48:53 -0400 X-UUID: 3f55144b779c472bbd3c960727b4aeab-20200324 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=dPrwEORYxiJbRkftSzBHfBY2aV9JKjm3BUQRpBuvvv4=; b=EtIkbkmzyuLGenVOcV+TzYXpdxV5qx+H+OSgFOXNLnhV0hA1iuU+OC7sbvzXgfMEoBTJim20syBhXLW5C8ns16Z6teP+Q8guCMaRXfsgcyF1boKMKvDqCuLIdat1L6kqoSTgmN1PANXP7gCgS0JS8Z9s3EEsDT24aybNex7EVP0=; X-UUID: 3f55144b779c472bbd3c960727b4aeab-20200324 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1946592548; Tue, 24 Mar 2020 20:48:49 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 24 Mar 2020 20:48:46 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 24 Mar 2020 20:48:46 +0800 From: To: Hans Verkuil , Alexandre Courbot , Mauro Carvalho Chehab , Matthias Brugger , Tomasz Figa , , , , CC: Erin Lo , Sj Huang , Houlong Wei , Andrew-CT Chen , Maoguang Meng , , Subject: [PATCH v2] media: mtk-vpu: load vpu firmware from the new location Date: Tue, 24 Mar 2020 20:48:49 +0800 Message-ID: <20200324124849.9490-1-gtk_ruiwang@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Rui Wang 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 --- Changed in v2: - reslove Warning: Missing SOB nominal patch author --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.18.0 diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index a768707abb94..89274842e07b 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c @@ -46,6 +46,8 @@ /* binary firmware name */ #define VPU_P_FW "vpu_p.bin" #define VPU_D_FW "vpu_d.bin" +#define VPU_P_FW_NEW "mediatek/mt8173/vpu_p.bin" +#define VPU_D_FW_NEW "mediatek/mt8173/vpu_d.bin" #define VPU_RESET 0x0 #define VPU_TCM_CFG 0x0008 @@ -477,16 +479,24 @@ static int load_requested_vpu(struct mtk_vpu *vpu, size_t tcm_size = fw_type ? VPU_DTCM_SIZE : VPU_PTCM_SIZE; size_t fw_size = fw_type ? VPU_D_FW_SIZE : VPU_P_FW_SIZE; char *fw_name = fw_type ? VPU_D_FW : VPU_P_FW; + char *fw_new_name = fw_type ? VPU_D_FW_NEW : VPU_P_FW_NEW; const struct firmware *vpu_fw; size_t dl_size = 0; size_t extra_fw_size = 0; void *dest; int ret; - ret = request_firmware(&vpu_fw, fw_name, vpu->dev); + ret = request_firmware(&vpu_fw, fw_new_name, vpu->dev); if (ret < 0) { - dev_err(vpu->dev, "Failed to load %s, %d\n", fw_name, ret); - return ret; + dev_info(vpu->dev, "Failed to load %s, %d, retry\n", + fw_new_name, ret); + + ret = request_firmware(&vpu_fw, fw_name, vpu->dev); + if (ret < 0) { + dev_err(vpu->dev, "Failed to load %s, %d\n", fw_name, + ret); + return ret; + } } dl_size = vpu_fw->size; if (dl_size > fw_size) {