]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: rockchip: rk3568: update clks
authorElaine Zhang <zhangqing@rock-chips.com>
Tue, 12 Oct 2021 08:43:00 +0000 (16:43 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 15 Oct 2021 12:57:31 +0000 (20:57 +0800)
fix up ppll init freq.
support tclk_emmc.
add freq (26M) for mmc device.
fix up the sfc clk rate unit error.

Change in V2:
remove change id.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/include/asm/arch-rockchip/cru_rk3568.h
drivers/clk/rockchip/clk_rk3568.c

index 6c59033f03a60a4208904ec98b19e5fe9c4a3958..399f19ad21ecfa788b844d1b9c7078180b4eca21 100644 (file)
@@ -14,7 +14,7 @@
 #define APLL_HZ                (816 * MHz)
 #define GPLL_HZ                (1188 * MHz)
 #define CPLL_HZ                (1000 * MHz)
-#define PPLL_HZ                (100 * MHz)
+#define PPLL_HZ                (200 * MHz)
 
 /* RK3568 pll id */
 enum rk3568_pll_id {
index 553c6c0dafbdbba78e7280a9bf718d162088fb77..d5e45e7602c7c1c7fe2e5738e6ae8b3e969b278b 100644 (file)
@@ -1441,6 +1441,7 @@ static ulong rk3568_sdmmc_set_clk(struct rk3568_clk_priv *priv,
 
        switch (rate) {
        case OSC_HZ:
+       case 26 * MHz:
                src_clk = CLK_SDMMC_SEL_24M;
                break;
        case 400 * MHz:
@@ -1507,7 +1508,7 @@ static ulong rk3568_sfc_get_clk(struct rk3568_clk_priv *priv)
        case SCLK_SFC_SEL_125M:
                return 125 * MHz;
        case SCLK_SFC_SEL_150M:
-               return 150 * KHz;
+               return 150 * MHz;
        default:
                return -ENOENT;
        }
@@ -1534,7 +1535,7 @@ static ulong rk3568_sfc_set_clk(struct rk3568_clk_priv *priv, ulong rate)
        case 125 * MHz:
                src_clk = SCLK_SFC_SEL_125M;
                break;
-       case 150 * KHz:
+       case 150 * MHz:
                src_clk = SCLK_SFC_SEL_150M;
                break;
        default:
@@ -2406,6 +2407,9 @@ static ulong rk3568_clk_get_rate(struct clk *clk)
        case BCLK_EMMC:
                rate = rk3568_emmc_get_bclk(priv);
                break;
+       case TCLK_EMMC:
+               rate = OSC_HZ;
+               break;
 #ifndef CONFIG_SPL_BUILD
        case ACLK_VOP:
                rate = rk3568_aclk_vop_get_clk(priv);
@@ -2582,6 +2586,9 @@ static ulong rk3568_clk_set_rate(struct clk *clk, ulong rate)
        case BCLK_EMMC:
                ret = rk3568_emmc_set_bclk(priv, rate);
                break;
+       case TCLK_EMMC:
+               ret = OSC_HZ;
+               break;
 #ifndef CONFIG_SPL_BUILD
        case ACLK_VOP:
                ret = rk3568_aclk_vop_set_clk(priv, rate);