From patchwork Tue Dec 29 03:30:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991899 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C9AB6C43381 for ; Tue, 29 Dec 2020 03:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1E65206F9 for ; Tue, 29 Dec 2020 03:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726014AbgL2DDI (ORCPT ); Mon, 28 Dec 2020 22:03:08 -0500 Received: from mail-eopbgr50047.outbound.protection.outlook.com ([40.107.5.47]:26094 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726855AbgL2DDH (ORCPT ); Mon, 28 Dec 2020 22:03:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9gqtPHC++R7rbsxnRab19r7V1qAN/VfMsJ1Rgegd/e2pg2oQJxFXBKFq0aSiND1+hoBNu/mh7TnfzFR8H6thGRO+DLcFGw2ThM2cGIj+mrsj/PHDFWdgFxsWhrrDftrTiVMWkAU45JlvLYOd54dOGtpw/V0mZXjFmxO3PFoMGAU2WNe17BjPFvHwSwzISzrb+BqJ76fIqheXfPHTGVziNWr5AYZehuaYvR0O4GVw5gwFin7rWE0rlQjWJKhle5g9HSEn4VZ18t9gN6tUT2Xpazxr9q78QCTqXSUjkcgSCmbKlnCDRVGnSiQw72f7LxPIOXoJKN0+1w3UYJPGctrwA== 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=/s2puioSKo6Stie4/46zpWJ12TL9WHRa/U2UKWS059k=; b=gt5mLx/Gj2qIB9xyFzVnKwLn+v9UH1vOgV0fUDiMQC9eeeYR5KejHi9jfIjaP4w14eDo4nq7+wuNaAXy+srkXR52Me7I3Z3qyH5rHzveEdCcjRPdwTc8I1M+EDM05hUuv7/YU/wvXdCUiFCuR/msVg59K8fRVkvPwnNMtMddHUu5yygBxiMZSm4q+mzBdUQiZ1KWuq0Qx0TcSk3fi26QUxCw7RaY+3zN3YnfSilFA4w08exwvkFg0DURUYjOsl0+06CGsBUTWLxnevHc15+sL5n3v9t7QBYb2w6RQMLmoIv4zeJwT/eRAhUx8EQJdE+gM2E30fjH1rr8NrYyFZsj1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/s2puioSKo6Stie4/46zpWJ12TL9WHRa/U2UKWS059k=; b=XmZnImHPVGBCJtrz4VuquLaPrlu7S/9lqEm5r0Gl62AQ6SsnJw9aIihgvJbbio5YqlX4inZPlgqHtAOGq4Hcw6czB2dOsHgoI6OkADxZymdz9IcAEsw/wY6A6lrZs/FqI09Y2TGiKHIxpMcXgTv5LslgTRBnh8iTJPA+OBFKlXs= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:01:51 +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.3700.031; Tue, 29 Dec 2020 03:01:51 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V5 1/8] remoteproc: introduce is_iomem to rproc_mem_entry Date: Tue, 29 Dec 2020 11:30:12 +0800 Message-Id: <20201229033019.25899-2-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:01:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a4ef68a4-7c15-4fcd-32e7-08d8aba6172d X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: 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: zjS//PqIXi/7IegItX0NEMRWjao2CKycSzzWSM5XAvg22ntA+t1zhdEcfW3Un9Idi9ADwPbZ2G55X4u6yzVAbkm+F2e33PyJpHvtSmEYnpmcPlav5r1Vu2PgVBbx/BpjQGHz0q2H4DX5/Pm/zWavViHkmeCemXQALXftB64jlPq8BtSbZteHSeu830c7UciSN69yV+Oo0iVNSU4LeiI4fHEP2oTXM+2IVa69zibeYjNVCG/POdxwlsnUkYP6fFWnLibbnYDTmrMYHP7xnCCqkF4epqDv7EONk5dRvQdY2Gf28VEH9Jf+dOXaHwSpkkQoayLaz8VghmLrjqn7Fqvr9EIKZ586Xd9wghn5k8uae9dDVaoZoyAdWMHa0DQvbaED2LiLdFM1Hxcx9yglb03iJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(4744005)(16526019)(9686003)(2906002)(7416002)(2616005)(86362001)(956004)(478600001)(8936002)(6666004)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cE3ATSVD63yKVoIEibHV2KaFxAxDlpuBXIWH4IskiLSVbxcMBvYaz0iwjewfEW3tKiJQcF5pMoL7V2DyrRm/elIU800yiwnPXrLtPfTDAg9szwDXQuPG3DwJKNk23o1e/dMS1D1RXeeBSiwJdvC7pcUTWmGGXY5rGNJDoklHdK1yTIj7K7Qq7VWoRZlBTldb14ybOsK58oAd6sVGQ8MdQK668TgqjHeuE1z3IS5UnJYIMi7bIXD2ai+254vcgPNYRMbH7AMQjsi5JLiZwf9dOKN19Q/laZu9tc3NyppqtyBDEMVJpwmSBHNSPyDE0rIo/YmfmGnBLj46M//Sc+8eB9xDbGLOQWP5Q54QBbkpKU8kTXl6xYKJ6Dsc9xefC6DHPVzp6wtYdWxy2ma70GHgktJJ7QVDNNBzd6KVH6iZqJy5K2fMVSsbV0+F6JEwvkquinKQFzMeqeK9ylePh4/BrtFoI3iwCfCP04Hyj4t6KFOY7EhGWwPGDIcHsZ9NwvRBTbc/8itVfWTKsV6VObvlqvBctolb+N5mqL+ujeDaSsALp9T5nXFBbxrJOLmcRKX726G2wVCPAtUXELSHwMrUxgoYLwX2GfG7EH4/NIFhzNK8veZ2JeZZz+jTyKnyTqNLOOT06+VSIxESAe6Sj2LraTFIjUX51vX9RCVVWWGywIv6QnJKF3EZIXLkfMSw0Q+KahkCBTJqAs0wH5lTVjKyBDzbEgOInYCsEss/774j2017Y3y1T1WAMugHhjVhXOVzvda9ocjF+zwtSesiKcAXl2Jb+o6yzpwLSqMq/FihJQMRZ/vomD6GN23t5xl8Zjp23tYe1acBMhXV+/3ySi2cMIVi9VvscUfh4EcAY99+ZJX71b7t5+bfe9so5iRzMC6qb4d68V6eqQoGjzjWoC1XbKGE2RMdqoJpwYv+4vpWdE8ljGdKjl3nAvJaenqKZRsiHt0dtDTFiHfGFrLc0b7bCJTO8dSbxqaBCMBIyGO4rqYX5qwFTX8F0sonZK6z/EUh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:01:51.3904 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: a4ef68a4-7c15-4fcd-32e7-08d8aba6172d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RpUiYr7FkHHuTCOfVuuQ5loXXhAqB+DR7rI2juWYeESrp1g5UCxwNKmYgK420gj/2mhYoMHPY3XPRMpqoViuIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Introduce is_iomem to indicate this piece memory is iomem or not. Reviewed-by: Bjorn Andersson Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- include/linux/remoteproc.h | 2 ++ 1 file changed, 2 insertions(+) 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 Tue Dec 29 03:30:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991897 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 8A02AC433DB for ; Tue, 29 Dec 2020 03:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54D44206F9 for ; Tue, 29 Dec 2020 03:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbgL2DDG (ORCPT ); Mon, 28 Dec 2020 22:03:06 -0500 Received: from mail-eopbgr50055.outbound.protection.outlook.com ([40.107.5.55]:14917 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726014AbgL2DDG (ORCPT ); Mon, 28 Dec 2020 22:03:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b1gclSCGnDqXC3wBfMrRXnR4HmxpooRW6mbA6r6iDn/ikBfasQHXD5wCmRV0i07g/7UyWVFBhBL4JzLVPUqR7d4VRnOnGxD+Fh/g+4XWnrQFHg0qIGVu89vU8x6EtApxsekivbcXEBDSP0skZF7i8F5X5IeGFlruGvwwNTaOkBntJ5nYpRe4+Z0jm0EPRx2l+D9HKuz8YAFw8hINeMzksZHgnm9cRXPz4bIDYEpJodjl5upV3XCq5wUd+tMORHHDVpsRmufeBYOKKstitCad36z2i1LNaiMryGTb4weuLc/tr8bdpXlomQmOVZ6ii/j0jVT/vbbIX+kg15nDJmDHig== 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=ur9+vRnHcOv0N8SD26jfYmBb8Jnk407yr1s4O30ZUsc=; b=iSjjP1zu+SMjatEr4iYszz+GWap0J1YWxBr+zHF3ggyZgvvcjw5W3ldwD42/R4Hkmt9vLedSB/6TjADTh+c170EB6ZDw+3mvOGg+Aamtt5x2ALYAKPxtcoxxSFsKrYqAf0DKmsbJNNutbS1jNt1RfN94goEQ6swe9UFmEXloHGVQ+urEfmoY/taggdQW5hPxNFAH88sssyTUmeDZ9Ym5+c6mQOwYfIEAeqe/ORHrkRW9EdREx/QXAulCst79YzHh96cixyQLrkd5ihitqfU5feqt7vt/d8qzKjyQNMNTG4HR5tOnkGJRFa/rQkiRhuLxtoAetuDPnuI1n8uecpWRbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ur9+vRnHcOv0N8SD26jfYmBb8Jnk407yr1s4O30ZUsc=; b=ArREVuU8xr+B/pGPLlYWr1xS2EFR+OFRF1BuZHHLT12AwGTk4AnUdQcEACJ5vo9/bB6u0zCBa4GwFqLk45aZ+qNkd121OvJa92Vq9nj/uJM9OkZ+Sgzhh9stPheNI50iP8N+ZcR9pgR1qVBRbvZPpEcQWRQSQjAAQY4aO8sidX4= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:01:57 +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.3700.031; Tue, 29 Dec 2020 03:01:56 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V5 2/8] remoteproc: add is_iomem to da_to_va Date: Tue, 29 Dec 2020 11:30:13 +0800 Message-Id: <20201229033019.25899-3-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:01:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 69008731-e87f-4b3e-5f68-08d8aba61a72 X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: 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: rbLNQVRTzl5X8ixn7sv6t9zmQ40fTrXcZSD5QA684cNw09Z/uU1GjM1R/rINzWpdBihaVegimdMFCfj2hCpCgtYgNi0yMTBq0q96yuuu3leVzZHqCYVrFdZKZjkQkteRPtFAe/RJCKn11n46nr3H1N1x6D3MfVsbxB3kByReXn3ZR+eK6j/lpcGoifQRLC54w+qWHusTJy+bNqfkfcOyNNrJOi7Flb/iOMWBE6AOUCV0LBKdEEnXUrgKY8d6TE2BP1H6FAhAMtDilTytnZpqY3mJbyREcXVbz1ecBdxD7PCkkvNsh0dyQueTyTDf70fwZFy6A4akCUPcexRxhcy4K24kv9fOHJg16tyvnykPfRiBN5PgYsg/CQclHvieQkzPuvD/STozJ69OKVmJ9HwfXA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(16526019)(9686003)(2906002)(7416002)(2616005)(86362001)(956004)(478600001)(83380400001)(8936002)(30864003)(6666004)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kHRZsNr0lRZ2W7A5hNi5EcxPmnpB3Tj2TC0PDQxbKYQyMa5pRXbbQ1YJz9yXjcmeygoPP0o2xiFiAcPSbyFnf3kNPY11KIDZeaDCSd4nSjVcXtipQ72elQe8TkhtQQmUFqZDSWe+X0PhDDQZklxKpYpqXsO8JbdKk1vL9WXVpDWn6PZ+WeBQMpZ+P54zmOkY1DHBY+UYK6GfUCl8aGY6jp7r5ikbewftjB+Pp9f13KTg9YQ5b0UnnED4i7sOgiwFESEeuNzixNNqIFPAMmU5UTq1oMbQNrZTMnLbe8RsKxyNtp3EIW/rRkcIp+vmgnNXi8Dh0NkOpj/zp7nC5X6N15zZr9sgzKhiZWMKAvDxK1URT2Zwij7yFIvzFkL8RD7Z0GxIA8keL6mS4P1YgmPkV1sgNz8xbNIdQdqp+tKKMHsuTANt/FFX6sGihoaNpdkLn1CDoLsrlNK8+dTHfXsPhj7Zj1ban7MwKxPgJSjzuRyGSoOSZECF/MoHk+Ib5tNZJTzTQFNBcHHouP9v6h8BU3GL2oqqFv3nTyRQkX74weu1EypqKZKBIlCAb4rghcXTYthUCKysZNliQ68C1z2qj0zlm6qic3jCPMPq72LE30uk8EuZz2QDO1eq+gSUsXwVY4fxoTi81JqR3PVSh/fz6qyTmHMBNfEPsXDL8T3eG2Ihwi9nGAXFgaklQvz2lBwmo4JjTNg8aToAJ07dj1ljOiWphR4LTQ/ECryIjDmSgLMohEtT8s36FdeRHyDelONgMap9peI2HA/0TtAzdfRc22R0oCysfrii4eZq8QgJO4XZCdIdzxrsjkmxr6nUKGv4ERI3/D5iLgmNSvdADl05gHCzl0bDNk4nRCHisWM3sO8doBjxyz5EGgZ+6e0oniJjHKrc8MAxTqHeYSx/8Vit+IixZFwkYECZ1f0Wts1dWpLl90v/qwsSvi7Yn5AjnX1kxFGqZ0YzFpmp3o8ZY/piQ5NfZFDFL1Io+yyARJ5Q/NTJ7ZMpTghd2GAIOtuCm76h X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:01:56.7430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 69008731-e87f-4b3e-5f68-08d8aba61a72 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B1r+y0gzWLkvDXnNa8B+Mi1mNka7Drg61BBWekCTu5PkTTiFBPEgtlnZsL6pcld+Kunz5lxAAm3eojI3Pu/tAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Introduce an extra parameter is_iomem to da_to_va, then the caller could take the memory as normal memory or io mapped memory. Reviewed-by: Bjorn Andersson Signed-off-by: Peng Fan Reported-by: kernel test robot Reported-by: kernel test robot Reviewed-by: Mathieu Poirier --- 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 Tue Dec 29 03:30:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991905 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=unavailable 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 6E6E6C43381 for ; Tue, 29 Dec 2020 03:03:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A876207B6 for ; Tue, 29 Dec 2020 03:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbgL2DDa (ORCPT ); Mon, 28 Dec 2020 22:03:30 -0500 Received: from mail-eopbgr50055.outbound.protection.outlook.com ([40.107.5.55]:14917 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726429AbgL2DDa (ORCPT ); Mon, 28 Dec 2020 22:03:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S+17Oj5lBe95q3W90/dvresZVRZtIf2jAgqUOqEjLP+PRs73r2ufuqWW4+PYacyM9dfA3wjGRXMD2kWBhgcdaYG9baOeHFb1o9DufFtrQhMRqEHlIPbAUvjYEGXRFDwPGXd0NBv2nKgXec8EZzKHDUQmAxolxracBszjykeBRXtrZfvj1Rgga0sm3lC2edc/ezhuPyG03oHxgngVjDoJFroZegRzP1qpOBcscr5ZywQLja0MVk8AA9K82g4WCoCEIZqmF/jApBvr3VRSFcDcsb150/agy1o2dlf1sZzMHCEqlCR5m9I/VfbJFHb/yrIJM0tap2eeDnReU5h+1WH6HA== 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=0Y7nvuV6YmxTo/n53V3OedPl/HPso53UW1BxgRUtTA8=; b=OCWQVYyXgQ6MEmrY7XhUyqblqOOiAEdulqQA/Jx8yaCveqXtH8aH0NgGUTMX2yBZ5oOHim57b/JmeHd9Y5YHYnSfmLmoj1NUBw/I1iRw2PA2D6Fo7giH+dZ3rnwzDJI9ettxjIqJW/NzUJOieGYWwTJqcLjw48byukKffTH9YQ9qvq9SfNDRPAZenHUei9uneSk9tlDwC33FLrBN0lW7LUNhOoRLfWNesl6MvqlRbrxwS3PLQTzD1M9E1BtZUtjfDkYVVXsTvWMX20uBGDP6yn3X+Bhng0u8Svk/1ww4PP2C1ZCdjd0BJi0Pdcf3qeMZvz0DF/OomdSOhog+XAlCow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Y7nvuV6YmxTo/n53V3OedPl/HPso53UW1BxgRUtTA8=; b=gPQo7vdsO5AuxE3//qQE6UI8p6VK4WfVVbt/IWTpWsm4mVD5l56jsEIOyM5MORJguoZYta3ELPLuFmquwbNDNrZy7rKl6KuZifXyAw0X6BQlZXKIeP+ng2klvbc646V2AKv60Jv0XMpJnLFTwUyyZy4o5sy3ho63Rd6lAFHyJqw= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:02:02 +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.3700.031; Tue, 29 Dec 2020 03:02:02 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V5 3/8] remoteproc: imx_rproc: correct err message Date: Tue, 29 Dec 2020 11:30:14 +0800 Message-Id: <20201229033019.25899-4-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:01:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cff33e03-6a0a-4d3c-e2dc-08d8aba61db3 X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:989; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ak5S8N6jG9ignrr83CQihDxyonOV48JY+ynpMmiqXiGVsJ3F5AYEd3SiyDDcBW+kP+HYeO0f7kXHoN1vfLP7axDQuUyKgfQsqwW5CNpIBE3Gpi0H0adyr+9hPUymwftwBjBEbVoNoDnJ8AHkZAQMaNBTJx47eECdzLdq6cwteO8w7uyIzBgXRolwe1VdvK1YAFNBwk5qnmSOz02OuNF0zTVr1xPNWQrpcE14x4y3LZP3qp60Fo54nVykUb6I1Pk60joOZ+hWSFV7l+tpc4BMaZKxvvfhzMDtSjJ5fIuW4nvSl5ZAXDDiKzf0CF7m40LKOOXve7/p0nWgBrN7mloB2t7mZj6Z0QipF19LSAe1Yneez1g+OcUIocaBpMkTTc4fznMtSknBFgrkoUge2IvjOQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(16526019)(9686003)(2906002)(7416002)(2616005)(15650500001)(86362001)(956004)(478600001)(83380400001)(8936002)(6666004)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CK5og8gM6MtL0ZUd0Z1/2/g/RcXkgivrdRMlbKSjX8ikyxbH15Q1MtLW2/sv9ZHK+75YwGikGbX4CssWyUUsYtlsoTPoxjtOjRrqmkm0kc+HPhZ6bS8oTYJJhHqJYjBJYIHYQshb3HpzoedygROG4z8FxWFtACpEiwjCdrMO+G8KkuiylS8jPezuoVxp3NC2Cef/8l7jR9Wa+5CCVPfl+wf2yXkB6k4rbBwTuXE7LlA5ffM5u8P3Qwr3iv4uPrkKDS8c1sHk9yJt25pgIzFeV/hSeLpm4A8xw19HZPuB67o4kv9Qyh8ojzXImwhKMdw0sY1ZLqfP6psQ2SOBxw+Kfi8lWkw7yIuKioKwEAp8MkHTn9zNr/QQSivogoyv0AguQDEgN9t6y6F0Fc81mLzbDJkv91naTDAcqBpNq6zdNiS6/SKv8qE/DBc70g2yyYAZsa6Q6lpTDqMrqw8VfuBIQZcASZN0OkmW0atUQYpU2W2hrKfAaMuR2APQiLNTxCU2G7p7Mln+SQH4c8sVBsIBXXTsfOFQWcbjR3aPes9kXRTGCzGfj1MoZO7Ni25BOup7GQvO/GwQpz8GQuIp9364sMHwE5kBsFe//vut4rbnILEnKjiObP33hdrNwFQ6sPaVC+UGt4A930OitAn2jlNLWDSIomEp71R0k91SoR6g9IeG5HlVWwNP5Gt+S2m3CJWPgHHABtOtIKY/oiGEK9BlEMBRP1pLDL+Mh37jx2ulNqhg9WdLK3ymZ2qHpNuNeLYOmxO6lBUSJHA2n/vDyaSEO2CwV2y5pEgw3uJ9/a9Bo93XvdnysWu+ljJgIYxom0uCDtxqC82FQycbsfyb5S6UIXYRXg4/k6JTmvw1pWb6PUcg2yKOdc0MPbGz3D8Myt1J1VIRJ+WDVQQT1E+JfBvug98zEoZvF4wf8IHG56Rzgohwab9brzVy6l4lx98ooDFcZL97m/gXm32pg+UgL+d5csMIycolVYy3cXzh2qVrVSVwe8f6uYPfPS9QsEX8Ons0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:02:02.3044 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: cff33e03-6a0a-4d3c-e2dc-08d8aba61db3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gcN11GKvU95JvagQYVZf5Du5paA9yqq0aU2WOvwyYIqk5nFM3Tblz/RxMlT5QxhQ4MFTPdtHwDvbDWrrdzPjtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan It is using devm_ioremap, so not devm_ioremap_resource. Correct the error message and print out sa/size. Reviewed-by: Bjorn Andersson Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier Reviewed-by: Mathieu Poirier --- 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..2a093cea4997 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -268,7 +268,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, att->sa, att->size); if (!priv->mem[b].cpu_addr) { - dev_err(dev, "devm_ioremap_resource failed\n"); + dev_err(dev, "failed to remap %#x bytes from %#x\n", att->size, att->sa); return -ENOMEM; } priv->mem[b].sys_addr = att->sa; @@ -298,7 +298,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); if (IS_ERR(priv->mem[b].cpu_addr)) { - dev_err(dev, "devm_ioremap_resource failed\n"); + dev_err(dev, "failed to remap %pr\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); return err; } From patchwork Tue Dec 29 03:30:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991903 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5A18FC433E9 for ; Tue, 29 Dec 2020 03:03:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32161207AB for ; Tue, 29 Dec 2020 03:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbgL2DDb (ORCPT ); Mon, 28 Dec 2020 22:03:31 -0500 Received: from mail-eopbgr50047.outbound.protection.outlook.com ([40.107.5.47]:26094 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726558AbgL2DDb (ORCPT ); Mon, 28 Dec 2020 22:03:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jbY8lXOSDWeX9a2Og3RD4fvZ3PubysBCz4YGpqqlIxJwO34QzsUNygo16hS4EkChjM5QNCwxBayFSUBtGmFVkl1gCz+TWIyX1AsFEkC9hjMODLL4GrTRPk8DOGdPOJhjVtkOlEt4DP/pwPzJn/2YxGSC7cO964gf3IFw6zSIAxIoYMqD8KNbVwQb1kupzgztGhDh9Z5O89byIinEbfkxWG3t46yPD34zO9NwcQPAor0DvW/DD2ehRj61x1Rob0cKvh1/xQqxazFJv/zb0SJupPwdY4YgRQ8pli6tNfqGPXkAAPh0i4MjvBc83szJGGJrxuzgnWTQU5OsxB7ExMDQfw== 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=Ikv+A6H57fhG1mI5w036+P++FNCZzL8Yk30kD3Liq/o=; b=ImqLccJqvyD3oR1q0Si8qMIagmjs+xsABAT7OViOx47YofLAiNXnjgqRM+BDg0Qk/WAWHvYCWiztz9jSX5fj34AM+IkN2mUOTlWD79gbad2x2JkzOthtNtim6mDAhDQJ3nrGEOv6JvddhPCFVAY0JvwJKfV+k3TEU4kTOeShQQYjBDHAsvPMtEHjKCGPSGy91U9EmVw7S7KTilcbZRwp9XUE57znVdrLFlV6XcOwcebT3xmU6YGRjpRkEatshDMnyyXPzqFFqzGWi7MfNvxRXje6qJldTIw+LhEvIFb04Gy16tdMoOarzuWxqnwKMMCC1F2StV8Xtp/PN0MisJSWRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ikv+A6H57fhG1mI5w036+P++FNCZzL8Yk30kD3Liq/o=; b=KRlDuX7/atAyZUXUANW4A5GT3Q5i1WN7Zaqtrpz5j2yeTmcD+HM7D8sSWXW+PAGHWSXmRFIo0nsxlc27TEYcNDrxqEGouCOx724frqvhK5nAb1PeRfQNTZpHw5ijP5o+IAde+IgKXCCod9mQGuSav+yWcZdIjbiKbOmv166zCqY= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:02:08 +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.3700.031; Tue, 29 Dec 2020 03:02:08 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan , Richard Zhu Subject: [PATCH V5 4/8] remoteproc: imx_rproc: use devm_ioremap Date: Tue, 29 Dec 2020 11:30:15 +0800 Message-Id: <20201229033019.25899-5-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:02:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aa64af5a-c7d0-419e-c503-08d8aba62108 X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: 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: 2GPCQfft86/dc2mhpuY11HYjoPKBdezymWoR3qR7/94z8u+Gdse1ajPSC/C/EcZm6Cn4Re0kMT3DLyJ+HiKriQsfzQukdOXw2svhLy/rKWLYza7mx4kFTmoTWuohMWvt2fZhylZFr+IeNJLKw3r56jNGLQ4UQYAzRsOdb6godQYtr8vuCMpPjGGLHaSbr7/IqUugZvTsaYFQE5SyfjLnked9bzFVPXlkvzykKlRFvCDEUJPXPfFhwc5dsx1AoKeXy66Mdsx3Ucj+0a9o68pGUxQjyeNIYMa0vNnD2LGL0tsfw6t/YkapR88zPhEktC6vwU2UguqBLuOr+KNJ4URWSEKbNcdTFcxQMBtizV4J1Ujnil9GINXof2wLEsCCcbTdwsV0H7NjthVqrw6bSlXV5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(16526019)(9686003)(2906002)(7416002)(2616005)(86362001)(956004)(54906003)(478600001)(83380400001)(8936002)(6666004)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hRyIpSJ5qJ4z091E7NxPBCQTFZVBMP8Euy+61OZy87z+tCeoIV4PBWOG7Oo0++GT2f5LFdz/K+rFdGaw0UC2jZ64RtEtCaCWyTwNyeTb6gQKO9bLPBU5+EsfJWwY52gGIzviQHFFPKsQkJelBjRwpLlwVx0pwnBE1gt5CgVJBgd0w3DevAQwZCR1mHgHGxcSkgHhRIa32moKEb7szvXsbVjpWZ36MNzRJ6HufbYUrjGntBCivBksulekkLRgHC5TZ6HCDi88QPx53AT04Pwy92jrQDPhaZrHQ/S+wrnvYQLjAhVe6K4JUUn4y41tzbzQCP2Q6xhvakbVr8I7vgkZ7UhdBNYhENwg0sGb4oYl8ebwhwn7F8BQUI9tr935ZJLHdV/8k6wNm5aHSuvoexVhnWTq4xNIsNQuyxrdELa/V1YbsO9tkAm0/vcpUMasQbWrbZqYwo4sYorf223J00ZD5pmN5veCbQ4ppFJZpfKuVQ1rE41oznwaFnXQwTXqonDy5KVdrmc6Jn1n+nFMdisKdrU3mur3lqi+TOxYpSq56O0y6Kf9SLA3yj+sJnBVaWWtIA6NxrOuM6gmGdXYoVRjgHgvs9AUEgjBjcLqp1q8lGVtAkYzuLfYY7nqDLserxUymeIFAJ2mkx/S1fyq51SaUVFNxQ/ZUOitI/ZSHQeYwwr7/2ZH3LTohTlm5xddpUg8ra/ggPN+hudK/RNt0mEakr4GP5QC9bcMTG7O1NYouk3V5roH4XFY6T+mwGFmY0WlLGsLl4h0pA7l2/L8vr/X+q6ExlcrbfrB2gpiClAmv9DFOsN4jmSW6XyF8cuE/p268qTM/fThDwoGpD+mGLJSIWvu6rUzeTNAZugOQqEHlEoezbhB74cOYk8VA0DHA5vTXOjbLsabQJ6qFr04XrqDGfn4Al91lB4h0M4eqY3Nlj+uIy6AvSjFWTYNxtIQuQtOQZFXvqoTLLNkVKLlYYrNLOW1DA2Wr2w+CAFhV6Rgm7J45jXA81X5XWO0T6aVG6pU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:02:07.8749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: aa64af5a-c7d0-419e-c503-08d8aba62108 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 13Ypbn6HW9m8XcFFRKe+UcYuFY1wcHSmORDgSZc3Nwk874mSbiAOoL56kOQ6WEMuNo60y+6CEuhZxEdbUM9XkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan We might need to map an region multiple times, becaue the region might be shared between remote processors, such i.MX8QM with dual M4 cores. So use devm_ioremap, not devm_ioremap_resource. Reviewed-by: Oleksij Rempel Reviewed-by: Richard Zhu Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 2a093cea4997..47fc1d06be6a 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -296,7 +296,8 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (b >= IMX7D_RPROC_MEM_MAX) break; - priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); + /* Not use resource version, because we might share region */ + priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); if (IS_ERR(priv->mem[b].cpu_addr)) { dev_err(dev, "failed to remap %pr\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); From patchwork Tue Dec 29 03:30:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991909 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=unavailable 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 BE872C433E6 for ; Tue, 29 Dec 2020 03:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8284222227 for ; Tue, 29 Dec 2020 03:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727629AbgL2DD4 (ORCPT ); Mon, 28 Dec 2020 22:03:56 -0500 Received: from mail-eopbgr50055.outbound.protection.outlook.com ([40.107.5.55]:14917 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726558AbgL2DDy (ORCPT ); Mon, 28 Dec 2020 22:03:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D7U0aSEtZmOk1ATGpULLi0MQz29RiQb2/vpMdfRiDkQBeMN3Mg5lygk0rQJK2oVSF6yYgL7ddGYIqVWYxqHAINc1LlC+v0kmH56J8CPxyW20wZXPpRMhwbkktX02DekMo5d4ONeNTBFoPp+Zc6qQNgeI/UsT4XXGdDablsgtms1P88X7J6EJmodjy03r/vRj8lz80goCFY7kHxjXE24wnuM0c6w2fEnec0VhE8MYM3JoACc0ayVCfC/428OITrWAEjkWfKOd1AiBdYC53HoAu74t6S6XTq4vevGDFZxo/NR7fd9CaKOE+efA2I1KnCmgIxwZyTA6QGuJBVxpYWeHnw== 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=LG9BDPRqMs/013Xi9CMEXxbg2o8zx/tTgq02hZ2QeiE=; b=gZQs8NdVbDThcmvTvd6sieG21Xj56ILR+IEmRxEHC5eeWMSYzc9GL/ArxChhPLIE5HVNtrmL88HSMIGrJ225IuNBfxn1iS4R0gzHwyVtEIADm/NWTo4AzTpyPBnb7BqoPrSPw6/v8K67GhzGY4qp9DNNHi65LKwJ02zjtUdcYp0oasaF7CVJaDbHafhPViAbSeOOdXvrhdAheCatMl5tgENCBjW12lKIx7My9a4bPh7KVWsMsJx1q7ywe6TjFccdabr2Pt6YyzHP844Z1l4dYGhlL5UBGVLIIZNls0bnTagZLISQkFz+QD+YPkUZgflEUO9F7zQGa1mQ3ReycmXTYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LG9BDPRqMs/013Xi9CMEXxbg2o8zx/tTgq02hZ2QeiE=; b=cXKuDoXgQSXQZ0IdRmB+V9cYiTfMNWzm39Vxylo7ae8TYHFE8CpLreE2RsN9fRaZ6wCzpyUojjLs0LXrWPbLETfYamR3hbhvsna9/OiJjpC3rquvqO6Rez02/g8Gx+bPBB19p6gqVargVjMCVHXFNpCEs91bIHua7Uix5LuXULI= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:02:13 +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.3700.031; Tue, 29 Dec 2020 03:02:13 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan , Richard Zhu Subject: [PATCH V5 5/8] remoteproc: imx_rproc: add i.MX specific parse fw hook Date: Tue, 29 Dec 2020 11:30:16 +0800 Message-Id: <20201229033019.25899-6-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:02:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6f7d9410-7ec6-485b-db1b-08d8aba62460 X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: 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: 0zyYijDgWpyRroUplTKKduaTjGOh7cgADxWuldpMIYR9G//1M3MDnNbhWPzzt16BlJCY5PSfKVFEnOElbEzfa8Q84nJc1VwjRa2NnmASjXXyvmvWO/sW2AKy8OMtovOIBZu/UNZKIuR5SgFWCTYoiWQ+Oh7ZYdnA6347p+Anig0WhVfQhT4+NJVjjn1qvFRtveuALo9QoJtUfKNYa5H9Os5rLRiaNvSwk8LcDtQV477VROAv/t9QGzi/pHSFB2boXkjR8g2zuvMfHdbuFEQbj8uaGvDs5NVnXtEvBpmXKs6Qfz88jTiZWN54cydNUWNLadZCW/sNfsyp/XzFf/HaDdbqiSjDc7IIjZVO+H1p1ZVn1nAjemAyHG0l8geitAUzoySsctTCd4wBuFcY6KhUNA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(16526019)(9686003)(2906002)(7416002)(2616005)(86362001)(956004)(54906003)(478600001)(83380400001)(8936002)(6666004)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: QjHoHt2ldb6wH9Jfhp5UWahP4O2muJoJwrshtbqQyt4UbB0PJD1efKvzIRfrGKZFpCHU+c1lMBDGZt7zzw5kRdypZqy4/ieRv9He/QM5Pc/9Dy2OXJMig685+X57XqokC75feYfF8a2NRzdRi54Mxy6qjDgNID5AqiITUWc8cQxH1aE8pFsjkI7wgpE7Mgs6BjtcpFLXUe6+KwN09xb1vb0auLsw+dr+W8jLMHLlHrfzoIZKkcbUl5i63zN4VAcs3X0+urPRp14573OKdhx5/o8scTqZfAnjoJKKmPTAqlylZjxe0dQg+77wMw6DG6Dk3mF6ezrVRwokl92sdpV+ujxg/tM2syBgjBWolbFNNO+msJQ05m9HXVXAfp7BRKwK55xJkbX2/h8jK5JQKYuD4T92PNIg1ID0WKuE7bYyIEkiKrzCakhFsaC97YJ5HlV+pMt6C2bsBisOfKbamgQ7yjbmoKlDhhb5FOzf5ci9PUir+RVLOeyW0I4G3Fk9GSxtK8h2wQlcj58U+hRZ9RMNqMRd2dgxkv/qoLcatl3rwTSU3YDTpKEPLLLGZR6sVWdz1DVMcgzUkq4Z1/4MSYJUEGBA7ViasjZfVpx9+i5gsykwLPJ4HycT5AZdn3rnv54mmdQbzYLhA1UYd4LpMWNDeJJU6pgsf2jB0Y5BnjLVftsRfHbCIguymbqJTWaf0P1vBBiB0BKNXfj/8TFHgbi/P4689TIToq442Q6jx6FALCOpLlvOj57XelWT6aYKBzWqm8Ze94hoWRO7GKzT4hLt/wQ/XZHZ5OLsT4tr0EYehZzCncilqQFCAPI/9s1HeHhQ4GeARCu3DHUbhoB8Fjgc6QNYvssnP20JjrvjgTwBNcvGvv1zUef/RmSQuU7FwHSudtFflRSOIvlqEoH0kegNRmmStu0DoJQnLbWJ4WgDLUnase9u4zimVCcF8MXedrARNGBE/z8f668HOC9oFlcgBadG3KCG8ZGAWLb7VdxipDQkNkJFJ+0M9GiC3E9zZB1A X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:02:13.4963 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 6f7d9410-7ec6-485b-db1b-08d8aba62460 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AyfzE5WkG4QyXJG9OeX9L5xwJHDNc1Y/Kvsm9Uj3SJOT4BjyzTnxLMtKpwm1HIv4BuOl+Yhk2IIhtxm7HJ716g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan The hook is used to parse memory-regions and load resource table from the address the remote processor published. Signed-off-by: Peng Fan Reviewed-by: Richard Zhu Reviewed-by: Mathieu Poirier --- 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 47fc1d06be6a..3c0075dc1787 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 Tue Dec 29 03:30:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991907 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=unavailable 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 97F73C433E0 for ; Tue, 29 Dec 2020 03:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 631DE207B6 for ; Tue, 29 Dec 2020 03:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727660AbgL2DD4 (ORCPT ); Mon, 28 Dec 2020 22:03:56 -0500 Received: from mail-eopbgr50047.outbound.protection.outlook.com ([40.107.5.47]:26094 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727524AbgL2DDy (ORCPT ); Mon, 28 Dec 2020 22:03:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ix222R9Pufn3opFcaKNhfBXaiU3P0q6xp68QEONMwXxlFXyEZ9FHhT3bEumIFj7Gm9nvzBWpwx5rqiEwiEGDhFXdDJ7xYdqv+exl5d9dkvjllEbxqExCQLDVquNZyY5Eo8Yjpn1iRQ3qpBCm4grRT01PKh44hsCHECoejyI1zGWRrk5vR9o9ea2TFUIX1hsJHBfj5qBMJrkfQ25BPeXZfivcEClIJeLghO4TmZdqkwiwdR5a0R/qCea4JNtJ1K3qjOn/ZGhL2xFGytfazxk/3faK52YGq486FxBxHfJxwqnbL786dai4SY5jnzosvpDRXxA2rME7/KmPqFwrT2WaJQ== 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=WtFEE6M51mDGF/Hl2oXngxif0aENCtRhvK9AUN8h4Ik=; b=NOge53yr2z2sWhE4oLNazumxME+i9Oh6SozVIgvjEY1kbpL9HZ65/fV7ARvGPr4hhYLJ318ZgEEY8BgFbFhIcYzVMux9MiDY+jw7srJmEOWT6wlvjptYaDYwVo04zzZC52f9hYdBVEZky8UPhDjjZIt1lSvtvzd5e6kav6jgG/qKXsYgAtJ9nLBcqfCfP1CCxmjWoHo3EBEzJJ7bn5hAjeFJk+eRV94rEPpyc3uDQDuoT01EvCCwx4YaKl/JewtToPrgAuZi/D6By1l8X/02PoiPXUTT10OQw0y+avCEKYrY8J14mgyLi3Ug50VauCRtkR2yJwUrlG905r1xLEDlDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WtFEE6M51mDGF/Hl2oXngxif0aENCtRhvK9AUN8h4Ik=; b=c6MQRgYxU+LUMuEPNGJhwd6tonTK+TytUE5TviLBj5aPkuoZRZ3buP29gDO67H0XFDoDxgKBjUVNqWROlT+BhRlxbRqzEKmiQ0whM4mYXr/FRaVMd8wHomDL4GmooM8lW2HRC6LO4NwxYvc/KsKcxp6CCTp41VrKkZ8WIsDEh+o= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:02:19 +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.3700.031; Tue, 29 Dec 2020 03:02:19 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan , Richard Zhu Subject: [PATCH V5 6/8] remoteproc: imx_rproc: support i.MX8MQ/M Date: Tue, 29 Dec 2020 11:30:17 +0800 Message-Id: <20201229033019.25899-7-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:02:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f3d298c9-74a4-4e66-21cf-08d8aba627a3 X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: 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: QHXS81eo/zkDR8QmbXBan2DHZgpy8m/SEV3Lkyxnxga15Vk9wDtXnXbY4NaENyBmnNdO9/IgehdSaPcn8bL6bwPegVXOeWm23tJdjXNqD9OHSSG6chEJC1tkTHTdhhiDiW2tjNl8tRHCcGToMmj9UiROupO9+iYtrpzNL1qqV3rYZOme+g9dpKF0ONnrURuOJFtCp8D9iOqiEn6ifB600EmeuKTOHPoP2qf67kzW8+1ELSOFfVZGmzi3fyjREXU9AEc7IpQV8sOF6ip6e+mIJ0vqKvRercmg113ySzb+pgd9MpUXOiVH9XcA0IQcZp80sV5tPTn9LmdSvUt3zCuMsywZYZ52ItH4kC6wFxtAlhnmqRatHBA49upZ6befr0lTLPUUzOyYlCUCcU30FHStHg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(16526019)(9686003)(2906002)(7416002)(2616005)(86362001)(956004)(54906003)(478600001)(8936002)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 687cO05CWY7j+YyBUfvDHkJiC78D4QsuOWdj/lazO6HIM9hlpXWMLMxBIEcm1S1C8gUYuYePvIxvFM9ftw3u2oLXrSQtfaXk8yVr7UiOTZFXXnC4E4pBBZMY1/PPhCC5qQYcxOHOs7ncIINJoStELI9qLl/b+/h9WfRpBhPRSlvx+fCjhIT6ktLBZebG7hV4HbEFEoXJbL0scIjyLTll/t8KX+e/VUOYFY6ojAKfmx1K2SKvQy8OZcjvl98cWJ+MdITblYRGsRpBgY7MHniKlhVZT/oh6M2PMv+bfn2VHA5U1CI5QgRDzi7MXxvszYEnmHYSNBs8nFl1DFHKF24ysX3wqbFT2kxAU2vVIWetM/FeqQtrRVUAGL+FvOpj00WU4d30If7UiPJJBjKGPuAIYNwX/U2MvTqnB2M+S+a1izH8qduEz61ld9n9j1fiBbd4bKSHIXyAjnGCXsBbiPv5crGdGZTBuqHye35fEcA43boXZTf/0IzhfzI87Hfsu+XlI65n4KWqtyJDYcVRoK5ef4WtbUSleTak6WAd5oYtzdznducoiOYawJEVMf/sjmFYCExg2JsNWy3qCKkwd+iHuP28VN9b/WsdF8YqeRxkaVJUm/JX3t5/YFa4genKNV2PjuT9+PqEuK8aOVLm6fihjJ28bEiO1POnTlST0Gce/E/EFNWfrWaFvQoqeM0Ah14uUY8tdOGHukppcmVUzMmJUpA6X1SFdctFLD0fEASXAtc4B+sJ7c3GLXum9oyVO9Zo8/iQpdMD9HET7Q9ZuQVk2ROhYtfqNDhX0qn/buxEN3R8RV0/ag3npkvqj2KQRzwbBc630EdocmzNbIwF4ZUAGNWz7FXzb1iHFA9L5a3RBL/9l6IN7w99xx0FIWB9b8zmWtqdRRwVhQnkP04JPUVcWuE8Tal+uik8BYQ/eVIUqzsr3g0A5Q+MvG0Ak1rMToNLdhXNf3znVldPvka4JStbD/qDSXy9mrI3ygs/mNR/SpEEsQHAfBjE+dDhvZhNvUFV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:02:18.9529 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: f3d298c9-74a4-4e66-21cf-08d8aba627a3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l+9XxwuHqTufaHCS6q4fwpSBQGtT0le5aZ/EZ1wwsRc0cPlDeadp0cSUff3Swxv5jEYlCftUiG3PIqUnW9s25w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Add i.MX8MQ dev/sys addr map and configuration data structure i.MX8MM share i.MX8MQ settings. Reviewed-by: Richard Zhu Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- 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 3c0075dc1787..f80428afb8a7 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 Tue Dec 29 03:30:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991901 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 DCE28C433E9 for ; Tue, 29 Dec 2020 03:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9F4A207AB for ; Tue, 29 Dec 2020 03:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbgL2DDP (ORCPT ); Mon, 28 Dec 2020 22:03:15 -0500 Received: from mail-vi1eur05on2084.outbound.protection.outlook.com ([40.107.21.84]:9185 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726825AbgL2DDO (ORCPT ); Mon, 28 Dec 2020 22:03:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TdJ0m9GZJBK2dytH/Qf6mGgWmubgOzPigmVwoxZn6dH/FGMustK4Bq45Ei/0I2fe0G7nmNGU9xBo1xRqeChs2SYg1esjqAkzMkDpie5LFaG2yzi7h6WEivTwCh6ogwpkUGLqel1SaMmVcKp3Jgc33p9+84/XiW1iJHP6O7VRaEXqYiK28tGwLknuVYqTutXSEZ4rySTwK9yXxMfvR/EA1eRqMhVKlKNHhs2KraAYwcDTwwCfKnUBDUA7/UFcB/iTHW/UkkuJUk19o2FeJ8OdMsC7dQJKcBvzSaDKkq1Ku24VEBM9RH099f5B2Jfu+L/izfsimt/o+gqW30RrAuGbWA== 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=pAYqIU35UPpL90YeZ0RIqNWEqoHhxw7xzRqpkA7vL1Y=; b=H4oNnleYcJt5pTxN4aeo5o/UC43A7ZGLvM3V8KW8BCtvVXJyTBy31LMd3LzKtXvKXsby09KSKeoEkRNDNwTCdDjkKgVCpEPH3TmT70SD30s8TCjdqJlJQrgx5AoBL2/29FqaBZ4q5Di9/dz/NVYrRjufoNSv6CHqNAFZUFnIerSlP9G2NLxtoMrBl63e7kV1WgLDnacSDTxyLO2AtpDlWeLo5JuJXDZ3MBi9HVGtXCIOGH7Kkf841Rh2dBYp6XfDgUGIIJj29PwlLvwBYjjNHboKnFwU/Fl/E05pPfxnMDFq8NHfXcwMf3VzUgqvDKWD1usehBOEBjoHC2Q4JxlG4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pAYqIU35UPpL90YeZ0RIqNWEqoHhxw7xzRqpkA7vL1Y=; b=GipVXkfns9ZObFPRi4lY1yay9EwHOCevj/kPz4YqMbcUlUR3k+lussCWCWrVgtUJVUVuVeYpukOYLEhWqHRbU3mIrzsDnzgcs6gj94YsOZtNGCjvuHot8QBGpdv2YgyO2Y3kodN3f6TF89+9taNwqZN5PUr7JlF2INavn9BWp6s= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7180.eurprd04.prod.outlook.com (2603:10a6:10:12c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:02:24 +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.3700.031; Tue, 29 Dec 2020 03:02:24 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan Subject: [PATCH V5 7/8] remoteproc: imx_rproc: ignore mapping vdev regions Date: Tue, 29 Dec 2020 11:30:18 +0800 Message-Id: <20201229033019.25899-8-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:02:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 982e36c0-1497-4c5f-87d3-08d8aba62ace X-MS-TrafficTypeDiagnostic: DB8PR04MB7180: 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: NHdFp6soMlFidDM/XDSX19WDGPlTcQVl3NJ+e0GRQ8frdEssodfRp9riTfrVkT1GAZFwKd2G0qn/MBzHwY0sLQuuQ5wQpMXdq5P2tBIO6BXYGXfjAn70Envm6XCsttOv8bD5WlCuLWt9v5Ro98vfAdL4hDHffUOttl25Q78P81Cdf4WVq3VPG6nJkLJd5GkwsR+AiECf1+thPsTCS5l3UChRlrebvP3BMgLitP3xS2JtFCXFte11tl95wyQYfVfMU1hAcf7159V/0tdvnEDk/qkM5XRu5feVGrFHWDqlF/JnxDZlDMMHQpUjE/z17F0HYPzeuKpkQFDRvSt/40116XwB1Iz6rZhHpevP+8Dlme8BE2fqYa2u0cfmwR9fmCIGyLu1FcvmDOpRwiizekxJew== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(346002)(39860400002)(366004)(396003)(52116002)(6486002)(6506007)(956004)(66946007)(6512007)(16526019)(5660300002)(26005)(8936002)(7416002)(66556008)(186003)(2616005)(36756003)(4744005)(1076003)(316002)(4326008)(66476007)(2906002)(8676002)(9686003)(86362001)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: +7AffkZxpYaia532eunqev4GLOzM0qTStnAnEXJcr2yDZMMPj8sXOTrMQ7V1yb1+YctXVEhyeVCx9CMviAqXogWkPXMIktfoDuxtE6aeTrwjKpFqQQ5K5JXZpuXX/o5KYFRkmfC1sw6UO+py6D3W6Zu010qNs9CjwoDIyCdskC4jLDEJ+iN2RdywSSRMk4BBiWl6IujRwkrahnb9Uaw0k33yOHHY5ixl7CJXMVba3GXdh1iS223zOjGjCZJBrj3wE/BVZvFd+c15jJLlynCvRMz/tWVi/l9ek4mOvn07FRjGXGfrpCl6x/mvMnODeuy3ol9Qpufc7EPR3uQOTxrkyqJe5bjar716NBMKAKR2oh7+o+zfAidFo/wfvMSqWR50TBueOfC5jPiLRfHgJZZIKB2ReiiQiNbEcKdDm97ylaWZd2swe7du91hgTWQQbLeuCTEd2MhueuEYuaIs8eetvFX5Y1Fav9c82mOmtjKkvy4RAMZhcMDhyle/fOGDQrIajvIDFY+SbLrrGYhysDpWr4BBPDL5ajwwHhlreKFW7092QtgQK4Xh67kY7AGMR11EumLJUtnKQy/24wAqXPykWdqiW4x5km/axygQhWgWNGxaR0BxxhuLlC9Imgyq3oT2svqUewW40plwqlvRkZYLWyd62DNXvlsHjDvk1WLDfAFv5kQ59oereivnmWOpFJx2Dw12V6xu5+0E4F2sPceR/SzPJFF1Ff1t2Y6A66ZXPvwfWWgArbh8TGkpAm5vBeKpMkG8spWlpZOf5qC3txZPnM/m9l9501zhho6Ax+BuuDZF9anLT6aFvPxiZMKLCEr5Lot94FSwJa8vqfE5c0ChPMK+PeDldIfzwMWrFawA+Lj5Gv6MPWvEUtTwX1G+IdspwcLvSWJkcCj5Exu9VP6mDK2Nxi9VXq0ezp336DN4iQ3jpYdSWazvqlK8leqy/g9ZnwuVwMP2IVkWvdsziMVjnMvA81kRSlm1eSgDiueaaUgnN4bTAh+YKgtHe6F20aLU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:02:24.2784 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 982e36c0-1497-4c5f-87d3-08d8aba62ace X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lRQkW5+3Z1hfh0TQYQAxDj0OHTMSwa2nN3XKy//QVWhdm6/fg0kNUFEDfmaFkiG0ZIXXbu/zIbyKmRsKdLBjnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7180 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan vdev regions are vdev0vring0, vdev0vring1, vdevbuffer and similar. They are handled by remoteproc common code, no need to map in imx rproc driver. Signed-off-by: Peng Fan --- 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 f80428afb8a7..e62a53ee128e 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 Tue Dec 29 03:30:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11991911 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=unavailable 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 DE17BC433DB for ; Tue, 29 Dec 2020 03:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5ED822262 for ; Tue, 29 Dec 2020 03:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727742AbgL2DEU (ORCPT ); Mon, 28 Dec 2020 22:04:20 -0500 Received: from mail-eopbgr50055.outbound.protection.outlook.com ([40.107.5.55]:14917 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726015AbgL2DET (ORCPT ); Mon, 28 Dec 2020 22:04:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9FTEYkckEc2b/8AbD9Q607LYvSqelLC49YCrCC2vCCKc9psfoUoZkwofgMJ9TDmUXJbs3D+3BJ/mT/J0vj0Z6QrWmN4iKrxg8nS0kdDf2Ss2DDiUTAV+jFRW625/kT9aKgC5cM4jB+itPL4Fg83IqSU0uDGBXBfH7YAGqCaW3OV+yw9A6Q2Zq4uvVfDGD1xmvajfSO4m3mWn6l6U1ZYjzUGAPq9uPy7KRxdLBupEvWtoAibf80eH4exo327h0q92vbORRmqDJv5rUcWke0KrglquDZOVxtpYAYw4mq5D+JCJCzmkZ3a7uMb8zyHMUKt/eINABESvRgNUjn89Di0Mg== 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=QLf6LPmqRrNcbdmySKxv/oX4Zp0M0bOHPxdt19tYu3A=; b=cSfIo6iiF95s1H7uDfsIV1aDA3roDqAO/4y2e8UpIB98SWBqlGMGDBzQlr3/vNamKpE3qcFVV/fc/6cdH0K4uDrKQETA02zpgIZ60ZV16du4xUBkOFFxADzoYGEJKlIA/7lChouZNGeiP2f4LIf4+vC60gb5P44xzXvDKSY7WoOScSOsRdn5EI1VdgQPPq1aOY39ddpoWTMP7A8v5TDCvEtMPBeeH11KKQSYrvCsWtmCWD+JJtScG5SLGrxJHqOkjmqBYPortZnKqwEvOJXG+TKjSvozP2cCpZeY1XxNsaL6Xu+8mBX3Qrf2I/a9wGdqpSBmhepctQLwnuv09kW4eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QLf6LPmqRrNcbdmySKxv/oX4Zp0M0bOHPxdt19tYu3A=; b=BwdLHoobeCAIbXMt6YD6aveyRYzxLfOFyqkdbH/mMV5Z09XiHH+kQQCQ8fd5ipgYEuKDUKKX0BLgtb+4a3uJ/A9EUZC3CPEIeIIBkDpzRloCsif5qLCi0DocIk+MMojxUjVAoes6e6ssVY4nQcjtd3hMMDQq9CD89ByQAvNomUs= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7178.eurprd04.prod.outlook.com (2603:10a6:10:12e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 03:02:29 +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.3700.031; Tue, 29 Dec 2020 03:02:29 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, matthias.bgg@gmail.com, agross@kernel.org, patrice.chotard@st.com, Peng Fan , Richard Zhu Subject: [PATCH V5 8/8] remoteproc: imx_proc: enable virtio/mailbox Date: Tue, 29 Dec 2020 11:30:19 +0800 Message-Id: <20201229033019.25899-9-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229033019.25899-1-peng.fan@nxp.com> References: <20201229033019.25899-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) 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 SG2PR06CA0178.apcprd06.prod.outlook.com (2603:1096:1:1e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 03:02:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aeec0a5a-e45e-481d-d2ef-08d8aba62e0e X-MS-TrafficTypeDiagnostic: DB8PR04MB7178: 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: gmx8N/+Zt9jBm1V0jU3WDFshiiWzVSp6vmikCAkIyJ5TMkELGBHG0pDKBMco6G2ZxfPNrQC/+ZmE7SidqgrYNG2o4TiymV3NuNHMd6XJvDYBaM9hAwrjO8eMlyJfhWU9yi9NDolew9UHPJ8w1R9LYIE1A9+Il4ia90SHB9FiKJYLYUvNWxVOu5gdo54COsSPCb7aGlXFLdcXOYwfrNJF4mCwmDptKHsSgX5WbqUmZuAiYub1x4vh6JVzJn0AHSb/JkjOX8cTa4z83W3yZ2Zjh07d2Mkqjs1jtoJYjgr6I/0JOg5DTSesOR/t26zej0Q24f2FogQgDpyEXWYz5OzhNnAM+WzgteEmFbYb4fEfYSdCgr1C6BMR45NaoMJ/WHYrijE4lOa/tsNj79XQkhQqNw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(66946007)(16526019)(9686003)(2906002)(7416002)(2616005)(15650500001)(86362001)(956004)(54906003)(478600001)(83380400001)(8936002)(6666004)(52116002)(66476007)(5660300002)(66556008)(316002)(26005)(6486002)(1076003)(8676002)(186003)(4326008)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oN3o3vTGF8AQMA/Qt7UYPrh5avgrxGGENPa6tcs6RZXRL8rAlgJjhlZ+5IeKQKkmGFY1wBa18AjeXQlmBeizMT0h7x38Bbx8Uq7wgGcTsXEqSTeAiTfSufodzifPyj4LhqefXhw5jEmM0Qtl3w+VAFvh+WosDjCdDzysGz6g5kCdQPTZSFmJtN9pgeWMiGcvWSFQdmKeQVZnL24/s6+9d6mYjdq8K9uBF/0kv4qsL28a0DdOF5/W3PzZyC+76ZIMx0TOfsUEYo85DuUt1bFqPMciY7RChLu1+rxwoXG/fkiWmpIFqDeXj+fpq3qtz2ZugtgLnUirmiU1d9T3Hetix9s8IZx3uuC/e3WrndkT0Bf3kLEj3Desis0p6Ytllm3LxuhZqZjJFRQOEG4bo+yFDDp8PhjK3jVM1fgaoDCqlcmgL5hNPj5k8CEYirRnbQ1J0fLDS8i4zuGIWYjro4xjN4zaKY47WsczPuBOd7JmjgZ8RWZYXHG3GqeW70no1num1FZRQIdnl+Co+jHvjSYY5CYk2MA3chb/aacNE6bmq7NS44gyV3ROwxiki5UQWHrhh70WgqJK3JopW/e+fuklvPaLOoUo2tlCfKra0zWrbvofbVL4HncBnfZXVPEI8IviM4E/37T1AicSGvRtYqvbc8/qyTXntK0EHE5ehmyg1QGoLMI7ZkS3t8ij2OBGFdmeWCb4unhkxK0rk7gzye8+mp8AS8aGNbhyooLBqpH2GcG/bByqdreH7CBR+3CVGqJ8JjinAGiKmnhth6WHvnoG1YXzgwwodYZs4nDsmmUpFf11QCdqu6gm8Um6MQgGznZzvh1t1bQjGaYxK5SEcYiul7CsZzNOWtfOIUOniIISbTIhIx9oWZQeG6LiEeNRGC/+/2MaarApydBT9Xzs/wv6b8bnyPfWDYSl8mwY3GBbN6Zv9TSz/At7XnnkDNHZh+hZ87xUkKNGnxHJSuUr73TUabQiph9nvqBLvOP/B5dD1aWtWmcjEqbnvmB93IQfDEJT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 03:02:29.7539 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: aeec0a5a-e45e-481d-d2ef-08d8aba62e0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Kp9j1rUTxBqHaIgTrCt1NVFjew4gUIPvwVMG8FSAl3hXrk0bZDIH0BKB+T/Ffy28BftzrC2lR0jhCNMjVYkG0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7178 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Use virtio/mailbox to build connection between Remote Proccessors and Linux. Add work queue to handle incoming messages. Reviewed-by: Richard Zhu Signed-off-by: Peng Fan --- 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 e62a53ee128e..812b077f1282 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);