rockchip: clk: Support setting ACLK
authorSimon Glass <sjg@chromium.org>
Sun, 13 Nov 2016 21:22:13 +0000 (14:22 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 26 Nov 2016 00:59:31 +0000 (17:59 -0700)
Add basic support for setting the ARM clock, since this allows us to run
at maximum speed in U-Boot. Currently only a single speed is supported
(1.8GHz).

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/clk/rockchip/clk_rk3288.c

index ed97e87a959bfbdc936d438e7dd3d9c2336389e5..d15504c3aaebda86250b56233d7871a8249bc061 100644 (file)
@@ -691,6 +691,13 @@ static ulong rk3288_clk_set_rate(struct clk *clk, ulong rate)
 
        gclk_rate = rkclk_pll_get_rate(priv->cru, CLK_GENERAL);
        switch (clk->id) {
+       case PLL_APLL:
+               /* We only support a fixed rate here */
+               if (rate != 1800000000)
+                       return -EINVAL;
+               rk3288_clk_configure_cpu(priv->cru, priv->grf);
+               new_rate = rate;
+               break;
        case CLK_DDR:
                new_rate = rkclk_configure_ddr(priv->cru, priv->grf, rate);
                break;