blob: 6a45c9a9abe9115503ffcac36c4baca4d22c563f [file] [log] [blame]
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001/*
Kukjin Kima8550392012-03-09 14:19:10 -08002 * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09003 * http://www.samsung.com
Changhwan Younc8bef142010-07-27 17:52:39 +09004 *
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09005 * EXYNOS4 - Clock support
Changhwan Younc8bef142010-07-27 17:52:39 +09006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/err.h>
14#include <linux/io.h>
Jonghwan Choiacd35612011-08-24 21:52:45 +090015#include <linux/syscore_ops.h>
Changhwan Younc8bef142010-07-27 17:52:39 +090016
17#include <plat/cpu-freq.h>
18#include <plat/clock.h>
19#include <plat/cpu.h>
20#include <plat/pll.h>
21#include <plat/s5p-clock.h>
22#include <plat/clock-clksrc.h>
Jonghwan Choiacd35612011-08-24 21:52:45 +090023#include <plat/pm.h>
Changhwan Younc8bef142010-07-27 17:52:39 +090024
25#include <mach/map.h>
26#include <mach/regs-clock.h>
KyongHo Chob0b6ff02011-03-07 09:10:24 +090027#include <mach/sysmmu.h>
Changhwan Younc8bef142010-07-27 17:52:39 +090028
Kukjin Kimcc511b82011-12-27 08:18:36 +010029#include "common.h"
Kukjin Kimce9c00e2012-03-09 13:51:24 -080030#include "clock-exynos4.h"
Kukjin Kimcc511b82011-12-27 08:18:36 +010031
Kukjin Kim7cdf04d2012-01-27 14:56:17 +090032#ifdef CONFIG_PM_SLEEP
Jonghwan Choiacd35612011-08-24 21:52:45 +090033static struct sleep_save exynos4_clock_save[] = {
Kukjin Kima8550392012-03-09 14:19:10 -080034 SAVE_ITEM(EXYNOS4_CLKDIV_LEFTBUS),
35 SAVE_ITEM(EXYNOS4_CLKGATE_IP_LEFTBUS),
36 SAVE_ITEM(EXYNOS4_CLKDIV_RIGHTBUS),
37 SAVE_ITEM(EXYNOS4_CLKGATE_IP_RIGHTBUS),
38 SAVE_ITEM(EXYNOS4_CLKSRC_TOP0),
39 SAVE_ITEM(EXYNOS4_CLKSRC_TOP1),
40 SAVE_ITEM(EXYNOS4_CLKSRC_CAM),
41 SAVE_ITEM(EXYNOS4_CLKSRC_TV),
42 SAVE_ITEM(EXYNOS4_CLKSRC_MFC),
43 SAVE_ITEM(EXYNOS4_CLKSRC_G3D),
44 SAVE_ITEM(EXYNOS4_CLKSRC_LCD0),
45 SAVE_ITEM(EXYNOS4_CLKSRC_MAUDIO),
46 SAVE_ITEM(EXYNOS4_CLKSRC_FSYS),
47 SAVE_ITEM(EXYNOS4_CLKSRC_PERIL0),
48 SAVE_ITEM(EXYNOS4_CLKSRC_PERIL1),
49 SAVE_ITEM(EXYNOS4_CLKDIV_CAM),
50 SAVE_ITEM(EXYNOS4_CLKDIV_TV),
51 SAVE_ITEM(EXYNOS4_CLKDIV_MFC),
52 SAVE_ITEM(EXYNOS4_CLKDIV_G3D),
53 SAVE_ITEM(EXYNOS4_CLKDIV_LCD0),
54 SAVE_ITEM(EXYNOS4_CLKDIV_MAUDIO),
55 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS0),
56 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS1),
57 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS2),
58 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS3),
59 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL0),
60 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL1),
61 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL2),
62 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL3),
63 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL4),
64 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL5),
65 SAVE_ITEM(EXYNOS4_CLKDIV_TOP),
66 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_TOP),
67 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_CAM),
68 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_TV),
69 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_LCD0),
70 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_MAUDIO),
71 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_FSYS),
72 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_PERIL0),
73 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_PERIL1),
74 SAVE_ITEM(EXYNOS4_CLKDIV2_RATIO),
75 SAVE_ITEM(EXYNOS4_CLKGATE_SCLKCAM),
76 SAVE_ITEM(EXYNOS4_CLKGATE_IP_CAM),
77 SAVE_ITEM(EXYNOS4_CLKGATE_IP_TV),
78 SAVE_ITEM(EXYNOS4_CLKGATE_IP_MFC),
79 SAVE_ITEM(EXYNOS4_CLKGATE_IP_G3D),
80 SAVE_ITEM(EXYNOS4_CLKGATE_IP_LCD0),
81 SAVE_ITEM(EXYNOS4_CLKGATE_IP_FSYS),
82 SAVE_ITEM(EXYNOS4_CLKGATE_IP_GPS),
83 SAVE_ITEM(EXYNOS4_CLKGATE_IP_PERIL),
84 SAVE_ITEM(EXYNOS4_CLKGATE_BLOCK),
85 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_DMC),
86 SAVE_ITEM(EXYNOS4_CLKSRC_DMC),
87 SAVE_ITEM(EXYNOS4_CLKDIV_DMC0),
88 SAVE_ITEM(EXYNOS4_CLKDIV_DMC1),
89 SAVE_ITEM(EXYNOS4_CLKGATE_IP_DMC),
90 SAVE_ITEM(EXYNOS4_CLKSRC_CPU),
91 SAVE_ITEM(EXYNOS4_CLKDIV_CPU),
92 SAVE_ITEM(EXYNOS4_CLKDIV_CPU + 0x4),
93 SAVE_ITEM(EXYNOS4_CLKGATE_SCLKCPU),
94 SAVE_ITEM(EXYNOS4_CLKGATE_IP_CPU),
Jonghwan Choiacd35612011-08-24 21:52:45 +090095};
Kukjin Kim7cdf04d2012-01-27 14:56:17 +090096#endif
Jonghwan Choiacd35612011-08-24 21:52:45 +090097
Kukjin Kima8550392012-03-09 14:19:10 -080098static struct clk exynos4_clk_sclk_hdmi27m = {
Changhwan Younc8bef142010-07-27 17:52:39 +090099 .name = "sclk_hdmi27m",
Changhwan Younc8bef142010-07-27 17:52:39 +0900100 .rate = 27000000,
101};
102
Kukjin Kima8550392012-03-09 14:19:10 -0800103static struct clk exynos4_clk_sclk_hdmiphy = {
Jongpill Leeb99380e2010-08-18 22:16:45 +0900104 .name = "sclk_hdmiphy",
Jongpill Leeb99380e2010-08-18 22:16:45 +0900105};
106
Kukjin Kima8550392012-03-09 14:19:10 -0800107static struct clk exynos4_clk_sclk_usbphy0 = {
Jongpill Leeb99380e2010-08-18 22:16:45 +0900108 .name = "sclk_usbphy0",
Jongpill Leeb99380e2010-08-18 22:16:45 +0900109 .rate = 27000000,
110};
111
Kukjin Kima8550392012-03-09 14:19:10 -0800112static struct clk exynos4_clk_sclk_usbphy1 = {
Jongpill Leeb99380e2010-08-18 22:16:45 +0900113 .name = "sclk_usbphy1",
Jongpill Leeb99380e2010-08-18 22:16:45 +0900114};
115
Boojin Kimbf856fb2011-09-02 09:44:36 +0900116static struct clk dummy_apb_pclk = {
117 .name = "apb_pclk",
118 .id = -1,
119};
120
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900121static int exynos4_clksrc_mask_top_ctrl(struct clk *clk, int enable)
Jongpill Lee37e01722010-08-18 22:33:43 +0900122{
Kukjin Kima8550392012-03-09 14:19:10 -0800123 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_TOP, clk, enable);
Jongpill Lee37e01722010-08-18 22:33:43 +0900124}
125
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900126static int exynos4_clksrc_mask_cam_ctrl(struct clk *clk, int enable)
Jongpill Lee33f469d2010-08-18 22:54:48 +0900127{
Kukjin Kima8550392012-03-09 14:19:10 -0800128 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_CAM, clk, enable);
Jongpill Lee33f469d2010-08-18 22:54:48 +0900129}
130
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900131static int exynos4_clksrc_mask_lcd0_ctrl(struct clk *clk, int enable)
Jongpill Lee33f469d2010-08-18 22:54:48 +0900132{
Kukjin Kima8550392012-03-09 14:19:10 -0800133 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_LCD0, clk, enable);
Jongpill Lee33f469d2010-08-18 22:54:48 +0900134}
135
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900136int exynos4_clksrc_mask_fsys_ctrl(struct clk *clk, int enable)
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900137{
Kukjin Kima8550392012-03-09 14:19:10 -0800138 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_FSYS, clk, enable);
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900139}
140
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900141static int exynos4_clksrc_mask_peril0_ctrl(struct clk *clk, int enable)
Jongpill Lee3297c2e2010-08-27 17:53:26 +0900142{
Kukjin Kima8550392012-03-09 14:19:10 -0800143 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_PERIL0, clk, enable);
Jongpill Lee3297c2e2010-08-27 17:53:26 +0900144}
145
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900146static int exynos4_clksrc_mask_peril1_ctrl(struct clk *clk, int enable)
Jongpill Lee33f469d2010-08-18 22:54:48 +0900147{
Kukjin Kima8550392012-03-09 14:19:10 -0800148 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_PERIL1, clk, enable);
Jongpill Lee33f469d2010-08-18 22:54:48 +0900149}
150
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900151static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable)
152{
Kukjin Kima8550392012-03-09 14:19:10 -0800153 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_MFC, clk, enable);
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900154}
155
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900156static int exynos4_clksrc_mask_tv_ctrl(struct clk *clk, int enable)
157{
Kukjin Kima8550392012-03-09 14:19:10 -0800158 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_TV, clk, enable);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900159}
160
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900161static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900162{
Kukjin Kima8550392012-03-09 14:19:10 -0800163 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_CAM, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900164}
165
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900166static int exynos4_clk_ip_tv_ctrl(struct clk *clk, int enable)
167{
Kukjin Kima8550392012-03-09 14:19:10 -0800168 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_TV, clk, enable);
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900169}
170
KyongHo Chobca10b92012-04-04 09:23:02 -0700171int exynos4_clk_ip_image_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900172{
Kukjin Kima8550392012-03-09 14:19:10 -0800173 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_IMAGE, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900174}
175
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900176static int exynos4_clk_ip_lcd0_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900177{
Kukjin Kima8550392012-03-09 14:19:10 -0800178 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_LCD0, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900179}
180
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900181int exynos4_clk_ip_lcd1_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900182{
Kukjin Kima8550392012-03-09 14:19:10 -0800183 return s5p_gatectrl(EXYNOS4210_CLKGATE_IP_LCD1, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900184}
185
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900186int exynos4_clk_ip_fsys_ctrl(struct clk *clk, int enable)
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900187{
Kukjin Kima8550392012-03-09 14:19:10 -0800188 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_FSYS, clk, enable);
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900189}
190
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900191static int exynos4_clk_ip_peril_ctrl(struct clk *clk, int enable)
Jongpill Lee5a847b42010-08-27 16:50:47 +0900192{
Kukjin Kima8550392012-03-09 14:19:10 -0800193 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_PERIL, clk, enable);
Jongpill Lee5a847b42010-08-27 16:50:47 +0900194}
195
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900196static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900197{
Kukjin Kima8550392012-03-09 14:19:10 -0800198 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_PERIR, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900199}
200
KyongHo Chobca10b92012-04-04 09:23:02 -0700201int exynos4_clk_ip_dmc_ctrl(struct clk *clk, int enable)
202{
203 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_DMC, clk, enable);
204}
205
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900206static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
207{
208 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
209}
210
211static int exynos4_clk_dac_ctrl(struct clk *clk, int enable)
212{
213 return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable);
214}
215
Changhwan Younc8bef142010-07-27 17:52:39 +0900216/* Core list of CMU_CPU side */
217
Kukjin Kima8550392012-03-09 14:19:10 -0800218static struct clksrc_clk exynos4_clk_mout_apll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900219 .clk = {
220 .name = "mout_apll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900221 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800222 .sources = &clk_src_apll,
Kukjin Kima8550392012-03-09 14:19:10 -0800223 .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 0, .size = 1 },
Jongpill Lee3ff31022010-08-18 22:20:31 +0900224};
225
Kukjin Kima8550392012-03-09 14:19:10 -0800226static struct clksrc_clk exynos4_clk_sclk_apll = {
Jongpill Lee3ff31022010-08-18 22:20:31 +0900227 .clk = {
228 .name = "sclk_apll",
Kukjin Kima8550392012-03-09 14:19:10 -0800229 .parent = &exynos4_clk_mout_apll.clk,
Jongpill Lee3ff31022010-08-18 22:20:31 +0900230 },
Kukjin Kima8550392012-03-09 14:19:10 -0800231 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 24, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900232};
233
Kukjin Kima8550392012-03-09 14:19:10 -0800234static struct clksrc_clk exynos4_clk_mout_epll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900235 .clk = {
236 .name = "mout_epll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900237 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800238 .sources = &clk_src_epll,
Kukjin Kima8550392012-03-09 14:19:10 -0800239 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 4, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900240};
241
Kukjin Kima8550392012-03-09 14:19:10 -0800242struct clksrc_clk exynos4_clk_mout_mpll = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800243 .clk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900244 .name = "mout_mpll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900245 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800246 .sources = &clk_src_mpll,
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900247
248 /* reg_src will be added in each SoCs' clock */
Changhwan Younc8bef142010-07-27 17:52:39 +0900249};
250
Kukjin Kima8550392012-03-09 14:19:10 -0800251static struct clk *exynos4_clkset_moutcore_list[] = {
252 [0] = &exynos4_clk_mout_apll.clk,
253 [1] = &exynos4_clk_mout_mpll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900254};
255
Kukjin Kima8550392012-03-09 14:19:10 -0800256static struct clksrc_sources exynos4_clkset_moutcore = {
257 .sources = exynos4_clkset_moutcore_list,
258 .nr_sources = ARRAY_SIZE(exynos4_clkset_moutcore_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900259};
260
Kukjin Kima8550392012-03-09 14:19:10 -0800261static struct clksrc_clk exynos4_clk_moutcore = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900262 .clk = {
263 .name = "moutcore",
Changhwan Younc8bef142010-07-27 17:52:39 +0900264 },
Kukjin Kima8550392012-03-09 14:19:10 -0800265 .sources = &exynos4_clkset_moutcore,
266 .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 16, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900267};
268
Kukjin Kima8550392012-03-09 14:19:10 -0800269static struct clksrc_clk exynos4_clk_coreclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900270 .clk = {
271 .name = "core_clk",
Kukjin Kima8550392012-03-09 14:19:10 -0800272 .parent = &exynos4_clk_moutcore.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900273 },
Kukjin Kima8550392012-03-09 14:19:10 -0800274 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900275};
276
Kukjin Kima8550392012-03-09 14:19:10 -0800277static struct clksrc_clk exynos4_clk_armclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900278 .clk = {
279 .name = "armclk",
Kukjin Kima8550392012-03-09 14:19:10 -0800280 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900281 },
282};
283
Kukjin Kima8550392012-03-09 14:19:10 -0800284static struct clksrc_clk exynos4_clk_aclk_corem0 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900285 .clk = {
286 .name = "aclk_corem0",
Kukjin Kima8550392012-03-09 14:19:10 -0800287 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900288 },
Kukjin Kima8550392012-03-09 14:19:10 -0800289 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900290};
291
Kukjin Kima8550392012-03-09 14:19:10 -0800292static struct clksrc_clk exynos4_clk_aclk_cores = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900293 .clk = {
294 .name = "aclk_cores",
Kukjin Kima8550392012-03-09 14:19:10 -0800295 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900296 },
Kukjin Kima8550392012-03-09 14:19:10 -0800297 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900298};
299
Kukjin Kima8550392012-03-09 14:19:10 -0800300static struct clksrc_clk exynos4_clk_aclk_corem1 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900301 .clk = {
302 .name = "aclk_corem1",
Kukjin Kima8550392012-03-09 14:19:10 -0800303 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900304 },
Kukjin Kima8550392012-03-09 14:19:10 -0800305 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 8, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900306};
307
Kukjin Kima8550392012-03-09 14:19:10 -0800308static struct clksrc_clk exynos4_clk_periphclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900309 .clk = {
310 .name = "periphclk",
Kukjin Kima8550392012-03-09 14:19:10 -0800311 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900312 },
Kukjin Kima8550392012-03-09 14:19:10 -0800313 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900314};
315
Changhwan Younc8bef142010-07-27 17:52:39 +0900316/* Core list of CMU_CORE side */
317
Kukjin Kima8550392012-03-09 14:19:10 -0800318static struct clk *exynos4_clkset_corebus_list[] = {
319 [0] = &exynos4_clk_mout_mpll.clk,
320 [1] = &exynos4_clk_sclk_apll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900321};
322
Kukjin Kima8550392012-03-09 14:19:10 -0800323struct clksrc_sources exynos4_clkset_mout_corebus = {
324 .sources = exynos4_clkset_corebus_list,
325 .nr_sources = ARRAY_SIZE(exynos4_clkset_corebus_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900326};
327
Kukjin Kima8550392012-03-09 14:19:10 -0800328static struct clksrc_clk exynos4_clk_mout_corebus = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900329 .clk = {
330 .name = "mout_corebus",
Changhwan Younc8bef142010-07-27 17:52:39 +0900331 },
Kukjin Kima8550392012-03-09 14:19:10 -0800332 .sources = &exynos4_clkset_mout_corebus,
333 .reg_src = { .reg = EXYNOS4_CLKSRC_DMC, .shift = 4, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900334};
335
Kukjin Kima8550392012-03-09 14:19:10 -0800336static struct clksrc_clk exynos4_clk_sclk_dmc = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900337 .clk = {
338 .name = "sclk_dmc",
Kukjin Kima8550392012-03-09 14:19:10 -0800339 .parent = &exynos4_clk_mout_corebus.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900340 },
Kukjin Kima8550392012-03-09 14:19:10 -0800341 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900342};
343
Kukjin Kima8550392012-03-09 14:19:10 -0800344static struct clksrc_clk exynos4_clk_aclk_cored = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900345 .clk = {
346 .name = "aclk_cored",
Kukjin Kima8550392012-03-09 14:19:10 -0800347 .parent = &exynos4_clk_sclk_dmc.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900348 },
Kukjin Kima8550392012-03-09 14:19:10 -0800349 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 16, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900350};
351
Kukjin Kima8550392012-03-09 14:19:10 -0800352static struct clksrc_clk exynos4_clk_aclk_corep = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900353 .clk = {
354 .name = "aclk_corep",
Kukjin Kima8550392012-03-09 14:19:10 -0800355 .parent = &exynos4_clk_aclk_cored.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900356 },
Kukjin Kima8550392012-03-09 14:19:10 -0800357 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 20, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900358};
359
Kukjin Kima8550392012-03-09 14:19:10 -0800360static struct clksrc_clk exynos4_clk_aclk_acp = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900361 .clk = {
362 .name = "aclk_acp",
Kukjin Kima8550392012-03-09 14:19:10 -0800363 .parent = &exynos4_clk_mout_corebus.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900364 },
Kukjin Kima8550392012-03-09 14:19:10 -0800365 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900366};
367
Kukjin Kima8550392012-03-09 14:19:10 -0800368static struct clksrc_clk exynos4_clk_pclk_acp = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900369 .clk = {
370 .name = "pclk_acp",
Kukjin Kima8550392012-03-09 14:19:10 -0800371 .parent = &exynos4_clk_aclk_acp.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900372 },
Kukjin Kima8550392012-03-09 14:19:10 -0800373 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900374};
375
376/* Core list of CMU_TOP side */
377
Kukjin Kima8550392012-03-09 14:19:10 -0800378struct clk *exynos4_clkset_aclk_top_list[] = {
379 [0] = &exynos4_clk_mout_mpll.clk,
380 [1] = &exynos4_clk_sclk_apll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900381};
382
Kukjin Kima8550392012-03-09 14:19:10 -0800383static struct clksrc_sources exynos4_clkset_aclk = {
384 .sources = exynos4_clkset_aclk_top_list,
385 .nr_sources = ARRAY_SIZE(exynos4_clkset_aclk_top_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900386};
387
Kukjin Kima8550392012-03-09 14:19:10 -0800388static struct clksrc_clk exynos4_clk_aclk_200 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900389 .clk = {
390 .name = "aclk_200",
Changhwan Younc8bef142010-07-27 17:52:39 +0900391 },
Kukjin Kima8550392012-03-09 14:19:10 -0800392 .sources = &exynos4_clkset_aclk,
393 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 12, .size = 1 },
394 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900395};
396
Kukjin Kima8550392012-03-09 14:19:10 -0800397static struct clksrc_clk exynos4_clk_aclk_100 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900398 .clk = {
399 .name = "aclk_100",
Changhwan Younc8bef142010-07-27 17:52:39 +0900400 },
Kukjin Kima8550392012-03-09 14:19:10 -0800401 .sources = &exynos4_clkset_aclk,
402 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 16, .size = 1 },
403 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 4, .size = 4 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900404};
405
Kukjin Kima8550392012-03-09 14:19:10 -0800406static struct clksrc_clk exynos4_clk_aclk_160 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900407 .clk = {
408 .name = "aclk_160",
Changhwan Younc8bef142010-07-27 17:52:39 +0900409 },
Kukjin Kima8550392012-03-09 14:19:10 -0800410 .sources = &exynos4_clkset_aclk,
411 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 20, .size = 1 },
412 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 8, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900413};
414
Kukjin Kima8550392012-03-09 14:19:10 -0800415struct clksrc_clk exynos4_clk_aclk_133 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900416 .clk = {
417 .name = "aclk_133",
Changhwan Younc8bef142010-07-27 17:52:39 +0900418 },
Kukjin Kima8550392012-03-09 14:19:10 -0800419 .sources = &exynos4_clkset_aclk,
420 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 24, .size = 1 },
421 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900422};
423
Kukjin Kima8550392012-03-09 14:19:10 -0800424static struct clk *exynos4_clkset_vpllsrc_list[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900425 [0] = &clk_fin_vpll,
Kukjin Kima8550392012-03-09 14:19:10 -0800426 [1] = &exynos4_clk_sclk_hdmi27m,
Changhwan Younc8bef142010-07-27 17:52:39 +0900427};
428
Kukjin Kima8550392012-03-09 14:19:10 -0800429static struct clksrc_sources exynos4_clkset_vpllsrc = {
430 .sources = exynos4_clkset_vpllsrc_list,
431 .nr_sources = ARRAY_SIZE(exynos4_clkset_vpllsrc_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900432};
433
Kukjin Kima8550392012-03-09 14:19:10 -0800434static struct clksrc_clk exynos4_clk_vpllsrc = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900435 .clk = {
436 .name = "vpll_src",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900437 .enable = exynos4_clksrc_mask_top_ctrl,
Jongpill Lee37e01722010-08-18 22:33:43 +0900438 .ctrlbit = (1 << 0),
Changhwan Younc8bef142010-07-27 17:52:39 +0900439 },
Kukjin Kima8550392012-03-09 14:19:10 -0800440 .sources = &exynos4_clkset_vpllsrc,
441 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP1, .shift = 0, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900442};
443
Kukjin Kima8550392012-03-09 14:19:10 -0800444static struct clk *exynos4_clkset_sclk_vpll_list[] = {
445 [0] = &exynos4_clk_vpllsrc.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900446 [1] = &clk_fout_vpll,
447};
448
Kukjin Kima8550392012-03-09 14:19:10 -0800449static struct clksrc_sources exynos4_clkset_sclk_vpll = {
450 .sources = exynos4_clkset_sclk_vpll_list,
451 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_vpll_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900452};
453
Kukjin Kima8550392012-03-09 14:19:10 -0800454static struct clksrc_clk exynos4_clk_sclk_vpll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900455 .clk = {
456 .name = "sclk_vpll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900457 },
Kukjin Kima8550392012-03-09 14:19:10 -0800458 .sources = &exynos4_clkset_sclk_vpll,
459 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 8, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900460};
461
Kukjin Kima8550392012-03-09 14:19:10 -0800462static struct clk exynos4_init_clocks_off[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900463 {
464 .name = "timers",
Kukjin Kima8550392012-03-09 14:19:10 -0800465 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900466 .enable = exynos4_clk_ip_peril_ctrl,
Changhwan Younc8bef142010-07-27 17:52:39 +0900467 .ctrlbit = (1<<24),
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900468 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900469 .name = "csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900470 .devname = "s5p-mipi-csis.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900471 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900472 .ctrlbit = (1 << 4),
473 }, {
474 .name = "csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900475 .devname = "s5p-mipi-csis.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900476 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900477 .ctrlbit = (1 << 5),
478 }, {
Arnd Bergmann853a0232012-03-15 21:22:00 +0000479 .name = "jpeg",
480 .id = 0,
481 .enable = exynos4_clk_ip_cam_ctrl,
482 .ctrlbit = (1 << 6),
483 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900484 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900485 .devname = "exynos4-fimc.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900486 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900487 .ctrlbit = (1 << 0),
488 }, {
489 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900490 .devname = "exynos4-fimc.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900491 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900492 .ctrlbit = (1 << 1),
493 }, {
494 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900495 .devname = "exynos4-fimc.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900496 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900497 .ctrlbit = (1 << 2),
498 }, {
499 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900500 .devname = "exynos4-fimc.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900501 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900502 .ctrlbit = (1 << 3),
503 }, {
Chander Kashyap1f926c42012-08-28 11:38:18 -0700504 .name = "tsi",
505 .enable = exynos4_clk_ip_fsys_ctrl,
506 .ctrlbit = (1 << 4),
507 }, {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900508 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700509 .devname = "exynos4-sdhci.0",
Kukjin Kima8550392012-03-09 14:19:10 -0800510 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900511 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900512 .ctrlbit = (1 << 5),
513 }, {
514 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700515 .devname = "exynos4-sdhci.1",
Kukjin Kima8550392012-03-09 14:19:10 -0800516 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900517 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900518 .ctrlbit = (1 << 6),
519 }, {
520 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700521 .devname = "exynos4-sdhci.2",
Kukjin Kima8550392012-03-09 14:19:10 -0800522 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900523 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900524 .ctrlbit = (1 << 7),
525 }, {
526 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700527 .devname = "exynos4-sdhci.3",
Kukjin Kima8550392012-03-09 14:19:10 -0800528 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900529 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900530 .ctrlbit = (1 << 8),
531 }, {
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900532 .name = "dwmmc",
Kukjin Kima8550392012-03-09 14:19:10 -0800533 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900534 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900535 .ctrlbit = (1 << 9),
Jongpill Lee82260bf2010-08-18 22:49:24 +0900536 }, {
Chander Kashyap1f926c42012-08-28 11:38:18 -0700537 .name = "onenand",
538 .enable = exynos4_clk_ip_fsys_ctrl,
539 .ctrlbit = (1 << 15),
540 }, {
541 .name = "nfcon",
542 .enable = exynos4_clk_ip_fsys_ctrl,
543 .ctrlbit = (1 << 16),
544 }, {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900545 .name = "dac",
546 .devname = "s5p-sdo",
547 .enable = exynos4_clk_ip_tv_ctrl,
548 .ctrlbit = (1 << 2),
549 }, {
550 .name = "mixer",
551 .devname = "s5p-mixer",
552 .enable = exynos4_clk_ip_tv_ctrl,
553 .ctrlbit = (1 << 1),
554 }, {
555 .name = "vp",
556 .devname = "s5p-mixer",
557 .enable = exynos4_clk_ip_tv_ctrl,
558 .ctrlbit = (1 << 0),
559 }, {
560 .name = "hdmi",
561 .devname = "exynos4-hdmi",
562 .enable = exynos4_clk_ip_tv_ctrl,
563 .ctrlbit = (1 << 3),
564 }, {
565 .name = "hdmiphy",
566 .devname = "exynos4-hdmi",
567 .enable = exynos4_clk_hdmiphy_ctrl,
568 .ctrlbit = (1 << 0),
569 }, {
570 .name = "dacphy",
571 .devname = "s5p-sdo",
572 .enable = exynos4_clk_dac_ctrl,
573 .ctrlbit = (1 << 0),
574 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900575 .name = "adc",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900576 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900577 .ctrlbit = (1 << 15),
578 }, {
Naveen Krishna Chf9d7bcb2011-02-22 17:13:42 +0900579 .name = "keypad",
Naveen Krishna Chf9d7bcb2011-02-22 17:13:42 +0900580 .enable = exynos4_clk_ip_perir_ctrl,
581 .ctrlbit = (1 << 16),
582 }, {
Changhwan Youncdff6e62010-09-20 15:25:51 +0900583 .name = "rtc",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900584 .enable = exynos4_clk_ip_perir_ctrl,
Changhwan Youncdff6e62010-09-20 15:25:51 +0900585 .ctrlbit = (1 << 15),
586 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900587 .name = "watchdog",
Kukjin Kima8550392012-03-09 14:19:10 -0800588 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900589 .enable = exynos4_clk_ip_perir_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900590 .ctrlbit = (1 << 14),
591 }, {
592 .name = "usbhost",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900593 .enable = exynos4_clk_ip_fsys_ctrl ,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900594 .ctrlbit = (1 << 12),
595 }, {
596 .name = "otg",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900597 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900598 .ctrlbit = (1 << 13),
599 }, {
600 .name = "spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +0900601 .devname = "exynos4210-spi.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900602 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900603 .ctrlbit = (1 << 16),
604 }, {
605 .name = "spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +0900606 .devname = "exynos4210-spi.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900607 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900608 .ctrlbit = (1 << 17),
609 }, {
610 .name = "spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +0900611 .devname = "exynos4210-spi.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900612 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900613 .ctrlbit = (1 << 18),
614 }, {
Jassi Brar2d270432010-12-21 09:57:03 +0900615 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900616 .devname = "samsung-i2s.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900617 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900618 .ctrlbit = (1 << 19),
619 }, {
620 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900621 .devname = "samsung-i2s.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900622 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900623 .ctrlbit = (1 << 20),
624 }, {
625 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900626 .devname = "samsung-i2s.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900627 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900628 .ctrlbit = (1 << 21),
629 }, {
Chander Kashyap377acfb2012-09-21 11:06:00 +0900630 .name = "pcm",
631 .devname = "samsung-pcm.1",
632 .enable = exynos4_clk_ip_peril_ctrl,
633 .ctrlbit = (1 << 22),
634 }, {
635 .name = "pcm",
636 .devname = "samsung-pcm.2",
637 .enable = exynos4_clk_ip_peril_ctrl,
638 .ctrlbit = (1 << 23),
639 }, {
640 .name = "slimbus",
641 .enable = exynos4_clk_ip_peril_ctrl,
642 .ctrlbit = (1 << 25),
643 }, {
644 .name = "spdif",
645 .devname = "samsung-spdif",
646 .enable = exynos4_clk_ip_peril_ctrl,
647 .ctrlbit = (1 << 26),
648 }, {
Jassi Braraa227552010-12-21 09:54:57 +0900649 .name = "ac97",
Jonghwan Choiaf8a9f62011-08-12 18:15:42 +0900650 .devname = "samsung-ac97",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900651 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Braraa227552010-12-21 09:54:57 +0900652 .ctrlbit = (1 << 27),
653 }, {
Kamil Debski0f75a962011-07-21 16:42:30 +0900654 .name = "mfc",
655 .devname = "s5p-mfc",
656 .enable = exynos4_clk_ip_mfc_ctrl,
657 .ctrlbit = (1 << 0),
658 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900659 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900660 .devname = "s3c2440-i2c.0",
Kukjin Kima8550392012-03-09 14:19:10 -0800661 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900662 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900663 .ctrlbit = (1 << 6),
664 }, {
665 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900666 .devname = "s3c2440-i2c.1",
Kukjin Kima8550392012-03-09 14:19:10 -0800667 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900668 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900669 .ctrlbit = (1 << 7),
670 }, {
671 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900672 .devname = "s3c2440-i2c.2",
Kukjin Kima8550392012-03-09 14:19:10 -0800673 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900674 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900675 .ctrlbit = (1 << 8),
676 }, {
677 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900678 .devname = "s3c2440-i2c.3",
Kukjin Kima8550392012-03-09 14:19:10 -0800679 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900680 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900681 .ctrlbit = (1 << 9),
682 }, {
683 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900684 .devname = "s3c2440-i2c.4",
Kukjin Kima8550392012-03-09 14:19:10 -0800685 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900686 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900687 .ctrlbit = (1 << 10),
688 }, {
689 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900690 .devname = "s3c2440-i2c.5",
Kukjin Kima8550392012-03-09 14:19:10 -0800691 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900692 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900693 .ctrlbit = (1 << 11),
694 }, {
695 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900696 .devname = "s3c2440-i2c.6",
Kukjin Kima8550392012-03-09 14:19:10 -0800697 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900698 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900699 .ctrlbit = (1 << 12),
700 }, {
701 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900702 .devname = "s3c2440-i2c.7",
Kukjin Kima8550392012-03-09 14:19:10 -0800703 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900704 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900705 .ctrlbit = (1 << 13),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900706 }, {
Tomasz Stanislawskic40e7e02011-09-16 18:44:36 +0900707 .name = "i2c",
708 .devname = "s3c2440-hdmiphy-i2c",
Kukjin Kima8550392012-03-09 14:19:10 -0800709 .parent = &exynos4_clk_aclk_100.clk,
Tomasz Stanislawskic40e7e02011-09-16 18:44:36 +0900710 .enable = exynos4_clk_ip_peril_ctrl,
711 .ctrlbit = (1 << 14),
712 }, {
KyongHo Chobca10b92012-04-04 09:23:02 -0700713 .name = SYSMMU_CLOCK_NAME,
714 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900715 .enable = exynos4_clk_ip_mfc_ctrl,
716 .ctrlbit = (1 << 1),
717 }, {
KyongHo Chobca10b92012-04-04 09:23:02 -0700718 .name = SYSMMU_CLOCK_NAME,
719 .devname = SYSMMU_CLOCK_DEVNAME(mfc_r, 1),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900720 .enable = exynos4_clk_ip_mfc_ctrl,
721 .ctrlbit = (1 << 2),
KyongHo Chobca10b92012-04-04 09:23:02 -0700722 }, {
723 .name = SYSMMU_CLOCK_NAME,
724 .devname = SYSMMU_CLOCK_DEVNAME(tv, 2),
725 .enable = exynos4_clk_ip_tv_ctrl,
726 .ctrlbit = (1 << 4),
727 }, {
728 .name = SYSMMU_CLOCK_NAME,
729 .devname = SYSMMU_CLOCK_DEVNAME(jpeg, 3),
730 .enable = exynos4_clk_ip_cam_ctrl,
731 .ctrlbit = (1 << 11),
732 }, {
733 .name = SYSMMU_CLOCK_NAME,
734 .devname = SYSMMU_CLOCK_DEVNAME(rot, 4),
735 .enable = exynos4_clk_ip_image_ctrl,
736 .ctrlbit = (1 << 4),
737 }, {
738 .name = SYSMMU_CLOCK_NAME,
739 .devname = SYSMMU_CLOCK_DEVNAME(fimc0, 5),
740 .enable = exynos4_clk_ip_cam_ctrl,
741 .ctrlbit = (1 << 7),
742 }, {
743 .name = SYSMMU_CLOCK_NAME,
744 .devname = SYSMMU_CLOCK_DEVNAME(fimc1, 6),
745 .enable = exynos4_clk_ip_cam_ctrl,
746 .ctrlbit = (1 << 8),
747 }, {
748 .name = SYSMMU_CLOCK_NAME,
749 .devname = SYSMMU_CLOCK_DEVNAME(fimc2, 7),
750 .enable = exynos4_clk_ip_cam_ctrl,
751 .ctrlbit = (1 << 9),
752 }, {
753 .name = SYSMMU_CLOCK_NAME,
754 .devname = SYSMMU_CLOCK_DEVNAME(fimc3, 8),
755 .enable = exynos4_clk_ip_cam_ctrl,
756 .ctrlbit = (1 << 10),
757 }, {
758 .name = SYSMMU_CLOCK_NAME,
759 .devname = SYSMMU_CLOCK_DEVNAME(fimd0, 10),
760 .enable = exynos4_clk_ip_lcd0_ctrl,
761 .ctrlbit = (1 << 4),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900762 }
Changhwan Younc8bef142010-07-27 17:52:39 +0900763};
764
Kukjin Kima8550392012-03-09 14:19:10 -0800765static struct clk exynos4_init_clocks_on[] = {
Jongpill Lee5a847b42010-08-27 16:50:47 +0900766 {
767 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900768 .devname = "s5pv210-uart.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900769 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900770 .ctrlbit = (1 << 0),
771 }, {
772 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900773 .devname = "s5pv210-uart.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900774 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900775 .ctrlbit = (1 << 1),
776 }, {
777 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900778 .devname = "s5pv210-uart.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900779 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900780 .ctrlbit = (1 << 2),
781 }, {
782 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900783 .devname = "s5pv210-uart.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900784 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900785 .ctrlbit = (1 << 3),
786 }, {
787 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900788 .devname = "s5pv210-uart.4",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900789 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900790 .ctrlbit = (1 << 4),
791 }, {
792 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900793 .devname = "s5pv210-uart.5",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900794 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900795 .ctrlbit = (1 << 5),
796 }
Changhwan Younc8bef142010-07-27 17:52:39 +0900797};
798
Kukjin Kima8550392012-03-09 14:19:10 -0800799static struct clk exynos4_clk_pdma0 = {
Thomas Abraham66fdb292011-10-24 14:01:03 +0200800 .name = "dma",
801 .devname = "dma-pl330.0",
802 .enable = exynos4_clk_ip_fsys_ctrl,
803 .ctrlbit = (1 << 0),
804};
805
Kukjin Kima8550392012-03-09 14:19:10 -0800806static struct clk exynos4_clk_pdma1 = {
Thomas Abraham66fdb292011-10-24 14:01:03 +0200807 .name = "dma",
808 .devname = "dma-pl330.1",
809 .enable = exynos4_clk_ip_fsys_ctrl,
810 .ctrlbit = (1 << 1),
811};
812
Boojin Kim9ed76e02012-02-15 13:15:12 +0900813static struct clk exynos4_clk_mdma1 = {
814 .name = "dma",
815 .devname = "dma-pl330.2",
816 .enable = exynos4_clk_ip_image_ctrl,
817 .ctrlbit = ((1 << 8) | (1 << 5) | (1 << 2)),
818};
819
Tushar Behera79025462012-03-12 21:17:02 -0700820static struct clk exynos4_clk_fimd0 = {
821 .name = "fimd",
822 .devname = "exynos4-fb.0",
823 .enable = exynos4_clk_ip_lcd0_ctrl,
824 .ctrlbit = (1 << 0),
825};
826
Kukjin Kima8550392012-03-09 14:19:10 -0800827struct clk *exynos4_clkset_group_list[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900828 [0] = &clk_ext_xtal_mux,
829 [1] = &clk_xusbxti,
Kukjin Kima8550392012-03-09 14:19:10 -0800830 [2] = &exynos4_clk_sclk_hdmi27m,
831 [3] = &exynos4_clk_sclk_usbphy0,
832 [4] = &exynos4_clk_sclk_usbphy1,
833 [5] = &exynos4_clk_sclk_hdmiphy,
834 [6] = &exynos4_clk_mout_mpll.clk,
835 [7] = &exynos4_clk_mout_epll.clk,
836 [8] = &exynos4_clk_sclk_vpll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900837};
838
Kukjin Kima8550392012-03-09 14:19:10 -0800839struct clksrc_sources exynos4_clkset_group = {
840 .sources = exynos4_clkset_group_list,
841 .nr_sources = ARRAY_SIZE(exynos4_clkset_group_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900842};
843
Kukjin Kima8550392012-03-09 14:19:10 -0800844static struct clk *exynos4_clkset_mout_g2d0_list[] = {
845 [0] = &exynos4_clk_mout_mpll.clk,
846 [1] = &exynos4_clk_sclk_apll.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900847};
848
Sachin Kamat8bf56462012-07-17 07:52:03 +0900849struct clksrc_sources exynos4_clkset_mout_g2d0 = {
Kukjin Kima8550392012-03-09 14:19:10 -0800850 .sources = exynos4_clkset_mout_g2d0_list,
851 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d0_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900852};
853
Kukjin Kima8550392012-03-09 14:19:10 -0800854static struct clk *exynos4_clkset_mout_g2d1_list[] = {
855 [0] = &exynos4_clk_mout_epll.clk,
856 [1] = &exynos4_clk_sclk_vpll.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900857};
858
Sachin Kamat8bf56462012-07-17 07:52:03 +0900859struct clksrc_sources exynos4_clkset_mout_g2d1 = {
Kukjin Kima8550392012-03-09 14:19:10 -0800860 .sources = exynos4_clkset_mout_g2d1_list,
861 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d1_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900862};
863
Kukjin Kima8550392012-03-09 14:19:10 -0800864static struct clk *exynos4_clkset_mout_mfc0_list[] = {
865 [0] = &exynos4_clk_mout_mpll.clk,
866 [1] = &exynos4_clk_sclk_apll.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900867};
868
Kukjin Kima8550392012-03-09 14:19:10 -0800869static struct clksrc_sources exynos4_clkset_mout_mfc0 = {
870 .sources = exynos4_clkset_mout_mfc0_list,
871 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc0_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900872};
873
Kukjin Kima8550392012-03-09 14:19:10 -0800874static struct clksrc_clk exynos4_clk_mout_mfc0 = {
Kamil Debski0f75a962011-07-21 16:42:30 +0900875 .clk = {
876 .name = "mout_mfc0",
877 },
Kukjin Kima8550392012-03-09 14:19:10 -0800878 .sources = &exynos4_clkset_mout_mfc0,
879 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 0, .size = 1 },
Kamil Debski0f75a962011-07-21 16:42:30 +0900880};
881
Kukjin Kima8550392012-03-09 14:19:10 -0800882static struct clk *exynos4_clkset_mout_mfc1_list[] = {
883 [0] = &exynos4_clk_mout_epll.clk,
884 [1] = &exynos4_clk_sclk_vpll.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900885};
886
Kukjin Kima8550392012-03-09 14:19:10 -0800887static struct clksrc_sources exynos4_clkset_mout_mfc1 = {
888 .sources = exynos4_clkset_mout_mfc1_list,
889 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc1_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900890};
891
Kukjin Kima8550392012-03-09 14:19:10 -0800892static struct clksrc_clk exynos4_clk_mout_mfc1 = {
Kamil Debski0f75a962011-07-21 16:42:30 +0900893 .clk = {
894 .name = "mout_mfc1",
895 },
Kukjin Kima8550392012-03-09 14:19:10 -0800896 .sources = &exynos4_clkset_mout_mfc1,
897 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 4, .size = 1 },
Kamil Debski0f75a962011-07-21 16:42:30 +0900898};
899
Kukjin Kima8550392012-03-09 14:19:10 -0800900static struct clk *exynos4_clkset_mout_mfc_list[] = {
901 [0] = &exynos4_clk_mout_mfc0.clk,
902 [1] = &exynos4_clk_mout_mfc1.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900903};
904
Kukjin Kima8550392012-03-09 14:19:10 -0800905static struct clksrc_sources exynos4_clkset_mout_mfc = {
906 .sources = exynos4_clkset_mout_mfc_list,
907 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900908};
909
Kukjin Kima8550392012-03-09 14:19:10 -0800910static struct clk *exynos4_clkset_sclk_dac_list[] = {
911 [0] = &exynos4_clk_sclk_vpll.clk,
912 [1] = &exynos4_clk_sclk_hdmiphy,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900913};
914
Kukjin Kima8550392012-03-09 14:19:10 -0800915static struct clksrc_sources exynos4_clkset_sclk_dac = {
916 .sources = exynos4_clkset_sclk_dac_list,
917 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_dac_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900918};
919
Kukjin Kima8550392012-03-09 14:19:10 -0800920static struct clksrc_clk exynos4_clk_sclk_dac = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900921 .clk = {
922 .name = "sclk_dac",
923 .enable = exynos4_clksrc_mask_tv_ctrl,
924 .ctrlbit = (1 << 8),
925 },
Kukjin Kima8550392012-03-09 14:19:10 -0800926 .sources = &exynos4_clkset_sclk_dac,
927 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 8, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900928};
929
Kukjin Kima8550392012-03-09 14:19:10 -0800930static struct clksrc_clk exynos4_clk_sclk_pixel = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900931 .clk = {
932 .name = "sclk_pixel",
Kukjin Kima8550392012-03-09 14:19:10 -0800933 .parent = &exynos4_clk_sclk_vpll.clk,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900934 },
Kukjin Kima8550392012-03-09 14:19:10 -0800935 .reg_div = { .reg = EXYNOS4_CLKDIV_TV, .shift = 0, .size = 4 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900936};
937
Kukjin Kima8550392012-03-09 14:19:10 -0800938static struct clk *exynos4_clkset_sclk_hdmi_list[] = {
939 [0] = &exynos4_clk_sclk_pixel.clk,
940 [1] = &exynos4_clk_sclk_hdmiphy,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900941};
942
Kukjin Kima8550392012-03-09 14:19:10 -0800943static struct clksrc_sources exynos4_clkset_sclk_hdmi = {
944 .sources = exynos4_clkset_sclk_hdmi_list,
945 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_hdmi_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900946};
947
Kukjin Kima8550392012-03-09 14:19:10 -0800948static struct clksrc_clk exynos4_clk_sclk_hdmi = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900949 .clk = {
950 .name = "sclk_hdmi",
951 .enable = exynos4_clksrc_mask_tv_ctrl,
952 .ctrlbit = (1 << 0),
953 },
Kukjin Kima8550392012-03-09 14:19:10 -0800954 .sources = &exynos4_clkset_sclk_hdmi,
955 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 0, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900956};
957
Kukjin Kima8550392012-03-09 14:19:10 -0800958static struct clk *exynos4_clkset_sclk_mixer_list[] = {
959 [0] = &exynos4_clk_sclk_dac.clk,
960 [1] = &exynos4_clk_sclk_hdmi.clk,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900961};
962
Kukjin Kima8550392012-03-09 14:19:10 -0800963static struct clksrc_sources exynos4_clkset_sclk_mixer = {
964 .sources = exynos4_clkset_sclk_mixer_list,
965 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_mixer_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900966};
967
Kukjin Kima8550392012-03-09 14:19:10 -0800968static struct clksrc_clk exynos4_clk_sclk_mixer = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800969 .clk = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900970 .name = "sclk_mixer",
971 .enable = exynos4_clksrc_mask_tv_ctrl,
972 .ctrlbit = (1 << 4),
973 },
Kukjin Kima8550392012-03-09 14:19:10 -0800974 .sources = &exynos4_clkset_sclk_mixer,
975 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 4, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900976};
977
Kukjin Kima8550392012-03-09 14:19:10 -0800978static struct clksrc_clk *exynos4_sclk_tv[] = {
979 &exynos4_clk_sclk_dac,
980 &exynos4_clk_sclk_pixel,
981 &exynos4_clk_sclk_hdmi,
982 &exynos4_clk_sclk_mixer,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900983};
984
Kukjin Kima8550392012-03-09 14:19:10 -0800985static struct clksrc_clk exynos4_clk_dout_mmc0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800986 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900987 .name = "dout_mmc0",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900988 },
Kukjin Kima8550392012-03-09 14:19:10 -0800989 .sources = &exynos4_clkset_group,
990 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 0, .size = 4 },
991 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900992};
993
Kukjin Kima8550392012-03-09 14:19:10 -0800994static struct clksrc_clk exynos4_clk_dout_mmc1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800995 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900996 .name = "dout_mmc1",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900997 },
Kukjin Kima8550392012-03-09 14:19:10 -0800998 .sources = &exynos4_clkset_group,
999 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 4, .size = 4 },
1000 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 16, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001001};
1002
Kukjin Kima8550392012-03-09 14:19:10 -08001003static struct clksrc_clk exynos4_clk_dout_mmc2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001004 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001005 .name = "dout_mmc2",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001006 },
Kukjin Kima8550392012-03-09 14:19:10 -08001007 .sources = &exynos4_clkset_group,
1008 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 8, .size = 4 },
1009 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001010};
1011
Kukjin Kima8550392012-03-09 14:19:10 -08001012static struct clksrc_clk exynos4_clk_dout_mmc3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001013 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001014 .name = "dout_mmc3",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001015 },
Kukjin Kima8550392012-03-09 14:19:10 -08001016 .sources = &exynos4_clkset_group,
1017 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 12, .size = 4 },
1018 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 16, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001019};
1020
Kukjin Kima8550392012-03-09 14:19:10 -08001021static struct clksrc_clk exynos4_clk_dout_mmc4 = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001022 .clk = {
1023 .name = "dout_mmc4",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001024 },
Kukjin Kima8550392012-03-09 14:19:10 -08001025 .sources = &exynos4_clkset_group,
1026 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 16, .size = 4 },
1027 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001028};
1029
Kukjin Kima8550392012-03-09 14:19:10 -08001030static struct clksrc_clk exynos4_clksrcs[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +09001031 {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001032 .clk = {
Changhwan Younc8bef142010-07-27 17:52:39 +09001033 .name = "sclk_pwm",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001034 .enable = exynos4_clksrc_mask_peril0_ctrl,
Changhwan Younc8bef142010-07-27 17:52:39 +09001035 .ctrlbit = (1 << 24),
1036 },
Kukjin Kima8550392012-03-09 14:19:10 -08001037 .sources = &exynos4_clkset_group,
1038 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 24, .size = 4 },
1039 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL3, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001040 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001041 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001042 .name = "sclk_csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001043 .devname = "s5p-mipi-csis.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001044 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001045 .ctrlbit = (1 << 24),
1046 },
Kukjin Kima8550392012-03-09 14:19:10 -08001047 .sources = &exynos4_clkset_group,
1048 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 24, .size = 4 },
1049 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 24, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001050 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001051 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001052 .name = "sclk_csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001053 .devname = "s5p-mipi-csis.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001054 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001055 .ctrlbit = (1 << 28),
1056 },
Kukjin Kima8550392012-03-09 14:19:10 -08001057 .sources = &exynos4_clkset_group,
1058 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 28, .size = 4 },
1059 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 28, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001060 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001061 .clk = {
Sylwester Nawrocki00aaad22011-09-27 07:00:59 +09001062 .name = "sclk_cam0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001063 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001064 .ctrlbit = (1 << 16),
1065 },
Kukjin Kima8550392012-03-09 14:19:10 -08001066 .sources = &exynos4_clkset_group,
1067 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 16, .size = 4 },
1068 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 16, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001069 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001070 .clk = {
Sylwester Nawrocki00aaad22011-09-27 07:00:59 +09001071 .name = "sclk_cam1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001072 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001073 .ctrlbit = (1 << 20),
1074 },
Kukjin Kima8550392012-03-09 14:19:10 -08001075 .sources = &exynos4_clkset_group,
1076 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 20, .size = 4 },
1077 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 20, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001078 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001079 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001080 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001081 .devname = "exynos4-fimc.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001082 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001083 .ctrlbit = (1 << 0),
1084 },
Kukjin Kima8550392012-03-09 14:19:10 -08001085 .sources = &exynos4_clkset_group,
1086 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 0, .size = 4 },
1087 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 0, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001088 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001089 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001090 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001091 .devname = "exynos4-fimc.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001092 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001093 .ctrlbit = (1 << 4),
1094 },
Kukjin Kima8550392012-03-09 14:19:10 -08001095 .sources = &exynos4_clkset_group,
1096 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 4, .size = 4 },
1097 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 4, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001098 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001099 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001100 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001101 .devname = "exynos4-fimc.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001102 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001103 .ctrlbit = (1 << 8),
1104 },
Kukjin Kima8550392012-03-09 14:19:10 -08001105 .sources = &exynos4_clkset_group,
1106 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 8, .size = 4 },
1107 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 8, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001108 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001109 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001110 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001111 .devname = "exynos4-fimc.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001112 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001113 .ctrlbit = (1 << 12),
1114 },
Kukjin Kima8550392012-03-09 14:19:10 -08001115 .sources = &exynos4_clkset_group,
1116 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 12, .size = 4 },
1117 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 12, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001118 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001119 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001120 .name = "sclk_fimd",
Jingoo Han268a7ef2011-07-21 15:42:38 +09001121 .devname = "exynos4-fb.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001122 .enable = exynos4_clksrc_mask_lcd0_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001123 .ctrlbit = (1 << 0),
1124 },
Kukjin Kima8550392012-03-09 14:19:10 -08001125 .sources = &exynos4_clkset_group,
1126 .reg_src = { .reg = EXYNOS4_CLKSRC_LCD0, .shift = 0, .size = 4 },
1127 .reg_div = { .reg = EXYNOS4_CLKDIV_LCD0, .shift = 0, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001128 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001129 .clk = {
Kamil Debski0f75a962011-07-21 16:42:30 +09001130 .name = "sclk_mfc",
1131 .devname = "s5p-mfc",
1132 },
Kukjin Kima8550392012-03-09 14:19:10 -08001133 .sources = &exynos4_clkset_mout_mfc,
1134 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 8, .size = 1 },
1135 .reg_div = { .reg = EXYNOS4_CLKDIV_MFC, .shift = 0, .size = 4 },
Kamil Debski0f75a962011-07-21 16:42:30 +09001136 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001137 .clk = {
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001138 .name = "sclk_dwmmc",
Kukjin Kima8550392012-03-09 14:19:10 -08001139 .parent = &exynos4_clk_dout_mmc4.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001140 .enable = exynos4_clksrc_mask_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001141 .ctrlbit = (1 << 16),
1142 },
Kukjin Kima8550392012-03-09 14:19:10 -08001143 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 8, .size = 8 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001144 }
Changhwan Younc8bef142010-07-27 17:52:39 +09001145};
1146
Kukjin Kima8550392012-03-09 14:19:10 -08001147static struct clksrc_clk exynos4_clk_sclk_uart0 = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001148 .clk = {
1149 .name = "uclk1",
1150 .devname = "exynos4210-uart.0",
1151 .enable = exynos4_clksrc_mask_peril0_ctrl,
1152 .ctrlbit = (1 << 0),
1153 },
Kukjin Kima8550392012-03-09 14:19:10 -08001154 .sources = &exynos4_clkset_group,
1155 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 0, .size = 4 },
1156 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 0, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001157};
1158
Kukjin Kima8550392012-03-09 14:19:10 -08001159static struct clksrc_clk exynos4_clk_sclk_uart1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001160 .clk = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001161 .name = "uclk1",
1162 .devname = "exynos4210-uart.1",
1163 .enable = exynos4_clksrc_mask_peril0_ctrl,
1164 .ctrlbit = (1 << 4),
1165 },
Kukjin Kima8550392012-03-09 14:19:10 -08001166 .sources = &exynos4_clkset_group,
1167 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 4, .size = 4 },
1168 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 4, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001169};
1170
Kukjin Kima8550392012-03-09 14:19:10 -08001171static struct clksrc_clk exynos4_clk_sclk_uart2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001172 .clk = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001173 .name = "uclk1",
1174 .devname = "exynos4210-uart.2",
1175 .enable = exynos4_clksrc_mask_peril0_ctrl,
1176 .ctrlbit = (1 << 8),
1177 },
Kukjin Kima8550392012-03-09 14:19:10 -08001178 .sources = &exynos4_clkset_group,
1179 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 8, .size = 4 },
1180 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 8, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001181};
1182
Kukjin Kima8550392012-03-09 14:19:10 -08001183static struct clksrc_clk exynos4_clk_sclk_uart3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001184 .clk = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001185 .name = "uclk1",
1186 .devname = "exynos4210-uart.3",
1187 .enable = exynos4_clksrc_mask_peril0_ctrl,
1188 .ctrlbit = (1 << 12),
1189 },
Kukjin Kima8550392012-03-09 14:19:10 -08001190 .sources = &exynos4_clkset_group,
1191 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 12, .size = 4 },
1192 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 12, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001193};
1194
Kukjin Kima8550392012-03-09 14:19:10 -08001195static struct clksrc_clk exynos4_clk_sclk_mmc0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001196 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001197 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001198 .devname = "exynos4-sdhci.0",
Kukjin Kima8550392012-03-09 14:19:10 -08001199 .parent = &exynos4_clk_dout_mmc0.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001200 .enable = exynos4_clksrc_mask_fsys_ctrl,
1201 .ctrlbit = (1 << 0),
1202 },
Kukjin Kima8550392012-03-09 14:19:10 -08001203 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 8, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001204};
1205
Kukjin Kima8550392012-03-09 14:19:10 -08001206static struct clksrc_clk exynos4_clk_sclk_mmc1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001207 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001208 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001209 .devname = "exynos4-sdhci.1",
Kukjin Kima8550392012-03-09 14:19:10 -08001210 .parent = &exynos4_clk_dout_mmc1.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001211 .enable = exynos4_clksrc_mask_fsys_ctrl,
1212 .ctrlbit = (1 << 4),
1213 },
Kukjin Kima8550392012-03-09 14:19:10 -08001214 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 24, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001215};
1216
Kukjin Kima8550392012-03-09 14:19:10 -08001217static struct clksrc_clk exynos4_clk_sclk_mmc2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001218 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001219 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001220 .devname = "exynos4-sdhci.2",
Kukjin Kima8550392012-03-09 14:19:10 -08001221 .parent = &exynos4_clk_dout_mmc2.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001222 .enable = exynos4_clksrc_mask_fsys_ctrl,
1223 .ctrlbit = (1 << 8),
1224 },
Kukjin Kima8550392012-03-09 14:19:10 -08001225 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 8, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001226};
1227
Kukjin Kima8550392012-03-09 14:19:10 -08001228static struct clksrc_clk exynos4_clk_sclk_mmc3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001229 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001230 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001231 .devname = "exynos4-sdhci.3",
Kukjin Kima8550392012-03-09 14:19:10 -08001232 .parent = &exynos4_clk_dout_mmc3.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001233 .enable = exynos4_clksrc_mask_fsys_ctrl,
1234 .ctrlbit = (1 << 12),
1235 },
Kukjin Kima8550392012-03-09 14:19:10 -08001236 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 24, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001237};
1238
Thomas Abraham46fda152012-07-14 10:53:08 +09001239static struct clksrc_clk exynos4_clk_mdout_spi0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001240 .clk = {
Thomas Abraham46fda152012-07-14 10:53:08 +09001241 .name = "mdout_spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +09001242 .devname = "exynos4210-spi.0",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001243 },
Kukjin Kima8550392012-03-09 14:19:10 -08001244 .sources = &exynos4_clkset_group,
1245 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 16, .size = 4 },
1246 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 0, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001247};
1248
Thomas Abraham46fda152012-07-14 10:53:08 +09001249static struct clksrc_clk exynos4_clk_mdout_spi1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001250 .clk = {
Thomas Abraham46fda152012-07-14 10:53:08 +09001251 .name = "mdout_spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +09001252 .devname = "exynos4210-spi.1",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001253 },
Kukjin Kima8550392012-03-09 14:19:10 -08001254 .sources = &exynos4_clkset_group,
1255 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 20, .size = 4 },
1256 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 16, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001257};
1258
Thomas Abraham46fda152012-07-14 10:53:08 +09001259static struct clksrc_clk exynos4_clk_mdout_spi2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001260 .clk = {
Thomas Abraham46fda152012-07-14 10:53:08 +09001261 .name = "mdout_spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +09001262 .devname = "exynos4210-spi.2",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001263 },
Kukjin Kima8550392012-03-09 14:19:10 -08001264 .sources = &exynos4_clkset_group,
1265 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 24, .size = 4 },
1266 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 0, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001267};
1268
Thomas Abraham46fda152012-07-14 10:53:08 +09001269static struct clksrc_clk exynos4_clk_sclk_spi0 = {
1270 .clk = {
1271 .name = "sclk_spi",
1272 .devname = "exynos4210-spi.0",
1273 .parent = &exynos4_clk_mdout_spi0.clk,
1274 .enable = exynos4_clksrc_mask_peril1_ctrl,
1275 .ctrlbit = (1 << 16),
1276 },
1277 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 8, .size = 8 },
1278};
1279
1280static struct clksrc_clk exynos4_clk_sclk_spi1 = {
1281 .clk = {
1282 .name = "sclk_spi",
1283 .devname = "exynos4210-spi.1",
1284 .parent = &exynos4_clk_mdout_spi1.clk,
1285 .enable = exynos4_clksrc_mask_peril1_ctrl,
1286 .ctrlbit = (1 << 20),
1287 },
1288 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 24, .size = 8 },
1289};
1290
1291static struct clksrc_clk exynos4_clk_sclk_spi2 = {
1292 .clk = {
1293 .name = "sclk_spi",
1294 .devname = "exynos4210-spi.2",
1295 .parent = &exynos4_clk_mdout_spi2.clk,
1296 .enable = exynos4_clksrc_mask_peril1_ctrl,
1297 .ctrlbit = (1 << 24),
1298 },
1299 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 8, .size = 8 },
1300};
1301
Changhwan Younc8bef142010-07-27 17:52:39 +09001302/* Clock initialization code */
Kukjin Kima8550392012-03-09 14:19:10 -08001303static struct clksrc_clk *exynos4_sysclks[] = {
1304 &exynos4_clk_mout_apll,
1305 &exynos4_clk_sclk_apll,
1306 &exynos4_clk_mout_epll,
1307 &exynos4_clk_mout_mpll,
1308 &exynos4_clk_moutcore,
1309 &exynos4_clk_coreclk,
1310 &exynos4_clk_armclk,
1311 &exynos4_clk_aclk_corem0,
1312 &exynos4_clk_aclk_cores,
1313 &exynos4_clk_aclk_corem1,
1314 &exynos4_clk_periphclk,
1315 &exynos4_clk_mout_corebus,
1316 &exynos4_clk_sclk_dmc,
1317 &exynos4_clk_aclk_cored,
1318 &exynos4_clk_aclk_corep,
1319 &exynos4_clk_aclk_acp,
1320 &exynos4_clk_pclk_acp,
1321 &exynos4_clk_vpllsrc,
1322 &exynos4_clk_sclk_vpll,
1323 &exynos4_clk_aclk_200,
1324 &exynos4_clk_aclk_100,
1325 &exynos4_clk_aclk_160,
1326 &exynos4_clk_aclk_133,
1327 &exynos4_clk_dout_mmc0,
1328 &exynos4_clk_dout_mmc1,
1329 &exynos4_clk_dout_mmc2,
1330 &exynos4_clk_dout_mmc3,
1331 &exynos4_clk_dout_mmc4,
1332 &exynos4_clk_mout_mfc0,
1333 &exynos4_clk_mout_mfc1,
Changhwan Younc8bef142010-07-27 17:52:39 +09001334};
1335
Kukjin Kima8550392012-03-09 14:19:10 -08001336static struct clk *exynos4_clk_cdev[] = {
1337 &exynos4_clk_pdma0,
1338 &exynos4_clk_pdma1,
Boojin Kim9ed76e02012-02-15 13:15:12 +09001339 &exynos4_clk_mdma1,
Tushar Behera79025462012-03-12 21:17:02 -07001340 &exynos4_clk_fimd0,
Thomas Abraham66fdb292011-10-24 14:01:03 +02001341};
1342
Kukjin Kima8550392012-03-09 14:19:10 -08001343static struct clksrc_clk *exynos4_clksrc_cdev[] = {
1344 &exynos4_clk_sclk_uart0,
1345 &exynos4_clk_sclk_uart1,
1346 &exynos4_clk_sclk_uart2,
1347 &exynos4_clk_sclk_uart3,
1348 &exynos4_clk_sclk_mmc0,
1349 &exynos4_clk_sclk_mmc1,
1350 &exynos4_clk_sclk_mmc2,
1351 &exynos4_clk_sclk_mmc3,
1352 &exynos4_clk_sclk_spi0,
1353 &exynos4_clk_sclk_spi1,
1354 &exynos4_clk_sclk_spi2,
Thomas Abraham46fda152012-07-14 10:53:08 +09001355 &exynos4_clk_mdout_spi0,
1356 &exynos4_clk_mdout_spi1,
1357 &exynos4_clk_mdout_spi2,
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001358};
1359
1360static struct clk_lookup exynos4_clk_lookup[] = {
Kukjin Kima8550392012-03-09 14:19:10 -08001361 CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &exynos4_clk_sclk_uart0.clk),
1362 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk),
1363 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk),
1364 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk),
Thomas Abraham8482c812012-04-14 08:04:46 -07001365 CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk),
1366 CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk),
1367 CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk),
1368 CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk),
Tushar Behera79025462012-03-12 21:17:02 -07001369 CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0),
Kukjin Kima8550392012-03-09 14:19:10 -08001370 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0),
1371 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1),
Tushar Behera8f7b1322011-12-27 14:42:50 +09001372 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos4_clk_mdma1),
Thomas Abrahama5238e32012-07-13 07:15:14 +09001373 CLKDEV_INIT("exynos4210-spi.0", "spi_busclk0", &exynos4_clk_sclk_spi0.clk),
1374 CLKDEV_INIT("exynos4210-spi.1", "spi_busclk0", &exynos4_clk_sclk_spi1.clk),
1375 CLKDEV_INIT("exynos4210-spi.2", "spi_busclk0", &exynos4_clk_sclk_spi2.clk),
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001376};
1377
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001378static int xtal_rate;
1379
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001380static unsigned long exynos4_fout_apll_get_rate(struct clk *clk)
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001381{
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001382 if (soc_is_exynos4210())
Kukjin Kima8550392012-03-09 14:19:10 -08001383 return s5p_get_pll45xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001384 pll_4508);
Changhwan Younb88b1cc2011-10-04 17:08:56 +09001385 else if (soc_is_exynos4212() || soc_is_exynos4412())
Kukjin Kima8550392012-03-09 14:19:10 -08001386 return s5p_get_pll35xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001387 else
1388 return 0;
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001389}
1390
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001391static struct clk_ops exynos4_fout_apll_ops = {
1392 .get_rate = exynos4_fout_apll_get_rate,
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001393};
1394
Kukjin Kima8550392012-03-09 14:19:10 -08001395static u32 exynos4_vpll_div[][8] = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001396 { 54000000, 3, 53, 3, 1024, 0, 17, 0 },
1397 { 108000000, 3, 53, 2, 1024, 0, 17, 0 },
1398};
1399
1400static unsigned long exynos4_vpll_get_rate(struct clk *clk)
1401{
1402 return clk->rate;
1403}
1404
1405static int exynos4_vpll_set_rate(struct clk *clk, unsigned long rate)
1406{
1407 unsigned int vpll_con0, vpll_con1 = 0;
1408 unsigned int i;
1409
1410 /* Return if nothing changed */
1411 if (clk->rate == rate)
1412 return 0;
1413
Kukjin Kima8550392012-03-09 14:19:10 -08001414 vpll_con0 = __raw_readl(EXYNOS4_VPLL_CON0);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001415 vpll_con0 &= ~(0x1 << 27 | \
1416 PLL90XX_MDIV_MASK << PLL46XX_MDIV_SHIFT | \
1417 PLL90XX_PDIV_MASK << PLL46XX_PDIV_SHIFT | \
1418 PLL90XX_SDIV_MASK << PLL46XX_SDIV_SHIFT);
1419
Kukjin Kima8550392012-03-09 14:19:10 -08001420 vpll_con1 = __raw_readl(EXYNOS4_VPLL_CON1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001421 vpll_con1 &= ~(PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT | \
1422 PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT | \
1423 PLL4650C_KDIV_MASK << PLL46XX_KDIV_SHIFT);
1424
Kukjin Kima8550392012-03-09 14:19:10 -08001425 for (i = 0; i < ARRAY_SIZE(exynos4_vpll_div); i++) {
1426 if (exynos4_vpll_div[i][0] == rate) {
1427 vpll_con0 |= exynos4_vpll_div[i][1] << PLL46XX_PDIV_SHIFT;
1428 vpll_con0 |= exynos4_vpll_div[i][2] << PLL46XX_MDIV_SHIFT;
1429 vpll_con0 |= exynos4_vpll_div[i][3] << PLL46XX_SDIV_SHIFT;
1430 vpll_con1 |= exynos4_vpll_div[i][4] << PLL46XX_KDIV_SHIFT;
1431 vpll_con1 |= exynos4_vpll_div[i][5] << PLL46XX_MFR_SHIFT;
1432 vpll_con1 |= exynos4_vpll_div[i][6] << PLL46XX_MRR_SHIFT;
1433 vpll_con0 |= exynos4_vpll_div[i][7] << 27;
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001434 break;
1435 }
1436 }
1437
Kukjin Kima8550392012-03-09 14:19:10 -08001438 if (i == ARRAY_SIZE(exynos4_vpll_div)) {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001439 printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n",
1440 __func__);
1441 return -EINVAL;
1442 }
1443
Kukjin Kima8550392012-03-09 14:19:10 -08001444 __raw_writel(vpll_con0, EXYNOS4_VPLL_CON0);
1445 __raw_writel(vpll_con1, EXYNOS4_VPLL_CON1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001446
1447 /* Wait for VPLL lock */
Kukjin Kima8550392012-03-09 14:19:10 -08001448 while (!(__raw_readl(EXYNOS4_VPLL_CON0) & (1 << PLL46XX_LOCKED_SHIFT)))
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001449 continue;
1450
1451 clk->rate = rate;
1452 return 0;
1453}
1454
1455static struct clk_ops exynos4_vpll_ops = {
1456 .get_rate = exynos4_vpll_get_rate,
1457 .set_rate = exynos4_vpll_set_rate,
1458};
1459
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001460void __init_or_cpufreq exynos4_setup_clocks(void)
Changhwan Younc8bef142010-07-27 17:52:39 +09001461{
1462 struct clk *xtal_clk;
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001463 unsigned long apll = 0;
1464 unsigned long mpll = 0;
1465 unsigned long epll = 0;
1466 unsigned long vpll = 0;
Changhwan Younc8bef142010-07-27 17:52:39 +09001467 unsigned long vpllsrc;
1468 unsigned long xtal;
1469 unsigned long armclk;
Changhwan Younc8bef142010-07-27 17:52:39 +09001470 unsigned long sclk_dmc;
Jongpill Lee228ef982010-08-18 22:24:53 +09001471 unsigned long aclk_200;
1472 unsigned long aclk_100;
1473 unsigned long aclk_160;
1474 unsigned long aclk_133;
Changhwan Younc8bef142010-07-27 17:52:39 +09001475 unsigned int ptr;
1476
1477 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
1478
1479 xtal_clk = clk_get(NULL, "xtal");
1480 BUG_ON(IS_ERR(xtal_clk));
1481
1482 xtal = clk_get_rate(xtal_clk);
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001483
1484 xtal_rate = xtal;
1485
Changhwan Younc8bef142010-07-27 17:52:39 +09001486 clk_put(xtal_clk);
1487
1488 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
1489
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001490 if (soc_is_exynos4210()) {
Kukjin Kima8550392012-03-09 14:19:10 -08001491 apll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_APLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001492 pll_4508);
Kukjin Kima8550392012-03-09 14:19:10 -08001493 mpll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001494 pll_4508);
Kukjin Kima8550392012-03-09 14:19:10 -08001495 epll = s5p_get_pll46xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0),
1496 __raw_readl(EXYNOS4_EPLL_CON1), pll_4600);
Changhwan Younc8bef142010-07-27 17:52:39 +09001497
Kukjin Kima8550392012-03-09 14:19:10 -08001498 vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk);
1499 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0),
1500 __raw_readl(EXYNOS4_VPLL_CON1), pll_4650c);
Changhwan Younb88b1cc2011-10-04 17:08:56 +09001501 } else if (soc_is_exynos4212() || soc_is_exynos4412()) {
Kukjin Kima8550392012-03-09 14:19:10 -08001502 apll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_APLL_CON0));
1503 mpll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0));
1504 epll = s5p_get_pll36xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0),
1505 __raw_readl(EXYNOS4_EPLL_CON1));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001506
Kukjin Kima8550392012-03-09 14:19:10 -08001507 vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk);
1508 vpll = s5p_get_pll36xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0),
1509 __raw_readl(EXYNOS4_VPLL_CON1));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001510 } else {
1511 /* nothing */
1512 }
Changhwan Younc8bef142010-07-27 17:52:39 +09001513
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001514 clk_fout_apll.ops = &exynos4_fout_apll_ops;
Changhwan Younc8bef142010-07-27 17:52:39 +09001515 clk_fout_mpll.rate = mpll;
1516 clk_fout_epll.rate = epll;
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001517 clk_fout_vpll.ops = &exynos4_vpll_ops;
Changhwan Younc8bef142010-07-27 17:52:39 +09001518 clk_fout_vpll.rate = vpll;
1519
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001520 printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
Changhwan Younc8bef142010-07-27 17:52:39 +09001521 apll, mpll, epll, vpll);
1522
Kukjin Kima8550392012-03-09 14:19:10 -08001523 armclk = clk_get_rate(&exynos4_clk_armclk.clk);
1524 sclk_dmc = clk_get_rate(&exynos4_clk_sclk_dmc.clk);
Changhwan Younc8bef142010-07-27 17:52:39 +09001525
Kukjin Kima8550392012-03-09 14:19:10 -08001526 aclk_200 = clk_get_rate(&exynos4_clk_aclk_200.clk);
1527 aclk_100 = clk_get_rate(&exynos4_clk_aclk_100.clk);
1528 aclk_160 = clk_get_rate(&exynos4_clk_aclk_160.clk);
1529 aclk_133 = clk_get_rate(&exynos4_clk_aclk_133.clk);
Jongpill Lee228ef982010-08-18 22:24:53 +09001530
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001531 printk(KERN_INFO "EXYNOS4: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n"
Jongpill Lee228ef982010-08-18 22:24:53 +09001532 "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n",
1533 armclk, sclk_dmc, aclk_200,
1534 aclk_100, aclk_160, aclk_133);
Changhwan Younc8bef142010-07-27 17:52:39 +09001535
1536 clk_f.rate = armclk;
1537 clk_h.rate = sclk_dmc;
Jongpill Lee228ef982010-08-18 22:24:53 +09001538 clk_p.rate = aclk_100;
Changhwan Younc8bef142010-07-27 17:52:39 +09001539
Kukjin Kima8550392012-03-09 14:19:10 -08001540 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrcs); ptr++)
1541 s3c_set_clksrc(&exynos4_clksrcs[ptr], true);
Changhwan Younc8bef142010-07-27 17:52:39 +09001542}
1543
Kukjin Kima8550392012-03-09 14:19:10 -08001544static struct clk *exynos4_clks[] __initdata = {
1545 &exynos4_clk_sclk_hdmi27m,
1546 &exynos4_clk_sclk_hdmiphy,
1547 &exynos4_clk_sclk_usbphy0,
1548 &exynos4_clk_sclk_usbphy1,
Changhwan Younc8bef142010-07-27 17:52:39 +09001549};
1550
Jonghwan Choiacd35612011-08-24 21:52:45 +09001551#ifdef CONFIG_PM_SLEEP
1552static int exynos4_clock_suspend(void)
1553{
1554 s3c_pm_do_save(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save));
1555 return 0;
1556}
1557
1558static void exynos4_clock_resume(void)
1559{
1560 s3c_pm_do_restore_core(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save));
1561}
1562
1563#else
1564#define exynos4_clock_suspend NULL
1565#define exynos4_clock_resume NULL
1566#endif
1567
Kukjin Kime745e062012-01-21 10:47:14 +09001568static struct syscore_ops exynos4_clock_syscore_ops = {
Jonghwan Choiacd35612011-08-24 21:52:45 +09001569 .suspend = exynos4_clock_suspend,
1570 .resume = exynos4_clock_resume,
1571};
1572
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001573void __init exynos4_register_clocks(void)
Changhwan Younc8bef142010-07-27 17:52:39 +09001574{
Changhwan Younc8bef142010-07-27 17:52:39 +09001575 int ptr;
1576
Kukjin Kima8550392012-03-09 14:19:10 -08001577 s3c24xx_register_clocks(exynos4_clks, ARRAY_SIZE(exynos4_clks));
Changhwan Younc8bef142010-07-27 17:52:39 +09001578
Kukjin Kima8550392012-03-09 14:19:10 -08001579 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sysclks); ptr++)
1580 s3c_register_clksrc(exynos4_sysclks[ptr], 1);
Changhwan Younc8bef142010-07-27 17:52:39 +09001581
Kukjin Kima8550392012-03-09 14:19:10 -08001582 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sclk_tv); ptr++)
1583 s3c_register_clksrc(exynos4_sclk_tv[ptr], 1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001584
Kukjin Kima8550392012-03-09 14:19:10 -08001585 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrc_cdev); ptr++)
1586 s3c_register_clksrc(exynos4_clksrc_cdev[ptr], 1);
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001587
Kukjin Kima8550392012-03-09 14:19:10 -08001588 s3c_register_clksrc(exynos4_clksrcs, ARRAY_SIZE(exynos4_clksrcs));
1589 s3c_register_clocks(exynos4_init_clocks_on, ARRAY_SIZE(exynos4_init_clocks_on));
Changhwan Younc8bef142010-07-27 17:52:39 +09001590
Kukjin Kima8550392012-03-09 14:19:10 -08001591 s3c24xx_register_clocks(exynos4_clk_cdev, ARRAY_SIZE(exynos4_clk_cdev));
1592 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clk_cdev); ptr++)
1593 s3c_disable_clocks(exynos4_clk_cdev[ptr], 1);
Thomas Abraham66fdb292011-10-24 14:01:03 +02001594
Kukjin Kima8550392012-03-09 14:19:10 -08001595 s3c_register_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off));
1596 s3c_disable_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off));
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001597 clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup));
Changhwan Younc8bef142010-07-27 17:52:39 +09001598
Jonghwan Choiacd35612011-08-24 21:52:45 +09001599 register_syscore_ops(&exynos4_clock_syscore_ops);
Boojin Kimbf856fb2011-09-02 09:44:36 +09001600 s3c24xx_register_clock(&dummy_apb_pclk);
1601
Changhwan Younc8bef142010-07-27 17:52:39 +09001602 s3c_pwmclk_init();
1603}