clk: starfive: Change divider value of cpu_core clock
authorXingyu Wu <xingyu.wu@starfivetech.com>
Thu, 15 Dec 2022 06:17:59 +0000 (14:17 +0800)
committerXingyu Wu <xingyu.wu@starfivetech.com>
Thu, 15 Dec 2022 06:18:05 +0000 (14:18 +0800)
Change divider value to make sure the frequency is half of PLL0.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
drivers/clk/starfive/clk-starfive-jh7110-gen.c

index cf974d2..d852c0a 100644 (file)
@@ -392,7 +392,7 @@ static int __init clk_starfive_jh7110_probe(struct platform_device *pdev)
                if (PLL0_DEFAULT_FREQ >= PLL0_FREQ_1500_VALUE) {
                        struct clk *cpu_core = priv->reg[JH7110_CPU_CORE].hw.clk;
 
-                       if (clk_set_rate(cpu_core, PLL0_FREQ_1500_VALUE / 2)) {
+                       if (clk_set_rate(cpu_core, clk_get_rate(pll0_clk) / 2)) {
                                dev_err(&pdev->dev, "set cpu_core rate failed\n");
                                goto failed_set;
                        }