From patchwork Mon Feb 15 12:34:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382945 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1046715jao; Mon, 15 Feb 2021 04:48:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyf7DtPJYcqc995nZ9cKCuO5h2XkKHM7d4o6N4MbK/wD7FVNhxweK6b/5i6tYoChchBGQxY X-Received: by 2002:a17:906:d18e:: with SMTP id c14mr15683454ejz.302.1613393303854; Mon, 15 Feb 2021 04:48:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393303; cv=pass; d=google.com; s=arc-20160816; b=VvsSmL3jAxYpVgan3mwGi2KyxPcJpcLFpbV1+OwIti2YRTay8bG0BHAJn3kMyBpAvW c/InY7bHVqy+uooqQjNOSeZPEYXqWLYBe5YJbRJxi1xLv61M31mXduA5qRl41DsiUmbZ IIsYl7JDeSLLuptOxjndGqdeQr0G00re/my+HT0o0YT6u9uiYF3BU4aWuU4RNWGspKu4 dkKB2rWPBf708FoTSHNnLXjfc3Qblo7y0AzGF44U7DwRvL2rbbRjlkdc9kfQfDts8KZy JdWFNsAFJIM1rOGwJcYpLtSQfYWSkSqwPrXiL3b707EbwS53mzhId8q96s4GJOzgzSzp xtEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+pZPVCe4IDZJzwE7wf2Sm3GKMMFW+4GxDTbzpdypFKY=; b=a4AwM9FVjDhxvWVyTfHcjh7xj5uQi/PUpi9y49JDzHd5Tp8Oa1+O8WYZ2tvFzuyGuT bcocLEoHK2ICMuP97DbNPvzk4uJtXmt2uncgaJtMNBsfoZnvN3ZHLjcMVF4Gp6CSmDGa LNuXY54LQQ1gQhjQXGSP39G+5ER6wezvE9P8TaSlteDzAoPiZM0iLDs65iirB5q6nCPS rtPgMY+NMpKiShSX4N3NHtWT7PjOzTz/2dXhQ/8Oq61xkfkmFO+cDKApCWcWkd04Chq2 k6eRTUTp2kzKdisKmcuVZtiAMHEiQvm+Qb2oFbuNmmYySOSFt3Y7CHQO/R+l2xoZvmuv Wv+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=g8hfRMGa; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si12572576edu.40.2021.02.15.04.48.23; Mon, 15 Feb 2021 04:48:23 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=g8hfRMGa; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbhBOMsN (ORCPT + 6 others); Mon, 15 Feb 2021 07:48:13 -0500 Received: from mail-db8eur05on2085.outbound.protection.outlook.com ([40.107.20.85]:29376 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230434AbhBOMrv (ORCPT ); Mon, 15 Feb 2021 07:47:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pn0Y85StUY2cEcJ/p2Dn7HqPY4DvnoFhk9c+CFFSe6Hi+pDIVKj5CXylf7K/EO/8/gJwZY1trAtUIU8EMFeom4EgwZ6uFfGKaWnhM9RycLuzpsrQCmy+X8SjfwQmuwkYvChVQtczvrMiFCdGe+WpKfzr3KJcwebOUa4zpnQSAksjNGdp3d49iphfJb6RTjr7f4v9ZmvRISqoG7rrJ7n9VVvoS+ZhLZDb+5PZD51ckVy1Fe/elRDyJ+RMSSx/01BRuMkaVLj0M8UeNoPPjt+H2xZztOTaDt937cq9gTDuadegzeY1ljBt4hEgtd3b3M4LLblhL49bzcWQCzpFEZ8rwg== 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=+pZPVCe4IDZJzwE7wf2Sm3GKMMFW+4GxDTbzpdypFKY=; b=abirYql/mVQ8squVL1LgRLZzTGWe2p2gRJMnc0j6tUnL797zwJrLIG2bFtbMVtkj9Ksh6Bs3GNs58zpkmXumtl1993yR0VCOaTjpD8yGgvhvFJFZRvTcaHHy6V8errkB/SJXtOaGDnwlOt4NmxSx6hawfHWAouLV30SONsIryejvB+zXOYFtdwsfIgPRO67CHwaXTodKfLpS6gd4whZ0vmjJrl6ToxF4fPPf/7K/Pod57V5McM6jkoHdRpzgR0nAiH85X4sT9Orsm4h3ePq9APJSwZdhcx+ZjkDgsomeU0gNhMjr8CLDiC3TR3Pxtb5Wcr1LhnYcSx6NpzIQD1HBGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+pZPVCe4IDZJzwE7wf2Sm3GKMMFW+4GxDTbzpdypFKY=; b=g8hfRMGaU1W2upMF4lMNtgp8c26RaDRiaKAmaNZOfOu0vvxnAWnJxg8WvHpA21U6HZKzk0ZnvQIW49u2Pwa6HK/mnHDLpryl8GoZK5irwzi/+QIIvpqMW2SfF0cXCtzCWcCN94k17UV+KEJdzmvvomWOBL+YWEYwvjuKrT1Ih1w= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB5081.eurprd04.prod.outlook.com (2603:10a6:10:23::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.36; Mon, 15 Feb 2021 12:46:26 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:46:26 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 01/10] dt-bindings: remoteproc: convert imx rproc bindings to json-schema Date: Mon, 15 Feb 2021 20:34:14 +0800 Message-Id: <1613392463-9676-2-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 653d73d0-1105-4c43-212e-08d8d1afb54a X-MS-TrafficTypeDiagnostic: DB7PR04MB5081: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nAryb12D1gmMuZDN6kGj8VivNFqntu5akB8jz9+LVmMgIFr7gE5w338uhhOfi964Xad11AC5AAajMqTTMqQbUPjZQm9B6/WtO7pbhRZBOoPj+4yAwcLC6ZITLz16DHlxL2/KrKHJluFbUswj0DNRxC1M4tlhBK1Sy0k9fEdQxojSM+71odmCuNmkEm6ApLG9T4x7admHbjsozEH8nZRV+Hi83AwxTOSGccf3C2opaargOoVJil/mwo2z7YThUS+GIqeBKuMKASmJme1Tljxljon6Ib2ZPs3eyMjS0QiH8OYdvV4Mt/HMp9cLVB5q6+nV4ek7SNB2rTe+g3jJ61J5dbhuPbbIe8V3hjg6LLK//YA+gudvs4+W+++FPJK+SvXsNip7ibhA9QoFeFq2n5lGZUopFjiY+VwffZrjWzrq2jbxpnLME1gqhNWGrVZBuSYHAwWc6K18NlnF0e9aQ5XeT/fMm+C4DRzF7kge32Llg9iZRkddrTo+DLkOiqCaUdt8HcbF2U6e/WixlVzteTVUJIzi5mmXzVpPI3fx3MLByo9TcY057zJXXBtap69N1nFMWD92DZrBiJMUOeGdWUbNpzZ8h8mislsow1d6217CCqg4VYdApGue0DBxR5AEKzVz9Rd4SQDzzry/QLK9vzTIJw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(136003)(346002)(39860400002)(396003)(4326008)(86362001)(16526019)(186003)(66556008)(6486002)(69590400012)(66946007)(2906002)(66476007)(7416002)(6666004)(956004)(2616005)(26005)(83380400001)(8936002)(8676002)(9686003)(6512007)(52116002)(5660300002)(316002)(6506007)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: i3wDG7yzqcCmopNk8Dz3v46uNy/nPqX/M82LOp7Pv2q4LiX9VbNcxVmWgwpdguUWgZLLoYEILCjbCcyE/N1smQGrLrarg+O93GEv8klFICncHYXeuwkLJ55urSvUA/wdoMnRRwXY1U37iK74P0u0aRiPFdvFJ2ibkpZ93bDrUwNVB/rohg+unXlVw1znJ04GsX5CNA01LxxAWWRl3bAGpeoiZ1zBvfOzBqC2vz1RDb1ikjgiJ1+osuky3kSRutymXhzCx8XxmxBsyOfCfIgL+Bhf3hSd96WSqqVmuL9xOg5p58w5AuSt1f2tT50nF8EpmLLNnp0HlpPB6zG3wUvQt5TLxDtc3HQIdm++i1cipiDm1BkwTvFwPGX4ByUe/EYXIt1kBmiJhTS796+1AtceBnELsLU85qukDIQi2mL+/WnwRXFtSWqh9eRcB+Nkjl9FgPQcFGyLK9oJ53koawnQ/P41SD5CMCk1k2+m1KwzpFFErWQZrzipB0fpHUtH4b4OLlWS0pIpCiLLWIJac+WPbHN6BBYf6NO6NBJCNcJvgr6pGepr8KN6pBCJ270tuXKocbKzJ5arJqZJN8Tjnfzv/gpeYuUT85x1LoH+1z11GExBR4ITYGOxU8HRqioT/zgU6AOqwBLiLpw05jrj1e+mMes6A72NAiM7SLCqUDtpyMWcuVT5z6VjgPgbztZ1F8PBdTnkDSQHd8zffLFylKnDIEYv46RPuSS170BBLJgm7Lf2cwF/HdGVdN63T4+VZgBFoqXxkUdt68MMre/oGjGsvofE1Qep3yIZXpBBiRmF3Yas/b/450JMCM1MZG03SsSVYftYe1lZ8vC40wBq8MnNIt3hW+vFI5h2MaoF57hLSsVQq1i61gRJaG2WdC1qlW8UEE+Hps8ZMDorMkg26hbXlAFDkWZ+k3dURdubomVMuMQU7wcph+jC4LpG38kEj1dSTS/6i+4hnD6g2NREVfHwK5wnfldmfiLxoQ/roSdTQ9ryp/SOkQjQufdmgV2SJm1ksB8bFdXhobkz8sT3/cWeVVJ3k1CmbpvE3PiMIciGnyvaZv7r761S1xKwNoqG8Pj3fvhyGXQE63+wMUlJc/44c3wmZ650IqIXafVo7p46jXvi7+I+hsmSRWTXuwvRWhVevECMRQY0iZf1q0g6yA+F+5JRAZ4VMFhU64pClPjyodDwUAzqo6kyZ8EF8/x0GyNjW1nNEXEIDqLW03uxJFXrDMr0UeynC86ggchhyu+Bs68VAuMm4+4pr2s6CmMxHUXE1l59erLa9O7SM/Ex7ai/EmQpje6NE6VyVDSufLhqvwy5k0jxcywVs6Boe0qB5fKw X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 653d73d0-1105-4c43-212e-08d8d1afb54a X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:46:26.6500 (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: zj5QIutFIWh0fyAKF86k0/QwiH0ugkrHatT+tmA7zrDcoEzie4kNxNTxihQE39XwegnMjvdEtg9eF6z8/wgExQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB5081 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Convert the imx rproc binding to DT schema format using json-schema. Signed-off-by: Peng Fan --- .../bindings/remoteproc/fsl,imx-rproc.yaml | 60 +++++++++++++++++++ .../bindings/remoteproc/imx-rproc.txt | 33 ---------- 2 files changed, 60 insertions(+), 33 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml delete mode 100644 Documentation/devicetree/bindings/remoteproc/imx-rproc.txt -- 2.30.0 diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml new file mode 100644 index 000000000000..8427d0f6e471 --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/remoteproc/fsl,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: + - Peng Fan + +properties: + compatible: + enum: + - fsl,imx7d-cm4 + - fsl,imx6sx-cm4 + + clocks: + maxItems: 1 + + syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to syscon block which provide access to System Reset Controller + + memory-region: + description: + If present, a phandle for a reserved memory area that used for vdev buffer, + resource table, vring region and others used by remote processor. + minItems: 1 + +required: + - compatible + - clocks + - syscon + +additionalProperties: false + +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>; + }; + +... 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>; - }; From patchwork Mon Feb 15 12:34:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382943 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1046660jao; Mon, 15 Feb 2021 04:48:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzs8sMepJotGGtrL5Wz4yXlBaTR88EuEsNcWsvLN31kNi7/G/lnACT5rU32W/6rCOmqgkh9 X-Received: by 2002:a17:907:3e1b:: with SMTP id hp27mr14601095ejc.506.1613393297614; Mon, 15 Feb 2021 04:48:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393297; cv=pass; d=google.com; s=arc-20160816; b=tHLGSeXMM15I4Xe9zWZN6jLStH7eEXOxOUoSRowmKxwWaGGsfPvBNLwxref4ezuo1Y ke7BlZ6Jz9DbA/IUbrpRlswhgaIoTZ64T/pzzeM5XwROSd4N1SHIXd312tf5bsglzmn9 yC/FHjHOeNLE4dqlyh0ZTTDtvzAvv4iJ8nrlhaObcHCPCRJi4jD7xctDVbOUup+7Lkam U5By/q1c4EofT29XFx6N7B1XOslYiMQo1GhzzD8P3r9jjNHMbNk/s0zj7AtU1OXp6d5c EBdyoq+3fFGKa9604PoFvmL0wWxfEeTQJyHeBA/V4uYYJBGT9phBXS5lnAg8XUHcecW9 DetQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dmoMHqZBPsl8SeyXNbGQhYN9YYgird0xDuOayiiXljs=; b=mVmT+uJkjQFUUeU6IdkNQ/iDqAm8gcYGhIS8DyGnpizoWi+svrbOxCiX7Z0b7/aNwl HMJnsmuvjcgsypC9VsxbkGDQeDwZiKqIPq3vbNDC3wg3WFM6gz67+Gh4FMH+ZC1v6CAl 2FxpNFLdlshRSLWPE7p7Z6mxTtIP/JyyB0Y+so2vakJ0ybhMWsFRjudtpFccIdo7apqG 04SoGRaSA/OFKjvSCs6Rt2zTxSpMpQFZKL3KBHz+wsmluzzG9+nvzfbro1fvqMfNmiwx FekhAxlvxQjVwaiGMOqFoAs26uL4aBZPeQ0WIuyCo/FY+L8OpTsz5Wkf/V+BxRxS9gHt NHEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=FzWxOk7e; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si12572576edu.40.2021.02.15.04.48.17; Mon, 15 Feb 2021 04:48:17 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=FzWxOk7e; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbhBOMr6 (ORCPT + 6 others); Mon, 15 Feb 2021 07:47:58 -0500 Received: from mail-eopbgr80050.outbound.protection.outlook.com ([40.107.8.50]:33952 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230223AbhBOMrX (ORCPT ); Mon, 15 Feb 2021 07:47:23 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gF+sbrB1PDGI8p5jfvVoJxop1SpIqxlFli7FYd/4+QoGjer76kxP16T/7x7RupDRrvRYbphFb+AxrzHDK3XBfXqgsIZq6a2FvBz0+DzVUiTfrL6WUu5tOfR9qXOYvW+zqzS2lrgkOxgaUik5lhSgBZo5GEryzNxYmQbNTg/sfE6s8JQr6ON4UM2OFyVmVJDJZjolNVmeuAifpQb28erhrsBuVmJm+gM3bPVxuO/X2vPR3EcyeTv1wkDxD5AztTOHQ920NlbY7yiWHUlWhoroqM1KoMLJmvPSSpgh0mmE/hCRGeX+oIflhiDzzwi0avC5ptLSk54C66EBE4fZm8YK6A== 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=dmoMHqZBPsl8SeyXNbGQhYN9YYgird0xDuOayiiXljs=; b=GPjzGJ/4udH+L/j+WjG3ZvZXWxMEps+w12bmTaONV4P2z/SF+jlbpdYTnPKiWkIuF36EVqHuiYJnz3iTpWjqia3iAMxDpWawiQvUYVbYtnmdGbgskqIssNWxtcILbZl2iyk8yCyglWVHNnMJZKoxmP3eh8vIV7RnrOL+0+qTZcK15aPnqs42WPlP5Ad15zsTXPVxO8qzxfXycx5mOo9j4dDLWwIaVgTHyOhr5YWKBHDzHsP8W+oPXPdF97yV2xciAN3VaCnxWVKr09DoXHtffyMp4cVomwr4mKQicCqYp2UA99n8woVqIwsuxc8nfI4KqKEHGveXwk2rrksMKv4arw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dmoMHqZBPsl8SeyXNbGQhYN9YYgird0xDuOayiiXljs=; b=FzWxOk7eaTRi0rn3G+PBtH0eALiQ4G47yUl3Z2iiEwTWAjrGGnegn1yt6EYebyWOFYnGM72fABVK2MKihVhVz2QYCxFkVrZJh1fH4GDa4+gjoDIQ5wFIV82u6t+eLHpxcXvQAAWM3h0IrEuwpadaqZ9RT+NUeLdNPS6eEjcDQCQ= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6859.eurprd04.prod.outlook.com (2603:10a6:10:119::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:46:32 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:46:32 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 02/10] dt-bindings: remoteproc: imx_rproc: add i.MX8MQ/M support Date: Mon, 15 Feb 2021 20:34:15 +0800 Message-Id: <1613392463-9676-3-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5e00b708-d42e-46f6-f5e0-08d8d1afb8ad X-MS-TrafficTypeDiagnostic: DB8PR04MB6859: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XMDKrhPy5sm1IW/z7p6RWPHgH4JR+gL2t4p7PDNzLDuFmlOnxSrZwczc3nS4zf4N0+ilef/7bgqHAssBs24sJEfLlIygB/ny43yE0v7QA76V9sOjzdbP4VvUfLDrUllkVp0kJg9Xa14xBHnBzmnMyWZLFS4+ALm1GXIX0qG/vnREuuHXwduoHbDRrvtJxMwtUy7V/fpY3o6vQxZ8on8d8FPxxrMptNWsgGju3AcJ8RxNRDrB2bCN1+Q/kpGv5zXryAbUySosnJ+IH6ZvN/8bB7ew+0uEXZhhrCTWXLdy4GXd5mCgMOwlJqzhh1osb8Ez6JT1qxC86JTzC+sSV3JjSI84sv9GlMGSadSikMva6QsDCtHwmEnGUApK7HBsMFsrVvDDNugdcDscKXywQ0lQZ6CGylb8l2jLycNhqImaeoAuaYoXbxJW6fOFJxk7ZCRE3UiSAPmKhrzbaxfPaqpUxV17G7Jku5FXcW4kBL3aDyvUKdSjfCfFqXMJuO4ZLx7nF9Zr54u1M47iTOQI/WrYo+2yzEW0Dlqpbuwq1qIes+FRILdu9B/dlzR888CfhfPw8YQae81HTTohlVFD91JAJM+mBUFvJKnDimyEVS97owuLEKNchBuEUsF22tqqHPmr9oHthDnqWmeqVXZNJvDngTVx5zfscS94ZjM+NwlG+Jg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(376002)(366004)(346002)(8676002)(6506007)(26005)(956004)(2616005)(2906002)(8936002)(5660300002)(69590400012)(16526019)(66946007)(7416002)(83380400001)(66476007)(186003)(66556008)(6486002)(4326008)(316002)(52116002)(6512007)(9686003)(6666004)(86362001)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UV4vTQVxgIuLit2WzZY8IeeIcDIOmk1Yv4d2XEWqsLqZoiJUSv8jJvWEmYPNggdLPp080X4OHkTrO1iLFfpokzUCpS+qL+prUZE+rCzI+CcPsFJHTb7AFtaTB7Wj9rJFYOUvdKlvm5PehFqJfBt10IL0eMLPBkvJLxWvXP+zzYnoqoA/SJrdhWcYsL+IMo1lRuXYBEdbAhhlUIpPMd6co8/fWUO1zTpEnjVDXYa3FuDB+yjWGyGPLULUsFYNybVcsyzCFDml/Pg4cdicx28uz2jKzV+jX81+1Ua73ZnhglP6ZLaRftmfCE3j3B/WgI1NyG4GxGwwDJRUNIyzk5TWYEiJJsuhInUZd5Js4YHb/xcdSdzo30sOUHF2W3GFN8XmoFARsqzYRhVBPKCdAPiAg2QVjHNMfUfN/+1KVfhlAe+9SxLKCKZ0N6mrCrANqeMLI16YhsbySFraIgnczbDbdxdeADH1tv8EdhFa7eNap1ZFiZwu6lBFD01ZtfxYYZR9tlOZYoFCt6z8DEBhF4DtxKksxlfGZGZLuZMS8YBwzDTsnYskV/F+iZsJf1hm4+5k9eCRnxPo7QwohCZChKrC9Z9hVDJFd+YCMcUnvZjQPVuwViMKCVPX4qZSs9R289wsJ2rgTJHE6JCrk2nOk8HJAaBWX4ICat6uzzbQJJTaQrlr3TIpb6hI62yxcnWOjaO+KDaO6Axs6InhG5qaFeq99XHJnmV9Wz/rkVIKZSlGrzqoRldSj/dAz/mZOaCQcEvcimsPziBpQ1PNRrEPZXdZ7DZcmwOOLKnEJm/r3JpDixUDWO3GpXc3EpTLmCbwb+0vcsomHtN5Fc/rEDwrus50QjMuOKy2OJk3xWrTDspbtKujlnZXV1Kdo5nbmDL8Ndq1VkmCg6nFzqNLxTgVjAtxswv60D25PtXhgI26T58hjdvjSSv9OiCWqEq6j3SZemnbBIf56mw2uxvSD/XYl7VMpXnGNLO/vV25hAd0yIryiniFt3pmvrLGUI1NywIS3fV5MixAOCK7CE+Yv79XV4Oa6N70PGDUbwWzJnjroHPOmpktwsoFEQc7guScs8OAZg+ySSqblguNIYTEjR37WGZdYBnEmLvJT3zYx7/Ue+BMIdJRuUM91DxA5mcVpyfT+/4JI93g91OT3bm/+rhF9NK+pzMcYm97rHrhsUQVuE7dzfvm3hrxEhIlnVc2bJDw0cFP94dGbroH1ZDiZ0uY5MFffsqHuMp5YLZTynxpQBXxjM9si/xGwCRrg6b/g62nd3FK6Q6SglcejOaZvNQeJdQR9nDUb8SpTuwdEbGfGg+rlfQ4poje7lW0sp8/lxRsmTeY X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e00b708-d42e-46f6-f5e0-08d8d1afb8ad X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:46:32.3174 (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: TCCcCFrzfLkQc1J+FZG7YO9543Ll+FaUT3mGDKKeVeJj8uwj6HtJePHnOIFzPFhnWVVXC8kQdVY6p7rdM1WiWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6859 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Add i.MX8MQ/M support, also include mailbox for rpmsg/virtio usage. Signed-off-by: Peng Fan --- .../bindings/remoteproc/fsl,imx-rproc.yaml | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) -- 2.30.0 diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml index 8427d0f6e471..f87e98d98413 100644 --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -4,7 +4,7 @@ $id: "http://devicetree.org/schemas/remoteproc/fsl,imx-rproc.yaml#" $schema: "http://devicetree.org/meta-schemas/core.yaml#" -title: NXP iMX6SX/iMX7D Co-Processor Bindings +title: NXP i.MX Co-Processor Bindings description: This binding provides support for ARM Cortex M4 Co-processor found on some NXP iMX SoCs. @@ -15,6 +15,8 @@ maintainers: properties: compatible: enum: + - fsl,imx8mq-cm4 + - fsl,imx8mm-cm4 - fsl,imx7d-cm4 - fsl,imx6sx-cm4 @@ -26,6 +28,20 @@ properties: description: Phandle to syscon block which provide access to System Reset Controller + mbox-names: + items: + - const: tx + - const: rx + - const: rxdb + + 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.yaml) + minItems: 1 + maxItems: 3 + memory-region: description: If present, a phandle for a reserved memory area that used for vdev buffer, @@ -57,4 +73,37 @@ examples: clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>; }; + - | + #include + rsc_table: rsc_table@550ff000 { + no-map; + reg = <0x550ff000 0x1000>; + }; + + vdev0vring0: vdev0vring0@55000000 { + no-map; + reg = <0x55000000 0x8000>; + }; + + vdev0vring1: vdev0vring1@55008000 { + reg = <0x55008000 0x8000>; + no-map; + }; + + vdev0buffer: vdev0buffer@55400000 { + compatible = "shared-dma-pool"; + reg = <0x55400000 0x100000>; + no-map; + }; + + imx8mm-cm4 { + compatible = "fsl,imx8mm-cm4"; + clocks = <&clk IMX8MM_CLK_M4_DIV>; + mbox-names = "tx", "rx", "rxdb"; + mboxes = <&mu 0 1 + &mu 1 1 + &mu 3 1>; + memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>; + syscon = <&src>; + }; ... From patchwork Mon Feb 15 12:34:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382944 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1046682jao; Mon, 15 Feb 2021 04:48:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoo3gd84BDeDpZPs/ZfpCfG+W2YPiDNPqyZ56L1i5+hhOQS+H3pVKeXwjSaxL3XiJ+rZUa X-Received: by 2002:a17:906:3456:: with SMTP id d22mr4992903ejb.115.1613393300658; Mon, 15 Feb 2021 04:48:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393300; cv=pass; d=google.com; s=arc-20160816; b=hdzRRgwscD/q+ySF8+bNYRqWPzZxrd4ldt4Mmf5a1dm6B3TFO4Q8RIc6xLiNcSLjp1 WEUGHk+lRrxz4DCoURFUd/QS4LzI7mA9sZYbMbj6v2msvauWASk6+wcdhp6sEp1uxVcu 8eOu7acCtkZanQGKCTOru3er+z+eK+loqzUKp16JJ+VbidNFoAeni2zS8OQYuEjWW7Sv O2nxWcAlYC1VKp6cOY3HjzJRJfEwYsvHOpvfYmzHgFGBho0eBO6597m5eMF174Eo31m8 pwVRvf0Clt2H1ljJPSdIbUFWKeuhif+gw7TFlCWCKspFrJBCKNj58EjoDTsPHft4qa3Q eC2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rSh0Klx+zNLSyY9W2gwUiOZPVVqrU82ogdPg4tjElUs=; b=LQvJfyPmi/605wSwHb/MgsyZrrKjoB/JVlOL9W+5Pu0MDgYoiOwkwsQhfC3GhT5wKH d0YqGcCV9HYJ3ZObtkYlcxqvUhrKk+HWCdu4GwhpAewf3Oh65hafWyCpzXkWV19SwYeQ b2ghcPA5dPe4xXnzP1nAWXkZHVmMDSpJsHioqTHTM+QMDk2Pg80EHfpL4E9zfLD5TqQG ncV0swOhg1sNdUY6ikPMhfgK+QKY+JcoG64USR82lfRAejH/Kw8Bwjt3qpDQT0Z+aVq+ buxH5ctvS80w2ubRvji36DLirxX7QOZGW/CfRWI+OQi5NDEO79NCSNDavuUOeYiPePAA GOSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=jU8Wi+6d; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si12572576edu.40.2021.02.15.04.48.20; Mon, 15 Feb 2021 04:48:20 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=jU8Wi+6d; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbhBOMsI (ORCPT + 6 others); Mon, 15 Feb 2021 07:48:08 -0500 Received: from mail-eopbgr40044.outbound.protection.outlook.com ([40.107.4.44]:27717 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230267AbhBOMr3 (ORCPT ); Mon, 15 Feb 2021 07:47:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a56AWsNY1UaWLf6MAR44OP6V0mQKFBFyXGOJMiyow5lC/pu4KzhO6bvhygdQmzEy8cDmn9BTAHyg6DgPpr+908P+Auh2NxxV0XKi8AzL0fcx0pHiqgEmKoWb+exyITlqPK3tRjNhyAfbFQtJfx2YsLcSMr1O8JwFf5T04wJT4FAjvnT+2inznXD5S8BT6rm48/dcZB1GhMoFM115UyaqPvWAZ3R4AkteB2NuOSP1FfvbrGeN+uknMZ8RCrNp+XgxI4Fchw4WKlENLQAgWqVatq29kbppSCgQs3suApbQeTZN23P0sUIJznQz4qdJA0h+gXAAxLqa5rPTOqEFR3nPfQ== 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=rSh0Klx+zNLSyY9W2gwUiOZPVVqrU82ogdPg4tjElUs=; b=gVXvPdVPGHWtrT5Juzsk0XpLqBfRFLAM3rFaVWJnJflUU1PC2kJcfQR6FxBI5UuNmK3+Crmnm+JDbFW2MeMPIucESwOYGZwjhjat5e/05mze71ajwfePN7958jxo5tcQM9zseIXDtpK9HCq/c6xKcKrJJ5ffKV8K1kOG9/ucZHADapU7ggOqjep6+Kr1TXz2oxpaakALhp98uiVO33NZLyGt7Ri8vSDwdvbXM2727RMsl3a+G8N/1sxurg7syK7GFjYstXFRg7qcGo2B+PwjoscVejwDpPB6FRRDzb1Nik12P/tahrvw3IjwTKiS/pK5R/W3XK/kk4aSUIWBAqsyWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rSh0Klx+zNLSyY9W2gwUiOZPVVqrU82ogdPg4tjElUs=; b=jU8Wi+6dVOME2WUH6HGLAR1MFIip+dL7gez96+YzPA4131rzL3o9HzoHy9YOxE4Tn0pc3KdsFzjJfLBkAsaEJs8KPIFlklVWt99LnoKly0XZ4aXWgy6gmGydOMCm2gOrGLmkH23p8jWByyqOO6fD6DTxk913WxMJCRCItreHdCQ= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:46:38 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:46:38 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 03/10] remoteproc: introduce is_iomem to rproc_mem_entry Date: Mon, 15 Feb 2021 20:34:16 +0800 Message-Id: <1613392463-9676-4-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a702995b-ef96-4bd2-cef7-08d8d1afbc0f X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hDrcA0Cxt6619pj54VI7XahowygU0bpacIrbUJldhb2dDV+aAJSleLBjMXA17+CTLJEff1X7kgK3xJ2yBWIHYlSEHTSay+WEEYQirTwhRBQBR6B/xgUDfr6GtKCSjWuke4IvOJ1am+Rdj8Qfct0G9DMBt1/o8hT1Dn+zLLZCapB0OuqK+C3XN2mO5fS2o2JGAGYRUSoayZqtcMsjI65p8PjGw2NQ3WVVmcHkLNU+sMMR2sdsUt/uxrdNOZItVZchfEkFpQtEnY8s0Mchf1Qx+T/OKiiqgqU5yGOFE2O5Iw1iXoFGoFgnSaa5YKVKij6w/ogxip24mME56m5sihmLWQ4BS6GyCebKmwJwaEtWa2CtJQ8/Pj0atTqfv4CYv39YHnsXAfnHQnrVEoEZd49h3HrJT+BfdBLn+vLfRaKgAw2U4v4YkNNigRYihNU/f7pzR0hR99D8iskth/I1h3v29igONhETy1zq7+qIPmT0DzsfZI8gQMHd7OIxPqhSPNlHd+of+v4/MFckte4CgfpFQlcDDmtLUYzthkVWeI3WnhWOba/JxQq+HBfjixWXy/WNqHE/ZsZDndXBigDkdUl93A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(4744005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EVTmGrFw2C5K1cfyYZKypnRVrNMgPJ9Kxd5Ty+0zDQm1JZowgF/sG2mZ1WZDlhULYq5bk9+lrrIgmXj9bW11tXoEVo6z7z5wWiIZpGW5OsWzZvheGiojKQ4afl7IwFu1jFjcZdjF/0lzXWU0W5enTskcIjuCskgktxzcMICdpHTmuZGXrWIdenfWNXM9KHwBH3BMkhUnD7V0bAd4VV8+rm+lz7oDXktbuwnhqUrytrKPAkF2UFB0rxMCtA+54lgpg2hOg5ed3lyhciD6ULQ5L0lweKacpbwC/cUt7+hnRuaf4ItRIv91aiSwQZ0ZxP8OLthEB6ux3ATaz6WLvKWv66WDAZABhlhKKK+JifEHbuxVASINKHyyRUyjG6WXNh+YX79J78TUox9KKbkSIIeegW9p1qhrlOfZBtH/xZfsU9HsWkM9TthVx07lRcdqA2KxsBBgyj6mrPmD0/i0EEDQ+GeInkcaND72xUNmHeuW13TII8U00qp1Kccp+oIvwiCCa0e582iGuuhs+N0uCW6ya2DCz9ftuAlQQBZXSeUR5YjGx/Ody3uH6HMWrUZfn+XDaW7LpnwYTmtrjNOvVNkBEoQr7R2U/VEhbhRj2V00xiM4kT9Mqz5Gnkw5Qk+YjeQs7xpEs8dG8AdeemOsDnilA7D9rjBBWp3MWmTaGBi3Di3h3AOIqCUo2PWoEmYI01kBKw/+uqaSoXJgMxvPqh+3BZGm/z0po6CnZwpE61oTbrlFi1ksYSJsmlZHvSMOAMVtppyRmtsnLDeClUin2/6oUqPXIAk4go3/qBo1M+Bil2WsU5tBH/o/jkZAdYXbRlYn1i/pX3t91mV1Ct+/YszHszE5kKnlW77F6KYE4qNcAlHRukRPQyHz1XH0UZUGX5GvudH6vgFi0USRVpoU4E+fCxW86a03sBVE5rh1fOv5sLyneA8dOgyV+6kUaTQk37QW0E44pd1Eet+zHRVJk4Aelx/bwaU9JVg2EKgST6m1jb0kXqNWfSG5Dj78ajfSk5nzbIRja4QD+6dIxXuF9/71PX8KvPOVKqhPrq/5BpPJrFiWuKv0S3H0IcLjBs1jTtoD2OL603UTky8eM3MwMbgxIJMoDHnHDjLGFyufp72+jDoLEgsmE1jTPx6UZn7eFVV2I20EUjW9xSZaSbCt73LYVJeJNfLyfGt8kWIK3UIyY0AgFdSGozImd4WPTgk0KQ568zh4+TFJoTjL79LQtBNJH9J+QMLmtI0B7m+sKC54SxTjJeV1H4dezOLC5fTakZW7sSQsQXu6LEqZRpIyHI1AFiJk5Ifbt2kUkRcseHxYOnS+uKoEtsuCG9UJBL/sr1H2 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a702995b-ef96-4bd2-cef7-08d8d1afbc0f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:46:38.1058 (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: bCpEHq0AIvikTtXNE7TU/+W2UY8DEihpwEUZTl8A+5hcXBtAEO5D064R//Ds26ubeqj0KGcYf6EiDk5EcEK43A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Introduce is_iomem to indicate this piece memory is iomem or not. Reviewed-by: Bjorn Andersson Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- include/linux/remoteproc.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.30.0 diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index f28ee75d1005..a5f6d2d9cde2 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -315,6 +315,7 @@ struct rproc; /** * struct rproc_mem_entry - memory entry descriptor * @va: virtual address + * @is_iomem: io memory * @dma: dma address * @len: length, in bytes * @da: device address @@ -329,6 +330,7 @@ struct rproc; */ struct rproc_mem_entry { void *va; + bool is_iomem; dma_addr_t dma; size_t len; u32 da; From patchwork Mon Feb 15 12:34:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382946 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1046722jao; Mon, 15 Feb 2021 04:48:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXJQkKEkwt7EASo5l/5FtejbE4S8ZpcICt7x2QVs7lVXqc4OKThfK/BClAdbcSWkOKp13M X-Received: by 2002:a17:906:15cc:: with SMTP id l12mr9761668ejd.280.1613393304305; Mon, 15 Feb 2021 04:48:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393304; cv=pass; d=google.com; s=arc-20160816; b=at2g9g55LPoR4ZHmO3aM5Ej3S4h/RNG/dz83xVOVQvjxrmAy66R7GX2rlkthZI3RqM R0MYR2/ARKUsauNLFmlHuLwipKEA9NjfRrLHQ2Dze5ihMAjJiLKZd0DKydHoCawdrFZq NhwgjeLF4yV7HUSRxPAInbtJoqDxR83fF+04SwOY4DFTuL6Lo2l9lEYregudDOpkPmZh vEpM//eBe0v4/EhVEncVrXYlOQnPGt5dGFczkI/0yoi8FRBeleg6SoPerKZ/R4F8btxz e38yv4ddmEdcveTu0/zc0yKDKSvvlXGJEQ3+JVpC0H36Y0dhPvw5MVKZony7F566V5k5 fzfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=h3macN6te2ODWmWB9GoKYvgu/NuH/FlGc+HqUZ8HFWY=; b=J/Fz8HSRQLXWCmDEdwuTVGH1wEh4DY8t/sVaeFbdzdvWrwoiiRlpuw6xXast0F+wP5 vj15NhmpsrE19pDM2xBkQkfyxwR5FLnogTOMs8/Gfwtqgmllx7jgmoEaoRuVTatGeeM2 SRZKLMmx2QHKsC1mDExsy5lregL8TgbSU38QHqVZOAhqMXMlTfbc2XxcUJaiehdbnAjX vcwGmwqsy4OhumsASM+dFsX9242oa+qnzM6yHpn2tgQCs2yVLOkbSwyoTe7NBMkgA/e2 dUJfaC/EgrKjaMyBkdr17AqxsCP+VssF/GnKdWTOUoxVLe5v343GxO12+eDFLH2UALN0 jiYA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=RBQXpU+A; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si12572576edu.40.2021.02.15.04.48.24; Mon, 15 Feb 2021 04:48:24 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=RBQXpU+A; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbhBOMsU (ORCPT + 6 others); Mon, 15 Feb 2021 07:48:20 -0500 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:27341 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230232AbhBOMsH (ORCPT ); Mon, 15 Feb 2021 07:48:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ciCJ8dHMWPTljBiKHxd2pw9Ug1oiBxKm+fQaawcHDSlLYeJsb3SrZjKfWdrb911DIIazS7GndxrX6Zt41fdrrMjFQg/AvNUjsKDdtd8r6wAzcPi516EC1ULlUlpKmH4yLtvAo8ffP0oD8JcFQyjty6FYBXcG4ppdW1W6iWEjeowVTjeFGl1uuFYHoez3FDuTpDoLVPhuo64t3n0DWaS5LIvSJhc6bRhfqc/ackJgee4kiT9Je9EjdrkHQGpJud+wnYSK63HB3kq2St004yDgZEaPb7ArPVgW7uZB+fmkKRhDTW+ZdahJdPf2CYq5Lkmw4SW3rl7c/fwFuinf7j3MJA== 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=h3macN6te2ODWmWB9GoKYvgu/NuH/FlGc+HqUZ8HFWY=; b=hVi+zmDzeqEbjjsdvPlr0QlW33iUPdXbOJ8wVtc34cHYRWX0Co5rl5mqdeSFoz7atH4JBMOrzy1/aawXn/C4o8PTvfb4ZRlTgtXtQpOZZUE4VZrXpVf6C5XmLwghflN4hZL/qvB8ldST9k24pxo6bOPFw0yIQF019EGHEGCH+Mr8CQFSkpRnUMEHkR96BpNAJBh288rbnkzQ/F8hI0VAtjtzRWdMkdTcc4rAcQqAoZFSILoHBNrDxj6Knchb34vGpogGxrxdd/p7bFi/E4NVdM7OyX8V+rfEzBJ1IxAJrGpvSTAAuzTCypsxvBTeeZdALTe3zsr2tf2vEmBUj1Q5vQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h3macN6te2ODWmWB9GoKYvgu/NuH/FlGc+HqUZ8HFWY=; b=RBQXpU+AChJqTJSFK12m0xIV7d1B3LHpkrzXMFuuQcEul57pJV3AJx6qQ2CWl/nUipHHtk2+sDvyO2U8gJLx7CcQ7z3cLUbm2UPjyry93r5sp8gXOBmTlpwbescOT+6jpaq/ARSp70pZNpUEZVM1xNsz0xDOolUnJ3jz/F0sIlM= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:46:44 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:46:44 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 04/10] remoteproc: add is_iomem to da_to_va Date: Mon, 15 Feb 2021 20:34:17 +0800 Message-Id: <1613392463-9676-5-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 46d0d39e-ac22-45a2-f56d-08d8d1afbf83 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FUNpQt/7mbuc4bNMGBm92VdhBkwK/iHH5xW9b5QUUfMMfebDT3AYVMM9R5ABtHIh53W9s9l/M8luryOiF372JPPDMeYYq1j1ybIfnQ/6CyKildiIxQOYGLzE8D2AA+dDmm3zfateKR8E/alkWLLQws9ekQfxuCcUOxKDBXhFfv13qsozIbWhH7VVU2/a5O7fjFjcouzhaEewJUKecoluf/GSGCsIvLcxZ5NM/wZQHiOOsrvG589/PTm68R1Noojp72vbUf1LN53rlUU74SqODm1HYH3uGYYvzXXQdPYTbw1Anpv/t+n8S1ZO1Z3zpTvcxwlbH/xt+f7WdNFmO5LyqXhnqeCNu2iahwrSXD+5wBirld8npYv4Xern5Ov5S/L8Ta7fFGIbyJacsVQ7qmlAIzR6IwZEpE/DtTuKkWfVMdiXatcUYeK/7SWbo4lzCSsefGSrjWN1isor3ZWLXoYKLK5PC9EsoB8W9tutXbpe9ehGpsMI97tkvmR9ZJzq5ywjzJICf2A8eUlQbbu8C8Yotqpby7tt5zpLM2lPDHwr3sHK868820rBGykQ/+uEg73nuLHmBv5gEedZPPACrrCp6g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(30864003)(8676002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Xxzkntt/6kuQFEEj08yES0Ee2mSX80R/xWEs5j7p1LLeIRnRs8Phd4pdBuZSPWAoG+ZweKD/iFrHkt47RwynrZDZg8sT6YmO95/94abcuBUgRQ2eJgflC/wh7wKFxawDoU1RLa34XAc223iFcaUsc3lU7FA2+ehZ4R8xZ3gtFC7bSNlpqQIt8IuVdAwHKH3sXfYuxkmO12nXVBAHzCWnld0z4pITzPaprwJ+NTvBryt6oalQAhXpoo5v+hAqIPyt1FKBwTmnoaBynNOhTCXr0RTjFSqgNdPHl/PIXAzUodbjxrf2Cj7smI5sPioWcru5wvWDGjVB10mi3zAqTIXlpc9FQR4sXyRLPwUyexGm/TDip5TW+p1KtaW4XBAzfbXwLN/UJRh3gC8WryZxHY2aC3+bd3TUKfnw2e+I5Pt4bQ9bzlVohA8mg525MvemudIva9lAfr703lyRvtQiQyv+ok6jlX7N38qbAl3qCEzBQpbmcNEzQRBuChoQdMb1/Iky4eyCazmlCGik1994x7B9Z1bas/rvt88GGXWI06O9CCWXlmu0tieRJGJC1dr5S77PHRXbJnL3oZlEcUXhZwTzxH3hvG6s5hxA5Il7LMw5jo5rLJra7my2uZhfzffx71Jf1llT7I4YPJNE5CVKVXKfEj82gTuRvQqJvEe1Djanraa+gyKfoZ3naOIZqrEtMKI1U1NG/ho016QX+AFsisTCNIgFg7eADzhrYKqlic6MJiQgwWTKCrw24vPZKK/d+k9GuFuFQCU7gCX4taG1uSGc+r41ztv6CfFLWmnYIYCW/FjF7jYDGw9L3yzhDlwuYHGfILRItD9ibzkpqm5jGN0KuWYGU3Zjeb4bXDhqfi7ap08uAIVPX2ggxrnwEFFw9kG/12s+hLB5x4QPMwa9Ap5UkdxlmIGsyO6ZKx3sVH0ncEbFOeJhjE2RFWuCWKQqVrqdEdFgVYK1lIJeMvdLkDjlLKchDpwWKI4lnlpc/UKPAC3opPM787DTdqPLx/2X7pCD1dl97CM1iZuyOwXPVdFaYWx+fkNHpYdK663Wjg6ARXvmHZrUJhEIZTPNlI8Y3qkNaeHI5eo5zP485Gjf9vrlWgbpayogGQwSh2GqBqxTlLbql62Z44cSy5L+0t7o7/NH4poMvy5Kh96i5t40qPLSkdXIiJKbPWT6FyUsqXpy43FRufp+W4rP09t1Ied3fVzjMrwQhzn11qORcm/oRue51oxWShn9m1Ckz2ymxbttfgCRLrnfCAT1Qsp5p7esEm8BFIs+sUNlCr0zxjeFHJCemq4thEMiH6xAKT3fM3hE+auLS0kHg6N/MAWs10HqiJc8 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46d0d39e-ac22-45a2-f56d-08d8d1afbf83 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:46:43.9951 (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: 1TX05lO0Dfi2t9mMMwRPLP2CoCuDLHzvRdh+LVgYQcTy/0edQtFB2TLAfTKSVjtsszD9LWhpO0ElpeXpQSoELw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Introduce an extra parameter is_iomem to da_to_va, then the caller could take the memory as normal memory or io mapped memory. Reviewed-by: Bjorn Andersson Reviewed-by: Mathieu Poirier Reported-by: kernel test robot Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 2 +- drivers/remoteproc/ingenic_rproc.c | 2 +- drivers/remoteproc/keystone_remoteproc.c | 2 +- drivers/remoteproc/mtk_scp.c | 6 +++--- drivers/remoteproc/omap_remoteproc.c | 2 +- drivers/remoteproc/pru_rproc.c | 2 +- drivers/remoteproc/qcom_q6v5_adsp.c | 2 +- drivers/remoteproc/qcom_q6v5_pas.c | 2 +- drivers/remoteproc/qcom_q6v5_wcss.c | 2 +- drivers/remoteproc/qcom_wcnss.c | 2 +- drivers/remoteproc/remoteproc_core.c | 7 +++++-- drivers/remoteproc/remoteproc_coredump.c | 8 ++++++-- drivers/remoteproc/remoteproc_debugfs.c | 2 +- drivers/remoteproc/remoteproc_elf_loader.c | 21 +++++++++++++++------ drivers/remoteproc/remoteproc_internal.h | 2 +- drivers/remoteproc/st_slim_rproc.c | 2 +- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 2 +- drivers/remoteproc/ti_k3_r5_remoteproc.c | 2 +- drivers/remoteproc/wkup_m3_rproc.c | 2 +- include/linux/remoteproc.h | 2 +- 20 files changed, 45 insertions(+), 29 deletions(-) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 8957ed271d20..6603e00bb6f4 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -208,7 +208,7 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, return -ENOENT; } -static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct imx_rproc *priv = rproc->priv; void *va = NULL; diff --git a/drivers/remoteproc/ingenic_rproc.c b/drivers/remoteproc/ingenic_rproc.c index e2618c36eaab..a356738160a4 100644 --- a/drivers/remoteproc/ingenic_rproc.c +++ b/drivers/remoteproc/ingenic_rproc.c @@ -121,7 +121,7 @@ static void ingenic_rproc_kick(struct rproc *rproc, int vqid) writel(vqid, vpu->aux_base + REG_CORE_MSG); } -static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct vpu *vpu = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c index cd266163a65f..54781f553f4e 100644 --- a/drivers/remoteproc/keystone_remoteproc.c +++ b/drivers/remoteproc/keystone_remoteproc.c @@ -246,7 +246,7 @@ static void keystone_rproc_kick(struct rproc *rproc, int vqid) * can be used either by the remoteproc core for loading (when using kernel * remoteproc loader), or by any rpmsg bus drivers. */ -static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct keystone_rproc *ksproc = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index ce727598c41c..9679cc26895e 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -272,7 +272,7 @@ static int scp_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* grab the kernel address for this device address */ - ptr = (void __iomem *)rproc_da_to_va(rproc, da, memsz); + ptr = (void __iomem *)rproc_da_to_va(rproc, da, memsz, NULL); if (!ptr) { dev_err(dev, "bad phdr da 0x%x mem 0x%x\n", da, memsz); ret = -EINVAL; @@ -509,7 +509,7 @@ static void *mt8192_scp_da_to_va(struct mtk_scp *scp, u64 da, size_t len) return NULL; } -static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct mtk_scp *scp = (struct mtk_scp *)rproc->priv; @@ -627,7 +627,7 @@ void *scp_mapping_dm_addr(struct mtk_scp *scp, u32 mem_addr) { void *ptr; - ptr = scp_da_to_va(scp->rproc, mem_addr, 0); + ptr = scp_da_to_va(scp->rproc, mem_addr, 0, NULL); if (!ptr) return ERR_PTR(-EINVAL); diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index d94b7391bf9d..43531caa1959 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -728,7 +728,7 @@ static int omap_rproc_stop(struct rproc *rproc) * Return: translated virtual address in kernel memory space on success, * or NULL on failure. */ -static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct omap_rproc *oproc = rproc->priv; int i; diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 5fad787ba012..8df99318f18a 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -483,7 +483,7 @@ static void *pru_i_da_to_va(struct pru_rproc *pru, u32 da, size_t len) * core for any PRU client drivers. The PRU Instruction RAM access is restricted * only to the PRU loader code. */ -static void *pru_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *pru_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct pru_rproc *pru = rproc->priv; diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index e02450225e4a..8b0d8bbacd2e 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -281,7 +281,7 @@ static int adsp_stop(struct rproc *rproc) return ret; } -static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index ee586226e438..333a1e389fcd 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -242,7 +242,7 @@ static int adsp_stop(struct rproc *rproc) return ret; } -static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c index 78ebe1168b33..704cd63c9af4 100644 --- a/drivers/remoteproc/qcom_q6v5_wcss.c +++ b/drivers/remoteproc/qcom_q6v5_wcss.c @@ -410,7 +410,7 @@ static int q6v5_wcss_stop(struct rproc *rproc) return 0; } -static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct q6v5_wcss *wcss = rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index 2a6a23cb14ca..3a131163064c 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -320,7 +320,7 @@ static int wcnss_stop(struct rproc *rproc) return ret; } -static void *wcnss_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *wcnss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; int offset; diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ab150765d124..a1df4d7e5323 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -189,13 +189,13 @@ EXPORT_SYMBOL(rproc_va_to_pa); * here the output of the DMA API for the carveouts, which should be more * correct. */ -void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct rproc_mem_entry *carveout; void *ptr = NULL; if (rproc->ops->da_to_va) { - ptr = rproc->ops->da_to_va(rproc, da, len); + ptr = rproc->ops->da_to_va(rproc, da, len, is_iomem); if (ptr) goto out; } @@ -217,6 +217,9 @@ void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) ptr = carveout->va + offset; + if (is_iomem) + *is_iomem = carveout->is_iomem; + break; } diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index 81ec154a6a5e..aee657cc08c6 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -153,18 +153,22 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest, size_t offset, size_t size) { void *ptr; + bool is_iomem; if (segment->dump) { segment->dump(rproc, segment, dest, offset, size); } else { - ptr = rproc_da_to_va(rproc, segment->da + offset, size); + ptr = rproc_da_to_va(rproc, segment->da + offset, size, &is_iomem); if (!ptr) { dev_err(&rproc->dev, "invalid copy request for segment %pad with offset %zu and size %zu)\n", &segment->da, offset, size); memset(dest, 0xff, size); } else { - memcpy(dest, ptr, size); + if (is_iomem) + memcpy_fromio(dest, ptr, size); + else + memcpy(dest, ptr, size); } } } diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index 7e5845376e9f..b5a1e3b697d9 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -132,7 +132,7 @@ static ssize_t rproc_trace_read(struct file *filp, char __user *userbuf, char buf[100]; int len; - va = rproc_da_to_va(data->rproc, trace->da, trace->len); + va = rproc_da_to_va(data->rproc, trace->da, trace->len, NULL); if (!va) { len = scnprintf(buf, sizeof(buf), "Trace %s not available\n", diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index df68d87752e4..11423588965a 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -175,6 +175,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) u64 offset = elf_phdr_get_p_offset(class, phdr); u32 type = elf_phdr_get_p_type(class, phdr); void *ptr; + bool is_iomem; if (type != PT_LOAD) continue; @@ -204,7 +205,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* grab the kernel address for this device address */ - ptr = rproc_da_to_va(rproc, da, memsz); + ptr = rproc_da_to_va(rproc, da, memsz, &is_iomem); if (!ptr) { dev_err(dev, "bad phdr da 0x%llx mem 0x%llx\n", da, memsz); @@ -213,8 +214,12 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* put the segment where the remote processor expects it */ - if (filesz) - memcpy(ptr, elf_data + offset, filesz); + if (filesz) { + if (is_iomem) + memcpy_fromio(ptr, (void __iomem *)(elf_data + offset), filesz); + else + memcpy(ptr, elf_data + offset, filesz); + } /* * Zero out remaining memory for this segment. @@ -223,8 +228,12 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) * did this for us. albeit harmless, we may consider removing * this. */ - if (memsz > filesz) - memset(ptr + filesz, 0, memsz - filesz); + if (memsz > filesz) { + if (is_iomem) + memset_io((void __iomem *)(ptr + filesz), 0, memsz - filesz); + else + memset(ptr + filesz, 0, memsz - filesz); + } } return ret; @@ -377,6 +386,6 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, return NULL; } - return rproc_da_to_va(rproc, sh_addr, sh_size); + return rproc_da_to_va(rproc, sh_addr, sh_size, NULL); } EXPORT_SYMBOL(rproc_elf_find_loaded_rsc_table); diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index c34002888d2c..9ea37aa687d2 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -84,7 +84,7 @@ static inline void rproc_char_device_remove(struct rproc *rproc) void rproc_free_vring(struct rproc_vring *rvring); int rproc_alloc_vring(struct rproc_vdev *rvdev, int i); -void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len); +void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem); phys_addr_t rproc_va_to_pa(void *cpu_addr); int rproc_trigger_recovery(struct rproc *rproc); diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c index 09bcb4d8b9e0..22096adc1ad3 100644 --- a/drivers/remoteproc/st_slim_rproc.c +++ b/drivers/remoteproc/st_slim_rproc.c @@ -174,7 +174,7 @@ static int slim_rproc_stop(struct rproc *rproc) return 0; } -static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct st_slim_rproc *slim_rproc = rproc->priv; void *va = NULL; diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index 863c0214e0a8..fd4eb67a6681 100644 --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c @@ -354,7 +354,7 @@ static int k3_dsp_rproc_stop(struct rproc *rproc) * can be used either by the remoteproc core for loading (when using kernel * remoteproc loader), or by any rpmsg bus drivers. */ -static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct k3_dsp_rproc *kproc = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 62b5a4c29456..5cf8d030a1f0 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -590,7 +590,7 @@ static int k3_r5_rproc_stop(struct rproc *rproc) * present in a DSP or IPU device). The translated addresses can be used * either by the remoteproc core for loading, or by any rpmsg bus drivers. */ -static void *k3_r5_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *k3_r5_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct k3_r5_rproc *kproc = rproc->priv; struct k3_r5_core *core = kproc->core; diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c index 92d387dfc03b..484f7605823e 100644 --- a/drivers/remoteproc/wkup_m3_rproc.c +++ b/drivers/remoteproc/wkup_m3_rproc.c @@ -89,7 +89,7 @@ static int wkup_m3_rproc_stop(struct rproc *rproc) return error; } -static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct wkup_m3_rproc *wkupm3 = rproc->priv; void *va = NULL; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index a5f6d2d9cde2..1b7d56c7a453 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -386,7 +386,7 @@ struct rproc_ops { int (*stop)(struct rproc *rproc); int (*attach)(struct rproc *rproc); void (*kick)(struct rproc *rproc, int vqid); - void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len); + void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len, bool *is_iomem); int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); int (*handle_rsc)(struct rproc *rproc, u32 rsc_type, void *rsc, int offset, int avail); From patchwork Mon Feb 15 12:34:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382948 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1047359jao; Mon, 15 Feb 2021 04:49:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWNwywRTx/yTnbaXFWIc7vu9MBgv1CRThRVtjLhhkfkTFKQxDnRJRSUuhO6gmPvl6g7GwI X-Received: by 2002:aa7:dd08:: with SMTP id i8mr1235800edv.1.1613393368097; Mon, 15 Feb 2021 04:49:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393368; cv=pass; d=google.com; s=arc-20160816; b=o88YRhQTYg+NuM0zF6k1DFShFj9DCcgB8qrqNG0NWlkbbzYU5Fkvns1Q7AsZjko1Xa zLT9CpQXXYcdZQCFtNdkiDd55NorXu0HcEfQGXIBmg+6KemHNgdIk3RI8hmrKNdxH3FV 7ahWtPdbsTIiWocajs68b78msf15sJ5zsHcwatbj1qA0y0z2bF2vWBnRSl0RkU6Wr1x8 5voE1IeUA3+AnhTE/GiHf7v8fpqT8uXpgoKuWVAfyZGCdKr7VLr2hdAYDLJq8BlaCfID WG1PJSihAZU8XmbHFsoxO5mibz5q6jh+YEsTGbYwnqpJkd/vxaWheoQGfuwSjF/+0/Qx /W1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EM9JIC+yeL3C9WIVZhyYz0R6U9vBvka5aiesdeAvSbw=; b=ZA6XIAhYRi20pWuuQIwEu3kKVdKm4lD/o41JczEVOlfBrg4PqlZtT3NbvD2rmdRFR+ 32CBaoMubtLSKEwV61Qt0ZH3S+3LYaMI8qW19D2PqRsC0l/xpTaaCmflosbubQkBE3t8 7EmMqo3mbcP6/tbX0KAZ9gYxF9CUVOYUQNAMmjvPf/AEiqChis6jo9GeqtyBkCMle3F1 /5eH304FudCPMkP7KlRNlCLq2ONs39KlAmLuNvVgrQGjF385efgSu+vst79yXMgx7s9i Opwm+DBLa+sv5p7LBaHTkp0Ir5H9iROafpFQhup+cIWJRTWVP8KmBx28txfoFzA5esqw WVRg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=VmNEkzfS; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si12572576edu.40.2021.02.15.04.49.27; Mon, 15 Feb 2021 04:49:28 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=VmNEkzfS; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbhBOMtN (ORCPT + 6 others); Mon, 15 Feb 2021 07:49:13 -0500 Received: from mail-eopbgr30043.outbound.protection.outlook.com ([40.107.3.43]:4416 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229913AbhBOMso (ORCPT ); Mon, 15 Feb 2021 07:48:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=icR3NYMRVn6fRhl36xLXUaSJiNkMbNER7BKJuThPZpKbLfABpaPrqMsYQ4x9wRnSk4YgdQ99TTiLRkuOLEQuSVcPTMv4pNlhbRSO7q36x+SHaTgs9TbjzhTLLNuE0gFeX4QIbkV/+qQKMiEVKYB7YX1M0EKeq7WYneZuqogxnx47hoXhVPlZ47EIbIgd1bqUFlesATfxC7rqKJViqbI3faTzbk/9ce+CZ79qLTgbfAoGISY/RuPb+7uIbT42pJ5bPWQdmh4MZODStDcFqT5zJJCZp0GJT5pJWAKfLUeXetPvBFc9oHNhcZsci+d6QixXHWhBwk7+DqtEZra0keV7VQ== 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=EM9JIC+yeL3C9WIVZhyYz0R6U9vBvka5aiesdeAvSbw=; b=Lh1ieTqHFgxcztTTSbOQ93NvE4b1MFpkOvoAPU2Ja4aMfR5EOGgeBzgiGn+y9jiottWFRcAU55o3dEwVXm+3oiifdFBAN8kuQYJN9oTCWwepMojD9mThNIt9Ne8SCrrS7e+oSqi8Xt/oGhDMKeOT9zkqqcyHlORwgbjkxJNyNj71YcHMgYKpYy5vOPfJhaCdW1b6C77UCBfJiqaEhFCob9QgM9jpjtsZm6QHFfrqi/2FUq1lD9xqmV/M5pt7cquPYS327NYpjni/rLZTnxdCwNXXyG+FouOM5KMIWCJGBmqeCS/g6nitUsVsvt28Hadgy7D/9K/qG4apRFZ3mLWXEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EM9JIC+yeL3C9WIVZhyYz0R6U9vBvka5aiesdeAvSbw=; b=VmNEkzfSog2jIJXYcHF8u8HFfHwdNROidYfNMQoWnPhtmmSQKlc3GMA9H05EBtMxxfADixcI6007inw2PzvBFVui3XJDQIAcv3uT+ui3LpWg5JE2DjLIuHj5KzfJSH8QKofyJkn1Nu+Bz3gflo0hPx1JeeCfgDouKJcq8xuJFvc= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:46:49 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:46:49 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 05/10] remoteproc: imx_rproc: correct err message Date: Mon, 15 Feb 2021 20:34:18 +0800 Message-Id: <1613392463-9676-6-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7389bac4-83e4-4fe0-e6ea-08d8d1afc30f X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:989; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dpKtsm65esLP+/NsU5zhJQo2hEevZdJbBz8Nqnh1PryIzxXT/z38s2dLXA00IRfTcQqbPqsQXiON21VYeXiLxr5YemUUKVcRECcAGHxzJxaUQlscODTRyHSqHl6A8k6epevxbN6sjnJZnse3HZget5I5xiuCi47gzmXmNUt9BVZtZyoB6NF1jgwPG8Mqaq4qxbVLMdHKkdP3DHamO2ijmiWNkTBoLipP/+8HF33pcSTQRiwakJbm6/crKi3RbaoVWyP+IO9Q/76erM1zWfAuP9WpYhTJ7X/jAyDdQzlvVp2crXs9UHi5hcaRtloj/6vvHHPtWdXXP0BqEWnVWuZ+KQfPEpmBsHzCBbflLlhzuR6t0WZ0kkbeflrD/m3s+7EppCfH+tTYiUJfgRuzEENlgnFeXqdM4HtsOjrYmCX7EHrM5+robussv1zBUYnj/OBjK5qMFE2V0uzxN+Q8B33fOsFdfVFf32zmKcTBrJS1Ys9K6TdSuXvbQ3Z++OZn5WcBuM8rRNDBDZ5tTo/SM8Ct9qz0qceXSqm0iWbaEFLu8GorTygTrRHlopF8YZdEFY8zEefUe+0MFqJ/1h3MMdZQ8g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(15650500001)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: T85DrJf+pR9AAi03ctyL0akzLzTp7m1YSbNF44FNnRzyw4BCxdPwuqrgjednoLsS0xDtqpkX3ZQSLZ2EQNsM/Wgni75X6I82Xm2HykU1ccjWMFdvd/GibaSTmEWNmG9FvdEiQbhRmq4oT3H3TK/r+p04BXRkmBqknRy8Y3LHrSf+FscDt6h1GWZotbhRaGJhsIkK+b9pGsg/Wp2WhVtPItHnKYpnzsN8s6uYvVaFZ7FhUngieWLoP2jWDOMp03V61MDt7yG09ihCJnO8FMLFEEKO/SuN4Z1O9HtABx+ci6x5PVa/VXD3+86MJn81VB4XyO9QoxOLa22V4u8Wpte/3Ti8/zJklHwM5BKiCZm3aQpAFF5EW103Jdtt0uyyHckxXvEKk5e+9cjj4yn7gbFVnZsE12st1mMr9cGKX10AvahVACj/Ln5d3ZEBg1CQD79Y2AD4o7/q3yP+QoC4YD80Ub9BBsHFgbuhyB4qEUwFzG7jD6GCBuP42qYUsunqf6EUo4cfiyy6eP2KPeUX+hfe7E1PfqtaORKgHJytMrwmPt4CqSKdTlG6ZqU7jdkh8j/Zf9e0hY5BVoH0E70Vqce6m9SpWcungECi/NPvdX9daPhrMMbq/6atkOgYZJsjOZuWlfuL1xCtKJpW9KCax9ocbZrjW6sKKcBGfV4UVH3XgDT0uFH7lEevtnmwF2o0+HhVce9JRWQER1S+NruNxuELhylkjbGo9IBym8Ee7we33U3xTp44zYyU3z86pFilG1RkSfPCTuRT4gHXZUUUKDW6fmFW95o+licIQgsAQJtrSJzISPiqkBdIJzzVJ+kECrMoJ7B5+bA3pffSRC4mbvaItRfBC/o6eJ3AgqlShyq5eFshX9/rma+2PipUZar0E0xuBclEcw/UFDYucdnn4U3bGASHAWzdFcEuxI2mWxWyrFiAUQs9VslPLPUGd9d8cDQoZddjDYk7JD7QyxAw5JEzQIThYN3hQbl6/CFZB9uAmYMbENskmIwiMmlICC1EE/MPh1cjTYEeXO18o+aVH6+WwDj3oCId6xq8Izj0qaeiQ00SbNd/AOpMbOnvceeNYy2V8owHXoGW6id7TAVLFVWGlHxB4nxZf2O8LoxYnCTvt5vcqJCeTTyG446Fp4gxpcGz3FbHh8QZBOW/VKEAdJxW/yA3sTEejyHS9kBbDkDxmuJo62EVw/HJ3FKppIg8sXYupsWz2xB2FQCgFJUVmKok74RRfTMLegDP+eKHKw7vJ7WR1IYcHV5WOXSiR5NeR3uJSDyhGV44eU0EW5ZUZSnZkxFivI6P1lrcy1GeYK1sfK7xDmSrtcfh+Mrzvs89YoUa X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7389bac4-83e4-4fe0-e6ea-08d8d1afc30f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:46:49.9194 (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: 1GvwxalZg9PNnKIVDTwrW/NJdOgxlkBwrmg3gjDDpxBc+ODwbvgBXW6XVGmYfPUI8SB/T/nXydbbZDG+DT/a7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan It is using devm_ioremap, so not devm_ioremap_resource. Correct the error message and print out sa/size. Reviewed-by: Bjorn Andersson Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 6603e00bb6f4..2a093cea4997 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -268,7 +268,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, att->sa, att->size); if (!priv->mem[b].cpu_addr) { - dev_err(dev, "devm_ioremap_resource failed\n"); + dev_err(dev, "failed to remap %#x bytes from %#x\n", att->size, att->sa); return -ENOMEM; } priv->mem[b].sys_addr = att->sa; @@ -298,7 +298,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); if (IS_ERR(priv->mem[b].cpu_addr)) { - dev_err(dev, "devm_ioremap_resource failed\n"); + dev_err(dev, "failed to remap %pr\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); return err; } From patchwork Mon Feb 15 12:34:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382947 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1047009jao; Mon, 15 Feb 2021 04:48:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhj3NS6248tvjjLbP4GKhINQcsps0jali/Pa6MtO8XH05MEJQEjK1gqR5EG5RILA+usptJ X-Received: by 2002:a17:906:35d0:: with SMTP id p16mr974285ejb.181.1613393334107; Mon, 15 Feb 2021 04:48:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393334; cv=pass; d=google.com; s=arc-20160816; b=xL270n/VSDlfOGO2lWZMq+N9LPkWb+4OeLmA0Wji5LRPhlmfAMnTtsrcVvYjoZy7SN JEOJScU1pLQUwNzTyi7mJgXSDC+lGagCqzW8vtMVzUU9KT2UFVayOuZsNNScj3SmBhh7 YwBUGn9U/QA8EFf7FlPy0QjjabAykxDbvIkPModRfanOtXwWr0mbG4hEit8KJ3SqKQRD 8B29SYYAMUQYsBOj88Opv+Rx9zwAWUi1xFmfB4dl4qur9/28OeeEtEFAusi36/BWFE8s zewuk9sCqiFaB5MDJ/CrQcWoJ5Zoj20SEyC3ew5tKvxL+jqN+LnvEERIcfXhuQ2zMI1B qcMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nJE0Ov249gPUdtT6ZeB+lf9+Z+9T/yJFkeTd4I25VJs=; b=Yy96PonYhMy/DsYUoKS7rglz5Va0iR+Fz2nrPgTRArrDwSTWmCa7AiDEqzME8bGgRH u2gd2/zYsSJ/JYs9dC0CCBncwenYAkx9KnvJfYNWiFGFCM6DW9vfsgns8MYzGmDDlZfr 0pQn00PJqxmkX398oeenAuaivkHOPqz3gcvV4U3PBku7TE4I51dBLyJ1F+LJ/FPMLkPX DGG2j8FHoWzBs/jsBNMPq5VJV8jFPg/ahUmEmuU3pyc9ruiIqO8W9pR7z7f2u9C5IAU5 +AJlWKjCXhp8P0OS3sMgVCbjz92/vr/priWcAJhtkB/fmstD+c671E6M9/zsNrh1qJv+ TDPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="dpA4Mt/R"; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si12572576edu.40.2021.02.15.04.48.53; Mon, 15 Feb 2021 04:48:54 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="dpA4Mt/R"; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbhBOMss (ORCPT + 6 others); Mon, 15 Feb 2021 07:48:48 -0500 Received: from mail-eopbgr40044.outbound.protection.outlook.com ([40.107.4.44]:27717 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230340AbhBOMsY (ORCPT ); Mon, 15 Feb 2021 07:48:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Doy0sJ6/2D7go5ChKU+/q15lNGg46grDnbn4dYWO4rtRdABnCacg+aSE5DLgksX1jFTN5pPbod5A5vdPByS+uuID4zKtBspso4sFIEROLGUfP7K1TpUY7jLexVA62WQ7uLgf2mihC+4L7fkIId0WVe7GIWnDRqfRVp5TloPODSF3g/bidBNbIE2pFusEtMVhA/609K4RqOmO3ltt54yfI76G3q+eLOkTLyQIyC78NUWZvDk5JwYHfVPrKNfOteV8f6yPbER27irrmvcK/WeLdBR3lrmNpIJLBsP7deB8m+RiVG0fXLYzoVdJpM5WcFsGwN6qmd5710046BqWSWLZuA== 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=nJE0Ov249gPUdtT6ZeB+lf9+Z+9T/yJFkeTd4I25VJs=; b=UJQB4baRDZouC4N6Q+Bz6oNvFXknyzDRqsyVZra+zvV0BTDouW2I3hDHX/9apU7uoiTe3XxZJh2iZBUXbT0cAbwVzgNN2MA/JJBC48Anp0Qt+lC4Rl4bjTkTlUU5okLDXy0kCkTdqA9DjtZxzfBuYa2lF6AoakqSqXNWwsk3tGvb5bpgoTK+wqksWH1OPddNunKoICeW4wYfGGHZIHOsrRnh6m2Q8zStYC6sl1a5t1IJlSpfRIzFp17QcD1HvSwwKiLdBUM93bNsov6TPm1ErgTnOhUuu10RqenGG1hp9YLhuEd78fUnIrbGe12FgjtkOlE23HqUXHERhK7g+vkjxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nJE0Ov249gPUdtT6ZeB+lf9+Z+9T/yJFkeTd4I25VJs=; b=dpA4Mt/RMMevTHVO2OquF1bvsxIZ7PLmOvDB7fIAKdem0V5QPrsr/ZfNOdaulH3WmVtHAZGWF0ycJfZDu1ZApHrTLcP0nEJ/gauwLslYYERz1o+MIBrekFpSF8NPc9UsWvRnsXEZY4m5QbDN9UYV8ue14nAUv/1K7Lx3e0o7Oqg= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:46:55 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:46:55 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 06/10] remoteproc: imx_rproc: use devm_ioremap Date: Mon, 15 Feb 2021 20:34:19 +0800 Message-Id: <1613392463-9676-7-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dd40fddf-5c16-4c0b-496f-08d8d1afc695 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:849; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HlkFgNG4eckEnKYDUSsKi8VpKjyvrXdPHyZc0dWJbGg2XWOnP7tjRt8o9hDJn9w9xvPxq0qbai1CLnaQzqQnbldLqKnrwvtcmbK6dLdwv6EBaH4Y9T8ZqKL9nS8ghxN6uig/ifB0A3ltPLld0h5cDjaAnLDySHxgOioc7v3Vs5WvK/7VeSODRImAvbuYYNtVgssMFmUVve59WXDuwJBI/5a3yZV0TM7V+NkMTlE5mFjfr78ik/t42zp3H6vRMYIQ5GYKWEKaMZqmmnqma3RpkiWORenvt06GmShrlm/foVjPyR5pD+VyJHyuyOLaruwxhGHlcX/z+NC7g9UJfKwXHlXbWPygx5dEAQjBCSYuYFtHdMWOjiq10uCoEnBmezPvgj4bmd1VhiD8tjW5mSV2JmZDBFz7wtWZFtCYfGFiEPbRzcLQ+TqN4QWRcN4rbc1ZTf7V4/ccMGKOKnWoQ9bFmQZTBCTmIKC1yg2YJCjz5J+4xY7YG6b12fTw6YF81N6ybFD9te/lznH2/QT7tTIo8NciNUP/AlyJMD0Kiqu9O+zoMQKpOmPOYhTRkN4rNhJlnJD4x4NVOxBRpiPo299XCQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 4y7htauqArsbk7H3EreQRZj31ZdgQgUqGjSJhm+p5z+1cdqXwlBw/byxcFHvc1HqoaMXxZ4bXRwjdwWimDU0rqgk5XQrU8Z11KmjnWh+ltLAdl3XTflAB3v+RvLp/Zmf3EZs0mw5Gbzu4AvhrkTuqBzqdHGV6zOpwNQATruCdOHUbknZmJGe5amikZ22ptUw+OT89hBQnuMaRyu6Q0g0xInwAKc6qBfx/gFJ4IML99zj5IBOFgatgixil2LKVLl6lKGJYV5bqD6mDqfctaeikG2uQ+rG3oLv+eTkA41CDKLsZlDekm73LaxfkouXpLnCqhLcsiuVNADdFOFU5fSNiU8qZnD2S4JZp8jL+8n8Eg4k0TLfHeLmEX2iyon9hms/OTGhie98G3PycsvFO294xChcEU1VxwGLE95G0+8HfQ/F+xGxuS0HVu2fg4TzrL51TfqsvEjiyInwNm2OJtyQ6ItCWJniWE+zPZCA3QoU+DLKuRWmTqK+AtK/+yMNWvDHfGbG52yJNv86MhXiIopLFf7GVtr0YG3+JfXfJrfujrR85q8n0vj2S/HAyWI5jcnpRXVxKccHXFLlRERW2fteEe21PPWVvt1CnJuN9sKMwtbkSt/2yok6hkgboh2SPx1HIthryGFz6sEfQO+jfe9Kwc/IWEIx28UKfWGmspDFOc0NIDVLEyG0ZlOWzSNVYiq2LW34nw+o3tH4uNfC8Zbm2Ub0cHQHNpFF+BwJEgxTSHDZJfvB4oHWtw4fDwrMxaHV3H/3fOe+YTgk1QWxduokJhIAONLPnFsNDbeSKp9tPE3HyoYPienqfYIXfMJTNmym0nezOXi64lHfIiDi4roZuzc3lpKxS/Xdz78nMSzDElG5Yxh3480FVC5K2RJf/IcP1VVX3EOpdpo88jtsLu8bnj+iKltwCWgkEMkOOPkux3W26E4YxssJzgtx9NAI7wyIpzZJ4x7WOfORxiszQF2XOpXgyqt1ZfMk4IE+OTfGhA0qYi4q6l8/I/U6TOAI7wdse1NfOWhmWaImJPzGQ6IIu/kG5TfeCtco2ypHJkp6LiIFsHXRFLUBreEGuuCf+YPRuGL+LUYHtr7Gsm7ZOFc/wt/Y7P1JdEWNLsgVZu4iOJ/d6bQxAj4AqBmoDk00jdZGyTAmNva7GMcBl+e8t5Lu1IHFTutTW6JK/5u5bo5xCpcaDQfiU/sD7FKD/BKkeVqzjPIIoClPEQXkXX/HPQ2xpdOrR0c0zzBXdR2cnWXCHxT+S2ib+5jaYGfqHAMf+4iNyKy3dqBWXr0DBlaNwLXtE/ygA0KiVGNN/q+4xLksqCE3CJKy1j2eTc8QmfOCHIIr X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd40fddf-5c16-4c0b-496f-08d8d1afc695 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:46:55.7787 (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: h9z+8j/CV7orgdacaqZroIAw7LQrs7RT8W3911VsEs9vQ1rOwnf5x6/1cZGU/IA9EbH7hhDGxubzIGWTdEaE1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan We might need to map an region multiple times, becaue the region might be shared between remote processors, such i.MX8QM with dual M4 cores. So use devm_ioremap, not devm_ioremap_resource. Reviewed-by: Oleksij Rempel Reviewed-by: Richard Zhu Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 2a093cea4997..47fc1d06be6a 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -296,7 +296,8 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (b >= IMX7D_RPROC_MEM_MAX) break; - priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); + /* Not use resource version, because we might share region */ + priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); if (IS_ERR(priv->mem[b].cpu_addr)) { dev_err(dev, "failed to remap %pr\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); From patchwork Mon Feb 15 12:34:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382949 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1048315jao; Mon, 15 Feb 2021 04:51:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQE4KW+8zoCjPZeaCHKU586JqgmkLwtgnko95YEwsWlAFWFU8GXlsjWmzPjOsOLExULeEq X-Received: by 2002:a17:906:ce44:: with SMTP id se4mr5466688ejb.140.1613393465327; Mon, 15 Feb 2021 04:51:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393465; cv=pass; d=google.com; s=arc-20160816; b=sxA+lymtiNB4HDbBBpmH2gaJFCZ9p0YSvXxDmY2qSjKW+COjlidy8qDOBWyn0wrvE5 e+tGngCjL5BPNQxENYVvZ6E6JXf1js/+2T80GVOBeHFMpBc2w/Hhj36EjwagjSEmiF2F lczX66XYsesz+10zdAmflMYpifpTVg+wc/nDfV1HAuZ/BIl+tg5bmokjlkLkP9h8Pnk+ M0IQS/lyHXO/6a+0THjF64yKSgfXqv2+leOwE6XTXR4MzSqLRHxNWbNPcs7naRwKxmnY eFt2DgAOVDu9MHdqL8YLQHxNEytU0nibxcSwtFgi4ET84zdX+fZ787SiWv8O0UgtW9lu rmcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wO90q2o6bhxpdxSyK+I0HmaAKEautFRECt/1AuiEMOA=; b=WoUwI+OyWwxGpj6W0YC2xCPQJ9Q6Ps72MaS7myG8qMhFXRUFJ8IvUifLTmrDwXNhLl 1tWnpMkFkEZXSH3hsfKyl+88KcJLsc7tmddVsn8G/eVsL+600l8VBcZEb/Q6u2u1bxdV GlXB1AZ31T9mWh/HJ/w+8an5JW7Mfc/sez0OES5eoAVtw4k0y98rmqYTBTYDDWS1gkIo xSeIFLRvFlxYPgxhAfto7mu5yyDaHVGmG34bxPXXQoupg3Iyz3TWpQF1pD8UJa+kFISN gNK9ptOohMqlRzgGfmbZZXQTQ1mxVCfdayTw9Sr5eUUBV+BxIbQESz9yzVWPTbNp3JmS 6KcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Xq9S3OWp; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si12668468edv.274.2021.02.15.04.51.05; Mon, 15 Feb 2021 04:51:05 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Xq9S3OWp; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230398AbhBOMt2 (ORCPT + 6 others); Mon, 15 Feb 2021 07:49:28 -0500 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:27341 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230355AbhBOMso (ORCPT ); Mon, 15 Feb 2021 07:48:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TK318kwzqQ4FWwgrA4A+Tc7OzU/PewnZSd0hjQdUtCVRTug+JESrNRDn8vbGm2IwWuaojz2Q5xhpbAJKijgrnD5PKE6no4Ye78igJM34wVpJp6k8GZJB2j5mdnfO5ZL33xNbeYDzqEFpldvBUUNgC36Y2GvLs5d1rtkfbD/GZ7dnSzFhWVCsV7+UMQtqg8o9oA7cCJDalKPkAfyDAEUzCkBlCL6V8nV9DZEq+I+v07IRZFwsF1QbzfhjZZI93BFbEscpgPWhx2CvI5BVbghHzetRGc4N1Fh0nrDoeXjyRRbiN0k/vTjSgLOes0NbJkZ/Ov4monYQIS98rmsD9KnE4Q== 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=wO90q2o6bhxpdxSyK+I0HmaAKEautFRECt/1AuiEMOA=; b=LPqZJNH7mDl3RHUbH+LkDLUlwtEoKR3yMarCu02N1onWJUdVG3Xpj9qu1x3+ETKLHI2eH4fgXuzBV0qcQTXs6i85+Lz7tS8aYgITutvjgBASpi3xN5bwb4s0zCONoF8XxP75z3CDVJn61pUdHRpO8mLpCam6oSz82UjSjlOqrZSl27asv02urxjbjuBgPqpmaLe6zXaJm/KCyEPT9n6IBMKdcvRPdY+AB56RUTEPZAOk4rqgjhSXFOhq/fMubnQXi5Jl+ux8040nxtv0i9ypI4XL8WlTYHvk1wCKQKUC7a+AXqbM47O1m49hiWsCTjTx3iSfVFoJQi6ChD68dNCF/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wO90q2o6bhxpdxSyK+I0HmaAKEautFRECt/1AuiEMOA=; b=Xq9S3OWpTMFiGEXMokqoXs7DAmAw3+84GDw0eg6N1rojK0+OUyYsUKUbw8gkZwlJWspEdGQ3KnlcVXkytIPWiysTADsucB6VOM6wk23uqD8lKijPBdFUy7USA1Ondru3laexeKHBP/osO4vRah2YOZMWXZ8Yihi4rnQj0RLHJRY= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:47:01 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:47:01 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 07/10] remoteproc: imx_rproc: add i.MX specific parse fw hook Date: Mon, 15 Feb 2021 20:34:20 +0800 Message-Id: <1613392463-9676-8-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:46:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4123f667-3b05-4143-d75e-08d8d1afca21 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cmLZOguwTef+T//2HJJhlSLfPcKVOlOyFrqHzJDnmrPe9jN+ibEfXd9mfmXrx16wXShFzVOPed1qO9mMKVUMs6RyZ7AknwJ8SD7MZg9B1Wyu6luEP9Eqeyr+AhDVGQLqzJ0bRi7sztyzg/MTCllFB+HwNjbfAuSCiGAQhJyNsZ4vvLMj/MfpIsPcjhirPceJWm9i2vCmDrkadZf0D7nap48pWAQLlJCwn7pmeo04reEokhxlS2hiaV5IvH54TVvTRDIRclARDhpa+giFETcvOYAwE/PAi1C/3yGmY5wfJu1bbeGCXgXhDUHXZSdOrsAdqE1UjBK4ise5WIc9R/eqaNhhn1UPBn5SUgaTSY06O/3qVOkn29g9Y6XW4NhgA+7TBWARI7rd4ZXbjnLLhgycYP/eN5+mqQoTszAYYKUMwlwstlVYcUbffOHin3xQ9gXv8CJBP1bQKndBng7c/gBcFcIhdDJ0c0WAWHxNxKgjJ5XV/2N4NWx5u4FfRHCeNgDvxyPrKAfWUr0v1Dcb6ZJvzU9qnGj9x0lIGTddt8nuC7IkxZlI0rcjj6ncEM7s4Ay0AA+h/2xH99fQPYygRXqUXg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6UGyg8CVaWVzRTY3mxMy2d1cimA6fxuxCwHUOvNKp5J5rfN2My5aE2sE5gwFhiD+r3wVLvtnlDyyTaz7R5vhEudQfsxix+OpWKS/JwlZK8Fdw7BRY6WX2rj2+VOCQT1fI4ow+vOs1qxmL2Kfgrkup822DviGYcD5+2tPXGeocM1GVccmRhK9DKSyfDkzUcwAKFX5QZV1GcDuCwgpuJ5aSUl0hisneumB+4sYebO3m48cFAY75aP14SHZj+f6nRr4tqHL4TTvBmCa/0BBpig1kSdBmrue8nkHJwADuL1/Rg93nVatG8HG7crfoOZ6QgB6vaIJBDIOGVfO252eOEnuPgzuGhYRiBLHJs5TY4akHbhzSD8s7Z9kLx7hxAGmP9qIZI676I84aMRaOSiKunV/IL0/nBJYzbw8sQLVsi0Fi8baIeU2H/wErLuO543wyZh2h4WGfCGFKt5Gdra1THnPqMwtxu2Gi9jle8ixmD0smgqkpOS5zR0BkirWtiaE5I5sNyN0YLs8ayKzSVoUTVCOve+/stiRJSp3CG5Z0P4TY/iqFkfB2AKWEbb6xqgmvdp1kSGWXo+xDLQQtfONPz4bIJgJS+SeTKgK2oJ75dYMkfEPTM4vax8aATbOVoE2JF//Dbax1jXN+jriFvAvVd2FriCWuEYF8uiKrcIsB89GMggPdRRAZ1HtrgVTQO2c+oq07426V33ur5plBXglDiJuw5C21Lj2t9jHGMqd52emSKuOUDD1nm44xaUE+Hvw42FlD5omLgci5xJCNkvEDZ6Q1vEb0Qo47FPs92WI+p3LDdkwfhLhFzXdL3zVVbfkNi5nUpSzRuig/vZ2LMF5D3RRGf/k2iQhTDjDTiBGcULati4Se0odvAXeOm7Xa/JAzyRrJJDaTuVsIvhFRCSfY1vFebdTUFa8l2hhwXm3enj0ZsjqqnlswWBxYF+pFfZCWCMm8BMUhX+B4gUC7BWHsYdWeVcQ8+sy/qutS7E06dk3H8kzvelH/xQ1Fruzjj8wfgVfu1yMT9HpnRdJFGMIgshoUCJqp5QaV0PNjenE4x9z17CAVTznqv+jMoEs4fKr1NTN4N53o4FFxVN5QjWjl+4KRKRSL/Am4DeTK59O8Ic4FwGGwPS9GmT7UghDD6qA+Bk0Bm3MBBy8hrha/6y0YGzvNDdN/jSIxaVHDXdfVuzndh/Vmmbht8KkD/9XW+J22YEDHM/ZFw1LPIxZmWvS5WGzDm1XHplNvV8S8f0Jj8993bdTYqp26MWrTgn674fxyw2lvHWlyfbbOgqCSHPFQa0lEodXBSpkrNzrmHyjpLajhcA3+j4xkkWRnFNKfqLyUcWA X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4123f667-3b05-4143-d75e-08d8d1afca21 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:47:01.7031 (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: lELNqQDrKp0IyZWSO/KT9gkSauLoMHPVyAr24gNQ1x9MCtGFkLIBZkjEO+L2H+LjIhw21lmupBT2DnW6aFUt6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan The hook is used to parse memory-regions and load resource table from the address the remote processor published. Reviewed-by: Richard Zhu Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 47fc1d06be6a..5ae1f5209548 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -241,10 +242,102 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *i return va; } +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+%zx\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+%zx\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_memory_regions(struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + struct device_node *np = priv->dev->of_node; + struct of_phandle_iterator it; + struct rproc_mem_entry *mem; + struct reserved_mem *rmem; + u32 da; + + /* Register associated reserved memory regions */ + of_phandle_iterator_init(&it, np, "memory-region", NULL, 0); + while (of_phandle_iterator_next(&it) == 0) { + /* + * Ignore the first memory region which will be used vdev buffer. + * No need to do extra handlings, rproc_add_virtio_dev will handle it. + */ + if (!strcmp(it.node->name, "vdev0buffer")) + continue; + + 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, i.MX use same map */ + da = rmem->base; + + /* 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 + return -ENOMEM; + + rproc_add_carveout(rproc, mem); + } + + return 0; +} + +static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) +{ + int ret = imx_rproc_parse_memory_regions(rproc); + + if (ret) + return ret; + + ret = rproc_elf_load_rsc_table(rproc, fw); + if (ret) + dev_info(&rproc->dev, "No resource table in elf\n"); + + 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 = rproc_elf_load_segments, + .parse_fw = imx_rproc_parse_fw, + .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, + .sanity_check = rproc_elf_sanity_check, + .get_boot_addr = rproc_elf_get_boot_addr, }; static int imx_rproc_addr_init(struct imx_rproc *priv, From patchwork Mon Feb 15 12:34:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382951 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1048417jao; Mon, 15 Feb 2021 04:51:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBM5FPvxjyUXkapCKIIQ0PfBCpv+NBxVPMx4Pi6oFzJERoAoXU/vTVJcMkm74iYuDkRfAI X-Received: by 2002:aa7:d906:: with SMTP id a6mr15256884edr.74.1613393475393; Mon, 15 Feb 2021 04:51:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393475; cv=pass; d=google.com; s=arc-20160816; b=n+SGqh7UFvFkV6YuxwVQpAwXs/kEk/DHSXWq+v0JlgemW+5mDu+6KY31tDO6mfPtFs zC+X5463D1l/GzcrhSEUhYC+5+AL8fSgy0zLRHcc6UuP+RZrJ4JdwI0AufFNNHVVs5pu Q0aQq6Fl28mjxsib+kvPCgixen/l3rwH6yDWHoemfkPkFNIyn36Wy5mqRaMDhiTozwMn 0XcfF4leYIckNvuPgFSCJakzzAXzjlwywlFpvXiNPULd3SJ0YQwjkKtvPKmQhCcU2xUU czH+cmmfm6A4pnoE6yJX0ptG02/qFWK8tVALAhaUUtr6JDF/Lt7tRZ9NJ6VfffAG2CWK ssig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hO1+r3GoanYoQG4pSNUPhcwcRzBSJ+js42Xn0O6ntMc=; b=JQNsJxKMRL0TBbLoW2td3lYeVZIxrcwdacaFQGicxgml8qTyisIlV6TYxeiLGCEO+H CT02QxQMO3UcyvUL1a/K0lRZMT0fBzsXKHpicydOd2TYPnXKb6xfKOqKm/PcQWYHqtGx zR3dTe4h90M7rfbWLFJUuDWFmU4l0/RUVq/YAcHGeq9Z8HJ108BP+KJCJ11ktWpIZwSf vKeFiLmKEjDuHPZkc4qxjRwbPzxyEq6RBBhJjMLf+Yqm5jul5r5CwsEK8cBhUXp97CYi ah2zZqEMzOGc1qSI1i4+WGSWl+s1Na1U1rS2arZoUtZ4kdg9Vm6+r1QLxbS9avi2sI0c UMcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=a1F3h9Ol; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si12668468edv.274.2021.02.15.04.51.15; Mon, 15 Feb 2021 04:51:15 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=a1F3h9Ol; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbhBOMum (ORCPT + 6 others); Mon, 15 Feb 2021 07:50:42 -0500 Received: from mail-eopbgr40065.outbound.protection.outlook.com ([40.107.4.65]:14406 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230473AbhBOMtx (ORCPT ); Mon, 15 Feb 2021 07:49:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bch6H8a/dPrYrZ3Z0pi029EGRLiWUncjYhO6sHIXke65xGWXDp3mf9QSwgZByYM1vclhlIrkJease6MCyoy80Vs6LWbH6CSSF/nIFuBBvDdY7hFbKWQ8UMxZyEZAOVK0F87UhadFbJlyUQvRae0w1LHZnGTcIc9TXpS28y70BcShpDw9+hyg35MEQHsF7YuPCHOjha9jITVCf0a7ebDexWR91MXzJZLNb41Dm5ghTxJXvZot8TAX2fC0RitMiab4kQXV1f8VTncii9XJ0hxNSqXIjEhc4Hvl5HxEkcEAFZWO0P/dPSYkpNIWRo4UdOejxYHpiUBNwCmeK8mcVK4Vcw== 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=hO1+r3GoanYoQG4pSNUPhcwcRzBSJ+js42Xn0O6ntMc=; b=cLmvZfE0voawMar2PHk99ALuovFlkQV5/ooZZ2YbU066Xk2YodOGQs0EDT0aznyrYIEhhM4HAlNyudKxRzr7dcgCPiUHihhaU2ycQpD1wX130cPSP7cVMaM/UiZAOGqOx2lHIeUBiSOMaCxzI3Nwtnj4X0QcGMOs8nCBi5lVbx5BG9CietAq/WZFRg+gAOKFYF9sBVDqFiTfWbvgsCRTTZWUG8ecMuN2atX+PPS1bWSdjRN9rttFgjYZglWt2ctjJNS8JEv35JKTgQ2KEH7kfTNi6PA+MnDGfJBO7JnqOBUw+UDeRjnCRKEueGYZsFJ/R8oOVEyt4XpNFhC0CzlcqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hO1+r3GoanYoQG4pSNUPhcwcRzBSJ+js42Xn0O6ntMc=; b=a1F3h9Olwgb2RNZaNlEyDM1fkYwPwdPJKQQOjTRCDgAYFqNjiObLn5qbTL3cUKeq379yM0Hys0g5LK2BgVD2uO8LqeEukuCEpZhmirt+pIKZNtfHgHHWSeGp0caReLwgYrKHZbDx6XH9PQn5W1Xv8iw6VBsA/I6o1gsuT9G6kkU= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:47:07 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:47:07 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 08/10] remoteproc: imx_rproc: support i.MX8MQ/M Date: Mon, 15 Feb 2021 20:34:21 +0800 Message-Id: <1613392463-9676-9-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:47:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2324151d-430f-4b80-f1c1-08d8d1afcd92 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:158; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9BDGXpJYMk6eKYxx4OIqMaONMHCadXTkyqBpnUWIUhe4uQNsx2VPrtp9Cug03KgQHlrYXy9NdtPMr9YmW65Pc6jP8gidQJ/K2xePkI88WT2rEJqFqI+2vE3HYa7jsFh4qvTSQcfSoomO6Ukr06GaYy53qC/h8IXC7FIFF+7wdkFYgIJyGnB/4VocFlFlX2jBjlv/TeQ34jaaWzzLUXtL5U3u38uYPC75KiiRrFXr0G57+R4IwYWbwXyqeOmfJgSLopnhI9l36h/s5BIBeOQXXUpj+mHr2wbX9QQAnHshVATCNip/9+xM33zON7M+v+GdCLwDvj0hjptdx7VpA7gkypEkVciIOwFa8JILaW4LcUr+vLnOOQToyVORl35gG4oe8r9nIAcGl9ZsWN4vRewfDBZcM2TRJIb2xpcyLncRQ0Tdudv5MMRS3YBs+o3Y/tA1LfBF61UaAIfuq/jRzhnBsjdUu+2/YlvLSu2FwiYsL9cSoTJ4p4FyaEDq1gKWC9LEHNRctEFnk6pZR6LVmvB5xgfd3xT3xM0aoLqs6IPCNL9xBgyeBtZDS0h0BPKzzrD0yaVN4lq62GcBwogW0Zorjw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mE9shQWeF1iDFwRY1gbGJoh7Fbo+nIfl8Cs9JCuilre2GkJ8QngOk4agkS5gbLuwrKFyyYPPI7P90msC55bwujfyRKm9l5nAHaxuhH5+F9M68n4KjJczD08xFD8aIzw/Oi6py1mQwuWdpl2NIxMHkILhinVfEsOKeUbmJQynuzpi1hw50ZchM8ZWtYvGwuXtcyA+iJvKJLShy5r9gXUwv5kXOvGXBa6kpAayTrY3v/GRYHnL+1IdlIhEeEe2qGwYebFFxK7C6BG600rC1Zhy/6AYy98FI7ZTi6f+TgXxsioEfH/skfKQ2bBkKwLsrotQUiQt8aPMfdVn/NafPEIVRAZYzkQ3yz5LL7Ia7BcPeMCbg+ms3uoTuw9b58PsKvIzeXQV4cCsE7pPPujTlmtdnBT9mbsuUry4Knk/MRpC1yT1V0C3koxHtXteQj716ld+x6nU2vHxQEPsAYt+mLK7QpUEXEg/eNbK/Zi5z9r/PwpH6gLsXJtrrLxlxWiKpQEobhrXEhBGFkmoh7iGiBSmRjF/n0TprnQ8gvVIDYyLusK52/Ri4BQjuPFwHajC/3YLAIcm4ALRmF1S9F4RHYlRYRFyd+2F21WX2e8N7VgsZYFO7vBGKeKZ039dnA9sq9IRZlTQYLv0o2xcWLqufHEOt+UdcnTz3GHK64GKDMtBi/q2aCPr/phJOBMqutIjF5DXdzfcJIi7Btww63fchiJFoWPBtrRxoM4kLp2NuiZpXGEbWl3P3fYytCjkorxA1jkg0FQtX3W5VkYXl8tKeKwZ5Hcm5LgfelmeZ+RmLDBeUcpCFHgqFGAwMR0mT6Iw0gCXaFtwPHzKrb93afqX7mSwrrMtUYHJwj/wpC9OdIB0phnATFj4hyx9LRnAXa+1GnYYvRz9sj/qC7MWxDoqqWAlUsXlr8hcNaoBwplYIXxrbYC318GU0bjfauNKpWOpkSgJrzGfA0KsKwW5X0pXQrbDQD3cnWzuPDH7NrjIa1QSHTfso+Qq8Q88zQgvHvNo0sMPNxZGCPoGgU+dvkqjqjXKWevMArgt6ylIqj4WmGwuM0mUgEoBWqKqbQDZiDLECSvU1H7uWaRfGxGxHiSM42NeH2QLbJvhIYEEM8x2tb2/FoVl7WShz2Xu51CwwWsTUWExNVKh5g0+wdAHzX+dDVojW98TMf1rXY3QkLC3M4u75rhWaxcL8GyNiSELAQoXMXv6pHIK9frUUgJfJ0JmiSCwVIWxvmrALEQj5Rp+T/vNMVfss3ZzJXskT6dU9nGchJ2OvyC0r+wYQvaXz0o/YRZ47wekMmt7sJSo3lmhSGKOeU+ntI7GVsQ0e0qxpTXrSo4C X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2324151d-430f-4b80-f1c1-08d8d1afcd92 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:47:07.7893 (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/zvyspGQMohQhRw6Mikqas9u0VSWjw9nDI5im+dtAmZ0mLYr+hnzK9dmNVxbktDF8Ccj9V1K0jAHLwWOAWv6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Add i.MX8MQ dev/sys addr map and configuration data structure i.MX8MM share i.MX8MQ settings. Reviewed-by: Richard Zhu Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/Kconfig | 6 ++--- drivers/remoteproc/imx_rproc.c | 41 +++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 4 deletions(-) -- 2.30.0 diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 15d1574d129b..7cf3d1b40c55 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -24,11 +24,11 @@ config REMOTEPROC_CDEV It's safe to say N if you don't want to use this interface. config IMX_REMOTEPROC - tristate "IMX6/7 remoteproc support" + tristate "i.MX remoteproc support" depends on ARCH_MXC help - Say y here to support iMX's remote processors (Cortex M4 - on iMX7D) via the remote processor framework. + Say y here to support iMX's remote processors via the remote + processor framework. It's safe to say N here. diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 5ae1f5209548..0124ebf69838 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -88,6 +88,34 @@ struct imx_rproc { struct clk *clk; }; +static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { + /* dev addr , sys addr , size , flags */ + /* TCML - alias */ + { 0x00000000, 0x007e0000, 0x00020000, 0 }, + /* OCRAM_S */ + { 0x00180000, 0x00180000, 0x00008000, 0 }, + /* OCRAM */ + { 0x00900000, 0x00900000, 0x00020000, 0 }, + /* OCRAM */ + { 0x00920000, 0x00920000, 0x00020000, 0 }, + /* QSPI Code - alias */ + { 0x08000000, 0x08000000, 0x08000000, 0 }, + /* DDR (Code) - alias */ + { 0x10000000, 0x80000000, 0x0FFE0000, 0 }, + /* TCML */ + { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN }, + /* TCMU */ + { 0x20000000, 0x00800000, 0x00020000, ATT_OWN }, + /* OCRAM_S */ + { 0x20180000, 0x00180000, 0x00008000, ATT_OWN }, + /* OCRAM */ + { 0x20200000, 0x00900000, 0x00020000, ATT_OWN }, + /* OCRAM */ + { 0x20220000, 0x00920000, 0x00020000, ATT_OWN }, + /* DDR (Data) */ + { 0x40000000, 0x40000000, 0x80000000, 0 }, +}; + static const struct imx_rproc_att imx_rproc_att_imx7d[] = { /* dev addr , sys addr , size , flags */ /* OCRAM_S (M4 Boot code) - alias */ @@ -138,6 +166,15 @@ static const struct imx_rproc_att imx_rproc_att_imx6sx[] = { { 0x80000000, 0x80000000, 0x60000000, 0 }, }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { + .src_reg = IMX7D_SRC_SCR, + .src_mask = IMX7D_M4_RST_MASK, + .src_start = IMX7D_M4_START, + .src_stop = IMX7D_M4_STOP, + .att = imx_rproc_att_imx8mq, + .att_size = ARRAY_SIZE(imx_rproc_att_imx8mq), +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { .src_reg = IMX7D_SRC_SCR, .src_mask = IMX7D_M4_RST_MASK, @@ -496,6 +533,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,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq }, + { .compatible = "fsl,imx8mm-cm4", .data = &imx_rproc_cfg_imx8mq }, {}, }; MODULE_DEVICE_TABLE(of, imx_rproc_of_match); @@ -512,5 +551,5 @@ static struct platform_driver imx_rproc_driver = { module_platform_driver(imx_rproc_driver); MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("IMX6SX/7D remote processor control driver"); +MODULE_DESCRIPTION("i.MX remote processor control driver"); MODULE_AUTHOR("Oleksij Rempel "); From patchwork Mon Feb 15 12:34:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382950 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1048380jao; Mon, 15 Feb 2021 04:51:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7sd8qehPEiFnXANfju4v02L8+1YWt45GCB4HUbwLNZfDKSfKihJ3wlbVrzjZfCoFsZiTo X-Received: by 2002:a05:6402:3069:: with SMTP id bs9mr15389532edb.151.1613393469144; Mon, 15 Feb 2021 04:51:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393469; cv=pass; d=google.com; s=arc-20160816; b=wSVUNcf3gdMYh8eSV9+fNX8eQymJAIigUNA5BtQK03kHN9DztgFOEW4uAWzpHS41Pz n3ClkPtl3C0SuReLbvA7h3F7+uF4jAUWMfMSaASDa8UbMRklQkE7KKP+2bOw1EZSLqcs WXTgB9hM0m8GA3e5R4V/gGPHmkoci7RLXpsMugctsQQjlOLByOuDJXpXkfkGLlAtkpZe +ZIUb21cctYL3KbuFyOLv6bEr2lTgxkOkLt1y+z7dX7pI5ATtr0QGmVYcPn4neWrwvx4 U7NrktP9qXn2yaQtMqIPzWopMXtVoWXInpRQ1egVAiGaVtOaK6CIa9Ghqfw2NNrF1NXU Arhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ylGtRczgykA3LROiqvT5P1IRIRg5xXAemZjMRiCZwqI=; b=DJ1gpRzzUQ66S0K9zQ6lXSQAknF08HTFL8AhEGs1dWcoRC0q6cdFZQL5f5mfNCf62I pQJiNPFjaT25SL7GpAUlqW9jCdMo57l6fcCZv+xsSR5QgvuiMNa6ShFOgaKW+snEDSoz RCqHGU2hNxkuBI3PeLU3+LeC+f3YbfMSDTWzpgf1v+WwtKtP+ihw03WT9dvK1m8iMWK9 MFp6wF5hqA1pmt742ZVv5beKOwANrTCTBZ2i+S1dHv4ubev1sHw5zgV8gJJivfIKaatR ZDowDPO2tQuepqK5X5QaERxjhdB/rRZj0TI32MlVht8kq0jog2F2mfMw+W4qeHzYq7s7 dVvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=XkNXVhMo; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si12668468edv.274.2021.02.15.04.51.08; Mon, 15 Feb 2021 04:51:09 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=XkNXVhMo; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbhBOMuf (ORCPT + 6 others); Mon, 15 Feb 2021 07:50:35 -0500 Received: from mail-eopbgr40044.outbound.protection.outlook.com ([40.107.4.44]:27717 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230223AbhBOMtN (ORCPT ); Mon, 15 Feb 2021 07:49:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZtHpkHCFPOw0gKHSkCFPQEuwiWnKKk/4xPBMpnqQf0CzYhE7DC18i2HtE6kQrlVEtwN8IBoJrii1dqE/uaqdUzHUSjcqu1e23qfg9rgUuWdjsLWH8JQiWPIk+GoA8xTA2vCCwwQVjD4u5ZWqR3VDdYq72CkAO9RcEs084crx42IB9DMl1+SlobAfz0FX1mnkbgyK++L3KUjO4kKYPoC7lQuvops8kur6hlx/2i27LRWmpqZCTncTN3VpssbGFNd+g0ajzbfEVJJz6w2n5HKwkxUuHf0oLCfsoyOZduZQVNSkN/I6ds+TGoT6+GArhLJWBrwpwo92vrm3x4QUEBHS6A== 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=ylGtRczgykA3LROiqvT5P1IRIRg5xXAemZjMRiCZwqI=; b=Q0fZZc2MpZQLJDbUPSCiKH5WQr8JfkwYqzwnSQIxys8LUzUAtu5F+muNJhArt/mtdpW20TUheqQPDhvSbomc7nGcQ4JisCDGkDwhzJ2/Eqkm8OJR4lBZWsAwhUiXXrUTJJcu9v6NnOa3C5paQpzS1cyKv6rPn2KlwEEcZXYIE4bUMD2XKfraDbYla+6ItqcXgSzoorH3QdZJBHxwTJMiVSVXfpkYcypj9T+4Np2+HkBNU7V2kAqJr6nezd3fMOjWCqi5cTCiEz5pktCxYC+UK8kbwbTsoy5o3xd232vlUfBazYwKx4c2eks2Vpfnuna9OSBEdTrjFwP4NljJTFhL5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ylGtRczgykA3LROiqvT5P1IRIRg5xXAemZjMRiCZwqI=; b=XkNXVhMo49blUbChTgWqup2GFmUxOT2KFyNr0GDT/dD/MORsuKP71oHTnA+JKlRceEAxxd6c0QjTET5jZkQZclWJMPUbb1abzjkRHrh4xb+M1DP9hGUz7teuzZ3pkf1/YLJhv5IHk5TPMLGL+nOAtN1iJEoKx9/geGpi7JQFC0w= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:47:14 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:47:14 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 09/10] remoteproc: imx_rproc: ignore mapping vdev regions Date: Mon, 15 Feb 2021 20:34:22 +0800 Message-Id: <1613392463-9676-10-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:47:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 79cc3fd9-569e-4eec-b260-08d8d1afd14f X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bVoM7i2asLfAAOZrze0WAyYR9SmTpFMcqcK37MBTv/maPkxbLixDoyT/4QHpInqW9kjoI9QuHJHA87umvZNS6lNpkYIEMRqf0rgbFQD+rupzzjtSZKEPzBAJavI9WD1H1CmxXnepREGyCg9apAQKE4J06dPxtvenoE2th2tozm8D/Tm6B+HRoF/6gneDmspPDRy9s+DhZbW4zZFE7rBfeb7psTGj2fuxuY5ljGbO7g8HUiEn3WBEgNDVa/tAq92MhWYHVSM2hgD7cz9J2u4sWBLc21zH19i7mnLX2LGySlmCNyp0djqe9NCHUo6Sk+xj0VLOwjNWuE+Ys0zPEIKwwvGP/BXAS2B0bsmfsYBoO4XE3eNcJiLsvFqdQUWg0i6hkE+r1C4dgniFygj+RtIkB9+arM37F2hLCiJw3v5dmzY9e8LliJZ/APZp6lHbUr8oSBKs/pnrMw6dLnPgdhC3nSehccnG/k/Rv0GT2BB5kymExlLje7pBhCdl7wg0Y1xrbK+AhRZLrDh4VlR3fLZc/v/Z4zWat/gJtENvUpKvz2u+tJAzj+LdsYpOlIpAyt3UIxvLfaa/HTnyR2l/+3emtw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(4744005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: t4GlAx2XRCteQ2yk9PzGMBgutBgLesWLER7cRUdstaYCkEN8odhaUM5arDvJ2I1zdqDZHJStY2UAc8BWlaRw8Hamk0g4Qmn5oUq95MUUPbnm5Fi17cG2R8kLxzZJtn1bwFnqL1kj+4v9J1Gh2TacV0DU2dXzN4JN4W+FX+umdJUpY8V1CQR56+Q1WRlOtBtXS3O3ucGRxIt/dVIlwwdiR5b0xxMMlpQg96q8nSHolypz+radPTVNJ+Qf4+gj3tt3gKmyYoC/JGz3xo94aaOFQKDdnq2lBZx0zY6V+vUW2EcISOglYsWEv0R1rvp2xsfGuBNyiV74JNFlOJOAD0ngJ35pTx5Np+5KWriwWw/RrsPNNf5IRbdgRG7Tsn2YSJC9YchgvvQnyMhG3kSvqbFluoqLowEG82jOW9EA/5SKWsqn3jRvoDIclFwVyvB90puTUNUUbukaYdrPZ/G129YxGYukFplRSGFo1g73jknpxua6bvfqwAVkTO7j/8Qf8wyEMm8PIUpt5gBocfIFLklCLescmUe498eVjUJ9w2SdC5DIXsTiAPNOSxgOasd2xjekJumvhhbS6QWfEuHhg6WyHetD/6B84tM21jTBMRnc2q/pqGuddqJvyiUGqV/cYjNxpUoQmjO/vLkY6PGGCrVjH7fvZg5NHzPW/Xe7D0evjPOfvbYjuXZo6qo1ugbubRSFci1s/Efr+QtIHvIyu3yuOz9wp2gEDnq0qJi9WDX8jzRVcXgxlmZ2Cvusa8nLKBmXHz9mp1J2qJbcguOZHp/Vp+bKLrhz4s2abbcJioWCtKFdDypGCccDdYvblLvW7X2AbDWIq6FPMn9wq0+m1pZOsOAnorU98z5D3sxZMQNao0uJH3e4HgmT1vhRNiS8TztJzxh/bg9uilPuQz9W3UhAEyNtKoMI43HRcnT2jPNRxV50zEfkVmGckxMMVCqSArSr/X78CvPDQH2YuYVadcx2DdRYA2f7QKaUuM4XuFxg541+j26z0wg6WnJ9Z1up+ab+CKv8whhpH2H5GjradfOM4vOykr1Okk+I9d8J6Uqwq4QycNuSA4AoOS0g0YEf6Txt3XrEeBgsQnIAZh/usZgztR4LMectdYM4+nEj3TjIdYqlAbPHLlWSnOfMs8LSiNEOWiVflPsJD0K3r16goqF7aFtLh/b+q9cH6imREia3XegIHYewMPLylZcPOYnXQHLr0ITrSKF3S9NYApuepn/ytCsY3n6HTSEMxpUsudRlVScWpRU9LM6AyCpmRs9l1Rgu1x10zsqHFioNauBNt09pzuxMumPVwVsphqVAIxqzbYE/g6tcGw1zZIz8LGQq8Acp X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79cc3fd9-569e-4eec-b260-08d8d1afd14f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:47:14.1614 (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: VkCa6BSDST64d2lGDREoli7yWxxQViZoPKEdjc0TGSxsNjYn17he2b2wf4zJ3HO5W9+Y/9SGXZoRAcwx1ENwkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan vdev regions are vdev0vring0, vdev0vring1, vdevbuffer and similar. They are handled by remoteproc common code, no need to map in imx rproc driver. Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 0124ebf69838..3685bbd135b0 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -417,6 +417,9 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, struct resource res; node = of_parse_phandle(np, "memory-region", a); + /* Not map vdev region */ + if (!strcmp(node->name, "vdev")) + continue; err = of_address_to_resource(node, 0, &res); if (err) { dev_err(dev, "unable to resolve memory region\n"); From patchwork Mon Feb 15 12:34:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 382952 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp1048437jao; Mon, 15 Feb 2021 04:51:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQ+6cfRWOPa8RGUpoZeJ9vhA2DxBH4Os28HGW8/sTHw7F/GooiYpYxZCI8s7yUxTAmcVtJ X-Received: by 2002:a17:906:dbd0:: with SMTP id yc16mr15478653ejb.524.1613393478341; Mon, 15 Feb 2021 04:51:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613393478; cv=pass; d=google.com; s=arc-20160816; b=KxiMMIiM64cSoHJX1vfA+arQCVWhmyipV/wdUl2OaopnimnP1ATFsNz+iZb2oUPlsQ kyPchaCRqongvK1Z57EwR7BqqTu2Dtw2Tf2TVSpN+yHlCeGKKKm1g4QcQhx83RLbvodN 8ZCqswYxGW/t8340ZHA3Aiq1EC7Ykpyjw9a5abAri2Hj2wu0F+mZpxrwP5+uC+dXkcSe nZgJej3pVICySOZLD4uM4HeeiIap6lYFSVZGz4E4S8nmd15QKMjkTGj9P/4S7c4m3u8Z 6e6x8Dsid7ulj32HO/161eKiiz4qmcNrYvHIHjJMqulwoilQThPhFACZVpXnA09IMeMb +kvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZfBczTf+RB1EWa5ibevseo+tYbxVdHstdpl8p+i5B30=; b=hTT2M75eTxUXuBYqS82YlCEtRlBqETuDZk0+TTIc2Jk+RBlkqvzQ2sdsISKOns+wwW 0cY2wgo8ibMPuDhbquh5Otv3oGVYm2/yZcgMjXyz2S7a0XxzES7X2OhaI0lnbZQID+2t uvz9SuzOTNOZNlL60yNRUiP8FEuCy12QC7Spi/s6S+l06JdN4olmLTBI+r19rLu9FKm9 0SA0jcLRs6n/Am4Sw2qtiJwwFHq12quKiI7xTCShRiDugAhkHiakladjT8sMr0LzVXak 1D0pv2kVc9bmFSN0sYmS1jdrnl86ne++U4utapkwi6yWAk3xbRzerFWpnd6nG4b3EkHT cpNQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=jLf7FGhR; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si12668468edv.274.2021.02.15.04.51.18; Mon, 15 Feb 2021 04:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=jLf7FGhR; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230305AbhBOMuk (ORCPT + 6 others); Mon, 15 Feb 2021 07:50:40 -0500 Received: from mail-eopbgr30043.outbound.protection.outlook.com ([40.107.3.43]:4416 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230471AbhBOMtm (ORCPT ); Mon, 15 Feb 2021 07:49:42 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RM2Avyp9OsBd/DhbOojL5OXyzielBiGf2SkCgrAzWJM9Kwn/UnUJJy8p6eAiNB9gdO5zfgdX5sGaYaSYvues08Q6shIfj4I/OtxeYCaAq0sqFp5izkglel2I6LQhaBxFKRcmuZDL2pduFB6nc+i5xPgomvG0WXjFduiYGPJv1HBAeccSho8NOUpSIcQ22BMmoqBqLRzUAhaCzChDOEte0uQ0y5z2D2AE86HrtXLCPnvUBZ9E76VtAFCE5NIcZie4LoNUnQ44TtXIYPkVbke6JwLj5bj38Gqh4sedcx2QyG5K1HDksg8Wo4/4cX8z53f4zXdnZ+kMUgKWTapKmzXpXQ== 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=ZfBczTf+RB1EWa5ibevseo+tYbxVdHstdpl8p+i5B30=; b=C1mvo/JMVs0vRTlef2IldPdw9SjnNRvPvHYH6lXt/dxC8afDmNrIioOMD1NzDaLNKF0hkQSxFxDvFfKmKeshH+GEhzVpZClekKHgDXKJ6K6qMp1P2XFNlA1VU9NY7xw+fYFd6Jwid9B1Lj81MDE6Tz2+phP8EvB9Ls4+d6YH/VYskifIniEyz1A5KQ9K7tkfC9vzfih7KKee4d4+0CxJCQLVh6CtfH45IHESluWTI1jzu4OlnVveRDO16w9e1KQd8rd035sbxiecnSlEfye8Suo2XcT3YVXQ0DEZi24/AA8n8bOUh9YU8o0D4q9IKa8D6P91sbLPqeSKdvL9NSA37A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZfBczTf+RB1EWa5ibevseo+tYbxVdHstdpl8p+i5B30=; b=jLf7FGhRwO25St90vpoSWd+yzV4BhfzSxBcP84aEwB9uDqOC/avzN1ncoV1jgGmllxzBiVcv7ohIi6jtBn1kC4hjhd1ePNMCiS4f7lJv86aZ6zDFHo6CdLJ1bmy8Zphtjl+b3PYej7kSYISyAKwXFs/9gwffan0oU5RxRT7Ktt0= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none; wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:47:19 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.027; Mon, 15 Feb 2021 12:47:19 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V10 10/10] remoteproc: imx_proc: enable virtio/mailbox Date: Mon, 15 Feb 2021 20:34:23 +0800 Message-Id: <1613392463-9676-11-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> References: <1613392463-9676-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0019.apcprd03.prod.outlook.com (2603:1096:3:2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.12 via Frontend Transport; Mon, 15 Feb 2021 12:47:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 377695fa-411e-4bb4-77c2-08d8d1afd501 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:751; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HvJgRAvvNfVTSmXdAeF6CrFluVMxe0OYoxvNvK8tnr0RbLKxS3yjAdGykbUrsuxa1iY/gqF8c4hfkZ1l4tDlFow9JpjsfjEEAnD2yGecFC0mOwI6pGU0VRScnpvcdrbT30q+0kb7V22HdSaKpSASuELPjQF5QevU/9bZ4ESg+01BoWJks/4c/BKL26CPSM3cU971mB7bC/m/VcAfOFiQMbKZKJjRQbH+anof7BvfQPkZNHn7B7zeJps1K07wvxpsxsDwU0a20IdabobFtWOmWLH955mM9924FOgflovLQY2Xov2UMihyAT/QpS0byCmextTjqea62ZQQuXVZdtBnki0h9ZVEOXS11xaoRP7PjlEaA88HJNbuTydzQI0LpignPmZac3gskKqHzoH9S7cA4xM6arEFNelZxn/YkwLaUSjNJFg4cNQTHBBYRPxhm+NwnfQafra0cZ7WW12kdtcDRqYAUn3vi0R+w91UK+w33MIcYu/WM3wXRwykJ++MerkeUlaYPXdCO6HoB4esBxr4Vpsy8McThupU/IFKlywB0S37EAdG33V7kFR/xDy/0EZKvharRysQdtr/9KRpE/i7Kw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(26005)(6486002)(9686003)(478600001)(316002)(186003)(52116002)(6512007)(2906002)(16526019)(15650500001)(4326008)(6506007)(8936002)(2616005)(956004)(7416002)(86362001)(66476007)(66946007)(66556008)(69590400012)(5660300002)(6666004)(8676002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HNKBTAG3EhBgQXa4LaAuPDQ57RGQ74TIgqAskFH7zCK0GD3ClZAgJIOG+tXHwc6KdknE7WEEtPzax7ODGVvbOsM2sIed88s6mFWfYo9cuUdldBO3BqrfiH4Xgq9vAtYpIQQPaUOV8iyreMYnajKpIlHKSF8tNbLq+jyd9LpiGCKBTOmtueCvJqO+h4K8bfJXnIQ9hS56pWcwWZUN6FJEYfpAXQNce17eUq3MdAPsH5/d3YplsHxX34HZCYqRL1djuOcAS5h/6pdf9gEYZPw38YkyfQW7sp/3NIVsNLr4yT2420dU+U5SrQhHRN9ZDPaVJve6MlzRMtdlB5pVkoL/RLbWW/K0kBzAyyX6lMe6+cvWy/RAWXtodStylFb5Zg/zBg9Xzt6F5hApaPBLBDsEBjCI0Am28ba5SFU4o1Cs2oJtapZd/aNv/qF/Q+i+atMQJgtn6jWXhwL9hPnpMncW8KVRERwmIDYzlWrN4XkpiYMxxO0SgMRtGWqkjZZZfJh2LS26PXhav2AJJko4GvdcGrB4mPqYlaMNvGitvW0Hvxyv6aOjZfyjUS3fP7G+E8I6uLWvAzC3btavruLLjzg9lFt5Odx8zd/C9mPTN2jOGd6AR4BAl38FhxTgMT9ypzGE/Bg074STZXotsIOeLvfhjAUhfeE+rzgBP/c47Cfjra/GyU4paBAB3Zh55QXZav9FXLVQhXKFXKopTh0JSDEwd/IbBfMTaeLB4o5091FPTLLRbYOyRMxTkMjUqEC0c7INZ76ecYGxEMe4bxyzf8q6zq2zDF6FhOiQaGbwiZUT+O0vRYK1tMBuWWh+PVxczBBLCc3MfS9jCfBS1FvVK3cNuT2Xty2dmrAUgpkcuiKpS0yJUeymc7oLb3TSNRSq0nLxy2fUOOELU3WuBiPWRQC6D8VpMiUAdz3DD7Psm+SN+MLPBvPws5dLY72q6JRvscq/4Dq42Ub/ajT9S++KNy8UfXrHk/MARor0Z4KtW/qiSmfheOCjs9ouyy2CiU86FYGlw5u2p8aC4dmXPeTBwQUHe5R/YHCihuFrAALqkRvzWSKxpvIzZ4CIxVKXSO7HpbAHpUwHxG0/4ds3saPD6wD0Q1lywGCrxf2uq1sJ1rdqinf9O/4cPWD8VAMX+8FIyby3fsfJ6iDYnn+58muI9NX3Zzn6+s6Z/PGjAsqvrAFQN9WDennP5CggPKH14wB4cfF8aX4tQgJK5yKVzMN8CX7B87hGNBB68l9vGkEtEYzF4hKxgRzwBw8UWy2dNBRdbkVgte9Tb2W919Ig3ieanPoDcLlYcIGg/17dyEj2Lw54S0NV7/gYv2hQWsAZ3cfXiOAH X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 377695fa-411e-4bb4-77c2-08d8d1afd501 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:47:19.8829 (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: +KVKXU9o6K2OSsJdwDTeYr9Wxth+QGW5svMqDstLurEWecgLbPhecAcrlaxPyycQXzyU+NiWeefAt3hWAQaJBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 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 work queue to handle incoming messages. Reviewed-by: Richard Zhu Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 116 ++++++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 3 deletions(-) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 3685bbd135b0..90471790bb24 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -15,6 +16,9 @@ #include #include #include +#include + +#include "remoteproc_internal.h" #define IMX7D_SRC_SCR 0x0C #define IMX7D_ENABLE_M4 BIT(3) @@ -86,6 +90,11 @@ struct imx_rproc { const struct imx_rproc_dcfg *dcfg; struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; struct clk *clk; + struct mbox_client cl; + struct mbox_chan *tx_ch; + struct mbox_chan *rx_ch; + struct work_struct rproc_work; + struct workqueue_struct *workqueue; }; static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { @@ -366,9 +375,33 @@ static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) return 0; } +static void imx_rproc_kick(struct rproc *rproc, int vqid) +{ + struct imx_rproc *priv = rproc->priv; + int err; + __u32 mmsg; + + if (!priv->tx_ch) { + dev_err(priv->dev, "No initialized mbox tx channel\n"); + return; + } + + /* + * Send the index of the triggered virtqueue as the mu payload. + * Let remote processor know which virtqueue is used. + */ + mmsg = vqid << 16; + + 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 = rproc_elf_load_segments, .parse_fw = imx_rproc_parse_fw, @@ -444,6 +477,66 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, return 0; } +static void imx_rproc_vq_work(struct work_struct *work) +{ + struct imx_rproc *priv = container_of(work, 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; + + queue_work(priv->workqueue, &priv->rproc_work); +} + +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; + + if (!of_get_property(dev->of_node, "mbox-names", NULL)) + return 0; + + cl = &priv->cl; + cl->dev = dev; + cl->tx_block = true; + cl->tx_tout = 100; + 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)) { + ret = PTR_ERR(priv->tx_ch); + return dev_err_probe(cl->dev, ret, + "failed to request tx mailbox channel: %d\n", ret); + } + + priv->rx_ch = mbox_request_channel_byname(cl, "rx"); + if (IS_ERR(priv->rx_ch)) { + mbox_free_channel(priv->tx_ch); + ret = PTR_ERR(priv->rx_ch); + return dev_err_probe(cl->dev, ret, + "failed to request rx mailbox channel: %d\n", ret); + } + + return 0; +} + +static void imx_rproc_free_mbox(struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + + mbox_free_channel(priv->tx_ch); + mbox_free_channel(priv->rx_ch); +} + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -481,18 +574,28 @@ static int imx_rproc_probe(struct platform_device *pdev) priv->dev = dev; dev_set_drvdata(dev, rproc); + priv->workqueue = create_workqueue(dev_name(dev)); + if (!priv->workqueue) { + dev_err(dev, "cannot create workqueue\n"); + ret = -ENOMEM; + goto err_put_rproc; + } + + ret = imx_rproc_xtr_mbox_init(rproc); + if (ret) + goto err_put_wkq; ret = imx_rproc_addr_init(priv, pdev); if (ret) { dev_err(dev, "failed on imx_rproc_addr_init\n"); - goto err_put_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; } /* @@ -502,9 +605,11 @@ 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_WORK(&(priv->rproc_work), imx_rproc_vq_work); + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n"); @@ -515,6 +620,10 @@ static int imx_rproc_probe(struct platform_device *pdev) err_put_clk: clk_disable_unprepare(priv->clk); +err_put_mbox: + imx_rproc_free_mbox(rproc); +err_put_wkq: + destroy_workqueue(priv->workqueue); err_put_rproc: rproc_free(rproc); @@ -528,6 +637,7 @@ static int imx_rproc_remove(struct platform_device *pdev) clk_disable_unprepare(priv->clk); rproc_del(rproc); + imx_rproc_free_mbox(rproc); rproc_free(rproc); return 0;