From patchwork Fri May 21 10:59:15 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: 12272837 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 E6139C433B4 for ; Fri, 21 May 2021 10:31:01 +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 78612613BD for ; Fri, 21 May 2021 10:31:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78612613BD 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: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:In-Reply-To:References:List-Owner; bh=K3un8sAt3iIq2bNZFN6+Nct05/sTxnNB+QDLbCBzCOg=; b=eRiiivHXd09t24saF6kEzgxcSA i61a/cQcHrkFGeUixjNmHkeVgcQLyOozaZCWwkDo5843tilke38ISrufraBq0PgYLSjGoVSjLNFMq AiwjR+MZ75547gMvsU1wNC7B1E7Lfo9r0AzAJIk5oswQ6CxH29JF7Ay2oPykLhNCqNrqKTNn3qVCU t04scpq7lF7uLCgPSXLrxvB/PoNxi2Oxqm7t8c4qg2F64ubNigdupcmIYPf6Bmp7qRrln9jqCg/LJ G4qTouP//yTMi23wQEovwWxKrdvQy0xgbRvc9aoz0xMZJeMqEMIT4VEpL3JKqaOs9ub+LfCITRUgW RuFWR6jw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk2NA-004uBs-Mv; Fri, 21 May 2021 10:27:16 +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 1lk2N8-004uAj-6f for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 10:27:14 +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:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=HyvQprL6EURJbUNZ/BqipUJ0FzfSkWQ/UyPpEeuhNYU=; b=R1eStVzxqVr2ED/cw5onEseKIC 3p/p2oTDD4gA0exXRRkXO19Y1eytYcJvV5upI2Vapcn0oOBOj72GHcrfxVYWaJYoYwG/OWHkjfSxv dSuf3kv22b+LSugISNXpcmkq98HGkSo21Jxo5SwsUecjHxirRatjFmYTPeWoZWAGL4EnBZYTSVEB+ EvUn0vmenpj0WiFqGMiMfz/WiWUIXudRcs2dtix7wpekZtoS8ucxhSH88gNwtu3AUdK8sqCHxroht qMtZVFaNiLOjZlGb3TZKm7Cx54TIVYaFWC8eSgb7p9FXhkXlKuYs1CleV/PqA2u9roKS3QH8wax61 RVxITnhQ==; Received: from mail-eopbgr40069.outbound.protection.outlook.com ([40.107.4.69] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk2N4-00H23u-8e for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 10:27:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cTHbsYnjwzmrq+DJLK+irVdY85ETjmzu0XOkaF0aENTMG3h72cCIDq3zvP95uSPLN+oMN/QzWw/cU5Ppvh9+EUbyTpyYvtJTfPPJ7zYCL5ysCRXZAz8FXeYCxFWh9Qip7acEQiBeC6qaJ3vE1gLnYyS78StbGIM1bDm5EL3UxoHKDjbkevyX4tno1g+7jU1Bmbej+7+FXmd8JgfxTQaz3bKTvg89R6kpCa21VisotA+tMyQejvnotABXLix4qvD7tge922vMV2pZioizBCAnpSxgx8vdyMejulvqJ9LC7ixdVIjZVNPkr4QErBikfPzX79EEv1Kpf9lI54/i0SjOrw== 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=HyvQprL6EURJbUNZ/BqipUJ0FzfSkWQ/UyPpEeuhNYU=; b=NgyJA8+Gjo0KdI/Kd27H8fQhaoXYU7OIpbfkTme2ne4O2xQToO0U6JOxIa8xy5Xmx53BKyKA3U3vqiUL3EfAeDPmAMCkJrvisTwl45lW9ZlvuNWB1mUbAGtXs5KZCEife2IcXOyTrAK4eN405pjfztq0J18iMXcmUah81mMIv94RdKBKZWQwiucDB2lBfZuKPVXsoJyFcsrh5RgwBitzKPb32r7D2G3lJluHnaXkGCSkSbXiDCgM/sTWHdXK5VdGa8Oleuknp0KOMwGoXba3h2tcNIDUYR13plE4dSH6Xqgu7fkfi5nhNT/1vLp/bkce9sprB1zzlCXOyNWatHQc/Q== 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=HyvQprL6EURJbUNZ/BqipUJ0FzfSkWQ/UyPpEeuhNYU=; b=JJje/6JMhd4WaDhSvJ/OsJw9DQHwC7KerOBdSgHlxR71Dcgme4WUHV5DNjGEIK3M5MggFFp7ugYD8rGXjZcYnIF2Z6G6Q3jXXSTpfUcwm2BJ8luLj/l9lQGwXaXtkTDmKelNj+OtbhZWB1Z2irwrmB9rFJ6GjMUvGEH6j2T+u+s= 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 DB7PR04MB4636.eurprd04.prod.outlook.com (2603:10a6:5:2e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Fri, 21 May 2021 10:27:05 +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.4129.033; Fri, 21 May 2021 10:27:04 +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 V5 0/4] soc: imx: add i.MX BLK-CTL support Date: Fri, 21 May 2021 18:59:15 +0800 Message-Id: <20210521105919.20167-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0163.apcprd06.prod.outlook.com (2603:1096:1:1e::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 SG2PR06CA0163.apcprd06.prod.outlook.com (2603:1096:1:1e::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; Fri, 21 May 2021 10:26:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d4a7bc3-45ae-4e3d-8470-08d91c42fa6c X-MS-TrafficTypeDiagnostic: DB7PR04MB4636: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FVoKNgkGdineX4S9g6qUvjYMWmajLkK9Buw8jlRZ9rzIA4stXpK3uESQBsOn8McL2i2VK449F0zWkxtB1wK4lE/MFy9P/H7sYykK/TiU0jDP5LAlATpkiZQorrm5Er2ONPRaxBDs33kszQgEUaXITD/UqvKIMCWy0x+CLxynGjGoIUPBD8zuT+XhIzSsK2jTVl/MQoRAZ68h+7HDOl+VQYLVEy29h3GLZphN+c7hQSjeBQFDsVKGU3/hQijgEvACgfXfJ8xBDBGgzUChVeusGqidLTb/k7qYvCRIsrBZUI+apLIACXn6RmOYkRPa1/iWwUPmlVa8PsFurvTjyf9PnJuGD1ihtUhygzdQ3EHkSRnIe6IzSWSS3lLvhKf3MaD+xOlUUPduUDqVuUaO2sRGTjyzYuVvsLlhMtsEN2SM9DWKOhYgA7OqgV9Ql7duEUphj2Eu9CqhSRMuYD9k9RAFI0GPgbmQQj1ta8yPDv7Jb4fnqF1EEx5oW6bPtrWVW1/0VIl8FSaGV83M0sQ0r4Czw+PpbrUQl3moid7RlVRlhNL+PS1TVUwCJQf2j8v/O8pOQDCQMvkLoU9SwYE8zA/B26L9Gfwbvs/9HbWLwQ33/n4dkKe0zlL+lbak9W6qfj00jUzyWMTjwXVyoBxr/qmAAw== 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)(39860400002)(396003)(136003)(366004)(376002)(346002)(16526019)(1076003)(6486002)(4326008)(956004)(6506007)(478600001)(186003)(6512007)(5660300002)(2616005)(52116002)(8676002)(8936002)(86362001)(7416002)(66556008)(26005)(38100700002)(66476007)(83380400001)(6666004)(2906002)(316002)(66946007)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: X6VRScr5TWvQy+HNvZ6Izqp201Ph92wjDO2HvAycKy3ulKalPPlYZZyZ3QiCNMLSbgjuZSV6LwEPQIubVfGm+P7cGdAas4ioF3tCdsecyLrRW71fp0ckA3yXFykLRVdEks/P2W8m9Yk/omqo1i22ZrRlaXaelLgg9RSk/V2ZZH6/orDccftuN6nzulFopCrKeEwv4QWKEsx6ifY8pgLHtpiKMwqEy/FHH9pEKgZOPxOUCWX0ifv0IUdqTfnonjVXUN6RYjJ63tN/Kz9qaUgr1vXOdox2tkAT9om9sb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Tenant-Network-Message-Id: 0d4a7bc3-45ae-4e3d-8470-08d91c42fa6c X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2021 10:27:04.8189 (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: QwDqjfQscIcbebi/pui/KoDLyj5iYm74FNrQK/y+bThisPp8S8X4ymJbJ/wXrID8CZDMJy2RwGHFfDN4ZZmfLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4636 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_032710_391466_04C3861F X-CRM114-Status: GOOD ( 14.69 ) 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 V5: Rework the blk-ctl driver to let sub-PGC use blk-ctl as parent power domain to fix the potential handshake issue. I still keep R-b/A-b tag for Patch 1,2,4, since very minor changes I only drop R-b tag for Patch 3, since it has big change. An example, the pgc_mipi not take pgc_dispmix as parent: pgc_dispmix: power-domain@10 { #power-domain-cells = <0>; reg = ; clocks = <&clk IMX8MM_CLK_DISP_ROOT>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, <&clk IMX8MM_CLK_DISP_APB_ROOT>; }; pgc_mipi: power-domain@11 { #power-domain-cells = <0>; reg = ; power-domains = <&dispmix_blk_ctl IMX8MM_BLK_CTL_PD_DISPMIX_BUS>; }; dispmix_blk_ctl: clock-controller@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>; }; V4: Add R-b tag Typo fix Update the power domain macro names Per Abel and Frieder V3: Add explaination for not listing items in patch 2 commit log Per Rob. Addressed comments from Lucas and Frieder on patch [3,4]. A few comments from Jacky was ignored, because following gpcv2 coding style. V2: Fix yaml check failure. Previously there is an effort from Abel that take BLK-CTL as clock provider, but it turns out that there is A/B lock issue and we are not able resolve that. Per discuss with Lucas and Jacky, we made an agreement that take BLK-CTL as a power domain provider and use GPC's domain as parent, the consumer node take BLK-CTL as power domain input. This patchset has been tested on i.MX8MM EVK board, but one hack is not included in the patchset is that the DISPMIX BLK-CTL MIPI_M/S_RESET not implemented. Per Lucas, we will finally have a MIPI DPHY driver, so fine to leave it. Thanks for Lucas's suggestion, Frieder Schrempf for collecting all the patches, Abel's previous BLK-CTL work, Jacky Bai on help debug issues. Peng Fan (4): dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Documentation: bindings: clk: Add bindings for i.MX BLK_CTL soc: imx: Add generic blk-ctl driver soc: imx: Add blk-ctl driver for i.MX8MM .../bindings/soc/imx/fsl,imx-blk-ctl.yaml | 66 ++++ drivers/soc/imx/Makefile | 2 +- drivers/soc/imx/blk-ctl-imx8mm.c | 139 ++++++++ drivers/soc/imx/blk-ctl.c | 311 ++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 85 +++++ include/dt-bindings/power/imx8mm-power.h | 13 + 6 files changed, 615 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml create mode 100644 drivers/soc/imx/blk-ctl-imx8mm.c create mode 100644 drivers/soc/imx/blk-ctl.c create mode 100644 drivers/soc/imx/blk-ctl.h