Skip to content

Commit 6f11c69

Browse files
Anson HuangShawn Guo
authored andcommitted
ARM: imx: add gpt_3m clk for i.mx6qdl
Add gpt_3m clock for i.mx6qdl, as gpt can source clock from OSC, some i.MX6 series SOCs has fixed divider of 8 for gpt clock, so here add a fix clk of gpt_3m. i.MX6Q TO1.0 has no gpt_3m option, so force it to be from ipg_per. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 69d9a3f commit 6f11c69

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

arch/arm/mach-imx/clk-imx6q.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
245245
clk[IMX6QDL_CLK_PLL3_80M] = imx_clk_fixed_factor("pll3_80m", "pll3_usb_otg", 1, 6);
246246
clk[IMX6QDL_CLK_PLL3_60M] = imx_clk_fixed_factor("pll3_60m", "pll3_usb_otg", 1, 8);
247247
clk[IMX6QDL_CLK_TWD] = imx_clk_fixed_factor("twd", "arm", 1, 2);
248+
clk[IMX6QDL_CLK_GPT_3M] = imx_clk_fixed_factor("gpt_3m", "osc", 1, 8);
248249
if (cpu_is_imx6dl()) {
249250
clk[IMX6QDL_CLK_GPU2D_AXI] = imx_clk_fixed_factor("gpu2d_axi", "mmdc_ch0_axi_podf", 1, 1);
250251
clk[IMX6QDL_CLK_GPU3D_AXI] = imx_clk_fixed_factor("gpu3d_axi", "mmdc_ch0_axi_podf", 1, 1);
@@ -461,6 +462,13 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
461462
clk[IMX6QDL_CLK_CKO1] = imx_clk_gate("cko1", "cko1_podf", base + 0x60, 7);
462463
clk[IMX6QDL_CLK_CKO2] = imx_clk_gate("cko2", "cko2_podf", base + 0x60, 24);
463464

465+
/*
466+
* The gpt_3m clock is not available on i.MX6Q TO1.0. Let's point it
467+
* to clock gpt_ipg_per to ease the gpt driver code.
468+
*/
469+
if (cpu_is_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0)
470+
clk[IMX6QDL_CLK_GPT_3M] = clk[IMX6QDL_CLK_GPT_IPG_PER];
471+
464472
imx_check_clocks(clk, ARRAY_SIZE(clk));
465473

466474
clk_data.clks = clk;

include/dt-bindings/clock/imx6qdl-clock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
#define IMX6QDL_PLL5_BYPASS 234
248248
#define IMX6QDL_PLL6_BYPASS 235
249249
#define IMX6QDL_PLL7_BYPASS 236
250-
#define IMX6QDL_CLK_END 237
250+
#define IMX6QDL_CLK_GPT_3M 237
251+
#define IMX6QDL_CLK_END 238
251252

252253
#endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */

0 commit comments

Comments
 (0)