18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2013 Samsung Electronics Co., Ltd.
48c2ecf20Sopenharmony_ci * Author: Tarek Dakhran <t.dakhran@samsung.com>
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Common Clock Framework support for Exynos5410 SoC.
78c2ecf20Sopenharmony_ci*/
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <dt-bindings/clock/exynos5410.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/clk-provider.h>
128c2ecf20Sopenharmony_ci#include <linux/of.h>
138c2ecf20Sopenharmony_ci#include <linux/of_address.h>
148c2ecf20Sopenharmony_ci#include <linux/clk.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include "clk.h"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define APLL_LOCK               0x0
198c2ecf20Sopenharmony_ci#define APLL_CON0               0x100
208c2ecf20Sopenharmony_ci#define CPLL_LOCK               0x10020
218c2ecf20Sopenharmony_ci#define CPLL_CON0               0x10120
228c2ecf20Sopenharmony_ci#define EPLL_LOCK               0x10040
238c2ecf20Sopenharmony_ci#define EPLL_CON0               0x10130
248c2ecf20Sopenharmony_ci#define MPLL_LOCK               0x4000
258c2ecf20Sopenharmony_ci#define MPLL_CON0               0x4100
268c2ecf20Sopenharmony_ci#define BPLL_LOCK               0x20010
278c2ecf20Sopenharmony_ci#define BPLL_CON0               0x20110
288c2ecf20Sopenharmony_ci#define KPLL_LOCK               0x28000
298c2ecf20Sopenharmony_ci#define KPLL_CON0               0x28100
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define SRC_CPU			0x200
328c2ecf20Sopenharmony_ci#define DIV_CPU0		0x500
338c2ecf20Sopenharmony_ci#define SRC_CPERI1		0x4204
348c2ecf20Sopenharmony_ci#define GATE_IP_G2D		0x8800
358c2ecf20Sopenharmony_ci#define DIV_TOP0		0x10510
368c2ecf20Sopenharmony_ci#define DIV_TOP1		0x10514
378c2ecf20Sopenharmony_ci#define DIV_FSYS0		0x10548
388c2ecf20Sopenharmony_ci#define DIV_FSYS1		0x1054c
398c2ecf20Sopenharmony_ci#define DIV_FSYS2		0x10550
408c2ecf20Sopenharmony_ci#define DIV_PERIC0		0x10558
418c2ecf20Sopenharmony_ci#define DIV_PERIC3		0x10564
428c2ecf20Sopenharmony_ci#define SRC_TOP0		0x10210
438c2ecf20Sopenharmony_ci#define SRC_TOP1		0x10214
448c2ecf20Sopenharmony_ci#define SRC_TOP2		0x10218
458c2ecf20Sopenharmony_ci#define SRC_FSYS		0x10244
468c2ecf20Sopenharmony_ci#define SRC_PERIC0		0x10250
478c2ecf20Sopenharmony_ci#define SRC_MASK_FSYS		0x10340
488c2ecf20Sopenharmony_ci#define SRC_MASK_PERIC0		0x10350
498c2ecf20Sopenharmony_ci#define GATE_BUS_FSYS0		0x10740
508c2ecf20Sopenharmony_ci#define GATE_TOP_SCLK_FSYS	0x10840
518c2ecf20Sopenharmony_ci#define GATE_TOP_SCLK_PERIC	0x10850
528c2ecf20Sopenharmony_ci#define GATE_IP_FSYS		0x10944
538c2ecf20Sopenharmony_ci#define GATE_IP_PERIC		0x10950
548c2ecf20Sopenharmony_ci#define GATE_IP_PERIS		0x10960
558c2ecf20Sopenharmony_ci#define SRC_CDREX		0x20200
568c2ecf20Sopenharmony_ci#define SRC_KFC			0x28200
578c2ecf20Sopenharmony_ci#define DIV_KFC0		0x28500
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/* list of PLLs */
608c2ecf20Sopenharmony_cienum exynos5410_plls {
618c2ecf20Sopenharmony_ci	apll, cpll, epll, mpll,
628c2ecf20Sopenharmony_ci	bpll, kpll,
638c2ecf20Sopenharmony_ci	nr_plls                 /* number of PLLs */
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* list of all parent clocks */
678c2ecf20Sopenharmony_ciPNAME(apll_p)		= { "fin_pll", "fout_apll", };
688c2ecf20Sopenharmony_ciPNAME(bpll_p)		= { "fin_pll", "fout_bpll", };
698c2ecf20Sopenharmony_ciPNAME(cpll_p)		= { "fin_pll", "fout_cpll" };
708c2ecf20Sopenharmony_ciPNAME(epll_p)		= { "fin_pll", "fout_epll" };
718c2ecf20Sopenharmony_ciPNAME(mpll_p)		= { "fin_pll", "fout_mpll", };
728c2ecf20Sopenharmony_ciPNAME(kpll_p)		= { "fin_pll", "fout_kpll", };
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciPNAME(mout_cpu_p)	= { "mout_apll", "sclk_mpll", };
758c2ecf20Sopenharmony_ciPNAME(mout_kfc_p)	= { "mout_kpll", "sclk_mpll", };
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciPNAME(mpll_user_p)	= { "fin_pll", "sclk_mpll", };
788c2ecf20Sopenharmony_ciPNAME(bpll_user_p)	= { "fin_pll", "sclk_bpll", };
798c2ecf20Sopenharmony_ciPNAME(mpll_bpll_p)	= { "sclk_mpll_muxed", "sclk_bpll_muxed", };
808c2ecf20Sopenharmony_ciPNAME(sclk_mpll_bpll_p)	= { "sclk_mpll_bpll", "fin_pll", };
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ciPNAME(group2_p)		= { "fin_pll", "fin_pll", "none", "none",
838c2ecf20Sopenharmony_ci			"none", "none", "sclk_mpll_bpll",
848c2ecf20Sopenharmony_ci			 "none", "none", "sclk_cpll" };
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock exynos5410_mux_clks[] __initconst = {
878c2ecf20Sopenharmony_ci	MUX(0, "mout_apll", apll_p, SRC_CPU, 0, 1),
888c2ecf20Sopenharmony_ci	MUX(0, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1),
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci	MUX(0, "mout_kpll", kpll_p, SRC_KFC, 0, 1),
918c2ecf20Sopenharmony_ci	MUX(0, "mout_kfc", mout_kfc_p, SRC_KFC, 16, 1),
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci	MUX(0, "sclk_mpll", mpll_p, SRC_CPERI1, 8, 1),
948c2ecf20Sopenharmony_ci	MUX(0, "sclk_mpll_muxed", mpll_user_p, SRC_TOP2, 20, 1),
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	MUX(0, "sclk_bpll", bpll_p, SRC_CDREX, 0, 1),
978c2ecf20Sopenharmony_ci	MUX(0, "sclk_bpll_muxed", bpll_user_p, SRC_TOP2, 24, 1),
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci	MUX(0, "sclk_epll", epll_p, SRC_TOP2, 12, 1),
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci	MUX(0, "sclk_cpll", cpll_p, SRC_TOP2, 8, 1),
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci	MUX(0, "sclk_mpll_bpll", mpll_bpll_p, SRC_TOP1, 20, 1),
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci	MUX(0, "mout_mmc0", group2_p, SRC_FSYS, 0, 4),
1068c2ecf20Sopenharmony_ci	MUX(0, "mout_mmc1", group2_p, SRC_FSYS, 4, 4),
1078c2ecf20Sopenharmony_ci	MUX(0, "mout_mmc2", group2_p, SRC_FSYS, 8, 4),
1088c2ecf20Sopenharmony_ci	MUX(0, "mout_usbd300", sclk_mpll_bpll_p, SRC_FSYS, 28, 1),
1098c2ecf20Sopenharmony_ci	MUX(0, "mout_usbd301", sclk_mpll_bpll_p, SRC_FSYS, 29, 1),
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci	MUX(0, "mout_uart0", group2_p, SRC_PERIC0, 0, 4),
1128c2ecf20Sopenharmony_ci	MUX(0, "mout_uart1", group2_p, SRC_PERIC0, 4, 4),
1138c2ecf20Sopenharmony_ci	MUX(0, "mout_uart2", group2_p, SRC_PERIC0, 8, 4),
1148c2ecf20Sopenharmony_ci	MUX(0, "mout_uart3", group2_p, SRC_PERIC0, 12, 4),
1158c2ecf20Sopenharmony_ci	MUX(0, "mout_pwm", group2_p, SRC_PERIC0, 24, 4),
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci	MUX(0, "mout_aclk200", mpll_bpll_p, SRC_TOP0, 12, 1),
1188c2ecf20Sopenharmony_ci	MUX(0, "mout_aclk400", mpll_bpll_p, SRC_TOP0, 20, 1),
1198c2ecf20Sopenharmony_ci};
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_cistatic const struct samsung_div_clock exynos5410_div_clks[] __initconst = {
1228c2ecf20Sopenharmony_ci	DIV(0, "div_arm", "mout_cpu", DIV_CPU0, 0, 3),
1238c2ecf20Sopenharmony_ci	DIV(0, "div_arm2", "div_arm", DIV_CPU0, 28, 3),
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	DIV(0, "div_acp", "div_arm2", DIV_CPU0, 8, 3),
1268c2ecf20Sopenharmony_ci	DIV(0, "div_cpud", "div_arm2", DIV_CPU0, 4, 3),
1278c2ecf20Sopenharmony_ci	DIV(0, "div_atb", "div_arm2", DIV_CPU0, 16, 3),
1288c2ecf20Sopenharmony_ci	DIV(0, "pclk_dbg", "div_arm2", DIV_CPU0, 20, 3),
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci	DIV(0, "div_kfc", "mout_kfc", DIV_KFC0, 0, 3),
1318c2ecf20Sopenharmony_ci	DIV(0, "div_aclk", "div_kfc", DIV_KFC0, 4, 3),
1328c2ecf20Sopenharmony_ci	DIV(0, "div_pclk", "div_kfc", DIV_KFC0, 20, 3),
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci	DIV(0, "aclk66_pre", "sclk_mpll_muxed", DIV_TOP1, 24, 3),
1358c2ecf20Sopenharmony_ci	DIV(0, "aclk66", "aclk66_pre", DIV_TOP0, 0, 3),
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci	DIV(0, "dout_usbphy300", "mout_usbd300", DIV_FSYS0, 16, 4),
1388c2ecf20Sopenharmony_ci	DIV(0, "dout_usbphy301", "mout_usbd301", DIV_FSYS0, 20, 4),
1398c2ecf20Sopenharmony_ci	DIV(0, "dout_usbd300", "mout_usbd300", DIV_FSYS0, 24, 4),
1408c2ecf20Sopenharmony_ci	DIV(0, "dout_usbd301", "mout_usbd301", DIV_FSYS0, 28, 4),
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci	DIV(0, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
1438c2ecf20Sopenharmony_ci	DIV(0, "div_mmc1", "mout_mmc1", DIV_FSYS1, 16, 4),
1448c2ecf20Sopenharmony_ci	DIV(0, "div_mmc2", "mout_mmc2", DIV_FSYS2, 0, 4),
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci	DIV_F(0, "div_mmc_pre0", "div_mmc0",
1478c2ecf20Sopenharmony_ci			DIV_FSYS1, 8, 8, CLK_SET_RATE_PARENT, 0),
1488c2ecf20Sopenharmony_ci	DIV_F(0, "div_mmc_pre1", "div_mmc1",
1498c2ecf20Sopenharmony_ci			DIV_FSYS1, 24, 8, CLK_SET_RATE_PARENT, 0),
1508c2ecf20Sopenharmony_ci	DIV_F(0, "div_mmc_pre2", "div_mmc2",
1518c2ecf20Sopenharmony_ci			DIV_FSYS2, 8, 8, CLK_SET_RATE_PARENT, 0),
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci	DIV(0, "div_uart0", "mout_uart0", DIV_PERIC0, 0, 4),
1548c2ecf20Sopenharmony_ci	DIV(0, "div_uart1", "mout_uart1", DIV_PERIC0, 4, 4),
1558c2ecf20Sopenharmony_ci	DIV(0, "div_uart2", "mout_uart2", DIV_PERIC0, 8, 4),
1568c2ecf20Sopenharmony_ci	DIV(0, "div_uart3", "mout_uart3", DIV_PERIC0, 12, 4),
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci	DIV(0, "dout_pwm", "mout_pwm", DIV_PERIC3, 0, 4),
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci	DIV(0, "aclk200", "mout_aclk200", DIV_TOP0, 12, 3),
1618c2ecf20Sopenharmony_ci	DIV(0, "aclk266", "mpll_user_p", DIV_TOP0, 16, 3),
1628c2ecf20Sopenharmony_ci	DIV(0, "aclk400", "mout_aclk400", DIV_TOP0, 24, 3),
1638c2ecf20Sopenharmony_ci};
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock exynos5410_gate_clks[] __initconst = {
1668c2ecf20Sopenharmony_ci	GATE(CLK_SSS, "sss", "aclk266", GATE_IP_G2D, 2, 0, 0),
1678c2ecf20Sopenharmony_ci	GATE(CLK_MCT, "mct", "aclk66", GATE_IP_PERIS, 18, 0, 0),
1688c2ecf20Sopenharmony_ci	GATE(CLK_WDT, "wdt", "aclk66", GATE_IP_PERIS, 19, 0, 0),
1698c2ecf20Sopenharmony_ci	GATE(CLK_RTC, "rtc", "aclk66", GATE_IP_PERIS, 20, 0, 0),
1708c2ecf20Sopenharmony_ci	GATE(CLK_TMU, "tmu", "aclk66", GATE_IP_PERIS, 21, 0, 0),
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_MMC0, "sclk_mmc0", "div_mmc_pre0",
1738c2ecf20Sopenharmony_ci			SRC_MASK_FSYS, 0, CLK_SET_RATE_PARENT, 0),
1748c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_MMC1, "sclk_mmc1", "div_mmc_pre1",
1758c2ecf20Sopenharmony_ci			SRC_MASK_FSYS, 4, CLK_SET_RATE_PARENT, 0),
1768c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_MMC2, "sclk_mmc2", "div_mmc_pre2",
1778c2ecf20Sopenharmony_ci			SRC_MASK_FSYS, 8, CLK_SET_RATE_PARENT, 0),
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci	GATE(CLK_MMC0, "sdmmc0", "aclk200", GATE_BUS_FSYS0, 12, 0, 0),
1808c2ecf20Sopenharmony_ci	GATE(CLK_MMC1, "sdmmc1", "aclk200", GATE_BUS_FSYS0, 13, 0, 0),
1818c2ecf20Sopenharmony_ci	GATE(CLK_MMC2, "sdmmc2", "aclk200", GATE_BUS_FSYS0, 14, 0, 0),
1828c2ecf20Sopenharmony_ci	GATE(CLK_PDMA1, "pdma1", "aclk200", GATE_BUS_FSYS0, 2, 0, 0),
1838c2ecf20Sopenharmony_ci	GATE(CLK_PDMA0, "pdma0", "aclk200", GATE_BUS_FSYS0, 1, 0, 0),
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_USBPHY301, "sclk_usbphy301", "dout_usbphy301",
1868c2ecf20Sopenharmony_ci	     GATE_TOP_SCLK_FSYS, 7, CLK_SET_RATE_PARENT, 0),
1878c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_USBPHY300, "sclk_usbphy300", "dout_usbphy300",
1888c2ecf20Sopenharmony_ci	     GATE_TOP_SCLK_FSYS, 8, CLK_SET_RATE_PARENT, 0),
1898c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_USBD300, "sclk_usbd300", "dout_usbd300",
1908c2ecf20Sopenharmony_ci	     GATE_TOP_SCLK_FSYS, 9, CLK_SET_RATE_PARENT, 0),
1918c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_USBD301, "sclk_usbd301", "dout_usbd301",
1928c2ecf20Sopenharmony_ci	     GATE_TOP_SCLK_FSYS, 10, CLK_SET_RATE_PARENT, 0),
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_PWM, "sclk_pwm", "dout_pwm",
1958c2ecf20Sopenharmony_ci	     GATE_TOP_SCLK_PERIC, 11, CLK_SET_RATE_PARENT, 0),
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci	GATE(CLK_UART0, "uart0", "aclk66", GATE_IP_PERIC, 0, 0, 0),
1988c2ecf20Sopenharmony_ci	GATE(CLK_UART1, "uart1", "aclk66", GATE_IP_PERIC, 1, 0, 0),
1998c2ecf20Sopenharmony_ci	GATE(CLK_UART2, "uart2", "aclk66", GATE_IP_PERIC, 2, 0, 0),
2008c2ecf20Sopenharmony_ci	GATE(CLK_UART3, "uart3", "aclk66", GATE_IP_PERIC, 3, 0, 0),
2018c2ecf20Sopenharmony_ci	GATE(CLK_I2C0, "i2c0", "aclk66", GATE_IP_PERIC, 6, 0, 0),
2028c2ecf20Sopenharmony_ci	GATE(CLK_I2C1, "i2c1", "aclk66", GATE_IP_PERIC, 7, 0, 0),
2038c2ecf20Sopenharmony_ci	GATE(CLK_I2C2, "i2c2", "aclk66", GATE_IP_PERIC, 8, 0, 0),
2048c2ecf20Sopenharmony_ci	GATE(CLK_I2C3, "i2c3", "aclk66", GATE_IP_PERIC, 9, 0, 0),
2058c2ecf20Sopenharmony_ci	GATE(CLK_USI0, "usi0", "aclk66", GATE_IP_PERIC, 10, 0, 0),
2068c2ecf20Sopenharmony_ci	GATE(CLK_USI1, "usi1", "aclk66", GATE_IP_PERIC, 11, 0, 0),
2078c2ecf20Sopenharmony_ci	GATE(CLK_USI2, "usi2", "aclk66", GATE_IP_PERIC, 12, 0, 0),
2088c2ecf20Sopenharmony_ci	GATE(CLK_USI3, "usi3", "aclk66", GATE_IP_PERIC, 13, 0, 0),
2098c2ecf20Sopenharmony_ci	GATE(CLK_TSADC, "tsadc", "aclk66", GATE_IP_PERIC, 15, 0, 0),
2108c2ecf20Sopenharmony_ci	GATE(CLK_PWM, "pwm", "aclk66", GATE_IP_PERIC, 24, 0, 0),
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_UART0, "sclk_uart0", "div_uart0",
2138c2ecf20Sopenharmony_ci			SRC_MASK_PERIC0, 0, CLK_SET_RATE_PARENT, 0),
2148c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_UART1, "sclk_uart1", "div_uart1",
2158c2ecf20Sopenharmony_ci			SRC_MASK_PERIC0, 4, CLK_SET_RATE_PARENT, 0),
2168c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_UART2, "sclk_uart2", "div_uart2",
2178c2ecf20Sopenharmony_ci			SRC_MASK_PERIC0, 8, CLK_SET_RATE_PARENT, 0),
2188c2ecf20Sopenharmony_ci	GATE(CLK_SCLK_UART3, "sclk_uart3", "div_uart3",
2198c2ecf20Sopenharmony_ci			SRC_MASK_PERIC0, 12, CLK_SET_RATE_PARENT, 0),
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci	GATE(CLK_USBH20, "usbh20", "aclk200_fsys", GATE_IP_FSYS, 18, 0, 0),
2228c2ecf20Sopenharmony_ci	GATE(CLK_USBD300, "usbd300", "aclk200_fsys", GATE_IP_FSYS, 19, 0, 0),
2238c2ecf20Sopenharmony_ci	GATE(CLK_USBD301, "usbd301", "aclk200_fsys", GATE_IP_FSYS, 20, 0, 0),
2248c2ecf20Sopenharmony_ci};
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_cistatic const struct samsung_pll_rate_table exynos5410_pll2550x_24mhz_tbl[] __initconst = {
2278c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 400000000U, 200, 3, 2, 0),
2288c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 333000000U, 111, 2, 2, 0),
2298c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 300000000U, 100, 2, 2, 0),
2308c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 266000000U, 266, 3, 3, 0),
2318c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 200000000U, 200, 3, 3, 0),
2328c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 192000000U, 192, 3, 3, 0),
2338c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 166000000U, 166, 3, 3, 0),
2348c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 133000000U, 266, 3, 4, 0),
2358c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 100000000U, 200, 3, 4, 0),
2368c2ecf20Sopenharmony_ci	PLL_36XX_RATE(24 * MHZ, 66000000U,  176, 2, 5, 0),
2378c2ecf20Sopenharmony_ci};
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_cistatic struct samsung_pll_clock exynos5410_plls[nr_plls] __initdata = {
2408c2ecf20Sopenharmony_ci	[apll] = PLL(pll_35xx, CLK_FOUT_APLL, "fout_apll", "fin_pll", APLL_LOCK,
2418c2ecf20Sopenharmony_ci		APLL_CON0, NULL),
2428c2ecf20Sopenharmony_ci	[cpll] = PLL(pll_35xx, CLK_FOUT_CPLL, "fout_cpll", "fin_pll", CPLL_LOCK,
2438c2ecf20Sopenharmony_ci		CPLL_CON0, NULL),
2448c2ecf20Sopenharmony_ci	[epll] = PLL(pll_2650x, CLK_FOUT_EPLL, "fout_epll", "fin_pll", EPLL_LOCK,
2458c2ecf20Sopenharmony_ci		EPLL_CON0, NULL),
2468c2ecf20Sopenharmony_ci	[mpll] = PLL(pll_35xx, CLK_FOUT_MPLL, "fout_mpll", "fin_pll", MPLL_LOCK,
2478c2ecf20Sopenharmony_ci		MPLL_CON0, NULL),
2488c2ecf20Sopenharmony_ci	[bpll] = PLL(pll_35xx, CLK_FOUT_BPLL, "fout_bpll", "fin_pll", BPLL_LOCK,
2498c2ecf20Sopenharmony_ci		BPLL_CON0, NULL),
2508c2ecf20Sopenharmony_ci	[kpll] = PLL(pll_35xx, CLK_FOUT_KPLL, "fout_kpll", "fin_pll", KPLL_LOCK,
2518c2ecf20Sopenharmony_ci		KPLL_CON0, NULL),
2528c2ecf20Sopenharmony_ci};
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info cmu __initconst = {
2558c2ecf20Sopenharmony_ci	.pll_clks	= exynos5410_plls,
2568c2ecf20Sopenharmony_ci	.nr_pll_clks	= ARRAY_SIZE(exynos5410_plls),
2578c2ecf20Sopenharmony_ci	.mux_clks	= exynos5410_mux_clks,
2588c2ecf20Sopenharmony_ci	.nr_mux_clks	= ARRAY_SIZE(exynos5410_mux_clks),
2598c2ecf20Sopenharmony_ci	.div_clks	= exynos5410_div_clks,
2608c2ecf20Sopenharmony_ci	.nr_div_clks	= ARRAY_SIZE(exynos5410_div_clks),
2618c2ecf20Sopenharmony_ci	.gate_clks	= exynos5410_gate_clks,
2628c2ecf20Sopenharmony_ci	.nr_gate_clks	= ARRAY_SIZE(exynos5410_gate_clks),
2638c2ecf20Sopenharmony_ci	.nr_clk_ids	= CLK_NR_CLKS,
2648c2ecf20Sopenharmony_ci};
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci/* register exynos5410 clocks */
2678c2ecf20Sopenharmony_cistatic void __init exynos5410_clk_init(struct device_node *np)
2688c2ecf20Sopenharmony_ci{
2698c2ecf20Sopenharmony_ci	struct clk *xxti = of_clk_get(np, 0);
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci	if (!IS_ERR(xxti) && clk_get_rate(xxti) == 24 * MHZ)
2728c2ecf20Sopenharmony_ci		exynos5410_plls[epll].rate_table = exynos5410_pll2550x_24mhz_tbl;
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci	samsung_cmu_register_one(np, &cmu);
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci	pr_debug("Exynos5410: clock setup completed.\n");
2778c2ecf20Sopenharmony_ci}
2788c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos5410_clk, "samsung,exynos5410-clock", exynos5410_clk_init);
279