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: 204620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0354C34022 for ; Wed, 19 Feb 2020 07:33:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A07BD21D56 for ; Wed, 19 Feb 2020 07:33:50 +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 S1726651AbgBSHdq (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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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: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: 204619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 260C5C3404E for ; Wed, 19 Feb 2020 07:33:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA24224670 for ; Wed, 19 Feb 2020 07:33:57 +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 S1726723AbgBSHdy (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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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: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: 204618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3B71C34022 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 A20E824670 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 S1726650AbgBSHeD (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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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: 204612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C511C34022 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 1AA4C2176D 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 S1726875AbgBSHeG (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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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: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: 204617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 137C5C34022 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 D6EE821D56 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 S1727338AbgBSHeQ (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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 },