From patchwork Fri Jul 7 23:24:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13305435 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 07B20EB64D9 for ; Fri, 7 Jul 2023 23:25:53 +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: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:In-Reply-To:References: List-Owner; bh=5ETZxhvPtDxMT4Zv6eo8Sseo+zbWLdnvq50HSJs8Hdo=; b=Ai54L4V1xwnu77 Z0jLEobl15oQU/TlMqyDhecf+6aredctKYEeF7MxPKR3ruxP14bLyUgXCDd4YqOkOnnqjL28s1CaL wyX/pN6bmwqnckdekqW52patONGf/cE/r1AFWPCQtMsKqUjK+BkplSEPibE4ISNwyx5lp58S6zwCS kHmwC8QcuDHOWZcyJyUPBh+nNMTlM6HQpe9Ux2acwYMOHgS7ZgHT7f78QtrfEqpB0VRH2ESYJSYLn jVdSVRdO3vpIUBAbKMDQqzg78zE1LIrMLTwp7wVr7pfa0qH9RDmnJJ7Dl+9U43KcQC7RyHW/8wLH7 9V/s+kDhy0DI31dmzYGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHup4-0063fK-0h; Fri, 07 Jul 2023 23:25:10 +0000 Received: from phobos.denx.de ([2a01:238:438b:c500:173d:9f52:ddab:ee01]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHup0-0063dy-2v for linux-arm-kernel@lists.infradead.org; Fri, 07 Jul 2023 23:25:08 +0000 Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 2289985F50; Sat, 8 Jul 2023 01:25:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688772301; bh=SuB3l1QN8nvAY233gdCLXZjbGzm59nfH891us3OCgEw=; h=From:To:Cc:Subject:Date:From; b=uyZpqpZsXHPaf6xdXLoTF2v+s7FIAc0xW5Lzpc39W7OUEEkDnODmLWHVLONr4qghn VypFW9/aCryNgwtWq0lT/JdxzDpXyNoIxUMnCPsCLu/fZiKAmEjA+G5DXp/ayMXyAc wAdV/8Cix7OxLiKhwdDTCCUBYIjP3krp1IvcX1I/skmG6kWN2UNm3j33mK24vfIe8b BlsDdoJxJXZrVgExbWlcL5zgx4notlEj+8G+QstyWfsfmJ3dk+bYWTv9um7ncrp98i op0Qewv+9tu+/MIIR3pMLPIfIWkMY3eVlrvUo0jtPtzMRHTPx4973nx8nhNunsIhIr ga6fIJ0Z741QQ== From: Marek Vasut To: linux-remoteproc@vger.kernel.org Cc: Marek Vasut , Bjorn Andersson , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Mathieu Poirier , NXP Linux Team , Peng Fan , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] dt-bindings: remoteproc: imx_rproc: Document fsl,startup-delay-ms Date: Sat, 8 Jul 2023 01:24:43 +0200 Message-Id: <20230707232444.374431-1-marex@denx.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_162507_195731_5447D376 X-CRM114-Status: UNSURE ( 9.68 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document fsl,startup-delay-ms property which indicates how long the system software should wait until attempting to communicate with the CM firmware. This gives the CM firmware a bit of time to boot and get ready for communication. Signed-off-by: Marek Vasut --- Cc: Bjorn Andersson Cc: Conor Dooley Cc: Fabio Estevam Cc: Krzysztof Kozlowski Cc: Mathieu Poirier Cc: NXP Linux Team Cc: Peng Fan Cc: Pengutronix Kernel Team Cc: Rob Herring Cc: Sascha Hauer Cc: Shawn Guo Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-remoteproc@vger.kernel.org --- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml index 0c3910f152d1d..c940199ce89df 100644 --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -76,6 +76,11 @@ properties: This property is to specify the resource id of the remote processor in SoC which supports SCFW + fsl,startup-delay-ms: + default: 0 + description: + CM firmware start up delay. + required: - compatible From patchwork Fri Jul 7 23:24:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13305434 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 9D46FEB64DA for ; Fri, 7 Jul 2023 23:25:53 +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=yOH3C9eHn6nXjfCCGwtRWw38jITLVf49SQGc10Bv1bw=; b=bP50upOOSmy8CV OFoQ3rxbbGhxy3Dy7Q0ZKFfze9ZaT1gJannJz3BoBbEI8NKb9m5jvYnprN8rJoTXMdGPrUNn1gwL2 GgJ5Km8VPOt2zYKdXZ5RbRWdPkRAtx69Ma+m2FYUalroMuC3Z4quN4E6oDElxLWbY5KEkAzkj7F0a zNQO+z/eD+oYoLMGcXpwE124S1NeiI+VtRJTIPhYWu4zDX6KgFyGTB6UTqn8cpLJ74loXmKgZ2Gyl m6A3tNOKnwS+BZ6TL8tqiIDbcWm/O7k0mBmPvsAxu186/tQ4rS0+Sj0VEUbl/kaHeZVmJTLfHu71U dHa+7yxs16PUi+xwokNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHup5-0063fW-2h; Fri, 07 Jul 2023 23:25:11 +0000 Received: from phobos.denx.de ([2a01:238:438b:c500:173d:9f52:ddab:ee01]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHup0-0063eC-2x for linux-arm-kernel@lists.infradead.org; Fri, 07 Jul 2023 23:25:08 +0000 Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1AA5386307; Sat, 8 Jul 2023 01:25:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688772303; bh=KyuDqypJqy4PITTMyrCUAaIaAbCclPHKKt5tlXM8dzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZyOcr2ZQEpDJvhWYgjCibSlekvgvTXPxBEvwzug9IgHGBvur6mZ5uROch1sqHkNF7 XAg6+fgWlXroJA6KkM4k6gojGuUY5Dtq/JNoy+lEhbDg8+/5kb9K8GzCTc+VutW6Yd fxIg7q4Dow6GXHzuy+atNsl4FhvU9IqgyK7Tsag7wLpxYvUXuORZ7ma+daVaXwWo7n wdRci9doseKkic39f1lT6n0Yy0cWxdFwKrMVs5REXqyk0LrO3oAAX6Zcf5+q0kdkaX 2lZjSdX82ocFp1UE3DB9kOvdT14iE3IJhC2djpmXP5YhLJJ0s3Ld0wec1qyHhlRrZx jaTSofE1V1r1w== From: Marek Vasut To: linux-remoteproc@vger.kernel.org Cc: Peng Fan , Jacky Bai , Ye Li , Bjorn Andersson , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Mathieu Poirier , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] remoteproc: imx_rproc: add start up delay Date: Sat, 8 Jul 2023 01:24:44 +0200 Message-Id: <20230707232444.374431-2-marex@denx.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230707232444.374431-1-marex@denx.de> References: <20230707232444.374431-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_162507_247598_89DAAE95 X-CRM114-Status: GOOD ( 14.41 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan There is case that after remoteproc start remote processor[M4], the M4 runs slow and before M4 finish its own rpmsg framework initialization, linux sends out vring kick message, then M4 firmware drops the kick message. Some NXP released Cortex-M[x] images has such limitation that it requires linux sends out vring kick message after M4 firmware finish its rpmsg framework initialization. Reviewed-by: Jacky Bai Reviewed-by: Ye Li Signed-off-by: Peng Fan --- Note: picked from NXP downstream LF-6630-2 remoteproc: imx_rproc: add start up delay https://github.com/nxp-imx/linux-imx.git 0b1b91c95b291a3b60d6224b13f6a95a75896abf --- Note: Literally all of the NXP BSP 2.13.0 firmware builds fail to boot without this being set to something like 50..500 ms , so this is rather useful to have. --- Cc: Bjorn Andersson Cc: Conor Dooley Cc: Fabio Estevam Cc: Krzysztof Kozlowski Cc: Mathieu Poirier Cc: NXP Linux Team Cc: Peng Fan Cc: Pengutronix Kernel Team Cc: Rob Herring Cc: Sascha Hauer Cc: Shawn Guo Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-remoteproc@vger.kernel.org --- drivers/remoteproc/imx_rproc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index f9874fc5a80ff..d0eb96d6a4fe1 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,7 @@ struct imx_rproc { u32 core_index; struct device **pd_dev; struct device_link **pd_dev_link; + u32 startup_delay; }; static const struct imx_rproc_att imx_rproc_att_imx93[] = { @@ -382,6 +384,9 @@ static int imx_rproc_start(struct rproc *rproc) if (ret) dev_err(dev, "Failed to enable remote core!\n"); + if (priv->startup_delay) + msleep(priv->startup_delay); + return ret; } @@ -1090,6 +1095,10 @@ static int imx_rproc_probe(struct platform_device *pdev) if (rproc->state != RPROC_DETACHED) rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot"); + ret = of_property_read_u32(dev->of_node, "fsl,startup-delay-ms", &priv->startup_delay); + if (ret) + priv->startup_delay = 0; + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n");