blob: 8a8468d83c8c421e2853f125da2adfbaf31f1da3 [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>
27
Kukjin Kimcc511b82011-12-27 08:18:36 +010028#include "common.h"
Kukjin Kimce9c00e2012-03-09 13:51:24 -080029#include "clock-exynos4.h"
Kukjin Kimcc511b82011-12-27 08:18:36 +010030
Kukjin Kim7cdf04d2012-01-27 14:56:17 +090031#ifdef CONFIG_PM_SLEEP
Jonghwan Choiacd35612011-08-24 21:52:45 +090032static struct sleep_save exynos4_clock_save[] = {
Kukjin Kima8550392012-03-09 14:19:10 -080033 SAVE_ITEM(EXYNOS4_CLKDIV_LEFTBUS),
34 SAVE_ITEM(EXYNOS4_CLKGATE_IP_LEFTBUS),
35 SAVE_ITEM(EXYNOS4_CLKDIV_RIGHTBUS),
36 SAVE_ITEM(EXYNOS4_CLKGATE_IP_RIGHTBUS),
37 SAVE_ITEM(EXYNOS4_CLKSRC_TOP0),
38 SAVE_ITEM(EXYNOS4_CLKSRC_TOP1),
39 SAVE_ITEM(EXYNOS4_CLKSRC_CAM),
40 SAVE_ITEM(EXYNOS4_CLKSRC_TV),
41 SAVE_ITEM(EXYNOS4_CLKSRC_MFC),
42 SAVE_ITEM(EXYNOS4_CLKSRC_G3D),
43 SAVE_ITEM(EXYNOS4_CLKSRC_LCD0),
44 SAVE_ITEM(EXYNOS4_CLKSRC_MAUDIO),
45 SAVE_ITEM(EXYNOS4_CLKSRC_FSYS),
46 SAVE_ITEM(EXYNOS4_CLKSRC_PERIL0),
47 SAVE_ITEM(EXYNOS4_CLKSRC_PERIL1),
48 SAVE_ITEM(EXYNOS4_CLKDIV_CAM),
49 SAVE_ITEM(EXYNOS4_CLKDIV_TV),
50 SAVE_ITEM(EXYNOS4_CLKDIV_MFC),
51 SAVE_ITEM(EXYNOS4_CLKDIV_G3D),
52 SAVE_ITEM(EXYNOS4_CLKDIV_LCD0),
53 SAVE_ITEM(EXYNOS4_CLKDIV_MAUDIO),
54 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS0),
55 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS1),
56 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS2),
57 SAVE_ITEM(EXYNOS4_CLKDIV_FSYS3),
58 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL0),
59 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL1),
60 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL2),
61 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL3),
62 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL4),
63 SAVE_ITEM(EXYNOS4_CLKDIV_PERIL5),
64 SAVE_ITEM(EXYNOS4_CLKDIV_TOP),
65 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_TOP),
66 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_CAM),
67 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_TV),
68 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_LCD0),
69 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_MAUDIO),
70 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_FSYS),
71 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_PERIL0),
72 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_PERIL1),
73 SAVE_ITEM(EXYNOS4_CLKDIV2_RATIO),
74 SAVE_ITEM(EXYNOS4_CLKGATE_SCLKCAM),
75 SAVE_ITEM(EXYNOS4_CLKGATE_IP_CAM),
76 SAVE_ITEM(EXYNOS4_CLKGATE_IP_TV),
77 SAVE_ITEM(EXYNOS4_CLKGATE_IP_MFC),
78 SAVE_ITEM(EXYNOS4_CLKGATE_IP_G3D),
79 SAVE_ITEM(EXYNOS4_CLKGATE_IP_LCD0),
80 SAVE_ITEM(EXYNOS4_CLKGATE_IP_FSYS),
81 SAVE_ITEM(EXYNOS4_CLKGATE_IP_GPS),
82 SAVE_ITEM(EXYNOS4_CLKGATE_IP_PERIL),
83 SAVE_ITEM(EXYNOS4_CLKGATE_BLOCK),
84 SAVE_ITEM(EXYNOS4_CLKSRC_MASK_DMC),
85 SAVE_ITEM(EXYNOS4_CLKSRC_DMC),
86 SAVE_ITEM(EXYNOS4_CLKDIV_DMC0),
87 SAVE_ITEM(EXYNOS4_CLKDIV_DMC1),
88 SAVE_ITEM(EXYNOS4_CLKGATE_IP_DMC),
89 SAVE_ITEM(EXYNOS4_CLKSRC_CPU),
90 SAVE_ITEM(EXYNOS4_CLKDIV_CPU),
91 SAVE_ITEM(EXYNOS4_CLKDIV_CPU + 0x4),
92 SAVE_ITEM(EXYNOS4_CLKGATE_SCLKCPU),
93 SAVE_ITEM(EXYNOS4_CLKGATE_IP_CPU),
Jonghwan Choiacd35612011-08-24 21:52:45 +090094};
Kukjin Kim7cdf04d2012-01-27 14:56:17 +090095#endif
Jonghwan Choiacd35612011-08-24 21:52:45 +090096
Kukjin Kima8550392012-03-09 14:19:10 -080097static struct clk exynos4_clk_sclk_hdmi27m = {
Changhwan Younc8bef142010-07-27 17:52:39 +090098 .name = "sclk_hdmi27m",
Changhwan Younc8bef142010-07-27 17:52:39 +090099 .rate = 27000000,
100};
101
Kukjin Kima8550392012-03-09 14:19:10 -0800102static struct clk exynos4_clk_sclk_hdmiphy = {
Jongpill Leeb99380e2010-08-18 22:16:45 +0900103 .name = "sclk_hdmiphy",
Jongpill Leeb99380e2010-08-18 22:16:45 +0900104};
105
Kukjin Kima8550392012-03-09 14:19:10 -0800106static struct clk exynos4_clk_sclk_usbphy0 = {
Jongpill Leeb99380e2010-08-18 22:16:45 +0900107 .name = "sclk_usbphy0",
Jongpill Leeb99380e2010-08-18 22:16:45 +0900108 .rate = 27000000,
109};
110
Kukjin Kima8550392012-03-09 14:19:10 -0800111static struct clk exynos4_clk_sclk_usbphy1 = {
Jongpill Leeb99380e2010-08-18 22:16:45 +0900112 .name = "sclk_usbphy1",
Jongpill Leeb99380e2010-08-18 22:16:45 +0900113};
114
Boojin Kimbf856fb2011-09-02 09:44:36 +0900115static struct clk dummy_apb_pclk = {
116 .name = "apb_pclk",
117 .id = -1,
118};
119
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900120static int exynos4_clksrc_mask_top_ctrl(struct clk *clk, int enable)
Jongpill Lee37e01722010-08-18 22:33:43 +0900121{
Kukjin Kima8550392012-03-09 14:19:10 -0800122 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_TOP, clk, enable);
Jongpill Lee37e01722010-08-18 22:33:43 +0900123}
124
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900125static int exynos4_clksrc_mask_cam_ctrl(struct clk *clk, int enable)
Jongpill Lee33f469d2010-08-18 22:54:48 +0900126{
Kukjin Kima8550392012-03-09 14:19:10 -0800127 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_CAM, clk, enable);
Jongpill Lee33f469d2010-08-18 22:54:48 +0900128}
129
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900130static int exynos4_clksrc_mask_lcd0_ctrl(struct clk *clk, int enable)
Jongpill Lee33f469d2010-08-18 22:54:48 +0900131{
Kukjin Kima8550392012-03-09 14:19:10 -0800132 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_LCD0, clk, enable);
Jongpill Lee33f469d2010-08-18 22:54:48 +0900133}
134
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900135int exynos4_clksrc_mask_fsys_ctrl(struct clk *clk, int enable)
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900136{
Kukjin Kima8550392012-03-09 14:19:10 -0800137 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_FSYS, clk, enable);
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900138}
139
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900140static int exynos4_clksrc_mask_peril0_ctrl(struct clk *clk, int enable)
Jongpill Lee3297c2e2010-08-27 17:53:26 +0900141{
Kukjin Kima8550392012-03-09 14:19:10 -0800142 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_PERIL0, clk, enable);
Jongpill Lee3297c2e2010-08-27 17:53:26 +0900143}
144
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900145static int exynos4_clksrc_mask_peril1_ctrl(struct clk *clk, int enable)
Jongpill Lee33f469d2010-08-18 22:54:48 +0900146{
Kukjin Kima8550392012-03-09 14:19:10 -0800147 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_PERIL1, clk, enable);
Jongpill Lee33f469d2010-08-18 22:54:48 +0900148}
149
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900150static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable)
151{
Kukjin Kima8550392012-03-09 14:19:10 -0800152 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_MFC, clk, enable);
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900153}
154
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900155static int exynos4_clksrc_mask_tv_ctrl(struct clk *clk, int enable)
156{
Kukjin Kima8550392012-03-09 14:19:10 -0800157 return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_TV, clk, enable);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900158}
159
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900160static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900161{
Kukjin Kima8550392012-03-09 14:19:10 -0800162 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_CAM, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900163}
164
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900165static int exynos4_clk_ip_tv_ctrl(struct clk *clk, int enable)
166{
Kukjin Kima8550392012-03-09 14:19:10 -0800167 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_TV, clk, enable);
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900168}
169
KyongHo Chobca10b92012-04-04 09:23:02 -0700170int exynos4_clk_ip_image_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900171{
Kukjin Kima8550392012-03-09 14:19:10 -0800172 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_IMAGE, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900173}
174
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900175static int exynos4_clk_ip_lcd0_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900176{
Kukjin Kima8550392012-03-09 14:19:10 -0800177 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_LCD0, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900178}
179
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900180int exynos4_clk_ip_lcd1_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900181{
Kukjin Kima8550392012-03-09 14:19:10 -0800182 return s5p_gatectrl(EXYNOS4210_CLKGATE_IP_LCD1, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900183}
184
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900185int exynos4_clk_ip_fsys_ctrl(struct clk *clk, int enable)
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900186{
Kukjin Kima8550392012-03-09 14:19:10 -0800187 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_FSYS, clk, enable);
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900188}
189
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900190static int exynos4_clk_ip_peril_ctrl(struct clk *clk, int enable)
Jongpill Lee5a847b42010-08-27 16:50:47 +0900191{
Kukjin Kima8550392012-03-09 14:19:10 -0800192 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_PERIL, clk, enable);
Jongpill Lee5a847b42010-08-27 16:50:47 +0900193}
194
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900195static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable)
Jongpill Lee82260bf2010-08-18 22:49:24 +0900196{
Kukjin Kima8550392012-03-09 14:19:10 -0800197 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_PERIR, clk, enable);
Jongpill Lee82260bf2010-08-18 22:49:24 +0900198}
199
KyongHo Chobca10b92012-04-04 09:23:02 -0700200int exynos4_clk_ip_dmc_ctrl(struct clk *clk, int enable)
201{
202 return s5p_gatectrl(EXYNOS4_CLKGATE_IP_DMC, clk, enable);
203}
204
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900205static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
206{
207 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
208}
209
210static int exynos4_clk_dac_ctrl(struct clk *clk, int enable)
211{
212 return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable);
213}
214
Changhwan Younc8bef142010-07-27 17:52:39 +0900215/* Core list of CMU_CPU side */
216
Kukjin Kima8550392012-03-09 14:19:10 -0800217static struct clksrc_clk exynos4_clk_mout_apll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900218 .clk = {
219 .name = "mout_apll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900220 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800221 .sources = &clk_src_apll,
Kukjin Kima8550392012-03-09 14:19:10 -0800222 .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 0, .size = 1 },
Jongpill Lee3ff31022010-08-18 22:20:31 +0900223};
224
Kukjin Kima8550392012-03-09 14:19:10 -0800225static struct clksrc_clk exynos4_clk_sclk_apll = {
Jongpill Lee3ff31022010-08-18 22:20:31 +0900226 .clk = {
227 .name = "sclk_apll",
Kukjin Kima8550392012-03-09 14:19:10 -0800228 .parent = &exynos4_clk_mout_apll.clk,
Jongpill Lee3ff31022010-08-18 22:20:31 +0900229 },
Kukjin Kima8550392012-03-09 14:19:10 -0800230 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 24, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900231};
232
Kukjin Kima8550392012-03-09 14:19:10 -0800233static struct clksrc_clk exynos4_clk_mout_epll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900234 .clk = {
235 .name = "mout_epll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900236 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800237 .sources = &clk_src_epll,
Kukjin Kima8550392012-03-09 14:19:10 -0800238 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 4, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900239};
240
Kukjin Kima8550392012-03-09 14:19:10 -0800241struct clksrc_clk exynos4_clk_mout_mpll = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800242 .clk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900243 .name = "mout_mpll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900244 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800245 .sources = &clk_src_mpll,
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900246
247 /* reg_src will be added in each SoCs' clock */
Changhwan Younc8bef142010-07-27 17:52:39 +0900248};
249
Kukjin Kima8550392012-03-09 14:19:10 -0800250static struct clk *exynos4_clkset_moutcore_list[] = {
251 [0] = &exynos4_clk_mout_apll.clk,
252 [1] = &exynos4_clk_mout_mpll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900253};
254
Kukjin Kima8550392012-03-09 14:19:10 -0800255static struct clksrc_sources exynos4_clkset_moutcore = {
256 .sources = exynos4_clkset_moutcore_list,
257 .nr_sources = ARRAY_SIZE(exynos4_clkset_moutcore_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900258};
259
Kukjin Kima8550392012-03-09 14:19:10 -0800260static struct clksrc_clk exynos4_clk_moutcore = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900261 .clk = {
262 .name = "moutcore",
Changhwan Younc8bef142010-07-27 17:52:39 +0900263 },
Kukjin Kima8550392012-03-09 14:19:10 -0800264 .sources = &exynos4_clkset_moutcore,
265 .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 16, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900266};
267
Kukjin Kima8550392012-03-09 14:19:10 -0800268static struct clksrc_clk exynos4_clk_coreclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900269 .clk = {
270 .name = "core_clk",
Kukjin Kima8550392012-03-09 14:19:10 -0800271 .parent = &exynos4_clk_moutcore.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900272 },
Kukjin Kima8550392012-03-09 14:19:10 -0800273 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900274};
275
Kukjin Kima8550392012-03-09 14:19:10 -0800276static struct clksrc_clk exynos4_clk_armclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900277 .clk = {
278 .name = "armclk",
Kukjin Kima8550392012-03-09 14:19:10 -0800279 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900280 },
281};
282
Kukjin Kima8550392012-03-09 14:19:10 -0800283static struct clksrc_clk exynos4_clk_aclk_corem0 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900284 .clk = {
285 .name = "aclk_corem0",
Kukjin Kima8550392012-03-09 14:19:10 -0800286 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900287 },
Kukjin Kima8550392012-03-09 14:19:10 -0800288 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900289};
290
Kukjin Kima8550392012-03-09 14:19:10 -0800291static struct clksrc_clk exynos4_clk_aclk_cores = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900292 .clk = {
293 .name = "aclk_cores",
Kukjin Kima8550392012-03-09 14:19:10 -0800294 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900295 },
Kukjin Kima8550392012-03-09 14:19:10 -0800296 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900297};
298
Kukjin Kima8550392012-03-09 14:19:10 -0800299static struct clksrc_clk exynos4_clk_aclk_corem1 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900300 .clk = {
301 .name = "aclk_corem1",
Kukjin Kima8550392012-03-09 14:19:10 -0800302 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900303 },
Kukjin Kima8550392012-03-09 14:19:10 -0800304 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 8, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900305};
306
Kukjin Kima8550392012-03-09 14:19:10 -0800307static struct clksrc_clk exynos4_clk_periphclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900308 .clk = {
309 .name = "periphclk",
Kukjin Kima8550392012-03-09 14:19:10 -0800310 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900311 },
Kukjin Kima8550392012-03-09 14:19:10 -0800312 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900313};
314
Changhwan Younc8bef142010-07-27 17:52:39 +0900315/* Core list of CMU_CORE side */
316
Kukjin Kima8550392012-03-09 14:19:10 -0800317static struct clk *exynos4_clkset_corebus_list[] = {
318 [0] = &exynos4_clk_mout_mpll.clk,
319 [1] = &exynos4_clk_sclk_apll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900320};
321
Kukjin Kima8550392012-03-09 14:19:10 -0800322struct clksrc_sources exynos4_clkset_mout_corebus = {
323 .sources = exynos4_clkset_corebus_list,
324 .nr_sources = ARRAY_SIZE(exynos4_clkset_corebus_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900325};
326
Kukjin Kima8550392012-03-09 14:19:10 -0800327static struct clksrc_clk exynos4_clk_mout_corebus = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900328 .clk = {
329 .name = "mout_corebus",
Changhwan Younc8bef142010-07-27 17:52:39 +0900330 },
Kukjin Kima8550392012-03-09 14:19:10 -0800331 .sources = &exynos4_clkset_mout_corebus,
332 .reg_src = { .reg = EXYNOS4_CLKSRC_DMC, .shift = 4, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900333};
334
Kukjin Kima8550392012-03-09 14:19:10 -0800335static struct clksrc_clk exynos4_clk_sclk_dmc = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900336 .clk = {
337 .name = "sclk_dmc",
Kukjin Kima8550392012-03-09 14:19:10 -0800338 .parent = &exynos4_clk_mout_corebus.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900339 },
Kukjin Kima8550392012-03-09 14:19:10 -0800340 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900341};
342
Kukjin Kima8550392012-03-09 14:19:10 -0800343static struct clksrc_clk exynos4_clk_aclk_cored = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900344 .clk = {
345 .name = "aclk_cored",
Kukjin Kima8550392012-03-09 14:19:10 -0800346 .parent = &exynos4_clk_sclk_dmc.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900347 },
Kukjin Kima8550392012-03-09 14:19:10 -0800348 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 16, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900349};
350
Kukjin Kima8550392012-03-09 14:19:10 -0800351static struct clksrc_clk exynos4_clk_aclk_corep = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900352 .clk = {
353 .name = "aclk_corep",
Kukjin Kima8550392012-03-09 14:19:10 -0800354 .parent = &exynos4_clk_aclk_cored.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900355 },
Kukjin Kima8550392012-03-09 14:19:10 -0800356 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 20, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900357};
358
Kukjin Kima8550392012-03-09 14:19:10 -0800359static struct clksrc_clk exynos4_clk_aclk_acp = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900360 .clk = {
361 .name = "aclk_acp",
Kukjin Kima8550392012-03-09 14:19:10 -0800362 .parent = &exynos4_clk_mout_corebus.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900363 },
Kukjin Kima8550392012-03-09 14:19:10 -0800364 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900365};
366
Kukjin Kima8550392012-03-09 14:19:10 -0800367static struct clksrc_clk exynos4_clk_pclk_acp = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900368 .clk = {
369 .name = "pclk_acp",
Kukjin Kima8550392012-03-09 14:19:10 -0800370 .parent = &exynos4_clk_aclk_acp.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900371 },
Kukjin Kima8550392012-03-09 14:19:10 -0800372 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900373};
374
375/* Core list of CMU_TOP side */
376
Kukjin Kima8550392012-03-09 14:19:10 -0800377struct clk *exynos4_clkset_aclk_top_list[] = {
378 [0] = &exynos4_clk_mout_mpll.clk,
379 [1] = &exynos4_clk_sclk_apll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900380};
381
Kukjin Kima8550392012-03-09 14:19:10 -0800382static struct clksrc_sources exynos4_clkset_aclk = {
383 .sources = exynos4_clkset_aclk_top_list,
384 .nr_sources = ARRAY_SIZE(exynos4_clkset_aclk_top_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900385};
386
Kukjin Kima8550392012-03-09 14:19:10 -0800387static struct clksrc_clk exynos4_clk_aclk_200 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900388 .clk = {
389 .name = "aclk_200",
Changhwan Younc8bef142010-07-27 17:52:39 +0900390 },
Kukjin Kima8550392012-03-09 14:19:10 -0800391 .sources = &exynos4_clkset_aclk,
392 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 12, .size = 1 },
393 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900394};
395
Kukjin Kima8550392012-03-09 14:19:10 -0800396static struct clksrc_clk exynos4_clk_aclk_100 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900397 .clk = {
398 .name = "aclk_100",
Changhwan Younc8bef142010-07-27 17:52:39 +0900399 },
Kukjin Kima8550392012-03-09 14:19:10 -0800400 .sources = &exynos4_clkset_aclk,
401 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 16, .size = 1 },
402 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 4, .size = 4 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900403};
404
Kukjin Kima8550392012-03-09 14:19:10 -0800405static struct clksrc_clk exynos4_clk_aclk_160 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900406 .clk = {
407 .name = "aclk_160",
Changhwan Younc8bef142010-07-27 17:52:39 +0900408 },
Kukjin Kima8550392012-03-09 14:19:10 -0800409 .sources = &exynos4_clkset_aclk,
410 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 20, .size = 1 },
411 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 8, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900412};
413
Kukjin Kima8550392012-03-09 14:19:10 -0800414struct clksrc_clk exynos4_clk_aclk_133 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900415 .clk = {
416 .name = "aclk_133",
Changhwan Younc8bef142010-07-27 17:52:39 +0900417 },
Kukjin Kima8550392012-03-09 14:19:10 -0800418 .sources = &exynos4_clkset_aclk,
419 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 24, .size = 1 },
420 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900421};
422
Kukjin Kima8550392012-03-09 14:19:10 -0800423static struct clk *exynos4_clkset_vpllsrc_list[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900424 [0] = &clk_fin_vpll,
Kukjin Kima8550392012-03-09 14:19:10 -0800425 [1] = &exynos4_clk_sclk_hdmi27m,
Changhwan Younc8bef142010-07-27 17:52:39 +0900426};
427
Kukjin Kima8550392012-03-09 14:19:10 -0800428static struct clksrc_sources exynos4_clkset_vpllsrc = {
429 .sources = exynos4_clkset_vpllsrc_list,
430 .nr_sources = ARRAY_SIZE(exynos4_clkset_vpllsrc_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900431};
432
Kukjin Kima8550392012-03-09 14:19:10 -0800433static struct clksrc_clk exynos4_clk_vpllsrc = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900434 .clk = {
435 .name = "vpll_src",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900436 .enable = exynos4_clksrc_mask_top_ctrl,
Jongpill Lee37e01722010-08-18 22:33:43 +0900437 .ctrlbit = (1 << 0),
Changhwan Younc8bef142010-07-27 17:52:39 +0900438 },
Kukjin Kima8550392012-03-09 14:19:10 -0800439 .sources = &exynos4_clkset_vpllsrc,
440 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP1, .shift = 0, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900441};
442
Kukjin Kima8550392012-03-09 14:19:10 -0800443static struct clk *exynos4_clkset_sclk_vpll_list[] = {
444 [0] = &exynos4_clk_vpllsrc.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900445 [1] = &clk_fout_vpll,
446};
447
Kukjin Kima8550392012-03-09 14:19:10 -0800448static struct clksrc_sources exynos4_clkset_sclk_vpll = {
449 .sources = exynos4_clkset_sclk_vpll_list,
450 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_vpll_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900451};
452
Kukjin Kima8550392012-03-09 14:19:10 -0800453static struct clksrc_clk exynos4_clk_sclk_vpll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900454 .clk = {
455 .name = "sclk_vpll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900456 },
Kukjin Kima8550392012-03-09 14:19:10 -0800457 .sources = &exynos4_clkset_sclk_vpll,
458 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 8, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900459};
460
Kukjin Kima8550392012-03-09 14:19:10 -0800461static struct clk exynos4_init_clocks_off[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900462 {
463 .name = "timers",
Kukjin Kima8550392012-03-09 14:19:10 -0800464 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900465 .enable = exynos4_clk_ip_peril_ctrl,
Changhwan Younc8bef142010-07-27 17:52:39 +0900466 .ctrlbit = (1<<24),
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900467 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900468 .name = "csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900469 .devname = "s5p-mipi-csis.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900470 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900471 .ctrlbit = (1 << 4),
472 }, {
473 .name = "csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900474 .devname = "s5p-mipi-csis.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900475 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900476 .ctrlbit = (1 << 5),
477 }, {
Arnd Bergmann853a0232012-03-15 21:22:00 +0000478 .name = "jpeg",
479 .id = 0,
480 .enable = exynos4_clk_ip_cam_ctrl,
481 .ctrlbit = (1 << 6),
482 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900483 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900484 .devname = "exynos4-fimc.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900485 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900486 .ctrlbit = (1 << 0),
487 }, {
488 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900489 .devname = "exynos4-fimc.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900490 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900491 .ctrlbit = (1 << 1),
492 }, {
493 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900494 .devname = "exynos4-fimc.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900495 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900496 .ctrlbit = (1 << 2),
497 }, {
498 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900499 .devname = "exynos4-fimc.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900500 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900501 .ctrlbit = (1 << 3),
502 }, {
Chander Kashyap1f926c42012-08-28 11:38:18 -0700503 .name = "tsi",
504 .enable = exynos4_clk_ip_fsys_ctrl,
505 .ctrlbit = (1 << 4),
506 }, {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900507 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700508 .devname = "exynos4-sdhci.0",
Kukjin Kima8550392012-03-09 14:19:10 -0800509 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900510 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900511 .ctrlbit = (1 << 5),
512 }, {
513 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700514 .devname = "exynos4-sdhci.1",
Kukjin Kima8550392012-03-09 14:19:10 -0800515 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900516 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900517 .ctrlbit = (1 << 6),
518 }, {
519 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700520 .devname = "exynos4-sdhci.2",
Kukjin Kima8550392012-03-09 14:19:10 -0800521 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900522 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900523 .ctrlbit = (1 << 7),
524 }, {
525 .name = "hsmmc",
Thomas Abraham8482c812012-04-14 08:04:46 -0700526 .devname = "exynos4-sdhci.3",
Kukjin Kima8550392012-03-09 14:19:10 -0800527 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900528 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900529 .ctrlbit = (1 << 8),
530 }, {
Dongjin Kim454696f2012-12-18 08:57:06 -0800531 .name = "biu",
Kukjin Kima8550392012-03-09 14:19:10 -0800532 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900533 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900534 .ctrlbit = (1 << 9),
Jongpill Lee82260bf2010-08-18 22:49:24 +0900535 }, {
Chander Kashyap1f926c42012-08-28 11:38:18 -0700536 .name = "onenand",
537 .enable = exynos4_clk_ip_fsys_ctrl,
538 .ctrlbit = (1 << 15),
539 }, {
540 .name = "nfcon",
541 .enable = exynos4_clk_ip_fsys_ctrl,
542 .ctrlbit = (1 << 16),
543 }, {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900544 .name = "dac",
545 .devname = "s5p-sdo",
546 .enable = exynos4_clk_ip_tv_ctrl,
547 .ctrlbit = (1 << 2),
548 }, {
549 .name = "mixer",
550 .devname = "s5p-mixer",
551 .enable = exynos4_clk_ip_tv_ctrl,
552 .ctrlbit = (1 << 1),
553 }, {
554 .name = "vp",
555 .devname = "s5p-mixer",
556 .enable = exynos4_clk_ip_tv_ctrl,
557 .ctrlbit = (1 << 0),
558 }, {
559 .name = "hdmi",
560 .devname = "exynos4-hdmi",
561 .enable = exynos4_clk_ip_tv_ctrl,
562 .ctrlbit = (1 << 3),
563 }, {
564 .name = "hdmiphy",
565 .devname = "exynos4-hdmi",
566 .enable = exynos4_clk_hdmiphy_ctrl,
567 .ctrlbit = (1 << 0),
568 }, {
569 .name = "dacphy",
570 .devname = "s5p-sdo",
571 .enable = exynos4_clk_dac_ctrl,
572 .ctrlbit = (1 << 0),
573 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900574 .name = "adc",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900575 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900576 .ctrlbit = (1 << 15),
577 }, {
Amit Daniel Kachhap8d4155d2012-10-29 21:18:01 +0900578 .name = "tmu_apbif",
579 .enable = exynos4_clk_ip_perir_ctrl,
580 .ctrlbit = (1 << 17),
581 }, {
Naveen Krishna Chf9d7bcb2011-02-22 17:13:42 +0900582 .name = "keypad",
Naveen Krishna Chf9d7bcb2011-02-22 17:13:42 +0900583 .enable = exynos4_clk_ip_perir_ctrl,
584 .ctrlbit = (1 << 16),
585 }, {
Changhwan Youncdff6e62010-09-20 15:25:51 +0900586 .name = "rtc",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900587 .enable = exynos4_clk_ip_perir_ctrl,
Changhwan Youncdff6e62010-09-20 15:25:51 +0900588 .ctrlbit = (1 << 15),
589 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900590 .name = "watchdog",
Kukjin Kima8550392012-03-09 14:19:10 -0800591 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900592 .enable = exynos4_clk_ip_perir_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900593 .ctrlbit = (1 << 14),
594 }, {
595 .name = "usbhost",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900596 .enable = exynos4_clk_ip_fsys_ctrl ,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900597 .ctrlbit = (1 << 12),
598 }, {
599 .name = "otg",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900600 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900601 .ctrlbit = (1 << 13),
602 }, {
603 .name = "spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +0900604 .devname = "exynos4210-spi.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900605 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900606 .ctrlbit = (1 << 16),
607 }, {
608 .name = "spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +0900609 .devname = "exynos4210-spi.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900610 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900611 .ctrlbit = (1 << 17),
612 }, {
613 .name = "spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +0900614 .devname = "exynos4210-spi.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900615 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900616 .ctrlbit = (1 << 18),
617 }, {
Jassi Brar2d270432010-12-21 09:57:03 +0900618 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900619 .devname = "samsung-i2s.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900620 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900621 .ctrlbit = (1 << 20),
622 }, {
623 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900624 .devname = "samsung-i2s.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900625 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900626 .ctrlbit = (1 << 21),
627 }, {
Chander Kashyap377acfb2012-09-21 11:06:00 +0900628 .name = "pcm",
629 .devname = "samsung-pcm.1",
630 .enable = exynos4_clk_ip_peril_ctrl,
631 .ctrlbit = (1 << 22),
632 }, {
633 .name = "pcm",
634 .devname = "samsung-pcm.2",
635 .enable = exynos4_clk_ip_peril_ctrl,
636 .ctrlbit = (1 << 23),
637 }, {
638 .name = "slimbus",
639 .enable = exynos4_clk_ip_peril_ctrl,
640 .ctrlbit = (1 << 25),
641 }, {
642 .name = "spdif",
643 .devname = "samsung-spdif",
644 .enable = exynos4_clk_ip_peril_ctrl,
645 .ctrlbit = (1 << 26),
646 }, {
Jassi Braraa227552010-12-21 09:54:57 +0900647 .name = "ac97",
Jonghwan Choiaf8a9f62011-08-12 18:15:42 +0900648 .devname = "samsung-ac97",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900649 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Braraa227552010-12-21 09:54:57 +0900650 .ctrlbit = (1 << 27),
651 }, {
Kamil Debski0f75a962011-07-21 16:42:30 +0900652 .name = "mfc",
653 .devname = "s5p-mfc",
654 .enable = exynos4_clk_ip_mfc_ctrl,
655 .ctrlbit = (1 << 0),
656 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900657 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900658 .devname = "s3c2440-i2c.0",
Kukjin Kima8550392012-03-09 14:19:10 -0800659 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900660 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900661 .ctrlbit = (1 << 6),
662 }, {
663 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900664 .devname = "s3c2440-i2c.1",
Kukjin Kima8550392012-03-09 14:19:10 -0800665 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900666 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900667 .ctrlbit = (1 << 7),
668 }, {
669 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900670 .devname = "s3c2440-i2c.2",
Kukjin Kima8550392012-03-09 14:19:10 -0800671 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900672 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900673 .ctrlbit = (1 << 8),
674 }, {
675 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900676 .devname = "s3c2440-i2c.3",
Kukjin Kima8550392012-03-09 14:19:10 -0800677 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900678 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900679 .ctrlbit = (1 << 9),
680 }, {
681 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900682 .devname = "s3c2440-i2c.4",
Kukjin Kima8550392012-03-09 14:19:10 -0800683 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900684 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900685 .ctrlbit = (1 << 10),
686 }, {
687 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900688 .devname = "s3c2440-i2c.5",
Kukjin Kima8550392012-03-09 14:19:10 -0800689 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900690 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900691 .ctrlbit = (1 << 11),
692 }, {
693 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900694 .devname = "s3c2440-i2c.6",
Kukjin Kima8550392012-03-09 14:19:10 -0800695 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900696 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900697 .ctrlbit = (1 << 12),
698 }, {
699 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900700 .devname = "s3c2440-i2c.7",
Kukjin Kima8550392012-03-09 14:19:10 -0800701 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900702 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900703 .ctrlbit = (1 << 13),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900704 }, {
Tomasz Stanislawskic40e7e02011-09-16 18:44:36 +0900705 .name = "i2c",
706 .devname = "s3c2440-hdmiphy-i2c",
Kukjin Kima8550392012-03-09 14:19:10 -0800707 .parent = &exynos4_clk_aclk_100.clk,
Tomasz Stanislawskic40e7e02011-09-16 18:44:36 +0900708 .enable = exynos4_clk_ip_peril_ctrl,
709 .ctrlbit = (1 << 14),
710 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900711 .name = "sysmmu",
712 .devname = "exynos-sysmmu.0",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900713 .enable = exynos4_clk_ip_mfc_ctrl,
714 .ctrlbit = (1 << 1),
715 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900716 .name = "sysmmu",
717 .devname = "exynos-sysmmu.1",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900718 .enable = exynos4_clk_ip_mfc_ctrl,
719 .ctrlbit = (1 << 2),
KyongHo Chobca10b92012-04-04 09:23:02 -0700720 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900721 .name = "sysmmu",
722 .devname = "exynos-sysmmu.2",
KyongHo Chobca10b92012-04-04 09:23:02 -0700723 .enable = exynos4_clk_ip_tv_ctrl,
724 .ctrlbit = (1 << 4),
725 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900726 .name = "sysmmu",
727 .devname = "exynos-sysmmu.3",
KyongHo Chobca10b92012-04-04 09:23:02 -0700728 .enable = exynos4_clk_ip_cam_ctrl,
729 .ctrlbit = (1 << 11),
730 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900731 .name = "sysmmu",
732 .devname = "exynos-sysmmu.4",
KyongHo Chobca10b92012-04-04 09:23:02 -0700733 .enable = exynos4_clk_ip_image_ctrl,
734 .ctrlbit = (1 << 4),
735 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900736 .name = "sysmmu",
737 .devname = "exynos-sysmmu.5",
KyongHo Chobca10b92012-04-04 09:23:02 -0700738 .enable = exynos4_clk_ip_cam_ctrl,
739 .ctrlbit = (1 << 7),
740 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900741 .name = "sysmmu",
742 .devname = "exynos-sysmmu.6",
KyongHo Chobca10b92012-04-04 09:23:02 -0700743 .enable = exynos4_clk_ip_cam_ctrl,
744 .ctrlbit = (1 << 8),
745 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900746 .name = "sysmmu",
747 .devname = "exynos-sysmmu.7",
KyongHo Chobca10b92012-04-04 09:23:02 -0700748 .enable = exynos4_clk_ip_cam_ctrl,
749 .ctrlbit = (1 << 9),
750 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900751 .name = "sysmmu",
752 .devname = "exynos-sysmmu.8",
KyongHo Chobca10b92012-04-04 09:23:02 -0700753 .enable = exynos4_clk_ip_cam_ctrl,
754 .ctrlbit = (1 << 10),
755 }, {
Cho KyongHo25e9d282012-12-26 10:54:02 +0900756 .name = "sysmmu",
757 .devname = "exynos-sysmmu.10",
KyongHo Chobca10b92012-04-04 09:23:02 -0700758 .enable = exynos4_clk_ip_lcd0_ctrl,
759 .ctrlbit = (1 << 4),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900760 }
Changhwan Younc8bef142010-07-27 17:52:39 +0900761};
762
Kukjin Kima8550392012-03-09 14:19:10 -0800763static struct clk exynos4_init_clocks_on[] = {
Jongpill Lee5a847b42010-08-27 16:50:47 +0900764 {
765 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900766 .devname = "s5pv210-uart.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900767 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900768 .ctrlbit = (1 << 0),
769 }, {
770 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900771 .devname = "s5pv210-uart.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900772 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900773 .ctrlbit = (1 << 1),
774 }, {
775 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900776 .devname = "s5pv210-uart.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900777 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900778 .ctrlbit = (1 << 2),
779 }, {
780 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900781 .devname = "s5pv210-uart.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900782 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900783 .ctrlbit = (1 << 3),
784 }, {
785 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900786 .devname = "s5pv210-uart.4",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900787 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900788 .ctrlbit = (1 << 4),
789 }, {
790 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900791 .devname = "s5pv210-uart.5",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900792 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900793 .ctrlbit = (1 << 5),
794 }
Changhwan Younc8bef142010-07-27 17:52:39 +0900795};
796
Kukjin Kima8550392012-03-09 14:19:10 -0800797static struct clk exynos4_clk_pdma0 = {
Thomas Abraham66fdb292011-10-24 14:01:03 +0200798 .name = "dma",
799 .devname = "dma-pl330.0",
800 .enable = exynos4_clk_ip_fsys_ctrl,
801 .ctrlbit = (1 << 0),
802};
803
Kukjin Kima8550392012-03-09 14:19:10 -0800804static struct clk exynos4_clk_pdma1 = {
Thomas Abraham66fdb292011-10-24 14:01:03 +0200805 .name = "dma",
806 .devname = "dma-pl330.1",
807 .enable = exynos4_clk_ip_fsys_ctrl,
808 .ctrlbit = (1 << 1),
809};
810
Boojin Kim9ed76e02012-02-15 13:15:12 +0900811static struct clk exynos4_clk_mdma1 = {
812 .name = "dma",
813 .devname = "dma-pl330.2",
814 .enable = exynos4_clk_ip_image_ctrl,
815 .ctrlbit = ((1 << 8) | (1 << 5) | (1 << 2)),
816};
817
Tushar Behera79025462012-03-12 21:17:02 -0700818static struct clk exynos4_clk_fimd0 = {
819 .name = "fimd",
820 .devname = "exynos4-fb.0",
821 .enable = exynos4_clk_ip_lcd0_ctrl,
822 .ctrlbit = (1 << 0),
823};
824
Kukjin Kima8550392012-03-09 14:19:10 -0800825struct clk *exynos4_clkset_group_list[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900826 [0] = &clk_ext_xtal_mux,
827 [1] = &clk_xusbxti,
Kukjin Kima8550392012-03-09 14:19:10 -0800828 [2] = &exynos4_clk_sclk_hdmi27m,
829 [3] = &exynos4_clk_sclk_usbphy0,
830 [4] = &exynos4_clk_sclk_usbphy1,
831 [5] = &exynos4_clk_sclk_hdmiphy,
832 [6] = &exynos4_clk_mout_mpll.clk,
833 [7] = &exynos4_clk_mout_epll.clk,
834 [8] = &exynos4_clk_sclk_vpll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900835};
836
Kukjin Kima8550392012-03-09 14:19:10 -0800837struct clksrc_sources exynos4_clkset_group = {
838 .sources = exynos4_clkset_group_list,
839 .nr_sources = ARRAY_SIZE(exynos4_clkset_group_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900840};
841
Kukjin Kima8550392012-03-09 14:19:10 -0800842static struct clk *exynos4_clkset_mout_g2d0_list[] = {
843 [0] = &exynos4_clk_mout_mpll.clk,
844 [1] = &exynos4_clk_sclk_apll.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900845};
846
Sachin Kamat8bf56462012-07-17 07:52:03 +0900847struct clksrc_sources exynos4_clkset_mout_g2d0 = {
Kukjin Kima8550392012-03-09 14:19:10 -0800848 .sources = exynos4_clkset_mout_g2d0_list,
849 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d0_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900850};
851
Kukjin Kima8550392012-03-09 14:19:10 -0800852static struct clk *exynos4_clkset_mout_g2d1_list[] = {
853 [0] = &exynos4_clk_mout_epll.clk,
854 [1] = &exynos4_clk_sclk_vpll.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900855};
856
Sachin Kamat8bf56462012-07-17 07:52:03 +0900857struct clksrc_sources exynos4_clkset_mout_g2d1 = {
Kukjin Kima8550392012-03-09 14:19:10 -0800858 .sources = exynos4_clkset_mout_g2d1_list,
859 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d1_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900860};
861
Kukjin Kima8550392012-03-09 14:19:10 -0800862static struct clk *exynos4_clkset_mout_mfc0_list[] = {
863 [0] = &exynos4_clk_mout_mpll.clk,
864 [1] = &exynos4_clk_sclk_apll.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900865};
866
Kukjin Kima8550392012-03-09 14:19:10 -0800867static struct clksrc_sources exynos4_clkset_mout_mfc0 = {
868 .sources = exynos4_clkset_mout_mfc0_list,
869 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc0_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900870};
871
Kukjin Kima8550392012-03-09 14:19:10 -0800872static struct clksrc_clk exynos4_clk_mout_mfc0 = {
Kamil Debski0f75a962011-07-21 16:42:30 +0900873 .clk = {
874 .name = "mout_mfc0",
875 },
Kukjin Kima8550392012-03-09 14:19:10 -0800876 .sources = &exynos4_clkset_mout_mfc0,
877 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 0, .size = 1 },
Kamil Debski0f75a962011-07-21 16:42:30 +0900878};
879
Kukjin Kima8550392012-03-09 14:19:10 -0800880static struct clk *exynos4_clkset_mout_mfc1_list[] = {
881 [0] = &exynos4_clk_mout_epll.clk,
882 [1] = &exynos4_clk_sclk_vpll.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900883};
884
Kukjin Kima8550392012-03-09 14:19:10 -0800885static struct clksrc_sources exynos4_clkset_mout_mfc1 = {
886 .sources = exynos4_clkset_mout_mfc1_list,
887 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc1_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900888};
889
Kukjin Kima8550392012-03-09 14:19:10 -0800890static struct clksrc_clk exynos4_clk_mout_mfc1 = {
Kamil Debski0f75a962011-07-21 16:42:30 +0900891 .clk = {
892 .name = "mout_mfc1",
893 },
Kukjin Kima8550392012-03-09 14:19:10 -0800894 .sources = &exynos4_clkset_mout_mfc1,
895 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 4, .size = 1 },
Kamil Debski0f75a962011-07-21 16:42:30 +0900896};
897
Kukjin Kima8550392012-03-09 14:19:10 -0800898static struct clk *exynos4_clkset_mout_mfc_list[] = {
899 [0] = &exynos4_clk_mout_mfc0.clk,
900 [1] = &exynos4_clk_mout_mfc1.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900901};
902
Kukjin Kima8550392012-03-09 14:19:10 -0800903static struct clksrc_sources exynos4_clkset_mout_mfc = {
904 .sources = exynos4_clkset_mout_mfc_list,
905 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900906};
907
Kukjin Kima8550392012-03-09 14:19:10 -0800908static struct clk *exynos4_clkset_sclk_dac_list[] = {
909 [0] = &exynos4_clk_sclk_vpll.clk,
910 [1] = &exynos4_clk_sclk_hdmiphy,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900911};
912
Kukjin Kima8550392012-03-09 14:19:10 -0800913static struct clksrc_sources exynos4_clkset_sclk_dac = {
914 .sources = exynos4_clkset_sclk_dac_list,
915 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_dac_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900916};
917
Kukjin Kima8550392012-03-09 14:19:10 -0800918static struct clksrc_clk exynos4_clk_sclk_dac = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900919 .clk = {
920 .name = "sclk_dac",
921 .enable = exynos4_clksrc_mask_tv_ctrl,
922 .ctrlbit = (1 << 8),
923 },
Kukjin Kima8550392012-03-09 14:19:10 -0800924 .sources = &exynos4_clkset_sclk_dac,
925 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 8, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900926};
927
Kukjin Kima8550392012-03-09 14:19:10 -0800928static struct clksrc_clk exynos4_clk_sclk_pixel = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900929 .clk = {
930 .name = "sclk_pixel",
Kukjin Kima8550392012-03-09 14:19:10 -0800931 .parent = &exynos4_clk_sclk_vpll.clk,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900932 },
Kukjin Kima8550392012-03-09 14:19:10 -0800933 .reg_div = { .reg = EXYNOS4_CLKDIV_TV, .shift = 0, .size = 4 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900934};
935
Kukjin Kima8550392012-03-09 14:19:10 -0800936static struct clk *exynos4_clkset_sclk_hdmi_list[] = {
937 [0] = &exynos4_clk_sclk_pixel.clk,
938 [1] = &exynos4_clk_sclk_hdmiphy,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900939};
940
Kukjin Kima8550392012-03-09 14:19:10 -0800941static struct clksrc_sources exynos4_clkset_sclk_hdmi = {
942 .sources = exynos4_clkset_sclk_hdmi_list,
943 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_hdmi_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900944};
945
Kukjin Kima8550392012-03-09 14:19:10 -0800946static struct clksrc_clk exynos4_clk_sclk_hdmi = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900947 .clk = {
948 .name = "sclk_hdmi",
949 .enable = exynos4_clksrc_mask_tv_ctrl,
950 .ctrlbit = (1 << 0),
951 },
Kukjin Kima8550392012-03-09 14:19:10 -0800952 .sources = &exynos4_clkset_sclk_hdmi,
953 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 0, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900954};
955
Kukjin Kima8550392012-03-09 14:19:10 -0800956static struct clk *exynos4_clkset_sclk_mixer_list[] = {
957 [0] = &exynos4_clk_sclk_dac.clk,
958 [1] = &exynos4_clk_sclk_hdmi.clk,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900959};
960
Kukjin Kima8550392012-03-09 14:19:10 -0800961static struct clksrc_sources exynos4_clkset_sclk_mixer = {
962 .sources = exynos4_clkset_sclk_mixer_list,
963 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_mixer_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900964};
965
Kukjin Kima8550392012-03-09 14:19:10 -0800966static struct clksrc_clk exynos4_clk_sclk_mixer = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800967 .clk = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900968 .name = "sclk_mixer",
969 .enable = exynos4_clksrc_mask_tv_ctrl,
970 .ctrlbit = (1 << 4),
971 },
Kukjin Kima8550392012-03-09 14:19:10 -0800972 .sources = &exynos4_clkset_sclk_mixer,
973 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 4, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900974};
975
Kukjin Kima8550392012-03-09 14:19:10 -0800976static struct clksrc_clk *exynos4_sclk_tv[] = {
977 &exynos4_clk_sclk_dac,
978 &exynos4_clk_sclk_pixel,
979 &exynos4_clk_sclk_hdmi,
980 &exynos4_clk_sclk_mixer,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900981};
982
Kukjin Kima8550392012-03-09 14:19:10 -0800983static struct clksrc_clk exynos4_clk_dout_mmc0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800984 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900985 .name = "dout_mmc0",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900986 },
Kukjin Kima8550392012-03-09 14:19:10 -0800987 .sources = &exynos4_clkset_group,
988 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 0, .size = 4 },
989 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900990};
991
Kukjin Kima8550392012-03-09 14:19:10 -0800992static struct clksrc_clk exynos4_clk_dout_mmc1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800993 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900994 .name = "dout_mmc1",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900995 },
Kukjin Kima8550392012-03-09 14:19:10 -0800996 .sources = &exynos4_clkset_group,
997 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 4, .size = 4 },
998 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 16, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900999};
1000
Kukjin Kima8550392012-03-09 14:19:10 -08001001static struct clksrc_clk exynos4_clk_dout_mmc2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001002 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001003 .name = "dout_mmc2",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001004 },
Kukjin Kima8550392012-03-09 14:19:10 -08001005 .sources = &exynos4_clkset_group,
1006 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 8, .size = 4 },
1007 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001008};
1009
Kukjin Kima8550392012-03-09 14:19:10 -08001010static struct clksrc_clk exynos4_clk_dout_mmc3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001011 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001012 .name = "dout_mmc3",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001013 },
Kukjin Kima8550392012-03-09 14:19:10 -08001014 .sources = &exynos4_clkset_group,
1015 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 12, .size = 4 },
1016 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 16, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001017};
1018
Kukjin Kima8550392012-03-09 14:19:10 -08001019static struct clksrc_clk exynos4_clk_dout_mmc4 = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001020 .clk = {
1021 .name = "dout_mmc4",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001022 },
Kukjin Kima8550392012-03-09 14:19:10 -08001023 .sources = &exynos4_clkset_group,
1024 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 16, .size = 4 },
1025 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001026};
1027
Kukjin Kima8550392012-03-09 14:19:10 -08001028static struct clksrc_clk exynos4_clksrcs[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +09001029 {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001030 .clk = {
Changhwan Younc8bef142010-07-27 17:52:39 +09001031 .name = "sclk_pwm",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001032 .enable = exynos4_clksrc_mask_peril0_ctrl,
Changhwan Younc8bef142010-07-27 17:52:39 +09001033 .ctrlbit = (1 << 24),
1034 },
Kukjin Kima8550392012-03-09 14:19:10 -08001035 .sources = &exynos4_clkset_group,
1036 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 24, .size = 4 },
1037 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL3, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001038 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001039 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001040 .name = "sclk_csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001041 .devname = "s5p-mipi-csis.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001042 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001043 .ctrlbit = (1 << 24),
1044 },
Kukjin Kima8550392012-03-09 14:19:10 -08001045 .sources = &exynos4_clkset_group,
1046 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 24, .size = 4 },
1047 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 24, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001048 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001049 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001050 .name = "sclk_csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001051 .devname = "s5p-mipi-csis.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001052 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001053 .ctrlbit = (1 << 28),
1054 },
Kukjin Kima8550392012-03-09 14:19:10 -08001055 .sources = &exynos4_clkset_group,
1056 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 28, .size = 4 },
1057 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 28, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001058 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001059 .clk = {
Sylwester Nawrocki00aaad22011-09-27 07:00:59 +09001060 .name = "sclk_cam0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001061 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001062 .ctrlbit = (1 << 16),
1063 },
Kukjin Kima8550392012-03-09 14:19:10 -08001064 .sources = &exynos4_clkset_group,
1065 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 16, .size = 4 },
1066 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 16, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001067 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001068 .clk = {
Sylwester Nawrocki00aaad22011-09-27 07:00:59 +09001069 .name = "sclk_cam1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001070 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001071 .ctrlbit = (1 << 20),
1072 },
Kukjin Kima8550392012-03-09 14:19:10 -08001073 .sources = &exynos4_clkset_group,
1074 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 20, .size = 4 },
1075 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 20, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001076 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001077 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001078 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001079 .devname = "exynos4-fimc.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001080 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001081 .ctrlbit = (1 << 0),
1082 },
Kukjin Kima8550392012-03-09 14:19:10 -08001083 .sources = &exynos4_clkset_group,
1084 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 0, .size = 4 },
1085 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 0, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001086 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001087 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001088 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001089 .devname = "exynos4-fimc.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001090 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001091 .ctrlbit = (1 << 4),
1092 },
Kukjin Kima8550392012-03-09 14:19:10 -08001093 .sources = &exynos4_clkset_group,
1094 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 4, .size = 4 },
1095 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 4, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001096 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001097 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001098 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001099 .devname = "exynos4-fimc.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001100 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001101 .ctrlbit = (1 << 8),
1102 },
Kukjin Kima8550392012-03-09 14:19:10 -08001103 .sources = &exynos4_clkset_group,
1104 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 8, .size = 4 },
1105 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 8, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001106 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001107 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001108 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001109 .devname = "exynos4-fimc.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001110 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001111 .ctrlbit = (1 << 12),
1112 },
Kukjin Kima8550392012-03-09 14:19:10 -08001113 .sources = &exynos4_clkset_group,
1114 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 12, .size = 4 },
1115 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 12, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001116 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001117 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001118 .name = "sclk_fimd",
Jingoo Han268a7ef2011-07-21 15:42:38 +09001119 .devname = "exynos4-fb.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001120 .enable = exynos4_clksrc_mask_lcd0_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001121 .ctrlbit = (1 << 0),
1122 },
Kukjin Kima8550392012-03-09 14:19:10 -08001123 .sources = &exynos4_clkset_group,
1124 .reg_src = { .reg = EXYNOS4_CLKSRC_LCD0, .shift = 0, .size = 4 },
1125 .reg_div = { .reg = EXYNOS4_CLKDIV_LCD0, .shift = 0, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001126 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001127 .clk = {
Kamil Debski0f75a962011-07-21 16:42:30 +09001128 .name = "sclk_mfc",
1129 .devname = "s5p-mfc",
1130 },
Kukjin Kima8550392012-03-09 14:19:10 -08001131 .sources = &exynos4_clkset_mout_mfc,
1132 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 8, .size = 1 },
1133 .reg_div = { .reg = EXYNOS4_CLKDIV_MFC, .shift = 0, .size = 4 },
Kamil Debski0f75a962011-07-21 16:42:30 +09001134 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001135 .clk = {
Dongjin Kim454696f2012-12-18 08:57:06 -08001136 .name = "ciu",
Kukjin Kima8550392012-03-09 14:19:10 -08001137 .parent = &exynos4_clk_dout_mmc4.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001138 .enable = exynos4_clksrc_mask_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001139 .ctrlbit = (1 << 16),
1140 },
Kukjin Kima8550392012-03-09 14:19:10 -08001141 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 8, .size = 8 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001142 }
Changhwan Younc8bef142010-07-27 17:52:39 +09001143};
1144
Kukjin Kima8550392012-03-09 14:19:10 -08001145static struct clksrc_clk exynos4_clk_sclk_uart0 = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001146 .clk = {
1147 .name = "uclk1",
1148 .devname = "exynos4210-uart.0",
1149 .enable = exynos4_clksrc_mask_peril0_ctrl,
1150 .ctrlbit = (1 << 0),
1151 },
Kukjin Kima8550392012-03-09 14:19:10 -08001152 .sources = &exynos4_clkset_group,
1153 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 0, .size = 4 },
1154 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 0, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001155};
1156
Kukjin Kima8550392012-03-09 14:19:10 -08001157static struct clksrc_clk exynos4_clk_sclk_uart1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001158 .clk = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001159 .name = "uclk1",
1160 .devname = "exynos4210-uart.1",
1161 .enable = exynos4_clksrc_mask_peril0_ctrl,
1162 .ctrlbit = (1 << 4),
1163 },
Kukjin Kima8550392012-03-09 14:19:10 -08001164 .sources = &exynos4_clkset_group,
1165 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 4, .size = 4 },
1166 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 4, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001167};
1168
Kukjin Kima8550392012-03-09 14:19:10 -08001169static struct clksrc_clk exynos4_clk_sclk_uart2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001170 .clk = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001171 .name = "uclk1",
1172 .devname = "exynos4210-uart.2",
1173 .enable = exynos4_clksrc_mask_peril0_ctrl,
1174 .ctrlbit = (1 << 8),
1175 },
Kukjin Kima8550392012-03-09 14:19:10 -08001176 .sources = &exynos4_clkset_group,
1177 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 8, .size = 4 },
1178 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 8, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001179};
1180
Kukjin Kima8550392012-03-09 14:19:10 -08001181static struct clksrc_clk exynos4_clk_sclk_uart3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001182 .clk = {
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001183 .name = "uclk1",
1184 .devname = "exynos4210-uart.3",
1185 .enable = exynos4_clksrc_mask_peril0_ctrl,
1186 .ctrlbit = (1 << 12),
1187 },
Kukjin Kima8550392012-03-09 14:19:10 -08001188 .sources = &exynos4_clkset_group,
1189 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 12, .size = 4 },
1190 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 12, .size = 4 },
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001191};
1192
Kukjin Kima8550392012-03-09 14:19:10 -08001193static struct clksrc_clk exynos4_clk_sclk_mmc0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001194 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001195 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001196 .devname = "exynos4-sdhci.0",
Kukjin Kima8550392012-03-09 14:19:10 -08001197 .parent = &exynos4_clk_dout_mmc0.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001198 .enable = exynos4_clksrc_mask_fsys_ctrl,
1199 .ctrlbit = (1 << 0),
1200 },
Kukjin Kima8550392012-03-09 14:19:10 -08001201 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 8, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001202};
1203
Kukjin Kima8550392012-03-09 14:19:10 -08001204static struct clksrc_clk exynos4_clk_sclk_mmc1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001205 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001206 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001207 .devname = "exynos4-sdhci.1",
Kukjin Kima8550392012-03-09 14:19:10 -08001208 .parent = &exynos4_clk_dout_mmc1.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001209 .enable = exynos4_clksrc_mask_fsys_ctrl,
1210 .ctrlbit = (1 << 4),
1211 },
Kukjin Kima8550392012-03-09 14:19:10 -08001212 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 24, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001213};
1214
Kukjin Kima8550392012-03-09 14:19:10 -08001215static struct clksrc_clk exynos4_clk_sclk_mmc2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001216 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001217 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001218 .devname = "exynos4-sdhci.2",
Kukjin Kima8550392012-03-09 14:19:10 -08001219 .parent = &exynos4_clk_dout_mmc2.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001220 .enable = exynos4_clksrc_mask_fsys_ctrl,
1221 .ctrlbit = (1 << 8),
1222 },
Kukjin Kima8550392012-03-09 14:19:10 -08001223 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 8, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001224};
1225
Kukjin Kima8550392012-03-09 14:19:10 -08001226static struct clksrc_clk exynos4_clk_sclk_mmc3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001227 .clk = {
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001228 .name = "sclk_mmc",
Thomas Abraham8482c812012-04-14 08:04:46 -07001229 .devname = "exynos4-sdhci.3",
Kukjin Kima8550392012-03-09 14:19:10 -08001230 .parent = &exynos4_clk_dout_mmc3.clk,
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001231 .enable = exynos4_clksrc_mask_fsys_ctrl,
1232 .ctrlbit = (1 << 12),
1233 },
Kukjin Kima8550392012-03-09 14:19:10 -08001234 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 24, .size = 8 },
Rajeshwari Shindea361d102011-10-24 17:05:58 +02001235};
1236
Thomas Abraham46fda152012-07-14 10:53:08 +09001237static struct clksrc_clk exynos4_clk_mdout_spi0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001238 .clk = {
Thomas Abraham46fda152012-07-14 10:53:08 +09001239 .name = "mdout_spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +09001240 .devname = "exynos4210-spi.0",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001241 },
Kukjin Kima8550392012-03-09 14:19:10 -08001242 .sources = &exynos4_clkset_group,
1243 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 16, .size = 4 },
1244 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 0, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001245};
1246
Thomas Abraham46fda152012-07-14 10:53:08 +09001247static struct clksrc_clk exynos4_clk_mdout_spi1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001248 .clk = {
Thomas Abraham46fda152012-07-14 10:53:08 +09001249 .name = "mdout_spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +09001250 .devname = "exynos4210-spi.1",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001251 },
Kukjin Kima8550392012-03-09 14:19:10 -08001252 .sources = &exynos4_clkset_group,
1253 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 20, .size = 4 },
1254 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 16, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001255};
1256
Thomas Abraham46fda152012-07-14 10:53:08 +09001257static struct clksrc_clk exynos4_clk_mdout_spi2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001258 .clk = {
Thomas Abraham46fda152012-07-14 10:53:08 +09001259 .name = "mdout_spi",
Thomas Abrahama5238e32012-07-13 07:15:14 +09001260 .devname = "exynos4210-spi.2",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001261 },
Kukjin Kima8550392012-03-09 14:19:10 -08001262 .sources = &exynos4_clkset_group,
1263 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 24, .size = 4 },
1264 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 0, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001265};
1266
Thomas Abraham46fda152012-07-14 10:53:08 +09001267static struct clksrc_clk exynos4_clk_sclk_spi0 = {
1268 .clk = {
1269 .name = "sclk_spi",
1270 .devname = "exynos4210-spi.0",
1271 .parent = &exynos4_clk_mdout_spi0.clk,
1272 .enable = exynos4_clksrc_mask_peril1_ctrl,
1273 .ctrlbit = (1 << 16),
1274 },
1275 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 8, .size = 8 },
1276};
1277
1278static struct clksrc_clk exynos4_clk_sclk_spi1 = {
1279 .clk = {
1280 .name = "sclk_spi",
1281 .devname = "exynos4210-spi.1",
1282 .parent = &exynos4_clk_mdout_spi1.clk,
1283 .enable = exynos4_clksrc_mask_peril1_ctrl,
1284 .ctrlbit = (1 << 20),
1285 },
1286 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 24, .size = 8 },
1287};
1288
1289static struct clksrc_clk exynos4_clk_sclk_spi2 = {
1290 .clk = {
1291 .name = "sclk_spi",
1292 .devname = "exynos4210-spi.2",
1293 .parent = &exynos4_clk_mdout_spi2.clk,
1294 .enable = exynos4_clksrc_mask_peril1_ctrl,
1295 .ctrlbit = (1 << 24),
1296 },
1297 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 8, .size = 8 },
1298};
1299
Changhwan Younc8bef142010-07-27 17:52:39 +09001300/* Clock initialization code */
Kukjin Kima8550392012-03-09 14:19:10 -08001301static struct clksrc_clk *exynos4_sysclks[] = {
1302 &exynos4_clk_mout_apll,
1303 &exynos4_clk_sclk_apll,
1304 &exynos4_clk_mout_epll,
1305 &exynos4_clk_mout_mpll,
1306 &exynos4_clk_moutcore,
1307 &exynos4_clk_coreclk,
1308 &exynos4_clk_armclk,
1309 &exynos4_clk_aclk_corem0,
1310 &exynos4_clk_aclk_cores,
1311 &exynos4_clk_aclk_corem1,
1312 &exynos4_clk_periphclk,
1313 &exynos4_clk_mout_corebus,
1314 &exynos4_clk_sclk_dmc,
1315 &exynos4_clk_aclk_cored,
1316 &exynos4_clk_aclk_corep,
1317 &exynos4_clk_aclk_acp,
1318 &exynos4_clk_pclk_acp,
1319 &exynos4_clk_vpllsrc,
1320 &exynos4_clk_sclk_vpll,
1321 &exynos4_clk_aclk_200,
1322 &exynos4_clk_aclk_100,
1323 &exynos4_clk_aclk_160,
1324 &exynos4_clk_aclk_133,
1325 &exynos4_clk_dout_mmc0,
1326 &exynos4_clk_dout_mmc1,
1327 &exynos4_clk_dout_mmc2,
1328 &exynos4_clk_dout_mmc3,
1329 &exynos4_clk_dout_mmc4,
1330 &exynos4_clk_mout_mfc0,
1331 &exynos4_clk_mout_mfc1,
Changhwan Younc8bef142010-07-27 17:52:39 +09001332};
1333
Kukjin Kima8550392012-03-09 14:19:10 -08001334static struct clk *exynos4_clk_cdev[] = {
1335 &exynos4_clk_pdma0,
1336 &exynos4_clk_pdma1,
Boojin Kim9ed76e02012-02-15 13:15:12 +09001337 &exynos4_clk_mdma1,
Tushar Behera79025462012-03-12 21:17:02 -07001338 &exynos4_clk_fimd0,
Thomas Abraham66fdb292011-10-24 14:01:03 +02001339};
1340
Kukjin Kima8550392012-03-09 14:19:10 -08001341static struct clksrc_clk *exynos4_clksrc_cdev[] = {
1342 &exynos4_clk_sclk_uart0,
1343 &exynos4_clk_sclk_uart1,
1344 &exynos4_clk_sclk_uart2,
1345 &exynos4_clk_sclk_uart3,
1346 &exynos4_clk_sclk_mmc0,
1347 &exynos4_clk_sclk_mmc1,
1348 &exynos4_clk_sclk_mmc2,
1349 &exynos4_clk_sclk_mmc3,
1350 &exynos4_clk_sclk_spi0,
1351 &exynos4_clk_sclk_spi1,
1352 &exynos4_clk_sclk_spi2,
Thomas Abraham46fda152012-07-14 10:53:08 +09001353 &exynos4_clk_mdout_spi0,
1354 &exynos4_clk_mdout_spi1,
1355 &exynos4_clk_mdout_spi2,
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001356};
1357
1358static struct clk_lookup exynos4_clk_lookup[] = {
Kukjin Kima8550392012-03-09 14:19:10 -08001359 CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &exynos4_clk_sclk_uart0.clk),
1360 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk),
1361 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk),
1362 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk),
Thomas Abraham8482c812012-04-14 08:04:46 -07001363 CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk),
1364 CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk),
1365 CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk),
1366 CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk),
Tushar Behera79025462012-03-12 21:17:02 -07001367 CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0),
Kukjin Kima8550392012-03-09 14:19:10 -08001368 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0),
1369 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1),
Tushar Behera8f7b1322011-12-27 14:42:50 +09001370 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos4_clk_mdma1),
Thomas Abrahama5238e32012-07-13 07:15:14 +09001371 CLKDEV_INIT("exynos4210-spi.0", "spi_busclk0", &exynos4_clk_sclk_spi0.clk),
1372 CLKDEV_INIT("exynos4210-spi.1", "spi_busclk0", &exynos4_clk_sclk_spi1.clk),
1373 CLKDEV_INIT("exynos4210-spi.2", "spi_busclk0", &exynos4_clk_sclk_spi2.clk),
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001374};
1375
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001376static int xtal_rate;
1377
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001378static unsigned long exynos4_fout_apll_get_rate(struct clk *clk)
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001379{
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001380 if (soc_is_exynos4210())
Kukjin Kima8550392012-03-09 14:19:10 -08001381 return s5p_get_pll45xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001382 pll_4508);
Changhwan Younb88b1cc2011-10-04 17:08:56 +09001383 else if (soc_is_exynos4212() || soc_is_exynos4412())
Kukjin Kima8550392012-03-09 14:19:10 -08001384 return s5p_get_pll35xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001385 else
1386 return 0;
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001387}
1388
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001389static struct clk_ops exynos4_fout_apll_ops = {
1390 .get_rate = exynos4_fout_apll_get_rate,
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001391};
1392
Kukjin Kima8550392012-03-09 14:19:10 -08001393static u32 exynos4_vpll_div[][8] = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001394 { 54000000, 3, 53, 3, 1024, 0, 17, 0 },
1395 { 108000000, 3, 53, 2, 1024, 0, 17, 0 },
1396};
1397
1398static unsigned long exynos4_vpll_get_rate(struct clk *clk)
1399{
1400 return clk->rate;
1401}
1402
1403static int exynos4_vpll_set_rate(struct clk *clk, unsigned long rate)
1404{
1405 unsigned int vpll_con0, vpll_con1 = 0;
1406 unsigned int i;
1407
1408 /* Return if nothing changed */
1409 if (clk->rate == rate)
1410 return 0;
1411
Kukjin Kima8550392012-03-09 14:19:10 -08001412 vpll_con0 = __raw_readl(EXYNOS4_VPLL_CON0);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001413 vpll_con0 &= ~(0x1 << 27 | \
1414 PLL90XX_MDIV_MASK << PLL46XX_MDIV_SHIFT | \
1415 PLL90XX_PDIV_MASK << PLL46XX_PDIV_SHIFT | \
1416 PLL90XX_SDIV_MASK << PLL46XX_SDIV_SHIFT);
1417
Kukjin Kima8550392012-03-09 14:19:10 -08001418 vpll_con1 = __raw_readl(EXYNOS4_VPLL_CON1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001419 vpll_con1 &= ~(PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT | \
1420 PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT | \
1421 PLL4650C_KDIV_MASK << PLL46XX_KDIV_SHIFT);
1422
Kukjin Kima8550392012-03-09 14:19:10 -08001423 for (i = 0; i < ARRAY_SIZE(exynos4_vpll_div); i++) {
1424 if (exynos4_vpll_div[i][0] == rate) {
1425 vpll_con0 |= exynos4_vpll_div[i][1] << PLL46XX_PDIV_SHIFT;
1426 vpll_con0 |= exynos4_vpll_div[i][2] << PLL46XX_MDIV_SHIFT;
1427 vpll_con0 |= exynos4_vpll_div[i][3] << PLL46XX_SDIV_SHIFT;
1428 vpll_con1 |= exynos4_vpll_div[i][4] << PLL46XX_KDIV_SHIFT;
1429 vpll_con1 |= exynos4_vpll_div[i][5] << PLL46XX_MFR_SHIFT;
1430 vpll_con1 |= exynos4_vpll_div[i][6] << PLL46XX_MRR_SHIFT;
1431 vpll_con0 |= exynos4_vpll_div[i][7] << 27;
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001432 break;
1433 }
1434 }
1435
Kukjin Kima8550392012-03-09 14:19:10 -08001436 if (i == ARRAY_SIZE(exynos4_vpll_div)) {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001437 printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n",
1438 __func__);
1439 return -EINVAL;
1440 }
1441
Kukjin Kima8550392012-03-09 14:19:10 -08001442 __raw_writel(vpll_con0, EXYNOS4_VPLL_CON0);
1443 __raw_writel(vpll_con1, EXYNOS4_VPLL_CON1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001444
1445 /* Wait for VPLL lock */
Kukjin Kima8550392012-03-09 14:19:10 -08001446 while (!(__raw_readl(EXYNOS4_VPLL_CON0) & (1 << PLL46XX_LOCKED_SHIFT)))
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001447 continue;
1448
1449 clk->rate = rate;
1450 return 0;
1451}
1452
1453static struct clk_ops exynos4_vpll_ops = {
1454 .get_rate = exynos4_vpll_get_rate,
1455 .set_rate = exynos4_vpll_set_rate,
1456};
1457
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001458void __init_or_cpufreq exynos4_setup_clocks(void)
Changhwan Younc8bef142010-07-27 17:52:39 +09001459{
1460 struct clk *xtal_clk;
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001461 unsigned long apll = 0;
1462 unsigned long mpll = 0;
1463 unsigned long epll = 0;
1464 unsigned long vpll = 0;
Changhwan Younc8bef142010-07-27 17:52:39 +09001465 unsigned long vpllsrc;
1466 unsigned long xtal;
1467 unsigned long armclk;
Changhwan Younc8bef142010-07-27 17:52:39 +09001468 unsigned long sclk_dmc;
Jongpill Lee228ef982010-08-18 22:24:53 +09001469 unsigned long aclk_200;
1470 unsigned long aclk_100;
1471 unsigned long aclk_160;
1472 unsigned long aclk_133;
Changhwan Younc8bef142010-07-27 17:52:39 +09001473 unsigned int ptr;
1474
1475 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
1476
1477 xtal_clk = clk_get(NULL, "xtal");
1478 BUG_ON(IS_ERR(xtal_clk));
1479
1480 xtal = clk_get_rate(xtal_clk);
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001481
1482 xtal_rate = xtal;
1483
Changhwan Younc8bef142010-07-27 17:52:39 +09001484 clk_put(xtal_clk);
1485
1486 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
1487
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001488 if (soc_is_exynos4210()) {
Kukjin Kima8550392012-03-09 14:19:10 -08001489 apll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_APLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001490 pll_4508);
Kukjin Kima8550392012-03-09 14:19:10 -08001491 mpll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001492 pll_4508);
Kukjin Kima8550392012-03-09 14:19:10 -08001493 epll = s5p_get_pll46xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0),
1494 __raw_readl(EXYNOS4_EPLL_CON1), pll_4600);
Changhwan Younc8bef142010-07-27 17:52:39 +09001495
Kukjin Kima8550392012-03-09 14:19:10 -08001496 vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk);
1497 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0),
1498 __raw_readl(EXYNOS4_VPLL_CON1), pll_4650c);
Changhwan Younb88b1cc2011-10-04 17:08:56 +09001499 } else if (soc_is_exynos4212() || soc_is_exynos4412()) {
Kukjin Kima8550392012-03-09 14:19:10 -08001500 apll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_APLL_CON0));
1501 mpll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0));
1502 epll = s5p_get_pll36xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0),
1503 __raw_readl(EXYNOS4_EPLL_CON1));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001504
Kukjin Kima8550392012-03-09 14:19:10 -08001505 vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk);
1506 vpll = s5p_get_pll36xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0),
1507 __raw_readl(EXYNOS4_VPLL_CON1));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001508 } else {
1509 /* nothing */
1510 }
Changhwan Younc8bef142010-07-27 17:52:39 +09001511
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001512 clk_fout_apll.ops = &exynos4_fout_apll_ops;
Changhwan Younc8bef142010-07-27 17:52:39 +09001513 clk_fout_mpll.rate = mpll;
1514 clk_fout_epll.rate = epll;
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001515 clk_fout_vpll.ops = &exynos4_vpll_ops;
Changhwan Younc8bef142010-07-27 17:52:39 +09001516 clk_fout_vpll.rate = vpll;
1517
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001518 printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
Changhwan Younc8bef142010-07-27 17:52:39 +09001519 apll, mpll, epll, vpll);
1520
Kukjin Kima8550392012-03-09 14:19:10 -08001521 armclk = clk_get_rate(&exynos4_clk_armclk.clk);
1522 sclk_dmc = clk_get_rate(&exynos4_clk_sclk_dmc.clk);
Changhwan Younc8bef142010-07-27 17:52:39 +09001523
Kukjin Kima8550392012-03-09 14:19:10 -08001524 aclk_200 = clk_get_rate(&exynos4_clk_aclk_200.clk);
1525 aclk_100 = clk_get_rate(&exynos4_clk_aclk_100.clk);
1526 aclk_160 = clk_get_rate(&exynos4_clk_aclk_160.clk);
1527 aclk_133 = clk_get_rate(&exynos4_clk_aclk_133.clk);
Jongpill Lee228ef982010-08-18 22:24:53 +09001528
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001529 printk(KERN_INFO "EXYNOS4: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n"
Jongpill Lee228ef982010-08-18 22:24:53 +09001530 "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n",
1531 armclk, sclk_dmc, aclk_200,
1532 aclk_100, aclk_160, aclk_133);
Changhwan Younc8bef142010-07-27 17:52:39 +09001533
1534 clk_f.rate = armclk;
1535 clk_h.rate = sclk_dmc;
Jongpill Lee228ef982010-08-18 22:24:53 +09001536 clk_p.rate = aclk_100;
Changhwan Younc8bef142010-07-27 17:52:39 +09001537
Kukjin Kima8550392012-03-09 14:19:10 -08001538 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrcs); ptr++)
1539 s3c_set_clksrc(&exynos4_clksrcs[ptr], true);
Changhwan Younc8bef142010-07-27 17:52:39 +09001540}
1541
Kukjin Kima8550392012-03-09 14:19:10 -08001542static struct clk *exynos4_clks[] __initdata = {
1543 &exynos4_clk_sclk_hdmi27m,
1544 &exynos4_clk_sclk_hdmiphy,
1545 &exynos4_clk_sclk_usbphy0,
1546 &exynos4_clk_sclk_usbphy1,
Changhwan Younc8bef142010-07-27 17:52:39 +09001547};
1548
Jonghwan Choiacd35612011-08-24 21:52:45 +09001549#ifdef CONFIG_PM_SLEEP
1550static int exynos4_clock_suspend(void)
1551{
1552 s3c_pm_do_save(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save));
1553 return 0;
1554}
1555
1556static void exynos4_clock_resume(void)
1557{
1558 s3c_pm_do_restore_core(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save));
1559}
1560
1561#else
1562#define exynos4_clock_suspend NULL
1563#define exynos4_clock_resume NULL
1564#endif
1565
Kukjin Kime745e062012-01-21 10:47:14 +09001566static struct syscore_ops exynos4_clock_syscore_ops = {
Jonghwan Choiacd35612011-08-24 21:52:45 +09001567 .suspend = exynos4_clock_suspend,
1568 .resume = exynos4_clock_resume,
1569};
1570
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001571void __init exynos4_register_clocks(void)
Changhwan Younc8bef142010-07-27 17:52:39 +09001572{
Changhwan Younc8bef142010-07-27 17:52:39 +09001573 int ptr;
1574
Kukjin Kima8550392012-03-09 14:19:10 -08001575 s3c24xx_register_clocks(exynos4_clks, ARRAY_SIZE(exynos4_clks));
Changhwan Younc8bef142010-07-27 17:52:39 +09001576
Kukjin Kima8550392012-03-09 14:19:10 -08001577 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sysclks); ptr++)
1578 s3c_register_clksrc(exynos4_sysclks[ptr], 1);
Changhwan Younc8bef142010-07-27 17:52:39 +09001579
Kukjin Kima8550392012-03-09 14:19:10 -08001580 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sclk_tv); ptr++)
1581 s3c_register_clksrc(exynos4_sclk_tv[ptr], 1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001582
Kukjin Kima8550392012-03-09 14:19:10 -08001583 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrc_cdev); ptr++)
1584 s3c_register_clksrc(exynos4_clksrc_cdev[ptr], 1);
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001585
Kukjin Kima8550392012-03-09 14:19:10 -08001586 s3c_register_clksrc(exynos4_clksrcs, ARRAY_SIZE(exynos4_clksrcs));
1587 s3c_register_clocks(exynos4_init_clocks_on, ARRAY_SIZE(exynos4_init_clocks_on));
Changhwan Younc8bef142010-07-27 17:52:39 +09001588
Kukjin Kima8550392012-03-09 14:19:10 -08001589 s3c24xx_register_clocks(exynos4_clk_cdev, ARRAY_SIZE(exynos4_clk_cdev));
1590 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clk_cdev); ptr++)
1591 s3c_disable_clocks(exynos4_clk_cdev[ptr], 1);
Thomas Abraham66fdb292011-10-24 14:01:03 +02001592
Kukjin Kima8550392012-03-09 14:19:10 -08001593 s3c_register_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off));
1594 s3c_disable_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off));
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001595 clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup));
Changhwan Younc8bef142010-07-27 17:52:39 +09001596
Jonghwan Choiacd35612011-08-24 21:52:45 +09001597 register_syscore_ops(&exynos4_clock_syscore_ops);
Boojin Kimbf856fb2011-09-02 09:44:36 +09001598 s3c24xx_register_clock(&dummy_apb_pclk);
1599
Changhwan Younc8bef142010-07-27 17:52:39 +09001600 s3c_pwmclk_init();
1601}