From patchwork Thu Apr 29 07:33:28 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: 12230569 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4781CC43460 for ; Thu, 29 Apr 2021 07:17:52 +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 ABBBC6115B for ; Thu, 29 Apr 2021 07:17:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABBBC6115B 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=5AEWFCAOTqp/mptfOhY2Aqfty8YvjfCwns4NR8LfGOY=; b=GdoAULKKc9D68/K1ej/+z/iHv fr5Qfhk7lRJMmSXOtEJEog0CMuIZOkCuJpQ+3CYyh1OeW1YwEVBG2RxCysNlEYK1p6bIHQNqpVCBM 22FD7SMFCkV9QV5CEwzNPWQ08UTrNqMbgFDbJ7tBSNLsB3Tey2S9O7vgwNzzAVwairhpHtY2zuPJr VOr05m8KzK0W1FIptdaS9dSPL+d3q9RSNOE6cyinYDHeaZt8ZpPOYsbg4iuGEuhnRvxmYt4Wl6C8I R+7L/o0qIj2gqX+/cQGZvoeY99Mha5KgyOQ9BsFzvKzrCn113EWw1nMS3J7fSbxasc/WPdqfttVLO KU6aXHzyA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc0tk-005Am1-BU; Thu, 29 Apr 2021 07:15:45 +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 1lc0g7-0057wK-5V for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 07:01:39 +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=A+F9ydPzZQL7+HYXXydKkW6iHvplYGD6tVCXh+5X5vM=; b=jtRP5gMCQ5ebFo+IYR7zkspLB0 khksBMuBu/gvt6dOne/4Cngt5muKZ8ZRPuUxodw0Qpm9bfDeuF7Q1OhLB00pgWz7XxyRM2RN9TGq8 8VjnknPPVD12+UJNG836p/+ieCHqzEGt8WHkEUDlxhRUvFPLmaBkgvynuemNOv5bpf93kW8XLVjCA jMSznUhH/pYJ45OY1eLLhsvKiybkWUFkbli8wRSj1BLZj2bsw1QRkJnsbxiZ2H9yizs5PGe/ux1OI Qd6KQsWnNX+6FA/I/Be6+kOdSQ7od+QcNA8SI562I7hSrtYDUN79ftjykzSEuOS1uJ9GwRgYjb10/ fU2wO2zw==; Received: from mail-eopbgr130085.outbound.protection.outlook.com ([40.107.13.85] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc0g4-000QVo-Fa for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 07:01:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gTt+S9AtCMEGKGBtKr6uQ56i22aQMw6+73SSK0DA95IEE12+M0Feg3Ray2NvzNiLa42nwQnFkTYEuyTjxIU7mOetYCuRkmtOg3aYraLliYsjr8VPYxbRRjH9tg75cBPj8KvnqTBaje1009Fdamo8ix9dYeVX4q4tbMtRY+wzwRAYrjQBMgdeU5oj7m91SZ+x9EwHNl2hj/cZZQ9WuwUtaQJ+rqGWyoTuP9PPnKLMXdUuYdrZr4kEUAYDLRoQ7k3AhHyqU3wRouXk/uGTxXqeaQC9/hXCPdxNVvXQ6P+Szq2ssuq5nK8tWMcQwIpFDblEBg/Sr+K5eTo7QdCJPXv7tA== 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=A+F9ydPzZQL7+HYXXydKkW6iHvplYGD6tVCXh+5X5vM=; b=mqz9v3nkVVZwylIt9nwfEQP/baH1epKowLcFFVNtxHLHall4TxHXFKx7NlHIOqqvk+j/yPEdHvws9Pbm7Sa96JfkiyfLWeS8nESlY+FQaNORLqFGZyOho5MPCr5XJJPRmQS+KO6fXiILDFWXd7GsO5KbHCAI5CZBBeA0ODCQRExJ46glrm3s0Nyci0tUjM1HClpw06Tl6lU18MRLedfIIpeJtSXq0MmuSv6FskbnmInn4dDr/e6qA7wkuclmexU/msG0vOdWkVgq6mgPmQDs914O1nMYnCna9lACINfjYQjE2yQmurgxmlFFiB3x2+XGchPAOR/iha+8BKd6oHMzlg== 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=A+F9ydPzZQL7+HYXXydKkW6iHvplYGD6tVCXh+5X5vM=; b=l0KkSon1O8yUFgRzn8M9+qUzDcLVFHqCVdFT1ORQqit12tKTT5q0KcoaQPU3s0MqQQtGNiiEqY91QSOacEWyTt22DtAahUIIi9XU2VV5d63nIpU4P9yXXhYsDUFUs7BZfH22JMQQwyGsyEzTjf6t6LpEFp9Qa1IEyd/pwkwIJMA= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20; Thu, 29 Apr 2021 07:01:33 +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.4065.023; Thu, 29 Apr 2021 07:01: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 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Date: Thu, 29 Apr 2021 15:33:28 +0800 Message-Id: <20210429073331.21204-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210429073331.21204-1-peng.fan@oss.nxp.com> References: <20210429073331.21204-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) 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 HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.28 via Frontend Transport; Thu, 29 Apr 2021 07:01:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ae0a02e-669e-4a57-4106-08d90adc9f72 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: VJtkQ5iJYvfn5GS9iBPn1Vmj1PUqqfcmgcYGEwB+jYFwN0Jwj+dJKMadB/+baYzCK3bfSuXkevPogY8/a4rdQSV1PmUZWxtCZBpNPV+XbB7GvB/0tklzcn6N0qJQXNFlCetE3IiUEDTEUl3mlV+oEDs+a0K0OypwAAAi1mDTaK2XhtsUyPzNWGJmv5fcmt5om2b0x2b1VNc1KBnyzb+8GDWUm8xpPBIb3k+O0LJmWkw41Kn0wRnjGld885HBJc+ptwgF6IuZ5Sm9gbrFHhCw7D4kBc14Q1/HRFvRhZrFlvmSQ61XvMuMK045OYW1H/FlhDH3WtwcVnay4A6D62iycTHPPkw6FekijxOrJyoHygyEEcewO7LJsBex4Kd7A8Q1Y4CYQOAU+2CJaMiI01Tli0iP3dYSvPTG5ilCSCdSi7klp2DyD0UEYddiW1TH3Y1k03J+HJAM6tcnagqn16ZuMeRGf1EcFRawalFWj2bYQHvRGZXdZaWwDH7lT21CawrqL5Ycz4db3N2kx/S3+k4s48yzYJMWxJgzG2h86WAPyRvMT1zlGs+dWIR3iWeTB1u5jceiHehIMZdmLCLZMMmN3E5bE/Zu3UQybSM9v7GcGOPiWvzJ9U3xEehsYJ4fVU8SAvuw9n7xGRhnjJq1GPYZDQ== 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)(136003)(396003)(366004)(39860400002)(376002)(2906002)(7416002)(26005)(52116002)(5660300002)(8676002)(66556008)(478600001)(66476007)(16526019)(186003)(316002)(6486002)(38350700002)(6506007)(2616005)(38100700002)(1076003)(86362001)(4326008)(4744005)(956004)(66946007)(6512007)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: s3obxb+pt79m35ZlMCMKVtD0TqJXbF3lGM8DFu1kpoky5V7KbUxF1fKCrShjfaN9MBFYkExnDX294cCC4abmY4G2X2ldvT6s7rO9dVKz4P/WI6CuPaZmMgtDnLx8LGhkwqteeOaVPyl38QAqQTx5YYEB8gb+dNUpLhJoDnUx4lrekWhtq/ASwqQoO88vLJEddOu8oF3HGrFAa59WmG6xrguPuEvWSw7WD5qbC4/bNrwH6fK1n1zyXMNMOPd0SAHXPuNH1BauK+doGYY5zX5mlrj9VTCoYlTPmAkGvPailrSjt/yHGN6xYNFdMsN8GoPmvxSkCHrwdRjDqTmtnH4nFSk5FrGPgxlnhMYOZ86uomObMW9LF+1+US+6sfU31uDWFJ+hKZkYQW2OSVJrFt1HU612/CZzyX8G2yMMCv9sk4XFE0bsYpjWCuavKCWxLhJyzGmzn9P8LKba/RY+XO//uAMMamZc/CibM2wlAg0p4vR0t93uxzs7RTtwhEsnQUDDxvnep8LW7NuzI5fPcpVLSBmKR9Y6s8yqEEHGw9uHuYfs/lFm9P8RWRtrltcHnMUrRC6nxlqgTCWvidTRxwjPu6UdSGreSsOHeXOf/ZnlYX1JoIIm7zE8AVdsDT1O043UD2pVLfVLbsMho+KWq1yWqbBSzHlumkzpDvec1UCfejFozPopdDVYBmARKMJy96bHB7eXyAr1y1Lt4NlxAMlepzMfJhtLoQXG0j+p08vHC7EZ/+8PM5Q9ZjFdHvJTt7vBm5fdnAVPEMFMhTlY2Jcj1EATqC9lJ6M07vDhG7EYHiQj9Xp7hjaIXHW7aBsYk7rS5LWb+9I1hMny+8ZW+UGGHGx+oG0+d4D43/NJXgDiza01p49am/AeG6BQFEuLURhklZjhddm473SFvyUILeN768DGZd2aMU9CxT8lZYqnuuGab5Kl89FXszKBLuGZ7dYuhgeMnxt9/E7ybKiGuob0iJuLGTDwhS07e4io/PrOtI4LMaHnH3vhGS41uurZ4EDpUPKljwAMm5xF3Y1Wur0+ZJ8NB4YhU7RllzHNmdUkfnaOZB0vIGtION8W+xvgK55SMUXPVIM81DVTKgkzCnjuInldF/zd49GLGcuj1bKjzPOIF8IqGo8Qq4SaLInu43pi9ZsioWB4g80UoRy027DYNIS4nUFVr98ezrln9z9+RxPry3HolTy+1nzc0CxqA5nLse5qYis2xmhKFK5g3ANbXihpXDKg2IU2NR92JYXwMqYyWihOhMUZZWCGJzXfLX8C937dbkUt2XFrl0fCwQ1R6Hf9g0DtV0bfgRpyuGrhGdO/vIXN63dfSLJusIp3QpIY X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ae0a02e-669e-4a57-4106-08d90adc9f72 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 07:01:33.8171 (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: IL5hMkzLvZwuep3GeInkJA28ZB3tEzZDwnQVu9Uozp5sYudtoAno3D/WID/YjgYq+njqYJ2XLtuozJJYpyJjVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210429_000136_542832_3C237375 X-CRM114-Status: UNSURE ( 7.68 ) 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 --- include/dt-bindings/power/imx8mm-power.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/dt-bindings/power/imx8mm-power.h b/include/dt-bindings/power/imx8mm-power.h index fc9c2e16aadc..510e383d1953 100644 --- a/include/dt-bindings/power/imx8mm-power.h +++ b/include/dt-bindings/power/imx8mm-power.h @@ -19,4 +19,15 @@ #define IMX8MM_POWER_DOMAIN_DISPMIX 10 #define IMX8MM_POWER_DOMAIN_MIPI 11 +#define IMX8MM_BLK_CTL_G2_PD 0 +#define IMX8MM_BLK_CTL_G1_PD 1 +#define IMX8MM_BLK_CTL_H1_PD 2 +#define IMX8MM_BLK_CTL_MAX_PD 3 + +#define IMX8MM_BLK_CTL_DISPMIX_CSI_BRIDGE 0 +#define IMX8MM_BLK_CTL_DISPMIX_LCDIF 1 +#define IMX8MM_BLK_CTL_DISPMIX_MIPI_DSI 2 +#define IMX8MM_BLK_CTL_DISPMIX_MIPI_CSI 3 +#define IMX8MM_BLK_CTL_DISPMIX_MAX_PD 4 + #endif From patchwork Thu Apr 29 07:33:29 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: 12230571 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=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 9D4E9C433B4 for ; Thu, 29 Apr 2021 07:19:12 +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 E545661059 for ; Thu, 29 Apr 2021 07:19:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E545661059 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=Rt4ug5M104lesDBcobu1XLIDoCmF8Pnfbxx7O+Jl1L8=; b=OWVc1B+1rbk/SBscE10WirmtP H/TvkfiaoHgwZ4YL01wK4vnYwKkOECY8EhMd6MosQMFG2cJ+cxLeIaYMYsEyxLIiSSqU2qzbVIUzP wXCO5XgVvup1GlgY5Q84Wkdul6+rgdo7fUikKGwgDx2EKxIE5u/3E2EufdSh2M/zy7P4Vq/ok68rX GXlKnfBNFFUETtXTN7wtUQ/th2zGoCEV2F6bryPqVqqfxmbgkWC5lU0AjqUiqcvM32M8WGdVs5Z6e 26lGFvloJ/1d4Kfjya0INSPdwgP7AJwSv6CTB4CfZdDc/WR/q/ZEDiUrYpsRoxvMSUOLiZsOy8izd ZPw93ojlw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc0vA-005B1D-Je; Thu, 29 Apr 2021 07:17:15 +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 1lc0gE-0057yJ-0b for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 07:01:46 +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=L9dCdVio7Wn3zOEXiXm/kW3gmGUiXo2aSwgj2ZLgpLg=; b=TpsaH/VHbD7F+SR6/z18MCOWmk WV5bty6kmXnwKUarNGGwtRUm+5VgV65IEcqkXdB92oaKrXIuBvTFpKj6I8y72HHGRdvxFf2VZ/C/4 aiFz4XB05hLdO6QQNiJaT9hPU+jbu6JAkG744I42WECppKnqWcFE/uzjTH0KqQ4QqLvwUTux0wd+p r0TBkJg4OgvH33fCG1OH+1UiudvTlyM5gt+j54sfebIeJAJTIadFd9u+q0P/IpJ7dUunL+ZllbgQJ peGjvMGmeC9mYe4oABf5PLDy5G7bcP/91n5nIEmlETfPTfxyGucT8PDVCw2IsVy3X9R0wA+094Sdl 2Pb3CWzQ==; Received: from mail-eopbgr130048.outbound.protection.outlook.com ([40.107.13.48] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc0gB-000QWb-3i for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 07:01:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GvdBXaqp9dDv+J3CJzR34GQakeA/WgnUwqv+D8DMEcYnNKk2q+3e3GDCTx1V+RGYffHG3ngxI254QCrOiYP5bR7nSayxNct24uuivWQM4kfdW3Cfn6ntLVBcVSTK5Tulkj/luKjGztw/3R+P4RJByHZWx9/oXLVYxonm2wpYgE+yy9Q7pEVtQzP34yKLQJu/ECZ+9oK9K5BM8oPFaIv4j/krtY6ry+QwwpYcI3DCiIHuFQVpC7eIpRoVz7u86ckhcw+t9qxmfGzmijxkOrbiOMJY7F2bd0kI0IqewDGU6nSvcbgWjCIBH/jOMxg/JM9KSJM5XNBqo6SwMmm9Ftgo2w== 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=L9dCdVio7Wn3zOEXiXm/kW3gmGUiXo2aSwgj2ZLgpLg=; b=P8gNj1BF9v6oRmyokiRDd/9SD3l6Blln+3pIPNbdM3HYlOVj9AirZmZ5rkxymRwNaN1JezxwrcOWl6nCMNQUo5AGiiGdbfQrZ4cCzhwkmMouFv+E+Cq5Zy9p4pqWuyjMrMEh5s5PKYQxFbr5C4qbyqO5r6jrFn+4FSWBJtNU8U5c5bQy0ShBTN1u4K5O6VFnBFC3jU40+z6/woFwFeqoRIHgc0ofX2Za/BXWwG7hyP4b9S4ZYE14bKdenxxVYEj09fJhLT7ed9lW2eA6xnGzDrBQWe8e9cpyzoBD7UsMZJE1sEZPm5+0g56FhiM546T0BdBGDNVZgkOJ0eP7okcb4w== 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=L9dCdVio7Wn3zOEXiXm/kW3gmGUiXo2aSwgj2ZLgpLg=; b=Ss6H40JLFToAnVOvsCvpKXZMW0hpqShuU27uUsoq3AN5RJ0kxZykZK6J1vIwqNz35FpyXtOFwQDCJB4S7tTWVC9AO5n0AGMMaQJ6dVH3QeBWyNC8YZgp5KRLwI6PREhNjzvkFBGRitKbx9NMYKSjcRH3N5BJjm2Me8Lhk/Vx9mk= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20; Thu, 29 Apr 2021 07:01: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.4065.023; Thu, 29 Apr 2021 07:01: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 2/4] Documentation: bindings: clk: Add bindings for i.MX BLK_CTL Date: Thu, 29 Apr 2021 15:33:29 +0800 Message-Id: <20210429073331.21204-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210429073331.21204-1-peng.fan@oss.nxp.com> References: <20210429073331.21204-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) 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 HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.28 via Frontend Transport; Thu, 29 Apr 2021 07:01:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5aac3f2-2cf5-4d8a-47d1-08d90adca328 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PmN0EQNaTKJu7nmLn3qhz6W16y3fhv9N2wri1qYbT8qDK6mVV+lBFPDPz7mPY7thfIbuXDme67CwXov76KDPKZbmrj94EtLxh+JESMNtwp2ziyDk0RQ452kudoG4SWZCPaqxY1fDdpC2E64BvSWevt0P8CjMRCPSOx2UDKkQLR5p9QLLel9hRrMcvD7KrZ6G4VMj1+AyUZwNZbEayDU1bfGdJocsyJeN3QLazOC+5muAN65mLHthD/vC1p+JkJ9ByjchHZCr70hjNGwAHW9YmMmVabcResnKmSaJyF6VwvghhvoNtopqKXa5XK+1h707KATBmZ51he6f4l1ZgzoFCN9q5o6fW7D8b5HXI4JjWe6tPRtXCetZDZAbm+WWwIaeJ3zVDRzUp9WpP+nfjKYMet3bISmb0ehjIRrJx40tLwGn+q/YHkCIFdY8+W4Mmr2Y3mTqHeu1pta0FWu5DX3C+VB1TahXLCCZixoKdfJpvmfBpDb1XoqGJbXLX/APIouFcRlHWnb3GVhWxMyz7vqgI1CdMUozlZ98HPmsH8DvYmgmutyQcIMefka2bC0vOzHWVV8ppTHruREj2nX96mhlBMlkUS7QlGONDC3gRCKHbrlSmxm8Z948IdaEc+gMhDzEfZ6HooCBwQx12EejRpY0kmGsQjdSH3Ut3b/jr0kEPcEjCgbYmYF5GRWVYbqL1KYbHBiiOIiulTBYevWRD4sN4uMQggAHwHpQc+QRiZdl3Mw= 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)(136003)(396003)(366004)(39860400002)(376002)(6666004)(2906002)(7416002)(26005)(52116002)(5660300002)(8676002)(66556008)(966005)(478600001)(66476007)(16526019)(186003)(316002)(6486002)(38350700002)(6506007)(2616005)(38100700002)(1076003)(83380400001)(86362001)(4326008)(956004)(66946007)(6512007)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kJLzpNFzuh9bPppR0fgf89RD4bxqxMzOTqGQu3DYFfe72ib8GA8HLFyJz4atTbVKXDhJlwOWQu/mY2WA8Hpyc/2skWW2/Cv1/Wrqwho2JoNxPTiBBMuJrLkAhTjoT/Zm1/C4aG8koyBlgrYq8fBhpiWdx4RQXKBTo38BicF8AzJUf6RWUNl97W5fl5ac5JWU9G1C+TGp4gYZcjY5lOEV4lSnVP9AlQ+BAVy32RbGRmhR9Z0NhQSHCungSHxgolXrVCDpwIRA66BTOMX7VGjAATNIe/V/yO1fcwh7XyZKZG9dcMqHBWPi6HWOYdHOOCzhsFP06iYgn22vXPMHt7Y+wy60RWT9x0PLyQIW9IeMA0dDyw8gX/affva7AH1wj3RUnb/EYSmeAYKtYoIFFfTYPNwEbZ/BTWDYm9RP1kFmnbP67vVAXyu1FAWFPrOggRyfov2+Ub+cQC8XWvXXorQktEdTM3IDNfbnSTXKzv90lgGZzc/HM8iLIC6azaSzJ4owqg3zzGxQovr3OZbA9j00nXDpZdQjS9FUgZRqSncv2/yFkrr9OdpnLPqxCtKQkT8pZZSmSCWhVba8tSfuAc4aq/Ss2zAPNv4/u5YkkU8047PonAxFx20oPvI65NPGIJQGrdE+WRh7ZUOLvwrEbXFki++4h4wuNMNQEfaAeFJAkzStb80ILbO8WftkwXaBR457gmBXsUMyPca7l3GDIzw5/MG1v+0OnfhZ+IKhCLm1sFhNqE+APw458LIQ2zXjNXi2FN15HaYaXXwLHzv9SWCGpm7U8a0Yh8u337BDz1EqTL+RaCeaOvYUf3LEzFaVTwi+iz4RnTtLeGNwxyUIoJbH3boqgn2P4HMu+ZlseL5FKUcetrH+H817SgrvzAks5PJOsPjLQ1f27CiHHb65q4MZ+IeOJohVou1RICK1XZH6oNywWrmAoAC9TVbJxkbKxXwRzTvTHq0uc3dHoFGWKW3lsa2obfkwzOgdOs5zyDReqP/92ItISMLcawUWXUa7hpX4/IwP6VWTVnPaIMWVoD1Ir37O0N8fW/Kz4Yxn5wkBjrJmaA6tKL5f7/WonjAmWNOZaSPzfgyAQDPOVU5I6V1rdQHssS5yaYsNC/aJaT8rvqkiSc8fHUslUbmfLQQQIb0W2l6r1vGtod4pdEZ5fMDaJrRT3zA52NIBTrxrS1SyHvgDSNaNNROFEl7FcSjFVU1AUiSbIft4kaORU0dvyWvpib6EULjsHtxQFitXTAMV/VIuEdYoCKEjVVB5G7baiF3+dYMTJJgqkT4WqihT31rcdaWzifxX5yJ8ZmHBxGcVQe2pd73x6u6apwLL7rkEVs5D X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5aac3f2-2cf5-4d8a-47d1-08d90adca328 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 07:01:39.8003 (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: apLQ0l/i/jLKJKCx62fCFg7OlvSL4ShNAVd2VexfadjvMTumR5RP+WlUcWsQh3TmRI2minOpYQwJfezCSh1qCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210429_000143_184800_EBB938AC X-CRM114-Status: GOOD ( 12.20 ) 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. Signed-off-by: Peng Fan --- .../bindings/soc/imx/fsl,imx-blk-ctl.yaml | 73 +++++++++++++++++++ 1 file changed, 73 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..8160ce51a8fa --- /dev/null +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml @@ -0,0 +1,73 @@ +# 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-vpumix-blk-ctl + - fsl,imx8mp-dispmix-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 + + '#reset-cells': + const: 1 + + clocks: + minItems: 1 + maxItems: 32 + + clock-names: + minItems: 1 + maxItems: 32 + +required: + - compatible + - reg + - power-domains + +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>; + clock-names = "disp", "axi", "apb"; + }; From patchwork Thu Apr 29 07:33:30 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: 12230573 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=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 88C96C433ED for ; Thu, 29 Apr 2021 07:20:32 +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 B2B2561059 for ; Thu, 29 Apr 2021 07:20:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2B2561059 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=Ih+pRk8zjLB2XqvNQOjeJ7IldsWFxwqSHM3GDaLSqBU=; b=H/W2lnIgQSHFvaRIYkERGIPwd 9pXHVx2qWJYW9UKW44KIdY8nfN6A9kou1Pzg0vsGHU1ZmWka1yP+FpwqJper6MWlnEGq2b3VcdP7B Gcmqbh0j67nJ8FWR+6/plqxnj4nHOJmZsUc0U5/JFYx552G7DLlTG05RWJw8kI3e19n996I8IiFsI haGElCF9CqEXoI8cqizrkaOC2wpUoT4ThtBolvb/+eDhjSOje6PYKCYodEEf/0I/j9rwKZcVWJzrp lKxzSXauOssw+9LcspNjUH91T/nRBMdf5N8BNQRy47jUKWyNqRlWkgjcsz0AUivYYOmChz3LecaJs 5UCIQ1aEg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc0wE-005BAj-Gn; Thu, 29 Apr 2021 07:18: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 1lc0gL-00580K-5s for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 07:01:53 +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=+BWnfzYybWl/scTuY5FD9VOLt2LECai+WE378UnVPK0=; b=UhxXyfA4Fdc9d/iZwOqqOh/sCX TNuEC8RZywXVVNoERc2lgO/GS5EfdyRny3SOHts60YOO+JI6SkmA0ylPSrEdPuPvpm7psH/SLmroJ /7PfCP/18Rcyfc8VrEwPqc09QykAfq8n+cD2SSVFgQ92y2uTS22PY3xg3lwT7xRND6ALW16PGd1af zKIFbVVV4h/SGC/qFcRdIhP3dt/rQFGI7szDeQBXYgEPbJXCWQ+QizSMqw45ZLcAOvQYbNJLyVDrx t0HRa1tOPHQ3thAl35U6UWEH+kWLKrD4/Pv64WY61XBYQ1D5dSgfrwkS5l66yHqZtbmGoRjCpWbS6 0EsBdjTg==; Received: from mail-eopbgr130055.outbound.protection.outlook.com ([40.107.13.55] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc0gH-000QXf-Mk for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 07:01:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kgRke9f3gCeslv6Ze2ss2DJAVkXco08/k9ftlRDleCIt9+TNT7o8deP5tbQ/42c73d0ofnMruLFpDNw3kjQKxRMYbrhd8LQ8MU4GGYNHccPmvm+jCEjETeD5f7nrIeR8rHtnl11LW2lSyn4jcQbv3EZxzNkZIdEPEtgiBwZuWWlTMzOmqHHJ+Ogy9LIReKQ4CBWp3Nx8yknP+HEvnJj+HigFwb8WccrHC/OecLep67mjBcNbfK6BqBQE7pOo0Y/jQthwUgtDQpkGVqzrEdrzHajzUkH9GrQvj8NQW7EMtwiFqDphpGI1zN6sHChANrsUBjShWhI8Y1J+LS43yixwDg== 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=+BWnfzYybWl/scTuY5FD9VOLt2LECai+WE378UnVPK0=; b=cvmUU2S8PBOJAiDUWrRM0N3A3VXLLNj1CSgNp7uV3OYoSI9LQfNMHtNyWYt8BHAFgBkBkyrm6Wd+9whx8cIyqcSegSPfPEOUL/ZXzFor1qD6HvnXOz7Y6jO8VsbZKsGuT8n0nFazg0o50PItKEBKuoeZFBMapOph6JTvUsSSxbIw4VOW/uZrrx3VJUhyTi0RfM7tvSJ+FUoSxdduDnmFdgi26r/BbA90KqLkNhYcelQEzB+OqjTVFNWe2wWSS28pDiZO88MP1le1tVD9lr+C5EQIms+y0+XL2kgrKqRxo/9TVvnte8L3sIQcfJ8bHD9LDXMRrHtEVF+vpVD46ZziWg== 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=+BWnfzYybWl/scTuY5FD9VOLt2LECai+WE378UnVPK0=; b=QX7jJhP+AKsV1HWV0ZeTpuxBXpuSOiXhSAec3Kd9eAzvbw9jjan+T/1X8GImvgPejA2rD0kMUeflQ1jOMf4+O70IgGKUEkvxxI2z2xQzFDpIU3lxrOaw5F++iC1tt/qUO2XaSYvTEVG6xncNd2MDzCComiMS0MKyCmQcArTS88A= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20; Thu, 29 Apr 2021 07:01:46 +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.4065.023; Thu, 29 Apr 2021 07:01:46 +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 3/4] soc: imx: Add generic blk-ctl driver Date: Thu, 29 Apr 2021 15:33:30 +0800 Message-Id: <20210429073331.21204-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210429073331.21204-1-peng.fan@oss.nxp.com> References: <20210429073331.21204-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) 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 HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.28 via Frontend Transport; Thu, 29 Apr 2021 07:01:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e8b4f3a3-39ff-4b6a-6189-08d90adca6bb X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: 1JYeDeugnG1J6HwsLY5r8aeqK9heLohq2Rv/l+qmEF0pIhViQfcvvayBiGwllt5P3HhEylknC24cVZbVUwbFLlLiwLmiJDVIF3fyowW+jJTe1haVj9uXTVbuEzp58B/6o6RfganY9d437bgyXsA6t93BWlhTWDakvrsloiBf00w9MjbFqb+7IqVb2kpfQsr5q54UIUObWJM3SjQg/NbKXzvL/WjaPiFPAZgKBq0hw+4PqYa3kMbWGqXgS8tTPos6/Yk5XwvT6lZtn6yz/NYqrJrpHqP9BJZJ3dBvrpRZcm09qqKt/P1VDajOJmbGcJbf2R69VJ5wmUjbOHGZqr7+1boZO3Z2v3ZVVQtVQxAB42EUrTkD3h9IRRE44dSQkhMomWuDVxmItoN19Tiq45pZN9dVDbObK9FoOqs6OwW6e/fp24GZXnJ4jfxTwWpC/Msz3KcMKgoZWCNYvGUzT0alXjr66ceKg9czDj//hnwJg4u690IlaVB6Y6brlXuoKxaCXp62KYOtI6XImMghigwPzYP20wx2eHef3F6iX0h81bSZZm+KPzOk+1XtPudzxc7eUb4Jp2aq+W2cMwPk2PO5Y0YuZwb8hjniNNSCKC2OzusWmgsYfGHhM+JJ1mMCY3w0Y9pdQBxHVL41Ia8V9gsqngLyrUYGwRclvtCbQnOnqig= 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)(136003)(396003)(366004)(39860400002)(376002)(6666004)(2906002)(7416002)(26005)(52116002)(5660300002)(8676002)(66556008)(478600001)(66476007)(16526019)(186003)(316002)(6486002)(38350700002)(6506007)(2616005)(38100700002)(1076003)(83380400001)(86362001)(4326008)(956004)(66946007)(6512007)(30864003)(8936002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yGSmQt3rcTfHmLAkE3FRWRtvcUJt4ydsdmzH/J4UtouicG8mq590d6fnzteJRjAUyl56KEfVk3+WOwOe5w6uMlosOs89NmCClAbdwNoNPaJg+kjZVff8D5li2NNzvTcrEUbSFr/Vr+LmbYb8XPN39nmCFd58vscvkuAYc1iXy7SzqFYt9CmcWz3Pg7YK9I93MXQ6CzRXFeVForlz/vAQBFV0SNa4kwpXMs1CSdCOxpDmSbvyQhSDWJW5uRB0vRtutcRaZZlYhhgV3b5NdKdHBgiswfspMjXxtM1luB6pcTjxmsqdX1PuoG2O9RxPIoT2xmFvVYYls04V5jMjdHWMXEKYpxPx3T0bj+yrjlXJTf/y+/VYbyaq0lDSZiBR8uNXrLjsbui/3QJlcdWP5xWssHu1/XwaLDRBdrT4mT0ZZEq1mCn3vEgO/cC+tx7DlHUMEr0Daqho9xSxZOkd2+/2bE4893U1cceqwUzxqEStfjlApS9go6k4tYSz64b+MZXIvHhXQ02aErHJkYQH3oNCh5cPZmC1a2abcl/uN7kzi1G8zqRLmuSQvhn0VltBaYm3BuoNeYXsaIedgM1Q0I5e70wRgrdlFkl20NVX6KBv7LcKrraewEFdfDygDDX4+p6NNlIojJln43i4NBUjhT+OXWPHrr/t8r+MNob1RHIMQaNdyZ2QL8a3GNiVPujzOgAIfZvxhSbKJCrpWhq2L1A711gwxtyTkZNfa7z9z6LFOA1zDWlf/NjnGo7nrfTfC6NSffSHQwo9VBQUSepcJA2tQiRzA0tbTiAZN2a0/FB21vqVo2+dqPSZKO4wmidVK6Dwx/JhlyumHRvbJDFJnclpYsKlosN6J17fR1y9dE6jO+HxIxW+SwXU0ZSQddsUkv22vLMO3t4Nc6kmJaUvbs/en89GNi3t8nPScqX08DIFQ/xPXaSEBWDR/gg9e3Wo4o/Q1oDsOg2CnW+uPXrpIAdkAv+Cr27uhWWvepk81UIuQ0nReqIfmM6iloycHQqMa4f5MboX1Giodx7nSb3FZmmDocsaZ70NtCoKX9xuVR8YX7UEdp8ad+VarPWXIn9Z7pXy+ubLrcm/D/rW61h5XDxVUdiIA9+lrlZ5sZAV4n062n98nckjqLcxa8fu0adLbsGkN68UU/OjrzHD55offePWiXunfY2OVMnf4ZJZSuvCEM3ptqhkWvtRBLRgmAeKwnSAHTKAB+y7sCx978nPbfqaBhpwHoF5TZlcpsAnSD7Lqenf76OWWzJoHc0zbpdpsqN1WDJNSNr0KKdjZzgyXttM/gUwQK5afbHyX+m0X59ZtJgiad00t/01bpqyfX7O1CW/ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8b4f3a3-39ff-4b6a-6189-08d90adca6bb X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 07:01:45.8595 (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: sfd2/cS/MxOhG3KRxeFXTFyW2kNdXikLzdbQ3ozrA3SmsA6DGbJTrRms+z02YytqXU1YuSHHFkT0JJaUw1d9Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210429_000149_946295_8B906292 X-CRM114-Status: GOOD ( 23.64 ) 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 | 303 ++++++++++++++++++++++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 76 ++++++++++ 3 files changed, 380 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..1f764dfd308d --- /dev/null +++ b/drivers/soc/imx/blk-ctl.c @@ -0,0 +1,303 @@ +// 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 "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, pd); +} + +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); + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, hw->mask); + + /* Wait for handshake */ + udelay(5); + + return ret; +} + +int imx_blk_ctl_power_off(struct generic_pm_domain *domain) +{ + struct imx_blk_ctl_domain *pd; + struct imx_blk_ctl *blk_ctl; + const struct imx_blk_ctl_hw *hw; + struct regmap *regmap; + int ret; + + pd = to_imx_blk_ctl_pd(domain); + blk_ctl = pd->blk_ctl; + regmap = blk_ctl->regmap; + hw = &blk_ctl->dev_data->pds[pd->id]; + + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); + if (ret) + return ret; + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, 0); + if (ret) + goto hsk_fail; + + if (hw->flags & IMX_BLK_CTL_PD_RESET) + ret = regmap_update_bits(regmap, hw->rst_offset, hw->rst_mask, 0); + + if (atomic_dec_and_test(&blk_ctl->power_count)) { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) { + dev_err(blk_ctl->dev, "Hankshake fail\n"); + goto hsk_fail; + } + } + +hsk_fail: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + return ret; +} + +int imx_blk_ctl_power_on(struct generic_pm_domain *domain) +{ + struct imx_blk_ctl_domain *pd; + struct regmap *regmap; + const struct imx_blk_ctl_hw *hw; + int ret; + struct imx_blk_ctl *blk_ctl; + + pd = to_imx_blk_ctl_pd(domain); + blk_ctl = pd->blk_ctl; + regmap = blk_ctl->regmap; + hw = &blk_ctl->dev_data->pds[pd->id]; + + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); + if (ret) + return ret; + + if ((atomic_read(&blk_ctl->power_count) == 0)) { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) { + dev_err(blk_ctl->dev, "Hankshake fail\n"); + goto disable_clk; + } + } + + if (hw->flags & IMX_BLK_CTL_PD_RESET) + ret = regmap_update_bits(regmap, hw->rst_offset, hw->rst_mask, 0); + + /* 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); + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, hw->mask); + if (ret) + goto disable_clk; + + atomic_inc(&blk_ctl->power_count); + +disable_clk: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + return ret; +} + +static int imx_blk_ctl_attach_pd(struct device *dev, struct device **devs, char **pd_names, + u32 num_pds) +{ + int i, ret; + + if (!pd_names) + return 0; + + if (dev->pm_domain) { + devs[0] = dev; + pm_runtime_enable(dev); + return 0; + } + + for (i = 0; i < num_pds; i++) { + devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]); + if (IS_ERR_OR_NULL(devs[i])) { + ret = PTR_ERR(devs[i]) ? : -ENODATA; + goto detach_pm; + } + } + + return 0; + +detach_pm: + for (i--; i >= 0; i--) + dev_pm_domain_detach(devs[i], false); + + return ret; +} + +static int imx_blk_ctl_register_pd(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; + int i, ret; + + blk_ctl->onecell_data.num_domains = num; + 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 = devm_kzalloc(dev, sizeof(*domain), GFP_KERNEL); + if (!domain) { + ret = -ENOMEM; + goto remove_genpd; + } + domain->pd.name = dev_data->pds[i].name; + domain->pd.power_off = imx_blk_ctl_power_off; + domain->pd.power_on = imx_blk_ctl_power_on; + domain->blk_ctl = blk_ctl; + domain->id = i; + + ret = pm_genpd_init(&domain->pd, NULL, true); + if (ret) + return ret; + + blk_ctl->onecell_data.domains[i] = &domain->pd; + } + + return 0; + +remove_genpd: + for (i = i - 1; i >= 0; i--) + pm_genpd_remove(blk_ctl->onecell_data.domains[i]); + + return ret; +} + +static int imx_blk_ctl_hook_pd(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; + const struct imx_blk_ctl_hw *pds = dev_data->pds; + int num_active_pd = dev_data->num_active_pd; + int num = dev_data->pds_num; + struct generic_pm_domain *genpd, *child_genpd; + int ret; + int i, j; + + blk_ctl->active_pds = devm_kcalloc(dev, num_active_pd, sizeof(struct device *), GFP_KERNEL); + if (!blk_ctl->active_pds) + return -ENOMEM; + + ret = imx_blk_ctl_attach_pd(dev, blk_ctl->active_pds, dev_data->active_pd_names, + num_active_pd); + if (ret) { + if (ret == -EPROBE_DEFER) + return ret; + dev_err(dev, "Failed to attach active pd: %d\n", ret); + return ret; + } + + for (i = 0; i < num; i++) { + for (j = 0; j < num_active_pd; j++) { + genpd = pd_to_genpd(blk_ctl->active_pds[j]->pm_domain); + if (!strcmp(genpd->name, pds[i].parent_name)) + break; + } + + child_genpd = blk_ctl->onecell_data.domains[i]; + if (pm_genpd_add_subdomain(genpd, child_genpd)) + pr_warn("failed to add subdomain:\n"); + } + + return 0; +} + +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; + int i, ret; + + if (!blk_ctl) + return -ENODEV; + + ret = imx_blk_ctl_register_pd(dev); + if (ret) + return ret; + + ret = imx_blk_ctl_hook_pd(dev); + if (ret) + goto unregister_pd; + + ret = of_genpd_add_provider_onecell(dev->of_node, &blk_ctl->onecell_data); + if (ret) + goto detach_pd; + + pm_runtime_get_noresume(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + + pm_runtime_put(dev); + + return 0; + +detach_pd: + for (i = blk_ctl->dev_data->num_active_pd; i >= 0; i--) + dev_pm_domain_detach(blk_ctl->active_pds[i], false); +unregister_pd: + for (i = num - 1; i >= 0; i--) + pm_genpd_remove(blk_ctl->onecell_data.domains[i]); + + return ret; +} +EXPORT_SYMBOL_GPL(imx_blk_ctl_register); + +static int __maybe_unused imx_blk_ctl_runtime_suspend(struct device *dev) +{ + return 0; +} + +static int __maybe_unused imx_blk_ctl_runtime_resume(struct device *dev) +{ + return 0; +} + +const struct dev_pm_ops imx_blk_ctl_pm_ops = { + SET_RUNTIME_PM_OPS(imx_blk_ctl_runtime_suspend, + imx_blk_ctl_runtime_resume, NULL) + 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..e736369406a1 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.h @@ -0,0 +1,76 @@ +/* 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 *parent_name; + u32 offset; + u32 mask; + u32 flags; + u32 id; + u32 rst_offset; + u32 rst_mask; +}; + +struct imx_blk_ctl_domain { + struct generic_pm_domain pd; + struct imx_blk_ctl *blk_ctl; + 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; + char **active_pd_names; + u32 num_active_pd; +}; + +struct imx_blk_ctl { + struct device *dev; + struct regmap *regmap; + struct device **active_pds; + u32 pds_num; + u32 active_pd_count; + struct genpd_onecell_data onecell_data; + const struct imx_blk_ctl_dev_data *dev_data; + struct clk_bulk_data *clks; + u32 num_clks; + + atomic_t power_count; +}; + +#define IMX_BLK_CTL(_type, _name, _parent_name, _id, _offset, _mask, _rst_offset, _rst_mask, \ + _flags) \ + { \ + .type = _type, \ + .name = _name, \ + .parent_name = _parent_name, \ + .id = _id, \ + .offset = _offset, \ + .mask = _mask, \ + .flags = _flags, \ + .rst_offset = _rst_offset, \ + .rst_mask = _rst_mask, \ + } + +#define IMX_BLK_CTL_PD(_name, _parent_name, _id, _offset, _mask, _rst_offset, _rst_mask, _flags) \ + IMX_BLK_CTL(BLK_CTL_PD, _name, _parent_name, _id, _offset, _mask, _rst_offset, \ + _rst_mask, _flags) + +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 Thu Apr 29 07:33:31 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: 12230575 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=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 1633BC433ED for ; Thu, 29 Apr 2021 07:21: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 54B9E6054E for ; Thu, 29 Apr 2021 07:21:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54B9E6054E 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=tVInHSPVIb/aJ4f+ln3J6ykqG0cHhxsR+Ly8KPKhpAQ=; b=cOpOHtUjC5NhFVSNJRLq2xsCw 95vxGVEDUB0uwxfnnaAoZwHXpn8d4oAqj6NFvRv7gK7M/TbyZhELDWbOcGvN0saZntjMqa390VI5z 59CHrzk9+BzOcVhsH2nh6SLLJyFopdDOFidKvWcKKzIUXTF6vKUc+IAkOLH5swvoIDgsAtd9geeTA 8esNkT7gRF/eJiF89gVX9GeVGJAaCmGCrPibxrR6iOmdwiw2LSTLZKvcJrJUW/uBxBSV6Dn2CI2tA Lur6K/blecRN92WjjvNST8z4bVSHYVcYkTBTxjjb/+RNB1gN5bXXNfEsGd9eC7zDEMvtf2z8y1iU3 JC8uWXjcA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc0xR-005BMp-LD; Thu, 29 Apr 2021 07:19: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 1lc0gQ-00581y-6B for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 07:01:58 +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=h15TxzHnPEFPnun3tKl5O+7Y9A7E+k+i03nQ5iN1Pdk=; b=mpfhGDZZq5nizMHrHefeex8Yfa fw9a2Jw+ecgmJxoHqGM9osUptTnCxGbzUmcIKiU4n3IbvQOCa9w2+K0E7jWf37XkVdC20VffZhblL ofCfUQqX8wdU286oC0ZALJGlncDd9IG/vJa4En08ZqFTaXYqdeaaFaX4dT5ByOSiyPRs3LH8rQ6zb XK0AMAcIqRBhMkGLbFTHY4o5i51gdzSZuPUzCpKaxXOwV8FiG5pameBqYGq5+3SScqTNRIS8k38p3 8giM667YHiWS31y43mtzA3qhh1JC39D/z9L0n1rVWusdsa5fw/gvHD5qGsE/rs+x6A0XkrNaQ0RvH REorHySA==; Received: from mail-eopbgr130043.outbound.protection.outlook.com ([40.107.13.43] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc0gN-000QYB-9k for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 07:01:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QCUt6qO8o7TLe9KRjHH4GxjO4a0MtSFgzHfq5jD5moVQ4ixD3GlCjtNRiP1m+qThTUYtitJz/201e4cCnck2m8m2b3p1ZJo9FE5dRdHWvEX0Fl2p62/gKuOTLDmXVIjlyb5ceK53fk8yX7npAYAhmv9CfS7kh3bXGA2MuBfTTnNlUVRDde3j7QF9+mjtdT0iAg+NRjoKeqRre/91OB7IlKH+OY2C6sIz1ke4f2GXn4BHMs51NfPWDh8IK/kUzKYiR5JacUTVFJfcJpDtLk/HmdR1dH5VPsbMufTj6/tLMt+uymcz7dLHhjc8HTluXxKa/jauUxpsZ2NQlD/3emmxPA== 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=h15TxzHnPEFPnun3tKl5O+7Y9A7E+k+i03nQ5iN1Pdk=; b=YhQlhXwn46kRFccDadIb5AG87Ap6l/PsESuoFdb6kCVbidFdmgYI06BVp/DtT+9gA/D3ZLwzcSL+fOcKhbPHw0sr1aXG/6EfTdYB3cFrJ0ricT6oozXTOlhjNVqVBDilA2iDPnPQNhvUrgjTrFDQMombqG19z2ZYod1hZpi0X+sD2/XSl9TOPtZY7bshoAEwmcJzkyqjr68hPCJ1aylDodXdng6Qo3mameG5Zb8SaIaO0HOU2kWQ3Fr+myrKhsuOYmEiz1ZQkxm5EgJXFtFqvArXqGiAO7iCNRcILvFPSiABtlSAsf2VI9cbmAe/cHu8Wajgfz3gzgUkUBKOjz5BkA== 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=h15TxzHnPEFPnun3tKl5O+7Y9A7E+k+i03nQ5iN1Pdk=; b=JS2pYwwMee63+IqYc9abcE/KPAmKSgxlc76o5DgDhIxbHovQMHeYjOTkE9Wdhe0iUalieRPw2S7ADAjoRxDwOXKIFNDiEFamAoAYIr9pt1roQXFE6SEo2wqL97aK5Rh+/LavbDmjP5axDRW7MSIKUDn0ifuUEV/qRTQbNsyZuB0= 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 DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20; Thu, 29 Apr 2021 07:01:52 +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.4065.023; Thu, 29 Apr 2021 07:01:52 +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 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Date: Thu, 29 Apr 2021 15:33:31 +0800 Message-Id: <20210429073331.21204-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210429073331.21204-1-peng.fan@oss.nxp.com> References: <20210429073331.21204-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) 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 HK2PR06CA0016.apcprd06.prod.outlook.com (2603:1096:202:2e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.28 via Frontend Transport; Thu, 29 Apr 2021 07:01:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46a8b33d-6164-4a7a-8fe8-08d90adcaa68 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: 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: FIGYx/YOzCgwkDOkHdPLeOxVoNcUaWLX+m4yga7jsc9WETbM6h502vmSm2iR/iRaE6tX1OBTCJPdGFJ9zLQrSmhF39wKMzA7llX7nHYBeBi9t1oALL1BzVYIXpJQob9LPLgZ1KvbM+FX9oGmfx7xIck+ME835zdDlmQfmr7oy0r8dG1WnBAbS/07ntMdqIOX+3kMACrhjpRXlJaWTVJjK89C1996TbT/XDhQd5Vg1IRCf2615jJoI/zbbW1BfEYTvVKMpI43asXefhjxgsyjnl4kkWOom1Xlfj7jb5D48auejNneyB7yCpIJLwY/3tNCw80wP+4a+Q+qw7Ml5q2UN/NwwRjQ8HI+ZLZdG02sUSKTPMTXu237G6ywrSe6CU66vnmQAkunqOSMCbUddIxDhLIj7RBVWZfNbYueSZxMK7EXy6DFuXl7yFM17N4nsVc6osYycSgkbavoOkoBYW/O0nn60FA8KZWGMi/cF0qMZ8DiPPAyPZ3QIN1exIMcBEnmaZchP9b3FQcDI1/YnT7jjHM5tyJcpJzW6pLY5oQ6uLggz2XvzMwhQsVBLBZ4tvYdrnoRwmzG4zb82H+rzWJcmbQV2LV1G6/d0LVkNsGBo0Ot9VYf8BrCsvE6jcyxiA5pGntCzxQZdKQgGisvjTUiuqjwNXHVoQl5/amUAjycs4k= 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)(136003)(396003)(366004)(39860400002)(376002)(6666004)(2906002)(7416002)(26005)(52116002)(5660300002)(8676002)(66556008)(478600001)(66476007)(16526019)(186003)(316002)(6486002)(38350700002)(6506007)(2616005)(38100700002)(1076003)(83380400001)(86362001)(4326008)(956004)(66946007)(6512007)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kyKknwp/9GtWZcQlSkWFpuE9EiNK8HeNx49hURQi/QSrA2gNuV3E8asmcDWodumeWC2jaSpZQlWNtLtZWsSF45QmXDHHhEI+IYaLr/Og+v4/0yQQd2oDDZXiMrzQGmbKmO7YcbtmIH6J0cmZPSkwXW5I0HZ9eMkjb5g7y2pUyOBcrXApVOSu85T6zP9XqXQgkXOeQVixwZioFdO5ZKLC/WWE3mE1tUg34iFiN1qEYDNaH4szDKYozdzk4+NtFLw9rzFud/JpPFrRYd/1raQTdc/G7cld6/i5rkhzMuQJPoQdwzx/zG95ynuMjU16nUqnXhF7HWoNhOSp8dPXkdlXk9flsQ5nLfQ8G0BaS3uKmmhmjGI1vrHhEDwf8Hg7hFr/z0awjEqKcpK2yxI28/h/tJ8/KF69WpvIOLHtZXWxATkGbBJGUIw3tX1NaT2PClm8u6jvkCYNHF0VQc77lDR7zsVEYSUlxZJH0FWsc4aOjgl4HZgFW+2r532avK+gzUPbBM1v/aUsOtlo5pYsQziGwQfXR1Xp9PVaMblnK6KYdlWQD3F9a89nRXH/Lt4Ych5xFtygatQyna730Pr5ZGWLj7OG39YbJcJGOKi6Cwzxg3CirwF7M+2oS97GyoTwHI0Ga3wwyIh5ke8L7x8MFONhIV7lsput2NbIp6iP//qNf0rvn39yraEZTKCycBw2z6uoNIWtY0q4bCYbYdwmFGTGA+36K5ZsWeJVcQOsBcbdIp+tVJ8Ez8+ly1yBr/hsoJb6UUeqAi4E5dyETB9YHCPaPv4OB0f9nWcPp9eFDkKUkiTjDHvzYeS0yxEzyW5xo6VaEo6S5J44bseRgl7Ync64Gmv1N68xG/ykp9eiyq5XZ3ahA+sZbbIji/wJ1KHQZqErHVS53+MOprfNxODX53rE1xWJjZ0ZI7mm03TkLhlP0QkGaaOUshO/DhaLvRfyC2B02SUXh276hmhlGMHNVrHxmNhycYUUeypYKaby0iv++Xo0ZU9ywMagwARen3XrGokuuaOCMV3YOWINyZi7neVTid7wrJILv3CkxmIKMzVZPvM8J6wjhUKy92SThT+ZH8k2vmvhmFoLgpAeU2lfvinjVrZJKyaq7zPhgUlF8Mz4PU0QM1JBEnIgGA589QYWitnzUxU/9KkUOCnVS3FA1AA5VgR7TFvP42dYY1b8ixKJGffQmhcXCT8klomGgWbgvLCqwL5WGBP92Mn8iICbEVpnqpZ8K92QNUrogqAYyMkG2/gzCcdNomMYyv7JpPzHtXnUbjMtuJwEuALwRR8q3SMfYLnwUNfYiBZkNVv8RQniGZ84Wfzfuj1ph+ip7n1qZcpV X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46a8b33d-6164-4a7a-8fe8-08d90adcaa68 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 07:01:51.9647 (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: 28o/qFODxeCfW2wkUJpBYSt1BPTfSThNXXdbm2nUAaIyf1A9C6jEggcxl5lq+WLY2ET81LkTifOTLRCDSX5yfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210429_000155_371679_F9233B1C X-CRM114-Status: GOOD ( 19.13 ) 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. Signed-off-by: Peng Fan --- drivers/soc/imx/Makefile | 2 +- drivers/soc/imx/blk-ctl-imx8mm.c | 138 +++++++++++++++++++++++++++++++ 2 files changed, 139 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..77e0a5d3fdac --- /dev/null +++ b/drivers/soc/imx/blk-ctl-imx8mm.c @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021 NXP + */ + +#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", "dispmix", IMX8MM_BLK_CTL_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", "dispmix", IMX8MM_BLK_CTL_DISPMIX_LCDIF, 0x4, + MEDIA_BLK_LCDIF_PD_MASK, -1, -1, 0), + IMX_BLK_CTL_PD("MIPI_DSI", "mipi", IMX8MM_BLK_CTL_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_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) +}; + +static struct imx_blk_ctl_hw imx8mm_vpumix_blk_ctl_pds[] = { + IMX_BLK_CTL_PD("VPU_BLK_CTL_G2", "vpu-g2", IMX8MM_BLK_CTL_G2_PD, 0x4, + BIT(0), 0, BIT(0), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_G1", "vpu-g1", IMX8MM_BLK_CTL_G1_PD, 0x4, + BIT(1), 0, BIT(1), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_H1", "vpu-h1", IMX8MM_BLK_CTL_H1_PD, 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), + .hw_hsk = IMX_BLK_CTL_PD(NULL, NULL, IMX8MM_BLK_CTL_H1_PD, 0x4, BIT(2), 0, BIT(2), + IMX_BLK_CTL_PD_HANDSHAKE), + .config = imx8mm_blk_ctl_regmap_config, + .active_pd_names = (char*[]){"vpumix", "g1", "g2", "h1"}, + .num_active_pd = 4, +}; + +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), + .hw_hsk = IMX_BLK_CTL_PD(NULL, NULL, -1, 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), + .config = imx8mm_blk_ctl_regmap_config, + .active_pd_names = (char*[]){"dispmix", "mipi"}, + .num_active_pd = 2, +}; + +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 resource *res; + struct imx_blk_ctl *ctl; + void __iomem *base; + + ctl = devm_kzalloc(dev, sizeof(*ctl), GFP_KERNEL); + if (!ctl) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + base = devm_ioremap_resource(dev, res); + 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; + atomic_set(&ctl->power_count, 0); + + 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 = of_device_get_match_data(dev); + + 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);