Skip to content

Commit b436f8a

Browse files
ziyao233pdp7
authored andcommitted
clk: thead: th1520-ap: Add C910 bus clock
This divider takes c910_clk as parent and is essential for the C910 cluster to operate, thus is marked as CLK_IS_CRITICAL. Reviewed-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Yao Zi <ziyao@disroot.org> Signed-off-by: Drew Fustini <fustini@kernel.org>
1 parent 892abfb commit b436f8a

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

drivers/clk/thead/clk-th1520-ap.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,20 @@ static struct ccu_mux c910_clk = {
539539
.mux = TH_CCU_MUX("c910", c910_parents, 0, 1),
540540
};
541541

542+
static struct ccu_div c910_bus_clk = {
543+
.enable = BIT(7),
544+
.div_en = BIT(11),
545+
.div = TH_CCU_DIV_FLAGS(8, 3, 0),
546+
.common = {
547+
.clkid = CLK_C910_BUS,
548+
.cfg0 = 0x100,
549+
.hw.init = CLK_HW_INIT_HW("c910-bus",
550+
&c910_clk.mux.hw,
551+
&ccu_div_ops,
552+
CLK_IS_CRITICAL),
553+
},
554+
};
555+
542556
static const struct clk_parent_data ahb2_cpusys_parents[] = {
543557
{ .hw = &gmac_pll_clk.common.hw },
544558
{ .index = 0 }
@@ -1051,6 +1065,7 @@ static struct ccu_common *th1520_pll_clks[] = {
10511065
};
10521066

10531067
static struct ccu_common *th1520_div_clks[] = {
1068+
&c910_bus_clk.common,
10541069
&ahb2_cpusys_hclk.common,
10551070
&apb3_cpusys_pclk.common,
10561071
&axi4_cpusys2_aclk.common,
@@ -1194,7 +1209,7 @@ static const struct th1520_plat_data th1520_ap_platdata = {
11941209
.th1520_mux_clks = th1520_mux_clks,
11951210
.th1520_gate_clks = th1520_gate_clks,
11961211

1197-
.nr_clks = CLK_UART_SCLK + 1,
1212+
.nr_clks = CLK_C910_BUS + 1,
11981213

11991214
.nr_pll_clks = ARRAY_SIZE(th1520_pll_clks),
12001215
.nr_div_clks = ARRAY_SIZE(th1520_div_clks),

0 commit comments

Comments
 (0)