From patchwork Tue Jul 28 09:31:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11688759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD66E1392 for ; Tue, 28 Jul 2020 09:37:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5BF720786 for ; Tue, 28 Jul 2020 09:37:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Q7wkr8wg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="n5aSzQBc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5BF720786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bUZE3iyo/si2FYxCi5WH6o96Y/A2DnZtzmHglZcHClk=; b=Q7wkr8wge5XipDJJLrPlFRKt5 lct34BeAamBWx406n4LoGACLidrtlyOwpZxnCub9c/vEGIBVBqh+sx2b4IDspq2P4MMWzqT18oHlk svD51NPDVph8e7qM0Ihzb3QeE4wHuB4nONKOYSHIXQ44R/qlGYIkp9j0WaaksN/e8gbjlrBplbBPC AgzUdLLDFCt76XKzzsu5mfLI6hSzPWNSYyxN/DwWcMaVPjigeq1t1UBqHrF0ya55XB2+8uiojHvJ7 Jx4olMvKdMMtYYgb2H0nOjH8882eD76L4gIJLisx1aem2b8ejaB50RiSjrWORDFMCNVvZgCwQEFQT +eUoy/b+A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0M1R-0001Kn-Ki; Tue, 28 Jul 2020 09:35:45 +0000 Received: from mail-db8eur05on2088.outbound.protection.outlook.com ([40.107.20.88] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0M1P-0001Ju-0U for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2020 09:35:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbKOF96lEbto9MHxmKfxjHddB1Nh2icbeJgCFNeVMddcfJGbEbdeDAT3evsih902WqW/8MobLKBqMn7Ko4/weEEeqPolYE+GJYyQ1A7x+CFjDcVoQDdG9SoSj8s+1rw88urlcnJsmDGCyFKgaNbPmYV10Jmftaem+H2Uto6jed118SIL6PcTt6AiKgUYBPJU1oCSb8u/2S0NWnJiUNbDygQ0JQNc0u9uoC/EblkIeFneOt8W0wouc3DNFS2+YT+3puJ6nwBi6xdhi3eVUunr4qKlZDWfL/MMe6YAGtphLFfDCBK7VxXN9is1KFU88x+1BoYdHiTkR8e506ycv9n+4A== 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=I28++d/kQ6HtgnqycqPFfPKEZZMNQRsSCBdMR+bXF/s=; b=TMx1X2VNRD8Z85Yh6pcRBcok/hY309BvHnNVWEFY+UcFR/L6h0CIdmN332Ya0fpQfgE+E81wMpFyiXnMuD1ZQHo/DeWPU++5u/GlFniDliHCMFfB9ksmb2nPrsTMSOdvX+AbzLmENpVKffplYXyjlK3nOeUIHMBH2Zrxfb89rGGTXKeNIeXtD92FbMhSRuEgrzw/t8KrpGFywHzcoqPRp3zx6ulaSj9VJIxaLBc3MtMENFfr8olBg8kCYYneNJY7fnETok99CH4q0MYCmHJfR8dJOKuVpCrK2bNJDcRYR/JQP6yrB+D0AmTiocrff61szMjT52XlHAC5MTP6QoMLlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I28++d/kQ6HtgnqycqPFfPKEZZMNQRsSCBdMR+bXF/s=; b=n5aSzQBcOnljEaSj5fo/fuxjQmN58GZtk3Xv8RXPZt9rGbLDxkftNCICKSpY0zAxyYNzO4BVtdgqCGWEnvBYfVkLvXKFXl4uwXkoAPYedk2gZHnFMM0yjyogy+/1fLzC2hWd2xB4YeyMZzU5pMlVz+1v9MjxH6KIry0WpNMZo0s= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4490.eurprd04.prod.outlook.com (2603:10a6:5:36::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Tue, 28 Jul 2020 09:35:41 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.033; Tue, 28 Jul 2020 09:35:41 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 2/2] remoteproc: imx_rproc: add elf memory hooks Date: Tue, 28 Jul 2020 17:31:13 +0800 Message-Id: <1595928673-26306-2-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595928673-26306-1-git-send-email-peng.fan@nxp.com> References: <1595928673-26306-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0101.apcprd06.prod.outlook.com (2603:1096:3:14::27) 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.67) by SG2PR06CA0101.apcprd06.prod.outlook.com (2603:1096:3:14::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3216.23 via Frontend Transport; Tue, 28 Jul 2020 09:35:36 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2d18deb4-55f0-4b64-bb96-08d832d9979a X-MS-TrafficTypeDiagnostic: DB7PR04MB4490: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:348; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AACMjDK2BuVxR6fq67wedTWb5GOXmpUNrmuLDbvT3pixcztQEZDDJKtf+1Ue5fVUgokBrl/UvNrDGd1J19HUJE1FkBQIH0AlfwWnD+Kd+qmmDC/m1Y23scPN7dKBUX8LFsJfq2o2h390JPGP8/lfKYTDzMP5RNBIvar8Tu8YBloX6ALvjxO2GKXI51P2oF1/J9qOY16Tx6uEG0WUswNg/4+NSYC8Azd4iiRAQ2H2465iZB9yAtGdFLMnIx9OXfJYQxjaHLxSyVEDWCi+K5VhsxkrueI+JVrwrGAFlBfFVUNpj1Y/4yYuzwXzZvs9ptmEUPtL57pkd33+g76WHUfqjkqQBs9APx9HEJv9qUg3OhcHnPdPR4QABziBInvWNe9Q 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; SFTY:; SFS:(4636009)(136003)(376002)(346002)(366004)(396003)(39860400002)(186003)(956004)(478600001)(6666004)(16526019)(2616005)(36756003)(6486002)(5660300002)(4326008)(316002)(52116002)(6506007)(7416002)(26005)(8676002)(2906002)(86362001)(8936002)(69590400007)(9686003)(6512007)(66556008)(66476007)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: FKULCu848pTT5baHpB2XPZqkvloklp8SVBfObhvxbP1U+cSMwVWg/2LRj5Wfuiqey2kGBKKYEmp2cmnxfkmDKv7kHxQU3xdIm1fYMmO67AMTeFfBO3nAdqgLsI4B25QYqEbndG1PrcmIOd68VjjhvA6qPxsLFEhktgGa7BizoniQxOdHMshfWe7BnmeDIwxBY2OVfIYbCdg/HFgOHdWe+NhLcYKGObZSQjqYqfOlQIdt8C3CJO0OE5xa5pLJlhWRCbJQXe6/nx+jZKk2aCHEAhLzaVEsTISEsKK2PcXSvL6Mtdjt59RRqivaH1+4XhUuoih6pSrzlLoC50LBLm9V+CeqZ2aC1D6TU1YqqhXqNJCGoYYwrt3gkAj8568oSR13hPT/qkmF+DCrFwADTlsj89lnb6lYPB5iic/SsUrsUFTFB/9EhO2mHyhJGiPj4f9bES3VuTQ9Knv8MpwXUlHvD2rncEV/mATKJRjFyztB2DRhZNw6owTmpRxUAsgqcw5L X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d18deb4-55f0-4b64-bb96-08d832d9979a X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2020 09:35:40.9665 (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: SvEzKLztdjVfqIbdON0tDAYwX/bHKb+1TYUywUjtB39JD6pi3QeYQFFtIq8yWei5Bd19Cra2t6/VChKxIXczWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4490 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200728_053543_122192_6178FAA9 X-CRM114-Status: GOOD ( 13.76 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [40.107.20.88 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.20.88 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , linux-remoteproc@vger.kernel.org, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Please not apply 2/2 for now, this 2/2 has not gone through test on all i.MX8 platforms. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 8957ed271d20..8ad860c65256 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -241,10 +242,22 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) return va; } +static void *imx_rproc_memcpy(struct rproc *rproc, void *dest, const void *src, size_t count) +{ + memcpy_toio((void * __iomem)dest, src, count); +} + +static void *imx_rproc_memset(struct rproc *rproc, void *s, int c, size_t count) +{ + memset_io((void * __iomem)s, c, count); +} + static const struct rproc_ops imx_rproc_ops = { .start = imx_rproc_start, .stop = imx_rproc_stop, .da_to_va = imx_rproc_da_to_va, + .memset = imx_rproc_memset, + .memcpy = imx_rproc_memcpy, }; static int imx_rproc_addr_init(struct imx_rproc *priv,