18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (c) 2013 Samsung Electronics Co., Ltd. 48c2ecf20Sopenharmony_ci * Copyright (c) 2013 Linaro Ltd. 58c2ecf20Sopenharmony_ci * Author: Thomas Abraham <thomas.ab@samsung.com> 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Common Clock Framework support for Exynos5250 SoC. 88c2ecf20Sopenharmony_ci*/ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <dt-bindings/clock/exynos5250.h> 118c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 128c2ecf20Sopenharmony_ci#include <linux/io.h> 138c2ecf20Sopenharmony_ci#include <linux/of.h> 148c2ecf20Sopenharmony_ci#include <linux/of_address.h> 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#include "clk.h" 178c2ecf20Sopenharmony_ci#include "clk-cpu.h" 188c2ecf20Sopenharmony_ci#include "clk-exynos5-subcmu.h" 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#define APLL_LOCK 0x0 218c2ecf20Sopenharmony_ci#define APLL_CON0 0x100 228c2ecf20Sopenharmony_ci#define SRC_CPU 0x200 238c2ecf20Sopenharmony_ci#define DIV_CPU0 0x500 248c2ecf20Sopenharmony_ci#define PWR_CTRL1 0x1020 258c2ecf20Sopenharmony_ci#define PWR_CTRL2 0x1024 268c2ecf20Sopenharmony_ci#define MPLL_LOCK 0x4000 278c2ecf20Sopenharmony_ci#define MPLL_CON0 0x4100 288c2ecf20Sopenharmony_ci#define SRC_CORE1 0x4204 298c2ecf20Sopenharmony_ci#define GATE_IP_ACP 0x8800 308c2ecf20Sopenharmony_ci#define GATE_IP_ISP0 0xc800 318c2ecf20Sopenharmony_ci#define GATE_IP_ISP1 0xc804 328c2ecf20Sopenharmony_ci#define CPLL_LOCK 0x10020 338c2ecf20Sopenharmony_ci#define EPLL_LOCK 0x10030 348c2ecf20Sopenharmony_ci#define VPLL_LOCK 0x10040 358c2ecf20Sopenharmony_ci#define GPLL_LOCK 0x10050 368c2ecf20Sopenharmony_ci#define CPLL_CON0 0x10120 378c2ecf20Sopenharmony_ci#define EPLL_CON0 0x10130 388c2ecf20Sopenharmony_ci#define VPLL_CON0 0x10140 398c2ecf20Sopenharmony_ci#define GPLL_CON0 0x10150 408c2ecf20Sopenharmony_ci#define SRC_TOP0 0x10210 418c2ecf20Sopenharmony_ci#define SRC_TOP1 0x10214 428c2ecf20Sopenharmony_ci#define SRC_TOP2 0x10218 438c2ecf20Sopenharmony_ci#define SRC_TOP3 0x1021c 448c2ecf20Sopenharmony_ci#define SRC_GSCL 0x10220 458c2ecf20Sopenharmony_ci#define SRC_DISP1_0 0x1022c 468c2ecf20Sopenharmony_ci#define SRC_MAU 0x10240 478c2ecf20Sopenharmony_ci#define SRC_FSYS 0x10244 488c2ecf20Sopenharmony_ci#define SRC_GEN 0x10248 498c2ecf20Sopenharmony_ci#define SRC_PERIC0 0x10250 508c2ecf20Sopenharmony_ci#define SRC_PERIC1 0x10254 518c2ecf20Sopenharmony_ci#define SRC_MASK_GSCL 0x10320 528c2ecf20Sopenharmony_ci#define SRC_MASK_DISP1_0 0x1032c 538c2ecf20Sopenharmony_ci#define SRC_MASK_MAU 0x10334 548c2ecf20Sopenharmony_ci#define SRC_MASK_FSYS 0x10340 558c2ecf20Sopenharmony_ci#define SRC_MASK_GEN 0x10344 568c2ecf20Sopenharmony_ci#define SRC_MASK_PERIC0 0x10350 578c2ecf20Sopenharmony_ci#define SRC_MASK_PERIC1 0x10354 588c2ecf20Sopenharmony_ci#define DIV_TOP0 0x10510 598c2ecf20Sopenharmony_ci#define DIV_TOP1 0x10514 608c2ecf20Sopenharmony_ci#define DIV_GSCL 0x10520 618c2ecf20Sopenharmony_ci#define DIV_DISP1_0 0x1052c 628c2ecf20Sopenharmony_ci#define DIV_GEN 0x1053c 638c2ecf20Sopenharmony_ci#define DIV_MAU 0x10544 648c2ecf20Sopenharmony_ci#define DIV_FSYS0 0x10548 658c2ecf20Sopenharmony_ci#define DIV_FSYS1 0x1054c 668c2ecf20Sopenharmony_ci#define DIV_FSYS2 0x10550 678c2ecf20Sopenharmony_ci#define DIV_PERIC0 0x10558 688c2ecf20Sopenharmony_ci#define DIV_PERIC1 0x1055c 698c2ecf20Sopenharmony_ci#define DIV_PERIC2 0x10560 708c2ecf20Sopenharmony_ci#define DIV_PERIC3 0x10564 718c2ecf20Sopenharmony_ci#define DIV_PERIC4 0x10568 728c2ecf20Sopenharmony_ci#define DIV_PERIC5 0x1056c 738c2ecf20Sopenharmony_ci#define GATE_IP_GSCL 0x10920 748c2ecf20Sopenharmony_ci#define GATE_IP_DISP1 0x10928 758c2ecf20Sopenharmony_ci#define GATE_IP_MFC 0x1092c 768c2ecf20Sopenharmony_ci#define GATE_IP_G3D 0x10930 778c2ecf20Sopenharmony_ci#define GATE_IP_GEN 0x10934 788c2ecf20Sopenharmony_ci#define GATE_IP_FSYS 0x10944 798c2ecf20Sopenharmony_ci#define GATE_IP_PERIC 0x10950 808c2ecf20Sopenharmony_ci#define GATE_IP_PERIS 0x10960 818c2ecf20Sopenharmony_ci#define BPLL_LOCK 0x20010 828c2ecf20Sopenharmony_ci#define BPLL_CON0 0x20110 838c2ecf20Sopenharmony_ci#define SRC_CDREX 0x20200 848c2ecf20Sopenharmony_ci#define PLL_DIV2_SEL 0x20a24 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci/*Below definitions are used for PWR_CTRL settings*/ 878c2ecf20Sopenharmony_ci#define PWR_CTRL1_CORE2_DOWN_RATIO (7 << 28) 888c2ecf20Sopenharmony_ci#define PWR_CTRL1_CORE1_DOWN_RATIO (7 << 16) 898c2ecf20Sopenharmony_ci#define PWR_CTRL1_DIV2_DOWN_EN (1 << 9) 908c2ecf20Sopenharmony_ci#define PWR_CTRL1_DIV1_DOWN_EN (1 << 8) 918c2ecf20Sopenharmony_ci#define PWR_CTRL1_USE_CORE1_WFE (1 << 5) 928c2ecf20Sopenharmony_ci#define PWR_CTRL1_USE_CORE0_WFE (1 << 4) 938c2ecf20Sopenharmony_ci#define PWR_CTRL1_USE_CORE1_WFI (1 << 1) 948c2ecf20Sopenharmony_ci#define PWR_CTRL1_USE_CORE0_WFI (1 << 0) 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci#define PWR_CTRL2_DIV2_UP_EN (1 << 25) 978c2ecf20Sopenharmony_ci#define PWR_CTRL2_DIV1_UP_EN (1 << 24) 988c2ecf20Sopenharmony_ci#define PWR_CTRL2_DUR_STANDBY2_VAL (1 << 16) 998c2ecf20Sopenharmony_ci#define PWR_CTRL2_DUR_STANDBY1_VAL (1 << 8) 1008c2ecf20Sopenharmony_ci#define PWR_CTRL2_CORE2_UP_RATIO (1 << 4) 1018c2ecf20Sopenharmony_ci#define PWR_CTRL2_CORE1_UP_RATIO (1 << 0) 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci/* list of PLLs to be registered */ 1048c2ecf20Sopenharmony_cienum exynos5250_plls { 1058c2ecf20Sopenharmony_ci apll, mpll, cpll, epll, vpll, gpll, bpll, 1068c2ecf20Sopenharmony_ci nr_plls /* number of PLLs */ 1078c2ecf20Sopenharmony_ci}; 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_cistatic void __iomem *reg_base; 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci/* 1128c2ecf20Sopenharmony_ci * list of controller registers to be saved and restored during a 1138c2ecf20Sopenharmony_ci * suspend/resume cycle. 1148c2ecf20Sopenharmony_ci */ 1158c2ecf20Sopenharmony_cistatic const unsigned long exynos5250_clk_regs[] __initconst = { 1168c2ecf20Sopenharmony_ci SRC_CPU, 1178c2ecf20Sopenharmony_ci DIV_CPU0, 1188c2ecf20Sopenharmony_ci PWR_CTRL1, 1198c2ecf20Sopenharmony_ci PWR_CTRL2, 1208c2ecf20Sopenharmony_ci SRC_CORE1, 1218c2ecf20Sopenharmony_ci SRC_TOP0, 1228c2ecf20Sopenharmony_ci SRC_TOP1, 1238c2ecf20Sopenharmony_ci SRC_TOP2, 1248c2ecf20Sopenharmony_ci SRC_TOP3, 1258c2ecf20Sopenharmony_ci SRC_GSCL, 1268c2ecf20Sopenharmony_ci SRC_DISP1_0, 1278c2ecf20Sopenharmony_ci SRC_MAU, 1288c2ecf20Sopenharmony_ci SRC_FSYS, 1298c2ecf20Sopenharmony_ci SRC_GEN, 1308c2ecf20Sopenharmony_ci SRC_PERIC0, 1318c2ecf20Sopenharmony_ci SRC_PERIC1, 1328c2ecf20Sopenharmony_ci SRC_MASK_GSCL, 1338c2ecf20Sopenharmony_ci SRC_MASK_DISP1_0, 1348c2ecf20Sopenharmony_ci SRC_MASK_MAU, 1358c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 1368c2ecf20Sopenharmony_ci SRC_MASK_GEN, 1378c2ecf20Sopenharmony_ci SRC_MASK_PERIC0, 1388c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 1398c2ecf20Sopenharmony_ci DIV_TOP0, 1408c2ecf20Sopenharmony_ci DIV_TOP1, 1418c2ecf20Sopenharmony_ci DIV_GSCL, 1428c2ecf20Sopenharmony_ci DIV_DISP1_0, 1438c2ecf20Sopenharmony_ci DIV_GEN, 1448c2ecf20Sopenharmony_ci DIV_MAU, 1458c2ecf20Sopenharmony_ci DIV_FSYS0, 1468c2ecf20Sopenharmony_ci DIV_FSYS1, 1478c2ecf20Sopenharmony_ci DIV_FSYS2, 1488c2ecf20Sopenharmony_ci DIV_PERIC0, 1498c2ecf20Sopenharmony_ci DIV_PERIC1, 1508c2ecf20Sopenharmony_ci DIV_PERIC2, 1518c2ecf20Sopenharmony_ci DIV_PERIC3, 1528c2ecf20Sopenharmony_ci DIV_PERIC4, 1538c2ecf20Sopenharmony_ci DIV_PERIC5, 1548c2ecf20Sopenharmony_ci GATE_IP_GSCL, 1558c2ecf20Sopenharmony_ci GATE_IP_MFC, 1568c2ecf20Sopenharmony_ci GATE_IP_G3D, 1578c2ecf20Sopenharmony_ci GATE_IP_GEN, 1588c2ecf20Sopenharmony_ci GATE_IP_FSYS, 1598c2ecf20Sopenharmony_ci GATE_IP_PERIC, 1608c2ecf20Sopenharmony_ci GATE_IP_PERIS, 1618c2ecf20Sopenharmony_ci SRC_CDREX, 1628c2ecf20Sopenharmony_ci PLL_DIV2_SEL, 1638c2ecf20Sopenharmony_ci GATE_IP_DISP1, 1648c2ecf20Sopenharmony_ci GATE_IP_ACP, 1658c2ecf20Sopenharmony_ci GATE_IP_ISP0, 1668c2ecf20Sopenharmony_ci GATE_IP_ISP1, 1678c2ecf20Sopenharmony_ci}; 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci/* list of all parent clock list */ 1708c2ecf20Sopenharmony_ciPNAME(mout_apll_p) = { "fin_pll", "fout_apll", }; 1718c2ecf20Sopenharmony_ciPNAME(mout_cpu_p) = { "mout_apll", "mout_mpll", }; 1728c2ecf20Sopenharmony_ciPNAME(mout_mpll_fout_p) = { "fout_mplldiv2", "fout_mpll" }; 1738c2ecf20Sopenharmony_ciPNAME(mout_mpll_p) = { "fin_pll", "mout_mpll_fout" }; 1748c2ecf20Sopenharmony_ciPNAME(mout_bpll_fout_p) = { "fout_bplldiv2", "fout_bpll" }; 1758c2ecf20Sopenharmony_ciPNAME(mout_bpll_p) = { "fin_pll", "mout_bpll_fout" }; 1768c2ecf20Sopenharmony_ciPNAME(mout_vpllsrc_p) = { "fin_pll", "sclk_hdmi27m" }; 1778c2ecf20Sopenharmony_ciPNAME(mout_vpll_p) = { "mout_vpllsrc", "fout_vpll" }; 1788c2ecf20Sopenharmony_ciPNAME(mout_cpll_p) = { "fin_pll", "fout_cpll" }; 1798c2ecf20Sopenharmony_ciPNAME(mout_epll_p) = { "fin_pll", "fout_epll" }; 1808c2ecf20Sopenharmony_ciPNAME(mout_gpll_p) = { "fin_pll", "fout_gpll" }; 1818c2ecf20Sopenharmony_ciPNAME(mout_mpll_user_p) = { "fin_pll", "mout_mpll" }; 1828c2ecf20Sopenharmony_ciPNAME(mout_bpll_user_p) = { "fin_pll", "mout_bpll" }; 1838c2ecf20Sopenharmony_ciPNAME(mout_aclk166_p) = { "mout_cpll", "mout_mpll_user" }; 1848c2ecf20Sopenharmony_ciPNAME(mout_aclk200_p) = { "mout_mpll_user", "mout_bpll_user" }; 1858c2ecf20Sopenharmony_ciPNAME(mout_aclk300_p) = { "mout_aclk300_disp1_mid", 1868c2ecf20Sopenharmony_ci "mout_aclk300_disp1_mid1" }; 1878c2ecf20Sopenharmony_ciPNAME(mout_aclk400_p) = { "mout_aclk400_g3d_mid", "mout_gpll" }; 1888c2ecf20Sopenharmony_ciPNAME(mout_aclk200_sub_p) = { "fin_pll", "div_aclk200" }; 1898c2ecf20Sopenharmony_ciPNAME(mout_aclk266_sub_p) = { "fin_pll", "div_aclk266" }; 1908c2ecf20Sopenharmony_ciPNAME(mout_aclk300_sub_p) = { "fin_pll", "div_aclk300_disp" }; 1918c2ecf20Sopenharmony_ciPNAME(mout_aclk300_disp1_mid1_p) = { "mout_vpll", "mout_cpll" }; 1928c2ecf20Sopenharmony_ciPNAME(mout_aclk333_sub_p) = { "fin_pll", "div_aclk333" }; 1938c2ecf20Sopenharmony_ciPNAME(mout_aclk400_isp_sub_p) = { "fin_pll", "div_aclk400_isp" }; 1948c2ecf20Sopenharmony_ciPNAME(mout_hdmi_p) = { "div_hdmi_pixel", "sclk_hdmiphy" }; 1958c2ecf20Sopenharmony_ciPNAME(mout_usb3_p) = { "mout_mpll_user", "mout_cpll" }; 1968c2ecf20Sopenharmony_ciPNAME(mout_group1_p) = { "fin_pll", "fin_pll", "sclk_hdmi27m", 1978c2ecf20Sopenharmony_ci "sclk_dptxphy", "sclk_uhostphy", "sclk_hdmiphy", 1988c2ecf20Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 1998c2ecf20Sopenharmony_ci "mout_cpll", "none", "none", 2008c2ecf20Sopenharmony_ci "none", "none", "none", 2018c2ecf20Sopenharmony_ci "none" }; 2028c2ecf20Sopenharmony_ciPNAME(mout_audio0_p) = { "cdclk0", "fin_pll", "sclk_hdmi27m", "sclk_dptxphy", 2038c2ecf20Sopenharmony_ci "sclk_uhostphy", "fin_pll", 2048c2ecf20Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 2058c2ecf20Sopenharmony_ci "mout_cpll", "none", "none", 2068c2ecf20Sopenharmony_ci "none", "none", "none", 2078c2ecf20Sopenharmony_ci "none" }; 2088c2ecf20Sopenharmony_ciPNAME(mout_audio1_p) = { "cdclk1", "fin_pll", "sclk_hdmi27m", "sclk_dptxphy", 2098c2ecf20Sopenharmony_ci "sclk_uhostphy", "fin_pll", 2108c2ecf20Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 2118c2ecf20Sopenharmony_ci "mout_cpll", "none", "none", 2128c2ecf20Sopenharmony_ci "none", "none", "none", 2138c2ecf20Sopenharmony_ci "none" }; 2148c2ecf20Sopenharmony_ciPNAME(mout_audio2_p) = { "cdclk2", "fin_pll", "sclk_hdmi27m", "sclk_dptxphy", 2158c2ecf20Sopenharmony_ci "sclk_uhostphy", "fin_pll", 2168c2ecf20Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 2178c2ecf20Sopenharmony_ci "mout_cpll", "none", "none", 2188c2ecf20Sopenharmony_ci "none", "none", "none", 2198c2ecf20Sopenharmony_ci "none" }; 2208c2ecf20Sopenharmony_ciPNAME(mout_spdif_p) = { "sclk_audio0", "sclk_audio1", "sclk_audio2", 2218c2ecf20Sopenharmony_ci "spdif_extclk" }; 2228c2ecf20Sopenharmony_ci 2238c2ecf20Sopenharmony_ci/* fixed rate clocks generated outside the soc */ 2248c2ecf20Sopenharmony_cistatic struct samsung_fixed_rate_clock exynos5250_fixed_rate_ext_clks[] __initdata = { 2258c2ecf20Sopenharmony_ci FRATE(CLK_FIN_PLL, "fin_pll", NULL, 0, 0), 2268c2ecf20Sopenharmony_ci}; 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_ci/* fixed rate clocks generated inside the soc */ 2298c2ecf20Sopenharmony_cistatic const struct samsung_fixed_rate_clock exynos5250_fixed_rate_clks[] __initconst = { 2308c2ecf20Sopenharmony_ci FRATE(CLK_SCLK_HDMIPHY, "sclk_hdmiphy", NULL, 0, 24000000), 2318c2ecf20Sopenharmony_ci FRATE(0, "sclk_hdmi27m", NULL, 0, 27000000), 2328c2ecf20Sopenharmony_ci FRATE(0, "sclk_dptxphy", NULL, 0, 24000000), 2338c2ecf20Sopenharmony_ci FRATE(0, "sclk_uhostphy", NULL, 0, 48000000), 2348c2ecf20Sopenharmony_ci}; 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_cistatic const struct samsung_fixed_factor_clock exynos5250_fixed_factor_clks[] __initconst = { 2378c2ecf20Sopenharmony_ci FFACTOR(0, "fout_mplldiv2", "fout_mpll", 1, 2, 0), 2388c2ecf20Sopenharmony_ci FFACTOR(0, "fout_bplldiv2", "fout_bpll", 1, 2, 0), 2398c2ecf20Sopenharmony_ci}; 2408c2ecf20Sopenharmony_ci 2418c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock exynos5250_pll_pmux_clks[] __initconst = { 2428c2ecf20Sopenharmony_ci MUX(0, "mout_vpllsrc", mout_vpllsrc_p, SRC_TOP2, 0, 1), 2438c2ecf20Sopenharmony_ci}; 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock exynos5250_mux_clks[] __initconst = { 2468c2ecf20Sopenharmony_ci /* 2478c2ecf20Sopenharmony_ci * NOTE: Following table is sorted by (clock domain, register address, 2488c2ecf20Sopenharmony_ci * bitfield shift) triplet in ascending order. When adding new entries, 2498c2ecf20Sopenharmony_ci * please make sure that the order is kept, to avoid merge conflicts 2508c2ecf20Sopenharmony_ci * and make further work with defined data easier. 2518c2ecf20Sopenharmony_ci */ 2528c2ecf20Sopenharmony_ci 2538c2ecf20Sopenharmony_ci /* 2548c2ecf20Sopenharmony_ci * CMU_CPU 2558c2ecf20Sopenharmony_ci */ 2568c2ecf20Sopenharmony_ci MUX_F(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1, 2578c2ecf20Sopenharmony_ci CLK_SET_RATE_PARENT, 0), 2588c2ecf20Sopenharmony_ci MUX(0, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1), 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ci /* 2618c2ecf20Sopenharmony_ci * CMU_CORE 2628c2ecf20Sopenharmony_ci */ 2638c2ecf20Sopenharmony_ci MUX(CLK_MOUT_MPLL, "mout_mpll", mout_mpll_p, SRC_CORE1, 8, 1), 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci /* 2668c2ecf20Sopenharmony_ci * CMU_TOP 2678c2ecf20Sopenharmony_ci */ 2688c2ecf20Sopenharmony_ci MUX(0, "mout_aclk166", mout_aclk166_p, SRC_TOP0, 8, 1), 2698c2ecf20Sopenharmony_ci MUX(0, "mout_aclk200", mout_aclk200_p, SRC_TOP0, 12, 1), 2708c2ecf20Sopenharmony_ci MUX(0, "mout_aclk300_disp1_mid", mout_aclk200_p, SRC_TOP0, 14, 1), 2718c2ecf20Sopenharmony_ci MUX(0, "mout_aclk300", mout_aclk300_p, SRC_TOP0, 15, 1), 2728c2ecf20Sopenharmony_ci MUX(0, "mout_aclk333", mout_aclk166_p, SRC_TOP0, 16, 1), 2738c2ecf20Sopenharmony_ci MUX(0, "mout_aclk400_g3d_mid", mout_aclk200_p, SRC_TOP0, 20, 1), 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_ci MUX(0, "mout_aclk300_disp1_mid1", mout_aclk300_disp1_mid1_p, SRC_TOP1, 2768c2ecf20Sopenharmony_ci 8, 1), 2778c2ecf20Sopenharmony_ci MUX(0, "mout_aclk400_isp", mout_aclk200_p, SRC_TOP1, 24, 1), 2788c2ecf20Sopenharmony_ci MUX(0, "mout_aclk400_g3d", mout_aclk400_p, SRC_TOP1, 28, 1), 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci MUX(0, "mout_cpll", mout_cpll_p, SRC_TOP2, 8, 1), 2818c2ecf20Sopenharmony_ci MUX(0, "mout_epll", mout_epll_p, SRC_TOP2, 12, 1), 2828c2ecf20Sopenharmony_ci MUX(0, "mout_vpll", mout_vpll_p, SRC_TOP2, 16, 1), 2838c2ecf20Sopenharmony_ci MUX(0, "mout_mpll_user", mout_mpll_user_p, SRC_TOP2, 20, 1), 2848c2ecf20Sopenharmony_ci MUX(0, "mout_bpll_user", mout_bpll_user_p, SRC_TOP2, 24, 1), 2858c2ecf20Sopenharmony_ci MUX(CLK_MOUT_GPLL, "mout_gpll", mout_gpll_p, SRC_TOP2, 28, 1), 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ci MUX(CLK_MOUT_ACLK200_DISP1_SUB, "mout_aclk200_disp1_sub", 2888c2ecf20Sopenharmony_ci mout_aclk200_sub_p, SRC_TOP3, 4, 1), 2898c2ecf20Sopenharmony_ci MUX(CLK_MOUT_ACLK300_DISP1_SUB, "mout_aclk300_disp1_sub", 2908c2ecf20Sopenharmony_ci mout_aclk300_sub_p, SRC_TOP3, 6, 1), 2918c2ecf20Sopenharmony_ci MUX(0, "mout_aclk266_gscl_sub", mout_aclk266_sub_p, SRC_TOP3, 8, 1), 2928c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_266_isp_sub", mout_aclk266_sub_p, SRC_TOP3, 16, 1), 2938c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_400_isp_sub", mout_aclk400_isp_sub_p, 2948c2ecf20Sopenharmony_ci SRC_TOP3, 20, 1), 2958c2ecf20Sopenharmony_ci MUX(0, "mout_aclk333_sub", mout_aclk333_sub_p, SRC_TOP3, 24, 1), 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_ci MUX(0, "mout_cam_bayer", mout_group1_p, SRC_GSCL, 12, 4), 2988c2ecf20Sopenharmony_ci MUX(0, "mout_cam0", mout_group1_p, SRC_GSCL, 16, 4), 2998c2ecf20Sopenharmony_ci MUX(0, "mout_cam1", mout_group1_p, SRC_GSCL, 20, 4), 3008c2ecf20Sopenharmony_ci MUX(0, "mout_gscl_wa", mout_group1_p, SRC_GSCL, 24, 4), 3018c2ecf20Sopenharmony_ci MUX(0, "mout_gscl_wb", mout_group1_p, SRC_GSCL, 28, 4), 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci MUX(0, "mout_fimd1", mout_group1_p, SRC_DISP1_0, 0, 4), 3048c2ecf20Sopenharmony_ci MUX(0, "mout_mipi1", mout_group1_p, SRC_DISP1_0, 12, 4), 3058c2ecf20Sopenharmony_ci MUX(0, "mout_dp", mout_group1_p, SRC_DISP1_0, 16, 4), 3068c2ecf20Sopenharmony_ci MUX(CLK_MOUT_HDMI, "mout_hdmi", mout_hdmi_p, SRC_DISP1_0, 20, 1), 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci MUX(0, "mout_audio0", mout_audio0_p, SRC_MAU, 0, 4), 3098c2ecf20Sopenharmony_ci 3108c2ecf20Sopenharmony_ci MUX(0, "mout_mmc0", mout_group1_p, SRC_FSYS, 0, 4), 3118c2ecf20Sopenharmony_ci MUX(0, "mout_mmc1", mout_group1_p, SRC_FSYS, 4, 4), 3128c2ecf20Sopenharmony_ci MUX(0, "mout_mmc2", mout_group1_p, SRC_FSYS, 8, 4), 3138c2ecf20Sopenharmony_ci MUX(0, "mout_mmc3", mout_group1_p, SRC_FSYS, 12, 4), 3148c2ecf20Sopenharmony_ci MUX(0, "mout_sata", mout_aclk200_p, SRC_FSYS, 24, 1), 3158c2ecf20Sopenharmony_ci MUX(0, "mout_usb3", mout_usb3_p, SRC_FSYS, 28, 1), 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci MUX(0, "mout_jpeg", mout_group1_p, SRC_GEN, 0, 4), 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ci MUX(0, "mout_uart0", mout_group1_p, SRC_PERIC0, 0, 4), 3208c2ecf20Sopenharmony_ci MUX(0, "mout_uart1", mout_group1_p, SRC_PERIC0, 4, 4), 3218c2ecf20Sopenharmony_ci MUX(0, "mout_uart2", mout_group1_p, SRC_PERIC0, 8, 4), 3228c2ecf20Sopenharmony_ci MUX(0, "mout_uart3", mout_group1_p, SRC_PERIC0, 12, 4), 3238c2ecf20Sopenharmony_ci MUX(0, "mout_pwm", mout_group1_p, SRC_PERIC0, 24, 4), 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ci MUX(0, "mout_audio1", mout_audio1_p, SRC_PERIC1, 0, 4), 3268c2ecf20Sopenharmony_ci MUX(0, "mout_audio2", mout_audio2_p, SRC_PERIC1, 4, 4), 3278c2ecf20Sopenharmony_ci MUX(0, "mout_spdif", mout_spdif_p, SRC_PERIC1, 8, 2), 3288c2ecf20Sopenharmony_ci MUX(0, "mout_spi0", mout_group1_p, SRC_PERIC1, 16, 4), 3298c2ecf20Sopenharmony_ci MUX(0, "mout_spi1", mout_group1_p, SRC_PERIC1, 20, 4), 3308c2ecf20Sopenharmony_ci MUX(0, "mout_spi2", mout_group1_p, SRC_PERIC1, 24, 4), 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ci /* 3338c2ecf20Sopenharmony_ci * CMU_CDREX 3348c2ecf20Sopenharmony_ci */ 3358c2ecf20Sopenharmony_ci MUX(0, "mout_bpll", mout_bpll_p, SRC_CDREX, 0, 1), 3368c2ecf20Sopenharmony_ci 3378c2ecf20Sopenharmony_ci MUX(0, "mout_mpll_fout", mout_mpll_fout_p, PLL_DIV2_SEL, 4, 1), 3388c2ecf20Sopenharmony_ci MUX(0, "mout_bpll_fout", mout_bpll_fout_p, PLL_DIV2_SEL, 0, 1), 3398c2ecf20Sopenharmony_ci}; 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_cistatic const struct samsung_div_clock exynos5250_div_clks[] __initconst = { 3428c2ecf20Sopenharmony_ci /* 3438c2ecf20Sopenharmony_ci * NOTE: Following table is sorted by (clock domain, register address, 3448c2ecf20Sopenharmony_ci * bitfield shift) triplet in ascending order. When adding new entries, 3458c2ecf20Sopenharmony_ci * please make sure that the order is kept, to avoid merge conflicts 3468c2ecf20Sopenharmony_ci * and make further work with defined data easier. 3478c2ecf20Sopenharmony_ci */ 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ci /* 3508c2ecf20Sopenharmony_ci * CMU_CPU 3518c2ecf20Sopenharmony_ci */ 3528c2ecf20Sopenharmony_ci DIV(0, "div_arm", "mout_cpu", DIV_CPU0, 0, 3), 3538c2ecf20Sopenharmony_ci DIV(0, "div_apll", "mout_apll", DIV_CPU0, 24, 3), 3548c2ecf20Sopenharmony_ci DIV(0, "div_arm2", "div_arm", DIV_CPU0, 28, 3), 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_ci /* 3578c2ecf20Sopenharmony_ci * CMU_TOP 3588c2ecf20Sopenharmony_ci */ 3598c2ecf20Sopenharmony_ci DIV(0, "div_aclk66", "div_aclk66_pre", DIV_TOP0, 0, 3), 3608c2ecf20Sopenharmony_ci DIV(0, "div_aclk166", "mout_aclk166", DIV_TOP0, 8, 3), 3618c2ecf20Sopenharmony_ci DIV(0, "div_aclk200", "mout_aclk200", DIV_TOP0, 12, 3), 3628c2ecf20Sopenharmony_ci DIV(0, "div_aclk266", "mout_mpll_user", DIV_TOP0, 16, 3), 3638c2ecf20Sopenharmony_ci DIV(0, "div_aclk333", "mout_aclk333", DIV_TOP0, 20, 3), 3648c2ecf20Sopenharmony_ci DIV(0, "div_aclk400_g3d", "mout_aclk400_g3d", DIV_TOP0, 3658c2ecf20Sopenharmony_ci 24, 3), 3668c2ecf20Sopenharmony_ci DIV(0, "div_aclk300_disp", "mout_aclk300", DIV_TOP0, 28, 3), 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ci DIV(0, "div_aclk400_isp", "mout_aclk400_isp", DIV_TOP1, 20, 3), 3698c2ecf20Sopenharmony_ci DIV(0, "div_aclk66_pre", "mout_mpll_user", DIV_TOP1, 24, 3), 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ci DIV(0, "div_cam_bayer", "mout_cam_bayer", DIV_GSCL, 12, 4), 3728c2ecf20Sopenharmony_ci DIV(0, "div_cam0", "mout_cam0", DIV_GSCL, 16, 4), 3738c2ecf20Sopenharmony_ci DIV(0, "div_cam1", "mout_cam1", DIV_GSCL, 20, 4), 3748c2ecf20Sopenharmony_ci DIV(0, "div_gscl_wa", "mout_gscl_wa", DIV_GSCL, 24, 4), 3758c2ecf20Sopenharmony_ci DIV(0, "div_gscl_wb", "mout_gscl_wb", DIV_GSCL, 28, 4), 3768c2ecf20Sopenharmony_ci 3778c2ecf20Sopenharmony_ci DIV(0, "div_fimd1", "mout_fimd1", DIV_DISP1_0, 0, 4), 3788c2ecf20Sopenharmony_ci DIV(0, "div_mipi1", "mout_mipi1", DIV_DISP1_0, 16, 4), 3798c2ecf20Sopenharmony_ci DIV_F(0, "div_mipi1_pre", "div_mipi1", 3808c2ecf20Sopenharmony_ci DIV_DISP1_0, 20, 4, CLK_SET_RATE_PARENT, 0), 3818c2ecf20Sopenharmony_ci DIV(0, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4), 3828c2ecf20Sopenharmony_ci DIV(CLK_SCLK_PIXEL, "div_hdmi_pixel", "mout_vpll", DIV_DISP1_0, 28, 4), 3838c2ecf20Sopenharmony_ci 3848c2ecf20Sopenharmony_ci DIV(0, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4), 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci DIV(0, "div_audio0", "mout_audio0", DIV_MAU, 0, 4), 3878c2ecf20Sopenharmony_ci DIV(CLK_DIV_PCM0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8), 3888c2ecf20Sopenharmony_ci 3898c2ecf20Sopenharmony_ci DIV(0, "div_sata", "mout_sata", DIV_FSYS0, 20, 4), 3908c2ecf20Sopenharmony_ci DIV(0, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4), 3918c2ecf20Sopenharmony_ci 3928c2ecf20Sopenharmony_ci DIV(0, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4), 3938c2ecf20Sopenharmony_ci DIV_F(0, "div_mmc_pre0", "div_mmc0", 3948c2ecf20Sopenharmony_ci DIV_FSYS1, 8, 8, CLK_SET_RATE_PARENT, 0), 3958c2ecf20Sopenharmony_ci DIV(0, "div_mmc1", "mout_mmc1", DIV_FSYS1, 16, 4), 3968c2ecf20Sopenharmony_ci DIV_F(0, "div_mmc_pre1", "div_mmc1", 3978c2ecf20Sopenharmony_ci DIV_FSYS1, 24, 8, CLK_SET_RATE_PARENT, 0), 3988c2ecf20Sopenharmony_ci 3998c2ecf20Sopenharmony_ci DIV(0, "div_mmc2", "mout_mmc2", DIV_FSYS2, 0, 4), 4008c2ecf20Sopenharmony_ci DIV_F(0, "div_mmc_pre2", "div_mmc2", 4018c2ecf20Sopenharmony_ci DIV_FSYS2, 8, 8, CLK_SET_RATE_PARENT, 0), 4028c2ecf20Sopenharmony_ci DIV(0, "div_mmc3", "mout_mmc3", DIV_FSYS2, 16, 4), 4038c2ecf20Sopenharmony_ci DIV_F(0, "div_mmc_pre3", "div_mmc3", 4048c2ecf20Sopenharmony_ci DIV_FSYS2, 24, 8, CLK_SET_RATE_PARENT, 0), 4058c2ecf20Sopenharmony_ci 4068c2ecf20Sopenharmony_ci DIV(0, "div_uart0", "mout_uart0", DIV_PERIC0, 0, 4), 4078c2ecf20Sopenharmony_ci DIV(0, "div_uart1", "mout_uart1", DIV_PERIC0, 4, 4), 4088c2ecf20Sopenharmony_ci DIV(0, "div_uart2", "mout_uart2", DIV_PERIC0, 8, 4), 4098c2ecf20Sopenharmony_ci DIV(0, "div_uart3", "mout_uart3", DIV_PERIC0, 12, 4), 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ci DIV(0, "div_spi0", "mout_spi0", DIV_PERIC1, 0, 4), 4128c2ecf20Sopenharmony_ci DIV_F(0, "div_spi_pre0", "div_spi0", 4138c2ecf20Sopenharmony_ci DIV_PERIC1, 8, 8, CLK_SET_RATE_PARENT, 0), 4148c2ecf20Sopenharmony_ci DIV(0, "div_spi1", "mout_spi1", DIV_PERIC1, 16, 4), 4158c2ecf20Sopenharmony_ci DIV_F(0, "div_spi_pre1", "div_spi1", 4168c2ecf20Sopenharmony_ci DIV_PERIC1, 24, 8, CLK_SET_RATE_PARENT, 0), 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci DIV(0, "div_spi2", "mout_spi2", DIV_PERIC2, 0, 4), 4198c2ecf20Sopenharmony_ci DIV_F(0, "div_spi_pre2", "div_spi2", 4208c2ecf20Sopenharmony_ci DIV_PERIC2, 8, 8, CLK_SET_RATE_PARENT, 0), 4218c2ecf20Sopenharmony_ci 4228c2ecf20Sopenharmony_ci DIV(0, "div_pwm", "mout_pwm", DIV_PERIC3, 0, 4), 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_ci DIV(0, "div_audio1", "mout_audio1", DIV_PERIC4, 0, 4), 4258c2ecf20Sopenharmony_ci DIV(0, "div_pcm1", "sclk_audio1", DIV_PERIC4, 4, 8), 4268c2ecf20Sopenharmony_ci DIV(0, "div_audio2", "mout_audio2", DIV_PERIC4, 16, 4), 4278c2ecf20Sopenharmony_ci DIV(0, "div_pcm2", "sclk_audio2", DIV_PERIC4, 20, 8), 4288c2ecf20Sopenharmony_ci 4298c2ecf20Sopenharmony_ci DIV(CLK_DIV_I2S1, "div_i2s1", "sclk_audio1", DIV_PERIC5, 0, 6), 4308c2ecf20Sopenharmony_ci DIV(CLK_DIV_I2S2, "div_i2s2", "sclk_audio2", DIV_PERIC5, 8, 6), 4318c2ecf20Sopenharmony_ci}; 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock exynos5250_gate_clks[] __initconst = { 4348c2ecf20Sopenharmony_ci /* 4358c2ecf20Sopenharmony_ci * NOTE: Following table is sorted by (clock domain, register address, 4368c2ecf20Sopenharmony_ci * bitfield shift) triplet in ascending order. When adding new entries, 4378c2ecf20Sopenharmony_ci * please make sure that the order is kept, to avoid merge conflicts 4388c2ecf20Sopenharmony_ci * and make further work with defined data easier. 4398c2ecf20Sopenharmony_ci */ 4408c2ecf20Sopenharmony_ci 4418c2ecf20Sopenharmony_ci /* 4428c2ecf20Sopenharmony_ci * CMU_ACP 4438c2ecf20Sopenharmony_ci */ 4448c2ecf20Sopenharmony_ci GATE(CLK_MDMA0, "mdma0", "div_aclk266", GATE_IP_ACP, 1, 0, 0), 4458c2ecf20Sopenharmony_ci GATE(CLK_SSS, "sss", "div_aclk266", GATE_IP_ACP, 2, 0, 0), 4468c2ecf20Sopenharmony_ci GATE(CLK_G2D, "g2d", "div_aclk200", GATE_IP_ACP, 3, 0, 0), 4478c2ecf20Sopenharmony_ci GATE(CLK_SMMU_MDMA0, "smmu_mdma0", "div_aclk266", GATE_IP_ACP, 5, 0, 0), 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci /* 4508c2ecf20Sopenharmony_ci * CMU_TOP 4518c2ecf20Sopenharmony_ci */ 4528c2ecf20Sopenharmony_ci GATE(CLK_SCLK_CAM_BAYER, "sclk_cam_bayer", "div_cam_bayer", 4538c2ecf20Sopenharmony_ci SRC_MASK_GSCL, 12, CLK_SET_RATE_PARENT, 0), 4548c2ecf20Sopenharmony_ci GATE(CLK_SCLK_CAM0, "sclk_cam0", "div_cam0", 4558c2ecf20Sopenharmony_ci SRC_MASK_GSCL, 16, CLK_SET_RATE_PARENT, 0), 4568c2ecf20Sopenharmony_ci GATE(CLK_SCLK_CAM1, "sclk_cam1", "div_cam1", 4578c2ecf20Sopenharmony_ci SRC_MASK_GSCL, 20, CLK_SET_RATE_PARENT, 0), 4588c2ecf20Sopenharmony_ci GATE(CLK_SCLK_GSCL_WA, "sclk_gscl_wa", "div_gscl_wa", 4598c2ecf20Sopenharmony_ci SRC_MASK_GSCL, 24, CLK_SET_RATE_PARENT, 0), 4608c2ecf20Sopenharmony_ci GATE(CLK_SCLK_GSCL_WB, "sclk_gscl_wb", "div_gscl_wb", 4618c2ecf20Sopenharmony_ci SRC_MASK_GSCL, 28, CLK_SET_RATE_PARENT, 0), 4628c2ecf20Sopenharmony_ci 4638c2ecf20Sopenharmony_ci GATE(CLK_SCLK_FIMD1, "sclk_fimd1", "div_fimd1", 4648c2ecf20Sopenharmony_ci SRC_MASK_DISP1_0, 0, CLK_SET_RATE_PARENT, 0), 4658c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MIPI1, "sclk_mipi1", "div_mipi1", 4668c2ecf20Sopenharmony_ci SRC_MASK_DISP1_0, 12, CLK_SET_RATE_PARENT, 0), 4678c2ecf20Sopenharmony_ci GATE(CLK_SCLK_DP, "sclk_dp", "div_dp", 4688c2ecf20Sopenharmony_ci SRC_MASK_DISP1_0, 16, CLK_SET_RATE_PARENT, 0), 4698c2ecf20Sopenharmony_ci GATE(CLK_SCLK_HDMI, "sclk_hdmi", "mout_hdmi", 4708c2ecf20Sopenharmony_ci SRC_MASK_DISP1_0, 20, 0, 0), 4718c2ecf20Sopenharmony_ci 4728c2ecf20Sopenharmony_ci GATE(CLK_SCLK_AUDIO0, "sclk_audio0", "div_audio0", 4738c2ecf20Sopenharmony_ci SRC_MASK_MAU, 0, CLK_SET_RATE_PARENT, 0), 4748c2ecf20Sopenharmony_ci 4758c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC0, "sclk_mmc0", "div_mmc_pre0", 4768c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 0, CLK_SET_RATE_PARENT, 0), 4778c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC1, "sclk_mmc1", "div_mmc_pre1", 4788c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 4, CLK_SET_RATE_PARENT, 0), 4798c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC2, "sclk_mmc2", "div_mmc_pre2", 4808c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 8, CLK_SET_RATE_PARENT, 0), 4818c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC3, "sclk_mmc3", "div_mmc_pre3", 4828c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 12, CLK_SET_RATE_PARENT, 0), 4838c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SATA, "sclk_sata", "div_sata", 4848c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0), 4858c2ecf20Sopenharmony_ci GATE(CLK_SCLK_USB3, "sclk_usb3", "div_usb3", 4868c2ecf20Sopenharmony_ci SRC_MASK_FSYS, 28, CLK_SET_RATE_PARENT, 0), 4878c2ecf20Sopenharmony_ci 4888c2ecf20Sopenharmony_ci GATE(CLK_SCLK_JPEG, "sclk_jpeg", "div_jpeg", 4898c2ecf20Sopenharmony_ci SRC_MASK_GEN, 0, CLK_SET_RATE_PARENT, 0), 4908c2ecf20Sopenharmony_ci 4918c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART0, "sclk_uart0", "div_uart0", 4928c2ecf20Sopenharmony_ci SRC_MASK_PERIC0, 0, CLK_SET_RATE_PARENT, 0), 4938c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART1, "sclk_uart1", "div_uart1", 4948c2ecf20Sopenharmony_ci SRC_MASK_PERIC0, 4, CLK_SET_RATE_PARENT, 0), 4958c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART2, "sclk_uart2", "div_uart2", 4968c2ecf20Sopenharmony_ci SRC_MASK_PERIC0, 8, CLK_SET_RATE_PARENT, 0), 4978c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART3, "sclk_uart3", "div_uart3", 4988c2ecf20Sopenharmony_ci SRC_MASK_PERIC0, 12, CLK_SET_RATE_PARENT, 0), 4998c2ecf20Sopenharmony_ci GATE(CLK_SCLK_PWM, "sclk_pwm", "div_pwm", 5008c2ecf20Sopenharmony_ci SRC_MASK_PERIC0, 24, CLK_SET_RATE_PARENT, 0), 5018c2ecf20Sopenharmony_ci 5028c2ecf20Sopenharmony_ci GATE(CLK_SCLK_AUDIO1, "sclk_audio1", "div_audio1", 5038c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 0, CLK_SET_RATE_PARENT, 0), 5048c2ecf20Sopenharmony_ci GATE(CLK_SCLK_AUDIO2, "sclk_audio2", "div_audio2", 5058c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 4, CLK_SET_RATE_PARENT, 0), 5068c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPDIF, "sclk_spdif", "mout_spdif", 5078c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 4, 0, 0), 5088c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI0, "sclk_spi0", "div_spi_pre0", 5098c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 16, CLK_SET_RATE_PARENT, 0), 5108c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI1, "sclk_spi1", "div_spi_pre1", 5118c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 20, CLK_SET_RATE_PARENT, 0), 5128c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI2, "sclk_spi2", "div_spi_pre2", 5138c2ecf20Sopenharmony_ci SRC_MASK_PERIC1, 24, CLK_SET_RATE_PARENT, 0), 5148c2ecf20Sopenharmony_ci 5158c2ecf20Sopenharmony_ci GATE(CLK_GSCL0, "gscl0", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 0, 0, 5168c2ecf20Sopenharmony_ci 0), 5178c2ecf20Sopenharmony_ci GATE(CLK_GSCL1, "gscl1", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 1, 0, 5188c2ecf20Sopenharmony_ci 0), 5198c2ecf20Sopenharmony_ci GATE(CLK_GSCL2, "gscl2", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 2, 0, 5208c2ecf20Sopenharmony_ci 0), 5218c2ecf20Sopenharmony_ci GATE(CLK_GSCL3, "gscl3", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 3, 0, 5228c2ecf20Sopenharmony_ci 0), 5238c2ecf20Sopenharmony_ci GATE(CLK_CAMIF_TOP, "camif_top", "mout_aclk266_gscl_sub", 5248c2ecf20Sopenharmony_ci GATE_IP_GSCL, 4, 0, 0), 5258c2ecf20Sopenharmony_ci GATE(CLK_GSCL_WA, "gscl_wa", "div_gscl_wa", GATE_IP_GSCL, 5, 0, 0), 5268c2ecf20Sopenharmony_ci GATE(CLK_GSCL_WB, "gscl_wb", "div_gscl_wb", GATE_IP_GSCL, 6, 0, 0), 5278c2ecf20Sopenharmony_ci GATE(CLK_SMMU_GSCL0, "smmu_gscl0", "mout_aclk266_gscl_sub", 5288c2ecf20Sopenharmony_ci GATE_IP_GSCL, 7, 0, 0), 5298c2ecf20Sopenharmony_ci GATE(CLK_SMMU_GSCL1, "smmu_gscl1", "mout_aclk266_gscl_sub", 5308c2ecf20Sopenharmony_ci GATE_IP_GSCL, 8, 0, 0), 5318c2ecf20Sopenharmony_ci GATE(CLK_SMMU_GSCL2, "smmu_gscl2", "mout_aclk266_gscl_sub", 5328c2ecf20Sopenharmony_ci GATE_IP_GSCL, 9, 0, 0), 5338c2ecf20Sopenharmony_ci GATE(CLK_SMMU_GSCL3, "smmu_gscl3", "mout_aclk266_gscl_sub", 5348c2ecf20Sopenharmony_ci GATE_IP_GSCL, 10, 0, 0), 5358c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_LITE0, "smmu_fimc_lite0", "mout_aclk266_gscl_sub", 5368c2ecf20Sopenharmony_ci GATE_IP_GSCL, 11, 0, 0), 5378c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_LITE1, "smmu_fimc_lite1", "mout_aclk266_gscl_sub", 5388c2ecf20Sopenharmony_ci GATE_IP_GSCL, 12, 0, 0), 5398c2ecf20Sopenharmony_ci 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_ci GATE(CLK_MFC, "mfc", "mout_aclk333_sub", GATE_IP_MFC, 0, 0, 0), 5428c2ecf20Sopenharmony_ci GATE(CLK_SMMU_MFCR, "smmu_mfcr", "mout_aclk333_sub", GATE_IP_MFC, 1, 0, 5438c2ecf20Sopenharmony_ci 0), 5448c2ecf20Sopenharmony_ci GATE(CLK_SMMU_MFCL, "smmu_mfcl", "mout_aclk333_sub", GATE_IP_MFC, 2, 0, 5458c2ecf20Sopenharmony_ci 0), 5468c2ecf20Sopenharmony_ci GATE(CLK_G3D, "g3d", "div_aclk400_g3d", GATE_IP_G3D, 0, 5478c2ecf20Sopenharmony_ci CLK_SET_RATE_PARENT, 0), 5488c2ecf20Sopenharmony_ci GATE(CLK_ROTATOR, "rotator", "div_aclk266", GATE_IP_GEN, 1, 0, 0), 5498c2ecf20Sopenharmony_ci GATE(CLK_JPEG, "jpeg", "div_aclk166", GATE_IP_GEN, 2, 0, 0), 5508c2ecf20Sopenharmony_ci GATE(CLK_MDMA1, "mdma1", "div_aclk266", GATE_IP_GEN, 4, 0, 0), 5518c2ecf20Sopenharmony_ci GATE(CLK_SMMU_ROTATOR, "smmu_rotator", "div_aclk266", GATE_IP_GEN, 6, 0, 5528c2ecf20Sopenharmony_ci 0), 5538c2ecf20Sopenharmony_ci GATE(CLK_SMMU_JPEG, "smmu_jpeg", "div_aclk166", GATE_IP_GEN, 7, 0, 0), 5548c2ecf20Sopenharmony_ci GATE(CLK_SMMU_MDMA1, "smmu_mdma1", "div_aclk266", GATE_IP_GEN, 9, 0, 0), 5558c2ecf20Sopenharmony_ci 5568c2ecf20Sopenharmony_ci GATE(CLK_PDMA0, "pdma0", "div_aclk200", GATE_IP_FSYS, 1, 0, 0), 5578c2ecf20Sopenharmony_ci GATE(CLK_PDMA1, "pdma1", "div_aclk200", GATE_IP_FSYS, 2, 0, 0), 5588c2ecf20Sopenharmony_ci GATE(CLK_SATA, "sata", "div_aclk200", GATE_IP_FSYS, 6, 0, 0), 5598c2ecf20Sopenharmony_ci GATE(CLK_USBOTG, "usbotg", "div_aclk200", GATE_IP_FSYS, 7, 0, 0), 5608c2ecf20Sopenharmony_ci GATE(CLK_MIPI_HSI, "mipi_hsi", "div_aclk200", GATE_IP_FSYS, 8, 0, 0), 5618c2ecf20Sopenharmony_ci GATE(CLK_SDMMC0, "sdmmc0", "div_aclk200", GATE_IP_FSYS, 12, 0, 0), 5628c2ecf20Sopenharmony_ci GATE(CLK_SDMMC1, "sdmmc1", "div_aclk200", GATE_IP_FSYS, 13, 0, 0), 5638c2ecf20Sopenharmony_ci GATE(CLK_SDMMC2, "sdmmc2", "div_aclk200", GATE_IP_FSYS, 14, 0, 0), 5648c2ecf20Sopenharmony_ci GATE(CLK_SDMMC3, "sdmmc3", "div_aclk200", GATE_IP_FSYS, 15, 0, 0), 5658c2ecf20Sopenharmony_ci GATE(CLK_SROMC, "sromc", "div_aclk200", GATE_IP_FSYS, 17, 0, 0), 5668c2ecf20Sopenharmony_ci GATE(CLK_USB2, "usb2", "div_aclk200", GATE_IP_FSYS, 18, 0, 0), 5678c2ecf20Sopenharmony_ci GATE(CLK_USB3, "usb3", "div_aclk200", GATE_IP_FSYS, 19, 0, 0), 5688c2ecf20Sopenharmony_ci GATE(CLK_SATA_PHYCTRL, "sata_phyctrl", "div_aclk200", 5698c2ecf20Sopenharmony_ci GATE_IP_FSYS, 24, 0, 0), 5708c2ecf20Sopenharmony_ci GATE(CLK_SATA_PHYI2C, "sata_phyi2c", "div_aclk200", GATE_IP_FSYS, 25, 0, 5718c2ecf20Sopenharmony_ci 0), 5728c2ecf20Sopenharmony_ci 5738c2ecf20Sopenharmony_ci GATE(CLK_UART0, "uart0", "div_aclk66", GATE_IP_PERIC, 0, 0, 0), 5748c2ecf20Sopenharmony_ci GATE(CLK_UART1, "uart1", "div_aclk66", GATE_IP_PERIC, 1, 0, 0), 5758c2ecf20Sopenharmony_ci GATE(CLK_UART2, "uart2", "div_aclk66", GATE_IP_PERIC, 2, 0, 0), 5768c2ecf20Sopenharmony_ci GATE(CLK_UART3, "uart3", "div_aclk66", GATE_IP_PERIC, 3, 0, 0), 5778c2ecf20Sopenharmony_ci GATE(CLK_UART4, "uart4", "div_aclk66", GATE_IP_PERIC, 4, 0, 0), 5788c2ecf20Sopenharmony_ci GATE(CLK_I2C0, "i2c0", "div_aclk66", GATE_IP_PERIC, 6, 0, 0), 5798c2ecf20Sopenharmony_ci GATE(CLK_I2C1, "i2c1", "div_aclk66", GATE_IP_PERIC, 7, 0, 0), 5808c2ecf20Sopenharmony_ci GATE(CLK_I2C2, "i2c2", "div_aclk66", GATE_IP_PERIC, 8, 0, 0), 5818c2ecf20Sopenharmony_ci GATE(CLK_I2C3, "i2c3", "div_aclk66", GATE_IP_PERIC, 9, 0, 0), 5828c2ecf20Sopenharmony_ci GATE(CLK_I2C4, "i2c4", "div_aclk66", GATE_IP_PERIC, 10, 0, 0), 5838c2ecf20Sopenharmony_ci GATE(CLK_I2C5, "i2c5", "div_aclk66", GATE_IP_PERIC, 11, 0, 0), 5848c2ecf20Sopenharmony_ci GATE(CLK_I2C6, "i2c6", "div_aclk66", GATE_IP_PERIC, 12, 0, 0), 5858c2ecf20Sopenharmony_ci GATE(CLK_I2C7, "i2c7", "div_aclk66", GATE_IP_PERIC, 13, 0, 0), 5868c2ecf20Sopenharmony_ci GATE(CLK_I2C_HDMI, "i2c_hdmi", "div_aclk66", GATE_IP_PERIC, 14, 0, 0), 5878c2ecf20Sopenharmony_ci GATE(CLK_ADC, "adc", "div_aclk66", GATE_IP_PERIC, 15, 0, 0), 5888c2ecf20Sopenharmony_ci GATE(CLK_SPI0, "spi0", "div_aclk66", GATE_IP_PERIC, 16, 0, 0), 5898c2ecf20Sopenharmony_ci GATE(CLK_SPI1, "spi1", "div_aclk66", GATE_IP_PERIC, 17, 0, 0), 5908c2ecf20Sopenharmony_ci GATE(CLK_SPI2, "spi2", "div_aclk66", GATE_IP_PERIC, 18, 0, 0), 5918c2ecf20Sopenharmony_ci GATE(CLK_I2S1, "i2s1", "div_aclk66", GATE_IP_PERIC, 20, 0, 0), 5928c2ecf20Sopenharmony_ci GATE(CLK_I2S2, "i2s2", "div_aclk66", GATE_IP_PERIC, 21, 0, 0), 5938c2ecf20Sopenharmony_ci GATE(CLK_PCM1, "pcm1", "div_aclk66", GATE_IP_PERIC, 22, 0, 0), 5948c2ecf20Sopenharmony_ci GATE(CLK_PCM2, "pcm2", "div_aclk66", GATE_IP_PERIC, 23, 0, 0), 5958c2ecf20Sopenharmony_ci GATE(CLK_PWM, "pwm", "div_aclk66", GATE_IP_PERIC, 24, 0, 0), 5968c2ecf20Sopenharmony_ci GATE(CLK_SPDIF, "spdif", "div_aclk66", GATE_IP_PERIC, 26, 0, 0), 5978c2ecf20Sopenharmony_ci GATE(CLK_AC97, "ac97", "div_aclk66", GATE_IP_PERIC, 27, 0, 0), 5988c2ecf20Sopenharmony_ci GATE(CLK_HSI2C0, "hsi2c0", "div_aclk66", GATE_IP_PERIC, 28, 0, 0), 5998c2ecf20Sopenharmony_ci GATE(CLK_HSI2C1, "hsi2c1", "div_aclk66", GATE_IP_PERIC, 29, 0, 0), 6008c2ecf20Sopenharmony_ci GATE(CLK_HSI2C2, "hsi2c2", "div_aclk66", GATE_IP_PERIC, 30, 0, 0), 6018c2ecf20Sopenharmony_ci GATE(CLK_HSI2C3, "hsi2c3", "div_aclk66", GATE_IP_PERIC, 31, 0, 0), 6028c2ecf20Sopenharmony_ci 6038c2ecf20Sopenharmony_ci GATE(CLK_CHIPID, "chipid", "div_aclk66", GATE_IP_PERIS, 0, 0, 0), 6048c2ecf20Sopenharmony_ci GATE(CLK_SYSREG, "sysreg", "div_aclk66", 6058c2ecf20Sopenharmony_ci GATE_IP_PERIS, 1, CLK_IGNORE_UNUSED, 0), 6068c2ecf20Sopenharmony_ci GATE(CLK_PMU, "pmu", "div_aclk66", GATE_IP_PERIS, 2, CLK_IGNORE_UNUSED, 6078c2ecf20Sopenharmony_ci 0), 6088c2ecf20Sopenharmony_ci GATE(CLK_CMU_TOP, "cmu_top", "div_aclk66", 6098c2ecf20Sopenharmony_ci GATE_IP_PERIS, 3, CLK_IGNORE_UNUSED, 0), 6108c2ecf20Sopenharmony_ci GATE(CLK_CMU_CORE, "cmu_core", "div_aclk66", 6118c2ecf20Sopenharmony_ci GATE_IP_PERIS, 4, CLK_IGNORE_UNUSED, 0), 6128c2ecf20Sopenharmony_ci GATE(CLK_CMU_MEM, "cmu_mem", "div_aclk66", 6138c2ecf20Sopenharmony_ci GATE_IP_PERIS, 5, CLK_IGNORE_UNUSED, 0), 6148c2ecf20Sopenharmony_ci GATE(CLK_TZPC0, "tzpc0", "div_aclk66", GATE_IP_PERIS, 6, 0, 0), 6158c2ecf20Sopenharmony_ci GATE(CLK_TZPC1, "tzpc1", "div_aclk66", GATE_IP_PERIS, 7, 0, 0), 6168c2ecf20Sopenharmony_ci GATE(CLK_TZPC2, "tzpc2", "div_aclk66", GATE_IP_PERIS, 8, 0, 0), 6178c2ecf20Sopenharmony_ci GATE(CLK_TZPC3, "tzpc3", "div_aclk66", GATE_IP_PERIS, 9, 0, 0), 6188c2ecf20Sopenharmony_ci GATE(CLK_TZPC4, "tzpc4", "div_aclk66", GATE_IP_PERIS, 10, 0, 0), 6198c2ecf20Sopenharmony_ci GATE(CLK_TZPC5, "tzpc5", "div_aclk66", GATE_IP_PERIS, 11, 0, 0), 6208c2ecf20Sopenharmony_ci GATE(CLK_TZPC6, "tzpc6", "div_aclk66", GATE_IP_PERIS, 12, 0, 0), 6218c2ecf20Sopenharmony_ci GATE(CLK_TZPC7, "tzpc7", "div_aclk66", GATE_IP_PERIS, 13, 0, 0), 6228c2ecf20Sopenharmony_ci GATE(CLK_TZPC8, "tzpc8", "div_aclk66", GATE_IP_PERIS, 14, 0, 0), 6238c2ecf20Sopenharmony_ci GATE(CLK_TZPC9, "tzpc9", "div_aclk66", GATE_IP_PERIS, 15, 0, 0), 6248c2ecf20Sopenharmony_ci GATE(CLK_HDMI_CEC, "hdmi_cec", "div_aclk66", GATE_IP_PERIS, 16, 0, 0), 6258c2ecf20Sopenharmony_ci GATE(CLK_MCT, "mct", "div_aclk66", GATE_IP_PERIS, 18, 0, 0), 6268c2ecf20Sopenharmony_ci GATE(CLK_WDT, "wdt", "div_aclk66", GATE_IP_PERIS, 19, 0, 0), 6278c2ecf20Sopenharmony_ci GATE(CLK_RTC, "rtc", "div_aclk66", GATE_IP_PERIS, 20, 0, 0), 6288c2ecf20Sopenharmony_ci GATE(CLK_TMU, "tmu", "div_aclk66", GATE_IP_PERIS, 21, 0, 0), 6298c2ecf20Sopenharmony_ci GATE(CLK_SMMU_2D, "smmu_2d", "div_aclk200", GATE_IP_ACP, 7, 0, 0), 6308c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_ISP, "smmu_fimc_isp", "mout_aclk_266_isp_sub", 6318c2ecf20Sopenharmony_ci GATE_IP_ISP0, 8, 0, 0), 6328c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_DRC, "smmu_fimc_drc", "mout_aclk_266_isp_sub", 6338c2ecf20Sopenharmony_ci GATE_IP_ISP0, 9, 0, 0), 6348c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_FD, "smmu_fimc_fd", "mout_aclk_266_isp_sub", 6358c2ecf20Sopenharmony_ci GATE_IP_ISP0, 10, 0, 0), 6368c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_SCC, "smmu_fimc_scc", "mout_aclk_266_isp_sub", 6378c2ecf20Sopenharmony_ci GATE_IP_ISP0, 11, 0, 0), 6388c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_SCP, "smmu_fimc_scp", "mout_aclk_266_isp_sub", 6398c2ecf20Sopenharmony_ci GATE_IP_ISP0, 12, 0, 0), 6408c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_MCU, "smmu_fimc_mcu", "mout_aclk_400_isp_sub", 6418c2ecf20Sopenharmony_ci GATE_IP_ISP0, 13, 0, 0), 6428c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_ODC, "smmu_fimc_odc", "mout_aclk_266_isp_sub", 6438c2ecf20Sopenharmony_ci GATE_IP_ISP1, 4, 0, 0), 6448c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_DIS0, "smmu_fimc_dis0", "mout_aclk_266_isp_sub", 6458c2ecf20Sopenharmony_ci GATE_IP_ISP1, 5, 0, 0), 6468c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_DIS1, "smmu_fimc_dis1", "mout_aclk_266_isp_sub", 6478c2ecf20Sopenharmony_ci GATE_IP_ISP1, 6, 0, 0), 6488c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMC_3DNR, "smmu_fimc_3dnr", "mout_aclk_266_isp_sub", 6498c2ecf20Sopenharmony_ci GATE_IP_ISP1, 7, 0, 0), 6508c2ecf20Sopenharmony_ci}; 6518c2ecf20Sopenharmony_ci 6528c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock exynos5250_disp_gate_clks[] __initconst = { 6538c2ecf20Sopenharmony_ci GATE(CLK_FIMD1, "fimd1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 0, 0, 6548c2ecf20Sopenharmony_ci 0), 6558c2ecf20Sopenharmony_ci GATE(CLK_MIE1, "mie1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 1, 0, 6568c2ecf20Sopenharmony_ci 0), 6578c2ecf20Sopenharmony_ci GATE(CLK_DSIM0, "dsim0", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 3, 0, 6588c2ecf20Sopenharmony_ci 0), 6598c2ecf20Sopenharmony_ci GATE(CLK_DP, "dp", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 4, 0, 0), 6608c2ecf20Sopenharmony_ci GATE(CLK_MIXER, "mixer", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 5, 0, 6618c2ecf20Sopenharmony_ci 0), 6628c2ecf20Sopenharmony_ci GATE(CLK_HDMI, "hdmi", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 6, 0, 6638c2ecf20Sopenharmony_ci 0), 6648c2ecf20Sopenharmony_ci GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub", 6658c2ecf20Sopenharmony_ci GATE_IP_DISP1, 9, 0, 0), 6668c2ecf20Sopenharmony_ci GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub", 6678c2ecf20Sopenharmony_ci GATE_IP_DISP1, 8, 0, 0), 6688c2ecf20Sopenharmony_ci}; 6698c2ecf20Sopenharmony_ci 6708c2ecf20Sopenharmony_cistatic struct exynos5_subcmu_reg_dump exynos5250_disp_suspend_regs[] = { 6718c2ecf20Sopenharmony_ci { GATE_IP_DISP1, 0xffffffff, 0xffffffff }, /* DISP1 gates */ 6728c2ecf20Sopenharmony_ci { SRC_TOP3, 0, BIT(4) }, /* MUX mout_aclk200_disp1_sub */ 6738c2ecf20Sopenharmony_ci { SRC_TOP3, 0, BIT(6) }, /* MUX mout_aclk300_disp1_sub */ 6748c2ecf20Sopenharmony_ci}; 6758c2ecf20Sopenharmony_ci 6768c2ecf20Sopenharmony_cistatic const struct exynos5_subcmu_info exynos5250_disp_subcmu = { 6778c2ecf20Sopenharmony_ci .gate_clks = exynos5250_disp_gate_clks, 6788c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(exynos5250_disp_gate_clks), 6798c2ecf20Sopenharmony_ci .suspend_regs = exynos5250_disp_suspend_regs, 6808c2ecf20Sopenharmony_ci .nr_suspend_regs = ARRAY_SIZE(exynos5250_disp_suspend_regs), 6818c2ecf20Sopenharmony_ci .pd_name = "DISP1", 6828c2ecf20Sopenharmony_ci}; 6838c2ecf20Sopenharmony_ci 6848c2ecf20Sopenharmony_cistatic const struct exynos5_subcmu_info *exynos5250_subcmus[] = { 6858c2ecf20Sopenharmony_ci &exynos5250_disp_subcmu, 6868c2ecf20Sopenharmony_ci}; 6878c2ecf20Sopenharmony_ci 6888c2ecf20Sopenharmony_cistatic const struct samsung_pll_rate_table vpll_24mhz_tbl[] __initconst = { 6898c2ecf20Sopenharmony_ci /* sorted in descending order */ 6908c2ecf20Sopenharmony_ci /* PLL_36XX_RATE(rate, m, p, s, k) */ 6918c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 266000000, 266, 3, 3, 0), 6928c2ecf20Sopenharmony_ci /* Not in UM, but need for eDP on snow */ 6938c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 70500000, 94, 2, 4, 0), 6948c2ecf20Sopenharmony_ci { }, 6958c2ecf20Sopenharmony_ci}; 6968c2ecf20Sopenharmony_ci 6978c2ecf20Sopenharmony_cistatic const struct samsung_pll_rate_table epll_24mhz_tbl[] __initconst = { 6988c2ecf20Sopenharmony_ci /* sorted in descending order */ 6998c2ecf20Sopenharmony_ci /* PLL_36XX_RATE(rate, m, p, s, k) */ 7008c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 192000000, 64, 2, 2, 0), 7018c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 180633605, 90, 3, 2, 20762), 7028c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 180000000, 90, 3, 2, 0), 7038c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 73728000, 98, 2, 4, 19923), 7048c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 67737602, 90, 2, 4, 20762), 7058c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 49152000, 98, 3, 4, 19923), 7068c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 45158401, 90, 3, 4, 20762), 7078c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 32768001, 131, 3, 5, 4719), 7088c2ecf20Sopenharmony_ci { }, 7098c2ecf20Sopenharmony_ci}; 7108c2ecf20Sopenharmony_ci 7118c2ecf20Sopenharmony_cistatic const struct samsung_pll_rate_table apll_24mhz_tbl[] __initconst = { 7128c2ecf20Sopenharmony_ci /* sorted in descending order */ 7138c2ecf20Sopenharmony_ci /* PLL_35XX_RATE(fin, rate, m, p, s) */ 7148c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1700000000, 425, 6, 0), 7158c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1600000000, 200, 3, 0), 7168c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1500000000, 250, 4, 0), 7178c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1400000000, 175, 3, 0), 7188c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1300000000, 325, 6, 0), 7198c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1200000000, 200, 4, 0), 7208c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1100000000, 275, 6, 0), 7218c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1000000000, 125, 3, 0), 7228c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 900000000, 150, 4, 0), 7238c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 800000000, 100, 3, 0), 7248c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 700000000, 175, 3, 1), 7258c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 600000000, 200, 4, 1), 7268c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 500000000, 125, 3, 1), 7278c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 400000000, 100, 3, 1), 7288c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 300000000, 200, 4, 2), 7298c2ecf20Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 200000000, 100, 3, 2), 7308c2ecf20Sopenharmony_ci}; 7318c2ecf20Sopenharmony_ci 7328c2ecf20Sopenharmony_cistatic struct samsung_pll_clock exynos5250_plls[nr_plls] __initdata = { 7338c2ecf20Sopenharmony_ci [apll] = PLL(pll_35xx, CLK_FOUT_APLL, "fout_apll", "fin_pll", APLL_LOCK, 7348c2ecf20Sopenharmony_ci APLL_CON0, NULL), 7358c2ecf20Sopenharmony_ci [mpll] = PLL(pll_35xx, CLK_FOUT_MPLL, "fout_mpll", "fin_pll", MPLL_LOCK, 7368c2ecf20Sopenharmony_ci MPLL_CON0, NULL), 7378c2ecf20Sopenharmony_ci [bpll] = PLL(pll_35xx, CLK_FOUT_BPLL, "fout_bpll", "fin_pll", BPLL_LOCK, 7388c2ecf20Sopenharmony_ci BPLL_CON0, NULL), 7398c2ecf20Sopenharmony_ci [gpll] = PLL(pll_35xx, CLK_FOUT_GPLL, "fout_gpll", "fin_pll", GPLL_LOCK, 7408c2ecf20Sopenharmony_ci GPLL_CON0, NULL), 7418c2ecf20Sopenharmony_ci [cpll] = PLL(pll_35xx, CLK_FOUT_CPLL, "fout_cpll", "fin_pll", CPLL_LOCK, 7428c2ecf20Sopenharmony_ci CPLL_CON0, NULL), 7438c2ecf20Sopenharmony_ci [epll] = PLL(pll_36xx, CLK_FOUT_EPLL, "fout_epll", "fin_pll", EPLL_LOCK, 7448c2ecf20Sopenharmony_ci EPLL_CON0, NULL), 7458c2ecf20Sopenharmony_ci [vpll] = PLL(pll_36xx, CLK_FOUT_VPLL, "fout_vpll", "mout_vpllsrc", 7468c2ecf20Sopenharmony_ci VPLL_LOCK, VPLL_CON0, NULL), 7478c2ecf20Sopenharmony_ci}; 7488c2ecf20Sopenharmony_ci 7498c2ecf20Sopenharmony_ci#define E5250_CPU_DIV0(apll, pclk_dbg, atb, periph, acp, cpud) \ 7508c2ecf20Sopenharmony_ci ((((apll) << 24) | ((pclk_dbg) << 20) | ((atb) << 16) | \ 7518c2ecf20Sopenharmony_ci ((periph) << 12) | ((acp) << 8) | ((cpud) << 4))) 7528c2ecf20Sopenharmony_ci#define E5250_CPU_DIV1(hpm, copy) \ 7538c2ecf20Sopenharmony_ci (((hpm) << 4) | (copy)) 7548c2ecf20Sopenharmony_ci 7558c2ecf20Sopenharmony_cistatic const struct exynos_cpuclk_cfg_data exynos5250_armclk_d[] __initconst = { 7568c2ecf20Sopenharmony_ci { 1700000, E5250_CPU_DIV0(5, 3, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 7578c2ecf20Sopenharmony_ci { 1600000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 7588c2ecf20Sopenharmony_ci { 1500000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 7598c2ecf20Sopenharmony_ci { 1400000, E5250_CPU_DIV0(4, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 7608c2ecf20Sopenharmony_ci { 1300000, E5250_CPU_DIV0(3, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 7618c2ecf20Sopenharmony_ci { 1200000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 7628c2ecf20Sopenharmony_ci { 1100000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 7638c2ecf20Sopenharmony_ci { 1000000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7648c2ecf20Sopenharmony_ci { 900000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7658c2ecf20Sopenharmony_ci { 800000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7668c2ecf20Sopenharmony_ci { 700000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7678c2ecf20Sopenharmony_ci { 600000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7688c2ecf20Sopenharmony_ci { 500000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7698c2ecf20Sopenharmony_ci { 400000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7708c2ecf20Sopenharmony_ci { 300000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7718c2ecf20Sopenharmony_ci { 200000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 7728c2ecf20Sopenharmony_ci { 0 }, 7738c2ecf20Sopenharmony_ci}; 7748c2ecf20Sopenharmony_ci 7758c2ecf20Sopenharmony_cistatic const struct of_device_id ext_clk_match[] __initconst = { 7768c2ecf20Sopenharmony_ci { .compatible = "samsung,clock-xxti", .data = (void *)0, }, 7778c2ecf20Sopenharmony_ci { }, 7788c2ecf20Sopenharmony_ci}; 7798c2ecf20Sopenharmony_ci 7808c2ecf20Sopenharmony_ci/* register exynox5250 clocks */ 7818c2ecf20Sopenharmony_cistatic void __init exynos5250_clk_init(struct device_node *np) 7828c2ecf20Sopenharmony_ci{ 7838c2ecf20Sopenharmony_ci struct samsung_clk_provider *ctx; 7848c2ecf20Sopenharmony_ci unsigned int tmp; 7858c2ecf20Sopenharmony_ci struct clk_hw **hws; 7868c2ecf20Sopenharmony_ci 7878c2ecf20Sopenharmony_ci if (np) { 7888c2ecf20Sopenharmony_ci reg_base = of_iomap(np, 0); 7898c2ecf20Sopenharmony_ci if (!reg_base) 7908c2ecf20Sopenharmony_ci panic("%s: failed to map registers\n", __func__); 7918c2ecf20Sopenharmony_ci } else { 7928c2ecf20Sopenharmony_ci panic("%s: unable to determine soc\n", __func__); 7938c2ecf20Sopenharmony_ci } 7948c2ecf20Sopenharmony_ci 7958c2ecf20Sopenharmony_ci ctx = samsung_clk_init(np, reg_base, CLK_NR_CLKS); 7968c2ecf20Sopenharmony_ci hws = ctx->clk_data.hws; 7978c2ecf20Sopenharmony_ci 7988c2ecf20Sopenharmony_ci samsung_clk_of_register_fixed_ext(ctx, exynos5250_fixed_rate_ext_clks, 7998c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_fixed_rate_ext_clks), 8008c2ecf20Sopenharmony_ci ext_clk_match); 8018c2ecf20Sopenharmony_ci samsung_clk_register_mux(ctx, exynos5250_pll_pmux_clks, 8028c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_pll_pmux_clks)); 8038c2ecf20Sopenharmony_ci 8048c2ecf20Sopenharmony_ci if (_get_rate("fin_pll") == 24 * MHZ) { 8058c2ecf20Sopenharmony_ci exynos5250_plls[epll].rate_table = epll_24mhz_tbl; 8068c2ecf20Sopenharmony_ci exynos5250_plls[apll].rate_table = apll_24mhz_tbl; 8078c2ecf20Sopenharmony_ci } 8088c2ecf20Sopenharmony_ci 8098c2ecf20Sopenharmony_ci if (_get_rate("mout_vpllsrc") == 24 * MHZ) 8108c2ecf20Sopenharmony_ci exynos5250_plls[vpll].rate_table = vpll_24mhz_tbl; 8118c2ecf20Sopenharmony_ci 8128c2ecf20Sopenharmony_ci samsung_clk_register_pll(ctx, exynos5250_plls, 8138c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_plls), 8148c2ecf20Sopenharmony_ci reg_base); 8158c2ecf20Sopenharmony_ci samsung_clk_register_fixed_rate(ctx, exynos5250_fixed_rate_clks, 8168c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_fixed_rate_clks)); 8178c2ecf20Sopenharmony_ci samsung_clk_register_fixed_factor(ctx, exynos5250_fixed_factor_clks, 8188c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_fixed_factor_clks)); 8198c2ecf20Sopenharmony_ci samsung_clk_register_mux(ctx, exynos5250_mux_clks, 8208c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_mux_clks)); 8218c2ecf20Sopenharmony_ci samsung_clk_register_div(ctx, exynos5250_div_clks, 8228c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_div_clks)); 8238c2ecf20Sopenharmony_ci samsung_clk_register_gate(ctx, exynos5250_gate_clks, 8248c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_gate_clks)); 8258c2ecf20Sopenharmony_ci exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", 8268c2ecf20Sopenharmony_ci hws[CLK_MOUT_APLL], hws[CLK_MOUT_MPLL], 0x200, 8278c2ecf20Sopenharmony_ci exynos5250_armclk_d, ARRAY_SIZE(exynos5250_armclk_d), 8288c2ecf20Sopenharmony_ci CLK_CPU_HAS_DIV1); 8298c2ecf20Sopenharmony_ci 8308c2ecf20Sopenharmony_ci /* 8318c2ecf20Sopenharmony_ci * Enable arm clock down (in idle) and set arm divider 8328c2ecf20Sopenharmony_ci * ratios in WFI/WFE state. 8338c2ecf20Sopenharmony_ci */ 8348c2ecf20Sopenharmony_ci tmp = (PWR_CTRL1_CORE2_DOWN_RATIO | PWR_CTRL1_CORE1_DOWN_RATIO | 8358c2ecf20Sopenharmony_ci PWR_CTRL1_DIV2_DOWN_EN | PWR_CTRL1_DIV1_DOWN_EN | 8368c2ecf20Sopenharmony_ci PWR_CTRL1_USE_CORE1_WFE | PWR_CTRL1_USE_CORE0_WFE | 8378c2ecf20Sopenharmony_ci PWR_CTRL1_USE_CORE1_WFI | PWR_CTRL1_USE_CORE0_WFI); 8388c2ecf20Sopenharmony_ci __raw_writel(tmp, reg_base + PWR_CTRL1); 8398c2ecf20Sopenharmony_ci 8408c2ecf20Sopenharmony_ci /* 8418c2ecf20Sopenharmony_ci * Enable arm clock up (on exiting idle). Set arm divider 8428c2ecf20Sopenharmony_ci * ratios when not in idle along with the standby duration 8438c2ecf20Sopenharmony_ci * ratios. 8448c2ecf20Sopenharmony_ci */ 8458c2ecf20Sopenharmony_ci tmp = (PWR_CTRL2_DIV2_UP_EN | PWR_CTRL2_DIV1_UP_EN | 8468c2ecf20Sopenharmony_ci PWR_CTRL2_DUR_STANDBY2_VAL | PWR_CTRL2_DUR_STANDBY1_VAL | 8478c2ecf20Sopenharmony_ci PWR_CTRL2_CORE2_UP_RATIO | PWR_CTRL2_CORE1_UP_RATIO); 8488c2ecf20Sopenharmony_ci __raw_writel(tmp, reg_base + PWR_CTRL2); 8498c2ecf20Sopenharmony_ci 8508c2ecf20Sopenharmony_ci samsung_clk_sleep_init(reg_base, exynos5250_clk_regs, 8518c2ecf20Sopenharmony_ci ARRAY_SIZE(exynos5250_clk_regs)); 8528c2ecf20Sopenharmony_ci exynos5_subcmus_init(ctx, ARRAY_SIZE(exynos5250_subcmus), 8538c2ecf20Sopenharmony_ci exynos5250_subcmus); 8548c2ecf20Sopenharmony_ci 8558c2ecf20Sopenharmony_ci samsung_clk_of_add_provider(np, ctx); 8568c2ecf20Sopenharmony_ci 8578c2ecf20Sopenharmony_ci pr_info("Exynos5250: clock setup completed, armclk=%ld\n", 8588c2ecf20Sopenharmony_ci _get_rate("div_arm2")); 8598c2ecf20Sopenharmony_ci} 8608c2ecf20Sopenharmony_ciCLK_OF_DECLARE_DRIVER(exynos5250_clk, "samsung,exynos5250-clock", exynos5250_clk_init); 861