From patchwork Sat May 22 13:42:46 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: 12274507 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.1 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 46470C2B9FB for ; Sat, 22 May 2021 13:13:23 +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 C11CB611AD for ; Sat, 22 May 2021 13:13:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C11CB611AD 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=wRa/vGWsE+D485m+cuz360WOLKYrHJavbCOqKcqxgTA=; b=RdOek77vpSM4g7RhfoREiSzLsx /56gfKY+xth3AvcfiZT6X3+NVAyeWg5ZgVFVBLyjpaLT/SpToySZC33HiUcjnKod1bWHZ4Xrub5oO vPKYZJh5ZEQgD+KpeEKxxeCRxi6K+byOBn3qGD8rL//L6SznYH0aUctaB1qIBU7UrJJGxaIUgncg5 DYuLiHyaChcZq21p0e3UKqh7H5nNNNvH49g2L8ihxJGXAsSOglU6OM+SW8KoDa4t/Mh3LVpH5Bjtw hO51GbisjytKBjLV3eeDIApQDYPI82IPppqKZgL6hrw2eETBS/Y+SNN5Z+YRZgJe/WXr/kPmwPJae SsMHTohg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkROw-002UzN-GM; Sat, 22 May 2021 13:10:46 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkROc-002Uyd-Gy for linux-arm-kernel@desiato.infradead.org; Sat, 22 May 2021 13:10:26 +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=/woyMMdDjmoLpw+OB3GH/kDvCzq6VvqWMWVeZD4Bi+A=; b=WaA+GmDcN3yFyMZzuRTHbZAULZ JAHf8Xb36f89FUhDFnyqeBkBl2WWucaAZeu3O2nuaaHbPxS7eWLH6DnZfb/NcB0e9QNnomFtbNe4C k8RzU6sGNfMovxUbXWeZItWK3sg+fMI/9P3gSUf1upORkbVID6RzES4BesUcvSMHBGXl3wqoYDaua JCm3QXCGb3eXa3jIHJvMuji33mvqnt3/bm+M7FD7eWY+eJkJfScICideF9mE2SHjwHvIBh103RfqP TmFMsySAVBD8EhgjadbIPfpU0Mz3Tvcku+OhD71epyPSUR59Ea40LB1R9VhgkEaxhcRiBA9bk0OsZ 8sKUyunw==; Received: from mail-am6eur05on2054.outbound.protection.outlook.com ([40.107.22.54] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkROX-000771-8O for linux-arm-kernel@lists.infradead.org; Sat, 22 May 2021 13:10:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G0XO4wJwZqF+v+9hUu0PDY9ixB85a+NYky91aqtE2fDQDC6jXIRDarhbal8yClQoZoL9tQgKplzv4xHrF4iXW1cnZwtgSQFFGQ8pIUKKbfCYu5LllqBY/v2Pf+UZa4JJzLk9PgJDenTyfjYMXLbrrG3tQKV7lvr23eVmttsWTjB7ZqULoQCcAhbuqsfP0867BNjWY1xPm9IC78NGAfKrbXPRQ3HtS4qwCwbXzdaxEHV5UJ97tCFheKSTA6CK/bSdiXn3A7Yv3TPTLNM66zAJOjuiJv824RYnOw/9YZqSbIjtdB9DNG/ErdK8EYp0B7I2KVi1fZxZKqX5j/SODNyk2w== 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=/woyMMdDjmoLpw+OB3GH/kDvCzq6VvqWMWVeZD4Bi+A=; b=DcNQ9QgIfelV635uSpa+ta3bKgUsdBmpFc5m2ubrGCx9HrPDhkOr1SlG5hyB+ZqZxAiLqbYwGJ+qSDMop5RoiiOHam3OwsG4YHOB3NzBS9O32laFiGJxIR9RhzG8mnJnxXIeZMp2ZRM8ptZuiurJFe1YlIctaCJ0VKjLnDUq2oKEDKKb3WGO7hZPBV7bJgoJ4gSlLoFeFu1K8nMuJi/WjujQ0+PSOfxlfBLgyG6jrq5/BEm5Uc9lpuei8UfjUC9J7fDzTcjK1Q06nJHw/pbigtVWl5/c8jNyzBJ2HMvjKqB2Iqq39whbItvM/WpGrZLxbfxPVlWJu1Ik0kAvt3NC/w== 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=/woyMMdDjmoLpw+OB3GH/kDvCzq6VvqWMWVeZD4Bi+A=; b=NgZHk12/XFBcfReO9HUMF+JjZj1Hp4eHQdWMDQWvji4JWFBvykrmqe3a+twgLufxqoeV4qCHSS4RDsynsKsT5uRxcy3jdZ4rgIRuKNqnVwzh6nkO2qEkl6E6bBP7cfi5z0dzTZo9azazofJcTRWAOK6c0VenvpQkOnl1lloHHsk= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:18 +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.4150.027; Sat, 22 May 2021 13:10:18 +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 , Rob Herring Subject: [PATCH V6 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Date: Sat, 22 May 2021 21:42:46 +0800 Message-Id: <20210522134249.15322-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3dfcece-6e45-4183-a470-08d91d22f1f6 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o+kryYxwBZKwCNF4M5OynlOt5nsZR+QOOWf986XSt3X8v97erm0NDVi2bQt/6XKTz18Pkl8LhCY3DATM7hsyMjy8MIjIHD1DJnKtJ7tgnrYdsit8I3zksxVcuGZx1D3G1zl/Ayn6/IKkIBk5GNmysoaCeOoB8YJKitSEug5tXoRCwtiaujnvh/Xey0TaWxJuoIn3Y61z8jZTd8mceUYu8DcxWwaDpRz63/ItuMCfTizlJuNSmf8oBcpw1baX6ALZVcEVeCCY9UusfylLoxsIN5A9BApKZWsiwHG8fovPNsfF3DuvoTHiIqUG1cOSVpcUiAn/EDlduXLw2dLYSxkmLmL8B7K02KwSzCCDFKKWlcNTRnToMmU+8ynTnK3ozx74rz3PBRlcpb9CiwPI1Zp5dOOyEw++bvebRGglajEHkjCtmmGRbwv2JdryZCM6p6uZPyb20pAnOFFd2DjiIVLkXschI8D8KiKgXt1xbWs/tj+9Lj0CbcC1wDDDchLheCC1GbJLPYVq7n5ff19p2gpXfHFkGuoPCxtv7Ph9mETZfs3p/HN8U/gQUrKhTbE6TEGwOug5kTujeeHZNlp8NRb0e5QqFmZciDh+AHOHuthGzlwpPcC4n1njT6HZJXtV3v5iyX92wwH50BMTQ+3Yaue9jyvFtDdQzRBbIS1we7k3A18= 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(6512007)(38350700002)(38100700002)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(54906003)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pM80qOQq6VQFnlKJwq15aozBB3ksQe9EfO20ubdGYj76z6ILrbjb7PCGuB2Ik0hgisZb0ppk6oQBrLtAO8qMmmMWXIQLxSeUdeiaYPtNCp6G2kXrYfchCZvmYzj5+b/7tZpWf31Lslp0oWErhc1+4CDtoXFWll2nXGepma/GIzB15HtMMIl8HMhDoS+4qMYat/+H1EtltEXmOktiy9Z3gZ7LVjyeiI9AP/MDCSCKsZE98h806yqMpJ5P2LIsjg/aPG617h5dWFtUDtkIVyAJ8gkMNOEjHpH6lw2F7RW0K1KV6vq7gTal1CM7zL/YKb+J33yCPImRYTYNZI78X22kD5ZSrLFlDu1AWXBfv9tC1Hnt4PZxk3V8tIjGizhboZG/wZOCHOo3cX2q/p2fMivY6qjskYmhQ23alwo/TU2pD3mCNu3TSZ12QlDIfpgjmY5JYsmFv8Si5H/v1v1QyEX8QNHlm5YxgErLOKNsd6qx5HMRaJVebwn+fXvOP24opACmyNryrVFMHS7vpRn5t11YYuMMfawNbtNvWt/vitA7/rpP5VGQaZ/5A9MA7CmQUWr/Xe0mHtMJrh7Rhzy+wpie83eW1V8zvFNqsy34hftF5/tyZ8sMIgFcd93e+SlcgoqidmaKgvNnNCgNDstuFRB79dFRoER2JPZG9D1t70VRll/kKYSx0f+IKFay8HXfbiPBtYd4wzvL1nQQ+FxGLCtwGyaJ0tE8fHPKQzXzG4oFNV1sTWvl0cCqlraerGix0T0tcnhjddYbI1Q4zBnnbxqMzrQdYJZP3gGS+LP4ZmvFvGbVmz2LaP9adRw9TLN4Mv9xjI7/lApJz5KRGMupBVgXyUHN+iUpvgqqRCj7oihZz/LmxubFsauckJk67ExeSAp+OU8pdc7Ehkg6Jfsoh3YhaQ59Sh7LtYIPSUMXxVHYz5QeeXTDNIJXDdvqymXGipT7C9ZYOrcFO470PYzGRaCfB76lv7qMxlrdLBddAevdmApJXQSgDlk6Xv40OBb/4msRf8FfxZ4vEWEXyRbyeZbxQIwcyONCT8eXMujRRe1iKbB84VRAgEhlcOVfG1ArITQBW+0hoELVDrED5DYjUkZwZl22b3gNGD3IxbsgxoeD9B/Pkm2RYjge7eYjHLkuK4oXaWwtS2MbLRq509ZHcbWB8LaHNH+0vlg8kSi8Uqta1o8nNsQ9saCPYZ/aAZGEO5+pCe9kRJ4w38bFcxRVdqb+XgJsaU/dBlxFTVMClixi1ovFhR3fDP1K7ut40rdtutT4SvgJi3jOW7aLcRiUWCSgepX9g1F0qIJf1Ok4hQUor74IsvWu/QsHcvv8KH7bstqZ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3dfcece-6e45-4183-a470-08d91d22f1f6 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:17.9070 (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: 3fuagunKgG6hiH0CR2N+8jqyFSR8Rej4OuiQdrre2OJ48TPzZspI/QRssZxU1aLXTgFq99ZOQ4EGAhtlZpv3rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210522_061021_320365_CC1E4086 X-CRM114-Status: UNSURE ( 7.64 ) 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: Peng Fan Adding the defines for i.MX8MM BLK-CTL power domains. Signed-off-by: Peng Fan Reviewed-by: Frieder Schrempf Acked-by: Rob Herring --- include/dt-bindings/power/imx8mm-power.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/dt-bindings/power/imx8mm-power.h b/include/dt-bindings/power/imx8mm-power.h index fc9c2e16aadc..982ca2939cdc 100644 --- a/include/dt-bindings/power/imx8mm-power.h +++ b/include/dt-bindings/power/imx8mm-power.h @@ -19,4 +19,17 @@ #define IMX8MM_POWER_DOMAIN_DISPMIX 10 #define IMX8MM_POWER_DOMAIN_MIPI 11 +#define IMX8MM_BLK_CTL_PD_VPU_G2 0 +#define IMX8MM_BLK_CTL_PD_VPU_G1 1 +#define IMX8MM_BLK_CTL_PD_VPU_H1 2 +#define IMX8MM_BLK_CTL_PD_VPU_BUS 3 +#define IMX8MM_BLK_CTL_PD_VPU_MAX 4 + +#define IMX8MM_BLK_CTL_PD_DISPMIX_CSI_BRIDGE 0 +#define IMX8MM_BLK_CTL_PD_DISPMIX_LCDIF 1 +#define IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_DSI 2 +#define IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_CSI 3 +#define IMX8MM_BLK_CTL_PD_DISPMIX_BUS 4 +#define IMX8MM_BLK_CTL_PD_DISPMIX_MAX 5 + #endif From patchwork Sat May 22 13:42:47 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: 12274509 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.1 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 F3C02C2B9F2 for ; Sat, 22 May 2021 13:13:27 +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 772C3611AD for ; Sat, 22 May 2021 13:13:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 772C3611AD 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=G62Z3owotmNHc810Nx9SVi2+WkP3sCp9zPaTTkAOl1s=; b=rAkr00/UjewkFUIotFMsJXLVyx f5H92/jTlld/OYPh2H7TqqzxUUw0+olcO7ByHxe5rvEgpgorv/YvsnUtqQXva+KYEwsBSgVR2+JdA 3vQag5V52G1hGyZnu3a+YUdgBmH6WpLg5+WlsWfdJsKwwFf0Ep1+JS3dAbz7b3MlpcFAQkywfboHm wrNmNPA2d1t4xXZDZXuqdifYPAUD3WQA4LEu9CIv4+eyfImZbmC+Whn8LII0g3wTmXwp7yU6F3ZFI mt8hULsdM15Ro5NCO8YJPQ5IUdJ6OhTJD1q3EgjgcuzeCN33s52M7ZQdhmgmocyxsVkdDqjzxoKOX lE7bDnbw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkRPK-002V0p-L8; Sat, 22 May 2021 13:11:11 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkROk-002Uz0-Kv for linux-arm-kernel@desiato.infradead.org; Sat, 22 May 2021 13:10:43 +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=0aB9k0PrMCYDScMBixgBT3+fJPleWCeHpDcOqnFBs8Q=; b=oB5f5H7r9tBLooM4bzH+G34mX+ 8IpVw7u0mCr3ku+6DNSibILI/pR/xtWXKiIurWxCc8anX+ZLoV3mkrDcAsjopk79tEufxawJFucwJ M/wueefna/rkJilaSVUwTKlZj3zLRA+gew9x9Tlc5/UkpgC/FwnCr/ob0dfRn6uSLiqNU2/juHUxH 7OLlsZ9JK47n1YOowj8oI2qMMhwRC4RHrRD4Mah50+jJrAmHC1OEs58zXbgFYgt+7uU4ggC3eEKr8 Sd9QQwvAId2IADNYmxbSk45sCP+tRVGn3arQTbSaj1MlYJ5EN38olOlViI61mVCP5vsewftN/Avq3 jLImNNQQ==; Received: from mail-eopbgr60074.outbound.protection.outlook.com ([40.107.6.74] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkROf-00077U-An for linux-arm-kernel@lists.infradead.org; Sat, 22 May 2021 13:10:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YWj+8J7L+Mi9Tsz+OJmNl4m5BAhKCz5WJl1ARdbzTHyyvGRAAybswtic+2nT4Pu1IHFXQFPMQ+WrEt8GSxZPd+hOliQC2dB9KCwsrDnO0mbKk1PurbLw/Q+V05FVCXEXENcII6nhFRt02OFIa5ZERQ59HOOr2toXOQxDHN5xKIdRlE0JyfMHQdP1+hHNGK28dKWk9q9KynVLExi1aY6N1oKb1kXHhnUix0/TG00pRhKfONbIttaHyDJFcW3HPfHai9G2h/OTq30YCD/AmPnatOtKGg3og9rTc2dDf5iVXQQ86wYq0Fxp0l0+u0szWiBswtxl0cAVASHdRDABwEyyWg== 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=0aB9k0PrMCYDScMBixgBT3+fJPleWCeHpDcOqnFBs8Q=; b=coDMGa46dVpkH1NclrBIt8sOAU8pyGelISIlyE+tI1W3WwtznLWpXR5Odp4WeL3nP7c9KWCjxe1qpGmDzV/cJ+CeO5uVQLFy4z87gox2T133ZjSX7aY/6TMxJacg8rh0ODGz48/uMcdFj9SGHpd+BFEO5aYny8nDJSBLpo3NqdL+I6MJWdSDBrHZyLesz/oAK1MSI5P5D4Wn5bLT4OZEMQNxMJnB5WvPcwteu46sjLgdh5Bjp7NzsGQqDjlWS34NKx24+33o5fdPkfPELHSXuALr4lRdxLIxvil589RmXpSQg0lSU6ADprUsx8rpbUNwCJ6BEoO92u1tlU+lAKhpFA== 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=0aB9k0PrMCYDScMBixgBT3+fJPleWCeHpDcOqnFBs8Q=; b=ZD8x7nSCRXVK+tHXeKiHE2ncIIzZFsdfTnsomqO5ShMzV+acY72jBcMBtLvh+oRpx8FlegDCYa5exCuNdigdxxW29cfRbnVCaJ5PCmxN0KnO7f5BDHlUNex4eOXCTfAAOKIjNo8Grfcx5TIBLZ14a57b6ClWaqmAmKfFopMRDpU= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:24 +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.4150.027; Sat, 22 May 2021 13:10:24 +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 , Rob Herring Subject: [PATCH V6 2/4] Documentation: bindings: clk: Add bindings for i.MX BLK_CTL Date: Sat, 22 May 2021 21:42:47 +0800 Message-Id: <20210522134249.15322-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 510ea44f-1763-4375-7326-08d91d22f5e1 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: 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: BzAZgGVLPayoLYqsh6uInoPWT1aR2UGKn67azRjqtftfVk4csrvL6Y895MbSWFp1uSjmTYW+HY+y+RJdrn8BNufa2urZSAxx+XJTAaL1HbVKkoDDo3pCVMx/FMvVhHQufO2L2ggIbufmV4YtL1zbyDtEK97mw4q15PdCaAMuKo9Yj5SFBtBm9MtIzK5T3vRduA76hglAcSb2hY2VjecuayqFHAaqqNvblBrPHscm55Ol0yiwrXdhLSDPHRHHCvZ9ug/xIRb+JxCtjWz44wRal/lYVw5LjM/IGZq5kNiHoVtSfUVrkeZG6Ng4PMIzcAmkOkS5+OqsJpCfmwhEBn01zaHgi4znwZvmbgKfY/qAenFHiEJKtQ/h7BZ5Pz67HyX7x43EeG8Ib26VP1gvucTMClYHtdcB8jk/lVDZ8pRayzOLp4YnHq7EH1d7iJkkC083Np3jNn5I1VSxhkOQ9ylw3zlQVsOuI5f5w1Kis7ZdXEa7tZRuxkFxR87TB+rAMVoJKqHhdhTre0FNNbl847C91eXhhPilMvQxQAGmuZfYadcyFPn/iFyvL4wC2s/PpHpIA23W1MQOiVBikk+EJbJkDULYmlyH5lM7xXYrFNVXKa31k8rn3OQ1u2rapBy09N3L78NhEVZpN29yCQL1S8VnGXvHdXHE6EVORgN3SgE2V00DzAVk2sTcGcwxPY1IEJ7sKwS2ONiJRXEV7knP4K6EZ0A0QqNBivH7IQh4vNccdyrC6Ew1Av2cVrvDfeGm5tMhbeiak7LbmWes6IOzzPG8Tg== 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(966005)(6512007)(38350700002)(38100700002)(83380400001)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(54906003)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oQhoahm4MXLxDJiyzIXojcMpvOQe9HcsocPonkNJSDDyMmwewP4Y8DbiPV2tYT9Ra7ucPLpi1k+YcsATC2vK8f+WnqcZIytHHbMPWU4VTpUeVr4cEM+f+x53qGBL2DC2ddYTGyIYC3pYWAQFx0O5sQjWRRweHkiRprnM16/pJVUIPw2WLuaAiIOF9q1MGS2CpR4OTY14T2W75wzpbtqi3OIbBzv5l3c2KAsd/GWXpJbqWrjgIgf2slBADaof0WXDNeHO9QO15GGWtcqi66oUZdKQySvB6+KVTBo6DKrVobxRN+e06ygPGTrfdfs+EzU4THFjZ5kJzGkx2A5RB51dpN/G0+BXNl+1W1GMrVwMGyjlbvKELpRkcnMovo6alIdzeceCVNY+7tnmumoxHf4w/kcdZKjvAC5sFm5nKHInIYcsCShCDxicfrtaaTV/JRzEWey6Z+zGMHIXKrxVV54b7bQayPPTOTCdsQJZrhY+FbqR5TSVEdKvg8NassaazYRtxAme74ssMFEmtzj0xA2Bhsi/6VyHZRc1KBYCvODVntIjqNjLM6A0KaPkvH7HWYn+zwYG6LOh28jpMoOZK4y3mZAIlCTne/FlM/6s1Ba/VoOyiJFZkr3Wo1k41yOTIGBd8LXdL2y4r7ayZxB//xC8jXYpk+f9P8CpuWDR3LXjtDbFRXSV+S99GrmjdFF5NandHKE+PSSsSHh6QtZmmuMhCuR2SqceKqvTeUu2utfRFnthb3SlgcMhcK5Iu3UQ5Cb0NKiheIRyhL4IDvEOxideBFxp4Wr8liQkiP36Ad+QUYmRJtzxCY6/wHyY9zKMHOkScxHEDxcF25v7LHZYgdSt4q/j84Xuy3ZiShiJeR1B508h2Jia6p/+iD2tsZD1aR+zm4OXiSiwK0wmCnmHOltQA24dZx48vYP7IKfm7OKIwUp+mn9RvQyKIQzU2ZjbtZuzn8rpBS6VWSnjRfTE5HF8toUhLv9CUhXi48R7RfdZUC/lcXnD3GTMBz/elYxQvZ6OWUOvTfVxki466OoZQh2uteTs0t6SE2FE5htKXr5cBrC7xjLeqmOwdwCa4/kIhA++YwaVlYEn8lzKu0eAn4DxaB0aBTrA2Y7+2gEmz24hcp3OdVhIZGmwSLurXnliM+SfA3IVBP0L7q/bGTHF7BU10fVTaN3Cprnw/33sHD8KhgMFei1Xu/4uHCR16+rhOk0Yv+oDil7V07VluCuCYK2775qrb9ZMijywRMV5aB6N07w37ereF9W6imvEGLiV0SK3VGE+h5HHqKTFW+HyUoBbUvJrvz2jEKXJg4NoEOooJR8v3nQjIcoOEDtGryuPBDZN X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 510ea44f-1763-4375-7326-08d91d22f5e1 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:24.3671 (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: ERzITLCYegPXKmt5qodDyKaoOuAirqA8RaEr+E6wH1ZeBTtz2z/ZHlU4L4Uigkm9hy191CcT0v78lmSENqMSXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210522_061029_399315_47435CE7 X-CRM114-Status: GOOD ( 13.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: Peng Fan Document the i.MX BLK_CTL with its devicetree properties. Each BLK CTL have different power domain inputs and they have different names, so we are not able to list all the power domain names for each BLK CTL here. For example: i.MX8MM dispmix BLK CTL, it has power-domains = <&pgc_dispmix>, <&pgc_mipi>; power-domain-names = "dispmix", "mipi"; vpumix BLK CTL, it has power-domains = <&vpumix_pd>, <&vpu_g1_pd>, <&vpu_g2_pd>, <&vpu_h1_pd>; power-domain-names = "vpumix", "g1", "g2", "h1"; Reviewed-by: Rob Herring Signed-off-by: Peng Fan --- .../bindings/soc/imx/fsl,imx-blk-ctl.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml new file mode 100644 index 000000000000..a66f11acc6b4 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/imx/fsl,imx-blk-ctl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX BLK_CTL + +maintainers: + - Peng Fan + +description: + i.MX BLK_CTL is a conglomerate of different GPRs that are + dedicated to a specific subsystem. It usually contains + clocks and resets amongst other things. Here we take the clocks + and resets as virtual PDs, the reason we could not take it as + clock provider is there is A/B lock issue between power domain + and clock. + +properties: + compatible: + items: + - enum: + - fsl,imx8mm-dispmix-blk-ctl + - fsl,imx8mm-vpumix-blk-ctl + - const: syscon + + reg: + maxItems: 1 + + "#power-domain-cells": + const: 1 + + power-domains: + minItems: 1 + maxItems: 32 + + power-domain-names: + minItems: 1 + maxItems: 32 + + clocks: + minItems: 1 + maxItems: 32 + +required: + - compatible + - reg + - power-domains + - power-domain-names + +additionalProperties: false + +examples: + - | + #include + + dispmix_blk_ctl: blk-ctl@32e28000 { + compatible = "fsl,imx8mm-dispmix-blk-ctl", "syscon"; + reg = <0x32e28000 0x100>; + #power-domain-cells = <1>; + power-domains = <&pgc_dispmix>, <&pgc_mipi>; + power-domain-names = "dispmix", "mipi"; + clocks = <&clk IMX8MM_CLK_DISP_ROOT>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, + <&clk IMX8MM_CLK_DISP_APB_ROOT>; + }; From patchwork Sat May 22 13:42:48 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: 12274511 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.1 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 489DDC2B9FB for ; Sat, 22 May 2021 13:13:29 +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 97626611BD for ; Sat, 22 May 2021 13:13:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97626611BD 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=I4XHtiYIBw3Eh83iorRdDe6pB4S23pbxzmvespiIPCM=; b=IRYmxYmZPMbaZxAZIVcbY6NfjK 0UpmwphSrvrvQSSUwoiK3iXlag3Wm6sXcR8tDDKBlSn3oAz6bxrf8D6mEjXpOt6jmDz48rUX+Nvul ggMA6EMsEAEj7UITeiIHRxs9lPeNf5E38mQ64+o2rrVumlvG9IJt7kGVTFTmQZFYwyXLAIs2cW4Bc 4QwzdVcaHH3pwsGVaSo9buJ9yN1GgavoD4sIcJbs4jr82rlr1ji6STLQuaBQjiMmo+cyxC/irrglE TxCgwEqLDAEPFsTXWZFP/eHME3kGkBvTiooj3cRsnbyOwpPvTiWd8gexrC8rtSQsIssgsszlJHAyo 7AmDt6dg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkRP8-002Uzu-RS; Sat, 22 May 2021 13:10:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkROo-002Uz2-9l for linux-arm-kernel@desiato.infradead.org; Sat, 22 May 2021 13:10:43 +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=5qwaDupzmhqcQqkEIrmxTz/W4DsI6Ku2iN63KCcphUI=; b=Qkz/B4aBLQHJut3HKbSXcSVMK3 IHRchLaXJh8R4TW1QmwDy+/J1Q8NBKwZedapN7Ja6yoa6FyFf3KGBTj7g470wWFzL4Fz83rZrCYey SeiClT/GOjlQL0rDuol/BK/suRxQmACvQvMoCUlD3L7IgstLTLZEAkCfM+RJ1mwpSqTJ2VVRKnRGi zfcQ6QJLo4f8XeZAR7s4eDNyZo7P9YDr7yJpug1ZGmeW9iDuiQmhm4RTpENSk/WKhqkTeG1Hmwa3l aKFIXqlqD4XVvhJ+U1hY5xrmBlkyOnwE1kI6prWfOrqXcO3XnPmZl2YqzKlgeaf/CsMwZiuWsKsAn FqHRnH7A==; Received: from mail-eopbgr60074.outbound.protection.outlook.com ([40.107.6.74] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkROj-00077U-MG for linux-arm-kernel@lists.infradead.org; Sat, 22 May 2021 13:10:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LQRNnCT5GbR7wvoudEj6RpXUlxlzC0T0uHNxgR7/qW/LSLDO4saR9HR82FR7lc7u1ayH1ZmG9o2bTd6BYiDhgj4FsyH6xHxgJX2/e5OyCdwQqeocaI3FWDovxiAwDs4Po6pXpnTNxz9XoNhnQh0olCR1KYY1BXOwQvm287Apf3fGdFySs8RjOkz2QOlUFk4IqkeRB85H647CBkM6HxbOAJ1yCqd9yN2pHEE/eqvJ9M+NY17huQO8xxVLC/v852Ah1VTgnYw9ADbDXVOJ8dFO247EUCH9VHQ+r5Rg6+xlOJh8/UsLBu6esnEUVzL330BylU80grUgjyyg1hHdVHBmcw== 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=5qwaDupzmhqcQqkEIrmxTz/W4DsI6Ku2iN63KCcphUI=; b=eWivciaWh/WMKEjtkMjqAh0SEwOGn2al4/qBYZ+YRuBCP5FnJH6vz2s2zF7ZiKqba6M/VsmGmY6KOjPPy6j14WCxiIWaG1EV4wyeAT1YWiANYdIFFXbnNxfOGpq3cjADqoXVTn0RU0c8ldi62cskUlGsolq4RjBoVBZRvxAiyZ7zgU3iBr9psfSaIphnhY2h3qfHE1A9MJyo2BSaPCS13PrkGlcfNUbcnbsJuPBqc9bKHHVp4SGWHBM59i/q6vWIj56meY4BADeZHPbKgPNq8PQ7MeRpCHVGpC4wTplMwRaOCXl4qsDKvUdXM9CX2AXvTlQpqhcwqdSCtbZ58AHKTQ== 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=5qwaDupzmhqcQqkEIrmxTz/W4DsI6Ku2iN63KCcphUI=; b=UB9BgjZ5XMbYSAXo4ZD8UcBGW8fSZgrB6N0GNC6KO5XEYQ/GynoiiMcODckYUKq0ptC8JpWSrLFCJi1FNT9Yvwbvt7y3tgjLPqDND/0tYG5TjOyh233tIoYw76wU1/3KxPDl0lpyDe2/MUnIEJgNHO7fsBUAhPsjw2N7Xz10zz0= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:30 +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.4150.027; Sat, 22 May 2021 13:10:30 +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 V6 3/4] soc: imx: Add generic blk-ctl driver Date: Sat, 22 May 2021 21:42:48 +0800 Message-Id: <20210522134249.15322-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8657a16d-e049-48c7-ede4-08d91d22f987 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:632; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JAismw68TwvayAhWDK4vh3sKZNZ1Mtd3W7SPjkzmbl8oRxm72kyEJjSKF+/UxJnP+xHhhkWzNU81NMqj3ZZ7tmAH8AlDsEEoQm2vbGT4gx7eGk9DHLOnXz2nfTL06oh2dasiwSCFIDitN4RPoOSkhijKr3L0AMiu8CyoUMyBJ35DT2e8Nb/9eszwkRsVfLKszWbs+DYaOqTgBM6+uS5/IuMFPEzG9tsYahm59AmfObyO75ZNzN/hf1yqq0+PipzqRpoT6rUGAqiqo2AVzfPnfOjITH9b8dAXpdEfm3MzBHtwve6xEsarZ+wDMB/HsIOBwu06CdfYemMlMZNE5VdDEKJLHaKYR5BQW7f1BJUMc2oPRqskGy9vs2QwGUCotkEybxRI3a3kxQwID6B9atfb798zwPSIJ2Z9ZcdMPK9zvMCRTR2TOSCHtZgQMZp4OjepUkhZTstMNJHU1a9r+OT7FIEHISg4JCNJnb1gk7YPU6KLqUzZzjePjNcXSPqRumHgdsLnBT52sokzpf1Hq4TNdr+Okw5JpM7RS+NLQzCIOP+KvIRrTUk4y0fwPMavglFFdPqPkK0j82PwSDR8zDlDvWS2awXU19MtLCMD75KaKdbJ8Epshj2bs2AED3BwZKcGHZvB9kbbAN+052tsTiAVXzwNuwWou01oUbURgAhsIqtRz61UI0jQQcjSEO1/hjCX 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(30864003)(6512007)(38350700002)(38100700002)(83380400001)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(316002)(86362001)(2906002)(6486002)(6666004)(7416002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7DJGqU1+tmNdHlGzzYDxXTvHFlh6hyUZq/NOKnmkTngERZ4FnCM+ySvNBDQAkiqIVFMFJTwx2bbGwDEc2jTeH7/QgbCzL4r2Fynp7B/ouz3wAjLSZLOerCngvRDvtzE5QDjrZ5S92Kfk6BYSE72sr9E48E1r4AZftunZhFKU1PyhtwnVb/8EyO+0nQLK7AOCVskUkdcsUwsiYUTT8qIU+LrggREXsbuKd32ZzjED825xC84HZzGhlbI46qUKv6Dr9efV4LBnsKOxNVLYJI4vXzymZ7lVnCFG+mvnqMqjT2iHotbldjzdjzFCP19yXTtREgTQyngqyykQO9zPMajG6jElI1ge4ivPFpzyGpF1P4HE/CRpX8igHQCMQjH6STA+i6KCyiVNIpKOKPi84q7ELCrHAeS3cCtCrEpD1mcjeKNXBmXIqWuFELPXWtO2wY3CvV4l/6IcLmYFyiDWQBPJZvMR6e27/KZdnkQ/Tx7cPr/qixWm5jXe8dcGXaaStIfFYRLeeIu3V48Ubx5hPy0hIIlTU7w1KCokAi2Kn9UiOFxkSspq6Bvrj/XHtC1RLH14N02fTBuQEwyAtJxsJtgK4eX1qV4xmbfOTY2kvnrdtlI5Uv3puMWHusuZpW0DRz8ku2WFEP8A6KTww8y/mcgq4nxEgEL5oERvhZPzpEUEPEpl4TFDW0Kwbi0aH+7z7zEGATwh18lqdn78KBE47QAKOMgaP5mbynm/kEt9Gxkq3TavobV5Q4VEOsCyf7UOvpupKl0aW27A3Cv3hbNlotPm9ek93/a/44X9AWjhdkfvZBqCoLz5yb31uv1QpD7+witA/YcPUspFwfwxzuBAV0TLCQIbhiMhoxZMf6Lz5SfNPGDG415dNkdHFHhK8DuRH/rzrem3RE/PeJSM0AfBmkgu9Jw+/FTC4G/D9h1/fn59QBmEykU/DTdqWAwF/ClSKXRYyFyoq4VSue8cneJaNmr/So8NwWPyS2Wb2ewC+KZFgxoLmw6QXw8G/+7T227K1EAyEwEDyllnpwH+FxWXniQ23xENxY3B4UJXUhS6KZGWTuz6nRYOfXBCH3cOqJArhyAI/FkAwYQaQ9TB+yK2gwWGfEnsvgEQV+/lPGy/GC85HbSYEMoDI6+SSBiELo/5jRnjWnSB2QELqqWL9DeqUStdmewpRG0IMyFwWTGJwaRa+vXQpqntzboos5ojpOuc/ltMHkDWjpXH/4m38qJN0pYxyb7k7/B/HYfa+xCo3VNPAdnSVaoGoJNtZCxH1+iKP5964S0EF7aueAHzQqqdiGfcb+TRJ29LSJo046Z4iLcRfpDeln098YyusYZl1oFSv7Hn X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8657a16d-e049-48c7-ede4-08d91d22f987 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:30.4963 (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: oTH4zo4W47BlsTBdIP8KqTmvEX/LAQOvNNvbfZDRrB5oDSyy16E9CLi7p67fV1zkIFvhD7PuZkHV9K5asLLskQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210522_061033_767514_24A2A3DB X-CRM114-Status: GOOD ( 24.71 ) 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 introduces an IP named BLK_CTL and usually is comprised of some GPRs. The GPRs has some clock bits and reset bits, but here we take it as virtual PDs, because of the clock and power domain A/B lock issue when taking it as a clock controller. For some bits, it might be good to also make it as a reset controller, but to i.MX8MM, we not add that support for now. Signed-off-by: Peng Fan --- drivers/soc/imx/Makefile | 2 +- drivers/soc/imx/blk-ctl.c | 334 ++++++++++++++++++++++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 85 ++++++++++ 3 files changed, 420 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/imx/blk-ctl.c create mode 100644 drivers/soc/imx/blk-ctl.h diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index 078dc918f4f3..d3d2b49a386c 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_ARCH_MXC) += soc-imx.o endif obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o -obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o +obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o diff --git a/drivers/soc/imx/blk-ctl.c b/drivers/soc/imx/blk-ctl.c new file mode 100644 index 000000000000..8e286b8ef1b3 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.c @@ -0,0 +1,334 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "blk-ctl.h" + +static inline struct imx_blk_ctl_domain *to_imx_blk_ctl_pd(struct generic_pm_domain *genpd) +{ + return container_of(genpd, struct imx_blk_ctl_domain, genpd); +} + +static int imx_blk_ctl_enable_hsk(struct device *dev) +{ + struct imx_blk_ctl *blk_ctl = dev_get_drvdata(dev); + const struct imx_blk_ctl_hw *hw = blk_ctl->dev_data->hw_hsk; + struct regmap *regmap = blk_ctl->regmap; + int ret; + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_update_bits(regmap, hw->rst_offset, hw->rst_mask, hw->rst_mask); + if (ret) + return ret; + } + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, hw->mask); + + /* Wait for handshake */ + udelay(5); + + return ret; +} + +int imx_blk_ctl_power_on(struct generic_pm_domain *domain) +{ + struct imx_blk_ctl_domain *pd = to_imx_blk_ctl_pd(domain); + struct imx_blk_ctl *blk_ctl = pd->blk_ctl; + struct regmap *regmap = blk_ctl->regmap; + const struct imx_blk_ctl_hw *hw = &blk_ctl->dev_data->pds[pd->id]; + int ret; + + mutex_lock(&blk_ctl->lock); + + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); + if (ret) { + mutex_unlock(&blk_ctl->lock); + return ret; + } + + if (hw->flags & IMX_BLK_CTL_PD_HANDSHAKE) { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) + dev_err(blk_ctl->dev, "Hankshake failed when power on\n"); + + goto disable_clk; + } + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_clear_bits(regmap, hw->rst_offset, hw->rst_mask); + if (ret) + goto disable_clk; + } + + /* Wait for reset propagate */ + udelay(5); + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_update_bits(regmap, hw->rst_offset, hw->rst_mask, hw->rst_mask); + if (ret) + goto disable_clk; + } + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, hw->mask); + if (ret) + goto disable_clk; + +disable_clk: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + mutex_unlock(&blk_ctl->lock); + + return ret; +} + +int imx_blk_ctl_power_off(struct generic_pm_domain *domain) +{ + struct imx_blk_ctl_domain *pd = to_imx_blk_ctl_pd(domain); + struct imx_blk_ctl *blk_ctl = pd->blk_ctl; + struct regmap *regmap = blk_ctl->regmap; + const struct imx_blk_ctl_hw *hw = &blk_ctl->dev_data->pds[pd->id]; + int ret; + + mutex_lock(&blk_ctl->lock); + + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); + if (ret) { + mutex_unlock(&blk_ctl->lock); + return ret; + } + + if (!(hw->flags & IMX_BLK_CTL_PD_HANDSHAKE)) { + ret = regmap_clear_bits(regmap, hw->offset, hw->mask); + if (ret) + goto hsk_fail; + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_clear_bits(regmap, hw->rst_offset, hw->rst_mask); + if (ret) + goto hsk_fail; + } + } + + if (hw->flags & IMX_BLK_CTL_PD_HANDSHAKE) { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) + dev_err(blk_ctl->dev, "Hankshake failed when power off\n"); + } + +hsk_fail: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + mutex_unlock(&blk_ctl->lock); + + return ret; +} + +static int imx_blk_ctl_probe(struct platform_device *pdev) +{ + struct imx_blk_ctl_domain *domain = pdev->dev.platform_data; + struct imx_blk_ctl *blk_ctl = domain->blk_ctl; + struct generic_pm_domain *parent_genpd; + struct device *dev = &pdev->dev; + struct device *active_pd; + int ret; + + pdev->dev.of_node = blk_ctl->dev->of_node; + if (domain->hw->active_pd_name) { + active_pd = dev_pm_domain_attach_by_name(dev, domain->hw->active_pd_name); + if (IS_ERR_OR_NULL(active_pd)) { + ret = PTR_ERR(active_pd) ? : -ENODATA; + pdev->dev.of_node = NULL; + return ret; + } + domain->active_pd = active_pd; + } else { + if (!blk_ctl->bus_domain) { + pdev->dev.of_node = NULL; + return -EPROBE_DEFER; + } + } + + if (domain->hw->active_pd_name) + parent_genpd = pd_to_genpd(active_pd->pm_domain); + else + parent_genpd = blk_ctl->bus_domain; + + if (pm_genpd_add_subdomain(parent_genpd, &domain->genpd)) { + pr_warn("failed to add subdomain: %s\n", domain->genpd.name); + } else { + mutex_lock(&blk_ctl->lock); + domain->hooked = true; + mutex_unlock(&blk_ctl->lock); + } + + return 0; +} + +static int imx_blk_ctl_remove(struct platform_device *pdev) +{ + struct imx_blk_ctl_domain *domain = pdev->dev.platform_data; + struct imx_blk_ctl *blk_ctl = domain->blk_ctl; + struct generic_pm_domain *parent_genpd; + struct device *active_pd; + + pdev->dev.of_node = blk_ctl->dev->of_node; + if (domain->hw->active_pd_name) + parent_genpd = pd_to_genpd(active_pd->pm_domain); + else + parent_genpd = blk_ctl->bus_domain; + + pm_genpd_remove_subdomain(parent_genpd, &domain->genpd); + + mutex_lock(&blk_ctl->lock); + domain->hooked = false; + mutex_unlock(&blk_ctl->lock); + + if (domain->hw->active_pd_name) + dev_pm_domain_detach(domain->active_pd, false); + + return 0; +} + +static const struct platform_device_id imx_blk_ctl_id[] = { + { "imx-vpumix-blk-ctl", }, + { "imx-dispmix-blk-ctl", }, + { }, +}; + +static struct platform_driver imx_blk_ctl_driver = { + .driver = { + .name = "imx-blk-ctl", + }, + .probe = imx_blk_ctl_probe, + .remove = imx_blk_ctl_remove, + .id_table = imx_blk_ctl_id, +}; +builtin_platform_driver(imx_blk_ctl_driver) + +static struct generic_pm_domain *imx_blk_ctl_genpd_xlate(struct of_phandle_args *genpdspec, + void *data) +{ + struct genpd_onecell_data *genpd_data = data; + unsigned int idx = genpdspec->args[0]; + struct imx_blk_ctl_domain *domain; + struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER); + + if (genpdspec->args_count != 1) + return ERR_PTR(-EINVAL); + + if (idx >= genpd_data->num_domains) { + pr_err("%s: invalid domain index %u\n", __func__, idx); + return ERR_PTR(-EINVAL); + } + + if (!genpd_data->domains[idx]) + return ERR_PTR(-ENOENT); + + domain = to_imx_blk_ctl_pd(genpd_data->domains[idx]); + mutex_lock(&domain->blk_ctl->lock); + if (domain->hooked) + genpd = genpd_data->domains[idx]; + mutex_unlock(&domain->blk_ctl->lock); + + return genpd; +} + +int imx_blk_ctl_register(struct device *dev) +{ + struct imx_blk_ctl *blk_ctl = dev_get_drvdata(dev); + const struct imx_blk_ctl_dev_data *dev_data = blk_ctl->dev_data; + int num = dev_data->pds_num; + struct imx_blk_ctl_domain *domain; + struct generic_pm_domain *genpd; + struct platform_device *pd_pdev; + int domain_index; + int i, ret; + + blk_ctl->onecell_data.num_domains = num; + blk_ctl->onecell_data.xlate = imx_blk_ctl_genpd_xlate; + blk_ctl->onecell_data.domains = devm_kcalloc(dev, num, sizeof(struct generic_pm_domain *), + GFP_KERNEL); + if (!blk_ctl->onecell_data.domains) + return -ENOMEM; + + for (i = 0; i < num; i++) { + domain_index = dev_data->pds[i].id; + if (domain_index >= num) { + dev_warn(dev, "Domain index %d is out of bounds\n", domain_index); + continue; + } + + domain = devm_kzalloc(dev, sizeof(struct imx_blk_ctl_domain), GFP_KERNEL); + if (!domain) + goto error; + + pd_pdev = platform_device_alloc(dev_data->name, domain_index); + if (!pd_pdev) { + dev_err(dev, "Failed to allocate platform device\n"); + goto error; + } + + pd_pdev->dev.platform_data = domain; + + domain->blk_ctl = blk_ctl; + domain->hw = &dev_data->pds[i]; + domain->id = domain_index; + domain->genpd.name = dev_data->pds[i].name; + domain->genpd.power_off = imx_blk_ctl_power_off; + domain->genpd.power_on = imx_blk_ctl_power_on; + domain->dev = &pd_pdev->dev; + domain->hooked = false; + + ret = pm_genpd_init(&domain->genpd, NULL, true); + pd_pdev->dev.parent = dev; + + if (domain->hw->flags & IMX_BLK_CTL_PD_HANDSHAKE) + blk_ctl->bus_domain = &domain->genpd; + + ret = platform_device_add(pd_pdev); + if (ret) { + platform_device_put(pd_pdev); + goto error; + } + blk_ctl->onecell_data.domains[i] = &domain->genpd; + } + + return of_genpd_add_provider_onecell(dev->of_node, &blk_ctl->onecell_data); + +error: + for (; i >= 0; i--) { + genpd = blk_ctl->onecell_data.domains[i]; + if (!genpd) + continue; + domain = to_imx_blk_ctl_pd(genpd); + if (domain->dev) + platform_device_put(to_platform_device(domain->dev)); + } + return ret; +} +EXPORT_SYMBOL_GPL(imx_blk_ctl_register); + +const struct dev_pm_ops imx_blk_ctl_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +}; +EXPORT_SYMBOL_GPL(imx_blk_ctl_pm_ops); diff --git a/drivers/soc/imx/blk-ctl.h b/drivers/soc/imx/blk-ctl.h new file mode 100644 index 000000000000..6780d00ec8c5 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __SOC_IMX_BLK_CTL_H +#define __SOC_IMX_BLK_CTL_H + +enum imx_blk_ctl_pd_type { + BLK_CTL_PD, +}; + +struct imx_blk_ctl_hw { + int type; + char *name; + char *active_pd_name; + u32 offset; + u32 mask; + u32 flags; + u32 id; + u32 rst_offset; + u32 rst_mask; + u32 errata; +}; + +struct imx_blk_ctl_domain { + struct generic_pm_domain genpd; + struct device *active_pd; + struct imx_blk_ctl *blk_ctl; + struct imx_blk_ctl_hw *hw; + struct device *dev; + bool hooked; + u32 id; +}; + +struct imx_blk_ctl_dev_data { + struct regmap_config config; + struct imx_blk_ctl_hw *pds; + struct imx_blk_ctl_hw *hw_hsk; + u32 pds_num; + u32 max_num; + char *name; +}; + +struct imx_blk_ctl { + struct device *dev; + struct regmap *regmap; + struct genpd_onecell_data onecell_data; + const struct imx_blk_ctl_dev_data *dev_data; + struct clk_bulk_data *clks; + u32 num_clks; + struct generic_pm_domain *bus_domain; + + struct mutex lock; +}; + +#define IMX_BLK_CTL(_type, _name, _active_pd, _id, _offset, _mask, _rst_offset, _rst_mask, \ + _flags, _errata) \ + { \ + .type = _type, \ + .name = _name, \ + .active_pd_name = _active_pd, \ + .id = _id, \ + .offset = _offset, \ + .mask = _mask, \ + .flags = _flags, \ + .rst_offset = _rst_offset, \ + .rst_mask = _rst_mask, \ + .errata = _errata, \ + } + +#define IMX_BLK_CTL_PD(_name, _active_pd, _id, _offset, _mask, _rst_offset, _rst_mask, _flags) \ + IMX_BLK_CTL(BLK_CTL_PD, _name, _active_pd, _id, _offset, _mask, _rst_offset, \ + _rst_mask, _flags, 0) + +#define IMX_BLK_CTL_PD_ERRATA(_name, _active_pd, _id, _offset, _mask, _rst_offset, _rst_mask, \ + _flags, _errata) \ + IMX_BLK_CTL(BLK_CTL_PD, _name, _active_pd, _id, _offset, _mask, _rst_offset, \ + _rst_mask, _flags, _errata) + +int imx_blk_ctl_register(struct device *dev); + +#define IMX_BLK_CTL_PD_HANDSHAKE BIT(0) +#define IMX_BLK_CTL_PD_RESET BIT(1) +#define IMX_BLK_CTL_PD_BUS BIT(2) + +const extern struct dev_pm_ops imx_blk_ctl_pm_ops; + +#endif From patchwork Sat May 22 13:42:49 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: 12274513 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.1 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 98B18C2B9F2 for ; Sat, 22 May 2021 13:13:30 +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 F391A611BD for ; Sat, 22 May 2021 13:13:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F391A611BD 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=14JyQKt2YW0A9aOA597zfbf1WDl83qJqmxA64gk7fGA=; b=I6QgeKmudECiQWvFC2VdAklbci 5D6tNmrnQ9DYZH0vO2Se+Pq5V2iGMUBFD/Z53rZ4/vfNczJJDwP99s6Y3r0jlgHBs9abDp+JQX4le mdtx16P3Fh5C9ttBEcWBA+/rKIQmKbpwbmXBacwz39L1uO04Ckb0SzgVQUjH1ZWL+4SMBub9mJ9Kj /77Mr1Yh4LHOqRpxHtIcC+oJRyM3FOA40pR4bOMdvNLyTLlj3/M4KQuROsPrejMmALBnnyw0qSAPB I/cgtFNw+Y7ctv3I5CnVGl0QKQSxeCVD7cPufh9J6k2PYTSx4oQwwVdJ3VA0fSTwuJiFgsBDSxbNY LgE7ugQQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkRPY-002V2y-A0; Sat, 22 May 2021 13:11:24 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkROz-002UzV-Bo for linux-arm-kernel@desiato.infradead.org; Sat, 22 May 2021 13:10:49 +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=Gm8D7o9Zkhoyic+N9lE/S6Kr9IT/0CYNpO5BdIwHQps=; b=2OuTuqZtpGTZPUnGktcKKFgMxz DXGkSxKY61/fntPW5oxOLOydJm/D/PR/pUaXgErNhkrEKt1sNEp3rxKFi69qRYSJOimSgrpHVca/l 3CHcY4MF0DHlwEjxHCA9KNj0wDek0C1W9Vu4JgCa6Oowydesv/+wwJXDfC/UK4ZGb/3s/p2KF01p+ humd0oWUOpQS5vYoPKS8fW+8uwkSaqOnHRfSK/4BhwThDIZ31MGbMG7Lg7NVLUsqvdgXI6d8ytQWs D69GRkUvjDqHzI5uFT9Btxpfz/rEx5yxnGvCoBojlOpblOFGK2IfhZd01M4aSeVX8fMfhWIu95pvT QyqliBnQ==; Received: from mail-am6eur05on2061.outbound.protection.outlook.com ([40.107.22.61] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkROw-00078v-6p for linux-arm-kernel@lists.infradead.org; Sat, 22 May 2021 13:10:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dC0PMzRkT+UnMhnyTxIUbu7S3/kbIbl/nuQ4B6kptm2XDiB05D5mW1QXAAxVb5+1loYxt8qx/y2JLHkDXQtBiNFijJK6UflpEb1tkbHkQ8h3xQnj7KV2NauL1aR1VQEMfc1iTk0Wq8kNblPa8yBxtV2sf7oMxBg2OFMGxcUokjdbflYzpCDdB8BdhaqXD/+uJckUvuKy2FKzb7DqY+D/3auhIHkM1yEbQQXrfd14YDgkiHS/4jXjxUGKR6x8g/nTy6PW72mSAwQ9Sp7OMC2meyWC0Je3adb2kwzYf0XDZjkNEf4kRNE/vrFvy7tzspiL2zB6ztg2dA89HAhpHj/Lcw== 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=Gm8D7o9Zkhoyic+N9lE/S6Kr9IT/0CYNpO5BdIwHQps=; b=mUW5tnNDKUF9YgFkie68nmaUJC/mqFrQmmFeEIDl97siCrpyg2SkUOyI+lRxzTQfw65qBcCiFFbave+W+l0z5o0wy3YJnUB4OUB01/6Dhh/NuAcF+pLQLSrCFMxIxtKUpmlrVMBPfIwqNkkCpX6J5SEMwfe2iP0CxikMo2LNNBieaIu/KRSxtsRUYmbsN/BQ8N/ZO/FtZxgsj9zthh+D+VPFZgSwDav4xA5F45caapYTBVx5hdsluF6eRutu8JjQApTkx4+unelRaeawXs20sibH6Phsum7laxnp62Bp4v8rGNXylsUvcwFTW07zLZk7XH7Bpl+UsWlUkbRGcdjaBw== 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=Gm8D7o9Zkhoyic+N9lE/S6Kr9IT/0CYNpO5BdIwHQps=; b=HLWB9d3FtoX2AkMtVT9+TNNQ42VvWF8z30r8+ohqqOb/3MYPYAwn0DP15hYXkiPPzMMOz8xhFRZS4yjTbdlcNpA9vhPgRhqUgiqTQVKjONcErvpGVRGtpgMxh2ckeG8TyoY13S3L6999kou3EemWpUYxNhgdgjSP+1Kg8TVStro= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:36 +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.4150.027; Sat, 22 May 2021 13:10:36 +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 V6 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Date: Sat, 22 May 2021 21:42:49 +0800 Message-Id: <20210522134249.15322-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22182090-b4a6-4148-b23f-08d91d22fd30 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:366; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DsPx6XkFdd8QH+B8fJ1nm3GW51R4iyarGeOt3ImkGJIxdlHb3RoA/U9Uzy4sAo8k2bne99NeJqGJWIurF+k37N3fKCL+qaCHJ897M74kR9h8Cy5sDsOnpXszT7a4V6NKiIKILKuWW/RwQoB+2g9x/KANHy7dXkOAOjvNUDSv8ouRwK1my/xv/bIR4sJ8cmkoA+5HBUzN4Bx6ZzRaEOMuO42ijcGpTB1+8PsIyGK8GdSXcEHnPLzqZJhPNxr3xUvCZOfC5dW/HtilK3gsUrSKJ4Z9O37UZEHxSTFKQvjoTWII0bxqWKXB9mSPBLWbyC/5S14nTgJUcu01YbfcD+nwg6gM/jKg5ku9ADSjqWL3EUqeTgbCYqOBjm2tItWe8qycKPJiY73Y4eAwQWLAL+B532CrGIiNSiHaslsOziqxg4w6dBrDJW0AkomZtXnp5BVht6QgmL3qs40PsbpYezTxL9yUtqtHYULykDQ17P0f8FweeBdVFEAIjwjrOwqQNeZ7hFEN3rRjidSm/BLmRyCeQK25CwCiBfb6qYZl9KPfgHeNsHdAiR1uhn01qcSF9+rvE9Bq8Bz68OBi/gby7duZK3lYDBUhgcBsK9O9W91YYfoZOz1kw79zofpM2iQfjW3HS/UZnH4UTnsLOV8bCAGntmbl27R9bWYLjgSh4nHXYjg= 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(6512007)(38350700002)(38100700002)(83380400001)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UhwCWWYqMFrF71MwN63++wOvG7e91WvmAUVaDfKX0EfbsvhmitavXcegxzaejl4VipdcMCpxURudFyTB8e4K8JSb64PUwjQkQbv5aGiJ1pwuA3WdwtcfH5Y9hd+eycTsKWtLMsR0YZomXAgPmOEj15rKia9LzKJlm5EtjYZZtT5LEe40fQJZF/3e+Mw8i8//buCVDHohGxNAw8uZYiTTtQ2fVWHLCvKc9QiPdOU4afcS/u5kCTEOmVacU4E50bK6bjM4oR4L2qPVKoZhIHaXQVRhvjQ90g9e6ZFvI+3rZiC6ajOIFVNkIJFcgKobn81B9Xl2ARfHu8SC/4uIuaZTtNAwv5N5BgJJSpM/kRrhtSUctlbPgKmx83pj7QXwWc+aR9zdXTrotJQjGHwXJQRoe/31Xo8qU2MxultBe8eN/tYFApS4PyvT8Du86ClLsIlvpQSBGOaJRkPn7hoHIC2mltvl1iMp+nmzn7LffN239mQoA+NaIcddJxZz8OdM7TThWhUFuHFNM6L+wiJfTEGqmt7S5TehL6hhCO+Z3bbRhC8hXyYwwpfiq2c8/ZZVBF1ORGZDEyAkgCtTDRHwkTegxzXV6CIWfoqBWmMoCIywPE67Lw5zhNYgMpB7tzwjf4omtzO8OJk7hhlCK8akzRZQKrYMEezovNFMPX6MDaArtyNky67RTLeXTUjVwZhp03s/iY5yC0C9zzpMZ0ylPmrpxlMjV2jQ27rTTTQTHDdyiR8w2VCcetiZ25I2VLdMsO+RMLGr6EzUvZafbYwpbHXcXqwzOwFz9EBIMjLrhen8qIlZh7QHg0nxNsxCfcFYboqBZZWXQI9ur0VyOa4Spc3HXhjsxNSCVrJPSWi81m3xjfBgVeOUKLQ40iRQJfSDCzzv66eHfXiCh02a4hN63vzIEYq/IfHhrzxXxJFTCk2uId81toRYpkusHqnc128uyosKcvM6nBCEFheUPfAo+1Z6Es/Y/wNV75RJcBcP3Cg/hfarMDVJYXETMy5Jk9MsV5ZA43obhaelLJklpFBsdNvyQxmvg+F1xnowwnnEgWe3FYYRz7KYjSLU9VJ0hM56Q1E731LOAniJxIrOo5v4bN1n0AIqP1+HOqOUeYF5Xe60fhOB2y8UoFWmVliqltBWmlqpRHq0QzLLe9sYMKWTLUfJlaRiKS9jQXfLun/FgZN4U43ezUb8K16sJY8tFFdf3DSD88VhcGlrwkiO3Sr04NU0rJi7g/amFlG+U5KXIJoDZa3urIK6/VD6HJO71uJQfiqEZDymeRqfLUbvKIj9ltsvEYTvlMmYSWoUVXsMNtZWthhEMudV/38tBLV+cDrN5YCX X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22182090-b4a6-4148-b23f-08d91d22fd30 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:36.5735 (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: jwpluOGRDMageS+HF7nshHgF36XcBESM2LI8Zu3l4G/mUPDWJttDf4xtk0MO3KC6vL04NsKoYHA+qHC9EYk74Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210522_061046_280173_FC4C29D9 X-CRM114-Status: GOOD ( 18.70 ) 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 SoC has dispmix BLK-CTL and vpumix BLK-CTL, so we add that support in this driver. Reviewed-by: Abel Vesa Signed-off-by: Peng Fan --- drivers/soc/imx/Makefile | 2 +- drivers/soc/imx/blk-ctl-imx8mm.c | 139 +++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/imx/blk-ctl-imx8mm.c diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index d3d2b49a386c..c260b962f495 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_ARCH_MXC) += soc-imx.o endif obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o -obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o +obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o blk-ctl-imx8mm.o diff --git a/drivers/soc/imx/blk-ctl-imx8mm.c b/drivers/soc/imx/blk-ctl-imx8mm.c new file mode 100644 index 000000000000..59443588f892 --- /dev/null +++ b/drivers/soc/imx/blk-ctl-imx8mm.c @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "blk-ctl.h" + +#define MEDIA_BLK_BUS_RSTN_BLK_SYNC_SFT_EN BIT(6) +#define MEDIA_BLK_MIPI_DSI_I_PRESETN_SFT_EN BIT(5) +#define MEDIA_BLK_MIPI_CSI_I_PRESETN_SFT_EN BIT(4) +#define MEDIA_BLK_CAMERA_PIXEL_RESET_N_SFT_EN BIT(3) +#define MEDIA_BLK_CSI_BRIDGE_SFT_EN GENMASK(2, 0) + +#define MEDIA_BLK_BUS_PD_MASK BIT(12) +#define MEDIA_BLK_MIPI_CSI_PD_MASK GENMASK(11, 10) +#define MEDIA_BLK_MIPI_DSI_PD_MASK GENMASK(9, 8) +#define MEDIA_BLK_LCDIF_PD_MASK GENMASK(7, 6) +#define MEDIA_BLK_CSI_BRIDGE_PD_MASK GENMASK(5, 0) + +static struct imx_blk_ctl_hw imx8mm_dispmix_blk_ctl_pds[] = { + IMX_BLK_CTL_PD("CSI_BRIDGE", NULL, IMX8MM_BLK_CTL_PD_DISPMIX_CSI_BRIDGE, 0x4, + MEDIA_BLK_CSI_BRIDGE_PD_MASK, 0, MEDIA_BLK_CSI_BRIDGE_SFT_EN, + IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("LCDIF", NULL, IMX8MM_BLK_CTL_PD_DISPMIX_LCDIF, 0x4, + MEDIA_BLK_LCDIF_PD_MASK, -1, -1, 0), + IMX_BLK_CTL_PD("MIPI_DSI", "mipi", IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_DSI, 0x4, + MEDIA_BLK_MIPI_DSI_PD_MASK, 0, MEDIA_BLK_MIPI_DSI_I_PRESETN_SFT_EN, + IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("MIPI_CSI", "mipi", IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_CSI, 0x4, + MEDIA_BLK_MIPI_CSI_PD_MASK, 0, + MEDIA_BLK_MIPI_CSI_I_PRESETN_SFT_EN | MEDIA_BLK_CAMERA_PIXEL_RESET_N_SFT_EN, + IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("DISPMIX_BUS", "dispmix", IMX8MM_BLK_CTL_PD_DISPMIX_BUS, 0x4, + MEDIA_BLK_BUS_PD_MASK, 0, MEDIA_BLK_BUS_RSTN_BLK_SYNC_SFT_EN, + IMX_BLK_CTL_PD_HANDSHAKE | IMX_BLK_CTL_PD_RESET) +}; + +static struct imx_blk_ctl_hw imx8mm_vpumix_blk_ctl_pds[] = { + IMX_BLK_CTL_PD("VPU_BLK_CTL_G2", "vpu-g2", IMX8MM_BLK_CTL_PD_VPU_G2, 0x4, + BIT(0), 0, BIT(0), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_G1", "vpu-g1", IMX8MM_BLK_CTL_PD_VPU_G1, 0x4, + BIT(1), 0, BIT(1), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_H1", "vpu-h1", IMX8MM_BLK_CTL_PD_VPU_H1, 0x4, + BIT(2), 0, BIT(2), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_BUS", "vpumix", IMX8MM_BLK_CTL_PD_VPU_BUS, 0x4, + BIT(2), 0, BIT(2), IMX_BLK_CTL_PD_HANDSHAKE | IMX_BLK_CTL_PD_RESET) +}; + +static const struct regmap_config imx8mm_blk_ctl_regmap_config = { + .reg_bits = 32, + .reg_stride = 4, + .val_bits = 32, + .max_register = 0x30, + .fast_io = true, +}; + +static const struct imx_blk_ctl_dev_data imx8mm_vpumix_blk_ctl_dev_data = { + .pds = imx8mm_vpumix_blk_ctl_pds, + .pds_num = ARRAY_SIZE(imx8mm_vpumix_blk_ctl_pds), + .max_num = IMX8MM_BLK_CTL_PD_VPU_MAX, + .hw_hsk = &imx8mm_vpumix_blk_ctl_pds[3], + .config = imx8mm_blk_ctl_regmap_config, + .name = "imx-vpumix-blk-ctl", +}; + +static const struct imx_blk_ctl_dev_data imx8mm_dispmix_blk_ctl_dev_data = { + .pds = imx8mm_dispmix_blk_ctl_pds, + .pds_num = ARRAY_SIZE(imx8mm_dispmix_blk_ctl_pds), + .max_num = IMX8MM_BLK_CTL_PD_DISPMIX_MAX, + .hw_hsk = &imx8mm_dispmix_blk_ctl_pds[4], + .config = imx8mm_blk_ctl_regmap_config, + .name = "imx-dispmix-blk-ctl", +}; + +static int imx8mm_blk_ctl_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + const struct imx_blk_ctl_dev_data *dev_data = of_device_get_match_data(dev); + struct regmap *regmap; + struct imx_blk_ctl *ctl; + void __iomem *base; + + ctl = devm_kzalloc(dev, sizeof(*ctl), GFP_KERNEL); + if (!ctl) + return -ENOMEM; + + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + regmap = devm_regmap_init_mmio(dev, base, &dev_data->config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + ctl->regmap = regmap; + ctl->dev = dev; + mutex_init(&ctl->lock); + + ctl->num_clks = devm_clk_bulk_get_all(dev, &ctl->clks); + if (ctl->num_clks < 0) + return ctl->num_clks; + + dev_set_drvdata(dev, ctl); + ctl->dev_data = dev_data; + + return imx_blk_ctl_register(dev); +} + +static const struct of_device_id imx_blk_ctl_of_match[] = { + { .compatible = "fsl,imx8mm-vpumix-blk-ctl", .data = &imx8mm_vpumix_blk_ctl_dev_data }, + { .compatible = "fsl,imx8mm-dispmix-blk-ctl", .data = &imx8mm_dispmix_blk_ctl_dev_data }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx_blk_ctl_of_match); + +static struct platform_driver imx_blk_ctl_driver = { + .probe = imx8mm_blk_ctl_probe, + .driver = { + .name = "imx8mm-blk-ctl", + .of_match_table = of_match_ptr(imx_blk_ctl_of_match), + .pm = &imx_blk_ctl_pm_ops, + }, +}; +module_platform_driver(imx_blk_ctl_driver);