Skip to content

Commit e6f4b4b

Browse files
Andre-ARMwens
authored andcommitted
clk: sunxi-ng: a523: Add support for bus clocks
Add the basic bus clocks for the Allwinner A523 and T527 SoCs. This covers the AHB, APB0 and APB1 clocks. Linux is not supposed to change those clocks, but they are needed as parents for many other mod clocks. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20250307002628.10684-7-andre.przywara@arm.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent 7cae1e2 commit e6f4b4b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

drivers/clk/sunxi-ng/ccu-sun55i-a523.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,39 @@ static CLK_FIXED_FACTOR_HW(pll_npu_2x_clk, "pll-npu-2x",
331331
static CLK_FIXED_FACTOR_HW(pll_npu_1x_clk, "pll-npu-1x",
332332
&pll_npu_4x_clk.common.hw, 4, 1, 0);
333333

334+
335+
/**************************************************************************
336+
* bus clocks *
337+
**************************************************************************/
338+
339+
static const struct clk_parent_data ahb_apb0_parents[] = {
340+
{ .fw_name = "hosc" },
341+
{ .fw_name = "losc" },
342+
{ .fw_name = "iosc" },
343+
{ .hw = &pll_periph0_600M_clk.hw },
344+
};
345+
346+
static SUNXI_CCU_M_DATA_WITH_MUX(ahb_clk, "ahb", ahb_apb0_parents, 0x510,
347+
0, 5, /* M */
348+
24, 2, /* mux */
349+
0);
350+
static SUNXI_CCU_M_DATA_WITH_MUX(apb0_clk, "apb0", ahb_apb0_parents, 0x520,
351+
0, 5, /* M */
352+
24, 2, /* mux */
353+
0);
354+
355+
static const struct clk_parent_data apb1_parents[] = {
356+
{ .fw_name = "hosc" },
357+
{ .fw_name = "losc" },
358+
{ .fw_name = "iosc" },
359+
{ .hw = &pll_periph0_600M_clk.hw },
360+
{ .hw = &pll_periph0_480M_clk.common.hw },
361+
};
362+
static SUNXI_CCU_M_DATA_WITH_MUX(apb1_clk, "apb1", apb1_parents, 0x524,
363+
0, 5, /* M */
364+
24, 3, /* mux */
365+
0);
366+
334367
/*
335368
* Contains all clocks that are controlled by a hardware register. They
336369
* have a (sunxi) .common member, which needs to be initialised by the common
@@ -358,6 +391,9 @@ static struct ccu_common *sun55i_a523_ccu_clks[] = {
358391
&pll_ve_clk.common,
359392
&pll_audio0_4x_clk.common,
360393
&pll_npu_4x_clk.common,
394+
&ahb_clk.common,
395+
&apb0_clk.common,
396+
&apb1_clk.common,
361397
};
362398

363399
static struct clk_hw_onecell_data sun55i_a523_hw_clks = {
@@ -403,6 +439,9 @@ static struct clk_hw_onecell_data sun55i_a523_hw_clks = {
403439
[CLK_PLL_NPU_4X] = &pll_npu_4x_clk.common.hw,
404440
[CLK_PLL_NPU_2X] = &pll_npu_2x_clk.hw,
405441
[CLK_PLL_NPU] = &pll_npu_1x_clk.hw,
442+
[CLK_AHB] = &ahb_clk.common.hw,
443+
[CLK_APB0] = &apb0_clk.common.hw,
444+
[CLK_APB1] = &apb1_clk.common.hw,
406445
},
407446
};
408447

0 commit comments

Comments
 (0)