From patchwork Wed Mar 9 10:21:14 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: 549870 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 43997C433FE for ; Wed, 9 Mar 2022 09:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232222AbiCIJmQ (ORCPT ); Wed, 9 Mar 2022 04:42:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbiCIJmP (ORCPT ); Wed, 9 Mar 2022 04:42:15 -0500 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50085.outbound.protection.outlook.com [40.107.5.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B46BC10708C; Wed, 9 Mar 2022 01:41:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KU18m2Z33aHwjUx6hZXf8mhARa4qnB5nYuurRa3qWOi7+gAffy8mHef65pehO9xPJbHkN6l4iSjkmQ3+JuflYRObeYbkCJlXuM+HEqsnwQ+ffOY2cKzBpRBzlzG4wDniPasMj5MugcHRaVzzxuvpMvlBOCPxxvQn8U18nctOYclWMcYZ5QT50cSCQ0n9PubeJbHw01VEXndoTSL+vKJ8Yt7jSUt5xqKKCyv9vgOvDs2aDznTNLDvEsBPvIA3xa7rGnL4HCigLsFVdXY5ztiqWrAUbREMXMtOeymBgTtuIrKdRH1tSj5hKvHPAk9S5cLAOQcCfzkalgFwyxL5tU5/FQ== 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=P/8yEkjUJ9cM9HYZi+vzoG+zthQuHeqTOJqAMHsBTPI=; b=LC8ZTKrGH8SMPk7NFw9FgslyPuRfxmN1YiPmI6uDjEPltQlhtiI6Rmk/f5mCCEZmh4GWFx25AyEq1xONlyZAtgYZNJJIbqgBO+rYrHj9uAIh0VF84EHFK4IneMB1DzItkuvt0p5/ZvsuR6HfAwRXqFYdRrxuSlIj5JOXPS6hNft5K801v+19Sw9UcgTFTcaxpIAsnyDCLFEAGX5nq+nrtIhGICGjVPriktb5QDcbLX+/gL8JH70BUCf5gHx+yU0tOeo+Lepo4nNct6ZIaVeogR5H16V+oi1JPonGcY8P4pMueUsoxGSlEb6XP+Sg2M/+YCoXFTaKAA3Fb7vGpIymnA== 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=P/8yEkjUJ9cM9HYZi+vzoG+zthQuHeqTOJqAMHsBTPI=; b=atMVmtgwyOHqJUj2nZ9FIIdTYFNbtd5s7JhEHouUHXD7o9Zeb7JVt/UZp4swRlWKRaT8jwgRYeqfP4NQaPw/XbpAHTjeJrVGZlM8QxijjS/a+4RulAW4/hdf0ilRzXENqFKo6ZmHAQATiyfjx3G2ZyqUBUxUExO78cqDtlFRrUE= 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 DBBPR04MB6043.eurprd04.prod.outlook.com (2603:10a6:10:c5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 09:41:13 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5538:7e34:6843:2bc7]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5538:7e34:6843:2bc7%6]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 09:41:13 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, 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 V2 2/6] dt-bindings: remoteproc: imx_rproc: support i.MX8QM Date: Wed, 9 Mar 2022 18:21:14 +0800 Message-Id: <20220309102118.8131-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20220309102118.8131-1-peng.fan@oss.nxp.com> References: <20220309102118.8131-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR04CA0002.apcprd04.prod.outlook.com (2603:1096:4:197::17) 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-Office365-Filtering-Correlation-Id: ae60381e-e0ba-44f9-d00f-08da01b0f303 X-MS-TrafficTypeDiagnostic: DBBPR04MB6043:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wda/5QNK2BU9OhOcyLSvSpdPkN4uS3IsmIaLdFDkdb046HjJe1yDXseefSZx+6hVVDciwlvqmGE5AOflndkO84YMEVziSOqtp5KF/xExwBOojC9a+dfnUhh8p8rzJInRjG1qsuJo25G1ooil2GG/V0UX0NvTGFDTfOiAhsNdi7cIgX5M8Gp7aVQ9jnjIHTHixGH7SOIJ5sP4wnEm0/ucV0CLy28NTgBbzOBJXvgS/+kQ1c8zBX7DWZ/dCOiElX9wI64FlpjyZstmoDoLmqAAxyDYjvM6dVgbNrN/EiwDNGxr/4lTf1fluEQCAEjCcAbC3y1AZN10Sk9L7ahg6LjLOtWTyB88hVt8/TDAPVunwJ/FGbpuykOE9v94BiGFfdFjDLY1pDR+TLJ0ceGCHiy6H6WouO3yJG3iwtAyrSqDt4ci7RGPYW3+bwQCfbN7BXwjkZkKMpyY7lw2Qzi+FvNYByl+D63RZLgTolrhlZQ+9euS+TUEEDLSGDCk4temJg6fXby7KPsZNKUo3w5ugmpL89nXvIJKPvWG0dOoJKdJynIPR+tga5U/PCFoLS0uTRHE6VPzshCw15ZFOXnupJ8C7aYGLhO0jO0CiX8fdD31naKvNjPu2F8+DJ8gRAHxwU5AHP/w+K3pHso8a7aGNycQITDHE12k1H1ewLzFk94kWkgUpccZM93NZMS2krPML/fo1+FqrIINHfjOnuWrFb6hJA== 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:(13230001)(4636009)(366004)(86362001)(52116002)(66476007)(66556008)(66946007)(4744005)(6512007)(8676002)(8936002)(7416002)(2906002)(6506007)(4326008)(6486002)(38350700002)(38100700002)(5660300002)(498600001)(1076003)(186003)(26005)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TAb3Rwi0t7abseI6f1FMhXuzEkFEg/6fk2Ttr2NPC1/yI+ZyexLb/b50Y0/jV7IlRKP+hJgUwIVJtKv01zzr736UiMQJKp3rTnmw7Wu73gHXWGMC7gj5S3qtI7tF758lm37xdrNlD85ybzJq9oy+eqZ+3woUCrvV5qVNcOz8caevA4t8OEIXJu1xipSeidSW44LyzguZQyMzjBih7cV6ri2dY0DaTYwEvCxBl2+TCGl5CTKRZEHYVNSA7yTy+4KsTxJSrbxz+Y/dpEbxiBt1tjr+2Q9tFS3aPRRnFV7BGpP8LAqIFY1MQ01zfmKWcyUtHorhldfpaVDhbBnY7Y+6vWB1Bwx0EB2588PliGZ0rt1tMY3b18MD9YmdPYRjkuyzOiC5Je3MmcRUiQE9BxR10nYcdxCLvE40SEajHPDiBkvrgg3pztPj3wRKOl+v4eoWYFjQ5ibic386s7rp0vUmBKRFzS0oCfwGOdcESlfAwNQIms3FsVDaJVhq6gNJ0mrDi2PGUdLhg3TeDlg2GOLW1ux+mv7YN87mIZB45HMZqwgw9+396stBS5y440rSYQVctKMAor75xsoJ/+DyELFd6Fvo5PC3Re0oDvjVsRPT0xGF8cq1sQJL1AkNYj50cEja6lKKbilE709XlyFfi8Nbx7iPCm6zCFGbdeECw+rgp6lNpjZZbhgVWRhMyErZanT1C0OQq1mMRTiFoDZAGyGFBhkHHhqp6bjPe25IduOZ4wYkXoRM69GVeVW1cxac5XJu9rXQ9KlE1tyltyZrhJYKQQKoZXSiJBZ0BZU+zXWgNPGk+sgrGBYAdqdshWihYzEIsD9ylVuslrXibX9tIdk9mCJdEwYhk3MJrVc41Z/6ZoNOhqXSFulW+iXrThVSNmHM1PYfpy/yQSQaWE6WD24Saoa2xRGT4iesf5LtyN/bZ3l98Z9LTUBe5qfnDAKc3+YAIGAkjkQLJtZhOj1Q40XeQVdEs4qFMWYU/tscwzcMhD2dwP6LmWZUj4f59A+ZTO/owY0eIjgj5lzX+GLXXxUQzkycwY+YrLbDSUePVqPQPztPfM+pb8yw/cWoE+j0oB1h73+Qg9sKPFyMVnJVGjsEyiMZOztV7dCZ4oxUHJy3niMQkNcluDdBXIvc+gxsJsBfIst2nPseAlciqf1wKVXYO/0vRsRyzHROHZrVliABZfgsPrupcVx/WpHFTp/wgOh+VL94TzlxbWCCaTiaOqqydnGwjCW32k9UoOGXNm62g4Zi1bgnK3cOcDVeJ2UC5DjakURyNtsjxOmQ0OHeuF7rNGXzN5Ax1Da0H7zlQOiL2MmUecNmlVwQC5cDec8DIcxQVVI0vd/gIyAnb2mGsJ34Q0/34ZRz5mgr0GHTLqVg8R2MTa46SfCtxTGrGxXrgAa0elknUljz/iYpvHJG3A2A2g/QFOkee407v6W6hIktZNzA45DhbixFghAEyTp0X7rt87L84tYOx0GPnc6lB75hj1LLWA0PYeyneSzKHCtjNey7+S+6qgW89lcy2nNn97PBRBt8pXJWcdyrGdFSj0jHec0a17NDKtVE/D/jW0a4oWCpWQY74ywzXlTGPYC7OipQ9Zhjqwi05odcsLyvQC54UM6EpS7KOuObnLAFggXQCec= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae60381e-e0ba-44f9-d00f-08da01b0f303 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 09:41:13.2456 (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: XQkFCmLh5rK1eM8YskuxwqI/dc21DOeUG+wcH/p4ds3NsRxakaovcdRZo5V7ULXLyJyzegBOjwn/Kv5A5WpT0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6043 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Add i.MX8QM compatible There are two general purpose M4, so add reg property to indicate the id. Signed-off-by: Peng Fan --- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml index f25c203dd2f9..41d366cff3cd 100644 --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -20,6 +20,7 @@ properties: - fsl,imx8mn-cm7 - fsl,imx8mp-cm7 - fsl,imx8qxp-cm4 + - fsl,imx8qm-cm4 - fsl,imx8ulp-cm33 - fsl,imx7d-cm4 - fsl,imx7ulp-cm4 @@ -68,6 +69,9 @@ properties: power-domains: maxItems: 8 + reg: + maxItems: 1 + rsrc-id: description: This property is to specify the resource id of the remote processor in SoC From patchwork Wed Mar 9 10:21:16 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: 549869 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 254EAC4332F for ; Wed, 9 Mar 2022 09:41:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232214AbiCIJmX (ORCPT ); Wed, 9 Mar 2022 04:42:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232234AbiCIJmX (ORCPT ); Wed, 9 Mar 2022 04:42:23 -0500 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50070.outbound.protection.outlook.com [40.107.5.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4D7106CBA; Wed, 9 Mar 2022 01:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HpogthNmxLLFg8ksB4onGZIzFE08z2jILUMg+/+A16+duITNUnb66CxtCMzB0LVCCGfxaiC3PIRo7dF9iN99tntHwjzaPOGJUTTPOyyrG1FkcjBEw9kbyHIVazwGVHUOAH8CSji8VKdaSDaKi2kls8YPyLqiPqs8iwgle5/8oc1t/qI3OLXD5ffz8utTiyjGKGUUrRqAnwHOw2Efw4Dns1/V6GQsx9bKHBkxoy2nT4/20bb6iFiFbtJGviMbMGSeLdQrjYy7twIdskGh/kuRGcwcJnfi9EwmNTMfZwVGsN9Hvy9Kq+5rW3Nvpdu3Ugi0G3NRJhbOr9yDAmlP2K1vRg== 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=vIS1tDzX/A3x8V/BrcBG/rU8H/aVYGGa1Bz/ZKzN/kM=; b=AtCNySnDSNKs+YyMCx/EvB5Cv+q1dK6ggU3TNfNtuUJGJ+ZuCyBwxchIZ38laUPgYVOWrUuVyuap97SFq0FWxaz6uyLrnYLRFUphGOk5GOBYT0wEA8TvvmwmOh6hgVb/hAHs45uIs5xS7OgndNBce7QgltQkpngL0cJZs2ER8K0bAqGMuWeTVqe8lX/piPbdk7ezMBSsvlv25JsdQbEM6crX7JHPhiTfNiCy7tce1OSqoNdtxmSrf74iGOkmV1qT6b61TbY+NRdh+um4prGHdNgpokNq57PykzM8P5N4WQaDQsF2MGsZkrvytXpRJ3MXz+Dh0bKIMtpJB6oSBk4v3w== 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=vIS1tDzX/A3x8V/BrcBG/rU8H/aVYGGa1Bz/ZKzN/kM=; b=DdE5T00LTOY0K60bHIrMGTmBIJbmXQi0F+AIK1GEksnq2h3qvbuZue6I7n6UAneH3xx7AlPF2vkCksxeYZ3iKoq7j6/PlanNmupsbxmHucDyyCNO2uEBZbsZkztk1phoZtqhgOC/mFBKf58MvJ9suQjs2nnul4zIHggaKmk8h1s= 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 DBBPR04MB6043.eurprd04.prod.outlook.com (2603:10a6:10:c5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 09:41:22 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5538:7e34:6843:2bc7]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5538:7e34:6843:2bc7%6]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 09:41:22 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, 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 V2 4/6] remoteproc: imx_rproc: support kicking Mcore from Linux for i.MX8QXP Date: Wed, 9 Mar 2022 18:21:16 +0800 Message-Id: <20220309102118.8131-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20220309102118.8131-1-peng.fan@oss.nxp.com> References: <20220309102118.8131-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR04CA0002.apcprd04.prod.outlook.com (2603:1096:4:197::17) 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-Office365-Filtering-Correlation-Id: 71526fbe-8dd9-48dc-654a-08da01b0f840 X-MS-TrafficTypeDiagnostic: DBBPR04MB6043:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: anG/FtnPQcDi6+ezkud9/L17TnxBGbHJVE/iRc93o89i+ytUXnjwPHYEu2snPrhQhV3rpNuF1DYvb8Aw437ZTb+hvGKrULyb4yPlHDBJSXXNCvjNpEryGDNq6cgJG3TCdTZdzLpkmyi4GSpKHFy7/zuEzfeVfCNxLqRQe+p9sUqnRGXIS96ptEdQHdPSU1vOHJnQX5AN44oDI/m0C+Ww+3J8pWY8rof2tA8Di7lOIeNhabDSN5S1j2HNOgvsob9XPRzphpHzdkIJJl0ekWPDdlYRARzA6AmoiZbCq5N6ztlFp2cm+Ra/ssvqXKfshWw3oqwIm6dP5AqsTARYnKtesPCQzO53Xq9esR6MMAP2SFeL5np3r0ehGh4y8YnVMK3wpTgxx8psOUapCpLwIXXBUFShquz4dtuJm9DqV39Yaq9HPOJPNGBsrWCcnAXgBsi3XO1WTY43rHAwvKFi6IlNJGsnh2rZCX7QQF3jsSiEVvd3qeJjV6ofhxJGhb6etFFaJ16CHltiUFXq5MflEezdx2m5eVoKyL1VE9UC8fpm7SlfMxjWWuBkYGsBIaff8NYutN+sGwukG9sXA6RyYE+OPg31nMwFgRPsDKbd+1OduoEveQdI45Ee3OlOcJ9W6SZHbsQXQq3rAM6gi1YhdbSj8DLc9QyB0Eao+AehBongsRCfC+A5fnktfWGOfeXpK5vJ8hmrPEnqj6cah/oeDXalXg== 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:(13230001)(4636009)(366004)(86362001)(52116002)(66476007)(66556008)(66946007)(6512007)(8676002)(8936002)(7416002)(2906002)(6506007)(4326008)(6666004)(6486002)(38350700002)(38100700002)(5660300002)(498600001)(1076003)(186003)(26005)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: j8Bywb+sngx3srf/f0HC9duAc73ihA+j4E5JRgJLOhzfsgfdI00zIeEPUhfOptRjNp1LSH1ViSDUfkSsZFyPoWmMfoFo1b3jMKqfZwYU2IEoO7IrXFG7wg5zUQEZxSxkJt6RK8UvUWcI0KEI4l6I7jPcfr4rQ6NC+U2eDNn37846IsbYMg/6u96IvtDrD7a4UzAfyYEMcvfEp8tiMh0Un6EiXVqrode9B0vAt2vHZsQSt5kEmWcAy3qNCMoVsROflWwfiYu3Vt/No1WM4c+ldoQzNVdW2tgl8ZbFQlBcaY1zeVSONeOYuCBCbj6X16Pfm5Zv90EMKjFtHS9N8UbBup0TtBOHG9CyPDs67SmRF6b5j9bYzx6bufT1k89YyBMZm8WsuqNqyOFaBtchcGGXkZ8z5Y3mZ5Tpy9HhfwAa5G+WKaiBPdyc5MhegjXUwEzyAf1DFYg/I31JrmoFkl26IyNr62RZ9oYeIVvbY0QCUtu+QBrezSlT0tPPJnp75a+TIxaCZLElkL/WJfN0KoXuim7hD7Y6S1GJeIrj0UaVmhzdOBHGP6L5VTMWR0WDTbTSrKuWFu4688CQMnBO+h83E864omLUpDPV4FdN065SEiKjGO7r4aV6NgZWVt6cEfBpaPUVIovM+xX2c82yVBdc/dJyL0miWZ5I+FDWQgnuxsggq1JSACR9+zmn7b5GJOCzfZavLQ3AThiMUZppHgZEMuKTluzPtf2J5vAookEfmP1A1GEB4fkTE5RSyzSzhq5g8JaSQOMduCDPZPoLEduqV+sI3G0IV743DGlXTh3PLD3XcjwDsL0mzpBB+n+XwXi0Wb+4GVhBZwXwDnzgU1A5F/HsEMFyFhMdA3so2D2xoobPYZHIHZ0T8o4Lx2klH4sah/UIw0uL8FHhmupiIM7qbZaWCCRLFTRMh7ZChD16O1JKU73OJPCmYJn5Et9axmuqeHbL6tdNRACjLICBQl9mNkP3ebKFySQk8Ux03zeafkDQAqfaY6mpOhwjZDpzMmOLqoBqiZlyFaDe0PdiO1E9BadCixWSddMV+HW1iM8zUgiv+44R/SWd2/iEEwzx2VEsg5EnbsO0BJIr+6g/hFhi/CxuOwwYFyabf1u2bf02AnLro0DRyjq1TXZTDvCGKSVZqANwGQgOxzFL51LVJGuHhsazk7EqFsRADINwZpHD9BqE2YNSn3fvQCdjn04uVABXh9Kfw4S94ficReT2xthJJZ3cVloS+1W4jJPgnpnEsC/4+b2VMxr0PvIMJSY/WkLF4WhvOEQiTT4wD/oaA3iWNuplx7N+7+scOcCJ9Pm+s4JE00fRLkRUkHghjz128zqLtJFFUEPrSCeVg8TJBsIhxZstniw9PdyOXRjRQZoxou2WVqSi/nQhucDVO0/A+7wnA7dGuqYL1IxPzlxfUVnGObOT+pzt46TqXxBx7aSYIQSQbQCLpxgdNE1ySinjs7Fbw7Va5BrCunbE2cujuoqPU7yZn1tFZxzkYsCNjHbNvV+a6Apl1Ta8QIMQOBpp0DDjohPmhiJ0iujZJhlAuqDLiFPwCItPOArChx9IFlYngE/wXb3MJHbGFoflQa5HuvIOaUGRSqVRLLnhx34Pl1w6XetKxpGrFkCRJg/upHeaYhk= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71526fbe-8dd9-48dc-654a-08da01b0f840 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 09:41:21.9219 (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: mGBNzrcg4HTQpI8uG/jB0zOdmyvdfY/1/NuTd27AW+Vu6kuQAx99DgIBv40DLoGnMLoX1guJGa1bw0nbol63OA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6043 Precedence: bulk List-ID: X-Mailing-List: devicetree@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. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 69 +++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 6ed53c660c18..7b84fb6d168f 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -96,6 +97,10 @@ struct imx_rproc { struct notifier_block proc_nb; u32 rproc_pt; /* partition id */ u32 rsrc; /* 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_imx8qxp[] = { @@ -304,6 +309,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, true, priv->entry); + break; default: return -EOPNOTSUPP; } @@ -333,6 +341,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, false, priv->entry); + break; default: return -EOPNOTSUPP; } @@ -703,6 +714,56 @@ 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; + + priv->num_pd = of_count_phandle_with_args(dev->of_node, "power-domains", + "#power-domain-cells"); + if (priv->num_pd < 0) + return priv->num_pd; + + if (!priv->num_pd) + 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_detect_mode(struct imx_rproc *priv) { struct regmap_config config = { .name = "imx-rproc" }; @@ -737,8 +798,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)) - return 0; + if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc)) { + if (of_property_read_u32(dev->of_node, "entry", &priv->entry)) + return -EINVAL; + + return imx_rproc_attach_pd(priv); + } rproc_set_feature(priv->rproc, RPROC_FEAT_ATTACH_RECOVERY); priv->rproc->state = RPROC_DETACHED; From patchwork Wed Mar 9 10:21:18 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: 549868 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 3A358C433EF for ; Wed, 9 Mar 2022 09:41:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232234AbiCIJmh (ORCPT ); Wed, 9 Mar 2022 04:42:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbiCIJmg (ORCPT ); Wed, 9 Mar 2022 04:42:36 -0500 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50075.outbound.protection.outlook.com [40.107.5.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A42C16EA9C; Wed, 9 Mar 2022 01:41:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mrKuMMiugslMsWr1q4djxS+95WmQfTCzEC+p0kgkic1e5mLfyCztfA7xYgSdH3eFc6GPaTNcj4gZmfIs5Eitzxk7mBKIbkOFnHih9tlVlJbQ/Dk2ZgYtI8ay6+gNsBgA+xxEaADq144/JWWEhV7nu4eAL7o31/rATuJU081Jwn9BpqD8jSG6l3QG5nfZ0neW1fNkMDtZkENhJx21XBAbCPtMtC7ZYIKfmPOgr5K/Imj6TmZ6L6dfQJnvqhwkGesxL6mM72pz2HfFdTUMaOnFC7Fa4UMieXUU3v6OYJ5razvIZEmNoTYuYIN8+2eV3iRp5PUWcogUL6z2oSejzt3K8Q== 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=Wk6NvhCtTfcK9hE2AklyLKrOsOTcAU/RjqDgv2rFzSc=; b=IxsbTrafE4FdA2RiHUtktKdq+u3NvtUF/iJOz4hoU3WPyNCNNH+Qnv1ZaZN9SnZZfeSNdSdGT9fynDb4taOZ7gnDCyaamDxKmWa4oMzGNX1zj6fnrpckJVGJbPdHSnN/PVPEDDnR/cnUhwE/KmZm3hV1YiO6yadSnUi/Mjl1yh5S711TIJI93E7pApxEMzetXnf8vD+Yo26AGz94AjPEd7bk9VoiQ9zik7OVTnbY38rURG6USfpinxxtqcPUfUSXgxTvi6wo6yIgdJ6rSOc12W6gUZm+QUOauTTZcPPt2V57Fnwl4mtfD7GL/taK3Esn2e4yjjAiM9HRGuAOtqr2kg== 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=Wk6NvhCtTfcK9hE2AklyLKrOsOTcAU/RjqDgv2rFzSc=; b=eFMm0SAzd9jupZy82FxJ6NwUWgInm1TnHL6/lYuv/A40qlBUIuyCRyRpaShxstimLhUBH2TL6NpvfKXpCNznbhJSeTdunSAR9V2ENLhtxC6TMHc6o2tdiGKaDTAJYYHmM1mabkfQxubVN0tu7srmAAgBKfTdIveHIGALvP/5qcg= 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 DBBPR04MB6043.eurprd04.prod.outlook.com (2603:10a6:10:c5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 09:41:30 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5538:7e34:6843:2bc7]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5538:7e34:6843:2bc7%6]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 09:41:30 +0000 From: "Peng Fan (OSS)" To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, 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 V2 6/6] remoteproc: imx_rproc: request mbox channel later Date: Wed, 9 Mar 2022 18:21:18 +0800 Message-Id: <20220309102118.8131-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20220309102118.8131-1-peng.fan@oss.nxp.com> References: <20220309102118.8131-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR04CA0002.apcprd04.prod.outlook.com (2603:1096:4:197::17) 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-Office365-Filtering-Correlation-Id: 9391139d-d3ff-451f-a076-08da01b0fd6c X-MS-TrafficTypeDiagnostic: DBBPR04MB6043:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l1ULFNaI35Jtx5+jrMl1Pp8AWFqocEbZMkL8je8WsSuVHC8k/vO4Qbpq/4dux0cyylpNZNRdqls4wcw6DjTrSRkiVdsF5ZH8hjgBitZtn1ADBKo/NzbpDTfEOxIKeJiSk5xpEDI4JqDym+Hx4GDVJFZB0k9onnnZ2C7G7c7RinQxkhQF8cKA9ytudd1kAP6uU/6hoUP38/BsH+OFtHGO52jFHo51q3ZCXkrFXhdVpluFh1bVAJJCVfjzipf1VS66bp/99mXPTQEFj5apx7ZG9c/ZuK3amyOmA1Vx+dGnvaG6aODuNrQQjnUvXTypeYmudQxI1YRTm099J4eKp7pL74JN0hAWCrR2U9kxIQIgTJZVvnEjSm21bu7/BZwNhzjCo32fyrsb6+/6LwKViHIakzweKZcZaCu8pQRo04kn7fzYVg2lsZZwm9jtROcZf3MvEyXow+rkoEiD+iDQz4/DNq5TRAyKiGdqKQ2ghIosici7hZYO1Uxe13xE5OUQ1ODDBoZG94hVHuptlgqeibtTMx/wZFELiAZtpo10KlWp4YEL0aiffkaVqZ6CA1iM6FpqtLTZLhQDJ80KRdMjyeYN83/h/rGGwg24/KA2TrG2NeN4xo5Xz0ZjhpaUXBDOBI2pv/PGqhJVaxZBYuxHXEyzVrBGoGZAtsNVEpYGVbSzoNWmGAhMeq8Hi4xUFnBjlhPsyD6gUu7u9enkNC9Nz+ceEA== 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:(13230001)(4636009)(366004)(86362001)(52116002)(66476007)(66556008)(66946007)(6512007)(8676002)(8936002)(7416002)(2906002)(6506007)(4326008)(6666004)(6486002)(38350700002)(38100700002)(5660300002)(498600001)(1076003)(186003)(26005)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jaX2uiU36+6ZdTc9Rg5vRQGU9U1XJ0ehP7fUC2xH9YK+srwYKMzB4pjbYxolPOM+pJ5J+Pp5DD+Xz4b2cJL7GqEqKiJLdX3vJ81o8seukpS+e/Q9wcKU2ESDZrfO7SOTTlVSYhnRoaNJoYtYo0U81SIRMDALrvRMpW8pW6pcJ9BNSIh2gGbA/HmhjrekfUulsk6xzj2Y3P4KSy31+swDDG9ryhhGPUsx6R1XqZxjn2jk9eEAuf0NdIXIFaLnoq1Y9kB2LhSV+IxW/1jF3hUStu5ZfU+DcbbIweDB6/F+bVjy8t0SUodSq1NrvNP5G2UvkP/MH1fexMRHZQC90lPSuCNEpSkyk/ymYkxdjje1Q5nuVKngFvxiQ5bC7H0xfDA1Cb5dqrjK1GNGh32gYJcPqRBKv999rGr4rFzgzCw/UdhUo2UwyDOG/bJwf4vkgGIoNhnU3xWSnTFQoBoTolzQZ2FFhxx+aqEJJH2XxcrCAzqpVYpu6xlloQ76O2I3I9jdY1oTtol90PJwvGXheUtQyQTDO5GX+LFTPI6hwn34MN4Q33BkXb/n+PZfNofdw5iirfp4Vi1ZPz8uCY3mzNxgeYxHlk/q3VOK84CVHP0LS0ho3KIGotCNxrmDS0aYlsjKpR9gKVsVfRKdNT33JPUMGq/SNyJzkcfo1vqF8W5ynxPsoGaDE1zBQKorvYQvbfslCBXGioRTBfOvE3KciQ+1y8MNbtkSZ3zfUwa5oIEsF3HfXf4i38eIQhKH1GQvH4JBjnuh7lYS4W8JJFePNmOHC1JaBGkraTcYLgTIBnCPP5hYCq0rCv3Qqn7gVSxXIP9LtbLWsNJ9igqFCgVzOlSSBdqmGxoAlZ+roftJutd/EXsP/vSt8DYsEplPOayNVFNRZRVXym0OJNk7t5ob7fq7lHmRZ+lU5z0KYy6vxfyoVNZnuloBMLmpxXUwb45gFntGPrrZ8mHyQwx13lcB1xrTp+hhlJYGtxU5S2H7hTR4R6PaLKxYD2uSKA5I1VUemOZT1h3sga6RuOP51Uqy4tGJAdFFEIoYGWlE1AzaANVN1QEzCpXlauBxOdK42caUUZej3AhBpBw1BHlgFLY4F2KHT5+4hb6csGG8WTa5I8uzql3oRbfBfn2LFsecJMCvAmvEZ5MnVxjjZLlBGNVGhrKU8XHdFqwnb4AKIDzo0SFNAiYQ9Ps3SvTlnBQy+WT3Inj5YMAcMjS0Gy9vQQhMuXcf2yolw37pBbeqCj2MQ1VgveIdrpx8uc9CksyTRy+04kZ1DyslL7iHT2xb+/Fsw+UU09JivYHkjtLZnaZu+zebFCyAuNICXkLjVEFyDOtlMBDNASepOiOW5eaIa1OoaXTVUDQG62JT8KXW7O+33kkzkF/+m9rGZJ78OcPlmZTVAkdvKLTHY8o18gO6Yf6VuaFafWIsQNzCU2IBQzkQZ9NjwIlstRelyKbeNO9cwuUYmkX81PXitH3mlqckgyQgg2FS7uHnS9N0HXzsid+ipDsyHCFJYO6g81fYgfuXOi1T/118JWKC9H+7L/Tse0Gd0uhYJV6alGG8LwsxQiyDW44CS0k+tkrvD36thVx/x7Di3EXxe/9OTUMqSayKJ3EVQl1ZnsglQF3fSuB1ygTT4MuOZB8= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9391139d-d3ff-451f-a076-08da01b0fd6c X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 09:41:30.5849 (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: e1tQUSJX6Hb6oJPuYsAK2OJCq/2XCGO8xtHNtEt5qPP5DIdNIWUwn3R7fAU+Ysl2sV0Kevj2lv7EKveuUMxMVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6043 Precedence: bulk List-ID: X-Mailing-List: devicetree@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. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index adedecf8def6..c03d479f1b09 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -83,6 +83,9 @@ 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); + struct imx_rproc { struct device *dev; struct regmap *regmap; @@ -323,6 +326,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, @@ -373,6 +380,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; } @@ -552,7 +561,7 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid) static int imx_rproc_attach(struct rproc *rproc) { - return 0; + return imx_rproc_xtr_mbox_init(rproc); } /* Only support detach when doing attach recovery */ @@ -561,6 +570,8 @@ static int imx_rproc_detach(struct rproc *rproc) if (rproc->state != RPROC_CRASHED) return -ENOTSUPP; + imx_rproc_free_mbox(rproc); + return 0; } @@ -695,6 +706,9 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc) struct mbox_client *cl; int ret; + if (priv->tx_ch && priv->rx_ch) + return 0; + if (!of_get_property(dev->of_node, "mbox-names", NULL)) return 0; @@ -729,6 +743,8 @@ static void imx_rproc_free_mbox(struct rproc *rproc) mbox_free_channel(priv->tx_ch); mbox_free_channel(priv->rx_ch); + priv->tx_ch = NULL; + priv->rx_ch = NULL; } static int imx_rproc_partition_notify(struct notifier_block *nb, @@ -961,23 +977,19 @@ static int imx_rproc_probe(struct platform_device *pdev) goto err_put_rproc; } - ret = imx_rproc_xtr_mbox_init(rproc); - if (ret) - goto err_put_wkq; - ret = imx_rproc_addr_init(priv, pdev); if (ret) { dev_err(dev, "failed on imx_rproc_addr_init\n"); - goto err_put_mbox; + goto err_put_wkq; } ret = imx_rproc_detect_mode(priv); if (ret) - goto err_put_mbox; + goto err_put_wkq; ret = imx_rproc_clk_enable(priv); if (ret) - goto err_put_mbox; + goto err_put_wkq; INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); @@ -994,8 +1006,6 @@ static int imx_rproc_probe(struct platform_device *pdev) err_put_clk: clk_disable_unprepare(priv->clk); -err_put_mbox: - imx_rproc_free_mbox(rproc); err_put_wkq: destroy_workqueue(priv->workqueue); err_put_rproc: @@ -1011,7 +1021,6 @@ static int imx_rproc_remove(struct platform_device *pdev) clk_disable_unprepare(priv->clk); rproc_del(rproc); - imx_rproc_free_mbox(rproc); destroy_workqueue(priv->workqueue); rproc_free(rproc);