From patchwork Mon Dec 21 10:06:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2563C433E6 for ; Mon, 21 Dec 2020 09:39:52 +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 8149122CA2 for ; Mon, 21 Dec 2020 09:39:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8149122CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=zaxJsSm3bi7rbY0f1cdKDsrBidtotdlBVICsBP4bjiU=; b=svLEKaA4uVDWHLAJcLeS3wR2c IwXQA9K9BtmtKpvcUzg0crfLeTWzDlADYvY2pry31iYGhL6X5Is6RE9Eo0P/NQWUAvKXdNYfER6aV ZD7wyqTqpUuTrsenLTkAKkO6l9axLmFtlKQl36P17/zvSrrckxv6KoSJI9S00DxQb8qaVoJbAp/y9 nuz/FsRrsS/jn9cK0OrFE+ctJsYRW1bq3qzGBLpiy+FFY9LKFBDNS6+oFblSMXg1hxv7te8/NxutH 8LoUhtP9JEKx2JokTQUefpBRkZ4bW2eZ2wXA8dkGotU5ZEn6ehRMr9mte/KVEWC0h4C15mMv6DZNS tDTeqYSFw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHe2-0005yb-Ak; Mon, 21 Dec 2020 09:38:22 +0000 Received: from mail-eopbgr40076.outbound.protection.outlook.com ([40.107.4.76] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHdz-0005y5-Ir for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Twzqf6DyZ/D1UyvH2cX9E0VSRnGuzd+fOzR2YxYXBptgDvTxiiOSFCIYpkxFDMyuvO+/iEs6rQcLos9jONWpVdHvBMCAyE8V7vIKXVxhqe/1FKRYStGTixY8XIVTHIehhcs19n5WHtvJsoqtuAeZ1bY6/5iXRXA+iiDx/77RsaXN7OHPFmPlJnmU3ZI/J5tCBs3oQ7IJ21f1XGuDk7RhbldIgZ96fpMccxUMYeTRZ8QAPczkzXzQ5m2Cslxhl+fP+EJnGm3Vf7kau7lfSs/3t/YRsx4YmPbvCQSX6b0ugSc0Voj70PXCKvjZXxIuLF5FDFTWdAvM3rb9QxpHf0xSWg== 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=Cd0i7N9PBSSbRfqnT60wRNuEFfxb/oykZGmixpw3i6k=; b=Jn0hj63/zo2bS++bSs8/T+8NK39WE96BnK88NhnBKJWJfd5yGSOaWhvV9aEbGgKGjsOEEOuypPXlsdjTWn1c0Eh3QW2n+eNdgfpIJ1hUlBlUVShYo7D9oB/ZPWOjin6Ti4mNfYqXt7wG7yOqlw25MMBLUiz/b0/0TF0IvcaAdjP2JN83gMzwFvNNQiedYHYL0GyAuvUzNotBdGIMk0nAUnJ/nuG+gJ+J4qxecsTT7fEsDoT8dZujVwRS3EKvAb096LpeYR7V+ogsxoZSUzxjeV4rAaUsqGthF/gj6hnsW4rhgb7A0WAVkdlqZGTkPEt8X1A7UXoDNDe04BNehN5/og== 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=Cd0i7N9PBSSbRfqnT60wRNuEFfxb/oykZGmixpw3i6k=; b=J7wO9M23OqzkXMsAfkLAC6pn8+gWSBumqAYmDhN+qcvJfFXKXiS3ysd0fE54vpR2DSFLlkghPNC4ARLi8bPdsZvEW1NfgFE8/T7Q5q9mgOHBzN1nYu1jQ8+PxmkWsVkkwVOHfN+ajouqXUj0I37CB2S+4pJWKNJb1DLwv+8ywhQ= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:17 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:17 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 1/8] remoteproc: introduce is_iomem to rproc_mem_entry Date: Mon, 21 Dec 2020 18:06:25 +0800 Message-Id: <20201221100632.7197-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9acb4218-8891-43f8-8b25-08d8a5942564 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: TDDSrQsbJ6bpKrIq9MqfM76kZXZNtYI8DC2M8W/r0ToUVO+mygl6Z7SDXCXOkvHpsWkSiLMjyYnLNVtI+VNQi6+MG/2ICnTsCrOqJjUAtUGZLCqaJ6Ac3NKNAAPBUtFi1SMYrEZhKOotHtBtYCBO2zyZPPnE0w4VQxp8yK2JSr0iiXFjzuviT6duXCt0sqB0y7zetjxxOyQromW7hkIxDUedMMtpgOJK64AxNSHNRAkFRC9PbGX/UOK1CPzvaFU0dmNGfUYn20oN+17fcT4Yw2+dSozpCc14gP7l9YJ9m8uhtgxUkvxCBIAuAr3+BaDRG6WMVLKvLigCsXM+WipO6NUkJLdpvh8FrE8NmCvR6iDaI1N2fj0uYqcy4PAd2J0js4emgF6GcoBvzmxqCbxBhQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(8936002)(6506007)(4744005)(6512007)(6666004)(26005)(316002)(956004)(186003)(86362001)(1076003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: z8H/96dRyM1+l5T7sZBYAkSLj4R0qDkaiDaT/lkWRizHnkKWDYVee7a2tAyGXKNIyygiE2i/3CkiRbV0BRg2/BLUMDVJNRqzxsiWEcyg3W1eIhlEWpAfT4hqvE9QzsRsFhqE16m2/tsSFmxFxc1+a4Nh7SDow1Lmf+thkYDK4daoVF9bR0mJezYZVHyMUyst4tPt1A0fPEURkGzHo0b5zbPaQft7bol84sFi0/JV+ubK1tVofeCy2u/T2ZCsXmvqn8MetfzNOsajHs5rcinsfdHFVLz/Gn9SAnOMi97tcet04YEh8srRlQHVETHypH60XHeWRONO+h7MSXyQAAoVHVLS74oLONau4+gp4QkpLCyqWmnNj5UuIcA0J0RWewHpggYcnDo6fpek4a4/b6Tot8ynTtKeiwFFZQOBgbY1xoV7xYJ5XaRyRWlQiyE8WJ/bMnQoxZiMHPA3itW+9AiuQJ6OuR7UoqzELnRkwsWG7k5W1h2M6xrqgE/KJiD/4VfPHOp/OrduaX1HTiL+Ok42pcedSNWo74b6/BMyPt2stUxcTd2oHpZro7/DewjUsHOc+hSjuNVEMzoYZR/KcmkHgaXiSFKP2vGmcoezqN/ZHzrYX0yDrlqpUdy6sSMXtXmk7PpfyU1kX4hmEarM/5C8Dm25MwOLEnz1ZGowzI1ct0mqUM5LLdrBp+WuqS/YuY8btYIaaWtFzAf8kvalJ+83EzlfscYE8CLLrOYRN4fQqT8ycHub7aSbmPrTFekTvo55C5KY3gcuPC1IpZIJ/UfTRms0l5FcE3ilW2fmDr5OEbfwS/6FL+mFtrRT+xPCUp/MiiKhE3gOU+BWt4cIdwqVkC6F9glUOq7TuTx3FUHI4p4VLvST5XroOzhB2pbPcA+moFfKqBjDAbcauu7Uu5cJxFZsdLkOXBNXCqpS4sCEW36ozwS7BPmn+z/56g7tL30KdUfnPL5b2VTL64S8I5gT2TEcPLL39rnevbRw2ij6hkzfI3IjJgCyjTkDYkBZLzhn X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:17.3244 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 9acb4218-8891-43f8-8b25-08d8a5942564 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FIAz/nfRdAOTkcpX2nNEznT64q2ZKoXSaixu2CHabCNMGYiYEUD6M9VEcgxy+To4QkztR4cSN3EPQRNlK3vx6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043819_742326_BFFEC0C5 X-CRM114-Status: GOOD ( 10.25 ) 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 , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan Introduce is_iomem to indicate this piece memory is iomem or not. Signed-off-by: Peng Fan Reviewed-by: Bjorn Andersson --- V4: New patch include/linux/remoteproc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index f28ee75d1005..a5f6d2d9cde2 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -315,6 +315,7 @@ struct rproc; /** * struct rproc_mem_entry - memory entry descriptor * @va: virtual address + * @is_iomem: io memory * @dma: dma address * @len: length, in bytes * @da: device address @@ -329,6 +330,7 @@ struct rproc; */ struct rproc_mem_entry { void *va; + bool is_iomem; dma_addr_t dma; size_t len; u32 da; From patchwork Mon Dec 21 10:06:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48602C433E0 for ; Mon, 21 Dec 2020 09:40:00 +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 F0B7F22CA2 for ; Mon, 21 Dec 2020 09:39:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0B7F22CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=Cy0r/s/LzjBAD+DOInhO/JuAbH4FyvJEoRSCUMt9XFI=; b=CfiibjdsNTvDC/SkirEw/pAdc nnFgrs55rPpVPfOAbuzzE28ryMxEYDRYzkATsNLGGRn04p+wpBxK7LN5aqC6619ygqUHPxXD24aqM DA4v/1Y1tWgYEvk2PsWpyhz9Oj5c4ROHaC7gFYuzSgwYhgAjpFzgVYmF//sA+XlyIdy1o1RUaZ9ym YZT9wLL4+dUhK+xH+jCBQQEmxaj1g9r90a5h7jyLwVnjEagTGKYmJwoUXNIhDZ5dLy5VihD/W2ydz kB14NTS6zCrYzIz2iI8BiorlFIpvlwmweSL8sjmwaSAQqPzIiu1ewMyx3BOEnqiwNOLdet3qNxExU UF9SivulQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeA-0005zS-0Z; Mon, 21 Dec 2020 09:38:30 +0000 Received: from mail-eopbgr40078.outbound.protection.outlook.com ([40.107.4.78] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHe6-0005yp-EL for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ToXlMF7jYFaI7twmI+lUa0NquOd7+50vg1HOjv2fV+1O23npn5kFm6gJaSBdA9V8aVpykkqrlTdE3Ai6L7UT82WS0uNHWSe8FlYa64Ldc7RcfPoT4krVgGrXQ96RXAP6B4XfZPMdBhgr7Rhk3EGR857ylFM4KdCT76G/KSZa2kF2WAJtfqh121eYm8sxsA6jl3JGH7+tg21mIobbfosB1uCvU2B4bWr/0IvmC07vXpN70g+4BtWZoTwvRbmBzDSSO9xK/mrs1jVGkncSsbYEnpDja+sL4KFrFiaZcdXWDbA3YpJWrUustWq6f6C91a5LSJsMw//4FawE8DnGvDpICA== 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=FLB7dQI0gPw6b3B/tyn+mvXA1ZMvuTLuZuPuKmNPD2k=; b=LNSChQaI6fnrmieLF+fGBPN4B6M+IV1qg2VJJ+zdSxHWP+DxX1hNdeo+1PrFD3YIq7SsQnvbAHLz+MkadmrJsVpwIVeow3+do6zcN+aKsZqwzXDp810XZC8K1krAQpzli0ZgQA1/+KJnPAr5aCsIed579J7Do19ZnK5q/OpQ0aFy1FwiZYAa+QVtEDqDgdD/pf+YLCVN3+hdUXj9N6cESTqT9IQqo82HCYO5oSN1s4se5QXnvGel6saGw80ZgxqNZKaDZsZAQJzUOzT+5w8uM9UXmHF26qK0uOOOSaVlz5CY4wvLp273FEPnGkapthHGiMcxvMRjfljm3+YVel22aw== 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=FLB7dQI0gPw6b3B/tyn+mvXA1ZMvuTLuZuPuKmNPD2k=; b=jCSZKGmLc2lw1IJ25Z9JlSwLpsTc9tKuPEk88o+806Di+nn0T57DpOTl9fGECA6/VtDWk+au5yMsqHT5VebgLc9NBqYq4T0diXPr7k9aXhdNHOQrkwlCFopNfa+gJWdYAXnLoj9KsnxfU5jpYDhsuNRanG398AIag/SqHqCtc1I= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:22 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:22 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 2/8] remoteproc: add is_iomem to da_to_va Date: Mon, 21 Dec 2020 18:06:26 +0800 Message-Id: <20201221100632.7197-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 06547764-fb16-40b5-7b63-08d8a59428a1 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: nfI9DmRxY1+K6TGmD3j/Q1gyr8SixVuxKYNJnLhI5DeeouaKnTaQdulBgmXaYNsG7VK2BHH2Hez/1qE6gsfZC1v9eonA47tI969NMjGc1gBlsCqVUPWtFmVD3uSwtZqGGECjYPikLjR7WMHaF2IiQ8RBpG/KB0PS8M+CN+KKJYx10OFOprZKhMz8ZEzGK3lhxY5YSDHtNzVjJ+MS5wXEA7H1x0X42mTsOBMPmwzf4oaAh4dTXwsIPK5io2cZozMnWE7CxScxhGHmorLlTobqXdspXVpIdYk6in30HAS7GMjzpb8ufXzF41Snw/h31M+/a8s+iTBzKxW2C01cl5i7B/1hAU/MqnR07FTQ7acf9za9h3JBIzvXO4FlG9xqPwijbD1IQ+1CQ4zmWb1rfVIaBA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(83380400001)(8936002)(6506007)(6512007)(6666004)(26005)(316002)(956004)(30864003)(186003)(86362001)(1076003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: AMxobkvuWmjEb6CRSr7by7LPhdAxkX23rF/WFRqjLe04CM0jBXmCagDIGGMgBAC/9zWjuqXjI1XLZUcaiCSngYeF2lIf5TomyBxq3Jh8wehZrOSaBiFdTnBiB3e8KA7yVjycNZsIqVecTvj40z+dnJj7G1tNKLF0NKoxBk1Be5X9CllqGGYzT6g5VrzWLZy9PfZPpm/z5CD+S59B7sacbczUsDpoH9+l51cfjN2xlqgkiRAb45Q3j88OncQHyWulO7HO5FRRQ064dnoZgMSNABGQ9Xd5KkCuNlRyFpeKrlVOc9cInOKbFPvfOotL7trdGQyXN3Dyl1J/Om1Jh71BEL3QCjV42sTXn9U3fJBMYeWjNCbZcQ+mAshEGvAtbBj/OPUxCeM6HJVv6RLgkxome+o9pn8v1SDIm8Ep1FYmTjlQoTZTIq/k1z9fvoCL+A4mPmdTnpEP6EiwkQaWcw3xqS03qnKXMmHwA2ZZ5r23y4KujRwJqAQ8C8ABmL2vWtZ04FCL3+pazaWcTW9cMutyvVbKI/6+Yxq+7d1QrCaig7sDvIjvhxWz+JusUkP/baticbMZqnvW57k7JHIIr3CMDqpINYVBwNY6BXGc+GmJsfcr2TTmEeixASIC+f24Y1xBw/ALiGQ+1dqUAX82Xb9WTEZWNHQS2th+jYCPX21Oj/PrhJNfi1pwNDIATBj0u2uk2ev4bLyQPQ0GwtRurve6zTh4gxqSzk/JMrQS6YhY16nC5Hysu/t2bFwCqV6wl/+QPISoszy+vuYWCiGYPH3WP8sQklRd5T+rAfgrnB9i7OKAeVJ9WjSkjg68vafw+v/JvS/U+3JPP/ABq0dsCzhtLk67ODfJZOt+XzgatYFTi3Q8MTTaI4fTZn9QKA5/ahwmC5S0ZNSL6zmER28sAsW67iIfb87mS5Zc9pdofsJPkMi4NtWUdWUWnYxOmSV3piidOKCwhiH2Dv0XKyz6qJ2asxU7dPlpN+mm/LzOJGvRj3uQ+fNw4Rh+p+lWH7SvtALi X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:22.6950 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 06547764-fb16-40b5-7b63-08d8a59428a1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +8LxVerDgm4MgVgfnXFKyWbj2GswGit3Vl9JDv2zjn1qzvWqIQr2sBgCHxUaIoPgZ3zBt3jtwA+an9fOkWNESg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043826_684904_3EFDCEB1 X-CRM114-Status: GOOD ( 18.05 ) 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 , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. Signed-off-by: Peng Fan Reviewed-by: Bjorn Andersson --- V4: New patch 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(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 8957ed271d20..6603e00bb6f4 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -208,7 +208,7 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, return -ENOENT; } -static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct imx_rproc *priv = rproc->priv; void *va = NULL; diff --git a/drivers/remoteproc/ingenic_rproc.c b/drivers/remoteproc/ingenic_rproc.c index 26e19e6143b7..bb5049295576 100644 --- a/drivers/remoteproc/ingenic_rproc.c +++ b/drivers/remoteproc/ingenic_rproc.c @@ -116,7 +116,7 @@ static void ingenic_rproc_kick(struct rproc *rproc, int vqid) writel(vqid, vpu->aux_base + REG_CORE_MSG); } -static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct vpu *vpu = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c index cd266163a65f..54781f553f4e 100644 --- a/drivers/remoteproc/keystone_remoteproc.c +++ b/drivers/remoteproc/keystone_remoteproc.c @@ -246,7 +246,7 @@ static void keystone_rproc_kick(struct rproc *rproc, int vqid) * can be used either by the remoteproc core for loading (when using kernel * remoteproc loader), or by any rpmsg bus drivers. */ -static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct keystone_rproc *ksproc = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index e0c235690361..535175f013e4 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -270,7 +270,7 @@ static int scp_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } /* grab the kernel address for this device address */ - ptr = (void __iomem *)rproc_da_to_va(rproc, da, memsz); + ptr = (void __iomem *)rproc_da_to_va(rproc, da, memsz, NULL); if (!ptr) { dev_err(dev, "bad phdr da 0x%x mem 0x%x\n", da, memsz); ret = -EINVAL; @@ -458,7 +458,7 @@ static int scp_start(struct rproc *rproc) return ret; } -static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct mtk_scp *scp = (struct mtk_scp *)rproc->priv; int offset; @@ -587,7 +587,7 @@ void *scp_mapping_dm_addr(struct mtk_scp *scp, u32 mem_addr) { void *ptr; - ptr = scp_da_to_va(scp->rproc, mem_addr, 0); + ptr = scp_da_to_va(scp->rproc, mem_addr, 0, NULL); if (!ptr) return ERR_PTR(-EINVAL); diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index d94b7391bf9d..43531caa1959 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -728,7 +728,7 @@ static int omap_rproc_stop(struct rproc *rproc) * Return: translated virtual address in kernel memory space on success, * or NULL on failure. */ -static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct omap_rproc *oproc = rproc->priv; int i; diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 2667919d76b3..2dcaa274e266 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -465,7 +465,7 @@ static void *pru_i_da_to_va(struct pru_rproc *pru, u32 da, size_t len) * core for any PRU client drivers. The PRU Instruction RAM access is restricted * only to the PRU loader code. */ -static void *pru_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *pru_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct pru_rproc *pru = rproc->priv; diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index e02450225e4a..8b0d8bbacd2e 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -281,7 +281,7 @@ static int adsp_stop(struct rproc *rproc) return ret; } -static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index ee586226e438..333a1e389fcd 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -242,7 +242,7 @@ static int adsp_stop(struct rproc *rproc) return ret; } -static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c index 78ebe1168b33..704cd63c9af4 100644 --- a/drivers/remoteproc/qcom_q6v5_wcss.c +++ b/drivers/remoteproc/qcom_q6v5_wcss.c @@ -410,7 +410,7 @@ static int q6v5_wcss_stop(struct rproc *rproc) return 0; } -static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct q6v5_wcss *wcss = rproc->priv; int offset; diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index f95854255c70..1bf60dc84f69 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -320,7 +320,7 @@ static int wcnss_stop(struct rproc *rproc) return ret; } -static void *wcnss_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *wcnss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; int offset; diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 2394eef383e3..9bec422ccce3 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -189,13 +189,13 @@ EXPORT_SYMBOL(rproc_va_to_pa); * here the output of the DMA API for the carveouts, which should be more * correct. */ -void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct rproc_mem_entry *carveout; void *ptr = NULL; if (rproc->ops->da_to_va) { - ptr = rproc->ops->da_to_va(rproc, da, len); + ptr = rproc->ops->da_to_va(rproc, da, len, is_iomem); if (ptr) goto out; } @@ -217,6 +217,9 @@ void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) ptr = carveout->va + offset; + if (is_iomem) + *is_iomem = carveout->is_iomem; + break; } diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index 81ec154a6a5e..aee657cc08c6 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -153,18 +153,22 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest, size_t offset, size_t size) { void *ptr; + bool is_iomem; if (segment->dump) { segment->dump(rproc, segment, dest, offset, size); } else { - ptr = rproc_da_to_va(rproc, segment->da + offset, size); + ptr = rproc_da_to_va(rproc, segment->da + offset, size, &is_iomem); if (!ptr) { dev_err(&rproc->dev, "invalid copy request for segment %pad with offset %zu and size %zu)\n", &segment->da, offset, size); memset(dest, 0xff, size); } else { - memcpy(dest, ptr, size); + if (is_iomem) + memcpy_fromio(dest, ptr, size); + else + memcpy(dest, ptr, size); } } } diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index 7e5845376e9f..b5a1e3b697d9 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -132,7 +132,7 @@ static ssize_t rproc_trace_read(struct file *filp, char __user *userbuf, char buf[100]; int len; - va = rproc_da_to_va(data->rproc, trace->da, trace->len); + va = rproc_da_to_va(data->rproc, trace->da, trace->len, NULL); if (!va) { len = scnprintf(buf, sizeof(buf), "Trace %s not available\n", diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index df68d87752e4..c02d4fec93a9 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, 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(ptr + filesz, 0, memsz - filesz); + else + memset(ptr + filesz, 0, memsz - filesz); + } } return ret; @@ -377,6 +386,6 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, return NULL; } - return rproc_da_to_va(rproc, sh_addr, sh_size); + return rproc_da_to_va(rproc, sh_addr, sh_size, NULL); } EXPORT_SYMBOL(rproc_elf_find_loaded_rsc_table); diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index c34002888d2c..9ea37aa687d2 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -84,7 +84,7 @@ static inline void rproc_char_device_remove(struct rproc *rproc) void rproc_free_vring(struct rproc_vring *rvring); int rproc_alloc_vring(struct rproc_vdev *rvdev, int i); -void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len); +void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem); phys_addr_t rproc_va_to_pa(void *cpu_addr); int rproc_trigger_recovery(struct rproc *rproc); diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c index 09bcb4d8b9e0..22096adc1ad3 100644 --- a/drivers/remoteproc/st_slim_rproc.c +++ b/drivers/remoteproc/st_slim_rproc.c @@ -174,7 +174,7 @@ static int slim_rproc_stop(struct rproc *rproc) return 0; } -static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct st_slim_rproc *slim_rproc = rproc->priv; void *va = NULL; diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index 863c0214e0a8..fd4eb67a6681 100644 --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c @@ -354,7 +354,7 @@ static int k3_dsp_rproc_stop(struct rproc *rproc) * can be used either by the remoteproc core for loading (when using kernel * remoteproc loader), or by any rpmsg bus drivers. */ -static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct k3_dsp_rproc *kproc = rproc->priv; void __iomem *va = NULL; diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 62b5a4c29456..5cf8d030a1f0 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -590,7 +590,7 @@ static int k3_r5_rproc_stop(struct rproc *rproc) * present in a DSP or IPU device). The translated addresses can be used * either by the remoteproc core for loading, or by any rpmsg bus drivers. */ -static void *k3_r5_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *k3_r5_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct k3_r5_rproc *kproc = rproc->priv; struct k3_r5_core *core = kproc->core; diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c index 92d387dfc03b..484f7605823e 100644 --- a/drivers/remoteproc/wkup_m3_rproc.c +++ b/drivers/remoteproc/wkup_m3_rproc.c @@ -89,7 +89,7 @@ static int wkup_m3_rproc_stop(struct rproc *rproc) return error; } -static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) +static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem) { struct wkup_m3_rproc *wkupm3 = rproc->priv; void *va = NULL; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index a5f6d2d9cde2..1b7d56c7a453 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -386,7 +386,7 @@ struct rproc_ops { int (*stop)(struct rproc *rproc); int (*attach)(struct rproc *rproc); void (*kick)(struct rproc *rproc, int vqid); - void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len); + void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len, bool *is_iomem); int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); int (*handle_rsc)(struct rproc *rproc, u32 rsc_type, void *rsc, int offset, int avail); From patchwork Mon Dec 21 10:06:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D28CC433E0 for ; Mon, 21 Dec 2020 09:39:57 +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 1000822CA2 for ; Mon, 21 Dec 2020 09:39:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1000822CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=ErExr+D6CtLtOuZNP0ZaFey1n3aS1cWiRQEeUvYvDjM=; b=OXP9b7TosPbixxJ+U2azmOmwv p/XqT4e3LZA/xTMUd6OW2PQtzmYNOUZo9LBaLpYTx1LUpOQLOGq3gLiKh3xUtbN284VRBc6DCpx4z CF+P8NT++8b9JE6Y2r4FlhKgHHCj6O6akF9xpKYOC+rJFV/7n7TtwbBe8TR14YlyuLwVRJIgEez+7 d0jDJz1TKUIiob/fJZ3TskIBn8wF7Dk9NnJbcXFBV+6XcUwwjGPMf6WniCxhKsdLtFt4w+1pNA6rk CF84TznviZige5Tpm6K/5ZFYU48tVNqFfl+zFIE0UJ0//3pv8nMODqHO1+tp3LH9opfs28qRP2iZR OhjyWSD6g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeE-00060V-JV; Mon, 21 Dec 2020 09:38:34 +0000 Received: from mail-db8eur05on2058.outbound.protection.outlook.com ([40.107.20.58] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeA-0005zP-B0 for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CgQLvTb1CQcrU3gWDEDBWkLgH/894ItvS/F5uU7V50XYziLIWTvP5JkUzC1US2yrxsFvo/THp3Q427c9nf70K9A+6QNVHvMhaCDgON46gSSWTXa74AeDivu2ddcPH4J3U+izLMhu9qcZdgZvSr6jM78LsuRIlK5YYuKaIbdlvJMBKBvzfUXVSXIiLVBh9xBjMmFghWZa0+6Yc7ttzrHo/5nJRnwpn1x/BFTYMxGArpja+Ua2NlZj2VctnVBpdtXWE6pzbMPoI5eq7641ZVyUPSu7R1m6AUtErYeef+Ah01y4XHFbT0mU4GmDhjA4kRmW4XiEXGp793n2jFCnMY8Ftw== 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=rACl7NUtcasQV8MsH72KsASEecE9FcoCPyFCBMwS2bA=; b=hA8g8r3DsjRbmXYpDOx9X3uO8eb4w5ncBOEAA/2sVFxiWVRRasTSeVQmWEr7/XEqzZwgVWZqKDkVZa3M5uLRpanie+CTHGP8fETfHIAkmKOzhCsfm3yd1z3G4M+DJZbvc/ZAVF8HswHUL/G80SmAD51x7uh7NQdTJXfgsHUymsqEiaq7RFXsqOIVrXCb+VciZlG+GzrOdQoaHGqWJv1TLnCCvd7fXLB5xUWtzjMS1YkVPfilrhQh1pVD+oGjyY0xKD3Bbv2kGUeRfWw2evlNCn0LYRzgX+Li6lvm8U2dZgzuNmgZwu9GmyScdultN/qGF7mrPtCwQyKu4AN3YPvkWg== 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=rACl7NUtcasQV8MsH72KsASEecE9FcoCPyFCBMwS2bA=; b=cLfOl6Z+DZgVJxemGul5+rfZmStRO86r+Clh/SoGp849T6LgZYCEXBVwyPEvqHw3+p/WFWwBOD9wNZvIpatjQcGiVnt6yT48jklvJjwQuNe2TQ3jCGutIM/Bm2d8GHDJYlvESJXWViQfawWeU2LIf+C8jIiIGYI9cpl19naCaqQ= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:28 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:28 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 3/8] remoteproc: imx_rproc: correct err message Date: Mon, 21 Dec 2020 18:06:27 +0800 Message-Id: <20201221100632.7197-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 05d32050-dc9c-4410-abbf-08d8a5942bf6 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UjCZ91CJElCHf4mGsLezjic3eqDBRA5+bWS5O5WP55cb1HwSRlmAepA0x9xJNAJn2nihEXRYTbZlaGPCFugatr1MrZjQlFBhKHJxu3A+OiGTk/5k8HB6dAKX4d66El+D712tnBdcbXgao+yj2jTw/qLMeYbUxJVshK6jWXwzt2UvCCGkUQcC/VKTfgFpEsiFTIcRQXmWioFrJpkQqCqeKyRnYhge67+WD8K7KwyrZl1IXZT6jDzi4jMmjqOfzqCvx2BdcnJDlBoFF+j0JJJ8h6SR0z0vop4BLIsTxwrb4+6uWG4ejxoG9uuL3KVl83nTEZq+r6eK3d50V74S0AxHQxVxsCYgnEuiAIT+jCf+NDMg9N4HwO6+RVUGen3hTxaro6bR/stI67FXSxvC41cSAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(83380400001)(8936002)(6506007)(6512007)(26005)(15650500001)(316002)(956004)(186003)(86362001)(1076003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: i2DiyvEuv8P+eZ9l5m36ApRX6fuVCPg8oi21X3KQ9/O9eKJw0WQvLhBnVLO8Kt3Moqxm4dBQbY1qpwEhE6lKhvsAzuT1N6KgmXdsBgoGfjmoZMp4MD0CtNgLWDyy/qKzHcemxco8d0tEO/MVMjGx97iS87NxMwhuoCGbHxyWBeObRsBCbmz6he7A+FdkJ9U1riCW3DanDxbkUgIl4G8No/Pz53It4opyOa0bgnBRFoFXdFxNnnE1/MIefGWyxPKfOHK4QzsZlT18Nxjj5954xJRcGQxQPud70d+ywRKNhPBoOk1NKzreR/ZEOKyWCjKuE7mlfvETLbY7fApEo8JszggFdPNqFDQSSAF9AppiRvzhV9a2xn+CBOAmnDCWLJ+FwtFRDoaxM2DPm9cZwmoi07+igLgCjc7NfMTY1qRta7XX8D94Noqq7aOOUhtUGYGkBV0NNiv0Yr2XQZSA15Ir8RqISv9bOV58UxNfJs1eMi+xw8h0Is2QjpU0QdT28Uexf/Zs4NJzoQjiziP7a4aU4rRn8G68mpxtsGOIFBtD/wiPZXhkp44Svr5WqGcVDhFU2tZZAnl7TThvCzWVusRy1HI5Q/jOG6n5L4ohiGBrP7NWW/DB0mw7HE/zkE1hXdWvPvibMQvGSWBIxNkjNtGYNevljt9e3V6wwe219HapTHE5FYFvzCgDHjNxFYR7hcPuZBOPGDOot7pkv9nQz0p8282pY3w0giaidi3Jj7qOuyLiD7AAp+ma28Hs5xbYCox6Q3szgr602m2YlQOn48cPCec/N6q1mnquZCrRjZobs+n3I/Kj5tzP5S/zt2FhzyxBiaWAjpm4XNmsBGf1w0/03XGzdub/kBqs6f5aW735k5pVaYRDj8JUXCrg+echCjywxf0bvYUynOqwOz6sAl8kf1P25F3YVCZtG4qdkhgseuKx4gxUlb5GxPPAYlC98cuEE14lSVM2+kPp6Vli5IwBOyKhPxEzys3Z/hqd29mtD52LQVvgVZxTiYbNqCyMAwNZ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:28.2614 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 05d32050-dc9c-4410-abbf-08d8a5942bf6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VDFveRh71w1wyt70uKWRa5684Xy4sQwnh2hMk7n4TZCEqWO6fQTjLKFbtmVUFtTWwCxqL9wC2pS1MpZjF+7FIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043830_474888_E599D02E X-CRM114-Status: GOOD ( 12.49 ) 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 , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan It is using devm_ioremap, so not devm_ioremap_resource. Correct the error message and print out sa/size. Signed-off-by: Peng Fan Reviewed-by: Bjorn Andersson --- V4: Drop the R-b tag Follow Bjorn's comments, correct/update the err msg. drivers/remoteproc/imx_rproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 6603e00bb6f4..fab772b02c9f 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -268,7 +268,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, att->sa, att->size); if (!priv->mem[b].cpu_addr) { - dev_err(dev, "devm_ioremap_resource failed\n"); + dev_err(dev, "failed to remap %#x bytes from %#x\n", att->size, att->sa); return -ENOMEM; } priv->mem[b].sys_addr = att->sa; @@ -298,7 +298,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); if (IS_ERR(priv->mem[b].cpu_addr)) { - dev_err(dev, "devm_ioremap_resource failed\n"); + dev_err(dev, "failed to remap %pr\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); return err; } From patchwork Mon Dec 21 10:06:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE549C433DB for ; Mon, 21 Dec 2020 09:39:59 +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 6FA8D22CA2 for ; Mon, 21 Dec 2020 09:39:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FA8D22CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=5u8pQDxzOYxdoPTtnBC5sSSHexdxLyw91R3h9VyRLOE=; b=FaSktw89n2/QPzTq5BdPBdhPZ 00K12xR5pqt/mIXHYhcpMSnF75tzyIn+CgbNVjYeW0+PNlajxxd+jppj2K281EOcRYdk9sh+dsLdP LGAVk2BSHCqCFewH3m1+Vgj1VEX9diQ6Edl+dIBM9nQ9yfL0k9xoe8OlsdNXha9eBhTts8TzWrN6H A2fCcmuavXzfxCdn4sp7gfFtfovYtj4hr2Reqd0Kg4pCLzfH0YUhek9NRPmGzvGRlaCoWwValpAnn bDFBIiNuU8C46nhkMrYyUZ+KXkQclAzisMp7KiDg//8Ac1urrI6UwUQ06Fr8LUBI349Z7XmuMrLQL +FnXmAJhw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeK-00062H-W3; Mon, 21 Dec 2020 09:38:41 +0000 Received: from mail-vi1eur05on2053.outbound.protection.outlook.com ([40.107.21.53] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeG-00060q-Fy for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WkpwOB1FcHEsE6G8QDUc/G+Ure90QXHXVROzI13OqW1tMPkbly/6N10wYq6kEsSoTZCO+VpzZugE2IkLsoCH3aMT55NatJ11spwhvN5GglNjDC0o1+ObLyRyAEhEPvGRFVWxhUdD5BacIuALQm8kMBh576+gLS48KMaIl+f2LyeMz7kB4HcZ6eB5CqVYbAijk7Q2vqEF0jgLaL0B2a1l6IzMVopCRy8VgSkMwo89At2sHX5KSH912xu9snuOfZ5eRkd5zdn6PdOREH/7p4/cbLxMtpee2RRrn0cbnXqoi5BGTGjsb4swWxNAsXcoJ0fRr7Oy3ulXb8cPkaCVXEYhAg== 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=0g/0nnKz7jYu/HpS1+6uMKNmuwpA7kwTSfzSnPHk6Ec=; b=dKp0JZYhHZT3aPANFKP6PqfIJKTq6W8Vr8wnWpwHUnpgg4/aVmI9VzrW9ABvnLmEpu1zui3vxarmhfgnpqpwMNWS4UjAMK7ZINcW/0qSKzJf/jWSVbY7kezkhlginXSzslx/IwTgRPpBoOovL4OUunn1PTQIq6yMbgHr7DjowE/XuEhEpASPtXDYuQXT+Wl87KtMfQpXD60S78ogi/aJdXUS6B5jkKedS7YbLnIAoRIavVpR16nWhHkJwZrCB/bKbNVI4JPlMp2SHhBXeNUPkZZvrqESNiG0mL4k4Bl+bf+dVQxMBC+C/SPtE902tCFZeoe+4gaTJJN+a12QLiiv3Q== 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=0g/0nnKz7jYu/HpS1+6uMKNmuwpA7kwTSfzSnPHk6Ec=; b=b6RaNXWNts0KSNSQiIlPPjEGgfpRu1W45SuyiphaPww8wp1CyRHiDF43bNzmX2byR1etRZhL2pVVJdQYUX2UfWh+i4ImyN5A469A4pEzodaQtJVX14/MbSX80tRUE/32qlUJBnctt0ZCZhVBKlFPBUNut4tx3eV//Vd1/I+qZK4= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:34 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:34 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 4/8] remoteproc: imx_rproc: use devm_ioremap Date: Mon, 21 Dec 2020 18:06:28 +0800 Message-Id: <20201221100632.7197-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b2407d5a-61c1-431f-31fc-08d8a5942f63 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: ODcNQLrS4v9dCWdD6qpyhMEcfeAh2JiJaXP5ekCJAfSGy9kb3GLodQX91R32JlE0nWyTG+9ye2raItfBDfzMlv3wWNSYRn5DTDqCq1c7z45wpHgPtDuCMUZap5RCzHyWaC1GKF8gUVGyc8HBps8UfeznG8aSy7xbJJrkaJTncdiS16yDw4YhCpxcBsMw0ujMb8r2cBEVVpuqNWS1qBwKstDwAyCVGp1JPG25nftvbbP/4yKLjSfSq+ee6QnnuxXrRa0mZ1CE0oTMWRmq5MZFOMJoV0N4AiKGijIibxIOakuqGFHn6cFZTHWE+xAmDM/9qRuzonMk6G/ygkW5DySWr88pVX7+uLiTjqiEGc6sxRVim/gk5JblkOji03rdKBSPJfGZlrUxZ3U+/9w8vao4lg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(83380400001)(8936002)(6506007)(6512007)(26005)(316002)(956004)(186003)(86362001)(1076003)(54906003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 4298zdrv0ggakF7NOCKSSz5ciwK1OxOrHOD4CLmmrKYkckq1JEwrzEUsNdc1PChcpNJ2urxri33KwVolEZ1numWKGmQR0FCyIGTe0O+woS5JKdskhV7lRVjRWWk0jrgvtxCbXhUb1BH+clodc9+t37EpUFNXmzzv/Luhwle3pgyOgQ4KoNdqnMuK2M6o/GWplvGdW7OjSZxiGWhdTwfHlDlMywySi51TlTth6ixlLKw3POv+EGIsZehA6AgtB2tr+oAhzP5+hInUdgg4wF4GmjZi5pB6ikWsg0TuAuQY0SQeo0kCG3/ki2bZq8/duav5EBM1ez/B6L5eBZ+1MHt1G119pt11J1UNHcILJ2EP646tR1AJhuPI8bv1LnDJs161s7Isuf+VcwvTHUIaFtbbLdxubcVbolI1b1WcB1zbQEzK6jC4HWlSTA0uZNApbkxcwmt1kjO6jwEfLczw7tW9JaAdHlvXwtEU7hCvkRYi8yy1f0DjhBwYdWfDcRt6HwgWaTM+CkljV8eFTczRucdAtBoVDRL1G7s8uzN+Q4trR40FPDMjd7pqjgsWmnPGOkQOWDXnJsjywUOWLV6KUp44zjN/CDG8jsxzYXCcF5uxIXWIdlG+G3dQ6MI9IlNq2R/dsv/5wWMZvZqZFVFUrXzto64hBZe+S6Wcb7A6ALflAjlkRw8cFUS9hxAaqvjDkw2N4mdaC7trFcJa36VB7slFv1daIatRTwb0JebiGAjcqCFAXU3NjrrOL4hHpMnI8plE36BRzcwF/e0KQstxiI/8eWyM5FIKGG/FHO9AF6zt7vblD8EE2sM83T2Zi8Wom8vTkOEzsX1g7I+zUN5AkaK+uYsDo26tgQMR9mnLXYj6q9dq+Xz3CUkth/zV1QiDkKLJSSEYchpuDOs1+L/YkTzhLfmd6W1NMLjpz2u9ezKq0zvz20Klv08dqbOXCzqbVYJlC2tizwBLDpRgUxv7mPgfMkokRB8sK5XO7JgxF8qdvSnlhR6PH7OCVBgFrhP9wqkU X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:33.9928 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: b2407d5a-61c1-431f-31fc-08d8a5942f63 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vLsU5Ho3L99vQ7eo/igT/JP4CTPjbV8dqO9pFeQ+zeQgyyiDbdn/CsKT3BHhhtvxcGbLLw0yrmHZFveQBhWL5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043837_286532_B3BB91E8 X-CRM114-Status: GOOD ( 12.34 ) 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 , Richard Zhu , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- V4: None drivers/remoteproc/imx_rproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index fab772b02c9f..3915c7f5ac47 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -296,7 +296,8 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (b >= IMX7D_RPROC_MEM_MAX) break; - priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); + /* Not use resource version, because we might share region */ + priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); if (IS_ERR(priv->mem[b].cpu_addr)) { dev_err(dev, "failed to remap %pr \n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); From patchwork Mon Dec 21 10:06:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50134C433DB for ; Mon, 21 Dec 2020 09:40:06 +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 02A8A22CA2 for ; Mon, 21 Dec 2020 09:40:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02A8A22CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=vUvVIaXUea0Bik9HurJzzXR/Gx9p9Uy2j+HWGDlQuTY=; b=gPdrdZANvU9q8aNVPQpGBLcam LKXHByfIPRGLf63SK5jlBZtADa3KfcXU3Kc8Ek0I5qPoU4TM6dH9Bxqk65eGlJse06WMpgVsJv5dH F7C61nW4N+4F7xxr8mQAG7KW716M9mKAcmMV5H4nTYDk6spdL34gi878t4R3aXRvzbJo6VzfpSCIQ X66EElGUZwg90nm2gtDEmHy1r4J7h3tg1kAd+Ojdph5qy3pxDsDGicfrQnIT6hcmF1pFU+O7kHI5p 93pNhKDsTbv5qKxmwszUZ3WJsbSFLXv9igkBlDjTHDHLIPrgYEiJX8Si378kPyLV5EVcrIlzpXL1Q xwkhKKGgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeQ-00063c-Q8; Mon, 21 Dec 2020 09:38:46 +0000 Received: from mail-eopbgr40072.outbound.protection.outlook.com ([40.107.4.72] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeL-00062O-Mo for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a7XG0f/EOnjcXfxVfMhfKy7R4hptpVTieD0XU5OLqHEguwsmbgQ0fmwkoTF9rIHoh5ZO8X4rFxFPC9pAwPP3C2wyEOqQzIj49aIFWz5Kv3M+DT967lNGxysh8k8jTTCkSVCH3Wkulvj2QHkRP3kJfNdYzDQF+4h4tzvrPM2JKEjm1rgS7Kezhwk7JHXq/iU62KHMedQQlKJQDft8u9ypMmQfVPBqFQa2TYoYO+7NKjbUIISAoojHr3A0EuLu+HCaUO50TqJMzH/eqJFROrdA6pxAZtnYbd35WWoWC85rEeVTIaXE44USDJIOgaJWHhvCLUMesbnr5N32A1xyluTxiA== 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=QWX8RIpN2wrTsUwrPQLmEaLeYDb7l34S0Rgk0mREnDw=; b=mJACo73I2vsZl5vmWNrrycSWRAgP9jSipoTdgpH+jbYtDWviqMuio7BHDKToil5+lABifFm8XNKBVEK8hm6h0cSfk3/9ZFolBpXrmSLN03YjQhSIo1j10XycUfJhGNU+jS6rbizyPB2AEhHlkqa/KtvqakDzhumP9y+lbEocPpcjnPg/alKUEX6uzYNHFk7/1EVkGseBqZ1DYvgrKpa3r9rhsT37MgAiOLkrJg78mPF4Jqdh4v3B3erMqssEQeULcH8heWrKwyqC3teai9906hP7J64eJGvi0ubUhBnhzZcdGBvTY1Xv5t+GEtvjioBjulV+HpdMpzRP9D1zRkjftQ== 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=QWX8RIpN2wrTsUwrPQLmEaLeYDb7l34S0Rgk0mREnDw=; b=BtLP2HN9LtVLjuTyX/Erm1OzhSvv+m9g5NpU/2qcGhoMW0p7jhdgLaMWIghW/W+yxo9N7BTal0VsrSdWAqw8cqwrk2hDC5S025CruStcKnM1Hz4yM7eoKwlSvSwokHPpS/eKlhkUJzc9s5ndDSFBAE/f1Co1+4GudjPLlcIQG2s= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:39 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:39 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 5/8] remoteproc: imx_rproc: add i.MX specific parse fw hook Date: Mon, 21 Dec 2020 18:06:29 +0800 Message-Id: <20201221100632.7197-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5249599b-865a-440e-144f-08d8a59432b8 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: Uk8yp8iAF/Dr0cKiu64YQP78Zo/SqLw2rSkpHfqo29fLaVfTdw4z8FXjK+/q5L0a83Y9Erd6HgkQ227p3VKNarWXJwJKrdttNE3BAIt9C0fj1C5+FuxLQX35m6Rozmrja4sEl9HL15Cq7K1q9oc3VsigYgpWHU6vIjGGv0UXYgXBXeysHfXT9HD9WarC6nGW3+/vKqe01KNlrMj8252wUUipQJo54cT8crGFvvA9tfdyxJKyzLVNYtRUikX3ALisZElM/GYtoiFHAQKoCUJC/PfyvaF/Pma58ec0cHgt1TfUkb3W04Mtlr3Mql3eOpgQYq9+n70g5yV2mkFrkn/Tx1ulAmpbb9sNvXQEYpcGuqW0xoTR+B/aJUn3UsFleHOmxMkNsUUWBqd9Ex8h74iy2A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(83380400001)(8936002)(6506007)(6512007)(6666004)(26005)(316002)(956004)(186003)(86362001)(1076003)(54906003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vtV8Hk+lHJzazStnFPTqIppUlqVHgIGpK3/Q1ptVLD6NSU7LbznoxlXs5/C0ORh4v3x//9eCzn9IA2LYaqQgRgcKoHdHFqR52htuBDK+gINlc3IZ2+cq18gWWlH2ffUSPbxph//7Wig6HLziY6Lu9D8f0Lkoxq7YkMbUq9293noNA6jEtenRiTvf/QmhAneihw+LsFiGFCJ9/GaQhHNa9uJbHhNWzYdyiKq644Q6KE1F76lo/qiXfn4m8cihsuTURJGAOn2K6ikzuxbSp/qktsLTr3Vkxu13U/6w8gcI1vRLSdVFez5gT+nrQvgfnv11Zk7IztExo7qc5kOfC15aY1e6ctkFOx1a5DYvr2fSfuk9iDI0vLdGKMjih2je9ewkU/D+ugx9N5+2Nbk0n1wy5D2/1AT2OQOgqigCPQlz3A9kHljAyZsIIZCDdSCk/V0MfyyUD7TvwJid+aV+aRG+XBSRw47g0cAlIR3KgC1zifmlfdJjdX2MOolXqwE/mWnYUWORk7XEaRGs4id33EbJwIntVckZHUFiHY20oQPOA2VI4wcE+zl/jukL+yg6/+Vy2xk31PV+kciEPRfjyXAbZ6tgSOKNdNf+umsECadlkAR+oGhR2JjLvfWfJTVyW95oi7m19EZP0lSSX94KR80P030QBEFYzKiGMwTVVq5Xo0qhbzdmJJDvmxJfRIEZ6+9G6ni8T6SBX5m63bRVPNnxHDB5o90FJyfdQHya09kJn35JlvGR5237hk2MY8HblIK1pFWDG7RyrihdgfL7WJ6jb81R1L8ggH2kKs8zThZr1lXqFXQAMZzyHj9/YKSNKBMK8rlewm57ahxlatYtdasIKYWfJDrHVGpFZwPJgZ7toy7YK37UaQnBjb/p8HcP0kwYE4pxwU3Vjw9eyZ2Arc7a7ejJeqYQWGmxeuzQz8vFTQuSIs9RQiPX7JcgXAdxSAdSusykaxssZEFEKLw/U33T7eTWp0sCfO2K9k5XZqdiQZER3apz3tINE65Dz8nTvNaZ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:39.5983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 5249599b-865a-440e-144f-08d8a59432b8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZA0Cad1qUeJ74NEdzGW+tzgqB04Aq72Tt1Z73MQJ/CEkwFdkNdwyx+HFBlTXAsb2yfADhAM4BTEZSyqnaGA2HA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043841_821237_D5E6BC18 X-CRM114-Status: GOOD ( 17.57 ) 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 , Richard Zhu , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan The hook is used to parse memory-regions and load resource table from the address the remote processor published. Signed-off-by: Peng Fan Reviewed-by: Richard Zhu Reviewed-by: Mathieu Poirier --- V4: None drivers/remoteproc/imx_rproc.c | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 3915c7f5ac47..f7ca7e7954ee 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, "vdevbuffer")) + continue; + + rmem = of_reserved_mem_lookup(it.node); + if (!rmem) { + dev_err(priv->dev, "unable to acquire memory-region\n"); + return -EINVAL; + } + + /* No need to translate pa to da, i.MX use same map */ + da = rmem->base; + + /* Register memory region */ + mem = rproc_mem_entry_init(priv->dev, NULL, (dma_addr_t)rmem->base, rmem->size, da, + imx_rproc_mem_alloc, imx_rproc_mem_release, + it.node->name); + + if (mem) + rproc_coredump_add_segment(rproc, da, rmem->size); + else + return -ENOMEM; + + rproc_add_carveout(rproc, mem); + } + + return 0; +} + +static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) +{ + int ret = imx_rproc_parse_memory_regions(rproc); + + if (ret) + return ret; + + ret = rproc_elf_load_rsc_table(rproc, fw); + if (ret) + dev_info(&rproc->dev, "No resource table in elf\n"); + + return 0; +} + static const struct rproc_ops imx_rproc_ops = { .start = imx_rproc_start, .stop = imx_rproc_stop, .da_to_va = imx_rproc_da_to_va, + .load = rproc_elf_load_segments, + .parse_fw = imx_rproc_parse_fw, + .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, + .sanity_check = rproc_elf_sanity_check, + .get_boot_addr = rproc_elf_get_boot_addr, }; static int imx_rproc_addr_init(struct imx_rproc *priv, From patchwork Mon Dec 21 10:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA15AC433E0 for ; Mon, 21 Dec 2020 09:40:15 +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 890CD22CAE for ; Mon, 21 Dec 2020 09:40:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 890CD22CAE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=pmu0bTjp4v+v6dqIwdlYnW17gJ9nCk88pXVDfcQg6GU=; b=mXoJJDBwIG6VD2AYMFkAummBk XExcz8hDIVVj9z56OVQ2K2pAkOu8vhuD9nbDIm2HRLlXzgxannn5vi2QFyO2IBxk9K4jX43wsOkw/ BpFv/rdFqh0DWKJVRxxJ6i1KjYvhUlXcWFXomEkprW7fFGXqLFq3qs4ok3cKAwvs+eVxQZRovywba 8GYLDwj8G/EehT6ErNL1GBZDRed4zZa9pAdQs+C4/me4SAQS0hjraGj6YU35JUp/3ASfuLlK/ULgj IwFlOS08TOmtu2NWuUvVRLIYwl+1kbeK4yMZM7xLMg0jYYzuTIBb/t0hlRaBnoQRSAyptENWSvMJl OVO+3/FSw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeY-0006B1-Me; Mon, 21 Dec 2020 09:38:54 +0000 Received: from mail-eopbgr40053.outbound.protection.outlook.com ([40.107.4.53] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeT-00063m-J5 for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfMwryOMQl+qeMW6fAsiOFjIYRM2qgqef+ChUKD1r5QJxekcLBqbWIQ574NdozvFFsu+Id7PdtEsI0qczmsnBOpXRz9lUaPbt5V3LpujAGbchmuWvJJ3+N/LmVVDjYHOGpsRnedbvsVwRITqTF7UscD7SP4qVG5AxSL+K6BRqLFCNp6nPmXS1dSsXZZd8vWX2TtjQmbm+v3Meik9QOnKomz+V3Mj1QA/n8NLF26FJKJ4P+gSnamIT0oUxkq4ihqBkqIiJQgqqUuzHax6oDDMzfJsyoMunAWlKCeXv4Ce/Ydabx90Cd2R9OeAY3xkXhUu5+08KOEspMNgiyNQ413yBQ== 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=wWn1K37yfTIQQHFpQzexyTyMQg+0b0PlCpdGLt56/Qo=; b=hJEA5gqpzjXxeYMnFijJw1oxP6ofXTfcmLnBr+9E5eqPdd3HSqa5iTqRTfNBVZuzHAPaPKnh4Kc1VB2MEExd2hALCPylm86NiaGMY9dlGsCumilaxJYgmGwFrezvux/3XSvLFNoKyIbq8h4E/JENyztlexy37qRZQq+yvbeVyi46KltJkv4M46/2ZQzSv/PLRcOlpQiIYavg5/b+9KN2GF2olnlTVJGItxtzX9EOtOIoOW/Tv7yc/O1bNjp104FqSieDWe/6SlihgIVQtIHE06lExWhE9vBQ3y1SfhLrHh5uyXcAWnCP0tHSvJxrxiWo4bmzUUadLQk8eGI4VfgbSA== 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=wWn1K37yfTIQQHFpQzexyTyMQg+0b0PlCpdGLt56/Qo=; b=E1Ccyd3Bk1ekw1wOWAnQuOQTPfYOSwPSJH8T7HFNUEZZyKlDzAJA9++yvnsjdziXqD3hr8Ta/E3jsA6dGo3B3+07IJtwElw8oWgxRQkTmegJKWTkWHDIAOJdLxqJawgcymhwDg2nc9VuvpHg8ycoTZz19n6Il6nhQC4yqSfh2bQ= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:45 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:45 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 6/8] remoteproc: imx_rproc: support i.MX8MQ/M Date: Mon, 21 Dec 2020 18:06:30 +0800 Message-Id: <20201221100632.7197-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e6c5af50-89b9-4853-acf6-08d8a594360a X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:61; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wdCOub53zQZnm79g4azlPqAKccJDwWCXbeLFr5tQLF+ShI9nQbx07YM6OdjvlGENMr1tIUGd6zZyqpcnbI8Fbxldnxm3c///1Ztxk1oV+KMNpVAEOqxjOnp4Swi19AVQkVDAoSsnSw6Ppmn9zVrSaw9BfccVjWoOuhhrcRG1xjW0oaU+UJaT0fCmsTgsM2XK2a/02xyvhX584K5dnTBFcNCWUkAFFEnldp5VwTiG0yuARtvl/eHJpDygSBehzx+bbJu9Bftcz5Xx5hwqAKPUeja0QNFQu3/ulGNsfs8iNvrNB7vH3uBryTh8vMfZb2OuzxOaZNNgYpunedTRbNdXfOkRBOtCd/QGvpqjgZFVCu8XG5TfHTi2/qLsoJ35RAtU7ICqoj8hcETtThMVE2P8sA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(8936002)(6506007)(6512007)(6666004)(26005)(316002)(956004)(186003)(86362001)(1076003)(54906003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1RHoi4LNe/b0FggJLcO8aP8vAVRcrdyyF7cMj7BSQH0BfTevxDlzxEUyVY8JPllYlRqHrjwJcTZuc5tG8gZObmdQE8G9nyUtBl6+1+6cfvWECtf/PEBMtFeh6d2+ELlDd++M1qbTASuj4UnZ54vphYRdKRXKzbtqzXY8mQXxPFanE7epeOWccQ+gCVDJppxt6bK2Hpx8Jr3N3NSAKBtgpNW6DMohmt6zzD435qFFHUAvh4cr1fZ/O+QHvkLZ1PiaezJQYNTOz897e39oSCKT+cDcVtao8x0WMj2MbfpALJtiUBZiUHZf8JJ+GUQ30B25D5HyctHelgakGgTV5yp0jfyHV0X67rMydBYtUUlUo+9QkXHO+yBZUEl1inhzFvRxdAHjjw38Y/T23Zze7xCLoKDFrY6/7Xrp2KKgVPKGvEC631fWRikIMwQU9rOPN9AFMvkccR8qz//PE55VLo0K8Ga73f1tnWrN13BrCPTUWU7SC4UT6oVZNaqW4XYRK/UCMzbku6V7CvhmWfsQ0L6lJDJieOVJSTxIJBfrsrRAUTywB1NpmXG0TQVJMjubM1PVD1i+0VssaMiOletVNzzMlxiFCfVgwYnzVeweNLWrAtVT8rydFMhzS8IYmvvqXxQ9qE2GzP9YTibzqOHkptAWZYKS6QzrONV3+r0eyP6ILKwF5K+yRg+szFRaY2VnpVeBbSWDf60rHskvnf/w4c5kGm9OFu5dTuEglTk+0O08amXhqzlfARava43KYqOBQY42daJFr9oz68duUVYcfxpcX8DnR6tr1GOqd6NXsg49a+yhW2oFQBhsREEzYnesjRQAi1jFwotHx/Dg0uItQCfm1TDoZsDQPF6E666RAlIBBSMjHYLCnBCQgbHeE0p3H06/b7Ihm7EF/r+00R+5ozNJ9cvdChzWkYcfb5Mj3Cd1eKCNu3E/fjVbPjJNS8H1Zdres4sMzXGzIlQjiRSlbKTcZ1dsWoC05yKSUCu7wsmJ6tMJh/lPYbeYqqbZSzguVvPw X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:45.2077 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: e6c5af50-89b9-4853-acf6-08d8a594360a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M2XXIUDaCWUkdEanLR1rbCkLc0Ud3QDKZOx/LuYglMousTl29hY0t+f6KEpb5u4K8QvjM9mFqrI2bX+SLzo5+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043850_399048_445F05B7 X-CRM114-Status: GOOD ( 12.13 ) 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 , Richard Zhu , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- V4: None drivers/remoteproc/imx_rproc.c | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index f7ca7e7954ee..9ba996e5001a 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); From patchwork Mon Dec 21 10:06:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DF21C433E0 for ; Mon, 21 Dec 2020 09:40:30 +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 6787A22CA2 for ; Mon, 21 Dec 2020 09:40:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6787A22CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=R+xtQYpjEr5VJC5HHsf6X60EPde2RukN0ZPKxrRG7z0=; b=xz980lDi62RkyYT92p3vt44Sd 4KjmQqMk9Ge7E4Z5oM1P5GcYps3u+etIwujIE2lzkERsyVxosBC5ExpdaWYxcSC17wFY3RhrielDv Y54ujxLL66HPY6/3mCayqQR51ScYw2xNQx/MS3g6vEjNFUYpvIuoLH4UQbnw50PpunaS41GlLOaWg B5DcyNYkdVrZmosbJYubOvOPk20QjWeVUhGV0T/l2jeevUVgxb6W1q2OPrGfAFXBoydBGQLIRWoRf olvUx/FXZXyhw3bkXielZa+ADuPegQpM9PwEecHiO2HZIgUpgl+1d28xps2P1NFq95SOfIWfrziSy 0OocZsa8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeq-0006Hu-Fu; Mon, 21 Dec 2020 09:39:12 +0000 Received: from mail-am6eur05on2072.outbound.protection.outlook.com ([40.107.22.72] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHeX-00065T-7v for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:38:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C8NggErQCJkC+z4QW1wSWFQgmUa7FRMvKD888KQ1JGrjxJM1ciB2ZgZZ5JDESlTvfSx31N0eCcKK8X9zMYaTxb+wT4+v9vgqX2e4+1n7ZuD07wPs3zF7XJK/1f/wTQrLIl5iH8ER+61Hcevo+Cf/L9banHN/YUKRKgxLlTYsT9yY5SZc5/haFiCHBa/mTvn9viOGQEtFFaXDN8rqROE2yLdf/1CRzUZm3JpHb9e4cOZv4H4RruktTEhdx0KyiDg+POkNol5XnKm88xtJHJkGIyF7hs9hdoZffEDkTuGZOx0F1Hmu6vrsFX7nTg+wSMI0GE70hyUSVXdM25lVCV7+XQ== 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=hCrwUW+aX0WNrz3js7nxK32GXemgaJzd5e2vwmVvuYY=; b=Sr56Ds2rMPRpNa4/NfCnZHs9AH4O5qKK1B+ctoUZ0q7Tj7ZDDid2QPbo+GHffV9SUHfbgEc9Ae6qJnmkGY+pinUs6zJUg69GPWY45Kg75fmW9f4+4jSeXpDEPOVQWiBQz8vCVMvc47iN5RWL5sMtjmB4qEi9yZx/G9UqhFK8VGjvWfxW3mP/+s/Mx7RGWA9na6M8yZK6ia5PoSJU1qMLdPa2cErLs7gwZC0hSwnyR1Tj08LOzBWX4jzYdBTUzPNseOH7DHTI02iy8XVooGQYOFjsICp6jplTl1mBJL3yDKWYy//PDB733228JRjbEpMNToW2BwzlUMopFq4g5Yg3/A== 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=hCrwUW+aX0WNrz3js7nxK32GXemgaJzd5e2vwmVvuYY=; b=DI22UH1MUfjr3QIdSG+2AnkIcrtioZ5+OyXwboTNv/R6tqLgFKeyLkkAs95PfTHvhdKAnjntTk9Urc2MgXEF8qyVj5g/rBwEsEHHEh2gBUyeBAYSLmkL4gD/7VQ5nNRTlXediq0T+F17pAmmSAlOdVB7/hx1PS+7jOuRvQK94uU= 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 DB7PR04MB4633.eurprd04.prod.outlook.com (2603:10a6:5:36::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:50 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:50 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 7/8] remoteproc: imx_rproc: ignore mapping vdev regions Date: Mon, 21 Dec 2020 18:06:31 +0800 Message-Id: <20201221100632.7197-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ca25a53b-b9f9-4ec5-2c2e-08d8a594394e X-MS-TrafficTypeDiagnostic: DB7PR04MB4633: 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: Y9HfCRro5/AnGrXa73uuhWKFs6ij+o7rWFlQHVULcW9oWvnJbkeVR5HCtZ/AQOkneLDJ+GMj4JCJcvdEp0COE/3hPquVVlH8B7ve2aqgoNDSmp/gzoHlt73viWRZkdj1b6zLBAUUBl46H6sERNyBnEKJIxKGEYNK8Kjl/NgvC74pIHbv3ddJI14jgKdP2m6obaXof8qUNEqG8Ltvn5kvmMKNs9b/B0e+tAFB83czilfwlnih/WFnLdhErCpougTbiRexqRlFk3j2z+UqDVUOZm21M7qPKblzctJmq76jv6Mba/b5/aKy0YXv2H6SG4iMQKiQLtORGBY/UYWwagrca/d9OO6oC/9DhBsmpCLMeh9T2MECT9ZMMr/Tjs40uGPLcCMa/23zvYhLO1rtuUYoNQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(136003)(366004)(396003)(66476007)(2616005)(4326008)(66556008)(16526019)(86362001)(956004)(6666004)(5660300002)(6512007)(316002)(52116002)(6486002)(66946007)(6506007)(7416002)(478600001)(8936002)(2906002)(4744005)(8676002)(186003)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yzev8UgSwtVsYR+MJyBRqY24iET6Ty0IvT3cvFiSu32Ku38m87OFuOaGUnntDLHyvtITdJKj8R2kWmBiBiR3op/HQVBRORfqLevudTajm8z5nyDBsRV4gYuYIZdIQaSrm2FXTGgXUr76shvZPH1UjB9W6iIeRuRQdQqCdOoZ4Wpjstb2k3U0RYqijAYZ9a2CwKFAtouiBYvsQsLre04FyBBhURUeI9MtvCIGjvR9oZegGcX4vMT7Tga5EFX1ik8ES+qNHNjdfVhnxE2A+PjXSWIYwEnuBN5pHyV+2vLPLOBXKKqvljs75lK8r8D8ZaGslqRt8beaNlwTLYx9iEKp6DnSWHJDJGq/lrWqAkhuTczpOiMigCPE1/mJd7O7m5QximrwQYA17pCIx3njwK5/WwfoEwyHsZdY1X70vqz/f3Jr/KbCQdzcVad/ruGu0fyOVWBqEiEMIYDfxvBqkIp0Hy3v79s+3aBi3FLX6LZ4PdKEfoov42RWSEVHdq78BAMr3Dp6AZFt8LJqhX5R9mGe0f2/tpY+FhLH6Eb/b8bJ1wlw/WCG2torzem1CsD5SqkhdRjCgkiu5TMjqcEHGeBArkXBF3HgEDWK/yhLxPusVJGPFAKghTwjSzjg9rkGyzdyQGou9cIihbpEvug1bvZWyEolnfDuMHj1oEnCunn/+dS/fZZzJ0kXXk3S3bur1sPITGBmrdKk9mHDbGVATxShT6qSYmECN9rnoLXo/UJ1inEL3KL+/llc1060uTg/WkuNrtflFiki+aW83nqxpgxN3U3yBIrEy63QXeI0J04RvYPGCFQj1mDqj4hyNQ0rx8TlHf1EcUA0Ifq7nMedUf+/QxPXy/k3PS9ohWyOma6onTichkpinnsXRTbTFykD2zz5cDb1IugLUxXnMrlnWeVk/cuc/z7GP4m3dq25m6LLSy3uJ4c3KR10o/bNO32zRkyxhDMInknkuS1dl0oRk4hxelV9FSWIXNzJIrQzIOPQD6Hl9Af/IN4opL0gHIyzbtF1 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:50.6513 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: ca25a53b-b9f9-4ec5-2c2e-08d8a594394e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pZ6MmOIpv9OyFuRAQXRTdbK6DMakoTQ8s0TASdkAvjaOxJiZA9nX7AJavr/cG+fteIWMRVJVpiXm7rNFcD9s0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4633 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043853_375394_30DA3DB2 X-CRM114-Status: GOOD ( 11.39 ) 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 , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- V4: New drivers/remoteproc/imx_rproc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 9ba996e5001a..fab191a485b4 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -417,6 +417,9 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, struct resource res; node = of_parse_phandle(np, "memory-region", a); + /* Not map vdev region */ + if (!strcmp(node->name, "vdev")) + continue; err = of_address_to_resource(node, 0, &res); if (err) { dev_err(dev, "unable to resolve memory region\n"); From patchwork Mon Dec 21 10:06:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11984393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0728C433DB for ; Mon, 21 Dec 2020 09:40:33 +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 7996F22CA2 for ; Mon, 21 Dec 2020 09:40:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7996F22CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=bHH8ssSjlM/Rq1gN48dCzVD4rDbWCDtmenKJxu1qwhk=; b=G1YazxBpttC14AW2XOOfsktV1 eCK5nhPiRV9qkuM02T4NEXZD3KiVPwJLy311X9YpdM7JuR8EZqklrP6ZCuH1a8c3gUJX1hvxlZ3TF BOrhhtpcZISoCT72Wx06hsgtEH8D5a3HMbYKq8vnkip19VVNcOaVz7p29Ma9sebH8WCVtWrC4R2a7 Xyl2N1Feyr4lxcsEyZY3y+OWN/sx1ObSWkgDbkxYnxMyJvh5TaMdzyWc5SS6ZZZ50yPki6XkOw3N+ T2T7/6WJwupP6doiDkzEm1XSQdhEeIfcsuStxBbmOmdPDyaFN2+a9jS7t2W3O8HFX0Jsyqyr3gEx/ nm59YWEkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHew-0006Lc-ON; Mon, 21 Dec 2020 09:39:18 +0000 Received: from mail-db8eur05on2053.outbound.protection.outlook.com ([40.107.20.53] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHed-0006DQ-L2 for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:39:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aZ1Adrv6RjHsF/VWzZcQ5dO/3ISchL4bhMSyELRigp2HuHlqIvHA45VBOnkPonCupa8ZwbLsOMCUDSL+kkbcIQ7QGO8VrkrtIFPLWnZd6A7w8DeceSKTHC6ZDNzbrWwEbUeP4WSi3aMAA/3DnPOUMEFuLHS3j/PstfVVt0UvyBWh4TYlNKkqybgbI186EgfuIBWf74IqVdTEA7NjN4c4FW7RNb3FfJGaMDrSHADaZ0ocrfHmeUjLvVE8H5d/rB6IrglLyb+LoygH9wPHfb4vPt8Mncdqi0WtfiUnT3JGWR8BHHNwARWO9d8yx1+vs7CBF+n9QIv9xomV421OIHqxBA== 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=q+Hdi603eUzvcpNyxZ+Yj0vNPyihCXJfbrhMq/LFZw4=; b=E/5dYZAaGG5qaH4oAM1sl7EG1Y04J52uzj0gBBsY0p3qyw6aQB3QeuOdZAn8PmR91m4B20TRjr+YgQGgnFjzKgDGnG0qDEnxMX/OrdPYErmFMvBOzPn9k59IdNZbLQ4dv4AU99xDAdB21WY8qFWT7h9J3BIA+8GCJl/isz+cfLVvCBpV819uqqwPp22P1KCjSbAaIkBj74h53Vho+8gO+wwRxCkGOGUxFYqrv2nvLZ/KvQjIhDnW6jf1vJDRuYdOLc1PmXq6lw6AF+V/NuwS6Y1E9gVfi4zTIjzNUr8MiZ030a17GUHCO40a8jL+5c1RDUKJI7sC31wXt/0JscS0Yw== 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=q+Hdi603eUzvcpNyxZ+Yj0vNPyihCXJfbrhMq/LFZw4=; b=MVKP5WCaZwX0uqi4ZwDd+zLQsvw7ZZ/N3RR2/TUmMSQcXO4BFqjJKeMT08e1o34elLDytzBOe+qLVGmEN7pvwl6WuNnjmYg7b+gpIuhlUdY1OihgLdCp1UTQz7m1Ygq+BrC6qr4cSGM7bumGhJvqQk/36dweAz00SukNvRP7LQ4= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.33; Mon, 21 Dec 2020 09:38:56 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 09:38:56 +0000 From: "Peng Fan (OSS)" To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Subject: [PATCH 8/8] remoteproc: imx_proc: enable virtio/mailbox Date: Mon, 21 Dec 2020 18:06:32 +0800 Message-Id: <20201221100632.7197-9-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201221100632.7197-1-peng.fan@oss.nxp.com> References: <20201221100632.7197-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR02CA0110.apcprd02.prod.outlook.com (2603:1096:4:92::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Mon, 21 Dec 2020 09:38:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 380f5f7b-d321-42ba-e3c3-08d8a5943c92 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: 2QOALAVerW2A+RCsXW5hcJdUdnU7oLPJe+QjZf3Guy8sOqddl4FBy9goMR7+Ut7sQoc4uG8kW41eegwtULuSge1yQU3WiUj0ECHph9CawJp0TCznCUJ+tVoTOsMpWVMOZj+OvDObEzP6fY9EOTfbzE9N8K4ZcdGPh+94lPE4zfd1YWho9eUa1hl+Eyqi7qOFHoG6U2rNP40bJYcbcnP6OCxCwcjCxi0NqKSKg94WagJnq4W2wHara1r/XuuZxIrNlx+OQ4eks4UxLrNcQKTKAR0HHSzrZ8oxTaNnMhRAc+V3mP0qAT8vpZjgIDvYR7Fjced3R5we6GkYUjAoSWcxgx+ibTcHrMshD81wO8LP7HR5/NjHOEr+8qLXx8ojZZrxaZBJrUAvzRirtKwcmCALsQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(5660300002)(66946007)(478600001)(6486002)(66556008)(52116002)(66476007)(7416002)(83380400001)(8936002)(6506007)(6512007)(6666004)(26005)(15650500001)(316002)(956004)(186003)(86362001)(1076003)(54906003)(16526019)(2906002)(8676002)(4326008)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: po9gBtuWWd1LKZlj6f3r6WL8Y06peqz5WFRo71olGvRrkl4ceefwT4PWb1wTVGRArhoLWXHMKVXdT8+Jktw+FCcvL48nArAIwUDrKlFcjvccC5GSLE0Zl+we0B6PclGQ4v2aDs+DUk8EzfUxAyM6j0VH1sBy1fcBG6qMYFuKs8JH6u28vgmY3kPY/4Ei54Ubat54ZQOXYj5shW4tVmvClS6qNxPq5rYEVN2f0y/DyV3Rme+62U2fTKqmU4ulVP206B46M/wjNMj/UJ5+NdHHDzVJZcAFWAIgioYE8yXLy5H7MDebjW8x7sXEdgGFsMiiGuiZ/bkN5Xw3s0lLQOrZzJxgFxyXRUW9kS/DNkRuRIt08Kly70eswuGlKmFdJVQ01OV7vxWogGVdNffmx+57bDo2ljPOTGl9NOYOUcYUNCX/XxpjgbOR3KHR5sYqEgI+3ztV4cNFZOTywrhSE39G4EM8bdAONUDPbiEHImAb5QsHtHqaICmQlKIO3tHhEnP2CM0JYXDgnwiWZ3ocq0VlDCCARFFVA8e3TwjATse0X9cMRMkPr3tsS7whQX5XHOW4ToEeo86Ci0K3Ks7QR0aLqFVA5vVyeCOpmjNX5MKDsjS4t+bLa3CBYze2nJdj29UU2XhTT5SaBrxMEMebx1EwpX71PEryMOYbCwstDZsM+Sz2Q13pbE/Pg1UA6DgT/FMm1RoEPcARoGXVaGKEQMQMx/oYpoiTH2BU/Ino3wHgEICYH2dmr1mQJwrdxHs8gMUwW6OZ9GODQ6DZiEwNHNIQpF4wiNTrulpRCzcp/hiwdVHUa5nfWsgk9Mo/Twy7m63s6vLLMLvhyZMorDgK6qhrWYc5kKcdyrHZgimsZGMHdZUIF2sKYEvQuKmJjdsOC8zTuc0s+cbwAYr43d/ia28stf7KVLvnGmq/mNVBeypjxpbN8keU57WroFy1ApoO2CPfKNE4bS2v4EI2vQcmnYrN1UWkJ9/1eKk70AdZU/axPZA/1L4Q9njK8Z+vVj0DthfT X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2020 09:38:56.1568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 380f5f7b-d321-42ba-e3c3-08d8a5943c92 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GpcymoGF/B75djY6Utj10vA3NkkXISjwTHGd2b+31Bt8j19AZ5Tbq+qY1Qf/HSSqr+8IUkQk6g5OZahnPl5s7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_043859_802569_6FCC5E2A X-CRM114-Status: GOOD ( 20.44 ) 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 , Richard Zhu , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Signed-off-by: Peng Fan --- V4: Use dev_err_probe to simplify code Use queue_work drivers/remoteproc/imx_rproc.c | 115 ++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index fab191a485b4..4cc11a942bc5 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,65 @@ 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, PTR_ERR(priv->tx_ch), + "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); + return dev_err_probe(cl->dev, PTR_ERR(priv->rx_ch), + "failed to request mbox tx chan\n"); + } + + 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 +573,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 +604,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 +619,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); @@ -527,6 +635,7 @@ static int imx_rproc_remove(struct platform_device *pdev) struct imx_rproc *priv = rproc->priv; clk_disable_unprepare(priv->clk); + imx_rproc_free_mbox(rproc); rproc_del(rproc); rproc_free(rproc);