From patchwork Fri Oct 21 04:15:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014272 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 573B5C4332F for ; Fri, 21 Oct 2022 04:14:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbiJUEOM (ORCPT ); Fri, 21 Oct 2022 00:14:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbiJUEOK (ORCPT ); Fri, 21 Oct 2022 00:14:10 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2079.outbound.protection.outlook.com [40.107.247.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7AE1CD324; Thu, 20 Oct 2022 21:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DiXF/amexY8A8vUQ4whL8tihK+RzLtqdirwHxJwtqj1KVSzzgB2Q1HiUts8pu5GtUse9Rq3OjLyHTPOw4PmjeOTqjZcobEMGROaZgAWZqspi7ctFQxmDQMbHJoDAaBe+P/DpQMzEmfUvMkpWbkpL7NOpEZBEn6Gju6JoNCOUPdROP0By6JfnCtgzha995qb3Tc8SiO/3OBrraj2bZuOgEeGZCsDOWPgkwh2IzTPo5PsFpSZ8XKGa1nWPo9P6+gKoFKT5luWMoi0BkhYfMG9OHw9vnYvpw48OPpCrnWnUDUrhYMGx+MPBrGE1OXZLM0ncQC1FXfxQfnweKLjJhyMj5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=05Sxwp2qiuQnWOyN46jehy6hs5jPcBhHTOijKpW514o=; b=NhoVWnfwQ22BB4q+s/RHTkYH+bYdTOckLLSzeY/JejP8BDF1AGz46Krixz11CwTW+RkJR45xBvmig2BRn1dKj7IfasLa7pRgxsF8FIC5rcdwvqNCesIIyVyB+LOL6AHaWtw92Rhwrp0niz8qC+pf6zz614KsRxhRmkOYs+QXwWNeB3peb3rkNW1OsvqS9GXbEUn8OI13amR64IusnMjt4CMPP4qtFAOnP7SzOoONuP3EzmBW9JFp0d0xBABkCk3uzo5VBpl6+d/EnaLFaBjFQUyoYPF8mmUBAARRmgb4YvkMChZkiGA474dOKfi/KGdoLTHb3/9UuP0i1OZmtkwrtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=05Sxwp2qiuQnWOyN46jehy6hs5jPcBhHTOijKpW514o=; b=BT+n8eUAHalYRCWNKniNh+fosaF47c3PnuhanSv7MUncOC7vztzfhp1e3hJY1CxUCX8K2DApzJ/r0C9LW6iupZA8QctJitxw9COXOTS5hK6cdlgdKcmp+ewAqYEqTn2XoTQlOWZlr17eYb+R+sChj1++9DvFdp2IGUgf2PMCMn4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:06 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:06 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , Rob Herring Subject: [PATCH V8 1/7] dt-bindings: remoteproc: imx_rproc: support i.MX8QXP Date: Fri, 21 Oct 2022 12:15:20 +0800 Message-Id: <20221021041526.3696483-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: 74540085-b25e-4f61-ef2d-08dab31ab1e5 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XrgAaAgtT4l6kG3sBK7Ylwjbm3szHP8PSpo20KlgHMDfSGUJM4p/e5PRBOrvRdfRGeaPFH7RuO6Ra5fQmNbfQYPclabUUhp4oNO+nQcvhCvVaXpgwrtYiYt0vTZg1mekQkZhChRTBgZFX51Ur3Bhn6dcAbpFyE96XNZALk4875QFa1ZNi9ok/M4YtUaEwMful/IBCr0ruahF9sE/5iYNFSSSEIV2r+L55XM6XJN+ByEvE9KZD3Y4sxedyFwbQEHswFApI4J++6KzaTJ9s+JYZcyt6tWK8cRVOKBg1KSUTRwFLXhdIhB9+MROaDeNjUomnLGbnfUuwJafrK3I0I2GOq49FFA4AX4TZLM7vzUi6juY8zOAu3+1WVi12DZHu28EedzLsV70t4oxYMig4HAQpHujiHZP9SXDm9w73ksC7U3l7yR6yZeErrj3a/nrvwLo7Yhvetonmeq05IAeepmbLfK39n6B4N+md6UhrmQRLbUyavLboIBOoHST5D23gSPteqbBb2E7pkbCWNE35qEtigcW7Nb4aMdn78X7nEun3NeNQWh5VP3IddyDSW2VK8d9s921cdh77ihtmVoyZ2fK0+BRjIs9CENAF3AUqYj52yQcmdBX9Cs7CDAIegjOVBjubGmWIZm2iCXnW7w1OV7kKTJLj2zvVlikvYH/4XPaHNxbBIsHgBask1qh/JKdx0UOMPWCQcoZNa11ivL8Uu6KisDVXBocn5SJtuKPpfcgi5mNHX4Y+j9YA4LgZKZXB/1f4bLw3p6eotTXmr5VEi2VlQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(54906003)(66476007)(66556008)(8676002)(66946007)(86362001)(6666004)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hnpupBtq3Ln4ypwUlM82GnqurbR+kSAT010WsOb2T/PVuOjQBsJcJDF9YMlwWJKcXh3Bv0nMvoouu44hsRB0Q7Pax+k+CzC18MJTCt1CCJ4dVou7m+m6lWgMI6n4t2+S2p1bXXXB6PZeK2SIO2WUXya3cdHX1OkDNVgQX3LjadSe8/z57Y1+IQByedDRaU2bRhPh9UnoMtIq9HIdgu++jqOmpqGfwyylFmYCk07k7BPyQWVBLWQsnOc0mkj9dsGo9OYOOstC+aJ29dbkN8WKUdakUgaS5Qk+qgfLyobKcWg8mpkEryVprb8ubZ/O1abK79HeiDXzcLcdcYmJeC+KDUbxn9LruWbx1ds/2R7gtQNwyZORiknCg/l7KTf49Pi1dSylLLwh1ckHnVmaLyPvRxc+wN3P3Ir/T0b3WRxUnalog/ZcBXQIqesX34/UTUqX0tVziyQHd9sfMsxsSk82jj/mYjbF9MkrEagDoHYD5XoR15P3Waxq3jr9IDhsYQtM1SbPJuXZ3Id6hyvqGGNj/a46O7Mt5eRkzZW1Yu2txP+KviDoz2xUUN8Xc34SvFHAFmtUvy4mJaudtZvAyO3RbZDooyob7JeQalN/60Xdf4s6lGSDrPhumiyA6/jNd9DhRQfhBwCdgDz0i2gJAmCWfYikUPbCZCYPnnFJkueHe9qFJWw/kww5LcHBTxmVEhcA6vdPsgt+ppMXFrESfSo8ejr4VFlZkjNCk6kCaOTrR6KzMYXegcAcR+g45aODpQgOWf98JgTDaBF7lsSgQa4kKuXTOQCz7ofEh+fs0hIFM8NSbSMin/h6/rh6lJvSw7tzCZBFOdlMkOr7SkK3DFJFxRpOi1Wmt3+/1/w1BbegTts2rJmDNNYXNMej/l/pRZEp4Cnud+yp+wl1+vdwVU/YZXOGQPByQF6eOsHwuTV/NKQv6fZoVLWC7Y5Ms9r12Lm9IDoVtko/G7ObBw0MLNndfpVV9vrQJ8dvyYadsxSngypNEkQR792pH9/eaDbZpCtRyd8v7arvZdM06A7WX/OJa4WMjZ/n5sZLP1rT7QNVX8Ia8v0TofOV4t+Oa/gOjTSgK7ao8Qmov7jogBeL8igoGo1bJpG7dVUlrKQcqr6EfwblI2wDO2wks/DRv6DkOUTjztw1EeTooqrOGPL5Z90UJQgD5oaob6RNWYVCU7kA6wBQmoDWkL+1jsC69gd2fGKXfgdJ613iRDYm46H/UJ8ZdzZ09AuvBIx6zOqz8jJtYwSNywK6A/I0NIndVWGSLh5UljLdSW8OokWqQBrgWZjDAzo2d51Zr36dhz7z0GAv8SteSAPzTo/mvawY9mc3piBJ65x3Jxi5VFX0JyALzf0rPX8vRJK1jMHSZ+YyINqVqCPoJTflgOSKTQcm3S4AIaPLOGIQ13MNn1LKhN38kvMFsUUq9uFDK4qWHBYi/wHk4LZTRvnJcWuuZyDmGY3f99KHnO6FMOr6O2209D7U3E1I9sHz11IwuXpHX0JvXdX2xuUjdINhI23arj2fUVT2K9tvNORbUh5Pyxp1jwd78o4obSQSGA0qsQbJvAcvUXYcGNV8UwTatSwW6Sqvy+a6csGO X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74540085-b25e-4f61-ef2d-08dab31ab1e5 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:06.4315 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3riru+I9u7w+8BH/pkoAP2ir9QQn76EZiIlUb3IaV9WR1kCXsg/b834XLmZ1/BrPQCHQeGWY/NY//uNNdfI3pQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Add i.MX8QXP compatible Add a new property fsl,resource-id for SoC which supports SCFW. This property is used to check whether remote process is under control of Linux or not. Add fsl,entry-address to specify the entry address which used by SCFW to kick M4. To i.MX8QM/QXP, when M4 is in the same hardware partition with Cortex-A cores, need power up M4 through SCFW, then M4 could start. So introduce power-domains property Reviewed-by: Rob Herring Signed-off-by: Peng Fan --- .../bindings/remoteproc/fsl,imx-rproc.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml index 3a1f59ad79e2..70322e57b6ff 100644 --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -22,6 +22,7 @@ properties: - fsl,imx8mn-cm7 - fsl,imx8mp-cm7 - fsl,imx8mq-cm4 + - fsl,imx8qxp-cm4 - fsl,imx8ulp-cm33 - fsl,imx93-cm33 @@ -54,12 +55,26 @@ properties: minItems: 1 maxItems: 32 + power-domains: + maxItems: 8 + fsl,auto-boot: $ref: /schemas/types.yaml#/definitions/flag description: Indicate whether need to load the default firmware and start the remote processor automatically. + fsl,entry-address: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specify CPU entry address for SCU enabled processor. + + fsl,resource-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + This property is to specify the resource id of the remote processor in SoC + which supports SCFW + required: - compatible From patchwork Fri Oct 21 04:15:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014273 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 D2670C4332F for ; Fri, 21 Oct 2022 04:14:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229838AbiJUEO3 (ORCPT ); Fri, 21 Oct 2022 00:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiJUEOV (ORCPT ); Fri, 21 Oct 2022 00:14:21 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2056.outbound.protection.outlook.com [40.107.247.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4801E204AD5; Thu, 20 Oct 2022 21:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LjnHxDCXmKVG2H0j9l6PKdEYAzQ63z77AtXU+oLHNV56P7L3p9319UTV4eiWHf5JgE2x6DxQZgdy+9GrGNlxTamqPynzyv3zA/fKcvwpqi75K9zM/n834W5oCpemsQHadesXF03EiLi9m/okf6144nF+TokpRXtqFVG27Qyq+M+TEm3bKWqVCnvdULuw3hYf+E+w3dfMGnFtn1pSHcFk0zAoFtmbL5lMOzwUpXFHbKoWWvE1UcWpy0LScBxb4zJJYFoQzDjkQ94vrsh1huIEYXcV3ltURFReggpflBgQ443KkMpv8Inif0K8gfiWNINFu2lN0jNv3NiubRWCR6NXgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=34agaj5t8z/WCYbnoytBz9wnHdSdG6GQDoFKZbVDIfU=; b=Ft3Ry4bZREW4L0D3gxm+f5EnD/M5ZiVI/YBuoUeCU/eO6nPF2pjh6iMD77Vf0xvhoa0P620vOF4TSg6ZCEWr+g39iAnM/85goD/IyQvCEf/DIHtXQkc83RIpkxfKUMIwSHOH7ZWZolntp15EWCI4Lah3S5sju7RM57Dp4fbR/mG21G58XDa1V1R/8ExI9Nw3bc6oPhDZEGXDlkCZVo/yFvtYj6q8E3JDL8lCZAXlj2OLyvCts8hohebi+sciPqrI0gUOJFCJIpXa7gyO8VK2vsEbLX7gdc4kgA4cUEcWWkW+s329PO+VbQpnKnCRAgSBiO5taMbuuG2cwVjjNLCWTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=34agaj5t8z/WCYbnoytBz9wnHdSdG6GQDoFKZbVDIfU=; b=hKkSlnbdZALDujXw+P76J0h2EpHuar8aCwxXbWNpqp+8Pp9tpcHK6R0T2B82Ls1BOgSPiviLhKVIh1Ue0TazEBsulyFivwkAXymxTd2En0SYMHfkgikpyEczrlsCgWxemmFHzDPr0nKkfs5rFvxk1eavyeUeKQl4QBjXRUXhkgQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:11 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:11 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , Rob Herring Subject: [PATCH V8 2/7] dt-bindings: remoteproc: imx_rproc: support i.MX8QM Date: Fri, 21 Oct 2022 12:15:21 +0800 Message-Id: <20221021041526.3696483-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: 7146e2f9-eb3d-407a-40da-08dab31ab4d5 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FCYp8d+OXzaweB9fQcL+S5k/mH+d/+gvjUsAuEcs0PNTNrBSF1oJjlzUdSpKrLNenJdH4Nm9oxNQevFShtOShS0bayDB6Jtum8wghB1yQWrz0GuFNN1tmp4IntxPoG6c2flvRewkycQONLJGNI3oUrtR4SV5i5NtiYRQ4tRUzLZ937XO3rpE9l9t9YbWBAauSM5XL0tTjMKVVy/4q+ax+F6xbvYLUYQ2Eg2KWlFZ2fg3tPdPZo4G2+pENSx+7OhnP+xwfYTm2LKYUyFLknJvbx3Irgy+MPkzvJeSwRqiDdml5k1hLujDsUuns9QEOl7o88Yk+PqBXJD3YBhuvUj/j75xAHmjPFAr82riptG551i6JuvHZa/bZgUt/otKEazegNLeidAd96SumH7jRtkHoDXv9Kp4vBdhe7Q8MUDncrIAgKkMiX0V4DFyCPpuJ3NAok4elznIJjbWlHO8bIFQS7hhpTzLt4OpG6c6JASlYfnlqVXE5i2fDp3Jb9MEwOALESVEobO6PvWf9GDL+MhNhR/bMCiwazW6NrQVK41judPdS9XsnskASFsWA/gWUofrRpg5AFc5Iy1mZqS5DQ66E4/JUpUOVz75yftO6Ujl4SCIfdFglFZh1VVQDFb/8WravFuJ21HySwqLSFVLny9XZHVsbl4vgllugEUtNTuhyobbnNanvQqZ0Y2bcGMcPKv65Cwr72RUXl4cAcEBx6RFTPwKnUwUU9kgvblU1G/fxSrjP9LuFlkkGhQ4xr+D4ddpDd/SUcxc0jarOWxVwzvExQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(54906003)(4744005)(66476007)(66556008)(8676002)(66946007)(86362001)(6666004)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ML6iJqV9pJ40gUiG0fdbcjSWYYu1jb2EDmX4vKrx0ugUD4t+id/Wa5aHCRqouXAPEWUcjALck65UoMVltML+Ap6if9OFOiTRlSd5lqYPCJVQfzE6s8SE1jaeGJOSqHeNzgXqv0ItrPbbLsVFOTkK7b/pzLocqkvwsuyrSAhh1hF3rQQXizYh+L+1Pd7GU5VnJMnOL/47KY3q5hnkInG9iLLuaLRwWgcAO5vbombjXw+LxalgvTyrohUgckifCVsyr0+7980a6hlAdeuFWzbVAzKqFrhtAcOLVfuqEPfjoiGzBhibbXPFCQvHt61Ll0BddQQ2C+3YM9oclljeVR3a2ZJ05rRVO5Y5difj2G4pvGcnpNrXtGqEBSAJ65ToGRn1XM5y6mRYr5IpaxM/+ZNkEOnWdIcB6lCdQ37I/rwynn9AAkyEgbkqXWcFSLIANfMEg06cJMFz5AUcyOJUdr3nyRgQVPS2SOVbjxDC/ejOPlGmuApOA3jO7fSVph5FktJx2cuN7il3SGuDCQbk+/mk1xNvEGDON9vU++6ihih2ZD2s8bZkOiKVYkZnqQ9EGdhhiKudCXvDE02dQnC2w3bXd+efFiou8GnrqH3uZpSFu9Qk1lKjGdSzXmWP0fyLc8XCg5pYd94SLAC7GYkizbrb2ESPiBaMUgiUWshEmDVlaTMAvVgRU8FxnkjNWjBaGi4KZOfKOg3+6c8YH7xmY4yNcHIlVbS4C9fMB8+JCDScN8eEpXoLMg2phCAgbXKu9+Jls/IyCKXiR9zeCES1nbNOB+X6ku47Xc9dUho+61RrTm8mxmidRaFSsbKus8C0g7kO5+Eou4mmen0+YQKih616qLXNy3Y9XigIOR0+1fJ9qfhTlexKr+2h2OSctFNSEpzaqQl+0alwumFSMjyF2yYjlg2LJCavnQ4dgCB6uCgZs1arY/q/C95bRRFe1vuYE1WIZaoqkSMueUUsx0vEg8gS4tuWC5pPjB9lStaN9dwp2bS5LglFPqUpYQyXzy7at03giXtUOlCtK5mgrR+TLN24itpI1musyP5txX6CtNRIeC/5CP9MoDqiZaS3XNGtQto4t1eDBKpP1ZW8d9OPRFpE6ofxHUBkbY/ljvkL46aAeFi/ZHW3ppctEBMUeExnseCtNmcQhCjZn5/taZa4Nf1yWteSDf4r0uXEAJGq4u+opx31gAMsfFnmuupIhGe38l0U8/Vchxq3mwHGW7kx8L37+YLqgmffXlKfchwHrUCwq5eW04BxMksuVh8vPzbbt0szvmgz9Sudv7pOILwd2oo0OK2QIPTdLhwVAHJ65T7id3ih/K6GLKmf3sDkqZHVZuE/0Jyu6t1D+3toLhfmTntNB+Uw2rdsMPjoUnwIt16GmlLtKJqJpmlu85ZvuAcmtnEAV8I7YVeCBvCLMMSrvD1/gRuCAgnt7HQBrK7mlhHeAOirf1sf/Y5kkb1VFUd/uweYPmtio/p0QG4rhhPafR5E/p1Be/d4X1Gz8IpdoGYjPbupJiDxIkA2gQTcrJeHEthB8Ev/LhWzb825TqMWKp8EDKyyKodcJ79RHsCrar4nSREaW0EKE8eIhmyILY8gdWAn X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7146e2f9-eb3d-407a-40da-08dab31ab4d5 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:11.3867 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yrwZIiLn5RnhlZYvWTLRtD1TNN8z01JZ491o9plSlnoMGPcWPj8t6TNWTMoc3yTVacINQrHdo6kM1/lKNW/z6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Add i.MX8QM compatible Reviewed-by: Rob Herring Signed-off-by: Peng Fan --- Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml index 70322e57b6ff..ad3b8d4ccd91 100644 --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -22,6 +22,7 @@ properties: - fsl,imx8mn-cm7 - fsl,imx8mp-cm7 - fsl,imx8mq-cm4 + - fsl,imx8qm-cm4 - fsl,imx8qxp-cm4 - fsl,imx8ulp-cm33 - fsl,imx93-cm33 From patchwork Fri Oct 21 04:15:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014274 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 1888AC433FE for ; Fri, 21 Oct 2022 04:14:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbiJUEOw (ORCPT ); Fri, 21 Oct 2022 00:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbiJUEOp (ORCPT ); Fri, 21 Oct 2022 00:14:45 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2056.outbound.protection.outlook.com [40.107.247.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BBDA634E; Thu, 20 Oct 2022 21:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AwvwLEvKhgQr7OYPaNXb6rGRQ4c++gi8sXS8OeJczm+mb0fg3xQKPjxXWIpvUlOA1rcIakqBQOw0mIoHnkI/5x8n8dreQzcL3mQrGPiIch4cd1dyUP3QhPLrFXDztGTLyIZgDyGtAiTFwpY+9wBc7F/55rUk+WXGocZTcDCmQwumetZ9330Ia0WcswApECRdFFtDD34JyJxEmwaRasRwXfEH67lSvq/hy7Mr7yc0fcbtd6CSCicdDswd597Kg9UlQ/UPjmZYeNQkUnKbxFyD0HUYqjWXZOjM35XME8mhLOru6Q3+RCaKwEzS+Enzb/NUgGOi/NIZxlsmM2CT4ADb3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TJfWI1YzYlvXMQs7TPShXS8gSDh/xbrUCZxc6bIVzUA=; b=CbgkVNYHq4DKsOqP3g2baNn1Z9PB/9mtjAXLUgLXa45dVSHiSn7uaPDBCxqMS8xH3agRFyv4CR4/v4q5EZ0dAdj42L2YSlwmNw8n3Ri0TfD1BOAgFEuS80fY0GtjvDTqndGGcBgdpDBbrhxP+YvxrJ3K4yP87mhGMmuiOx++00V7mllKTJSNcRvl9BYeaCMYmn5p1CGmyTELh4bCwMbEoGCJWxwQynzYZpMtNE4sVbdPV6JM/p10Dcu+JB6QrNgY7k2TY20NGsap+XQylNp3Rw+XfqqoSiaNsQjK6ZPx8QlJkDjazDEOXO2jRL6XotMPv/T4AfdwNQctnM5zK1hVpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TJfWI1YzYlvXMQs7TPShXS8gSDh/xbrUCZxc6bIVzUA=; b=MS2ZHy+lnhKpOMe7ZeI8j00b4DoS7dFnTTIDXA8vDhveRzD2ydvJbAq1/mGypDC19qSm0H6vGD1iYajqGgKyd95A+dHs44fg4ifuGdT7AK3CUArO4vMP9PxFU4Ug823e5B20PqqYryNxiN7GvV1se+TkWk9ubLGRcfwSGIgoeXg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:15 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:15 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V8 3/7] remoteproc: imx_rproc: support attaching to i.MX8QXP M4 Date: Fri, 21 Oct 2022 12:15:22 +0800 Message-Id: <20221021041526.3696483-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: cefc7843-a1cf-4461-30eb-08dab31ab795 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q/66XHy+QVuZhkalLA9FIYzxaQtiMUyN33m2zY7FCR2L/zTLQID5JSaAukDLuM4Fdu/iHXbtrev2vci9vEJp/lFeEBzJlGyd5yMgYnnNFcm53fgCY9fOKBbRe760uIJNEDIrdkxrdHEKIU9zGCmGV/7apNACR3iiA63NknUgkeSWH/QQRfAZleoJEmJTF0XrHwNk8WhR88CBFVNncNemD16nFDoYvDmrH4XvyTSvx0lV4mrBwlejJfsHgDzRLKNCkShE/MXlR2ofIlPsoUJidVcwKAQ54KL7JQzJiYWjHDT1tXB4k+YZHYSOkGXeoJIBflAG5t7ma249l5N9LhlEMAc0dnJaPAdY5X+2r76mCTJjFwcIkB/bePsqZG6QFlVI745SzOco1qgfKAH//gntnfNkAmXs0ES3n1yzvrjOoBdBc9SheAMwjaYgXabpYdyJq5TNzo3nOLEn161VRMGD/rkXE5i8C6BIcP0fmWAWpOtbNHCl8fQzLrP8J3BzRs6Vmx+3tqNJH4w3xMkWZkFJBJQ6scJMlP0b2OXBoAewO+qglzkDKLDihNWJVYj7jgayFr+Pe1SmnLuA88l8SMo3U3N/DLNjC9ieotAgzruzMcyJIEsA41bz/W/eML410lQav4SIwoLExwAjO5A21/tRjQyQQlLuBIQVuFBlvUMWbP3hw8XGM/JxcexwyfwKon5ToBCvubK94ofeTiCTqWDyVqy9xWbE1CPHE6Ryu6YXj41Kx90EKH8ZvBzjM2Uj4kUIMV3PTBYqWr0uiydeIE+ozw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(66476007)(66556008)(8676002)(66946007)(86362001)(6666004)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kYBXALO52xTbubZmDLTXWo9ZAkGFhZl7dlzCUgL77AvlPwKgkeO5y3+AYeRHMuSzJVVqJnpHtDO/21v+q7qAUT0tN2FbC/Sfsjc3KJq78rl/H/Y9k3DKZP15TJ47UdFos3HgD6ZewsuAwQudpjrOMVFWpN3A7pHfY0rAmRKvxHiurFyz8Gvzk1RMDUsIqBmeWBOONFMY+nn7w4vH+XEBBY6yeREDEBPPeDUovuZ8V5Hqs40zEHa67+/9eKsLfc+We/s5s4wXxg9rcHyzt6RhO3i4/wvd+UX4FXtuIUcFw5hJDj7jySLMTuy4yphCpAhrna47g/B3HGr6zc5jJzIaBlMBWFIYMxElp1bZ6ihWoS2gi545J79jEsDWuhQs8PBSO26RuObQL+59sLKV/HDXRkraVNSvawrbgp/M7Gfaw66B6kjTG7SO5JZqviyguIWYv4ED+idgN37N6KtcAtYwy5LPThN2/xQQaIppSSIC86YyntkpmiN9pcroYTPV/Qt4dpgUWZtqONqvyLoNb1rKmG9drXESJTSoc19paETQmheFc2TPchP+PclyOhsKB6mLhey2uYYQ8TnqezgX8gvW9N9h1PyMYJZG+aQmV5aOQQMoNmYfj/KgBRnuPwllCG8LFRs03pjjq0AHagMGCZjyPdKiT1UN3hIdIeCTFMRw/nOIyqAsymGaPLSnyrWbUyFw4s63QzMBJhxs7k7Lg93eRCMOFOqHGXhL3yn1//9TZKk0ymJA5pOsBRra4UZXrxX8EK354KY3l4NuUlx7HY/yxEMNw4qhQzxgfQbWdi+fkxqdYLHrOHUlhXUc8cHyVkpo9IAGb8V0z9Uy/iWHOAV1svzfv4LrWhp2BdoEvTan3hKLEhR31JkSJEiJmqska1nva48xzQNZVdjDyWrhrSpcscUZPoq1NGDm+tlv/xDtuR981/wfMolpYJXfPiBMxjnUl8Ioin/WwHmqDZM1AVhz7AHDNSivkZs7BUFmCgc0JXAM3ZUXCXUYllr5ViVRbQ86OVvSBsk7Jr9kMtsefS4Wx7vzMqUHCz0OS6Xzv94Bj0mmnAK3Mq0hnnyBKJKI3Gn+5wJOLYQTRH8UBn8z8fmzVC8I+3WJEeUE1MgpZtqVEnu/gfhTbNjUw1yKhB05dxWXHV7finc/58Ui6Te7TjJU4sVrLF6ZkXnvR35HMlJ/RQzEMNYP93f9jONwjadaOJ+fyrRR3jjgMoJvOWN2guL3hObLiBFvefDm7/4O3R7FzAFPIsgHaVvtJwSSYpeZo7hp5wxRV+kZdNVvauki72Igba022sHmPl1w8hpXToAqUCMRTkhdqz5tdtB4Q2nc3nt1jAjMh2uyofQlvZWRnG//Kt/+vXThMUIXBaDhaLBp/8PSYmp5T4AEuRwF4RnJALI03FM8e6xIvuZL8wCtbIoESiaq57OYiGKwzqtkxypEwzjOTHaA4FWyAzZJ2FD2HNAz0dpiX8mMDDpZAlCLyJSa9so5fo9O1FeotGk8euo6FsVOKeYyFlmIjcBtvm82RIvXHi+dbrrEBHRJCFP7UhipfDyhZ+8lEUrMUM/YvOG+Odz9FWdC1hgDJkAw+mdeBlM4 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cefc7843-a1cf-4461-30eb-08dab31ab795 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:15.8750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ebD+xdpWDzzqUdYCXc8QKBTmy5wXO+BtbYJo5oEmKTwUdlYqOthAVLaC9828otGNaq5ZdFxHJbdUFE0WhYa3jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan When M4 is kicked by SCFW, M4 runs in its own hardware partition, Linux could only do IPC with M4, it could not start, stop, update image. We disable recovery reboot when M4 is managed by SCFW, because remoteproc core still not support M4 auto-recovery without loading image. Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 108 ++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 7cc4fd207e2d..5bbba6955683 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,8 @@ #define IMX_SIP_RPROC_STARTED 0x01 #define IMX_SIP_RPROC_STOP 0x02 +#define IMX_SC_IRQ_GROUP_REBOOTED 5 + /** * struct imx_rproc_mem - slim internal memory structure * @cpu_addr: MPU virtual address of the memory region @@ -89,6 +92,10 @@ struct imx_rproc { struct work_struct rproc_work; struct workqueue_struct *workqueue; void __iomem *rsc_table; + struct imx_sc_ipc *ipc_handle; + struct notifier_block rproc_nb; + u32 rproc_pt; /* partition id */ + u32 rsrc_id; /* resource id */ }; static const struct imx_rproc_att imx_rproc_att_imx93[] = { @@ -117,6 +124,18 @@ static const struct imx_rproc_att imx_rproc_att_imx93[] = { { 0xD0000000, 0xa0000000, 0x10000000, 0 }, }; +static const struct imx_rproc_att imx_rproc_att_imx8qxp[] = { + { 0x08000000, 0x08000000, 0x10000000, 0 }, + /* TCML/U */ + { 0x1FFE0000, 0x34FE0000, 0x00040000, ATT_OWN | ATT_IOMEM }, + /* OCRAM(Low 96KB) */ + { 0x21000000, 0x00100000, 0x00018000, 0 }, + /* OCRAM */ + { 0x21100000, 0x00100000, 0x00040000, 0 }, + /* DDR (Data) */ + { 0x80000000, 0x80000000, 0x60000000, 0 }, +}; + static const struct imx_rproc_att imx_rproc_att_imx8mn[] = { /* dev addr , sys addr , size , flags */ /* ITCM */ @@ -255,6 +274,12 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { .method = IMX_RPROC_MMIO, }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qxp = { + .att = imx_rproc_att_imx8qxp, + .att_size = ARRAY_SIZE(imx_rproc_att_imx8qxp), + .method = IMX_RPROC_SCU_API, +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx8ulp = { .att = imx_rproc_att_imx8ulp, .att_size = ARRAY_SIZE(imx_rproc_att_imx8ulp), @@ -680,6 +705,37 @@ static void imx_rproc_free_mbox(struct rproc *rproc) mbox_free_channel(priv->rx_ch); } +static void imx_rproc_put_scu(struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + const struct imx_rproc_dcfg *dcfg = priv->dcfg; + + if (dcfg->method != IMX_RPROC_SCU_API) + return; + + if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) + return; + + imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED, BIT(priv->rproc_pt), false); + imx_scu_irq_unregister_notifier(&priv->rproc_nb); +} + +static int imx_rproc_partition_notify(struct notifier_block *nb, + unsigned long event, void *group) +{ + struct imx_rproc *priv = container_of(nb, struct imx_rproc, rproc_nb); + + /* Ignore other irqs */ + if (!((event & BIT(priv->rproc_pt)) && (*(u8 *)group == IMX_SC_IRQ_GROUP_REBOOTED))) + return 0; + + rproc_report_crash(priv->rproc, RPROC_WATCHDOG); + + pr_info("Partition%d reset!\n", priv->rproc_pt); + + return 0; +} + static int imx_rproc_detect_mode(struct imx_rproc *priv) { struct regmap_config config = { .name = "imx-rproc" }; @@ -689,6 +745,7 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) struct arm_smccc_res res; int ret; u32 val; + u8 pt; switch (dcfg->method) { case IMX_RPROC_NONE: @@ -699,6 +756,51 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) if (res.a0) priv->rproc->state = RPROC_DETACHED; return 0; + case IMX_RPROC_SCU_API: + ret = imx_scu_get_handle(&priv->ipc_handle); + if (ret) + return ret; + ret = of_property_read_u32(dev->of_node, "fsl,resource-id", &priv->rsrc_id); + if (ret) { + dev_err(dev, "No fsl,resource-id property\n"); + return ret; + } + + /* + * If Mcore resource is not owned by Acore partition, It is kicked by ROM, + * and Linux could only do IPC with Mcore and nothing else. + */ + if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) + return 0; + + priv->rproc->state = RPROC_DETACHED; + priv->rproc->recovery_disabled = true; + + /* Get partition id and enable irq in SCFW */ + ret = imx_sc_rm_get_resource_owner(priv->ipc_handle, priv->rsrc_id, &pt); + if (ret) { + dev_err(dev, "not able to get resource owner\n"); + return ret; + } + + priv->rproc_pt = pt; + priv->rproc_nb.notifier_call = imx_rproc_partition_notify; + + ret = imx_scu_irq_register_notifier(&priv->rproc_nb); + if (ret) { + dev_err(dev, "register scu notifier failed, %d\n", ret); + return ret; + } + + ret = imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED, BIT(priv->rproc_pt), + true); + if (ret) { + imx_scu_irq_unregister_notifier(&priv->rproc_nb); + dev_err(dev, "Enable irq failed, %d\n", ret); + return ret; + } + + return 0; default: break; } @@ -803,7 +905,7 @@ static int imx_rproc_probe(struct platform_device *pdev) ret = imx_rproc_clk_enable(priv); if (ret) - goto err_put_mbox; + goto err_put_scu; INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); @@ -820,6 +922,8 @@ static int imx_rproc_probe(struct platform_device *pdev) err_put_clk: clk_disable_unprepare(priv->clk); +err_put_scu: + imx_rproc_put_scu(rproc); err_put_mbox: imx_rproc_free_mbox(rproc); err_put_wkq: @@ -837,6 +941,7 @@ static int imx_rproc_remove(struct platform_device *pdev) clk_disable_unprepare(priv->clk); rproc_del(rproc); + imx_rproc_put_scu(rproc); imx_rproc_free_mbox(rproc); destroy_workqueue(priv->workqueue); rproc_free(rproc); @@ -852,6 +957,7 @@ static const struct of_device_id imx_rproc_of_match[] = { { .compatible = "fsl,imx8mm-cm4", .data = &imx_rproc_cfg_imx8mq }, { .compatible = "fsl,imx8mn-cm7", .data = &imx_rproc_cfg_imx8mn }, { .compatible = "fsl,imx8mp-cm7", .data = &imx_rproc_cfg_imx8mn }, + { .compatible = "fsl,imx8qxp-cm4", .data = &imx_rproc_cfg_imx8qxp }, { .compatible = "fsl,imx8ulp-cm33", .data = &imx_rproc_cfg_imx8ulp }, { .compatible = "fsl,imx93-cm33", .data = &imx_rproc_cfg_imx93 }, {}, From patchwork Fri Oct 21 04:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014275 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 6D7FCC4332F for ; Fri, 21 Oct 2022 04:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbiJUEPO (ORCPT ); Fri, 21 Oct 2022 00:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbiJUEO4 (ORCPT ); Fri, 21 Oct 2022 00:14:56 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2056.outbound.protection.outlook.com [40.107.247.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F0A248C9; Thu, 20 Oct 2022 21:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuNMsdQshM18qLnzjGmXOyg+DHzVDUrfjxzSgtrRSLY12jY62/YPlu5s37TkY7g6FUxKeqSPuIHuDKD6nNhe0/Nof/SxIHEZLpBMaXQPjVOlDcKQZ6lBy86mk7yVU+Ed5jslkMj3d0bLneBfLscb5qK50Qg6XtHhiBXWUO82a26MpSaRTQoN1apTlwKDlC3EjQt3dre3+gxbOzxS14Pa3m3OixG8Yq9zAUDPgbPU+ZCev5Hpf9/6qAI74TcjApCdaCaWMLhwqIJsokulVDk1pXwBVG+twz92KisoKJo2FR4dmpDl+ESFR7CGHgLY5pPbVxrCbxk0epZ0B5vfoGwxhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VXlSOq5mayofeEidHA9K1mueZiDPZvbynQwlfobd4SQ=; b=N6k7JhtAiOPxnWzG6CLc7gUZIReJ8vbrGiTWNcBTokxI6WnaRHsp5x8Fe+nncp0AM4uGsR/5pF6Mo+xx5ZnpBoYTzwtFt1g2xN4nBIMtsKv3iw+ozvFlkfgZQW2ev8J+tLfGi/pd1BYzI2GrbpTU77xLNnOBVOw0L47R0jblFB+t9iPJZAwAF6NPJljaSv5+Tu4IgIDlBcju0WF6WO2xjQWNLua1D72j0kLTIP58gkqb6/eyZXdRmLqlRFZn/M+6eL/jpVCHH91PpAsVo0wfVuJm1YzKpE1u4BviZKp7jJtThFJij05VBADCgE25HrxRlNJrP1S83gafIWwGwLQeyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VXlSOq5mayofeEidHA9K1mueZiDPZvbynQwlfobd4SQ=; b=b4BlZS0F+LFY82AEJAp+RjVEnzdsbSbkPIelnE7JzcotG5PWZ9uokJghhi3sBh7eqe+8Zn5//6JixsYS/447Ui2Enp0nLkdS8ivkK09VGz0WldsNNLvosMFiFtQepsUmUmJ6DBmRbda4cqKV1Yr/XfQKuUVItQBL1zaLGbHMfHg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:20 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:20 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V8 4/7] remoteproc: imx_rproc: support kicking Mcore from Linux for i.MX8QXP Date: Fri, 21 Oct 2022 12:15:23 +0800 Message-Id: <20221021041526.3696483-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: ccdbc4dd-bdd1-4d32-dc2c-08dab31aba30 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h0GkNf1peUQ/PvAxQghriwbWFDJGNh6BCa85Lp/fzDBi49A7n2ORAPUSSvolkFmtzLRssYG7ialxjpoTdH+DSAIgnyFocC/797a3H30+vPfvo6VaeNLKzdNSFu3iNCtUvyVM2WVW3IsSnQbJ+Tfii1/dR5PfhqV/Wq09lVbbAWRaJWpGi53eicEp0o/YoifQiyUlS5xWoyiluJ2QwBt+DsUyh1o+4w9hKVI4ksKtVXckFiHSfX4k5N4c/slVQxC521JbB6fMYT9LQFt+bGDvJSMter4SVcIu/G8U7UF0TTA2S3LnCU8LfB8Y1nssC7akvPDFw+8cxuoxUfU42tbDPX55959+n20BVQAERzZEA8EFiYdio4dKd18pE5Qt4AX7PdUm2SnqqnjP/p11qQ/Dz47qkyEuVM0g6zmbfh8laGQbObV9oQZI+T1IPm9TFBwwBZI9lUP8f6XW4nwNCqQIqilcgKHEc5bDlPvafCnAH0/I1PU8s7iqGhOxdGrESp5Mx+2uuyYXPfXzfe+6leiEYWrn0Abn1W1zC3wHi7FVYQ8RxNKJC4mlhfDaDfncvucgiACalOsnxh6AZpSJ8iS9Ve27Xx/woFflZ2i3XpTk8DLfHY4a6UVL3jySu68TRz5H7yZtp2GcgIFE5ald+OdNYK5qY/hCkS1bSHjzGFXaon4aJFJnAti5kozVcazfKoF2fh//7HX5yZDwO6mOHbt8rZCew7W0xV4SmNZjo9K3OstxN7u/u+B+52hF5kPuG9BwoxqEvr9C2gZ9fGDMtExsjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(66476007)(66556008)(8676002)(66946007)(86362001)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JIbUuRJBL4tXp6DsCkDMp++EGnxsZlBxWNVcPXjt7q398M70YeGhhKqtb+wSAw8rMaF63Avgxdzv473VN8x6fbE+939nDsXQ4dVnj+F7VyYkZ/WmkXI7Iby5DRl1FmMdOG+np1ce1qFllZ93gbseP6CREZUirF0D3e8TGP7KB/yESFBBt9ggJwotFBOg0JjQ5nPvLvhpw/TCObGTcE1sqdM6BiAi8wy3Td1tH3aZo4clzd26Chfb/rHYxJG0MPdGAIRZDGwKARteMb9Jf53vNGStmJwjMY0iK3K7E+4l2aJ2DrHUz8xNl6AZF/Ax4FQaHURtvIy3rnBLj/uB9NY3bQu5PnIfBkVxV1xgHGJzA06L1kYNdeS2BKvlISsE7jealFJVAJaJcy2CdD2x3NfIN/cYRyFqxNazA/2B+OddmnyGrXd94PKcwQ5ixRGRoq/ZZIfXnmUG8b+MFY5sx7OHitPHWRqCC7ctwTXYtZF9A4Uo18TrIexn16JmQwEQSWgc2JZdvYEQgql3wh++3Cmn9PUagGo0z4ESwa4CLCjbKAbIJo3A0R64xBgFr+rkgr4AGKgvgnVYOyL8rQYXPpBmUg6obqoMTpgisbCnuudekQcHS0tKbS/3Lg1rRilz5lZg96inbrJORGlPsQbXm1qTARcYHUmw1mj8QQe2cRwZLaznEAGG/1JD96KbDeMllGcjlkEn0DU+osVl07orR3MOkzovMYiOuD44zbK4yreAec50yFqOr1I7LJJsnQw7JfczAHyQOCNPrU8op007uLUTkN0XHgVnB/icp0ctHaNJ8UE5RW6XrHEVDbCXLrnGCzVVsM/e7v4UOcnWY5fJvP8+HpngZbJbPVKq6LKkFFdPR7jsHSs9Bgz4NlaraC9puO0q7BUY2SjiXHlO88hn04cBl3WzM+tatSlsFeZe9/UbiKsC4yEvz7KtFOt0yTNkojBLRIS3KBUKreOdQ4LG7EdifiRJ8KQeusPvYLds2m3wKI1FQp4Ak8IBBpBOK7udeyDULDRgkXrqLzC9xg3h/O9f6J2BALtFCZ+HvtbFWs31zroaq7/XqS50xnIWFyqFpjRPInhNN8WrysjgDg5hTZEviBjBORHOLeGnqtiC2C2FWeVtc9HrsBFj5988altEoQK5MpLM5SOTxSTB1vByP+Y6UZ9bUXkU9G8KXDlkQ3TtLIZUD0d0WnX3NBJBs16ykHK0qX5xZ+HIe5obJvopszVQZlw+ZaryffNjjFH0MREH6aD8yIa8q9LHrqBckLxkNNW2tghOJcGd/BjmQD/YxmHChgLQR+5u+FVc9FsrL+8Zx65or1MQOdu8ADg5rj1Se+0qaALSThpIT1oF6QBIouIIYSgIqZBSw1E/27xxKv0zp6RYQaIg7Wwpv3IbnrRMZhfvtC/Gi0U5VLP5RiqXo1dvlgvpK5X5n8aSxm+jhKqPp5gA+lGQtpiJzp2PR25uUBG/KWeU5aq4kiLPb2NpRGMBcsMJIYEQMzPBG4FiFXF8nkQLbO3abj8dleA8Y6YDmLusd0mcNnyeGMi02YQIWQSUomQmgFuCRj331PttF84SW5zYymrHud/krhKKlUfyU7iB X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccdbc4dd-bdd1-4d32-dc2c-08dab31aba30 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:20.3132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lzbNffWMJe/WatScRNxFrzJFN7rWJYbkPokA3l8ZKkVO2kt7BVuznBmH82sc8twvaFgI1nInn2JodW//f9zJPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan When M4 is in the same hardware partition with Cortex-A, it could be start/stop by Linux. Added power domain to make sure M4 could run, it requires several power domains to work. Make clk always optional for i.MX8QXP, because SCFW handles it when power up M4 core. Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 96 ++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 5bbba6955683..372cb4a346b0 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,8 @@ struct imx_rproc_mem { #define ATT_OWN BIT(1) #define ATT_IOMEM BIT(2) +static int imx_rproc_detach_pd(struct rproc *rproc); + struct imx_rproc { struct device *dev; struct regmap *regmap; @@ -96,6 +99,10 @@ struct imx_rproc { struct notifier_block rproc_nb; u32 rproc_pt; /* partition id */ u32 rsrc_id; /* resource id */ + u32 entry; /* cpu start address */ + int num_pd; + struct device **pd_dev; + struct device_link **pd_dev_link; }; static const struct imx_rproc_att imx_rproc_att_imx93[] = { @@ -335,6 +342,9 @@ static int imx_rproc_start(struct rproc *rproc) arm_smccc_smc(IMX_SIP_RPROC, IMX_SIP_RPROC_START, 0, 0, 0, 0, 0, 0, &res); ret = res.a0; break; + case IMX_RPROC_SCU_API: + ret = imx_sc_pm_cpu_start(priv->ipc_handle, priv->rsrc_id, true, priv->entry); + break; default: return -EOPNOTSUPP; } @@ -364,6 +374,9 @@ static int imx_rproc_stop(struct rproc *rproc) if (res.a1) dev_info(dev, "Not in wfi, force stopped\n"); break; + case IMX_RPROC_SCU_API: + ret = imx_sc_pm_cpu_start(priv->ipc_handle, priv->rsrc_id, false, priv->entry); + break; default: return -EOPNOTSUPP; } @@ -713,8 +726,10 @@ static void imx_rproc_put_scu(struct rproc *rproc) if (dcfg->method != IMX_RPROC_SCU_API) return; - if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) + if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) { + imx_rproc_detach_pd(rproc); return; + } imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED, BIT(priv->rproc_pt), false); imx_scu_irq_unregister_notifier(&priv->rproc_nb); @@ -736,6 +751,77 @@ static int imx_rproc_partition_notify(struct notifier_block *nb, return 0; } +static int imx_rproc_attach_pd(struct imx_rproc *priv) +{ + struct device *dev = priv->dev; + int ret, i; + + /* + * If there is only one power-domain entry, the platform driver framework + * will handle it, no need handle it in this driver. + */ + priv->num_pd = of_count_phandle_with_args(dev->of_node, "power-domains", + "#power-domain-cells"); + if (priv->num_pd <= 1) + return 0; + + priv->pd_dev = devm_kmalloc_array(dev, priv->num_pd, sizeof(*priv->pd_dev), GFP_KERNEL); + if (!priv->pd_dev) + return -ENOMEM; + + priv->pd_dev_link = devm_kmalloc_array(dev, priv->num_pd, sizeof(*priv->pd_dev_link), + GFP_KERNEL); + + if (!priv->pd_dev_link) + return -ENOMEM; + + for (i = 0; i < priv->num_pd; i++) { + priv->pd_dev[i] = dev_pm_domain_attach_by_id(dev, i); + if (IS_ERR(priv->pd_dev[i])) { + ret = PTR_ERR(priv->pd_dev[i]); + goto detach_pd; + } + + priv->pd_dev_link[i] = device_link_add(dev, priv->pd_dev[i], DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE); + if (!priv->pd_dev_link[i]) { + dev_pm_domain_detach(priv->pd_dev[i], false); + ret = -EINVAL; + goto detach_pd; + } + } + + return 0; + +detach_pd: + while (--i >= 0) { + device_link_del(priv->pd_dev_link[i]); + dev_pm_domain_detach(priv->pd_dev[i], false); + } + + return ret; +} + +static int imx_rproc_detach_pd(struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + int i; + + /* + * If there is only one power-domain entry, the platform driver framework + * will handle it, no need handle it in this driver. + */ + if (priv->num_pd <= 1) + return 0; + + for (i = 0; i < priv->num_pd; i++) { + device_link_del(priv->pd_dev_link[i]); + dev_pm_domain_detach(priv->pd_dev[i], false); + } + + return 0; +} + static int imx_rproc_detect_mode(struct imx_rproc *priv) { struct regmap_config config = { .name = "imx-rproc" }; @@ -770,8 +856,12 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) * If Mcore resource is not owned by Acore partition, It is kicked by ROM, * and Linux could only do IPC with Mcore and nothing else. */ - if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) - return 0; + if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) { + if (of_property_read_u32(dev->of_node, "fsl,entry-address", &priv->entry)) + return -EINVAL; + + return imx_rproc_attach_pd(priv); + } priv->rproc->state = RPROC_DETACHED; priv->rproc->recovery_disabled = true; From patchwork Fri Oct 21 04:15:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014276 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 5FF27C4332F for ; Fri, 21 Oct 2022 04:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbiJUEPo (ORCPT ); Fri, 21 Oct 2022 00:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbiJUEPA (ORCPT ); Fri, 21 Oct 2022 00:15:00 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2056.outbound.protection.outlook.com [40.107.247.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB6F41D28; Thu, 20 Oct 2022 21:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F6BgPlHLizPsoWGqys3UewIm2SNj5wKeMaAvtqrmxhPWlEYKSWTzb8v8eLAFVXFdeQwIK8z6XhBlCc5kYKsnfcWkplpFvFw5ujEuf0LpaTDOc5TD5Pew+HoiM+F3X9Z/5JNSMubRiuL/mQ7dCBNKRH8vO35RMTpXDA8HJqo01h8dlaQfOPFyjULskz+fCQovFk0/hi/9kQFdgbA2fBrvKS+LhBLYuRq5oXpiI4achnHYilW5XDOo0lFJ9YzqaIXNj26IgLiq9M71qlzOeJDFuvRenXHIxi+0SB9WPCFRIMaTGzdzqIrZkuuzpKiT0y3pwPngFSvD+13XSbEhoqUt0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MvxEeqqwY7dac6HsGnLTQI13mhd7JygOFElQG9WC7TA=; b=JGMA4uELXPfKtKwhnZSsweTF1Lmram4d72gXZcx18oRhboR+SuwK/VNR3yDn0jQTuGIT+/eddO9PZ7i5fJI+Q5Mcin0lRTm0J9+CW/v2idclBFlEhlBV7QvJDDvx4gzs0HPLcQBEPihf8d1CoJ6XkJ6a2p1Oqk/WmToMfkmyxGS9h2CYgpEwyCgHqQ5I832EAO1RKkteVYJ86mqKHZfTrpPMnBJ+Xbzsl4QzAcbv6/f0BxifsQAm9GVIIhNHYvNw75PF5RcTMVZzOJI8uFUvSb7nVocdiUKX5IUZh+GCkGU5SaZfs/vkHjqTpkd8dmSKV7Db+AsAY+tiAOUZ6rzLXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MvxEeqqwY7dac6HsGnLTQI13mhd7JygOFElQG9WC7TA=; b=GLlyIUk0+woEaGrxBmLttbLtFrobOapHqhh2ZAgx/RyN6iaRuX14EI9KbE0/ZLLO/BqB2UvCSrnEjxEJ306zlsk+lKHO1GAaYkb1Hs2Gr8Lx6uhPeJKMXaOAV4ZWzrAEASfvXPAXc99HUPLN8UFDdFDgB3kukrZ4OvtADRiaXaA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:24 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:24 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V8 5/7] remoteproc: imx_rproc: support i.MX8QM Date: Fri, 21 Oct 2022 12:15:24 +0800 Message-Id: <20221021041526.3696483-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: adcf1da4-8204-458e-ce10-08dab31abceb X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zaTbs+hORplqdsLepUynknwDb835qMC6PKTgIxj1J2EhjykTHQ0mYbYXUaPuaCodpwYaUaTPHiFVh8oaP/tVwqZOpMZuvnKY8bQg6uVVYo8yKaCJsUBHAfDEBy6stEhB/vlMuveGgSGWztJl6b8QcoCZJBDytVUA3M3bphOp4Oov+WIKLAq1Dfc9xh0C6jYHhzhZmnjYxQyoqu9IEWPB/JdRZBNpyHFt67y23u6QkGDA8Cxy3AG9qn1BbXhoBUOO4OdJ0tYH/Wxz8Aso1TSoViYMOFolnnxDBtoWZBdEFuY3kz8HaxHepEueZb7TP5BP/1itVRnu5PTVqyiNOzJex1ZgmTjOycwmIrMQKu0Y2YcYEEYXIu7RALBZIE9ndfkZ3e+qRRM0FGAJ8vwLACpv4SveR30gaUbkDYRIE2t2m5keBZvfv5Cx6rILihbx57xLKcTSB/BnSuJAqonBARJWlq+isegnt2QqNiH2PwohKu+JE1cF4xrjZFQZ4zFvpWEjUlPP2bv32CzBXYKzmtcM8lEc1j4+00B6D75fBiqjjeuiPS//2soTAts7f6keSC1N4Jh/NTcKNRwxsOeEN8OIukP7yMUk9DHWjMPVez/Vb+XDSquhAYEXACVa4iW5nnpGC7OsMw99G7OQYSc6u2N577Y/Nr0RYIKaDuINVGlq0P8hzd1gQUj5FPlH3pgN2qQZLyE9nz7bmLyFbQzJluHUGJ/uld0EpzoJI+G+xbehW1uwaST1/hF7wwQwOxreAjhIVymf/SvaouzMTyADOfL7aw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(66476007)(66556008)(8676002)(66946007)(86362001)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h1M68zbrcHdNzp0e7t7GWPvPlGkc7EPHnt76lJ8ZW2oDF92D0EG1qVH5rtt1EKtLiNoHNitcGLIlhIc2ar+GV/VSMIkJNzH/R6gmgQHNKDbo52L03HDxv8O2I6GvpPYn+BIDz5J+GF7BDvB1m/UGqRKNo2IxPQSW3UWdoIqVFsWzvqSYaNOkVrTWCaP/SSodts9b2fayw2vp8s39R2SmE1v1YUmWorQInUnuAX/Kqb/9DS4ZViXzvQw1WKhLpvsVqzYvZ1YoOYi8bsPajURi9YaZnE3U51adDIHSf5+w/5DpY4XQxA6eppjIhGY0IKRhNJMi1laP9Jmsx8hO7VjKi3OsQp4q9xAR7mffl3Bib2CaOs6R8ntEsTnGkF3i/qH/yR8J16cyMGAVEuHAvm1x1I2g/I9dmkW93JgXABsnUEP343fLMNmDg7Vo33qJFLp/CAAwm0nkZ9QQokcMtEJDPzf9a5RlI/MBW2IURyPL68xGiK6W0BFDubD0BhTYYQMcsxjg6td0fmrAUYdWltfEdNtLY30qCGoK2NgWx0B0gakdVI+BkJt0Mnfrny2RI9PxxYilJ5QUMQSjEjM8Ila8BPbTWxHSKioRwITGmwswlYqGJJxAsi25Qln6nE0pNMrbzz8GizA3HHz2JfeNsE3qN1vMLgNvZ2zrlKtQLsX1Dce+FJfZb+Jc+hoNrE1l+0tY1/uK59Jx6ngEMoGWlm403SSGAuFHHazuZiUjvx1OBl7PEAOGzZE4f4K1MU7FiqSV+lQQkDYse+7ocwDzV/db2Cyq80/+vPON0QQw/8YtVgFjQaj28OI9HyeTCPcfGHvBXHWw3rXNQxeAv7/iIIzGq+fJlQghx8/oUgaGZj8zRF+ka3zWwFRwFkgfgmEnFFcdOqvHO52Aot+wKaGI/U0dyWs+gu9WWqh8UwG4SAx0EmbzWzc0TVqj3GNHG1mEX9yuyGpUwm8NVXoNoIUXK1gpfuHFlIRaOHQaT1rPzih4vvh9ur38cbGKkDS9sK5hWHyNrCg4EJ2V+J5P4sXRL8Dkws2nejzzgl4dK5F2PiK92ijaFuC+IwSGRCUJ5qp0FRsiRxc+oMDp31q56g2jmxPvKJQss1gpVLa7Y4SKXucw0SBrFEz+7Rsl569NIMDKtO34ZmW4tEypRNW+2B43TgFwEV0tsG3Livr/WxDSyKwKo8xBK/EoemntA+tOtlZmgiwKv7Ui9Wp9RCicPfhZ8KUqjRMNtJZFuiZp+buSt2bxF2lpqMCCEBtRs2R1gMOHF/MNXXBl5WkxNv/qsdcGZ1yb3H/viX4j4IJkr4JfHCV9dJYKfVOYXRuFKbuxGFqPbkOaTjLBRUgzCBIcebwGwLyU37beRXTkwkzNor1AbVciRDVUaTgOqdNkiPiiXnbJSzzLCua1f9WI/PXVLtEkdliJSRMKWUWa+RrXyJYbWTnhBz+iRKUlJGM7+t3GJ7eVmrgEWavuyNbPw5zGB0PT0RutYkkV/y/0lJZ/nm2ENasUpqlbJbipqCHqorgwe76PG7u+3Mv6IlcF7HsA0KeWaHEPD5ldEo86wD/kQxqUYpgT0UYNqLdP/MKL379xxGqHJYa8 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: adcf1da4-8204-458e-ce10-08dab31abceb X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:24.8312 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xypJeGeW3ZZ0chpVkCcS6CnJoXJw4U2VMLYtYKlxYrCIJ8sPubJ+IyDRbQaLI9DIBXWnEs0CDqiP855zn+mOBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Most logic are same as i.MX8QXP, but i.MX8QM has two general purpose M4 cores, the two cores runs independently and they have different resource id, different start address from SCFW view. Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 47 +++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 372cb4a346b0..917e6db39572 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -3,6 +3,7 @@ * Copyright (c) 2017 Pengutronix, Oleksij Rempel */ +#include #include #include #include @@ -75,10 +76,13 @@ struct imx_rproc_mem { size_t size; }; -/* att flags */ +/* att flags: lower 16 bits specifying core, higher 16 bits for flags */ /* M4 own area. Can be mapped at probe */ -#define ATT_OWN BIT(1) -#define ATT_IOMEM BIT(2) +#define ATT_OWN BIT(31) +#define ATT_IOMEM BIT(30) + +#define ATT_CORE_MASK 0xffff +#define ATT_CORE(I) BIT((I)) static int imx_rproc_detach_pd(struct rproc *rproc); @@ -101,6 +105,7 @@ struct imx_rproc { u32 rsrc_id; /* resource id */ u32 entry; /* cpu start address */ int num_pd; + u32 core_index; struct device **pd_dev; struct device_link **pd_dev_link; }; @@ -131,6 +136,19 @@ static const struct imx_rproc_att imx_rproc_att_imx93[] = { { 0xD0000000, 0xa0000000, 0x10000000, 0 }, }; +static const struct imx_rproc_att imx_rproc_att_imx8qm[] = { + /* dev addr , sys addr , size , flags */ + { 0x08000000, 0x08000000, 0x10000000, 0}, + /* TCML */ + { 0x1FFE0000, 0x34FE0000, 0x00020000, ATT_OWN | ATT_IOMEM | ATT_CORE(0)}, + { 0x1FFE0000, 0x38FE0000, 0x00020000, ATT_OWN | ATT_IOMEM | ATT_CORE(1)}, + /* TCMU */ + { 0x20000000, 0x35000000, 0x00020000, ATT_OWN | ATT_IOMEM | ATT_CORE(0)}, + { 0x20000000, 0x39000000, 0x00020000, ATT_OWN | ATT_IOMEM | ATT_CORE(1)}, + /* DDR (Data) */ + { 0x80000000, 0x80000000, 0x60000000, 0 }, +}; + static const struct imx_rproc_att imx_rproc_att_imx8qxp[] = { { 0x08000000, 0x08000000, 0x10000000, 0 }, /* TCML/U */ @@ -281,6 +299,12 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { .method = IMX_RPROC_MMIO, }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qm = { + .att = imx_rproc_att_imx8qm, + .att_size = ARRAY_SIZE(imx_rproc_att_imx8qm), + .method = IMX_RPROC_SCU_API, +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qxp = { .att = imx_rproc_att_imx8qxp, .att_size = ARRAY_SIZE(imx_rproc_att_imx8qxp), @@ -397,6 +421,17 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, for (i = 0; i < dcfg->att_size; i++) { const struct imx_rproc_att *att = &dcfg->att[i]; + /* + * Ignore entries not belong to current core: + * i.MX8QM has dual general M4_[0,1] cores, M4_0's own entries + * has "ATT_CORE(0) & BIT(0)" true, M4_1's own entries has + * "ATT_CORE(1) & BIT(1)" true. + */ + if (att->flags & ATT_CORE_MASK) { + if (!((BIT(priv->core_index)) & (att->flags & ATT_CORE_MASK))) + continue; + } + if (da >= att->da && da + len < att->da + att->size) { unsigned int offset = da - att->da; @@ -852,6 +887,11 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) return ret; } + if (priv->rsrc_id == IMX_SC_R_M4_1_PID0) + priv->core_index = 1; + else + priv->core_index = 0; + /* * If Mcore resource is not owned by Acore partition, It is kicked by ROM, * and Linux could only do IPC with Mcore and nothing else. @@ -1048,6 +1088,7 @@ static const struct of_device_id imx_rproc_of_match[] = { { .compatible = "fsl,imx8mn-cm7", .data = &imx_rproc_cfg_imx8mn }, { .compatible = "fsl,imx8mp-cm7", .data = &imx_rproc_cfg_imx8mn }, { .compatible = "fsl,imx8qxp-cm4", .data = &imx_rproc_cfg_imx8qxp }, + { .compatible = "fsl,imx8qm-cm4", .data = &imx_rproc_cfg_imx8qm }, { .compatible = "fsl,imx8ulp-cm33", .data = &imx_rproc_cfg_imx8ulp }, { .compatible = "fsl,imx93-cm33", .data = &imx_rproc_cfg_imx93 }, {}, From patchwork Fri Oct 21 04:15:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014278 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 6D3BEC43219 for ; Fri, 21 Oct 2022 04:15:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbiJUEPu (ORCPT ); Fri, 21 Oct 2022 00:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbiJUEPB (ORCPT ); Fri, 21 Oct 2022 00:15:01 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2056.outbound.protection.outlook.com [40.107.247.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D01714D179; Thu, 20 Oct 2022 21:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMIO9Mt5DRNyhuX9qi4AbQz5zekDhePWK/c6ZRIeMyhixXGTYSuRSvazseBfyupP0rXagLqFoPh3axkOAtUXovsiDHz39lyGJna2gIfxBodOVK2kMRYnTOQOhI8s3qoaE5b8ym08hxyqMVUM7I8jKfI1veydNAjCXKCmNBoFhA+ymV7VyI2P6+BZta/3hDCTJlnoS3HNuDXNCDgpz62Rg3yUAzHPZutUREpGds2l46Mivx8SpkvBPtkZeAEyCvrlBgx4wegPnjXgDnakozly+c+TBYDiNNgRgLP3s5CGqCtOBObYxmWT9FYr4AJ4YEe0sogJkm+2A4ojJ28Bqoq8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/g4ticVbSfJTXiIKBwpQhaSw8lLbSSXvitD61nOORHY=; b=Je3Ts+4/WN3ooPe+aH3HwBLemAxt1xH5LGSX6RHTYQnGjSoy7K/4epT/Iy7oXHBRLRGLXjxQOh1hogdxaSLqAMxqy10z+gFzwT8f+BN71oiVkEQ4MpgkUjmN8aO7iA/7aI154x11JBJ+rxZ2kP7tXFSW12rkucBKW8meK81OFjriOs3jbogfBGL9i5lUlYBSOa9T5TxisAFY/sICPwOs2Y1Bs31yMp23TR6o0BScbQ6cB+eCf1rQbGieovu2vUSQ9Dd59hFvVDm+9x8P4SXmuEuErCmQV5nkoP3eyrC89MqR/gtjCPSOv7BSldbYQelLZNKjiMn29amAjMWHRvZytA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/g4ticVbSfJTXiIKBwpQhaSw8lLbSSXvitD61nOORHY=; b=F1nxB4ic5gUfO6grdTtCoQ/XvWuDMBveZRqNzBrRPFeqVgaGc0rFAeJXapnUzxwBm6DcK9KkMg9um9eG1yL+EX3cr4p8TbxU9pi5UKv4vL/V3izely7OFoM0zgBLwzi5ALaqIQriFQRyqkyHqtX6L87ua2vONbICzohJ0QqTUU8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:29 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:29 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V8 6/7] remoteproc: imx_rproc: request mbox channel later Date: Fri, 21 Oct 2022 12:15:25 +0800 Message-Id: <20221021041526.3696483-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: 86b4a916-7c9a-451f-e051-08dab31abfad X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7oI0SH0XtUJqL8rRHF6i+EZMJk69xRX9uQt8p3Qm0uWJrfvDbmU1zgKveKXKCIcbymLNhaVCVqROltAaiLnsjAHpdc/FX9c/HgYEHsc2UkxNROLqm+AROVpBIi6tVQKwrcWUqO+XwmTWlPfdtfKbXnnEPPV5d7UOegKm+KrtgC+m/aZuvOS7SPXWaz2NK/kIVMyHzPjumc6AmKPdXqZGB857UxGZuXB/hw2HR8GwINQZ9jVx6Z4xQ1/De5jUxfNAkE4EHpIklP7HJeUDDoo9tIeMebJjrmfwOgqx47dfAhKm7Ys0CL66NxsTtx7hycItQJEwCMXsJ8acCJc3+BG8k7756/7Etu13VfgJpE7w7B09MXFPNicQsHz22WzDzKiRuS/XtPucnJzci5DwBa0DSd5wjvgO7cfb2SwQCUvmkg0IZueU8YTJ1xm3sztRhrLZKRER90ikoHw4b8hEy+Atj92wpvfTfx7J+aBpmlvTo36UjcK0ez5sjE5dtYjflIUt0CnOjc5tv+ajj/TLZ5qKr4pnH/h2LwSQru2TVKkvYgaqDsaf9RUHp5xhyGUJA/CflDM9i1UIxuzWMSR9KAszpYy6X2WEBC0zdrEjO2dzODQdAwWFBPgB/33i/fr9Lk4n4TJX3eSZlCOlvWmIwFH9q/OoeGu6Xhdk24S/b9+s+gYPAw0cjn9s1eZfuGiBjvc6mx0SAJXImNsekmKnI9JoDAqJopSS5q4pV/xAm0b6vymIBAxDeG5958SINit63VqS7eVyn/xCX6zOQbNqTZBj3Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(66476007)(66556008)(8676002)(66946007)(86362001)(6666004)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d1dFFDyVY/23dGzbnkWMZlgmF4KoWvXtvinX+GM/sb//NM/E/e6sZ763iNeXpXebQL/sfuQ01VzFHX+je8hQ1mprtfU52AlW7eXg4lK3Oe0eS4HDpoMwE3aCYyF38TZVdgxzh1UGiyKIqkULud6aYXX9b4WlXXVH68Cy6oNjcNC6z4PzKHVWYtICUasP8UZUe6mBYQZJq1XV9JXFu9z9XY1oLTXs77b4N8SewGEhXrAWi31L+AkQeTZWMT9QwNV+qHcO6HV2WTa83/WEclOICXw1TQpfFFFNIjXc/7tT+tfLSO8jmaDALnFDOcNHn2J0ggce0nxJXrCHcKGBThJY2hFo+UeYSnTeF5sdylTJe6AObYO5nJzUcqPiV7ecqGv0Zs+5xzwx03dJXSfonrS6mwEksUxEz5xhzsI6F0ToRpNqEie9Nw8Y1PN7JNXOXUvM3XQLe7RQyXR3NZBq2SBVbrBKgPqzMGYezDVSaFdVi8n3Oi/YpXPU3Mhn7UDGhdfo+veKUkY3gh2sVGwBGyCAJv9sjYtnMOSNdJY4Tu/PUczHDlw6134idMEhmrL1dQGVji7NmSmmi4YR7ycTvllzqu9wWqE2ynd+thFMMpK5vvEZABMTPm3p6Hz335T/R3zDpseT++aOjWUE86GM8pt2ge/zDSnmFUQXFqJPq91BHG/X+GAR7syGa8R0UagkPNwAmPzuk0Jt8SxE8AEVoQE7YxO7g8eGFsZY0gD5GWO3vh8qfW9uiDR9S+L29RhUvBkrKAXXX9ycYQOPklfiLlIYWPeZ2+VpMeiLt8I/VWqeWrLwOXx1cecj25Wrf4X+HdoVAi1rjby08GrU8IO3lfJFy8ImK1cAs3Xy8ahjdC+kfaarlwFxF5wwXCrXUvkmDt7tnw0xrW+6ia65hZYcmPMU3+8/z0sSXYj2wJzo6TMRS7zrJfLw+OXxC7N2Jbt8pjCv9aQgQEUrwHn8oCk8XHTSPqquBjWnbp/Q7BW6BV5oYp8jpVIFOwAZfCDj2aZuvdymAGJpRkmVrxDlWos309axb6nD+1J6+CqeaunUhDlEn1JfjMHWAjmVDWlQlihEe4hmKlokLYkiYwaERDJwdkdF2cNmyxeJNg0fGjOSzR4UFhhl/IahbIpnr0yuCzaOPHfUkxLoFR02MudVm66kLj+YM6WRAnYDpEt2TnJaWOcs1r21C5lYqis7Ceh4Wwo+KBnSIjpi1GHJ783vkDjUhZXVkPSSeGLgoJwOr/mUbKTIGPQ2noPsRy/qottpoo+2eLQfLB4ztf0MYCbUAWieDaCZmAiM4HP7I3G0Lo1ToKAU0qblBO+9KErqJpBoARFQwAE1hirKuL8v24C/Y1VFFun0QIQb72Xbwy2mHtpmaZ/x9+ntcJzTVl02JKwDu4sCu9pV4hH8JRSxJqrowAHpE+Vt9x5d5fmk7auQIcd+5/2bQhes7ODI/Y0Uxul2d82Mn/ZoLzlqhBw+4yS43kFjyH2CU/EjdFmNgCRBJDtcR6rEemJ9gNsTQHRAK/Hrbju1j3D5hosoT73x5cTqEvo5MzaJvxf+goPPjwv6QzMmglHRv7VvsUuStXgR75DC7KD4TsVg X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86b4a916-7c9a-451f-e051-08dab31abfad X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:29.4585 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FkOCI9TE6PLvjLBUvB9qiEofaPwdCUKu5v4u4tyoRBXskfxfV5iolcZCTqd+TSP86Nux8UmWGnXaP0883lMozg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan It is possible that when remote processor crash, the communication channel will be broken with garbage value in mailbox, such as when Linux is issuing a message through mailbox, remote processor crashes, we need free & rebuild the mailbox channels to make sure no garbage value in mailbox channels. So move the request/free to start/stop for managing remote procesosr in Linux, move to attach/detach for remote processor is out of control of Linux. Previous, we just request mbox when attach for CM4 boot early before Linux, but if mbox defer probe, remoteproc core will do resource cleanup and corrupt resource table for later probe. So move request mbox ealier and still keep mbox request when attach for self recovery case, but keep a check when request/free mbox. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 48 ++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 917e6db39572..dda4e8a12adf 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -84,6 +84,8 @@ struct imx_rproc_mem { #define ATT_CORE_MASK 0xffff #define ATT_CORE(I) BIT((I)) +static int imx_rproc_xtr_mbox_init(struct rproc *rproc); +static void imx_rproc_free_mbox(struct rproc *rproc); static int imx_rproc_detach_pd(struct rproc *rproc); struct imx_rproc { @@ -357,6 +359,10 @@ static int imx_rproc_start(struct rproc *rproc) struct arm_smccc_res res; int ret; + ret = imx_rproc_xtr_mbox_init(rproc); + if (ret) + return ret; + switch (dcfg->method) { case IMX_RPROC_MMIO: ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask, @@ -407,6 +413,8 @@ static int imx_rproc_stop(struct rproc *rproc) if (ret) dev_err(dev, "Failed to stop remote core\n"); + else + imx_rproc_free_mbox(rproc); return ret; } @@ -592,6 +600,22 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid) static int imx_rproc_attach(struct rproc *rproc) { + return imx_rproc_xtr_mbox_init(rproc); +} + +static int imx_rproc_detach(struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + const struct imx_rproc_dcfg *dcfg = priv->dcfg; + + if (dcfg->method != IMX_RPROC_SCU_API) + return -EOPNOTSUPP; + + if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id)) + return -EOPNOTSUPP; + + imx_rproc_free_mbox(rproc); + return 0; } @@ -610,6 +634,7 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc static const struct rproc_ops imx_rproc_ops = { .prepare = imx_rproc_prepare, .attach = imx_rproc_attach, + .detach = imx_rproc_detach, .start = imx_rproc_start, .stop = imx_rproc_stop, .kick = imx_rproc_kick, @@ -720,6 +745,18 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc) struct device *dev = priv->dev; struct mbox_client *cl; + /* + * stop() and detach() will free the mbox channels, so need + * to request mbox channels in start() and attach(). + * + * Because start() and attach() not able to handle mbox defer + * probe, imx_rproc_xtr_mbox_init is also called in probe(). + * The check is to avoid request mbox again when start() or + * attach() after probe() returns success. + */ + if (priv->tx_ch && priv->rx_ch) + return 0; + if (!of_get_property(dev->of_node, "mbox-names", NULL)) return 0; @@ -749,8 +786,15 @@ static void imx_rproc_free_mbox(struct rproc *rproc) { struct imx_rproc *priv = rproc->priv; - mbox_free_channel(priv->tx_ch); - mbox_free_channel(priv->rx_ch); + if (priv->tx_ch) { + mbox_free_channel(priv->tx_ch); + priv->tx_ch = NULL; + } + + if (priv->rx_ch) { + mbox_free_channel(priv->rx_ch); + priv->rx_ch = NULL; + } } static void imx_rproc_put_scu(struct rproc *rproc) From patchwork Fri Oct 21 04:15:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13014277 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 7162DC4321E for ; Fri, 21 Oct 2022 04:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbiJUEPu (ORCPT ); Fri, 21 Oct 2022 00:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiJUEPB (ORCPT ); Fri, 21 Oct 2022 00:15:01 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2056.outbound.protection.outlook.com [40.107.247.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A009578BC; Thu, 20 Oct 2022 21:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GeJD3V0fvjqHt3bBpYokmjYBZNWA7n9vr9OViAFrQPoFiSVDqm39eGHzCC9B2DI0Eli2atpRXCwYI8FiG5hG4/ApxMXb0Tqv6YZLrhNApop/PCzwxKigZa29zO7eqQnbebkCc9cprlvZJcJHkt/APfNrvMxR9Z95yM3zn/piwvyaapbHoJq2tWkKEvml1fe/Nf5yFHirKBtUFq8CX10PH42VRIb5DOrPiZTsn4se4AlpRqQg9Eiwcrth0COfVuY+u6+QM+Z+fTkYM1ySqHwcABJwIC1xSHZ+OmsT5DqQHukyL9SftVD+ZA18YK8Ae9Zc/VECww6T9WMfMHrslfyDIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5lmd7U3HA5UYUtnW7yd0cOy+Wpwv4BP/NsvISeSF++Y=; b=cp+UxGruUYs4Qsb9Kd2KgMvqqZG78pWWelgopTl+M2zvJIeALUYmJX3IjPoT8L5QhuWISDi2tQuawEM1ylwEDtyl/AROWJ/rChtfBNsHbMPCmAwgFqkCEa1t7qDni2nuXJhAZSpTGPYTHx9EaRSrLIe35IfxpYMmUAtmzt1hqW4cYdd/HdtKh2YPQ/1UT6tY633Wcx90Ze+AnfKtKFwGLJGAgAPKqu3CdT9mu48hT7+mRtJ/sCo7gFsE/cvpxePkT5Fbi0fwcLLxb3leB2RqnelVSqh7iEDEZUe3BhcgDSAtaBKzDU1zcTmIW2ba/G05oRBwtPzJhAbSAwr91+q4+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5lmd7U3HA5UYUtnW7yd0cOy+Wpwv4BP/NsvISeSF++Y=; b=Qe+4g7yIXc88ti3jIOebOqYC4BYPfEwdJ3FsTak1vSbSaTHxYbPLAP0of1y5mglbBRA7Gdoy+inN9Vlg9AlayiGHLHGLs0hBdB9rsBwIMXynwZxFrOD5QkUoDfgqTdzmcM58GYF64yEzYoKIFJjznlj1AuSMLlg2zrjvZXCrO3w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7294.eurprd04.prod.outlook.com (2603:10a6:800:1a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 04:14:34 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::a5ff:3d28:4bbc:e1ed%6]) with mapi id 15.20.5723.032; Fri, 21 Oct 2022 04:14:34 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V8 7/7] remoteproc: imx_rproc: Enable attach recovery for i.MX8QM/QXP Date: Fri, 21 Oct 2022 12:15:26 +0800 Message-Id: <20221021041526.3696483-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221021041526.3696483-1-peng.fan@oss.nxp.com> References: <20221021041526.3696483-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ed24a3c-f0ec-4c60-ffd8-08dab31ac27b X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eTbq2VLkYN3mnpf6+zyvzNz8QEwEGutcdkASMnGkrgpjSIT7ay06+UXU8z30Po9myYTS1qP6R5JXDF2sXa554tzQlJKr3V1tmjpfI8mGMbZy6C5BFENItR/NbJbH1gOGOFQQkJknN5zsfYHUZv35y27Usnp578d1D+1sZylNTtAdYvdCGIzdGcoQae/VC2sGnSus7x7b0zM3eLSsWHDPywwnBGzd2dSqLxs6YLv90IpHytymSdZhWEu0Ij82PT6MltT6IaCplFqxc/hDpi1yv521wJxynRYu6r8ANug1GCcce/dn8COlS5rf12n3PRyWZJVS814UlQfwgQQC+Cz1BFjg5cyv/xGkcuMvbcskkNKS8iDdPI4U/G9+K4gb1flZjPglUswOQMNIlDoebWhhbaNeKtGhGDIY1/bsgsGQDmcKuHJ2Or1IwgpQ/UXrtlfP1nOOipX23/Hq50aObPRWhZb2pqE76ja1c7eKi2Wi0y0Ut/9lvRzwdNnPGchHMYX45S9kAPMATQaRA6Ue2aR49FOPUjxIISlLK1JKkJ4yA7ipURY7+17hLofBvm/zTii37EvhYmIqjYIv3zsPn6flZ5qD9W4U+knBEWsiGxXgmt67lBaPfKdKdxUcxBX3qTkZilToMN88KP3tPYRQUEBr36RuKjKtpSUIEk28cAty0qbwb3GKM/VtQAN/ru8BcMFVO6u66Q5Pxxodf+bL0bEU0Jk2iYeL+NYi4gbHBhMbY3woovMEqvaz1NJh1Kzu2SBrpiV/CzxfnehNjC6fuQNh7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199015)(38350700002)(186003)(2616005)(38100700002)(6486002)(2906002)(1076003)(478600001)(4744005)(66476007)(66556008)(8676002)(66946007)(86362001)(6666004)(8936002)(316002)(4326008)(6512007)(6506007)(26005)(41300700001)(52116002)(7416002)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VM5rKKQgSevwgqJLxR8KdcOwVQLZmZ5JogWDdAQTZN+vhu4LZpAqwIqXMjQO2xIwdV7WCVQiUXcbgCfJmj0auXLvgNKMms0uWLb/bpW4Xb02wBesLFYWs+je6QCzNoOi3s95HJkD7mmZ0/dzVdIpRjbkX+dmzH5DdAIpX903AyUUdd5/6LcoYv4C5YuesQqDRYDcd8BkcusN8CtJb8k4+Qjz6aq4hv2U/a5uR/1n2HbIEPAZUwCyS/PaVNm84xSerjZl/TrjnNrRcmLyqf4nAbBW+1kTH0FEG4XAxrCFDH3lCK1LLjpxDT+0Y5mBxDCiWVRg6jvHaODgGMLjYDCtrKf+2sigI919U91BJAGo3RnalNcDYuQln849VcYjWfefKQ4rZTVleVCQVCKbNKZczviY7DE4b0cP5/MbZCkbJWYkz7iuUByy9b21z5EQ4EdeZeb9GQkmDPoWgS1Pqbv5QEQC/I4c1q9k3LR1RWlithGRg6ZoWO4gLUD0GwK0JVp/efYID5f8pTCbKC2ZItVbWnRR/M4WVFls82MJwhrMsaP9JW874PN7+5EnwC7Rhlb2SG7LmSIq9nYrkalP8pKCy/pcfvajcToxwXvLspgQ6CUsaClODH0c1E6wMXQ1EvxglbbFTW8GWaxdIo07q0Aabt9pDse7wSy5IYd0zt8RmvWl0G/ToBVFJvP8T8vcniHesT6fYmjElcadX/uWZhuZ3H8NYggm8qnNq5PFY0thLszn0SvjAImDTes7ZPS8Mw3UOTgKYTRAQg1BvoqFZucxuyff8Km4dOqRvDPJbRyBtKwym+2iRUkC9PueUmDKAQwjuwp21dpOXmzsoFbsB56Bd/r2BLDMJrIDC54jCRPV7+aKfY2Zq8lG1zdexOUTwhPJ6c5IV00Pws7MUHSlUNfX1QiWFWFGb7+eFli112v5I0MHrzK+mC32VMl+v17+7RnrrjBuEqljyorbuVyCjZPI/lE+6OxxeMz/TwBIMLl4QgZGM3UKmRtPCAyoQTxXZS1N0n9ZByFK/xjtYNblzeoyhn8fGWNZ6z/fxwLW02rH8MG7f6cqA4mGPhCP7iXUI0kSw+Q6E5yox6wOO/1RCtAua9AXFEQkNNWkCLBOKzAn4wcsRrgIK23vRBOqFyHdQLjDPz09zg99XWiIllCqZ8Yc7g0+cKLh0d8vb7S/DOqt8XnJTuM7CS/kVjamZMq+nus2gma96zyZ4unup6cKIGzmZkQpu2JPhAMptRKkWpch1vGVFPo94gTaMALQt3rAW4rJJfkxWD/D33KcrtWZ4/06h0KougeRAqRP+nWpB7YSyRIUVTgNgAtKVAs54Q+Xqsifun21MQaHggF01RisI2u4VNamzxBFC2z6mQhbFkeewD8cJScBfKvgKV2Nf5OTG6bibnXBFVhBuQRw3IFYYGLr6kGNbYAPYn2jwzvhH2XrYa3OJ3NuxAiceatGSOFipkg7orj3l6ie32sCBNl/+1EMpjys1/O4m5emtUURFpAvoxPzEPzPUijs0X/Jf9LLuIWBAU8exRcdPrDyO8B0aBeXCbuQrIMv5vBGjx6Nahqm+fybweioQnTtWtqQlSKLvDLx X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ed24a3c-f0ec-4c60-ffd8-08dab31ac27b X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 04:14:34.2731 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KQMg2D16rEjg1QZnB9ySo6D5W6kzMpFGh+Ozg5BufQ8MZCGDGkrIrUT363SWbefagnAWilZIG3jPbirC5Rva2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7294 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan i.MX8QM/QXP M4 could recover without help from Linux, so to support it: - enable feature RPROC_FEAT_ATTACH_ON_RECOVERY - set recovery_disabled as false Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index dda4e8a12adf..2c471e46f4ca 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -948,7 +948,8 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) } priv->rproc->state = RPROC_DETACHED; - priv->rproc->recovery_disabled = true; + priv->rproc->recovery_disabled = false; + rproc_set_feature(priv->rproc, RPROC_FEAT_ATTACH_ON_RECOVERY); /* Get partition id and enable irq in SCFW */ ret = imx_sc_rm_get_resource_owner(priv->ipc_handle, priv->rsrc_id, &pt);