162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2013 Samsung Electronics Co., Ltd. 462306a36Sopenharmony_ci * Copyright (c) 2013 Linaro Ltd. 562306a36Sopenharmony_ci * Author: Thomas Abraham <thomas.ab@samsung.com> 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Common Clock Framework support for Exynos5250 SoC. 862306a36Sopenharmony_ci*/ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#include <dt-bindings/clock/exynos5250.h> 1162306a36Sopenharmony_ci#include <linux/clk-provider.h> 1262306a36Sopenharmony_ci#include <linux/io.h> 1362306a36Sopenharmony_ci#include <linux/of.h> 1462306a36Sopenharmony_ci#include <linux/of_address.h> 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#include "clk.h" 1762306a36Sopenharmony_ci#include "clk-cpu.h" 1862306a36Sopenharmony_ci#include "clk-exynos5-subcmu.h" 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#define APLL_LOCK 0x0 2162306a36Sopenharmony_ci#define APLL_CON0 0x100 2262306a36Sopenharmony_ci#define SRC_CPU 0x200 2362306a36Sopenharmony_ci#define DIV_CPU0 0x500 2462306a36Sopenharmony_ci#define PWR_CTRL1 0x1020 2562306a36Sopenharmony_ci#define PWR_CTRL2 0x1024 2662306a36Sopenharmony_ci#define MPLL_LOCK 0x4000 2762306a36Sopenharmony_ci#define MPLL_CON0 0x4100 2862306a36Sopenharmony_ci#define SRC_CORE1 0x4204 2962306a36Sopenharmony_ci#define GATE_IP_ACP 0x8800 3062306a36Sopenharmony_ci#define GATE_IP_ISP0 0xc800 3162306a36Sopenharmony_ci#define GATE_IP_ISP1 0xc804 3262306a36Sopenharmony_ci#define CPLL_LOCK 0x10020 3362306a36Sopenharmony_ci#define EPLL_LOCK 0x10030 3462306a36Sopenharmony_ci#define VPLL_LOCK 0x10040 3562306a36Sopenharmony_ci#define GPLL_LOCK 0x10050 3662306a36Sopenharmony_ci#define CPLL_CON0 0x10120 3762306a36Sopenharmony_ci#define EPLL_CON0 0x10130 3862306a36Sopenharmony_ci#define VPLL_CON0 0x10140 3962306a36Sopenharmony_ci#define GPLL_CON0 0x10150 4062306a36Sopenharmony_ci#define SRC_TOP0 0x10210 4162306a36Sopenharmony_ci#define SRC_TOP1 0x10214 4262306a36Sopenharmony_ci#define SRC_TOP2 0x10218 4362306a36Sopenharmony_ci#define SRC_TOP3 0x1021c 4462306a36Sopenharmony_ci#define SRC_GSCL 0x10220 4562306a36Sopenharmony_ci#define SRC_DISP1_0 0x1022c 4662306a36Sopenharmony_ci#define SRC_MAU 0x10240 4762306a36Sopenharmony_ci#define SRC_FSYS 0x10244 4862306a36Sopenharmony_ci#define SRC_GEN 0x10248 4962306a36Sopenharmony_ci#define SRC_PERIC0 0x10250 5062306a36Sopenharmony_ci#define SRC_PERIC1 0x10254 5162306a36Sopenharmony_ci#define SRC_MASK_GSCL 0x10320 5262306a36Sopenharmony_ci#define SRC_MASK_DISP1_0 0x1032c 5362306a36Sopenharmony_ci#define SRC_MASK_MAU 0x10334 5462306a36Sopenharmony_ci#define SRC_MASK_FSYS 0x10340 5562306a36Sopenharmony_ci#define SRC_MASK_GEN 0x10344 5662306a36Sopenharmony_ci#define SRC_MASK_PERIC0 0x10350 5762306a36Sopenharmony_ci#define SRC_MASK_PERIC1 0x10354 5862306a36Sopenharmony_ci#define DIV_TOP0 0x10510 5962306a36Sopenharmony_ci#define DIV_TOP1 0x10514 6062306a36Sopenharmony_ci#define DIV_GSCL 0x10520 6162306a36Sopenharmony_ci#define DIV_DISP1_0 0x1052c 6262306a36Sopenharmony_ci#define DIV_GEN 0x1053c 6362306a36Sopenharmony_ci#define DIV_MAU 0x10544 6462306a36Sopenharmony_ci#define DIV_FSYS0 0x10548 6562306a36Sopenharmony_ci#define DIV_FSYS1 0x1054c 6662306a36Sopenharmony_ci#define DIV_FSYS2 0x10550 6762306a36Sopenharmony_ci#define DIV_PERIC0 0x10558 6862306a36Sopenharmony_ci#define DIV_PERIC1 0x1055c 6962306a36Sopenharmony_ci#define DIV_PERIC2 0x10560 7062306a36Sopenharmony_ci#define DIV_PERIC3 0x10564 7162306a36Sopenharmony_ci#define DIV_PERIC4 0x10568 7262306a36Sopenharmony_ci#define DIV_PERIC5 0x1056c 7362306a36Sopenharmony_ci#define GATE_IP_GSCL 0x10920 7462306a36Sopenharmony_ci#define GATE_IP_DISP1 0x10928 7562306a36Sopenharmony_ci#define GATE_IP_MFC 0x1092c 7662306a36Sopenharmony_ci#define GATE_IP_G3D 0x10930 7762306a36Sopenharmony_ci#define GATE_IP_GEN 0x10934 7862306a36Sopenharmony_ci#define GATE_IP_FSYS 0x10944 7962306a36Sopenharmony_ci#define GATE_IP_PERIC 0x10950 8062306a36Sopenharmony_ci#define GATE_IP_PERIS 0x10960 8162306a36Sopenharmony_ci#define BPLL_LOCK 0x20010 8262306a36Sopenharmony_ci#define BPLL_CON0 0x20110 8362306a36Sopenharmony_ci#define SRC_CDREX 0x20200 8462306a36Sopenharmony_ci#define PLL_DIV2_SEL 0x20a24 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci/*Below definitions are used for PWR_CTRL settings*/ 8762306a36Sopenharmony_ci#define PWR_CTRL1_CORE2_DOWN_RATIO (7 << 28) 8862306a36Sopenharmony_ci#define PWR_CTRL1_CORE1_DOWN_RATIO (7 << 16) 8962306a36Sopenharmony_ci#define PWR_CTRL1_DIV2_DOWN_EN (1 << 9) 9062306a36Sopenharmony_ci#define PWR_CTRL1_DIV1_DOWN_EN (1 << 8) 9162306a36Sopenharmony_ci#define PWR_CTRL1_USE_CORE1_WFE (1 << 5) 9262306a36Sopenharmony_ci#define PWR_CTRL1_USE_CORE0_WFE (1 << 4) 9362306a36Sopenharmony_ci#define PWR_CTRL1_USE_CORE1_WFI (1 << 1) 9462306a36Sopenharmony_ci#define PWR_CTRL1_USE_CORE0_WFI (1 << 0) 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci#define PWR_CTRL2_DIV2_UP_EN (1 << 25) 9762306a36Sopenharmony_ci#define PWR_CTRL2_DIV1_UP_EN (1 << 24) 9862306a36Sopenharmony_ci#define PWR_CTRL2_DUR_STANDBY2_VAL (1 << 16) 9962306a36Sopenharmony_ci#define PWR_CTRL2_DUR_STANDBY1_VAL (1 << 8) 10062306a36Sopenharmony_ci#define PWR_CTRL2_CORE2_UP_RATIO (1 << 4) 10162306a36Sopenharmony_ci#define PWR_CTRL2_CORE1_UP_RATIO (1 << 0) 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci/* NOTE: Must be equal to the last clock ID increased by one */ 10462306a36Sopenharmony_ci#define CLKS_NR (CLK_MOUT_VPLLSRC + 1) 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci/* list of PLLs to be registered */ 10762306a36Sopenharmony_cienum exynos5250_plls { 10862306a36Sopenharmony_ci apll, mpll, cpll, epll, vpll, gpll, bpll, 10962306a36Sopenharmony_ci nr_plls /* number of PLLs */ 11062306a36Sopenharmony_ci}; 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_cistatic void __iomem *reg_base; 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci/* 11562306a36Sopenharmony_ci * list of controller registers to be saved and restored during a 11662306a36Sopenharmony_ci * suspend/resume cycle. 11762306a36Sopenharmony_ci */ 11862306a36Sopenharmony_cistatic const unsigned long exynos5250_clk_regs[] __initconst = { 11962306a36Sopenharmony_ci SRC_CPU, 12062306a36Sopenharmony_ci DIV_CPU0, 12162306a36Sopenharmony_ci PWR_CTRL1, 12262306a36Sopenharmony_ci PWR_CTRL2, 12362306a36Sopenharmony_ci SRC_CORE1, 12462306a36Sopenharmony_ci SRC_TOP0, 12562306a36Sopenharmony_ci SRC_TOP1, 12662306a36Sopenharmony_ci SRC_TOP2, 12762306a36Sopenharmony_ci SRC_TOP3, 12862306a36Sopenharmony_ci SRC_GSCL, 12962306a36Sopenharmony_ci SRC_DISP1_0, 13062306a36Sopenharmony_ci SRC_MAU, 13162306a36Sopenharmony_ci SRC_FSYS, 13262306a36Sopenharmony_ci SRC_GEN, 13362306a36Sopenharmony_ci SRC_PERIC0, 13462306a36Sopenharmony_ci SRC_PERIC1, 13562306a36Sopenharmony_ci SRC_MASK_GSCL, 13662306a36Sopenharmony_ci SRC_MASK_DISP1_0, 13762306a36Sopenharmony_ci SRC_MASK_MAU, 13862306a36Sopenharmony_ci SRC_MASK_FSYS, 13962306a36Sopenharmony_ci SRC_MASK_GEN, 14062306a36Sopenharmony_ci SRC_MASK_PERIC0, 14162306a36Sopenharmony_ci SRC_MASK_PERIC1, 14262306a36Sopenharmony_ci DIV_TOP0, 14362306a36Sopenharmony_ci DIV_TOP1, 14462306a36Sopenharmony_ci DIV_GSCL, 14562306a36Sopenharmony_ci DIV_DISP1_0, 14662306a36Sopenharmony_ci DIV_GEN, 14762306a36Sopenharmony_ci DIV_MAU, 14862306a36Sopenharmony_ci DIV_FSYS0, 14962306a36Sopenharmony_ci DIV_FSYS1, 15062306a36Sopenharmony_ci DIV_FSYS2, 15162306a36Sopenharmony_ci DIV_PERIC0, 15262306a36Sopenharmony_ci DIV_PERIC1, 15362306a36Sopenharmony_ci DIV_PERIC2, 15462306a36Sopenharmony_ci DIV_PERIC3, 15562306a36Sopenharmony_ci DIV_PERIC4, 15662306a36Sopenharmony_ci DIV_PERIC5, 15762306a36Sopenharmony_ci GATE_IP_GSCL, 15862306a36Sopenharmony_ci GATE_IP_MFC, 15962306a36Sopenharmony_ci GATE_IP_G3D, 16062306a36Sopenharmony_ci GATE_IP_GEN, 16162306a36Sopenharmony_ci GATE_IP_FSYS, 16262306a36Sopenharmony_ci GATE_IP_PERIC, 16362306a36Sopenharmony_ci GATE_IP_PERIS, 16462306a36Sopenharmony_ci SRC_CDREX, 16562306a36Sopenharmony_ci PLL_DIV2_SEL, 16662306a36Sopenharmony_ci GATE_IP_DISP1, 16762306a36Sopenharmony_ci GATE_IP_ACP, 16862306a36Sopenharmony_ci GATE_IP_ISP0, 16962306a36Sopenharmony_ci GATE_IP_ISP1, 17062306a36Sopenharmony_ci}; 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci/* list of all parent clock list */ 17362306a36Sopenharmony_ciPNAME(mout_apll_p) = { "fin_pll", "fout_apll", }; 17462306a36Sopenharmony_ciPNAME(mout_cpu_p) = { "mout_apll", "mout_mpll", }; 17562306a36Sopenharmony_ciPNAME(mout_mpll_fout_p) = { "fout_mplldiv2", "fout_mpll" }; 17662306a36Sopenharmony_ciPNAME(mout_mpll_p) = { "fin_pll", "mout_mpll_fout" }; 17762306a36Sopenharmony_ciPNAME(mout_bpll_fout_p) = { "fout_bplldiv2", "fout_bpll" }; 17862306a36Sopenharmony_ciPNAME(mout_bpll_p) = { "fin_pll", "mout_bpll_fout" }; 17962306a36Sopenharmony_ciPNAME(mout_vpllsrc_p) = { "fin_pll", "sclk_hdmi27m" }; 18062306a36Sopenharmony_ciPNAME(mout_vpll_p) = { "mout_vpllsrc", "fout_vpll" }; 18162306a36Sopenharmony_ciPNAME(mout_cpll_p) = { "fin_pll", "fout_cpll" }; 18262306a36Sopenharmony_ciPNAME(mout_epll_p) = { "fin_pll", "fout_epll" }; 18362306a36Sopenharmony_ciPNAME(mout_gpll_p) = { "fin_pll", "fout_gpll" }; 18462306a36Sopenharmony_ciPNAME(mout_mpll_user_p) = { "fin_pll", "mout_mpll" }; 18562306a36Sopenharmony_ciPNAME(mout_bpll_user_p) = { "fin_pll", "mout_bpll" }; 18662306a36Sopenharmony_ciPNAME(mout_aclk166_p) = { "mout_cpll", "mout_mpll_user" }; 18762306a36Sopenharmony_ciPNAME(mout_aclk200_p) = { "mout_mpll_user", "mout_bpll_user" }; 18862306a36Sopenharmony_ciPNAME(mout_aclk300_p) = { "mout_aclk300_disp1_mid", 18962306a36Sopenharmony_ci "mout_aclk300_disp1_mid1" }; 19062306a36Sopenharmony_ciPNAME(mout_aclk400_p) = { "mout_aclk400_g3d_mid", "mout_gpll" }; 19162306a36Sopenharmony_ciPNAME(mout_aclk200_sub_p) = { "fin_pll", "div_aclk200" }; 19262306a36Sopenharmony_ciPNAME(mout_aclk266_sub_p) = { "fin_pll", "div_aclk266" }; 19362306a36Sopenharmony_ciPNAME(mout_aclk300_sub_p) = { "fin_pll", "div_aclk300_disp" }; 19462306a36Sopenharmony_ciPNAME(mout_aclk300_disp1_mid1_p) = { "mout_vpll", "mout_cpll" }; 19562306a36Sopenharmony_ciPNAME(mout_aclk333_sub_p) = { "fin_pll", "div_aclk333" }; 19662306a36Sopenharmony_ciPNAME(mout_aclk400_isp_sub_p) = { "fin_pll", "div_aclk400_isp" }; 19762306a36Sopenharmony_ciPNAME(mout_hdmi_p) = { "div_hdmi_pixel", "sclk_hdmiphy" }; 19862306a36Sopenharmony_ciPNAME(mout_usb3_p) = { "mout_mpll_user", "mout_cpll" }; 19962306a36Sopenharmony_ciPNAME(mout_group1_p) = { "fin_pll", "fin_pll", "sclk_hdmi27m", 20062306a36Sopenharmony_ci "sclk_dptxphy", "sclk_uhostphy", "sclk_hdmiphy", 20162306a36Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 20262306a36Sopenharmony_ci "mout_cpll", "none", "none", 20362306a36Sopenharmony_ci "none", "none", "none", 20462306a36Sopenharmony_ci "none" }; 20562306a36Sopenharmony_ciPNAME(mout_audio0_p) = { "cdclk0", "fin_pll", "sclk_hdmi27m", "sclk_dptxphy", 20662306a36Sopenharmony_ci "sclk_uhostphy", "fin_pll", 20762306a36Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 20862306a36Sopenharmony_ci "mout_cpll", "none", "none", 20962306a36Sopenharmony_ci "none", "none", "none", 21062306a36Sopenharmony_ci "none" }; 21162306a36Sopenharmony_ciPNAME(mout_audio1_p) = { "cdclk1", "fin_pll", "sclk_hdmi27m", "sclk_dptxphy", 21262306a36Sopenharmony_ci "sclk_uhostphy", "fin_pll", 21362306a36Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 21462306a36Sopenharmony_ci "mout_cpll", "none", "none", 21562306a36Sopenharmony_ci "none", "none", "none", 21662306a36Sopenharmony_ci "none" }; 21762306a36Sopenharmony_ciPNAME(mout_audio2_p) = { "cdclk2", "fin_pll", "sclk_hdmi27m", "sclk_dptxphy", 21862306a36Sopenharmony_ci "sclk_uhostphy", "fin_pll", 21962306a36Sopenharmony_ci "mout_mpll_user", "mout_epll", "mout_vpll", 22062306a36Sopenharmony_ci "mout_cpll", "none", "none", 22162306a36Sopenharmony_ci "none", "none", "none", 22262306a36Sopenharmony_ci "none" }; 22362306a36Sopenharmony_ciPNAME(mout_spdif_p) = { "sclk_audio0", "sclk_audio1", "sclk_audio2", 22462306a36Sopenharmony_ci "spdif_extclk" }; 22562306a36Sopenharmony_ci 22662306a36Sopenharmony_ci/* fixed rate clocks generated outside the soc */ 22762306a36Sopenharmony_cistatic struct samsung_fixed_rate_clock exynos5250_fixed_rate_ext_clks[] __initdata = { 22862306a36Sopenharmony_ci FRATE(CLK_FIN_PLL, "fin_pll", NULL, 0, 0), 22962306a36Sopenharmony_ci}; 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_ci/* fixed rate clocks generated inside the soc */ 23262306a36Sopenharmony_cistatic const struct samsung_fixed_rate_clock exynos5250_fixed_rate_clks[] __initconst = { 23362306a36Sopenharmony_ci FRATE(CLK_SCLK_HDMIPHY, "sclk_hdmiphy", NULL, 0, 24000000), 23462306a36Sopenharmony_ci FRATE(0, "sclk_hdmi27m", NULL, 0, 27000000), 23562306a36Sopenharmony_ci FRATE(0, "sclk_dptxphy", NULL, 0, 24000000), 23662306a36Sopenharmony_ci FRATE(0, "sclk_uhostphy", NULL, 0, 48000000), 23762306a36Sopenharmony_ci}; 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_cistatic const struct samsung_fixed_factor_clock exynos5250_fixed_factor_clks[] __initconst = { 24062306a36Sopenharmony_ci FFACTOR(0, "fout_mplldiv2", "fout_mpll", 1, 2, 0), 24162306a36Sopenharmony_ci FFACTOR(0, "fout_bplldiv2", "fout_bpll", 1, 2, 0), 24262306a36Sopenharmony_ci}; 24362306a36Sopenharmony_ci 24462306a36Sopenharmony_cistatic const struct samsung_mux_clock exynos5250_pll_pmux_clks[] __initconst = { 24562306a36Sopenharmony_ci MUX(CLK_MOUT_VPLLSRC, "mout_vpllsrc", mout_vpllsrc_p, SRC_TOP2, 0, 1), 24662306a36Sopenharmony_ci}; 24762306a36Sopenharmony_ci 24862306a36Sopenharmony_cistatic const struct samsung_mux_clock exynos5250_mux_clks[] __initconst = { 24962306a36Sopenharmony_ci /* 25062306a36Sopenharmony_ci * NOTE: Following table is sorted by (clock domain, register address, 25162306a36Sopenharmony_ci * bitfield shift) triplet in ascending order. When adding new entries, 25262306a36Sopenharmony_ci * please make sure that the order is kept, to avoid merge conflicts 25362306a36Sopenharmony_ci * and make further work with defined data easier. 25462306a36Sopenharmony_ci */ 25562306a36Sopenharmony_ci 25662306a36Sopenharmony_ci /* 25762306a36Sopenharmony_ci * CMU_CPU 25862306a36Sopenharmony_ci */ 25962306a36Sopenharmony_ci MUX_F(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1, 26062306a36Sopenharmony_ci CLK_SET_RATE_PARENT, 0), 26162306a36Sopenharmony_ci MUX(0, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1), 26262306a36Sopenharmony_ci 26362306a36Sopenharmony_ci /* 26462306a36Sopenharmony_ci * CMU_CORE 26562306a36Sopenharmony_ci */ 26662306a36Sopenharmony_ci MUX(CLK_MOUT_MPLL, "mout_mpll", mout_mpll_p, SRC_CORE1, 8, 1), 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci /* 26962306a36Sopenharmony_ci * CMU_TOP 27062306a36Sopenharmony_ci */ 27162306a36Sopenharmony_ci MUX(0, "mout_aclk166", mout_aclk166_p, SRC_TOP0, 8, 1), 27262306a36Sopenharmony_ci MUX(0, "mout_aclk200", mout_aclk200_p, SRC_TOP0, 12, 1), 27362306a36Sopenharmony_ci MUX(0, "mout_aclk300_disp1_mid", mout_aclk200_p, SRC_TOP0, 14, 1), 27462306a36Sopenharmony_ci MUX(0, "mout_aclk300", mout_aclk300_p, SRC_TOP0, 15, 1), 27562306a36Sopenharmony_ci MUX(0, "mout_aclk333", mout_aclk166_p, SRC_TOP0, 16, 1), 27662306a36Sopenharmony_ci MUX(0, "mout_aclk400_g3d_mid", mout_aclk200_p, SRC_TOP0, 20, 1), 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci MUX(0, "mout_aclk300_disp1_mid1", mout_aclk300_disp1_mid1_p, SRC_TOP1, 27962306a36Sopenharmony_ci 8, 1), 28062306a36Sopenharmony_ci MUX(0, "mout_aclk400_isp", mout_aclk200_p, SRC_TOP1, 24, 1), 28162306a36Sopenharmony_ci MUX(0, "mout_aclk400_g3d", mout_aclk400_p, SRC_TOP1, 28, 1), 28262306a36Sopenharmony_ci 28362306a36Sopenharmony_ci MUX(0, "mout_cpll", mout_cpll_p, SRC_TOP2, 8, 1), 28462306a36Sopenharmony_ci MUX(0, "mout_epll", mout_epll_p, SRC_TOP2, 12, 1), 28562306a36Sopenharmony_ci MUX(0, "mout_vpll", mout_vpll_p, SRC_TOP2, 16, 1), 28662306a36Sopenharmony_ci MUX(0, "mout_mpll_user", mout_mpll_user_p, SRC_TOP2, 20, 1), 28762306a36Sopenharmony_ci MUX(0, "mout_bpll_user", mout_bpll_user_p, SRC_TOP2, 24, 1), 28862306a36Sopenharmony_ci MUX(CLK_MOUT_GPLL, "mout_gpll", mout_gpll_p, SRC_TOP2, 28, 1), 28962306a36Sopenharmony_ci 29062306a36Sopenharmony_ci MUX(CLK_MOUT_ACLK200_DISP1_SUB, "mout_aclk200_disp1_sub", 29162306a36Sopenharmony_ci mout_aclk200_sub_p, SRC_TOP3, 4, 1), 29262306a36Sopenharmony_ci MUX(CLK_MOUT_ACLK300_DISP1_SUB, "mout_aclk300_disp1_sub", 29362306a36Sopenharmony_ci mout_aclk300_sub_p, SRC_TOP3, 6, 1), 29462306a36Sopenharmony_ci MUX(0, "mout_aclk266_gscl_sub", mout_aclk266_sub_p, SRC_TOP3, 8, 1), 29562306a36Sopenharmony_ci MUX(0, "mout_aclk_266_isp_sub", mout_aclk266_sub_p, SRC_TOP3, 16, 1), 29662306a36Sopenharmony_ci MUX(0, "mout_aclk_400_isp_sub", mout_aclk400_isp_sub_p, 29762306a36Sopenharmony_ci SRC_TOP3, 20, 1), 29862306a36Sopenharmony_ci MUX(0, "mout_aclk333_sub", mout_aclk333_sub_p, SRC_TOP3, 24, 1), 29962306a36Sopenharmony_ci 30062306a36Sopenharmony_ci MUX(0, "mout_cam_bayer", mout_group1_p, SRC_GSCL, 12, 4), 30162306a36Sopenharmony_ci MUX(0, "mout_cam0", mout_group1_p, SRC_GSCL, 16, 4), 30262306a36Sopenharmony_ci MUX(0, "mout_cam1", mout_group1_p, SRC_GSCL, 20, 4), 30362306a36Sopenharmony_ci MUX(0, "mout_gscl_wa", mout_group1_p, SRC_GSCL, 24, 4), 30462306a36Sopenharmony_ci MUX(0, "mout_gscl_wb", mout_group1_p, SRC_GSCL, 28, 4), 30562306a36Sopenharmony_ci 30662306a36Sopenharmony_ci MUX(0, "mout_fimd1", mout_group1_p, SRC_DISP1_0, 0, 4), 30762306a36Sopenharmony_ci MUX(0, "mout_mipi1", mout_group1_p, SRC_DISP1_0, 12, 4), 30862306a36Sopenharmony_ci MUX(0, "mout_dp", mout_group1_p, SRC_DISP1_0, 16, 4), 30962306a36Sopenharmony_ci MUX(CLK_MOUT_HDMI, "mout_hdmi", mout_hdmi_p, SRC_DISP1_0, 20, 1), 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci MUX(0, "mout_audio0", mout_audio0_p, SRC_MAU, 0, 4), 31262306a36Sopenharmony_ci 31362306a36Sopenharmony_ci MUX(0, "mout_mmc0", mout_group1_p, SRC_FSYS, 0, 4), 31462306a36Sopenharmony_ci MUX(0, "mout_mmc1", mout_group1_p, SRC_FSYS, 4, 4), 31562306a36Sopenharmony_ci MUX(0, "mout_mmc2", mout_group1_p, SRC_FSYS, 8, 4), 31662306a36Sopenharmony_ci MUX(0, "mout_mmc3", mout_group1_p, SRC_FSYS, 12, 4), 31762306a36Sopenharmony_ci MUX(0, "mout_sata", mout_aclk200_p, SRC_FSYS, 24, 1), 31862306a36Sopenharmony_ci MUX(0, "mout_usb3", mout_usb3_p, SRC_FSYS, 28, 1), 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci MUX(0, "mout_jpeg", mout_group1_p, SRC_GEN, 0, 4), 32162306a36Sopenharmony_ci 32262306a36Sopenharmony_ci MUX(0, "mout_uart0", mout_group1_p, SRC_PERIC0, 0, 4), 32362306a36Sopenharmony_ci MUX(0, "mout_uart1", mout_group1_p, SRC_PERIC0, 4, 4), 32462306a36Sopenharmony_ci MUX(0, "mout_uart2", mout_group1_p, SRC_PERIC0, 8, 4), 32562306a36Sopenharmony_ci MUX(0, "mout_uart3", mout_group1_p, SRC_PERIC0, 12, 4), 32662306a36Sopenharmony_ci MUX(0, "mout_pwm", mout_group1_p, SRC_PERIC0, 24, 4), 32762306a36Sopenharmony_ci 32862306a36Sopenharmony_ci MUX(0, "mout_audio1", mout_audio1_p, SRC_PERIC1, 0, 4), 32962306a36Sopenharmony_ci MUX(0, "mout_audio2", mout_audio2_p, SRC_PERIC1, 4, 4), 33062306a36Sopenharmony_ci MUX(0, "mout_spdif", mout_spdif_p, SRC_PERIC1, 8, 2), 33162306a36Sopenharmony_ci MUX(0, "mout_spi0", mout_group1_p, SRC_PERIC1, 16, 4), 33262306a36Sopenharmony_ci MUX(0, "mout_spi1", mout_group1_p, SRC_PERIC1, 20, 4), 33362306a36Sopenharmony_ci MUX(0, "mout_spi2", mout_group1_p, SRC_PERIC1, 24, 4), 33462306a36Sopenharmony_ci 33562306a36Sopenharmony_ci /* 33662306a36Sopenharmony_ci * CMU_CDREX 33762306a36Sopenharmony_ci */ 33862306a36Sopenharmony_ci MUX(0, "mout_bpll", mout_bpll_p, SRC_CDREX, 0, 1), 33962306a36Sopenharmony_ci 34062306a36Sopenharmony_ci MUX(0, "mout_mpll_fout", mout_mpll_fout_p, PLL_DIV2_SEL, 4, 1), 34162306a36Sopenharmony_ci MUX(0, "mout_bpll_fout", mout_bpll_fout_p, PLL_DIV2_SEL, 0, 1), 34262306a36Sopenharmony_ci}; 34362306a36Sopenharmony_ci 34462306a36Sopenharmony_cistatic const struct samsung_div_clock exynos5250_div_clks[] __initconst = { 34562306a36Sopenharmony_ci /* 34662306a36Sopenharmony_ci * NOTE: Following table is sorted by (clock domain, register address, 34762306a36Sopenharmony_ci * bitfield shift) triplet in ascending order. When adding new entries, 34862306a36Sopenharmony_ci * please make sure that the order is kept, to avoid merge conflicts 34962306a36Sopenharmony_ci * and make further work with defined data easier. 35062306a36Sopenharmony_ci */ 35162306a36Sopenharmony_ci 35262306a36Sopenharmony_ci /* 35362306a36Sopenharmony_ci * CMU_CPU 35462306a36Sopenharmony_ci */ 35562306a36Sopenharmony_ci DIV(0, "div_arm", "mout_cpu", DIV_CPU0, 0, 3), 35662306a36Sopenharmony_ci DIV(0, "div_apll", "mout_apll", DIV_CPU0, 24, 3), 35762306a36Sopenharmony_ci DIV(CLK_DIV_ARM2, "div_arm2", "div_arm", DIV_CPU0, 28, 3), 35862306a36Sopenharmony_ci 35962306a36Sopenharmony_ci /* 36062306a36Sopenharmony_ci * CMU_TOP 36162306a36Sopenharmony_ci */ 36262306a36Sopenharmony_ci DIV(0, "div_aclk66", "div_aclk66_pre", DIV_TOP0, 0, 3), 36362306a36Sopenharmony_ci DIV(0, "div_aclk166", "mout_aclk166", DIV_TOP0, 8, 3), 36462306a36Sopenharmony_ci DIV(0, "div_aclk200", "mout_aclk200", DIV_TOP0, 12, 3), 36562306a36Sopenharmony_ci DIV(0, "div_aclk266", "mout_mpll_user", DIV_TOP0, 16, 3), 36662306a36Sopenharmony_ci DIV(0, "div_aclk333", "mout_aclk333", DIV_TOP0, 20, 3), 36762306a36Sopenharmony_ci DIV(0, "div_aclk400_g3d", "mout_aclk400_g3d", DIV_TOP0, 36862306a36Sopenharmony_ci 24, 3), 36962306a36Sopenharmony_ci DIV(0, "div_aclk300_disp", "mout_aclk300", DIV_TOP0, 28, 3), 37062306a36Sopenharmony_ci 37162306a36Sopenharmony_ci DIV(0, "div_aclk400_isp", "mout_aclk400_isp", DIV_TOP1, 20, 3), 37262306a36Sopenharmony_ci DIV(0, "div_aclk66_pre", "mout_mpll_user", DIV_TOP1, 24, 3), 37362306a36Sopenharmony_ci 37462306a36Sopenharmony_ci DIV(0, "div_cam_bayer", "mout_cam_bayer", DIV_GSCL, 12, 4), 37562306a36Sopenharmony_ci DIV(0, "div_cam0", "mout_cam0", DIV_GSCL, 16, 4), 37662306a36Sopenharmony_ci DIV(0, "div_cam1", "mout_cam1", DIV_GSCL, 20, 4), 37762306a36Sopenharmony_ci DIV(0, "div_gscl_wa", "mout_gscl_wa", DIV_GSCL, 24, 4), 37862306a36Sopenharmony_ci DIV(0, "div_gscl_wb", "mout_gscl_wb", DIV_GSCL, 28, 4), 37962306a36Sopenharmony_ci 38062306a36Sopenharmony_ci DIV(0, "div_fimd1", "mout_fimd1", DIV_DISP1_0, 0, 4), 38162306a36Sopenharmony_ci DIV(0, "div_mipi1", "mout_mipi1", DIV_DISP1_0, 16, 4), 38262306a36Sopenharmony_ci DIV_F(0, "div_mipi1_pre", "div_mipi1", 38362306a36Sopenharmony_ci DIV_DISP1_0, 20, 4, CLK_SET_RATE_PARENT, 0), 38462306a36Sopenharmony_ci DIV(0, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4), 38562306a36Sopenharmony_ci DIV(CLK_SCLK_PIXEL, "div_hdmi_pixel", "mout_vpll", DIV_DISP1_0, 28, 4), 38662306a36Sopenharmony_ci 38762306a36Sopenharmony_ci DIV(0, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4), 38862306a36Sopenharmony_ci 38962306a36Sopenharmony_ci DIV(0, "div_audio0", "mout_audio0", DIV_MAU, 0, 4), 39062306a36Sopenharmony_ci DIV(CLK_DIV_PCM0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8), 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_ci DIV(0, "div_sata", "mout_sata", DIV_FSYS0, 20, 4), 39362306a36Sopenharmony_ci DIV(0, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4), 39462306a36Sopenharmony_ci 39562306a36Sopenharmony_ci DIV(0, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4), 39662306a36Sopenharmony_ci DIV_F(0, "div_mmc_pre0", "div_mmc0", 39762306a36Sopenharmony_ci DIV_FSYS1, 8, 8, CLK_SET_RATE_PARENT, 0), 39862306a36Sopenharmony_ci DIV(0, "div_mmc1", "mout_mmc1", DIV_FSYS1, 16, 4), 39962306a36Sopenharmony_ci DIV_F(0, "div_mmc_pre1", "div_mmc1", 40062306a36Sopenharmony_ci DIV_FSYS1, 24, 8, CLK_SET_RATE_PARENT, 0), 40162306a36Sopenharmony_ci 40262306a36Sopenharmony_ci DIV(0, "div_mmc2", "mout_mmc2", DIV_FSYS2, 0, 4), 40362306a36Sopenharmony_ci DIV_F(0, "div_mmc_pre2", "div_mmc2", 40462306a36Sopenharmony_ci DIV_FSYS2, 8, 8, CLK_SET_RATE_PARENT, 0), 40562306a36Sopenharmony_ci DIV(0, "div_mmc3", "mout_mmc3", DIV_FSYS2, 16, 4), 40662306a36Sopenharmony_ci DIV_F(0, "div_mmc_pre3", "div_mmc3", 40762306a36Sopenharmony_ci DIV_FSYS2, 24, 8, CLK_SET_RATE_PARENT, 0), 40862306a36Sopenharmony_ci 40962306a36Sopenharmony_ci DIV(0, "div_uart0", "mout_uart0", DIV_PERIC0, 0, 4), 41062306a36Sopenharmony_ci DIV(0, "div_uart1", "mout_uart1", DIV_PERIC0, 4, 4), 41162306a36Sopenharmony_ci DIV(0, "div_uart2", "mout_uart2", DIV_PERIC0, 8, 4), 41262306a36Sopenharmony_ci DIV(0, "div_uart3", "mout_uart3", DIV_PERIC0, 12, 4), 41362306a36Sopenharmony_ci 41462306a36Sopenharmony_ci DIV(0, "div_spi0", "mout_spi0", DIV_PERIC1, 0, 4), 41562306a36Sopenharmony_ci DIV_F(0, "div_spi_pre0", "div_spi0", 41662306a36Sopenharmony_ci DIV_PERIC1, 8, 8, CLK_SET_RATE_PARENT, 0), 41762306a36Sopenharmony_ci DIV(0, "div_spi1", "mout_spi1", DIV_PERIC1, 16, 4), 41862306a36Sopenharmony_ci DIV_F(0, "div_spi_pre1", "div_spi1", 41962306a36Sopenharmony_ci DIV_PERIC1, 24, 8, CLK_SET_RATE_PARENT, 0), 42062306a36Sopenharmony_ci 42162306a36Sopenharmony_ci DIV(0, "div_spi2", "mout_spi2", DIV_PERIC2, 0, 4), 42262306a36Sopenharmony_ci DIV_F(0, "div_spi_pre2", "div_spi2", 42362306a36Sopenharmony_ci DIV_PERIC2, 8, 8, CLK_SET_RATE_PARENT, 0), 42462306a36Sopenharmony_ci 42562306a36Sopenharmony_ci DIV(0, "div_pwm", "mout_pwm", DIV_PERIC3, 0, 4), 42662306a36Sopenharmony_ci 42762306a36Sopenharmony_ci DIV(0, "div_audio1", "mout_audio1", DIV_PERIC4, 0, 4), 42862306a36Sopenharmony_ci DIV(0, "div_pcm1", "sclk_audio1", DIV_PERIC4, 4, 8), 42962306a36Sopenharmony_ci DIV(0, "div_audio2", "mout_audio2", DIV_PERIC4, 16, 4), 43062306a36Sopenharmony_ci DIV(0, "div_pcm2", "sclk_audio2", DIV_PERIC4, 20, 8), 43162306a36Sopenharmony_ci 43262306a36Sopenharmony_ci DIV(CLK_DIV_I2S1, "div_i2s1", "sclk_audio1", DIV_PERIC5, 0, 6), 43362306a36Sopenharmony_ci DIV(CLK_DIV_I2S2, "div_i2s2", "sclk_audio2", DIV_PERIC5, 8, 6), 43462306a36Sopenharmony_ci}; 43562306a36Sopenharmony_ci 43662306a36Sopenharmony_cistatic const struct samsung_gate_clock exynos5250_gate_clks[] __initconst = { 43762306a36Sopenharmony_ci /* 43862306a36Sopenharmony_ci * NOTE: Following table is sorted by (clock domain, register address, 43962306a36Sopenharmony_ci * bitfield shift) triplet in ascending order. When adding new entries, 44062306a36Sopenharmony_ci * please make sure that the order is kept, to avoid merge conflicts 44162306a36Sopenharmony_ci * and make further work with defined data easier. 44262306a36Sopenharmony_ci */ 44362306a36Sopenharmony_ci 44462306a36Sopenharmony_ci /* 44562306a36Sopenharmony_ci * CMU_ACP 44662306a36Sopenharmony_ci */ 44762306a36Sopenharmony_ci GATE(CLK_MDMA0, "mdma0", "div_aclk266", GATE_IP_ACP, 1, 0, 0), 44862306a36Sopenharmony_ci GATE(CLK_SSS, "sss", "div_aclk266", GATE_IP_ACP, 2, 0, 0), 44962306a36Sopenharmony_ci GATE(CLK_G2D, "g2d", "div_aclk200", GATE_IP_ACP, 3, 0, 0), 45062306a36Sopenharmony_ci GATE(CLK_SMMU_MDMA0, "smmu_mdma0", "div_aclk266", GATE_IP_ACP, 5, 0, 0), 45162306a36Sopenharmony_ci 45262306a36Sopenharmony_ci /* 45362306a36Sopenharmony_ci * CMU_TOP 45462306a36Sopenharmony_ci */ 45562306a36Sopenharmony_ci GATE(CLK_SCLK_CAM_BAYER, "sclk_cam_bayer", "div_cam_bayer", 45662306a36Sopenharmony_ci SRC_MASK_GSCL, 12, CLK_SET_RATE_PARENT, 0), 45762306a36Sopenharmony_ci GATE(CLK_SCLK_CAM0, "sclk_cam0", "div_cam0", 45862306a36Sopenharmony_ci SRC_MASK_GSCL, 16, CLK_SET_RATE_PARENT, 0), 45962306a36Sopenharmony_ci GATE(CLK_SCLK_CAM1, "sclk_cam1", "div_cam1", 46062306a36Sopenharmony_ci SRC_MASK_GSCL, 20, CLK_SET_RATE_PARENT, 0), 46162306a36Sopenharmony_ci GATE(CLK_SCLK_GSCL_WA, "sclk_gscl_wa", "div_gscl_wa", 46262306a36Sopenharmony_ci SRC_MASK_GSCL, 24, CLK_SET_RATE_PARENT, 0), 46362306a36Sopenharmony_ci GATE(CLK_SCLK_GSCL_WB, "sclk_gscl_wb", "div_gscl_wb", 46462306a36Sopenharmony_ci SRC_MASK_GSCL, 28, CLK_SET_RATE_PARENT, 0), 46562306a36Sopenharmony_ci 46662306a36Sopenharmony_ci GATE(CLK_SCLK_FIMD1, "sclk_fimd1", "div_fimd1", 46762306a36Sopenharmony_ci SRC_MASK_DISP1_0, 0, CLK_SET_RATE_PARENT, 0), 46862306a36Sopenharmony_ci GATE(CLK_SCLK_MIPI1, "sclk_mipi1", "div_mipi1", 46962306a36Sopenharmony_ci SRC_MASK_DISP1_0, 12, CLK_SET_RATE_PARENT, 0), 47062306a36Sopenharmony_ci GATE(CLK_SCLK_DP, "sclk_dp", "div_dp", 47162306a36Sopenharmony_ci SRC_MASK_DISP1_0, 16, CLK_SET_RATE_PARENT, 0), 47262306a36Sopenharmony_ci GATE(CLK_SCLK_HDMI, "sclk_hdmi", "mout_hdmi", 47362306a36Sopenharmony_ci SRC_MASK_DISP1_0, 20, 0, 0), 47462306a36Sopenharmony_ci 47562306a36Sopenharmony_ci GATE(CLK_SCLK_AUDIO0, "sclk_audio0", "div_audio0", 47662306a36Sopenharmony_ci SRC_MASK_MAU, 0, CLK_SET_RATE_PARENT, 0), 47762306a36Sopenharmony_ci 47862306a36Sopenharmony_ci GATE(CLK_SCLK_MMC0, "sclk_mmc0", "div_mmc_pre0", 47962306a36Sopenharmony_ci SRC_MASK_FSYS, 0, CLK_SET_RATE_PARENT, 0), 48062306a36Sopenharmony_ci GATE(CLK_SCLK_MMC1, "sclk_mmc1", "div_mmc_pre1", 48162306a36Sopenharmony_ci SRC_MASK_FSYS, 4, CLK_SET_RATE_PARENT, 0), 48262306a36Sopenharmony_ci GATE(CLK_SCLK_MMC2, "sclk_mmc2", "div_mmc_pre2", 48362306a36Sopenharmony_ci SRC_MASK_FSYS, 8, CLK_SET_RATE_PARENT, 0), 48462306a36Sopenharmony_ci GATE(CLK_SCLK_MMC3, "sclk_mmc3", "div_mmc_pre3", 48562306a36Sopenharmony_ci SRC_MASK_FSYS, 12, CLK_SET_RATE_PARENT, 0), 48662306a36Sopenharmony_ci GATE(CLK_SCLK_SATA, "sclk_sata", "div_sata", 48762306a36Sopenharmony_ci SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0), 48862306a36Sopenharmony_ci GATE(CLK_SCLK_USB3, "sclk_usb3", "div_usb3", 48962306a36Sopenharmony_ci SRC_MASK_FSYS, 28, CLK_SET_RATE_PARENT, 0), 49062306a36Sopenharmony_ci 49162306a36Sopenharmony_ci GATE(CLK_SCLK_JPEG, "sclk_jpeg", "div_jpeg", 49262306a36Sopenharmony_ci SRC_MASK_GEN, 0, CLK_SET_RATE_PARENT, 0), 49362306a36Sopenharmony_ci 49462306a36Sopenharmony_ci GATE(CLK_SCLK_UART0, "sclk_uart0", "div_uart0", 49562306a36Sopenharmony_ci SRC_MASK_PERIC0, 0, CLK_SET_RATE_PARENT, 0), 49662306a36Sopenharmony_ci GATE(CLK_SCLK_UART1, "sclk_uart1", "div_uart1", 49762306a36Sopenharmony_ci SRC_MASK_PERIC0, 4, CLK_SET_RATE_PARENT, 0), 49862306a36Sopenharmony_ci GATE(CLK_SCLK_UART2, "sclk_uart2", "div_uart2", 49962306a36Sopenharmony_ci SRC_MASK_PERIC0, 8, CLK_SET_RATE_PARENT, 0), 50062306a36Sopenharmony_ci GATE(CLK_SCLK_UART3, "sclk_uart3", "div_uart3", 50162306a36Sopenharmony_ci SRC_MASK_PERIC0, 12, CLK_SET_RATE_PARENT, 0), 50262306a36Sopenharmony_ci GATE(CLK_SCLK_PWM, "sclk_pwm", "div_pwm", 50362306a36Sopenharmony_ci SRC_MASK_PERIC0, 24, CLK_SET_RATE_PARENT, 0), 50462306a36Sopenharmony_ci 50562306a36Sopenharmony_ci GATE(CLK_SCLK_AUDIO1, "sclk_audio1", "div_audio1", 50662306a36Sopenharmony_ci SRC_MASK_PERIC1, 0, CLK_SET_RATE_PARENT, 0), 50762306a36Sopenharmony_ci GATE(CLK_SCLK_AUDIO2, "sclk_audio2", "div_audio2", 50862306a36Sopenharmony_ci SRC_MASK_PERIC1, 4, CLK_SET_RATE_PARENT, 0), 50962306a36Sopenharmony_ci GATE(CLK_SCLK_SPDIF, "sclk_spdif", "mout_spdif", 51062306a36Sopenharmony_ci SRC_MASK_PERIC1, 4, 0, 0), 51162306a36Sopenharmony_ci GATE(CLK_SCLK_SPI0, "sclk_spi0", "div_spi_pre0", 51262306a36Sopenharmony_ci SRC_MASK_PERIC1, 16, CLK_SET_RATE_PARENT, 0), 51362306a36Sopenharmony_ci GATE(CLK_SCLK_SPI1, "sclk_spi1", "div_spi_pre1", 51462306a36Sopenharmony_ci SRC_MASK_PERIC1, 20, CLK_SET_RATE_PARENT, 0), 51562306a36Sopenharmony_ci GATE(CLK_SCLK_SPI2, "sclk_spi2", "div_spi_pre2", 51662306a36Sopenharmony_ci SRC_MASK_PERIC1, 24, CLK_SET_RATE_PARENT, 0), 51762306a36Sopenharmony_ci 51862306a36Sopenharmony_ci GATE(CLK_GSCL0, "gscl0", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 0, 0, 51962306a36Sopenharmony_ci 0), 52062306a36Sopenharmony_ci GATE(CLK_GSCL1, "gscl1", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 1, 0, 52162306a36Sopenharmony_ci 0), 52262306a36Sopenharmony_ci GATE(CLK_GSCL2, "gscl2", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 2, 0, 52362306a36Sopenharmony_ci 0), 52462306a36Sopenharmony_ci GATE(CLK_GSCL3, "gscl3", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 3, 0, 52562306a36Sopenharmony_ci 0), 52662306a36Sopenharmony_ci GATE(CLK_CAMIF_TOP, "camif_top", "mout_aclk266_gscl_sub", 52762306a36Sopenharmony_ci GATE_IP_GSCL, 4, 0, 0), 52862306a36Sopenharmony_ci GATE(CLK_GSCL_WA, "gscl_wa", "div_gscl_wa", GATE_IP_GSCL, 5, 0, 0), 52962306a36Sopenharmony_ci GATE(CLK_GSCL_WB, "gscl_wb", "div_gscl_wb", GATE_IP_GSCL, 6, 0, 0), 53062306a36Sopenharmony_ci GATE(CLK_SMMU_GSCL0, "smmu_gscl0", "mout_aclk266_gscl_sub", 53162306a36Sopenharmony_ci GATE_IP_GSCL, 7, 0, 0), 53262306a36Sopenharmony_ci GATE(CLK_SMMU_GSCL1, "smmu_gscl1", "mout_aclk266_gscl_sub", 53362306a36Sopenharmony_ci GATE_IP_GSCL, 8, 0, 0), 53462306a36Sopenharmony_ci GATE(CLK_SMMU_GSCL2, "smmu_gscl2", "mout_aclk266_gscl_sub", 53562306a36Sopenharmony_ci GATE_IP_GSCL, 9, 0, 0), 53662306a36Sopenharmony_ci GATE(CLK_SMMU_GSCL3, "smmu_gscl3", "mout_aclk266_gscl_sub", 53762306a36Sopenharmony_ci GATE_IP_GSCL, 10, 0, 0), 53862306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_LITE0, "smmu_fimc_lite0", "mout_aclk266_gscl_sub", 53962306a36Sopenharmony_ci GATE_IP_GSCL, 11, 0, 0), 54062306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_LITE1, "smmu_fimc_lite1", "mout_aclk266_gscl_sub", 54162306a36Sopenharmony_ci GATE_IP_GSCL, 12, 0, 0), 54262306a36Sopenharmony_ci 54362306a36Sopenharmony_ci 54462306a36Sopenharmony_ci GATE(CLK_MFC, "mfc", "mout_aclk333_sub", GATE_IP_MFC, 0, 0, 0), 54562306a36Sopenharmony_ci GATE(CLK_SMMU_MFCR, "smmu_mfcr", "mout_aclk333_sub", GATE_IP_MFC, 1, 0, 54662306a36Sopenharmony_ci 0), 54762306a36Sopenharmony_ci GATE(CLK_SMMU_MFCL, "smmu_mfcl", "mout_aclk333_sub", GATE_IP_MFC, 2, 0, 54862306a36Sopenharmony_ci 0), 54962306a36Sopenharmony_ci GATE(CLK_G3D, "g3d", "div_aclk400_g3d", GATE_IP_G3D, 0, 55062306a36Sopenharmony_ci CLK_SET_RATE_PARENT, 0), 55162306a36Sopenharmony_ci GATE(CLK_ROTATOR, "rotator", "div_aclk266", GATE_IP_GEN, 1, 0, 0), 55262306a36Sopenharmony_ci GATE(CLK_JPEG, "jpeg", "div_aclk166", GATE_IP_GEN, 2, 0, 0), 55362306a36Sopenharmony_ci GATE(CLK_MDMA1, "mdma1", "div_aclk266", GATE_IP_GEN, 4, 0, 0), 55462306a36Sopenharmony_ci GATE(CLK_SMMU_ROTATOR, "smmu_rotator", "div_aclk266", GATE_IP_GEN, 6, 0, 55562306a36Sopenharmony_ci 0), 55662306a36Sopenharmony_ci GATE(CLK_SMMU_JPEG, "smmu_jpeg", "div_aclk166", GATE_IP_GEN, 7, 0, 0), 55762306a36Sopenharmony_ci GATE(CLK_SMMU_MDMA1, "smmu_mdma1", "div_aclk266", GATE_IP_GEN, 9, 0, 0), 55862306a36Sopenharmony_ci 55962306a36Sopenharmony_ci GATE(CLK_PDMA0, "pdma0", "div_aclk200", GATE_IP_FSYS, 1, 0, 0), 56062306a36Sopenharmony_ci GATE(CLK_PDMA1, "pdma1", "div_aclk200", GATE_IP_FSYS, 2, 0, 0), 56162306a36Sopenharmony_ci GATE(CLK_SATA, "sata", "div_aclk200", GATE_IP_FSYS, 6, 0, 0), 56262306a36Sopenharmony_ci GATE(CLK_USBOTG, "usbotg", "div_aclk200", GATE_IP_FSYS, 7, 0, 0), 56362306a36Sopenharmony_ci GATE(CLK_MIPI_HSI, "mipi_hsi", "div_aclk200", GATE_IP_FSYS, 8, 0, 0), 56462306a36Sopenharmony_ci GATE(CLK_SDMMC0, "sdmmc0", "div_aclk200", GATE_IP_FSYS, 12, 0, 0), 56562306a36Sopenharmony_ci GATE(CLK_SDMMC1, "sdmmc1", "div_aclk200", GATE_IP_FSYS, 13, 0, 0), 56662306a36Sopenharmony_ci GATE(CLK_SDMMC2, "sdmmc2", "div_aclk200", GATE_IP_FSYS, 14, 0, 0), 56762306a36Sopenharmony_ci GATE(CLK_SDMMC3, "sdmmc3", "div_aclk200", GATE_IP_FSYS, 15, 0, 0), 56862306a36Sopenharmony_ci GATE(CLK_SROMC, "sromc", "div_aclk200", GATE_IP_FSYS, 17, 0, 0), 56962306a36Sopenharmony_ci GATE(CLK_USB2, "usb2", "div_aclk200", GATE_IP_FSYS, 18, 0, 0), 57062306a36Sopenharmony_ci GATE(CLK_USB3, "usb3", "div_aclk200", GATE_IP_FSYS, 19, 0, 0), 57162306a36Sopenharmony_ci GATE(CLK_SATA_PHYCTRL, "sata_phyctrl", "div_aclk200", 57262306a36Sopenharmony_ci GATE_IP_FSYS, 24, 0, 0), 57362306a36Sopenharmony_ci GATE(CLK_SATA_PHYI2C, "sata_phyi2c", "div_aclk200", GATE_IP_FSYS, 25, 0, 57462306a36Sopenharmony_ci 0), 57562306a36Sopenharmony_ci 57662306a36Sopenharmony_ci GATE(CLK_UART0, "uart0", "div_aclk66", GATE_IP_PERIC, 0, 0, 0), 57762306a36Sopenharmony_ci GATE(CLK_UART1, "uart1", "div_aclk66", GATE_IP_PERIC, 1, 0, 0), 57862306a36Sopenharmony_ci GATE(CLK_UART2, "uart2", "div_aclk66", GATE_IP_PERIC, 2, 0, 0), 57962306a36Sopenharmony_ci GATE(CLK_UART3, "uart3", "div_aclk66", GATE_IP_PERIC, 3, 0, 0), 58062306a36Sopenharmony_ci GATE(CLK_UART4, "uart4", "div_aclk66", GATE_IP_PERIC, 4, 0, 0), 58162306a36Sopenharmony_ci GATE(CLK_I2C0, "i2c0", "div_aclk66", GATE_IP_PERIC, 6, 0, 0), 58262306a36Sopenharmony_ci GATE(CLK_I2C1, "i2c1", "div_aclk66", GATE_IP_PERIC, 7, 0, 0), 58362306a36Sopenharmony_ci GATE(CLK_I2C2, "i2c2", "div_aclk66", GATE_IP_PERIC, 8, 0, 0), 58462306a36Sopenharmony_ci GATE(CLK_I2C3, "i2c3", "div_aclk66", GATE_IP_PERIC, 9, 0, 0), 58562306a36Sopenharmony_ci GATE(CLK_I2C4, "i2c4", "div_aclk66", GATE_IP_PERIC, 10, 0, 0), 58662306a36Sopenharmony_ci GATE(CLK_I2C5, "i2c5", "div_aclk66", GATE_IP_PERIC, 11, 0, 0), 58762306a36Sopenharmony_ci GATE(CLK_I2C6, "i2c6", "div_aclk66", GATE_IP_PERIC, 12, 0, 0), 58862306a36Sopenharmony_ci GATE(CLK_I2C7, "i2c7", "div_aclk66", GATE_IP_PERIC, 13, 0, 0), 58962306a36Sopenharmony_ci GATE(CLK_I2C_HDMI, "i2c_hdmi", "div_aclk66", GATE_IP_PERIC, 14, 0, 0), 59062306a36Sopenharmony_ci GATE(CLK_ADC, "adc", "div_aclk66", GATE_IP_PERIC, 15, 0, 0), 59162306a36Sopenharmony_ci GATE(CLK_SPI0, "spi0", "div_aclk66", GATE_IP_PERIC, 16, 0, 0), 59262306a36Sopenharmony_ci GATE(CLK_SPI1, "spi1", "div_aclk66", GATE_IP_PERIC, 17, 0, 0), 59362306a36Sopenharmony_ci GATE(CLK_SPI2, "spi2", "div_aclk66", GATE_IP_PERIC, 18, 0, 0), 59462306a36Sopenharmony_ci GATE(CLK_I2S1, "i2s1", "div_aclk66", GATE_IP_PERIC, 20, 0, 0), 59562306a36Sopenharmony_ci GATE(CLK_I2S2, "i2s2", "div_aclk66", GATE_IP_PERIC, 21, 0, 0), 59662306a36Sopenharmony_ci GATE(CLK_PCM1, "pcm1", "div_aclk66", GATE_IP_PERIC, 22, 0, 0), 59762306a36Sopenharmony_ci GATE(CLK_PCM2, "pcm2", "div_aclk66", GATE_IP_PERIC, 23, 0, 0), 59862306a36Sopenharmony_ci GATE(CLK_PWM, "pwm", "div_aclk66", GATE_IP_PERIC, 24, 0, 0), 59962306a36Sopenharmony_ci GATE(CLK_SPDIF, "spdif", "div_aclk66", GATE_IP_PERIC, 26, 0, 0), 60062306a36Sopenharmony_ci GATE(CLK_AC97, "ac97", "div_aclk66", GATE_IP_PERIC, 27, 0, 0), 60162306a36Sopenharmony_ci GATE(CLK_HSI2C0, "hsi2c0", "div_aclk66", GATE_IP_PERIC, 28, 0, 0), 60262306a36Sopenharmony_ci GATE(CLK_HSI2C1, "hsi2c1", "div_aclk66", GATE_IP_PERIC, 29, 0, 0), 60362306a36Sopenharmony_ci GATE(CLK_HSI2C2, "hsi2c2", "div_aclk66", GATE_IP_PERIC, 30, 0, 0), 60462306a36Sopenharmony_ci GATE(CLK_HSI2C3, "hsi2c3", "div_aclk66", GATE_IP_PERIC, 31, 0, 0), 60562306a36Sopenharmony_ci 60662306a36Sopenharmony_ci GATE(CLK_CHIPID, "chipid", "div_aclk66", GATE_IP_PERIS, 0, 0, 0), 60762306a36Sopenharmony_ci GATE(CLK_SYSREG, "sysreg", "div_aclk66", 60862306a36Sopenharmony_ci GATE_IP_PERIS, 1, CLK_IGNORE_UNUSED, 0), 60962306a36Sopenharmony_ci GATE(CLK_PMU, "pmu", "div_aclk66", GATE_IP_PERIS, 2, CLK_IGNORE_UNUSED, 61062306a36Sopenharmony_ci 0), 61162306a36Sopenharmony_ci GATE(CLK_CMU_TOP, "cmu_top", "div_aclk66", 61262306a36Sopenharmony_ci GATE_IP_PERIS, 3, CLK_IGNORE_UNUSED, 0), 61362306a36Sopenharmony_ci GATE(CLK_CMU_CORE, "cmu_core", "div_aclk66", 61462306a36Sopenharmony_ci GATE_IP_PERIS, 4, CLK_IGNORE_UNUSED, 0), 61562306a36Sopenharmony_ci GATE(CLK_CMU_MEM, "cmu_mem", "div_aclk66", 61662306a36Sopenharmony_ci GATE_IP_PERIS, 5, CLK_IGNORE_UNUSED, 0), 61762306a36Sopenharmony_ci GATE(CLK_TZPC0, "tzpc0", "div_aclk66", GATE_IP_PERIS, 6, 0, 0), 61862306a36Sopenharmony_ci GATE(CLK_TZPC1, "tzpc1", "div_aclk66", GATE_IP_PERIS, 7, 0, 0), 61962306a36Sopenharmony_ci GATE(CLK_TZPC2, "tzpc2", "div_aclk66", GATE_IP_PERIS, 8, 0, 0), 62062306a36Sopenharmony_ci GATE(CLK_TZPC3, "tzpc3", "div_aclk66", GATE_IP_PERIS, 9, 0, 0), 62162306a36Sopenharmony_ci GATE(CLK_TZPC4, "tzpc4", "div_aclk66", GATE_IP_PERIS, 10, 0, 0), 62262306a36Sopenharmony_ci GATE(CLK_TZPC5, "tzpc5", "div_aclk66", GATE_IP_PERIS, 11, 0, 0), 62362306a36Sopenharmony_ci GATE(CLK_TZPC6, "tzpc6", "div_aclk66", GATE_IP_PERIS, 12, 0, 0), 62462306a36Sopenharmony_ci GATE(CLK_TZPC7, "tzpc7", "div_aclk66", GATE_IP_PERIS, 13, 0, 0), 62562306a36Sopenharmony_ci GATE(CLK_TZPC8, "tzpc8", "div_aclk66", GATE_IP_PERIS, 14, 0, 0), 62662306a36Sopenharmony_ci GATE(CLK_TZPC9, "tzpc9", "div_aclk66", GATE_IP_PERIS, 15, 0, 0), 62762306a36Sopenharmony_ci GATE(CLK_HDMI_CEC, "hdmi_cec", "div_aclk66", GATE_IP_PERIS, 16, 0, 0), 62862306a36Sopenharmony_ci GATE(CLK_MCT, "mct", "div_aclk66", GATE_IP_PERIS, 18, 0, 0), 62962306a36Sopenharmony_ci GATE(CLK_WDT, "wdt", "div_aclk66", GATE_IP_PERIS, 19, 0, 0), 63062306a36Sopenharmony_ci GATE(CLK_RTC, "rtc", "div_aclk66", GATE_IP_PERIS, 20, 0, 0), 63162306a36Sopenharmony_ci GATE(CLK_TMU, "tmu", "div_aclk66", GATE_IP_PERIS, 21, 0, 0), 63262306a36Sopenharmony_ci GATE(CLK_SMMU_2D, "smmu_2d", "div_aclk200", GATE_IP_ACP, 7, 0, 0), 63362306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_ISP, "smmu_fimc_isp", "mout_aclk_266_isp_sub", 63462306a36Sopenharmony_ci GATE_IP_ISP0, 8, 0, 0), 63562306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_DRC, "smmu_fimc_drc", "mout_aclk_266_isp_sub", 63662306a36Sopenharmony_ci GATE_IP_ISP0, 9, 0, 0), 63762306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_FD, "smmu_fimc_fd", "mout_aclk_266_isp_sub", 63862306a36Sopenharmony_ci GATE_IP_ISP0, 10, 0, 0), 63962306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_SCC, "smmu_fimc_scc", "mout_aclk_266_isp_sub", 64062306a36Sopenharmony_ci GATE_IP_ISP0, 11, 0, 0), 64162306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_SCP, "smmu_fimc_scp", "mout_aclk_266_isp_sub", 64262306a36Sopenharmony_ci GATE_IP_ISP0, 12, 0, 0), 64362306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_MCU, "smmu_fimc_mcu", "mout_aclk_400_isp_sub", 64462306a36Sopenharmony_ci GATE_IP_ISP0, 13, 0, 0), 64562306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_ODC, "smmu_fimc_odc", "mout_aclk_266_isp_sub", 64662306a36Sopenharmony_ci GATE_IP_ISP1, 4, 0, 0), 64762306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_DIS0, "smmu_fimc_dis0", "mout_aclk_266_isp_sub", 64862306a36Sopenharmony_ci GATE_IP_ISP1, 5, 0, 0), 64962306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_DIS1, "smmu_fimc_dis1", "mout_aclk_266_isp_sub", 65062306a36Sopenharmony_ci GATE_IP_ISP1, 6, 0, 0), 65162306a36Sopenharmony_ci GATE(CLK_SMMU_FIMC_3DNR, "smmu_fimc_3dnr", "mout_aclk_266_isp_sub", 65262306a36Sopenharmony_ci GATE_IP_ISP1, 7, 0, 0), 65362306a36Sopenharmony_ci}; 65462306a36Sopenharmony_ci 65562306a36Sopenharmony_cistatic const struct samsung_gate_clock exynos5250_disp_gate_clks[] __initconst = { 65662306a36Sopenharmony_ci GATE(CLK_FIMD1, "fimd1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 0, 0, 65762306a36Sopenharmony_ci 0), 65862306a36Sopenharmony_ci GATE(CLK_MIE1, "mie1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 1, 0, 65962306a36Sopenharmony_ci 0), 66062306a36Sopenharmony_ci GATE(CLK_DSIM0, "dsim0", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 3, 0, 66162306a36Sopenharmony_ci 0), 66262306a36Sopenharmony_ci GATE(CLK_DP, "dp", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 4, 0, 0), 66362306a36Sopenharmony_ci GATE(CLK_MIXER, "mixer", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 5, 0, 66462306a36Sopenharmony_ci 0), 66562306a36Sopenharmony_ci GATE(CLK_HDMI, "hdmi", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 6, 0, 66662306a36Sopenharmony_ci 0), 66762306a36Sopenharmony_ci GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub", 66862306a36Sopenharmony_ci GATE_IP_DISP1, 9, 0, 0), 66962306a36Sopenharmony_ci GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub", 67062306a36Sopenharmony_ci GATE_IP_DISP1, 8, 0, 0), 67162306a36Sopenharmony_ci}; 67262306a36Sopenharmony_ci 67362306a36Sopenharmony_cistatic struct exynos5_subcmu_reg_dump exynos5250_disp_suspend_regs[] = { 67462306a36Sopenharmony_ci { GATE_IP_DISP1, 0xffffffff, 0xffffffff }, /* DISP1 gates */ 67562306a36Sopenharmony_ci { SRC_TOP3, 0, BIT(4) }, /* MUX mout_aclk200_disp1_sub */ 67662306a36Sopenharmony_ci { SRC_TOP3, 0, BIT(6) }, /* MUX mout_aclk300_disp1_sub */ 67762306a36Sopenharmony_ci}; 67862306a36Sopenharmony_ci 67962306a36Sopenharmony_cistatic const struct exynos5_subcmu_info exynos5250_disp_subcmu = { 68062306a36Sopenharmony_ci .gate_clks = exynos5250_disp_gate_clks, 68162306a36Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(exynos5250_disp_gate_clks), 68262306a36Sopenharmony_ci .suspend_regs = exynos5250_disp_suspend_regs, 68362306a36Sopenharmony_ci .nr_suspend_regs = ARRAY_SIZE(exynos5250_disp_suspend_regs), 68462306a36Sopenharmony_ci .pd_name = "DISP1", 68562306a36Sopenharmony_ci}; 68662306a36Sopenharmony_ci 68762306a36Sopenharmony_cistatic const struct exynos5_subcmu_info *exynos5250_subcmus[] = { 68862306a36Sopenharmony_ci &exynos5250_disp_subcmu, 68962306a36Sopenharmony_ci}; 69062306a36Sopenharmony_ci 69162306a36Sopenharmony_cistatic const struct samsung_pll_rate_table vpll_24mhz_tbl[] __initconst = { 69262306a36Sopenharmony_ci /* sorted in descending order */ 69362306a36Sopenharmony_ci /* PLL_36XX_RATE(rate, m, p, s, k) */ 69462306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 266000000, 266, 3, 3, 0), 69562306a36Sopenharmony_ci /* Not in UM, but need for eDP on snow */ 69662306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 70500000, 94, 2, 4, 0), 69762306a36Sopenharmony_ci { }, 69862306a36Sopenharmony_ci}; 69962306a36Sopenharmony_ci 70062306a36Sopenharmony_cistatic const struct samsung_pll_rate_table epll_24mhz_tbl[] __initconst = { 70162306a36Sopenharmony_ci /* sorted in descending order */ 70262306a36Sopenharmony_ci /* PLL_36XX_RATE(rate, m, p, s, k) */ 70362306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 192000000, 64, 2, 2, 0), 70462306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 180633605, 90, 3, 2, 20762), 70562306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 180000000, 90, 3, 2, 0), 70662306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 73728000, 98, 2, 4, 19923), 70762306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 67737602, 90, 2, 4, 20762), 70862306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 49152000, 98, 3, 4, 19923), 70962306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 45158401, 90, 3, 4, 20762), 71062306a36Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 32768001, 131, 3, 5, 4719), 71162306a36Sopenharmony_ci { }, 71262306a36Sopenharmony_ci}; 71362306a36Sopenharmony_ci 71462306a36Sopenharmony_cistatic const struct samsung_pll_rate_table apll_24mhz_tbl[] __initconst = { 71562306a36Sopenharmony_ci /* sorted in descending order */ 71662306a36Sopenharmony_ci /* PLL_35XX_RATE(fin, rate, m, p, s) */ 71762306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1700000000, 425, 6, 0), 71862306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1600000000, 200, 3, 0), 71962306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1500000000, 250, 4, 0), 72062306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1400000000, 175, 3, 0), 72162306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1300000000, 325, 6, 0), 72262306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1200000000, 200, 4, 0), 72362306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1100000000, 275, 6, 0), 72462306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 1000000000, 125, 3, 0), 72562306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 900000000, 150, 4, 0), 72662306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 800000000, 100, 3, 0), 72762306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 700000000, 175, 3, 1), 72862306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 600000000, 200, 4, 1), 72962306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 500000000, 125, 3, 1), 73062306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 400000000, 100, 3, 1), 73162306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 300000000, 200, 4, 2), 73262306a36Sopenharmony_ci PLL_35XX_RATE(24 * MHZ, 200000000, 100, 3, 2), 73362306a36Sopenharmony_ci}; 73462306a36Sopenharmony_ci 73562306a36Sopenharmony_cistatic struct samsung_pll_clock exynos5250_plls[nr_plls] __initdata = { 73662306a36Sopenharmony_ci [apll] = PLL(pll_35xx, CLK_FOUT_APLL, "fout_apll", "fin_pll", APLL_LOCK, 73762306a36Sopenharmony_ci APLL_CON0, NULL), 73862306a36Sopenharmony_ci [mpll] = PLL(pll_35xx, CLK_FOUT_MPLL, "fout_mpll", "fin_pll", MPLL_LOCK, 73962306a36Sopenharmony_ci MPLL_CON0, NULL), 74062306a36Sopenharmony_ci [bpll] = PLL(pll_35xx, CLK_FOUT_BPLL, "fout_bpll", "fin_pll", BPLL_LOCK, 74162306a36Sopenharmony_ci BPLL_CON0, NULL), 74262306a36Sopenharmony_ci [gpll] = PLL(pll_35xx, CLK_FOUT_GPLL, "fout_gpll", "fin_pll", GPLL_LOCK, 74362306a36Sopenharmony_ci GPLL_CON0, NULL), 74462306a36Sopenharmony_ci [cpll] = PLL(pll_35xx, CLK_FOUT_CPLL, "fout_cpll", "fin_pll", CPLL_LOCK, 74562306a36Sopenharmony_ci CPLL_CON0, NULL), 74662306a36Sopenharmony_ci [epll] = PLL(pll_36xx, CLK_FOUT_EPLL, "fout_epll", "fin_pll", EPLL_LOCK, 74762306a36Sopenharmony_ci EPLL_CON0, NULL), 74862306a36Sopenharmony_ci [vpll] = PLL(pll_36xx, CLK_FOUT_VPLL, "fout_vpll", "mout_vpllsrc", 74962306a36Sopenharmony_ci VPLL_LOCK, VPLL_CON0, NULL), 75062306a36Sopenharmony_ci}; 75162306a36Sopenharmony_ci 75262306a36Sopenharmony_ci#define E5250_CPU_DIV0(apll, pclk_dbg, atb, periph, acp, cpud) \ 75362306a36Sopenharmony_ci ((((apll) << 24) | ((pclk_dbg) << 20) | ((atb) << 16) | \ 75462306a36Sopenharmony_ci ((periph) << 12) | ((acp) << 8) | ((cpud) << 4))) 75562306a36Sopenharmony_ci#define E5250_CPU_DIV1(hpm, copy) \ 75662306a36Sopenharmony_ci (((hpm) << 4) | (copy)) 75762306a36Sopenharmony_ci 75862306a36Sopenharmony_cistatic const struct exynos_cpuclk_cfg_data exynos5250_armclk_d[] __initconst = { 75962306a36Sopenharmony_ci { 1700000, E5250_CPU_DIV0(5, 3, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 76062306a36Sopenharmony_ci { 1600000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 76162306a36Sopenharmony_ci { 1500000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 76262306a36Sopenharmony_ci { 1400000, E5250_CPU_DIV0(4, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 76362306a36Sopenharmony_ci { 1300000, E5250_CPU_DIV0(3, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 76462306a36Sopenharmony_ci { 1200000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 76562306a36Sopenharmony_ci { 1100000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 76662306a36Sopenharmony_ci { 1000000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 76762306a36Sopenharmony_ci { 900000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 76862306a36Sopenharmony_ci { 800000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 76962306a36Sopenharmony_ci { 700000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 77062306a36Sopenharmony_ci { 600000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 77162306a36Sopenharmony_ci { 500000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 77262306a36Sopenharmony_ci { 400000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 77362306a36Sopenharmony_ci { 300000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 77462306a36Sopenharmony_ci { 200000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 77562306a36Sopenharmony_ci { 0 }, 77662306a36Sopenharmony_ci}; 77762306a36Sopenharmony_ci 77862306a36Sopenharmony_cistatic const struct samsung_cpu_clock exynos5250_cpu_clks[] __initconst = { 77962306a36Sopenharmony_ci CPU_CLK(CLK_ARM_CLK, "armclk", CLK_MOUT_APLL, CLK_MOUT_MPLL, CLK_CPU_HAS_DIV1, 0x200, 78062306a36Sopenharmony_ci exynos5250_armclk_d), 78162306a36Sopenharmony_ci}; 78262306a36Sopenharmony_ci 78362306a36Sopenharmony_cistatic const struct of_device_id ext_clk_match[] __initconst = { 78462306a36Sopenharmony_ci { .compatible = "samsung,clock-xxti", .data = (void *)0, }, 78562306a36Sopenharmony_ci { }, 78662306a36Sopenharmony_ci}; 78762306a36Sopenharmony_ci 78862306a36Sopenharmony_ci/* register exynox5250 clocks */ 78962306a36Sopenharmony_cistatic void __init exynos5250_clk_init(struct device_node *np) 79062306a36Sopenharmony_ci{ 79162306a36Sopenharmony_ci struct samsung_clk_provider *ctx; 79262306a36Sopenharmony_ci unsigned int tmp; 79362306a36Sopenharmony_ci struct clk_hw **hws; 79462306a36Sopenharmony_ci 79562306a36Sopenharmony_ci if (np) { 79662306a36Sopenharmony_ci reg_base = of_iomap(np, 0); 79762306a36Sopenharmony_ci if (!reg_base) 79862306a36Sopenharmony_ci panic("%s: failed to map registers\n", __func__); 79962306a36Sopenharmony_ci } else { 80062306a36Sopenharmony_ci panic("%s: unable to determine soc\n", __func__); 80162306a36Sopenharmony_ci } 80262306a36Sopenharmony_ci 80362306a36Sopenharmony_ci ctx = samsung_clk_init(NULL, reg_base, CLKS_NR); 80462306a36Sopenharmony_ci hws = ctx->clk_data.hws; 80562306a36Sopenharmony_ci 80662306a36Sopenharmony_ci samsung_clk_of_register_fixed_ext(ctx, exynos5250_fixed_rate_ext_clks, 80762306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_fixed_rate_ext_clks), 80862306a36Sopenharmony_ci ext_clk_match); 80962306a36Sopenharmony_ci samsung_clk_register_mux(ctx, exynos5250_pll_pmux_clks, 81062306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_pll_pmux_clks)); 81162306a36Sopenharmony_ci 81262306a36Sopenharmony_ci if (clk_hw_get_rate(hws[CLK_FIN_PLL]) == 24 * MHZ) { 81362306a36Sopenharmony_ci exynos5250_plls[epll].rate_table = epll_24mhz_tbl; 81462306a36Sopenharmony_ci exynos5250_plls[apll].rate_table = apll_24mhz_tbl; 81562306a36Sopenharmony_ci } 81662306a36Sopenharmony_ci 81762306a36Sopenharmony_ci if (clk_hw_get_rate(hws[CLK_MOUT_VPLLSRC]) == 24 * MHZ) 81862306a36Sopenharmony_ci exynos5250_plls[vpll].rate_table = vpll_24mhz_tbl; 81962306a36Sopenharmony_ci 82062306a36Sopenharmony_ci samsung_clk_register_pll(ctx, exynos5250_plls, 82162306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_plls)); 82262306a36Sopenharmony_ci samsung_clk_register_fixed_rate(ctx, exynos5250_fixed_rate_clks, 82362306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_fixed_rate_clks)); 82462306a36Sopenharmony_ci samsung_clk_register_fixed_factor(ctx, exynos5250_fixed_factor_clks, 82562306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_fixed_factor_clks)); 82662306a36Sopenharmony_ci samsung_clk_register_mux(ctx, exynos5250_mux_clks, 82762306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_mux_clks)); 82862306a36Sopenharmony_ci samsung_clk_register_div(ctx, exynos5250_div_clks, 82962306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_div_clks)); 83062306a36Sopenharmony_ci samsung_clk_register_gate(ctx, exynos5250_gate_clks, 83162306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_gate_clks)); 83262306a36Sopenharmony_ci samsung_clk_register_cpu(ctx, exynos5250_cpu_clks, 83362306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_cpu_clks)); 83462306a36Sopenharmony_ci 83562306a36Sopenharmony_ci /* 83662306a36Sopenharmony_ci * Enable arm clock down (in idle) and set arm divider 83762306a36Sopenharmony_ci * ratios in WFI/WFE state. 83862306a36Sopenharmony_ci */ 83962306a36Sopenharmony_ci tmp = (PWR_CTRL1_CORE2_DOWN_RATIO | PWR_CTRL1_CORE1_DOWN_RATIO | 84062306a36Sopenharmony_ci PWR_CTRL1_DIV2_DOWN_EN | PWR_CTRL1_DIV1_DOWN_EN | 84162306a36Sopenharmony_ci PWR_CTRL1_USE_CORE1_WFE | PWR_CTRL1_USE_CORE0_WFE | 84262306a36Sopenharmony_ci PWR_CTRL1_USE_CORE1_WFI | PWR_CTRL1_USE_CORE0_WFI); 84362306a36Sopenharmony_ci __raw_writel(tmp, reg_base + PWR_CTRL1); 84462306a36Sopenharmony_ci 84562306a36Sopenharmony_ci /* 84662306a36Sopenharmony_ci * Enable arm clock up (on exiting idle). Set arm divider 84762306a36Sopenharmony_ci * ratios when not in idle along with the standby duration 84862306a36Sopenharmony_ci * ratios. 84962306a36Sopenharmony_ci */ 85062306a36Sopenharmony_ci tmp = (PWR_CTRL2_DIV2_UP_EN | PWR_CTRL2_DIV1_UP_EN | 85162306a36Sopenharmony_ci PWR_CTRL2_DUR_STANDBY2_VAL | PWR_CTRL2_DUR_STANDBY1_VAL | 85262306a36Sopenharmony_ci PWR_CTRL2_CORE2_UP_RATIO | PWR_CTRL2_CORE1_UP_RATIO); 85362306a36Sopenharmony_ci __raw_writel(tmp, reg_base + PWR_CTRL2); 85462306a36Sopenharmony_ci 85562306a36Sopenharmony_ci samsung_clk_sleep_init(reg_base, exynos5250_clk_regs, 85662306a36Sopenharmony_ci ARRAY_SIZE(exynos5250_clk_regs)); 85762306a36Sopenharmony_ci exynos5_subcmus_init(ctx, ARRAY_SIZE(exynos5250_subcmus), 85862306a36Sopenharmony_ci exynos5250_subcmus); 85962306a36Sopenharmony_ci 86062306a36Sopenharmony_ci samsung_clk_of_add_provider(np, ctx); 86162306a36Sopenharmony_ci 86262306a36Sopenharmony_ci pr_info("Exynos5250: clock setup completed, armclk=%ld\n", 86362306a36Sopenharmony_ci clk_hw_get_rate(hws[CLK_DIV_ARM2])); 86462306a36Sopenharmony_ci} 86562306a36Sopenharmony_ciCLK_OF_DECLARE_DRIVER(exynos5250_clk, "samsung,exynos5250-clock", exynos5250_clk_init); 866