]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3188: init CPU freq in clock driver
authorKever Yang <kever.yang@rock-chips.com>
Mon, 22 Jul 2019 11:59:13 +0000 (19:59 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 29 Jul 2019 02:25:27 +0000 (10:25 +0800)
Init CPU frquency in clock driver instead of in SPL board file,
this will help for use common board file later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3188-board-spl.c
drivers/clk/rockchip/clk_rk3188.c

index c3efe0d7a95a9cbc35110729271dede68dae7ea7..017bc6e805ab0999ca1cd887a1e168913dea296b 100644 (file)
@@ -70,27 +70,6 @@ fallback:
        return BOOT_DEVICE_MMC1;
 }
 
-static int setup_arm_clock(void)
-{
-       struct udevice *dev;
-       struct clk clk;
-       int ret;
-
-       ret = rockchip_get_clk(&dev);
-       if (ret)
-               return ret;
-
-       clk.id = CLK_ARM;
-       ret = clk_request(dev, &clk);
-       if (ret < 0)
-               return ret;
-
-       ret = clk_set_rate(&clk, 600000000);
-
-       clk_free(&clk);
-       return ret;
-}
-
 void board_init_f(ulong dummy)
 {
        struct udevice *dev;
@@ -146,7 +125,6 @@ void board_init_f(ulong dummy)
                return;
        }
 
-       setup_arm_clock();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
        back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
index 9bb9959c9d3ac0512be40a741fa15b47c70d19c4..dda686cfb3a084fa43b3fb0922afafef8f50f7a9 100644 (file)
@@ -562,6 +562,9 @@ static int rk3188_clk_probe(struct udevice *dev)
 #endif
 
        rkclk_init(priv->cru, priv->grf, priv->has_bwadj);
+
+       /* Init CPU frequency */
+       rkclk_configure_cpu(priv->cru, priv->grf, APLL_HZ, priv->has_bwadj);
 #endif
 
        return 0;