]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
misc: imx8: scu: add i.MX8QM support
authorPeng Fan <peng.fan@nxp.com>
Tue, 5 Mar 2019 02:32:45 +0000 (02:32 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 25 Apr 2019 15:03:25 +0000 (17:03 +0200)
According to IMX8QXP/8QM config option, choose the clk/iomuxc
compatible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/misc/imx8/scu.c

index 1b9c49c99c9c7c3c2464c85a1377dd54e05e4e94..9ec00457b8b5bf14835817724420aee5047f8a97 100644 (file)
@@ -219,11 +219,21 @@ static int imx8_scu_bind(struct udevice *dev)
        int ret;
        struct udevice *child;
        int node;
+       char *clk_compatible, *iomuxc_compatible;
+
+       if (IS_ENABLED(CONFIG_IMX8QXP)) {
+               clk_compatible = "fsl,imx8qxp-clk";
+               iomuxc_compatible = "fsl,imx8qxp-iomuxc";
+       } else if (IS_ENABLED(CONFIG_IMX8QM)) {
+               clk_compatible = "fsl,imx8qm-clk";
+               iomuxc_compatible = "fsl,imx8qm-iomuxc";
+       } else {
+               return -EINVAL;
+       }
 
        debug("%s(dev=%p)\n", __func__, dev);
 
-       node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
-                                            "fsl,imx8qxp-clk");
+       node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, clk_compatible);
        if (node < 0)
                panic("No clk node found\n");
 
@@ -234,7 +244,7 @@ static int imx8_scu_bind(struct udevice *dev)
        plat->clk = child;
 
        node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
-                                            "fsl,imx8qxp-iomuxc");
+                                            iomuxc_compatible);
        if (node < 0)
                panic("No iomuxc node found\n");