@@ -26,73 +26,6 @@ static u32 share_count_disp;
26
26
static u32 share_count_pdm ;
27
27
static u32 share_count_nand ;
28
28
29
- static const struct imx_pll14xx_rate_table imx8mm_pll1416x_tbl [] = {
30
- PLL_1416X_RATE (1800000000U , 225 , 3 , 0 ),
31
- PLL_1416X_RATE (1600000000U , 200 , 3 , 0 ),
32
- PLL_1416X_RATE (1200000000U , 300 , 3 , 1 ),
33
- PLL_1416X_RATE (1000000000U , 250 , 3 , 1 ),
34
- PLL_1416X_RATE (800000000U , 200 , 3 , 1 ),
35
- PLL_1416X_RATE (750000000U , 250 , 2 , 2 ),
36
- PLL_1416X_RATE (700000000U , 350 , 3 , 2 ),
37
- PLL_1416X_RATE (600000000U , 300 , 3 , 2 ),
38
- };
39
-
40
- static const struct imx_pll14xx_rate_table imx8mm_audiopll_tbl [] = {
41
- PLL_1443X_RATE (393216000U , 262 , 2 , 3 , 9437 ),
42
- PLL_1443X_RATE (361267200U , 361 , 3 , 3 , 17511 ),
43
- };
44
-
45
- static const struct imx_pll14xx_rate_table imx8mm_videopll_tbl [] = {
46
- PLL_1443X_RATE (650000000U , 325 , 3 , 2 , 0 ),
47
- PLL_1443X_RATE (594000000U , 198 , 2 , 2 , 0 ),
48
- };
49
-
50
- static const struct imx_pll14xx_rate_table imx8mm_drampll_tbl [] = {
51
- PLL_1443X_RATE (650000000U , 325 , 3 , 2 , 0 ),
52
- };
53
-
54
- static struct imx_pll14xx_clk imx8mm_audio_pll = {
55
- .type = PLL_1443X ,
56
- .rate_table = imx8mm_audiopll_tbl ,
57
- .rate_count = ARRAY_SIZE (imx8mm_audiopll_tbl ),
58
- };
59
-
60
- static struct imx_pll14xx_clk imx8mm_video_pll = {
61
- .type = PLL_1443X ,
62
- .rate_table = imx8mm_videopll_tbl ,
63
- .rate_count = ARRAY_SIZE (imx8mm_videopll_tbl ),
64
- };
65
-
66
- static struct imx_pll14xx_clk imx8mm_dram_pll = {
67
- .type = PLL_1443X ,
68
- .rate_table = imx8mm_drampll_tbl ,
69
- .rate_count = ARRAY_SIZE (imx8mm_drampll_tbl ),
70
- };
71
-
72
- static struct imx_pll14xx_clk imx8mm_arm_pll = {
73
- .type = PLL_1416X ,
74
- .rate_table = imx8mm_pll1416x_tbl ,
75
- .rate_count = ARRAY_SIZE (imx8mm_pll1416x_tbl ),
76
- };
77
-
78
- static struct imx_pll14xx_clk imx8mm_gpu_pll = {
79
- .type = PLL_1416X ,
80
- .rate_table = imx8mm_pll1416x_tbl ,
81
- .rate_count = ARRAY_SIZE (imx8mm_pll1416x_tbl ),
82
- };
83
-
84
- static struct imx_pll14xx_clk imx8mm_vpu_pll = {
85
- .type = PLL_1416X ,
86
- .rate_table = imx8mm_pll1416x_tbl ,
87
- .rate_count = ARRAY_SIZE (imx8mm_pll1416x_tbl ),
88
- };
89
-
90
- static struct imx_pll14xx_clk imx8mm_sys_pll = {
91
- .type = PLL_1416X ,
92
- .rate_table = imx8mm_pll1416x_tbl ,
93
- .rate_count = ARRAY_SIZE (imx8mm_pll1416x_tbl ),
94
- };
95
-
96
29
static const char * pll_ref_sels [] = { "osc_24m" , "dummy" , "dummy" , "dummy" , };
97
30
static const char * audio_pll1_bypass_sels [] = {"audio_pll1" , "audio_pll1_ref_sel" , };
98
31
static const char * audio_pll2_bypass_sels [] = {"audio_pll2" , "audio_pll2_ref_sel" , };
@@ -101,8 +34,6 @@ static const char *dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", };
101
34
static const char * gpu_pll_bypass_sels [] = {"gpu_pll" , "gpu_pll_ref_sel" , };
102
35
static const char * vpu_pll_bypass_sels [] = {"vpu_pll" , "vpu_pll_ref_sel" , };
103
36
static const char * arm_pll_bypass_sels [] = {"arm_pll" , "arm_pll_ref_sel" , };
104
- static const char * sys_pll1_bypass_sels [] = {"sys_pll1" , "sys_pll1_ref_sel" , };
105
- static const char * sys_pll2_bypass_sels [] = {"sys_pll2" , "sys_pll2_ref_sel" , };
106
37
static const char * sys_pll3_bypass_sels [] = {"sys_pll3" , "sys_pll3_ref_sel" , };
107
38
108
39
/* CCM ROOT */
@@ -392,20 +323,18 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
392
323
clks [IMX8MM_GPU_PLL_REF_SEL ] = imx_clk_mux ("gpu_pll_ref_sel" , base + 0x64 , 0 , 2 , pll_ref_sels , ARRAY_SIZE (pll_ref_sels ));
393
324
clks [IMX8MM_VPU_PLL_REF_SEL ] = imx_clk_mux ("vpu_pll_ref_sel" , base + 0x74 , 0 , 2 , pll_ref_sels , ARRAY_SIZE (pll_ref_sels ));
394
325
clks [IMX8MM_ARM_PLL_REF_SEL ] = imx_clk_mux ("arm_pll_ref_sel" , base + 0x84 , 0 , 2 , pll_ref_sels , ARRAY_SIZE (pll_ref_sels ));
395
- clks [IMX8MM_SYS_PLL1_REF_SEL ] = imx_clk_mux ("sys_pll1_ref_sel" , base + 0x94 , 0 , 2 , pll_ref_sels , ARRAY_SIZE (pll_ref_sels ));
396
- clks [IMX8MM_SYS_PLL2_REF_SEL ] = imx_clk_mux ("sys_pll2_ref_sel" , base + 0x104 , 0 , 2 , pll_ref_sels , ARRAY_SIZE (pll_ref_sels ));
397
326
clks [IMX8MM_SYS_PLL3_REF_SEL ] = imx_clk_mux ("sys_pll3_ref_sel" , base + 0x114 , 0 , 2 , pll_ref_sels , ARRAY_SIZE (pll_ref_sels ));
398
327
399
- clks [IMX8MM_AUDIO_PLL1 ] = imx_clk_pll14xx ("audio_pll1" , "audio_pll1_ref_sel" , base , & imx8mm_audio_pll );
400
- clks [IMX8MM_AUDIO_PLL2 ] = imx_clk_pll14xx ("audio_pll2" , "audio_pll2_ref_sel" , base + 0x14 , & imx8mm_audio_pll );
401
- clks [IMX8MM_VIDEO_PLL1 ] = imx_clk_pll14xx ("video_pll1" , "video_pll1_ref_sel" , base + 0x28 , & imx8mm_video_pll );
402
- clks [IMX8MM_DRAM_PLL ] = imx_clk_pll14xx ("dram_pll" , "dram_pll_ref_sel" , base + 0x50 , & imx8mm_dram_pll );
403
- clks [IMX8MM_GPU_PLL ] = imx_clk_pll14xx ("gpu_pll" , "gpu_pll_ref_sel" , base + 0x64 , & imx8mm_gpu_pll );
404
- clks [IMX8MM_VPU_PLL ] = imx_clk_pll14xx ("vpu_pll" , "vpu_pll_ref_sel" , base + 0x74 , & imx8mm_vpu_pll );
405
- clks [IMX8MM_ARM_PLL ] = imx_clk_pll14xx ("arm_pll" , "arm_pll_ref_sel" , base + 0x84 , & imx8mm_arm_pll );
406
- clks [IMX8MM_SYS_PLL1 ] = imx_clk_pll14xx ("sys_pll1" , "sys_pll1_ref_sel" , base + 0x94 , & imx8mm_sys_pll );
407
- clks [IMX8MM_SYS_PLL2 ] = imx_clk_pll14xx ("sys_pll2" , "sys_pll2_ref_sel" , base + 0x104 , & imx8mm_sys_pll );
408
- clks [IMX8MM_SYS_PLL3 ] = imx_clk_pll14xx ("sys_pll3" , "sys_pll3_ref_sel" , base + 0x114 , & imx8mm_sys_pll );
328
+ clks [IMX8MM_AUDIO_PLL1 ] = imx_clk_pll14xx ("audio_pll1" , "audio_pll1_ref_sel" , base , & imx_1443x_pll );
329
+ clks [IMX8MM_AUDIO_PLL2 ] = imx_clk_pll14xx ("audio_pll2" , "audio_pll2_ref_sel" , base + 0x14 , & imx_1443x_pll );
330
+ clks [IMX8MM_VIDEO_PLL1 ] = imx_clk_pll14xx ("video_pll1" , "video_pll1_ref_sel" , base + 0x28 , & imx_1443x_pll );
331
+ clks [IMX8MM_DRAM_PLL ] = imx_clk_pll14xx ("dram_pll" , "dram_pll_ref_sel" , base + 0x50 , & imx_1443x_pll );
332
+ clks [IMX8MM_GPU_PLL ] = imx_clk_pll14xx ("gpu_pll" , "gpu_pll_ref_sel" , base + 0x64 , & imx_1416x_pll );
333
+ clks [IMX8MM_VPU_PLL ] = imx_clk_pll14xx ("vpu_pll" , "vpu_pll_ref_sel" , base + 0x74 , & imx_1416x_pll );
334
+ clks [IMX8MM_ARM_PLL ] = imx_clk_pll14xx ("arm_pll" , "arm_pll_ref_sel" , base + 0x84 , & imx_1416x_pll );
335
+ clks [IMX8MM_SYS_PLL1 ] = imx_clk_fixed ("sys_pll1" , 800000000 );
336
+ clks [IMX8MM_SYS_PLL2 ] = imx_clk_fixed ("sys_pll2" , 1000000000 );
337
+ clks [IMX8MM_SYS_PLL3 ] = imx_clk_pll14xx ("sys_pll3" , "sys_pll3_ref_sel" , base + 0x114 , & imx_1416x_pll );
409
338
410
339
/* PLL bypass out */
411
340
clks [IMX8MM_AUDIO_PLL1_BYPASS ] = imx_clk_mux_flags ("audio_pll1_bypass" , base , 16 , 1 , audio_pll1_bypass_sels , ARRAY_SIZE (audio_pll1_bypass_sels ), CLK_SET_RATE_PARENT );
@@ -415,8 +344,6 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
415
344
clks [IMX8MM_GPU_PLL_BYPASS ] = imx_clk_mux_flags ("gpu_pll_bypass" , base + 0x64 , 28 , 1 , gpu_pll_bypass_sels , ARRAY_SIZE (gpu_pll_bypass_sels ), CLK_SET_RATE_PARENT );
416
345
clks [IMX8MM_VPU_PLL_BYPASS ] = imx_clk_mux_flags ("vpu_pll_bypass" , base + 0x74 , 28 , 1 , vpu_pll_bypass_sels , ARRAY_SIZE (vpu_pll_bypass_sels ), CLK_SET_RATE_PARENT );
417
346
clks [IMX8MM_ARM_PLL_BYPASS ] = imx_clk_mux_flags ("arm_pll_bypass" , base + 0x84 , 28 , 1 , arm_pll_bypass_sels , ARRAY_SIZE (arm_pll_bypass_sels ), CLK_SET_RATE_PARENT );
418
- clks [IMX8MM_SYS_PLL1_BYPASS ] = imx_clk_mux_flags ("sys_pll1_bypass" , base + 0x94 , 28 , 1 , sys_pll1_bypass_sels , ARRAY_SIZE (sys_pll1_bypass_sels ), CLK_SET_RATE_PARENT );
419
- clks [IMX8MM_SYS_PLL2_BYPASS ] = imx_clk_mux_flags ("sys_pll2_bypass" , base + 0x104 , 28 , 1 , sys_pll2_bypass_sels , ARRAY_SIZE (sys_pll2_bypass_sels ), CLK_SET_RATE_PARENT );
420
347
clks [IMX8MM_SYS_PLL3_BYPASS ] = imx_clk_mux_flags ("sys_pll3_bypass" , base + 0x114 , 28 , 1 , sys_pll3_bypass_sels , ARRAY_SIZE (sys_pll3_bypass_sels ), CLK_SET_RATE_PARENT );
421
348
422
349
/* PLL out gate */
@@ -427,29 +354,48 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
427
354
clks [IMX8MM_GPU_PLL_OUT ] = imx_clk_gate ("gpu_pll_out" , "gpu_pll_bypass" , base + 0x64 , 11 );
428
355
clks [IMX8MM_VPU_PLL_OUT ] = imx_clk_gate ("vpu_pll_out" , "vpu_pll_bypass" , base + 0x74 , 11 );
429
356
clks [IMX8MM_ARM_PLL_OUT ] = imx_clk_gate ("arm_pll_out" , "arm_pll_bypass" , base + 0x84 , 11 );
430
- clks [IMX8MM_SYS_PLL1_OUT ] = imx_clk_gate ("sys_pll1_out" , "sys_pll1_bypass" , base + 0x94 , 11 );
431
- clks [IMX8MM_SYS_PLL2_OUT ] = imx_clk_gate ("sys_pll2_out" , "sys_pll2_bypass" , base + 0x104 , 11 );
432
357
clks [IMX8MM_SYS_PLL3_OUT ] = imx_clk_gate ("sys_pll3_out" , "sys_pll3_bypass" , base + 0x114 , 11 );
433
358
434
- /* SYS PLL fixed output */
435
- clks [IMX8MM_SYS_PLL1_40M ] = imx_clk_fixed_factor ("sys_pll1_40m" , "sys_pll1_out" , 1 , 20 );
436
- clks [IMX8MM_SYS_PLL1_80M ] = imx_clk_fixed_factor ("sys_pll1_80m" , "sys_pll1_out" , 1 , 10 );
437
- clks [IMX8MM_SYS_PLL1_100M ] = imx_clk_fixed_factor ("sys_pll1_100m" , "sys_pll1_out" , 1 , 8 );
438
- clks [IMX8MM_SYS_PLL1_133M ] = imx_clk_fixed_factor ("sys_pll1_133m" , "sys_pll1_out" , 1 , 6 );
439
- clks [IMX8MM_SYS_PLL1_160M ] = imx_clk_fixed_factor ("sys_pll1_160m" , "sys_pll1_out" , 1 , 5 );
440
- clks [IMX8MM_SYS_PLL1_200M ] = imx_clk_fixed_factor ("sys_pll1_200m" , "sys_pll1_out" , 1 , 4 );
441
- clks [IMX8MM_SYS_PLL1_266M ] = imx_clk_fixed_factor ("sys_pll1_266m" , "sys_pll1_out" , 1 , 3 );
442
- clks [IMX8MM_SYS_PLL1_400M ] = imx_clk_fixed_factor ("sys_pll1_400m" , "sys_pll1_out" , 1 , 2 );
359
+ /* SYS PLL1 fixed output */
360
+ clks [IMX8MM_SYS_PLL1_40M_CG ] = imx_clk_gate ("sys_pll1_40m_cg" , "sys_pll1" , base + 0x94 , 27 );
361
+ clks [IMX8MM_SYS_PLL1_80M_CG ] = imx_clk_gate ("sys_pll1_80m_cg" , "sys_pll1" , base + 0x94 , 25 );
362
+ clks [IMX8MM_SYS_PLL1_100M_CG ] = imx_clk_gate ("sys_pll1_100m_cg" , "sys_pll1" , base + 0x94 , 23 );
363
+ clks [IMX8MM_SYS_PLL1_133M_CG ] = imx_clk_gate ("sys_pll1_133m_cg" , "sys_pll1" , base + 0x94 , 21 );
364
+ clks [IMX8MM_SYS_PLL1_160M_CG ] = imx_clk_gate ("sys_pll1_160m_cg" , "sys_pll1" , base + 0x94 , 19 );
365
+ clks [IMX8MM_SYS_PLL1_200M_CG ] = imx_clk_gate ("sys_pll1_200m_cg" , "sys_pll1" , base + 0x94 , 17 );
366
+ clks [IMX8MM_SYS_PLL1_266M_CG ] = imx_clk_gate ("sys_pll1_266m_cg" , "sys_pll1" , base + 0x94 , 15 );
367
+ clks [IMX8MM_SYS_PLL1_400M_CG ] = imx_clk_gate ("sys_pll1_400m_cg" , "sys_pll1" , base + 0x94 , 13 );
368
+ clks [IMX8MM_SYS_PLL1_OUT ] = imx_clk_gate ("sys_pll1_out" , "sys_pll1" , base + 0x94 , 11 );
369
+
370
+ clks [IMX8MM_SYS_PLL1_40M ] = imx_clk_fixed_factor ("sys_pll1_40m" , "sys_pll1_40m_cg" , 1 , 20 );
371
+ clks [IMX8MM_SYS_PLL1_80M ] = imx_clk_fixed_factor ("sys_pll1_80m" , "sys_pll1_80m_cg" , 1 , 10 );
372
+ clks [IMX8MM_SYS_PLL1_100M ] = imx_clk_fixed_factor ("sys_pll1_100m" , "sys_pll1_100m_cg" , 1 , 8 );
373
+ clks [IMX8MM_SYS_PLL1_133M ] = imx_clk_fixed_factor ("sys_pll1_133m" , "sys_pll1_133m_cg" , 1 , 6 );
374
+ clks [IMX8MM_SYS_PLL1_160M ] = imx_clk_fixed_factor ("sys_pll1_160m" , "sys_pll1_160m_cg" , 1 , 5 );
375
+ clks [IMX8MM_SYS_PLL1_200M ] = imx_clk_fixed_factor ("sys_pll1_200m" , "sys_pll1_200m_cg" , 1 , 4 );
376
+ clks [IMX8MM_SYS_PLL1_266M ] = imx_clk_fixed_factor ("sys_pll1_266m" , "sys_pll1_266m_cg" , 1 , 3 );
377
+ clks [IMX8MM_SYS_PLL1_400M ] = imx_clk_fixed_factor ("sys_pll1_400m" , "sys_pll1_400m_cg" , 1 , 2 );
443
378
clks [IMX8MM_SYS_PLL1_800M ] = imx_clk_fixed_factor ("sys_pll1_800m" , "sys_pll1_out" , 1 , 1 );
444
379
445
- clks [IMX8MM_SYS_PLL2_50M ] = imx_clk_fixed_factor ("sys_pll2_50m" , "sys_pll2_out" , 1 , 20 );
446
- clks [IMX8MM_SYS_PLL2_100M ] = imx_clk_fixed_factor ("sys_pll2_100m" , "sys_pll2_out" , 1 , 10 );
447
- clks [IMX8MM_SYS_PLL2_125M ] = imx_clk_fixed_factor ("sys_pll2_125m" , "sys_pll2_out" , 1 , 8 );
448
- clks [IMX8MM_SYS_PLL2_166M ] = imx_clk_fixed_factor ("sys_pll2_166m" , "sys_pll2_out" , 1 , 6 );
449
- clks [IMX8MM_SYS_PLL2_200M ] = imx_clk_fixed_factor ("sys_pll2_200m" , "sys_pll2_out" , 1 , 5 );
450
- clks [IMX8MM_SYS_PLL2_250M ] = imx_clk_fixed_factor ("sys_pll2_250m" , "sys_pll2_out" , 1 , 4 );
451
- clks [IMX8MM_SYS_PLL2_333M ] = imx_clk_fixed_factor ("sys_pll2_333m" , "sys_pll2_out" , 1 , 3 );
452
- clks [IMX8MM_SYS_PLL2_500M ] = imx_clk_fixed_factor ("sys_pll2_500m" , "sys_pll2_out" , 1 , 2 );
380
+ /* SYS PLL2 fixed output */
381
+ clks [IMX8MM_SYS_PLL2_50M_CG ] = imx_clk_gate ("sys_pll2_50m_cg" , "sys_pll2" , base + 0x104 , 27 );
382
+ clks [IMX8MM_SYS_PLL2_100M_CG ] = imx_clk_gate ("sys_pll2_100m_cg" , "sys_pll2" , base + 0x104 , 25 );
383
+ clks [IMX8MM_SYS_PLL2_125M_CG ] = imx_clk_gate ("sys_pll2_125m_cg" , "sys_pll2" , base + 0x104 , 23 );
384
+ clks [IMX8MM_SYS_PLL2_166M_CG ] = imx_clk_gate ("sys_pll2_166m_cg" , "sys_pll2" , base + 0x104 , 21 );
385
+ clks [IMX8MM_SYS_PLL2_200M_CG ] = imx_clk_gate ("sys_pll2_200m_cg" , "sys_pll2" , base + 0x104 , 19 );
386
+ clks [IMX8MM_SYS_PLL2_250M_CG ] = imx_clk_gate ("sys_pll2_250m_cg" , "sys_pll2" , base + 0x104 , 17 );
387
+ clks [IMX8MM_SYS_PLL2_333M_CG ] = imx_clk_gate ("sys_pll2_333m_cg" , "sys_pll2" , base + 0x104 , 15 );
388
+ clks [IMX8MM_SYS_PLL2_500M_CG ] = imx_clk_gate ("sys_pll2_500m_cg" , "sys_pll2" , base + 0x104 , 13 );
389
+ clks [IMX8MM_SYS_PLL2_OUT ] = imx_clk_gate ("sys_pll2_out" , "sys_pll2" , base + 0x104 , 11 );
390
+
391
+ clks [IMX8MM_SYS_PLL2_50M ] = imx_clk_fixed_factor ("sys_pll2_50m" , "sys_pll2_50m_cg" , 1 , 20 );
392
+ clks [IMX8MM_SYS_PLL2_100M ] = imx_clk_fixed_factor ("sys_pll2_100m" , "sys_pll2_100m_cg" , 1 , 10 );
393
+ clks [IMX8MM_SYS_PLL2_125M ] = imx_clk_fixed_factor ("sys_pll2_125m" , "sys_pll2_125m_cg" , 1 , 8 );
394
+ clks [IMX8MM_SYS_PLL2_166M ] = imx_clk_fixed_factor ("sys_pll2_166m" , "sys_pll2_166m_cg" , 1 , 6 );
395
+ clks [IMX8MM_SYS_PLL2_200M ] = imx_clk_fixed_factor ("sys_pll2_200m" , "sys_pll2_200m_cg" , 1 , 5 );
396
+ clks [IMX8MM_SYS_PLL2_250M ] = imx_clk_fixed_factor ("sys_pll2_250m" , "sys_pll2_250m_cg" , 1 , 4 );
397
+ clks [IMX8MM_SYS_PLL2_333M ] = imx_clk_fixed_factor ("sys_pll2_333m" , "sys_pll2_333m_cg" , 1 , 3 );
398
+ clks [IMX8MM_SYS_PLL2_500M ] = imx_clk_fixed_factor ("sys_pll2_500m" , "sys_pll2_500m_cg" , 1 , 2 );
453
399
clks [IMX8MM_SYS_PLL2_1000M ] = imx_clk_fixed_factor ("sys_pll2_1000m" , "sys_pll2_out" , 1 , 1 );
454
400
455
401
np = dev -> of_node ;
0 commit comments