Skip to content

Commit ac5d829

Browse files
Raghav Sharmakrzk
authored andcommitted
clk: samsung: exynosautov920: add clock support
Add support for CMU_M2M which provides clocks to M2M block, and register the required compatible and cmu_info for the same. Signed-off-by: Raghav Sharma <raghav.s@samsung.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 0b94201 commit ac5d829

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

drivers/clk/samsung/clk-exynosautov920.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define CLKS_NR_HSI0 (CLK_DOUT_HSI0_PCIE_APB + 1)
2828
#define CLKS_NR_HSI1 (CLK_MOUT_HSI1_USBDRD + 1)
2929
#define CLKS_NR_HSI2 (CLK_DOUT_HSI2_ETHERNET_PTP + 1)
30+
#define CLKS_NR_M2M (CLK_DOUT_M2M_NOCP + 1)
3031

3132
/* ---- CMU_TOP ------------------------------------------------------------ */
3233

@@ -1821,6 +1822,47 @@ static const struct samsung_cmu_info hsi2_cmu_info __initconst = {
18211822
.clk_name = "noc",
18221823
};
18231824

1825+
/* ---- CMU_M2M --------------------------------------------------------- */
1826+
1827+
/* Register Offset definitions for CMU_M2M (0x1a800000) */
1828+
#define PLL_CON0_MUX_CLKCMU_M2M_JPEG_USER 0x600
1829+
#define PLL_CON0_MUX_CLKCMU_M2M_NOC_USER 0x610
1830+
#define CLK_CON_DIV_DIV_CLK_M2M_NOCP 0x1800
1831+
1832+
static const unsigned long m2m_clk_regs[] __initconst = {
1833+
PLL_CON0_MUX_CLKCMU_M2M_JPEG_USER,
1834+
PLL_CON0_MUX_CLKCMU_M2M_NOC_USER,
1835+
CLK_CON_DIV_DIV_CLK_M2M_NOCP,
1836+
};
1837+
1838+
/* List of parent clocks for Muxes in CMU_M2M */
1839+
PNAME(mout_clkcmu_m2m_noc_user_p) = { "oscclk", "dout_clkcmu_m2m_noc" };
1840+
PNAME(mout_clkcmu_m2m_jpeg_user_p) = { "oscclk", "dout_clkcmu_m2m_jpeg" };
1841+
1842+
static const struct samsung_mux_clock m2m_mux_clks[] __initconst = {
1843+
MUX(CLK_MOUT_M2M_JPEG_USER, "mout_clkcmu_m2m_jpeg_user",
1844+
mout_clkcmu_m2m_jpeg_user_p, PLL_CON0_MUX_CLKCMU_M2M_JPEG_USER, 4, 1),
1845+
MUX(CLK_MOUT_M2M_NOC_USER, "mout_clkcmu_m2m_noc_user",
1846+
mout_clkcmu_m2m_noc_user_p, PLL_CON0_MUX_CLKCMU_M2M_NOC_USER, 4, 1),
1847+
};
1848+
1849+
static const struct samsung_div_clock m2m_div_clks[] __initconst = {
1850+
DIV(CLK_DOUT_M2M_NOCP, "dout_m2m_nocp",
1851+
"mout_clkcmu_m2m_noc_user", CLK_CON_DIV_DIV_CLK_M2M_NOCP,
1852+
0, 3),
1853+
};
1854+
1855+
static const struct samsung_cmu_info m2m_cmu_info __initconst = {
1856+
.mux_clks = m2m_mux_clks,
1857+
.nr_mux_clks = ARRAY_SIZE(m2m_mux_clks),
1858+
.div_clks = m2m_div_clks,
1859+
.nr_div_clks = ARRAY_SIZE(m2m_div_clks),
1860+
.nr_clk_ids = CLKS_NR_M2M,
1861+
.clk_regs = m2m_clk_regs,
1862+
.nr_clk_regs = ARRAY_SIZE(m2m_clk_regs),
1863+
.clk_name = "noc",
1864+
};
1865+
18241866
static int __init exynosautov920_cmu_probe(struct platform_device *pdev)
18251867
{
18261868
const struct samsung_cmu_info *info;
@@ -1851,6 +1893,9 @@ static const struct of_device_id exynosautov920_cmu_of_match[] = {
18511893
}, {
18521894
.compatible = "samsung,exynosautov920-cmu-hsi2",
18531895
.data = &hsi2_cmu_info,
1896+
}, {
1897+
.compatible = "samsung,exynosautov920-cmu-m2m",
1898+
.data = &m2m_cmu_info,
18541899
},
18551900
{ }
18561901
};

0 commit comments

Comments
 (0)