From patchwork Mon Feb 8 08:56:02 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: 378541 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4517499jah; Mon, 8 Feb 2021 01:11:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0nfuoixhg7s87E3lFwrqobDKa9VVOrojnWMexNS8lMSl1RWODEpJKAVoKbj9huFymGTbu X-Received: by 2002:a17:906:c08e:: with SMTP id f14mr16629831ejz.388.1612775506818; Mon, 08 Feb 2021 01:11:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775506; cv=pass; d=google.com; s=arc-20160816; b=jdDjecQBXVN+e64qUlSfYfEoM3bLx/zAqA1RuHDBeATPGAYqx25wMeV4cZATGhdAT3 EHCptc2RyWEcPAO6x0ITwjZfV1uv4ceJBQpHUefIhEViuh0nxTJgx5coXZyqelh5F1zY rCsD1/iEeBUHOb/2x25MqU2SPL9zmFrtmomZzx7rvERyTwhHuQ0qdW5FN2UK3EZD/Jw0 8lfl1yj0GyYW++DHS/yhMgtqq38LQjC/qRG5vqP6SZRdwkvnj1Oub/6umBhKTtcDpYd4 SENtsikS3mg2LYzQepkXELmJ2+XGa5/2kd2ng8ZpjoHkfPfVl371FI1/Tr228n5H6jIC dZMw== 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=5ya5TZ1TPJCBO3tXK6VZCcn/yLGZLf97GH1cX0cehIU=; b=gbLYE4OcP9On/OvmuY8dCwYrlbCGqsabAul3WcJ5WH8/1o/s1ccnKdzkIAywhYeYr+ suq62RM5dPrW+/KhEG5YmBqUXWNTPjFkd1l7NT2et207tzoTFPjMDD/ULZmoGDqTh6rz BOf4n/b8TZFxCgQr+RiWJ3s1b15CY+AESSrSSmdIt6jzfXCVpR8HpYrxr8ivWi1MHyZn TdhHRkUQ5aQzuk+V0Gea8ZPjnTB0PcmZ3Jg1QlcT1BrxOVuImUL854oW0ZmTGN4AQpfr 6BuS2YueMJKwwFqSNoUdBudImL9VWsx6Sz9BkqOP9XV8WsPBdrd15PytHTH8PCJN4Hhv +v+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=dLYmhoQB; 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 n14si7081278ejr.267.2021.02.08.01.11.46; Mon, 08 Feb 2021 01:11:46 -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=dLYmhoQB; 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 S231400AbhBHJLa (ORCPT + 6 others); Mon, 8 Feb 2021 04:11:30 -0500 Received: from mail-eopbgr40068.outbound.protection.outlook.com ([40.107.4.68]:17732 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230396AbhBHJJ1 (ORCPT ); Mon, 8 Feb 2021 04:09:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XXz+7EFrxw5oEDXqxwOTQVsrWkpUqEJw939qYDhwGDAHJjXw8QM2nxS6nWwJASyDciA1GLoTXB/Kp+ZdUDsYOlmFyhAwX0CEvNpsnYTqQLfDsfmEY94bWYP4Yba/OsUl779QBGrd7CAoSLNXeO70qi6EvVkJ6XWy+Mh/5JEqC+RBpbs9IOGH15bfPx8j4ZxPMCsw1EseEVQX47Fe1C1OxkQMXuskCYaRq+QXV/S219og+or43cZgzXoXfm4goTI2OTr/dEHrIzPJ8YeNmQaCmgmeG1oqzRFMppJ9I/or899J0aE0cTcPNiSHoaWFnIaZJKvsjHfoMAgpTZxoJ3zyJg== 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=5ya5TZ1TPJCBO3tXK6VZCcn/yLGZLf97GH1cX0cehIU=; b=Xuy3TnxUP+Vwf04sRSpg2imXA43iy/ks+KDKUYqHiR+sWyMk3xYBAlELK1xklEmv0Fh8Qfe9zW6+r5UgRVWqcZBHDS/Vr3HjfHbE9EssiyAobA3YxZu8lnp3ClTdKnT5z1NkXgJ1QkqqNR5tPPRF8kHTrPNRuCgMq0t9UK/dPrH6uCD3EpR3TfG0EGyWInUWqdxE4AkTUdZr8Dg9SUc93wakQfRUo2Rp3krvqshbVXjil1HsMJ1OOWZrElEZtAsZwDbN33XGvS6k0GjZjeERCVDGGqWQxOF5BSgHF86eE6xKfnw2982+tyuAwkDZ7as51tTcO5kgG4WwOXirpRP9Bg== 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=5ya5TZ1TPJCBO3tXK6VZCcn/yLGZLf97GH1cX0cehIU=; b=dLYmhoQBZ1BWix+eyC4j+yis1aASVdhDcO0j/vmqEkJxSQC2j7mNmm9Lawq4hzcul9ajwsuUG9YTh1zgQDILgI6FZNR7EsconyNaxYjh8MhAu/Fn5z34QlVbBb2bkvd4gkVn0DWrqoD0DVaqwZOA/MXoof7A5guyCVVHtxymzhg= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:07:43 +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.3825.030; Mon, 8 Feb 2021 09:07:43 +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, 8 Feb 2021 16:56:02 +0800 Message-Id: <1612774571-6134-2-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:07:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 82ed24a7-d0ba-4e6f-d527-08d8cc10fe6c X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: GHyq4+h0SEnN6IXfpVMA0+vEFPMlQieq9KAbLWe6DklYJld3H91qOTAiErCIZclZF9CMMHlo7+bMzOboHSwzg2Ay4PqxvpsCa2m1rv7ydE+akjiXdda2TXUnBQhJmNpeh6XdMiAiHHJUEc51+qhFl/MMZbUYMQt5AOEQkXDI8dxqQnDGkwuq0b8MbHCEtztG2z+muKmWiGpZ8pGq1tt3yMBYPim0vfuUnSVXRRpj+z/RNG0szK7ga3BsByzxlUNSn3Tpf48nrk1/ADC5YAkQBGh4sCxEeA1xqejiYd7MOI+9/G5727klQu20RaYgP3BitUtUU95zSvDL6V6WSyJYbyLYrecVRFtlDdqooSP9rallGXGnQpyrT9gHqHckjj8WpunQ2vAk4+q8D5SFEjpkp/BHqXBINiejbuxUMBWPfzm8uDoVSGt8SsmfyAtm4GDZe9wZszplOOOqlzTDPMXiD3f9MLFm8JI/MBRK5R6WC9Snqca7WeMbFI3Gd6j/h43MI3VMNLTXk1EfwivmeTqth2gdszx7v+oGBdiFsxWvy6l2L4Gbo+qdGoCYLLD4Pqs5ccomZ3fPCr4KXRu1e96NLq9o8DFClw27fvG/KUtYyXm9S4IOTuASPhxCzhl2nkTx5yUomteX8koKytYimZJltw== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(83380400001)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zZsvSCegEjPA6bMB+WR5yhUxLmB54HDRAjvSn13kfwW7MObx5neHbpJFeiI5Lp05B3lFLuSd83yAnzmIwxVZFDY0g4q8Khs00j1qscxlv2Bfs14UVmg89lgwLs2UMipgo4upo4OcL8QXOcZHgT6Vire0Mg5rLjRdXRAiflcCQO0OqMo/QlNU5W+Ct62+p6oZm6koPYmdPxHQyk+kDEpnBEJIZ0sX9nSv8nBdRtIAcDkABUNs6bwnB+5ej/O4ObA17+gbpBIlQUSsCzPDZ+KygtkbF9ry7kgVGYGiUNfcPJqH/FOwC1nWN9XbTNS9N4ilbhK8t2SxKcMNXCKFSR/ee1Uif/2IZd/c7bzl/QtDluvGtEYkYRPekLoy0Mbpqw4PJZd8VeDz1CuzTeYc90FHJgOkorNSR/QZZpDIcW3eegeNJ18Rjz7N7Oxket256JJskQu1YcSPxceUFNO/1kLybSl0k0xAfdBh/MH+VZFU24+dVz3FKhNqQWboke0lIHNBVlq/k01NVSt/sD3KWcdgI0ZFhF3NYvxXW/UaL8+ZDiVW0v4OjVTOB8kkgWsYDSqB1I48uxcDBDX0SZxX56ZmM7uRsxmCFUPrvYhzogUVrw9Zg/uDLpZ40yqHow8b5fU7qm4zcnBWXBwxx0k6NI0Hpeho5mPG6Ei+DU5XxrYZytaxcpW47VvrNWO+VJgr3mXxbj3gNDe1O43rfzLg9F5S1OFx990e3+RvecT7Ut8HfnknOyjHClAN728/grcEzbgkkjkqIz9hWTru0gTXFEgMysfQfoxqnrmjD06ckC0HZCVwDAv5haYB/SUKnk56O551gK4P4nH68yKNie4a1Oq3ex0Oyiz+8ZYQoU2YLKvGjZHL+ePKr67WFMtZAAZO0Zn041954G6o4701bTak86HD74DXiEGncMx+tl6OB/lftMUmZ/6CJRYLwp69PnYvHFC+Yv24K+tRbevYzr5Z1KnfA8+zlx/171h6AT154hAax1mH3Fw6lT0ZStmsFzcGZeW5s9zB69wXPoCmCj09mqBee03vXDCfKkamckx/hr9q7+6tHwqs1iosksmkh9GdMc+jvAI68vcjaVnaM6XUS1nbj5HhJbEgk+g/L6Adpo8yVUuy4MkmOYvWYxGUL4Xpga2Gc0lingecCpVd2EMQmaglYYSm9vtq5eS2U4uvEyrE5yWShfXEFngHDQ2F2jzYP6W8OUOgGZr0mOj5XHdurO+fyhewsaVpUHtYh3gzI0d5rj6LjEgVQFcD5Nv7x/W7LJAbHuORD/jFXi7l3MmCs/yuzSn0aqlkmm2Dnp3UeXbZjwneb8VW/tC5J3UhVlNmpFUdB5/Yu1yb/syVUOPR8lwzKA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82ed24a7-d0ba-4e6f-d527-08d8cc10fe6c X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:07:43.5742 (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: dQ18cgQCSMquvyQRJottCLQOtMT9ROnRHU3Ji8YcMLChhnxLngTdN4eDT+1+ivQHEuLt4GMMuPqBytA1KtbPqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 | 59 +++++++++++++++++++ .../bindings/remoteproc/imx-rproc.txt | 33 ----------- 2 files changed, 59 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..5e906fa6a39d --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -0,0 +1,59 @@ +# 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. + +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 8 08:56:03 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: 378542 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4517513jah; Mon, 8 Feb 2021 01:11:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8JN5pyUT1dmsyR10/4QUhZ6Vg5X3DkKhgv5SnhL6BdSJbLK4UBXBIIvPQFrmjSK/+f3uQ X-Received: by 2002:aa7:c351:: with SMTP id j17mr1443998edr.261.1612775508082; Mon, 08 Feb 2021 01:11:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775508; cv=pass; d=google.com; s=arc-20160816; b=R6eKfTwWEUYV/VzXkxZgze2BEBWfJV4t2buh8b32BNUhvF+pkkBtm9zQAjelnZwAHG MXdWBCTSp1zVgFm6YJ98oVzkjPBiuGvPDFhWmnSKVvCgWlmMqk3Rv+T91mUkheOxXbFV MoH/QeGmPL8wpu6yJrUkePOq5MmRa767Ueci70A05otPcoyiMcQ73eKka6hXPzfW8k1N SVczsgUHMdH0LN0EZkEbaLL9nKkl6LEWeUIP6IpBrl3nvCWf8YA7M/VdrYZ33IMYp4hx 8xRrz9gcmip8SC00+Gq5JqFFGwd5srd6/gDkesQdr5B8AoLap08Ve5BPAI1l1TNvhP8Y j07Q== 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=WK2KUyUvCzMDfschWTGWSopTnL1yz7l37jkBoLMpbYs=; b=EZg0Hi4G8tbFOcAIvd9IkmQ1OZduvIk1mRy+PI+bqH3Usn71F4d4PuHFvUp+8Hf1qJ MIqDwUkVIYQY5+40u1xQPHU8Yxd6Y+/LZFH0uL8t0/hyT9a2gN4l7OBU6Y6ti3L4TpFk ig/3uya+qQIc3+9RtgJgst5AVROQ70tjVp1ypFrBapLGPit/HRedairBB5NtFvnHoGSt m5CvzUGHIVcm4O/2eK/RluX949IeQu7bcSkAjU51cfPh5EblF9Y8V09fnk8nCcTqLxx+ Xdi53PbNST5LdBKZAtuf3eD44f++ciEK9rvtxiZLvidcx+22RsaQoC1uaq1WYUk62gKZ 1zHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=a5a9fG2Q; 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 n14si7081278ejr.267.2021.02.08.01.11.47; Mon, 08 Feb 2021 01:11:48 -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=a5a9fG2Q; 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 S231281AbhBHJLc (ORCPT + 6 others); Mon, 8 Feb 2021 04:11:32 -0500 Received: from mail-am6eur05on2040.outbound.protection.outlook.com ([40.107.22.40]:52193 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230427AbhBHJJm (ORCPT ); Mon, 8 Feb 2021 04:09:42 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LyZY/qaTyrQYe4pBLqgm3Gko3CuvOcC6bLMWzwcBaPCvPFh+d1fBvv5+VzReFbUkKEmV12XJtcTnkPhJhrnDn80ZJiscakTxn+se7+4Ca12ZPrhqe3oNAN9qD5oEh9b0cuh7I+bnMfcy9i1SbEl/XQqI5E3nHMi7A+GlnxycAA/KfHvVdmEESJ4ToOfciKR7/qazYbI+PCOyGBpNT99inCsg5JIPqbPwEnNUHJTuVq46vZfZpDYNCmUxEil7crH+d9N//sUMRekcjmf9ekqNjpCpYrCbWueHe8cM4Lfuh1s074gppT3wXTbtS2WoEF89Gsmo8VDZSyWz7tdX02b3DQ== 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=WK2KUyUvCzMDfschWTGWSopTnL1yz7l37jkBoLMpbYs=; b=Pogwb3OfcTk9ke3ic1O7NElVaQkikTP+ZSQkvAsquW3c7ZfvXynihmHsde28a73Ali47KoMU5pEhrR29lwjeJ1KlpHGFTT9hs846wuRrjZcg0I0ui6ZfgqvLlUfpcbXmRqireurkkjuwEWxcfqvKH2p9UxbWPVIMZYj79zw82R9doZn9SPGDd629e24mQTp6h5x9QD/XDyRFFtkKsKSayi0E9xt2m0wjXkg6VtSkXJ4DqcOL9nBIX+izHVwev2B7Bxb8yE1hxvOzh1eeuzc9gUZ+VZTfxsPE/aqGzshuiA1Q018nQJzfdXtNc3EjlyVK+EgpKIUFx0JfMml+xH1Y+w== 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=WK2KUyUvCzMDfschWTGWSopTnL1yz7l37jkBoLMpbYs=; b=a5a9fG2QsZi0bhYTrCUuNTZc7oHTGOsp5Ir8/UdjJLFpNoMuN6SWdV1Nb+rWQwtzK/ZTQ2MI20UzPlyWreuULm7O8vmp6zwGtXp1pPMY+XJhmcZisreVnap9aUsiMQVtNlh4NMCnfwQHVFI3amuyAUwe6nANg0fOZupnBFSvIRU= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:07: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.3825.030; Mon, 8 Feb 2021 09:07: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 02/10] dt-bindings: remoteproc: imx_rproc: add i.MX8MQ/M support Date: Mon, 8 Feb 2021 16:56:03 +0800 Message-Id: <1612774571-6134-3-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:07:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 29e6b211-77ff-4d03-eaae-08d8cc1101d6 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: lYYfy4xRwar3tJWSrLYKMKCjZpHrawYp/EdrPcJWAotTUfi1guIfmTBPAhKKw8OcUbqiKY9DBC/QwR7lfWmQf4QPQe87WVAfBH7DZHO5ATASpx4JFXplkDKrB4zPexwVy7Gy3obmjUXLlGEO/gNjLvOX8C+vVEI8EfVpHblCQ+NP73CZBk2GHUscPWm0bwRipJ7xxaqMOKAPVYYlZqkSDDJUzWSNk4SFpeosADpBI9jfPT/rI6n666sAEEswI2FnyoWU8tsab4+Fo+eG3tVHdHZT0T71l+x38SgY+jZCOf8PIEW8f8FZEui8MCDi8M4d4ZVQo3FgPpyeVC3R9FpjVzEQdHm92CEcmZrVsQwKuSR41kAyTvp/rO84tR6Q6jfP+sVzSgDpEJyBuNc3rhzrdMl1Y9geMXe3cMm8FQWMFyLbbtK5JnJWncsMn+dtD5usYXUqby5LTSOCREUfEoAG5dFkRm0USXzZsU5A2rFTB78XeDh76670BFB29yEjQfpVLRwxBxTn07YgguizGkPu2opxPwrJUXNEU+4rUOUFIA17yOsYYXer4XhYjXfW3QMzcQMdjozj4Dbbww/fTJO/Fio5Xs6SoIq682i7xOId25itL5mYyFOJHYZ1p5Z8AAaYv7bkRKFfK9+HnsZeS9x+yqVD5EoxTH4kzWjgsJkAre8= 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(83380400001)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: +y2vgPiTSVd7MQZg17yNgw3vPsKAJmmjEzpvPMae514n89I9Fp9PRJhqNhgkXJfkmEUsKtyPXw8GDRzle3UjcYSOtzQPiddzDTZg2P7SezEGmAbNPHYrCmtf8m1y7k3Uv0DDz+DnHe14djVBroXFYmZ1p76lIb7nOtxczArRWV7HETxTkQFGqAQjIF5fdUD3wX8JRUYxevCxWnIbGP8R3u6I5Rm929hgPDvFYu4X4Kfi9/xBnFelNRA7Fyw5R99C4Z+oTen1AoA/bQHAYMkc1+hiYY5bu3inHxEgnSPksUAQwqK+y+u2upOWATnPiaQvYc1s0NfTTbP1+2ibLwsZg333QFbqmlJ9x/bS1VJPkNeupoMgokogXNgnN8de1drEBw8E32QaOL8SAswzjw83jE9tl/FyqQ8M6ICflJhQ8nZ+VzTSnoRBxfyjX4smRNAyTAj47fSq1BpHLzdEhZrIWEEgiT4BMbWCqG84Ugw5RCScHU5K4350y3Jfa+Mk0ERhTd1Oo1TDZ6M/YcKl4yv8I29wxvmCUl7jmPcg9kRJtZefeyqFPMoDyP0Qv+G4Md04w9YkNH2564S5k4S2h3TkdavbE1kpHW39nCJYjtlGUgH9kX8yBmJaVQKtQXTftF/WRzjMIqjE2kuhKi3zzBIsJyl6jkINkeESjZcDNCM4eAKgx66m08/99NhG9A9g3NG9aIHFV5Wp/ye7Fm8R2NR6+gpOM2krO1KF4g4Q9cHNVgLFrkayuFGvmP36denU0O4J/JSVdW72UF3uCoLyVle5deIMiCZKp388F8uaO9HuEUlESyrndoXe9IBNSaUkmXYrrhqMvBLzcUCJshOHsTqFDah8E/uI5PK6mTDiw3x0XnOUAzt3yY+I+jnmN4wEx2o9Eep8qz3I8GLug/1RWGog0d/DKREb56PMzeDxQrLC+13z0pSKxQkJOdai5rh8A3AjXM/TT89sKa1BIUDt08L1uTeZV09U4V4LylWza0uYG4QARe+XdieExkeBEB8/IOKi7FBJbkv4t86tfBxvqVcykp3uvannQlp3vsTOrxQxl4k6w5IEmymcEaxLRPrCMSkb1Ffy4b1n63YFZ2moG++zPbLiSS2k7fB6VEN2uFQeSZDs4dzVL62cmrF4Azo5pjXUncztp7GXHzfdbDbmEN5XCmZbx5FmlAOQdD/eFyekYbzuw1E2pgYGVoTABvNK6kI8qvIH9QmA9IL0XXe2J+9ezZBgaXO3bJTCudwRTeTq0bF9M1TI6qhD4edOk+LDNT90K+1/CSEdwsVv1TikjRdytO755iN9btjtlrEyEf4jM7qL3Wu0JlpZfokZAiORftvC X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29e6b211-77ff-4d03-eaae-08d8cc1101d6 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:07:49.2676 (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: PFW0M+DpZwM9+ZVkBfhCwJoTpsEHb8EKLKLuz4NNeRloxBVYHsNzJbWhMD2Jsmp9ARCAunSK+JPAWgkL6fAJDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 5e906fa6a39d..d692077c65cf 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, @@ -56,4 +72,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 8 08:56:04 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: 378543 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4517522jah; Mon, 8 Feb 2021 01:11:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJypyzMV5eNBSOkopJ3jqeI4Y6IeOEt2JeMUtS8ncic88TOcuvwwlJnmqGwKPrixe78Ovxjm X-Received: by 2002:a17:906:2747:: with SMTP id a7mr16537660ejd.250.1612775508862; Mon, 08 Feb 2021 01:11:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775508; cv=pass; d=google.com; s=arc-20160816; b=Ud8NaLD0PPu7yZT7cNSZlmymsQAV5s6x3gjFWnpxns9Mcx6EZSPvH7O05wZpGZIyVU U7k1I4gEVMmT5w/R93NhXeE1B2gBOqBJV2VH4Y9XLFPn1+17z8aT1PB0D9CRCVkOvLAg 19vqoipoowqdt2BPEulzaQcGDjRyBU/inYWQt92k9C6E7PtzIvL0hwSE0Xc4rWjaBDXT UIjOVL6v42Pa2kl50ZRW3dtqR9OeNeX81uGNz2TmYg+c4XNrMveC9g3vtJxAJihIIOvN Y1+tGrPRrCn/4Xoa+pYGTZ+V8//kmbtGCri5RuXSKZNXion5sO9+BqAbXrP+wGWRnRUl QtHA== 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=OEJJ0FAGRD87LJcvi5zw9PapPXFGWB4JE0Hrh+ADKNxLOXaCH/InnNXdzZhwseo35G 5t19A1sL5aRLHCU7Nfres+XB/h5eqN8gTb8mpuYgylwv04OmzIrR2uBDNJ/ggospruJU G271m0PL0AlJaJemXs82OMTVSRJN3xXeBhIMqVUetu7UZcx5i1V6DJgWh0wYkZf4erAM 33ezieaOW+mWeSBs600hQ2kL7Di1r48KydFh0Nq4oWgXkh/cpdrE935Wy2KwEQi1ms+S XZndFWuxShPLoKyZhHcc0/NLuRqw5uwdafK+oRjhYNUSH5l/sp3RaTG0u68+FIbi8Le5 R+kQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="hCi/NF3i"; 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 n14si7081278ejr.267.2021.02.08.01.11.48; Mon, 08 Feb 2021 01:11:48 -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="hCi/NF3i"; 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 S231428AbhBHJLd (ORCPT + 6 others); Mon, 8 Feb 2021 04:11:33 -0500 Received: from mail-am6eur05on2086.outbound.protection.outlook.com ([40.107.22.86]:49473 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230475AbhBHJJn (ORCPT ); Mon, 8 Feb 2021 04:09:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wo7IBa28Rt2oHkLkC5mDE5f74fslm51rnsPIO4b4GyyHyS/buVv+L/pN15NFEnEsO8bGQXgYMuHdUOpBfQZwPpHpR7DW5ubHtszQdOkU1OoT4VvnmMNbpmgtoegy+Y6+Om5/1Wf+9WPO7biH8pT2WfoZut+MwL2tRBg/n0aDHPZyRuirr7eLi9Mem/kyhwEISxP+sJ+yJ8dMgzS1NVIe6g576+9fjLO5/lMfFkF9wV4DMUaASCzO0gEENKMf6fvu+SmyPuUWxHdPVnETENBmzMXnWetcy2WZTaGFB13qDRc7n8EK2SPTNEO95Cpq16v6noVlIRmR5UYjffN8j9CdyQ== 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=d1xQ50ppjBVLcgnSdXeo2qPF2ehlLhpginecoT5imMIyNwO9HTpFOSRKihnOBeKr10P93o+HpzwE7iu9kW3dq2koOPFg7qxDhNdHRzP7UhLpc2/8elFyp9T3LkuXXMLk0ib+u1nSFGDz4ivCS00edxMV/i5Zeav6SH3fLbrkwJqaDIU3byTc8GbYXwI0zOUj73kUwvRkMH/8jIDRLqGsZz7sYI+frDS8a1Rf8qLXo+/MDaD6ckydQi54ROHBiBn+A6vDuO/6p8fCCUbskNyT1YdL95N1If8Gvh/k+c6J7Bw6nCRAZW4OgfMCWw+EMZArFoxOoEly6EG+JqzDG4Vcrw== 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=hCi/NF3i9rcj6XfZ19QjqlFshHWojY1P/XMzoTmq2+WdRyj+HShostNOqm0vVSfK4qL6dhw6DHkXXT7H+0+HPgivXSIwwQuqSXVxdHdihtbEbLt/z/aKqIIqGLomSVHDbR1BEP4KY16xhc7KygS7GdI2Mp1lVOlcI0QDQvpvx2M= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:07: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.3825.030; Mon, 8 Feb 2021 09:07: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 03/10] remoteproc: introduce is_iomem to rproc_mem_entry Date: Mon, 8 Feb 2021 16:56:04 +0800 Message-Id: <1612774571-6134-4-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:07:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5be43924-fed9-40c4-6c98-08d8cc110545 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: Hb8M5wN0Umw4pGILZvVBAAyubnNWC/Tz60LrPdSf+2WBjq+Q2sFgouGwm/y5Wu6rGVQaJBb4y/1feaLwd9jAmZqCdl6Lol+l2biNTnI3RENvLfk/VCJLX98ozHYPJPQZulscuKAHyiBDKh+H1zd0Ds0epm5I/8KaJemsUXqk9+fz2cM69+1WBXqCUVijCjdNTWDN1YSaJIFAq73K35D1PkI+jFrGAFBbxvOVX8g7E+eblOuepjyjX3In/nmCyAVjOZyytMVTujKaQ6xho1f5TIAXUDghWBewrKLdtNoRD/cFQ5RiFab4qNOggPZwDgxHJnePS7/OrOqWknR+VUhe/SY0L6sBltlQrtqr22gCbrBjHUwAI2ehbzoR4y0vxhohNWHZn0yzZ/A2dZMoPs09kmNRJ6ZTIKk6vpplRJC1l4m9lEMl3tr7dGF9d8x+bpzT2saaxq37oAM6LX6hsXs5v6wvlCeQnxpKY5kPENjVynvMb1/eSaM3FOs0hDxSUcKdtVSyQ4VWQu7r8htGoHcI0jtH0q1UhMfWu4qOg3YpIjKWhyyTgv2/rJOo5vBpYV2fMMDBBOBnUXTDUPOpP8ZRLw== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(4744005)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZED2jS//f0jyqm2JxH5rnm5ORs4mlCfuw54UWnHR/nBScn6/Kv6WVHBqfTY+VPM1phtSFMVEVQ+GN1s2NLhB+M7totBCx6SNRLQthxip91kQSABZ1NzrsqcvN4bqxGeLlvuK23SsDwU77z55tisQ38kYn+czORktlSAQeOiTOd5iJaBe9ocC4qlXzBLZfa8bzPkm1nAtTgDwAm1SUqqWV1FYi2xGwtTOo+Nr5ioOP1+Bhd6km7j53ciUTMH1Gh9LXiL3L0Lei/HOfxB7/JOG8blJEUeScpuICe1dZEADqLhJsUmZ70ype1tmquth+2ZP6jPehNN6Q5HSooEQ6PmbWyktI5DfrnDyplmM5nxl0FjJyhqBBzdy0Fj3Vw43wPD/nyUfP862A80YVAkvN6GfyXmUu37EpQyiA6J42u1IHu7UpKT1aIPzEIMxdaXps2Ki7GiY+AYbV+gZkq8HqJzjU3XQGtWTmCU10xucmBbMULFofLp8roUrMB5+QqlU1zTsIIOCB8ie9uIWPnl1oJ/7LpuxfS5e6WrIDusQRbg9e7qVR/hH6F25k11Pcmx6wlFCjVp/IoiJulphnP2Q4GT7hJ+ZbS+6kfGFXS1S3ESeDR+l1q8grBJY5dBxJjbANzRTA0uBaW4P2ST1BUdrbCvlJrVfQGt/nPNPmswS5ASfVfBSdIDCndEyY2SJZBfnX32tBWQ+3+EV2l5COLW6N9qFFRm64Fud0N1dOWcz1+9gteI1w+wzHODwgJhvrFUeNCfA7bbiDBqI/usjMzNRKx4vydmKffc+iFC99/RtggQYgVhGc8aHuSYYKyyzRrw2aBzQBlm1Hxg9Plat1WX9ZYaZ+LhBvRWIMIlkb436hiiOc5PI3MjIg94303U/jnWornQMuP35GoaskX/C7ns/RDtdnzQBN1x9VbB5WlvFyESYduqqI0omVsuvbfdxvyaVxUvDw8eiNeMhv4tqitZdOJz69+AS3h8bXwlpeZEcCBx9kZyv3eUp+wQYlh60UM/Vgm54HJHAWdKxxyfwAB6Il+Mr+UXgJALwxj4B3vMW0mIiFym9BGOjaTKvKaCUav0aI71ZO0c+9thO4IyYFkXNIpLR5Jt4Ogu+SMUjNlyLS6YRxz8EcXK4dGS+T1UE8XB0oA3wIbl5i8qXIKLoguGSNBBdJY7YUaihaFx/BIIesPrLZHnQLEM+4aoRCkldrRSXKPOJjMRunuPHB81wHJqmx0kvJ9PqjDFgXyRTUYywExvjqs0R85Q4VttlTdYTfZPbzWpIPZZ7OcLRA8XEaAWvm+8rwgRHMHS2+kKEFtQeLMwtgy5CO32d73YGjfHpvu0qMec/ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5be43924-fed9-40c4-6c98-08d8cc110545 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:07:55.2149 (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: DwNk0serdpjFhNUZh9HfSbtybUKL7C3mn3Nlfk48R2EY7TX6zWVBxW3OjlYgrsqg72luWZwNVXwE8WM05+osCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 8 08:56:05 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: 378544 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4518473jah; Mon, 8 Feb 2021 01:13:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4GvkNVR9ypRpRxEP8w777N9sw1x8FjEf9ycIIo2qzpYvz9rREIMwhXNI84NpTVPH+Cbzb X-Received: by 2002:a17:906:1712:: with SMTP id c18mr16255456eje.417.1612775613724; Mon, 08 Feb 2021 01:13:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775613; cv=pass; d=google.com; s=arc-20160816; b=gIeV4o/Jw2WkaP8jo1s3AShYNla9RAJ8e+APh5rH/mjkbWAB6IMU2VRx3oulDXovfG rRKrQzB6ehwy0Hwfu6n5b0CXQPO/IvnRGli4Gc7uq4dvuBuYf9QgmISt1dFtYhz8Otvt YRD999M7vUiVA0cdCg9u8RAbuVhhU490Lrey49q4R7UZiN82BrncZ7Z1qwofZXlVWgWm nnKySRRNsOMVG6Owmpp3etED6xVKNI2+LdbkT2Wb4KEY12fCSm4d9Dke3mSi3NrG2OcM +OWtypz4OOuZbAUPPp2bnseHCuYfJOV1ily54+2tvmGTrY5JkEptbVhnURTOf3xBpl0J Lh+g== 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=+rXNKJk22YITHnbriISWdtOmCJIILHeindid0JlBzWo=; b=wOXp6r0Z7gs4uOdw/c9iK4G3k4zEfCzcLN35J4Ma1k98R3Wz0ZBUlWuW4D3fE4EjZ7 +mYJA7+6mKXL92zVyzqmZOa2fBM1BFUBKoPr5skHitJdpdNV4EI8GXCJHyACxOtPrl4m 5wvyLWUx35OV5nrdu5YdAPapppY6VfoS44/s30qyHHMjFUalmIeflPTv1EWrXleloZ/y S9B8Fi2NW2CtOQqjyTAkik+yKVEJ1pqHNrwPfuFBSJmEUMr16YSRwuEHQkH/BNDlgSjr RNrl+9G8vFprdrR/ZpyE8LXRUBFB00ZbIlQfJ6NVIBgNBrrhp9s5ipT6mSUg03TlEi2M /HDw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="jg/zI4os"; 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 v25si11906757edq.408.2021.02.08.01.13.33; Mon, 08 Feb 2021 01:13:33 -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="jg/zI4os"; 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 S231138AbhBHJMc (ORCPT + 6 others); Mon, 8 Feb 2021 04:12:32 -0500 Received: from mail-am6eur05on2057.outbound.protection.outlook.com ([40.107.22.57]:42177 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231322AbhBHJKf (ORCPT ); Mon, 8 Feb 2021 04:10:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hdesN5h1uudZyf5jQ/GzUJ3TylxLHbOK2kFMVdl1Gjd6sFBzjxTnIjrtH5JsczmIwscwYuFX3mmu/M7HVszi0DHoJZgjy/MjDFi7DXKnxN+cex1uZs6v0EB/iR4epExY2kz7lBkhgs+VbvvfQ9e3fK9bvGLP3qmJnI5siVSL2sD6lj4ZAmB6KfOF6iHmiL0kUaXPmOivE0zOFH/JNIPXdkvZuTngqrHfVTmBUkt0uq6BEBrpRH0EVi0gC30zu29BfoMd964GvzVnJbiaTrwpPa1tuQ9eoH9pKWFSZb5eiIvoiIQ1oDeBp74dmmtY8VYsz3vrY3yenl5TBHmg7nxDrQ== 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=+rXNKJk22YITHnbriISWdtOmCJIILHeindid0JlBzWo=; b=g2v/NXNzdMliAAyKfArarmX0Hi6ZSoUlougkkPqYLG70FL/GBO4YswjBjHCWxBmBVvNKNmxkgWnRehYyKM88owQGOjqqZw10e8yJEMHdIm1rA6xaqtfM8kXn7VLrvd7BugniJfKzfCPMspvoDSN9NvgStJulupf+5DJXAPjfhSVqmWPSiP2koL4PsY+IK5+QUXi+REsbDkDy2GYq3z8J456A2TIVYBqYwwpS0NMaBCGGwtanLhZiW26nsq8hl5GNdFY3De0g0xamZh9pQW4b2gXHTHJHYU/xqNOFdCpMOf64yGkhNFfOqAIug+P57k3O6g9pG2VvRcbWSFTUd5OtQQ== 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=+rXNKJk22YITHnbriISWdtOmCJIILHeindid0JlBzWo=; b=jg/zI4osBrG063t3FMKB2WVJwi9mWDKvZSjZUyfqaGE56bK8GjX3uPhodteiJ6q6bsanPm8i1LwKLw7RFIpZExG0mk2/qz8OzcQVJTRS7clJ4Z2WpDeTgQDk/cJRtW2dJEP4217nDlgP6PgNd6/O9Qrd5XGpzDP3gVFv54S/XUw= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08: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.3825.030; Mon, 8 Feb 2021 09:08: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 04/10] remoteproc: add is_iomem to da_to_va Date: Mon, 8 Feb 2021 16:56:05 +0800 Message-Id: <1612774571-6134-5-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:07:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 17e77584-499e-4d29-783e-08d8cc1108ce X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: o2WDwnAvkt4EaSs0Yuh5Rcwv27BCJvh3YMG5Gz87QyAHqjXkvI12+ZKvQ1knZNDx5FZ0G9uqBD4tIQNq7I9/CvEFq7MrCv/zxcSuJV8DsPXNc9eEekDMm+z78COuBUsBsIiZIV+eyP6t+bHsj+jhTaLfCWpV5GowzdHpj5fs1unkw8PAnFsRnvf6iUPWlrEZw0K4l5qOt+4mk6hnniujxNI4R6Z/CuoJ/bE6QILKvcxXTHOnAbaGIR5Da5OrT+9BFzB7vvBA9lQ4EjIqBZE+DB5a0r33W+hnipKCJUA4+HoYRBjTee9IuWMoTQ9cpjRBEr7PPBd77E4FRM6kNjbYo62tj0tLYhEiBFMKytLChvV70xSQZ27/RitfzuTYKprkWJCOJ5SRdDAQ2QoDyEppvDl7dRBXhn5GUerybJ7ZEcthdl4uUBwaO8wSzmjHlC0zhqOqGRSxh2aORCZxdP8aMHJ9ItrV0hgVpA55vh6Hk2UFH1M8NvLEbajy2kO5YSbIKhGVwLmjX36TBLzNTnzezKAkK0ySV87L26j18wPY6J0UqktmZ5pZVHzvdDih0atNuMxMnOBY0LhuV1sQW2Lzxw== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(83380400001)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(30864003)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: afOgDHDWuMPgL5BrQR1v7zT0922NMvO+VCtQ9CABR4fQefnsklW27uqkBFxyF/PRgGsULLF8b8MNBc4YD/oiTbYrcqj8suzDN9f8cwqt+hPw3wj+5qRXAldIOMOzvyIe2BGh3VvCMXeo8K8NMWMjLjfSn0I55FvIdcJ5lu4QfNQn772mUTPYLNHlkLAYDsos0XVJ3wozbxeqPO/8LjaOFo8riQsuDKiCbRy7jF0IBBYQJhqaMIN1GfQOm0rMFpqUdLnYBxQo5oL0oDtTuJ/0PFYziNArRRmtelbffM9Y+V8OuwdPeSFr/LSffhYY3HRZYWX4Krokvo+RS/vvAr2GH6H090801GFKpYgpaZ9Ydfo3YhJECEr2vDVcsxx9fn0pUwxCxbcWVOif5K2hvFuxrf5gsqFdB2jOgjdZqbUAqHwg5pGbs9C1+UVqJFVZAYh3jVy6GNDIwbZfUh6sXr7M9do9munxoDYGgCK77EA/PcRMKCtf1/WO4L/4rb73sbQh5pnxo4DvNCaH//pCe85SdrB0A16IhCQOCOmBBk/TeGgN3KuAMqZ3ugfBnZXHHO9fWinnXWNxsL8zEU207rmc4Cv69KGMiyla9dTzA8WCPFa7XXrsta1nAGwYdycJOsn0v7ElGsSmNTlv4z6k3QCYLQlcWrbeRjgOOFY6mXo2/UI199TNHdHZqOGkhb9YRhRzPHAQabfcFplp5NipbDwZQ0gaUVYmk1TQh4hMb28Zo4pdL7PGEvocsTqXGI3H+tj2LQUYZqtN9GgAH45ZwzVEPbImhpcgG0t4X6aQ8SjIBwKuIuHmRofbxZbmMrRoItJC8+0K24kv5+QRgaAfoDZhVpMemEEECE9rnISEblgoFk00SKobPC5GkahQAq6s+x/ZKL4CoeT2jVNNB2MK48nJUoKLIr/iZ1wyW8HNRe+0XSxdFyU4vIzqrBPZlluCVSwGdbqnGLE7yPa57+Y0YlZ87yFQtV/m9S+a9mPuKXJpp1EJAMNLhi0VMo0FTGr8PR3Rb2AjfBkg6HBXVYVL2IwklvK6rUNEgxfKXaq0oDFlfC+Z67P0o3Zr89X1g/D2cq0q27JVihYbjr6CyMIM24IiBv1xWEQc4vBh8b3mM0MJs8nsVYukNwP0ZzsQF68q29Ks+JQ+9uv1RRgLA6KvMMnB+Ll1Ao4dNNlASioxjJBCbC0PyCk38PL0dtbibKm/scgvuuQsUktH9FHNpj8EomLiETCQZR490Wa1w/khEQILw5JYgGYkV5MqQRXGEmgbmjJjLpMCXFm7MHHWQBFgWYwIlL0nsK2cD7Q3vY4GSVSzdfhVAUrl7TW71LzEHxMQ5I8K X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17e77584-499e-4d29-783e-08d8cc1108ce X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:01.0702 (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: dAq/uT+UqIu+hqvtztoE4RPiOfeYxsFnx5Qwj4tSDmkl4bGhws3BUvPMBQzUi7Uji61RPypTudI2DbMcPPaTFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 Reported-by: kernel test robot 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 26e19e6143b7..bb5049295576 100644 --- a/drivers/remoteproc/ingenic_rproc.c +++ b/drivers/remoteproc/ingenic_rproc.c @@ -116,7 +116,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 e0c235690361..535175f013e4 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -270,7 +270,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; @@ -458,7 +458,7 @@ static int scp_start(struct rproc *rproc) return ret; } -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; int offset; @@ -587,7 +587,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 f95854255c70..1bf60dc84f69 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 2394eef383e3..9bec422ccce3 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 8 08:56:06 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: 378545 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4518479jah; Mon, 8 Feb 2021 01:13:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8YBVLXmQSdODqI9GxHIJ7fu0LM+VL8iJQwYYJYqlihBDcChdySTe16WshUMv6AmovWMEL X-Received: by 2002:aa7:da19:: with SMTP id r25mr16209212eds.1.1612775614448; Mon, 08 Feb 2021 01:13:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775614; cv=pass; d=google.com; s=arc-20160816; b=iTpei8vpAiMamCVx+Fl6Xk2xSMFZxi33G+QNGhe/tV1/krCA//VArSGLx7VCqfBAEK inkmGwwedCoFgF2vgW3xEA+7o0wg3RDFCsbrY7yPza3A67ae7wkP72tlL9A7aOFIDWrf QY9Z4+yuzNf3TcKgyr/DQnLgY2VGxn4FzN/UaFODyU1t1vwzJ7oN+fiszouklSWVy1oj 12TkF+hHiZ5T3bpbkvoYGyeWND7ElZVQhB9T38Y33RCXB5FRlcDHtEHEQTaeBNcvME97 iQwgwA0mKnuhmkYwpE1jv43ZolgyrjD2Piom3s3vECUc08BFiHVM6CfR8cFOHcgltNfb ZnPA== 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=gdfrJ9wi1jXiAf/+DguWVIhXhNQOJZwEIJxmyGoo3HLwcsQyPp7JFHEG5M0MyX2xNb S6Twl15IQ32UgxfKTY3W97rARc76CRZyV23cOXAoVuVtoMOiEvfK1E0NNPlb0JY0gFeJ Gj6ERV7EMqsa5KVJIco23Z51fzP5zebMOgeEVdgbvz/fJGHWDN0dsA3CBvCb1RaDLxMe FthtpzbkM8TZVaLqkAL1Bf2OMWyZ6NcjLHm/raDsBMr+Wtvvw4WfUIY0XkU4oC5J8dVL MTeCgfKtCavpwljYweO6P8cNzvlXht1NBJjd157hEMuTllRL4KSUT6OMtK5ypz7H9CwH baVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=G2M51jGf; 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 v25si11906757edq.408.2021.02.08.01.13.34; Mon, 08 Feb 2021 01:13:34 -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=G2M51jGf; 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 S231466AbhBHJMi (ORCPT + 6 others); Mon, 8 Feb 2021 04:12:38 -0500 Received: from mail-am6eur05on2066.outbound.protection.outlook.com ([40.107.22.66]:55553 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231357AbhBHJLJ (ORCPT ); Mon, 8 Feb 2021 04:11:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqsED9l+8bP9lvJesTFzaZgMyyZIUEEbqrJqTZvkPCDme9ONkbm08P4n91Ky5YEbCjWJd1n4WoYm/3MQYLNETmDu18dH0Z9a6u3LMT4HDQCQ8Gx3hKHPeW7b5JkXCKuAVs0GtuQdQymJytxamFg0Fr209s1KqAcgFZi3zdc1NMd0+iICbx1a2J9GZStGr4NG5emjwkin3lS0fV31laJISmOy4WaZMFKRW/FVWtcy44sQ36I/l9FtrlaYBrEZu/iRhek6R0i+IHufrDfpM5vn15DyX+QiG5/H2kMd6ODgoysn2awdAHnsTtc/9sSN7GZJfE8BN6L0E5qjpVU85v2H0g== 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=fTRglU7/tt6GAdQ1ecgafyduDWs0uMULEvE9zvpyk6udSqMU0dpkHdXyWK+8qSqYfPbuIikBgy5y48INjB4rEk1lFCX4mc0N2YLOfpURZ7hEXwGYpjj+KwhaSHw8yaOFfWSOtliB0K7zJURxp00TK027lgvAZYEzXNS4SK/6aT+xMaTrRjuAsPuWvoiVX5EaNqiA/HyX7wcC91YULKwSDbBwZRfL/x/hov1Vssi6JlXxBM9HP7VCRaQektjR0ABnIthVpUXVjFiU7lWij+wbrG7dYtvfnezEabMP92NdJCkF3RSpDRJahvjbULE0BcYZKS6Od9P1Tubcipjuk80j0g== 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=G2M51jGfuolFVBRSWmkJWXh/V3hsVPMPwpZZ3yxB/z1NMBpMRr0xw/LqHCnurqNa/Ic1reoB54XX03ZETnePMea1saloaDaSwOJaakZWWiNrqik9x8Mivd+XgO5LpQF4J4Lf1MbYFIBLGN7AN5ItGmJOoi9CJFCHv/7AfEpErFE= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08: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.3825.030; Mon, 8 Feb 2021 09:08:06 +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, 8 Feb 2021 16:56:06 +0800 Message-Id: <1612774571-6134-6-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:08:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7fdb868f-0716-498e-f54a-08d8cc110c47 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: nT+B8t9U4xskGficnidSUwVDo13ZQWYDmOIV1uKy3ap+8PAI3Q6m+n2GXXoxdkxOlK/FJTnzLKfi+ytV4hEnKSzQeOrQI/oi201U4tNBUxNgSTi0jHOX2A+XgC1o8tB76jSMrJZuAOYzJVKNWneReAhGdtZTD/K4gngHcHXGWdMDqsSxl7xF45uX0pRvv/Bxq+VwhXn90OqE29MEjU3SfEfIDHCOmLuzREiOcbp3diFzAyfZMv9JipNS26et+dIHuXD7lq781boRs7EsSZSRysI+Sz3Yp7zXuWKtHvQ3Nozgb2W5AUcWQmwZJyrBDns3FfODp2toCjWAIrIlzqvmNx4RKmt/H0NNQqsXxJQuCzBfPkvQqZ3DmS1umMPrWH5SqFmPHNse5XyLPvPm3aBDeU8/w6uM2zsZzv5PC3rKjNo1Z6jlN0LiRCFocZ0+54nmN3/BgHWXXLgMzMkKuVVp+TiHC6kB3Zs4KEsu54pgMDx8z0pxKnKVjov8q3Ln/rTrFtrj7Uz7jTd4gVDYra86KlZwuXFfzv36zgxonDZL//bOu9HHQH2i+/KL/6rGjHFNCErxeI01vdQ6N2RcTN3S5Q== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(316002)(83380400001)(4326008)(8936002)(15650500001)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Xq2csf/fVtUY3KASYbNNfOm098M8Qk5BTnqO07PaSAKAzxqsk3nFtZ1ntrH+nUb0CWu8gqeIFmolgcLfCyGDSPjWCD8AgNfbkSBtpevtXfGD6LySZWsLzM9Mq8q0wnoIo3+My0Ws7MYuCHubbouZpA2vxFhq5ZOJyGo7jw+UAPpisooI6AQ396uo8Y4rU8odrIr9ug0NV6VdydtjiIpZLNqm/bLlSA9eyqd1xnIx3+R889zq88O5EdunuFJsVuk9/CFEdGoTnRO5rF90jCcisbTXDLsGAe3xOnmudWB5h9i2xB24qnsticN0rUY8+wGibuCIKPmhojx9a3iAtE83AhksbIpzIKp0jnD8NNaf8ZmDLu+9hcxDaduem0IDMPqLhbcQ5b2jaIrNNPm9tcWWBtLvrhEbMOO8dpHV/gH5RLNwNC4Pwqdo0o7Np/9aN7U968ZbtxyHlBuv2yVObxG1MHKhb+teBtFL7MMZ46S9VlRMfsjbrptmBy1bPbGRRm88BYLYRjKiOYL1s/ghaeNdmSswCvasTT9DXUZNfGiRAFR0/z7o4NgCmucutcJAaIi7QXys8y/u4+2JwNaGv9AUTSTAWZ9cg1bY2dQQ92GIWuFdHEdccGFG7eewHA16GEvarpL2cPqB2YGrFvncIDs6IvxKwYBFWcaIR3kZHXgl+4daeIYgPOLsL1iIdVLsztvKVNMMCLt4Vj2YqrEDRkTXweUeQkCb3AMOlzWXOr/xX3HUIGUBwma20hIEtMu4fdDoKyaqMKWxVw+VyGSl+euQ90YSNDmOrgJocDgIvUo++q1AAuvvom16+zkD4+qNKb9Ie57d9pulcZ/225ZlRa7DmInwS79M0c4EIIw+blCdDqMmJf//F4TO6Z2L4egcwPFucLgap5tVbLNWjt1P+7b7jQWrJGfU1yOEkhDzhZlXbDUopd3qhHVoqJcUUmSMITDIJO6/yzz6Gt5sTaqnaUYeg5Dg86PNdZlg0E51htYqAWpgF9adVhlA02jzGmoISMufl+cPNNammJO46+N7LBBASrzUnghfWE04VEiMghmG4JkzWPBKowWM1LIzq8ewjotRQCAkPCIhViZAb86ceqgQx6wR5LOD4wvH/UXIchL5IAZqW5t9DYba6IItu7PvgJ1ubvhLqWgAidWgk8m10rlFwhro+rmJtrEt+ga2/5d2vfuz9oCw5Bl2QAwYF1dCV2rI+4XwnB6qeJcvuljmRwkKj7umNhnLtgcXpe+IXEoGuVup0rasTgS6iKhNJnSD+pBjQ24SX6OopoKLV/ivjPv6B9uKd6B1An9ASJjB4vH01rXMPsUKsZyqx7VNvG5wMh6d X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fdb868f-0716-498e-f54a-08d8cc110c47 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:06.9086 (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: 5fx958f23YhFm3/L/mxOr53YSmjUSXEZxvjC8A+fnTns2t4EOwMG6AO72bORHPRWIu6zFT6GuQ8QjgAFwxBbqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 8 08:56:07 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: 378546 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4518503jah; Mon, 8 Feb 2021 01:13:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJykO3yO66WGVJEPNmNoJDggfRB5JWiLhbxRDJNiwTN881M/UpigfzG/yiZIZQ2gztpzrd/k X-Received: by 2002:a17:906:eb88:: with SMTP id mh8mr15827938ejb.150.1612775616768; Mon, 08 Feb 2021 01:13:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775616; cv=pass; d=google.com; s=arc-20160816; b=UiPchA/+PGY7Z+His421uhPKYc37A/CS6T61Xi21GdXv+1PICE50mHaBrpNuc/CqzE K/QaVdO3AvckUCglb6fWH2oJlCDy6hI4olYGuCGQEqZTE338qa7uwk2X2TfF4irEjbUr ycphvgB85TrDRIg44g3D6867Ths4vFwh204vuYTAEIt8VkJJV0XA2OsGBKZy4xfAx5rG rWDEFYeM5dBdbRkmNhSQ7jl2wQhfBHNhZIP//qD/xpw4Eux+XdRwH4gxxzjGoOhTvQD7 PimXSHSPWFJc5/QN+ZhBN7/imoWBq/dH58PqSoOmQ5NUUz+OOmXqFkcr9t9t/5r/gjOS H3og== 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=WZbd4yH3FcwhGaJwLAD5nUFcm11c6MrvRQ798UTnyMKXgOhvzigMrt6tLHH2C3g1LL 6mKhoHbNKwvpZgcqgEE91/pzF8whTNITso3WSWIFVT8w54D2IQwSO9wqnjWnGUrIi2XU Ugv8sH2xZcC8ZIC1Hh0/V64BgNvm/TyPyACtH3ar6h7lW+8nrcbaBbH5RaSdTt/J0vJw TjNyd9d2u9Demh2ouTok+5YH5jddKDIMMIA8j9V7pvMA1ReorCKIe32fRJ5rI48vANbf HxWI7w0f5+mXRAV6EFnvWTH+kVGmljkwBr7IZLcqT4z2VtfteJPYVgW8Zuz83OYC4HwY yjJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=cedwUi9B; 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 v25si11906757edq.408.2021.02.08.01.13.36; Mon, 08 Feb 2021 01:13:36 -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=cedwUi9B; 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 S231256AbhBHJNO (ORCPT + 6 others); Mon, 8 Feb 2021 04:13:14 -0500 Received: from mail-am6eur05on2089.outbound.protection.outlook.com ([40.107.22.89]:51744 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231388AbhBHJLc (ORCPT ); Mon, 8 Feb 2021 04:11:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYEMUX6XjQxgX6bGybN8n6ybm4LtnOfYcXpombkJQ8fbfRfTFmJbd7x9H4nWWaycdlVW1w0JLqSdNdTNIP9/QL3kbiGIn66/gi4sQByu9EG2ubxmsSuAYXJP7mqs9nILsWn8Ip/lh5aHgrgaifvbpsgtyMRo2CMctQ0nL0WB8aHT0j3MfnKQsmwrlCbAt8d+M1LERb08EznKr/krtIDJZ62O3JARDg5Bd2wPdfXeCRv37KEpK4nkdLpDkWVHhd/sCgxKCk1iNDG19gOb1CbyPoaON/Uw1Paq0pIK5l4aBAHWDDpv1/MSSt29vsgq3mmKZfO4xW5rHxtNDyqlhoG0DQ== 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=VEN6VdjYoKgzV8/7g2tBr+iw5wFYCkf1WiMBUSMdu8Q3NUkRjbk0pe7s4nWOYO05R2fkmAR9RCkRSCvcL00xxwxIxolTnwRDDlWRTh5GC5wjQO0RHenEQq15dyznXpR37WaZ5ISfM0Z7pTmHgNqqjAxaFY0QaH4nadcXLk5eCAiza7RZYMla/dHNyJLLz7CFU9sHCODHoS46CdcK6SWpbYkFgpWfRb2jzdIfUkHO6xgG3hB0AtiXWPLR5fZLTBFMljpsq5+BP+wGgWw2FFQglwUksNiiph6nIQH/W6KM0F9dr/EPas7x250F7OOFwLhzaHcd0eNrQ8rL5lPFHarn2g== 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=cedwUi9Bjnv0QJE9/evoYT/hAQ8hv2zfDcHUoTsI988tIrMnThFzJQXIMdqHoQ2PfxsXj1ibJ508lFNqe9UTR8wlmD2DGjdeuQNms5b28DtzyXj7qBqpbJxCjXfBlhya9CX7kYwyWLC4cMnRxncDx1FSsRTFMprSKOKl++blxvs= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08:12 +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.3825.030; Mon, 8 Feb 2021 09:08:12 +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, 8 Feb 2021 16:56:07 +0800 Message-Id: <1612774571-6134-7-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:08:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f67f1452-8715-4af3-aab3-08d8cc110fc2 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: 5WJv9pLYkr13n2lo8Z8bueCiiizYYuM8RHJ9wFziFFX5eWzu6AQ/4e7xqmkBgwaN2AOFSsVregEhPXxQiGXlQxY138SfL8zz6+0hfKhImA9p55SN4pYdq7RGr20VK52kkL8bsjMNDBAI53v/FlT2e69T4tLjSvQ+GHBjegn94ALmM1IV4ED8924DCOQjYousTbyfbi95nQxRtJF8vcocY4QMYqfEIGB7QCknmmOX7qJbZjpF0YtVhwH8dohjSUg1qrLzoVtqLE9ZnLBQ4cdTmjyepTW3+H7XN3k41XVbBJqg22sVufcBkYWnjqVN+4Zm8TeovYmqhsk+g+/yLCOuNP3KAREdoLExjnMvzcmtr+TRrJ7+42RlSepNvCW8DEJxGrlNApfN09alZ772iyZghrkanCOhSvFbgb+CfqmssYDTBgISKRa0tX5oeKwNzjJ+BhPG1jdYEvtPNIelKWWnbToWVvGjoq/beGnI8X7W8KAifsSK6QCbFdWLmpRdoTLmzY6RsXfcHi8NJgPG62FrJXWQLJQ6jorKvyFmycPe7xFiZTsAvjYSOP8YVGf2Ar8Dttm75m6i3GIugfI/E8TaLg== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(316002)(83380400001)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hIkQrueU7TlIdxqh1A6EbwMIgzCV5FK7FPFLcCc7Hrkknv2G9nVMxG14IuYZmD/VwiV/Tj0bmpd5jgT+3qcmks9FffKgvyTiH180ZX5sbSHJr2XKPbikQKJMq8JZdIvOPHImcpq7xwnlnjmh2bvWs+xpk5aApFWMAztJ8G038OOYACVC8Gmfw9FDK4PsxvWr3QsnG5m6BpF6djo/9HH3Fkx0IWQCJA0DArKpUeGvtQAwQzECE8WrTf9TQo3hGQSeoQHCwD605pUyH33oV8M0Mb853USVxRrumwoWBUQGQBYVqbpTxd6ctKb1B2jcQ88Jhu7z5PVwG9qblSIegqCs1Z8+o5Ve3A64dDiwG0RScfbCkwtGG51dtHlhQz19xj0/0XIzPvCIhbReSzp0YpGCtwfg5EnhihrT7pdJcAcLB3x12OsqeR+co/JMxEr9/5a9Y1V3VykSWZC4YGuoJM2XWPMk64MNxgAglJpQ4uGcAU6NiqWZJvzJxtKbTjWDdroDmRIdpEsZFWwm+VqmHjT4E2/c6deAOxfcwzF3vdti6ibAcr3md6b1dWnBbyQQsd+FHzDwI6Sn6Abnnce/b3hWYInSXpFylcYWwe30mbWRQYtmSz8PK8OLTFf5gFI2eI5mDaa+X/FVpt2WkybFpLWrki4ddlYePGhr5BWfHD7TLlp3eR5Tqv3vPXgKg/OF8z60NRTwQMly/JouZZNWRRM10Ws/4sKYji/J8Y7VdGoU0jC61dFwz4eaubGrErrG13le28/0Zz8T6RWjVj/Og5VCnFqf6scxkmWhieDKckCL5q/mnyxoMwFxpB+Zax3eYRPsAd+YuaCwrusO0x+GTz1gRAUIF+e4lbzX/cIxsP/QXbkyW7q6FEcGiB6ATLtjOaxKLoTjW50Kf1a5cpve18AY17mfUhSUWwX5wF6r5WcYbyd39hLEycFda67WrKQ8+komdLO4pps4u3WnOrRYxO3YPtyRDaobhKqlkmPJf0DRoZP4xlnsS6PD4f5bBwHtrfvtJU6vAM0RErCSJlZ4LUyYTLKlKXcqUdhK+i5w52GY1BSXf3bo2Lrj7qtwkyN/1pRwcwZpZT1v7ZsRentDuDL1JQMO+wzT0IKRJ7F1eOUj1JjiJ4is0N1N6p1xCQLpbRXEBkOIHjSQnIXNauUncVWRU93vaMjLaB3TfSXbDGggx4NPZrgg3nFBgHhDA7OVIpfApjyt3bkFBwvEUGaNteOXBwzq5ClzRXn6u7EkEPhTvqWeEkcyVxCUkWYcxsbLaEVO9u878m1m9ahXrzO9g753mAj4o/N9uQh8swGNZHvgDGp62NC0cg657fh2tAkbDUz3 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f67f1452-8715-4af3-aab3-08d8cc110fc2 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:12.7319 (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: 2eRu+ObApVTY3i+bXJgQ8hOL6Cw+3Ii55WYvBZ63AsKBhzF78BXPt9E2hLL5yoII0cFe5p+jne89E73PHqjMTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 8 08:56:08 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: 378549 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4519340jah; Mon, 8 Feb 2021 01:15:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwteVSAtOw1wjHjDP/9m75xAzYfgkFhXmFV4DZhc3EhuruLAthoINXYRZNponFIcua4UfeR X-Received: by 2002:a17:906:d214:: with SMTP id w20mr16156238ejz.284.1612775717134; Mon, 08 Feb 2021 01:15:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775717; cv=pass; d=google.com; s=arc-20160816; b=YHckTO09mmCgFw8in0l3K4eKnQaAtgpXDXBflKtBKmESYs6XH/xF61i0g3MgcaoTB2 3s66/ciOV/wNy14WwiNuIYa8l9db/JVCRdor/4/akqn49oesR93FOYrTLVjsJWEFNrml WLaoEt9fMdH8W6/lktqGsWwRt1RKOD4wAoOPEyJQspd+CLRrie/GLNYENyLqPpaPI3J2 runZOHrhx5asrtLb8pJkRiJqoMhMe0YD160QUc6ogso8BYHo8Pm3WvD0Vpbom2tQaEno b+S5nvX/ZrWTGSYHpY0pfNFOEPlN/IMqT2sCsIB1R0SkRtirYPEILHvvYk16uDmh2wye f8Wg== 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=Fb86gps8SkrLiNMRguS9DEp7tLDQGM8YDz+GYlX55RyeO2fUbkSbw7MQgfYca3YgQA ChMdTByT18lpkIkjGWlEjQXev/PeV2/wzOFilCOKTWN6UaZLiMRODnLVrlVq12S9ptZx eMMqU5AgkEymwgWBMTeVXvwdAGbnWcFX6eUgzkMnnPuKOYw/4YpqeNZigD5hWimuclsE Xt5YTeDYyMWO2YTabxB3rgxhhAkfDMsK6K4e3vnImjvD1Hnci61Tk+roNQpyRl5gsAtt HelOLZfcZ73bwM97sQRLZ15JR0EAxgb34Hn3RVgZeEKeBiDcGdFtGn74b9QtzL6XWsmr G6dA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=N229cZCz; 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 hk6si11031618ejb.204.2021.02.08.01.15.16; Mon, 08 Feb 2021 01:15: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=N229cZCz; 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 S231529AbhBHJNm (ORCPT + 6 others); Mon, 8 Feb 2021 04:13:42 -0500 Received: from mail-am6eur05on2064.outbound.protection.outlook.com ([40.107.22.64]:2528 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231438AbhBHJMB (ORCPT ); Mon, 8 Feb 2021 04:12:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EhbFAAdMn5uJRUnCo1oFduWayllKCVANitcfOVLB7/S7up6qKI6uA3AYKv2H4zyUKZyyFL1tDlvCPJYkoTO3hSW4w7D4AtAR44Q1SW4HOuOxgesFkYk8AYPmurhnNhNm3CSbu84D5ptjpVx+fq263CtfLi1bor+/E8M76FiBWMvN9FRG6yIy63b2k89WoAsgPFsP6p+1acdp6VFnfPrvY8JSFb5nb7zo6BvReP/LXWvb2O/uM9jBA7i87IXJ7/GmDrtcZZ1wg6Q+0ZRaczMbsQODhSRTvF3kACwOyPlYoSDTCwe2fNNfk1fKstXf9MjWfjta69/ojf2TZrvNyqtraA== 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=hBqDMdboEjcgxyhm+GmoUjp/9ELE9tVLaakYraZZ2hJvT2RebsA/FKOatJlU5z/S0zYMJlxajjSQvITofeh9lp86dOH9xMp5L0ERpDm4x72nCgigm99Ox41rLOg610GfhUhc3DWoGXz4ovfCoqiMwPUZt9VEc36IHFZGWqOWOmRTvH40aMQe4CbGIv1UvS9IAz6K8k9dkHWwbiannhCM24rpnRUx8CgIRgOHBcA74DDyK87uPdZoz1iKKZePpNuFfQCyd5QtDWk5yjnyMHhG3PNkK+Q0iUNeLGt7jG+vOfBrE6Iwxg7g7BVtfIXeWrZ9kH+oBAHKrxW9L1DdBnfscQ== 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=N229cZCzuRVlPN/3/+TLHZjztegVfIxrL7EFeI0rF+Qsbdp2AXbtnb0aTjh7ev6DTbShlmw7HqD78lLPnCS0xwrTB35HhhdGM3QXWG7g4NYnoE4/s/zjiFk3+RLOhiySK7tkfUL9eDfq6ZYPsDZ6BI45z/MgIj5gd0kPXQ/ORhI= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08:18 +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.3825.030; Mon, 8 Feb 2021 09:08:18 +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, 8 Feb 2021 16:56:08 +0800 Message-Id: <1612774571-6134-8-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:08:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 67dc6435-4a1e-49d0-2362-08d8cc11133e X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: rYrsh0ABhPCXqvJq2V/ADKkM4shPrfAHOS3STmzq8HnKrrPeMw/x7E5YmyQy4VcHQTlfGnaz24r2kLlg7uo7/ToJm0Fkct0H509+ZTsaH+SQu2W+6nXBCvg0lILkTgQwjA8PBHnBNM7/IGS1GJEkyuMY5YKM+jJpRDI9h2AdDROEXzhyfJrXz3nPzFHaJCopipQ06bol74pDK7lm0t7oxryBqFbfjt71aW38kAChDRSL1uUNBsw1Bz/BnfAb7fT8BumRL74wBvzSr5ERSi9GH9H4C+37Ha+MycQ5VKOYrfQGAYmWhmVaUTU/GipEBj8/9CM0Ntevc5M7Sh2Tt04qprstE/IWeWIX6FYS85NzdP6tfDO35H0dtJxD4lGs3sAa+m87geZl0dg9ZUXwIrqHz2KgsO8zqZi1YKrthQCMaKaQaD+Z9qmEbyj77EAVFjwxcmrFzry90W/5h3PHDD/D9/RgFCbC4JxRNK1LR5rWDur/TKzpaRUUbkTxfLu9LSxKHxFMh0RBo6v7AuZBM7Ait+OcTP7mdFArvgcplfi9+4BpFZAnv0+4c8FyIGUt41KqF6RYC2F4nuSgTCfdIecLAw== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(83380400001)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cSK8BqodU1yizEvils5JD4guB3zKEAO78uOYKDXgAN/gQdarPzHYTz3a/hq3rhY04Kof1/Bivg8kuBCgMx4I6DQrsAQOJCRxNtiFQ3IFC1l5QeH2m0GKd3baPq2E4SreNgLPqTfJvKCriijqSBAhXC2CsRn4J9cW+nc4JtR9UcTvFFha2cCzk0jJq6E890Ddmy6U2HQH2zHoxStE/koWRPkeNalSwBw/9Y2Xh+HxS7pV5Srbd0r237KNKD863TP46t5M/wJnZer1bfDQILL1GKwsxdEl8CB6fJT+dh5H/UFWNNyIEsLCSmRgPpHkMLt4AaQzjEqxnzBLeDKiws0pIYdyEObbgtjNbke04CKNDql3uDEcYQd6V1fElLSwyGrG4wh9Znpo+T9ejUbHYpJYckm45hwNRd4KE/Hba3j2l1+ewUhlOS3Yqn5AeoBxHkH4HU9ONR2emEs6uGyiCWXYGKkQB9eoHt+KppZpk+TkWGIJotWRiodfiGY+Fm2MoyGV335I3qsXEuLMc2UfdeK25F6WF5k2QY5NNZ+fk6ku92FK1qPben3AAdRopLWhhuQCre8BnwL+KwwxcF9vy215zsXIG3GVopl0Pw4UCDs6jfLnz2w4Lq/xs1Ns2LKTzfNjBJDu7jtwJjqRneI7p8AnP+NH9rl6r4c5vWjuZZzpchRzXxtTB+MhFCh9RXuhCWOkzMgHuszaigTdsXCHGAxK+/7Z0VZBsMhr+rgloIy2VH9cQZ7Cu5kZpItaaFOiyLzUkLjQqPsheNK+tr5E7zkgnGTD2I8uYOZGb4RaKpkztWOmLgqLf7RYUiHMNV2T17baSLYQBHK/z6h+23mUGWIK2EW7fQ46NGpDwINB+lMnM6xh1+HGH/ynX2/Ycs61AKOmYRMas6rb7xrJCMxOFv+Jds8JK4gEbRI/KVSGdjEyz0S6+5l3q+ArhsUqmzKgdB3ZpObORmyN8WPXCgi68oxuwB3WWLrED45BlLK6VhTZ+HEuLx4I9UaHhn4ZnSPivDIbDB8Av1zumetgXdtdSgQHWbBabgyvkplOy7o3NYpaUNAKfw1P4bioRuC2vJVTsRQb/P41YoKWCS+S207jt2oZszxSlESrfdJInuhCNtzJozPGFzO0F7YpL6yZWJwrzgBbv4nRiPP+LHTg70w1P71YeXJd4U4vGiewTPSi1KKYwPklPQoDcDHjn8wyPnoTwnYEVP41B2crE/fq0zTqASGCSkAxbUTHcuhbIdCj89ht6lSJB80mdarVpRgdeS3ggFtShG6DoyspopI8+vvC0/GYfLer4NY7TGOzI8YPjqabIMuUBPnl8gxdd0XNk9oDd63E X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67dc6435-4a1e-49d0-2362-08d8cc11133e X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:18.4583 (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: 8JfsR0QAkOXfghI+CeqsbcT19yXumjrG13kE35ZB8LHM6aAEIfEwz+HceBub1DpYRUUZqDBj18Pd/UuPrKW9wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 8 08:56:09 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: 378547 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4519141jah; Mon, 8 Feb 2021 01:14:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfeELVAnYu56DzHgIhYAhor12WButNpMfRddnLoimsaqYwV+Yxp8aZdYKHWpeEVOsVRqzw X-Received: by 2002:a17:906:7f06:: with SMTP id d6mr15485908ejr.169.1612775697717; Mon, 08 Feb 2021 01:14:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775697; cv=pass; d=google.com; s=arc-20160816; b=lD4hQeBObiHCTtpaFv/d7XHV65I4RZo+ANW/kMZVKbpyeo+DUGycmiQJC3ZH2vVwv8 sagiDxmeKHOjxnz65XrHj0fAQXYspFldnhbDAz6KSYqLDEM+NlCCCI22hh2707WZv9wN d0hkNP9uVve3M4M4J8Rw5mTbrpWMLYN81Y1QXLO8v+SR997fJ1DoVWMr8KGCya0q6LoI EgeXglv6hD+kf9flCLm6C0ls2BqXa8v64WA/WykieyfvBhJDDukngMlTHirilZrk7VNb DcmLWMHFL72Kuo+iY4TaFShiW2/ZokIeYxIrENAn+amUqo5i5lK+uLKlIA+agvlDIInc f2bQ== 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=kNgl0WbKTtb9jSYiW4oo06gJ+GsOdnAhRPfrRn4DFqI=; b=R1pXFzyegsRG2COSWQI9Six3+NtC1FH5jw/P2/tCSrH9oES48eHSpos86iLpQYOAHY /i4/rsvQop7KjD0KzyUCbGSOiNX7lvvlarj/pxn+A7AGbaP6CncMVdBiQ9WeQ6E9MCkD fV3fO6KDlFFFR6eAbHQ8/TI+HsgApu/iKMdkn87MH4derLR06EpcZj4Qz38eOaxn0e03 SRxAZFy/NLqo77IQ12LCrW/SrgYcpbKMqPQWSNh2qIzLGJZtk9EMOS+UtjGmwC5I+iNF d0Fp2XiJxH3g6+tXREH8jhm5oB+dl9DedZ4HSmzjN2mzD3QSQqClkuO6Qf0g1XUXw/5p wneQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=iYdZcWRe; 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 hk6si11031618ejb.204.2021.02.08.01.14.57; Mon, 08 Feb 2021 01:14:57 -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=iYdZcWRe; 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 S231424AbhBHJNi (ORCPT + 6 others); Mon, 8 Feb 2021 04:13:38 -0500 Received: from mail-eopbgr40068.outbound.protection.outlook.com ([40.107.4.68]:17732 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231236AbhBHJLx (ORCPT ); Mon, 8 Feb 2021 04:11:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kk8wvSjpqXr7kLO7sBCjZYmPaH05Tc6q1YgwJjGhM2dl4GsRj3DtW1H8dwIcCMT28vlsQQRuv5oheeRHvNdYk3ijcpRe8QepmOluSkMkH6erIbJQYidFqCxW/keN7jz+1zStyYjWunKueZcAW2ZDruTHscRKSHSl4Go8Cur9JjaL3dIpDiVINOIggR6HXRVvh8BkfFWG/J7EtrBEMaAi8nhLkYJMw+K6SIvucXVbM9FNr88lrSbuKj6SoXXEyI6V9oALwExAj2lCdgigEkoAHlOE/ieTQkY0eKBBAW58AIin/Rahn6YIXAy0+aKNyULITo55XoKcZsTRdYBO17Y0yw== 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=kNgl0WbKTtb9jSYiW4oo06gJ+GsOdnAhRPfrRn4DFqI=; b=ap8ZLpfAUXJJZEPdyysxgL31IANlDP8TcCIDlMRa3BmI1wFtLxKRScfBWnIiTYEcB5o9CsVDfukhVKLGwewA8JFT3fKO9VwcZkZLIQo0/d5n8kIwX9XhL/pZaKW2hdlI6lj/+KfuO9LQZ7klFlrOKhwq796o/TOFHB3NjQcE3BpPhAWh6RF5GWFqw0jjp4cBXl0rzS/Rz88WMtwU+KnRG+95Q2DenHunH4yOieD1rOBekRMVk80i5iasWCmBqtKfj/QrVwIWDfaMsRJYevR6z5I0uh1m3rV5SVK3tMFkZNB/7uOaFordbfz3YpNFBKN9w5HCi3gJw0tSFAXy10Fw5Q== 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=kNgl0WbKTtb9jSYiW4oo06gJ+GsOdnAhRPfrRn4DFqI=; b=iYdZcWRecW2600JdzRifhXdX3pE6eJRTyoXoBVZGS9vArvwk4BKlh6+qYyLkcwqugXo/KVtzwU/SwY+KbnZ6x5o4vLaljT7HOsm4iA7chQNY2+W8/Uce5Zv0U2QB3n7Tn4/IBx8rEex7ve1VSzvViE/2g2IBtOoyX34K1iJAnAM= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08:24 +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.3825.030; Mon, 8 Feb 2021 09:08:24 +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, 8 Feb 2021 16:56:09 +0800 Message-Id: <1612774571-6134-9-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:08:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2a883948-944b-483c-301b-08d8cc1116ac X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: RbEyhnH0evCVFUE6IaCoMn+7EKKUDvrVKDmkeqN754c8fubNBqpikLdPl1vLCENMGrHlYvr95F7S27ErImg3mk+SszDPov0TLWqLbqSiZSGVKTz12rKW6RTVpzMJnDigLKFIQPM8vgrVMx2KBWcEGXneyaDbbopBD6dSQvTvqqU4PKSHQrZOg7Pmmawi83JCmdmEPGzN5SvHOz5ypztFuEriT70BqJnp9pDUzslkV0a51wmUfAwPpO5dlzgB0oyoqoJL0TRuFx3Iy/B0qhY8lfEJKKJ70IW8Z11vZr7xlXXb92PBw8kvDJeqdf/xXnlimophLd+x6ZqFqz0/u+Cj2NOddK1hoRV+tHs/QCDHsQGkKif06NM8tfwhTQx7ufTinXoLH1O+I2gwkUxPFbMEwKNFKgf/epLXUn6WLTGlvJ96mhXc4pe/E6Lq188jiNoPWfQp+exRisz3w3RMSpQIsEOZ/uEM+hQA0pYLPveEEdf7o/C0NPePxNbVJZYR1z1qh5mih1VkcHwpZ/4P9pYqH+lbrzCLbseS3lfER9D5DyvY48jIYM0KUn4EwSlgG53AvV6+ZNBnTbnj1ofmHIDCcA== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(83380400001)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cBJJ+V7QjOFPIp9CJcHc/7Ytp/i79UIzi+vZtfhdkF0OI3kMjCUsIIbI458kqJ8lxKbHBEX6Wc5SILnOcUB8gt5bJ1cavl98m7GxKllx8BsDod6ulz+iLBw6KogqyBTXsia7n+n6RATbz5OkZK11aPWhatxGpBdigZBA6x6LmeOH12fGXFLVDwDq2jOAcsupQtBmJ3GuPuVR9gTcaDR96p1p+YsRFH9hEHnn04sR/XsWCFkYXZhXFHVCB3OzEmscWuwXcvO/16OuiPx+Ag+d62t6NG6mnzCrwKrJheUpq8kcvDHUr+7GEapxmqY/yt6ofcWhKtWfg5/dTEvQ/hI3swdPUbCEvuJjh7EJNP2ObZOrOPfltaYF4OnwiPkbl260xBL3y3uBEdq3Ue14t1JIQMPqSvAL69EicZDt3w10iFzo59vwSQNpSHSJS0rZnq2ssT7iYAeHxe2bJJ11czuyIfpCCD7htLcMcR/JVMn2fSyFm8wDxnt38K3TpnpnSMZDQo36dBA8TOj01Ay52/YQF7OdOidpGJIUtQK6TSv1aRszHH/oWNx8DJatPeNfOmqcLDNp2gjgvIcO4FeWBrDGghEfjL3wGv2CCtnRI71PDCcBilIxBrRrjsSblayjbY7eANcFbVdWGbBT5sTp45TodZyxTkq2c4Nlz5t3JrCJzLdyHR4XKixZtZ5LB87iBo8rMjSSPb44uIwfvQSQPsgE//JH4E7mhwDUdIG61XyBEHk1TzumoYar+gyn3/POmXxLzsFXjf4feS47XzyQxN4Vhws4qEUBW2HqGHaL11YlIF/IIqRL28aL+BRTns5iespJ8RJD4WwDPd3xkPd1CwYCIFBb+oMQGKw2mjeEu06utLuizv1Lx6zkoe7ehyJOFHwCChLDkNpN/0MMljBaYUrlOnGJ3AJqyxn8rdwVSLVRSn1JFoDDlzFKIg5pVxx98kB7Ygc9YaHAUW5zepSFZkp4CTo1ixtaYqmrfvydRzK/pWKBlR3vzvJ+zKxF1ga0ch9SXZHR30hbqlOTdJmCdyDJYBkkbPx4XOh6KjBIxz52w/nNAgKxUbXIg1dWOKC1FVRFeaXq6FRbPzh/t8fHAeMj01sL7WyqSiv8f5pZzdNH0a+B4jamZX0LCYv4RWnRGFkvoPRq2PV8LCiVPqb3468KO5pGJbiQ2lGKV2BbPP3MzBV3R1y5yLIKIWh5hqYYR/Z+ymNbIbdhqyyfA5Vl51yjlQbxnThuIOXG3h/eB0FN+Ooi6JyXvFkvPnuBsmFLqIQuxPV5MHIMGe90h7xjEx0Hw2Rp+XL2KsPx5t/HX7abBt6+yhKui/7E3k/gj4HmNUf/ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a883948-944b-483c-301b-08d8cc1116ac X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:24.2897 (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: AmvCwFFenPjYSt6KcqHhnzYeRK48OBG/0aze/JF2rxyp5EAAadUtAwYviyyIawGvZ22KIdmizp1FYFjbpT4TIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 9e7efe542f69..86d99229e8ab 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 8 08:56:10 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: 378550 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4519479jah; Mon, 8 Feb 2021 01:15:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyyuLFV0AGQhTUJULtkGUOMHf1hYjq0Vqi+W47U8UzX8tyYym+lZPB4paEWVaf+BuzeVZo X-Received: by 2002:a17:906:296a:: with SMTP id x10mr15774615ejd.240.1612775728845; Mon, 08 Feb 2021 01:15:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775728; cv=pass; d=google.com; s=arc-20160816; b=QNyjhyBf78853RTRCtTrRJpRp7/eq/VEGwZ7k7yPoJ1WdeIM/0TJT5Dk0x1b6dWPiZ yPooJ78OzlLkhfMaqDnqGRXWIccKyg4MwYxVBHUJckIa7qbiO/MW0s1wLmP4cmK/U2hj uWkIQLbvS3Xsir7Qr40p4lRxIkkQjYYu9a5XOnjJaC5XaaBXskZywwpQxXXPsGJLMuRX FF9CXCLhSfx4NCcNYK/jA8ut8Fk/jjcyUQYyquDFz58I6TB1o1e5g/ZI/gTUUWjP6vm0 pSiJfz/2w0MLsZlgmnG9agq/Wtfk1lRl/l8LR5in2NfuaSg4rOzvuYwxT2h5tnom/REK Ukuw== 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=WdrTZ5FAsAreEf+4lbnxDPh+S/OAHxTmU69wNdXrsMuIP/zU+YK81y4kgVLL9ypPiq OhROXCH4pdJrD5duMXbSC0fqyZxh/IPtq6itq60VEKF2QfrxcspVNBHmFUrVz6RqoEul L8Vz0AZG3KKCTFGRFO0eFCHzgqQHpbSK8DI10A1cR6E08vgfKWhfFRoeK8y94M89wmNX meBzvNMNSW5Z2z4cEPoIuES5uP6xbrc8kQJyPWpa3Qt9HMu2vt+XtqqRpjSScUA8K927 BidPf+uXNJpSQ5bOLEnkBDF1Ar0w2doX47uJnHhsKCBDrK/eREgjrkq11tm+VjMbpIcg rZPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=QcKG7efV; 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 hk6si11031618ejb.204.2021.02.08.01.15.28; Mon, 08 Feb 2021 01:15: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=QcKG7efV; 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 S231532AbhBHJNp (ORCPT + 6 others); Mon, 8 Feb 2021 04:13:45 -0500 Received: from mail-am6eur05on2040.outbound.protection.outlook.com ([40.107.22.40]:52193 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231433AbhBHJM2 (ORCPT ); Mon, 8 Feb 2021 04:12:28 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XpWP9A1tpWXbg0ONPuETcPTsSo1DJmTL2s0kCcKpav5HDtyXsxSbZgCYsHXNMAgLDZKqMevW4evBOy0Hl/kpHjM9j4jYlJp5KaJ0yEYPZZpC1y3TKIDwOPxrPBViOb4Lwihac1xo6wGfhRNEI/cYWOknoJIG/PvvvipaSPWYMStQrk7cDXbTCigiZrxvA9y4bpreaRdWY/VEU3nD53fRxpmnTP5nIU8bnEOd3foBE8s7pgElq8UWcve67e9BrWyeq+FaMXl7FONk+REGywbDDEGGfhhDYZK6LLqzt+MZToXlpXy8oefsFK5EQuCLu9hBmEkHHjTJMpScd82uCFjGQA== 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=WVy6NlKkoSYfn310GLFw9f3D2mCiblJvlRgzRERiR2txh3dWuN814XGNe4t1Cw2anuIqvVkf05vUe7bN8o/7yTuKU14H4nojW76XUheGsQcHiQWAZW2sTcqcYtkTdgzLNhrnedkCeRqpkFJGd6H7tWAAsYENLYC7378TZW9T7xAx5VD53+I6H8aiH9MRSLZ8LjjWJx8Z90mXicA1lt6YxBBVHFn/u6LLz+W7isHN2EfV6euVmOt1fAfqhXCO572YbsJBSpWWAXBQKsMqYQyfs8hTFl7fxyL9nQnlWDbxdwW3uwwTkUol3SWAHRBcm0PuTCk/UligOFHZns5m8u3Kdw== 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=QcKG7efVRVY6bx6zk/meN/xuHtE0yr3CaVwCuhT1fL4zlyQcSxLK/QD7gKjbz/+ycYUpYtXGj6VZCbcGDZ8ByG/vl/wuRJXp4MtgoHROvgyoQA2LyJNB2qw82UUdY9QXr6YH5aZqFZaSY44CrgvOxu/gjPbBMsKl7TnHX3xClNI= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08:30 +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.3825.030; Mon, 8 Feb 2021 09:08:30 +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, 8 Feb 2021 16:56:10 +0800 Message-Id: <1612774571-6134-10-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:08:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e6234469-db39-4a9b-a8c1-08d8cc111a27 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: UsQ+Wg79VRz9IlU2EKlVzB3s9BrhubtvVMdJf+g93VtSOjOxPepOj74+g1s5dLH0N1eYZ6F7Xx5SAQyaLwdG55fpPu/wHo1Hftuvf1AoeQvGWyR0LOXt4G2k1mDcllmBtBRtIRLtyuxvrsd3Ypke7K12PcHo0moCgWekDFFpBlCijs7Ikuz85PRwotA7BoEpdkGtJ3ZMNMjIa2+cfPv+8650R8aNphqtpuQOCeD/7XzZDIxpxtlm8BNDUUO+GjHHFJ8UMX9arKs1wOAsqHTNsF51hNtWTRMmTZQh9S8P6W295gFZRJZwh2+fowoQ8yZdDJTC/xH8hrK3pRbL4ah0W0mkuHtMqnC+w+7YqXb5BMwvCFe1E9IPK/yvtfROkGRLN9rq7MdO/yMHgvUcRNc3rZ7QxLF+Cp1/JbkWvFTN7uiPGX2ec+gJL4duR7XgpT0HK1lRur4/R3LDeWiYq2c6XA18QRhjnbzV8g9q6iYs2U9TIIhtYzPouJwJZVNekMqtt3IIiCvc0N9AQOEyzaN7jVTbqvEpFibxIGEbs7OLvAKDsj86iZqyjq75hDdcKdZ5KoqEIHZCLv9Rf+5DCk20XA== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(4326008)(8936002)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(4744005)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6hcoGq63AqMWfBaVMaUPsEh7qR0V09cPhMUlB8ZOJ6nw0nXcJ7JRrTYQt32zyRLeXZatu0yESQHO11C6lugJKPPnh/jt2eTavUbvVaEFCAuOoigd08ceufn1ObxaqyX5xLRdCV5xJ2e9ARYmxOM8TZ43OPqEpYm82E0ZkYMexoMr88UZlycd5YKZVb16UAzf88tXaQRl7N8cbwU6jQzrX6tvsEY06XaPQnCHxL3jSwL2oeS8SDxheuyUlD+Zx2mCz7DZ+bhLX+splxSZwr5Zbq7zJzstnHffCUYYR5HVjS237dyNzcMSkUxE3H+wMOwd8mS9n9CDljFxG2HdlG3NtnJbrw54p5EkSzHQMxIfEtMlpXvlU4yhrVq5CyrSa5u4jcjDlDUAQilUDL3Wey4R/2lc3F0mQaPyKj5u6fwcUM/G8LcumwpjuUfvBNjLlNyBZYO4kYcvLYQK3NVIUJmPrAMyHBzd/Opv6ibzn0wG6DDB9fLfHvD8UGja7NeTYmZ7kefRgtQ2oBqzyL71WAIQh5ONxp554SScy4MpaSxHMwO7GjDAG1BqWB27554iX2+IjEQ10BkoMMaw4NpaAGao6HL3b/MWElbEhajbw3xoZU9AiCHzSBZQ4bESKbA6IAEi8FsTme8LkNdNqYC7hRhk8YNzbV/jTPGMzetUdmFKrWqsrNw/6OGllyoRkfKI3iVHl89Q5Ez+rdYpLt2qElg/I8UHvD0HaSUhs3Iq8XV+O+s2zLwHNHIYJgkMtsoPPmiC5cp6eECubbuwKsqi8HjwvaxoklvFiYyMlXv2zDQiAYV38FFjot2QbqTePsSLdetfL/Wx6LHYTnvJYGVHJ5Cix6dEVlcen8Ytfqis+pPlnfjrdjX3FgcQfud4oZ3GVoHn5Iax6XQImjbf+CytrNtjq6Vuo5dMoXnE40vfOXyJDn0dwtpKJH2Kfv0diBXX9T+teADml7wccVXjTLIs3ppdkJIBJtAhz9aGIlhlzjUmM6YVunqRh+gt9c99I9t/eKkXm5RtduqK/upXHy6YdysoTGF/rSDCAm8ULZayTQVxOHmOSA2R7VPLpFjiVJXJhQU71GdAl5uCR/mXoPFhSm2+FAWi6t6c8/j8czzkLpNTeKnOqRqHKhDdhqe2n+ayZZpiMc7drIVtBTVqDGpdZCHgPuqliCKEr2dYTxZC5m57yCRKDgMJMzXYZCgVR7JFeugRbSXuwNUyPXNcuYFow7rENUxbcQS8AWooEIeMnL+CXWVyi/rMWHzDbFCOS/lDVdDjiRuphVLQMq494Aq2QIZdAeK4jioFKuCzNlnjd0Kwwdq8Dz8izY8FmfAS+LTUr86a X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6234469-db39-4a9b-a8c1-08d8cc111a27 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:30.1770 (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: 0O4pJtpPr4ljgj28HQAovK9uyMDpDHRfKU1kGJ5kvvyfmm96WC7GxXI5mBM9/6cF0WV+EczMoyPEh/CKijyo3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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 8 08:56:11 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: 378548 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4519338jah; Mon, 8 Feb 2021 01:15:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVVxf4YpEamRkzPPx+UNIGvG4S4et5EGaranzNX/0RYkLoa4jmw6jZsJXdv2qZzDJqM6qY X-Received: by 2002:a17:907:262b:: with SMTP id aq11mr10028924ejc.360.1612775716383; Mon, 08 Feb 2021 01:15:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612775716; cv=pass; d=google.com; s=arc-20160816; b=ZjNllfqRNDNAuV6kAUCF254oaVTJMYnHnAGQCTz7M+2Cut3K/remo6ChfL4CyP8ail b6Bky848zW3TJKyDVWMx9pSgfOYsDk6zFB8Vsi5mFVJIh+6u+0j0ntcwe40kJRLRV+N/ 4+Rn32EOA4i3KU8ZAcKCnYCJsHZCq6Je+ah0PnutUW38ytcW1NI2wXeeh13GzlFEnNku 69i3p9R+9xrWxdsvwBwlDMefIom486FlGhf+HCNYtM+ukyfBfFmMVzFqRHLhWk8tCqNQ eaD4NQRs52AXG4NogGclcEdvsa6XyYS0k58UcGZEjp3ftOJfcqgnV/STlrqjT03W3jp3 7s1Q== 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=SpSgtWojI86OlX/Gf5n6em9lKN7U7VuEbmKM8IZBZlKMSusa5GM6qZxVnqWsHidjS9 mXXUI1af2KgifNjHp4rZvl5r6jMWjEHbx6Fb6lFxd1cagE1QIEwq/ZNv+VBitOdZQOGq fHWcheeQ3nRTRDnIYXhfzxK0GmSDJYv5GjNaWczJfBax0D9xYuMKSdpeWHa6x5gGErAo sWrW/SdRrrBIc2Os+nhXl7uKRoYvNTaKjenFhXvk7SiAdgO1jdB0UcMRgyGrjvA5P1bq A8cBYP1HmSG4bHxlO3mNqWq5C7S2xsuL0k4QhwGZyn1aVYbwBJCdk+YSP5VeJDyc3uNv onOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=R6aYpo8Q; 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 hk6si11031618ejb.204.2021.02.08.01.15.16; Mon, 08 Feb 2021 01:15:16 -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=R6aYpo8Q; 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 S231320AbhBHJNk (ORCPT + 6 others); Mon, 8 Feb 2021 04:13:40 -0500 Received: from mail-am6eur05on2086.outbound.protection.outlook.com ([40.107.22.86]:49473 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231436AbhBHJLy (ORCPT ); Mon, 8 Feb 2021 04:11:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UxuOolDYRa46VE1Xb372TEKDUe6vFHP8Kp98Wy2XQh3VctYEPa7qiOQkevS7Wp39kPDIonxwT9OZcR24QVPbtLbmdLIq4H3QsUrerUigcL8JWBNsZhKTwiJOmehDu6C1yFmG0c2cDw9e6LQCMtbuR01cU+/68Njd3Lha01dmnB+F/uIr1bbYed+nQCwivS3ex0ktellUNChnBBODl5uYIdNJfozewLTbWkSUM42K1GCxEJl31XJ3wI7i03mPQYgEOXmHraCKyCkBJOQ/xXd5gtUamXGi/tcSFUQJAMjFiXK9YumcsGBhAElUT/jmHiU8JoBqbAKHAnPVOt63WLwkQA== 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=IU/mVIr+padiD32Z4lmU9ahqsflhaeTQoB+yAu70gqbbXcTmcItFq8Gr0qYrqvIJl+YEwm0FunIwky5rpIyvkOeov+kq7vPvFOHV2lWJidHt5Uuidpf2c5eqZ4LTQT//DCKBEFleb02HWhry4ApfcrwB42FA61MzCGpJwhPVidUD9whGs9eFGfYM22C7X2bBavTyAXrTtVkHUge78Pi8492uTuo4qZbWBX96SzwG3+CLHcJLrQlcatepOIVpT38nBzuntgo+KSjh2uryMzW1yCFeLpgDyucBm9qEr3pGLBi3bozHKqPTsfExgtO3gY2eBk3sJtrma9dSVrv47WLiKA== 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=R6aYpo8QITNYelMzBoModnSZAsiRZihwxIZqutNhNM5gorPCKe1yotBno6lxDECdwl6BEV3XkNMN1kVxwjxYJudsVFcTa5V4XIso0FWxp+laWO9pParmzvvqlkMtlNI+nJccf13PK9Db1OU/jzbgMtX4oseyClyg/Phf7FAeMK4= 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 DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Mon, 8 Feb 2021 09:08:35 +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.3825.030; Mon, 8 Feb 2021 09:08:35 +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, 8 Feb 2021 16:56:11 +0800 Message-Id: <1612774571-6134-11-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> References: <1612774571-6134-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) 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 SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 09:08:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7a717bbe-b64f-41fe-f65e-08d8cc111d9b X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: 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: 0dLjvMAUYXkpR7YlfHqeQudylHZWAdj+7VBBY4f4TLM9eB+JGV5ag9bl9ugutoQBl31oLap1XqFTtGek+hLWqO7axw15pJP2crTPq0cZXIGk7GwZv/O+hV468ExttUtqJkqEhGOCd43KGUbINhLj57SzwScRzVGGdMaEg8iKFtT8mdVa2HLUaYI7Q5FaIOEMCshSXpV3Z76CR7OrlidKrJIT1JhhROh83ff6plhScBKa0k6D0A+5d+cqGKOf8Fl3p7Vwvvqeu1eQ+8KjCTMDf6LjYcYiayrxwiRYqBfShXdZOLkkE0+4bjhKr6CaY6tB29N2aTIZsUl5A5Bg4/dvIJa2btXbeFwGimJ9q7W87qiIu0fMeAEY/XGiCQt6S0kKMihnjUbzNMlV/IHjGg1vZaCOBRFfpXycvogSI1lHAbp3VoY2dg0FhJW3O/UK7oESqRs+B53a4Bye/TdCMz4tVSE1bjUSOlv+div6NMMB2VmYXVGCgWB1DCarnSTjHGJ/9kJ6oRB3mKrv3QR/BkAR8bWz+DrIE/ckHmlSWRTVt3ZDrbuMePFG2tgoFuR96omNA+59WJ6URZfJBPhFsHsvPA== 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(7416002)(52116002)(6666004)(316002)(83380400001)(4326008)(8936002)(15650500001)(186003)(69590400011)(86362001)(66946007)(6486002)(8676002)(6512007)(478600001)(6506007)(26005)(956004)(2616005)(5660300002)(16526019)(66476007)(66556008)(2906002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: VEO9yqGZ+nrKDySeTSA3RWulTkMfT/ewy7T12OzBdCCKnZxYERJvt1VyTFkqHMo93tz0f6X7WEJUhNk8HIfJ2wAPESWIshgilBpSueJrVsImllPQOfzC6GZYZz60j/OOMtJoxfS1Wm87hCduZd7duB+iRtbJ7Dwon1uwcTRsAnBjTFNKFOhUENP/u6nb81W31XyoTNQ0fD1CDmVrtAgV2LYH4N6WJE5eDQPSQaTAPb53QQGYYiK7wsOlOEx6vEKsg6McJ5UTKlmvyeLZPqbIyA7E9PTmujOwPlGRWIGKN61xZ2R/F7kalNSjcH5o19AdHFOqhoDZKGRLqzhZVdXZaagCL0uYIWicEz4NWTQ+2rGdcXkReiL2uA14Qwk12thnfLs3NKkzrKaBsvgd2exhh7/DESFpJi7l0N0A6i1snGqF4eSGZJB0Cwy+A0BnqxOn2/KEa7qT3U4IQntHufYolNXu/kukP8e4coigYfjIITK8EqT4rS4RRkzhRw/IQtVH5Qu7/ZK6w1LZPFSm8EC0PRHlOmZ+aGSg1d/TOijxsG9751GI3EJEvX2DWhl+4lDTqaWaCKjfUXlKazXoZc9k+FqOx2YoYtIA1FAIYKUOSEccSc6uF0rBvqGe4EwNiGqn8bLiMByWu46MRWLQEmIk1Z7Y4mm/sEx+ElX2c5LUEMS9d797EUEninDTEAwThFd0tyCUK2bmDKq04n7HAPnl2Mf48rSMbT7eOf2Ypebdt9U77YoaskngaM/B3ftlEEVs8xRF3OOm175qafCfhE6GrpxZpMMXGSUk+o5nAnUXaWuHcnd4EXdIZbDwdWejcUwgHOVmsH07S9Adb3A6cjX7CFPupa3ZseasM9FEdgxKno6ZIvPC7f+Nt+oiBgcLpBpSTFpLfmtCFzTQ37UXhG1EMHaSUzn2R6D8zSDhpG/8TCRsaEKh2RuiyDvfiV+dUIbEvCyhqGXOQrdkGv8ftKUiaR0N3ocWfU4jUhVjE0oI80hTZpFBipEFyBD1A1kqKnz1zaQYpwzdWPQas0CqFM8bmLkMmhp3Udnk2jKWkrbC+OUqpCGTxp3vo6Sz/lfGkh7fpNAFUCkkzOIRnMNN7a3OQV+UoOBHzFtgRrNfR4jxpkAS75xoDjmk3pA7R413svWZgsO4MqHDCt5aOx89IOeBJWfMjxFAlkTocweqKMfzVuwKs7VDPL9jC26snWBMm24FMmrTpH21pmUBqxIbjGKvGcXmpmgCLc2tPDGsnO9QQiMpFIpWHLdd0xWpgLeOFVWXGNS/Y4Y9wAxUv2jlilcj7ZQN7Tq0d7doHfcjaMRvnqdJxuhZlpIeF8c7Pq2gr34L X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a717bbe-b64f-41fe-f65e-08d8cc111d9b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 09:08:35.8484 (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: mcpi28mQpMAzNmtwAvfdGD1sFuesxa0mg3X0AtoMa35vM/Hig1nl/5dsSCIStfuTv3eW4vPqMQXdkw78J3jeyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 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;