Skip to content

Commit 1627f68

Browse files
Mylène Josserandmmind
authored andcommitted
clk: rockchip: Handle clock tree for rk3288w variant
The revision rk3288w has a different clock tree about "hclk_vio" clock, according to the BSP kernel code. This patch handles this difference by detecting which device-tree we are using. If it is a "rockchip,rk3288-cru", let's register the clock tree as it was before. If the device-tree node is "rockchip,rk3288w-cru", we will apply the difference with this version of this SoC. Noticed that this new device-tree compatible must be handled in bootloader such as u-boot. Signed-off-by: Mylène Josserand <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 7f6ffbb commit 1627f68

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

drivers/clk/rockchip/clk-rk3288.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
425425
COMPOSITE(0, "aclk_vio0", mux_pll_src_cpll_gpll_usb480m_p, CLK_IGNORE_UNUSED,
426426
RK3288_CLKSEL_CON(31), 6, 2, MFLAGS, 0, 5, DFLAGS,
427427
RK3288_CLKGATE_CON(3), 0, GFLAGS),
428-
DIV(0, "hclk_vio", "aclk_vio0", 0,
429-
RK3288_CLKSEL_CON(28), 8, 5, DFLAGS),
430428
COMPOSITE(0, "aclk_vio1", mux_pll_src_cpll_gpll_usb480m_p, CLK_IGNORE_UNUSED,
431429
RK3288_CLKSEL_CON(31), 14, 2, MFLAGS, 8, 5, DFLAGS,
432430
RK3288_CLKGATE_CON(3), 2, GFLAGS),
@@ -819,6 +817,16 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
819817
INVERTER(0, "pclk_isp", "pclk_isp_in", RK3288_CLKSEL_CON(29), 3, IFLAGS),
820818
};
821819

820+
static struct rockchip_clk_branch rk3288w_hclkvio_branch[] __initdata = {
821+
DIV(0, "hclk_vio", "aclk_vio1", 0,
822+
RK3288_CLKSEL_CON(28), 8, 5, DFLAGS),
823+
};
824+
825+
static struct rockchip_clk_branch rk3288_hclkvio_branch[] __initdata = {
826+
DIV(0, "hclk_vio", "aclk_vio0", 0,
827+
RK3288_CLKSEL_CON(28), 8, 5, DFLAGS),
828+
};
829+
822830
static const char *const rk3288_critical_clocks[] __initconst = {
823831
"aclk_cpu",
824832
"aclk_peri",
@@ -936,6 +944,14 @@ static void __init rk3288_clk_init(struct device_node *np)
936944
RK3288_GRF_SOC_STATUS1);
937945
rockchip_clk_register_branches(ctx, rk3288_clk_branches,
938946
ARRAY_SIZE(rk3288_clk_branches));
947+
948+
if (of_device_is_compatible(np, "rockchip,rk3288w-cru"))
949+
rockchip_clk_register_branches(ctx, rk3288w_hclkvio_branch,
950+
ARRAY_SIZE(rk3288w_hclkvio_branch));
951+
else
952+
rockchip_clk_register_branches(ctx, rk3288_hclkvio_branch,
953+
ARRAY_SIZE(rk3288_hclkvio_branch));
954+
939955
rockchip_clk_protect_critical(rk3288_critical_clocks,
940956
ARRAY_SIZE(rk3288_critical_clocks));
941957

0 commit comments

Comments
 (0)