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

clk: imx: imx8mq: fix a53 cpu clock

The A53 CCM clk root only accepts input up to 1GHz, CCM A53 root
signoff timing is 1Ghz, however the A53 core which sources from CCM
root could run above 1GHz which violates the CCM.

There is a CORE_SEL slice before A53 core, we need to configure the
CORE_SEL slice source from ARM PLL, not A53 CCM clk root.

The A53 CCM clk root should only be used when need to change ARM PLL
frequency.

Add arm_a53_core clk that could source from arm_a53_div and arm_pll_out.
Configure a53 ccm root sources from 800MHz sys pll
Configure a53 core sources from arm_pll_out
Mark arm_a53_core as critical clock

Fixes: db27e40b27f1 ("clk: imx8mq: Add the missing ARM clock")
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Peng Fan and committed by
Shawn Guo
d6fb02f0 c267bd44

+15 -5
+12 -4
drivers/clk/imx/clk-imx8mq.c
··· 41 41 static const char * const imx8mq_a53_sels[] = {"osc_25m", "arm_pll_out", "sys2_pll_500m", "sys2_pll_1000m", 42 42 "sys1_pll_800m", "sys1_pll_400m", "audio_pll1_out", "sys3_pll_out", }; 43 43 44 + static const char * const imx8mq_a53_core_sels[] = {"arm_a53_div", "arm_pll_out", }; 45 + 44 46 static const char * const imx8mq_arm_m4_sels[] = {"osc_25m", "sys2_pll_200m", "sys2_pll_250m", "sys1_pll_266m", 45 47 "sys1_pll_800m", "audio_pll1_out", "video_pll1_out", "sys3_pll_out", }; 46 48 ··· 427 425 hws[IMX8MQ_CLK_GPU_SHADER_CG] = hws[IMX8MQ_CLK_GPU_SHADER]; 428 426 hws[IMX8MQ_CLK_GPU_SHADER_DIV] = hws[IMX8MQ_CLK_GPU_SHADER]; 429 427 428 + /* CORE SEL */ 429 + hws[IMX8MQ_CLK_A53_CORE] = imx_clk_hw_mux2_flags("arm_a53_core", base + 0x9880, 24, 1, imx8mq_a53_core_sels, ARRAY_SIZE(imx8mq_a53_core_sels), CLK_IS_CRITICAL); 430 + 430 431 /* BUS */ 431 432 hws[IMX8MQ_CLK_MAIN_AXI] = imx8m_clk_hw_composite_critical("main_axi", imx8mq_main_axi_sels, base + 0x8800); 432 433 hws[IMX8MQ_CLK_ENET_AXI] = imx8m_clk_hw_composite("enet_axi", imx8mq_enet_axi_sels, base + 0x8880); ··· 593 588 hws[IMX8MQ_GPT_3M_CLK] = imx_clk_hw_fixed_factor("gpt_3m", "osc_25m", 1, 8); 594 589 hws[IMX8MQ_CLK_DRAM_ALT_ROOT] = imx_clk_hw_fixed_factor("dram_alt_root", "dram_alt", 1, 4); 595 590 596 - hws[IMX8MQ_CLK_ARM] = imx_clk_hw_cpu("arm", "arm_a53_div", 597 - hws[IMX8MQ_CLK_A53_DIV]->clk, 598 - hws[IMX8MQ_CLK_A53_SRC]->clk, 591 + clk_hw_set_parent(hws[IMX8MQ_CLK_A53_SRC], hws[IMX8MQ_SYS1_PLL_800M]); 592 + clk_hw_set_parent(hws[IMX8MQ_CLK_A53_CORE], hws[IMX8MQ_ARM_PLL_OUT]); 593 + 594 + hws[IMX8MQ_CLK_ARM] = imx_clk_hw_cpu("arm", "arm_a53_core", 595 + hws[IMX8MQ_CLK_A53_CORE]->clk, 596 + hws[IMX8MQ_CLK_A53_CORE]->clk, 599 597 hws[IMX8MQ_ARM_PLL_OUT]->clk, 600 - hws[IMX8MQ_SYS1_PLL_800M]->clk); 598 + hws[IMX8MQ_CLK_A53_DIV]->clk); 601 599 602 600 imx_check_clk_hws(hws, IMX8MQ_CLK_END); 603 601
+3 -1
include/dt-bindings/clock/imx8mq-clock.h
··· 429 429 #define IMX8MQ_CLK_M4_CORE 287 430 430 #define IMX8MQ_CLK_VPU_CORE 288 431 431 432 - #define IMX8MQ_CLK_END 289 432 + #define IMX8MQ_CLK_A53_CORE 289 433 + 434 + #define IMX8MQ_CLK_END 290 433 435 434 436 #endif /* __DT_BINDINGS_CLOCK_IMX8MQ_H */