From patchwork Wed Feb 19 07:27:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8008A930 for ; Wed, 19 Feb 2020 07:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 581CE2176D for ; Wed, 19 Feb 2020 07:33:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="OExWpc8F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgBSHdq (ORCPT ); Wed, 19 Feb 2020 02:33:46 -0500 Received: from mail-eopbgr00047.outbound.protection.outlook.com ([40.107.0.47]:47886 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726163AbgBSHdq (ORCPT ); Wed, 19 Feb 2020 02:33:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eq1EBPq0UVhl6ElPQosAVaCy/S4YiAgtndyaJH7xTORp2N8PtidePrV64swkJy3AM5kZ84HBnLnIIPlS6WUS3qq4Qd3I6ihR8ws1xYnYMleXFQKgjMuSRBhgCGYQ49oMW0Wk4YGxDgqpGWjsy8NfvXjL3p+cF9Mslfdl+ErGkESvJJmDk8F+8TOMHDAYtYmgVgeueJdF6RAWs1/DAN0XMzV1ZuQAvNdRZav/qUyaHYLqr1BLbFkfIwWZFM0sO20vKfEXNl7gchx/p1Bo+7IuCEiny1nVu5NsxSVHiaLlJMbAZlLdubgwfXBgytWd1Q7whL0okRFH4vYwwXoBUYFqUA== 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-SenderADCheck; bh=guZUjDw3rLsB1wDaQlDCH/YqhhmIeGLUk0m597LLgoM=; b=a9mMEuAdpB022K0WHS6vM610RBsPKBMzYNBR71b2BGN9igoKGQBVH1AsPJzajyF/RkMnnnYGZYAGDs2gV7NLvKqguWloVGnmX/xMVlEMOn7txB+bqigEA0C8iFzHir4gIEMsctkkAKC0rTmi4+FFSSsV5Qn+BlKhLK312LIbsVhsFoTWQpZz2phTTkQxhg2tmR4codthkw/BGL3qCmASLUHI3hKOIgz5YXIBP0E1m1Gg1c+8yqMqIYBzHyowiWp5jtRXBeV/X0TW3pGbB1W4jHV52/p0pjuDrWYfP9jA8TNe/YZmYcywRjawkxCjua9qWGio4Zvhj5XDXJgwrLYwFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=guZUjDw3rLsB1wDaQlDCH/YqhhmIeGLUk0m597LLgoM=; b=OExWpc8FEXgHMeqPBTTFlXIoSV2rCR/fhF7HNicrza06ql7/Meo6WTWA7kr0rrRGANVLkAxluFqno5i7VrvovLIvzUOz5jtuFlLBFg3LuNQveaIq2JIdPqFhOdYLrKwMYkSXchJCYMdAQuYAAb3d0PIO0cHS5nj5SP+HjDDD9Os= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:33:42 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:33:42 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 1/9] dt-bindings: remoteproc: Convert imx-rproc to json-schema Date: Wed, 19 Feb 2020 15:27:37 +0800 Message-Id: <1582097265-20170-2-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:33:38 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1c090ec4-9273-4bb4-ced4-08d7b50e0b61 X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hjtRbsgIh5mY7TzzYXBh7zr83TrbKVKqoPiejgLFexsy9uE6F0PpnfsB/+lO+Tvzc/1pgPSSwtnZ9DE+mupqSgqa7T55jdXwY97AX05IdDJ3szgJTay0LLPrzWhKvMLmd/72/HL3cFoennhk2dB1C4sswZTitkqfgoZqxSqVOHeguExX+XC6bHzgRyEJYAk7Oo5jYZMjwWNYfktLIK9Vt3zCBKrzHKn13kOYnsTAgfmiEetx6Q3KrgTz3anPeCzRiPLIs3484OF5tYvDwTN+tjT09Jfg55DYIAFw0Io0AyT2LMY6zbiEYyxuKMez2RQQveHX1RTy3ZNXNl/onL5X53v9fJ9r2FiwYTiXcjvLdL1UzKa4vMhW6YHvBO1kI8Mi8Jy02yn2xq7N0cxVbZyQ1Rg1jZVMjQEkTdeRehU0NRKOOwEs1wc3UUc/9IlY2ePwiRfzTYK2EgVKXSNHL1SouF+G/VhCkD4Loa7t16tp6otUXAO8o0tOm1HeY8Je5wSOOiwzTJBbpTsBV00UEGsXrKDYnUNqloE8OXJ/T3fA3UkkoT2Vz1DGw+zFLb9FTns3isbfs69SYd4ycrqOzWdG8mR1pWvjo803mhKuw3zY4u7DMqrrcFq+1GDyExWo6MVl X-MS-Exchange-AntiSpam-MessageData: 8aRafuF9K9TX1lkudrBYNl3CGu2aW+bhfM33ZcUiXXuQh67b0pEQLbZAhMgTuZAbQBWrsFtTn2elrO0o0CPp6fSShQxZdhZhax9kQtjIz+0XscxubIRIErac4ZdBsR7khJNt6YJUlyws4z57Ak48yA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c090ec4-9273-4bb4-ced4-08d7b50e0b61 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:33:42.3622 (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: j63DnLekaJwUgp+jAHonQoNIMiCz44Nvsfvd/eTtTzqR6Z3EeGvingmbfObMjEZzMhr4DUaEt+KQsXXRsXv38g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Convert the i.MX remoteproc binding to DT schema format using json-schema Signed-off-by: Peng Fan --- .../devicetree/bindings/remoteproc/imx-rproc.txt | 33 ------------ .../devicetree/bindings/remoteproc/imx-rproc.yaml | 61 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 33 deletions(-) delete mode 100644 Documentation/devicetree/bindings/remoteproc/imx-rproc.txt create mode 100644 Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml diff --git a/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt b/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt deleted file mode 100644 index fbcefd965dc4..000000000000 --- a/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt +++ /dev/null @@ -1,33 +0,0 @@ -NXP iMX6SX/iMX7D Co-Processor Bindings ----------------------------------------- - -This binding provides support for ARM Cortex M4 Co-processor found on some -NXP iMX SoCs. - -Required properties: -- compatible Should be one of: - "fsl,imx7d-cm4" - "fsl,imx6sx-cm4" -- clocks Clock for co-processor (See: ../clock/clock-bindings.txt) -- syscon Phandle to syscon block which provide access to - System Reset Controller - -Optional properties: -- memory-region list of phandels to the reserved memory regions. - (See: ../reserved-memory/reserved-memory.txt) - -Example: - m4_reserved_sysmem1: cm4@80000000 { - reg = <0x80000000 0x80000>; - }; - - m4_reserved_sysmem2: cm4@81000000 { - reg = <0x81000000 0x80000>; - }; - - imx7d-cm4 { - compatible = "fsl,imx7d-cm4"; - memory-region = <&m4_reserved_sysmem1>, <&m4_reserved_sysmem2>; - syscon = <&src>; - clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>; - }; diff --git a/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml new file mode 100644 index 000000000000..12a5f3de38fb --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/remoteproc/imx-rproc.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: NXP iMX6SX/iMX7D Co-Processor Bindings + +description: + This binding provides support for ARM Cortex M4 Co-processor found on + some NXP iMX SoCs. + +maintainers: + - Oleksij Rempel + - Peng Fan + +properties: + compatible: + enum: + - "fsl,imx7d-cm4" + - "fsl,imx6sx-cm4" + + clocks: + items: + Clock for co-processor (See: ../clock/clock-bindings.txt) + + syscon: + description: + Phandle to syscon block which provide access to System Reset Controller + allOf: + - $ref: "/schemas/types.yaml#/definitions/phandle" + + memory-region: + description: + List of phandles to the reserved memory regions. + (see ../reserved-memory/reserved-memory.txt) + +required: + - compatible + - clocks + - syscon + +examples: + - | + #include + m4_reserved_sysmem1: cm4@80000000 { + reg = <0x80000000 0x80000>; + }; + + m4_reserved_sysmem2: cm4@81000000 { + reg = <0x81000000 0x80000>; + }; + + imx7d-cm4 { + compatible = "fsl,imx7d-cm4"; + memory-region = <&m4_reserved_sysmem1>, <&m4_reserved_sysmem2>; + syscon = <&src>; + clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>; + }; + +... From patchwork Wed Feb 19 07:27:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D614A1395 for ; Wed, 19 Feb 2020 07:33:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD880222D9 for ; Wed, 19 Feb 2020 07:33:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="LHulx4eq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbgBSHdu (ORCPT ); Wed, 19 Feb 2020 02:33:50 -0500 Received: from mail-eopbgr00078.outbound.protection.outlook.com ([40.107.0.78]:44169 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726163AbgBSHdt (ORCPT ); Wed, 19 Feb 2020 02:33:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nwl2WDnhWHSktyYMtgf3eYRJvhOW5RFm/qLijcNknvESgnYhTO82p9+dVbTqUvPOBpfFRp1DWrUcTql7UjaKQPkS7OVxhe157QGXysAPgteZCRmw6O7LcVSc9s5GRPFBijA/ygWmYnxMg+Xy8FSvPpPK5BU/7SDRFfXZV9Vnag8ZItma7Mis1l2zIAlmr9dY8l6vAckAdvDx2G5awEFgjao7XTbFOPYBBapg+nAHeXwfCN8DIdymB4vctGQ0Bave/GAIa/wmG8sDsFdNa2RiNbE40x5kOo5V2OqL1Ja9ECZ+rFibrTvGx12ID0qHDFs1t7QaYI8KC6JTPYsEQQtHmQ== 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-SenderADCheck; bh=8MJu2Gqo9PEPupr/NB04nKB7lM0ivhY3/SZe4/3Nzvg=; b=BrRpEhg10itNzpttIwiDDEwLetdg5MDswnoaXc3gM9Pm1UJdfDoLaNvqJMlInY/VN9pQFFs9UcFq2gmPRgFDH1PzAsjYts/yLwicpoDSlEemDosla77Uv+T3Wsl/9p/nqUm1qepMhWhcXK3mIzhV7YNagKQTB33wMiVPIhWqA9zEa4vACj0ba8yXF2eULmRV8n3cxg8riSs48SmJ11kGbT3MNZMO+sXnptDuQZCixV7NdVnAt5JWE30HUePhf69z/BXkJa0E0ZTi6k5sj5dZMo4bbohiyBeKVGlwRpQW+rSszf4P5N7Wpt29kteAzxeN6NHM2oauscQpjquOSOrhnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8MJu2Gqo9PEPupr/NB04nKB7lM0ivhY3/SZe4/3Nzvg=; b=LHulx4eqdGUks/B0R+eRHEBE9hXarPYnkXMRdzD5WBTGivOncpqbZk3IOFS5NsqiQ+PzODoWY5On6d1KXX2tY0Vo2C6M/d0z2V/83fxfo3M2OF0BNIrZtGYjTB/YmkHmBBIABfX790ZBAlW29nxW4oWOizXVKjoFDQKMITx1roE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:33:46 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:33:46 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 2/9] dt-bindings: remoteproc: imx-rproc: support i.MX[8,8M,7ULP] Date: Wed, 19 Feb 2020 15:27:38 +0800 Message-Id: <1582097265-20170-3-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:33:42 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dc12d2a7-7da0-4fcf-4cb6-08d7b50e0dc9 X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(6666004)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rtdf1Do9hVjh8HcjRO+N03E3Tl+8cEq7cD6KNB6j3zcBq4Zk+qlqRAGDFQqd3AeiuhhmkQYTAa2qhnT0pY+lrUOHG+/mlAjkpgmcPp+5v+gV1wIxYQNhUg5X+rlXaltpkLlOW20neeS6PDZ/L+fmvqwNJDb72HkDU2qUzjjNho+jZ6NWConOvRUYXF7ITNDtRbUMdYLg+b6QjoaIDMHKVF1HKdbwWPmbI4RdZa+/xhxc1fy5bj2qHlm5zfCrLZGrCg/Aeh/Nv/oroTEzvOGwEF2Uatu3kthxKyTokzWOe6o+efUv6oFTAzUuv5e9ajZ80ZqsF9RPCpMQ/d66RAULza5Wq3neuMn42UMEjxLxq6MxPRFwaKup62pMNOypGsxGC3TdfUKDV1wC06fwJw4intEzJRpKY65+5kZjK8fYN3BzLW9+bfy80OpwZBS3lbVFu0W7+eCUVaJCSLRmo03uIfIWtgdwoh6dmC7U7n6jofsqR0u8Gt27Zyfd/Vg/2wWYKfE+dqs1XlGnd2LBHlB5PzuMLmmlihgw0t+eL2qO9cg= X-MS-Exchange-AntiSpam-MessageData: 24Nfrdg+XD2VIjvLHMzSYkIgLCwQSt462Vann5SCQmEOVL0foQTQ1uoG3g7Kks4zDSqYzpBFbxrDH/QX8nEqFBwAmK203lMqd4ZhwZtXpZI3qynPwBHJK1jdHH+ZqIeFzIR7WNSPK2zzWBV7KnsGmQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc12d2a7-7da0-4fcf-4cb6-08d7b50e0dc9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:33:46.3399 (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: ox/EimDem/RbtzZQ+TzzgPLxeOPRnbBw8+K2d5Ip9xFXjZ31rc3PCmvuEIsuL2l0RXNq/nx5LqETEOw5/5HAAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Support i.MX8/8M/7ULP: - Introduce early-booted property for M4 booted before Linux - Introduce mboxes for rpmsg/virtio to communicate with M4 - Introduce mub-partition for hardware partition supported by i.MX8 - Introduce rsrc-table which hold the resource table Signed-off-by: Peng Fan --- .../devicetree/bindings/remoteproc/imx-rproc.yaml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml index 12a5f3de38fb..be708130d5c0 100644 --- a/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/imx-rproc.yaml @@ -19,6 +19,12 @@ properties: enum: - "fsl,imx7d-cm4" - "fsl,imx6sx-cm4" + - "fsl,imx7ulp-cm4" + - "fsl,imx8mm-cm4" + - "fsl,imx8qm-cm4" + - "fsl,imx8qxp-cm4" + + early-booted: true clocks: items: @@ -30,11 +36,39 @@ properties: allOf: - $ref: "/schemas/types.yaml#/definitions/phandle" + mboxes: + description: + This property is required only if the rpmsg/virtio functionality is used. + List of <&phandle type channel> - 1 channel for TX, 1 channel for RX, + 1 channel for RXDB. + (see mailbox/fsl,mu.txt) + maxItems: 3 + + mbox-names: + items: + - const: tx + - const: rx + - const: rxdb + maxItems: 3 + memory-region: description: List of phandles to the reserved memory regions. (see ../reserved-memory/reserved-memory.txt) + mub-partition: + description: + The remote Co-processor hardware partition which is only valid for + i.MX SoCs with hardware partition feature. + $ref: /schemas/types.yaml#/definitions/uint32 + + rsrc-table: + description: + Resource table array is required only if the rpmsg/virtio + functionality is used. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32-array + required: - compatible - clocks From patchwork Wed Feb 19 07:27:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390485 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26112930 for ; Wed, 19 Feb 2020 07:33:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2C262176D for ; Wed, 19 Feb 2020 07:33:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kTBKUSFE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgBSHdy (ORCPT ); Wed, 19 Feb 2020 02:33:54 -0500 Received: from mail-eopbgr60089.outbound.protection.outlook.com ([40.107.6.89]:59040 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726163AbgBSHdx (ORCPT ); Wed, 19 Feb 2020 02:33:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O+1R8zP4ZeWRwjJYN4W0F+D4jWmJyznrNZATteGMdZPCiLPUpThexAo6W4AHUeK5oDS0Gdu0jBymWg3J+VH29I5DPHirEMWjoB4lkv7i0gjVqSKaniS8hzdtjyj/HtMq1xwKPMX6w3nb09ErF4vjaQqSTyxJbk6qeR6ymWoSNMbMRYa24mkaFqL/Bfg7bA/fbgAMxAq3/11a9JyXPtCFUrLMF5gZ/gBlvJI8F4reehzdjRQqk1vrqMRQwHWhFwtj8ZwxsmALWZ2M0Ffhczt9mK0RdiiYqxt4NFWx4TBxnFrZ15clOa3BuhvCk1CytG7tL6HUq3PiFb+xEYVamEbVuw== 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-SenderADCheck; bh=+qCILug04ayhEfedFyILsM0cXXdxMb0n+5FQBhiCtvo=; b=kmQE6EGLhdgKcb+PlpgHB0+8cNeNYwcNAMM3MvtawHuR/zKP/wEKHRtlPi2bHqhH8RtD+X+S/R6OZMWtqCa+0jqMdQ5VLeN9kS+zey9sA9nUx5522uoadvCLZrKi9t0eeI5kpFItcmaOkIBZwjzHzBuL66AIjbIrWMvUYbH3+7SboGKea+6VhzrpSIqaNBNcnnsNIyYIbalydqOMV4c5D8ErRb/ZMMzFvvngQBIXqysCQhWc3zEWpQqUkA3yZXeDcHD/awwk8zEU66wu3fF/7fgAZyTBUQSf4Hm65ozd3Z8tmonviwrF0nkg0jRIrJeDO3FqzQxFEBuzV4mdT7pX+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+qCILug04ayhEfedFyILsM0cXXdxMb0n+5FQBhiCtvo=; b=kTBKUSFERZVNTrKCdzLjGmo+d+bFw+30BQJ6WugXtt4ujWB4wjmv+FXFCBjvRovnYwDBjtAh6sgYK4jSNUqBp6SloyZPUwpX+0GfwuV7wXGN3tNfByepeUBzqEmHzBJqitJfK37N5r2aKsldFe9eW/NQ6TYfGuxOI84Kf5Hq5tg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:33:50 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:33:50 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 3/9] remoteproc: add support to skip firmware load when recovery Date: Wed, 19 Feb 2020 15:27:39 +0800 Message-Id: <1582097265-20170-4-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:33:46 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 13e3cbc9-b313-46e1-1dd1-08d7b50e1026 X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:568; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(6666004)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1I6HbkX6Ll/Dm/0MgNppX+vD54De+DaHoCUDBj1OThOlti9GLYfXGGOUJPeOpDypnQSTxDRIYFKrPKwZyXV1WhGoorhwPOC5EESB+jSubFqVjLmeSQH5ziCiFrDMzL7se27BHKouJHCDZwIZvd0ES0GH2YpcG9Zhk+GYAbVzshwrZeycGxuYZUGJmnFOb21WGXmCff4FQL6GagfrP7Pvil2ks8mAEXBq+hrG9Y+QedZbc5lZS232fjVEQB8cOE0vUsXgxg/UZlbAKf8z3928oxQjDqE/hqp8LBEMRH5gqXkROQW8h0wZyz3kLQ4munSy/4eAaGTjUcJq1R6NnXMfKzNzwUEMDYe3KxyZIiFu5zpv0wtbc7sFh2KBnTpvj1K9L/JKhxnjHG/PHaf22EnjFPhE/kheyO+ZW2GoOT1okZL1g4C3+6//9tc+QyX4UAQL8mEg1w8oQepm+WCFLutgO4BZoVZjEnlW3u7I0ooNFO6KxuNT5TZvS6o5mdrkbSt2mOOSvmKY8lScFG8ii+VrMK1ldWBwuHDT7Dg3Ae4UnC0= X-MS-Exchange-AntiSpam-MessageData: /SCSUIRJHQLQY6XpjGsXwoGiyDG2RzPGBBldfAnDb16BwMcyGxjDTN7jVn2hCUk12kuXoY+1YJTd2N616rcMhrbK6FI4lcHELBUF4WbU0lQUlvaOlIUf4bDpYu8dv2J+ms/8/K9/c+SSe4qCf9uJQQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13e3cbc9-b313-46e1-1dd1-08d7b50e1026 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:33:50.2906 (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: bskIFBC9QqxDLcNAOAz3VgsR2GPMhUAQwPsPWjCcJc/1Y+CbJ45EKQkVeh4ej6v/ImhTDNdzyCKdcwLgEPV1bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Remote processor such as M4 inside i.MX8QXP is not handled by Linux when it is configured to run inside its own hardware partition by system control unit(SCU). So even remote processor crash reset, it is handled by SCU, not linux. To such case, firmware load should be ignored, So introduce skip_fw_load_recovery and platform driver should set it if needed. Signed-off-by: Peng Fan --- drivers/remoteproc/remoteproc_core.c | 19 +++++++++++-------- include/linux/remoteproc.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 876b5420a32b..ca310e3582bf 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1678,20 +1678,23 @@ int rproc_trigger_recovery(struct rproc *rproc) if (ret) goto unlock_mutex; - /* generate coredump */ - rproc_coredump(rproc); + if (!rproc->skip_fw_load_recovery) { + /* generate coredump */ + rproc_coredump(rproc); - /* load firmware */ - ret = request_firmware(&firmware_p, rproc->firmware, dev); - if (ret < 0) { - dev_err(dev, "request_firmware failed: %d\n", ret); - goto unlock_mutex; + /* load firmware */ + ret = request_firmware(&firmware_p, rproc->firmware, dev); + if (ret < 0) { + dev_err(dev, "request_firmware failed: %d\n", ret); + goto unlock_mutex; + } } /* boot the remote processor up again */ ret = rproc_start(rproc, firmware_p); - release_firmware(firmware_p); + if (!rproc->skip_fw_load_recovery) + release_firmware(firmware_p); unlock_mutex: mutex_unlock(&rproc->lock); diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 4fd5bedab4fa..fe6ee253b385 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -514,6 +514,7 @@ struct rproc { bool has_iommu; bool auto_boot; bool skip_fw_load; + bool skip_fw_load_recovery; struct list_head dump_segments; int nb_vdev; }; From patchwork Wed Feb 19 07:27:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E113930 for ; Wed, 19 Feb 2020 07:34:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E816C222D9 for ; Wed, 19 Feb 2020 07:33:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="B66giBbp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbgBSHd7 (ORCPT ); Wed, 19 Feb 2020 02:33:59 -0500 Received: from mail-eopbgr60063.outbound.protection.outlook.com ([40.107.6.63]:54262 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726163AbgBSHd7 (ORCPT ); Wed, 19 Feb 2020 02:33:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nSbWm5V7ueIVe6oi1Wtjj64J9t6wCMkSRL4eXXjfvtKsFSr5PYw+PMY95SqJQMnHm4nj/ZsoMOsCNYxeiAz572hKKQzU5MQ2RNhViGI/XW5CVKRbCBonK1I28BlufgieAraiO8XeEV+zLugH38/djbJWhOD9TNyrKh0f/rBe/OUYRzE+U8YdhWBwyHqzPzxsJEhtNNuXEEEYUSGyCAM+y/H5SesNFXXmQaGcmZRR7kItep/AMPnv4wBaktk2+l9DoOxXsCYZ3oZ4lKGyNy2krnAKzdGeENTq/gHvam0MlAFtQbwtUn8SaHvALRzjhO0dDVb1UxCspbiQOwMDu7tO5g== 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-SenderADCheck; bh=3Mg3lyAdZT3dDrqLGc/wWfuzj9BY+McWIN4feT5+PRs=; b=NId0WqHe1Y/MvZ1dkwdj2mTa3MDd53q0F+NyEuh8Py/enqPR1LG+LFUy2ULRFeScTvi8dJl6S8ATtUbu252jSJ7mE6Nth9zI+IBkJCm1VEjnTXjxPD/xuaAvayROtpuhJrhRoMnqkN2gIxy43vLejUIu+cQ65+B/cnp/70/QH9L/0q6b8ByFP1b7kw5xptJXydTVHIHbO3jdZr8d+5Da2L7ZP5+IA+MpU70psKKtT0yBNwc1k3S+R8EAU07PH6tmtHAMb59ucXjU7WGZbNr2JJVDvsGAKLbrbDVs5+pSGwR3qPypojBQdRMMeC3HmJSfDqd63n81i5bPqUP02DDEfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3Mg3lyAdZT3dDrqLGc/wWfuzj9BY+McWIN4feT5+PRs=; b=B66giBbpYolGhOu5K1iQbAQOmYhUyBJrk/roxZFCX6rHF5S3402E+hFZVagTArIJxKUfbOS/3VXRnCeoSKieOvPhZRcPI7pjnInWXdyi/IVygk1WGjVtOOEPmaaVv2IggrFhPzjq9dYMA4j2zR/hebyWL/IopO0uectnwDona10= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:33:54 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:33:54 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 4/9] remoteproc: imx_rproc: surport early booted remote processor Date: Wed, 19 Feb 2020 15:27:40 +0800 Message-Id: <1582097265-20170-5-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:33:50 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b41eb06e-d249-4076-7c60-08d7b50e12d8 X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:525; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(6666004)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QDI6bReplngS3yC+XMf8XvdkEnaScbQqxSebSMPF8HI9dR6qnAdWPiEjxChIgvUlvZ2DRFjDOX97wJThqjz6B8h5vBJJ64LVfJRFB6qdL5KpyoETZm/n7NfV1v9Vvz+GVJ9oIAWq+93/+75y2eprPH3bb/hCsYOifhmtsEfqrcf1z4OegQpyKOdl+dJqeg3SysCptXh2mjZsyLKJdI3pZORb0pfmHdP2PBU3ukJ8AqQV5BWsaKGeZjt39eghW+tvBTypFbgE4wN7wTcyX0gkgDUuuPXYkDJMTby6b+a6e19CindRSBK+Py4fcFduSsdzsUdCmRHyPFn31cP7S1n5A9uVBHAZT/novtAHrfF3YHQlWS7qccl7BSh6Vm8fggx6zBUErolLSPAMwfGKs8MM5kxc3vKeOFIKXfS86MqB9VfqyY5bgprGrYYf9O6k5N7PrIIIHE9cEgN4N3NDbIRY88mNbVrIGc8X1B4iBt6sE0G+e2OuHd/lq3+ngkfUm1JJBN5S3/1xnce5EgTI3IF7JDZIrz1E1caYmZs9sJDhQUs= X-MS-Exchange-AntiSpam-MessageData: kKuZoOzXRqxasYxpRAiZBHlbgyCZts53UKGdo7ZdVA6niRno4vnsXDuupfQyNS3kd2Un/rVQopgOR3soInZ7XP/Z8yQO6nWB1lOPeOtJcDjBItNg3Eo7S/BDfvqnYt2uIpOx5fyyowrlxTo5NibZcg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b41eb06e-d249-4076-7c60-08d7b50e12d8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:33:54.8220 (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: /bWEmLXBFIuUyqmGdP+aAm4wMao8qv04J6ceUoAYhgoe2fUziXuvEhBWRX6tbF6mZCUZd9XdGC/RM/SojAMFpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan When remote processor is booted by bootloader, Linux need to ignore firmware loading, and ignore remote processor start/stop related hardware operations. what should do is to need to handle memory-regions and resource table. Add a src_started entry to check whether Cortex-M4 is started for i.MX7D and i.MX6SX. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 240 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 220 insertions(+), 20 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 3e72b6f38d4b..b9fabe269fd2 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -74,6 +74,7 @@ struct imx_rproc_dcfg { u32 src_mask; u32 src_start; u32 src_stop; + u32 src_started; const struct imx_rproc_att *att; size_t att_size; }; @@ -85,6 +86,7 @@ struct imx_rproc { const struct imx_rproc_dcfg *dcfg; struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; struct clk *clk; + bool early_boot; }; static const struct imx_rproc_att imx_rproc_att_imx7d[] = { @@ -142,6 +144,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { .src_mask = IMX7D_M4_RST_MASK, .src_start = IMX7D_M4_START, .src_stop = IMX7D_M4_STOP, + .src_started = IMX7D_ENABLE_M4, .att = imx_rproc_att_imx7d, .att_size = ARRAY_SIZE(imx_rproc_att_imx7d), }; @@ -151,6 +154,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = { .src_mask = IMX6SX_M4_RST_MASK, .src_start = IMX6SX_M4_START, .src_stop = IMX6SX_M4_STOP, + .src_started = IMX6SX_ENABLE_M4, .att = imx_rproc_att_imx6sx, .att_size = ARRAY_SIZE(imx_rproc_att_imx6sx), }; @@ -162,6 +166,9 @@ static int imx_rproc_start(struct rproc *rproc) struct device *dev = priv->dev; int ret; + if (priv->early_boot) + return 0; + ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask, dcfg->src_start); if (ret) @@ -177,6 +184,9 @@ static int imx_rproc_stop(struct rproc *rproc) struct device *dev = priv->dev; int ret; + if (priv->early_boot) + return 0; + ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask, dcfg->src_stop); if (ret) @@ -240,10 +250,167 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, int len) return va; } +static int imx_rproc_elf_load_segments(struct rproc *rproc, + const struct firmware *fw) +{ + struct imx_rproc *priv = rproc->priv; + + if (!priv->early_boot) + return rproc_elf_load_segments(rproc, fw); + + return 0; +} + +static int imx_rproc_mem_alloc(struct rproc *rproc, + struct rproc_mem_entry *mem) +{ + struct device *dev = rproc->dev.parent; + void *va; + + dev_dbg(dev, "map memory: %p+%x\n", &mem->dma, mem->len); + va = ioremap_wc(mem->dma, mem->len); + if (IS_ERR_OR_NULL(va)) { + dev_err(dev, "Unable to map memory region: %p+%x\n", + &mem->dma, mem->len); + return -ENOMEM; + } + + /* Update memory entry va */ + mem->va = va; + + return 0; +} + +static int imx_rproc_mem_release(struct rproc *rproc, + struct rproc_mem_entry *mem) +{ + dev_dbg(rproc->dev.parent, "unmap memory: %pa\n", &mem->dma); + iounmap(mem->va); + + return 0; +} + +static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) +{ + struct imx_rproc *priv = rproc->priv; + struct resource_table *resource_table; + struct device_node *np = priv->dev->of_node; + struct of_phandle_iterator it; + struct rproc_mem_entry *mem; + struct reserved_mem *rmem; + int index = 0; + int elems; + int ret; + u64 da; + + if (!priv->early_boot) + return rproc_elf_load_rsc_table(rproc, fw); + + /* Register associated reserved memory regions */ + of_phandle_iterator_init(&it, np, "memory-region", NULL, 0); + while (of_phandle_iterator_next(&it) == 0) { + rmem = of_reserved_mem_lookup(it.node); + if (!rmem) { + dev_err(priv->dev, "unable to acquire memory-region\n"); + return -EINVAL; + } + + /* No need to translate pa to da */ + da = rmem->base; + + if (strcmp(it.node->name, "vdev0buffer")) { + /* Register memory region */ + mem = rproc_mem_entry_init(priv->dev, NULL, + (dma_addr_t)rmem->base, + rmem->size, da, + imx_rproc_mem_alloc, + imx_rproc_mem_release, + it.node->name); + + if (mem) + rproc_coredump_add_segment(rproc, da, + rmem->size); + } else { + /* Register reserved memory for vdev buffer alloc */ + mem = rproc_of_resm_mem_entry_init(priv->dev, index, + rmem->size, + rmem->base, + it.node->name); + } + + if (!mem) + return -ENOMEM; + + rproc_add_carveout(rproc, mem); + index++; + } + + /*Parse device tree to get resource table */ + elems = of_property_count_u32_elems(np, "rsrc-table"); + if (elems < 0) { + dev_err(&rproc->dev, "no rsrc-table\n"); + return elems; + } + + resource_table = kzalloc(elems * sizeof(u32), GFP_KERNEL); + if (!resource_table) + return PTR_ERR(resource_table); + + ret = of_property_read_u32_array(np, "rsrc-table", + (u32 *)resource_table, elems); + if (ret) + return ret; + + rproc->cached_table = resource_table; + rproc->table_ptr = resource_table; + rproc->table_sz = elems * sizeof(u32); + + return 0; +} + +static struct resource_table * +imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, + const struct firmware *fw) +{ + struct imx_rproc *priv = rproc->priv; + + if (!priv->early_boot) + return rproc_elf_find_loaded_rsc_table(rproc, fw); + + return NULL; +} + +static int imx_rproc_elf_sanity_check(struct rproc *rproc, + const struct firmware *fw) +{ + struct imx_rproc *priv = rproc->priv; + + if (!priv->early_boot) + return rproc_elf_sanity_check(rproc, fw); + + return 0; +} + +static u32 imx_rproc_elf_get_boot_addr(struct rproc *rproc, + const struct firmware *fw) +{ + struct imx_rproc *priv = rproc->priv; + + if (!priv->early_boot) + return rproc_elf_get_boot_addr(rproc, fw); + + return 0; +} + static const struct rproc_ops imx_rproc_ops = { .start = imx_rproc_start, .stop = imx_rproc_stop, .da_to_va = imx_rproc_da_to_va, + .load = imx_rproc_elf_load_segments, + .parse_fw = imx_rproc_parse_fw, + .find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table, + .sanity_check = imx_rproc_elf_sanity_check, + .get_boot_addr = imx_rproc_elf_get_boot_addr, }; static int imx_rproc_addr_init(struct imx_rproc *priv, @@ -309,6 +476,31 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, return 0; } +static int imx_rproc_configure_mode(struct imx_rproc *priv) +{ + const struct imx_rproc_dcfg *dcfg = priv->dcfg; + struct device *dev = priv->dev; + int ret; + u32 val; + + if (of_get_property(dev->of_node, "early-booted", NULL)) { + priv->early_boot = true; + } else { + ret = regmap_read(priv->regmap, dcfg->src_reg, &val); + if (ret) { + dev_err(dev, "Failed to read src\n"); + return ret; + } + + priv->early_boot = !!(val & dcfg->src_started); + } + + if (priv->early_boot) + priv->rproc->skip_fw_load = true; + + return 0; +} + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -347,27 +539,33 @@ static int imx_rproc_probe(struct platform_device *pdev) dev_set_drvdata(dev, rproc); - ret = imx_rproc_addr_init(priv, pdev); - if (ret) { - dev_err(dev, "failed on imx_rproc_addr_init\n"); + ret = imx_rproc_configure_mode(priv); + if (ret) goto err_put_rproc; - } - priv->clk = devm_clk_get(dev, NULL); - if (IS_ERR(priv->clk)) { - dev_err(dev, "Failed to get clock\n"); - ret = PTR_ERR(priv->clk); - goto err_put_rproc; - } + if (!priv->early_boot) { + ret = imx_rproc_addr_init(priv, pdev); + if (ret) { + dev_err(dev, "failed on imx_rproc_addr_init\n"); + goto err_put_rproc; + } - /* - * clk for M4 block including memory. Should be - * enabled before .start for FW transfer. - */ - ret = clk_prepare_enable(priv->clk); - if (ret) { - dev_err(&rproc->dev, "Failed to enable clock\n"); - goto err_put_rproc; + priv->clk = devm_clk_get(dev, NULL); + if (IS_ERR(priv->clk)) { + dev_err(dev, "Failed to get clock\n"); + ret = PTR_ERR(priv->clk); + goto err_put_rproc; + } + + /* + * clk for M4 block including memory. Should be + * enabled before .start for FW transfer. + */ + ret = clk_prepare_enable(priv->clk); + if (ret) { + dev_err(&rproc->dev, "Failed to enable clock\n"); + goto err_put_rproc; + } } ret = rproc_add(rproc); @@ -379,7 +577,8 @@ static int imx_rproc_probe(struct platform_device *pdev) return 0; err_put_clk: - clk_disable_unprepare(priv->clk); + if (!priv->early_boot) + clk_disable_unprepare(priv->clk); err_put_rproc: rproc_free(rproc); @@ -391,7 +590,8 @@ static int imx_rproc_remove(struct platform_device *pdev) struct rproc *rproc = platform_get_drvdata(pdev); struct imx_rproc *priv = rproc->priv; - clk_disable_unprepare(priv->clk); + if (!priv->early_boot) + clk_disable_unprepare(priv->clk); rproc_del(rproc); rproc_free(rproc); From patchwork Wed Feb 19 07:27:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDC731395 for ; Wed, 19 Feb 2020 07:34:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A99C24673 for ; Wed, 19 Feb 2020 07:34:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="cpUsehBi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbgBSHeD (ORCPT ); Wed, 19 Feb 2020 02:34:03 -0500 Received: from mail-eopbgr00077.outbound.protection.outlook.com ([40.107.0.77]:19013 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726773AbgBSHeC (ORCPT ); Wed, 19 Feb 2020 02:34:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kt5qiLl2Bp9upIQy3B3Kiostporw7/xzzCko72qVPGj0nekSC5kCihf8JaulukSL3Tch3IMQ44ABc+t7NtI4d/8sW9LIIjPM7VIxHOfxKSAZ9sAmyS3ntrFd+gqU5GMm5FWegE9g3VltyRlDhPl9LyYY2cSlkYBHCAZ/WhhsnX2Hv5RjebW3KAbdm1yF2urMz4WuxAm1imyfcu4Cecx2rEpim+O1f6H+6NAjKqRq2tzhTkpvMxM3mgs3Yl8Gbf0SWln+GpPEbPLo1ceuWuhR+EfuYYxOOu9Obp7G4Xe9GVMauJ7aqDQCUtbkm8Thcx47KujAMAmiJnt07VdBzdHicg== 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-SenderADCheck; bh=U5jq8+36WVgT+n17P/obSsXiSnkHmjmfHVw/sIPza8E=; b=bSgavM5l7iPUNIZz68UtNlz4jCurkx5eDIkVAH8n1l7eRZgjYqv3d32GEkyDAOqbbKlVLccZGC6LhmKFZJ7Uh9n+N95N3Opc2kmxp1aitZp5Yf9PZPUec9rwP9vQEteR7uKVIwSz+hPdkj2IOC0LUhGIf1zC6dVVqoM0K1CpFb54jz3MJRoIeM9ifwBKig+6Ps2Tp17GGz9bxZilkzKCcrfLNleDfI1pjg/7OGvNAcBzjTnPtru4BZbKi4v+oxi9Xi/05Zgow4i9klzo2q57eu8PP92Qjif4AO50FpC2edS+uOlN3K92M8flJ1+1xfc2kfvusszDJO2F/mTjGyuhNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U5jq8+36WVgT+n17P/obSsXiSnkHmjmfHVw/sIPza8E=; b=cpUsehBiyuioQyr36nGf4sOPMR6D+2pElStjihhqsWhZPXXZfkiEReG1b+HaWeWL/nw4S/dkBOZfEmEfSb62xXPfzfLUQnu2UQca3/edJphcNZ32Q341VgPqAtoKDmeBXU81bEBIW+DAqEZIxpLxJB7hdNiFBpKTqNC/uAEwIjA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:33:58 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:33:58 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 5/9] remoteproc: imx_rproc: parse early-booted property Date: Wed, 19 Feb 2020 15:27:41 +0800 Message-Id: <1582097265-20170-6-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:33:55 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3bdb16f8-3dba-413c-37af-08d7b50e1536 X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:494; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(6666004)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5qhjnVEagW8b0q97ZxY7hSByPV6twZvpNxcgLZ8TfIgLOFcM5c2UB5aoYALicFgTfcRggmvxQfnhXxmrc8/RPB3JW3Cuzv9y0JuyeDXyLhivcFgjUplBX6vfzynfyFwc75/KTGTyGhacir5e0iuToQVrlmLie2JKgyxD9Db1yvARgIlJIy2w2U34kfssWA6HmGn9k/276b+MhxpIG8qxyqyYBZYmOQNkQhBx/pYnDYbxNpVDLTTtKnuo9CRX5N6IZk+iw/Mn5hz2whVVhGX/0d1WHFx+4HWDJExKnqPXAKXBuwVJmIAMyfa59Rq37a5sIB9eWgWwiO73sFp3VsIIH/50gWK0EN2Wm/DSN1w5g7O+B9aJdgzKnoCvrbfkTqdkwYSazxogcX2oVU0pT1SwqcseVsoaQ2uF3+p0q6LH3YhvRy8VQKGTtcaGVd3W3HgemZzXYsxlCw+TwhED+ns45fXIdI/T1YAm9/Cr+CiOpSQwGV4TAydjJA72jebUZ5YznoJZUzOk9klCZc/PXptQiyFBY9EdoLblZsT68cNz8CA= X-MS-Exchange-AntiSpam-MessageData: 1jVSRoABYLryi+FMw4FW9djwboMPNAduuHVAV71b7CzjK6VKLy5JY3ZJwMKvLdmcs9UXaA9Xnge1earNjIkSD3G+RTqVPGRhlFPmn+A9rmzRbzqldhLf/MEPmsymf9+DP7HwJhcMfKmLPjTbCKLi4Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bdb16f8-3dba-413c-37af-08d7b50e1536 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:33:58.7708 (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: fx9Vu+CW8BuLnv6QtzRH79MpfQnaaj4aREVbRz6emNCHVu20PQni2ZLtVt/G3nni52FcF2ieTUHqsyaINKRiwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan If early-property exists, there is no need to check syscon. Just mark early_boot as true. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index b9fabe269fd2..e31ea1090cf3 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -483,7 +483,9 @@ static int imx_rproc_configure_mode(struct imx_rproc *priv) int ret; u32 val; - if (of_get_property(dev->of_node, "early-booted", NULL)) { + if (dcfg->variants == IMX7ULP) { + priv->early_boot = true; + } else if (of_get_property(dev->of_node, "early-booted", NULL)) { priv->early_boot = true; } else { ret = regmap_read(priv->regmap, dcfg->src_reg, &val); @@ -509,15 +511,17 @@ static int imx_rproc_probe(struct platform_device *pdev) struct rproc *rproc; struct regmap_config config = { .name = "imx-rproc" }; const struct imx_rproc_dcfg *dcfg; - struct regmap *regmap; + struct regmap *regmap = NULL; int ret; - regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); - if (IS_ERR(regmap)) { - dev_err(dev, "failed to find syscon\n"); - return PTR_ERR(regmap); + if (!of_get_property(np, "early-booted", NULL)) { + regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); + if (IS_ERR(regmap)) { + dev_err(dev, "failed to find syscon\n"); + return PTR_ERR(regmap); + } + regmap_attach_dev(dev, regmap, &config); } - regmap_attach_dev(dev, regmap, &config); /* set some other name then imx */ rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops, From patchwork Wed Feb 19 07:27:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390517 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89FFF1395 for ; Wed, 19 Feb 2020 07:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60F072176D for ; Wed, 19 Feb 2020 07:34:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="LJgbdR2u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726163AbgBSHeG (ORCPT ); Wed, 19 Feb 2020 02:34:06 -0500 Received: from mail-eopbgr00045.outbound.protection.outlook.com ([40.107.0.45]:42040 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726824AbgBSHeF (ORCPT ); Wed, 19 Feb 2020 02:34:05 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nsJkl4Z2f9wywLy1W9rxfKuEY0f4aALnZV7LSUTu0bM30zPnfYuSzFhkUJO8GTnd9TIFk7JcMezm15BSmE2nTvyB4Dy9U5/V84RVgGm8XAoWNGvhIHSrsnn+BFJaGHbYqJLMP2k+cUerWTJgvTVr66fl+qEQQZkVBYtvsJqGZ+irk6bhRPQs9GJZczVb+2Zffy3ZOsvKm7cpZ2LVOOt06ZOWrBE+9Q1Dylu3+eQsUgYQ/XJ5vs38tLM1I8xxa0AlBATLvmVIyZFJda92i/wO4tg3G/MDDOuURU1TnD8cRBP52UwyT2PHQYoh4pTqgaBMq01DgTRJiZjjJnSxGqs3WQ== 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-SenderADCheck; bh=2hLsZGc0Jz3fvBUSAmJFwrydvGi0DthVlRqJf1pLuRc=; b=NmQpLswZ+H/LdDBaJp1WQL1BmN3kO99Aeo+0o4oBHKdekdmj5PprR3F1vYvpcvtTCZRU0T9uyfHNX5T9OnE8pceS3tNe50uziVZQVxAfZdiaM+Iq0d6YVUKzKh5hrAYYtLoExopft644/r+Y1yMRul1y/MjLQEWaP/9ptgcrWobOHef3v2YFi2Vb1xeLnMXIwl1oLVOfYwggF8ME0eu+VCZOA+wBQ4YydVtc215QDoa4kKz554SQWxGWq1yOXK/EEGhHoGWcXdAGyJaB0v6P+rfkENtzo4fR3CRd62vM/etWSvcC3iEscHlJVKXprUe4K/PW42r2gQQykgykSEJOuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2hLsZGc0Jz3fvBUSAmJFwrydvGi0DthVlRqJf1pLuRc=; b=LJgbdR2uwnmxr2OqEQug1poU3/QTEtZeMkhvDgG6/w4yTNBDOLacZsNUreFFl5gJcF+N0PuDqg7HRA4WMtEQwSRwhAqH1SAr74Pe1Df6sDu00vDm3nnXyrr1jjnmtyaTe2GYRT9YsP1AXFMs531WF9GDgjQ9H6HvKacYajArJiU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:34:02 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:34:02 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 6/9] remoteproc: imx_proc: enable virtio/mailbox Date: Wed, 19 Feb 2020 15:27:42 +0800 Message-Id: <1582097265-20170-7-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:33:59 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: be00a042-42f9-46d0-b244-08d7b50e178d X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(6666004)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(15650500001)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /55s+MllzGW+3en6ZYB3ZdcElytS7M/AJz6gFpbxzfe4kFRbkH2wKoSc7Xwj1CICrD1sCWzgGN9gDImX8dw8dbyoLoGLmHEnEvvIUpMCIEvvrbNPGlFRA4kVxaIzrHFQlg4olXIRqAtTejONr3SiDh/M70X6+0rAxSOpRsuZrvRFQqq1ll5p+23UKYE/BEsBogxH3B+JjMhx01LZJhn4LDatOhZj3AIf+T/8exn5WXqJCFjUt1KZ0vZ0w608oi+r5d5wZ5jS2wyxB0uTm6yvWvhQY9bG2lWLqUAF68gc0bMf2ekkFK4/9+s/56oWa4J1sRBRaZwF4L2TpZL1g4ejo+OqgqrgRKel5tM68ZLLbgikel7fbIcGLTk6qF+IbK3z57tQBsRYNUQtvE0D9J2WGNgrUh5vY3KFLqxYqtNLCmLDu2Ifc1SRWF6w75AF3/83ZX4X0juGPcLLe3bbJE7vvfbuLBJrx4pi7HWpR3l/TL3AmmxyGTkd0M9WZUu2fxh7pWugNsh7iSX+PFYksID0Ny+1l/x5xVQP066tQrHfcqs= X-MS-Exchange-AntiSpam-MessageData: ljBgqsrmu2AcDFZQgrmZZxsPVtqtD4owed6+YXs0uw5duEnYF+/K+1BH9ZWeSql1LiJlKC1N13snvZ5xct3c6Pa45zRes27ewHCshTdHGUtve5JiWmwvF2mb6Kg/oVRBC3Ta26XvAlJHLKTtwGIVsg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be00a042-42f9-46d0-b244-08d7b50e178d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:34:02.7445 (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: y+lcboYwagk/DkbdXqWmyJ2IdERq3MZVZMCoNNx7O+oPwWrQP9XzR5ou62JxiOS5OAnUaNiOjuc9TmJy4c8GMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Use virtio/mailbox to build connection between Remote Proccessors and Linux. Add delayed work to handle incoming messages. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 106 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index e31ea1090cf3..36dec1ce4f50 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -7,14 +7,18 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include +#include "remoteproc_internal.h" + #define IMX7D_SRC_SCR 0x0C #define IMX7D_ENABLE_M4 BIT(3) #define IMX7D_SW_M4P_RST BIT(2) @@ -87,6 +91,10 @@ struct imx_rproc { struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; struct clk *clk; bool early_boot; + struct mbox_client cl; + struct mbox_chan *tx_ch; + struct mbox_chan *rx_ch; + struct delayed_work rproc_work; }; static const struct imx_rproc_att imx_rproc_att_imx7d[] = { @@ -402,9 +410,25 @@ static u32 imx_rproc_elf_get_boot_addr(struct rproc *rproc, return 0; } +static void imx_rproc_kick(struct rproc *rproc, int vqid) +{ + struct imx_rproc *priv = rproc->priv; + int err; + __u32 mmsg; + + mmsg = vqid << 16; + + priv->cl.tx_tout = 20; + err = mbox_send_message(priv->tx_ch, (void *)&mmsg); + if (err < 0) + dev_err(priv->dev, "%s: failed (%d, err:%d)\n", + __func__, vqid, err); +} + static const struct rproc_ops imx_rproc_ops = { .start = imx_rproc_start, .stop = imx_rproc_stop, + .kick = imx_rproc_kick, .da_to_va = imx_rproc_da_to_va, .load = imx_rproc_elf_load_segments, .parse_fw = imx_rproc_parse_fw, @@ -503,6 +527,67 @@ static int imx_rproc_configure_mode(struct imx_rproc *priv) return 0; } +static void imx_rproc_vq_work(struct work_struct *work) +{ + struct delayed_work *dwork = to_delayed_work(work); + struct imx_rproc *priv = container_of(dwork, struct imx_rproc, + rproc_work); + + rproc_vq_interrupt(priv->rproc, 0); + rproc_vq_interrupt(priv->rproc, 1); +} + +static void imx_rproc_rx_callback(struct mbox_client *cl, void *msg) +{ + struct rproc *rproc = dev_get_drvdata(cl->dev); + struct imx_rproc *priv = rproc->priv; + + schedule_delayed_work(&(priv->rproc_work), 0); +} + +static int imx_rproc_xtr_mbox_init(struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + struct device *dev = priv->dev; + struct mbox_client *cl; + int ret = 0; + + cl = &priv->cl; + cl->dev = dev; + cl->tx_block = true; + cl->tx_tout = 20; + cl->knows_txdone = false; + cl->rx_callback = imx_rproc_rx_callback; + + priv->tx_ch = mbox_request_channel_byname(cl, "tx"); + if (IS_ERR(priv->tx_ch)) { + if (PTR_ERR(priv->tx_ch) == -EPROBE_DEFER) + return -EPROBE_DEFER; + ret = PTR_ERR(priv->tx_ch); + dev_dbg(cl->dev, "failed to request mbox tx chan, ret %d\n", + ret); + goto err_out; + } + + priv->rx_ch = mbox_request_channel_byname(cl, "rx"); + if (IS_ERR(priv->rx_ch)) { + ret = PTR_ERR(priv->rx_ch); + dev_dbg(cl->dev, "failed to request mbox rx chan, ret %d\n", + ret); + goto err_out; + } + + return ret; + +err_out: + if (!IS_ERR(priv->tx_ch)) + mbox_free_channel(priv->tx_ch); + if (!IS_ERR(priv->rx_ch)) + mbox_free_channel(priv->rx_ch); + + return ret; +} + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -543,22 +628,28 @@ static int imx_rproc_probe(struct platform_device *pdev) dev_set_drvdata(dev, rproc); + ret = imx_rproc_xtr_mbox_init(rproc); + if (ret) { + if (ret == -EPROBE_DEFER) + goto err_put_rproc; + } + ret = imx_rproc_configure_mode(priv); if (ret) - goto err_put_rproc; + goto err_put_mbox; if (!priv->early_boot) { ret = imx_rproc_addr_init(priv, pdev); if (ret) { dev_err(dev, "failed on imx_rproc_addr_init\n"); - goto err_put_rproc; + goto err_put_mbox; } priv->clk = devm_clk_get(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "Failed to get clock\n"); ret = PTR_ERR(priv->clk); - goto err_put_rproc; + goto err_put_mbox; } /* @@ -568,10 +659,12 @@ static int imx_rproc_probe(struct platform_device *pdev) ret = clk_prepare_enable(priv->clk); if (ret) { dev_err(&rproc->dev, "Failed to enable clock\n"); - goto err_put_rproc; + goto err_put_mbox; } } + INIT_DELAYED_WORK(&(priv->rproc_work), imx_rproc_vq_work); + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n"); @@ -583,6 +676,11 @@ static int imx_rproc_probe(struct platform_device *pdev) err_put_clk: if (!priv->early_boot) clk_disable_unprepare(priv->clk); +err_put_mbox: + if (!IS_ERR(priv->tx_ch)) + mbox_free_channel(priv->tx_ch); + if (!IS_ERR(priv->rx_ch)) + mbox_free_channel(priv->rx_ch); err_put_rproc: rproc_free(rproc); From patchwork Wed Feb 19 07:27:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390499 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D101E930 for ; Wed, 19 Feb 2020 07:34:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A270221D56 for ; Wed, 19 Feb 2020 07:34:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="tAjJs4BY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbgBSHeM (ORCPT ); Wed, 19 Feb 2020 02:34:12 -0500 Received: from mail-eopbgr60081.outbound.protection.outlook.com ([40.107.6.81]:29959 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726980AbgBSHeL (ORCPT ); Wed, 19 Feb 2020 02:34:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7EMigLF10c36QzSn79YrTrcbF6cZ6Ri5fPiAz2GTaVo/7B2dfZVP/4wcojnJ2iir9qyzYWPxdxxe++sBwxM4uOH7zqIs9l7HBkAHDdWVGJmX1r9ywlj9rN7VpWvHr2R1sbERvxARKZkj2qRXbi04l8R3DM8/XIZ+4RzxOePKji1yTNSM4VQJ5VivVPMq6P56SL8WOF27f9qsnskl8eB+EY8gi77CpgvCO08ywdMCCWfjjToXKYT4/HrqoySp85WS/ypar60/4KkCFhYUSmce3fIBUB7EVW0qw/n0mutvgWGBXEPOUZ40uOV8zO85fRqzapCd3d3ASuTgWt2yLZ8Lg== 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-SenderADCheck; bh=/vkCrfHpigAWTKCwQqwZsKOqtxF59CIm1CeIeDIxdYo=; b=nSNdpmGriotx2TBUD28IE5fyzOBICMNoaxpIUd8Li/kotJqSvKtUZsaWJcsIfqNf4noL0khgWuP5NGVMrLxswuvNW10JeTAbd2jRBQo5xMp6nuochOuEFWY7Jg7NahvbuNFbH7Z9H4z+jN9j8XsD7Uw+GzZTpir3uofvXa+BQ8F+u0uDmRt3M2hDCaY1aBEqq41Yh8px0NMBrjkHmBWNY4/vUVqbk4ld4HEwiDLeQe9YrgcGLCKGP6ZEY+7g8lFtxqQ6jVmNDgx2BWmFDVmZD3bdVAVu1DfTGNS/qac3sQODHyL89wmz4Vhg6U7EYLJh6nqimpBZo/cuWLTTGXY8lg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/vkCrfHpigAWTKCwQqwZsKOqtxF59CIm1CeIeDIxdYo=; b=tAjJs4BYobmhKpb0K2spE2p18yWFQU0kmjSurVE1lfFCaH1VktMAAfHKQ6hykSWDLCoTNIVPh94Ah8iIdxqLmoaWLorX/F6K2wsOeYEvehQH4dsdsd9AuCqceK3nefZV2hsvoa0n85slHty6N5rXOywzBksLGCKtFJ1rX7OP+Gc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3969.eurprd04.prod.outlook.com (52.134.95.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:34:07 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:34:07 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 7/9] remoteproc: imx_rproc: add i.MX8QM/QXP Date: Wed, 19 Feb 2020 15:27:43 +0800 Message-Id: <1582097265-20170-8-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:34:03 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 26010d26-ac8e-42d1-ef77-08d7b50e19ee X-MS-TrafficTypeDiagnostic: AM0PR04MB3969:|AM0PR04MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(66556008)(66476007)(8676002)(478600001)(186003)(52116002)(956004)(81166006)(81156014)(7416002)(5660300002)(4326008)(2616005)(66946007)(8936002)(16526019)(316002)(69590400006)(9686003)(6666004)(36756003)(2906002)(86362001)(6506007)(6512007)(26005)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB3969;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PMbZatyvs/+qy6CvKt7N9fhePnW2kZEYOjvG8+40QZRPD06mH0OiU7aDt0j4O6OXVi6TSDEADkEm+vcxEB2MzLf2b/C9dTvktj91iyukzcRJhPMV3L/qQ8kcnaMwGolB6qoaO3N3MNwts3VIQ6+OSAIr/UE2v+Hr1mfr+ArG57CG1roMqtBcHBTLWNtWMxSUvHyubU3GBBwB1qXAQsErGZyS+tFAeGuUYsVbKBkh/YupYe/7exZnaKGNYuI4rw1f+AGxwUrV7vpu8v86wofwSvnJ2uT4/KYaA5pfA1pLSMi+wgibknVXvfE22rwQ05XPbmaslm0PJO6Ww0QIBOdx8b3crpKrKoPnxnBzmKJj0lEoODUlj2WjkorVpK0iqqEAztZMhfT+dmfGoD0CdtI3tPzExh/VyvgjdjyhS+7l3pD42z/9+boQbOBYqeOXnKxH4VfXXHf26MSH25Vr+j8KiaSMDf7Kcb8SmpyQx9xCJO54OsEZQr809HPKVwSXgWSxA0EbtquiPBZ7iSYpypOjZXKSiNzn3Bay5u0ZG8AeLok= X-MS-Exchange-AntiSpam-MessageData: /iM381wdH4S3vVVwlyZ2gsZAJa/wbxEZ71ohmM6HW40W7/vs23I1b2jQHOWXpRqwqv7NO96O1IqQuzMSeML65TrALEK/xp21SRyR+yy7W3QELfSe4qUx3l1nGSfDrHLxTAd9Bz6f2qVxJAImwt135Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26010d26-ac8e-42d1-ef77-08d7b50e19ee X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:34:07.2249 (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: SRaIJqZ5Rqt65cRBQC4KZcbAyOHlkFnuxd+Vsa8xgHhieXWs7iElu427WPlp5n/gp00Ezp9H0aNcSaMBkXaatw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3969 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan i.MX8QM and i.MX8QXP support hardware partition feature, the M4 could be controlled by System Control Unit(SCU). The M4 is out of control of Linux with hardware partition used which is the normal case for production in automotive space. When M4 reboot, SCU will issue interrupt to Linux side, and Linux side will recovery the connection. To use related functions, guard code with CONFIG_IMX_SCU which is enabled for all i.MX SoCs with SCU inside. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 84 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 36dec1ce4f50..003f9e5c2b0c 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1,10 +1,14 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017 Pengutronix, Oleksij Rempel + * Copyright 2020 NXP, Peng Fan */ #include #include +#ifdef CONFIG_IMX_SCU +#include +#endif #include #include #include @@ -49,6 +53,13 @@ #define IMX7D_RPROC_MEM_MAX 8 +enum imx_rproc_variants { + IMX8QM, + IMX8QXP, + IMX7D, + IMX6SX, +}; + /** * struct imx_rproc_mem - slim internal memory structure * @cpu_addr: MPU virtual address of the memory region @@ -81,6 +92,7 @@ struct imx_rproc_dcfg { u32 src_started; const struct imx_rproc_att *att; size_t att_size; + enum imx_rproc_variants variant; }; struct imx_rproc { @@ -95,6 +107,8 @@ struct imx_rproc { struct mbox_chan *tx_ch; struct mbox_chan *rx_ch; struct delayed_work rproc_work; + u32 mub_partition; + struct notifier_block proc_nb; }; static const struct imx_rproc_att imx_rproc_att_imx7d[] = { @@ -167,6 +181,14 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = { .att_size = ARRAY_SIZE(imx_rproc_att_imx6sx), }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qxp = { + .variant = IMX8QXP, +}; + +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qm = { + .variant = IMX8QM, +}; + static int imx_rproc_start(struct rproc *rproc) { struct imx_rproc *priv = rproc->priv; @@ -507,9 +529,7 @@ static int imx_rproc_configure_mode(struct imx_rproc *priv) int ret; u32 val; - if (dcfg->variants == IMX7ULP) { - priv->early_boot = true; - } else if (of_get_property(dev->of_node, "early-booted", NULL)) { + if (of_get_property(dev->of_node, "early-booted", NULL)) { priv->early_boot = true; } else { ret = regmap_read(priv->regmap, dcfg->src_reg, &val); @@ -588,6 +608,25 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc) return ret; } +#ifdef CONFIG_IMX_SCU +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, proc_nb); + + /* Ignore other irqs */ + if (!((event & BIT(priv->mub_partition)) && + (*(u8 *)group == 5))) + return 0; + + rproc_report_crash(priv->rproc, RPROC_WATCHDOG); + + pr_info("Patition%d reset!\n", priv->mub_partition); + + return 0; +} +#endif + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -665,15 +704,50 @@ static int imx_rproc_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&(priv->rproc_work), imx_rproc_vq_work); +#ifdef CONFIG_IMX_SCU + priv->proc_nb.notifier_call = imx_rproc_partition_notify; + + if (dcfg->variant == IMX8QXP || dcfg->variant == IMX8QM) { + /* + * Get muB partition id and enable irq in SCFW + * default partition 3 + */ + if (of_property_read_u32(np, "mub-partition", + &priv->mub_partition)) + priv->mub_partition = 3; + + ret = imx_scu_irq_group_enable(5, BIT(priv->mub_partition), + true); + if (ret) { + dev_warn(dev, "Enable irq failed.\n"); + goto err_put_clk; + } + + ret = imx_scu_irq_register_notifier(&priv->proc_nb); + if (ret) { + imx_scu_irq_group_enable(5, BIT(priv->mub_partition), + false); + dev_warn(dev, "reqister scu notifier failed.\n"); + goto err_put_clk; + } + + priv->rproc->skip_fw_load_recovery = true; + } +#endif + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n"); - goto err_put_clk; + goto err_put_scu; } return 0; +err_put_scu: +#ifdef CONFIG_IMX_SCU + imx_scu_irq_group_enable(5, BIT(priv->mub_partition), false); err_put_clk: +#endif if (!priv->early_boot) clk_disable_unprepare(priv->clk); err_put_mbox: @@ -703,6 +777,8 @@ static int imx_rproc_remove(struct platform_device *pdev) static const struct of_device_id imx_rproc_of_match[] = { { .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d }, { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx }, + { .compatible = "fsl,imx8qxp-cm4", .data = &imx_rproc_cfg_imx8qxp }, + { .compatible = "fsl,imx8qm-cm4", .data = &imx_rproc_cfg_imx8qm }, {}, }; MODULE_DEVICE_TABLE(of, imx_rproc_of_match); From patchwork Wed Feb 19 07:27:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA13317EF for ; Wed, 19 Feb 2020 07:34:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6BEA21D56 for ; Wed, 19 Feb 2020 07:34:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="SiShjaMi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727346AbgBSHeQ (ORCPT ); Wed, 19 Feb 2020 02:34:16 -0500 Received: from mail-eopbgr80041.outbound.protection.outlook.com ([40.107.8.41]:49216 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727263AbgBSHeP (ORCPT ); Wed, 19 Feb 2020 02:34:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZSunnbKRJg2/zznpg5UXQeEgLK5m+j0mnP3s3Qkjn0SIw1zxCleesYfRlTnfYQY3mYgi7pbZZUx2ln9B14SdhjEqpFwKCLHARVU4R3LXeWSZ0kzKarz6ecaSvzepuqC+iwKHoQJ2RdfnpZvTry2WO0bUyC0IWKkxcpV2Ckj6uEFCJsm30Fa9rJ7A/ro/iQ92Z5rQm97hTXjX4xZaSzSg5sqPWR0fJsKWQdKsZ8LsvXcQDVaxpjz9A3XfXHN9DTLGIdkoxhA/8Q1QB9xTpStadKMeek8RgesElisdr5YZ8yABpxavizzE/rZ+zTjTQ4OG+NY2WUvBf3QQAlymf27Kww== 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-SenderADCheck; bh=Di6Xc2Kec+lh/UZnw+aO21NwG9ymOod2MojAnOUohSk=; b=OM6pgPQ0Jijed0PfX9H0i2S1sd7ydi1GsngTSMTch2ezpSy+mxFQbubfbdl+MHIFEhSjOU9Lf5a2ilq+ZtNW1n+cVuNz3yiVM2xypH/nIZ1laImhi9mOO8lAsjDEin1yFqC+mdrXn97516S0xADR9WYKIBlX+ZzDAd+XvttrT60QOm0POKJAr/WTTTsAqyC5tGdAkreMhUGvZE8TuMobmQULPPVqhPLn/uYXyfoYvZKSRbDQXNz3k9KhxGBkx+f1Eqdwg+fMnCEWcaYePv9ryKW30gNzhBTLYlhOUWtMzXo3uG0xII+V1FRmx/FbLnB/LUrhBmClug0Jae8d+F+1kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Di6Xc2Kec+lh/UZnw+aO21NwG9ymOod2MojAnOUohSk=; b=SiShjaMiEgZjydPhxPt8kFUFCKZ8EVPlNCp0b+qgxcO1e/nDQkc/CA9AEjwclJD4BQUVPoIZFgiiE5p3rC+cZ/esYS4lJG7jdPu7ZIPhUh93V0T9TTts7zY+Gk3j2wYGK/NWPwOqPyQmqFBKCHPxdPyMSe86JgET4SD0+MT/Dv4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5233.eurprd04.prod.outlook.com (20.177.40.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:34:11 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:34:11 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 8/9] remoteproc: imx_rproc: support i.MX7ULP Date: Wed, 19 Feb 2020 15:27:44 +0800 Message-Id: <1582097265-20170-9-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:34:07 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e9c4be95-8cc6-4ee8-226b-08d7b50e1ca3 X-MS-TrafficTypeDiagnostic: AM0PR04MB5233:|AM0PR04MB5233: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(136003)(346002)(376002)(366004)(396003)(199004)(189003)(81166006)(52116002)(8676002)(2906002)(81156014)(5660300002)(8936002)(9686003)(6506007)(956004)(2616005)(6512007)(6666004)(66476007)(36756003)(4326008)(66946007)(316002)(66556008)(7416002)(69590400006)(6486002)(16526019)(478600001)(86362001)(186003)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB5233;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tcJYhfC/vyTqFdGIpfEc8hwRVwVndqkP6PytU8Cbc73+aVFwSCwapznm4peFNUiMIF9ZCDbKkfJ8kW/MjaL78LNYtYDDyA6v2Z1cXOcqNNqXIssrtD+c97r33jHmG5JyUsziMIEq5KOBl790f2rVfx4FfdeYnk79Ajb2/YNOaq7ofQ2L5SN0B3pEQhpNFhRBbHa+U6Kfp/s2BzjoUYyvdz7bUDyXb1twmY891WZCLc86EkgAGxrbIwm7MrkDH5ZLPGKRPv1XkF9oKqYQ83fRGTh8SusEogdTTM8jYbeZ/oKZ8h3Rvdq2A+PGZpXigjXxKJw6mK2RFTZobz4aJlNYuQIje4oyoz2ECbA+h9qZZEbyHrnLSvfzM/4J6hzU6cSM4gIlwMD6izofXYcXVgycPP/18jp9TpDFd/5CaVHdWrPLygJpKTzmlPJaF4aNzgt2mfhxkxi1ExUD8DoC+gB7gLa+LqLSwn2/bBrm1zWj7BuaWh1lVfbHfAyYtz9J8Z/E7ah/m+fOOetJbVEP7k5aU6HtzA5GUB7QNPGIQXk/8ns= X-MS-Exchange-AntiSpam-MessageData: Lqx16E4ncWZ/qf6GdMX6gDjf8kSQ118XRRfV7qKo4RxNVXcLXgACCsnBSxpSX8DCRoXaP4y9DDveLGUjJYgONEabrSg9bWxc5TKGLPKBc+j7skzqkmRYXZ1kK+PvC/+rCpnZT5GKzpBew7nTjE2NkQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9c4be95-8cc6-4ee8-226b-08d7b50e1ca3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:34:11.2736 (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: QW1h7v2tSEm1NkOdp3yYF9I7wRti1n10wbGy4e7cfSQCrH4KhxA9WaF8C4LDCoWElMYQTxokXOVQKofAPJXXDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5233 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan To i.MX7ULP, M4 is booted before Linux and it's in charge of the whole system. So M4 is surely have early_boot set. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 003f9e5c2b0c..fc2a504bc350 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -56,6 +56,7 @@ enum imx_rproc_variants { IMX8QM, IMX8QXP, + IMX7ULP, IMX7D, IMX6SX, }; @@ -181,6 +182,10 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = { .att_size = ARRAY_SIZE(imx_rproc_att_imx6sx), }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx7ulp = { + .variant = IMX7ULP, +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qxp = { .variant = IMX8QXP, }; @@ -529,7 +534,9 @@ static int imx_rproc_configure_mode(struct imx_rproc *priv) int ret; u32 val; - if (of_get_property(dev->of_node, "early-booted", NULL)) { + if (dcfg->variant == IMX7ULP) { + priv->early_boot = true; + } else if (of_get_property(dev->of_node, "early-booted", NULL)) { priv->early_boot = true; } else { ret = regmap_read(priv->regmap, dcfg->src_reg, &val); @@ -638,7 +645,14 @@ static int imx_rproc_probe(struct platform_device *pdev) struct regmap *regmap = NULL; int ret; - if (!of_get_property(np, "early-booted", NULL)) { + dcfg = of_device_get_match_data(dev); + if (!dcfg) { + ret = -EINVAL; + return ret; + } + + if (!of_get_property(np, "early-booted", NULL) && + !(dcfg->variant == IMX7ULP)) { regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(regmap)) { dev_err(dev, "failed to find syscon\n"); @@ -653,12 +667,6 @@ static int imx_rproc_probe(struct platform_device *pdev) if (!rproc) return -ENOMEM; - dcfg = of_device_get_match_data(dev); - if (!dcfg) { - ret = -EINVAL; - goto err_put_rproc; - } - priv = rproc->priv; priv->rproc = rproc; priv->regmap = regmap; @@ -775,6 +783,7 @@ static int imx_rproc_remove(struct platform_device *pdev) } static const struct of_device_id imx_rproc_of_match[] = { + { .compatible = "fsl,imx7ulp-cm4", .data = &imx_rproc_cfg_imx7ulp }, { .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d }, { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx }, { .compatible = "fsl,imx8qxp-cm4", .data = &imx_rproc_cfg_imx8qxp }, From patchwork Wed Feb 19 07:27:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11390495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CA15930 for ; Wed, 19 Feb 2020 07:34:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FC9924673 for ; Wed, 19 Feb 2020 07:34:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="gRI8WZYQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbgBSHeT (ORCPT ); Wed, 19 Feb 2020 02:34:19 -0500 Received: from mail-eopbgr80072.outbound.protection.outlook.com ([40.107.8.72]:44608 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727405AbgBSHeS (ORCPT ); Wed, 19 Feb 2020 02:34:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvNEwTMvJm4U90mrB1CdBSAUxwOAIbmBUbSKofVMCMOdlqGsmpIXT4Pu6YLEgDvJNm+y7l04f7ObS8Puyl/6/36sQzNUYSWLRGewYBz/fcMuH81UXzuXMGzp0M6cqesQDNFXCNDzJwO3V5Dr3+VEPK0f313PDyseUwxuv/kAuVhdl6xE0EnPsXp0Fpjw3SUjDM4gLzbUK/uGT8Ut6J5S8oficZOkoFE5yWoMlugUOPg2rdsc3k+6zEKq9ojPJU4DOBcHuY2hZFOjnPmJbPZakEg7a6StnZa2XsK+8UeVm0mqpvZ77PROKNchqvYKonEt/hji82Ij7Ob91NpmMSPgqw== 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-SenderADCheck; bh=B/Vj60ZeOZ55CHjRFkSChc9Jzl90zgEyrE1PbkO2VyU=; b=dKUSwffUM04Gh5cU/JJGjVDw0jhCHZP/LxKZoKoyqQK7vng0qZ/x/65hVOVw3i10J1J11heo8C3UBVvpygnmfsbPbNzIU5Q8DiJdG2ztDQgRv1Se30YbAS/N3ybEFMHtZOLeU1rk1V7cT74LnY8bQ8kxSnE1Xqum3IqRXFClAsXfn+I1VvVcIAs93Uvlz5OzspoH8XRHNQSCp3NUj1VGsBAWkK+E3wN2rz+iqHckwejSnoI3ukOwEB9Em5nFucOgnvnsZpwrA5UFLiC0mNymKQ7CZAwU6hTzysYK/A7Ruz/mdJZpVMIXaVDeuJSbAU6l5hC3MI+7vBb8QKXk5T38fA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B/Vj60ZeOZ55CHjRFkSChc9Jzl90zgEyrE1PbkO2VyU=; b=gRI8WZYQiJQqIboFbvZ/d5E9LHCNZ4QCeSzohmJLX4/FdjoSNO3hSwTlAjHRp1Wuq9V8SorA9ZoUuV5r0cJIDtx8avqQhU0KuSSs328LC/e/hgNLUV9Ci5MvhW8JLMaQLeDY6OcNClM3LeweJ0IJTsq9VpWLzWvBzK8lDhv/IsA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5233.eurprd04.prod.outlook.com (20.177.40.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Wed, 19 Feb 2020 07:34:15 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 07:34:15 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: 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 9/9] remoteproc: imx_rproc: add i.MX8MM support Date: Wed, 19 Feb 2020 15:27:45 +0800 Message-Id: <1582097265-20170-10-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> References: <1582097265-20170-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0115.apcprd03.prod.outlook.com (2603:1096:203:b0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.23 via Frontend Transport; Wed, 19 Feb 2020 07:34:11 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eedee99b-8336-470f-e5f2-08d7b50e1f05 X-MS-TrafficTypeDiagnostic: AM0PR04MB5233:|AM0PR04MB5233: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:167; X-Forefront-PRVS: 0318501FAE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(136003)(346002)(376002)(366004)(396003)(199004)(189003)(81166006)(52116002)(8676002)(2906002)(81156014)(5660300002)(8936002)(9686003)(6506007)(956004)(2616005)(6512007)(6666004)(66476007)(36756003)(4326008)(66946007)(316002)(66556008)(7416002)(69590400006)(6486002)(16526019)(478600001)(86362001)(186003)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB5233;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EcdwqMAn7Sf5Op5bvSShrIPJWsv8jcvqj9mi9lxfTuo+KMOEcM7S2bSEF7eY0YT2vwDQ/bQr2bDsmlRQQEXclS7CZwCKMb+A8cLM6j60Q3ZjNT7pAlVo8jo4aZpXQcvh3IQSp17NQVU+z+Zr3L9W2KfcNrIfX+cVDSueyhVUeSGwCtDWF8Sgw6roQG0Oi5Ptdx/aQzoYKIkvtn1JpYSBKLtyP4Yw6xMPjyBuJKM48MlXO1fg0yRXa0p4PRFAlJKXt91UsDnvQylSDOzkfEOm19m2jBSS2n7qVh1fvHuBNkF7jghaZsBzuRIhvosmpSrWTwtV/mFaPZr3vkw2B5/RAzksXw7kyqol5JBJFmcztu2cEEe0ZpYiL9Xg160boAU2yDju/l4YCbAOEcG9CilI8JAFT3gaM845YHovpEM/NXm4u50Bw3v5iCLwcpGLDL5WlBBt/0ue5nJ4uhDfYLSq997bR97wJWRAPNp1reklziUxxpZ5b+uAkCLfz7hXMPmnhPwsui9x/Md1vBXMyGUp2wkQ/STVXtD2PW8AA2mqACE= X-MS-Exchange-AntiSpam-MessageData: qYbLIitO3bA0CISw2xONSf/ryeh/I1iXqXpnxhEeuKCFY7kxG4+zJXrCQPX9ewX7pjTX3Rg+wuhO+BIs5JilvHVnOl5AONSUvdWJVeThBG/YyXPEIwtaEOyg32wvC67WXU7SiIZqDGDdcY4Jd3xQuw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eedee99b-8336-470f-e5f2-08d7b50e1f05 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2020 07:34:15.4352 (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: cO8jX4zz92Kdjpo5X11MTNPu3rd5vVEhZL6Ga5su53jkMMT9qinRz0nH1JU5qfRalVDmVDpVk3aO5yt+XcydCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5233 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Add i.MX8MM support. Remote processor is under control of Cortex-A processor. Currently only early boot is supported. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index fc2a504bc350..d00c3cbcd87c 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -56,6 +56,7 @@ enum imx_rproc_variants { IMX8QM, IMX8QXP, + IMX8MM, IMX7ULP, IMX7D, IMX6SX, @@ -194,6 +195,10 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qm = { .variant = IMX8QM, }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mm = { + .variant = IMX8MM, +}; + static int imx_rproc_start(struct rproc *rproc) { struct imx_rproc *priv = rproc->priv; @@ -788,6 +793,7 @@ static const struct of_device_id imx_rproc_of_match[] = { { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx }, { .compatible = "fsl,imx8qxp-cm4", .data = &imx_rproc_cfg_imx8qxp }, { .compatible = "fsl,imx8qm-cm4", .data = &imx_rproc_cfg_imx8qm }, + { .compatible = "fsl,imx8mm-cm4", .data = &imx_rproc_cfg_imx8mm }, {}, }; MODULE_DEVICE_TABLE(of, imx_rproc_of_match);