Skip to content

Commit 90b171f

Browse files
superna9999jbrun3t
authored andcommitted
clk: meson: g12a: set CLK_MUX_ROUND_CLOSEST on the cpu clock muxes
When setting the 100MHz, 500MHz, 666MHz and 1GHz rate for CPU clocks, CCF will use the SYS_PLL to handle these frequencies, but: - using FIXED_PLL derived FCLK_DIV2/DIV3 clocks is more precise - the Amlogic G12A/G12B/SM1 Suspend handling in firmware doesn't handle entering suspend using SYS_PLL for these frequencies Adding CLK_MUX_ROUND_CLOSEST on all the muxes of the non-SYS_PLL cpu clock tree helps CCF always selecting the FCLK_DIV2/DIV3 as source for these frequencies. Fixes: ffae847 ("clk: meson: g12a: add notifiers to handle cpu clock change") Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Jerome Brunet <[email protected]>
1 parent 4a07964 commit 90b171f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/clk/meson/g12a.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ static struct clk_regmap g12a_cpu_clk_premux0 = {
343343
.offset = HHI_SYS_CPU_CLK_CNTL0,
344344
.mask = 0x3,
345345
.shift = 0,
346+
.flags = CLK_MUX_ROUND_CLOSEST,
346347
},
347348
.hw.init = &(struct clk_init_data){
348349
.name = "cpu_clk_dyn0_sel",
@@ -409,6 +410,7 @@ static struct clk_regmap g12a_cpu_clk_postmux0 = {
409410
.offset = HHI_SYS_CPU_CLK_CNTL0,
410411
.mask = 0x1,
411412
.shift = 2,
413+
.flags = CLK_MUX_ROUND_CLOSEST,
412414
},
413415
.hw.init = &(struct clk_init_data){
414416
.name = "cpu_clk_dyn0",
@@ -465,6 +467,7 @@ static struct clk_regmap g12a_cpu_clk_dyn = {
465467
.offset = HHI_SYS_CPU_CLK_CNTL0,
466468
.mask = 0x1,
467469
.shift = 10,
470+
.flags = CLK_MUX_ROUND_CLOSEST,
468471
},
469472
.hw.init = &(struct clk_init_data){
470473
.name = "cpu_clk_dyn",
@@ -484,6 +487,7 @@ static struct clk_regmap g12a_cpu_clk = {
484487
.offset = HHI_SYS_CPU_CLK_CNTL0,
485488
.mask = 0x1,
486489
.shift = 11,
490+
.flags = CLK_MUX_ROUND_CLOSEST,
487491
},
488492
.hw.init = &(struct clk_init_data){
489493
.name = "cpu_clk",
@@ -503,6 +507,7 @@ static struct clk_regmap g12b_cpu_clk = {
503507
.offset = HHI_SYS_CPU_CLK_CNTL0,
504508
.mask = 0x1,
505509
.shift = 11,
510+
.flags = CLK_MUX_ROUND_CLOSEST,
506511
},
507512
.hw.init = &(struct clk_init_data){
508513
.name = "cpu_clk",
@@ -522,6 +527,7 @@ static struct clk_regmap g12b_cpub_clk_premux0 = {
522527
.offset = HHI_SYS_CPUB_CLK_CNTL,
523528
.mask = 0x3,
524529
.shift = 0,
530+
.flags = CLK_MUX_ROUND_CLOSEST,
525531
},
526532
.hw.init = &(struct clk_init_data){
527533
.name = "cpub_clk_dyn0_sel",
@@ -567,6 +573,7 @@ static struct clk_regmap g12b_cpub_clk_postmux0 = {
567573
.offset = HHI_SYS_CPUB_CLK_CNTL,
568574
.mask = 0x1,
569575
.shift = 2,
576+
.flags = CLK_MUX_ROUND_CLOSEST,
570577
},
571578
.hw.init = &(struct clk_init_data){
572579
.name = "cpub_clk_dyn0",
@@ -644,6 +651,7 @@ static struct clk_regmap g12b_cpub_clk_dyn = {
644651
.offset = HHI_SYS_CPUB_CLK_CNTL,
645652
.mask = 0x1,
646653
.shift = 10,
654+
.flags = CLK_MUX_ROUND_CLOSEST,
647655
},
648656
.hw.init = &(struct clk_init_data){
649657
.name = "cpub_clk_dyn",
@@ -663,6 +671,7 @@ static struct clk_regmap g12b_cpub_clk = {
663671
.offset = HHI_SYS_CPUB_CLK_CNTL,
664672
.mask = 0x1,
665673
.shift = 11,
674+
.flags = CLK_MUX_ROUND_CLOSEST,
666675
},
667676
.hw.init = &(struct clk_init_data){
668677
.name = "cpub_clk",

0 commit comments

Comments
 (0)