From patchwork Wed Apr 21 02:20:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12215317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3189EC433ED for ; Wed, 21 Apr 2021 02:39:15 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 942CE613DE for ; Wed, 21 Apr 2021 02:39:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 942CE613DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RJ0VjG5198u/Zy2IglevVKGi8Q7RgyoC1LgzyM+l5Lc=; b=cZt5gxWesB0BDuJ6RxVDQAY9o IJg3kYqP61WQv6fRL5Q4kPF+74B5pK5K2mrwuJFxiIxRul8Ffs4T408EQ5/z7mvNqK1ZWwfmc0VxD jv2kDcYYqDr1pSYukT3G+a1qul8d+Nm8Wb161K6o9YCbGLa8m0iS9dHdPom9LM5keG6YCt7Tdje35 Ws8iaHfJVEvNZr4gxSJVlC+I/cBfMC9s7IBZKJxfEkAO2soVf/lUxXgmUjLOxWWcTE5GaoogPbJOQ GfsyDeyNO+/2ak8FhuRyAN2DFU6sE1hGOobPLi4UoGzSPAsOBw4TQ2gQBAuwRFI3d5yr7haYy64YZ 0zrVjZZ3A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZ2jt-00DULC-M8; Wed, 21 Apr 2021 02:37:18 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZ2j0-00DUCR-IT for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 02:36:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=sS1qPSpCR2+q5Q2NGZhBZ4LMiXU5RaEq5A3dh4Bn1gI=; b=1p3u7GU0UbaQj007bv53u0qczy +z0oiT6UJE15m6Qx78P9izKpmQOimb8fRKheMQk9/Hyt8XXDFK4P8BRn+Zum1S4z41T8NoXBZD/UI Ontl8CodyzLL/GMDLVhvUuTa9hJLN8a1km92ZBctzrLy8nThYXT2ngIiX7JWq7bjlo5Litrxko+Ms zn9yi6VosIPzpVdbfyvXbY0LpUCk2hdPbt1jpDLBa6Hatydd5Q0L1kuYFNSeXqYPqUkFEvKHNtXms CDRZ3FYsxpI5AEGA1ltdzaKWyp0WUVmsJzCzBIrOt72Ma4LFFAdoO7nexXUtfWUZpz0bQPo9D5tlW 94flLIcw==; Received: from mail-eopbgr150050.outbound.protection.outlook.com ([40.107.15.50] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZ2iv-00CXsO-Tw for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 02:36:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BizIlscu30KvtM+g+kT1V6oAxWPLrj5aJbY9mq8a3uXOU0btLYwXN9xBnDaslch+GCf+ovS16Tpl4G4D9ojq08XY/g0p1e2dmJrbXgf5O9juotmoIZpF+v5wq5mAULx1gp31jD1dX9AqVlDesi+ekHBffp2SChZDJIgNieQmq9IAyOflrMq7afnIn5W8ScXptb5ZGeUyATJxG6XopVzFYmTfpGgewy8dneoXURuVyG97GCrPzJcxY0rpC99Qda/KgafsL0MyFDCNh5jB2NngYu5Q6TY4elTK+j4+F5muv3CDeP1A002PcllWwkVxQUAYeYqqyQojd+6R6lm2uDLMAA== 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=sS1qPSpCR2+q5Q2NGZhBZ4LMiXU5RaEq5A3dh4Bn1gI=; b=TnU0/ycZOwZ+Q2KEP3rX0ejvt+0DCDB42NzQsuAnaya0BprIE4MdTx24EKlOuQpGSDf33LXq/JY35Xn+S0nY4q1tcjZRGUp24h5OJ0/IWSPAKLqqgrsObmtWXc/0AagxsrzT8u6BHNIwX+ZQGPzR01c3Hm2nAvzFA1+zQ0781rk+kFI/ICv/b2nF1txmIH14w7vZjF67DJhqGLEG7zsYss4PKnb6tk04MsOeqKiO0HnM1smRrj9kjsf8z6lOjAu/lZ7HpfzIZ0m6a/hdLmt1J+ahEJOvhu9LFgpjqZXhDATu6a225cVFDeuHOHs2P3bl+y7+RcSg5EsGmew3J2R+Hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sS1qPSpCR2+q5Q2NGZhBZ4LMiXU5RaEq5A3dh4Bn1gI=; b=TM8JhSdPvtsjlyvtIbzVASLgDPPiUAtJQ1JLaksaxE8SoO6aFvAJ6rhwKRBnOzAoV8iTyu956fsI57r0mmU1IhTPCRInZjlf8J30X4G1WuV3nuNhIcE1YxDKrUvzZZoHYeVjZYmfAMgeU4o3bBYMuxT2EhkWLFJWYUND4439O0I= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB9PR04MB8313.eurprd04.prod.outlook.com (2603:10a6:10:241::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.19; Wed, 21 Apr 2021 02:36:15 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4042.020; Wed, 21 Apr 2021 02:36:14 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V5 5/8] remoteproc: imx_rproc: initial support for mutilple start/stop method Date: Wed, 21 Apr 2021 10:20:19 +0800 Message-Id: <1618971622-30539-6-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618971622-30539-1-git-send-email-peng.fan@oss.nxp.com> References: <1618971622-30539-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR02CA0204.apcprd02.prod.outlook.com (2603:1096:201:20::16) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR02CA0204.apcprd02.prod.outlook.com (2603:1096:201:20::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4065.20 via Frontend Transport; Wed, 21 Apr 2021 02:36:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4fcc3924-277e-40cd-b120-08d9046e3813 X-MS-TrafficTypeDiagnostic: DB9PR04MB8313: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:153; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hvzs/RWYkuXuL8QXAb4ldSwb3lEZOGmJotwNOXx4SplArZDksv7rpCKdvXiwvxLKBcbWenMvZW9ppNslF+A8x0sOujuEMZeIK+s2PtS7ATyH4Z+Ptfx8Id8w1yV/WUbo2GBCKSp7NAATbaOUC1yUCE3cRLXoLzntb5glk3FCYotI18T38Of5ZolGkyENnFXVutejDzqL7SeswE6HKKii6gKW1GvJAj+i4pUeOccSHiGxPm51Ya/evyMpvBPL+iYLHuJBJPTp9avr/fFZcX4CHCj4ScrmqHXCB9cyOLyDAvQqmGoLq09EEkQh73izL2SGFezTCgcMqfqdVs5dXHIlL/jrxou3WlNN/zXPprOdoK/H37AmJ7l0L4Db7Typ45ctGlvsqli7oRlC9ky264jilGQsE95wIeYVEG6/TvfPPk6dLA5c7DFlqCXTwZQorz7GbAHV6nDkiBnS0tJTK0MovYkcRYsIh6ZYPBDLh3Yo5Diy4bosGoe+WjSwjCiOM0IDhWSdoSdeL7JiTHwoHHtl9rGmVqqvjRpxfbpDhKma53WB4V/vkftM5iwCULK6iqLGq4L+avsCR2i4O9coM0FoBMcUHsswERApFQcddI53+lBfsFv+StznHZLRsohUz+e6eILcEaxJnr0K5ZekmRlXq/jW7ImM3GzD9CM2pPCSeAHWgVbf0h7IBQkHcS9yGbXW X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(136003)(39860400002)(346002)(396003)(38350700002)(26005)(186003)(38100700002)(66556008)(52116002)(5660300002)(956004)(4326008)(8676002)(66946007)(8936002)(316002)(86362001)(6666004)(66476007)(7416002)(6506007)(6512007)(2906002)(9686003)(478600001)(2616005)(16526019)(6486002)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: RcmQbNqZAVw/zCVuJs5zwwcDco28A63/FWc81DHGgmll+sIxR93l5AIgoOXZH+7bZSoHn90qZefb9HlzWxMCmG0ebvvfc6jZPXfZ0ttVgz9ehT2lSpg2t2OeyH7oJZ9DWtSBpx7rv6ZTxlaDd7Oc4T9My82jEUB+KnMecILuAjte74haWk5Fk9I7b4gVqs7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AzgjclN4Xz37iWsGuYTuA2kGWf8vhasf2b89u5W1jDnU/8YyKZF0w1xI8te8e2gmCh0mWUZwDcTYFccAmca3Q X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fcc3924-277e-40cd-b120-08d9046e3813 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2021 02:36:08.4983 (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: mPqc83FQ1x/p+HcGlg62BmaNfa1xxQjHZKwVsjLMxhtu/UfijM21f9vIQ6D9iVSIdvFVZVyL2dSv8n9FgZpI+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8313 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210420_193617_989380_7FBA63FC X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan Add three methods IMX_RPROC_NONE(no need start/stop), IMX_RPROC_MMIO (start/stop through mmio) and IMX_RPROC_SMC(start/stop through ARM SMCCC). The current SoCs supported are all using IMX_RPROC_MMIO. Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 06dac92e98e6..6289aeae95b6 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -74,6 +74,15 @@ struct imx_rproc_att { int flags; }; +/* Remote core start/stop method */ +enum imx_rproc_method { + IMX_RPROC_NONE, + /* Through syscon regmap */ + IMX_RPROC_MMIO, + /* Through ARM SMCCC */ + IMX_RPROC_SMC, +}; + struct imx_rproc_dcfg { u32 src_reg; u32 src_mask; @@ -81,6 +90,7 @@ struct imx_rproc_dcfg { u32 src_stop; const struct imx_rproc_att *att; size_t att_size; + enum imx_rproc_method method; }; struct imx_rproc { @@ -183,6 +193,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { .src_stop = IMX7D_M4_STOP, .att = imx_rproc_att_imx8mq, .att_size = ARRAY_SIZE(imx_rproc_att_imx8mq), + .method = IMX_RPROC_MMIO, }; static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { @@ -192,6 +203,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { .src_stop = IMX7D_M4_STOP, .att = imx_rproc_att_imx7d, .att_size = ARRAY_SIZE(imx_rproc_att_imx7d), + .method = IMX_RPROC_MMIO, }; static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = { @@ -201,6 +213,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = { .src_stop = IMX6SX_M4_STOP, .att = imx_rproc_att_imx6sx, .att_size = ARRAY_SIZE(imx_rproc_att_imx6sx), + .method = IMX_RPROC_MMIO, }; static int imx_rproc_start(struct rproc *rproc)