From patchwork Fri Jul 24 08:08:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D790D618 for ; Fri, 24 Jul 2020 07:43:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9A672076A for ; Fri, 24 Jul 2020 07:43:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="mSPpMZFt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbgGXHnh (ORCPT ); Fri, 24 Jul 2020 03:43:37 -0400 Received: from mail-eopbgr00087.outbound.protection.outlook.com ([40.107.0.87]:36007 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbgGXHnf (ORCPT ); Fri, 24 Jul 2020 03:43:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZdtDTEuZ4AKsaD1LSGpV0kvkzqu2o7L44Ckqk3sA9jsBmwdR7xio7cREeI6LWDXql59j9YZwqpzqt+6uo8qvK9PnAnsO/THo+UKIqmZQvSDUEH7DFAPC07hGArmwotcGy2rcD/cH2xzr8lm8ea8LGKNl/CglTEp+VXWnKed39kjlqjKRCPXgiOQt0F1rj8QiELBsOwd6IoJXJUR3QKgcc5KWwxJBKxZuu7dDSRp9GmdgoGVRrx0STpEtUU5uegQsDfSKsi2x/1W8Us8wTZ8PvoElJzeAF7UqgWypTvFyghhHRaWl7xnNrhT/WaBMoyX21wUBXwzdJ09pvMpM+MJUQ== 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=LWr0ss9DEwgiTYRm0sghYVPuZPbmFJHyVAX3E5aY34c=; b=lEAzjuDacg61a4kSKnxSSbIABY4DcYeAxSXGLzUXbUcIjKZHcEmtzBN1XtxSNt//qtLA5yoEhKCjlWFNLqx7JW+ElphGCHCEQ2Qhix9gS2dcymRpMWQ1epE865wD5BzUEXj1RSkL0RtnPfE6HXPBbqnrZkMBvE2kw8EIWpTCb1rupAkLBSLtbSLZZ8z4jlnjPQnyKJiAZHZpvHLPI/53xQKzJKS7s0K4cWRHcCNf4Hle58TjAC+Libt5GBiInhORwated+HwvsvooTqEm+DCYzeDED3q4bGweAwe3FlC8ZuWWRhemKF7qIaIvDJgJYBm0o9lRU022RzRzswEVzlgVA== 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=LWr0ss9DEwgiTYRm0sghYVPuZPbmFJHyVAX3E5aY34c=; b=mSPpMZFtVmwdlwRJ6x0r5CXkrDpuZHO8sJ3FETqivxM6/se+V0zyAP3A1UubRHx0mxrEfYuFBGmBysETgJZwpG2MQX94GxdGJkBll8DETjPIGVmi1t+V5Vj6gT9RdwCf76YMCIh+H0ostD8HPb18qaRR1QqkpMSShFlBCtIxgW0= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6857.eurprd04.prod.outlook.com (2603:10a6:10:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Fri, 24 Jul 2020 07:43:32 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:32 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 01/10] dt-bindings: remoteproc: imx_rproc: add i.MX8MQ/M Date: Fri, 24 Jul 2020 16:08:04 +0800 Message-Id: <20200724080813.24884-2-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:28 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b1f0475d-8746-4dde-2d87-08d82fa5436f X-MS-TrafficTypeDiagnostic: DB8PR04MB6857: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CmF1xSMj1ByBMkordCDBahnPeFaq74L0QL/hJRByb6X0GyCD64EVc4GLGxBRojocHf42QRbvorRukR/5NGLZUai+TQq1q5OWixQenGfWVgcomfGhJjVbgc7Qh+37N+UB2EVqxikoV8VwOm/q866l/PMzwwHFi/iGDUQolyvwbFnJGAG3pjDnIQhHNvUf+j/0ruS1V9/mLLK83Q6A3QXiMoNqkKyODmoVp/oeziSJKI6yhNqkwtKJv+C+6mYZMwn07+BJk7ZsAZP545FKshOLuYV0DonFoC67xpYD1L6wSSXchLFevMgSyFcUM5FtLgdvzlT/bEm61bywAiF9j5fq9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(136003)(346002)(376002)(39860400002)(396003)(6512007)(478600001)(8676002)(2616005)(7416002)(316002)(44832011)(956004)(66946007)(66476007)(66556008)(1076003)(5660300002)(6506007)(186003)(26005)(8936002)(6666004)(2906002)(6486002)(16526019)(86362001)(4326008)(36756003)(83380400001)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 07+t0MmtcS3JZavbFXl5xwi5hiDIPfkPjF6YZ3FXJJljofYfcrKDQ//qHsmemXJ1J7GW9VdK0AsTwIGfwj8xz6ub2Rdj+kvXDZK5W+lT93zQB4pWupDmifpJ12rkTtbk5ght7gb3ewAXtKwPMtWlDddMrBxIQgSX4ZWNauwBnzJCTBjGqeRySaw1zQp8zHvYh0cXKAMzN0n75WBy4VeWrI70URZXNt0nurNNHb50Ze0lF2X2et8P+lAbUEBSKjl0cJSUMpQXvUTSCSuIxw9uxLYoyhOgGwKRAnh3WayDmAjZLbCXVM4tDPcgsIcs7LjNiLIwJycTykFJ0zLFTSGnjAyGAMp/QAvyUKDghgRI0Fpp26nJdhB9dn8GBNZwIIc8SwYC3eG7YljDV72yMjeEY4hDPYyEtB1e8k+1uTVC2mkjv4n5sOI432EGV19kLW7wYTiJ6FL0modi7SNFhT15HOXM1bBKNy0mqqjmg7nLjpCJfxCwIEVknY1vdNLEBYiz X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1f0475d-8746-4dde-2d87-08d82fa5436f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:32.4242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C+ybt5fd2x61bQ/J9CkQnj2u8sli2xPKTycjLZImZCbI459uakQ0OsA699ZX06IfXZ/+lyAo4S8MZENu17o/Bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6857 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Add i.MX8MQ/M compatible string Signed-off-by: Peng Fan --- Documentation/devicetree/bindings/remoteproc/imx-rproc.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt b/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt index fbcefd965dc4..46f7623512db 100644 --- a/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt +++ b/Documentation/devicetree/bindings/remoteproc/imx-rproc.txt @@ -8,6 +8,8 @@ Required properties: - compatible Should be one of: "fsl,imx7d-cm4" "fsl,imx6sx-cm4" + "fsl,imx8mq-cm4" + "fsl,imx8mm-cm4" - clocks Clock for co-processor (See: ../clock/clock-bindings.txt) - syscon Phandle to syscon block which provide access to System Reset Controller @@ -15,6 +17,7 @@ Required properties: Optional properties: - memory-region list of phandels to the reserved memory regions. (See: ../reserved-memory/reserved-memory.txt) +- rsc-da address of resource table Example: m4_reserved_sysmem1: cm4@80000000 { From patchwork Fri Jul 24 08:08:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E0DD618 for ; Fri, 24 Jul 2020 07:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DCCB20767 for ; Fri, 24 Jul 2020 07:43:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="PyUlTqns" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728253AbgGXHnl (ORCPT ); Fri, 24 Jul 2020 03:43:41 -0400 Received: from mail-eopbgr80041.outbound.protection.outlook.com ([40.107.8.41]:26244 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728243AbgGXHnk (ORCPT ); Fri, 24 Jul 2020 03:43:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gFzRI7KLnNxu3bBPEkLyGrMhCnCqq94h94caPu5V0mzER4Psaovd4EsXQ+eqvFwUXmUU/rFs2p40fBLyZEEEJLub44CE/iTZBebACle9arvBI3VNiHMrWcHcFY0kJuauZSB4+JSV8MoKwS4pcn0JiKk2lawG2gd9A2Kn2la4XtC820i1sAofPuF3X/bk5HYWZyc2ehJUWQ6+zbhrrMjhGLuZNtjYeO40z++u+zrZ2oKC8Bf6ELm2fhzC7oBZ8eZ4RD2ysn2kGlKtrwAM6MfpLALzsMFvTcTx/cQJvIoupj1IjlRWcegXAoPDQoe6oa4khdB9KZ0KLJj3g2LKTJOybg== 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=0fidPlfCdQaDys0o4S57MP6gfjwdrJb1sVgbFpSf4cc=; b=g9Oqh1uIE1ZdOlSIw90TmbkwdQTgrtoWphDVacvG5O0YI6rBWsJ/ArJOx+d894tW+vAhwv/m/MtDurHqvPFqUNuPzG0wf0ZEu6JE8BFWbC1wJiUR5k5rdwGLcEv9MlJ/F6/DQQe3Ay+E6c5i4vXPqgpjz5Pg0sZghU1T2TZ/nkKiogntPvq2vbnhW6jo7YUSEd/EoD9fYunTa0zV0DZLx6RmzWsjKmZjeVQJ6+vGZ4p03drwNK9GqTtITCacmG60G4ZsBz93pD3KzZxJghebw5IPjc/zhuagx3NXEbwYRmALY0xU8oXdFN1TfEBRwwMYxTpUTU16LFk+qY/i2/p9ZQ== 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=0fidPlfCdQaDys0o4S57MP6gfjwdrJb1sVgbFpSf4cc=; b=PyUlTqnsj4Ao4uCz6jJSXi/wRVOg0EmIugfVVh/sQvhm34TPtLKzCncy3jbJpNe0yPRRI28JWfILD807IojfHTEcK2dgwGZbi94djo4jfJkhM6d0fDpUbm8vmzpkC6qK41SwjQbR5DDBpZv5yYArNcovaoznZOKh/g5a4IsQXiA= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6857.eurprd04.prod.outlook.com (2603:10a6:10:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Fri, 24 Jul 2020 07:43:37 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:37 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 02/10] remoteproc: imx_rproc: correct err message Date: Fri, 24 Jul 2020 16:08:05 +0800 Message-Id: <20200724080813.24884-3-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:32 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5ed607c8-c160-4f43-018f-08d82fa54623 X-MS-TrafficTypeDiagnostic: DB8PR04MB6857: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RWV0SW0044ceK/zO9595IBP72WEyEbhRiifey4p/pCTdJlXZjR0Lpp/Nf0anwKS/nCZCai98gBpWJU2DCBPcD8JcsKHljf0W/m945SPBET4QAS073JI+CUnK4jhkolYP/jw+d/JXzTKMjnCcq7hcK1r8x5Kn7CBbGcfHQ8ESfg0l03IK0FPdL5trU6vt858WsrFKvwcmqpQnecuQ4AD8YkXNNshL8ezeoUEPwZeQ++oBoOyAWLx3q51XD02OIitof1C+I/gjP04vsm7g2lTZdY4gqupF3xngWRMlcNg44CpiQynGXhHu8iIgZiR/J/6nqsInvMtmVq0aYO6NzA6WnA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(136003)(346002)(376002)(39860400002)(396003)(6512007)(15650500001)(478600001)(8676002)(2616005)(7416002)(316002)(44832011)(956004)(66946007)(66476007)(66556008)(1076003)(5660300002)(4744005)(6506007)(186003)(26005)(8936002)(6666004)(2906002)(6486002)(16526019)(86362001)(4326008)(36756003)(83380400001)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cUNKEbviQdwQ3dml1Zxbf/auaTDX5esR9prWLCvd9tDZLs/AqLalbMienG6eIf1lBHpCq82n2x7HQxIB4F7wWO+n7cAmLAwwNnLef/+DIUsKJ4Tg6cVNDhktgKGiaMhJleCJzkCTgF7gnIOw6rGd3z5H+JWw9KbNeemvGrVEHaBgnQ5I+x0pl/RYhFcZw5+MUkNg1Qeclwsk29RmZ4QxTsPDRyiLyKL/Q5oz32H41T+nmYio7+Kw1OvcuqaTHW4+V8kLvA5PK4lrzPtMfWqxWYQRtdYyJHp5cfUxF4Oh6e3xrd76jSOIJmNDL0my1aZdzW+2iJurTl8EWSLnxIS1q0G0Zno6F3B8Z1YB9bXyMRU3zIOZ1H+w1f8Ug0saoN+l7ZCL4z8wWmo7W8wztfhcSysHv36jnsMw690cjU54FbivoqmQWO45Rj5hBD+27Lamdr1J7YQNOe0rD/qpe94kpNvp4CiXeLb8h/POUo5u/GPOwMR3gbnBe/sHmXD+Go37 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ed607c8-c160-4f43-018f-08d82fa54623 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:36.9791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8UB6dBx5/oTk6nhJtfNiqnrnyACOOL36WoSCrlGWQxZxKytPpLMqThZnngeppM2OdMJOQ0c76odRWpBvFs3opg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6857 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org It is using devm_ioremap, so not devm_ioremap_resource. Correct the error message and print out sa/size. Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 8957ed271d20..3b3904ebac75 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, "devm_ioremap sa:0x%x size:0x%x failed\n", att->sa, att->size); return -ENOMEM; } priv->mem[b].sys_addr = att->sa; From patchwork Fri Jul 24 08:08:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682473 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F74913B4 for ; Fri, 24 Jul 2020 07:43:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6269920768 for ; Fri, 24 Jul 2020 07:43:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ZCQPE6YV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbgGXHnq (ORCPT ); Fri, 24 Jul 2020 03:43:46 -0400 Received: from mail-eopbgr80055.outbound.protection.outlook.com ([40.107.8.55]:36068 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728040AbgGXHnp (ORCPT ); Fri, 24 Jul 2020 03:43:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QmpJxX7COcZNG+pTWyHWicFmSFQ7G1IOgjFqNvlCz5reFWkMev77J1flEvk8KADVXQArLNTuZQvk8HFgzLZKGm342fr8j4bHbQnf4f7YrZsj+OdtHb2R0lAoAhWyInS9NZ4pPgg6utpHDGRqEDkyDX6rkm1aAbcvBENNsOfuTrhDqhy/8qPYtTZjvu04c3XU15MdqtXO4aIWugutESX6Bb0SKwQZg4nO9dBzaOsrZIqx2J7qPSGUYCmFIcEdvMbQ3VHKq2iTnxkOR9PTJxCNhrma30Zmsp+dghL5PNF9VHCY9NndTN/coV8YKywc889Hne+arsiPby7Z0tAIjNMs1w== 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=YdNMZtH7GA3m7WuCVTf+3ch988T+aebmrLLYbcmLdns=; b=m6cFjMkIuRV2S6uNFLFPwywloiO9xbpcp+tG8JOg7W4guJFbwCqU+JXmEgPee6XkiUx/kE3VlIMrSKDxL2Nh7yvHUZtzXJoOSic8Atm8T/CtyqNLYAGHo/2o+1fXPb7UkbSlwUaqEELdIEfhiwdKuY03pN0+CzXXJW6RGD7E0CQaIhqNbusQ3CTuoU2HiQQSACr+Il2rRM3Z4W/FPP9AZettZAdmhNEogj0jmmlykzsG7rOj/jblCLWhK3cNVNLEMG03f/w2WiqYkXUzsoUlDRbMcDx1oQGstLMGaOf2HjXGxqQ+ICGuGcPNjv35MP4fRZ7sMcEWG1/adYNr/BHYMg== 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=YdNMZtH7GA3m7WuCVTf+3ch988T+aebmrLLYbcmLdns=; b=ZCQPE6YVO+2LAHqNOBvys0Jct47cKY7mATMak/BJOdGFe292BC18mbJrIUdD6+sI5FuSIIC1o4u7HjivxCAvND7J5p5VI+DW9yEH9DYGw/FwDnn/SgLzx+N9PCqG9emPvOY40X/OXCMqfz/K+ygdgwa5RB5qAPzWsstJiUSOW0Y= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6857.eurprd04.prod.outlook.com (2603:10a6:10:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Fri, 24 Jul 2020 07:43:41 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:41 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 03/10] remoteproc: imx: use devm_ioremap Date: Fri, 24 Jul 2020 16:08:06 +0800 Message-Id: <20200724080813.24884-4-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:37 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7b7e7497-b0da-49f1-d59d-08d82fa548d6 X-MS-TrafficTypeDiagnostic: DB8PR04MB6857: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kfXCY6Dv9fvxQkS/INfX1qU93V0S2K7jh+4+Lie4j14bgeQjxA/fZVtwJp5MjttTRAjUOVwMl4WNRaKkGc1CqCbBt4G0Zu1Q1j9N96CyHl5Qho1c7S+MjG4A655fxSoE56LGjPmbMzLeGOSViBrrzf9bLj5CV0Ov2EU83fUft7X2IAAjndd+vhhd9Q/n7yI0jZcgS+VFAczEaKOb2cGKO6qwXbsaSGdDrugyszbiNvHEnRxuq7Z8gzdCNtQxzmBzW8ZEe3EMfXGtv4MF9GSQqya+YDkNpoZWRv89EvYxiw/T7BvN+qC2glorQBp83SRqf5rqUeED5qywJ5upW5KB4A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(136003)(346002)(376002)(39860400002)(396003)(6512007)(478600001)(8676002)(2616005)(7416002)(316002)(44832011)(956004)(66946007)(66476007)(66556008)(1076003)(5660300002)(6506007)(186003)(26005)(8936002)(6666004)(2906002)(6486002)(16526019)(86362001)(4326008)(36756003)(83380400001)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: t4Gcwf73+sJ2Z8iOUDOAzLcur+BN0kPRaX8Dnj1rfiubHBEmXVQLaaP+U5Lhyr5rHL5U9R3JAqSVilf6pSXaoiQHUbZKK4ZlQLDlR9fGEvwN0NRTS4VOomCN7OjGdTqXGcyrAgtwFV6gd+xuns1Lzb8V+I8k+WlRvUChHGtPRNDhF4AE+seBwIJnwVxHbDA4ZcXXO+TAUj5Jpf39an5wDd9dNlWl1NbB23SweJsIwOMh88gdW7Z6LCqeXP47wRfoLJh5uPJ/slrgR99ebsD1PoKXVwhwQ5cbW3tIJ0I1sES7GXfYyuWLEb3iIgiY1JqsbuEHmkMRSO+Kal7w3YMxwkDb+nAUCT5vKaWBYBDQhx5nJDHKr1LsIiDfRLEmklWyFWofAD3BcnCvhniA8lk8p/Pm10Ohpao28B72z86tio2ngUWuWnssGlZCfdKbxlA28YbD4W9zPwIcpxMdgq2juEg7srDH8kRxuUYTGVFFlLQuJTf4rqA/fXSwy/7oYdzp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b7e7497-b0da-49f1-d59d-08d82fa548d6 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:41.4721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 885mKcTdaad3U9cuJr694p/8ncnTz+BN9YqDOtmErqgNYeFIy7UjFSdBE/CGCI+JrvxcVpQomV16ZxDbVRbx1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6857 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org 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: Richard Zhu Signed-off-by: Peng Fan Reviewed-by: Oleksij Rempel --- drivers/remoteproc/imx_rproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 3b3904ebac75..82594a800a1b 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -296,9 +296,10 @@ 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, "devm_ioremap_resource failed\n"); + dev_err(dev, "devm_ioremap %pR failed\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr); return err; } From patchwork Fri Jul 24 08:08:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682477 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A7D213B6 for ; Fri, 24 Jul 2020 07:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41D1520767 for ; Fri, 24 Jul 2020 07:43:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="KKzU9I0e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbgGXHnu (ORCPT ); Fri, 24 Jul 2020 03:43:50 -0400 Received: from mail-eopbgr80051.outbound.protection.outlook.com ([40.107.8.51]:59307 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728266AbgGXHnt (ORCPT ); Fri, 24 Jul 2020 03:43:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C2tiadCDcgVysWcTaDmrb90WH6OU5fjAfkOfUsSzIlUvnNuM4qOdKqYa/y0Q7jOkewOkvBgg24HC2gkHMOxFNxSXrZL/cw0LeGARlTBDK1zmhJ+E63AMkdafb3zAXrzUYFd9/xz4Moo5G0bUM4R/ul82oWjj3EpZSshJAL9LCxKCe92JgwWSejvqZR6V+vRBEjKEiPl6IqSEZ3eAE+mDM4MhjWE+hHG2BKmaOArJey3BPLz+G7UOTJEnMCnYKRm0HcfRAKpkAK3s4ItyimsEpUgn3vrU61yL/2gTF6QMwfPyvlXrGzDinahwKS4GTMn46Q7Szkx6fadf/N19ZcqJ9A== 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=JA/x/bUv5KXcx+/ykfUIpTYgVe0nzp2lijRi348Hiqo=; b=ZYcTLQ5gdZhoO8BO8edDlv6qy4fyMldAINkXVHnENny0q8lldQTetq5Abn7N6Su3d012BUxoYCSP8eUbVNJX8822Ge0j9oGM45wV70WJ/Uh9P8S/d2SnLCELUwWHmW+H4qV7e0BA96ylvRnbbG5HbotIq24+Mw/+i4J+lDGBgBxrbZAfh0GTCykwXwcr04aPCZ9lpcVciJNiYt92+ev8rNP68pkTQ4DsCVtgjqGPjF+eZDBuaWWMbUOUcpUBc3GwkxqIuE/ku/A4DOa6qlUOIvwaMrRIiGmOro6dcNSSBJSu6tIBKJd08a40KHQC8rN2gO/ls80jt26xJinkzAWsZg== 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=JA/x/bUv5KXcx+/ykfUIpTYgVe0nzp2lijRi348Hiqo=; b=KKzU9I0eQ3gwdHqdutFyOrCJX/x9YX/B3oQmbJEIXuPEsWvWPvTts9TeQO8xrZe7PMqJLjckSVVmcHVbKNmIH8MbqmPB+70ls0vGEtKsjUEf1JcmT47gbddS9frCpmPjOmVnPFtfnRBMKBfDGHoAp2fq+lht6CbQoNIHvPdyDIc= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6857.eurprd04.prod.outlook.com (2603:10a6:10:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Fri, 24 Jul 2020 07:43:46 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:46 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 04/10] remoteproc: imx_rproc: make syscon optional Date: Fri, 24 Jul 2020 16:08:07 +0800 Message-Id: <20200724080813.24884-5-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:41 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 423b0dc2-b7e3-4c02-c362-08d82fa54b90 X-MS-TrafficTypeDiagnostic: DB8PR04MB6857: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:317; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p9/7aDh06IcTShIovbPtF5fy73v1zrc2f5WcjoMSUkjnp1OViCrJ+qZJnjZhLhqGULmld/qkYpxv/TsIbqKTv32UcHzFGCINVjqf9OZCxuJXhAUlnl8AYsjUoxq+5vwGjjD8w7FI+1qzRDvID60KxQJfrla6tvhx5hQ7oC65v3ZHhnjelZhawaaaO02aqomdDkDza/mjPQMLsBWJMkCJkJ9QtgB6iu9CcjchC2MY87gkwoCvxXxn9AX4Oh9ti5iNMvViWcjiUuNWZDjhINqXRvninMuOGr/TQtfUsTi5fbkJU4JaIXq6rWsmNc6ROzbJi6Z9hJPPijKPePSjtVsoOw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(136003)(346002)(376002)(39860400002)(396003)(6512007)(478600001)(8676002)(2616005)(7416002)(316002)(44832011)(956004)(66946007)(66476007)(66556008)(1076003)(5660300002)(6506007)(186003)(26005)(8936002)(6666004)(2906002)(6486002)(16526019)(86362001)(4326008)(36756003)(83380400001)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: WxKaPsudXHKHSa8zFDz5ur7KTZdeDmaFT8sXnjSRhr1YY2lLC+kaZCUy/J09sRbeRjZ+Ihi6BJ6ZbE7+v9fa1jeVPD/Ac07qGAe9DFMnbYIVj5SGLfjLsxx9c2sJmEoc3UY1wHhCjaxURfJf9/Rzjq33HIBTNs/mtN0+Pi2aJuZTYkQt9NMqWftaRNqcM5CY8y0PDSnFrBKbFWHKI1BaUZPgqt1358rAvA/HER75IWOZ9V2t61bLzC80pW9Oi/fSG8/11646DpV2QRszmKSMsUz9nA0lZPwzQwNkW/iN3TxhXm+fQub4PzkYemUPYB1aapude/l67W1ODf7Ao5AawB4ii/k0ie/dst+M5X8LlWhVYAXdTBm6WBi+eGgxBbaz3fTCTCjG7zIELkzZsvqcUP9DVE3YIa+uu91ga4YF7rEQCKQNHE6cqG2raJtPrWGrUn8QSuuZsFW2IX5XEQbcYH0lGK4iksWYc+LSftlRrU+DTeJhNqM1t89JXDaaraPW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 423b0dc2-b7e3-4c02-c362-08d82fa54b90 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:45.9311 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4g0sKkM3czf98YlOxvhBKz9ZYeC7JW2eV3B6MnDavos8EMqzPV3A/cEbKmAAdmLfCoQTnyVJJBXt7yvXAcetFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6857 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Make syscon optional, since i.MX8QM/QXP/7ULP not have SRC to control M4. But currently i.MX8QM/QXP/7ULP not added, so still check regmap when start/stop to avoid unhappy things. Reviewed-by: Richard Zhu Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 82594a800a1b..4fad5c0b1c05 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -162,6 +162,9 @@ static int imx_rproc_start(struct rproc *rproc) struct device *dev = priv->dev; int ret; + if (!priv->regmap) + return -EOPNOTSUPP; + ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask, dcfg->src_start); if (ret) @@ -177,6 +180,9 @@ static int imx_rproc_stop(struct rproc *rproc) struct device *dev = priv->dev; int ret; + if (!priv->regmap) + return -EOPNOTSUPP; + ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask, dcfg->src_stop); if (ret) @@ -325,9 +331,10 @@ static int imx_rproc_probe(struct platform_device *pdev) regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(regmap)) { dev_err(dev, "failed to find syscon\n"); - return PTR_ERR(regmap); + regmap = NULL; + } else { + regmap_attach_dev(dev, regmap, &config); } - regmap_attach_dev(dev, regmap, &config); /* set some other name then imx */ rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops, From patchwork Fri Jul 24 08:08:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682481 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB64213B6 for ; Fri, 24 Jul 2020 07:43:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F04D20748 for ; Fri, 24 Jul 2020 07:43:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="o0awVNa5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727988AbgGXHn4 (ORCPT ); Fri, 24 Jul 2020 03:43:56 -0400 Received: from mail-vi1eur05on2088.outbound.protection.outlook.com ([40.107.21.88]:26464 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727973AbgGXHnz (ORCPT ); Fri, 24 Jul 2020 03:43:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qct0S3GJG6MZiot8qDwOKQRlMDN2X8+Re8FsJreACPW77xgb7a9Kax55fvPaHuF4c4IJ5EfuSgn1wPZ9ONAwxeOVRbAV8L7iCVZKAx93PlzHzqD6zZEAiqY8oarYGIFDwF0v1tHa92PG0g5Agwo7+ha8YsTqadAScgNcn//CrT6rkIronWoOoQcYIIJ/xXVPGTZSh6/vXU7o00jLJ/QHdd9gaGKId4QXRt5K5PlUI5dxHdh6pKqtxByGPhBnxWlgb9mUf7QQAsIWSar4vr64vmv8bQTUJd+SA15FEwFZcm3pMvef88hUi1F+L4ZbiHQO0Wwioiph4S5m6DRDCnt6FA== 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=UhuUE7ee1k1h3yS9lk8HoshtF1lfSheIfdm5bhrs3BA=; b=hJ9F4qO0Y8ZvwKOHI+o58Y0PUz2JpQrlxupP0W0Vu4oaKhf7buOVEvquZBFbivPRbAv3gn14wEhjDtrUWbuIcyNbXggkBftfNNdWp2MAazIXE0DNbXltMKRYGoJ5NkurdneFKQEtYAZNsbreCmK0HHq721wjf40M6ibwXsZdLP/JKp1IlhMvUzy9ByBfOdiDerFc+ydx4MHKbXJoSXafROeQH4+RQTzs6tLYNd4744U0SKXJeChA28H0lrVlh+rj3QSFOldmKQjFL5HcK7hlFvj59UrmNmlHsVWGl870pkjW2eSKKsMfhk94YO0DsHjoe88luV7ctHccB90jL+lPYA== 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=UhuUE7ee1k1h3yS9lk8HoshtF1lfSheIfdm5bhrs3BA=; b=o0awVNa5CAtDIrLXr21g09y9uLrZnH6kLUYd8Q5AikCMsqW7qKnnunAhw9c3U5sLnHO5D3bO2hMfl4NAWOXXAjulNCWNF4J5cFmkTGkoQ1j3S4jrhC4nHyW91kUCJ1P0LPAqR+NPCRBCnHSWDqDvoY9DzyxU2VoDHRu3WK3Nq8U= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6858.eurprd04.prod.outlook.com (2603:10a6:10:113::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 07:43:50 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:50 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 05/10] remoteproc: imx_rproc: make clk optional Date: Fri, 24 Jul 2020 16:08:08 +0800 Message-Id: <20200724080813.24884-6-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:46 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 69227ae4-e128-4523-1ee0-08d82fa54e2b X-MS-TrafficTypeDiagnostic: DB8PR04MB6858: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:632; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gx3o/Z9ptJH9ZZJXcPUIqNGvsZcl4mcpdDx+O5JQ2xhXLmK2JpIS8o9fpbrFLcYPVOsc00k8h+uQ6bq+NF6GTlG3apgzQf+k4+VwuEFJW0iiKUeIMuyRvjiYITeaLViun+v9ZRCs4Oqv8Wktwb8+0+nKm3bl5/pCPUwwDmIgCU5bPX8SAilzwBEfWEUU/5y4saSEaXzIZtFM6AtlOhwigrOHQNa2tQ7USa0tUxBT2pumaVRwU7Qs7amTMAvEhB4PUBii+RkdRCZhSvR+9P1dPIzHgpOFmY1zYdUM2p7o9kXaRpSoVKcxL5yMQOilvOvEc7Wa6CcvTI6ejNXhe76naQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(52116002)(36756003)(83380400001)(478600001)(1076003)(2906002)(6666004)(16526019)(186003)(26005)(6506007)(44832011)(956004)(2616005)(86362001)(6486002)(66946007)(316002)(8936002)(7416002)(6512007)(66476007)(66556008)(4326008)(8676002)(5660300002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mGUoIIONerSKVNR6TzwjYXhQ1cHC7L0471RTG3Mt83uiq/OxOW9k8aG4bBMZDlBWvjsV3wdevyntf9m3Hsh18EqY8oDiyCE4vb2OKv5DGooPDgz8HIvfXBqbsz00r37l9oKd/jd1mjAkdUeV6V/z3LwfJ29cRT4ZBueNpOF8ctcFerXJlRIg4J6KtpucDrBgVDCesSOpzlH+3uSeOB8QuoNcMeNlc05V+OEUuDYvzph41tN9sYsbzKdgtY076DXb5i/mzODlVNA+ex+/lV7yB3kg2Ip1r4HOG2CaLq0hA9I7xYOFQdMZd/xWHYuTIaLLeLdPT+b78BGN2hwYelb9sJir5dIFdKBRs2wAIqxBSA/FU41/IQuvIZiFt03Dqq3nX2c71mr0vmqsHFLarzz4hXoofXTqpDPgqvRe/QMUjgKKKIpHe/IC0J4b4M/YMcA0KX4sryIwWmpsUo7UoCfp6+syTrp0lgFtXCxt+1DNjeIEmSTmqVgAnkb1fXB274oN X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69227ae4-e128-4523-1ee0-08d82fa54e2b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:50.4621 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eQgTwVvXQin7F2MExJ4LBtUPuqXN1vacCUX8B609N4vsYb/zfoxvgdPk7GOI7tp+TPALHutUkbN7zXWFhl8+Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6858 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org To i.MX7ULP Dual Boot, M4 is the master to control everything, so it not need clk from A7. Reviewed-by: Richard Zhu Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 4fad5c0b1c05..aee790efbf7b 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -362,7 +362,7 @@ static int imx_rproc_probe(struct platform_device *pdev) goto err_put_rproc; } - priv->clk = devm_clk_get(dev, NULL); + priv->clk = devm_clk_get_optional(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "Failed to get clock\n"); ret = PTR_ERR(priv->clk); From patchwork Fri Jul 24 08:08:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E93C813B6 for ; Fri, 24 Jul 2020 07:44:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C96EE2074F for ; Fri, 24 Jul 2020 07:44:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kxuG2qKC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727973AbgGXHoA (ORCPT ); Fri, 24 Jul 2020 03:44:00 -0400 Received: from mail-vi1eur05on2088.outbound.protection.outlook.com ([40.107.21.88]:26464 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727057AbgGXHn7 (ORCPT ); Fri, 24 Jul 2020 03:43:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oBLMZdQNxOvzteK/H+gE6T4pg65KA+hYX1fNRFyhAuZMTVypZBnQaDLQbt+oz5CKxAK13EYeCqklrVgXXWSn/SpR+QMBVxGY25/g1DTM+o3u/ApQIqKGDq9vtUoJwT7qAv0Lmstcx0JEG9jDfRdfc0ECSzbBfVcilt6nGcEx2EErjpDgmP5bH9p2Abrpy5G0439lR5JSxZ4lzUlCbiAn4NsDgoLZC/iBnCpeM5Hk+6Jv2gE/dLvy9UkO7XNCB4lepuuHW78e1+JkMtXNvK1xddeRiliscCGA/jRMTjjurmuGqCIFFoBd8YcB7lq1/5ux2Y17cshUVQC43UFt1PpitA== 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=R9PER7tJVHanuJZgCm9ErNp4Xtl84HfXSUbuBJPMqvM=; b=XxL9D67GGpTahHdvHIEnv4Dg5CybLK2a/ghpKBh7NxCYmvVOivBmVoujEGcS5nxeUVvG5qXDuz8ego3+18yfg+VEJ1uCBNEwgUdBDH18rEyurXVdbZewYmzdY8mNBRrWeMUW11viQRP8bZz+IreMxPGfYvF/BB1wydUHAD2TOJ9U1nGuLm3Iwx6OCDDWHgbYj6pfCysRfYAxV2DirOQwBhwnJCnkvDHTiRppcJ1dw81xh2SZKc7/EVSHXQZKxYJwDHzMMrNCDBZvKgzPj9NbO2y/qrV5HoxQULxmTntr+r9TsUdWD6bclFwIMYvFshv/ZtZ2P+8BTLzKRnKIn0WewA== 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=R9PER7tJVHanuJZgCm9ErNp4Xtl84HfXSUbuBJPMqvM=; b=kxuG2qKCU2MZQb7aqj2eXtnu4WxfOd78e/vfEBsBbSeY7op/jYsm9vcwoPPClmDLbGyDvXVYzsc3Dhb+2E5kwYyURNJxRkLteHPPfL4Mwz5rNIPXI8te/5n1//XYiStp6oicRt6TKY1sJL4qgZk8+IHKrNYlxasCiDko9Ai5530= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6858.eurprd04.prod.outlook.com (2603:10a6:10:113::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 07:43:55 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:55 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 06/10] remoteproc: imx_rproc: add load hook Date: Fri, 24 Jul 2020 16:08:09 +0800 Message-Id: <20200724080813.24884-7-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:50 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 09efdae1-9660-43d4-4047-08d82fa550f1 X-MS-TrafficTypeDiagnostic: DB8PR04MB6858: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2eVnLRBXqM2usHHpmO+CDx5E6eZTkI7D8jvuDEPe5MeDFaRSFichJM1HSELAr1Cap36j9LFEhB3M7roub49JGVZwtQwgsqCu3ztOG07fqNKhDwkXV5AjjQQfjDb/DLO1EUlILJdpdLeLPblbAKZ3EWCjZULmxm4nKLYCwUUJyI8wC42KCln/U2DIGeSMY6n46mTsjDTyWlIwZWCCSWEP3/6wmQdsPcHwv9pxc6VETlbXT+FfO9bfrIN1Hgqjn97meKW05r/AbW2bl/rLNA1wx7ghhAalTpvrEhErTwXlKaHaVTFkERTiAAUDIo0J6omo X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(52116002)(36756003)(478600001)(1076003)(2906002)(6666004)(16526019)(186003)(26005)(6506007)(44832011)(956004)(2616005)(86362001)(6486002)(66946007)(316002)(8936002)(7416002)(6512007)(66476007)(66556008)(4326008)(8676002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bQisqhNZcBXoHnrt1CeG53YrUuBqxIxwOHfytyrQQgbJlbPZPQdhN2CIsU9Wt0nlM57bgSf9q2FgASRgWhGwBJEkBCidZAZ+SHL2DMN/gOMnUpZHuS4WVr/06Z8T1N/sKGpiaG8sX8k1e80JKQerPAOi0/wGuwnp1yKBDcLLuOpiRFLhNctBw5Qn/g4nfgYg2DbedgqHAADt0xWDKryMqyrnE/FCLnM/59wASZO0V8IE2cejU78VowLjLANfe8d36tikTCmB5x5Lm4oIxlE92nUCiwgSLBdoimAm/PEvWFZS0KNikJCcvGotecjidB1RJoPSLmQc6JbBmT3/H3EOA24keWbHyZDP7QxFnzZuMFjVEW2OV6b5xKHvzuIAMCgAIVf9WnxJ8REsdI71722aHy83rLeIb6KWRklMQlJDmqQOB91Y1ZLaK/xik3RNiNZ7JFFfRk3jiMkZAIFxHHtOLN/H51u/apdUNeyz+zEsZoc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09efdae1-9660-43d4-4047-08d82fa550f1 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:54.9481 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 18pW4hA7DfvczYWr/Fc+gzcqS7dJ5xipyYvG50SpDGu5T02XsvSszVtoSpxXp7gO+F2SkmOXkVE1L91IsXJkqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6858 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org To i.MX8, we not able to see the correct data written into TCM when using ioremap_wc, so use ioremap. However common elf loader using memset. To arm64, "dc zva, dst" is used in memset. Per ARM DDI 0487A.j, chapter C5.3.8 DC ZVA, Data Cache Zero by VA, "If the memory region being zeroed is any type of Device memory, this instruction can give an alignment fault which is prioritized in the same way as other alignment faults that are determined by the memory type." On i.MX platforms, when elf is loaded to onchip TCM area, the region is ioremapped, so "dc zva, dst" will trigger abort. So add i.MX specific loader to address the TCM write issue. The change not impact i.MX6/7 function. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index aee790efbf7b..c23726091228 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -15,6 +16,9 @@ #include #include +#include "remoteproc_internal.h" +#include "remoteproc_elf_helpers.h" + #define IMX7D_SRC_SCR 0x0C #define IMX7D_ENABLE_M4 BIT(3) #define IMX7D_SW_M4P_RST BIT(2) @@ -247,10 +251,82 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) return va; } +static int imx_rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) +{ + struct device *dev = &rproc->dev; + const void *ehdr, *phdr; + int i, ret = 0; + u16 phnum; + const u8 *elf_data = fw->data; + u8 class = fw_elf_get_class(fw); + u32 elf_phdr_get_size = elf_size_of_phdr(class); + + ehdr = elf_data; + phnum = elf_hdr_get_e_phnum(class, ehdr); + phdr = elf_data + elf_hdr_get_e_phoff(class, ehdr); + + /* go through the available ELF segments */ + for (i = 0; i < phnum; i++, phdr += elf_phdr_get_size) { + u64 da = elf_phdr_get_p_paddr(class, phdr); + u64 memsz = elf_phdr_get_p_memsz(class, phdr); + u64 filesz = elf_phdr_get_p_filesz(class, phdr); + u64 offset = elf_phdr_get_p_offset(class, phdr); + u32 type = elf_phdr_get_p_type(class, phdr); + void *ptr; + + if (type != PT_LOAD) + continue; + + dev_dbg(dev, "phdr: type %d da 0x%llx memsz 0x%llx filesz 0x%llx\n", + type, da, memsz, filesz); + + if (filesz > memsz) { + dev_err(dev, "bad phdr filesz 0x%llx memsz 0x%llx\n", + filesz, memsz); + ret = -EINVAL; + break; + } + + if (offset + filesz > fw->size) { + dev_err(dev, "truncated fw: need 0x%llx avail 0x%zx\n", + offset + filesz, fw->size); + ret = -EINVAL; + break; + } + + if (!rproc_u64_fit_in_size_t(memsz)) { + dev_err(dev, "size (%llx) does not fit in size_t type\n", + memsz); + ret = -EOVERFLOW; + break; + } + + /* grab the kernel address for this device address */ + ptr = rproc_da_to_va(rproc, da, memsz); + if (!ptr) { + dev_err(dev, "bad phdr da 0x%llx mem 0x%llx\n", da, + memsz); + ret = -EINVAL; + break; + } + + /* put the segment where the remote processor expects it */ + if (filesz) + memcpy_toio(ptr, elf_data + offset, filesz); + } + + return ret; +} + 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 = imx_rproc_elf_load_segments, + .parse_fw = rproc_elf_load_rsc_table, + .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 Fri Jul 24 08:08:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682485 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 100CC618 for ; Fri, 24 Jul 2020 07:44:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E73B720768 for ; Fri, 24 Jul 2020 07:44:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HkHfo/Ts" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbgGXHoE (ORCPT ); Fri, 24 Jul 2020 03:44:04 -0400 Received: from mail-vi1eur05on2088.outbound.protection.outlook.com ([40.107.21.88]:26464 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727798AbgGXHoD (ORCPT ); Fri, 24 Jul 2020 03:44:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O/SV76Gjq4sasbhY+NDQXcRlRm9keyg+5wUqFPSLn+MkyTNSpAlFTGl+obIgBZun2Zes4maAZhgkkQRT9V/DEn8BsflX9lSDzakdAGiLGWLBNgudEZt3tG0rYMGVnjm7O7ZxKe/3WCBeKLTaZLPVpFMow54InFUGHKQ5/VASRfAh9kLXsxQa7JzRxJ9hnvh8UQK12S417XyJoUiF6PGcaoUdBZO/5bt0Q1fnwBB3gpz93FCpkJAzdw0R1+QnFHKK2pamPA6WzFUSLm33pq1ZJSLeLF1ymXAVJnX/cXOwN3FrKz8fBh/hR/KbkKpusJu68gZkOWj1/ZGMabxAV1DRkw== 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=WNKBHTMrmY8wF7CYQVz+bZy3kgVPVLfKbD5Xvr6bNBU=; b=YNFfVeHUMgY+OknLbOSM9wiJtISbQ0KpxPkqXyr2xNz0AZYWy1NmE4jBA7cy+eHRAPyadwI35p5rje+GC6DlcMWM8m2mQHoHLnQUfau6LyVeTj8rxuozpd5oTxb0nXJQ1iSNmvzygSUfn6PPz2yiCc97CAhkYnwmOT2xTjHEMuleuFGXvarlhe9PItg9oCyE7gyOXHaGhuQty8J6iBoMjTH7ABiKBY0Wh8xt1FR3holY7oYHTsMwLG+XfJjL27YJvuVJ7f9bej50m5mH3CG9mGijKlwdjtvhCPkTJ3VrAeyEuSp3p8do8T8KT9GXZMJzuVtlXpltAEDGg0cXC22Y3A== 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=WNKBHTMrmY8wF7CYQVz+bZy3kgVPVLfKbD5Xvr6bNBU=; b=HkHfo/Ts1kD8h4YZh7RuBKYWclzwFdeZHAdHWsRjY1Rn5y51ajq8BUm56byhnMJkt7Dso/NRs0mjruvKu/BbeOFxjuDq0Ek/fKN/hTD1BIGON/Jyw/pQN6j4qAfdJFfPIyxFNnTSfmTG2TxFYfIqasRomaXC0K2BP10jLUKJxmk= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6858.eurprd04.prod.outlook.com (2603:10a6:10:113::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 07:43:59 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:43:59 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 07/10] remoteproc: imx_rproc: add i.MX specific parse fw hook Date: Fri, 24 Jul 2020 16:08:10 +0800 Message-Id: <20200724080813.24884-8-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:55 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: be5bf5c4-b3d2-402f-ad0f-08d82fa5538c X-MS-TrafficTypeDiagnostic: DB8PR04MB6858: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4wuKCks85IhmC2+OYiUrsGTU3FBHO5id70PmdIGFSN+BYsWU+vjdT9TJXWUVfd3FiQ68KnPKiavTxntw2SOkuRoab+0RWnwLKszCNk4u9g3iJNUU5e06Z3SWOdrbgTM/5TYl2iCMgiXJ6RhfnV6LBV36UCOsK4DPXT3M6QsY3d2+ii8lVeYwiHG/pJq8Jf66mbguEuo5ruAd/FsdQ2umnNqjmCsqZFpWFO+oJcJ/G3CnlP94Upare3ypdVBoMhrBzkGq4QTk+5dRroOGh6epaMB52jIFp9x4nSjlCQkYlNXoNFmhGvZ3okUSNWrKalTJYrwl+GVQsZ9MjLJ7xBUd2g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(52116002)(36756003)(83380400001)(478600001)(1076003)(2906002)(6666004)(16526019)(186003)(26005)(6506007)(44832011)(956004)(2616005)(86362001)(6486002)(66946007)(316002)(8936002)(7416002)(6512007)(66476007)(66556008)(4326008)(8676002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 4rB80+kq6rOSHgz75BGeKeh0K3llEyUJsXaW5hN40qfvFav6rwHscRZ0QJbM5nffQ8uvYiTOrpF8Y7BZFZRiaxSzmLTxfZHS+UbaDK1AptaoRqtoZRJKfN9UiLIWvAZZ8CN+eP8YyNAkFSToGagVPgqrAakDveBA4gxLE6DHrnjUZJaL4cL/oMIuIjTOwpm/iwkT+saqk5tHUGDxrpZsk0sr/MgscIOtlWn1nkcSGWkc/GM6oGIRVpYZY/xzG5mZoZT4MZn8bFXyYQik2wtsun96kTM7oWWM628rZ7NiCDh1XoYUkJ1DHGOp9kHnVC3SktjePdoAypQFUdJXLhMEpf4t1f28IcTEO3POXQfJJ7EaC+rBF7s0Nh1WGhrteirnFFa75bO2lCGba+y0PgnH+wkfHrpgNB36rdV2dzgw0tTpDYYGbeLxeCzKO+Tnn+5RT9C1v+FuPbatA0W/8TDiJgt/ubhucBuLXKm9OMCkfJ0= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be5bf5c4-b3d2-402f-ad0f-08d82fa5538c X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:43:59.3381 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JZ6B9KWUD4ZM7R/Fsst9Q4fob8QLeeijXxa6jILD3XdjWwz1Dz24GWYNuI9XcXT2BHCFPxmhjyV4pxpxxfFMpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6858 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org The hook is used to parse memory-regions and load resource table from the address the remote processor published. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 99 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index c23726091228..43000a992455 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -89,6 +90,7 @@ struct imx_rproc { const struct imx_rproc_dcfg *dcfg; struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; struct clk *clk; + void *rsc_va; }; static const struct imx_rproc_att imx_rproc_att_imx7d[] = { @@ -251,6 +253,101 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) 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; + int index = 0; + u32 da; + + /* Register associated reserved memory regions */ + of_phandle_iterator_init(&it, np, "memory-region", NULL, 0); + while (of_phandle_iterator_next(&it) == 0) { + 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; + + if (strcmp(it.node->name, "vdev0buffer")) { + /* 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 { + /* Register reserved memory for vdev buffer alloc */ + mem = rproc_of_resm_mem_entry_init(priv->dev, index, + rmem->size, + rmem->base, + it.node->name); + } + + if (!mem) + return -ENOMEM; + + rproc_add_carveout(rproc, mem); + index++; + } + + 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 int imx_rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) { struct device *dev = &rproc->dev; @@ -323,7 +420,7 @@ static const struct rproc_ops imx_rproc_ops = { .stop = imx_rproc_stop, .da_to_va = imx_rproc_da_to_va, .load = imx_rproc_elf_load_segments, - .parse_fw = rproc_elf_load_rsc_table, + .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, From patchwork Fri Jul 24 08:08:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11682489 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BA3E618 for ; Fri, 24 Jul 2020 07:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F255D20767 for ; Fri, 24 Jul 2020 07:44:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kTxF50qE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727820AbgGXHoI (ORCPT ); Fri, 24 Jul 2020 03:44:08 -0400 Received: from mail-vi1eur05on2058.outbound.protection.outlook.com ([40.107.21.58]:20001 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728293AbgGXHoI (ORCPT ); Fri, 24 Jul 2020 03:44:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VVGKTjYssoKqY2okkQg+6p8kQN6auWncnltEor3SwW9qI/KvEfK6RjXIA+osxGQYnSRu/yy8pN8wSUk2A3bwi2B+Go7Vg8cnpxhKonuO7GyLVsgZKTGy97XOCbfP4KDd1e0NZAE6S912KJsX9vQjVIcI54S7USZS6UsRPrgqB3dm3OgR86wHflPHySGLB8xBunJROsr75YFcA5iLrMltk+9sToALf8bNwqd5MQjFuaPhvPighiUOROW1Py3pRoLhLBX4CaAcUs4PX7e7FM1ugEdb4cseH/N6oCVG37RNkyypK27NoEWm6m6vYvQxBj2mTJ46E8ADtNDtbgLLERBv6Q== 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=OmOmcZ88KXJyAJYcF09Ib1w500GSJmSl0cg424eQR4M=; b=hTZbkyi0KTEYVuxWX0seMRzL7vtItx5q0IS8rVtILTOJXlEgqSn9PeH/J4pVRK9HKZbvGdKLma0FhbcBU8vCK1pFmoG+r8xrQ8bCc/YJ1qgKGWvRdP5mgYto8292HlzUJY2Ce/3n8pzKcFSJKPAID9BqL3Bf2PbkMAEuuNMoLZQbCSRFLSZaKIrLuHviXCBos0qnalW3QroZ1fr66+5MQHo/6GGAK+s9IRPcmqBVSRRl6BD7U/ABIVkZESL1NTpEmHgK68W4HQMvHBKhdrQP8MwCThv2xviyhYb6j/3cqs8JgNTWGFzxpSKm+mIqxAk0GagLRlHgZp99nsanYhNh7w== 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=OmOmcZ88KXJyAJYcF09Ib1w500GSJmSl0cg424eQR4M=; b=kTxF50qEPlkV5lUnd/9jTQP+OP1GydHiUIUPVCeQ0JxTBj8NLzKzvRu+qX17BmAdEExvmDcPyG4UnoSueeCQ6+IRxHtrd3v0s1M7zbkqMAT9vfD0UrxLPHaT8DfHJPIQu7ol0Dz7aN7aYVODkWwMOUlZnr6zNZY3H5uexGCV05M= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6858.eurprd04.prod.outlook.com (2603:10a6:10:113::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 07:44:03 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:44:03 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 08/10] remoteproc: imx_rproc: support i.MX8MQ/M Date: Fri, 24 Jul 2020 16:08:11 +0800 Message-Id: <20200724080813.24884-9-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:43:59 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7b79836b-8a65-4d94-a8c3-08d82fa5562e X-MS-TrafficTypeDiagnostic: DB8PR04MB6858: 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: 4XCpekZxBLDfbXsa0bx7ZZmiuP9DFQq8yzeML45o4Z/VkCQNEP50BrVBy1F8NdOEHcQO1g1y+7yGPABsbt+ukiAYCl5pejWZix4qWI6N1SPWB9mcs91frjV3a9+NOmli9WrV61t1Npq6rnysy+yUwMaWliyUFhzykC/fyO1RefjbYcYz9sTf24RfewtgZibAr5y1krtyqz40Y2hBX/CmDkKRPCuSGbkuqJHWIfS7hIHcSTrJ1W+ZnecFlix+bPQAszOfZvTg20rvgKD6r6TZmbsHSIdsgafIM3buLQWCxxEKKyLlN8RpIzWbOq0PTUfw1bAsgkDyddH0ScfGSyXSMQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(52116002)(36756003)(478600001)(1076003)(2906002)(6666004)(16526019)(186003)(26005)(6506007)(44832011)(956004)(2616005)(86362001)(6486002)(66946007)(316002)(8936002)(7416002)(6512007)(66476007)(66556008)(4326008)(8676002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: im6P2HKZoVn4esXZYYz73+KuasuAbjpoDSct7EDWhSKG1RryGDycnw8EUFcPVvRC5OXporHOTVo6CusLgoc0p9Hs01DMKAjLj+y65DshKc1CL5N0r2to5r0Ns1uK2CLf4rm6JWQn8Th4kZbLr+3BBDfqvKUINgWnbMYDAZavc4IaIvT8OETNxbRLMkueoNqRM17BjfKeOPNeZhmI7/HfNaSclkO1gnJsrEwkdU/2XMYCof3cCFLaA3VATsqVwXK4O30KAtRLn3MTTceMw5cN6Jp4gFzSLo1ZpWeK7zuZ1deCaRfUj5EX1PIb1CikGrggF2OMb/MBLW85vhNAqzZtQlH7lnouaPjYlwvsABwfcS1B8diRPI1H6ch/z59IpKpRsuGhylhvzoTVcQMZPiO9M3xK1S7TF1Ysh2YDq0TErQft0+s6XIS7DGovMtSof9tPAcqLnyqO1IzPgDso9IKp05MRyW7+4KBzMAfrNPJZ/7M= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b79836b-8a65-4d94-a8c3-08d82fa5562e X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:44:03.7351 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nMrnI7vcLv3gzaL/JgjAkpaJ+EXTFeUFe6wWHvcEZtU+lqHnSPXrO7no/LZM2BntOi/SGReOGmg0jWAXRllWmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6858 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org 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 --- 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 43000a992455..03382290d6a5 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -93,6 +93,34 @@ struct imx_rproc { void *rsc_va; }; +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 */ @@ -143,6 +171,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, @@ -583,6 +620,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 Fri Jul 24 08:08: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: 11682491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F107713B4 for ; Fri, 24 Jul 2020 07:44:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB76120767 for ; Fri, 24 Jul 2020 07:44:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="cvfjDZ/h" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727856AbgGXHoM (ORCPT ); Fri, 24 Jul 2020 03:44:12 -0400 Received: from mail-vi1eur05on2042.outbound.protection.outlook.com ([40.107.21.42]:28161 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727836AbgGXHoL (ORCPT ); Fri, 24 Jul 2020 03:44:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L1ovKxIb/lYevOxiZ/OotmUVKlz6OtOOm017HAQfqmH5iDgO8+ykWhYCboTVjlgmDO5Kmy++kopi1BlUIHRDpVs6xxCZxEzxzaXzsU3dA6PQBws39SXr+Qp/rw22mnJoLQ84IN6KFzS3K6J4edGjszpXWadmy0lcc8Lm4Kw2H4B8MKlE3uPg3/Fw3m2S1S7a+LGwAQPZ5UNmNkB6Oi0ydv/21Ud8PSr5uAb8U9O11+PDBXwstr6Vm+9SV9GjCIwM3jY+87yLFCGhcSwROJ6VR4k6qJ9ADekB1OH2nf11kD2qfrtwz8Q1CLPm+vbZJQ9Ns1We6k94Qvaz7JFFQpNojA== 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=/S5xzslLg13cyVfNnQlytWG9SZw7GUarAuSy+KDde0M=; b=QnJQ+nK4irrZTi8Tx9m+2Ay+2DuMW7xYhwjsr0fiPCF9J408lX6ZKKFWG6xNXDg484u7zp0ALuZB0JnYaS1CTVg+3zxdMP79cDUsjYLGd764XaB9zQ2t963dQAMZqeGoieWnTArtPpjcmYIY3MAb4LFheWFObMPokFgElGfgd8qvzFWdlQmgofQMTWBpD6Iws7RaWm6ivkyScCg5AJbtxDSaih4QSZrmSEqgBVhXz97xMqzgEtmDJ+BmsFIOUvUF7irxWt1Eaj66PWVKEh7ETwFb4dLk23XGpPFnLCShMvPwaajkMOSCF39KDHd2em8OL5tyQZt1GlqHdHMUOzP3SA== 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=/S5xzslLg13cyVfNnQlytWG9SZw7GUarAuSy+KDde0M=; b=cvfjDZ/hWzW4fbDyVUKCffKpDpDOR3CvvmMxqHrpQtNCAPGrqPNcqzCtFewci5lLRQLPMp9shS7784qbF2r7xtqW33PnGsBE9pGHxQBkSPyb6aCIwApAkMh5SmQljoRtqrawgNNKi46b9Z9moYVJm0Q2g8NnxfWyIiqcDNaI2vA= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6858.eurprd04.prod.outlook.com (2603:10a6:10:113::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 07:44:08 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:44:08 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 09/10] remoteproc: imx_proc: enable virtio/mailbox Date: Fri, 24 Jul 2020 16:08:12 +0800 Message-Id: <20200724080813.24884-10-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:44:04 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9ceff2ed-4731-4da3-157c-08d82fa558ca X-MS-TrafficTypeDiagnostic: DB8PR04MB6858: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:569; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UzwWHjCFNDxRKwjcZ1Am4qfoAfYQKtHJT56NJ4I8vvsbU3biNcJxw4fOELHdlfSh29TXvGPYtmrV2iZm9ilX1oBWGaoFFMrYTo6f6xhtel34v/EiD7tLsXlKwkQCiMhHMMD2A8gknrPeg8cLsp6F0GgKVIbhVQgmKJMPZE1InJk7z2oMVDe8hgJI96L+Hh7oVl47yg5qwKqzruNet3qT3kSWFygzywYYPrQaE+Bqn+U7kw7mqTYZjU0cdW8w2tUpR0mFu9RIO1f78hZ9E7LmC4w01P9UnGfJcoOb+2TP7AdJZWaiyBA2mQ7MQXrnl12VpFCG7bAXjxaF3SVgH3GATQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(52116002)(36756003)(83380400001)(478600001)(1076003)(2906002)(6666004)(16526019)(186003)(26005)(6506007)(15650500001)(44832011)(956004)(2616005)(86362001)(6486002)(66946007)(316002)(8936002)(7416002)(6512007)(66476007)(66556008)(4326008)(8676002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CChrRR4/ftpbxpupoLpzgHVkiFq+SRpNDX8Dm1p2Yqm4WCM1gKLzdbVlfDr2jkC/ZLqDTfHS35d34cvczSV1mDMwZ6Mlfg4VACo7TD07OJq8NsU/xThmJPrCQ9rtv0nl563kcL4pmoZxsgd/IHdA26uFvJAORVs6kEy8g8MgIAbUkj5oY3KKnU0AJ0gY0XViARPmaeBwNkrKeYlVT0oiDzg2gTD9EQm0DE4TNQ12XGizyCtTIT32Co8ptbkEUo1SW+wUk394xVRFo7M3QDgwNCQ+xkXGL9kJhOpRl3qWtw0b+jNNwPkIgY3AS5lT3Pry9lIKYjmPzR7P0Klta8IZD78f7FY5k2y0q3qhzlKr5EYnVzYFNCQUFtr8m7A4S7LPxmpdiYqRdTwa4keKor+9g8MwissP/DYfJ2z+qBI0jArLYG7nrhxe4Tzqy6rIkS0oTXtBnlvyE8BtzSf119fSL8cM+RgN3NgOhFwHK1BTtEI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ceff2ed-4731-4da3-157c-08d82fa558ca X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:44:08.2561 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xC0yi20tO9/nMiO3qC5KCZvfjzWLugk6HqTdzmmOesD0uaXFvN72OsU3LINKIfbuJhET9U7JK0bLDznxE9oLkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6858 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Use virtio/mailbox to build connection between Remote Proccessors and Linux. Add delayed work to handle incoming messages. Reviewed-by: Richard Zhu Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 102 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 03382290d6a5..a8ce97c04e1e 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -91,6 +92,10 @@ struct imx_rproc { struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; struct clk *clk; void *rsc_va; + struct mbox_client cl; + struct mbox_chan *tx_ch; + struct mbox_chan *rx_ch; + struct delayed_work rproc_work; }; static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { @@ -452,9 +457,25 @@ static int imx_rproc_elf_load_segments(struct rproc *rproc, const struct firmwar return ret; } +static void imx_rproc_kick(struct rproc *rproc, int vqid) +{ + struct imx_rproc *priv = rproc->priv; + int err; + __u32 mmsg; + + mmsg = vqid << 16; + + priv->cl.tx_tout = 20; + 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 = imx_rproc_elf_load_segments, .parse_fw = imx_rproc_parse_fw, @@ -527,6 +548,67 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, return 0; } +static void imx_rproc_vq_work(struct work_struct *work) +{ + struct delayed_work *dwork = to_delayed_work(work); + struct imx_rproc *priv = container_of(dwork, 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; + + schedule_delayed_work(&(priv->rproc_work), 0); +} + +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 = 0; + + cl = &priv->cl; + cl->dev = dev; + cl->tx_block = true; + cl->tx_tout = 20; + 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)) { + if (PTR_ERR(priv->tx_ch) == -EPROBE_DEFER) + return -EPROBE_DEFER; + ret = PTR_ERR(priv->tx_ch); + dev_dbg(cl->dev, "failed to request mbox tx chan, ret %d\n", + ret); + goto err_out; + } + + priv->rx_ch = mbox_request_channel_byname(cl, "rx"); + if (IS_ERR(priv->rx_ch)) { + ret = PTR_ERR(priv->rx_ch); + dev_dbg(cl->dev, "failed to request mbox rx chan, ret %d\n", + ret); + goto err_out; + } + + return ret; + +err_out: + if (!IS_ERR(priv->tx_ch)) + mbox_free_channel(priv->tx_ch); + if (!IS_ERR(priv->rx_ch)) + mbox_free_channel(priv->rx_ch); + + return ret; +} + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -566,17 +648,24 @@ static int imx_rproc_probe(struct platform_device *pdev) dev_set_drvdata(dev, rproc); + ret = imx_rproc_xtr_mbox_init(rproc); + if (ret) { + if (ret == -EPROBE_DEFER) + goto err_put_rproc; + /* mbox is optional, so not fail here */ + } + 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_optional(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; } /* @@ -586,9 +675,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_DELAYED_WORK(&(priv->rproc_work), imx_rproc_vq_work); + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n"); @@ -599,6 +690,11 @@ static int imx_rproc_probe(struct platform_device *pdev) err_put_clk: clk_disable_unprepare(priv->clk); +err_put_mbox: + if (!IS_ERR(priv->tx_ch)) + mbox_free_channel(priv->tx_ch); + if (!IS_ERR(priv->rx_ch)) + mbox_free_channel(priv->rx_ch); err_put_rproc: rproc_free(rproc); From patchwork Fri Jul 24 08:08: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: 11682495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46FC4618 for ; Fri, 24 Jul 2020 07:44:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2808120768 for ; Fri, 24 Jul 2020 07:44:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Z+xM73FO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbgGXHoS (ORCPT ); Fri, 24 Jul 2020 03:44:18 -0400 Received: from mail-vi1eur05on2049.outbound.protection.outlook.com ([40.107.21.49]:61664 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727836AbgGXHoR (ORCPT ); Fri, 24 Jul 2020 03:44:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YV9zHcRv2QdLAWsdVbdqPx2Z5fxZWG6CtfCEOngmILAXuj/5rVPPL3peGotRtkBbYcFrnfflw/y3lFciYa4ZWFBADOc6XcLYAXWWXKyFH28sAGRf4RoojfUPnkWClY1vtPNZqdCowVh5+AiU+Bs9cXaM+Iwe0FEQd4Kr7lH87e6gJ2ShvX8puTvfpXgGyBcst2pfEJQae2D6bVA+SGM5M/tD/wIb0RWIM/xhHH/lU2F0tRcH4lU/zkSqm51GKTONjnseSEGs5Ww18WI5+iAeioRV59PKdh7nBen+ni8ADu0MA9GtnCR2vg/5uz6MmyLkLeDitPBUH2AwUcamXIxFlQ== 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=ycrD+ONW/+IkoPUuu4wnsgt/1ruih9vo8Wr0ekuz24E=; b=XSIBAhhFuIzeA0QBzFOUeA+9xGfAQcavKcS0mgJ6WbPLpdtWsyX3VRc+AjFi1Ctn8KrSvr+MdKUj8LGuvNWzxrwQNYZSiJ+3MWsowU6MY2GfQOJ85PojFrNXJSM5SOG5lBfh5G2BejiMRIyp2YJ5hInrypu3YYKhFGXJ01ccganAWz7mbQ43DLu0ZtzjBwaKXuWHIBzJmyp6Cb4ra0y20gpzQnTsryu536NTYcrsClt/pmR5voPncILv4b5eNd3GjsaVz+0itP9FcPAYQ+MGxHJUI/B85m0nA43ClmTWgQKPW8YkIgNokU97FrVQfLgEdj0m6prWQCD+CBTONx3wMA== 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=ycrD+ONW/+IkoPUuu4wnsgt/1ruih9vo8Wr0ekuz24E=; b=Z+xM73FOJVLHsoZBM548Wq377CDD4vnnOuejxoSFGmsdHl8W1KVpymtwoVH1ZdtzpheFAgP7dmDpCQnVTVZ1pTb19ahxEcr3D0Psl9ra6j39MqFSRHvtk/wr5LU4jH1P6Nknq4s2pEkdl6XQXWx3y3o1Prv/b/SS/h0mYKRcn/U= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6858.eurprd04.prod.outlook.com (2603:10a6:10:113::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 07:44:12 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 07:44:12 +0000 From: Peng Fan To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 10/10] remoteproc: imx_rproc: support coproc booting before Linux Date: Fri, 24 Jul 2020 16:08:13 +0800 Message-Id: <20200724080813.24884-11-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200724080813.24884-1-peng.fan@nxp.com> References: <20200724080813.24884-1-peng.fan@nxp.com> X-ClientProxiedBy: SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 07:44:08 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2481b5ca-703a-413b-5505-08d82fa55b94 X-MS-TrafficTypeDiagnostic: DB8PR04MB6858: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CU9BcNYCU1wjESF7XCRpx2fQzOYD2VDLrDXGzOC1jw0bxPVfPXXoIRufQOi0yO1SuO4YgAlKAB3adbpOuxWaXwuN3XgqRKbz0oq3bZdY8HklYC9wbgqhhlu+3ZsESb5J9WxD7QctepLq3cpKRuiTcgDfIXJgSvJnsFWabtbOO/rR+DswCGorgP3ewGuu9d6Ka1EW9KDfurewYOn3nOYhXaGCtP1FP90LQXMxpqDutAZMQo0zEkBnBqtSY+wtjasTumCD1UpxztiVEYozQVORiKy5um0xf48UG7Jdh7sYP2u2kMoNzE7HnfdY9XFpn/K+GpMYjN8imjpozZ5VMmPQPQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(52116002)(36756003)(83380400001)(478600001)(1076003)(2906002)(6666004)(16526019)(186003)(26005)(6506007)(44832011)(956004)(2616005)(86362001)(6486002)(66946007)(316002)(8936002)(7416002)(6512007)(66476007)(66556008)(4326008)(8676002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: +BXej0xxfuBoqWkqbDIdKogrwn+KqM33XmQoWEPqtwv689nhKMiy9a/GQx5fh7vsH/cLP3i/3TS2kJwnWFmAlr1wdgcTimXDPZNdM3GYT7vIWOSqNNFV1r41/1uxEgmKP6u9ysIzGwOW9eyHWGHFP2powwKL7giRwZmWW/xFkv7p41ZQlSDRRqyYR5NRGe4J0bRMZdm3REJafZKIJEzHsoa9OqDpcy8bnRhcZNRtwTXmlR6MeTjetws1nbhtA8f/qYIutTaJlfrrGpCoSO8Gj6EHJCsnvywT374toN5bfS23Zrg4nuXihPRyxUZ9zjMavDIyrvh616c/Tq7A5FA1MQnc6AoAdbC5nF01cnGBnUFgHxHsnPFNazCI4aSKxA0HHl+dyAeaBH4dhN6T96BHaF7sgUR5sFBkE4LDbli3USQ4MvDPzijiGL7RsZ33CmQxMRisK6PpKQtDRT12tzP4QhrIIrca9RMTWeckIPqKuDM= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2481b5ca-703a-413b-5505-08d82fa55b94 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 07:44:12.8890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EQP6hoC7N6XHnB3Flgwp+ynlQ9oZb2a2pYsUfnyVV8i2WWsfBAwy+3/9JaZoyNpnUzfeD5edF6WgWFKChEutrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6858 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Detect Coproc booted or not and Parse resource table Set remoteproc state to RPROC_DETACHED when M4 is booted early Add attach hook Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 75 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index a8ce97c04e1e..0863b3162777 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -91,6 +91,7 @@ struct imx_rproc { const struct imx_rproc_dcfg *dcfg; struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; struct clk *clk; + bool early_boot; void *rsc_va; struct mbox_client cl; struct mbox_chan *tx_ch; @@ -235,6 +236,8 @@ static int imx_rproc_stop(struct rproc *rproc) dcfg->src_mask, dcfg->src_stop); if (ret) dev_err(dev, "Failed to stop M4!\n"); + else + priv->early_boot = false; return ret; } @@ -390,6 +393,32 @@ static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) return 0; } +static int imx_rproc_get_loaded_rsc_table(struct device *dev, + struct rproc *rproc) +{ + struct imx_rproc *priv = rproc->priv; + struct device_node *np = dev->of_node; + u32 da; + int ret; + + ret = of_property_read_u32(np, "rsc-da", &da); + if (!ret) + priv->rsc_va = rproc_da_to_va(rproc, (u64)da, SZ_1K); + else + return 0; + + if (!priv->rsc_va) { + dev_err(priv->dev, "no map for rsc-da: %x\n", da); + return PTR_ERR(priv->rsc_va); + } + + rproc->table_ptr = (struct resource_table *)priv->rsc_va; + rproc->table_sz = SZ_1K; + rproc->cached_table = NULL; + + return 0; +} + static int imx_rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) { struct device *dev = &rproc->dev; @@ -472,9 +501,15 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid) __func__, vqid, err); } +static int imx_rproc_attach(struct rproc *rproc) +{ + return 0; +} + static const struct rproc_ops imx_rproc_ops = { .start = imx_rproc_start, .stop = imx_rproc_stop, + .attach = imx_rproc_attach, .kick = imx_rproc_kick, .da_to_va = imx_rproc_da_to_va, .load = imx_rproc_elf_load_segments, @@ -609,6 +644,36 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc) return ret; } +static int imx_rproc_detect_mode(struct imx_rproc *priv) +{ + const struct imx_rproc_dcfg *dcfg = priv->dcfg; + struct device *dev = priv->dev; + int ret; + u32 val; + + ret = regmap_read(priv->regmap, dcfg->src_reg, &val); + if (ret) { + dev_err(dev, "Failed to read src\n"); + return ret; + } + + priv->early_boot = !(val & dcfg->src_stop); + + if (priv->early_boot) { + priv->rproc->state = RPROC_DETACHED; + + ret = imx_rproc_parse_memory_regions(priv->rproc); + if (ret) + return ret; + + ret = imx_rproc_get_loaded_rsc_table(dev, priv->rproc); + if (ret) + return ret; + } + + return 0; +} + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -661,6 +726,10 @@ static int imx_rproc_probe(struct platform_device *pdev) goto err_put_mbox; } + ret = imx_rproc_detect_mode(priv); + if (ret) + goto err_put_mbox; + priv->clk = devm_clk_get_optional(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "Failed to get clock\n"); @@ -689,7 +758,8 @@ static int imx_rproc_probe(struct platform_device *pdev) return 0; err_put_clk: - clk_disable_unprepare(priv->clk); + if (!priv->early_boot) + clk_disable_unprepare(priv->clk); err_put_mbox: if (!IS_ERR(priv->tx_ch)) mbox_free_channel(priv->tx_ch); @@ -706,7 +776,8 @@ static int imx_rproc_remove(struct platform_device *pdev) struct rproc *rproc = platform_get_drvdata(pdev); struct imx_rproc *priv = rproc->priv; - clk_disable_unprepare(priv->clk); + if (!priv->early_boot) + clk_disable_unprepare(priv->clk); rproc_del(rproc); rproc_free(rproc);