]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: imx6: initialize GPU clocks
authorLucas Stach <l.stach@pengutronix.de>
Fri, 16 Sep 2016 09:16:11 +0000 (11:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 07:45:18 +0000 (03:45 -0400)
commit d8846023aed1293e54d33499558fc2aa2b2f393f upstream.

Initialize the GPU clock muxes to sane inputs. Until now they have
not been changed from their default values, which means that both
GPU3D shader and GPU2D core were fed by clock inputs whose rates
exceed the maximium allowed frequency of the cores by as much as
200MHz.

This fixes a severe GPU stability issue on i.MX6DL.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/imx/clk-imx6q.c

index ba1c1ae72ac2af632953df98c5bcc9ef5c44799b..3b45af167f94fe0e751176433070c542963d5619 100644 (file)
@@ -629,6 +629,24 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        if (IS_ENABLED(CONFIG_PCI_IMX6))
                clk_set_parent(clk[IMX6QDL_CLK_LVDS1_SEL], clk[IMX6QDL_CLK_SATA_REF_100M]);
 
+       /*
+        * Initialize the GPU clock muxes, so that the maximum specified clock
+        * rates for the respective SoC are not exceeded.
+        */
+       if (clk_on_imx6dl()) {
+               clk_set_parent(clk[IMX6QDL_CLK_GPU3D_CORE_SEL],
+                              clk[IMX6QDL_CLK_PLL2_PFD1_594M]);
+               clk_set_parent(clk[IMX6QDL_CLK_GPU2D_CORE_SEL],
+                              clk[IMX6QDL_CLK_PLL2_PFD1_594M]);
+       } else if (clk_on_imx6q()) {
+               clk_set_parent(clk[IMX6QDL_CLK_GPU3D_CORE_SEL],
+                              clk[IMX6QDL_CLK_MMDC_CH0_AXI]);
+               clk_set_parent(clk[IMX6QDL_CLK_GPU3D_SHADER_SEL],
+                              clk[IMX6QDL_CLK_PLL2_PFD1_594M]);
+               clk_set_parent(clk[IMX6QDL_CLK_GPU2D_CORE_SEL],
+                              clk[IMX6QDL_CLK_PLL3_USB_OTG]);
+       }
+
        imx_register_uart_clocks(uart_clks);
 }
 CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init);