From patchwork Fri May 3 01:34:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 1094630 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="U3eaj5wp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44wF6q6txqz9sB8 for ; Fri, 3 May 2019 11:34:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725995AbfECBen (ORCPT ); Thu, 2 May 2019 21:34:43 -0400 Received: from mail-eopbgr70081.outbound.protection.outlook.com ([40.107.7.81]:23494 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726150AbfECBen (ORCPT ); Thu, 2 May 2019 21:34:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m+oyjylI89WOdiEJe1vxtVTeRifl01vyRdMgmrLAUBE=; b=U3eaj5wpAhp01sDwgwt0zI7moq6a4bF0aZl6Uh5+NsePLFXaOFargipI1LBQF3i0Qbo3Su47ANEMlT1DVe4Wly2I05UV8JXvcf3dHcIOhunl70LgruRvpvAqtX4s/ubgDruLxB2FqQA7uNbPTTSHIym8wSYwH+aP6xpZw1ZgrQs= Received: from AM0PR04MB4211.eurprd04.prod.outlook.com (52.134.92.158) by AM0PR04MB4963.eurprd04.prod.outlook.com (20.176.215.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.15; Fri, 3 May 2019 01:34:35 +0000 Received: from AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::c415:3cab:a042:2e13]) by AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::c415:3cab:a042:2e13%6]) with mapi id 15.20.1856.008; Fri, 3 May 2019 01:34:35 +0000 From: Aisheng Dong To: Aisheng Dong CC: Rob Herring , Stephen Boyd , Shawn Guo , Sascha Hauer , Michael Turquette , "devicetree@vger.kernel.org" Subject: [PATCH V2 2/2] dt-bindings: clock: imx-lpcg: add support to parse clocks from device tree Thread-Topic: [PATCH V2 2/2] dt-bindings: clock: imx-lpcg: add support to parse clocks from device tree Thread-Index: AQHVAVBdWqUIsdPvA0i25nEbTE5g6w== Date: Fri, 3 May 2019 01:34:35 +0000 Message-ID: <1556846821-8581-3-git-send-email-aisheng.dong@nxp.com> References: <1556846821-8581-1-git-send-email-aisheng.dong@nxp.com> In-Reply-To: <1556846821-8581-1-git-send-email-aisheng.dong@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0PR03CA0093.apcprd03.prod.outlook.com (2603:1096:203:72::33) To AM0PR04MB4211.eurprd04.prod.outlook.com (2603:10a6:208:5b::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 637eba19-77c2-4d0e-0b53-08d6cf677fda x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB4963; x-ms-traffictypediagnostic: AM0PR04MB4963: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0026334A56 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(39860400002)(346002)(136003)(54534003)(189003)(199004)(186003)(50226002)(7736002)(8936002)(52116002)(2616005)(4326008)(446003)(11346002)(486006)(6862004)(476003)(44832011)(81156014)(26005)(386003)(68736007)(6506007)(6512007)(81166006)(66066001)(102836004)(8676002)(5660300002)(25786009)(76176011)(7049001)(478600001)(53936002)(6116002)(3846002)(6436002)(86362001)(2906002)(73956011)(64756008)(66476007)(66556008)(66446008)(71190400001)(71200400001)(66946007)(316002)(37006003)(99286004)(6486002)(14444005)(256004)(54906003)(36756003)(6200100001)(305945005)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4963; H:AM0PR04MB4211.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zkehlw6blqXsf5pVcBjCWQpCOMw5SW37zCqJrdYCeDm/HM4YVp6ebHsqEXHelUIztXsZzdHle8SJatDS9KRp00A8V/wsGOv7LReZyuB31jwXW1E5URDtmCrlgV5RZ7uu1a0235B1+OnblrF5mJUXva6kIO/sH7CmKrrcRfQzG76iz4/f+0IMcgRLket1BzxvNlkloC/LV3hU2wTJVpSHwbqx+mz+Ap57ebSaNaMDdSjO13Ktt6fqxsEbMKKOoQFnOuvq6R3CdE2NlieAtvjVYReRYbQhUUqOSZ4w6ROZSHzB6CIm69ErdSX4WSsYZgVDDcXrqDeUSwU5w746OboyvyOzgv5tN7Vpr1JHzo9oStnm+JMILg6d5CMGCtygJjDcaQkGjtrwv8yCRfqks9mGAa8yqc4Ma4CnaKKSs30OkQc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 637eba19-77c2-4d0e-0b53-08d6cf677fda X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2019 01:34:35.6149 (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-Transport-CrossTenantHeadersStamped: AM0PR04MB4963 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org MX8QM and MX8QXP LPCG Clocks are mostly the same except they may reside in different subsystems across CPUs and also vary a bit on the availability. Same as SCU clock, we want to move the clock definition into device tree which can fully decouple the dependency of Clock ID definition from device tree and make us be able to write a fully generic lpcg clock driver. And we can also use the existence of clock nodes in device tree to address the device and clock availability differences across different SoCs. Cc: Rob Herring Cc: Stephen Boyd Cc: Shawn Guo Cc: Sascha Hauer Cc: Michael Turquette Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng --- ChangeLog: v1->v2: * Update example * Add power domain property --- .../devicetree/bindings/clock/imx8qxp-lpcg.txt | 34 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.txt b/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.txt index 965cfa4..6fc2fd8 100644 --- a/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.txt +++ b/Documentation/devicetree/bindings/clock/imx8qxp-lpcg.txt @@ -11,6 +11,21 @@ enabled by these control bits, it might still not be running based on the base resource. Required properties: +- compatible: Should be one of: + "fsl,imx8qxp-lpcg" + "fsl,imx8qm-lpcg" followed by "fsl,imx8qxp-lpcg". +- reg: Address and length of the register set. +- #clock-cells: Should be 1. One LPCG supports multiple clocks. +- clocks: Input parent clocks phandle array for each clock. +- bit-offset: An integer array indicating the bit offset for each clock. +- hw-autogate: Boolean array indicating whether supports HW autogate for + each clock. +- clock-output-names: Shall be the corresponding names of the outputs. + NOTE this property must be specified in the same order + as the clock bit-offset and hw-autogate property. +- power-domains: Should contain the power domain used by this clock. + +Legacy binding (DEPRECATED): - compatible: Should be one of: "fsl,imx8qxp-lpcg-adma", "fsl,imx8qxp-lpcg-conn", @@ -33,10 +48,17 @@ Examples: #include -conn_lpcg: clock-controller@5b200000 { - compatible = "fsl,imx8qxp-lpcg-conn"; - reg = <0x5b200000 0xb0000>; +sdhc0_lpcg: clock-controller@5b200000 { + compatible = "fsl,imx8qxp-lpcg"; + reg = <0x5b200000 0x10000>; #clock-cells = <1>; + clocks = <&sdhc0_clk IMX_SC_PM_CLK_PER>, + <&conn_ipg_clk>, <&conn_axi_clk>; + bit-offset = <0 16 20>; + clock-output-names = "sdhc0_lpcg_per_clk", + "sdhc0_lpcg_ipg_clk", + "sdhc0_lpcg_ahb_clk"; + power-domains = <&pd IMX_SC_R_SDHC_0>; }; usdhc1: mmc@5b010000 { @@ -44,8 +66,8 @@ usdhc1: mmc@5b010000 { interrupt-parent = <&gic>; interrupts = ; reg = <0x5b010000 0x10000>; - clocks = <&conn_lpcg IMX8QXP_CONN_LPCG_SDHC0_IPG_CLK>, - <&conn_lpcg IMX8QXP_CONN_LPCG_SDHC0_PER_CLK>, - <&conn_lpcg IMX8QXP_CONN_LPCG_SDHC0_HCLK>; + clocks = <&sdhc0_lpcg 1>, + <&sdhc0_lpcg 0>, + <&sdhc0_lpcg 2>; clock-names = "ipg", "per", "ahb"; };