From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10184C43217 for ; Thu, 14 Apr 2022 11:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242827AbiDNL4R (ORCPT ); Thu, 14 Apr 2022 07:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235031AbiDNL4Q (ORCPT ); Thu, 14 Apr 2022 07:56:16 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964BC8879C; Thu, 14 Apr 2022 04:53:51 -0700 (PDT) X-UUID: 0378893a1b3a47ad9863c9f44f513db3-20220414 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.4,REQID:5a588b30-4b2d-43a2-9f35-bcd84585a249,OB:10,L OB:10,IP:0,URL:0,TC:0,Content:-20,EDM:0,RT:0,SF:95,FILE:0,RULE:Release_Ham ,ACTION:release,TS:75 X-CID-INFO: VERSION:1.1.4,REQID:5a588b30-4b2d-43a2-9f35-bcd84585a249,OB:10,LOB :10,IP:0,URL:0,TC:0,Content:-20,EDM:0,RT:0,SF:95,FILE:0,RULE:Spam_GS981B3D ,ACTION:quarantine,TS:75 X-CID-META: VersionHash:faefae9,CLOUDID:14df25a9-d103-4e36-82b9-b0e86991b3df,C OID:7a0f8d2109bd,Recheck:0,SF:13|15|28|17|19|48,TC:nil,Content:0,EDM:-3,Fi le:nil,QS:0,BEC:nil X-UUID: 0378893a1b3a47ad9863c9f44f513db3-20220414 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 449969936; Thu, 14 Apr 2022 19:53:45 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Thu, 14 Apr 2022 19:53:44 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 Apr 2022 19:53:43 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 14 Apr 2022 19:53:43 +0800 From: Allen-KH Cheng To: Ohad Ben-Cohen , Bjorn Andersson , Mathieu Poirier , Rob Herring , Matthias Brugger CC: Hsin-Yi Wang , , , , , , , Allen-KH Cheng Subject: [PATCH 2/2] remoteproc: mediatek: allow reading firmware-name from DT Date: Thu, 14 Apr 2022 19:53:39 +0800 Message-ID: <20220414115339.5536-3-allen-kh.cheng@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220414115339.5536-1-allen-kh.cheng@mediatek.com> References: <20220414115339.5536-1-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org The SCP firmware blob differs between platforms and SoCs. We add support in the SCP driver for reading the path of firmware file from DT in order to allow these files to live in a generic file system (or linux-firmware). The firmware-name property is optional and the code falls back to the old filename if the property isn't present. Signed-off-by: Allen-KH Cheng --- drivers/remoteproc/mtk_scp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index ee6c4009586e..82813d74e829 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev) struct mtk_scp *scp; struct rproc *rproc; struct resource *res; - char *fw_name = "scp.img"; + const char *fw_name = "scp.img"; int ret, i; + ret = of_property_read_string(pdev->dev.of_node, "firmware-name", + &fw_name); + if (ret < 0 && ret != -EINVAL) + return ret; + rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp)); if (!rproc) return dev_err_probe(dev, -ENOMEM, "unable to allocate remoteproc\n"); -- 2.18.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55250C433EF for ; Thu, 14 Apr 2022 12:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nFb3UwrZnv1JhxIpP+Ww7OUj0FElr311zyNAH8hzC3o=; b=u0V+6mQKf72Pky 4U8zOcWTtb0lq3FTSLCp8E/SUO+OMmOMxf3xYVI32zRSor7IRfxdGYMCpYFsmnbE9rBpFVl+IuDH/ dnxHqDcZc7ZNOl4g9Cu7il5CYk/G0AaJwEztd/NYonauD9Rri7Mg40SgmZs/mHhEsaVFilc03taEC NM7T9Pb82BVTYuvPmoJoAWz/z4iY7W5qRqdI5V4HResZ7+rGnJnZDa/1RXyJBHpXSedCDK7jCO1xu ETC0AGEycbtn/BKWdttDJh19nGgHqtDY9dAPLRiPJ0IDciUx04cVDWJvOqFN4m0yPF4gBVs7CofTJ XsrEXmCcJxwJMzjaNVqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neyFR-005QbP-Fu; Thu, 14 Apr 2022 12:06:53 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neyCV-005P7f-KE; Thu, 14 Apr 2022 12:03:53 +0000 X-UUID: ea12dee9491149088bd1a020d22835da-20220414 X-UUID: ea12dee9491149088bd1a020d22835da-20220414 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1905967011; Thu, 14 Apr 2022 05:03:45 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 Apr 2022 04:53:55 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 Apr 2022 19:53:43 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 14 Apr 2022 19:53:43 +0800 From: Allen-KH Cheng To: Ohad Ben-Cohen , Bjorn Andersson , Mathieu Poirier , Rob Herring , Matthias Brugger CC: Hsin-Yi Wang , , , , , , , Allen-KH Cheng Subject: [PATCH 2/2] remoteproc: mediatek: allow reading firmware-name from DT Date: Thu, 14 Apr 2022 19:53:39 +0800 Message-ID: <20220414115339.5536-3-allen-kh.cheng@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220414115339.5536-1-allen-kh.cheng@mediatek.com> References: <20220414115339.5536-1-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220414_050351_719133_B4FBC40F X-CRM114-Status: GOOD ( 14.14 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The SCP firmware blob differs between platforms and SoCs. We add support in the SCP driver for reading the path of firmware file from DT in order to allow these files to live in a generic file system (or linux-firmware). The firmware-name property is optional and the code falls back to the old filename if the property isn't present. Signed-off-by: Allen-KH Cheng --- drivers/remoteproc/mtk_scp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index ee6c4009586e..82813d74e829 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev) struct mtk_scp *scp; struct rproc *rproc; struct resource *res; - char *fw_name = "scp.img"; + const char *fw_name = "scp.img"; int ret, i; + ret = of_property_read_string(pdev->dev.of_node, "firmware-name", + &fw_name); + if (ret < 0 && ret != -EINVAL) + return ret; + rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp)); if (!rproc) return dev_err_probe(dev, -ENOMEM, "unable to allocate remoteproc\n"); -- 2.18.0 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1AC3C433F5 for ; Thu, 14 Apr 2022 12:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2BtknpBNSoJKbUHXDTk1NPBSQcMgWWkFBRlV6hCKXRQ=; b=fEEVTgvVVF0Ryi Uyp66PQh/j0TxCpbt6IWRjdcsPSQqfSA9v5w7l5b7XFFuLLDVJJD4tw7OpGCuQe7V3ksv1WfUtFcW vcRlBzEC+Ocq9OUhldnAPS5oyBlpZ/JINzdcVWNV0NCZZVId+l6lX7vyZseTpN0CWWZ3Sc/kZgiZr C6LzIhovHpZB6AjQqfsoqSP/oWG1V2LriiNsiWxLYwZ+tMq0SigtEvGQ6SGKSJwCactj4JF5fCD0q 0AxQNpxYAgz7r3C4XrcEcdYaP0SRo2MlqhuMucexZPWdfTgjX7+S2k8Q1jn3Yy1okHJ64m6G58tC2 xy4xtw0gX1p9MccM4ZCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neyGK-005R3A-2Q; Thu, 14 Apr 2022 12:07:48 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neyCV-005P7f-KE; Thu, 14 Apr 2022 12:03:53 +0000 X-UUID: ea12dee9491149088bd1a020d22835da-20220414 X-UUID: ea12dee9491149088bd1a020d22835da-20220414 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1905967011; Thu, 14 Apr 2022 05:03:45 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 Apr 2022 04:53:55 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 Apr 2022 19:53:43 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 14 Apr 2022 19:53:43 +0800 From: Allen-KH Cheng To: Ohad Ben-Cohen , Bjorn Andersson , Mathieu Poirier , Rob Herring , Matthias Brugger CC: Hsin-Yi Wang , , , , , , , Allen-KH Cheng Subject: [PATCH 2/2] remoteproc: mediatek: allow reading firmware-name from DT Date: Thu, 14 Apr 2022 19:53:39 +0800 Message-ID: <20220414115339.5536-3-allen-kh.cheng@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220414115339.5536-1-allen-kh.cheng@mediatek.com> References: <20220414115339.5536-1-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220414_050351_719133_B4FBC40F X-CRM114-Status: GOOD ( 14.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SCP firmware blob differs between platforms and SoCs. We add support in the SCP driver for reading the path of firmware file from DT in order to allow these files to live in a generic file system (or linux-firmware). The firmware-name property is optional and the code falls back to the old filename if the property isn't present. Signed-off-by: Allen-KH Cheng --- drivers/remoteproc/mtk_scp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index ee6c4009586e..82813d74e829 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev) struct mtk_scp *scp; struct rproc *rproc; struct resource *res; - char *fw_name = "scp.img"; + const char *fw_name = "scp.img"; int ret, i; + ret = of_property_read_string(pdev->dev.of_node, "firmware-name", + &fw_name); + if (ret < 0 && ret != -EINVAL) + return ret; + rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp)); if (!rproc) return dev_err_probe(dev, -ENOMEM, "unable to allocate remoteproc\n"); -- 2.18.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel