From patchwork Mon May 10 04:00:33 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: 12246753 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=-17.4 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,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 50E53C433ED for ; Mon, 10 May 2021 03:31:44 +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 CCA4A60FE4 for ; Mon, 10 May 2021 03:31:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCA4A60FE4 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=/OSHdtl3+dXf9cJoKMuPMVvXF2FZbRYLEpgnoibq3bs=; b=PSdqqYSAjThmH4gZdshfMgap3 +2OOMatZjhl0cM5TRxbbECLPy4klaS/2V1V0tpdN+onZcIQ1BpbQBUFuUv7j07OBvaAIZjMH4H5w3 N/0IYSbWqeqUBUDGax6HGp3xKo7fUz7OTVlAxDvRYwwLqhe3hkBQquyNfRAckQcc7wtZRvtOQGBvA p+y3pujHelsRVtJ8LSEpvb4biWo7DvQT72sKawbQBINuotEE4Z94HpU7I40aBp/7PZ1A/+uJ0UBSf d8HWfvs+JmEx7mJ7xgG2OmfswUC+IudBxMb/zyvlxIFddbjSKxy81h2c0cZeQvhLGGDSW7EEvCJPT sj4jgxBTQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwbp-00Cxzx-9O; Mon, 10 May 2021 03:29:29 +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 1lfwbV-00CxxJ-Ne for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:10 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=dBtNf8hUw51xpYDxBFthFu3ihl0mHuIhW/BkcGUm2cA=; b=dj8XTLcso8PU7w1jeo1Pb8nxqR RRWuczuAwiA1ZjDSGUZ8wTSEjEMfbb0UzGtWkZQfATZlbEyDMoQFKKxBa++Ew1VSdINtWDm5Dyext y/vvAEWQeeNMOQ63h9U4pVIBSbh7dYhn9apF4wez2B9WZw6/E/pV1aSNL4xKTWVhd4F5RdVAFjhuW tZDH7Fe2fiZ8MKWD5ICD9e9U46PVcpm1Vx7matoMoVstncqeSEd7TDEf5PuTinAfx5RIP6F7dVJ+y CB9YKR1COyL79oAKIwDjtWeHAWLxW5iMzp42nHmCDKa9TBsCdV6CkDzxWNFSj7XHUOGLuziXEyW8v HWdJMf4w==; Received: from mail-eopbgr140079.outbound.protection.outlook.com ([40.107.14.79] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwbT-008Ehf-98 for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CHBY3buTrOA3v3qmVrrwF606A284JXS+gkTbRKlPGbZdIqcYidoZ3V8lKheS621x6Hfp6k7AHjnpo5br8X9ALbRiDhrJ3xxTgp1F0D5kyTnGJTIAyf+VIKcmhiEzEjOLb/ctakw5V1wkaOMlx5tQIqcyteylI51L61AtpqbfC/dVMK+FdAB7T1EtvMgjDTXQ/Nna4X/AMTEPQTIQ3o07CPoXOuun+6nUuIbiYBrs4BPmXrtolgm+0QaKfkbla/6GDlW+rk5IvsHM7eOOEQRKwMwj2C34XlVM3o0++X3Iad/Ecbch+u+t+X7ob6unXDZdPiF1otDzPV8p70jkAcqqfg== 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=dBtNf8hUw51xpYDxBFthFu3ihl0mHuIhW/BkcGUm2cA=; b=OdVXEX7FxV3/LRS7EVAMxv/VGI8mPMAI5Kwm+CvrkagblWsVDFiJe8wPcpsjBWJF4fKjWoHviyMxx/P2esP2O4S37f2pwQ3pNgDvD9tog19x6BXoonExJYCYXMG3p6CuEOhUcQFf+XqGbL3fgKW4J9SupjO4tlsturiEbhs8gCWz5kULhEgRMaZZS8+s5WQnj2/74HwwMnMs3+pQHv4QtM6oy6XvnVQTcr3gLkPdvCh4of1Z8Le92Tx2VU91a2zdR3ZxWr8WaNtSo4KUZ8UR+PqtbzWDXGAIJMmBSVsJD4vFj1VFqjepercktteOqjYdJxhDVYWi+KJohADekNWYAg== 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=dBtNf8hUw51xpYDxBFthFu3ihl0mHuIhW/BkcGUm2cA=; b=i96Zh541i2C6YBcoVDoDcRH9dGx+dSJsNEFuCBA2zgrS10F2ZyDWrzh/LGcgUCMyc2SnB0N+eew+4A3zaiIo/D0jTU3jkZsVJPIaFpUty02mcRiteQ6iRZfKfQIXzs3i0wORP6d0Gaag4z6FuNkPawlPmRPvb4o86FsfUQa2MyA= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:03 +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.4108.031; Mon, 10 May 2021 03:29:03 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 01/13] soc: imx: gpcv2: move to more ideomatic error handling in probe Date: Mon, 10 May 2021 12:00:33 +0800 Message-Id: <20210510040045.13225-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:28:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d43db42-4baa-4110-72c6-08d91363c26a X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D8HLD1v+YvQk7nDFULXkvzkD0oFYJqjbmuItrXeVukIbha00UHY3C/QH/tK4r1PgcTP7CiqSzY1iUkSuSczN+j/ZXIAi7hAOmJFyhaxPihQedFReyge25/yHfZS0CtdPs19ZpF5dYENNySae+8LPhT4EFGLfFLzUIfWb7xa/SzgIGyyTw0nBZqwPMJ6lHAW7iGO2xQ4aWyptECGque7+mbKFe03blXDr0LN8bHuDtQ+dDEKSP6TUUnZtiNYflgVJ0xwpL+TC7NsxCFv06a+n0FWkGq/FVc4mQlvStwPH1X8BLl74SVU9MA/jBmYC4d5TG9E859hdX3N2HiAJSk8gRIgR8T5r7GwnDXMZou1X/J8cDyn7a7n81K8tXvi+m4vsCIhFBZyU5Jsw4OO6EMmPXKfUubHCnObhPgMOsTEliUj53G3sht4LUsTJj8/lPhB8g4wlk8depcWeJ70ir/gEPjv9DUO/n71Ql33TI+OWmr/O/aRkR5zmSCvWMW7DTiM8IVRiTvzGH7IG1CUDCZSuiHdxSQB6lVwsD0lLw+S3V9GJDju7CqpveLRgUixBsgGfBD16kjMjMdTUvM3Uasz4Ivv90uZ9VqSOCgZbXNF4/osGwmS7WMa+PXJvu2MHBQyOv2Jfu0gJCjPTdXMUK2s9K/RWJx1tXxo+vwiaIan1zis= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: KnsAedUVZG6Mt7UthE/2ktt/Uk01xbYF3ffKdWws95WsaWRJ6t8ppN0ZuozT76hcpOyaU9LnGwdKxxs+PPIUgfWFmBWe1tqtrK/KBvXC3iyKYVAkqFoatdTJbrMmu0yxXT8TZbMwaV2yNHWtMu5oQzEM/4IlDEaj+QAQU82k94JSYE1k0IfHLmRg6nvGS4HGZd6EDVLAWRR3g58g42wJO1Lzy5EgwYxvG9Q6IAG9LgCJyOwo+hvxHeVdyoqtK1d5KldOQP0bvaI4PZid/OzzwnLehKI2UKGHzIj9V/lNxxkpWf6fuZ31nWFG5ZDnN90vvecdSVsITrocOiECht3tQ2hmnA6r5QKi6rb6M6jM6ZW5fitVfh37EERzT/bUCnV/EoyMyQ3zAbkecS1IM0Vx9gLKj9cUuJkB4LM3F1D4eJQTkBVLkCLq45hs1QigTl0B3pSmubJTTU4DR5kNohTt8jJ35MHKRTGT/HwD7atsBLds8m4dLlrpzF4hMwAguE1J3jaoQbByvfo7f9YqokB134p9GtM/VqVw+ML0fvNXyKFYTA5n+Z7+qV8mYHm9v8nuvVZE9qKR2YLc/gwxG/Wsb8kmJfm2OHYss0KZZc/jpfB0MnCRWNdsIf6lUW1WRkXW9HlThrg8sTRGD2EwY97EiFtE6jKVRipGETAwRMTLKYmQ39JNDRW2fwFBps1WiIem0jO1r4CMGHtybW0v9sXSev1TWfJyi5X98AzYA5iBKIjjt5heUdw35idvWOvNzU7nXwsi99sKUwloHerg9PIqwHxeJEfMAl/tKa8xkKZRBQyLuCzljddTUpZWnjTSarRvi9G4JJ6NObfd0VciqEHjfE5tXX9XqKVBsYV7dsA4MiC9q4gch23Bih8OGy+otthDSLPqFcRfCyCIykwKkYoyuHYje97Si1HXYm392tilbBd6iTMhdTe93l2TaTeckKxBUM2S7b7a20D12o46sme3JiZY+ZqlGXMNcdsm3kBFk2ZUT85ttUFoZwlqFIz/bOKYdbaez6xlmQN3v060/BwaUjK/2azU37pa0PCeDkwvwtweqJ36mtYLGr620Cl/Pihvh4wFF0k/UDtXmd0dYbXidUU49du5Gma3N6AVk5x7b7qhPmASTb74XUeqOGTmDBmU7v1pSku4hlSlSvF/VSG/JjD9okenzawHCTxeXebyakYVnTRDhkElD6x2U2TVX0EgVGQjDZGQnhiQ3jKZYy3qqqqbdXqVQLdRSlAccl03PsDAy9l448DHpuztNKQKd5LykGECH1eBgNKA4hIL/7RWTZSsaiHWf25AQwcHtaz4REV4QBOz/vKOah4qOV8C8Rot X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d43db42-4baa-4110-72c6-08d91363c26a X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:03.6900 (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: Q0/bXl9dI/D/0qocnqS02MUFRqopycS8WT2T4Jhxnn6PcOGOhqiMP2p0KULKEAEnyaHuK1QbxT3ak0qXJUj5wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202907_347121_82435E36 X-CRM114-Status: GOOD ( 11.18 ) 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: Lucas Stach Switch to "goto out..." error handling in domain driver probe to avoid repeating all the error paths. Tested-by: Frieder Schrempf Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Tested-by: Adam Ford Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index db7e7fc321b1..512e6f4acafd 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -502,18 +502,23 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) ret = pm_genpd_init(&domain->genpd, NULL, true); if (ret) { dev_err(domain->dev, "Failed to init power domain\n"); - imx_pgc_put_clocks(domain); - return ret; + goto out_put_clocks; } ret = of_genpd_add_provider_simple(domain->dev->of_node, &domain->genpd); if (ret) { dev_err(domain->dev, "Failed to add genpd provider\n"); - pm_genpd_remove(&domain->genpd); - imx_pgc_put_clocks(domain); + goto out_genpd_remove; } + return 0; + +out_genpd_remove: + pm_genpd_remove(&domain->genpd); +out_put_clocks: + imx_pgc_put_clocks(domain); + return ret; } From patchwork Mon May 10 04:00:34 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: 12246755 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D617C433B4 for ; Mon, 10 May 2021 03:31:45 +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 F07FB6101A for ; Mon, 10 May 2021 03:31:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F07FB6101A 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=h85165iYKlxujDqi7N/5Z4KymLelJoP8e2Q48qKH7eg=; b=qw14WWcF2llwE+X+DoJIxjBd+ wy9G9EGQX1u57J+Xf9cPbenXWHjTl3DHKib/WMmTrAbwOJ0xuC0MUn5NxPdH+tbFQRVqKDCXOCltk 6ruWoZpBS07sEH5l3+AgQ/WSZdjJm7L7VMsze4zWe/bbZ0mdIJLGHKsQI+67C6/iQwr1G14EOSu54 B1UYN6knZo39JHt1o47rhmOeosEMKQb5X9edgk4DfrdrNzUhDW8l/PMbTFMQKWhUx8v/W4Owx0QKn jnbsFbXSALG3hrdKjqNrdrTGD++IHDG7mk/T31Lv2o77la4jvVR5zP/6zsUYTRq6XJOyhKBWaA3wc q2ksJAPaA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwc0-00Cy2q-Q3; Mon, 10 May 2021 03:29:41 +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 1lfwbb-00Cxxr-Mf for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:16 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=D/oo5r10HjYifhxk7hRTOy6jWsuKsuFXbXBItk2pEbQ=; b=aCsaBxa9sLERRbTYtrXS2K3W36 FxnVqUh3ZArm7aZ6cOrDgGT8qI9hJn9ZvJG7c2PpcV2RIu84wSHU2p54ViYtNwO80BCv1v2KcBRiD f/BB/hB/b6pvhq2eXzd8jDX0YXcK2xAV38PU1zYsNhxLhAMuATZrSR7rz13KrYaR5aF6+AqpwXiEJ sIf8+qDc1j8wgQrtu2joeGsk7rCyX3So8qG/L0TuTYxek89QFNwv6+rhEPwWVPLd0r/3mKxY6HjY6 BbS31j7yQECxgiKOn3LicPGQgmt764FO4OwDYdwvzNva449dTt5H5/+bqJjLZQ6zzSln9v0itKdUi VuO9uI4A==; Received: from mail-eopbgr140048.outbound.protection.outlook.com ([40.107.14.48] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwbZ-008EiY-3Y for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nGeNf1Jejtlzu9f0l0QWjJt6Q8qqxfJTt7lDCyGOyyAS90csCIcBN4z9WgogQF3JGLDZnfhi4ZASul3lj8D4nLKfn813gDJ8nMdEv5LXvrrSfTKEmrI8pmCYrdgB1Z/LmFqtL5Jl9Jw5GrOEJm9fMJBPRlghdwhWtSot7nfCdiz6SC2n5eSyJZy0BpX7j435zKfpvGXjP3QrTJDz/+BEac5B6CoQwBmf5zlAJLlc6msUtQLlB4Vya9ohIqv9lS3lhj9rKfJBvB7vXxS3g4jxPOqcf0F7gy1ywq2rI8dVHTszmvaaIg4pHdTeSnwwRdgBmutwocICQJ5LMI1oD33Tbw== 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=D/oo5r10HjYifhxk7hRTOy6jWsuKsuFXbXBItk2pEbQ=; b=OdkfXsOJia/nJktdvxafUFcapFacYDZxikuIz4xxfu8fVZeLS1cVl2vskWmnsGIH0ikltk7LXEGco+VyNZzqsoOfmf9luGRKK0H5eGOH9YyoRTS7U4YPRxY7ss0gciM6o+pfPEPG039MnawZi59nT308arUIi718aEmjMDdQ89vWzmyLhlyPMXS9f2Hxggkjn8xpBD6XgDgZKQfb7VF4Ca9dGg5BK7/9H/++ZUlKmo8sl6+CAZ5kEYQyyJl72LM25xT6whwP/3n10j9oQTxhcQSoDKfytf1GaN44m0wkYNw6mOUPZV2vOR9qEct96gS0T8CLAlr6TldFvX5kxwjFHQ== 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=D/oo5r10HjYifhxk7hRTOy6jWsuKsuFXbXBItk2pEbQ=; b=Rum1y1a+vzdpQ+8+ckomR6Vuvl7Zc7FgJf2pvJhnCptTSm68V7+Cpb5UcFJNM5N6SduSz8RcTK2G36ghotut9E1hbyzIxJfhroUyA2Xg/09CODeyNdnCuNcIJAFTRrbyfa81TzGhTPAMIujk2Jby2A3l+xOewFZZ0eZtycrUOGE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:09 +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.4108.031; Mon, 10 May 2021 03:29:09 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com Subject: [PATCH V3 02/13] soc: imx: gpcv2: move domain mapping to domain driver probe Date: Mon, 10 May 2021 12:00:34 +0800 Message-Id: <20210510040045.13225-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 053c5404-5e7b-4964-53b6-08d91363c5e3 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lKSRnhd/gzQV0qB3z3p+4Marrnrk1bEckPRtLqTP5SMuya6K58X7PUaswrG4uqLxhOp+tiWPyAiY6ImUaz3afmv5b0wfRRuijVHq+3DRi5MGp2GRyYCVNdZaKKrL2R0DjnnVUxOIom4cDzbiMbdpLLTmY4ujTEMCkgf/2YZcGuh2qIBVo0YQK+cFdyi3Z27Z4S7lzFGcer8+8rWcpLctNqfh+XCdYZKYpgCZ3KelkGdoeJfppP5HeTYR8PrqkjbregsOxLv4eKw1UqISoYZboQUNoZfZO5qfqEOGnVcEDPFaijt2A7ouf26x/KxPjthIsc+Em/himyrHpZkZm1CrkbRhhOhL1it3P8ezxIwQIXaE7n9GjTeaP2wSVfyKrV/GSZrIVzZSHB6RVdTAJJL+WBykgIPbGREamjPD6w5cicE01EzEXNLOYnt0yEUmfZqAah4Jb8V6Uld/f+eH6F1YomdYf3dHB2HNjL6JgXkusTMxuBBmunG3lDfePT7OZe/9ldL7kFFkpYNpCYfRYcvFSa0O9JjvEzzsMwC2dbgsh6SCuzhe9sak+UE5ctWEKN5buK77JwnNaZwEEmd2u0ieBGZAa3qw5yvw1B8uVg2ufWrqUFnEBYEBJ7YIZz/KmE5nmhYAU5PCGcnCHjLoaMTahrDbGTa9+eLq0QKzLEo3OXA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zCXgMGjB8C9QtpG2rw8Jpo+Z5WQDhd91PI3SQRZe36adP2o2MR8xI4tfIlxnmIrn8G689hALecTGNYwcMa4hl7iqGIVhO/uJAOcedKVPQI/YBRXQfW4twc64HYXuC7U9n4yCtKvnX26gZdK4Qgx3xtDxu5b605PKahCuAvTqjRjJY0Z2YCN4NmMGUj0uMaE8eU097hH5SJvDeW+yxAjZaCqZdOckW7RK1CsjenBqTvmM0EB+VXuZPArUJ2sAVIXKwEyQKzyhT2r4W63hhQ/OxdCM12SjetPA1nm9WI+tyce89D8WeQLxTE1jfLoGrUQVMpSDL1Ksqhv12rEJisIbdDB27HYd29JcNDrF3e+E3w7OFkrmEDGNPR7H67nxOi/4wVfwpv9BLCEr6AbZt/78sbm8iaA7OvB1K/ZYOj9TranOWU1sHOKhdKzFo3QMBK0DbvbLhICmGVtgBs6GBYagkKxjDHVfzbI8JDB1jk6iTJgeOqzisr8asfg4KdfuqWBAViGHIMOFkQ8DIRxn+I1JeP9lFxBgZOzjqjIAnJHoymvRARDZKsld2l7fe05J3XIcNIoCz1Uy7OUZ+Vzh7A9PM0I7/ox5O4pYH/a+RDAP8xBTbH8cgjbG0fVDrlOTqOdsrEoyX83ZCXDbus0olKT2GoS5g/oTuAutFU6qmfSawkaNFwCxMCk8N3wYqsYAit7o675MqBAcDJNcduY4wzpIj5kNNi9bq5LEj7bJQyPYWJGYYUIi8FD76BK5hkyVcPrhN4hOdHI+02oyD4+aOiHn6tU/Al7tOdGl7otgJ1mvCR3lr1SWxCEV+HVVTAkzSmVy/QGFhAf8fqUtUNQbakzuKu5+endr6dozDVRbzp2zF1dBo1Lx+TAfqqZIqNfQygXFlc01EIrAe4b1Lxuf5CkCJzANiqI1Hd1DSFgNi3dSFPTi8fntHAjPT22sw/40PXnKxZdB0j8PNvx64JMf8DzQFMVy0lvUF+xrOEic07ayndM/WoFsUY8+ETskA9AO+PYS1dntXU3jHnUDerfV3wSAEWarDUn0ovsw1W30+n1MY2qiuAWcjUDbDcsP9Pe9DcYUTUi5OWHL/lpMPqCdgXza5TMV1UIZlE3Pzzp4G0CVP31XeWLLMa15SloQYLyfemREFZjRJw2VVFactSOPVE/8Eub5OFuccZSrQzdjActFNrPyWVfN4ctNd4uZT3mErDWAIKTZKedASLBld6Lyh+XgvT9mUFQxSvgW8TVskQhckdKQwlO3je9gO9vPHl4nLArS3FEEdjvHYpAri6s3V/0jT27pdZLNBCRz0Q1l53xLqxgTm48ZQJh7f4PSerb8VdvL X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 053c5404-5e7b-4964-53b6-08d91363c5e3 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:09.4304 (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: McgLotXr8GNeceggz1i6193uQdKHaejQuRfwBcfE6H+GhAVGWu4H7k8ohveHfKYZjCNJipMPG7RIdFDRxZh9Cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202913_176044_90C1064C X-CRM114-Status: GOOD ( 14.06 ) 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: Lucas Stach As long as the power domain driver is active we want power control over the domain (which is what the mapping bit requests), so there is no point in whacking it for every power control action, simply set the bit in driver probe and clear it when the driver is removed. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach --- drivers/soc/imx/gpcv2.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 512e6f4acafd..552d3e6bee52 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -140,14 +140,11 @@ static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, int i, ret = 0; u32 pxx_req; - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, domain->bits.map); - if (has_regulator && on) { ret = regulator_enable(domain->regulator); if (ret) { dev_err(domain->dev, "failed to enable regulator\n"); - goto unmap; + return ret; } } @@ -203,9 +200,7 @@ static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, /* Preserve earlier error code */ ret = ret ?: err; } -unmap: - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, 0); + return ret; } @@ -499,10 +494,13 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) if (ret) return dev_err_probe(domain->dev, ret, "Failed to get domain's clocks\n"); + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, domain->bits.map); + ret = pm_genpd_init(&domain->genpd, NULL, true); if (ret) { dev_err(domain->dev, "Failed to init power domain\n"); - goto out_put_clocks; + goto out_domain_unmap; } ret = of_genpd_add_provider_simple(domain->dev->of_node, @@ -516,7 +514,9 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) out_genpd_remove: pm_genpd_remove(&domain->genpd); -out_put_clocks: +out_domain_unmap: + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, 0); imx_pgc_put_clocks(domain); return ret; @@ -528,6 +528,10 @@ static int imx_pgc_domain_remove(struct platform_device *pdev) of_genpd_del_provider(domain->dev->of_node); pm_genpd_remove(&domain->genpd); + + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, 0); + imx_pgc_put_clocks(domain); return 0; From patchwork Mon May 10 04:00:35 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: 12246757 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=-14.6 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,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F461C433ED for ; Mon, 10 May 2021 03:32:00 +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 62E7260FE4 for ; Mon, 10 May 2021 03:31:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62E7260FE4 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=lVRwk3ULi+4VOpdtGWAoGDWPHh3NCW5RVJPSWLhzmgU=; b=jELpvSCLL0kFl3U2pTuKqS7DK 66cM+B2BOKBrQymzW1o5zElXmEVpBe2YNF5DAJOEGXAhhCMv/F9dGvtDYgqxO89XdhH5LuVoip1L2 WwziWCtV5j5+R05fV7dUO76wpGNiIrfTRXh89FqIyxxOofmhSB8LnQI5FqlPUVnGWpZLMu2BfDsOD 2KegCYWVDIOMaAs9pwAxrVbN62TDIBcDylZbLsBnevdYB2Rr1IJj004M4a+fqLAaKcuLF1gEjUTus njljcT3bhPJWkW4+RRM+5+Q6JM6bJ/u5z8l7uhisUek/Z3BAGcF8/I45YOr1CqYgAOts5UshyYXKT SU+tjyD+w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcF-00Cy86-BR; Mon, 10 May 2021 03:29:55 +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 1lfwbh-00CxyL-70 for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29: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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=B/6UZkZw+NFTrcNzoryPOEUoazojZwuqYnxPoEC9zIA=; b=vOdMU8IqmmKlBFYLktCqO2HdRz IuJJnb8E01haXFPBlBf6vzs2lrzp7OlAWCSNDTNWm9fqgeEQFSvUVvKBYhBNQuLVaoELxFwpGC/w9 0HbX9s3OFhJRPZ/QPyN9pMdX7BKZK3u2MVKTjk3NtUPzdIoKuSMhWPPTHFaWc92yYdL5Vz6hu37hf GbvgwZhLWaOoXDQ0LoIa1pu+ryPW4YzrSfnyu75E79d+jb126t6sPq07Ze1yHDh1StiR7s5ej6jL4 QgLdOQFvJsbP4r0pbFmpBz1dTqYJ+FQECgi00DLB6iOihSH+T9EuaiB7ZGXkQKeq61nQqx5R7UL++ oaUV83dw==; Received: from mail-eopbgr140048.outbound.protection.outlook.com ([40.107.14.48] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwbe-008EjF-Ib for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSphag6TMof2N9IdCDzDRqdsUwiSpyH++exl2vb8INM9JcnkJKzDHGtC2RGIhT5TEcbnkzplp4ldcTNefx9DLDd5w+bOekd1OAMqR4sWcXU/T2yXAgdYNo+N07A2R4ZM7gwzSbMno2Jfr35ga6PRwvJV4n20GLznxbp1pQAN1m5VbWXB8w6wSd/h9vZlnlxiLWQgABuMKBqbqcy5mO9ggyLViNz4q/A7jhCujOyyPQXXu6ZKCNnOc3w5EWzasK7XUxeDBKuWxOSvhGbpM1cR3pjO3E5MegX6O3UwtPEyvaln3HgcDbQX7bKGsTD/UB1ikmUpCTBq8NRk61v42dh7/Q== 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=B/6UZkZw+NFTrcNzoryPOEUoazojZwuqYnxPoEC9zIA=; b=aVDIXAE9meRIFUdYpSdPrZ+5HKdzTLPGjhrloASfGrYV+JAZ3myXsXyO+ldN0ty69vyoUek8dDWRTQqWJA7jssPSrfAQvNkS3j2FTXLMeuDdPdxl2TQji9ZGp0xoU2zKQuQRTB8nxcysqtzqc+6AuyRc0PxT7TfNhXUO3f3SHpNPy3lPEsc+Fas3uyFbQuIeDXArz5kFn1f0uNfBE3UPVxzl7IR6bKDfPn0q1LEqH9ghXUDo9cRp5fyK6B2j+FXavwDS4C79LCKO7+tGOOyM4jrpC76jj+qbLm/mAbhqb1m8ko5VsHgIvdYOm/uaUpBqpBy0z6bURvNyWu2nkXWamQ== 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=B/6UZkZw+NFTrcNzoryPOEUoazojZwuqYnxPoEC9zIA=; b=BGUQEa/zrBLAO2muQIvQAXPVSQ2GFKRifrH+S+RFWWKj6F4PvyeUqYJaWtc/oN0RQe6VCiy6KGpNX6beg0XeDogJBLECkifEqZOIz6UH+VwdJabiX7xJ5yvTjnsFNKMpGFDB4W+2jSscpZmaX9wbS8c8n/QZXbhHNKUmiOGav6U= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29: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.4108.031; Mon, 10 May 2021 03:29:15 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 03/13] soc: imx: gpcv2: switch to clk_bulk_* API Date: Mon, 10 May 2021 12:00:35 +0800 Message-Id: <20210510040045.13225-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16373e49-45fc-4e10-b5ee-08d91363c971 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cdnFB/XWuV8OOAK+q/ujr+jVRGcQGGtBnr0Jus3WlWvSxHUyo5TBPHPD2MFkdukVXdPz3X/E7SwViEsJaLNsl78xxARgUqKnZa7flMKSeklyRNbVkGlytBcAL5aqZccIaZyDZVxTatwQKa2PBXSxL3jlt4tNP0miCZSWQHAfowT18rwcI7pwAykJQ6d/rWlZT55/s7KclsHkOuejqGgmBiF3QRGKTDF+t583eE82fDwH5q57/xapKmMOUlial4+MlWMG3KAq0DrTlIyO37bdSqFXf4sWZce+IDBlTTsaHdtvXfZHUNvQ9QZZNlVtMwkC8y10XG4GjNjkWk6wVkENNjdYwGOW/oVBsKLxAzAYhYfgkQLi7ktRBUefo/VnmSPZ14McF81O0GCdxfSMGApMbTLDHA2hvpf1GQic4iMR7Tb7ZB4If0YKhWAwWUp51ZwtD3cT49RuHsV9me5xrYw3oAL2NaW9rT2l/C0kYznipC6jo7MRns3hwSzKIyyNQWDPOeOwAf1VRchiyWiCBUQ87Xz1+UpDGva47yJ23qWv9FyBLvdikKSoX8g2hzSyNC2O6poR2oXq1k+oMH/GK4zC5KV/p8cJ/1Z+TS14WRXmocWgXzwXXokIFpmh/kAVy0USA6OBbhMmKcG6+N8lk0UwdTCmfyAZ7+zQwL6uQYfUbPo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fTvTCgCpxdxu8NW/8lL4peB74CYIGcoOJHGWXKZmOIGMmxuQNp4A1SB5IpGmxpqIK/gyaBsTd1vi50bhpoReDgbjMQEFNiwPRAVDPVbtKTQaR0gg5nJud1e/yi+XGi8e84EjiofuB6wQRPKyUgBa3MtRqgLYmFvnYtN7XRCeqZfvK3qGoNYvJ4KkEtx2HsVqvWUgdr/ITIomltEZmthkSQ5j6GPH+RYnzNhs6uMdNETz4S//0kb68be3XukBJfmUJh7EY6av+oAaHv6hOtWk7FGRh5SAzmPqSHamfwUPEyEd2abgt9fBSpS2djKsHgeXe3Hg2sJcpHjY4Zxh7OHhv7MAQAS0rXCwtw0bA6YGZNXjw/3+8tvGFcYxD6GkpC7jVac+iRzpS8PfpeqhnXdGW9/Cd01j4JvOfnOgDdJcTsk4Gz0Xed8iqH3AXaJCZ1txvVQiyQ/q9cW49zLDROK7UhW6RfcTsvsR1aQbFFKl9beq5KyIRTtN3VhlVfxxMXx5vNDsufGxg3zONTE3xLG4QtaYrlMSkbbwuw1nu6ixInJUjZkSWoZeLdxTIZNyjPdlgDyXp87+HEVs1eqFlODbv+Ia9TKn+LL9MJ5XMd5UnzBnNJHca/o1tt79Nci93zv3FsmaVTmDatVmFKZ6+7zzvMB0Lh7srcJ781Wn/kLjAv0Hi7xp7/eQ+DntjJISeEv6fHq2uW/TVqh/lINCUedB/Y/kE1lCV47jaoPqz15jhINqdsp8FxQ7T8ZeSk91Drmbd+FWcii3ZNsO5jl3YqEpinPTDz+HmQTtBKR7W0tUBtRp/Hn/c/zd5o+4rkLbDC9CPIgsP32ZoPaRj8mGwahwxePgubJpJbExvCV3TBruEcQ47cuQaX2m7+T/KScoVpIe0hj78Pk0ZX83gqTZZsIoo1edQLNK5A2ICbV1Y4y+uyLVEgZeUC+ge5GeUrAHz0klbAjVAm+/LDcvivflfHfRvb4uCUdLfKLxmD0YOJZbFZ8DuWpJdBDuDkSsUjbi6rVD8xFLuYnVN8yrRmoRP/TwM8L73WTa/ZyhiKehVKZZ4brQ30Hh2bxPFm4YAkafPKM0mo5wye+qu+OwWw+n3yxBu7UcyHLhlPN+3aE3v9Ed+W+Tx5bVb1Tdbu++egRyMbHWnqXH6KsE33R2QfDwaBeo1lSGORGXbCSXg7k4EFh2IDCsPzFq2yx7IGriyhBq9lsc80KzjbmeO9nOf/RrDpn9Kr9FoD+3DrzvxxJ2d92E8WcuYwak8ZTM7oz1EIhZmcT2F0wQVrtk+YmoKXQK/KCTGfduyKP844CYKKLK9qWRKcV4hA/8M9nLzp+uZEhvM/AK X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16373e49-45fc-4e10-b5ee-08d91363c971 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:15.4277 (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: m1VM8QatkVG1tAhdxs169prWsrbl99v8K+0XsT7+qo24CxVcZ2s4nCt14vPBTwaQxskDVKFGTB8Rwzd5jiHiXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202918_641504_C8CC6B98 X-CRM114-Status: GOOD ( 17.56 ) 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: Lucas Stach Use clk_bulk API to simplify the code a bit. Also add some error checking to the clk_prepare_enable calls. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 60 +++++++++-------------------------------- 1 file changed, 12 insertions(+), 48 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 552d3e6bee52..4222b6e87e7c 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -100,13 +100,11 @@ #define GPC_PGC_CTRL_PCR BIT(0) -#define GPC_CLK_MAX 6 - struct imx_pgc_domain { struct generic_pm_domain genpd; struct regmap *regmap; struct regulator *regulator; - struct clk *clk[GPC_CLK_MAX]; + struct clk_bulk_data *clks; int num_clks; unsigned int pgc; @@ -149,8 +147,12 @@ static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, } /* Enable reset clocks for all devices in the domain */ - for (i = 0; i < domain->num_clks; i++) - clk_prepare_enable(domain->clk[i]); + ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); + if (ret) { + dev_err(domain->dev, "failed to enable reset clocks\n"); + regulator_disable(domain->regulator); + return ret; + } if (enable_power_control) regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), @@ -187,8 +189,7 @@ static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, GPC_PGC_CTRL_PCR, 0); /* Disable reset clocks for all devices in the domain */ - for (i = 0; i < domain->num_clks; i++) - clk_disable_unprepare(domain->clk[i]); + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); if (has_regulator && !on) { int err; @@ -438,41 +439,6 @@ static const struct imx_pgc_domain_data imx8m_pgc_domain_data = { .reg_access_table = &imx8m_access_table, }; -static int imx_pgc_get_clocks(struct imx_pgc_domain *domain) -{ - int i, ret; - - for (i = 0; ; i++) { - struct clk *clk = of_clk_get(domain->dev->of_node, i); - if (IS_ERR(clk)) - break; - if (i >= GPC_CLK_MAX) { - dev_err(domain->dev, "more than %d clocks\n", - GPC_CLK_MAX); - ret = -EINVAL; - goto clk_err; - } - domain->clk[i] = clk; - } - domain->num_clks = i; - - return 0; - -clk_err: - while (i--) - clk_put(domain->clk[i]); - - return ret; -} - -static void imx_pgc_put_clocks(struct imx_pgc_domain *domain) -{ - int i; - - for (i = domain->num_clks - 1; i >= 0; i--) - clk_put(domain->clk[i]); -} - static int imx_pgc_domain_probe(struct platform_device *pdev) { struct imx_pgc_domain *domain = pdev->dev.platform_data; @@ -490,9 +456,10 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) domain->voltage, domain->voltage); } - ret = imx_pgc_get_clocks(domain); - if (ret) - return dev_err_probe(domain->dev, ret, "Failed to get domain's clocks\n"); + domain->num_clks = devm_clk_bulk_get_all(domain->dev, &domain->clks); + if (domain->num_clks < 0) + return dev_err_probe(domain->dev, domain->num_clks, + "Failed to get domain's clocks\n"); regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, domain->bits.map, domain->bits.map); @@ -517,7 +484,6 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) out_domain_unmap: regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, domain->bits.map, 0); - imx_pgc_put_clocks(domain); return ret; } @@ -532,8 +498,6 @@ static int imx_pgc_domain_remove(struct platform_device *pdev) regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, domain->bits.map, 0); - imx_pgc_put_clocks(domain); - return 0; } From patchwork Mon May 10 04:00:36 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: 12246759 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C39ACC433B4 for ; Mon, 10 May 2021 03:32:34 +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 020AB6142D for ; Mon, 10 May 2021 03:32:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 020AB6142D 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=AbVMzDewEweN8SglQ6hQlogcZWiGzzlekbHEVRHl9Es=; b=d8MA4eg9LPKtgH+OuiO5ekfj1 hs4pIEuH5GpG1OE1K2rQhX6KV1fjZHUz7FoE1EAU7yy1lzH6yKfD8PIUVqHMpB9afUvNIy4m42sJB wo/1KJNWFaWjQ95whoOzHSlIueCVZ+PUcjZmzvgaDJqvyZWsdtS8r7nHp6TInknHV1Nl6TAZxYmKX c7mT0i+5D7oKPqMqqn+Un40LWa2TdSQQCripuwAze2HZJnjdfTn3kjtJuz1Kl5U9luMh2+I2V2VqT Dvc0u0K+AlLzIX7HZzt4ZdheTlKYC6nHlu15mKEWEtGPou53Yiju9AxlqQBnCL2nihBT/yIp+XRQ2 UP811InYg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcd-00CyDu-EV; Mon, 10 May 2021 03:30:19 +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 1lfwbo-00Cxzn-NP for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:29 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=GF6MauPmT4g0ZYZibgloyB+h6HZUfn7M6Sivd5kwauk=; b=ZfKZcYr+yOE+Wz7e6LCi+0tqLT b4VEvX0GDUceABgXGtHD+QEnUlH5laAiY9HP6jTAJEwFfU0izIgg3b7xIe68aoYuqQ3fxhnKGzfjV Hs2zcD3/TyMAv3/9iu/DlZn6TTBo9/XfU8h1SnBsC/8YOlJ1zF9F1avZf7zL9T4NB7IEqq9QFWQdd pzkDdQjgSRwwP7o/RuVA1rkr6MkM0rsLXzw/mz5GMWJa4YvGc6HBU4CKYFUZ6NkrfI2KxOpZihxwF b+wIm2I7rI/1qne/a0TTiJV0DqqZiITUZIu0MgtKHO9lFrUpDnSk2926cqZUdilDy5nio+mbnMIf0 EVmHVmmA==; Received: from mail-eopbgr40063.outbound.protection.outlook.com ([40.107.4.63] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwbl-008Ejy-O4 for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PpRDtPS0HeWnQ8RuSIW+U6lwvaNu7rIUKxE9aqvfr9I2Jy+89P+Ef0ZQz6TMrbCU8WgR+ge0ubMx+R2b1el+2VtSqXKe0kz5Iqfh9qC0vqyXzwyFkIsS9rqiebSN+2nZ1iYKvQwHc/giOMAIy31j9SBOnq93HXRT50yxS7/6xgB4E0qPPK0wnYphjRDn89evKH/2DVzy57w8awi+f/tj8Rdb4Ra9wIlZYlTNKmeNAOJmBSiqFfnHA+rmY7zLacCrFVEDyDtoy8ERDjiJ5wURfUPbRfR43HLv/EqaCMVZwNf20+is4UE+BIpUQqqff/CG/Ne50hAEDHpnxRaNR8rekg== 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=GF6MauPmT4g0ZYZibgloyB+h6HZUfn7M6Sivd5kwauk=; b=bJ8mc8REv041PvC9cJxMQWvoUpGZxWxvd/ygmMI+FVFTQG6RqwW9q3o9y2YWT1vVeoWj38SwLTMH9piYckb6MVRZIWMipOwl5ZXmFWKG4aOP8fSrKB8MjzidE85c6SLAUcZLU2B/8QX+10IYN1QjEcvwACMt5YqeEt1/kJvkePWDUMBPBRbAx+F/Obd9tdg2X49aHR8ueYzidl4kv85sFoPoE/ArCvQU9XOqKagwK+CScfqDcxf63IOlrCVOkOCoXpzDvGZfYL+Swfu3PWYwpfsu1d3TkJBZhdnuIMbwnfVjLiJ7FOdzczqKkwrPfTpkcp2CRJj25pTmaHd1LahOKA== 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=GF6MauPmT4g0ZYZibgloyB+h6HZUfn7M6Sivd5kwauk=; b=bOMaaDF/LjTbbkGWcAucTovtIiK1i/yqm167n7zASP1/gmb/ScSr0HNw8wwVRSkSykkJbz3Tk/mGkF/QdyfCOHpOi8WElupYZK/Ot4zBoVMfZ7DjCVjJBAZwmefA3RNy/p3GmMX4PZgcI71WdxYrSwU2D0DW1dd01PlHU6mQpps= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:21 +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.4108.031; Mon, 10 May 2021 03:29:21 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 04/13] soc: imx: gpcv2: split power up and power down sequence control Date: Mon, 10 May 2021 12:00:36 +0800 Message-Id: <20210510040045.13225-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86df4415-80f3-4ee5-daba-08d91363cd12 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kPqKYQ/5DKUs4bDDRIEYNpd1lkKCO8IoUoIi78BwCS/OQT3+cD3Tg6MtRjACOAq3Mb3t4Ll4RdddBO+PmNb66pH/0ur0bSo/XKgBSi48fkTRDp4ssKY886Ritia+AKyzcvhau7TCwkWDpEOTmThf+N859pGT0T/AZ6wgDMqIKBF06j67NchRFjVukIxPpZ7/FwTbGb1ma7nt/ezPgnIL/VOfdAAMpk1egxd2xqwokzS2UVVbarNtO+v2C661VydklLa2jdKDF2n3xS4CpZ2r1i3O1XXYBFwdUo5lWPv2GDl+glZDJ7S1coUXCGfgGQYjrw802TmiD8xVMd4N+CjSqbOkf0WrKxSNcHgDuX7OviG2heisRr81iwCF5y8iqnTStFf+AbJJqpHyZHOER7mZ4rah/TCrLVoSyOnNLmL3qpqza+kHTkypVh14R3CWEoRzTB1M4QQC5YnTu61yCGqX5flN0SMN7yV9wR1wz/qLgfmTJb3hWHry2DmBaEdPlwzMooOdZZixZ35zNaQp1e8Pelc79RTPMIWSuf9qfGItqUTVNJSA4Sdg/ayI3jg0jFsTA7kkOpXvAB7hZg8Lr+UWJpx3RTFfQXVmQoG+3P6F+yr5YVdwk4Ov7V2r4tqEAfQEcbu10useh4FCau8Qmsd/1NB1/iLDerruqp+070474tY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3K0QkR7V2u1fQlyuNeVHeuzCnprKfjuN5g8qV78gf9ZRSzxoSztJ8ZO7cI9TCsttpwgJLPFDh5/44eD1P+yFCcEcBOeAB5mIirRsWNNVod0yHyPRYTDAQNkJehwDDOlm2Qmi17tAmW819v8MrQ/Wqbgs+EGbmLXrfK02wk3u+wmbPjhsv60vup1zRKx3QY5tcgjIPgEUsqUZRV+XL/hOoat1CeXVRMQyzdjO6vzM7iyVYi7sMJb6lepS/PX8N+H1b9hm5Pn1ficNc9uy0NozdDmJ3SUNvBr+EKCqZPnHVoJsMI474OWoxhL46UjtWM9MjHGI5Q42idDvlH0ibLYu6E4hiGYnFAAbnAL6SFjW6nRn1jEtFRmuAibXjWvNbJw7is55VQmCEbds3lwCP0Tp+4pbCc1S18Mc7GMBtvCMYsIII5+dNgrQvmG8Po2f+a3ZQ4URcgNfVX+l5x36cA7YTID4QQbOksh5dYJi54W7DRKv0KVGepMxgyyjWnSN7Klw1ap2u/9brJi2sSsoqBUuCKRQnVRx69WQjpmEo/cbzg7u17bmy7uY1Dl68ggUXomdDzYBBWqCwuVVX92Azx5QbZsQ4l9VsbQaOZNzYrChagN5EMAroGc5NLtL8dn651++/DdXA2s7dzvhxc8cuRke/TBPI9aXO7GHXbrrtdDTh2a7O2Ak0OnQRPKg5MOlltPXxO0Bza6jjUCijEcY6+VQ0Z/p8RO+WvBjxIj/R0dLs9rQdCSCHwJ4sSPUFvGKhxagkU5EKZMPuhiLUuJSs+xw9kjPXzdwOGNVEAF170z+pUoVDsD6e9XTmqB7OnSLV388CvUJCqOHKzFsfEjvpxNH7fqQTGX8TNaV8Vg57t/fsOCb9xiyQ3S3A7zEVjw55/+/vvsKFqEZCEMV1DKZ2C4vcH91VSybQDdrR5tmlvg6x0Mm0JCHm2LGEH8WQp6ltF39ShDEXU01ySq3ep+4BPVfaSmUWcG0aMfZRVLPnVKW7hQbPgRcpLm9iOLcw93zs52sCU/ArKE0B+VySt6CUdPObi4gLd3LYE4gVKup143XXqTGjfl7zT1Rn10D4ZYzkLw7QqYjxZHJ+nOW9C0jvz8lEnHeTlxRA0+17+hGY6x+BRFfxtECNI8aFXj69QBW/hQ4bff3DTqFU0woTKsMM3e6ySC20TuQhCWjapJpMOG66wbFWrg9z2wS/Ngct5RVWDn+ENO/u92ZaTy5aB/NMIOxLEJ3eO6G4aSZBKkeFFk0Da3DzoC2GklhFucbnMYUEKWnuvzpE95imKEm9XtA/wdVrZH/0yMIhJeKAop3FXq/zst4TkInkY2PZgCLr54y+vii X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86df4415-80f3-4ee5-daba-08d91363cd12 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:21.5069 (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: NkKy91GS6+uj6S0etGCl6jsvXA25jQgpezcUjuuX0UD1Wj+KTi8knpGLuadq8ZK6QkHLZPp/JvfMNnIYVCTenw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202925_815593_63649A64 X-CRM114-Status: GOOD ( 23.16 ) 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: Lucas Stach The current mixed function to control both power up and power down sequences is very hard to follow and already contains some sequence errors like triggering the ADB400 handshake at the wrong time due to this. Split the function into two, which results in slightly more code, but is way easier to get right. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 141 ++++++++++++++++++++++++---------------- 1 file changed, 86 insertions(+), 55 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 4222b6e87e7c..bcf1f338b0bf 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -125,20 +125,19 @@ struct imx_pgc_domain_data { const struct regmap_access_table *reg_access_table; }; -static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, - bool on) +static inline struct imx_pgc_domain * +to_imx_pgc_domain(struct generic_pm_domain *genpd) { - struct imx_pgc_domain *domain = container_of(genpd, - struct imx_pgc_domain, - genpd); - unsigned int offset = on ? - GPC_PU_PGC_SW_PUP_REQ : GPC_PU_PGC_SW_PDN_REQ; - const bool enable_power_control = !on; - const bool has_regulator = !IS_ERR(domain->regulator); - int i, ret = 0; - u32 pxx_req; - - if (has_regulator && on) { + return container_of(genpd, struct imx_pgc_domain, genpd); +} + +static int imx_pgc_power_up(struct generic_pm_domain *genpd) +{ + struct imx_pgc_domain *domain = to_imx_pgc_domain(genpd); + u32 reg_val; + int ret; + + if (!IS_ERR(domain->regulator)) { ret = regulator_enable(domain->regulator); if (ret) { dev_err(domain->dev, "failed to enable regulator\n"); @@ -150,69 +149,101 @@ static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); if (ret) { dev_err(domain->dev, "failed to enable reset clocks\n"); - regulator_disable(domain->regulator); - return ret; + goto out_regulator_disable; } - if (enable_power_control) - regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); - - if (domain->bits.hsk) - regmap_update_bits(domain->regmap, GPC_PU_PWRHSK, - domain->bits.hsk, on ? domain->bits.hsk : 0); - - regmap_update_bits(domain->regmap, offset, + /* request the domain to power up */ + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, domain->bits.pxx, domain->bits.pxx); - /* * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait * for PUP_REQ/PDN_REQ bit to be cleared */ - ret = regmap_read_poll_timeout(domain->regmap, offset, pxx_req, - !(pxx_req & domain->bits.pxx), + ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, + reg_val, !(reg_val & domain->bits.pxx), 0, USEC_PER_MSEC); if (ret) { dev_err(domain->dev, "failed to command PGC\n"); - /* - * If we were in a process of enabling a - * domain and failed we might as well disable - * the regulator we just enabled. And if it - * was the opposite situation and we failed to - * power down -- keep the regulator on - */ - on = !on; + goto out_clk_disable; } - if (enable_power_control) - regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR, 0); + /* disable power control */ + regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR); + + /* request the ADB400 to power up */ + if (domain->bits.hsk) + regmap_update_bits(domain->regmap, GPC_PU_PWRHSK, + domain->bits.hsk, domain->bits.hsk); /* Disable reset clocks for all devices in the domain */ clk_bulk_disable_unprepare(domain->num_clks, domain->clks); - if (has_regulator && !on) { - int err; + return 0; - err = regulator_disable(domain->regulator); - if (err) - dev_err(domain->dev, - "failed to disable regulator: %d\n", err); - /* Preserve earlier error code */ - ret = ret ?: err; - } +out_clk_disable: + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); +out_regulator_disable: + if (!IS_ERR(domain->regulator)) + regulator_disable(domain->regulator); return ret; } -static int imx_gpc_pu_pgc_sw_pup_req(struct generic_pm_domain *genpd) +static int imx_pgc_power_down(struct generic_pm_domain *genpd) { - return imx_gpc_pu_pgc_sw_pxx_req(genpd, true); -} + struct imx_pgc_domain *domain = to_imx_pgc_domain(genpd); + u32 reg_val; + int ret; -static int imx_gpc_pu_pgc_sw_pdn_req(struct generic_pm_domain *genpd) -{ - return imx_gpc_pu_pgc_sw_pxx_req(genpd, false); + /* Enable reset clocks for all devices in the domain */ + ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); + if (ret) { + dev_err(domain->dev, "failed to enable reset clocks\n"); + return ret; + } + + /* request the ADB400 to power down */ + if (domain->bits.hsk) + regmap_clear_bits(domain->regmap, GPC_PU_PWRHSK, + domain->bits.hsk); + + /* enable power control */ + regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); + + /* request the domain to power down */ + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, + domain->bits.pxx, domain->bits.pxx); + /* + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait + * for PUP_REQ/PDN_REQ bit to be cleared + */ + ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, + reg_val, !(reg_val & domain->bits.pxx), + 0, USEC_PER_MSEC); + if (ret) { + dev_err(domain->dev, "failed to command PGC\n"); + goto out_clk_disable; + } + + /* Disable reset clocks for all devices in the domain */ + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); + + if (!IS_ERR(domain->regulator)) { + ret = regulator_disable(domain->regulator); + if (ret) { + dev_err(domain->dev, "failed to disable regulator\n"); + return ret; + } + } + + return 0; + +out_clk_disable: + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); + + return ret; } static const struct imx_pgc_domain imx7_pgc_domains[] = { @@ -590,8 +621,8 @@ static int imx_gpcv2_probe(struct platform_device *pdev) domain = pd_pdev->dev.platform_data; domain->regmap = regmap; - domain->genpd.power_on = imx_gpc_pu_pgc_sw_pup_req; - domain->genpd.power_off = imx_gpc_pu_pgc_sw_pdn_req; + domain->genpd.power_on = imx_pgc_power_up; + domain->genpd.power_off = imx_pgc_power_down; pd_pdev->dev.parent = dev; pd_pdev->dev.of_node = np; From patchwork Mon May 10 04:00:37 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: 12246761 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E109C433ED for ; Mon, 10 May 2021 03:32:49 +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 D89C56142D for ; Mon, 10 May 2021 03:32:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D89C56142D 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=9gDh458LFAwNVkzLvDdgJ9/+eCi1oInauAwjJVLazfg=; b=fW9ihkWGTf0SjoJl8S0vFFG7O wiW6x8dDItOQSl3GANKK1b0hYEaY9WPUrS9QfnAAsD2CfGi6Z3w9l1J6rTcLS/6OtGDqeR3DKB8DR m4zXPZAa/ZLqOG/YyXjjqGe5bq1A7NzaAycIJ6lrGr20a97+5l4SxM6Yg/o/GNgqvySR6wuGVaZDZ aszoHpNX+72hQJttj2u99H6AWtuoUs5i/+LrGscnV+iJGgD8oOVJ8/dYX8TFVTtuY974+rSxChkfC VmYEiqsNDFTENYmZDamzXAq2QoNRje2I3fojEVfFf8DwlCLxWMnnP4bJlcL6y4TUYQXSBw68zfCYa Bb1+gNrxw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcw-00CyKb-9I; Mon, 10 May 2021 03:30:38 +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 1lfwbt-00Cy2B-Hq for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:36 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=M3a8RtViAU6NJPihpfy8sxeF6A97AR4gHBn5SIWqMkw=; b=c96FU5pOQX0UHo27ng39pJOvZa LCQN5ayhfNwuAT85+SQNz2xd73gEAwX/905OV4qyOJXXCtdr6NPmohkXP8hTlsxslFstx5VXi4+CY mUt0T8Fc4LbtLFib4MHgEVr6R539XLIpUjhIZU9uU4obI1MMJ7aqayH0qQd+Wo1XN5qbuDeIEdZQI LnRUfveSjQ2JhbKIhVfsPA8qfA1gcZgnq7lHtjUMC3oWvT1kKX+Djh7afVrGK4n4QppBPS0Hm/KUI spO6IST0QroDc7t3H9ewApJSjzx78K5WJo9d0pSFAbbx5dOCo3/InNuT0ttiMOF0K3pVzYmwxxZ3w KyoDLmWw==; Received: from mail-eopbgr140089.outbound.protection.outlook.com ([40.107.14.89] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwbq-008EkT-TM for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FfFcRehYoXIMXwfTPde+jiTwTxNVKOcH1ovWGPpMH0Z8ZuAaJmcC/wmiRQPP6MSdT8CQNLUwTbd1NVhvVzFZRhsvuR5Xduzg7sKU6Vtc+vYqekQJwfusVFHK98gkk9v/0LzWLNQ1Fcsr8/dqP8/PCKydnIF8X5oKl8d/35OLKjBPu0lKf0hdB2ZLX8qpfo1v5CZCMfy7Qj0YtFooJLtkBqTesA/IIEUzM6y53iUq3UH9Kdg3TRawwxuuwxokUOEqC5SxKVODTs34d3xBfZE+cRlX/9hHBR4Rggizw8Xt0Xv3Ov+zxAwcSOtkofNFM+W8WlaPeeqAU1z9v4FU3rymCA== 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=M3a8RtViAU6NJPihpfy8sxeF6A97AR4gHBn5SIWqMkw=; b=kUTt92m40i39m6OvEHJujMOyFCt/XhC2khAwjwlaMyT3Wbq0LSm/2p5hcV9Ygfwy2HUqrSp6EX8XVZ4vJj0QjZZTFPXuZcqFxgZuJe+Vyd+bXrmr3D92K7+U4MEvkolT/OANrCu1GTQTZjz7UDVBxEHReQ7K+uRLrHyBQmI5qzaTcpyHBZ5f2Xbr2zyMBvMQKXqJIIT6+PJvzN3PtAK7RPE4Qkl5b7CER1UvWtz2QByay9O47nfhnlGcjLW1uSGXCU6zFtwpdD49kDI1qMsY3R0cSC97fEOSJbcS26QIBmQrJjxcAqT5rfSMmqfdmDiQ4wQpiCN19Wgpi38I8Lw5FQ== 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=M3a8RtViAU6NJPihpfy8sxeF6A97AR4gHBn5SIWqMkw=; b=dpSzKbfvZ1k8HUjc+0pClGtzCY8di/JnQoPf40oslwbKn1ZIfiX8FVO6OBJOpqnsuk69lNTQtvgZBWaENMzDyks6BySatS9iw5Di4Cx95GesqCGgMXuxOUxHOOEz4myhAS/E1yWoXOE+eTgFFo2ItnO+2Pw8Uj+Jd1KBGwfKhl8= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:27 +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.4108.031; Mon, 10 May 2021 03:29:27 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 05/13] soc: imx: gpcv2: wait for ADB400 handshake Date: Mon, 10 May 2021 12:00:37 +0800 Message-Id: <20210510040045.13225-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43e30061-ccb0-4aa1-4167-08d91363d09f X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GqxsmMVZxgJ8rVDzbPmfRM4zhjcSekCbir0Kk3hRNlUccV7Pmvw0dYuZh+Yd2dX7vbddS46KA8cbbs+eXfJ5mn/CtCRDW5nSGQK2Bv2jz3BvkjYJHug3/p2rfXD9ixEjj0k3W1201fXfRmT6VjiMbtxPpn/HFdc6T9SK9mHF+3aP4gtH5R/PcLDuI1PmxpnSth5Ue75htmFYysVclO2X9i89ulKCzKb6AM5X+zfUNXSOSPsadoIRX2xxoDoskOY9VOMnRARMGkqZsY4GZ1XxC7rkciWf/7guaO6OYkWwlt7MZAg9Js8iXP2T5iM/30/nodf/qXMtwYkd5vAPznT4kJh3LPhAw8cOBYq9g4lHDNLGF5t7eNK6gwn7F1dzb3R/HLi2BjCXhnoa6dQaQ+595xblgRWvIAVxGAVrdNDco0cR4MW6av3sA4QHOWn3xBW6tTZtUmoyHmrrTcT+rm/9HBcP4oe+k1usVYRn05Y+cN3sq91O4luPiYr7eVhqzw93gs2A+EiobJMfo/vju5FvNLZEIOdcbuaqpAQjCmFp6ySSlTJzu/8ZmI2RWj8vAb+W1xUa7L06Zy74QcZCupEJ+GpOas4obTAfwIPWuRb+pENPkcpldzK8xCdVDS1GA/mHNw+FyXYgdjCo6uCY2veaVNBP6iuj6Q7R3wDmon69qDU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: n3ltLM6tx7MO9enjdzlrE+yim8IdcgMHwQRvTCDKL7zeN5+xuYnND5y9m2O9tqd7A5ge8B7IaxxyF/FH1m8oniLAzRkKzEiJJtvrTinaGpPR6wkR50OoOmz0m3ihaU9+5NlmWaDg0JJuPedAqWh1XQaCDX+e3VK8vHM9xXKmU5XDT5h8KPuu+Nrb3ZWYQaiyDhm1f8BpW1AFFBxv9wK0cQ1EPcBl9fvIOrCOacwZE9N0NeqvO98NzogNo+JwEqG2Beg6GZ7fP4DmUL2SfbQz9UqhPvFlcOcKD1VzVMw4fgVK2e8JoSviTIlwbOSusXizMLB8lqPeixV2bYDiyGE53+s0zktP0AHonMgxV2eJPeMHeJgdoiaMP5eFF1h1cC4EN9XjGv/YqEQ0Y+Mu5gJ0IqcmHFjswtBmtXdg8TofhzOQr58qustvrJNrgEgtDDnsF00ji1mSrp9YfR65aQNUC2qNgpsTQWUlk3RQ4oCgJyCcNkCrkgZDjjfhYDspN5+y7CnFMP/4JUz8ooW7e0jyiqe2j9d82YA0LSQ88nKfMN8o8Q2f7jz8hHiWzZBX7Lli8hMDO8myMVzELEsO55sHNC5PHdtzfnQ+nCrtpanE4Bq+vRUT0q7pNIBHgYAMnelXyoqh+m6WQXI2fCo3GbB2C/vz4dnyjT7rES2OoQAtU79MMrnlatAhlT/+VxipD9dTXCOakgfp6HutdW9ijfnhUP3Lsvp0tzRvo4BN9t4m5/aMqsg4/OyjKEHc9DcI/WKtnBZObcMUl4trOu82HWT92CDpRl7Pe8C9SbNBbEo7ib2NMKWXaK1bq1MmwNPN1Co7P3iHdeEIN/OkZx+F+AJeZ1mRthc4m5jge9mcpmlFVlcKPJbYJpmMS7XBZWRcxYgRd7LP6ZM/hb/KAOLB+I3M/zUs4cUK3DSlSiWVD+5XzGzcY0o2IXdE7xBkjSPpAiUrCRuJJk2Y3+fe+YR50GjprIwHjcJ7q5YHBpiMl25QLLO5ENoZ2y8JBRZPv8TvEpp3J5MdahhZufoqeU+aATxbjgVk0c45oQcCwNixMLwOCKZ4aQdl6wNbDtJ0pao1LpAu7kIYxSpZ+f7Vho5ly02U3SEOqo4O+BT67iPgmo1dWnbT9fnRNd62i/CZRo1OqHThJT2XE2ichiHpLAh1l97Yfg0rGTIuuAJI7dUuxnkA0dr3AKCyMfwJkjcin95ej1TQwahsgIjKs1SepldcrUvHl+Giervvi6nFQ7tc+aJHWhtKgINdlPm3DmWQJdH5HfZrOPxHgnbO50xqLlz934CP7ZHf1TCrM9d6TFy9kMPcL/EvhklxHMFi1ESe1FNBheaX X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43e30061-ccb0-4aa1-4167-08d91363d09f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:27.4432 (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: 36CZhUBruu/QaZTz8mO4KjO0rUeiyW82q8mxyJTkP+/rDql7olXHUihsnWhaZl/YULuV8BwppxW4r/KOy4GsjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202930_974817_7261A45E X-CRM114-Status: GOOD ( 19.93 ) 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: Lucas Stach New reference manuals show that there is actually a status bit for the ADB400 handshake. Add a poll loop to wait for the ADB400 to acknowledge our request. [Peng Fan: i.MX8MM has blk ctl module, the handshake can only finish after setting blk ctl. The blk ctl driver will set the bus clk bit and the handshake will finish there. we just add a delay and suppose the handshake will finish after that.] Tested-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 47 ++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index bcf1f338b0bf..c449cd0e1499 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -69,6 +69,9 @@ #define GPC_PU_PWRHSK 0x1fc +#define IMX8M_GPU_HSK_PWRDNACKN BIT(26) +#define IMX8M_VPU_HSK_PWRDNACKN BIT(25) +#define IMX8M_DISP_HSK_PWRDNACKN BIT(24) #define IMX8M_GPU_HSK_PWRDNREQN BIT(6) #define IMX8M_VPU_HSK_PWRDNREQN BIT(5) #define IMX8M_DISP_HSK_PWRDNREQN BIT(4) @@ -112,7 +115,8 @@ struct imx_pgc_domain { const struct { u32 pxx; u32 map; - u32 hsk; + u32 hskreq; + u32 hskack; } bits; const int voltage; @@ -172,9 +176,23 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) GPC_PGC_CTRL_PCR); /* request the ADB400 to power up */ - if (domain->bits.hsk) + if (domain->bits.hskreq) { regmap_update_bits(domain->regmap, GPC_PU_PWRHSK, - domain->bits.hsk, domain->bits.hsk); + domain->bits.hskreq, domain->bits.hskreq); + + /* + * ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PWRHSK, reg_val, + * (reg_val & domain->bits.hskack), 0, + * USEC_PER_MSEC); + * Technically we need the commented code to wait handshake. But that needs + * the BLK-CTL module BUS clk-en bit being set. + * + * There is a separate BLK-CTL module and we will have such a driver for it, + * that driver will set the BUS clk-en bit and handshake will be triggered + * automatically there. Just add a delay and suppose the handshake finish + * after that. + */ + } /* Disable reset clocks for all devices in the domain */ clk_bulk_disable_unprepare(domain->num_clks, domain->clks); @@ -204,9 +222,19 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd) } /* request the ADB400 to power down */ - if (domain->bits.hsk) + if (domain->bits.hskreq) { regmap_clear_bits(domain->regmap, GPC_PU_PWRHSK, - domain->bits.hsk); + domain->bits.hskreq); + + ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PWRHSK, + reg_val, + !(reg_val & domain->bits.hskack), + 0, USEC_PER_MSEC); + if (ret) { + dev_err(domain->dev, "failed to power down ADB400\n"); + goto out_clk_disable; + } + } /* enable power control */ regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), @@ -369,7 +397,8 @@ static const struct imx_pgc_domain imx8m_pgc_domains[] = { .bits = { .pxx = IMX8M_GPU_SW_Pxx_REQ, .map = IMX8M_GPU_A53_DOMAIN, - .hsk = IMX8M_GPU_HSK_PWRDNREQN, + .hskreq = IMX8M_GPU_HSK_PWRDNREQN, + .hskack = IMX8M_GPU_HSK_PWRDNACKN, }, .pgc = IMX8M_PGC_GPU, }, @@ -381,7 +410,8 @@ static const struct imx_pgc_domain imx8m_pgc_domains[] = { .bits = { .pxx = IMX8M_VPU_SW_Pxx_REQ, .map = IMX8M_VPU_A53_DOMAIN, - .hsk = IMX8M_VPU_HSK_PWRDNREQN, + .hskreq = IMX8M_VPU_HSK_PWRDNREQN, + .hskack = IMX8M_VPU_HSK_PWRDNACKN, }, .pgc = IMX8M_PGC_VPU, }, @@ -393,7 +423,8 @@ static const struct imx_pgc_domain imx8m_pgc_domains[] = { .bits = { .pxx = IMX8M_DISP_SW_Pxx_REQ, .map = IMX8M_DISP_A53_DOMAIN, - .hsk = IMX8M_DISP_HSK_PWRDNREQN, + .hskreq = IMX8M_DISP_HSK_PWRDNREQN, + .hskack = IMX8M_DISP_HSK_PWRDNACKN, }, .pgc = IMX8M_PGC_DISP, }, From patchwork Mon May 10 04:00:38 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: 12246763 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6685C433B4 for ; Mon, 10 May 2021 03:33: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 4E5B2613CF for ; Mon, 10 May 2021 03:33:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E5B2613CF 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=QxBXhr1Qx/QND1bILqvcx4EDURNoAdmI7L08SH+L3DE=; b=ZhUCXQtoqrGeVYJarmc8+oSzI 8dhsDzC+RoXwkjvUPZzC5asLrq+HsKpLbK8cqMK7FmHU60YB7/fV6eoWAoOCYnwPU0yXylAsgyaB7 u8V5bDO78t6IC1FnMGPHGj6Sq6UDEm3GyfWW09qqB9T5R2FjbTdLPr3Su8Y802RKeim++5WNxCz+/ /hAcGr3plrFF94QcXkbnuUynROTpu+/oLfcVb4AFfjK0z1goLTfw+lBUJ/994Yg4IO/tzKaYyeTkD F91J3cKCFAxZ0LO55YWX5dBuhx8piWaQZE3Kya1Yj++SuQ/BYyrTreCKAuOjweYZqEkk32I2sFYIy 82QPX3/yQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwdH-00CyUF-GR; Mon, 10 May 2021 03:31:03 +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 1lfwc0-00Cy2m-LI for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:41 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=zjlRWO8cOUoxrFGQ/W9cviGeigU8Ax/aVi0piZhgup4=; b=Bjz1tZ2TF5nOc+qh9incjl+k6T ysabzTK2ATsbOlcOvwKMr2YNGliifcGb5KqEq2LmkdKWV3PDgHE2dUHdPt30qK2CR99/MtBPdafj8 2t8NGBBlFFlNlLKnns0f/KNEsT0tmz9oQZIjszOGyRr9S9efLo6nNWVZnfwZQBw65fm9S0ZGsAgmp 8snteFSJcdPmzRWYpmKVjCccr5pwclVd1A8JHdadTdd8Ehiy+Pi+0tAu5KoQ1f35oo06oSyq+Pu7j scu/bre/ONpvrg4mtqMyB5Yr137g7nTja06kjd+Y9c6+fY/MaWlrCcaQ4sBOKRmqUbBzb05McthTx DFpQq6TQ==; Received: from mail-eopbgr140053.outbound.protection.outlook.com ([40.107.14.53] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwby-008Eku-2N for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YnWgQznYn029CgH0JXt7YOGQRBpiwm5HeCR95SP1E7/yBOy7B67Zl0z6nlfNn+T9YsCZBeendsT2bik7/lYlVpRzZ6pWQscFVAhYQFcLEdgASPgTPGsVEk+w/mXKoGGJattHJK21lKI2itSJeR9nauSZAmoG4ZeHfLU2XZEiGoENX6wkmpT3hX3rbMbmsuo7TiqmOTLi3KfAfHdzO62c1a+34WYL2xcTGOEfNVQMb2D8+HHkk74D+ydwtwaxNNi1HES1mkKz/+Xs7ZbSAFWf8PGY9fkGVtJbe3EjA4kVrBibnFVYTfXC57RPRl7cRg/C4ckVB3Twr5z0Id+IbhiDLQ== 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=zjlRWO8cOUoxrFGQ/W9cviGeigU8Ax/aVi0piZhgup4=; b=OHI484MjMOosU30pZ2cGe0dsp5vdtRxx225eamI38OUTEOfJsYy6NLnZHHAutXtyQ82GeJLXm9tmOxDaalT0+kdsTiZtLTpsl2mqN5nSBEwM4w115RTPp6cwKmZezBUeN6f/N44qoGLEfewmm8KZ1sZt7HUjYJxpLq5H4Yuj7JAq626eioDFGbvCVrNdzhpDHKrYs2COfPBoTxUCesmwaGr0YKHpqMsUXWDSdeUDBedDeW/yfJEQsG7muvqjGDcOhhyGltDR1jDrvs+NO3KSmU+VkqHhQ9r1bQ0OoOae7SCjtcHMVwoG7bKOVzl1mRrsxFlL9AYPyD5AwZZz1GylwA== 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=zjlRWO8cOUoxrFGQ/W9cviGeigU8Ax/aVi0piZhgup4=; b=cFm+6EMm/ZVlAO+Buf/2ThI6k4ZI/o3VOIh0qDjgt/MOs51CbLlE1BSYojr+uCuEedNkYlyF6SN0YLQl+FxQz0xFnF9aU9bPeqYuoP61+m7mqmhe4YyILbDE3stjRPElrjyE5nxQ6gSbPYk92j3seJZx4Y2/ylqJZX9ftQAXs4Q= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:34 +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.4108.031; Mon, 10 May 2021 03:29:33 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 06/13] soc: imx: gpcv2: add runtime PM support for power-domains Date: Mon, 10 May 2021 12:00:38 +0800 Message-Id: <20210510040045.13225-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 751cede2-b02b-46ba-1d2e-08d91363d42c X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:454; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7lX30uqXixYIcBSyUd4JEAGtAycsTVGVqmI8y7mXUt7i/Yn3IJijB6fJUtlS8X28Ck1WwXKzra5hAvXzONgXebkC5hGfyBSWvV7qqoB/PUjL9aHbz8h4PEfMlxk2E8y9D1WWi7IGLLP/LfxngNCTK+QxHLuU4QU0BpY/R7N9d0Ct8GhroXRctV8t/20X/nPHdXGCowNOwbHCAm9M4ks0IRjldb44ktO9YUSAoYpmuSs4O8NGU5D74Aqsb8yf+HtUF5EUccNkT76nEBI017dAMqMPMAAvHX0aOKt8PANQaJy9lz8LHqvIFLZ5RQwRIthV/ZhC87kF03tZ3Hgk2GUceCIM3/9HbpDe8wW/p0RSjQJ0roK0p+6odLQ9Z1KeJvO80YfGBwJAsHavqBPKH5FqBiMPVLfbQqDWlG9LbWeXG5OwZbp/59XxBymIEw8pZpwvlw773XLI9w463MGRv0Sb1QucXiQwLWyh3Zb6MLVs0sRNjQS6ChGuE1qz7FT8IAx+1w/fAOlfPGr7BFvwQqlGmm43ivVGL5afEOEV2GxFGnohbDP3ziqhCBh3g5mQoVEC5Pj6Ya+6xJfV0Y9GqkZpATvpcgfCWlE3X2eEiOTca5OZoQ4gxxiYiAwD5WRFIuDiLE7w+94WHw9tOTNQUu4hHBJ6+aGO8Y/sOtvMAowohUM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mS6tw4u9CtSzts5jytjyeb9KR/h7ep7R0P1glIGKM76EuN8DPXYIjAGIo1fXeMrWRnl7pDbObjBxZOhD4i5DQ+GXSCX9ECruR4jDwXDd5+QQTPE37heccPCVLDOZMDdYp8IMGzRRz1YLDqZfhMnAmotJVWgtOeHqVilG2R/u4zHfYNehhpuoRjiOQ5oMVJ00Aw5PNMzU0ZUbGf5nz8HysQvl+9R428otLf3eeYwWKp2d0gYnhzzQmk73Grc1u4MugUaYdEhheWkxSrF+GHwBLOG+4SK4WCMwq/5pp35WvUs9xKck3Ry+y4cGQo+gSF8qeRCUJmUu9cd9Ixgrb0i9Fr8yTS1O1VmTqWM2SxrXFJxKznMn09MpjNVKnJ5IogF/lfwhtszBKMwV3jzMcWCi4t17sk3giwo60OJWbMs4+NTY4UnifMHcTQNbe/iOaUJxvyVDKJRpdcEMcAEbzp+6In9EKhI37RSYh3o9NKW45jIsFS+g5HZe2jmf4c8GZAeAtAIYn0aBPDP8Lb23QWN/pofdTGp0b9WJozgR1kbNodAmrg1hkj2sXQGS8Enh8+rH3rg7KRgVymMk6VkvhoMGZiq89LJ/Di8p8QkoSPKNPh/my5QHNJ0UUkFl3i/uCvjhOV3NgFCy2OS+3GgGn1kt9UzhmTMK5xYBC6fkr6m3cKIeYykkv3HA5dTNKKMsBw9hiRMjO4oRhYrxS+P5BKdHuebI6VgoR7Jnk1RMDSFazxxKmbzxsPkjTPJxBzgC29bEVssPrkir3XY1wp2iesnqoqv9zXzfKFfLEJuQJVxT+i65fzlDX0fEV8rIxFVJ10ecfwbzsUrbTuMx+QIpIuEZS5PC2FGCt6napF/mD5e06Px7YepH2hAewXguxfNYPwcw7RS6eEzw1BWe3ldnUnIoOHVEuPvIAXNQB6pBZNLU0zFanw7rkEB/gLYEEKRym0olhcpqw5RVlkmttI4EwyIgbyX2E3A5Z+cCeLJrS8fRfXk+z7SuUMubL+nHcDgeCoB9k6WfY1ROJHjRqYaW+MeFXsHI8XGs9N05SJE1gvTCdsaBgTD3gPGh/G46sgvzqpXS4DnuijjG7OSqtcGyG/AhJBF1z9NoFeAQzeUASL3rUFsIlnOl6fUU3dggp01IDbkHaasNeMna3CAHHfQRZWCk+60KcTZbbJABYGGVrp6VxfdvUNuw1TROm76McrALrcOxFytm86WYBnvwaPJDFaYwQjORjEtN7iPtt15VIewT0+wVK+pMlAZgio1atJ2oj50yuV3LKFnjShdkC5tugQPTOwr1F18tadOcgVw37JpKprYiYDSrt0o2aut0w2BJKuQs X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 751cede2-b02b-46ba-1d2e-08d91363d42c X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:33.4075 (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: Eo5ycuh86G+lAXdQfcZOGiCEmbGls57sS2KvzR8wfsvjDPPRRVKrOk3N235l7njkCjtYtPFPF1jL/piU568BrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202938_139346_BD72629D X-CRM114-Status: GOOD ( 13.80 ) 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: Lucas Stach This allows to nest domains into other power domains and have the parent domain powered up/down as required by the child domains. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index c449cd0e1499..800287abdbea 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -141,11 +142,17 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) u32 reg_val; int ret; + ret = pm_runtime_get_sync(domain->dev); + if (ret < 0) { + pm_runtime_put_noidle(domain->dev); + return ret; + } + if (!IS_ERR(domain->regulator)) { ret = regulator_enable(domain->regulator); if (ret) { dev_err(domain->dev, "failed to enable regulator\n"); - return ret; + goto out_put_pm; } } @@ -204,6 +211,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) out_regulator_disable: if (!IS_ERR(domain->regulator)) regulator_disable(domain->regulator); +out_put_pm: + pm_runtime_put(domain->dev); return ret; } @@ -266,6 +275,8 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd) } } + pm_runtime_put(domain->dev); + return 0; out_clk_disable: @@ -523,6 +534,8 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) return dev_err_probe(domain->dev, domain->num_clks, "Failed to get domain's clocks\n"); + pm_runtime_enable(domain->dev); + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, domain->bits.map, domain->bits.map); @@ -546,6 +559,7 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) out_domain_unmap: regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, domain->bits.map, 0); + pm_runtime_disable(domain->dev); return ret; } @@ -560,6 +574,8 @@ static int imx_pgc_domain_remove(struct platform_device *pdev) regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, domain->bits.map, 0); + pm_runtime_disable(domain->dev); + return 0; } From patchwork Mon May 10 04:00:39 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: 12246765 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11BB1C433ED for ; Mon, 10 May 2021 03:34:20 +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 63E3C60FE4 for ; Mon, 10 May 2021 03:34:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63E3C60FE4 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=h0v9PGKQC1WfHyD7hRCYjBnXfHAxodnEo86yEdMu3BY=; b=d+VbE1VMFmqIqM6PxH0y/0Zn7 X62IImdilbniPnerg2Uc2RmqaU79bjeTQG/63zk6MP8OpNZKR+xTEtRmfE2MAPgvfaJgztyJfAQ/i wD3/8sqhdVKW7FoQTDydTn3dZk5nXW2cFZ3FrUk8yLyd1MwxMnDlUAXg59J8xbZstKnYUj+wqox7P IxQAyFLU2CqtLKeKcqNElmU9RuB6xBNpbzij4WO4HiXrpWKI/1wAGR93S9+C4nudkbTC7qY+9VdUx jhIUaCKIvqz4MZ244AjdV6d81fkKkb42mSlXaHqXgxe3UC3/yADloK7X2316A/rtb8GTciljAG0wc B09dhz97w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwdi-00Cyfr-R3; Mon, 10 May 2021 03:31:27 +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 1lfwc5-00Cy6P-Cl for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:45 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=uZOmLsY6WJNG2s5oD+u9itH2/YPJ0aEHqCR2x9gj644=; b=tfpY6l5qYO5PAsC+fzfmohXXmf KS9T6RowiGqQI5/ZO/JchfaQobS5Si+waFLBK3TOtPAG3rclKVBQn9NOwccEFTtuud5HLamkaRKBv jzZ6ppDJ6VJAGcG8hdyiQuEkbpNxXqsaz3btnII6caLVLphlw3JKjzNVxXTlhku7TWC1MiQeyP8c6 gVYW/d2E03ARLNGwYRu+Khm6ooposSWCjYX54edCUmrsFbG9xOq/q8FYpZyrksq1JtqZkmQrNBRJi y795IDVIOZKiL3HB22Q5h/w2Qh4RlydwRJIipBGYMdZRT0ex6qFVWAQ7KN5F+Z3nDstE6xJRLoH8a FIQik0Zw==; Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwc2-008Elx-Kt for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lz3EtwVOsyXhInV8/H4Ym7kGSUMhNeTBWorTkTiDEa/8tfkFkjvsretL48uiU+9/IjH+6I4+ZLql1i3jf5bqrZwtWCMM6uPoOY4AVg6/JZAlOx0cNn7SfWH5QwHq3P0HkwDh8188EhXOX+iR3HrmxXUBqdZnfQ6Kniw2QgfMyqiFe6B5gLzLeKw/unvQnS2S3wzGKot0SL8JrUKlHuVTkLNJlSCPgArsdOVh7sAEGtqBWDG8ZZFb8/Dg48jgASq4l2Xfbo1pmfOjlQJrGZ7g/DDGktjot6BWBbKGLRJTzUMs0/uhs5Cp75wAZ0XGMKa2KqTh8RbeeI1O3UIqPPHFKw== 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=uZOmLsY6WJNG2s5oD+u9itH2/YPJ0aEHqCR2x9gj644=; b=DpDaNqZ/2mb6cPsH6+PInnz+b3tbsrXshTu2GTt2wGrsclQYTDCj+gSFa7021lvHRycffr97N2W0u+LfL/10tUD9QbMTgJurz6fpKklvPAsnHQvk1BvgttPlLlxpbSyFlmvb2+6z7j94sYzhRvsE+ERq8mCpwRQ1EOGQJvu4fZ+g3/RJG6QrZbJsEx/YAaAGEIhpt++85XTQ7mtQOfFgB272MzFagZyNrEIsbSlyTbMa+SU4e/sfJr6QR2sjzM5EIb+p3YSKZrYYh1s0yjupnPOuE5jxo7CymOynLdYUdhK8bFve6qYFF/+m23H3ppwFzop5FCXL8+UJzfFkxawpcQ== 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=uZOmLsY6WJNG2s5oD+u9itH2/YPJ0aEHqCR2x9gj644=; b=VP2KQt+7TfeKrjTZiEeV++9ZsXLOEQvGVzQ/vNCMVQVUXjrXRIMt+54dxuSjObYXa3avdvarBkHVULERUALaK8X5lY5oq4fPgKBBQ6Z0vxJGWIGMGi41+qSfPJQKNve9az057ZG4yVeEdNRq0FVBmX1dIIaKcyggvspwe/jaNrc= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:39 +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.4108.031; Mon, 10 May 2021 03:29:39 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 07/13] soc: imx: gpcv2: allow domains without power-sequence control Date: Mon, 10 May 2021 12:00:39 +0800 Message-Id: <20210510040045.13225-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73106864-699a-4e07-1b98-08d91363d7bb X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True 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: RrM9j12UgKSok3G8tnWhXlow4UW48buG20lwaiqq118aY3oeoFpN3ni327NS3PnujJHcKE2G+jebYMghHKn5+iPtY0cEXIk0amdEif/SOgMG8x8taDCm+vmri97RCd34VGc2FmyzoPSKBLPDuJMHBj8xI3s8kdu6O5x3jg7Y7sHct61dqcYTcPRQJ9yhWVOW+3eekl28Wny7NzvG7/Vce1/3GynXGo5eScbcQKllDf5DXp7nK+y9dnN7FiHRkyqYpA54xjL3EALwpIwKF8Wux6nMtUBLcl/pgctPpETMGQPK/e+h7QS17mCLHLVtfwb6VibNPQPjr9+s0ZkZfbW9L64repgtrf2p8rsIuhaHUuqW4/6OG50TCLIMRagx4H2kVAmtbFxdjtgTP5meUflsAvfRBFOGqnFyRwy20dI14RHzz7AUCkZFQcIG2X+1Tx2a1U2XxKCUscdKbNpf+UTF5LGQ2R9o0PL5l0SGBg0vceuMHvKFLFt5hTnmDDK8GcOWvcl6n4oZsV3ZFOchj1VrPu5lOn8ViJk16gbTyHrNkVUqoiQtMvCmYtOK8wCdwn+Pu/uR6EfVEpllh2UlrS/UNhI3L89BFqLka9PXyZ9wme4Ae12DSO8/qM45mq6o4g6cmoYVtiaL3tHeJyxZdbB4S/+Hj5fIeTXnRKM0w14x+IA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NT8EQ3kLM0eeriUaPI+BcMy3CP3unBO8/Y5GNUGediHd3NkuNzXgwdAT9DdB6zs2/z8Qrghs5uk7d/lGvxEMM0RqTMRYUQfOsK33HLxtLsU5um4nHXOxDOVBRBhvxw/eSynzuz55Er3cENktfyFEpooYBlxCUJNtMRfMKssYqHTdLLq/aZiQSLIBPu2JD67D1vIIDCxdNESgWprMhQRZaZYPyUAlHE2t7Br8Cd+dW2vPfopOzCzn/COLgfG58eXXKNt2SusBFY0E6zUIZCX0x6KLkIk+LIN/aSiPzzpfSqZDftNILdkDRyHgYAadJnbu6Amt/FgBvbOnfc9ukDVk3mqj0J7kwalsUuAnQQNZPTOQEhid1BCWHkrjM+bjpsz6kMkK7vTIcErLwS1X+EMonQIllzKOMGZVBvubic5KXEOXv6jBSG3zugYYZmBPb1PHFGmJnrWkH7o/dFRxXwFX1jwqyqdoQZ8Vu0sSLESJ0L/zxCurUX45MCTLY0leXWARLCLHRB5ZPnbdjK/Zg6id1NW7yzekw5h2rxyljcUjgMwm7gvhWNhsQfrIX9Fel+vbiV3Cl/2Xckz7FZWUAEjLUx00NZn47hszUHFJu9lNoquinEqz2Gx0Jov9STgjeG39N2qQ0YR0Rcai5EveDft9zRl8YL8QifRMVnJ3ANzP9kUD8ZjOq9TL1vth+yXP9H4O0+66rTUsQi1n8fhYNzUznmnUcUomYDwTUACIaFt/0PWl6IlpN0YkRL5QDqZ0vOv3wSfYJYnpT9viZBnlUGrvjix52TJZMLOGjuEunTkcmjYVVaSDKfchdxDnruHewaoZ8IdSzWyiF0w7vy5cpwy1DZvRUObYn2OnJJB77ptmzNEsk2tqR22WC4mMDgvqZDd9d2ftRYDdPnEA8Sqp44OPxKM81PIfdxtoaFcrTAwVlXsg3WHPKfOccLmz4MSqwd7F0WHc+Zd5VALQxx9PMFR+SEmYIwlY/lb+ajDOyFkRUcdxnc/mXVHddbRpn3ePWDHXRzG+/psI4fKi8dceCjXmq3bjv+Kg8FX5zWksnf7sTi7tSMXMUj4RsVjlVX74rXsGBXfn1eKxAISg2zdV2pYZDmdnfBmz3h66kDvciXk/mtbjPlUTWg4lEIktnAczjgOCWOIXWkI9PEHCqnJ6FvAVMW93Zxu9UL4NMXd1areQtPDei6dLTzlFOrEOEnXoxNb+/1yNeqZpVOuFMy4zC/nUcZc2wRAmaKBhT5bJY/d9CrutCvobBR31n5yZzvOixNFMrxLjTvFyjgN1uJ2Gq+fvUXAo7aHYlNMYjYsCjxcPuDNfNHI9m2U+Y8s72cqpKCD7 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73106864-699a-4e07-1b98-08d91363d7bb X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:39.4208 (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: 0mepFt0GvAkD3WWnxb5m5YRNrbOCsox2DEIqT3/QjERSBJYSBu+KfA2OyGW/1k8UF92+0w4Pr/G12CJvIPaakA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202942_719485_C645985D X-CRM114-Status: GOOD ( 14.01 ) 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: Lucas Stach Some of the PGC domains only control the handshake with the ADB400 and don't have any power sequence controls. Make such domains work by allowing the pxx and map bits to be empty and skip all actions using those controls. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 89 +++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 800287abdbea..fdf759a7c865 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -163,24 +163,27 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) goto out_regulator_disable; } - /* request the domain to power up */ - regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, - domain->bits.pxx, domain->bits.pxx); - /* - * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait - * for PUP_REQ/PDN_REQ bit to be cleared - */ - ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, - reg_val, !(reg_val & domain->bits.pxx), - 0, USEC_PER_MSEC); - if (ret) { - dev_err(domain->dev, "failed to command PGC\n"); - goto out_clk_disable; - } + if (domain->bits.pxx) { + /* request the domain to power up */ + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, + domain->bits.pxx, domain->bits.pxx); + /* + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait + * for PUP_REQ/PDN_REQ bit to be cleared + */ + ret = regmap_read_poll_timeout(domain->regmap, + GPC_PU_PGC_SW_PUP_REQ, reg_val, + !(reg_val & domain->bits.pxx), + 0, USEC_PER_MSEC); + if (ret) { + dev_err(domain->dev, "failed to command PGC\n"); + goto out_clk_disable; + } - /* disable power control */ - regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR); + /* disable power control */ + regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR); + } /* request the ADB400 to power up */ if (domain->bits.hskreq) { @@ -245,23 +248,26 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd) } } - /* enable power control */ - regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), - GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); - - /* request the domain to power down */ - regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, - domain->bits.pxx, domain->bits.pxx); - /* - * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait - * for PUP_REQ/PDN_REQ bit to be cleared - */ - ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, - reg_val, !(reg_val & domain->bits.pxx), - 0, USEC_PER_MSEC); - if (ret) { - dev_err(domain->dev, "failed to command PGC\n"); - goto out_clk_disable; + if (domain->bits.pxx) { + /* enable power control */ + regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), + GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); + + /* request the domain to power down */ + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, + domain->bits.pxx, domain->bits.pxx); + /* + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait + * for PUP_REQ/PDN_REQ bit to be cleared + */ + ret = regmap_read_poll_timeout(domain->regmap, + GPC_PU_PGC_SW_PDN_REQ, reg_val, + !(reg_val & domain->bits.pxx), + 0, USEC_PER_MSEC); + if (ret) { + dev_err(domain->dev, "failed to command PGC\n"); + goto out_clk_disable; + } } /* Disable reset clocks for all devices in the domain */ @@ -536,8 +542,9 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) pm_runtime_enable(domain->dev); - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, domain->bits.map); + if (domain->bits.map) + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, domain->bits.map); ret = pm_genpd_init(&domain->genpd, NULL, true); if (ret) { @@ -557,8 +564,9 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) out_genpd_remove: pm_genpd_remove(&domain->genpd); out_domain_unmap: - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, 0); + if (domain->bits.map) + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, 0); pm_runtime_disable(domain->dev); return ret; @@ -571,8 +579,9 @@ static int imx_pgc_domain_remove(struct platform_device *pdev) of_genpd_del_provider(domain->dev->of_node); pm_genpd_remove(&domain->genpd); - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, - domain->bits.map, 0); + if (domain->bits.map) + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, + domain->bits.map, 0); pm_runtime_disable(domain->dev); From patchwork Mon May 10 04:00:40 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: 12246767 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=-17.4 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,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 46BD6C433B4 for ; Mon, 10 May 2021 03:35:05 +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 CB3B7613CF for ; Mon, 10 May 2021 03:35:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB3B7613CF 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=yOFcbrwDkyozUlfPKP3j58+knW9CVl70aucDV2GMlNc=; b=lXdo6q0+g/eqxKmzuGmTyf+AV bbFH639sOlOKaT7h0I07PSFqphDJmfcUcPdQyotbQqR1qyG0FJmaRcWOJ9GmPdeIRn/3tTZwbXO+e Lg2X3IsC20lY5wMcw3ZJkrTeD/hAtvyOQHrRD107+OWR/25V2f8PrE8pqd6sXVH2NqDAF8hR7G4zK 0OtW1jYGGhhQVju8TtdgfNKyBbBCZ/kWLIRSJQXkDg/MU7vrpIyD/a3FOFT3iLa7pX6ysaI8nWpJz l0NWF1dyysVauiwEfOeaozc3WtDDc6wiU5/11KtLrjhzObV+qM2YmPfab8PsCixFPpCA/yScBbIly Sls90DU2w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwe5-00Cypq-GK; Mon, 10 May 2021 03:31:54 +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 1lfwcB-00Cy6z-BR for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:52 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=+AImgcs7ms0qAmSvPDKY1UQmEuy3v9Gj65WikmMKaK8=; b=NAd0XyXQUDRRQU4FtVK/D9UfRr en444O2w/q8I3zSV7DailZUHQbR3/uDsW9LvosVwTmDQ1eDUVvi+AAYOEMU9DOKYX8g4gYPW15DDB pLHFp5g/kt87RXmq9hOSmA4OlNhQcbq8d9KHzSdFrQWMhbKb4YBjurwa65nE8V5Q0h1xSqnRF2MQp rZlMTI8YjgWGQ126bWVALkzvRJisJ+voUzGfY+fXpuLwLdQlsrZqTFRB0OuVSmvDdRkYGEf9gUCWY l/x1jg/xc9a94iXqvsahCzEQ7jzr119PGLAsPVCi6VUuime7O96iDHp2BQvA1YnuD7GsahE7t4R3x T5eqp/jg==; Received: from mail-eopbgr140054.outbound.protection.outlook.com ([40.107.14.54] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwc8-008Emr-RU for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2QHMSd5zPTnMyFN/14SoADfP3p4JE6v1SA/P1G7uyCXuzUvlqd36e4jAyKvKCL+cWtR6GJ+cl11o8kikzbQACSkX2z2akgZV3hILmG+ajMd+lJ6glixLWxw9liav71FrfoCv5l6/B+DhutsFUCQNh5RJNCLUhHmR9v2IlndRy50iwOX7ChHi/qgGLYUBeYmOOg9IYb9l4UQK41NtsLobTQ6jFYj18mFwTntDQNIhbwwrUBCbogIPmXuP5bM+Jj+LmN/obiAOjaMNlwEcaffAQjXKnHC02ADTPSYD/RurVa9DeeJHO8OqstfRbHmfPMNs8oLL2drDvnAClta3kmbVQ== 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=+AImgcs7ms0qAmSvPDKY1UQmEuy3v9Gj65WikmMKaK8=; b=drY3gfDkXN/2HehhZNPmhjGXlUxQdHAcLHaqar18AsDFPZV+/ZPvp9bWOe46iJJcY0Zw04r1vn+dFi9CjoL0yAt8Ah5Caq/JVLZiO22/k1qk8UJehkxAMvcFAlskknly2Z5cBXbmzyIaNnTXJcna1RYi1IdOEiWM0hQQX8H4t4qg+ovyNc63SRZmTdn7L2B8P8JL1y6ZPPvEaof+dSF/tiGr2CHVsohqI7bvjeDO/jUSAaMOwf1h4irS2n/nPbPbmE7mh7qlIIESBjlE6GfseQx4GuhBTcfDhuN0+o8zcgT9arjA7ohwTU75wmTvuuhvbCQ1j5G9q5RpJ4s4Hpm5uQ== 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=+AImgcs7ms0qAmSvPDKY1UQmEuy3v9Gj65WikmMKaK8=; b=ab0UHqKSzFFc8gBA0aPNSDlAehG6UQgbuoAvg79phmGpo5ZwwLX+d0R2XH7UguLFgKpDn6plxhyirf2tRKLewCD5hgaHwifA1Oux4kCCB3/rLu2QS0ZqylSg2xx4iX1JW2JgnhDSNQdjXhZ6ITJzK+HugRM8VLKkhg20UEtiIl4= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:45 +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.4108.031; Mon, 10 May 2021 03:29:45 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 08/13] dt-bindings: imx: gpcv2: add support for optional resets Date: Mon, 10 May 2021 12:00:40 +0800 Message-Id: <20210510040045.13225-9-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c84699a5-442c-40a8-2637-08d91363db5f X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xZsMmZYCTSBnCorcQR9ntGHwAtHcmNCQ1G/dA6hmQ8e0Ev2PzxwhYVfZDd2Jogys5+KyX0yVysV5P3t2s8H6EgemTqhZysXEAV8fM6/6dJZ63SzxJhb1iHQOtfNGLMtW/yVTqfk3Y1rJDmeyVz21mZ/J4bQOHxy2oMz7qHj45gFXw/wSUriKUdXJZKchOf10DEdf1/dd2PnzrE4UCEucu2bSK7uKS5nv/yv92sj2xX8lbgitdFh1Ua0A6VBiPu2xMZgsbAMa1tzvrWzBohlM8T/d1p4+NzxRLCohlqAu1oS/ly0uBRP+uo/CXT1dPk4KYB3bfOHVrF3EJnxjjB4RjegDeuq8IwY0S5281iPhS95gSM61+5mJNJfqFz3q0SWAlVHzU0/8h9zFE6sYkZ62TRRD5m+ofUAWtxsbhM12rGmKciFsuu5gQwEV4Fw4qBVTcVD3/JHq+MN+0Jd1L/5u+5FzyC/e6ahH4XKU0Qh98db8zuuIKqkrmRyJs4lwJRvkJ6XdAzx3M8ae091Vs0dAfgPfs72dn4eX13NMdZ18Fu7M4lRxY6DSaLD9j1MPn8dSz8O8cDJvTTsYtO7Gxw9j7jbFwLnXYlq2IyB8ukOe8LMkbpQLYAFiLH2m+UtBswz7+CC/K2/r0or70tlW5l5hjGBMfz9KLmYGNcC/ZMDU3qc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: QFs3psgAAghdAKnK9qKd4lrOzo7heaBcLNcwF0rN22fHcYUPc9lchSXBgGYOmW1grfFcTrc8rPd9sQT8UfTUaT5ImrMH4SFmiAbSNvNoEOeVRRXtUWioqGj79svxdip0hUsv3EOWtmnP6vnhnI5czUE5kw7V/TiCaBAuIZKZ0vfS6+q0KPm+mCBhnxjsOCj/Da0+gChuAAmwB9pttg+wlgy2D3GgaA3DGp5B7RFOyvxMxdaw2buUwcqNu3A46ukoqxNdmfZ6N2pe3Z3Q0vvkRDsCyaoVVuSgYvbgAnJ8QvKr1KhkH6uiENeGtvfuU/LWvLYUdzmgyGOdKkq8Uvyyy5mrXEuZfw+SCTeUxCCRzIdUJLvpRyO6S14iyWE2JJBZg3QxgA+wS5Kl6gHYUNYUTKug8etG4qgSRUvOa5yhNWzJ6k2yw6oHLjkM2n+GfzmWodugHxiXVo1pFBpGJSKBw0CxJzwIUISYdHUMT6sLFniGoOxvBhtYhzbGqk0DHzsaWWJotoVk+fgpZDuAFtYmfaRRKDgwlCckEfioIWlcmsFNDiB7oNjNdtk7/mjMh3XgKZWkxJqRTSiUb8gMPJ7HSGrIZ4a6M8bKiCqGyV26rvutVd6+hMkOHprm2HAfxt5CuutkyUzHW82w3FVvoE5r5TjfDriLWcI5j5tNQ7ZaYEmKmwAOdfuYq23KyfjtqFERYS2sffP/UfWvwrEvucUdIj9GCZveTR/zrhcuUpv/pT54rzew5WJ23c4BCO9xsRGMT/C9Rb4YQVowsfKBUNQe8+jeIT+ORPK5IlEEJGpwB3PU84U4Udq1jOepygHFbHVLkmReBft4eCKYGQwR6YhrovIYIf8cs0pDKjqiP7/Oeou73LyDLahvepWDAKyZbkkv1lP7bDErSm83i+TwQEngxINUgZHanYKdGpJZ4iUC2LBPa7nszYwzZLV091ibaGpEysb7YzAjK/4nScgNym9GLibjkKQlLb0Pe88etxIQTkfODBtnCF/YxeNW36R6qZJslXvOxHte9cvqZEf+KKcPWHTwkTjdAvoesGMqRP3r3U5dVyuC+tDtYkj8BTsIzxvZ1s8gu6ofVUEmyMgBUIAOWc+Mv8WhuFWTo53k9ICJ4BD7NhS9rgIqwoAEZwFHI5Wr4oGw0NYEiTrXl95sDSXxnggMwibPZeyvKaR7Nwt4osK4hB5a6ZCAXG276kkL8d4RB1vNewdTdwLR1kRn3osIYMo/1yEnBGN7uTbBwuT8kd25/AYh3PEMUq2mObr7C0aN7aFk4v2w74Msfg4ZOraQE5XjFC71oq/QPsafeVJobvAvoBPJqJ+2I4V6y/C3PwnQ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c84699a5-442c-40a8-2637-08d91363db5f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:45.5280 (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: GkR71VQVeP2tqQPPRqj4r73nY25v0ynwqr9f6rQ6ifIe2YYF3oYMdDrxb8I2YQ0q0mjXABMOpEPN19+OlBr96A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202948_913500_A930118B X-CRM114-Status: GOOD ( 11.15 ) 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: Lucas Stach For some domains the resets of the devices in the domain are not automatically triggered. Add an optional resets property to allow the GPC driver to trigger those resets explicitly. The resets belong to devices located inside the power domain, which need to be held in reset across the power-up sequence. So we have no means to specify what each reset is in a generic power-domain binding. Same situation as with the clocks in this binding actually. Tested-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan Reviewed-by: Rob Herring --- .../devicetree/bindings/power/fsl,imx-gpcv2.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml b/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml index a96e6dbf1858..eb248f24dce6 100644 --- a/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml +++ b/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml @@ -66,6 +66,16 @@ properties: power-supply: true + resets: + description: | + A number of phandles to resets that need to be asserted during + power-up sequencing of the domain. The resets belong to devices + located inside the power domain, which need to be held in reset + across the power-up sequence. So no means to specify what each + reset is in a generic power-domain binding. + minItems: 1 + maxItems: 4 + required: - '#power-domain-cells' - reg From patchwork Mon May 10 04:00:41 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: 12246769 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67DEBC433B4 for ; Mon, 10 May 2021 03:35:31 +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 DABF561437 for ; Mon, 10 May 2021 03:35:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DABF561437 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=nzyhqW4UXBHx9rgtpXRoCPjtfrekiq7VIjoqKMsI3/o=; b=HiOGKCRdTfOp3qm5MImJdT453 iZtIxZ14vceyXciDMQE5J1ur8/lcPl6s+fAlSoRGzQ7kTW8px9HhcHXN7pj+O3CXT0XrDz9qefj5W WxxC387pEZ5xfj+oZX9Z+3ZIHF4fnlatH6wG5pJBNYkAiRZ21fzvDRTASoDa17DCy2vWyJ3jB9lsW hI7guiL3UQLm/52LzRe3k3bQl0nPrgX3+wqjW+HupnwW5/ebGFQPES4Kl5xnILrEzZkh8V2/XWlmo oVT+T8ZA07JfJgE2J+2hRjMjAbDp24+/hYKzVEwzUALMBfzcWzJrXy1Qr/rYQ0w+jNXs0U8N0mnqw FmbmEWzUw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwen-00Cz3l-C8; Mon, 10 May 2021 03:32:34 +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 1lfwcH-00Cy9L-Em for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:29:57 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=lp95uhgHswPJobcTTddxxg2ESZwXqhvhUAhAT+7D6Ac=; b=TNIO7k8tbBEyEmQA1Sl1onocFD wj0xTQY4dMTa9ld9PM34F57UNO8Y45A1FGrGE0ekd2f+xU79Zrr/02YmEyF9EmxFbaVfSUDhTjbVO p5BcUXm3Z+6hJO2hUrtKzFMzm/GWNWqrJUIK00jeGYVI03QlQHwNktRwDB4/Tfp/Hs7ipZKGSSb00 tkAN6Thej44GpGBmqpn27UAouSRAc5mA6Dp6GXGq0HTAHQVU4GKszEbpKar6jBdrFjCcjIEeZcBZ/ sV0QpgSCLCAzNACRjP1WCdCyy3CMYs2b7dK/BZzkiVhtyRt/3WWkoUVt0KfSVJOtw7mJ+LGb2U0GZ +ETKCh8A==; Received: from mail-eopbgr140072.outbound.protection.outlook.com ([40.107.14.72] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcE-008EnR-Tw for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:29:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BLb4XWhmFHmYAe5/ppIjpmpuQoxKgQ9D2V8XbbVXYj/qgSABcRbiEgwK9CK+IsMIv2h9t0hOuQJIEKbATaaopLMaTYEDfu4oCnsaG4ZmqjwFz7ZpFF2jbxxPvkd/Sa5nfTBhXC+PQCCNUq1mhmrgJ913pd0LT4NULbDgYdFE0BtjSsefRTFYNPREn0FrFsxAI1ao42TWYmGaeiIePZ1rMiReshoIyeEkKOt2+bfgndF5wuuBGCJnUGdYqHo7orAVaFX1GNwWGrrQu63t3isK29Hoa7z+YefyeakbZI3AcOyt2EWSjP5mQDWMOz4ouR0aStjXCJH1+HdXtrSAzXevnw== 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=lp95uhgHswPJobcTTddxxg2ESZwXqhvhUAhAT+7D6Ac=; b=ZRuR1Sx2/xILBVzqSXq/JG9lPVggMVwWPwvd86/KeEAV4BwEODmnSj/aDIGHTKfy9W4652DqFhp12gETJQ6IDwzzyU/Snpq703ptRFxaU+mSivR8EN2h94mgXJ66R8IDdnCm6rWnq6e89preCL9xCjlEuw9r1U1cDmIa0U8iV4hQpRmgHYNDz5WCmFAVFNXBVqznd65bQlrZKTW8zO2mwSs6IgcRn8f/BDqm30bCn14T7Y2ifjIlFZYy3+6QU8SeMEX5kdk+z37zYnuWp2y4e80q/dKScMolK5FEOlr9SqFRn+Pr9Vn4doSnbtYDhzVxXKScCB0KOhkYfBKrY+7JbQ== 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=lp95uhgHswPJobcTTddxxg2ESZwXqhvhUAhAT+7D6Ac=; b=D76MV02IkesfA0RocP9syheEM8MiiuLMlRFASqw1ErxMdavgiLvwKlLUocm4tP7OcPioppxzKmxnz9Rjw/3CYsPEvREmHZ/FmyqdnjvwnY+t+YZNCv5Ga4pODw0P2rIlXoacvn6povIaK+UOx+Tco1E/ViYEg5oM3n7geBOWxHI= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:51 +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.4108.031; Mon, 10 May 2021 03:29:51 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 09/13] soc: imx: gpcv2: add support for optional resets Date: Mon, 10 May 2021 12:00:41 +0800 Message-Id: <20210510040045.13225-10-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68312f10-f2f7-4fee-e721-08d91363df00 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yxzxsc0qwhlSxKa1B9qnxpcEUJdpZ4yINRSfjCJewdMAVcRbfyxdKgAxEcDaV4y0Lwnmob/Su4sqsxl9vE6aJdBozRoQH4lEkk5EWoXEp+rK5TUaX52Eyk9b9LlIKOxZiVMvtuMYUdc0Rn5DSbZPi1sKgLnZEncKKTCU5hxht8dCu5MBgoUcvu1Dy32z7gM1qBy/VCfPgwyg6SbBmg7jD4VTS0iLTR04qoQZSxrD1ZqrAogEyJ0nDGRN6qEF1iZa5frGFhij+4p0+hV8NtHLoKcxcyF/EZcMNvxiJ92+fEb6n7L1K5K23KSafjbVhGalNJH909bJQdEiAR261rbz+5cXuK6iGWraOgH7qD4MVT5dHgFKJx9jocXu4ZHtufDgsil9eqyIO+5zhUBAaq4Kci3Xzwb2AyPFNxngdR3HYplEkgOCNQb9zdlbSlkQSOvqxGKVvB8RnwU/sxN1MT3OPqdFscc5isIVWG61OT6ynAVO5PYBp5hNcA7lvtoWJJLiE0qWdsRXjBGc2lvGdTP0wFkJRKh5vdapRQiAb4CWNYzbAjVcHNj3+5Fde70+fTkwJcGiVY5C3XZQG891bb1bnZmLYJg+v3yPuWm+EOkAbu9syB1CpaozFtkJB4UT+vPFSGK8Q2wphMCMPSDJDBdwgKIYOmiWRgHZYrABIbiu8Qo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yxMVAyNjHdS6R6D9q+GiFFTHNn6olcAOHZkIVKTlIHffvat7gKzXeaVwaIkTtnB/qwq8DitrlF23bDprVkUkjmr03PW1C5vMDkDtM/VgqiD1fx737VNaUgoPKGCI14bezbtUHVedinDUBMioxSAVIiKnNVKdAoeAobiImrHMXa7PTqigevPqBCHP1IzvHGYh8D2N37V99eanqIBFEwslrwBZep4Hlxx0Cc6N9MDtL0LDjqryyb3hFRtj55N9agsAef7GSV7J4ZWyEB43Fay6KyghD8VppFWx6Ei0QRfWeAYOsNmOWWHEhwmc85wlp9pebrUr6hK5UkYDvucKwkdg1obzrstbPFtu3Waii9byAqwlEpS70mjcxEOTgbVkY/vRkqy+TbUFX0WhuRN4fWJ6eeIOuRYxA8T2AHBJ1cobL4QB3Otnkwwr6hIPpKQhQ+e/WKOdOSsKg35Ulb1fve11aqYlM+TALpFPo9A/dFCBjL00jfTBZWwFRWBO9qMBmjkQtCOcFbdg9yibWuv58rzaUW7HnDrT9TPNns22s4ejhAy1itMA3kvYCVO1c+itZhzXfUKGzLvyPjTjGflFxCQhDIh4moYD5fQcSpnhjNJ5OpW+c69FfIasYwVhDd18cbHCM7xMroMPtHZiRAqlycAlGV1uRIJ/iIo2I8w0pHJ6NjCzgCzmQ0ix5B1324y97NOoCd2/WrO2aFHcpFR+cGJO6QSX8eNZn6U4DlRynGj+ZepabkWTcDKEAsdpuPF0b0j4rn601bwy0uSFVzzoKfpTwyDPRfChDtKtbo//OVQadVzluylD8OxhMNqEPyl6AHrEA1G6UVKp1qUFfPYcAi4sz6k8c5fHUkVDTzUPK6t/RwzvbLHN5jdXXF7tAv3lpB5MJISOm6BNoVRYR7RRmNgk3ViWpEeNisVjMH1AzJLydfDEOdtAzvXaO0Enp3anb9PrdXJjwYmAASeF6rZwbZXN1rFdU+FadI8EsWA7mriSYtJh7omqIxzTrVIPZoaul5ENHBMWrkG1qKRZKDz1e4pKcMSEa+dURI7ShraOUo+vqva8MYsym7b5PSiEn6/YdRm7oD6JcYW9CG06808JVcFRgqbMraaCfD54BxMOhDmYcSH9cC8t43OdDIytxO2ntTZPcHkaaHfWGNkQUkvjl+QnJ+IH3ic49WNvgdpsJRe8xna8pW5ULxjVwW+JXXDsUjfKYC6a9gmpccKqR2kw14Eqk/BEKG/AnWhWUxHBvUhnhh/KCK5Qs5HM7xqjHwx89uSGZ2H+CHDkgVkTsR/avgSMtiirI7jpnq8eMM6QsE8mE28Yow0xVRHzh8VyeyCKeSn5 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68312f10-f2f7-4fee-e721-08d91363df00 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:51.5873 (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: v95UfO/5xky2JcrlbYJUhYgTFIeNwyis63pXONbe6uTCNF4AL6ILW1oE6eLr6mH+If0YqrA8FcU6+c0JI0NbEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_202954_992029_4A63CC56 X-CRM114-Status: GOOD ( 14.86 ) 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: Lucas Stach Normally the reset for the devices inside the power domain is triggered automatically from the PGC in the power-up sequencing, however on i.MX8MM this doesn't work for the GPU power domains. Add support for triggering the reset explicitly during the power up sequencing. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index fdf759a7c865..04ce64326c19 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -108,6 +109,7 @@ struct imx_pgc_domain { struct generic_pm_domain genpd; struct regmap *regmap; struct regulator *regulator; + struct reset_control *reset; struct clk_bulk_data *clks; int num_clks; @@ -163,6 +165,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) goto out_regulator_disable; } + reset_control_assert(domain->reset); + if (domain->bits.pxx) { /* request the domain to power up */ regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, @@ -185,6 +189,11 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) GPC_PGC_CTRL_PCR); } + /* delay for reset to propagate */ + udelay(5); + + reset_control_deassert(domain->reset); + /* request the ADB400 to power up */ if (domain->bits.hskreq) { regmap_update_bits(domain->regmap, GPC_PU_PWRHSK, @@ -540,6 +549,11 @@ static int imx_pgc_domain_probe(struct platform_device *pdev) return dev_err_probe(domain->dev, domain->num_clks, "Failed to get domain's clocks\n"); + domain->reset = devm_reset_control_array_get_optional_exclusive(domain->dev); + if (IS_ERR(domain->reset)) + return dev_err_probe(domain->dev, PTR_ERR(domain->reset), + "Failed to get domain's resets\n"); + pm_runtime_enable(domain->dev); if (domain->bits.map) From patchwork Mon May 10 04:00:42 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: 12246771 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FBD2C433B4 for ; Mon, 10 May 2021 03:35:58 +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 2AF6C613CF for ; Mon, 10 May 2021 03:35:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AF6C613CF 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=3iRF1LlhXSuvFT2H8k6fjbx3f9GgndAg3SbfVa+rcqg=; b=R3kK5W5k+FyBaYMvJDL8IW9dz VPYGwrjVytVAxVA2ThvLh+CwAmU9ywWL5cA2MBucCD0KgBwWbBwyp+6mq987dwbREehsVtJ6hD57v wnzWWbHMfeIvQ4GjyMNUnb07ihOkaWG0J5GDkGzxq4Ct046+C+oiSp7fOCG7zKzKugUneYtRHEloY DxKEKDdGUWzgawIytL7+aaxTXq7B+M79Zzyms8AmKYIJ3mCFbl761Z0/QuJiZ0Nb4QbVlCzympD71 a7LARisp8xu4KnsHeqXIQc2LljsyNwZgb0DbKOadZuqzcN643FAKuGm44bFrTK7ZjndLIzYARyFrg FjfKcrXiA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwfI-00CzC6-Kb; Mon, 10 May 2021 03:33:06 +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 1lfwcO-00CyB6-Bi for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:30:06 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=wjHmCh7i6Cgd6Gv49NPv0qXRM3dK+6grNipLLqomDtw=; b=yF/tfyitDrYlpzwgrxRh4nVoiP 0cGVenSLbx8z2PqALKtXrOHKZuMucyu7W/RCwRHDsiEI0qGGwll/NooIB7ucrWsxzRQ+5wJEOpbxA SX7Fku4EJ34YRX/XPPhJjRIieFaL9+GjuH6E5HJUiprgHPo6Y9r4/etyTpJD/qQ8BCoPVfBCssHWL pqZlOuQi1RTW8SBGOSfck6wSyXqMcS14M5mmYS+wHKwX1RI1B1645owa4YN/vmgsxd2WCsWjhmvHs GaqKlBpl/9+0GYPJTKHVRrmrWj+E8JelNNUVagw/CL4vcr/2oIxogBwlq+2znIk0X3CEXqaaa/DiF ajKM8YbA==; Received: from mail-eopbgr140070.outbound.protection.outlook.com ([40.107.14.70] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcL-008Eon-P4 for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:30:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JpbP5GrOmNg1TB0alAoydq1MQbr0zuCBTw9th+eOU/s2/o++t2KGhleBWWCGDiQkF5qMV/vjo2nHrgsb9HLJ+rvb27ZFiVO+xbeN1b0B23dsQpiB7+lxKdxk71tq1BJfMl+pWGBSm/t0rRf+0nK0dbsB3XT5ZBs8medm2gtS+IUhNJXOKxMJZ3DKjUODejk3Scpt22sHKN2IbTn/Jcnfjc6HF/86uhRTBfEfHFcZy3LiLhzgFN2S8ebUXhRnd+Wt01sCCyO//SyL3srt6nAAex8AjNaOyUIsqtXckWOKGK3gm712D+cj4vwPMhN17W/TYkZ359ETh4V6A4SMndo9ng== 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=wjHmCh7i6Cgd6Gv49NPv0qXRM3dK+6grNipLLqomDtw=; b=jbr8qMd4wYXS2+C7/1lCANgtkCsUhQsBsCkRO7+/O8kLw3QysoCiHWmboI1nMGCR6ZIGgmvfpAc8dpJGMR8YU/AUk6qWFHJOzqa6P23pQa/WEkO4x+d3VemwwcTlNYARLZ9DJWZDzrAYmuY/mdTqV+Xdnrqgj73yhOzet9moqP9xwUxZU3nlVWKGlTiNJlQ/79BS1zC27+PnI4z3ygaVrLs4wHjEi/0WHdQwJZAqqesHD03rcIu7ZoCTEzuMhI0HSLVsATg8JBDLGKfCeaLe4G18MDftAyDctRZn30MxaXnZVeqwhME92nsW5B/tMSuvzEgOo796twOV63d/Ufgm5Q== 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=wjHmCh7i6Cgd6Gv49NPv0qXRM3dK+6grNipLLqomDtw=; b=B/LPKfw9IWxOoGSn3REyNSsa3XURuHdakDA98pwE7ZZ94653o4RqcQ8t0n9wLdZa+smiSKPqX9V8FKQEgsSY3xTVijkWjdxwIApB0bF3cptWOvx2YHCGLQ10GEOFp6BmFiYoaHcx0kHpLyPh+Zkea79Xz/3/iYYSVu4yXRERHyI= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:29:57 +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.4108.031; Mon, 10 May 2021 03:29:57 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Rob Herring , Peng Fan Subject: [PATCH V3 10/13] dt-bindings: power: add defines for i.MX8MM power domains Date: Mon, 10 May 2021 12:00:42 +0800 Message-Id: <20210510040045.13225-11-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 56523bc6-92ff-47c9-7775-08d91363e2b8 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:497; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R9PRsXDnDWwXx6DxVjS1Uv+nwtpI8LHIYC+PQAC4z6FVgHaPvWTQ91qMjtgf3SoUu4VpuhPcQR9JxxYo5AkUp1UgVXmJilFbAz78qmZXZ3C0at5BZZ4LePJeUdNtvD3vV4pFx7wh0w9WPydxZlQRMVbvtQ2ptWq3VJoWt1PxVdBoYoUGCvTRqhPZb7uittaVBcRPpFpDIdIbrh0sjAXuVdiiY/5K9w1WftWsoPyjpdsUdamOKH9pXfGJoaxWxRTW7dovVfPqmI9uq5K8YuoxtDAnQSdCr7CyttT8ZAXhixmqfLu10+E8ix1NY33LP97ek3qJEfvSVjsQWXOPZLETZozewqFd72H2fE4HU4+25Qugo0qFN8TU75l6oiKSqFmnr1P6owSZNB0tX8TQfTzWaie2cd/KpkX5XTIXxUpLoeLAUJrOXuD65+HyiaEIgbsK2zr8X0Bg3tGR7RTaEvmYT1OFbmWI2V0dQNUAX3zfXiKwFThK7GddTgMXD1L3YogxE6gZhkCBZyRGjlWmaaZaWariaHhi9EcgU4995Q1yOezo9tyvcm5xQPsez0WS2dXJu38TLU+uyqBouweIbMUdUiuAX3a7hBXIjlEbYa62SevfltODaPOGP5ZM5nABYFGIRHPQsYy7K0Tt1ChYKf5Nltgi0I8BfIv6KEtyzBD/Su4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(54906003)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EjMK8CkV5yIQOluki+B34CMaSYYKbutk2Y6V/CC+90eGgjwa56MlrQsOToXNePcUkqW2eEX07yvXo4XaDVWQVpEn6hMICoHNE5DETnpz87JoUYkiMt9xJS4QfDOascN9f108ExknQSmem3pZ7r9S1G1K1HzsvwvS3BUxVuhwvxeRj8I1GvHBf6w4mebvmzB3o1rKtXkmuT+x5VcwzSho0O5zjHT5JFQrl+xh/hP/T6rCNqUgRpjSoHzcO9buWA/DSO7nNrMXBvqTzdu5Wn23026ezsT6U4PMumBTmkJj+Bk8/eOUKkPsdBRFNVsIw0sFLdFpc5Y2E7Cmr96fLl7o1u9PFFZlCKGLx5pUn1ovCvtabJRCgmw/y2PQDPlJElzbCwZpwZAnMm/RlFjQ31iNBztAO1hA1YbsfwwIcVYYqjtS39KnKlKeENTzXrLjxXKSOfvLP6XROt6bUnDhA6tOCG1vdsxJoJzdQferV3GrAmUW4jplY2NyMsFO7g5XvsEBeAkCEnaCKMUQFSsKu4ErE2e4mbWlmrqqVY88Q/9JWsrU3nX0OlWoHKMMU/c/t7o/V+aE0RILyd9yJWh15/z3oLvLiQv3/O0xQBcsN4vR39Bkfavm2on9y16/XBgOi6S1+zPYf2l2lMknWCE9vg/hEFS5KSZT4i4ZzJMDGzmWvwRv1s/RtYViF31Qf4gY7T1R9F7YVKhWQubypX4jfW3/mTqkEGoHnVtTMoOZwO1is2pmB6Ag0SW7fa0p9f3mIbRZ23EPHPrU8ogQIyg8ywiy2jdkbmZlviRCLWTBtVTfIqdmP6BGwsu1yPS9yya7xj6Cgutplvv5ftKVQAzyZCOTg5Y65nxt6uMFQv9GVLoSbGU61zVu+XFgMJlWrkOzuyD0jhMFcfdiQINqCGtpoJ67gHBIbfrf09+WdsrT1bJpnoUwO+ws4FSL5q00C1IA5injwXxLvocUfhwRQZosRdIICSHw2kz8fhPOXlLbaIpMoSTkYdV/fceuYEY0DIrv8pH2DWnLF/Y/WFMQR/4GPxPRPhuDgapQhKE3pNsRPHVCBtopvI92CDdY4XtcHjfJ8exdOwLFqHWjgNgVqhLh6iXKnxDoZTqdhoSqeKboGusU7IlZWUtuhYLD61Xbktn+mXHELlwHOpMhp4xorluprPVBGxD4APDT1zt2wHio/RxdAiU2KrbA0RO0itHHVC5kr97SAEzTwOymlSGTFLEXFvzyeUA74N/KaR+DteqHjwETTUdC+q6YNIwpcK5vV0AoOSR1g6uJOQH9EP1Tj7Gmz5dTA+InJSqWhPWSe133AZYK7aB95FlVoR3WMnnOwHXEklJ7 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56523bc6-92ff-47c9-7775-08d91363e2b8 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:29:57.8224 (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: bdG9BHMw9EZs7sp3tZ9W+lRNy4STp2OTndJldjpfnyAtvyqXBDeGoU43qLJrdyzuV6y6P5P0NWOSdLDtDNCADA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_203001_842366_59D4B457 X-CRM114-Status: GOOD ( 12.14 ) 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: Lucas Stach Adding defines for i.MX8MM GPC power domains. Tested-by: Frieder Schrempf Acked-by: Rob Herring Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- .../bindings/power/fsl,imx-gpcv2.yaml | 2 ++ include/dt-bindings/power/imx8mm-power.h | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 include/dt-bindings/power/imx8mm-power.h diff --git a/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml b/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml index eb248f24dce6..87b6318bf2b9 100644 --- a/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml +++ b/Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml @@ -26,6 +26,7 @@ properties: enum: - fsl,imx7d-gpc - fsl,imx8mq-gpc + - fsl,imx8mm-gpc reg: maxItems: 1 @@ -54,6 +55,7 @@ properties: Power domain index. Valid values are defined in include/dt-bindings/power/imx7-power.h for fsl,imx7d-gpc and include/dt-bindings/power/imx8m-power.h for fsl,imx8mq-gpc + include/dt-bindings/power/imx8mm-power.h for fsl,imx8mm-gpc maxItems: 1 clocks: diff --git a/include/dt-bindings/power/imx8mm-power.h b/include/dt-bindings/power/imx8mm-power.h new file mode 100644 index 000000000000..fc9c2e16aadc --- /dev/null +++ b/include/dt-bindings/power/imx8mm-power.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ +/* + * Copyright (C) 2020 Pengutronix, Lucas Stach + */ + +#ifndef __DT_BINDINGS_IMX8MM_POWER_H__ +#define __DT_BINDINGS_IMX8MM_POWER_H__ + +#define IMX8MM_POWER_DOMAIN_HSIOMIX 0 +#define IMX8MM_POWER_DOMAIN_PCIE 1 +#define IMX8MM_POWER_DOMAIN_OTG1 2 +#define IMX8MM_POWER_DOMAIN_OTG2 3 +#define IMX8MM_POWER_DOMAIN_GPUMIX 4 +#define IMX8MM_POWER_DOMAIN_GPU 5 +#define IMX8MM_POWER_DOMAIN_VPUMIX 6 +#define IMX8MM_POWER_DOMAIN_VPUG1 7 +#define IMX8MM_POWER_DOMAIN_VPUG2 8 +#define IMX8MM_POWER_DOMAIN_VPUH1 9 +#define IMX8MM_POWER_DOMAIN_DISPMIX 10 +#define IMX8MM_POWER_DOMAIN_MIPI 11 + +#endif From patchwork Mon May 10 04:00:43 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: 12246773 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFBB3C433ED for ; Mon, 10 May 2021 03:36:48 +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 5444D61078 for ; Mon, 10 May 2021 03:36:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5444D61078 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=ATxZyYwzb49WtB63/QxwBTd+C2Ak4iShoi/njfYFlJM=; b=pcUDCAHc22PQMnJ+KEJh1Qa6A cEFPcT/9w28putTlpwIeNyx7UWWHZLJnHpwBaCSKSEPBOyHAIx3kKCbXmygDETGUrIyxfRI7rHeI4 gzDm/VMntJbvi3R8z/hD8QtgyRn6Epr0yc+mFUdW/mJ+ydciVB5pJ6Ku6gGShuggHQPtTAwoSgp5V M2ezschZro7HhI/0Yv29JB455XPisp9pODIVRYW4Ydl81MeNiIPTmUp02eWMBd73AQqNV38ZLkJWq T9MOLS2gX1dNA5MWYEAlsH1svBBt/H+IY58o0lkMXaWGQNZVfp4uCPFqnHadDC1TRNu/oWC3kk1Si 9drna+CLQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwgE-00CzOs-Bi; Mon, 10 May 2021 03:34:02 +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 1lfwcV-00CyCb-5Z for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:30:11 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=Me8f/Jm7YEEwlseaDhmwT+CqGHX59R/SHEHuVQyr0Ic=; b=3JlFOI/lh8fENuG3iHnuSJ81TO ovbTYeQKSsUI0Xa5gopHbcI0sgC23dzL04GNIGHS0r5mCAnyxKhx9a1JrYqHF+oVYqNEz/XYHppt7 lZ19aAe2MOXY9mQI5PtIAaclqPgrle/AUWqEhJTQDzDtWJ7B9AY21NMNj9SwHrBmu8Feo0gUyaX/g OAUOZ8oZ5Wa75Xj+7dke+bFHQwpKwDKMHHDJMfE3J6jqr1tkXmol7lmXVV/VaVcQXCOuGMjxO6F0d rVHjm+E7aSE5jBji0jWviINOAM2ZpfzRCv2UHch14jwVl3xytemYM/LeptrCHSEIw3afpShARd3MS pRwHBxPQ==; Received: from mail-eopbgr40086.outbound.protection.outlook.com ([40.107.4.86] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcS-008EpJ-3z for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:30:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtvDfkkVWWXJXdRVQIXhOqvyHMGzHFClKMd8mC5W/6G6qto/oTR9kY/+OeJ2bw2AcffX8KziEnB1IPWZsGre+3MU4n/NHfwv0dY1o0sp8ae/NOa0HbvkqSbcrgLQ/+ec4f3/zh/N3DI0XBXueJRRhP42J/4JJ/gq7OPedZmoE4YygyIETk1NB/6PC8Xibm/AA46OymsJ/UKfTVHelwi766WDnGs0Dogn/NWHWcVUQ7dHYl7a0hiUsgCwqhEEuYskCH/LWqh7Tx/qLGbcTrlYMnYQzBG1DMiBhGlIIH0P3V8MBX1FsxjtOS9WFDSiYFZcN6InxyP2i1mDyt3c5ykMLQ== 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=Me8f/Jm7YEEwlseaDhmwT+CqGHX59R/SHEHuVQyr0Ic=; b=OYAFCyvXzO0FmOY+iiuOCqztXV8wanDdNRDr/pl0kES/NeKzK+0y9HITicSKgdGDX1rZqQkqbvNWDD04Uuv+w7vtnTzm44GMq56W/rb2r4NxeyfhjfhDQH0CW/vgTEhY51FC9KZ5IfTq2hqY+Mkec0y2tEVuVw8ZIejcahljg7rKTfhQS6GOdjEuZYSjRWra0mSMfNCkVNy7+w0NgR3i/O6q8gqL9dmz5uyTPV/J/uz8zU7/uLUDojRHML5+G+f5NLk6D8MtbhWoeliOQQlX0RsbA0wpn7BEls0b+116xXqUb0SfithvS1ytYMFc8/qv4VB1MibLwQRT5faIweJJvA== 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=Me8f/Jm7YEEwlseaDhmwT+CqGHX59R/SHEHuVQyr0Ic=; b=XcBW/6rsbC40I7ijCzsAPhtNsAie7e4svdMgPB8CX/5N5egIfBLIR62LQbLdYQ6r7nlVGbKVYZf03B0q2o6kPnRoMEHO0CfY+ws1wbBFpfZylt4dcK576eg/S/jwh5ZvrqrWU2Yyo+Yl6pmsFGXBSMSKU37BTGmwT5POj0p9vyU= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:30:04 +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.4108.031; Mon, 10 May 2021 03:30:03 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 11/13] soc: imx: gpcv2: add support for i.MX8MM power domains Date: Mon, 10 May 2021 12:00:43 +0800 Message-Id: <20210510040045.13225-12-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:29:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: beb4bfd5-9834-4f3b-413e-08d91363e656 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YUhUt8mUZ9u6ZXpbBpXt4j0F+vRkSlF33BuiiNUjJQ2O+ftNCmW0bLwlYQ6OuWr+rLDY7z1Z02ed5L3bCM4dhMldWh8xtiXaAIYrx0GrgR34Q6YUUs0oR79U3Chkeup5/EcP/z3I33nmXg7NBo/1EjODB2v7oLqjCxJ75XRBEnsv1SMVifsWlaOKd7lzn25U+SBrykG7+0gy705DFGvMMhuffW1RRX4vkL8hAygIZof2fHQBYu4M/zsvMivtC5yS98co6hgxyjbvZwuE7sNXt91gCOLOKcjm4yvlG7shg9dFjQDnUi7euNN80Hn5ed+B7K4+3377FWdXork/DResnvducZmg8KCq8TtShqmVcEvjyG2TLE4Nx/svRbR58e+qiuhC+zJFxjlM2/bjvxY4dhZMblPD3zZ+uOsIrgTTOPcDxJ8ompptKfjcZSGuQ2OSWMQOn0RIXjb6D3NIzVKFtUciI4Clc+yzK7Y50QzLnSzH0hm4XCBW1kpfgtyV9I3DirqDH8Us1SmcAdi61tqiiJtSgWMcbnTdft04FzFffuTk7WT72RUY8lHq2KKlmXlsAYZuQB1tfH0tOYV3ULSvYe3B62NGiK9bVo+ASy1YnYQZk6r9faE74LdOgNjlhsJ1gtp1ltbqRRmWiDW73r0IuWtmeka+6OJ+XYhOJ7gaEhM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: klFs4lCfUC/UxQQcn9itPwWfI8yrr+Exq+2D8M2LYgtaqoGnba9yP7nrVLpqG2BXtEPI6c6jx3VchirDQyLXsDBM7Pi/T0+OtANPzQNHdOu5lz0cRfjd9PRFVX9LFykeKHcp3HW4E5nc+qNwG5AseGM6FmYOBZVN+8i3HMj/m4X9jPoOmsHBWqCWvdMjYX73rtoAMKBJtIzKazv2H1oSG2DKZKbpBp+uhkez9NwR5d+V6SIU792i3UkX3778IQizoqNiKNlqRJugnuZW6gip8BywmJdYq7g05xfq+o+YR/5G3VmC09aszKN8cnuO6+fgTeP/U/0AMepuuSDkxGw2Fgq608ozitJOhXPghkdR5T3p90Ru9Y1JhYbJc72YDlZkcr95F80v9O6cy8nf4IkLnKIsvAVC0N4QGRR0TNjLuaE+qhVopB4wkaN+smlGG7+Ez5ha+lPN3OBcihyp85L+A7o7oIICvoW5xA2P1f6A7m3F8qZiSjZdoklW0s4+3ceKITmeh9oiKO0VhVPurgpD3Tuk0beIWbmiEmq/3kQpFypLXqGhpW70cmLLXJU8/WVn7GVixa7qoOCeFF4xM7SOfcwzVLB9J3E6gtYIMwm+qOYa7mQxUy7wEQi5ohK6yTSJ/UWPkHZOkM9XMKuLupPOgqSX6GKMtGXJ7/RChPxwJMFLBWbGkkhP5l8V3ofGGi1cxWos7r9dRQ5jHnDif8nBsPvkBtQl2eNO9Zapfdpevd2QzVL14elqU+PHWHbysi9JIySfz4UrV5wxxpoflNDyre5Lz9p3piyqXiBGemTi8HVEL9NyI2G2xi6vrVr+6s26OCFTM2kcNdqhCh/wVVqIfHdGLXVmZDwY9PhHbv+h+qkJU+huyREVPfFEkVKUiPQChv9cBR2UO4RxkI5X9/+JCXlUzXXR6/CDvF8Ou0wiK7t2RslKWQ+FkNyW6XJFh8aBc2dLpIJmIaW6y7eImtrfzWQ/htCOPHiBAZA7cFcm0jGwczmL0LxKCqKXw4QjRryYbOhElK5u4m2TorV5oikWzKe0ranLQSAvv91F3sClyhUSW0Wnn5bHn+v72qLGlmYSCmSsqqU/jC9M8bVJ6tMaUli1YWBpf6UaSBoznvG1LhtcLcDyyyW7db49xZddACbfy12ET5jHbLLx13dzzVEKuBOb2otq9OgQgdqWm2VxB0saKYRCfTBjZ/DP5do3atXWITamJ1ZV1JYBD29CgIEzz27+U04zf8fRFFFIK86qTGdpFpO1XB1Zlz8MKryGECOxNrZdQQLVXUyW/cYTPqyKz4d7Qc1l2lJ6u87IRIpJgIOM5FM+jj9VZzgOPe9RpuhR X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: beb4bfd5-9834-4f3b-413e-08d91363e656 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:30:03.8967 (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: FTlcQwoeCvOl/Z6i1ewLzGI91JSz63XkcOoXfdkKicPJaDIpIT6mQSYo0C+9YRetoar/JnfOWKv4A0jNmgOc0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_203008_322134_5AF2085C X-CRM114-Status: GOOD ( 13.57 ) 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: Lucas Stach This adds support for the power domains found on i.MX8MM. The 2D and 3D GPU domains are abstracted as a single domain in the driver, as they can't be powered up/down individually due to a shared reset. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 168 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 04ce64326c19..d676e65e8c16 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -19,6 +19,7 @@ #include #include #include +#include #define GPC_LPCR_A_CORE_BSC 0x000 @@ -44,6 +45,19 @@ #define IMX8M_PCIE1_A53_DOMAIN BIT(3) #define IMX8M_MIPI_A53_DOMAIN BIT(2) +#define IMX8MM_VPUH1_A53_DOMAIN BIT(15) +#define IMX8MM_VPUG2_A53_DOMAIN BIT(14) +#define IMX8MM_VPUG1_A53_DOMAIN BIT(13) +#define IMX8MM_DISPMIX_A53_DOMAIN BIT(12) +#define IMX8MM_VPUMIX_A53_DOMAIN BIT(10) +#define IMX8MM_GPUMIX_A53_DOMAIN BIT(9) +#define IMX8MM_GPU_A53_DOMAIN (BIT(8) | BIT(11)) +#define IMX8MM_DDR1_A53_DOMAIN BIT(7) +#define IMX8MM_OTG2_A53_DOMAIN BIT(5) +#define IMX8MM_OTG1_A53_DOMAIN BIT(4) +#define IMX8MM_PCIE_A53_DOMAIN BIT(3) +#define IMX8MM_MIPI_A53_DOMAIN BIT(2) + #define GPC_PU_PGC_SW_PUP_REQ 0x0f8 #define GPC_PU_PGC_SW_PDN_REQ 0x104 @@ -67,6 +81,19 @@ #define IMX8M_PCIE1_SW_Pxx_REQ BIT(1) #define IMX8M_MIPI_SW_Pxx_REQ BIT(0) +#define IMX8MM_VPUH1_SW_Pxx_REQ BIT(13) +#define IMX8MM_VPUG2_SW_Pxx_REQ BIT(12) +#define IMX8MM_VPUG1_SW_Pxx_REQ BIT(11) +#define IMX8MM_DISPMIX_SW_Pxx_REQ BIT(10) +#define IMX8MM_VPUMIX_SW_Pxx_REQ BIT(8) +#define IMX8MM_GPUMIX_SW_Pxx_REQ BIT(7) +#define IMX8MM_GPU_SW_Pxx_REQ (BIT(6) | BIT(9)) +#define IMX8MM_DDR1_SW_Pxx_REQ BIT(5) +#define IMX8MM_OTG2_SW_Pxx_REQ BIT(3) +#define IMX8MM_OTG1_SW_Pxx_REQ BIT(2) +#define IMX8MM_PCIE_SW_Pxx_REQ BIT(1) +#define IMX8MM_MIPI_SW_Pxx_REQ BIT(0) + #define GPC_M4_PU_PDN_FLG 0x1bc #define GPC_PU_PWRHSK 0x1fc @@ -78,6 +105,17 @@ #define IMX8M_VPU_HSK_PWRDNREQN BIT(5) #define IMX8M_DISP_HSK_PWRDNREQN BIT(4) + +#define IMX8MM_GPUMIX_HSK_PWRDNACKN BIT(29) +#define IMX8MM_GPU_HSK_PWRDNACKN (BIT(27) | BIT(28)) +#define IMX8MM_VPUMIX_HSK_PWRDNACKN BIT(26) +#define IMX8MM_DISPMIX_HSK_PWRDNACKN BIT(25) +#define IMX8MM_HSIO_HSK_PWRDNACKN (BIT(23) | BIT(24)) +#define IMX8MM_GPUMIX_HSK_PWRDNREQN BIT(11) +#define IMX8MM_GPU_HSK_PWRDNREQN (BIT(9) | BIT(10)) +#define IMX8MM_VPUMIX_HSK_PWRDNREQN BIT(8) +#define IMX8MM_DISPMIX_HSK_PWRDNREQN BIT(7) +#define IMX8MM_HSIO_HSK_PWRDNREQN (BIT(5) | BIT(6)) /* * The PGC offset values in Reference Manual * (Rev. 1, 01/2018 and the older ones) GPC chapter's @@ -100,6 +138,20 @@ #define IMX8M_PGC_MIPI_CSI2 28 #define IMX8M_PGC_PCIE2 29 +#define IMX8MM_PGC_MIPI 16 +#define IMX8MM_PGC_PCIE 17 +#define IMX8MM_PGC_OTG1 18 +#define IMX8MM_PGC_OTG2 19 +#define IMX8MM_PGC_DDR1 21 +#define IMX8MM_PGC_GPU2D 22 +#define IMX8MM_PGC_GPUMIX 23 +#define IMX8MM_PGC_VPUMIX 24 +#define IMX8MM_PGC_GPU3D 25 +#define IMX8MM_PGC_DISPMIX 26 +#define IMX8MM_PGC_VPUG1 27 +#define IMX8MM_PGC_VPUG2 28 +#define IMX8MM_PGC_VPUH1 29 + #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc) @@ -527,6 +579,121 @@ static const struct imx_pgc_domain_data imx8m_pgc_domain_data = { .reg_access_table = &imx8m_access_table, }; +static const struct imx_pgc_domain imx8mm_pgc_domains[] = { + [IMX8MM_POWER_DOMAIN_HSIOMIX] = { + .genpd = { + .name = "hsiomix", + }, + .bits = { + .pxx = 0, /* no power sequence control */ + .map = 0, /* no power sequence control */ + .hskreq = IMX8MM_HSIO_HSK_PWRDNREQN, + .hskack = IMX8MM_HSIO_HSK_PWRDNACKN, + }, + }, + + [IMX8MM_POWER_DOMAIN_PCIE] = { + .genpd = { + .name = "pcie", + }, + .bits = { + .pxx = IMX8MM_PCIE_SW_Pxx_REQ, + .map = IMX8MM_PCIE_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_PCIE, + }, + + [IMX8MM_POWER_DOMAIN_OTG1] = { + .genpd = { + .name = "usb-otg1", + }, + .bits = { + .pxx = IMX8MM_OTG1_SW_Pxx_REQ, + .map = IMX8MM_OTG1_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_OTG1, + }, + + [IMX8MM_POWER_DOMAIN_OTG2] = { + .genpd = { + .name = "usb-otg2", + }, + .bits = { + .pxx = IMX8MM_OTG2_SW_Pxx_REQ, + .map = IMX8MM_OTG2_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_OTG2, + }, + + [IMX8MM_POWER_DOMAIN_GPUMIX] = { + .genpd = { + .name = "gpumix", + }, + .bits = { + .pxx = IMX8MM_GPUMIX_SW_Pxx_REQ, + .map = IMX8MM_GPUMIX_A53_DOMAIN, + .hskreq = IMX8MM_GPUMIX_HSK_PWRDNREQN, + .hskack = IMX8MM_GPUMIX_HSK_PWRDNACKN, + }, + .pgc = IMX8MM_PGC_GPUMIX, + }, + + [IMX8MM_POWER_DOMAIN_GPU] = { + .genpd = { + .name = "gpu", + }, + .bits = { + .pxx = IMX8MM_GPU_SW_Pxx_REQ, + .map = IMX8MM_GPU_A53_DOMAIN, + .hskreq = IMX8MM_GPU_HSK_PWRDNREQN, + .hskack = IMX8MM_GPU_HSK_PWRDNACKN, + }, + .pgc = IMX8MM_PGC_GPU2D, + }, +}; + +static const struct regmap_range imx8mm_yes_ranges[] = { + regmap_reg_range(GPC_LPCR_A_CORE_BSC, + GPC_PU_PWRHSK), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_MIPI), + GPC_PGC_SR(IMX8MM_PGC_MIPI)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_PCIE), + GPC_PGC_SR(IMX8MM_PGC_PCIE)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_OTG1), + GPC_PGC_SR(IMX8MM_PGC_OTG1)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_OTG2), + GPC_PGC_SR(IMX8MM_PGC_OTG2)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_DDR1), + GPC_PGC_SR(IMX8MM_PGC_DDR1)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPU2D), + GPC_PGC_SR(IMX8MM_PGC_GPU2D)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPUMIX), + GPC_PGC_SR(IMX8MM_PGC_GPUMIX)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUMIX), + GPC_PGC_SR(IMX8MM_PGC_VPUMIX)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPU3D), + GPC_PGC_SR(IMX8MM_PGC_GPU3D)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_DISPMIX), + GPC_PGC_SR(IMX8MM_PGC_DISPMIX)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUG1), + GPC_PGC_SR(IMX8MM_PGC_VPUG1)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUG2), + GPC_PGC_SR(IMX8MM_PGC_VPUG2)), + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUH1), + GPC_PGC_SR(IMX8MM_PGC_VPUH1)), +}; + +static const struct regmap_access_table imx8mm_access_table = { + .yes_ranges = imx8mm_yes_ranges, + .n_yes_ranges = ARRAY_SIZE(imx8mm_yes_ranges), +}; + +static const struct imx_pgc_domain_data imx8mm_pgc_domain_data = { + .domains = imx8mm_pgc_domains, + .domains_num = ARRAY_SIZE(imx8mm_pgc_domains), + .reg_access_table = &imx8mm_access_table, +}; + static int imx_pgc_domain_probe(struct platform_device *pdev) { struct imx_pgc_domain *domain = pdev->dev.platform_data; @@ -710,6 +877,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev) static const struct of_device_id imx_gpcv2_dt_ids[] = { { .compatible = "fsl,imx7d-gpc", .data = &imx7_pgc_domain_data, }, + { .compatible = "fsl,imx8mm-gpc", .data = &imx8mm_pgc_domain_data, }, { .compatible = "fsl,imx8mq-gpc", .data = &imx8m_pgc_domain_data, }, { } }; From patchwork Mon May 10 04:00:44 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: 12246775 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=-17.4 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,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D4ECC433B4 for ; Mon, 10 May 2021 03:37:24 +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 9DE3E61409 for ; Mon, 10 May 2021 03:37:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DE3E61409 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=Z7DsbvzGDxdfVtMbKypk+O60+Ncz0RXcdTrOUV3cclc=; b=X2UX9uZi4XP4/AtbQI044NvkM g5h5QDD2x2MuY67lHOUfvmWqnA9yONrITLvwC5S7KaOYQqKW9NkTO2bYS3+MdDkphIVp8av+D2lSX 9tNANp2xYRujft5yjXpioOCNtA5ooig/W3RZHVVhkm48lcFdHHPuT6ZdICIYY66etokdhG7ZtCPI/ zse47mLCLyeNM/hFpW2aUkMXSjGl9Ae3Ff4aD4ZWKp9OzCE6zxvhrd8XuHG7ShKLE+8QuBmpp9Pyz d+Q+X4gc8lIOi7TwGws+UPp1D3r9qWTE5IATVgrRCoiotmhaDuLfOSTm96M/NnnvwsXqSpU37JDbR lj/7ZfisQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwgr-00CzbH-Hz; Mon, 10 May 2021 03:34:42 +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 1lfwca-00CyDx-T9 for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:30:18 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=Gq+LJJeqZCNia778mjaNfmB17XwG8aX6tv846PU3g5Y=; b=Mb2Ypfi7T7OAtLNOoE3ErKSKS6 r4stlEMTwWFwFyfF/bhf9xocvk7g9xNS4NNxl28ZDeEM6NkSUsYCuCrTccrC550LF4UaCx5n3kpFA xvbSjYb9l2AkL26s/w4qPHwumRIwOQU51F4Oq9iM0O4gVqp0Ehtg7R8i9hEIIBeUmHW6zLm7Mx1HJ uX6L2rSKfyEvi9Hv0gqtzptVEL3UB6FViIhB7K4NPRsWJzZmU7yv2U4Y3jG1nBdeW0MQU5Rz85MxQ Z0qkd9JusWwziirnL82FBtkKdQw3cY9JdJW9KxAPUzouLYFGpR5aQJ6Wr7PoTfu3eUHJVBjC3+2SF jGCH9Hyw==; Received: from mail-eopbgr140051.outbound.protection.outlook.com ([40.107.14.51] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwcY-008Eph-C1 for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:30:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ajfw8LRv1DgzG8HL5XfSfUFLfPkC9T4zw6R4OM0cQlkTTEc7nMzLh1BhV4db1we7ou8thsLe+zsfo15k+ILjQOGgt58zSdcMOtGChTdzSgvbV/TXUOdIlwA39iD4xr+D0xiAPvXeAmVkKyJ1UN3D7HVFKeYhmjqziHyMAkil6l15qrOrqQ1auMF7GSvhJ+U/dkh/FiutnfYqzPXqYCSHgsg+O62vtRrJPwDooARnS380rJWEBY5XRv4j+GeTNTCuMxjRQhlrBwhQ+3AmE/1dG6Yc++YfQRrhMtFRGUtd/q+lg/PUNcV7n2sFz9vs719ubjtOUnyhdMjnaARzhjZVeA== 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=Gq+LJJeqZCNia778mjaNfmB17XwG8aX6tv846PU3g5Y=; b=THm9TWGXY9JNu9D2BYj2cuSA2JvjfDRDXa1blbxv6s1gorwOVQiqAy1DMUZ32rBZI3IA9/1KP7hTfjajof7XR994/W/9HbTKa6451JYay2bsgyDCSr/Nrda8zKRnm48Ry3GugBjoj20OHsICSAvEq3I3sWnf4oM2XMB8rb18x0caeniKimuc3nspT63okBBTZdmMNZD/Es+RuEX7U422REW1YFeLXhJCc81rTZcb39IzAovNoipeUHIOScKMMiKQP43aypXY93pa+eJ5Z2VpEcbNG/SB0lrDUaYot/bruyZxRVn55HekO/4XbeiLe1a74xUGiURJTACJWqohRJfqqw== 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=Gq+LJJeqZCNia778mjaNfmB17XwG8aX6tv846PU3g5Y=; b=KJpU0P9i3ObbrHbvGnA6IShC6UpHgEsposLLWB6D/yRgW7392XFC8qvNAJvWm99iL05IKMarMlcb/OCCeqyBX49ZQ7aJocyj1RdKVHsWm6es9uAJ+IoGAOWW/aNLKZKA0hk6jPjilGpf2U1Rx/1bzL65jUI73itT6eEcb+9V8Zo= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:30:10 +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.4108.031; Mon, 10 May 2021 03:30:10 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 12/13] soc: imx: gpcv2: Add support for missing i.MX8MM VPU/DISPMIX power domains Date: Mon, 10 May 2021 12:00:44 +0800 Message-Id: <20210510040045.13225-13-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:30:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b453e98d-94ec-48aa-db20-08d91363e9f7 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ju/WA30F45KgGu+L3fKVqcOy0VkSCFDyKuV7U4PXaHg9Rh39hclDtzpe5cKaqGG5jrJrl9xBjyGMuVFvBNR8/CZUa+4qHhfK5oX9fs/ni6glMHq7eaC7ZamhxHe9ucJnOltbIGlMtRVMZgkPrbqTOQTJZY5Q44UjdgCrey6yUGAiQedW5HsbV5HyflFm2gYrFQBYV3ie44kyEiKw2kSCd0OW4wGktuRpbyRXL5jd75sxXvqijgCUIhqxfgxMUh/Acscb8Sl032M+QCMfc2Px6hCUTFCFSqu4HEQUSMkuqvogqk7d8G1pAWd1RknuKlG6TCIzmbjHnlbsfnGptRQpnZqwnfEyxOGcMrGwnI6Phw2VnqUCkqtOWTWP5TLaQSIXKAPZiQ7pNYkCjEtouO/nky60c4LUTuBymwf8Htfptz1nDDEuZ46Mhp2HjNyHloMZmjMM00i6js4CCFihM5dDgBmZG8F46f9ptNmDsaZS62N2IDI2801HnGXoAcEClzzZMqoETG8/NttZ1yUtx7pFzffdW+Sc5CQjkBVQ9vev0gQRirfqAmChhfcCnnKTNksjlUV0grUdRri7sKWBdyuXsvGLqB6SDWFemZn4x3o2j+2iajQYtWP/ptKVucKFLRKqywH83n/ycMD45dAUZVwUkxPD9JCdZ2C4hGFqG3PGRBY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wHbOXDlvJkFwL3S664SAKI4QPx38mhpXFhHWQgnZp3MMcUCPgZ/qrYll2S5mDkLhqXNzspkAOoc3vkWyXr8L/9TXnWGI//LKhNS74PZIP++Ul0F28PEbNYykf1aKUs3ua0e70y8Kxd7yTPlRsoWSgVFNTnnF7S5kGKT2IC4CooOpT6rzVNoE6LVHJGGi5Mz9unj+rizjFrbJg+U4h/utwt9fwfwxa3XJIompZH3s0+ql0YOcPnD2w2j8IEmeMGL0+RUCm3AhkSAl5qZOv/+vl8VpJgAbrqP3iatbkLTRvNb53T8Mqw1zEuwn9fGQg4m1eu/DzqKtFFH9WAjXWWF0qUBjXqR8DmyUShlgwEeOJZQOrfXcI/og4NA+t/miFTdH0miaXDcKh+VSc1IAvrbfQYVmTETM9rTi71v2jiWjEduZL2tcm3sRSaRaTvpAkWGCqD3VOXfUWpqC8QvUs0B+3XvSFqkV1AguQTdQGwf8rCeHee6CCdSbxWMXSm9gqqNY4R2zM/N7i8DZDI1Vl3X/Ggk8rk4C2wgTpP7pUF8JnsBcQrJsgCef2rPKRM+yfxcFnhpAaYVm1sL92OVwqqBwS+lona0PYKFG3hTVw2K6ZsfKgPyMqDnYmxSy0tpf1O8XoR9KNWPNa3t+uDpPJysfutkaugmqa/5+YzWv++WYt9ir/vHMNuYBXBKrw6fmfsO6YgrTFPqLsTItHIJ2h6MrUZLoIs/2qdSlGtLVFsYZbBqcbbf19x8YPrjhbeJ5HFN2voX06dkL6Jt2JQZXzVBkDVsAOSdPm+iIjqjSi3MUk0DojxqcLKe6OyYmmLRQpby3AQIMzcnw+n+KABlz6MEwvLxQpdpiyoZEq95OLfDiu2yivVcdV3YgNcpgcghdHc6dCxtd+bXU4vvumAztE5AmhORRzXXhdcK1/ZiX7H8sp/+zIBj9BXNoFkDWInfwg4vufvdYNPVuxHSJYnHUhmyYS/dj45GXGS3R+g1yCy42Fq9vLQJh0SqyNRn1pfEj7s+xHCVhZODNgIUO4hyriyBDM4W6JGxabcI6ecnzVxiomsv7Wqz1LdBQT3KeW8sqtltiAtlCZ2R4awezWqqlEG5RgjMSlEy1LYLLvK4M4CvV1weTO4dfoGqZc+MYpejhHRLgrMs2mYVNRrwRYgNx4YvyeymZ8NtyPVtBkB4FTJLh4YpJxY+YQ+fWnZGcOoj2XJGkUIR4+aZY9v6+stjgdoG0JfNpCLlUyYSILBqT+soYZhzWIAu67mtFfeUdqokItwBZr7/ilYUfDlDdWmLPKfPEGhJgafr75ssEHqRcTP8E+hy/NYpvOrPRbb9XUI4dJjLD X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b453e98d-94ec-48aa-db20-08d91363e9f7 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:30:09.9579 (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: kw+pbaFDQ9742VJlVaxjoR8xn4oogyfhKO5KsIlz4EzGHSA+p6W9boii+T56vFikN0XsGfDLuDJ2u8a+7kInpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_203014_434410_55CC2D38 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. 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: Lucas Stach With the BLK-CTL driver now in place, let's add the missing domains. Tested-by: Frieder Schrempf Signed-off-by: Lucas Stach Signed-off-by: Frieder Schrempf Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 70 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index d676e65e8c16..2490757f759d 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -650,6 +650,76 @@ static const struct imx_pgc_domain imx8mm_pgc_domains[] = { }, .pgc = IMX8MM_PGC_GPU2D, }, + + [IMX8MM_POWER_DOMAIN_VPUMIX] = { + .genpd = { + .name = "vpumix", + }, + .bits = { + .pxx = IMX8MM_VPUMIX_SW_Pxx_REQ, + .map = IMX8MM_VPUMIX_A53_DOMAIN, + .hskreq = IMX8MM_VPUMIX_HSK_PWRDNREQN, + .hskack = IMX8MM_VPUMIX_HSK_PWRDNACKN, + }, + .pgc = IMX8MM_PGC_VPUMIX, + }, + + [IMX8MM_POWER_DOMAIN_VPUG1] = { + .genpd = { + .name = "vpu-g1", + }, + .bits = { + .pxx = IMX8MM_VPUG1_SW_Pxx_REQ, + .map = IMX8MM_VPUG1_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_VPUG1, + }, + + [IMX8MM_POWER_DOMAIN_VPUG2] = { + .genpd = { + .name = "vpu-g2", + }, + .bits = { + .pxx = IMX8MM_VPUG2_SW_Pxx_REQ, + .map = IMX8MM_VPUG2_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_VPUG2, + }, + + [IMX8MM_POWER_DOMAIN_VPUH1] = { + .genpd = { + .name = "vpu-h1", + }, + .bits = { + .pxx = IMX8MM_VPUH1_SW_Pxx_REQ, + .map = IMX8MM_VPUH1_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_VPUH1, + }, + + [IMX8MM_POWER_DOMAIN_DISPMIX] = { + .genpd = { + .name = "dispmix", + }, + .bits = { + .pxx = IMX8MM_DISPMIX_SW_Pxx_REQ, + .map = IMX8MM_DISPMIX_A53_DOMAIN, + .hskreq = IMX8MM_DISPMIX_HSK_PWRDNREQN, + .hskack = IMX8MM_DISPMIX_HSK_PWRDNACKN, + }, + .pgc = IMX8MM_PGC_DISPMIX, + }, + + [IMX8MM_POWER_DOMAIN_MIPI] = { + .genpd = { + .name = "mipi", + }, + .bits = { + .pxx = IMX8MM_MIPI_SW_Pxx_REQ, + .map = IMX8MM_MIPI_A53_DOMAIN, + }, + .pgc = IMX8MM_PGC_MIPI, + }, }; static const struct regmap_range imx8mm_yes_ranges[] = { From patchwork Mon May 10 04:00:45 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: 12246779 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=-17.4 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,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 2FF69C433B4 for ; Mon, 10 May 2021 03:38:03 +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 AEC9A6109F for ; Mon, 10 May 2021 03:38:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEC9A6109F 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=noxRiZYZ9F4kp5dZ4Bp2MN6DiIQ+Hz+oeicCc5S4w4Q=; b=e6PGc+pRntTMOxHe3ERcrsI0o IbWmCszEfSZ+bq9LKSUr6sLhZ46MdM7FY36uYh7LjphaWhnAxEkBH9D/WzNE82ibR/zlvVJen2JXH uZv27ZdxAT7rd07EHlr//LnZEzxZa1MZu8GU2ysuYjPn6U4qSFY5V1CcYZt3rZ0bZbW+WN7jgauek JWcJKr5xq2XpFbH8Oe1+Jfp1agHE31U1Kh5K9RnbE5B0HCzwFY1AqaLbe3gVSzFQ90foDgixLKgH4 T/ksVPwghUQfyXrxTDoEx7DgISGwG8TKUVWgX7ak8PQulAhxs0bTj98hkugofoNilMTGUGj8CT377 t1ABPuppA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfwhQ-00Czl3-8v; Mon, 10 May 2021 03:35:21 +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 1lfwcg-00CyG6-Oj for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 03:30:23 +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: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=Q9CnNtvb9vIm+pedslTBJfFuW0h8T99Um/krzsU0U/k=; b=khcZDiKH6Q0hlsL9Y2HgE/PBZQ vO+IOqVlFpqQzuZFmmNtAVlexj2mzuptQhKF7Ign7cg3pxUQzgkyJC6dAv4PIKtaEp4Z7q26dbIWX c1c26ZZ+l4v4CLJSxGYDJpiDKU2zN10g3o0jMx2UVZ/idvNhs/pBg45dDMw6SCjq9RyEFdcy/7XpZ lGcqoLvkTYbtZlwooYTcqYRsbKnrUcbqThk81SVKTP4XucaT99Vh1LTiT/DY9gku1vhq31107uS+Q pK9SCCjvVadu+ETdCgt42FN+Ck7mNJf/I3S9v0f7fwIMx3dqhfZxPrHp9G0V+bKOvjkIq9QWKrQFf ScFbT6mA==; Received: from mail-eopbgr140083.outbound.protection.outlook.com ([40.107.14.83] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfwce-008Eqe-8H for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 03:30:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UGUYhk+/nzXgUJSufgIs8R5/9ieHifG+7LmqrggPk86CHx5aGhFsJqVXmUWRhV7pTAP3aLzNtggEYS+DPRYw92OWKFMpfCZZmMAmNmVQBl7rXqsDlaMZa3XsHiIuUp5KQvDhf5KWs6o6urs0zpDG1qY+KWIu1zU/ZQA/LImUXx33K0EGvabG9PDPWWs6aa8JDcx2gyUV2xg6N6hCzoJKAKD2588mhlGeo+JJSlYETIeERAFHTZ+6mtgwwiD4dRHNOP5Ybr+kyfFGNMykEoLo95L+N4cBAlkoSRtURUJSgQZ/i5HCuU+dyBEZsaBTtpnpjBt2i0z+D9dz7hYJdpHdhQ== 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=Q9CnNtvb9vIm+pedslTBJfFuW0h8T99Um/krzsU0U/k=; b=bmmyO/k+RtLf7DDwMCF/zIht4Qe7jLn5mc+660FKzb5Z8QuKyyOK/tJlT82MdpgSnUFyIi2Dmx+jp+PIg06f/6WJPabF7fBSM8U5WxGXVTxdecgDFkpGMvM0xqhJ3ptuQHSBh3wKA8qoTkFOAnK0wEEyTsNqVlP2NmhnjlsTB7hV5IjgtmcjhWq4wvhaGYZmZgHIzzjW9fanXrzGLhu1tRK+Q5wmOd+vzw07urvqxYTPL/fkeuL2LqxlfVnuKagvPScPheO0gjEcWdabTXEKAN8UYVgUgQ1DdkypwwhgkziUBmL/3cvieWUz4zoDhqbLvt0i556FoSuFZkO4cNFF4Q== 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=Q9CnNtvb9vIm+pedslTBJfFuW0h8T99Um/krzsU0U/k=; b=Ogsn8zbutOGkYFOB/kY5d5CHQXI8mbd5J5FO3FKGd76KUaezy5hAPzwpt5KfRYWnVzPBoaRepZF1S6cZskAd5d9wvWn0oiDYkmVRtpNRHc37LzzUtzKt0BUz1wD+12UcDh25R1yeEIJt7QPq2keUHvQ58rCDCc+A+iJS8eLsjZ4= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 03:30:16 +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.4108.031; Mon, 10 May 2021 03:30:16 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V3 13/13] soc: imx: gpcv2: move reset assert after requesting domain power up Date: Mon, 10 May 2021 12:00:45 +0800 Message-Id: <20210510040045.13225-14-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210510040045.13225-1-peng.fan@oss.nxp.com> References: <20210510040045.13225-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) 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 SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 03:30:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f8f77be-5368-4011-a131-08d91363ed85 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XjYOaw5NCXt5X1N500HHy9ymuAVn7a+XtQ2nmb34nk/e+/waLGSFDE8Kmjf+pPvbg1vCl+kS8gnwCS3VKE+4nBQGQzhyiUiSOCU/OV4L2+PNYN1fNyOtOU4XaOChK5/1vbcDSSysuvgOJ3JbVwU+ZP4i+dZLnBKDQ5lFK2TUkFKYsqxnu34InlX3jj/nzse/OY4lhgWg87bHb4OVmlzeQulgqKgcEI8DcNxO0jPoVEhUI4sNJbngb6KNrT1eSv3I56YeU+rLGyfDDgQxyP3Xt6RGKf4qQkNsSsUWFEu4T6tAAqtvzUviccKSklyQYjfTTOKPbcW/XTulPWJxEXIoWnyHWdymti1IKifX14gMcv8QhkntAmJ55Ja3NA+Oyo0B5npJYaTlDpMtRuZlR1xR1rEoetg3LHZWLw022IOt/+3nMaqbtN6jSKrdxUn/yE3dflHIIfl/EplkgWHbypqsYYNle/su8z3ew0wM5/knUyjp1oS/+IikcTRu9lgB5cp/VG+5dAOBbCGn4t7HfOF/mCPGW8e3o1boIRMkCI8aNTTyGichGGCmPvpi54CQmPunbfaGaJBJBnVdg0u85KHHGAorNJ60HW3s8kvcSEMQcyR2P1/mY+q0APkuJ22cTqnljveNPGgbhwfnpjUMvww6qA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(316002)(86362001)(478600001)(4326008)(1076003)(2616005)(956004)(5660300002)(16526019)(6666004)(7416002)(66476007)(38100700002)(83380400001)(6506007)(52116002)(26005)(2906002)(38350700002)(6512007)(6486002)(66556008)(8936002)(186003)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: i01LAJjWUDjWyuqRR4WyLXUUch332BbTGqb95/cHe2umD1KF4fociNFagxKbi+fT/+xTjZfFK6JG+4UNNnbWFjI55cSsBDwHLhH0SR3Jde7CTCdl98bfYiTsDvpD5JNNMqOz3XfE91bORSQHrluR08nel6cYkcsk1NjigpFbcLEgptmsl7nAYCrp3CBdw1rrYzLUBnZfxa2M7t/OQGLZdGTOLj6fK7QwPdhxEpDzeg8nY2bnOewwfy450Q9Y5pX47vB5tvV+Bo7UeBR1LhRNI603nR2q3CrgrMVpxWnpY+kFhyvvDBxPZ5FP0TycFG7gcq0Gh4uyXZJwt48hLRO+jAqRg5VXrPjmg4svt9jG7Z+ti1djBbHFVUsJtAd5ift7HSMYvK6BB2GAuhBWjOSnTuMWxoIXxl24V6iNvr2twR+UCsPsYuq+hG36L2LTGJMBCj9SbVQy7C07ImuZdcIAg/4uj9WNIlI4eiXYiI8OevDYdLaoJmDgj2Qp6FQWo5lLnaHqr+RxWIkWG/wJedBqYLgJ61novcRM2SGTVNFFVSAHztzWhRPc/piUS/M/F34i2KngD3cUF6fWURlyUpeoUz7AovO58K6yiuXzuVZO0TeSMkqGJi6rRwnkfhjKr1ZiwXLZ/u8BgxjzHoPIwrZyMjZ08V5/HOMhasAmXgwtmjQXg96qCQHXYjCT4innr3ZSIgb9GF7I9YNVoefnWH7DRuCN6v8hc0QPnRHGYiOha6l8IDpQagFWUiPcqwOWIHJJW7fwTGL9stYLHjuHkAkqNZiLcuvMjgpMs3a8AJayY6v5//CSwVPi3CmfHs8zKlSm38vPFx/cSSQXuBYjRSPLVRKQvi19D6xT2VdBpc7ECt859IMGLIXMH571KYRs8EYFmqlWvNlH9qUlBO9WGiXFlTT7ipf2HNHfXJk+wP6H1rDuXr6H8p37X9ifWkYK+POaW6V1ZQ0EyjtztxmfuDwmnuwfC2Blgd0S37ZWvVER3BFNAczfza+0tBWg/e/JtnYC50bl4wriXTTR3Mlj9QxU7oGtpjdzKMjM+4Lmcmt1f9dpYn1ms0naAOKcZ5OWi3AAvIx50d/9SS/HP9QN+Af0To8Mt0ArTT4iYvQtTMrzHRQAxsS0YPdebspHcVsMewrw1WlbAhVgwNhgcgU0BJ/l5Al91dbTk7PvkYCybOiTOP8AIrZ6U/QYChI8tuan363kchce21qmJrjqeJRFnaezncdXQ/b7s6so6ucDprSHgdpplnp0nab9WY9nVnwTYj5aSHJ3Utt4PoOt6EohK2XeUwZFNmUzQPNzyc+sd4TtphUJyT6j55QKDMqREOUEgn2L X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f8f77be-5368-4011-a131-08d91363ed85 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 03:30:16.0492 (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: kSnydgZQYtUcfcV5mucEY8PaU9nINJN2kP83uEoVO3hfg4eolTGcSKJmRvF/gghPOy3oT2F2f1BvhR9TcOKKNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210509_203020_321108_89DBFD10 X-CRM114-Status: GOOD ( 11.92 ) 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 The i.MX8MM VPU power up sequence is a bit special, it must follow: 1. request power up 2. reset assert 3. reset deassert This change in this patch will not affect other domains, because the power domain default is in asserted state, unless bootloader deassert the reset. It also applies to GPU power domain. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peng Fan --- drivers/soc/imx/gpcv2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 2490757f759d..35bbb1bc5159 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -217,8 +217,6 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) goto out_regulator_disable; } - reset_control_assert(domain->reset); - if (domain->bits.pxx) { /* request the domain to power up */ regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, @@ -241,6 +239,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) GPC_PGC_CTRL_PCR); } + reset_control_assert(domain->reset); + /* delay for reset to propagate */ udelay(5);