dt-bindings: firmware: imx-scu: new binding to parse clocks from device tree
authorDong Aisheng <aisheng.dong@nxp.com>
Wed, 29 Jul 2020 08:00:08 +0000 (16:00 +0800)
committerShawn Guo <shawnguo@kernel.org>
Mon, 26 Oct 2020 02:41:26 +0000 (10:41 +0800)
There's a few limitations on the original one cell clock binding
(#clock-cells = <1>) that we have to define some SW clock IDs for device
tree to reference. This may cause troubles if we want to use common
clock IDs for multi platforms support when the clock of those platforms
are mostly the same.
e.g. Current clock IDs name are defined with SS prefix.

However the device may reside in different SS across CPUs, that means the
SS prefix may not valid anymore for a new SoC. Furthermore, the device
availability of those clocks may also vary a bit.

For such situation, we want to eliminate the using of SW Clock IDs and
change to use a more close to HW one instead.
For SCU clocks usage, only two params required: Resource id + Clock Type.
Both parameters are platform independent. So we could use two cells binding
to pass those parameters,

Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: devicetree@vger.kernel.org
Acked-by: Shawn Guo <shawnguo@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt

index 6064d98..395359d 100644 (file)
@@ -89,7 +89,10 @@ Required properties:
                          "fsl,imx8qm-clock"
                          "fsl,imx8qxp-clock"
                        followed by "fsl,scu-clk"
-- #clock-cells:                Should be 1. Contains the Clock ID value.
+- #clock-cells:                Should be either
+                       2: Contains the Resource and Clock ID value.
+                       or
+                       1: Contains the Clock ID value. (DEPRECATED)
 - clocks:              List of clock specifiers, must contain an entry for
                        each required entry in clock-names
 - clock-names:         Should include entries "xtal_32KHz", "xtal_24MHz"
@@ -208,7 +211,7 @@ firmware {
 
                clk: clk {
                        compatible = "fsl,imx8qxp-clk", "fsl,scu-clk";
-                       #clock-cells = <1>;
+                       #clock-cells = <2>;
                };
 
                iomuxc {
@@ -263,8 +266,7 @@ serial@5a060000 {
        ...
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_lpuart0>;
-       clocks = <&clk IMX8QXP_UART0_CLK>,
-                <&clk IMX8QXP_UART0_IPG_CLK>;
-       clock-names = "per", "ipg";
+       clocks = <&uart0_clk IMX_SC_R_UART_0 IMX_SC_PM_CLK_PER>;
+       clock-names = "ipg";
        power-domains = <&pd IMX_SC_R_UART_0>;
 };