Skip to content

Commit 69a21d5

Browse files
cometzeroSylwester Nawrocki
authored andcommitted
clk: samsung: exynosautov9: add cmu_busmc clock support
CMU_BUSMC is responsible to control clocks of BLK_BUSMC which represents Data/Peri buses. Most clocks except PDMA/SPDMA are not necessary to be controlled by HLOS. So, this adds PDMA/SPDMA gate clocks. Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Link: https://lore.kernel.org/r/20220504075154.58819-7-chanho61.park@samsung.com
1 parent ceb4c8b commit 69a21d5

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

drivers/clk/samsung/clk-exynosautov9.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,58 @@ static void __init exynosautov9_cmu_top_init(struct device_node *np)
957957
CLK_OF_DECLARE(exynosautov9_cmu_top, "samsung,exynosautov9-cmu-top",
958958
exynosautov9_cmu_top_init);
959959

960+
/* ---- CMU_BUSMC ---------------------------------------------------------- */
961+
962+
/* Register Offset definitions for CMU_BUSMC (0x1b200000) */
963+
#define PLL_CON0_MUX_CLKCMU_BUSMC_BUS_USER 0x0600
964+
#define CLK_CON_DIV_DIV_CLK_BUSMC_BUSP 0x1800
965+
#define CLK_CON_GAT_GOUT_BLK_BUSMC_UID_QE_PDMA0_IPCLKPORT_PCLK 0x2078
966+
#define CLK_CON_GAT_GOUT_BLK_BUSMC_UID_QE_SPDMA_IPCLKPORT_PCLK 0x2080
967+
968+
static const unsigned long busmc_clk_regs[] __initconst = {
969+
PLL_CON0_MUX_CLKCMU_BUSMC_BUS_USER,
970+
CLK_CON_DIV_DIV_CLK_BUSMC_BUSP,
971+
CLK_CON_GAT_GOUT_BLK_BUSMC_UID_QE_PDMA0_IPCLKPORT_PCLK,
972+
CLK_CON_GAT_GOUT_BLK_BUSMC_UID_QE_SPDMA_IPCLKPORT_PCLK,
973+
};
974+
975+
/* List of parent clocks for Muxes in CMU_BUSMC */
976+
PNAME(mout_busmc_bus_user_p) = { "oscclk", "dout_clkcmu_busmc_bus" };
977+
978+
static const struct samsung_mux_clock busmc_mux_clks[] __initconst = {
979+
MUX(CLK_MOUT_BUSMC_BUS_USER, "mout_busmc_bus_user",
980+
mout_busmc_bus_user_p, PLL_CON0_MUX_CLKCMU_BUSMC_BUS_USER, 4, 1),
981+
};
982+
983+
static const struct samsung_div_clock busmc_div_clks[] __initconst = {
984+
DIV(CLK_DOUT_BUSMC_BUSP, "dout_busmc_busp", "mout_busmc_bus_user",
985+
CLK_CON_DIV_DIV_CLK_BUSMC_BUSP, 0, 3),
986+
};
987+
988+
static const struct samsung_gate_clock busmc_gate_clks[] __initconst = {
989+
GATE(CLK_GOUT_BUSMC_PDMA0_PCLK, "gout_busmc_pdma0_pclk",
990+
"dout_busmc_busp",
991+
CLK_CON_GAT_GOUT_BLK_BUSMC_UID_QE_PDMA0_IPCLKPORT_PCLK, 21,
992+
0, 0),
993+
GATE(CLK_GOUT_BUSMC_SPDMA_PCLK, "gout_busmc_spdma_pclk",
994+
"dout_busmc_busp",
995+
CLK_CON_GAT_GOUT_BLK_BUSMC_UID_QE_SPDMA_IPCLKPORT_PCLK, 21,
996+
0, 0),
997+
};
998+
999+
static const struct samsung_cmu_info busmc_cmu_info __initconst = {
1000+
.mux_clks = busmc_mux_clks,
1001+
.nr_mux_clks = ARRAY_SIZE(busmc_mux_clks),
1002+
.div_clks = busmc_div_clks,
1003+
.nr_div_clks = ARRAY_SIZE(busmc_div_clks),
1004+
.gate_clks = busmc_gate_clks,
1005+
.nr_gate_clks = ARRAY_SIZE(busmc_gate_clks),
1006+
.nr_clk_ids = BUSMC_NR_CLK,
1007+
.clk_regs = busmc_clk_regs,
1008+
.nr_clk_regs = ARRAY_SIZE(busmc_clk_regs),
1009+
.clk_name = "dout_clkcmu_busmc_bus",
1010+
};
1011+
9601012
/* ---- CMU_CORE ----------------------------------------------------------- */
9611013

9621014
/* Register Offset definitions for CMU_CORE (0x1b030000) */
@@ -1075,6 +1127,9 @@ static int __init exynosautov9_cmu_probe(struct platform_device *pdev)
10751127

10761128
static const struct of_device_id exynosautov9_cmu_of_match[] = {
10771129
{
1130+
.compatible = "samsung,exynosautov9-cmu-busmc",
1131+
.data = &busmc_cmu_info,
1132+
}, {
10781133
.compatible = "samsung,exynosautov9-cmu-core",
10791134
.data = &core_cmu_info,
10801135
}, {

0 commit comments

Comments
 (0)