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: 445903 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1839851jac; Sat, 22 May 2021 06:10:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz52C81ceLiJ5MoCSBtYym1yQZhwUHi2AnWC26B3f1XSqOnfFgky2WPhvgX/fYKPR5tvAb3 X-Received: by 2002:a5d:8188:: with SMTP id u8mr4975066ion.163.1621689019494; Sat, 22 May 2021 06:10:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621689019; cv=pass; d=google.com; s=arc-20160816; b=06RU+ljYxb2VmBEs5AZSuplTVFHHrQDTCoAuNnmKjjvo1a2XAXeqObKZx4oZF1eiq7 l8XNJgBBXf3xvmcl7vC/Da0JaQSb9mP+O2cnPWtGM8qijYQzz+AdJCVijbAT+WUfirK5 O/D2ABOhp0Df1vJc+BfQhO4loXIh7qm0NEICli/Y7Cu+VQwI+vzLR2iW1cy6p2S0qicD Jkii2acLruEHhwPpponUwm4jHClh/8BrPe5gFGD9FDSf1VEpO26ENUPnxiM8H0ga3uL4 Sur79isLb4KL+RbN0snoMBlI/ztLtSQbFDYwuaQaaWCvOxk6xWIvtuT3dSD+/LcxxINk U/ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=jVHMHqU0j7JGm+11Xwe3k+sWb0k+qgzeEjQ88KVeG6M=; b=PnGE2UlhlZPm7o9JEXVY+XxRV2QaaMNEP/4qhbDXH1CLzGG6nL5gtYpDgGeLFJ31mh PKrjneTLdG7hx8S0KLfQixFgQv5IfNGqEQWw6bRYYb01RKsXP3rux0rPfhk5rxkAqRtf 42QpTUo/zx3djwN3DDfB4qDj97KYnJZhfpEl1js18Mb3ndOGoFV/KMn7j+SaQSCyR2ep Y8LQDsJrjK3c1G1G6tKdpvB+AERWWD25OhL6exWKOqbRK506w1HYQRyE9pd8Nt0rxdWj UKmo2b5S5POuElgdHwA99bBOs5/c8ipBzpBqJlmLkW7Du7oMMGhZNvOqkEgDl2hZyxtd HTmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JDAn4iRP; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si8224815ilq.76.2021.05.22.06.10.19; Sat, 22 May 2021 06:10:19 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JDAn4iRP; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbhEVNLk (ORCPT + 7 others); Sat, 22 May 2021 09:11:40 -0400 Received: from mail-am6eur05on2070.outbound.protection.outlook.com ([40.107.22.70]:42840 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230431AbhEVNLj (ORCPT ); Sat, 22 May 2021 09:11:39 -0400 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/dUI7po6p4JyesxNlkNbKjqGd076S2WlRklvIuL/V2WHZMRvuPBr0WJ6NKFBHEG8KPOtvsL/O7XB53FW9P5BznM6JvS58Y5cm40EVrRdY2YGZVAqYXW0hMdzacDV0eYpdjCa3q2/jk3hKJ26Z3FZNNJluYZcoQYZSPJl6Hg91soOzSzYwuJv3RLXn5lBH5hayXrXjWns74yoKET9iHaKcm2Vw4rdphmwmyyVTU+nLVlm+9jFCrD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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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 -- 2.30.0