@@ -227,6 +227,30 @@ static const char * const imx8mn_pwm4_sels[] = {"osc_24m", "sys_pll2_100m", "sys
227227 "sys_pll1_40m" , "sys_pll3_out" , "clk_ext2" ,
228228 "sys_pll1_80m" , "video_pll1_out" , };
229229
230+ static const char * const imx8mn_gpt1_sels [] = {"osc_24m" , "sys_pll2_100m" , "sys_pll1_400m" ,
231+ "sys_pll1_40m" , "video_pll1_out" , "sys_pll1_80m" ,
232+ "audio_pll1_out" , "clk_ext1" , };
233+
234+ static const char * const imx8mn_gpt2_sels [] = {"osc_24m" , "sys_pll2_100m" , "sys_pll1_400m" ,
235+ "sys_pll1_40m" , "video_pll1_out" , "sys_pll1_80m" ,
236+ "audio_pll1_out" , "clk_ext1" , };
237+
238+ static const char * const imx8mn_gpt3_sels [] = {"osc_24m" , "sys_pll2_100m" , "sys_pll1_400m" ,
239+ "sys_pll1_40m" , "video_pll1_out" , "sys_pll1_80m" ,
240+ "audio_pll1_out" , "clk_ext1" , };
241+
242+ static const char * const imx8mn_gpt4_sels [] = {"osc_24m" , "sys_pll2_100m" , "sys_pll1_400m" ,
243+ "sys_pll1_40m" , "video_pll1_out" , "sys_pll1_80m" ,
244+ "audio_pll1_out" , "clk_ext1" , };
245+
246+ static const char * const imx8mn_gpt5_sels [] = {"osc_24m" , "sys_pll2_100m" , "sys_pll1_400m" ,
247+ "sys_pll1_40m" , "video_pll1_out" , "sys_pll1_80m" ,
248+ "audio_pll1_out" , "clk_ext1" , };
249+
250+ static const char * const imx8mn_gpt6_sels [] = {"osc_24m" , "sys_pll2_100m" , "sys_pll1_400m" ,
251+ "sys_pll1_40m" , "video_pll1_out" , "sys_pll1_80m" ,
252+ "audio_pll1_out" , "clk_ext1" , };
253+
230254static const char * const imx8mn_wdog_sels [] = {"osc_24m" , "sys_pll1_133m" , "sys_pll1_160m" ,
231255 "vpu_pll_out" , "sys_pll2_125m" , "sys_pll3_out" ,
232256 "sys_pll1_80m" , "sys_pll2_166m" , };
@@ -476,6 +500,12 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
476500 hws [IMX8MN_CLK_PWM2 ] = imx8m_clk_hw_composite ("pwm2" , imx8mn_pwm2_sels , base + 0xb400 );
477501 hws [IMX8MN_CLK_PWM3 ] = imx8m_clk_hw_composite ("pwm3" , imx8mn_pwm3_sels , base + 0xb480 );
478502 hws [IMX8MN_CLK_PWM4 ] = imx8m_clk_hw_composite ("pwm4" , imx8mn_pwm4_sels , base + 0xb500 );
503+ hws [IMX8MN_CLK_GPT1 ] = imx8m_clk_hw_composite ("gpt1" , imx8mn_gpt1_sels , base + 0xb580 );
504+ hws [IMX8MN_CLK_GPT2 ] = imx8m_clk_hw_composite ("gpt2" , imx8mn_gpt2_sels , base + 0xb600 );
505+ hws [IMX8MN_CLK_GPT3 ] = imx8m_clk_hw_composite ("gpt3" , imx8mn_gpt3_sels , base + 0xb680 );
506+ hws [IMX8MN_CLK_GPT4 ] = imx8m_clk_hw_composite ("gpt4" , imx8mn_gpt4_sels , base + 0xb700 );
507+ hws [IMX8MN_CLK_GPT5 ] = imx8m_clk_hw_composite ("gpt5" , imx8mn_gpt5_sels , base + 0xb780 );
508+ hws [IMX8MN_CLK_GPT6 ] = imx8m_clk_hw_composite ("gpt6" , imx8mn_gpt6_sels , base + 0xb800 );
479509 hws [IMX8MN_CLK_WDOG ] = imx8m_clk_hw_composite ("wdog" , imx8mn_wdog_sels , base + 0xb900 );
480510 hws [IMX8MN_CLK_WRCLK ] = imx8m_clk_hw_composite ("wrclk" , imx8mn_wrclk_sels , base + 0xb980 );
481511 hws [IMX8MN_CLK_CLKO1 ] = imx8m_clk_hw_composite ("clko1" , imx8mn_clko1_sels , base + 0xba00 );
@@ -501,6 +531,12 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
501531 hws [IMX8MN_CLK_GPIO3_ROOT ] = imx_clk_hw_gate4 ("gpio3_root_clk" , "ipg_root" , base + 0x40d0 , 0 );
502532 hws [IMX8MN_CLK_GPIO4_ROOT ] = imx_clk_hw_gate4 ("gpio4_root_clk" , "ipg_root" , base + 0x40e0 , 0 );
503533 hws [IMX8MN_CLK_GPIO5_ROOT ] = imx_clk_hw_gate4 ("gpio5_root_clk" , "ipg_root" , base + 0x40f0 , 0 );
534+ hws [IMX8MN_CLK_GPT1_ROOT ] = imx_clk_hw_gate4 ("gpt1_root_clk" , "gpt1" , base + 0x4100 , 0 );
535+ hws [IMX8MN_CLK_GPT2_ROOT ] = imx_clk_hw_gate4 ("gpt2_root_clk" , "gpt2" , base + 0x4110 , 0 );
536+ hws [IMX8MN_CLK_GPT3_ROOT ] = imx_clk_hw_gate4 ("gpt3_root_clk" , "gpt3" , base + 0x4120 , 0 );
537+ hws [IMX8MN_CLK_GPT4_ROOT ] = imx_clk_hw_gate4 ("gpt4_root_clk" , "gpt4" , base + 0x4130 , 0 );
538+ hws [IMX8MN_CLK_GPT5_ROOT ] = imx_clk_hw_gate4 ("gpt5_root_clk" , "gpt5" , base + 0x4140 , 0 );
539+ hws [IMX8MN_CLK_GPT6_ROOT ] = imx_clk_hw_gate4 ("gpt6_root_clk" , "gpt6" , base + 0x4150 , 0 );
504540 hws [IMX8MN_CLK_I2C1_ROOT ] = imx_clk_hw_gate4 ("i2c1_root_clk" , "i2c1" , base + 0x4170 , 0 );
505541 hws [IMX8MN_CLK_I2C2_ROOT ] = imx_clk_hw_gate4 ("i2c2_root_clk" , "i2c2" , base + 0x4180 , 0 );
506542 hws [IMX8MN_CLK_I2C3_ROOT ] = imx_clk_hw_gate4 ("i2c3_root_clk" , "i2c3" , base + 0x4190 , 0 );
@@ -522,7 +558,6 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
522558 hws [IMX8MN_CLK_SAI5_IPG ] = imx_clk_hw_gate2_shared2 ("sai5_ipg_clk" , "ipg_audio_root" , base + 0x4370 , 0 , & share_count_sai5 );
523559 hws [IMX8MN_CLK_SAI6_ROOT ] = imx_clk_hw_gate2_shared2 ("sai6_root_clk" , "sai6" , base + 0x4380 , 0 , & share_count_sai6 );
524560 hws [IMX8MN_CLK_SAI6_IPG ] = imx_clk_hw_gate2_shared2 ("sai6_ipg_clk" , "ipg_audio_root" , base + 0x4380 , 0 , & share_count_sai6 );
525- hws [IMX8MN_CLK_SNVS_ROOT ] = imx_clk_hw_gate4 ("snvs_root_clk" , "ipg_root" , base + 0x4470 , 0 );
526561 hws [IMX8MN_CLK_UART1_ROOT ] = imx_clk_hw_gate4 ("uart1_root_clk" , "uart1" , base + 0x4490 , 0 );
527562 hws [IMX8MN_CLK_UART2_ROOT ] = imx_clk_hw_gate4 ("uart2_root_clk" , "uart2" , base + 0x44a0 , 0 );
528563 hws [IMX8MN_CLK_UART3_ROOT ] = imx_clk_hw_gate4 ("uart3_root_clk" , "uart3" , base + 0x44b0 , 0 );
@@ -549,6 +584,8 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
549584 hws [IMX8MN_CLK_SDMA3_ROOT ] = imx_clk_hw_gate4 ("sdma3_clk" , "ipg_audio_root" , base + 0x45f0 , 0 );
550585 hws [IMX8MN_CLK_SAI7_ROOT ] = imx_clk_hw_gate2_shared2 ("sai7_root_clk" , "sai7" , base + 0x4650 , 0 , & share_count_sai7 );
551586
587+ hws [IMX8MN_CLK_GPT_3M ] = imx_clk_hw_fixed_factor ("gpt_3m" , "osc_24m" , 1 , 8 );
588+
552589 hws [IMX8MN_CLK_DRAM_ALT_ROOT ] = imx_clk_hw_fixed_factor ("dram_alt_root" , "dram_alt" , 1 , 4 );
553590
554591 hws [IMX8MN_CLK_ARM ] = imx_clk_hw_cpu ("arm" , "arm_a53_core" ,
@@ -594,6 +631,8 @@ static struct platform_driver imx8mn_clk_driver = {
594631 },
595632};
596633module_platform_driver (imx8mn_clk_driver );
634+ module_param (mcore_booted , bool , S_IRUGO );
635+ MODULE_PARM_DESC (mcore_booted , "See Cortex-M core is booted or not" );
597636
598637MODULE_AUTHOR ("Anson Huang <Anson.Huang@nxp.com>" );
599638MODULE_DESCRIPTION ("NXP i.MX8MN clock driver" );
0 commit comments