Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: clock: imx-lpcg: add support to parse clocks from device tree

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: Sascha Hauer <kernel@pengutronix.de>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: devicetree@vger.kernel.org
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Dong Aisheng and committed by
Shawn Guo
540742fb 02f5bea9

+74 -19
+60 -19
Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml
··· 21 21 22 22 The clock consumer should specify the desired clock by having the clock 23 23 ID in its "clocks" phandle cell. See the full list of clock IDs from: 24 - include/dt-bindings/clock/imx8-clock.h 24 + include/dt-bindings/clock/imx8-lpcg.h 25 25 26 26 properties: 27 27 compatible: 28 - enum: 29 - - fsl,imx8qxp-lpcg-adma 30 - - fsl,imx8qxp-lpcg-conn 31 - - fsl,imx8qxp-lpcg-dc 32 - - fsl,imx8qxp-lpcg-dsp 33 - - fsl,imx8qxp-lpcg-gpu 34 - - fsl,imx8qxp-lpcg-hsio 35 - - fsl,imx8qxp-lpcg-img 36 - - fsl,imx8qxp-lpcg-lsio 37 - - fsl,imx8qxp-lpcg-vpu 38 - 28 + oneOf: 29 + - const: fsl,imx8qxp-lpcg 30 + - items: 31 + - enum: 32 + - fsl,imx8qm-lpcg 33 + - const: fsl,imx8qxp-lpcg 34 + - enum: 35 + - fsl,imx8qxp-lpcg-adma 36 + - fsl,imx8qxp-lpcg-conn 37 + - fsl,imx8qxp-lpcg-dc 38 + - fsl,imx8qxp-lpcg-dsp 39 + - fsl,imx8qxp-lpcg-gpu 40 + - fsl,imx8qxp-lpcg-hsio 41 + - fsl,imx8qxp-lpcg-img 42 + - fsl,imx8qxp-lpcg-lsio 43 + - fsl,imx8qxp-lpcg-vpu 44 + deprecated: true 39 45 reg: 40 46 maxItems: 1 41 47 42 48 '#clock-cells': 43 49 const: 1 50 + 51 + clocks: 52 + description: | 53 + Input parent clocks phandle array for each clock 54 + minItems: 1 55 + maxItems: 8 56 + 57 + clock-indices: 58 + description: | 59 + An integer array indicating the bit offset for each clock. 60 + Refer to <include/dt-bindings/clock/imx8-lpcg.h> for the 61 + supported LPCG clock indices. 62 + minItems: 1 63 + maxItems: 8 64 + 65 + clock-output-names: 66 + description: | 67 + Shall be the corresponding names of the outputs. 68 + NOTE this property must be specified in the same order 69 + as the clock-indices property. 70 + minItems: 1 71 + maxItems: 8 72 + 73 + power-domains: 74 + maxItems: 1 44 75 45 76 required: 46 77 - compatible ··· 82 51 83 52 examples: 84 53 - | 85 - #include <dt-bindings/clock/imx8-clock.h> 54 + #include <dt-bindings/clock/imx8-lpcg.h> 86 55 #include <dt-bindings/firmware/imx/rsrc.h> 87 56 #include <dt-bindings/interrupt-controller/arm-gic.h> 88 57 89 - clock-controller@5b200000 { 90 - compatible = "fsl,imx8qxp-lpcg-conn"; 91 - reg = <0x5b200000 0xb0000>; 58 + sdhc0_lpcg: clock-controller@5b200000 { 59 + compatible = "fsl,imx8qxp-lpcg"; 60 + reg = <0x5b200000 0x10000>; 92 61 #clock-cells = <1>; 62 + clocks = <&sdhc0_clk IMX_SC_PM_CLK_PER>, 63 + <&conn_ipg_clk>, 64 + <&conn_axi_clk>; 65 + clock-indices = <IMX_LPCG_CLK_0>, 66 + <IMX_LPCG_CLK_4>, 67 + <IMX_LPCG_CLK_5>; 68 + clock-output-names = "sdhc0_lpcg_per_clk", 69 + "sdhc0_lpcg_ipg_clk", 70 + "sdhc0_lpcg_ahb_clk"; 71 + power-domains = <&pd IMX_SC_R_SDHC_0>; 93 72 }; 94 73 95 74 mmc@5b010000 { 96 75 compatible = "fsl,imx8qxp-usdhc", "fsl,imx7d-usdhc"; 97 76 interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>; 98 77 reg = <0x5b010000 0x10000>; 99 - clocks = <&conn_lpcg IMX_CONN_LPCG_SDHC0_IPG_CLK>, 100 - <&conn_lpcg IMX_CONN_LPCG_SDHC0_PER_CLK>, 101 - <&conn_lpcg IMX_CONN_LPCG_SDHC0_HCLK>; 78 + clocks = <&sdhc0_lpcg IMX_LPCG_CLK_4>, 79 + <&sdhc0_lpcg IMX_LPCG_CLK_0>, 80 + <&sdhc0_lpcg IMX_LPCG_CLK_5>; 102 81 clock-names = "ipg", "per", "ahb"; 103 82 power-domains = <&pd IMX_SC_R_SDHC_0>; 104 83 };
+14
include/dt-bindings/clock/imx8-lpcg.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* 3 + * Copyright 2019-2020 NXP 4 + * Dong Aisheng <aisheng.dong@nxp.com> 5 + */ 6 + 7 + #define IMX_LPCG_CLK_0 0 8 + #define IMX_LPCG_CLK_1 4 9 + #define IMX_LPCG_CLK_2 8 10 + #define IMX_LPCG_CLK_3 12 11 + #define IMX_LPCG_CLK_4 16 12 + #define IMX_LPCG_CLK_5 20 13 + #define IMX_LPCG_CLK_6 24 14 + #define IMX_LPCG_CLK_7 28