Skip to content

Commit 5e5f328

Browse files
Raghav Sharmakrzk
authored andcommitted
clk: samsung: exynosautov920: add block G3D clock support
Add support for CMU_G3D which provides clocks to G3D block, and register the required compatible and cmu_info for the same. Signed-off-by: Raghav Sharma <raghav.s@samsung.com> Link: https://patch.msgid.link/20260202103555.2089376-3-raghav.s@samsung.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent 6e59133 commit 5e5f328

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

drivers/clk/samsung/clk-exynosautov920.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define CLKS_NR_M2M (CLK_DOUT_M2M_NOCP + 1)
3131
#define CLKS_NR_MFC (CLK_DOUT_MFC_NOCP + 1)
3232
#define CLKS_NR_MFD (CLK_DOUT_MFD_NOCP + 1)
33+
#define CLKS_NR_G3D (CLK_MOUT_G3D_NOCP_USER + 1)
3334

3435
/* ---- CMU_TOP ------------------------------------------------------------ */
3536

@@ -1942,6 +1943,54 @@ static const struct samsung_cmu_info mfd_cmu_info __initconst = {
19421943
.clk_name = "noc",
19431944
};
19441945

1946+
/* ---- CMU_G3D --------------------------------------------------------- */
1947+
1948+
/* Register Offset definitions for CMU_G3D (0x1a000000) */
1949+
#define PLL_LOCKTIME_PLL_G3D 0x0
1950+
#define PLL_CON3_PLL_G3D 0x10c
1951+
#define CLK_CON_MUX_MUX_CLK_G3D_NOC 0x1000
1952+
#define PLL_CON0_MUX_CLKCMU_G3D_NOCP_USER 0x600
1953+
#define PLL_CON0_MUX_CLKCMU_G3D_SWITCH_USER 0x610
1954+
1955+
static const unsigned long g3d_clk_regs[] __initconst = {
1956+
PLL_LOCKTIME_PLL_G3D,
1957+
PLL_CON3_PLL_G3D,
1958+
CLK_CON_MUX_MUX_CLK_G3D_NOC,
1959+
PLL_CON0_MUX_CLKCMU_G3D_NOCP_USER,
1960+
PLL_CON0_MUX_CLKCMU_G3D_SWITCH_USER,
1961+
};
1962+
1963+
static const struct samsung_pll_clock g3d_pll_clks[] __initconst = {
1964+
/* CMU_G3D_PLL */
1965+
PLL(pll_531x, FOUT_PLL_G3D, "fout_pll_g3d", "oscclk",
1966+
PLL_LOCKTIME_PLL_G3D, PLL_CON3_PLL_G3D, NULL),
1967+
};
1968+
1969+
/* List of parent clocks for Muxes in CMU_G3D */
1970+
PNAME(mout_clk_g3d_noc_p) = { "oscclk", "fout_pll_g3d", "mout_clkcmu_g3d_switch_user"};
1971+
PNAME(mout_clkcmu_g3d_switch_user_p) = { "oscclk", "dout_clkcmu_g3d_switch" };
1972+
PNAME(mout_clkcmu_g3d_nocp_user_p) = { "oscclk", "dout_clkcmu_g3d_nocp" };
1973+
1974+
static const struct samsung_mux_clock g3d_mux_clks[] __initconst = {
1975+
MUX(CLK_MOUT_G3D_NOC, "mout_clk_g3d_noc",
1976+
mout_clk_g3d_noc_p, CLK_CON_MUX_MUX_CLK_G3D_NOC, 0, 2),
1977+
MUX(CLK_MOUT_G3D_SWITCH_USER, "mout_clkcmu_g3d_switch_user",
1978+
mout_clkcmu_g3d_switch_user_p, PLL_CON0_MUX_CLKCMU_G3D_SWITCH_USER, 4, 1),
1979+
MUX(CLK_MOUT_G3D_NOCP_USER, "mout_clkcmu_g3d_nocp_user",
1980+
mout_clkcmu_g3d_nocp_user_p, PLL_CON0_MUX_CLKCMU_G3D_NOCP_USER, 4, 1),
1981+
};
1982+
1983+
static const struct samsung_cmu_info g3d_cmu_info __initconst = {
1984+
.pll_clks = g3d_pll_clks,
1985+
.nr_pll_clks = ARRAY_SIZE(g3d_pll_clks),
1986+
.mux_clks = g3d_mux_clks,
1987+
.nr_mux_clks = ARRAY_SIZE(g3d_mux_clks),
1988+
.nr_clk_ids = CLKS_NR_G3D,
1989+
.clk_regs = g3d_clk_regs,
1990+
.nr_clk_regs = ARRAY_SIZE(g3d_clk_regs),
1991+
.clk_name = "noc",
1992+
};
1993+
19451994
static int __init exynosautov920_cmu_probe(struct platform_device *pdev)
19461995
{
19471996
const struct samsung_cmu_info *info;
@@ -1981,6 +2030,9 @@ static const struct of_device_id exynosautov920_cmu_of_match[] = {
19812030
}, {
19822031
.compatible = "samsung,exynosautov920-cmu-mfd",
19832032
.data = &mfd_cmu_info,
2033+
}, {
2034+
.compatible = "samsung,exynosautov920-cmu-g3d",
2035+
.data = &g3d_cmu_info,
19842036
},
19852037
{ }
19862038
};

0 commit comments

Comments
 (0)