blob: db5d1cce3d25613c33fa576440dc1c8efa6897b0 [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
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900171static int 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
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900201static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
202{
203 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
204}
205
206static int exynos4_clk_dac_ctrl(struct clk *clk, int enable)
207{
208 return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable);
209}
210
Changhwan Younc8bef142010-07-27 17:52:39 +0900211/* Core list of CMU_CPU side */
212
Kukjin Kima8550392012-03-09 14:19:10 -0800213static struct clksrc_clk exynos4_clk_mout_apll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900214 .clk = {
215 .name = "mout_apll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900216 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800217 .sources = &clk_src_apll,
Kukjin Kima8550392012-03-09 14:19:10 -0800218 .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 0, .size = 1 },
Jongpill Lee3ff31022010-08-18 22:20:31 +0900219};
220
Kukjin Kima8550392012-03-09 14:19:10 -0800221static struct clksrc_clk exynos4_clk_sclk_apll = {
Jongpill Lee3ff31022010-08-18 22:20:31 +0900222 .clk = {
223 .name = "sclk_apll",
Kukjin Kima8550392012-03-09 14:19:10 -0800224 .parent = &exynos4_clk_mout_apll.clk,
Jongpill Lee3ff31022010-08-18 22:20:31 +0900225 },
Kukjin Kima8550392012-03-09 14:19:10 -0800226 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 24, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900227};
228
Kukjin Kima8550392012-03-09 14:19:10 -0800229static struct clksrc_clk exynos4_clk_mout_epll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900230 .clk = {
231 .name = "mout_epll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900232 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800233 .sources = &clk_src_epll,
Kukjin Kima8550392012-03-09 14:19:10 -0800234 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 4, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900235};
236
Kukjin Kima8550392012-03-09 14:19:10 -0800237struct clksrc_clk exynos4_clk_mout_mpll = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800238 .clk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900239 .name = "mout_mpll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900240 },
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800241 .sources = &clk_src_mpll,
Kukjin Kim2bc02c02011-08-24 17:25:09 +0900242
243 /* reg_src will be added in each SoCs' clock */
Changhwan Younc8bef142010-07-27 17:52:39 +0900244};
245
Kukjin Kima8550392012-03-09 14:19:10 -0800246static struct clk *exynos4_clkset_moutcore_list[] = {
247 [0] = &exynos4_clk_mout_apll.clk,
248 [1] = &exynos4_clk_mout_mpll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900249};
250
Kukjin Kima8550392012-03-09 14:19:10 -0800251static struct clksrc_sources exynos4_clkset_moutcore = {
252 .sources = exynos4_clkset_moutcore_list,
253 .nr_sources = ARRAY_SIZE(exynos4_clkset_moutcore_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900254};
255
Kukjin Kima8550392012-03-09 14:19:10 -0800256static struct clksrc_clk exynos4_clk_moutcore = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900257 .clk = {
258 .name = "moutcore",
Changhwan Younc8bef142010-07-27 17:52:39 +0900259 },
Kukjin Kima8550392012-03-09 14:19:10 -0800260 .sources = &exynos4_clkset_moutcore,
261 .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 16, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900262};
263
Kukjin Kima8550392012-03-09 14:19:10 -0800264static struct clksrc_clk exynos4_clk_coreclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900265 .clk = {
266 .name = "core_clk",
Kukjin Kima8550392012-03-09 14:19:10 -0800267 .parent = &exynos4_clk_moutcore.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900268 },
Kukjin Kima8550392012-03-09 14:19:10 -0800269 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900270};
271
Kukjin Kima8550392012-03-09 14:19:10 -0800272static struct clksrc_clk exynos4_clk_armclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900273 .clk = {
274 .name = "armclk",
Kukjin Kima8550392012-03-09 14:19:10 -0800275 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900276 },
277};
278
Kukjin Kima8550392012-03-09 14:19:10 -0800279static struct clksrc_clk exynos4_clk_aclk_corem0 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900280 .clk = {
281 .name = "aclk_corem0",
Kukjin Kima8550392012-03-09 14:19:10 -0800282 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900283 },
Kukjin Kima8550392012-03-09 14:19:10 -0800284 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900285};
286
Kukjin Kima8550392012-03-09 14:19:10 -0800287static struct clksrc_clk exynos4_clk_aclk_cores = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900288 .clk = {
289 .name = "aclk_cores",
Kukjin Kima8550392012-03-09 14:19:10 -0800290 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900291 },
Kukjin Kima8550392012-03-09 14:19:10 -0800292 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900293};
294
Kukjin Kima8550392012-03-09 14:19:10 -0800295static struct clksrc_clk exynos4_clk_aclk_corem1 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900296 .clk = {
297 .name = "aclk_corem1",
Kukjin Kima8550392012-03-09 14:19:10 -0800298 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900299 },
Kukjin Kima8550392012-03-09 14:19:10 -0800300 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 8, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900301};
302
Kukjin Kima8550392012-03-09 14:19:10 -0800303static struct clksrc_clk exynos4_clk_periphclk = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900304 .clk = {
305 .name = "periphclk",
Kukjin Kima8550392012-03-09 14:19:10 -0800306 .parent = &exynos4_clk_coreclk.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900307 },
Kukjin Kima8550392012-03-09 14:19:10 -0800308 .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900309};
310
Changhwan Younc8bef142010-07-27 17:52:39 +0900311/* Core list of CMU_CORE side */
312
Kukjin Kima8550392012-03-09 14:19:10 -0800313static struct clk *exynos4_clkset_corebus_list[] = {
314 [0] = &exynos4_clk_mout_mpll.clk,
315 [1] = &exynos4_clk_sclk_apll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900316};
317
Kukjin Kima8550392012-03-09 14:19:10 -0800318struct clksrc_sources exynos4_clkset_mout_corebus = {
319 .sources = exynos4_clkset_corebus_list,
320 .nr_sources = ARRAY_SIZE(exynos4_clkset_corebus_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900321};
322
Kukjin Kima8550392012-03-09 14:19:10 -0800323static struct clksrc_clk exynos4_clk_mout_corebus = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900324 .clk = {
325 .name = "mout_corebus",
Changhwan Younc8bef142010-07-27 17:52:39 +0900326 },
Kukjin Kima8550392012-03-09 14:19:10 -0800327 .sources = &exynos4_clkset_mout_corebus,
328 .reg_src = { .reg = EXYNOS4_CLKSRC_DMC, .shift = 4, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900329};
330
Kukjin Kima8550392012-03-09 14:19:10 -0800331static struct clksrc_clk exynos4_clk_sclk_dmc = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900332 .clk = {
333 .name = "sclk_dmc",
Kukjin Kima8550392012-03-09 14:19:10 -0800334 .parent = &exynos4_clk_mout_corebus.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900335 },
Kukjin Kima8550392012-03-09 14:19:10 -0800336 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900337};
338
Kukjin Kima8550392012-03-09 14:19:10 -0800339static struct clksrc_clk exynos4_clk_aclk_cored = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900340 .clk = {
341 .name = "aclk_cored",
Kukjin Kima8550392012-03-09 14:19:10 -0800342 .parent = &exynos4_clk_sclk_dmc.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900343 },
Kukjin Kima8550392012-03-09 14:19:10 -0800344 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 16, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900345};
346
Kukjin Kima8550392012-03-09 14:19:10 -0800347static struct clksrc_clk exynos4_clk_aclk_corep = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900348 .clk = {
349 .name = "aclk_corep",
Kukjin Kima8550392012-03-09 14:19:10 -0800350 .parent = &exynos4_clk_aclk_cored.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900351 },
Kukjin Kima8550392012-03-09 14:19:10 -0800352 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 20, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900353};
354
Kukjin Kima8550392012-03-09 14:19:10 -0800355static struct clksrc_clk exynos4_clk_aclk_acp = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900356 .clk = {
357 .name = "aclk_acp",
Kukjin Kima8550392012-03-09 14:19:10 -0800358 .parent = &exynos4_clk_mout_corebus.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900359 },
Kukjin Kima8550392012-03-09 14:19:10 -0800360 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900361};
362
Kukjin Kima8550392012-03-09 14:19:10 -0800363static struct clksrc_clk exynos4_clk_pclk_acp = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900364 .clk = {
365 .name = "pclk_acp",
Kukjin Kima8550392012-03-09 14:19:10 -0800366 .parent = &exynos4_clk_aclk_acp.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900367 },
Kukjin Kima8550392012-03-09 14:19:10 -0800368 .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 4, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900369};
370
371/* Core list of CMU_TOP side */
372
Kukjin Kima8550392012-03-09 14:19:10 -0800373struct clk *exynos4_clkset_aclk_top_list[] = {
374 [0] = &exynos4_clk_mout_mpll.clk,
375 [1] = &exynos4_clk_sclk_apll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900376};
377
Kukjin Kima8550392012-03-09 14:19:10 -0800378static struct clksrc_sources exynos4_clkset_aclk = {
379 .sources = exynos4_clkset_aclk_top_list,
380 .nr_sources = ARRAY_SIZE(exynos4_clkset_aclk_top_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900381};
382
Kukjin Kima8550392012-03-09 14:19:10 -0800383static struct clksrc_clk exynos4_clk_aclk_200 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900384 .clk = {
385 .name = "aclk_200",
Changhwan Younc8bef142010-07-27 17:52:39 +0900386 },
Kukjin Kima8550392012-03-09 14:19:10 -0800387 .sources = &exynos4_clkset_aclk,
388 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 12, .size = 1 },
389 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 0, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900390};
391
Kukjin Kima8550392012-03-09 14:19:10 -0800392static struct clksrc_clk exynos4_clk_aclk_100 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900393 .clk = {
394 .name = "aclk_100",
Changhwan Younc8bef142010-07-27 17:52:39 +0900395 },
Kukjin Kima8550392012-03-09 14:19:10 -0800396 .sources = &exynos4_clkset_aclk,
397 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 16, .size = 1 },
398 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 4, .size = 4 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900399};
400
Kukjin Kima8550392012-03-09 14:19:10 -0800401static struct clksrc_clk exynos4_clk_aclk_160 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900402 .clk = {
403 .name = "aclk_160",
Changhwan Younc8bef142010-07-27 17:52:39 +0900404 },
Kukjin Kima8550392012-03-09 14:19:10 -0800405 .sources = &exynos4_clkset_aclk,
406 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 20, .size = 1 },
407 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 8, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900408};
409
Kukjin Kima8550392012-03-09 14:19:10 -0800410struct clksrc_clk exynos4_clk_aclk_133 = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900411 .clk = {
412 .name = "aclk_133",
Changhwan Younc8bef142010-07-27 17:52:39 +0900413 },
Kukjin Kima8550392012-03-09 14:19:10 -0800414 .sources = &exynos4_clkset_aclk,
415 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 24, .size = 1 },
416 .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 12, .size = 3 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900417};
418
Kukjin Kima8550392012-03-09 14:19:10 -0800419static struct clk *exynos4_clkset_vpllsrc_list[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900420 [0] = &clk_fin_vpll,
Kukjin Kima8550392012-03-09 14:19:10 -0800421 [1] = &exynos4_clk_sclk_hdmi27m,
Changhwan Younc8bef142010-07-27 17:52:39 +0900422};
423
Kukjin Kima8550392012-03-09 14:19:10 -0800424static struct clksrc_sources exynos4_clkset_vpllsrc = {
425 .sources = exynos4_clkset_vpllsrc_list,
426 .nr_sources = ARRAY_SIZE(exynos4_clkset_vpllsrc_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900427};
428
Kukjin Kima8550392012-03-09 14:19:10 -0800429static struct clksrc_clk exynos4_clk_vpllsrc = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900430 .clk = {
431 .name = "vpll_src",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900432 .enable = exynos4_clksrc_mask_top_ctrl,
Jongpill Lee37e01722010-08-18 22:33:43 +0900433 .ctrlbit = (1 << 0),
Changhwan Younc8bef142010-07-27 17:52:39 +0900434 },
Kukjin Kima8550392012-03-09 14:19:10 -0800435 .sources = &exynos4_clkset_vpllsrc,
436 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP1, .shift = 0, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900437};
438
Kukjin Kima8550392012-03-09 14:19:10 -0800439static struct clk *exynos4_clkset_sclk_vpll_list[] = {
440 [0] = &exynos4_clk_vpllsrc.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900441 [1] = &clk_fout_vpll,
442};
443
Kukjin Kima8550392012-03-09 14:19:10 -0800444static struct clksrc_sources exynos4_clkset_sclk_vpll = {
445 .sources = exynos4_clkset_sclk_vpll_list,
446 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_vpll_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900447};
448
Kukjin Kima8550392012-03-09 14:19:10 -0800449static struct clksrc_clk exynos4_clk_sclk_vpll = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900450 .clk = {
451 .name = "sclk_vpll",
Changhwan Younc8bef142010-07-27 17:52:39 +0900452 },
Kukjin Kima8550392012-03-09 14:19:10 -0800453 .sources = &exynos4_clkset_sclk_vpll,
454 .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 8, .size = 1 },
Changhwan Younc8bef142010-07-27 17:52:39 +0900455};
456
Kukjin Kima8550392012-03-09 14:19:10 -0800457static struct clk exynos4_init_clocks_off[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900458 {
459 .name = "timers",
Kukjin Kima8550392012-03-09 14:19:10 -0800460 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900461 .enable = exynos4_clk_ip_peril_ctrl,
Changhwan Younc8bef142010-07-27 17:52:39 +0900462 .ctrlbit = (1<<24),
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900463 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900464 .name = "csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900465 .devname = "s5p-mipi-csis.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900466 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900467 .ctrlbit = (1 << 4),
468 }, {
469 .name = "csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900470 .devname = "s5p-mipi-csis.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900471 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900472 .ctrlbit = (1 << 5),
473 }, {
474 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900475 .devname = "exynos4-fimc.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900476 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900477 .ctrlbit = (1 << 0),
478 }, {
479 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900480 .devname = "exynos4-fimc.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900481 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900482 .ctrlbit = (1 << 1),
483 }, {
484 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900485 .devname = "exynos4-fimc.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900486 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900487 .ctrlbit = (1 << 2),
488 }, {
489 .name = "fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900490 .devname = "exynos4-fimc.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900491 .enable = exynos4_clk_ip_cam_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900492 .ctrlbit = (1 << 3),
493 }, {
494 .name = "fimd",
Jingoo Han268a7ef2011-07-21 15:42:38 +0900495 .devname = "exynos4-fb.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900496 .enable = exynos4_clk_ip_lcd0_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900497 .ctrlbit = (1 << 0),
498 }, {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900499 .name = "hsmmc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900500 .devname = "s3c-sdhci.0",
Kukjin Kima8550392012-03-09 14:19:10 -0800501 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900502 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900503 .ctrlbit = (1 << 5),
504 }, {
505 .name = "hsmmc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900506 .devname = "s3c-sdhci.1",
Kukjin Kima8550392012-03-09 14:19:10 -0800507 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900508 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900509 .ctrlbit = (1 << 6),
510 }, {
511 .name = "hsmmc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900512 .devname = "s3c-sdhci.2",
Kukjin Kima8550392012-03-09 14:19:10 -0800513 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900514 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900515 .ctrlbit = (1 << 7),
516 }, {
517 .name = "hsmmc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900518 .devname = "s3c-sdhci.3",
Kukjin Kima8550392012-03-09 14:19:10 -0800519 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900520 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900521 .ctrlbit = (1 << 8),
522 }, {
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900523 .name = "dwmmc",
Kukjin Kima8550392012-03-09 14:19:10 -0800524 .parent = &exynos4_clk_aclk_133.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900525 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900526 .ctrlbit = (1 << 9),
Jongpill Lee82260bf2010-08-18 22:49:24 +0900527 }, {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900528 .name = "dac",
529 .devname = "s5p-sdo",
530 .enable = exynos4_clk_ip_tv_ctrl,
531 .ctrlbit = (1 << 2),
532 }, {
533 .name = "mixer",
534 .devname = "s5p-mixer",
535 .enable = exynos4_clk_ip_tv_ctrl,
536 .ctrlbit = (1 << 1),
537 }, {
538 .name = "vp",
539 .devname = "s5p-mixer",
540 .enable = exynos4_clk_ip_tv_ctrl,
541 .ctrlbit = (1 << 0),
542 }, {
543 .name = "hdmi",
544 .devname = "exynos4-hdmi",
545 .enable = exynos4_clk_ip_tv_ctrl,
546 .ctrlbit = (1 << 3),
547 }, {
548 .name = "hdmiphy",
549 .devname = "exynos4-hdmi",
550 .enable = exynos4_clk_hdmiphy_ctrl,
551 .ctrlbit = (1 << 0),
552 }, {
553 .name = "dacphy",
554 .devname = "s5p-sdo",
555 .enable = exynos4_clk_dac_ctrl,
556 .ctrlbit = (1 << 0),
557 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900558 .name = "adc",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900559 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900560 .ctrlbit = (1 << 15),
561 }, {
Naveen Krishna Chf9d7bcb2011-02-22 17:13:42 +0900562 .name = "keypad",
Naveen Krishna Chf9d7bcb2011-02-22 17:13:42 +0900563 .enable = exynos4_clk_ip_perir_ctrl,
564 .ctrlbit = (1 << 16),
565 }, {
Changhwan Youncdff6e62010-09-20 15:25:51 +0900566 .name = "rtc",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900567 .enable = exynos4_clk_ip_perir_ctrl,
Changhwan Youncdff6e62010-09-20 15:25:51 +0900568 .ctrlbit = (1 << 15),
569 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900570 .name = "watchdog",
Kukjin Kima8550392012-03-09 14:19:10 -0800571 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900572 .enable = exynos4_clk_ip_perir_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900573 .ctrlbit = (1 << 14),
574 }, {
575 .name = "usbhost",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900576 .enable = exynos4_clk_ip_fsys_ctrl ,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900577 .ctrlbit = (1 << 12),
578 }, {
579 .name = "otg",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900580 .enable = exynos4_clk_ip_fsys_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900581 .ctrlbit = (1 << 13),
582 }, {
583 .name = "spi",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900584 .devname = "s3c64xx-spi.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900585 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900586 .ctrlbit = (1 << 16),
587 }, {
588 .name = "spi",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900589 .devname = "s3c64xx-spi.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900590 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900591 .ctrlbit = (1 << 17),
592 }, {
593 .name = "spi",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900594 .devname = "s3c64xx-spi.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900595 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900596 .ctrlbit = (1 << 18),
597 }, {
Jassi Brar2d270432010-12-21 09:57:03 +0900598 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900599 .devname = "samsung-i2s.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900600 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900601 .ctrlbit = (1 << 19),
602 }, {
603 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900604 .devname = "samsung-i2s.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900605 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900606 .ctrlbit = (1 << 20),
607 }, {
608 .name = "iis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900609 .devname = "samsung-i2s.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900610 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Brar2d270432010-12-21 09:57:03 +0900611 .ctrlbit = (1 << 21),
612 }, {
Jassi Braraa227552010-12-21 09:54:57 +0900613 .name = "ac97",
Jonghwan Choiaf8a9f62011-08-12 18:15:42 +0900614 .devname = "samsung-ac97",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900615 .enable = exynos4_clk_ip_peril_ctrl,
Jassi Braraa227552010-12-21 09:54:57 +0900616 .ctrlbit = (1 << 27),
617 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900618 .name = "fimg2d",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900619 .enable = exynos4_clk_ip_image_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900620 .ctrlbit = (1 << 0),
621 }, {
Kamil Debski0f75a962011-07-21 16:42:30 +0900622 .name = "mfc",
623 .devname = "s5p-mfc",
624 .enable = exynos4_clk_ip_mfc_ctrl,
625 .ctrlbit = (1 << 0),
626 }, {
Jongpill Lee82260bf2010-08-18 22:49:24 +0900627 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900628 .devname = "s3c2440-i2c.0",
Kukjin Kima8550392012-03-09 14:19:10 -0800629 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900630 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900631 .ctrlbit = (1 << 6),
632 }, {
633 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900634 .devname = "s3c2440-i2c.1",
Kukjin Kima8550392012-03-09 14:19:10 -0800635 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900636 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900637 .ctrlbit = (1 << 7),
638 }, {
639 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900640 .devname = "s3c2440-i2c.2",
Kukjin Kima8550392012-03-09 14:19:10 -0800641 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900642 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900643 .ctrlbit = (1 << 8),
644 }, {
645 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900646 .devname = "s3c2440-i2c.3",
Kukjin Kima8550392012-03-09 14:19:10 -0800647 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900648 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900649 .ctrlbit = (1 << 9),
650 }, {
651 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900652 .devname = "s3c2440-i2c.4",
Kukjin Kima8550392012-03-09 14:19:10 -0800653 .parent = &exynos4_clk_aclk_100.clk,
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900654 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee82260bf2010-08-18 22:49:24 +0900655 .ctrlbit = (1 << 10),
656 }, {
657 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900658 .devname = "s3c2440-i2c.5",
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 << 11),
662 }, {
663 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900664 .devname = "s3c2440-i2c.6",
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 << 12),
668 }, {
669 .name = "i2c",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900670 .devname = "s3c2440-i2c.7",
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 << 13),
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900674 }, {
Tomasz Stanislawskic40e7e02011-09-16 18:44:36 +0900675 .name = "i2c",
676 .devname = "s3c2440-hdmiphy-i2c",
Kukjin Kima8550392012-03-09 14:19:10 -0800677 .parent = &exynos4_clk_aclk_100.clk,
Tomasz Stanislawskic40e7e02011-09-16 18:44:36 +0900678 .enable = exynos4_clk_ip_peril_ctrl,
679 .ctrlbit = (1 << 14),
680 }, {
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900681 .name = "SYSMMU_MDMA",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900682 .enable = exynos4_clk_ip_image_ctrl,
683 .ctrlbit = (1 << 5),
684 }, {
685 .name = "SYSMMU_FIMC0",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900686 .enable = exynos4_clk_ip_cam_ctrl,
687 .ctrlbit = (1 << 7),
688 }, {
689 .name = "SYSMMU_FIMC1",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900690 .enable = exynos4_clk_ip_cam_ctrl,
691 .ctrlbit = (1 << 8),
692 }, {
693 .name = "SYSMMU_FIMC2",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900694 .enable = exynos4_clk_ip_cam_ctrl,
695 .ctrlbit = (1 << 9),
696 }, {
697 .name = "SYSMMU_FIMC3",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900698 .enable = exynos4_clk_ip_cam_ctrl,
699 .ctrlbit = (1 << 10),
700 }, {
701 .name = "SYSMMU_JPEG",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900702 .enable = exynos4_clk_ip_cam_ctrl,
703 .ctrlbit = (1 << 11),
704 }, {
705 .name = "SYSMMU_FIMD0",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900706 .enable = exynos4_clk_ip_lcd0_ctrl,
707 .ctrlbit = (1 << 4),
708 }, {
709 .name = "SYSMMU_FIMD1",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900710 .enable = exynos4_clk_ip_lcd1_ctrl,
711 .ctrlbit = (1 << 4),
712 }, {
713 .name = "SYSMMU_PCIe",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900714 .enable = exynos4_clk_ip_fsys_ctrl,
715 .ctrlbit = (1 << 18),
716 }, {
717 .name = "SYSMMU_G2D",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900718 .enable = exynos4_clk_ip_image_ctrl,
719 .ctrlbit = (1 << 3),
720 }, {
721 .name = "SYSMMU_ROTATOR",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900722 .enable = exynos4_clk_ip_image_ctrl,
723 .ctrlbit = (1 << 4),
724 }, {
725 .name = "SYSMMU_TV",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900726 .enable = exynos4_clk_ip_tv_ctrl,
727 .ctrlbit = (1 << 4),
728 }, {
729 .name = "SYSMMU_MFC_L",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900730 .enable = exynos4_clk_ip_mfc_ctrl,
731 .ctrlbit = (1 << 1),
732 }, {
733 .name = "SYSMMU_MFC_R",
KyongHo Chob0b6ff02011-03-07 09:10:24 +0900734 .enable = exynos4_clk_ip_mfc_ctrl,
735 .ctrlbit = (1 << 2),
736 }
Changhwan Younc8bef142010-07-27 17:52:39 +0900737};
738
Kukjin Kima8550392012-03-09 14:19:10 -0800739static struct clk exynos4_init_clocks_on[] = {
Jongpill Lee5a847b42010-08-27 16:50:47 +0900740 {
741 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900742 .devname = "s5pv210-uart.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900743 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900744 .ctrlbit = (1 << 0),
745 }, {
746 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900747 .devname = "s5pv210-uart.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900748 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900749 .ctrlbit = (1 << 1),
750 }, {
751 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900752 .devname = "s5pv210-uart.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900753 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900754 .ctrlbit = (1 << 2),
755 }, {
756 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900757 .devname = "s5pv210-uart.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900758 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900759 .ctrlbit = (1 << 3),
760 }, {
761 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900762 .devname = "s5pv210-uart.4",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900763 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900764 .ctrlbit = (1 << 4),
765 }, {
766 .name = "uart",
Thomas Abrahambadc4f22011-06-14 19:12:27 +0900767 .devname = "s5pv210-uart.5",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +0900768 .enable = exynos4_clk_ip_peril_ctrl,
Jongpill Lee5a847b42010-08-27 16:50:47 +0900769 .ctrlbit = (1 << 5),
770 }
Changhwan Younc8bef142010-07-27 17:52:39 +0900771};
772
Kukjin Kima8550392012-03-09 14:19:10 -0800773static struct clk exynos4_clk_pdma0 = {
Thomas Abraham66fdb292011-10-24 14:01:03 +0200774 .name = "dma",
775 .devname = "dma-pl330.0",
776 .enable = exynos4_clk_ip_fsys_ctrl,
777 .ctrlbit = (1 << 0),
778};
779
Kukjin Kima8550392012-03-09 14:19:10 -0800780static struct clk exynos4_clk_pdma1 = {
Thomas Abraham66fdb292011-10-24 14:01:03 +0200781 .name = "dma",
782 .devname = "dma-pl330.1",
783 .enable = exynos4_clk_ip_fsys_ctrl,
784 .ctrlbit = (1 << 1),
785};
786
Boojin Kim9ed76e02012-02-15 13:15:12 +0900787static struct clk exynos4_clk_mdma1 = {
788 .name = "dma",
789 .devname = "dma-pl330.2",
790 .enable = exynos4_clk_ip_image_ctrl,
791 .ctrlbit = ((1 << 8) | (1 << 5) | (1 << 2)),
792};
793
Kukjin Kima8550392012-03-09 14:19:10 -0800794struct clk *exynos4_clkset_group_list[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +0900795 [0] = &clk_ext_xtal_mux,
796 [1] = &clk_xusbxti,
Kukjin Kima8550392012-03-09 14:19:10 -0800797 [2] = &exynos4_clk_sclk_hdmi27m,
798 [3] = &exynos4_clk_sclk_usbphy0,
799 [4] = &exynos4_clk_sclk_usbphy1,
800 [5] = &exynos4_clk_sclk_hdmiphy,
801 [6] = &exynos4_clk_mout_mpll.clk,
802 [7] = &exynos4_clk_mout_epll.clk,
803 [8] = &exynos4_clk_sclk_vpll.clk,
Changhwan Younc8bef142010-07-27 17:52:39 +0900804};
805
Kukjin Kima8550392012-03-09 14:19:10 -0800806struct clksrc_sources exynos4_clkset_group = {
807 .sources = exynos4_clkset_group_list,
808 .nr_sources = ARRAY_SIZE(exynos4_clkset_group_list),
Changhwan Younc8bef142010-07-27 17:52:39 +0900809};
810
Kukjin Kima8550392012-03-09 14:19:10 -0800811static struct clk *exynos4_clkset_mout_g2d0_list[] = {
812 [0] = &exynos4_clk_mout_mpll.clk,
813 [1] = &exynos4_clk_sclk_apll.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900814};
815
Kukjin Kima8550392012-03-09 14:19:10 -0800816static struct clksrc_sources exynos4_clkset_mout_g2d0 = {
817 .sources = exynos4_clkset_mout_g2d0_list,
818 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d0_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900819};
820
Kukjin Kima8550392012-03-09 14:19:10 -0800821static struct clksrc_clk exynos4_clk_mout_g2d0 = {
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900822 .clk = {
823 .name = "mout_g2d0",
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900824 },
Kukjin Kima8550392012-03-09 14:19:10 -0800825 .sources = &exynos4_clkset_mout_g2d0,
826 .reg_src = { .reg = EXYNOS4_CLKSRC_IMAGE, .shift = 0, .size = 1 },
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900827};
828
Kukjin Kima8550392012-03-09 14:19:10 -0800829static struct clk *exynos4_clkset_mout_g2d1_list[] = {
830 [0] = &exynos4_clk_mout_epll.clk,
831 [1] = &exynos4_clk_sclk_vpll.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900832};
833
Kukjin Kima8550392012-03-09 14:19:10 -0800834static struct clksrc_sources exynos4_clkset_mout_g2d1 = {
835 .sources = exynos4_clkset_mout_g2d1_list,
836 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d1_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900837};
838
Kukjin Kima8550392012-03-09 14:19:10 -0800839static struct clksrc_clk exynos4_clk_mout_g2d1 = {
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900840 .clk = {
841 .name = "mout_g2d1",
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900842 },
Kukjin Kima8550392012-03-09 14:19:10 -0800843 .sources = &exynos4_clkset_mout_g2d1,
844 .reg_src = { .reg = EXYNOS4_CLKSRC_IMAGE, .shift = 4, .size = 1 },
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900845};
846
Kukjin Kima8550392012-03-09 14:19:10 -0800847static struct clk *exynos4_clkset_mout_g2d_list[] = {
848 [0] = &exynos4_clk_mout_g2d0.clk,
849 [1] = &exynos4_clk_mout_g2d1.clk,
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900850};
851
Kukjin Kima8550392012-03-09 14:19:10 -0800852static struct clksrc_sources exynos4_clkset_mout_g2d = {
853 .sources = exynos4_clkset_mout_g2d_list,
854 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d_list),
Jongpill Lee06cba8d2010-08-18 22:51:23 +0900855};
856
Kukjin Kima8550392012-03-09 14:19:10 -0800857static struct clk *exynos4_clkset_mout_mfc0_list[] = {
858 [0] = &exynos4_clk_mout_mpll.clk,
859 [1] = &exynos4_clk_sclk_apll.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900860};
861
Kukjin Kima8550392012-03-09 14:19:10 -0800862static struct clksrc_sources exynos4_clkset_mout_mfc0 = {
863 .sources = exynos4_clkset_mout_mfc0_list,
864 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc0_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900865};
866
Kukjin Kima8550392012-03-09 14:19:10 -0800867static struct clksrc_clk exynos4_clk_mout_mfc0 = {
Kamil Debski0f75a962011-07-21 16:42:30 +0900868 .clk = {
869 .name = "mout_mfc0",
870 },
Kukjin Kima8550392012-03-09 14:19:10 -0800871 .sources = &exynos4_clkset_mout_mfc0,
872 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 0, .size = 1 },
Kamil Debski0f75a962011-07-21 16:42:30 +0900873};
874
Kukjin Kima8550392012-03-09 14:19:10 -0800875static struct clk *exynos4_clkset_mout_mfc1_list[] = {
876 [0] = &exynos4_clk_mout_epll.clk,
877 [1] = &exynos4_clk_sclk_vpll.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900878};
879
Kukjin Kima8550392012-03-09 14:19:10 -0800880static struct clksrc_sources exynos4_clkset_mout_mfc1 = {
881 .sources = exynos4_clkset_mout_mfc1_list,
882 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc1_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900883};
884
Kukjin Kima8550392012-03-09 14:19:10 -0800885static struct clksrc_clk exynos4_clk_mout_mfc1 = {
Kamil Debski0f75a962011-07-21 16:42:30 +0900886 .clk = {
887 .name = "mout_mfc1",
888 },
Kukjin Kima8550392012-03-09 14:19:10 -0800889 .sources = &exynos4_clkset_mout_mfc1,
890 .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 4, .size = 1 },
Kamil Debski0f75a962011-07-21 16:42:30 +0900891};
892
Kukjin Kima8550392012-03-09 14:19:10 -0800893static struct clk *exynos4_clkset_mout_mfc_list[] = {
894 [0] = &exynos4_clk_mout_mfc0.clk,
895 [1] = &exynos4_clk_mout_mfc1.clk,
Kamil Debski0f75a962011-07-21 16:42:30 +0900896};
897
Kukjin Kima8550392012-03-09 14:19:10 -0800898static struct clksrc_sources exynos4_clkset_mout_mfc = {
899 .sources = exynos4_clkset_mout_mfc_list,
900 .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc_list),
Kamil Debski0f75a962011-07-21 16:42:30 +0900901};
902
Kukjin Kima8550392012-03-09 14:19:10 -0800903static struct clk *exynos4_clkset_sclk_dac_list[] = {
904 [0] = &exynos4_clk_sclk_vpll.clk,
905 [1] = &exynos4_clk_sclk_hdmiphy,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900906};
907
Kukjin Kima8550392012-03-09 14:19:10 -0800908static struct clksrc_sources exynos4_clkset_sclk_dac = {
909 .sources = exynos4_clkset_sclk_dac_list,
910 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_dac_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900911};
912
Kukjin Kima8550392012-03-09 14:19:10 -0800913static struct clksrc_clk exynos4_clk_sclk_dac = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900914 .clk = {
915 .name = "sclk_dac",
916 .enable = exynos4_clksrc_mask_tv_ctrl,
917 .ctrlbit = (1 << 8),
918 },
Kukjin Kima8550392012-03-09 14:19:10 -0800919 .sources = &exynos4_clkset_sclk_dac,
920 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 8, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900921};
922
Kukjin Kima8550392012-03-09 14:19:10 -0800923static struct clksrc_clk exynos4_clk_sclk_pixel = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900924 .clk = {
925 .name = "sclk_pixel",
Kukjin Kima8550392012-03-09 14:19:10 -0800926 .parent = &exynos4_clk_sclk_vpll.clk,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900927 },
Kukjin Kima8550392012-03-09 14:19:10 -0800928 .reg_div = { .reg = EXYNOS4_CLKDIV_TV, .shift = 0, .size = 4 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900929};
930
Kukjin Kima8550392012-03-09 14:19:10 -0800931static struct clk *exynos4_clkset_sclk_hdmi_list[] = {
932 [0] = &exynos4_clk_sclk_pixel.clk,
933 [1] = &exynos4_clk_sclk_hdmiphy,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900934};
935
Kukjin Kima8550392012-03-09 14:19:10 -0800936static struct clksrc_sources exynos4_clkset_sclk_hdmi = {
937 .sources = exynos4_clkset_sclk_hdmi_list,
938 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_hdmi_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900939};
940
Kukjin Kima8550392012-03-09 14:19:10 -0800941static struct clksrc_clk exynos4_clk_sclk_hdmi = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900942 .clk = {
943 .name = "sclk_hdmi",
944 .enable = exynos4_clksrc_mask_tv_ctrl,
945 .ctrlbit = (1 << 0),
946 },
Kukjin Kima8550392012-03-09 14:19:10 -0800947 .sources = &exynos4_clkset_sclk_hdmi,
948 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 0, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900949};
950
Kukjin Kima8550392012-03-09 14:19:10 -0800951static struct clk *exynos4_clkset_sclk_mixer_list[] = {
952 [0] = &exynos4_clk_sclk_dac.clk,
953 [1] = &exynos4_clk_sclk_hdmi.clk,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900954};
955
Kukjin Kima8550392012-03-09 14:19:10 -0800956static struct clksrc_sources exynos4_clkset_sclk_mixer = {
957 .sources = exynos4_clkset_sclk_mixer_list,
958 .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_mixer_list),
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900959};
960
Kukjin Kima8550392012-03-09 14:19:10 -0800961static struct clksrc_clk exynos4_clk_sclk_mixer = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800962 .clk = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900963 .name = "sclk_mixer",
964 .enable = exynos4_clksrc_mask_tv_ctrl,
965 .ctrlbit = (1 << 4),
966 },
Kukjin Kima8550392012-03-09 14:19:10 -0800967 .sources = &exynos4_clkset_sclk_mixer,
968 .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 4, .size = 1 },
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900969};
970
Kukjin Kima8550392012-03-09 14:19:10 -0800971static struct clksrc_clk *exynos4_sclk_tv[] = {
972 &exynos4_clk_sclk_dac,
973 &exynos4_clk_sclk_pixel,
974 &exynos4_clk_sclk_hdmi,
975 &exynos4_clk_sclk_mixer,
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +0900976};
977
Kukjin Kima8550392012-03-09 14:19:10 -0800978static struct clksrc_clk exynos4_clk_dout_mmc0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800979 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900980 .name = "dout_mmc0",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900981 },
Kukjin Kima8550392012-03-09 14:19:10 -0800982 .sources = &exynos4_clkset_group,
983 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 0, .size = 4 },
984 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900985};
986
Kukjin Kima8550392012-03-09 14:19:10 -0800987static struct clksrc_clk exynos4_clk_dout_mmc1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800988 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900989 .name = "dout_mmc1",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900990 },
Kukjin Kima8550392012-03-09 14:19:10 -0800991 .sources = &exynos4_clkset_group,
992 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 4, .size = 4 },
993 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 16, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900994};
995
Kukjin Kima8550392012-03-09 14:19:10 -0800996static struct clksrc_clk exynos4_clk_dout_mmc2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -0800997 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900998 .name = "dout_mmc2",
Jongpill Lee340ea1e2010-08-18 22:39:26 +0900999 },
Kukjin Kima8550392012-03-09 14:19:10 -08001000 .sources = &exynos4_clkset_group,
1001 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 8, .size = 4 },
1002 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001003};
1004
Kukjin Kima8550392012-03-09 14:19:10 -08001005static struct clksrc_clk exynos4_clk_dout_mmc3 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001006 .clk = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001007 .name = "dout_mmc3",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001008 },
Kukjin Kima8550392012-03-09 14:19:10 -08001009 .sources = &exynos4_clkset_group,
1010 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 12, .size = 4 },
1011 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 16, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001012};
1013
Kukjin Kima8550392012-03-09 14:19:10 -08001014static struct clksrc_clk exynos4_clk_dout_mmc4 = {
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001015 .clk = {
1016 .name = "dout_mmc4",
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001017 },
Kukjin Kima8550392012-03-09 14:19:10 -08001018 .sources = &exynos4_clkset_group,
1019 .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 16, .size = 4 },
1020 .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001021};
1022
Kukjin Kima8550392012-03-09 14:19:10 -08001023static struct clksrc_clk exynos4_clksrcs[] = {
Changhwan Younc8bef142010-07-27 17:52:39 +09001024 {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001025 .clk = {
Changhwan Younc8bef142010-07-27 17:52:39 +09001026 .name = "sclk_pwm",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001027 .enable = exynos4_clksrc_mask_peril0_ctrl,
Changhwan Younc8bef142010-07-27 17:52:39 +09001028 .ctrlbit = (1 << 24),
1029 },
Kukjin Kima8550392012-03-09 14:19:10 -08001030 .sources = &exynos4_clkset_group,
1031 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 24, .size = 4 },
1032 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL3, .shift = 0, .size = 4 },
Jongpill Lee340ea1e2010-08-18 22:39:26 +09001033 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001034 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001035 .name = "sclk_csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001036 .devname = "s5p-mipi-csis.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001037 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001038 .ctrlbit = (1 << 24),
1039 },
Kukjin Kima8550392012-03-09 14:19:10 -08001040 .sources = &exynos4_clkset_group,
1041 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 24, .size = 4 },
1042 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 24, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001043 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001044 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001045 .name = "sclk_csis",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001046 .devname = "s5p-mipi-csis.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001047 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001048 .ctrlbit = (1 << 28),
1049 },
Kukjin Kima8550392012-03-09 14:19:10 -08001050 .sources = &exynos4_clkset_group,
1051 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 28, .size = 4 },
1052 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 28, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001053 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001054 .clk = {
Sylwester Nawrocki00aaad22011-09-27 07:00:59 +09001055 .name = "sclk_cam0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001056 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001057 .ctrlbit = (1 << 16),
1058 },
Kukjin Kima8550392012-03-09 14:19:10 -08001059 .sources = &exynos4_clkset_group,
1060 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 16, .size = 4 },
1061 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 16, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001062 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001063 .clk = {
Sylwester Nawrocki00aaad22011-09-27 07:00:59 +09001064 .name = "sclk_cam1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001065 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001066 .ctrlbit = (1 << 20),
1067 },
Kukjin Kima8550392012-03-09 14:19:10 -08001068 .sources = &exynos4_clkset_group,
1069 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 20, .size = 4 },
1070 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 20, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001071 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001072 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001073 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001074 .devname = "exynos4-fimc.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001075 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001076 .ctrlbit = (1 << 0),
1077 },
Kukjin Kima8550392012-03-09 14:19:10 -08001078 .sources = &exynos4_clkset_group,
1079 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 0, .size = 4 },
1080 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 0, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001081 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001082 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001083 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001084 .devname = "exynos4-fimc.1",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001085 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001086 .ctrlbit = (1 << 4),
1087 },
Kukjin Kima8550392012-03-09 14:19:10 -08001088 .sources = &exynos4_clkset_group,
1089 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 4, .size = 4 },
1090 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 4, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001091 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001092 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001093 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001094 .devname = "exynos4-fimc.2",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001095 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001096 .ctrlbit = (1 << 8),
1097 },
Kukjin Kima8550392012-03-09 14:19:10 -08001098 .sources = &exynos4_clkset_group,
1099 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 8, .size = 4 },
1100 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 8, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001101 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001102 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001103 .name = "sclk_fimc",
Thomas Abrahambadc4f22011-06-14 19:12:27 +09001104 .devname = "exynos4-fimc.3",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001105 .enable = exynos4_clksrc_mask_cam_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001106 .ctrlbit = (1 << 12),
1107 },
Kukjin Kima8550392012-03-09 14:19:10 -08001108 .sources = &exynos4_clkset_group,
1109 .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 12, .size = 4 },
1110 .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 12, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001111 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001112 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001113 .name = "sclk_fimd",
Jingoo Han268a7ef2011-07-21 15:42:38 +09001114 .devname = "exynos4-fb.0",
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001115 .enable = exynos4_clksrc_mask_lcd0_ctrl,
Jongpill Lee33f469d2010-08-18 22:54:48 +09001116 .ctrlbit = (1 << 0),
1117 },
Kukjin Kima8550392012-03-09 14:19:10 -08001118 .sources = &exynos4_clkset_group,
1119 .reg_src = { .reg = EXYNOS4_CLKSRC_LCD0, .shift = 0, .size = 4 },
1120 .reg_div = { .reg = EXYNOS4_CLKDIV_LCD0, .shift = 0, .size = 4 },
Jongpill Lee33f469d2010-08-18 22:54:48 +09001121 }, {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001122 .clk = {
Jongpill Lee33f469d2010-08-18 22:54:48 +09001123 .name = "sclk_fimg2d",
Jongpill Lee33f469d2010-08-18 22:54:48 +09001124 },
Kukjin Kima8550392012-03-09 14:19:10 -08001125 .sources = &exynos4_clkset_mout_g2d,
1126 .reg_src = { .reg = EXYNOS4_CLKSRC_IMAGE, .shift = 8, .size = 1 },
1127 .reg_div = { .reg = EXYNOS4_CLKDIV_IMAGE, .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",
1198 .devname = "s3c-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",
1209 .devname = "s3c-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",
1220 .devname = "s3c-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",
1231 .devname = "s3c-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
Kukjin Kima8550392012-03-09 14:19:10 -08001239static struct clksrc_clk exynos4_clk_sclk_spi0 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001240 .clk = {
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001241 .name = "sclk_spi",
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001242 .devname = "s3c64xx-spi.0",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001243 .enable = exynos4_clksrc_mask_peril1_ctrl,
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001244 .ctrlbit = (1 << 16),
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001245 },
Kukjin Kima8550392012-03-09 14:19:10 -08001246 .sources = &exynos4_clkset_group,
1247 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 16, .size = 4 },
1248 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 0, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001249};
1250
Kukjin Kima8550392012-03-09 14:19:10 -08001251static struct clksrc_clk exynos4_clk_sclk_spi1 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001252 .clk = {
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001253 .name = "sclk_spi",
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001254 .devname = "s3c64xx-spi.1",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001255 .enable = exynos4_clksrc_mask_peril1_ctrl,
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001256 .ctrlbit = (1 << 20),
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001257 },
Kukjin Kima8550392012-03-09 14:19:10 -08001258 .sources = &exynos4_clkset_group,
1259 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 20, .size = 4 },
1260 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 16, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001261};
1262
Kukjin Kima8550392012-03-09 14:19:10 -08001263static struct clksrc_clk exynos4_clk_sclk_spi2 = {
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001264 .clk = {
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001265 .name = "sclk_spi",
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001266 .devname = "s3c64xx-spi.2",
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001267 .enable = exynos4_clksrc_mask_peril1_ctrl,
Kukjin Kimce9c00e2012-03-09 13:51:24 -08001268 .ctrlbit = (1 << 24),
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001269 },
Kukjin Kima8550392012-03-09 14:19:10 -08001270 .sources = &exynos4_clkset_group,
1271 .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 24, .size = 4 },
1272 .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 0, .size = 4 },
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001273};
1274
Changhwan Younc8bef142010-07-27 17:52:39 +09001275/* Clock initialization code */
Kukjin Kima8550392012-03-09 14:19:10 -08001276static struct clksrc_clk *exynos4_sysclks[] = {
1277 &exynos4_clk_mout_apll,
1278 &exynos4_clk_sclk_apll,
1279 &exynos4_clk_mout_epll,
1280 &exynos4_clk_mout_mpll,
1281 &exynos4_clk_moutcore,
1282 &exynos4_clk_coreclk,
1283 &exynos4_clk_armclk,
1284 &exynos4_clk_aclk_corem0,
1285 &exynos4_clk_aclk_cores,
1286 &exynos4_clk_aclk_corem1,
1287 &exynos4_clk_periphclk,
1288 &exynos4_clk_mout_corebus,
1289 &exynos4_clk_sclk_dmc,
1290 &exynos4_clk_aclk_cored,
1291 &exynos4_clk_aclk_corep,
1292 &exynos4_clk_aclk_acp,
1293 &exynos4_clk_pclk_acp,
1294 &exynos4_clk_vpllsrc,
1295 &exynos4_clk_sclk_vpll,
1296 &exynos4_clk_aclk_200,
1297 &exynos4_clk_aclk_100,
1298 &exynos4_clk_aclk_160,
1299 &exynos4_clk_aclk_133,
1300 &exynos4_clk_dout_mmc0,
1301 &exynos4_clk_dout_mmc1,
1302 &exynos4_clk_dout_mmc2,
1303 &exynos4_clk_dout_mmc3,
1304 &exynos4_clk_dout_mmc4,
1305 &exynos4_clk_mout_mfc0,
1306 &exynos4_clk_mout_mfc1,
Changhwan Younc8bef142010-07-27 17:52:39 +09001307};
1308
Kukjin Kima8550392012-03-09 14:19:10 -08001309static struct clk *exynos4_clk_cdev[] = {
1310 &exynos4_clk_pdma0,
1311 &exynos4_clk_pdma1,
Boojin Kim9ed76e02012-02-15 13:15:12 +09001312 &exynos4_clk_mdma1,
Thomas Abraham66fdb292011-10-24 14:01:03 +02001313};
1314
Kukjin Kima8550392012-03-09 14:19:10 -08001315static struct clksrc_clk *exynos4_clksrc_cdev[] = {
1316 &exynos4_clk_sclk_uart0,
1317 &exynos4_clk_sclk_uart1,
1318 &exynos4_clk_sclk_uart2,
1319 &exynos4_clk_sclk_uart3,
1320 &exynos4_clk_sclk_mmc0,
1321 &exynos4_clk_sclk_mmc1,
1322 &exynos4_clk_sclk_mmc2,
1323 &exynos4_clk_sclk_mmc3,
1324 &exynos4_clk_sclk_spi0,
1325 &exynos4_clk_sclk_spi1,
1326 &exynos4_clk_sclk_spi2,
Padmavathi Venna74ac23a2011-12-26 16:42:15 +09001327
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001328};
1329
1330static struct clk_lookup exynos4_clk_lookup[] = {
Kukjin Kima8550392012-03-09 14:19:10 -08001331 CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &exynos4_clk_sclk_uart0.clk),
1332 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk),
1333 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk),
1334 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk),
1335 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk),
1336 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk),
1337 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk),
1338 CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk),
1339 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0),
1340 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1),
1341 CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk0", &exynos4_clk_sclk_spi0.clk),
1342 CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk0", &exynos4_clk_sclk_spi1.clk),
1343 CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk0", &exynos4_clk_sclk_spi2.clk),
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001344};
1345
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001346static int xtal_rate;
1347
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001348static unsigned long exynos4_fout_apll_get_rate(struct clk *clk)
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001349{
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001350 if (soc_is_exynos4210())
Kukjin Kima8550392012-03-09 14:19:10 -08001351 return s5p_get_pll45xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001352 pll_4508);
Changhwan Younb88b1cc2011-10-04 17:08:56 +09001353 else if (soc_is_exynos4212() || soc_is_exynos4412())
Kukjin Kima8550392012-03-09 14:19:10 -08001354 return s5p_get_pll35xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001355 else
1356 return 0;
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001357}
1358
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001359static struct clk_ops exynos4_fout_apll_ops = {
1360 .get_rate = exynos4_fout_apll_get_rate,
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001361};
1362
Kukjin Kima8550392012-03-09 14:19:10 -08001363static u32 exynos4_vpll_div[][8] = {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001364 { 54000000, 3, 53, 3, 1024, 0, 17, 0 },
1365 { 108000000, 3, 53, 2, 1024, 0, 17, 0 },
1366};
1367
1368static unsigned long exynos4_vpll_get_rate(struct clk *clk)
1369{
1370 return clk->rate;
1371}
1372
1373static int exynos4_vpll_set_rate(struct clk *clk, unsigned long rate)
1374{
1375 unsigned int vpll_con0, vpll_con1 = 0;
1376 unsigned int i;
1377
1378 /* Return if nothing changed */
1379 if (clk->rate == rate)
1380 return 0;
1381
Kukjin Kima8550392012-03-09 14:19:10 -08001382 vpll_con0 = __raw_readl(EXYNOS4_VPLL_CON0);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001383 vpll_con0 &= ~(0x1 << 27 | \
1384 PLL90XX_MDIV_MASK << PLL46XX_MDIV_SHIFT | \
1385 PLL90XX_PDIV_MASK << PLL46XX_PDIV_SHIFT | \
1386 PLL90XX_SDIV_MASK << PLL46XX_SDIV_SHIFT);
1387
Kukjin Kima8550392012-03-09 14:19:10 -08001388 vpll_con1 = __raw_readl(EXYNOS4_VPLL_CON1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001389 vpll_con1 &= ~(PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT | \
1390 PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT | \
1391 PLL4650C_KDIV_MASK << PLL46XX_KDIV_SHIFT);
1392
Kukjin Kima8550392012-03-09 14:19:10 -08001393 for (i = 0; i < ARRAY_SIZE(exynos4_vpll_div); i++) {
1394 if (exynos4_vpll_div[i][0] == rate) {
1395 vpll_con0 |= exynos4_vpll_div[i][1] << PLL46XX_PDIV_SHIFT;
1396 vpll_con0 |= exynos4_vpll_div[i][2] << PLL46XX_MDIV_SHIFT;
1397 vpll_con0 |= exynos4_vpll_div[i][3] << PLL46XX_SDIV_SHIFT;
1398 vpll_con1 |= exynos4_vpll_div[i][4] << PLL46XX_KDIV_SHIFT;
1399 vpll_con1 |= exynos4_vpll_div[i][5] << PLL46XX_MFR_SHIFT;
1400 vpll_con1 |= exynos4_vpll_div[i][6] << PLL46XX_MRR_SHIFT;
1401 vpll_con0 |= exynos4_vpll_div[i][7] << 27;
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001402 break;
1403 }
1404 }
1405
Kukjin Kima8550392012-03-09 14:19:10 -08001406 if (i == ARRAY_SIZE(exynos4_vpll_div)) {
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001407 printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n",
1408 __func__);
1409 return -EINVAL;
1410 }
1411
Kukjin Kima8550392012-03-09 14:19:10 -08001412 __raw_writel(vpll_con0, EXYNOS4_VPLL_CON0);
1413 __raw_writel(vpll_con1, EXYNOS4_VPLL_CON1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001414
1415 /* Wait for VPLL lock */
Kukjin Kima8550392012-03-09 14:19:10 -08001416 while (!(__raw_readl(EXYNOS4_VPLL_CON0) & (1 << PLL46XX_LOCKED_SHIFT)))
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001417 continue;
1418
1419 clk->rate = rate;
1420 return 0;
1421}
1422
1423static struct clk_ops exynos4_vpll_ops = {
1424 .get_rate = exynos4_vpll_get_rate,
1425 .set_rate = exynos4_vpll_set_rate,
1426};
1427
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001428void __init_or_cpufreq exynos4_setup_clocks(void)
Changhwan Younc8bef142010-07-27 17:52:39 +09001429{
1430 struct clk *xtal_clk;
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001431 unsigned long apll = 0;
1432 unsigned long mpll = 0;
1433 unsigned long epll = 0;
1434 unsigned long vpll = 0;
Changhwan Younc8bef142010-07-27 17:52:39 +09001435 unsigned long vpllsrc;
1436 unsigned long xtal;
1437 unsigned long armclk;
Changhwan Younc8bef142010-07-27 17:52:39 +09001438 unsigned long sclk_dmc;
Jongpill Lee228ef982010-08-18 22:24:53 +09001439 unsigned long aclk_200;
1440 unsigned long aclk_100;
1441 unsigned long aclk_160;
1442 unsigned long aclk_133;
Changhwan Younc8bef142010-07-27 17:52:39 +09001443 unsigned int ptr;
1444
1445 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
1446
1447 xtal_clk = clk_get(NULL, "xtal");
1448 BUG_ON(IS_ERR(xtal_clk));
1449
1450 xtal = clk_get_rate(xtal_clk);
Jaecheol Lee877d1b52010-12-23 14:25:31 +09001451
1452 xtal_rate = xtal;
1453
Changhwan Younc8bef142010-07-27 17:52:39 +09001454 clk_put(xtal_clk);
1455
1456 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
1457
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001458 if (soc_is_exynos4210()) {
Kukjin Kima8550392012-03-09 14:19:10 -08001459 apll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_APLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001460 pll_4508);
Kukjin Kima8550392012-03-09 14:19:10 -08001461 mpll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0),
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001462 pll_4508);
Kukjin Kima8550392012-03-09 14:19:10 -08001463 epll = s5p_get_pll46xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0),
1464 __raw_readl(EXYNOS4_EPLL_CON1), pll_4600);
Changhwan Younc8bef142010-07-27 17:52:39 +09001465
Kukjin Kima8550392012-03-09 14:19:10 -08001466 vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk);
1467 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0),
1468 __raw_readl(EXYNOS4_VPLL_CON1), pll_4650c);
Changhwan Younb88b1cc2011-10-04 17:08:56 +09001469 } else if (soc_is_exynos4212() || soc_is_exynos4412()) {
Kukjin Kima8550392012-03-09 14:19:10 -08001470 apll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_APLL_CON0));
1471 mpll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0));
1472 epll = s5p_get_pll36xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0),
1473 __raw_readl(EXYNOS4_EPLL_CON1));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001474
Kukjin Kima8550392012-03-09 14:19:10 -08001475 vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk);
1476 vpll = s5p_get_pll36xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0),
1477 __raw_readl(EXYNOS4_VPLL_CON1));
Kukjin Kim2bc02c02011-08-24 17:25:09 +09001478 } else {
1479 /* nothing */
1480 }
Changhwan Younc8bef142010-07-27 17:52:39 +09001481
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001482 clk_fout_apll.ops = &exynos4_fout_apll_ops;
Changhwan Younc8bef142010-07-27 17:52:39 +09001483 clk_fout_mpll.rate = mpll;
1484 clk_fout_epll.rate = epll;
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001485 clk_fout_vpll.ops = &exynos4_vpll_ops;
Changhwan Younc8bef142010-07-27 17:52:39 +09001486 clk_fout_vpll.rate = vpll;
1487
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001488 printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
Changhwan Younc8bef142010-07-27 17:52:39 +09001489 apll, mpll, epll, vpll);
1490
Kukjin Kima8550392012-03-09 14:19:10 -08001491 armclk = clk_get_rate(&exynos4_clk_armclk.clk);
1492 sclk_dmc = clk_get_rate(&exynos4_clk_sclk_dmc.clk);
Changhwan Younc8bef142010-07-27 17:52:39 +09001493
Kukjin Kima8550392012-03-09 14:19:10 -08001494 aclk_200 = clk_get_rate(&exynos4_clk_aclk_200.clk);
1495 aclk_100 = clk_get_rate(&exynos4_clk_aclk_100.clk);
1496 aclk_160 = clk_get_rate(&exynos4_clk_aclk_160.clk);
1497 aclk_133 = clk_get_rate(&exynos4_clk_aclk_133.clk);
Jongpill Lee228ef982010-08-18 22:24:53 +09001498
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001499 printk(KERN_INFO "EXYNOS4: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n"
Jongpill Lee228ef982010-08-18 22:24:53 +09001500 "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n",
1501 armclk, sclk_dmc, aclk_200,
1502 aclk_100, aclk_160, aclk_133);
Changhwan Younc8bef142010-07-27 17:52:39 +09001503
1504 clk_f.rate = armclk;
1505 clk_h.rate = sclk_dmc;
Jongpill Lee228ef982010-08-18 22:24:53 +09001506 clk_p.rate = aclk_100;
Changhwan Younc8bef142010-07-27 17:52:39 +09001507
Kukjin Kima8550392012-03-09 14:19:10 -08001508 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrcs); ptr++)
1509 s3c_set_clksrc(&exynos4_clksrcs[ptr], true);
Changhwan Younc8bef142010-07-27 17:52:39 +09001510}
1511
Kukjin Kima8550392012-03-09 14:19:10 -08001512static struct clk *exynos4_clks[] __initdata = {
1513 &exynos4_clk_sclk_hdmi27m,
1514 &exynos4_clk_sclk_hdmiphy,
1515 &exynos4_clk_sclk_usbphy0,
1516 &exynos4_clk_sclk_usbphy1,
Changhwan Younc8bef142010-07-27 17:52:39 +09001517};
1518
Jonghwan Choiacd35612011-08-24 21:52:45 +09001519#ifdef CONFIG_PM_SLEEP
1520static int exynos4_clock_suspend(void)
1521{
1522 s3c_pm_do_save(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save));
1523 return 0;
1524}
1525
1526static void exynos4_clock_resume(void)
1527{
1528 s3c_pm_do_restore_core(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save));
1529}
1530
1531#else
1532#define exynos4_clock_suspend NULL
1533#define exynos4_clock_resume NULL
1534#endif
1535
Kukjin Kime745e062012-01-21 10:47:14 +09001536static struct syscore_ops exynos4_clock_syscore_ops = {
Jonghwan Choiacd35612011-08-24 21:52:45 +09001537 .suspend = exynos4_clock_suspend,
1538 .resume = exynos4_clock_resume,
1539};
1540
Kukjin Kimb3ed3a12011-02-14 16:08:04 +09001541void __init exynos4_register_clocks(void)
Changhwan Younc8bef142010-07-27 17:52:39 +09001542{
Changhwan Younc8bef142010-07-27 17:52:39 +09001543 int ptr;
1544
Kukjin Kima8550392012-03-09 14:19:10 -08001545 s3c24xx_register_clocks(exynos4_clks, ARRAY_SIZE(exynos4_clks));
Changhwan Younc8bef142010-07-27 17:52:39 +09001546
Kukjin Kima8550392012-03-09 14:19:10 -08001547 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sysclks); ptr++)
1548 s3c_register_clksrc(exynos4_sysclks[ptr], 1);
Changhwan Younc8bef142010-07-27 17:52:39 +09001549
Kukjin Kima8550392012-03-09 14:19:10 -08001550 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sclk_tv); ptr++)
1551 s3c_register_clksrc(exynos4_sclk_tv[ptr], 1);
Tomasz Stanislawskifbf05562011-09-19 16:44:42 +09001552
Kukjin Kima8550392012-03-09 14:19:10 -08001553 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrc_cdev); ptr++)
1554 s3c_register_clksrc(exynos4_clksrc_cdev[ptr], 1);
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001555
Kukjin Kima8550392012-03-09 14:19:10 -08001556 s3c_register_clksrc(exynos4_clksrcs, ARRAY_SIZE(exynos4_clksrcs));
1557 s3c_register_clocks(exynos4_init_clocks_on, ARRAY_SIZE(exynos4_init_clocks_on));
Changhwan Younc8bef142010-07-27 17:52:39 +09001558
Kukjin Kima8550392012-03-09 14:19:10 -08001559 s3c24xx_register_clocks(exynos4_clk_cdev, ARRAY_SIZE(exynos4_clk_cdev));
1560 for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clk_cdev); ptr++)
1561 s3c_disable_clocks(exynos4_clk_cdev[ptr], 1);
Thomas Abraham66fdb292011-10-24 14:01:03 +02001562
Kukjin Kima8550392012-03-09 14:19:10 -08001563 s3c_register_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off));
1564 s3c_disable_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off));
Thomas Abraham0cfb26e2011-10-24 12:08:42 +02001565 clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup));
Changhwan Younc8bef142010-07-27 17:52:39 +09001566
Jonghwan Choiacd35612011-08-24 21:52:45 +09001567 register_syscore_ops(&exynos4_clock_syscore_ops);
Boojin Kimbf856fb2011-09-02 09:44:36 +09001568 s3c24xx_register_clock(&dummy_apb_pclk);
1569
Changhwan Younc8bef142010-07-27 17:52:39 +09001570 s3c_pwmclk_init();
1571}