From patchwork Sat May 22 13:42:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12274505 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_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 845CEC2B9F2 for ; Sat, 22 May 2021 13:13:21 +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 04E7A611AD for ; Sat, 22 May 2021 13:13:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04E7A611AD 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=JQcMKqrQZ6/XdjBBt8nWmifFfWNAN6mLHN56k3tcW/Q=; b=cRm/mhjtKlm/DiCzPmVTqqRTmv stZhpUfEFvybKd4zexaAvMXGZmwFru+9tTo0SLwye0DMgOCyXBfLyhJjMSAwi/mpfuKEJFZdw3wZq Cqi67TIwy56K4DfQlR5Z12WCKQCRrmIkfutgIgzMbo7ZWVLxgeGfDrAF7QoIcs2hnlmwvMHuBwYoF ilWu34rVuXgxPCozvrdtYHf6v+8OJcbnBUGgkg1/vcxZhWTGfV3qwzHVQ1oLNED8hzuJF1B+iskcU aOOOxDVjlb9jrfS9nLn8sAldu4ZcTnWx+DePqcIlqs6rMYO56v/TDROsMfpVkgMFXukdO1voxkRLw aKXnax7A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkROe-002Uye-L6; Sat, 22 May 2021 13:10:28 +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-002UyS-Od for linux-arm-kernel@desiato.infradead.org; Sat, 22 May 2021 13:10:24 +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=jVHMHqU0j7JGm+11Xwe3k+sWb0k+qgzeEjQ88KVeG6M=; b=fpA3DnBC7NaFCtFZNGKOMre2In LIYfHYvPGsWNasp2S2+0lCuapPeKzrprc3/SZ7UAo5x5vh2NVZZCcSM3+o4fUjN8KsqyBza6Luob1 VIzGVg7pXG5B9F+V1S23yAc9TSIRlUdkmTfbmNaoxuQj/XW9t1P0o240Uo1EGCR/ncA416IJs5LRN spT4oWmg+PA2ASxuPq4kmasRJoPOusvosPEYJTzNuZQptnQm3e79FYg6EBVCzprE63gF20j3YgnRa gXqlamzY5O3181EEvYnRm6ZCO/eT5xjLkgK7xfrC/xpu9BHzMazIbq94t+rZzBTD2G5RfKKainnpU TG66cmuQ==; Received: from mail-am6eur05on2080.outbound.protection.outlook.com ([40.107.22.80] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkROS-00076h-Bq for linux-arm-kernel@lists.infradead.org; Sat, 22 May 2021 13:10:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gs2XehsloHjU4zBW8o2nkQjA06mDY4plwsTbQD1GsUqe18lWgk8H7D8U8I/9UEbOrlFPx8UvP+Uzx4ukPEgCNIJUBWOmx7/8f1wW584pMpF3smSzaJUvcysuo7wGzI/LzLmTYwiSWIwOWiyMYgM66+YeQ4nL7WwKgeoahmBMPKoiA+u+Oa8iiHiEFU/YAJLBEpoNcpYfGEzlQcUxgQgE8IxEuwdgaPhuxEKZgaU7Uu4nbh1AfHVFF1remcO0J2mXJ53yAnRCCGfOX/Fo03a9xQGKYyVt+GuEIy358xT9hVUacRFDa8tEy13jHGhdCxnoYZ7yL45tQ1qj7IHwx0YrnQ== 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=jVHMHqU0j7JGm+11Xwe3k+sWb0k+qgzeEjQ88KVeG6M=; b=Zj/p9Eqyb3zKTV/HKSOptqw2jsQXLlRKYtVq6M8prWR0Fdga9QpIYy1cvrGWc7JmEhgmhoV6bSg/FS5bxzPPRKzeZfOlMQjd2Q7tzaFP1gaBNoL7So9gve6C0oRbS55F8kK7oQ5Kwu+22vNOyPnU9d2Ti8f9TySrcCSKG7J3nr2psHF2MLSxPckhjc9yW4iwj/wxwP1cYDJR1aSw5tRTkFg3jR+wqIpajejlVrWAhTgxylw+3w9ETwi+nBslw0TJS6/L3b0XOo+xqQhY7qcezTPSvh8wXEzoGnPfG9pei0SCgcd+2x8MKDvUwcghUL9aPmNHOJAQway3kFQBPnskzg== 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=jVHMHqU0j7JGm+11Xwe3k+sWb0k+qgzeEjQ88KVeG6M=; b=JDAn4iRP6z3tT0DL4PMkkiOIZDPaBr8yr5GsAv3o0M6W5O+piFbx0BS4QUNb8Ai03oXUfdrMOk0E+nzF1+au/H20AE7aVuAcJ3L0J/V4hgybGufpULrZ1WsNSTbtOaAYx5qqhwOaAP1h96MNoCfGhwQsfBGrn+nMmRmw2DpeA4M= 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:09 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4150.027; Sat, 22 May 2021 13:10:09 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V6 0/4] soc: imx: add i.MX BLK-CTL support Date: Sat, 22 May 2021 21:42:45 +0800 Message-Id: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 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:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d56c4a6f-3e1a-43a6-744d-08d91d22ecf9 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:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qJa4j2ct8pL8jTiYPv82MhIvDGJtP7Jh7Cgkjx98dnotLX7H0BbyVnFe3Ah2kgiTjQsn2SCRV2skcYK64XURy9zHPdyDX+hPmtMKZRGx8LRQZTNd0S7Y79MEAw9AG83byjM9ZMYUVx/7BoHvegZAYkvvV4kcXy3I/kVMxIC7NrkdtjJcH/oKz51soAKLapNMMUTLsjj8jI12gIwx963WP5c6N4iB6R/NRuMgNXtNYer40QOlFGFw23K1/H6Ylypxy9NQPW9Jic2WE5gxvzIqYI1h2J7aSsDMfwmZZWQa4hGuWj0p5vCXsqB3F0Z1txJDKTB0lG3EOihGV4qMuwz9iV/Hbtg33ClkPHH9Muc3737MAFnR75M4gtkHEj4N96FEEonSkONDM0bjhHECGUi6V7/ijxD4ji5zoA8sJG6pPvkwTLJEo1GwXBJ/kKmhGxgbpeC2cCSDj+Wcx6ckj2e9zqEGWnaopAo3zHTBzcOfeqkqWgZLQJ84it95HrbpA7lZorKancPttQGlu9aQtwjFZaDpH1ygS0cK/QOEF+SqJZ8zftYYB7xL119QoDNkCeSD1/g3HCwEEyzqmS1Pvw97ZD7hs4tGTCxC2AflRHpr8QK2phIrNSGgFJNJ3UHVpkA1UCKsmjXzsc4KNDtxU5WFsUQJPogrBPUHwpBgEK429erNt0wuR6W0Y263tL2zdCiBxnDHcze5UNi12Fxs5pQi2RtqHEt09uMRAIQqx026h+GduYgbJ4SsoieI+T9QnpLUifK7WsufFGCcpnKKKSPpdw== 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)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: sSClVNdScsDOhi9ZlCZijI1eOuEsM24K+vvWe/Ih6N1MRZ1/fqf6VdTpKYZnpNeeeklQsI0JKZb2W54vyJs5Dh1946xR1N7WquTt/jR8bFA99/dUI7po6p4JyesxNlkNbKjqGd076S2Wl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PDumhCl1O4OggO6joz5p0EsG8NAPKsT4cXIxohmP2CyVlNX7bZDo8lApNXsyRalN4S73Afch6/qHmC+6xQH5wPa50ysc56uG/iOiXvj9GLYVrtdqaXRcfEnZ5TUwY1FUXe6FVt X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d56c4a6f-3e1a-43a6-744d-08d91d22ecf9 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:09.5908 (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: y+zoahcXjGjFz8/uZh6ZTRqKKFOY1cObAwrmyveFM1KXJuVwncApwZd+HD9T8kcc3rFCXvB38orpAYeRgueyVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210522_061016_433867_DC7FB881 X-CRM114-Status: GOOD ( 15.65 ) 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 V6: Thanks for Adam's report on V5. Resolve the error message dump, it is the child device reuse the parent device node and matches the parent driver. Filled the remove function for child device. A diff dts file for upstream: https://gist.github.com/MrVan/d73888d8273c43ea4a3b28fa668ca1d0 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 | 334 ++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 85 +++++ include/dt-bindings/power/imx8mm-power.h | 13 + 6 files changed, 638 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