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

clk: imx7d: only enable minimum required clocks

Formerly clk core does not support imx7d clock type well that all
its clock operations requires the parent clock on.
Therefore we enabled all clocks by default in clock driver
initialization for other module clocks operate well.

After patch 'clk: imx7d: using api with flag CLK_OPS_PARENT_ENABLE',
clk core can handle such clock type well, so we don't have to enable
them all by default anymore. Instead, we only enable a minimum required
set of clocks.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Dong Aisheng and committed by
Stephen Boyd
e8e628fb cbeac74a

+10 -8
+10 -8
drivers/clk/imx/clk-imx7d.c
··· 361 361 static const char *pll_audio_bypass_sel[] = { "pll_audio_main", "pll_audio_main_src", }; 362 362 static const char *pll_video_bypass_sel[] = { "pll_video_main", "pll_video_main_src", }; 363 363 364 + static int const clks_init_on[] __initconst = { 365 + IMX7D_ARM_A7_ROOT_CLK, IMX7D_MAIN_AXI_ROOT_CLK, 366 + IMX7D_PLL_SYS_MAIN_480M_CLK, IMX7D_NAND_USDHC_BUS_ROOT_CLK, 367 + IMX7D_DRAM_PHYM_ROOT_CLK, IMX7D_DRAM_ROOT_CLK, 368 + IMX7D_DRAM_PHYM_ALT_ROOT_CLK, IMX7D_DRAM_ALT_ROOT_CLK, 369 + IMX7D_AHB_CHANNEL_ROOT_CLK, 370 + }; 371 + 364 372 static struct clk_onecell_data clk_data; 365 373 366 374 static struct clk ** const uart_clks[] __initconst = { ··· 854 846 clk_data.clk_num = ARRAY_SIZE(clks); 855 847 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 856 848 857 - /* TO BE FIXED LATER 858 - * Enable all clock to bring up imx7, otherwise system will be halt and block 859 - * the other part upstream Because imx7d clock design changed, clock framework 860 - * need do a little modify. 861 - * Dong Aisheng is working on this. After that, this part need be changed. 862 - */ 863 - for (i = 0; i < IMX7D_CLK_END; i++) 864 - clk_prepare_enable(clks[i]); 849 + for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 850 + clk_prepare_enable(clks[clks_init_on[i]]); 865 851 866 852 /* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */ 867 853 clk_set_parent(clks[IMX7D_GPT1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]);