From patchwork Thu Feb 18 01:24:51 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: 384350 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281344jao; Wed, 17 Feb 2021 17:39:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2e+qzzbU9G1EcFPOn6WDqqXaF4fpJInvJypUSxS0wRLoT8dqsx87ym6KFkX96Bq8uokDB X-Received: by 2002:a17:906:9bcd:: with SMTP id de13mr1600621ejc.245.1613612348565; Wed, 17 Feb 2021 17:39:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612348; cv=pass; d=google.com; s=arc-20160816; b=YwqCT0RHEprkiAz0bFsKX9asbeLf6YQtG8mDG/1SZLD1TZYxziNADlYUEvvgEd8R+n 0eiuDzDXMxm+ZCsWnCFsUw4zk+2ZYyWYZXQqTUAMTDlKUjfMY7FQt7oue7ZALLDUrEOg VBE1wDwiIEKKTAsHsc30VKuy98i1dGObNGK/T1NoVJRKFtavy/+mv/TA+D7I/v4R/M5p 4ZTSdp9pMHWukHvYcWmfjDwAOHGAryyamuS8/HyQxb/zTrtwd9TNnKiGbCZioUqvsff8 Ho9WURN/BeRHXLjN5cOCyjZR6+rYGa8RtXPbaMhtxLodxg6QO2spVhzVEB0jv0eyEy1H PqZQ== 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=yt+axGlyrTIDQD77uBCs/V1sEzbEHvwbaLemP3XgUOo=; b=WhOz8L7HDWb9Pqf3HoWbkM4G56tGAvjrCq3rIe9i/i6sgPUbaoFqHbVo3zKDqI23n8 CafG7l2xvbqPxdUpRtsOXA+yD6lL9Yl4C4NCY9PlCHkvfFqTc3iOw8vXaHgK9Ug+A2lo 2zQ5Lm+f9W9kqsEL9TLk90Qls6iBMgxjoroub52qql1cpulIPxOT4yvY7EatfJHpHvt2 +VmrRlMillSALabnrwyBEkX8ELbaKSkxwmk7sWYb353qYJEwrse3dmxnRTgLvPsNoieA PO7FoVdTJ4Pc/tj69PI14VQGWqP4Pcc8LF2YBJYgJDbIcRxq2o99D4ydH4e970rkGuK8 FwrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=EgPqD9iW; 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 e1si2551315eja.255.2021.02.17.17.39.08; Wed, 17 Feb 2021 17:39:08 -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=EgPqD9iW; 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 S229553AbhBRBiV (ORCPT + 6 others); Wed, 17 Feb 2021 20:38:21 -0500 Received: from mail-eopbgr80057.outbound.protection.outlook.com ([40.107.8.57]:29216 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230125AbhBRBiQ (ORCPT ); Wed, 17 Feb 2021 20:38:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NAaq8knHt2COzA7f1yzPSME6er42aYVXf31qXudX4la1qFEqoZQMH8qzDcIpPooLoLZeM16HoFcdTVNEqzn8RcXoQInTgTOBz8zM/+/a74G1qioXH+Oq0YEQev8qswJK7AhqYG1AUAPE72Lk/9SdIaz+2qGOfvQ1yxOi3a9mH+9KqYB/sZWofVEsomI5pVtmNlhmbB8oCUQFaLnTWtkHrWQ4+JvO/Pr8NhF0UyppabspAHBVOvHXHNuAe0vdy5PRkRPwiv+/GcSyqneMyUOi+pHoAsT9DuOSKM8DdjM4RpPVcFxGfkg9bVvTGe3KURtW+7ASGb6PClMvThlHQMbenQ== 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=yt+axGlyrTIDQD77uBCs/V1sEzbEHvwbaLemP3XgUOo=; b=ddELUmN3mZtrDnqdwYj79Xd8DGmzBDY8gxCnh7Hq2r8n8zqnPCVu3HoQuoy9L0YU0wxopKdvEqU0O+yZZcpUvJkMC8SrOgq8+3EZ4t+05+b9fPjO7pTyL6absnB7zfRtjuHGasAveEuxj14iTZ903qr80ZG1oVMvCt7esyObVaS2P6RFpsIngvT7V40bljNrgvyq7jV8fsY+3FHp1eUlEGyby7EJJKz94jVfw5YtABy46qe3Tmu8QRw9VsIudNLsxYWVuWmGFFitlmoIN3zxOYPa8pCbhzkofessJmLLkmUyXqIKJK+V3gIVxCuPeKGpKpB+7Av49QulQwzmEr4u6g== 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=yt+axGlyrTIDQD77uBCs/V1sEzbEHvwbaLemP3XgUOo=; b=EgPqD9iWX3FpNysdllMoKT7ABzHpQYYpxAOlOy897Taa2dLO0xWzZPRtHiLS0RLd7dmzYjT7D9t/Q8xD8lbPZOCd8aFe5Wb/xyMoUjwaWjHSNWcEU3D7qUyhWHG5AVUyMhfWjC+hrBHhdw7+ZFdl7NxCp9c5Jzt9Pewm586hgAc= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37:01 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37: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-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 V12 01/10] dt-bindings: remoteproc: convert imx rproc bindings to json-schema Date: Thu, 18 Feb 2021 09:24:51 +0800 Message-Id: <1613611500-12414-2-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:36:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b60465d5-0ede-4b08-4665-08d8d3adafe0 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: DHY8xBvpbDwwal6ggx2DkUWacG8/lV0EGzX/YMSJpbGrHEdC6DoxCvA89jzZ59Etr6923LcJYT4CJCHrMLDlaTZ3YRCShvDb5q1BD6fimOeCHdmxXGDuA22b9WUefMJRUFhbQRBNqQyQpv/k8zwSF1gxKPDbweDD3Ho2r56eRoOW7emj/Xcy17mO4E7smMIyEUdqI3tmFSSCoSh2WNtq1mFzaHGsByNltxgUoOTOrygmoHcQUbkoISJuXb+JDWyQ8aTuEW/EVluCbK/MS/W88ybNqPCC5cIB7FOKIiwNY8ko8KnFxfNjKIivcwJ/bI1JgifwE/ogiGWhd8REIdNfjErWhP4cKKx1DB7NAUT1+SKukdeel1KKOXM7tAObVIZ6MdWhXdy1uSReZ4eQpQhU2w51Rh4fzKZRRnGWZFIq9iiI52w3xwZGo5jBO4BJtL3lwiQ1gFp8CzzBI4+YMBjrmbfX8TUPtH3TVktTh+cwNDwyC+vuwSLe9HoFEm4s9D2idu8HZMvJbOqy7OtdN/SOz9YhbpHUREYGEzw8q5tV/JwgaNinVp4x4obILOe0B6Rv6TUtB3wN4HTplkn9I+GDHpwNLphc6AaDAseDEjxhJrRwqBTGzu4/aZ30my79utWAdvdVpcukcDLNAPLWt5W1NQ== 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(83380400001)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Gxn2BSwOgheO5pfagehdbiRIBjYUQ6Lt/JloJjG2U4ZDjjv4FakuXST4aVg4c43az8ChoE06/3d+E7jkbZhPGwuQI1M7Ko/eilr21Qv/XtFd5NKzie1b6tIQ7jpa20S4bFrTMK27RxiV9pqpfMPywjpRpzJzVqbOqj+57EwL6qA0nwN4No7m58P4uWucWJxx0iayved96MHo6Y0ekdnlwkBJDj5n2h4IFPg6blCXLn8frkk8ZJPXPCGp58LDKGT4PpaW5uZqr66v1+O8DWtonYacsGPULHOoAHExgj93LEmuwEu7c0uyJFeRBBD1EsbopIxfsLhTzMqs1a+jVzszKy5bpGzMLpRlYGAXKYv4JsRTmF3sTfBsiICDZmx04+/QPC6WXTh3NsUr5sSwH+bKbJb6oO8halBPlcuFhOqrupJ5FmCR7wcA+7Ooak4vzsWA+mmrwGG9b8ZmL12mWnhAltnFP9llDrFyj+FJ036l88lm/spAkjjDJ9/VBjn63I1tweX5NW5y7e3Y+zxqkDHaXUBZ3mFnbLUlYsAzXFqh27DFz/e9lFJELX73X4qgklmNs6VjPHbqs2kFbFgwPXiJDYgOm2OG1oHGD1Y5FKt+MlFQ+Z7rKbwiMGeD+yxpNUJNro4X7lfh9QQnuo0eWHAiowAWDU8hmXBqOuxpzlxw9n5ATPmvPFr0C4B9/uXpXkiqQ9s2wvdKjdeRFkVDV6iiI8OMvOdBo538vlYG5w3YnZGMFRdiAKsi3O5zWVhDDztkw0WO9VNdNT4pAdJMUYcutJQjfK5uOnYO0ffKMeH4pFZOjYNBq3akyf0I5PIC81ezBHYCGftyWkhXP1DXiGe7AshpkfPLZcEaE316L1tI8AyROcA/tPDXrlkBAnZCsdVE8134gDPlY2KxGRqjF9R2NB8Z4U2Y1H15qL2+HQ/bCRTEDYPpx0tA4YmgaKMOnmbeowoSyMf50M9ZBeoGGJgklOWxrbIZknT2qZJYHFvXLdNo0wUOhFhVEXvTLepKiSZi1fVz/AvtfamMcxFD86cmrPsNC2Q29qAK1erv43VP5bt5XmOjRAUrxaEoBiqLm/bLXkvWDuybsx1vL5jY8hPpWPQ8BOXtftPLe/vD98ZZb47r1AZhuO2RGalcAyifg5YH0nYMrnvvxqDjO+9Ev3Xn+skbsIwiI8sKVW77qPQ4zVettIBQXnPvaNvHCIpMHQCAzEqvFwzwxnJim/Zk14ynPOxwNmObLaqODEqLqzEY2TjjKTiV4zyeUwPHxQDvNTgchqu1cBMg6QR9U7kJtdmhkxmXMq4bT3Kn/v+DIdc6hFzKvkb+9UnsDi/NT89Z5x4A X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b60465d5-0ede-4b08-4665-08d8d3adafe0 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:00.9217 (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: NWL7ZZOF294wx7R27IdprNnkBmkfy6zBMbsXurGHX5vrc2rodxFFW+KqatcResd/543o5XgH9Kux+xn0JNzrlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 | 61 +++++++++++++++++++ .../bindings/remoteproc/imx-rproc.txt | 33 ---------- 2 files changed, 61 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 Reviewed-by: Rob Herring 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..54d2456530a6 --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/remoteproc/fsl,imx-rproc.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: NXP iMX6SX/iMX7D Co-Processor Bindings + +description: + This binding provides support for ARM Cortex M4 Co-processor found on some NXP iMX SoCs. + +maintainers: + - Peng Fan + +properties: + compatible: + enum: + - fsl,imx7d-cm4 + - fsl,imx6sx-cm4 + + clocks: + maxItems: 1 + + syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to syscon block which provide access to System Reset Controller + + memory-region: + description: + If present, a phandle for a reserved memory area that used for vdev buffer, + resource table, vring region and others used by remote processor. + minItems: 1 + maxItems: 32 + +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 Thu Feb 18 01:24:52 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: 384349 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281337jao; Wed, 17 Feb 2021 17:39:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJye9y0Sb2G31E0qrWiPlgK8jIBeZmzxBoXKo2zY283QnoW3cFmQjdDTFZZF+xcyERC683nR X-Received: by 2002:a17:906:c09:: with SMTP id s9mr1615817ejf.539.1613612347707; Wed, 17 Feb 2021 17:39:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612347; cv=pass; d=google.com; s=arc-20160816; b=sraP8ffL3rP5f/m8OkLbNrIOCjDVxlHST7H3pWc5NQFKRaB//xkklJDs4SOREdW9Gr TmosTL6TUQ7zUzzyJZh7skQ5jzLgtS6LVDcDlj03FysUc4VWc0ZT/fsxE6JjbcwaFr92 vfM3IWbjSeCA5zvGtrMUpZpTGF8o5OvrfuixtwGuWoaWOaXHB7sb9N/FJIJAhVB88n8s VwP9LanUlPRxqhuc1xuWvlGdmFoRZ1Fghlwwe1awmfUPyJlnH2ahcoxG6nD3Jlgr+Bg8 7pFY6HxzeOpTtR7PULe6BOefdXuv4FULcxIYaQ4cOZk5x96PsJSIiga8NthMLak7aaUo BK3A== 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=XHaHf0+s3IpKXu0/DnioLgWNvoaHXdKV/0UGF4JtDNU=; b=wpRolqugGrVMmcFbQvOzN5ltc7uQ4JQ7WfFywuq86qtG3mpg9ZSLFI7KH2yXepC3pH 3HAI2cy2YfTGk/jwHGIaF1T+EyIwSQJqJCGhyvHPC8Vl3BHtcc40KvoyJmSI1v3MUN6V WmFAVsoDwycA6X/sd//CM3MRLlVqCtDy6UhDNu/SjbzU2/2XHacs1msusio+pR0Rm++s UgOLZdCTJ1ng3uk7CiIN1Bgw7C/O0PxUdJWC8HfrL3rZXV4CQhLgX8gRh3h2VznEKwbh VfX1z9efkN1IjnrXggIRgMn5puU2NMamkRCFBPFU8FkVhGmbkI5XQ8+YMuRCptcxLICm gJsQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=BRVQvymV; 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 e1si2551315eja.255.2021.02.17.17.39.07; Wed, 17 Feb 2021 17:39:07 -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=BRVQvymV; 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 S230121AbhBRBiN (ORCPT + 6 others); Wed, 17 Feb 2021 20:38:13 -0500 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:51809 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229850AbhBRBiM (ORCPT ); Wed, 17 Feb 2021 20:38:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DYKQAv5vDJXHJ+H5XFZoCfB93zX14PmoBL8JwjRY2FbZS/80lPCFESGSBqI7KvIPk/IsExRbeDRvf9qHw0UT66dG2dhreZdQXkMBTvSydZjvR+JwLJmak95ed8AmHI59MCFBjpQltkJcODR5iEPBW1tS0CNlGK5a++5YmsREDp3rVqfzBEn4Y+UBJ4n3Tw+U3mPyykfmh1xGl8xPkcEs6T2DKU5Bd7PjJbQ2JYQ1Sqqv1PUXq/0WCCfUcuyOfyIHf4Ktgcp84VoehuMcj4IksLjqLCVHQ/w7R7+15BEWqjAurJ5AU+QjQKiFCnW1dmdWV9mbjlZWhKxLTmNjyhYc9A== 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=XHaHf0+s3IpKXu0/DnioLgWNvoaHXdKV/0UGF4JtDNU=; b=YoeQoZakb9EPD4XqNw8MZ0HBYh5IJBqKUk9lbbV9SPeG7NvNiJkBE2VW9qLVIehyOrjVq3+MQCzyLDNxS7/pf2b+dLrp+7GUe0TbSLtsuJwyDJL2bL5av1erQ44GKxRSx62SaFhFqKFraEaKYQZn8FWGoobCEB8FMJw2tn06m5PgZKsAl1YJqP8f9HJBrt9T6ZhvxksJMfP3eO5ri0WAtYUuf+RAaJlUCmDU1hnGh1MGyKYYoapPNbX8G0AuVesV360wuDsRDm6C4KlgckJFZM37EIcT9/2XDDqx/ZQqLyEAw9iURaM0OXQZLSSe+pLunKyxD5+n3ekZqgjDf6WvPg== 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=XHaHf0+s3IpKXu0/DnioLgWNvoaHXdKV/0UGF4JtDNU=; b=BRVQvymVkOqng/G0WFVN9W4htw2G8r+3hIxHnvkAttXhLfSxgTL8bDQifpUuT1p21RkAm7p51RKayoX2tZKdJGinnXN3Q6KYgpKsfUcBil80K91QDmhgl467fPg9w93GJDcV6CZkBJpML/uFHZQVkBfr1WTuU4V6uybobO3ZtIE= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37:06 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37: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-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 V12 02/10] dt-bindings: remoteproc: imx_rproc: add i.MX8MQ/M support Date: Thu, 18 Feb 2021 09:24:52 +0800 Message-Id: <1613611500-12414-3-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 360dd85f-916d-4505-7f57-08d8d3adb33a X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: t2BHvqdtUQmKdiTwlAaad1LE+HlZWTY3RIFsenpUcKyDLpDmEqLAdUuf2OWosR5neFqAV0OvCVD7bGZJYVmo2INT3/wARvnr4/+4vndKwFueWc21F96gOE9irolV+TPQHDfW++U6yt4qSI7DaSOZg9sXpjC6MjTe7ki0AVl2tM6hFYQzqk3KbQWAA2814eT7+DXYa13dZClwKvVJFhzlLVcJfGN9e2SpwLSFv5ULFuIVn+CGvE+aKbeC6J6nl6egzt8Y5Tm/c+xrUREg54J/mxYYuFWwjnVwCmk86bNYedvjMPZ21x579+HqNKW/rMbW2mbBwR6CGRFjnxJAEZSvPD1hnaXbIiyWIW70hZXgf9G+cWMGSTbAUDE4w65T1URNYXUnxoTOZycK0G+PfAQ2r/5jorMNvk36wWwiXJg50YES0qr9S+obgm0BWkn/F/1wMXhAiqGviZtkeQG2TYUUz7iYR3N4KxBsbJ7GVXsoAkLGdNpoRqKdHFCdBNBfVb+3QXE1gaJECL8kApFAoVOkI2bRHbpW7HV/LjVXYimi3lOfXXiCasB0XFsSaq5UAoDKsF/WS816+rH/glNMERphajylbp+qgbYXTKtUBLcrIdN1K+mjfvkg0x6l/GwPb0aZncvAoHMV9dq+Lk5V6bF9aOqu6lAKG/3NQ+lfzDsY6XM= 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(83380400001)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hPZgB7iBiqTGfypGf2tgfJROtbkuAadvsvHw1dAjzTWPhI04pJKnQFt6oIXAGbMa0b46ink1Aw6f2bbxA7YA3PsUT8BqO0xCEDgoHeORxMZE6TT+1xf9jN+jAmcijHs62XTgaSH/JgIeb4h3Szu16TFjuMkZXogHh41upICHjPoE26zoGZCvgH++rdhgJ5jwjKp04TC6AAxoUTcZjIxxmPgJUhEZdj1eD+L52P8U7pzoxLvHLcIKXCEUuITa681s5VAf//rQijw46bGw/p0UdXSGOhmA8k9O3mxX68nsj3Q1o1t35Fxlc4hT1y1Wa0DtYhIJdQOlxaoCY3vUhIt9pVPIOW+58HkhrU/yvwXwnQk8Y3epIPGDEO7vRqJD+OSrujTR0RDLt+p5bfJw1sWkNbahepiKCE0B0k2w5rN6oUAkbGW1OC8kaQATD/JGwpoNWUsEZeBbEEz/g1wiQO8Q3MzqsunDM1nDCfSX+aLWVQzZpKk9zjHk/NNR7kufam6XRJCOOTT9vS0Mvr+VUdrICkDFOiDkueoPc3c9AtAGcP2Y0xrEjBV0N6qmXsaKJDmEnWvGJ89kOjS0WAgTrknFeB4ocDW4IaOfw4x2997/8igZLB6vjvNXNm2oxJvatiSfnwnA19FtzdqzwTCQIXmR0+S247p24tYh/WgYV+2YJ1nvLUz1n3Skr3VeC9BausZcF/4jdVRa0QPA65jnYbwEDyy6XardBhZj5X9+X4G1KMC+wXma4lfZMX6MgreVOnV2wcxGnuIfex+r0MqgEPZD9ctfKg+ay26w9MIJ/tU7vPgkOtgD9oApl4t2kKpQgb8SwialQfJhHxkG+1DR57JZnVjc+RWr/ZLi/tLkqxUQ2Xfkx8JfitYzzKoYHb3cbMZ0qArJuMbBw/xvcoyt6BY6/riyx4qMuo/0USBHrH4XECgHjdqdRJDeV6IV5Sum/+6PFuBy3ocS8sdioZNX0VxcA1Y8xeW0Fe6YCC9F063lgl/J2IyIvEWLiG3Inmc6xuTmhRkEvwe/ryE8MmDPiPtWT0QcNEogC7pFoEBBh18FzblX9crtEIQXoJLANrXTeYToCGJNJIt7Ar0XxDgEwugyDuYirfDYw6DLz89chu7QPbfcSdW04WXvdpnZxnXoa+kBr1Iyubr40O14phsLaw1stJcc48vN8IAB3BidqH5/FOJHRbTqa862r6/dHpcDMtfbq6JhVlvOPD4Eb0ezQJ0/g2GX/chEzOagwnq0KnmJTz5dHeQ9+rTvTM4uLRWWKLEfZtW4czT0rT2tRfMU7SzGFwXl7e1BSWznQuArxXj/kzXX24S7XUwHJvPPS0pVzA2o X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 360dd85f-916d-4505-7f57-08d8d3adb33a X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:06.4802 (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: kNXBivtgT6TCEUnErGc8CFmuj8jjKH6mU7Ux/EdJJiG4WmxeQc1waFzCxHGNV23w8ANxtSXTeALZ+SSW2c4VKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 54d2456530a6..52c8e523506d 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, @@ -58,4 +74,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 Thu Feb 18 01:24:53 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: 384353 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281378jao; Wed, 17 Feb 2021 17:39:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMpcMqyUW0OFb11UUu44HWjY9AZXvKCjz6BQeA1QDaAZu/CYukaGxw8roxpCee07jOK7da X-Received: by 2002:a17:906:d84:: with SMTP id m4mr1620055eji.437.1613612351772; Wed, 17 Feb 2021 17:39:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612351; cv=pass; d=google.com; s=arc-20160816; b=xP/j9dP3OO/QHP4JgkTAKMXYlL/ucwOt1N1gr+MZhlJeE95ytAeVMUtKqwVbjAlp3+ JnaQzX/aUWBwNvOL5c8Q0HEbLF7rqJolb6pN7bk/EeDUeLMLCduYzV2rc1gqkylQBZkI 16stsEq3pEdb69VRpAj7tbzqnUdzVsDnLaodVgsmzTpFbqZbzLxh1mh7ueFqQKimAuT/ RQziLn7JOwG+1I2CscJpSYoP/RAxXpnBN/da2+iHJEH3ZsOO9u12vyhzQgCCjYw8XlTq znSooQ/OWOKFA/aDCr48eH6kRXbt6hngmhbyeGpGCMT+Z311m4vv2aIQse91Sv0jqL/7 j5lA== 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=uju/xQpsIrTt3iN5DUZpcp30V3pOIq19AqqxDMEWzJ6BX5sr6hv5g+bpUeHe2R06Ox XnOF+lEN7uR3Qzg72tvXGFuZbvEktFKMPdtF6OFdgoDhO00s/2Jy+/hZlQ6dcGASdCDQ xSuqyCBHw6DbfcRcE8RAMKJGuqTTmibe7y4IeCdVHQSoLz4x2VnLTvwmXSU2Y01LSVeP JiVRtjS4vBDwdXna+ifpjd5fJpK1BN0vKfMnZrS4bQxIy/fcI8FfGSlYnuviCfjWr1Iy I6udn1AY8GHewaImBddeRPQaVq2bfaUSEkC0y7K+y9QYwozBrGdyxPARZJr+YPDoKUlw EeVQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=gM8mZ210; 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 e1si2551315eja.255.2021.02.17.17.39.11; Wed, 17 Feb 2021 17:39:11 -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=gM8mZ210; 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 S229876AbhBRBii (ORCPT + 6 others); Wed, 17 Feb 2021 20:38:38 -0500 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:51809 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230125AbhBRBig (ORCPT ); Wed, 17 Feb 2021 20:38:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N55XwZf88B6pcvYAvK9WusF81hl4bgjqjv63tsCu7vs81gadSWljwOfevnPmFq/yTemBgYoo9/fLLII5Fe3xchOpJ4aAcbKdK8K1Q2GL8UFq0SHsCEprWzJGRTdHITQQxoVlsPZ2JwRAI2lf8wWfylvs5Odo1K1iQ4pTpi1B4epTckgJUE7YTCX4BxbdCN/PJKeRMLWdNtqQZBF/Zt0vBrhxVOL8z/k7vxXrO03kyRNWK10fXS+gG7W2xLx4XTtxzRwJSXs1W+9ovClZF1xVuqb7GvDohBPyDPsBRD71whK2vS2ryVnL6QD+ku+Tom9nms5LGGAfv74iFH8DZd/ODQ== 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=nmlnF8pYZmwL78bV6fAFmwzN4wvva9EVRI1gDOhvnXYqUuM90OVw/+mVtUj+zl0K0C86Sabqb6CltgqSWAPqOy4V2yc6TUf6AX7wZ7BGlXqF+xXxTIU6XEgA1e8aiodhIMD9Mk2CF22516cU06pAgwCLyXvD4uNyS/yyOQcgVtDAnFqJOuS5mMnUwHHIGIC/lafrIJDhZIjB6elgIDMo/Vh7ogooExjBfD068ZiPAc7w6/1HdorJ/zw9ZRLE0LYtOLOIsWf+VtPMZc0ISehwOBpNtJkUxg7+YtFjhI2W1RsmbjfRE3Cx1Q94Xgv3MwmtZvNxCSxoHjnpYh/lZlovkA== 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=gM8mZ210rxpf77LwMQgzhAFUMlcMUj/phWnc0AdnmDGqqHOIc4wGAM8tQdQjvJsTV+v2Zc/FI1c9h0rdimWtYDa5gBxh9kfTZoIVGImNviijtq9khK5OJvPl0K5ZGxYd+11WAA3RqMbyGU1P6psXIhiozUMe+D7+46p/XaabPDE= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37: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.3846.043; Thu, 18 Feb 2021 01:37: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-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 V12 03/10] remoteproc: introduce is_iomem to rproc_mem_entry Date: Thu, 18 Feb 2021 09:24:53 +0800 Message-Id: <1613611500-12414-4-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c9fe755f-6497-4744-b12f-08d8d3adb66b X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: LjmTsw07ad2Ogl58c6r6qE8scnhFfir2VefMcdU4YM1GlNjkcVMjXkNN51Y/1whr2lGe0xN8A+3QMXDAd2sKjJvVVJCjwGqpU0/G71X/WQ99/QIkAAJiDMymuGifafPbScr1GMZXHIx8ojnEQTHyH6MQL2hZa4jcz23ouPmy20R+ZxsSnAsJj/sX6ZZT/+atzlVqJgzBQujw/p6hKl6N8ipzGeO1FNJxzGnxBf7cexKw9buTVeIZaZZHw/OnEbpVC7mBtkIW7Q/QOeD4R7TtUH19GUtWL4GPp/UieME92kyUnlz23bAh/DkPqxFz4m1/OH1J/mKqTYipm+av/0+707q8w68f6naBJz53zEsEV1gDbbBx4QmXm1QTY6Ndt5M3rnuVkdrhjUG3LRsno02BdDStrFznP9p+qwrqHu1ibk9wP5ZCCV1y834RP70yQf0JY6R1D1hCR9DYXaQ+93mxIRQNnXrDOHDKYBNmIMpnWz8ORV5CFP+g9ZB1TZ4ymAgvffj3JvVBVmtTD9zgUDDKViFg4O/ZLlzCkCh1RaURwGAFrNSGWp1Dr+pRdbqEUKwLVIkmpe2Ua3z5b7hA+WC++A== 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(4744005)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 8AA0kEmW2FcX7rTf0qeBBCMJT6m20Z8FozsQemuB+fuhvWKMg7fNyEqBGqVq1Ak7dCdPz0xGI3/N8xGPhMwKC9H6d23Vm9Hj8C88JN72IIFbQRn4wBaQCx2QlFGFe5t5KpFQXUpNoSuJvIiGm8gb8rtsWPRkiw3NrcuQXhtICK2Ke8UHshshlDfNjFhWkcoNQVV0vIVQqVybLgIMsJU3OmDQ/q6W8dRNkVnO+Un9PHNKEjIvYaWybj3geX+cAOYqsKYiwQFub2xx2nDyE4qU76glLkU6yeqEMTCRzaxGSA/AKl08Suc5JxFjxze9OPZgrHq/thwfrIaxjqHGf4NpGR+5QuHlh/i1Jcuuc4K/wOmSI83GbH8Gy4sSeRh6hEFbjzUKYlBf5vUpOXgcfRsCOdbKZj6obxt17T47yK1ZiNvZ+7Ir6i5VUWk+9sc6OeEKeBVPDsrRosOOPgDfyJLnsR15RcoF3TYmvaalvHUyC6ZhIQ/7Rp8PuT8sP7+L5zmuCYTeoJtqHhnvHdSZxucOZOUttMRV4vM3YWihZkHcWwa7pZ8zmZ4dAOQBqtx4pBuAvHO91I7G/IYeuEyETYjlDGmsWp8/0p/PO1A46h0rrQYKWk1m7L7b+e4hP7kSxza54tuo/cUSwlOxztFAh2dBAcDC0MqSj29XxNMbDX2pXxwbuDqkySE3q0FSls/uZ7eP94lW90SsNzZq96fkP+keT4aN4ghcO+GVxSzE+q7G0/LTB9Xj+kbIqx4lY4KmWcAqLSlN2Nl4JLY5HHARIuuGS7gavJCwOHO2Z2jnOUQIX9GaSJto8vOp47atQZiMXIRHLEtASaMu+6vsgxTR7iNMA17nyiqJ7ldVxWg8d3M1GHxCRQ2S0HJFs6/FTd/DgirhxgicxJ+Dzu7P4CzTduT1JVjzPg0teIbDdulfYea+N8vP8YaI+CL9xaoMeOlpYJHIvLdf8Dz6c52NEM0q0q/MQCEjbgHTRyo1Q1YzWONUUiCgu6kSDYFCPuLodcA3xrA84C9hcjuh6Ti6/mm20ogZmOyz5qC1R6h4qsuMdTmKCVPvdc481di6zHOA57f+zzTKoasVLRAU4PNvgMEE4QfS/DP05664dEn3P+1nu85Z0diEKuXqwqc4LoruynQjHylxXoEfRlwmb91Hzcfr5iTil4MMRG9ZKkTxsmEltZDhbOrxoIWhTqE+Gx/5dTDCkiwTLDyImS+sj6w7R3BdaQT7teOfzoKCa2H0mpaMHVQ2JLk+XL1j0JjvlQLiljus6m8vs/PgTzL8rXq5THGaquq3mXEMRvsZwMciC8oLoOpUaT9fDGFB/va7hRQgdoS9xFQk X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9fe755f-6497-4744-b12f-08d8d3adb66b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:11.9807 (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: ik+W29rwxT1iX2F/pZJdWLwhAJZVx3KvJiOKfF1AT7xwZ0tT6Pl4pDXGp/S6Cw/KusgUGUQIVqbtdGkEppwhbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 Thu Feb 18 01:24:54 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: 384354 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281389jao; Wed, 17 Feb 2021 17:39:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJylCobZsfphMce2pBmCkG4zPW0/aQq+KYbIw+/YwetbPRwHmagvNKndOXkKOoaTFg+t8ci4 X-Received: by 2002:aa7:d849:: with SMTP id f9mr1586531eds.76.1613612353958; Wed, 17 Feb 2021 17:39:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612353; cv=pass; d=google.com; s=arc-20160816; b=mdDCRYxioEdlhF+AktldczU+IdJ9TaB0m3ziVwgz617MqkmLDvEeR9+s0YNrYOATgn racOdUPhthzaBGDVgzBUrEHOcvlrjCMj8aSzAy7lK5r8cIsncMh55ac4YCBR5fImg1iy dpDzqp1Cg3z1x6IA32u6agt6yWSgrouoKzFTlvowEVvfbbUFqjUGBFo+9lA9zCa/jqn9 7CaMlkQItld7CoBXt0Zlz5mK/jDqdx5sq6VMgR/g1tNcdzPpQfokqxbu6mpTSC6AJopR KpM185mcqgWvQF3UboWC62D9p+ALo5YwL3vPSHdbwlZ+2qb5zq3Tj70m0gfVCEWEb44j 52kQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=h3macN6te2ODWmWB9GoKYvgu/NuH/FlGc+HqUZ8HFWY=; b=v4reGyGKd+4g3cprEeqUv1MQUAaLOvaprgVLrIeRzriyppmIMSaRI/x+4F0+nghntN +KBEn0C33DPLq9AxcreJEK6Tr3VhsfKhiYrY8WWOGFA1kcJGDRfdeFo7AT5gKd8UwtYI EZgLLl5Puys4uQo8vnaGzS63yV5/uOlic2YnSGl2ONahkeMuZ1Pz23JIJ8R20u6SbWlh WiKERCb7ox6oQl+W0yt9XFDZGoB+1O4/HnF7tPlR+kygHVIa6rwAES6TpMAMM2yUeowh VS7TbHTqAIvPGayHyKcEOTqCVrNCIJ+IGCoP++u8PGtqTda49bh7mvZJPGFpqsu7Pkwb M2Gw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="BHoVVM/8"; 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 e1si2551315eja.255.2021.02.17.17.39.13; Wed, 17 Feb 2021 17:39:13 -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="BHoVVM/8"; 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 S230228AbhBRBiy (ORCPT + 6 others); Wed, 17 Feb 2021 20:38:54 -0500 Received: from mail-eopbgr80057.outbound.protection.outlook.com ([40.107.8.57]:29216 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230219AbhBRBip (ORCPT ); Wed, 17 Feb 2021 20:38:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E2uEeXPm7FSxwwSt/nGoxnS3udiBVKHIgOGz+qFNVxm4Xr2nbc3jlqIwXwIVejSR4MqqLmrmHHwiiOesuZix1cGAl50jQd53k8AkcS7iDSKbv4HvFNukfPz8kPCB3ViPZttNJUAxt8e+GpVqj1bI2kGWWNA/T1uL/AigvJ7LIVw6iVBbxrstrYanBxB+w/hcKr0FB1iI+UjyIrMPIOkEUYmmw9aZ1b+XQ6vcP8iDZEJqDguhvZUBjUGgYPS1QwGkHBh4nfzgesA68jOK4wIhcDUa0UO7rPz/FPyjPD0JDUwNjMyGbr2W2QUhq+YyMJRtWwDMYFPqXwtueybrXhbpQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h3macN6te2ODWmWB9GoKYvgu/NuH/FlGc+HqUZ8HFWY=; b=jn+YhOGXrZVNZq2H5HFdxQFUbdoT2Y2KBRZfGNa/izsu+M2QFancsP5/wbyZwQQmQICHAH6/34YzfyOsqcPUOFTLCql8CzxofNrD7D6VpGZM6mOhkJGKR4Cdhw4lWaQu06MDFbAJAIzc1fv0vNNtr+WLeerLlwpkDW6e3YzYJRP+bvtvsAwhKmbLy3w4WBL5Eut7Kl7VMkjUJLLX3mhv0uX2Vis1Mgqu7wC8FLZHUMcAqSSlF74r4/LA27H6qH6OaTqBvkjcCy4dl2kHgXJcWkRXsREqBKGd1fKEPbkWwP6qIICikU8nfDGRGNK9xdJZw8/060+FRfGWHK9ILNAKVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h3macN6te2ODWmWB9GoKYvgu/NuH/FlGc+HqUZ8HFWY=; b=BHoVVM/8K6SxXlYPfy21tjegjtewqI98OAQULkevfDmIYP+Jk2dC1hIV3BBHCol/GR7vNZdD5Pl5BxlXSzbXhmCp49qiNPk7RL39F1U+0pxGdHCdW6EukswmaLEFrl+oAl8MiaACLUosKVa6C4ClG8SEO5rLzQxEo/Ed/RknZLQ= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37:17 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:17 +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-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 V12 04/10] remoteproc: add is_iomem to da_to_va Date: Thu, 18 Feb 2021 09:24:54 +0800 Message-Id: <1613611500-12414-5-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: db93cb53-34eb-4361-2793-08d8d3adb9b3 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: n/p/tbk4UsHrOIqqD2zj5ZOwE16OLsXJTYkpLgq0BlQ+uCqBjHDH31fgCY0wKKPEHsBWlSWoWFenOMR53WmPwzdeUo9xwiJmgsk6FD8aiv3ORbmbz3W4K9/nMxnj/Sqm7OLjAkDWbaY/WrtxoFzWzqe/WRDi899/HK5sdCGtfJRX4pNl9957kaUUA4jPbVc1Iq/b3YaKuX4VKWiYLfufsaT+FfI//Lzg4k3xNmWaDdv5gF+1yv0LIDwH0j5s1riOTo9oQUuPaBgDyBZdqt2/U6Y+1IhE2ec0tWL0oQb+ISx4vbLOgjAAN4L1fc6U41ud/SrdZ5gtEfdjgOF2rZP2HR7HUAxKP3I/cXfiihawJS9hME7nLn92pHVKfjtpZDk3xAlBt1tFEggJAolDL5jTxL30N6hGREKLtYacVE+ob2PaGz8owYX3XUYKR/hy/CzLIqdrzEasQzy7SlHyEAhAevPn4TJoyhftOGyajW3mSExdQWA4hWYgCW4Ldm49to64T/9yG+fEitS8CxGFFAZborYIBvDHhqqrb3IIfdgsFWxE3X4Jay54/3af70xxPex7AAqkboiJt4cueIE3DA02rw== 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(83380400001)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(30864003)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: JKxB/NNSIjXs6i42Kktjj4MC/NzMU08B6nx6IbrPCfCxoNOkCh5g4glPQLVsGaFYSrCA6vNt+g8UbfiY3Xj4oBwdS7Ak5NI8q41PsetXnVDZ5y3iRHstxQ8BMNO0t7m5nFvZo5DJvJgHX1UDgnZdgQJe1RsqFME3P+K+ey7m8IHem8TyOgaPScw1jG80FKIs7InLcbSKtnqOK2eQcIYdmj5f+gNpP0OQl53+RBJHrdFUVM/FgUJZmPug8ko28o/CKkYJ3FuJiopJIbvyft/nOgXXjVxGINB5w5Rltrx+FSJIFtnTlq7/N5wQkdWY6q0Mz9uHfUu4BSwXIeEPWNAgxpY4EWIQAYu8kuQ8St0BGBNhoO+DLDh1fIobFiUpg9BOosnZCtTCvXC2wFqIx2DNBIpYNQ5i5MkXJSuMzsDAYm03zT9KA5/ESlUOtGcik5dGMnNKaSHx2ogJrZZSjyJ5b1wfN1KlEQoJTN6Jn6YDGuX3yQKhizSRnKQ5E6D63kIA2m6zRUXH9JIt8HeIK2BriPjD7fnhg4QEoSChVlDuuslfLiEBxAwEwwYafRzXAMQmY2pAK2Rv98aJHx0zVHKlzv/BItBjQKS/c1gU/Dc1ASEUNo5+kyuBxhac8CjIgWfgaR28+TbP+QVJ22p+voGtieNiVDAFB44PZLLhpK89MAzjoY1pbMOrfGoafDZ/fdh0OmjDCXKUP9ljOPvXrawbuh7nSkZYmtos4vLq4+Nw8oerNq+ODl1MoLiSuFLLWfjhuqG8sw7pXXroPZOBZyMDfpuC4tVUToARDVojBWzRsZcaMCpP3QBA9b//Yzv1UtS4Ejx7av4T4Qdif4mDuKmpSv+Gs5xKU7WQ0g2x8byPXM2VpLzlGgPDiPggagxCpGKyof4ekrDj8DXpHwCERYDwmqpw7bC5Cxf8Q1rqzvFf5NxTPH9UpLdLtfQ6MWVHiDipbt37rUbJkYz6p1mRZbOSida9+qaYlkgeAQcwihRAnQtS/nKq33LPq0L/8dsSmR8CUS3IMgAif52+h1M3C+Qc+9oaouU5+cLHCc/P7RrG8ihk1JcRUahwiAPokn/w0412OX+fguhf5zZE5QZCoa7wog4EY4XADrblHd0afQSrZw5hQ08+nQtMgHDh2JcJvSgfJOQDk5+JD2SDqKE0KikWKfnkVmSCeTKUOBCCiE0Y317QEhmEOi69nD3qqSQQQ2mHney9PZkrZHLTo+1IUHBF7wZx/YwJibajihg0Rz5UaZnB7WeoDgNeDoA6daSKj8zdelcJAjq22dafp0DcQrqrEoWAy53Ixebnn7FNozqIqG4NYlkLA+yDlnr4+0dTw4bV X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: db93cb53-34eb-4361-2793-08d8d3adb9b3 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:17.4922 (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: 6bzSSSrEW15LmuP05+qrLSxWDAbBhhJMQYtjjzBL0Emti5T9zTA4ULIWxHqTQJzIwhBP+nHEDJhXB1QowXEEHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 e2618c36eaab..a356738160a4 100644 --- a/drivers/remoteproc/ingenic_rproc.c +++ b/drivers/remoteproc/ingenic_rproc.c @@ -121,7 +121,7 @@ static void ingenic_rproc_kick(struct rproc *rproc, int vqid) writel(vqid, vpu->aux_base + REG_CORE_MSG); } -static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct vpu *vpu = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c index cd266163a65f..54781f553f4e 100644 --- a/drivers/remoteproc/keystone_remoteproc.c +++ b/drivers/remoteproc/keystone_remoteproc.c @@ -246,7 +246,7 @@ static void keystone_rproc_kick(struct rproc *rproc, int vqid) * can be used either by the remoteproc core for loading (when using kernel * remoteproc loader), or by any rpmsg bus drivers. */ -static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct keystone_rproc *ksproc = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index ce727598c41c..9679cc26895e 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -272,7 +272,7 @@ static int scp_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* grab the kernel address for this device address */ - ptr = (void __iomem *)rproc_da_to_va(rproc, da, memsz); + ptr = (void __iomem *)rproc_da_to_va(rproc, da, memsz, NULL); if (!ptr) { dev_err(dev, "bad phdr da 0x%x mem 0x%x\n", da, memsz); ret = -EINVAL; @@ -509,7 +509,7 @@ static void *mt8192_scp_da_to_va(struct mtk_scp *scp, u64 da, size_t len) return NULL; } -static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct mtk_scp *scp = (struct mtk_scp *)rproc->priv; @@ -627,7 +627,7 @@ void *scp_mapping_dm_addr(struct mtk_scp *scp, u32 mem_addr) { void *ptr; - ptr = scp_da_to_va(scp->rproc, mem_addr, 0); + ptr = scp_da_to_va(scp->rproc, mem_addr, 0, NULL); if (!ptr) return ERR_PTR(-EINVAL); diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index d94b7391bf9d..43531caa1959 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -728,7 +728,7 @@ static int omap_rproc_stop(struct rproc *rproc) * Return: translated virtual address in kernel memory space on success, * or NULL on failure. */ -static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct omap_rproc *oproc = rproc->priv; int i; diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 5fad787ba012..8df99318f18a 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -483,7 +483,7 @@ static void *pru_i_da_to_va(struct pru_rproc *pru, u32 da, size_t len) * core for any PRU client drivers. The PRU Instruction RAM access is restricted * only to the PRU loader code. */ -static void *pru_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *pru_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct pru_rproc *pru = rproc->priv; diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index e02450225e4a..8b0d8bbacd2e 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -281,7 +281,7 @@ static int adsp_stop(struct rproc *rproc) return ret; } -static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index ee586226e438..333a1e389fcd 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -242,7 +242,7 @@ static int adsp_stop(struct rproc *rproc) return ret; } -static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c index 78ebe1168b33..704cd63c9af4 100644 --- a/drivers/remoteproc/qcom_q6v5_wcss.c +++ b/drivers/remoteproc/qcom_q6v5_wcss.c @@ -410,7 +410,7 @@ static int q6v5_wcss_stop(struct rproc *rproc) return 0; } -static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct q6v5_wcss *wcss = rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index 2a6a23cb14ca..3a131163064c 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -320,7 +320,7 @@ static int wcnss_stop(struct rproc *rproc) return ret; } -static void *wcnss_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *wcnss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; int offset; diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ab150765d124..a1df4d7e5323 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -189,13 +189,13 @@ EXPORT_SYMBOL(rproc_va_to_pa); * here the output of the DMA API for the carveouts, which should be more * correct. */ -void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct rproc_mem_entry *carveout; void *ptr = NULL; if (rproc->ops->da_to_va) { - ptr = rproc->ops->da_to_va(rproc, da, len); + ptr = rproc->ops->da_to_va(rproc, da, len, is_iomem); if (ptr) goto out; } @@ -217,6 +217,9 @@ void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) ptr = carveout->va + offset; + if (is_iomem) + *is_iomem = carveout->is_iomem; + break; } diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index 81ec154a6a5e..aee657cc08c6 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -153,18 +153,22 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest, size_t offset, size_t size) { void *ptr; + bool is_iomem; if (segment->dump) { segment->dump(rproc, segment, dest, offset, size); } else { - ptr = rproc_da_to_va(rproc, segment->da + offset, size); + ptr = rproc_da_to_va(rproc, segment->da + offset, size, &is_iomem); if (!ptr) { dev_err(&rproc->dev, "invalid copy request for segment %pad with offset %zu and size %zu)\n", &segment->da, offset, size); memset(dest, 0xff, size); } else { - memcpy(dest, ptr, size); + if (is_iomem) + memcpy_fromio(dest, ptr, size); + else + memcpy(dest, ptr, size); } } } diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index 7e5845376e9f..b5a1e3b697d9 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -132,7 +132,7 @@ static ssize_t rproc_trace_read(struct file *filp, char __user *userbuf, char buf[100]; int len; - va = rproc_da_to_va(data->rproc, trace->da, trace->len); + va = rproc_da_to_va(data->rproc, trace->da, trace->len, NULL); if (!va) { len = scnprintf(buf, sizeof(buf), "Trace %s not available\n", diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index df68d87752e4..11423588965a 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -175,6 +175,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) u64 offset = elf_phdr_get_p_offset(class, phdr); u32 type = elf_phdr_get_p_type(class, phdr); void *ptr; + bool is_iomem; if (type != PT_LOAD) continue; @@ -204,7 +205,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* grab the kernel address for this device address */ - ptr = rproc_da_to_va(rproc, da, memsz); + ptr = rproc_da_to_va(rproc, da, memsz, &is_iomem); if (!ptr) { dev_err(dev, "bad phdr da 0x%llx mem 0x%llx\n", da, memsz); @@ -213,8 +214,12 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* put the segment where the remote processor expects it */ - if (filesz) - memcpy(ptr, elf_data + offset, filesz); + if (filesz) { + if (is_iomem) + memcpy_fromio(ptr, (void __iomem *)(elf_data + offset), filesz); + else + memcpy(ptr, elf_data + offset, filesz); + } /* * Zero out remaining memory for this segment. @@ -223,8 +228,12 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) * did this for us. albeit harmless, we may consider removing * this. */ - if (memsz > filesz) - memset(ptr + filesz, 0, memsz - filesz); + if (memsz > filesz) { + if (is_iomem) + memset_io((void __iomem *)(ptr + filesz), 0, memsz - filesz); + else + memset(ptr + filesz, 0, memsz - filesz); + } } return ret; @@ -377,6 +386,6 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, return NULL; } - return rproc_da_to_va(rproc, sh_addr, sh_size); + return rproc_da_to_va(rproc, sh_addr, sh_size, NULL); } EXPORT_SYMBOL(rproc_elf_find_loaded_rsc_table); diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index c34002888d2c..9ea37aa687d2 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -84,7 +84,7 @@ static inline void rproc_char_device_remove(struct rproc *rproc) void rproc_free_vring(struct rproc_vring *rvring); int rproc_alloc_vring(struct rproc_vdev *rvdev, int i); -void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len); +void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem); phys_addr_t rproc_va_to_pa(void *cpu_addr); int rproc_trigger_recovery(struct rproc *rproc); diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c index 09bcb4d8b9e0..22096adc1ad3 100644 --- a/drivers/remoteproc/st_slim_rproc.c +++ b/drivers/remoteproc/st_slim_rproc.c @@ -174,7 +174,7 @@ static int slim_rproc_stop(struct rproc *rproc) return 0; } -static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct st_slim_rproc *slim_rproc = rproc->priv; void *va = NULL; diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index 863c0214e0a8..fd4eb67a6681 100644 --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c @@ -354,7 +354,7 @@ static int k3_dsp_rproc_stop(struct rproc *rproc) * can be used either by the remoteproc core for loading (when using kernel * remoteproc loader), or by any rpmsg bus drivers. */ -static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct k3_dsp_rproc *kproc = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 62b5a4c29456..5cf8d030a1f0 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -590,7 +590,7 @@ static int k3_r5_rproc_stop(struct rproc *rproc) * present in a DSP or IPU device). The translated addresses can be used * either by the remoteproc core for loading, or by any rpmsg bus drivers. */ -static void *k3_r5_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *k3_r5_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct k3_r5_rproc *kproc = rproc->priv; struct k3_r5_core *core = kproc->core; diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c index 92d387dfc03b..484f7605823e 100644 --- a/drivers/remoteproc/wkup_m3_rproc.c +++ b/drivers/remoteproc/wkup_m3_rproc.c @@ -89,7 +89,7 @@ static int wkup_m3_rproc_stop(struct rproc *rproc) return error; } -static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct wkup_m3_rproc *wkupm3 = rproc->priv; void *va = NULL; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index a5f6d2d9cde2..1b7d56c7a453 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -386,7 +386,7 @@ struct rproc_ops { int (*stop)(struct rproc *rproc); int (*attach)(struct rproc *rproc); void (*kick)(struct rproc *rproc, int vqid); - void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len); + void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len, bool *is_iomem); int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); int (*handle_rsc)(struct rproc *rproc, u32 rsc_type, void *rsc, int offset, int avail); From patchwork Thu Feb 18 01:24:55 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: 384355 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281401jao; Wed, 17 Feb 2021 17:39:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJykaEBpIuBrN91lOR56p80XxtS1eMq4LsF0Miv4Qn3++415SkIy4Uueq07CMfui+E1s752/ X-Received: by 2002:a17:906:168e:: with SMTP id s14mr1650395ejd.515.1613612355121; Wed, 17 Feb 2021 17:39:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612355; cv=pass; d=google.com; s=arc-20160816; b=JWfLkjSgeFnHzh6N0WEFkqnMjm8fFGVHNt2jfimhxPb4WDe83i0OHRZiy3bpnNMARg D6PykouZn8TneF7nrnGDHL2TJAND6qYOGA7NHCgWQe8TArRn+yNHsylu/QiXxBHCJApn tnLapZwgGZQD4hzVvkY/X03sqheHVN/0d5C5XSWpC4fC75Ryo5NQhyLAD/y/kwMgIDe+ EOuwAS4gSAvEeK2za8gb56K8FfyrABXBNAjZu4TQiwNyaRXbHmvlpZ/iXByWCUoN+opy 4vJPV9tjMg/rRuTMhGYwFYWvAhcv5oE7hz77sY8Rlt0IarMJ0X8sW3R112VWkja/nDuz yCLQ== 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=pfLKhvnNT57eRpUe1IS0f2WxzM9ebuaEKJt3Q4PJbABSpxjkVx1hwgdmm3Q/0uNOSc JR1oq1SImHdeknbqKoBa1ZudZQnofPTCcvC8qh3Ghx95Hs0SHWSBVy8o04UjtmmVkTlV 8rHvhm10Mu8IICZrw+cXirUZlfFbnz7KxCt2jaywcC/GNVHvZbLGykm8sXGOYdx7nqml D1URAYbeiz5RjwlOCSBdmLLr/FHekl00G77AfrSOCytBj2BT9T6qMUG2600HPYUibgRN z715aSekdNhhqGwVH9YKQUy659TE2pfD5dnnM4MROHmCF4nI8zbKt/7enws6H73OsN0v ppIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=hAc4j7uw; 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 e1si2551315eja.255.2021.02.17.17.39.14; Wed, 17 Feb 2021 17:39:15 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=hAc4j7uw; 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 S230254AbhBRBjC (ORCPT + 6 others); Wed, 17 Feb 2021 20:39:02 -0500 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:51809 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229873AbhBRBjA (ORCPT ); Wed, 17 Feb 2021 20:39:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DgtEOOVSpeQhqRopLIVZa6oLO7mb9CawCZKozO1iH7KddspmuNuOTpI8Aho0i4CHG2dZF5QUinA/qr91nOPw0eHGZ5m2bHC78zmSVXU0Y/flfpJLgR0tFPwU0RTpWhcnXmQnMbxYCCCSqosGYEOJdjCMP+llSXoIdqQeVy+w2SlhRxPr4qOJXx7m0+lS2vLdxto4AqYfeW91Y3Ic9ad8CpNsR2rrL381Oi/h1mJmn6fC0cWRY8Y3MgLH7nlXgCry2EiF8R27IfBDe15YU9bDn6+pK6+2zwpMw3oI3cWCPKZBGoxMLqy9MzWsmO4MFtTNWZB+YL0dSHuTDtF+nxn+6Q== 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=n6RdzuKOnRRVIrFNxEprcvqjr2+LbdkbptP5a1jLJEkQsN6+cbKtki12x4upAU4kYJlvz7gUOYpHLI0WpEPmzDTsnoUKnV9yVDjkVa0DL6S8Bd0yqEn2v/fPIJZYQd3zpI00bBl+rHToquDlv/MiMze/OoAxy2UVBJnpAaoLg8GFKorsdFfbQouMub/uUny5XMA/2HVmw8Nxyer7cJ1McBVtipomm9zgHvHIExaXTiyeQcwUxr8GyfrxWdJqTDeyNOW1J5QooqmDX01Pno4zVDHkFxluFbDU1Ay33FGF190AA0A3y/z5Cb0TH/Obi6SuP75S/o9E9whPgkc3QqA21Q== 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=hAc4j7uwB64Ta+ntkpkgx0hLif5ICYztmgxzUKi0rI/BuIDHZPlD3FfPK9IGnltgdwviudJ64LUls8yDqVTJ18+JU0sX6u+hS15HxRHWoOT8maUp4BBiGfX1NUsAIMqyaTHN81FTToNHrvCLg+kFzFSaNICF6tlQCv0zrHxUXw8= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37:23 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:23 +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-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 V12 05/10] remoteproc: imx_rproc: correct err message Date: Thu, 18 Feb 2021 09:24:55 +0800 Message-Id: <1613611500-12414-6-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 748a55b2-eac2-40e4-5858-08d8d3adbcff X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: ocAQB9RrKUnZIru0jKtsX+NMdyBZMEHdWOByRKhPIW0UYYoM+uv9W71Zx/EhYNnG3BEk8vUVw9gbv7ab7SZlYrLShh5VRDCSSZAKN/FQbdAWp4sCrW+Ih7q+8ywcZ69Xz//7LcupbN3SZ33lObF2e2+nlO2gBVaKmFEhCGmeW7oRePQgiYMAmXyJ2wFWsgSaKkBgpHJ579AYpW1QzdJkmfNfVtupO62cmoSQgON516p/NYJedn9JA3IWOHQKhPYTZsOdiWD9Th793PLHhXXaqhTqdIwDanvqaq8GjHuNVaFl9uoCwzSvRP5e9kgg2DokaMTK/Y6rU9dujcGev96rmKUA6nBoMe+HAejwo3NZtkS6igBOm1+4Wb3HCZDpPdP2mBMZDVTNYe8SGNKpxjJsqUJKezNTQLDLkEXKVYjR6L4xHVlv7UlgOz14goi+WbNZHwdsgm0i2svcV9teLoij4dHVIepUbyVtgJ5JjjvOkILmpXOBLugRZt/RIbdEVmBG/VcTOLa/fWg9ksmMKc7r6Tk+ne6XuwcXr/+Qs3gkBqQ5Nu1aNTotkfaWdgCuE492mxbW7DSDrfVdK7PieJcRSg== 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(83380400001)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(15650500001)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CoXqWtsVNTHz6mecn44XXpFoBwQ6Vc+BMarVp4z2UuJ7NVP+hAZP+lxhxUDjaXqKo489gnstsPsTgz24SWM6fAICFkHZ8/p7KOErhy8sqk820IKGeOGMx6N6D0ShXhamZGoY9uxe4J8E9/FQRohR5NEOBg28D5TrAQNCtFweyKdXQNxsXX2lDJsJePvAiAsAYhANTPBsNdfEkJDekg59j/t3wK5lO0ktop3P+Cpk09whf5yrjJeh8S/r/sUHz+B9v822VzXFORzkZ4YD52ExSVSpcy3V8tPrVNKdvhrHPlgluWAp2488LMUSCNI2PwZHWzWbfxfvdkR4EEzyMO8vTHKVkgHwUfu8xWF5445FHf4X6o/zwmVSwgCQw7Ff5qr5/9QlzCb/LPyqxdI5X3LiIPZYDxusX93SaCnlmFdKEntKdsiEjBoUM+nrD73y7XIkMMXCTrW83Xfi4Mbm+7Z/ULJQtjm9BCPZIJRdpsIeBUrnPEmq61ieolT5PxFKlH3zA3IOGMkES4pflrwSly/s8F2p2XL41DJiiu5WYHqMqN7mZKnvErsO3AXo5/JTNlqDYV7KyJ1s7478e+Af7KWpjtmLiK9vqASoS77Rpew1tS5wUXkiL92NOdJ6Mvi6vSyfvE2aiTXyNcZ2oZkQC6MbsUUUZU0Qr0qI46pRdfYgZnijKvhLk39z1kCPVkcq2DE5ua7OIPZCfBhmwzrFbkQCDhb1bjdlTiGwXk8r5+Il4qKl2d/4jsIrKBSqaPLQyAIKylm7G0Qq0HVGt3AkNU7mEs7KiP6znPQrjHPXc2TNgvxnETA/6R04E8D0cblVnQ7ruExdH7XdKOrjGVyL+T+Df7TitK8g52GsEJIWUXbZtdmgI327Z8f+sDcLQQFGLDfKY0o3zK5Vp3Lioavv89EgaGMAOQnpZit5UOAGgwj8HoDoH9JD7lQ01yfNjCXTn8vGUu+FApyfSkmr5CsLik8hLv1i6YQZdoZ554VcdM47X+YHE3v/qiMFw3AePFjk8pYVklbwNHUudnHHc427f2uJTJIeqNoQANv3KinzEVA7X/FB9bHgE8/0Z1P1qF3b86NiTkuPDlOAntICB2JvqHmck4pNIm7wxBAlnQEBoMwWinVuUmD6kuQW2sh85RDHeB3aOOsivAq7+p6ux4DSx4YNjQgFGkq02lzYEsI9pJQXHNnCcWZ6bSIrX+nIIe1qQYeIDGhz6MXMYSJwDFzl0cx8kiQ1vheH9K7ibG6PiILJO/nLfPQEN3EUgugZKidccqbTdDnoqqTMZHrKHH649UclJgllfsPxP1tkhbatzKYlZIZg9hJxUYUCahVXDSn7ZUOL X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 748a55b2-eac2-40e4-5858-08d8d3adbcff X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:23.0307 (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: 6Ed1NYHmDZRpBtlQBuk5qTQw9xcLJe+BEmvNeKUBjnvf5xAAvTLtB0mVzU2qHyfHfRNUx0hDadkLJpNbIv4G8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 Thu Feb 18 01:24:56 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: 384357 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281577jao; Wed, 17 Feb 2021 17:39:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQlKNbJQYwPYYpSvOEwz68ITgMx+cbJBtT+7FQXmJRcHDpE57gWNll8GWrLcEeKs+36T0o X-Received: by 2002:a17:906:e2ca:: with SMTP id gr10mr1620611ejb.507.1613612378679; Wed, 17 Feb 2021 17:39:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612378; cv=pass; d=google.com; s=arc-20160816; b=Kx9Y/Pit47gL07I5IyOGZsWWabIgxHCHnsdb3eR9/sDy8RRS2s0l0JbBRuSr8dWkP/ 9g9WHv8gIbMTEa+hN67+V7MECN3TQKv0VkJmKxNXe+mRcdNZVlnCI9aovtBvfw7DGApR lMES0SwtryjrOU7/K4MzlEVWnm8pmYwfw764T0dTv/ZlJhgYNzIb1xaxtTj6ckzKxP+d eY7//MzpGHQRNYsU7F7jDzvO44HjoHxjIyhcXPIzrPo/Csg07l4zXUmzSrgKc8qZQ8Ln ue0iR5sw5+Qyz+xliNsiOqOhtL72wzqXHTJCHsqnd30KbJAyUUR24bTfPOUxCIztgXaO NcSw== 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=HnIDbznh9Ba8RYWwOuM0RIo2zWKQUfB7K94wDFhw2mILTtjv7gBpRXSCrsAqkg66uv GSnJR9lSuJ0v+aNgtRF3sfVpNckHJljxL+otd7fKSY3ONMtTGC5pvTfGv/thU65dDpeu 3vzvyoqN8W4Wm8/xCwx82dTp2H5iwAPdWcdjFQdqiR38ukT9to3AmfzMXBDm5OTDKgSs E2LW7NQ6ql1YBzL49GKj8+EYAbkjtL2pS4QRYDZ+r6jUKvo6Fl1kkigDzRYIIAXjYcvY 8SkogAvk2oCxGOdnRr2MmF8hxlAuatyKZbhJFgOc+bA6uzDY6e7UtDvI2clwKC8s5aLH szIw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=i7dwSeJI; 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 e1si2551315eja.255.2021.02.17.17.39.38; Wed, 17 Feb 2021 17:39:38 -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=i7dwSeJI; 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 S229934AbhBRBjc (ORCPT + 6 others); Wed, 17 Feb 2021 20:39:32 -0500 Received: from mail-eopbgr80057.outbound.protection.outlook.com ([40.107.8.57]:29216 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230241AbhBRBjQ (ORCPT ); Wed, 17 Feb 2021 20:39:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQEotOXMrUKibs6kRoleXteYhnU7sT/APaFS/KirzgTAjEaBknEqqHgrcmspB+LsdUg5JeXWw9Mgk14uGWlBWrnmReZQEoYcqPv1mUbL2mKfHPQwsL1BUWBFuIxHbOqxC2+fPX2zkyCxKRu9l5MUNK8AotIQoq10u5rUZBtSvWQ4E7qIcN1rOqMQnScUr2LVUx+dLSH2oQi1hXPOd+xaxyAHGSFFgGS1ZA5Ew3a6Zi5QESVb6jPP8etv0caXvXciG8RbAhkO8OApWGWBGtfYiRJeWEdDRdVN8i1mpjHF6tSS/T/gIMSa0QZHUmnKVHzGa6iUJ/HvucGhpyPDVHNw5w== 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=ClUi9OuDwq8GWGTYYF3uc1wmMvZKxtmduZaP1MzzmvmYLS/fMpEvlh6Gru1lip04qGJV6QNzmjuTAvMjbgo/PrGWy12nX4XE5B0vP7G97MU8jtfd8J+ViY6guT1JvwabNCkgy1TUTU8Naqci/ZsQs8YOJ8anE67P+ZhtFMqYBcVndoi5LH5simYiGi0oufFLW8TW3oOwJhG+Qkn5HaxVQebAvnSqFcLwv6Ylc3XD2GMN8Eza6d5QNcHJr82I9Hwi2alczm0sjPohXFj/lHgdGwZ+R1NfpH6fhFdwJjX7i3g+QxjIGqIwd/SKG1TTrPTsOrCAUwTZ500DrC9xELG58Q== 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=i7dwSeJI6Qzs6CjSOe3pVqyfp+RfgU5uoo9eGHL1CAVv3cBWHJZ0mmdG10vYYsxEA0AW/75YUrV5ChjNpX8AK+OPo/DDnxiR6B0LNim/ODaPaiMPuO9WmHdFgX9nuzI0fjex4mN5di03Ofu+V9QkKj5XZ2TqKjeJPAU8e1CUv7U= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37:28 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:28 +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-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 V12 06/10] remoteproc: imx_rproc: use devm_ioremap Date: Thu, 18 Feb 2021 09:24:56 +0800 Message-Id: <1613611500-12414-7-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 63b2a4ee-1f12-4057-186e-08d8d3adc049 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: n4kSpHPKmYI4adj5fXzefG/q0LuCmTM7Aw0cA+cJWHTBh2lRcF4w0rdy89X8VAGVC7bVc+GlYqDIIBrSIxmEuSUXJxsvHV+BKTDVLQt7mpErz5Nve6gfGe6jKd1gLFITao0fBLjHScV6Zg++fKsZwgiFv+akOXIw+3SwlQPDWf++tVZK25Oho3zDQgqk54+ucZReuWTtGeE6K03lkenvO7efNoAsq7+27otsgCOrQHh9TqY5nGfYfKHy+hlW9ZmeQ/8VBSfHzqHaAPJNdyPsaK2tFjh0JZxlzzRchYTOZOwT4rAJ89GRxKFuBlBDvpDRLe9TySwmt8+7Q8ExcGSgx8XKVMALRJbgmhgqGycR6y+1orJMi7EROXPxF1kyfe/3Chl0BtaOyfB6bXMzwSiyzLlAGU7qoc4maPcJ2oImQonDMBUJdhGpYJOYml8qCJJDi757a33s0YK9aixwAOciABQQU9ZDGpb2MYmMtalzEBA+XqN+8ad0MeXpjZB/UHKh06v+0PpZ+JNsgB6Dh0zLVMNvJJ5+20aTpmpl3iuzCC5TblbUK8esIfHEmijMi2IlP8JF99C3EjVhI8x2Khum7g== 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(83380400001)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UVT/Mb7g6ZtKYMCpfXgfj9kICKHa/4w/RPbOP2p3zcKQhXMgvdOS1DzW6KACg+dQa9VQTuJUuNQuTBn/8DGyJEM/kmVg+WTyTcE5GimM3jMxvpsHtwT50El9CukidozAtgsLKEjWBrs+D/aby6APYaHec7ZbX+aaxWweJLnEuVKvsGYtln1B6wXrhHXR7Hu+48bOPqqyfcQLXsqGtr2veEeMPHTOIHVwberJvPtf26uT4dM2CqoS+WaVKHk563VYhRwoCBlzLUzHO37s+Tb86TizFa2AWuHFYCxMoSR6F8M1+/7xGFF5jzYJzyGHTJdpnlbAZ+sdoUOcmmN93b4b/fzxvxg39mqEu+eCvBQj6fJCNzd6L/LjJjEjO2j+FaYtAuEO0LkLDGAZu9R2hMcvXhtiS9JGBN4LAKT85Ah0ZBXV6WcCIiTTpFlVJrp4DDI7BoPmjv+iv38veDWtCPYRU06qg0C2xWLq9s2XDh09d93YMHwoRE7LIZvEFGUMWbP6li7Di1rf7+Sm644sl5ovMg2+w/fIUKbs64Q6kvCQKrrafm3+ITylx/akORKzrMPHllEzcDYrrE9wSt1Vb0BLGWZ45+/XbTBkoH2lslbkoiKYv9zVLpRbX071AZHJ5eStADRdeddPlTHbqDYuwKnGOIn78owuG5bEhXqkbg+LzUh2sfII/Qe/9Fj9pWfyPg9m1JPU4Wr2hMtoWmMchBMLwwoR0YT4EM4DLblIhr11xf5/sQAcxzK9UsvTIh2Vkhy/TZXfjFnsizPKYV5U7/QipzqXhJ43azBMESE4U3Q+qK+W6lmHKzRP4LlMpevBs/E8FHzu7sw28k2CMvGW7DanThQHwPb0bbbHSsFmQ5R2iZZzayYZTDAA9AgJLtJ4B4Ki/RYKMOEHN7vx9/Xsr/MNYpPg7F1k1ZbFmSNFGK2+Hs2aeJEupQSS+zaLiCu8Pr+PL8bbqYKZUQ2WKY/ww8eJ3Up4UjvmN0OEk7oS3UL06hNfYzllQh83yFRrKwo2hPlFR9kXfhqKqCp8EsECu+lhwM9aLZWkSqy3aCTIiIcx0EYfVc1sMMqwctXpFF8d8YwxnEYPMkppVnfO+NYrs4PB03ooYFkluVYg0+n5A4sg4K2v2JuzHsptFUt39679275CoShHfTIgpvfhdtbeweOP9WCI4xrVvbOsUejf+KKqzBhgTk91E6X5sRFUd97SSzcrMGmyGfBSs/cMgZTtpz+UcKmjkrldJHFigBNQrQ/Jhaz+8EVH86NRm65nvSK+11BdiIrhvF8QBJckOzE+tdQPz/z8FIApNvf1lPRUS1j1k47yfrw830c/RkRwTw2/O6fm X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63b2a4ee-1f12-4057-186e-08d8d3adc049 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:28.5022 (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: qHke0r1XmQNEF6cHEQY2XaQ4sFA0raj8/8YVm1W40zUUDPggYngIPIiQzSSw3I9yjjXR1qppR9udg57IEQaFbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 Thu Feb 18 01:24:57 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: 384358 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281628jao; Wed, 17 Feb 2021 17:39:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyiVhhgkWPuIxJsERlfM56MBlX80aBwmzjrENP+tMLUEym7nE4ObB2wk/tArGl+10mV3+e X-Received: by 2002:a17:907:98cd:: with SMTP id kd13mr1658963ejc.152.1613612386900; Wed, 17 Feb 2021 17:39:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612386; cv=pass; d=google.com; s=arc-20160816; b=LQ8G4omJXEBJHu4nuKKlNJ9VXrH2ahaj3qD5fMTgRCN2vtKRqnoQiXbuefRLXzaCz/ 0ryOSeZ8cx7K0I0Nydw+k6rEnUeVNwvRcy94Tr1DauVFxZkm+GUeLqWqTTMd2iWGnOBE 69x9JgYYsONhiXvyLG7SUJj6XHlVOsP1MNexK3KGBM8Yu3v/2POOzkmax2s6iexP1v/f NDqqV0+GJtNCdNv0Ka4z7m5Z44DdAiP5j8eKIQ3n1VI7XXiZPprH9iiREnbNv1JSH7aX yhXDQ7MdKZmqlXujyTIFudo0OC0rxINKGlurkvEG9f33YRESJo8pK9fXGyRrPyTgltpO 71AA== 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=MCRSiq2VTMJ/0XkqF27xURok6ZJufWGU8M/p8nkjVhv13UnOtZ6DHCYvacqevCIEem f+TxIthHF49me5wY4KLIAIdq8Aab+xhuOgXmyKiwcQs+FhnH7fy45diZORfBZeyBH+7L Oywei7Jxk+w9m9ksNLnRtOz4417belR8Z2Q8DzrGkbazCFW3p2ZAg5DnvxxkmH+DSa6J YxIh+KTujQhwDbyWLROz/rz1y6+hX3k5ya4yNc+/crtgsV9MPCQkUSsVJh8820WwGgqu FvI+pxbFy/oMWcia2A2Ed0qutgBI+bVhKxT+wgtof5pPO+Mku62r1b5ivnqFAq39YeQR a14Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=UkzzNgZW; 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 e1si2551315eja.255.2021.02.17.17.39.46; Wed, 17 Feb 2021 17:39: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=UkzzNgZW; 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 S230021AbhBRBjf (ORCPT + 6 others); Wed, 17 Feb 2021 20:39:35 -0500 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89]:51809 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230018AbhBRBjZ (ORCPT ); Wed, 17 Feb 2021 20:39:25 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Znzy71pIPRqd9iJvi8b/Kf9y8GuMI7bq0f03v0NDw8rafSnT6zyGGPy827N7kHlzWVfi6jW2tY8kvptl+1oI1bRFJbXPQwx5DNf+qYWfrbpuXBgy7NB0IC20tyNSSDuLob78q53PJh2RByQ34XyS6oOv0sm+P+acHv30c9q46MN89caO17ScElTU508tzc7mheJ9XyTpDXIo5EeZSKozG4+Y1FxcBYhQT5XXK9gCBADbkdqKN/4NPEN6hSa11rnjGTioYkSBeNSyHjJmMkIbiwTHV96m5IuEzCl6JqePX4kfioDut8Oad7fTevZdnKmUVaNvPrFqa4GXSjHJMN4GnA== 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=hUN1T2uIikqKXNE/3zWeVZGARyTh4SVjH8izMzOln8vMe3WjRPHYwdPVhzlK8ZBQETiPeZj1mZ4+oN7WBZiXQTV8Qe1dMjx2LRro9NzD21QGeppE6xCYIvD1aHJzfxq+Oh2jtUaOnkCHzUY5lMP3ts9ZwIgT2zMx9VleC8DaVel/fCcN1/8AxJ5ecIGfiCOhp+RNsR3Eht5GmwCTJgOVCO7JiQ26WrwvEew571OD7weVZSyXl714oQv3jvbp6++3UFESNA0wT1/+p5ev0seu2t2sV/amkX7FgbHiFr+nnFnjJRYRujGyc3w0N6RrpH65mkCp+hQWQJs21cuLYwDjrQ== 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=UkzzNgZWz9rOUxR7dfYg/wW25awJf2YlOLEp8ISU58oFNpaVuSdFGi23PHePNkS/eVGKI7FQs6VGiZuDGZ4nQYmtUlNFjEuTOXiTvStVP4xlwM54KkURB/ffIbulf6mq41sgiu0EN8yBCyohk6NuF3bS6YOAvEqthT3x5vUbVzY= 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 DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.28; Thu, 18 Feb 2021 01:37:34 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:34 +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-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 V12 07/10] remoteproc: imx_rproc: add i.MX specific parse fw hook Date: Thu, 18 Feb 2021 09:24:57 +0800 Message-Id: <1613611500-12414-8-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 52b43212-d7fd-4d0b-85f7-08d8d3adc394 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: 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: RYpuyeP7vKVKD84PLwPJqwv6A7gdfC9ssvv9HbWcQQUDoznPoS+U2f5T+cRW24cEnWMhWRao6zdLaWornmvtb5qHjED+/i9dS6PnZXEUEFzt2FLiQ9lEyh7nIYFkoAcCbHPvQayybnM5QXF4LUiM6PgiUakkJ2nLSpI+9Ft1bEAN1WXSiUDeLX2VIvQvi4XuTC6uzI+BCemWGZ1rX0+ahhP3swZFyGSZpSVTk5HS2VhAa7lJAZzo71eDO/1m77+GPeMoSUUgHuLR9+kYBf2U6jDiWhbH7YnykWkGnrnajWmMISlNEViGlvK5dwYlA/eGs3DswmRjgFtDL5y11nTt/CfH6NJ3k70YTBWnEnUUnBCl6tMvQFc7rUH1aQYJA7nA74D/xRZe+TumWGMBpKm1qnlokrkrhRWGTLKTT8ZfCl+Ms1iFx+8Yc5Ognni2XmdHqvzsQnzUWZU59oMDR+UvdVTyFbI5sHiUUWZtZMcuqXyjJlAX1yIB+Vqy3OpqAQOAlmWsvMn8xHfHxsaeHKoxof8o28uQWrTl7LTf8ANIZS5wRbakCATTTFR9GRl9hvIumyzAUhi6bodKVI2NKFGZ1w== 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)(136003)(376002)(366004)(396003)(39860400002)(346002)(6512007)(9686003)(16526019)(186003)(26005)(5660300002)(83380400001)(6506007)(69590400012)(66946007)(66556008)(2906002)(52116002)(7416002)(316002)(66476007)(8676002)(2616005)(956004)(6486002)(6666004)(86362001)(478600001)(4326008)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pUU9Y0KUd00s7bsqQH6Vbbfd5aCl/gM/PHu6aw512onsbgsOwnMbXWtE8SsMJU+U1cHtsMLjQMWRJSlqEDkhvGpTQkBuyq0zqsPI2I3HJElGb7Jtu/KyEYvXUsF9SVAXDb1bKJ/yqDatpoRrwuRZXj3O7Y4J+IzDTCfJqwOilUs1W9+xai1czMjOz2Yq0Wt8H9e4HzqWUW2yNo64SrCWA0+vyfwzMexhIFXvtw5c96FNlF+Lbl+1mgkXktRhwh/I+rv288QWvEMRJNVC5bSAjj0SBmO9CwYVS7wjgYRpJj5mGkd5o+eqpBF66TN7DiBek5H8TUI2KTxmhkdhtG+RuBivSLz0bt2Yjw9zLp33y0+q25JwFPGzH6633gL7L77/rE+goJCpKJK+JvZ+WScMO8wBalxAoqNz+hadLOLwchgl8ZuD+nKOUYWYhZAIy7eNuiGe87eEUaiQD2UvlruQDTNeE/pZDRRvAnhEOKN+nn3NlKXrfawHy8I2FdjksZE3yDaGGpx9nb55bKfUpx4277wQ6bGPZDP4oe68qKWTwnKtmcnVlqYy2Bv6seFZn4qGpsMcaZoW3JqoPxgewgm0rMKdPMxbrR92kESacvXxKhWhl8vUjB7Wuub+Pbj5KbKGrgxanz2M99JTnBxX3ZHf2xcEPapn18rhFz87qcDVb3yJ/QCcn6rt66XMvjL8clxLWqXznwAZD0FLR9kRwLxxVbXKQWI7NSMBPZ8vCSwhe+Bd5KG92ka67jPKKARvGGbc3+y7QKSqSeq/xOZ5ZqHRC/xX5SEx6QXgfHuGVQNvocp+ee1wmFabfHJ62GFRxe1EJNArKOWEdWQX3ggEcGAurO/FbDuaXqI/usA40WdIPG8X6PKD/q6e2KBuk3MyoH0vIEjM/pLRidiP1Hh995kCoWGqTNusZmpW/3wWaQbUeuwUlwxxIkAWZQeO/l9XYQy3g/IC+EBGuQAIKp8P92Zkti9C8oDhnEBD/+Y3rplPChugDzIkjcl1CNsKXnXFHIYL9ptr5Ora993LA1+mrSZwWJJhn0d8CGrqzrpUFhyG8HKEUwmthCojz/6XfTIdEyYe5+J4QL6L7NPnGh389oOsuAIRh0na7rvhwM1FUPD09NHNxBnoCbCNZZPVF9NLU0DusW5eNdQBbyCyvaQoD84BELBYkzkV6GJUbBScoiViofdoebaMt0erXX6koTzcK4OIRSMWUujjXcQhAa48db5nG/jl1jcmqByy+rGPO2xHgQVnsiojPmbpt4QHkqOQ4x8WMLbtxDQ+jsSGf5/7fl8S7VWSOl8RO+vPa0VGt7/Vc6ahmeBlUU16cgH7NWCYTzX1 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52b43212-d7fd-4d0b-85f7-08d8d3adc394 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:34.1236 (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: qq4HwmpZ5wCaOOQObABwOo/A4XBDTROnvoJ4/ZTslaCK/Y0jyQc59xyTIZZLLgDO8ZUAvgrljh4n3ktHq2iXWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 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 Reported-by: kernel test robot 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 Thu Feb 18 01:24:58 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: 384351 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281366jao; Wed, 17 Feb 2021 17:39:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx50NE9XO9z7GElloEIgkellSGxs+HrPfEbokzN/mJPNVCslOPTaKBN9X99lrRBdIUGtOdn X-Received: by 2002:a17:906:4058:: with SMTP id y24mr1683251ejj.6.1613612350171; Wed, 17 Feb 2021 17:39:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612350; cv=pass; d=google.com; s=arc-20160816; b=EpQPwPXFJg4ZSXONRhT46qeVNFlwChT/GcajrkLWSR+kAiQ1i+Duz/PcZCGZBSFOkZ b8Lcauo7kvnpIzOpmKai2OnE5UzmtcSZGpS7JtT4yFMgSpC8nAo3NIl7PNBn8bt1Rqx4 SVNPcIJeZ8Oh3FvLPUviqUlS4TzHP7f4d9ePXXbyPu2BJas5++8cbx27eZCIwTn5h+3a /ScsjeCkKFNNOSsaJvNePyfuUB5b07Co383En7hNNJxC9EYhzHLyrYX4GdaAs65pIjeB PqGhPuUTN6PU+wi2m/XEVOsLjPwVQ8oZ5jE4TeR3+ZzF2DPhfIpMdA8gik5e6e6E28Cx of0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hO1+r3GoanYoQG4pSNUPhcwcRzBSJ+js42Xn0O6ntMc=; b=Xz0Dp37kpoL0ufo/aHMC8w97JbfTVEQf2MVnZHlsFwNMJcfb4M3Itb5AEhdb8SQmmv yEJGzBiVE/bYPAeHq7UAjGvK6xvMBH1hiKqhI31Dx4K8dn1l/uoqH3OuzM3Hr0/G/A/Z 2cH5F8WocWS9gBSTsC5cXgBKBKlOnBLTGdwb9vnty+Ht9CmyWzv79G33eK+ycDMflt1z nJcsyMloW+BO2fZ4bCGinfbTKh+nsId6JUJO/Hjv0AlYTbJ+p6oh55rT806aUfRvOftG Hgr/nNu5SqamqBq7SswOAAEpoaE5F2PUOVbpHkL7JKWUHiMgJR5cb8E6LcOVBxXJoy16 lvSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ZIPJOuGJ; 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 e1si2551315eja.255.2021.02.17.17.39.10; Wed, 17 Feb 2021 17:39:10 -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=ZIPJOuGJ; 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 S230175AbhBRBid (ORCPT + 6 others); Wed, 17 Feb 2021 20:38:33 -0500 Received: from mail-eopbgr80057.outbound.protection.outlook.com ([40.107.8.57]:34274 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229876AbhBRBib (ORCPT ); Wed, 17 Feb 2021 20:38:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PoIuu/pB0bEhJJTRZAGoKW4whuA3jyysuXgK2rKv5AebGU8A2VCwAXagLW/zzpimlmpIU0YaYpr0s6knag0OzwBb8OPxh1xrkefTOWgyN4Qhf6cR6X+V7lU3fX+NkXQrc+RUqrxAi9QA+bKj1KFcVdDCOLLOsl1QvZcKA8mbGxMPyMaPZSSPBkHWeP3bYnxTJy+F8EXcKVkXE61uCkKGac2ysn9bbwD+uLm5vnJRET8pBtfXjKWVEo5Q+DCTQVz6Fkj44fdXOnPFAEpUSjQCrCTEPQhVCiYjLs29mgVZ1h9r3jpHk6y7QaP9a2wCNohFZj3s6w4wa7n670jy2tHeoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hO1+r3GoanYoQG4pSNUPhcwcRzBSJ+js42Xn0O6ntMc=; b=VO10y/XpqwZB3dea5vOSbHVJ4EmblRIG3gkAL9hmp0YZRIfWHlzirNaFiw6aOrAGFNclNmzvrFVk89WZFkdr5y92E2sO9b6sCm7rUJYfP6rTmxUQKlwhc53bYF6XC+Do2JOP0FkHqzvprzAHrUqAf18kIJWz0FwhdlhMiS7gdVoo0P6FVujkU4eqfgtIsbJw/m3hmartkfnoXqYVFt6cK0Hhn7MMVgiGbIzZXEwGNLK5U+oPMbjeARYoq7HboJ3r8/npX3O+0bN0YXQ3pLBX6Y382ohS3r3OMP2QqSuABFe5kZY6Z/U0Z+O1MZqbjId6hY6L3DNS3jXFRXjzwIrDgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hO1+r3GoanYoQG4pSNUPhcwcRzBSJ+js42Xn0O6ntMc=; b=ZIPJOuGJBYG8UV0AC3l6v1Wn3FU8WkOZKYswsJn51LZN8tjmmj0JyWnqfJGOoL1MgqsfIkyOfshROYVtoH+zMMFT1n+e8fFz6PllrbUfYdjoDu0RhHfZB9APT3s4SW9/dHHAbtmTJpQV40SFvVR9GY3qYwglt560hQWTb7g16UQ= 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 DB7PR04MB5244.eurprd04.prod.outlook.com (2603:10a6:10:21::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Thu, 18 Feb 2021 01:37:39 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:39 +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-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 V12 08/10] remoteproc: imx_rproc: support i.MX8MQ/M Date: Thu, 18 Feb 2021 09:24:58 +0800 Message-Id: <1613611500-12414-9-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 340b27a6-9d96-4760-86e6-08d8d3adc6e4 X-MS-TrafficTypeDiagnostic: DB7PR04MB5244: 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: RSGGooARJs8LeumNRYhXYbyNkSdVDzU4VC3/R0q6iN6elJy5ttXB9xO8QKpjPR1RBoSs5lCFWkJV5dfI96pEmHnwTJPGoNnAi2QqRjA9C/1OT0ZhJt0ZuGPaJRzb7Gnp0r2hKqQKKZUwoZrfxcs5HzG8jcSHS+1xhGBlV5bbmk/t1R92WQI2gF74IeE+X9pJhqi5MojILk5IEzEVR1k8/RUodrhgjitYXhMfpKSeFqUN6tYeRRYGyUQ8/lJD2hc+kiqVJeLtRRQCE31jwFD8IBo9QLoYmukazQLTCrYqgV7AtLd0zQfaZv8pOEqsbR708nrHt65VlsQJD7Qxujkghkdu2lb9uU/UgUpTuiMBWnqg/dr0YZtoi7FU72PM+zSsIXrvjBATaOYY8fn9Gd05VwE/tj3gYnSSzkHs7n9021OfBVGnsl64ZWpcfi0xCQmgnS+MLAudh1pmuHvzdJ4TZrbWvvABiLU6P6f9j8ySKUNYo8XY1+RXeeTl8e4LuXruEHfUW/R/qr7h/78YIpedfXFLYhbOx/Yw2+RUTy2wSo53vNR78/c/MPvcQlaYC8e7ScQN94EISEcoSJGC07E8yg== 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)(346002)(396003)(376002)(366004)(136003)(39860400002)(86362001)(186003)(5660300002)(16526019)(6506007)(26005)(2906002)(7416002)(83380400001)(4326008)(956004)(6666004)(52116002)(9686003)(66476007)(6512007)(66556008)(8676002)(316002)(2616005)(8936002)(6486002)(66946007)(478600001)(69590400012); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1uxQzqeIi5zzeNi+nfR/5sJc6RdfvUnZ/z2JgEoMZTF03tKvlCkWlUbGO5sOsdkPh+0A0aOAu8dvIcdZWMmN6s3t84Hk33FPrGD7EjwBcO2JLQFpUEZCrh5bqqEDKJgpoyfprfzLtfyUQq0B3iuskBaUoke+t4ltMWU6GEsM6i37FaickHIfvpdLXoKZNllSDgm6cPWVU+kOsNnwKpx3NjUWuFQ2jjA5ByJWolof+evnE7YpqCBTrhU2legAaorzx818yjPmWMHcZGZQhCdXySSIG1+YC3q7mi9iU5qF3m2y+3Yd0nezzZWOdsc74Coj4wDD6Dt73YVDA5uH5w1l0yAMNsahINf8pQbw9pN9RDCsHpFi4exvz/JhzIIPBXjsPfic5/CMv7lxNkTMr4DSpoKGYf9uAkLbew0xnwFU3U9d/GJ8AihJq8eji3eBRSNB95BU541keGNJuWsZEA7VNkfJYHPz3vHT61EUcClKr7zlQvIADx2NRY5oVR8OsLyp61det1OGYWVTw/ktFvl6T9/wVP1l905ilMysBrk4Tg0xd7iBDP2ZNTtGsfDGChRdwS/VtzsCWPaaLd2oDVhq9p+PhMg4gkKUfVzygqrZ9LTZe5rPYsy0RTwzuWgVky0bjDfGr35RoXcOEgQkmWnZpoL3BZoznU+SCo3qAvDEgRCEqihwf2oNI9NDLnp0wjljYHbQw3Iwdo+kIIBuC7fIi8yFzZGgnTUlfKH21sd26M/7hTA8qaxs8I6wGR7e1Ik7aPW/auIC4SwgkvGNjEIGPy5cT9i6kJ/2IElhwx63lW825pNV6qpIkFYCSJM/+FHrU7cymWvTH+b9pCBB52kWBYqVzJQnt8GiNc6htwaRVgK2VJySiu9wCgWCbDqWQFcgc9U077if1Kst/o7NQUleEIkv5JfetZlP/Wa0mLwpH0FILjG3w2D7S37ODyTkpJNzEpe1FhTkUJofw29KvtbXcy1JHoYOlPsDyUeaMK39UeXdENsUwkN6MU034vGWcb9Uj9nECvjOmhEOZLW+qlkw4O7CboZwbun0HbtMWWkWpw+SzR5iXcWl5t6yoB0T4PQjluKJqXR59H8N0pYYvVslqBL+F/82HS84VmoXY5Ftzw+zUsS2p3o+1Fitsk1sTaelo4PeCus0CHJ1v6dkPrT5CPKgpNlGt6A1ivdb+nQMjAfOEpxj8IzGf7VSjLHqVq9HdRTZnVu5lCJbVJz2e2ftmnBeTVcFexO1PWIhL08W3fK+a262BAY3TYRP3LbEIvSZS9TUABALDmPdXfr32O7bfXhS1cDkIaWTx1Vpjps6CVnFRsKoZ2WY+TBCZ8Vf72dO X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 340b27a6-9d96-4760-86e6-08d8d3adc6e4 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:39.4702 (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: n9dZqnEHlpB6POoVa3wpikH7FL7so6O65VsnEPFo2ZtSEBlGHZzt56RNYunqU8SMFD8uWpxk60+mpGsnOy6+Rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB5244 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Add i.MX8MQ dev/sys addr map and configuration data structure i.MX8MM share i.MX8MQ settings. Reviewed-by: Richard Zhu Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/Kconfig | 6 ++--- drivers/remoteproc/imx_rproc.c | 41 +++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 4 deletions(-) -- 2.30.0 diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 15d1574d129b..7cf3d1b40c55 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -24,11 +24,11 @@ config REMOTEPROC_CDEV It's safe to say N if you don't want to use this interface. config IMX_REMOTEPROC - tristate "IMX6/7 remoteproc support" + tristate "i.MX remoteproc support" depends on ARCH_MXC help - Say y here to support iMX's remote processors (Cortex M4 - on iMX7D) via the remote processor framework. + Say y here to support iMX's remote processors via the remote + processor framework. It's safe to say N here. diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 5ae1f5209548..0124ebf69838 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -88,6 +88,34 @@ struct imx_rproc { struct clk *clk; }; +static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { + /* dev addr , sys addr , size , flags */ + /* TCML - alias */ + { 0x00000000, 0x007e0000, 0x00020000, 0 }, + /* OCRAM_S */ + { 0x00180000, 0x00180000, 0x00008000, 0 }, + /* OCRAM */ + { 0x00900000, 0x00900000, 0x00020000, 0 }, + /* OCRAM */ + { 0x00920000, 0x00920000, 0x00020000, 0 }, + /* QSPI Code - alias */ + { 0x08000000, 0x08000000, 0x08000000, 0 }, + /* DDR (Code) - alias */ + { 0x10000000, 0x80000000, 0x0FFE0000, 0 }, + /* TCML */ + { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN }, + /* TCMU */ + { 0x20000000, 0x00800000, 0x00020000, ATT_OWN }, + /* OCRAM_S */ + { 0x20180000, 0x00180000, 0x00008000, ATT_OWN }, + /* OCRAM */ + { 0x20200000, 0x00900000, 0x00020000, ATT_OWN }, + /* OCRAM */ + { 0x20220000, 0x00920000, 0x00020000, ATT_OWN }, + /* DDR (Data) */ + { 0x40000000, 0x40000000, 0x80000000, 0 }, +}; + static const struct imx_rproc_att imx_rproc_att_imx7d[] = { /* dev addr , sys addr , size , flags */ /* OCRAM_S (M4 Boot code) - alias */ @@ -138,6 +166,15 @@ static const struct imx_rproc_att imx_rproc_att_imx6sx[] = { { 0x80000000, 0x80000000, 0x60000000, 0 }, }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { + .src_reg = IMX7D_SRC_SCR, + .src_mask = IMX7D_M4_RST_MASK, + .src_start = IMX7D_M4_START, + .src_stop = IMX7D_M4_STOP, + .att = imx_rproc_att_imx8mq, + .att_size = ARRAY_SIZE(imx_rproc_att_imx8mq), +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { .src_reg = IMX7D_SRC_SCR, .src_mask = IMX7D_M4_RST_MASK, @@ -496,6 +533,8 @@ static int imx_rproc_remove(struct platform_device *pdev) static const struct of_device_id imx_rproc_of_match[] = { { .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d }, { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx }, + { .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq }, + { .compatible = "fsl,imx8mm-cm4", .data = &imx_rproc_cfg_imx8mq }, {}, }; MODULE_DEVICE_TABLE(of, imx_rproc_of_match); @@ -512,5 +551,5 @@ static struct platform_driver imx_rproc_driver = { module_platform_driver(imx_rproc_driver); MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("IMX6SX/7D remote processor control driver"); +MODULE_DESCRIPTION("i.MX remote processor control driver"); MODULE_AUTHOR("Oleksij Rempel "); From patchwork Thu Feb 18 01:24:59 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: 384352 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281371jao; Wed, 17 Feb 2021 17:39:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYxSeZEX5faJYEC81QSnk13fTJHrqU/uTHm5DhlB7XjGLJRlcIM2HOJwpMf1JQcg3cwr+9 X-Received: by 2002:a17:907:20e3:: with SMTP id rh3mr1670182ejb.510.1613612350950; Wed, 17 Feb 2021 17:39:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612350; cv=pass; d=google.com; s=arc-20160816; b=05Rp8dekzBk+rBLjVfwhOUY74rVk4oYBkrOEePwb4tECer/37be2ueLzU5DF4AZHbj H0kNdIs2kZJM5P0UPZkLmt/eKc1IMJcXH9uKSdlpJCKEZxqodfqAZap5GbA16M+nfbxL jUyHiRFSCmgNwmSDXaY2LaxV1JrPS5CxlKBgEqL11LQeoFCg2KN1EXm11a41XewiMtIa Qg8EWtvL7zn3U18hUoZeZ0MPaM4BlhOAhNeXkykvK3GALDe9ircU78vs5k0ewXh8HryF kQAzf5WHVaNfXrrdgmzveIbjeMV+BYTVm9j289T/z2+7c5S6eTHHwSanJrsUemD/XEJ2 e0TQ== 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=HWSLW7fDiu1K2wcjlTiQI5E2HsDD0/68pnXmEJoyRDQY31ix8TshxyZUftYtYDgyng Q3Q4f0WdLW81GwPVJPIX7DA9yJG/eZ3h9w6jUzxM27T62rnIJVLcW+Zjohd9kKx0xLlz aH7P//FToU2dfo+Amn16GSsViABlEJ4PEvs5fAdX0rKCPheWttmEWJot7A1sefSw7p+2 mle2JVdOlQScp/Bn/U+VEAdkfhrHJsgkvBzC5JNsr0JPWV5QUzzvV7Y0gTB1oOYh0t0R l3hDsTq7txCG28+jqbNiItC6joYIUIdBJnoPp8LEYGs0hZOfj8RZzyZWLWKE7Z/rrdvo exOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=FxLXxP98; 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 e1si2551315eja.255.2021.02.17.17.39.10; Wed, 17 Feb 2021 17:39:10 -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=FxLXxP98; 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 S230200AbhBRBih (ORCPT + 6 others); Wed, 17 Feb 2021 20:38:37 -0500 Received: from mail-db8eur05on2047.outbound.protection.outlook.com ([40.107.20.47]:41185 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230019AbhBRBif (ORCPT ); Wed, 17 Feb 2021 20:38:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CuyftZe+2uauT32GTpxenzy/ETOwRnbuSGQ/22zui8KJb7LwMzVDZvJX+5NdTehha3x+KJE+yAaHJrD0xemWEGBFf4ZAnAsyokJ+q0VDNaudGnd4Az1kkfhJ+TT3QR7aL8vF85IB7nSQlWsstO2Pqyg47EqvpGb+X+nU6/VUTROYkhFqxmbkeArsKkkBlj6zKiMrCMAD1/7PnbqHaMHeMXmpuSNytgp5H7J9PW3FIyYyQStf0moVSLHwQlhHjmj8pGf7p9CggbkA4XR8kUeVo0LlcYx+HfmsDVkT02LciWhEjKcNXIT4llu14VMNItJNFo+NXDAB0MSnnFy5EdMLFg== 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=cx5vOXraxJctV6RwfDqOo/x0yg6ygE98uSmLbg5HnGzO/TcRJ7RzDOuSJu45kALtMFxxmwlyqFhDKIxBzEwhq9TCHbdcNspIp2R7j08HUusMSzvwpmT16/+jzyqWBTDRg6CN9tUNhzBd+JF4t3TTKGC6XR53mf6Rdd3UaCL0Hl6Nucsy5ZagQQAX7duyE/ctCkKI0L49ST1uIBqlz2JuHRxw7/q6GzmqOnRSI2lD6kZcljpIYpibMl+KHOaDuO46Rg+U117p9kmATXYk+TjortQpTapet5+wLQjABakTERtI7B+poOoyYEMwom0nN/vOBhw/yQO8/g8AOodm2KFRpw== 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=FxLXxP988GRVxaH8U3LftDZISzA8utbUm5EJSgTkZuTtm9Pi5sWcRmRzJ9vMjBsJGM66zZfHwsPX2+B53LMKPuIERnJkay6o6e9zCieXvO3hvqxycU7Mt5F1DnKnvHsIdXENq6fFFsHj6u44TLJKV1s9Ud01AAV6fg3sYTUw3QU= 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 DB7PR04MB4092.eurprd04.prod.outlook.com (2603:10a6:5:27::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26; Thu, 18 Feb 2021 01:37:45 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:45 +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-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 V12 09/10] remoteproc: imx_rproc: ignore mapping vdev regions Date: Thu, 18 Feb 2021 09:24:59 +0800 Message-Id: <1613611500-12414-10-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 64b8c733-b283-481b-e7e1-08d8d3adca23 X-MS-TrafficTypeDiagnostic: DB7PR04MB4092: 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: Uo0eMEwI7wwE+53koG2VRRUXmaJBCvgpz9yBf8uz7T3fLT+bn6SlHlt+WJW/CiMJmfJa+luEB41nEnYOUbwW/3UnIUX4tehBSk6umEBNnMb9Rm4i72lS3POnwHW0KT5MKj46UB5eTAl7bc9n4+XhrQbLDGQmq1S+Vz38/TwuV3QM+F1meXqhvQmVN2d+Bd+inQ9rcweJ+UGOhCfQO+HHBHzrHXYhizG4IcLfv+vPK+35GIgK4tL3eK+Ppqwe2rhl5fX/QJvLF8HKrHmQwedG06zKtStOiiGxJfJQVXz+s8ufUgkXIXVIi+/DjjhYDV2HkW+uQXycKT5MbJilBSJ1TSBBHLUInkF10ladpU+aK5JnFFE6YHrYds1iLc4wk4oZfrXcKe+o4yCfa/pcsPzG7XuXEcDePY2cVfwLIv3qBWrlBWdllcRSohXUhEvBlnaTY50LMGBQkDjC9xoyySwvyPhDiNHYMbZsLu9PKTi8FUCIsohZH0m/RdIkWtoWR/RikAerr/RWCUZ8TVWg0q/invvJ4lsKAX7lmxr8A2ZJhCzYRFHosMuUnu+kAtpVX2MZ2BS3RjUWQ03/CE5IFkZtnw== 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(8936002)(2616005)(6486002)(4326008)(52116002)(956004)(8676002)(316002)(4744005)(6666004)(26005)(86362001)(6506007)(5660300002)(66556008)(186003)(6512007)(2906002)(7416002)(69590400012)(9686003)(66476007)(66946007)(478600001)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xeXKBxeZ+jvPYUV8BG7e/HLw9CX56eavJNEfkP/3b1kVpLysd76AJf8PJBnjvry1qhsdjVmcQqsKFPI5gNqJw4kFItSY6JnRGeNEAU8S6mjO4HDrIvuSbU3WevcAsQbrBDuSkuYJvlX1m+OnNdxV47LSMH/gUpEYzjq4vniYiK2cpsLKtDqOsulw6jGGsveJDG2irY9PJKA+k89F+96L8sfIl9pRs1pm6kM8AWdVj+t4/yGiClRyjrOXQYfrq8AQA8sOHcq2qStXyIDK3XR589im8YGyo3GT9eXTglY2uPrtMWbQXtR80V+qM8ULXKxNI8UZVDFBRCKc1bCKcUur1Hew8rimWaPvBC4+zeHb2M8c2zovMjCFcPswFYXXV4CcG1O9qcudyQIaaoUhFcpQbXOCLGrQQAIDDP4zg4elJvRDMXK3hm7nYklWEKSrwSn17OJhY5A0psmGvey2zb+qetKQ4v+bFh1yTGYxM7K8Z1nbrL1pBtasHX1SE/9Nb00B+WCKvHm4brKYSB73PdlUx3y1j+/BHdEykT6Q0IYon6Wp4Dtk9lU1siAW+TKNA7r6uy9pZtuw9RXANUnhuv7NZW5x2fqBNLxM35hpyRB0YktEaFRlxLtJFyuw7rZU7vZMsxCCCLPH+pYyrKkUQed+PP6nWfsAIc0vfqotSK0nc0YnO/SQLmhO1T8BaHv9JdGe7jAmDOvb9r/hC9StU5o0XKIP3prJtPGB4AperVuHYJurk51J2gyxgwhP21hz4NFPgtbFFljFivw5AFtUgxjdAehh9T+n4EPtHQa/jaGyQ95IkSGwAXZNkydCwB0ArhXXl5H71lsfrHZ2zErk506nzFEbilaWEeCiWYtkaIChE7Bs4fwWnWdddQIT/5MQUt4s8yf+OOli9xeo+iHyVwAXzsNh0UR8oNKv2MmlgSUPwmYn+OgI/wC1BOuKqowTjDsQ6dUfeFQ1/ccA7Kf4BZ0YO6+I04Ea3kQVdV9CvHgo1eyqAkLdvExVTtF5xFzwSl/bki8UNW1TeJjJwMGG5lFlps+dy7b9bAA44NLYqur2AgQ6nE+sGuzhm38k6fBFRiGrF7lml0vAO7u2CMtOvMAQ4e3mpX+xsZoN573oOY8bFsI2wpfQrYXxCqPRD9Q1/IVnz+8L1POjZYnUkqINRq/ApxGNs5vZ6UnfciyWB5SSv5yJiI49GnRflUK0TipwD9B0vOxq0LIb6gBX0qcpHC+oRJxcYrGf6Gr8JtKMAnOUB3SpIah7wR9Ph6eQdOZyd0Gu/b/j5+g+PFT0S3WAT7NFRfk2y7+xXha6vXOwtGEXqt2T5x8s0nEJHvyETkIAAwMy X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64b8c733-b283-481b-e7e1-08d8d3adca23 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:45.0477 (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: XNNTR4D2+qtbyGnPxeNwpgm93ubl5vI4pN67QotVNVv1mszU8/5X1CHWUYwIvzW030613s2QNyYIbQWwkUCSgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4092 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 Thu Feb 18 01:25:00 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: 384356 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3281558jao; Wed, 17 Feb 2021 17:39:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaJWURf4m+hOVaHTpKwow3ptJE/rIdbZvIoGE5C0XR+bIlVF0vEqul9iK9RQXjanXmqGl/ X-Received: by 2002:aa7:c308:: with SMTP id l8mr1591037edq.366.1613612376435; Wed, 17 Feb 2021 17:39:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613612376; cv=pass; d=google.com; s=arc-20160816; b=A419XKjme1gnUJVREUJWqWpHCVIHHZ6WLS57P4Xn6VkZVwdNwEl36W1SNbVZDzN6lz HDxVtsnWvfZkQAEhfYNaAyuA1kRVXBklhIMZoAhFZTc9PosncnBp9DbowOvfjZw/PBog ancaPe4VmNZ97rDUg4B9mAnG4taU8v2IqeIzXE8xdTQJWofvf+J77F8Kbl0nXryvkkYg Gd4NGjngYTKGXd3luJbcJdnmzLYp67hEWX+y+LHVJ4mQPrl1LVFIeCN1VOCQvpXO39H0 H+vemwX6p2H4TreSxrCnUVZZVFdWFeBN/OGOO83AtUjrAOq/Ekx+9yajNeMTyPB8zMbE 9LZw== 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=UetsMGkiYX97zNS26m257pEPLh2+6xrKzSh5F8JxyZC3MmIOmQADhfwHQN5Bie0VG5 fW28NpLVIHfRVIT7VyVYVY9Ue0ihUocgN8IA6yyBJqrZFgy9A5CyJAarI+HX0q/3iBHg dbs3nln3JqtuWCdZItZXcjninfBdPmviGcQRpuvmRnSlHMEhhJXqL9/qBrlgVtlFVpBy NFKKcLRRW0yNj7bSlARFlI5KaGP6FrYOczvzeGa817m8b6Qc/NSqZ6h8z+YijdqsAPLg upWr/nvSJeviL53sfZ2Y2kynd0UgN0XQkQtr1K4JcztUfT9L5vmV7spzwS96h6b9UTMy MAnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Qvm1non5; 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 e1si2551315eja.255.2021.02.17.17.39.36; Wed, 17 Feb 2021 17:39: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=Qvm1non5; 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 S229828AbhBRBj3 (ORCPT + 6 others); Wed, 17 Feb 2021 20:39:29 -0500 Received: from mail-db8eur05on2046.outbound.protection.outlook.com ([40.107.20.46]:35360 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229746AbhBRBjL (ORCPT ); Wed, 17 Feb 2021 20:39:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eGQZeGEcVejJ2F797zpdSEgmnOFP2u3ZdG27GCzbiPzsgyzfgpAY5WWCCyqbPdOy9K5cEamGhshnDaWi/0ROj83kDUpeyXb6yfMVdZXVGRYqFaRMcKnMSf+yVjEWbfMwyidXTzk8/Z31If/ulnqea5TqU0h/8EmMwrQKcbEyDexGAlSMfO4RTmSGQ1QgTE+8y3DqirvU9x2t7NYjlGbOQyAq7CwwFx0SXcnaPCQZoXAwr5Pwpy5t6q3BfWOE64jNN3PfqNsrHeCS9SzFdvyUkqkH/+8OIs3XBMuCFk027G6bf9AKAlxLmo75dIbmziC4s08aKbHM5RukXeDrXl2OVQ== 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=faZvQtjypK6UqUOuEIb2rpcXkSRQWAud8F4ZEhdxuVl+UEdBFp0JOFuMux88aM7ZG26TMcstv/9VYdyDf6RzBvCoyZWhn6yF50iS1qaG92MYqAomxQbj+HP5310PauVIGMAqDRmRlK6IR45nAfkHnXkdq4G3bysb5XnaUt8ZNMMvLu5tFk4JmqCB+VfFVD3BQwKBq2Ih8+6nzAxYxB2gqwn9Lp1nh6fYhWdiv6lN/0L/+SaSwRGFnu1BselZu1iCP2x+9Q0lMjMvTDxkkVTblz/hLmQ9eqAB9PVm+OFga+69idge87BMJaH75z/f/Cy85dXHDSZC5WM/8AtnDkCT2w== 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=Qvm1non56OzonCjtQjC7LZVeG5JSItFUc5X59RBETZkfBLgILKcib1QBQ7MUfFzEH+FZtuTCPgtUGEqaOMgiTDry6gEn6bkmgajVH1GYh6uoLoxevVNihRk9jR5jnDyPAQto7gatiTu4lP/yvuaxuKv4f9NGa+Ha6qw40LC6tE0= 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 DB7PR04MB4092.eurprd04.prod.outlook.com (2603:10a6:5:27::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26; Thu, 18 Feb 2021 01:37:50 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 01:37:50 +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-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 V12 10/10] remoteproc: imx_proc: enable virtio/mailbox Date: Thu, 18 Feb 2021 09:25:00 +0800 Message-Id: <1613611500-12414-11-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> References: <1613611500-12414-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) 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 SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 01:37:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4818b812-7667-4537-3ea9-08d8d3adcd8b X-MS-TrafficTypeDiagnostic: DB7PR04MB4092: 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: 5S9sVAajX4/338Mud7QU8GiZZkbwP3E+EIXftul6pcPxtQQ2DLjQvxepGSWlEJxH6aKBG5zKnE92lMc70MtBlu96JCN6dhpKmM9CmvbH4u5EA8dXcV4222rCc3H55wmizqDIGbMmCoel/DVf2uuN600knCf2x2SB2OVK1pzNJ5xovRGW05Ewg2lBnMejP60rRL8mnDphm+/3h0NBGPVpuDb4/lVyqCitll8vn620iSdkErjV2F7Ro9nfbNdJYI62w1K/83xIeL3BSjF6RHOQm5RPIObRGzZqA12uAmPL/n7WU4B70prdclh7GFzXT9WiAbR3Ih6WbIkDm1jBJZe4wRRl9oUzGPuQ2gNCBv8oKVVirq9KWEw/GcoJEKijmixM/Ow9RCBpL2lqK2ivMzu9kiOlVcPWaySN6potJ+C/tm6vvARbz6LJg0uHdtVQPGRwEq3FgrK+9RIP+37xqfMUDpC1YOx/rQhEc9hNqTCReIMfrkSZ3x0rAnfkz8yQTN3QD8KPIvC3DjwX7oHHHK2X80qhhl5cdvSlkbhSfO6xnNIsjmGam9tildBpxKqbzybObZrOb8XJm9M7NJCjRb9H8Q== 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(8936002)(2616005)(6486002)(4326008)(52116002)(956004)(8676002)(316002)(6666004)(26005)(86362001)(6506007)(5660300002)(66556008)(186003)(6512007)(2906002)(7416002)(15650500001)(69590400012)(9686003)(66476007)(83380400001)(66946007)(478600001)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MheuhFHAvYs0iqUiM40Q7aT2ig6mvWwgpx/R0VHcNheI1RANbwqnx34ahoOUScs869OQGNuYZP450EODbbDJikZGB88gNfSChOj1gv8djfkY9LvVCqcVLMpM/IDmavwcblS1R8H6xwxz4vBAA23LOuFP8QazfIih1EsQojBpPhy53rAgNN8zRXMQL0K8awI8uWBsW9M9nnEG5k4wO4ypaQLpeFFjeNjsFHeNzI1/u5c8/cAq41bIRA1vuHPx1hmCQXJXTWfnU+LONDi/rGUDOE6HQV2UwlUXzaxqKVO+ikxyt5RCfMFlR7bsawqNM3gSPdVHMxYxOAIT6ErLlrwVGJPDwA1tDNx243OyaN2ZEQIg4c8SROirCysgm39Q2NYSev4fUfGyr4B9fRWZSD7oxmK7zjh+ta5IdAPbYqMJO3Axv5YXTnkFPzE7SuZXtwwOWYCxiDnHiaqdCUJmGhpp8h3MRpmlTiuH85u4RZNSayGJmFE1o4AGy3n9itEtA3FLiYIFNuxXTd2xWMwz3y0walNjulvKF1RXyu+BqbsO5dAE5pxmcEjWBL5leqUyZ3DWrfIdgeuNLuUwmblbDzr70Z9u5+Ixocmdu6ZoZcsSuFYKZ/WiR8WofLX7kHQXrRe/NNM6bweA1zhTNMjVazk5ByPPotiuTLjN17QBOsYAP3n2QWVQ6YjrC0vBtEKRnFOjsUEayuRQ/q4SYGz+83sJsoJskNC5facQwoV9xJCl8gNkan3OELzO2TgcGbVsNmfE4DzlP7LZ65fmwUe6NkhxHO04Wp07jQ74MUL41er8kSFwQnjgCO8D9+RKuiMBUjgsoxMlbDwVSmRdw1r/koHNEraWKSFa4I2Ob3GSUJm0fDpacY3qSN8TdmlU0vwIE6EPm/NwB2biY+YOUj4wS/cl+keNgcL2C3a76MzSWvXgXQKQ02h3EGBF0X1KlVN/35Q+3FkZYc2IC2Zuw2iEjyDxg1c3B9CGXo5/mfbdm7EMco4gtB/h8M79Gssco1ZzSwV54cBaLW/0CoMSwdOzJJHbvMN7KJ0/1x0MAgyKVFP0xp21XTtYE32KnmpNDQ1WIhRvcg/qSqxZMic5kOAVkrc0REjOvBzRxUNtE8Y6SCwJ8vZyiLtryjgl0lstP3+DdKhk/Mq7uD8DHBJT+Wks+b+WQTteJPMyO1a4NYm7O0HZv/9gW8U3aw6oTeCHu43EotnYMxVcfkuPFYQA/V/shxB03JO293iiqFNHWhS346wq/YrvotD3SPVRbenEqPIXuUDYNY6ZGbwNgXUJDnz/U9L7m/ruaPLCxVUve9XVyeEkouE78IV0Yc+F2EXXR0vV7/Ah X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4818b812-7667-4537-3ea9-08d8d3adcd8b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 01:37:50.6801 (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: pLX5jqrCYELHPDr6ibKEMHT8IziptBeMclmqc1elvMbRie3dcXVXFJQ/FwgLIarys+B6zSVUEdbGjmunfFAZHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4092 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;