Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-exynos4/clock.c |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 2 | * |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 5 | * |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 6 | * EXYNOS4 - Clock support |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/err.h> |
| 15 | #include <linux/io.h> |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 16 | #include <linux/syscore_ops.h> |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 17 | |
| 18 | #include <plat/cpu-freq.h> |
| 19 | #include <plat/clock.h> |
| 20 | #include <plat/cpu.h> |
| 21 | #include <plat/pll.h> |
| 22 | #include <plat/s5p-clock.h> |
| 23 | #include <plat/clock-clksrc.h> |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 24 | #include <plat/exynos4.h> |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 25 | #include <plat/pm.h> |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 26 | |
| 27 | #include <mach/map.h> |
| 28 | #include <mach/regs-clock.h> |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 29 | #include <mach/sysmmu.h> |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 30 | #include <mach/exynos4-clock.h> |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 31 | |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 32 | static struct sleep_save exynos4_clock_save[] = { |
| 33 | SAVE_ITEM(S5P_CLKDIV_LEFTBUS), |
| 34 | SAVE_ITEM(S5P_CLKGATE_IP_LEFTBUS), |
| 35 | SAVE_ITEM(S5P_CLKDIV_RIGHTBUS), |
| 36 | SAVE_ITEM(S5P_CLKGATE_IP_RIGHTBUS), |
| 37 | SAVE_ITEM(S5P_CLKSRC_TOP0), |
| 38 | SAVE_ITEM(S5P_CLKSRC_TOP1), |
| 39 | SAVE_ITEM(S5P_CLKSRC_CAM), |
| 40 | SAVE_ITEM(S5P_CLKSRC_TV), |
| 41 | SAVE_ITEM(S5P_CLKSRC_MFC), |
| 42 | SAVE_ITEM(S5P_CLKSRC_G3D), |
| 43 | SAVE_ITEM(S5P_CLKSRC_LCD0), |
| 44 | SAVE_ITEM(S5P_CLKSRC_MAUDIO), |
| 45 | SAVE_ITEM(S5P_CLKSRC_FSYS), |
| 46 | SAVE_ITEM(S5P_CLKSRC_PERIL0), |
| 47 | SAVE_ITEM(S5P_CLKSRC_PERIL1), |
| 48 | SAVE_ITEM(S5P_CLKDIV_CAM), |
| 49 | SAVE_ITEM(S5P_CLKDIV_TV), |
| 50 | SAVE_ITEM(S5P_CLKDIV_MFC), |
| 51 | SAVE_ITEM(S5P_CLKDIV_G3D), |
| 52 | SAVE_ITEM(S5P_CLKDIV_LCD0), |
| 53 | SAVE_ITEM(S5P_CLKDIV_MAUDIO), |
| 54 | SAVE_ITEM(S5P_CLKDIV_FSYS0), |
| 55 | SAVE_ITEM(S5P_CLKDIV_FSYS1), |
| 56 | SAVE_ITEM(S5P_CLKDIV_FSYS2), |
| 57 | SAVE_ITEM(S5P_CLKDIV_FSYS3), |
| 58 | SAVE_ITEM(S5P_CLKDIV_PERIL0), |
| 59 | SAVE_ITEM(S5P_CLKDIV_PERIL1), |
| 60 | SAVE_ITEM(S5P_CLKDIV_PERIL2), |
| 61 | SAVE_ITEM(S5P_CLKDIV_PERIL3), |
| 62 | SAVE_ITEM(S5P_CLKDIV_PERIL4), |
| 63 | SAVE_ITEM(S5P_CLKDIV_PERIL5), |
| 64 | SAVE_ITEM(S5P_CLKDIV_TOP), |
| 65 | SAVE_ITEM(S5P_CLKSRC_MASK_TOP), |
| 66 | SAVE_ITEM(S5P_CLKSRC_MASK_CAM), |
| 67 | SAVE_ITEM(S5P_CLKSRC_MASK_TV), |
| 68 | SAVE_ITEM(S5P_CLKSRC_MASK_LCD0), |
| 69 | SAVE_ITEM(S5P_CLKSRC_MASK_MAUDIO), |
| 70 | SAVE_ITEM(S5P_CLKSRC_MASK_FSYS), |
| 71 | SAVE_ITEM(S5P_CLKSRC_MASK_PERIL0), |
| 72 | SAVE_ITEM(S5P_CLKSRC_MASK_PERIL1), |
| 73 | SAVE_ITEM(S5P_CLKDIV2_RATIO), |
| 74 | SAVE_ITEM(S5P_CLKGATE_SCLKCAM), |
| 75 | SAVE_ITEM(S5P_CLKGATE_IP_CAM), |
| 76 | SAVE_ITEM(S5P_CLKGATE_IP_TV), |
| 77 | SAVE_ITEM(S5P_CLKGATE_IP_MFC), |
| 78 | SAVE_ITEM(S5P_CLKGATE_IP_G3D), |
| 79 | SAVE_ITEM(S5P_CLKGATE_IP_LCD0), |
| 80 | SAVE_ITEM(S5P_CLKGATE_IP_FSYS), |
| 81 | SAVE_ITEM(S5P_CLKGATE_IP_GPS), |
| 82 | SAVE_ITEM(S5P_CLKGATE_IP_PERIL), |
| 83 | SAVE_ITEM(S5P_CLKGATE_BLOCK), |
| 84 | SAVE_ITEM(S5P_CLKSRC_MASK_DMC), |
| 85 | SAVE_ITEM(S5P_CLKSRC_DMC), |
| 86 | SAVE_ITEM(S5P_CLKDIV_DMC0), |
| 87 | SAVE_ITEM(S5P_CLKDIV_DMC1), |
| 88 | SAVE_ITEM(S5P_CLKGATE_IP_DMC), |
| 89 | SAVE_ITEM(S5P_CLKSRC_CPU), |
| 90 | SAVE_ITEM(S5P_CLKDIV_CPU), |
| 91 | SAVE_ITEM(S5P_CLKDIV_CPU + 0x4), |
| 92 | SAVE_ITEM(S5P_CLKGATE_SCLKCPU), |
| 93 | SAVE_ITEM(S5P_CLKGATE_IP_CPU), |
| 94 | }; |
| 95 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 96 | struct clk clk_sclk_hdmi27m = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 97 | .name = "sclk_hdmi27m", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 98 | .rate = 27000000, |
| 99 | }; |
| 100 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 101 | struct clk clk_sclk_hdmiphy = { |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 102 | .name = "sclk_hdmiphy", |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 103 | }; |
| 104 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 105 | struct clk clk_sclk_usbphy0 = { |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 106 | .name = "sclk_usbphy0", |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 107 | .rate = 27000000, |
| 108 | }; |
| 109 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 110 | struct clk clk_sclk_usbphy1 = { |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 111 | .name = "sclk_usbphy1", |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 112 | }; |
| 113 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 114 | static int exynos4_clksrc_mask_top_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 37e0172 | 2010-08-18 22:33:43 +0900 | [diff] [blame] | 115 | { |
| 116 | return s5p_gatectrl(S5P_CLKSRC_MASK_TOP, clk, enable); |
| 117 | } |
| 118 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 119 | static int exynos4_clksrc_mask_cam_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 120 | { |
| 121 | return s5p_gatectrl(S5P_CLKSRC_MASK_CAM, clk, enable); |
| 122 | } |
| 123 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 124 | static int exynos4_clksrc_mask_lcd0_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 125 | { |
| 126 | return s5p_gatectrl(S5P_CLKSRC_MASK_LCD0, clk, enable); |
| 127 | } |
| 128 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 129 | int exynos4_clksrc_mask_fsys_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 130 | { |
| 131 | return s5p_gatectrl(S5P_CLKSRC_MASK_FSYS, clk, enable); |
| 132 | } |
| 133 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 134 | static int exynos4_clksrc_mask_peril0_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 3297c2e | 2010-08-27 17:53:26 +0900 | [diff] [blame] | 135 | { |
| 136 | return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL0, clk, enable); |
| 137 | } |
| 138 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 139 | static int exynos4_clksrc_mask_peril1_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 140 | { |
| 141 | return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL1, clk, enable); |
| 142 | } |
| 143 | |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 144 | static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable) |
| 145 | { |
| 146 | return s5p_gatectrl(S5P_CLKGATE_IP_MFC, clk, enable); |
| 147 | } |
| 148 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 149 | static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 150 | { |
| 151 | return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable); |
| 152 | } |
| 153 | |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 154 | static int exynos4_clk_ip_tv_ctrl(struct clk *clk, int enable) |
| 155 | { |
| 156 | return s5p_gatectrl(S5P_CLKGATE_IP_TV, clk, enable); |
| 157 | } |
| 158 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 159 | static int exynos4_clk_ip_image_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 160 | { |
| 161 | return s5p_gatectrl(S5P_CLKGATE_IP_IMAGE, clk, enable); |
| 162 | } |
| 163 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 164 | static int exynos4_clk_ip_lcd0_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 165 | { |
| 166 | return s5p_gatectrl(S5P_CLKGATE_IP_LCD0, clk, enable); |
| 167 | } |
| 168 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 169 | int exynos4_clk_ip_lcd1_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 170 | { |
| 171 | return s5p_gatectrl(S5P_CLKGATE_IP_LCD1, clk, enable); |
| 172 | } |
| 173 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 174 | int exynos4_clk_ip_fsys_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 175 | { |
| 176 | return s5p_gatectrl(S5P_CLKGATE_IP_FSYS, clk, enable); |
| 177 | } |
| 178 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 179 | static int exynos4_clk_ip_peril_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 180 | { |
| 181 | return s5p_gatectrl(S5P_CLKGATE_IP_PERIL, clk, enable); |
| 182 | } |
| 183 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 184 | static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 185 | { |
| 186 | return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable); |
| 187 | } |
| 188 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 189 | /* Core list of CMU_CPU side */ |
| 190 | |
| 191 | static struct clksrc_clk clk_mout_apll = { |
| 192 | .clk = { |
| 193 | .name = "mout_apll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 194 | }, |
| 195 | .sources = &clk_src_apll, |
| 196 | .reg_src = { .reg = S5P_CLKSRC_CPU, .shift = 0, .size = 1 }, |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 197 | }; |
| 198 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 199 | struct clksrc_clk clk_sclk_apll = { |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 200 | .clk = { |
| 201 | .name = "sclk_apll", |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 202 | .parent = &clk_mout_apll.clk, |
| 203 | }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 204 | .reg_div = { .reg = S5P_CLKDIV_CPU, .shift = 24, .size = 3 }, |
| 205 | }; |
| 206 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 207 | struct clksrc_clk clk_mout_epll = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 208 | .clk = { |
| 209 | .name = "mout_epll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 210 | }, |
| 211 | .sources = &clk_src_epll, |
| 212 | .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 4, .size = 1 }, |
| 213 | }; |
| 214 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 215 | struct clksrc_clk clk_mout_mpll = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 216 | .clk = { |
| 217 | .name = "mout_mpll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 218 | }, |
| 219 | .sources = &clk_src_mpll, |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 220 | |
| 221 | /* reg_src will be added in each SoCs' clock */ |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 222 | }; |
| 223 | |
| 224 | static struct clk *clkset_moutcore_list[] = { |
Jaecheol Lee | 8f3b9cf | 2010-09-18 10:50:46 +0900 | [diff] [blame] | 225 | [0] = &clk_mout_apll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 226 | [1] = &clk_mout_mpll.clk, |
| 227 | }; |
| 228 | |
| 229 | static struct clksrc_sources clkset_moutcore = { |
| 230 | .sources = clkset_moutcore_list, |
| 231 | .nr_sources = ARRAY_SIZE(clkset_moutcore_list), |
| 232 | }; |
| 233 | |
| 234 | static struct clksrc_clk clk_moutcore = { |
| 235 | .clk = { |
| 236 | .name = "moutcore", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 237 | }, |
| 238 | .sources = &clkset_moutcore, |
| 239 | .reg_src = { .reg = S5P_CLKSRC_CPU, .shift = 16, .size = 1 }, |
| 240 | }; |
| 241 | |
| 242 | static struct clksrc_clk clk_coreclk = { |
| 243 | .clk = { |
| 244 | .name = "core_clk", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 245 | .parent = &clk_moutcore.clk, |
| 246 | }, |
| 247 | .reg_div = { .reg = S5P_CLKDIV_CPU, .shift = 0, .size = 3 }, |
| 248 | }; |
| 249 | |
| 250 | static struct clksrc_clk clk_armclk = { |
| 251 | .clk = { |
| 252 | .name = "armclk", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 253 | .parent = &clk_coreclk.clk, |
| 254 | }, |
| 255 | }; |
| 256 | |
| 257 | static struct clksrc_clk clk_aclk_corem0 = { |
| 258 | .clk = { |
| 259 | .name = "aclk_corem0", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 260 | .parent = &clk_coreclk.clk, |
| 261 | }, |
| 262 | .reg_div = { .reg = S5P_CLKDIV_CPU, .shift = 4, .size = 3 }, |
| 263 | }; |
| 264 | |
| 265 | static struct clksrc_clk clk_aclk_cores = { |
| 266 | .clk = { |
| 267 | .name = "aclk_cores", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 268 | .parent = &clk_coreclk.clk, |
| 269 | }, |
| 270 | .reg_div = { .reg = S5P_CLKDIV_CPU, .shift = 4, .size = 3 }, |
| 271 | }; |
| 272 | |
| 273 | static struct clksrc_clk clk_aclk_corem1 = { |
| 274 | .clk = { |
| 275 | .name = "aclk_corem1", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 276 | .parent = &clk_coreclk.clk, |
| 277 | }, |
| 278 | .reg_div = { .reg = S5P_CLKDIV_CPU, .shift = 8, .size = 3 }, |
| 279 | }; |
| 280 | |
| 281 | static struct clksrc_clk clk_periphclk = { |
| 282 | .clk = { |
| 283 | .name = "periphclk", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 284 | .parent = &clk_coreclk.clk, |
| 285 | }, |
| 286 | .reg_div = { .reg = S5P_CLKDIV_CPU, .shift = 12, .size = 3 }, |
| 287 | }; |
| 288 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 289 | /* Core list of CMU_CORE side */ |
| 290 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 291 | struct clk *clkset_corebus_list[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 292 | [0] = &clk_mout_mpll.clk, |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 293 | [1] = &clk_sclk_apll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 294 | }; |
| 295 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 296 | struct clksrc_sources clkset_mout_corebus = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 297 | .sources = clkset_corebus_list, |
| 298 | .nr_sources = ARRAY_SIZE(clkset_corebus_list), |
| 299 | }; |
| 300 | |
| 301 | static struct clksrc_clk clk_mout_corebus = { |
| 302 | .clk = { |
| 303 | .name = "mout_corebus", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 304 | }, |
| 305 | .sources = &clkset_mout_corebus, |
Sunyoung Kang | 7af36b9 | 2010-09-18 10:59:31 +0900 | [diff] [blame] | 306 | .reg_src = { .reg = S5P_CLKSRC_DMC, .shift = 4, .size = 1 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | static struct clksrc_clk clk_sclk_dmc = { |
| 310 | .clk = { |
| 311 | .name = "sclk_dmc", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 312 | .parent = &clk_mout_corebus.clk, |
| 313 | }, |
Sunyoung Kang | 7af36b9 | 2010-09-18 10:59:31 +0900 | [diff] [blame] | 314 | .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 12, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 315 | }; |
| 316 | |
| 317 | static struct clksrc_clk clk_aclk_cored = { |
| 318 | .clk = { |
| 319 | .name = "aclk_cored", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 320 | .parent = &clk_sclk_dmc.clk, |
| 321 | }, |
Sunyoung Kang | 7af36b9 | 2010-09-18 10:59:31 +0900 | [diff] [blame] | 322 | .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 16, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 323 | }; |
| 324 | |
| 325 | static struct clksrc_clk clk_aclk_corep = { |
| 326 | .clk = { |
| 327 | .name = "aclk_corep", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 328 | .parent = &clk_aclk_cored.clk, |
| 329 | }, |
Sunyoung Kang | 7af36b9 | 2010-09-18 10:59:31 +0900 | [diff] [blame] | 330 | .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 20, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 331 | }; |
| 332 | |
| 333 | static struct clksrc_clk clk_aclk_acp = { |
| 334 | .clk = { |
| 335 | .name = "aclk_acp", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 336 | .parent = &clk_mout_corebus.clk, |
| 337 | }, |
Sunyoung Kang | 7af36b9 | 2010-09-18 10:59:31 +0900 | [diff] [blame] | 338 | .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 0, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 339 | }; |
| 340 | |
| 341 | static struct clksrc_clk clk_pclk_acp = { |
| 342 | .clk = { |
| 343 | .name = "pclk_acp", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 344 | .parent = &clk_aclk_acp.clk, |
| 345 | }, |
Sunyoung Kang | 7af36b9 | 2010-09-18 10:59:31 +0900 | [diff] [blame] | 346 | .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 4, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 347 | }; |
| 348 | |
| 349 | /* Core list of CMU_TOP side */ |
| 350 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 351 | struct clk *clkset_aclk_top_list[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 352 | [0] = &clk_mout_mpll.clk, |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 353 | [1] = &clk_sclk_apll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 354 | }; |
| 355 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 356 | struct clksrc_sources clkset_aclk = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 357 | .sources = clkset_aclk_top_list, |
| 358 | .nr_sources = ARRAY_SIZE(clkset_aclk_top_list), |
| 359 | }; |
| 360 | |
| 361 | static struct clksrc_clk clk_aclk_200 = { |
| 362 | .clk = { |
| 363 | .name = "aclk_200", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 364 | }, |
Kukjin Kim | 9e23552 | 2010-08-18 22:06:02 +0900 | [diff] [blame] | 365 | .sources = &clkset_aclk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 366 | .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 12, .size = 1 }, |
| 367 | .reg_div = { .reg = S5P_CLKDIV_TOP, .shift = 0, .size = 3 }, |
| 368 | }; |
| 369 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 370 | static struct clksrc_clk clk_aclk_100 = { |
| 371 | .clk = { |
| 372 | .name = "aclk_100", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 373 | }, |
Kukjin Kim | 9e23552 | 2010-08-18 22:06:02 +0900 | [diff] [blame] | 374 | .sources = &clkset_aclk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 375 | .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 16, .size = 1 }, |
| 376 | .reg_div = { .reg = S5P_CLKDIV_TOP, .shift = 4, .size = 4 }, |
| 377 | }; |
| 378 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 379 | static struct clksrc_clk clk_aclk_160 = { |
| 380 | .clk = { |
| 381 | .name = "aclk_160", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 382 | }, |
Kukjin Kim | 9e23552 | 2010-08-18 22:06:02 +0900 | [diff] [blame] | 383 | .sources = &clkset_aclk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 384 | .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 20, .size = 1 }, |
| 385 | .reg_div = { .reg = S5P_CLKDIV_TOP, .shift = 8, .size = 3 }, |
| 386 | }; |
| 387 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 388 | struct clksrc_clk clk_aclk_133 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 389 | .clk = { |
| 390 | .name = "aclk_133", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 391 | }, |
Kukjin Kim | 9e23552 | 2010-08-18 22:06:02 +0900 | [diff] [blame] | 392 | .sources = &clkset_aclk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 393 | .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 24, .size = 1 }, |
| 394 | .reg_div = { .reg = S5P_CLKDIV_TOP, .shift = 12, .size = 3 }, |
| 395 | }; |
| 396 | |
| 397 | static struct clk *clkset_vpllsrc_list[] = { |
| 398 | [0] = &clk_fin_vpll, |
| 399 | [1] = &clk_sclk_hdmi27m, |
| 400 | }; |
| 401 | |
| 402 | static struct clksrc_sources clkset_vpllsrc = { |
| 403 | .sources = clkset_vpllsrc_list, |
| 404 | .nr_sources = ARRAY_SIZE(clkset_vpllsrc_list), |
| 405 | }; |
| 406 | |
| 407 | static struct clksrc_clk clk_vpllsrc = { |
| 408 | .clk = { |
| 409 | .name = "vpll_src", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 410 | .enable = exynos4_clksrc_mask_top_ctrl, |
Jongpill Lee | 37e0172 | 2010-08-18 22:33:43 +0900 | [diff] [blame] | 411 | .ctrlbit = (1 << 0), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 412 | }, |
| 413 | .sources = &clkset_vpllsrc, |
| 414 | .reg_src = { .reg = S5P_CLKSRC_TOP1, .shift = 0, .size = 1 }, |
| 415 | }; |
| 416 | |
| 417 | static struct clk *clkset_sclk_vpll_list[] = { |
| 418 | [0] = &clk_vpllsrc.clk, |
| 419 | [1] = &clk_fout_vpll, |
| 420 | }; |
| 421 | |
| 422 | static struct clksrc_sources clkset_sclk_vpll = { |
| 423 | .sources = clkset_sclk_vpll_list, |
| 424 | .nr_sources = ARRAY_SIZE(clkset_sclk_vpll_list), |
| 425 | }; |
| 426 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 427 | struct clksrc_clk clk_sclk_vpll = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 428 | .clk = { |
| 429 | .name = "sclk_vpll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 430 | }, |
| 431 | .sources = &clkset_sclk_vpll, |
| 432 | .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 8, .size = 1 }, |
| 433 | }; |
| 434 | |
Kukjin Kim | 957c461 | 2011-01-04 17:58:22 +0900 | [diff] [blame] | 435 | static struct clk init_clocks_off[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 436 | { |
| 437 | .name = "timers", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 438 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 439 | .enable = exynos4_clk_ip_peril_ctrl, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 440 | .ctrlbit = (1<<24), |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 441 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 442 | .name = "csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 443 | .devname = "s5p-mipi-csis.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 444 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 445 | .ctrlbit = (1 << 4), |
| 446 | }, { |
| 447 | .name = "csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 448 | .devname = "s5p-mipi-csis.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 449 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 450 | .ctrlbit = (1 << 5), |
| 451 | }, { |
| 452 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 453 | .devname = "exynos4-fimc.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 454 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 455 | .ctrlbit = (1 << 0), |
| 456 | }, { |
| 457 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 458 | .devname = "exynos4-fimc.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 459 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 460 | .ctrlbit = (1 << 1), |
| 461 | }, { |
| 462 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 463 | .devname = "exynos4-fimc.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 464 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 465 | .ctrlbit = (1 << 2), |
| 466 | }, { |
| 467 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 468 | .devname = "exynos4-fimc.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 469 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 470 | .ctrlbit = (1 << 3), |
| 471 | }, { |
| 472 | .name = "fimd", |
Jingoo Han | 268a7ef | 2011-07-21 15:42:38 +0900 | [diff] [blame] | 473 | .devname = "exynos4-fb.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 474 | .enable = exynos4_clk_ip_lcd0_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 475 | .ctrlbit = (1 << 0), |
| 476 | }, { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 477 | .name = "hsmmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 478 | .devname = "s3c-sdhci.0", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 479 | .parent = &clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 480 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 481 | .ctrlbit = (1 << 5), |
| 482 | }, { |
| 483 | .name = "hsmmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 484 | .devname = "s3c-sdhci.1", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 485 | .parent = &clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 486 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 487 | .ctrlbit = (1 << 6), |
| 488 | }, { |
| 489 | .name = "hsmmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 490 | .devname = "s3c-sdhci.2", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 491 | .parent = &clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 492 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 493 | .ctrlbit = (1 << 7), |
| 494 | }, { |
| 495 | .name = "hsmmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 496 | .devname = "s3c-sdhci.3", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 497 | .parent = &clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 498 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 499 | .ctrlbit = (1 << 8), |
| 500 | }, { |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 501 | .name = "dwmmc", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 502 | .parent = &clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 503 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 504 | .ctrlbit = (1 << 9), |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 505 | }, { |
Jassi Brar | 3055c6d | 2010-12-21 09:54:35 +0900 | [diff] [blame] | 506 | .name = "pdma", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 507 | .devname = "s3c-pl330.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 508 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jassi Brar | 3055c6d | 2010-12-21 09:54:35 +0900 | [diff] [blame] | 509 | .ctrlbit = (1 << 0), |
| 510 | }, { |
| 511 | .name = "pdma", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 512 | .devname = "s3c-pl330.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 513 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jassi Brar | 3055c6d | 2010-12-21 09:54:35 +0900 | [diff] [blame] | 514 | .ctrlbit = (1 << 1), |
| 515 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 516 | .name = "adc", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 517 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 518 | .ctrlbit = (1 << 15), |
| 519 | }, { |
Naveen Krishna Ch | f9d7bcb | 2011-02-22 17:13:42 +0900 | [diff] [blame] | 520 | .name = "keypad", |
Naveen Krishna Ch | f9d7bcb | 2011-02-22 17:13:42 +0900 | [diff] [blame] | 521 | .enable = exynos4_clk_ip_perir_ctrl, |
| 522 | .ctrlbit = (1 << 16), |
| 523 | }, { |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 524 | .name = "rtc", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 525 | .enable = exynos4_clk_ip_perir_ctrl, |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 526 | .ctrlbit = (1 << 15), |
| 527 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 528 | .name = "watchdog", |
Inderpal Singh | f5fb4a2 | 2011-03-08 07:13:45 +0900 | [diff] [blame] | 529 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 530 | .enable = exynos4_clk_ip_perir_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 531 | .ctrlbit = (1 << 14), |
| 532 | }, { |
| 533 | .name = "usbhost", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 534 | .enable = exynos4_clk_ip_fsys_ctrl , |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 535 | .ctrlbit = (1 << 12), |
| 536 | }, { |
| 537 | .name = "otg", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 538 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 539 | .ctrlbit = (1 << 13), |
| 540 | }, { |
| 541 | .name = "spi", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 542 | .devname = "s3c64xx-spi.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 543 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 544 | .ctrlbit = (1 << 16), |
| 545 | }, { |
| 546 | .name = "spi", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 547 | .devname = "s3c64xx-spi.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 548 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 549 | .ctrlbit = (1 << 17), |
| 550 | }, { |
| 551 | .name = "spi", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 552 | .devname = "s3c64xx-spi.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 553 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 554 | .ctrlbit = (1 << 18), |
| 555 | }, { |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 556 | .name = "iis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 557 | .devname = "samsung-i2s.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 558 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 559 | .ctrlbit = (1 << 19), |
| 560 | }, { |
| 561 | .name = "iis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 562 | .devname = "samsung-i2s.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 563 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 564 | .ctrlbit = (1 << 20), |
| 565 | }, { |
| 566 | .name = "iis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 567 | .devname = "samsung-i2s.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 568 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 569 | .ctrlbit = (1 << 21), |
| 570 | }, { |
Jassi Brar | aa22755 | 2010-12-21 09:54:57 +0900 | [diff] [blame] | 571 | .name = "ac97", |
Jonghwan Choi | af8a9f6 | 2011-08-12 18:15:42 +0900 | [diff] [blame] | 572 | .devname = "samsung-ac97", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 573 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | aa22755 | 2010-12-21 09:54:57 +0900 | [diff] [blame] | 574 | .ctrlbit = (1 << 27), |
| 575 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 576 | .name = "fimg2d", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 577 | .enable = exynos4_clk_ip_image_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 578 | .ctrlbit = (1 << 0), |
| 579 | }, { |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 580 | .name = "mfc", |
| 581 | .devname = "s5p-mfc", |
| 582 | .enable = exynos4_clk_ip_mfc_ctrl, |
| 583 | .ctrlbit = (1 << 0), |
| 584 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 585 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 586 | .devname = "s3c2440-i2c.0", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 587 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 588 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 589 | .ctrlbit = (1 << 6), |
| 590 | }, { |
| 591 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 592 | .devname = "s3c2440-i2c.1", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 593 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 594 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 595 | .ctrlbit = (1 << 7), |
| 596 | }, { |
| 597 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 598 | .devname = "s3c2440-i2c.2", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 599 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 600 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 601 | .ctrlbit = (1 << 8), |
| 602 | }, { |
| 603 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 604 | .devname = "s3c2440-i2c.3", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 605 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 606 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 607 | .ctrlbit = (1 << 9), |
| 608 | }, { |
| 609 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 610 | .devname = "s3c2440-i2c.4", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 611 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 612 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 613 | .ctrlbit = (1 << 10), |
| 614 | }, { |
| 615 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 616 | .devname = "s3c2440-i2c.5", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 617 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 618 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 619 | .ctrlbit = (1 << 11), |
| 620 | }, { |
| 621 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 622 | .devname = "s3c2440-i2c.6", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 623 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 624 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 625 | .ctrlbit = (1 << 12), |
| 626 | }, { |
| 627 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 628 | .devname = "s3c2440-i2c.7", |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 629 | .parent = &clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 630 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 631 | .ctrlbit = (1 << 13), |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 632 | }, { |
| 633 | .name = "SYSMMU_MDMA", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 634 | .enable = exynos4_clk_ip_image_ctrl, |
| 635 | .ctrlbit = (1 << 5), |
| 636 | }, { |
| 637 | .name = "SYSMMU_FIMC0", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 638 | .enable = exynos4_clk_ip_cam_ctrl, |
| 639 | .ctrlbit = (1 << 7), |
| 640 | }, { |
| 641 | .name = "SYSMMU_FIMC1", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 642 | .enable = exynos4_clk_ip_cam_ctrl, |
| 643 | .ctrlbit = (1 << 8), |
| 644 | }, { |
| 645 | .name = "SYSMMU_FIMC2", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 646 | .enable = exynos4_clk_ip_cam_ctrl, |
| 647 | .ctrlbit = (1 << 9), |
| 648 | }, { |
| 649 | .name = "SYSMMU_FIMC3", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 650 | .enable = exynos4_clk_ip_cam_ctrl, |
| 651 | .ctrlbit = (1 << 10), |
| 652 | }, { |
| 653 | .name = "SYSMMU_JPEG", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 654 | .enable = exynos4_clk_ip_cam_ctrl, |
| 655 | .ctrlbit = (1 << 11), |
| 656 | }, { |
| 657 | .name = "SYSMMU_FIMD0", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 658 | .enable = exynos4_clk_ip_lcd0_ctrl, |
| 659 | .ctrlbit = (1 << 4), |
| 660 | }, { |
| 661 | .name = "SYSMMU_FIMD1", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 662 | .enable = exynos4_clk_ip_lcd1_ctrl, |
| 663 | .ctrlbit = (1 << 4), |
| 664 | }, { |
| 665 | .name = "SYSMMU_PCIe", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 666 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 667 | .ctrlbit = (1 << 18), |
| 668 | }, { |
| 669 | .name = "SYSMMU_G2D", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 670 | .enable = exynos4_clk_ip_image_ctrl, |
| 671 | .ctrlbit = (1 << 3), |
| 672 | }, { |
| 673 | .name = "SYSMMU_ROTATOR", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 674 | .enable = exynos4_clk_ip_image_ctrl, |
| 675 | .ctrlbit = (1 << 4), |
| 676 | }, { |
| 677 | .name = "SYSMMU_TV", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 678 | .enable = exynos4_clk_ip_tv_ctrl, |
| 679 | .ctrlbit = (1 << 4), |
| 680 | }, { |
| 681 | .name = "SYSMMU_MFC_L", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 682 | .enable = exynos4_clk_ip_mfc_ctrl, |
| 683 | .ctrlbit = (1 << 1), |
| 684 | }, { |
| 685 | .name = "SYSMMU_MFC_R", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 686 | .enable = exynos4_clk_ip_mfc_ctrl, |
| 687 | .ctrlbit = (1 << 2), |
| 688 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 689 | }; |
| 690 | |
| 691 | static struct clk init_clocks[] = { |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 692 | { |
| 693 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 694 | .devname = "s5pv210-uart.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 695 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 696 | .ctrlbit = (1 << 0), |
| 697 | }, { |
| 698 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 699 | .devname = "s5pv210-uart.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 700 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 701 | .ctrlbit = (1 << 1), |
| 702 | }, { |
| 703 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 704 | .devname = "s5pv210-uart.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 705 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 706 | .ctrlbit = (1 << 2), |
| 707 | }, { |
| 708 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 709 | .devname = "s5pv210-uart.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 710 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 711 | .ctrlbit = (1 << 3), |
| 712 | }, { |
| 713 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 714 | .devname = "s5pv210-uart.4", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 715 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 716 | .ctrlbit = (1 << 4), |
| 717 | }, { |
| 718 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 719 | .devname = "s5pv210-uart.5", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 720 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 721 | .ctrlbit = (1 << 5), |
| 722 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 723 | }; |
| 724 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 725 | struct clk *clkset_group_list[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 726 | [0] = &clk_ext_xtal_mux, |
| 727 | [1] = &clk_xusbxti, |
| 728 | [2] = &clk_sclk_hdmi27m, |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 729 | [3] = &clk_sclk_usbphy0, |
| 730 | [4] = &clk_sclk_usbphy1, |
| 731 | [5] = &clk_sclk_hdmiphy, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 732 | [6] = &clk_mout_mpll.clk, |
| 733 | [7] = &clk_mout_epll.clk, |
| 734 | [8] = &clk_sclk_vpll.clk, |
| 735 | }; |
| 736 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 737 | struct clksrc_sources clkset_group = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 738 | .sources = clkset_group_list, |
| 739 | .nr_sources = ARRAY_SIZE(clkset_group_list), |
| 740 | }; |
| 741 | |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 742 | static struct clk *clkset_mout_g2d0_list[] = { |
| 743 | [0] = &clk_mout_mpll.clk, |
| 744 | [1] = &clk_sclk_apll.clk, |
| 745 | }; |
| 746 | |
| 747 | static struct clksrc_sources clkset_mout_g2d0 = { |
| 748 | .sources = clkset_mout_g2d0_list, |
| 749 | .nr_sources = ARRAY_SIZE(clkset_mout_g2d0_list), |
| 750 | }; |
| 751 | |
| 752 | static struct clksrc_clk clk_mout_g2d0 = { |
| 753 | .clk = { |
| 754 | .name = "mout_g2d0", |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 755 | }, |
| 756 | .sources = &clkset_mout_g2d0, |
| 757 | .reg_src = { .reg = S5P_CLKSRC_IMAGE, .shift = 0, .size = 1 }, |
| 758 | }; |
| 759 | |
| 760 | static struct clk *clkset_mout_g2d1_list[] = { |
| 761 | [0] = &clk_mout_epll.clk, |
| 762 | [1] = &clk_sclk_vpll.clk, |
| 763 | }; |
| 764 | |
| 765 | static struct clksrc_sources clkset_mout_g2d1 = { |
| 766 | .sources = clkset_mout_g2d1_list, |
| 767 | .nr_sources = ARRAY_SIZE(clkset_mout_g2d1_list), |
| 768 | }; |
| 769 | |
| 770 | static struct clksrc_clk clk_mout_g2d1 = { |
| 771 | .clk = { |
| 772 | .name = "mout_g2d1", |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 773 | }, |
| 774 | .sources = &clkset_mout_g2d1, |
| 775 | .reg_src = { .reg = S5P_CLKSRC_IMAGE, .shift = 4, .size = 1 }, |
| 776 | }; |
| 777 | |
| 778 | static struct clk *clkset_mout_g2d_list[] = { |
| 779 | [0] = &clk_mout_g2d0.clk, |
| 780 | [1] = &clk_mout_g2d1.clk, |
| 781 | }; |
| 782 | |
| 783 | static struct clksrc_sources clkset_mout_g2d = { |
| 784 | .sources = clkset_mout_g2d_list, |
| 785 | .nr_sources = ARRAY_SIZE(clkset_mout_g2d_list), |
| 786 | }; |
| 787 | |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 788 | static struct clk *clkset_mout_mfc0_list[] = { |
| 789 | [0] = &clk_mout_mpll.clk, |
| 790 | [1] = &clk_sclk_apll.clk, |
| 791 | }; |
| 792 | |
| 793 | static struct clksrc_sources clkset_mout_mfc0 = { |
| 794 | .sources = clkset_mout_mfc0_list, |
| 795 | .nr_sources = ARRAY_SIZE(clkset_mout_mfc0_list), |
| 796 | }; |
| 797 | |
| 798 | static struct clksrc_clk clk_mout_mfc0 = { |
| 799 | .clk = { |
| 800 | .name = "mout_mfc0", |
| 801 | }, |
| 802 | .sources = &clkset_mout_mfc0, |
| 803 | .reg_src = { .reg = S5P_CLKSRC_MFC, .shift = 0, .size = 1 }, |
| 804 | }; |
| 805 | |
| 806 | static struct clk *clkset_mout_mfc1_list[] = { |
| 807 | [0] = &clk_mout_epll.clk, |
| 808 | [1] = &clk_sclk_vpll.clk, |
| 809 | }; |
| 810 | |
| 811 | static struct clksrc_sources clkset_mout_mfc1 = { |
| 812 | .sources = clkset_mout_mfc1_list, |
| 813 | .nr_sources = ARRAY_SIZE(clkset_mout_mfc1_list), |
| 814 | }; |
| 815 | |
| 816 | static struct clksrc_clk clk_mout_mfc1 = { |
| 817 | .clk = { |
| 818 | .name = "mout_mfc1", |
| 819 | }, |
| 820 | .sources = &clkset_mout_mfc1, |
| 821 | .reg_src = { .reg = S5P_CLKSRC_MFC, .shift = 4, .size = 1 }, |
| 822 | }; |
| 823 | |
| 824 | static struct clk *clkset_mout_mfc_list[] = { |
| 825 | [0] = &clk_mout_mfc0.clk, |
| 826 | [1] = &clk_mout_mfc1.clk, |
| 827 | }; |
| 828 | |
| 829 | static struct clksrc_sources clkset_mout_mfc = { |
| 830 | .sources = clkset_mout_mfc_list, |
| 831 | .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list), |
| 832 | }; |
| 833 | |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 834 | static struct clksrc_clk clk_dout_mmc0 = { |
| 835 | .clk = { |
| 836 | .name = "dout_mmc0", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 837 | }, |
| 838 | .sources = &clkset_group, |
| 839 | .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 0, .size = 4 }, |
| 840 | .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 0, .size = 4 }, |
| 841 | }; |
| 842 | |
| 843 | static struct clksrc_clk clk_dout_mmc1 = { |
| 844 | .clk = { |
| 845 | .name = "dout_mmc1", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 846 | }, |
| 847 | .sources = &clkset_group, |
| 848 | .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 4, .size = 4 }, |
| 849 | .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 16, .size = 4 }, |
| 850 | }; |
| 851 | |
| 852 | static struct clksrc_clk clk_dout_mmc2 = { |
| 853 | .clk = { |
| 854 | .name = "dout_mmc2", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 855 | }, |
| 856 | .sources = &clkset_group, |
| 857 | .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 8, .size = 4 }, |
| 858 | .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 0, .size = 4 }, |
| 859 | }; |
| 860 | |
| 861 | static struct clksrc_clk clk_dout_mmc3 = { |
| 862 | .clk = { |
| 863 | .name = "dout_mmc3", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 864 | }, |
| 865 | .sources = &clkset_group, |
| 866 | .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 12, .size = 4 }, |
| 867 | .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 16, .size = 4 }, |
| 868 | }; |
| 869 | |
| 870 | static struct clksrc_clk clk_dout_mmc4 = { |
| 871 | .clk = { |
| 872 | .name = "dout_mmc4", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 873 | }, |
| 874 | .sources = &clkset_group, |
| 875 | .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 16, .size = 4 }, |
| 876 | .reg_div = { .reg = S5P_CLKDIV_FSYS3, .shift = 0, .size = 4 }, |
| 877 | }; |
| 878 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 879 | static struct clksrc_clk clksrcs[] = { |
| 880 | { |
| 881 | .clk = { |
| 882 | .name = "uclk1", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 883 | .devname = "s5pv210-uart.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 884 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 885 | .ctrlbit = (1 << 0), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 886 | }, |
| 887 | .sources = &clkset_group, |
| 888 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 }, |
| 889 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 }, |
| 890 | }, { |
| 891 | .clk = { |
| 892 | .name = "uclk1", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 893 | .devname = "s5pv210-uart.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 894 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
Jongpill Lee | 3297c2e | 2010-08-27 17:53:26 +0900 | [diff] [blame] | 895 | .ctrlbit = (1 << 4), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 896 | }, |
| 897 | .sources = &clkset_group, |
| 898 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 }, |
| 899 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 }, |
| 900 | }, { |
| 901 | .clk = { |
| 902 | .name = "uclk1", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 903 | .devname = "s5pv210-uart.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 904 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
Jongpill Lee | 3297c2e | 2010-08-27 17:53:26 +0900 | [diff] [blame] | 905 | .ctrlbit = (1 << 8), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 906 | }, |
| 907 | .sources = &clkset_group, |
| 908 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 }, |
| 909 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 }, |
| 910 | }, { |
| 911 | .clk = { |
| 912 | .name = "uclk1", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 913 | .devname = "s5pv210-uart.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 914 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
Jongpill Lee | 3297c2e | 2010-08-27 17:53:26 +0900 | [diff] [blame] | 915 | .ctrlbit = (1 << 12), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 916 | }, |
| 917 | .sources = &clkset_group, |
| 918 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 }, |
| 919 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 }, |
| 920 | }, { |
| 921 | .clk = { |
| 922 | .name = "sclk_pwm", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 923 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 924 | .ctrlbit = (1 << 24), |
| 925 | }, |
| 926 | .sources = &clkset_group, |
| 927 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 24, .size = 4 }, |
| 928 | .reg_div = { .reg = S5P_CLKDIV_PERIL3, .shift = 0, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 929 | }, { |
| 930 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 931 | .name = "sclk_csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 932 | .devname = "s5p-mipi-csis.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 933 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 934 | .ctrlbit = (1 << 24), |
| 935 | }, |
| 936 | .sources = &clkset_group, |
| 937 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 24, .size = 4 }, |
| 938 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 24, .size = 4 }, |
| 939 | }, { |
| 940 | .clk = { |
| 941 | .name = "sclk_csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 942 | .devname = "s5p-mipi-csis.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 943 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 944 | .ctrlbit = (1 << 28), |
| 945 | }, |
| 946 | .sources = &clkset_group, |
| 947 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 28, .size = 4 }, |
| 948 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 28, .size = 4 }, |
| 949 | }, { |
| 950 | .clk = { |
| 951 | .name = "sclk_cam", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 952 | .devname = "exynos4-fimc.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 953 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 954 | .ctrlbit = (1 << 16), |
| 955 | }, |
| 956 | .sources = &clkset_group, |
| 957 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 16, .size = 4 }, |
| 958 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 16, .size = 4 }, |
| 959 | }, { |
| 960 | .clk = { |
| 961 | .name = "sclk_cam", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 962 | .devname = "exynos4-fimc.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 963 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 964 | .ctrlbit = (1 << 20), |
| 965 | }, |
| 966 | .sources = &clkset_group, |
| 967 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 20, .size = 4 }, |
| 968 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 20, .size = 4 }, |
| 969 | }, { |
| 970 | .clk = { |
| 971 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 972 | .devname = "exynos4-fimc.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 973 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 974 | .ctrlbit = (1 << 0), |
| 975 | }, |
| 976 | .sources = &clkset_group, |
| 977 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 0, .size = 4 }, |
| 978 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 0, .size = 4 }, |
| 979 | }, { |
| 980 | .clk = { |
| 981 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 982 | .devname = "exynos4-fimc.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 983 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 984 | .ctrlbit = (1 << 4), |
| 985 | }, |
| 986 | .sources = &clkset_group, |
| 987 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 4, .size = 4 }, |
| 988 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 4, .size = 4 }, |
| 989 | }, { |
| 990 | .clk = { |
| 991 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 992 | .devname = "exynos4-fimc.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 993 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 994 | .ctrlbit = (1 << 8), |
| 995 | }, |
| 996 | .sources = &clkset_group, |
| 997 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 8, .size = 4 }, |
| 998 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 8, .size = 4 }, |
| 999 | }, { |
| 1000 | .clk = { |
| 1001 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1002 | .devname = "exynos4-fimc.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1003 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1004 | .ctrlbit = (1 << 12), |
| 1005 | }, |
| 1006 | .sources = &clkset_group, |
| 1007 | .reg_src = { .reg = S5P_CLKSRC_CAM, .shift = 12, .size = 4 }, |
| 1008 | .reg_div = { .reg = S5P_CLKDIV_CAM, .shift = 12, .size = 4 }, |
| 1009 | }, { |
| 1010 | .clk = { |
| 1011 | .name = "sclk_fimd", |
Jingoo Han | 268a7ef | 2011-07-21 15:42:38 +0900 | [diff] [blame] | 1012 | .devname = "exynos4-fb.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1013 | .enable = exynos4_clksrc_mask_lcd0_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1014 | .ctrlbit = (1 << 0), |
| 1015 | }, |
| 1016 | .sources = &clkset_group, |
| 1017 | .reg_src = { .reg = S5P_CLKSRC_LCD0, .shift = 0, .size = 4 }, |
| 1018 | .reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 }, |
| 1019 | }, { |
| 1020 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1021 | .name = "sclk_spi", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1022 | .devname = "s3c64xx-spi.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1023 | .enable = exynos4_clksrc_mask_peril1_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1024 | .ctrlbit = (1 << 16), |
| 1025 | }, |
| 1026 | .sources = &clkset_group, |
| 1027 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 }, |
| 1028 | .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 }, |
| 1029 | }, { |
| 1030 | .clk = { |
| 1031 | .name = "sclk_spi", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1032 | .devname = "s3c64xx-spi.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1033 | .enable = exynos4_clksrc_mask_peril1_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1034 | .ctrlbit = (1 << 20), |
| 1035 | }, |
| 1036 | .sources = &clkset_group, |
| 1037 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 }, |
| 1038 | .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 }, |
| 1039 | }, { |
| 1040 | .clk = { |
| 1041 | .name = "sclk_spi", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1042 | .devname = "s3c64xx-spi.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1043 | .enable = exynos4_clksrc_mask_peril1_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1044 | .ctrlbit = (1 << 24), |
| 1045 | }, |
| 1046 | .sources = &clkset_group, |
| 1047 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 }, |
| 1048 | .reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 }, |
| 1049 | }, { |
| 1050 | .clk = { |
| 1051 | .name = "sclk_fimg2d", |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1052 | }, |
| 1053 | .sources = &clkset_mout_g2d, |
| 1054 | .reg_src = { .reg = S5P_CLKSRC_IMAGE, .shift = 8, .size = 1 }, |
| 1055 | .reg_div = { .reg = S5P_CLKDIV_IMAGE, .shift = 0, .size = 4 }, |
| 1056 | }, { |
| 1057 | .clk = { |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 1058 | .name = "sclk_mfc", |
| 1059 | .devname = "s5p-mfc", |
| 1060 | }, |
| 1061 | .sources = &clkset_mout_mfc, |
| 1062 | .reg_src = { .reg = S5P_CLKSRC_MFC, .shift = 8, .size = 1 }, |
| 1063 | .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 }, |
| 1064 | }, { |
| 1065 | .clk = { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1066 | .name = "sclk_mmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1067 | .devname = "s3c-sdhci.0", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1068 | .parent = &clk_dout_mmc0.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1069 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1070 | .ctrlbit = (1 << 0), |
| 1071 | }, |
| 1072 | .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 }, |
| 1073 | }, { |
| 1074 | .clk = { |
| 1075 | .name = "sclk_mmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1076 | .devname = "s3c-sdhci.1", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1077 | .parent = &clk_dout_mmc1.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1078 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1079 | .ctrlbit = (1 << 4), |
| 1080 | }, |
| 1081 | .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 }, |
| 1082 | }, { |
| 1083 | .clk = { |
| 1084 | .name = "sclk_mmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1085 | .devname = "s3c-sdhci.2", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1086 | .parent = &clk_dout_mmc2.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1087 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1088 | .ctrlbit = (1 << 8), |
| 1089 | }, |
| 1090 | .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 }, |
| 1091 | }, { |
| 1092 | .clk = { |
| 1093 | .name = "sclk_mmc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1094 | .devname = "s3c-sdhci.3", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1095 | .parent = &clk_dout_mmc3.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1096 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1097 | .ctrlbit = (1 << 12), |
| 1098 | }, |
| 1099 | .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 }, |
| 1100 | }, { |
| 1101 | .clk = { |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1102 | .name = "sclk_dwmmc", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1103 | .parent = &clk_dout_mmc4.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1104 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1105 | .ctrlbit = (1 << 16), |
| 1106 | }, |
| 1107 | .reg_div = { .reg = S5P_CLKDIV_FSYS3, .shift = 8, .size = 8 }, |
| 1108 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1109 | }; |
| 1110 | |
| 1111 | /* Clock initialization code */ |
| 1112 | static struct clksrc_clk *sysclks[] = { |
| 1113 | &clk_mout_apll, |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 1114 | &clk_sclk_apll, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1115 | &clk_mout_epll, |
| 1116 | &clk_mout_mpll, |
| 1117 | &clk_moutcore, |
| 1118 | &clk_coreclk, |
| 1119 | &clk_armclk, |
| 1120 | &clk_aclk_corem0, |
| 1121 | &clk_aclk_cores, |
| 1122 | &clk_aclk_corem1, |
| 1123 | &clk_periphclk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1124 | &clk_mout_corebus, |
| 1125 | &clk_sclk_dmc, |
| 1126 | &clk_aclk_cored, |
| 1127 | &clk_aclk_corep, |
| 1128 | &clk_aclk_acp, |
| 1129 | &clk_pclk_acp, |
| 1130 | &clk_vpllsrc, |
| 1131 | &clk_sclk_vpll, |
| 1132 | &clk_aclk_200, |
| 1133 | &clk_aclk_100, |
| 1134 | &clk_aclk_160, |
| 1135 | &clk_aclk_133, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1136 | &clk_dout_mmc0, |
| 1137 | &clk_dout_mmc1, |
| 1138 | &clk_dout_mmc2, |
| 1139 | &clk_dout_mmc3, |
| 1140 | &clk_dout_mmc4, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 1141 | &clk_mout_mfc0, |
| 1142 | &clk_mout_mfc1, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1143 | }; |
| 1144 | |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1145 | static int xtal_rate; |
| 1146 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1147 | static unsigned long exynos4_fout_apll_get_rate(struct clk *clk) |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1148 | { |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1149 | if (soc_is_exynos4210()) |
| 1150 | return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0), |
| 1151 | pll_4508); |
Changhwan Youn | b88b1cc | 2011-10-04 17:08:56 +0900 | [diff] [blame^] | 1152 | else if (soc_is_exynos4212() || soc_is_exynos4412()) |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1153 | return s5p_get_pll35xx(xtal_rate, __raw_readl(S5P_APLL_CON0)); |
| 1154 | else |
| 1155 | return 0; |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1156 | } |
| 1157 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1158 | static struct clk_ops exynos4_fout_apll_ops = { |
| 1159 | .get_rate = exynos4_fout_apll_get_rate, |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1160 | }; |
| 1161 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1162 | void __init_or_cpufreq exynos4_setup_clocks(void) |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1163 | { |
| 1164 | struct clk *xtal_clk; |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1165 | unsigned long apll = 0; |
| 1166 | unsigned long mpll = 0; |
| 1167 | unsigned long epll = 0; |
| 1168 | unsigned long vpll = 0; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1169 | unsigned long vpllsrc; |
| 1170 | unsigned long xtal; |
| 1171 | unsigned long armclk; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1172 | unsigned long sclk_dmc; |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1173 | unsigned long aclk_200; |
| 1174 | unsigned long aclk_100; |
| 1175 | unsigned long aclk_160; |
| 1176 | unsigned long aclk_133; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1177 | unsigned int ptr; |
| 1178 | |
| 1179 | printk(KERN_DEBUG "%s: registering clocks\n", __func__); |
| 1180 | |
| 1181 | xtal_clk = clk_get(NULL, "xtal"); |
| 1182 | BUG_ON(IS_ERR(xtal_clk)); |
| 1183 | |
| 1184 | xtal = clk_get_rate(xtal_clk); |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1185 | |
| 1186 | xtal_rate = xtal; |
| 1187 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1188 | clk_put(xtal_clk); |
| 1189 | |
| 1190 | printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); |
| 1191 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1192 | if (soc_is_exynos4210()) { |
| 1193 | apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON0), |
| 1194 | pll_4508); |
| 1195 | mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON0), |
| 1196 | pll_4508); |
| 1197 | epll = s5p_get_pll46xx(xtal, __raw_readl(S5P_EPLL_CON0), |
| 1198 | __raw_readl(S5P_EPLL_CON1), pll_4600); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1199 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1200 | vpllsrc = clk_get_rate(&clk_vpllsrc.clk); |
| 1201 | vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), |
| 1202 | __raw_readl(S5P_VPLL_CON1), pll_4650c); |
Changhwan Youn | b88b1cc | 2011-10-04 17:08:56 +0900 | [diff] [blame^] | 1203 | } else if (soc_is_exynos4212() || soc_is_exynos4412()) { |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1204 | apll = s5p_get_pll35xx(xtal, __raw_readl(S5P_APLL_CON0)); |
| 1205 | mpll = s5p_get_pll35xx(xtal, __raw_readl(S5P_MPLL_CON0)); |
| 1206 | epll = s5p_get_pll36xx(xtal, __raw_readl(S5P_EPLL_CON0), |
| 1207 | __raw_readl(S5P_EPLL_CON1)); |
| 1208 | |
| 1209 | vpllsrc = clk_get_rate(&clk_vpllsrc.clk); |
| 1210 | vpll = s5p_get_pll36xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), |
| 1211 | __raw_readl(S5P_VPLL_CON1)); |
| 1212 | } else { |
| 1213 | /* nothing */ |
| 1214 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1215 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1216 | clk_fout_apll.ops = &exynos4_fout_apll_ops; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1217 | clk_fout_mpll.rate = mpll; |
| 1218 | clk_fout_epll.rate = epll; |
| 1219 | clk_fout_vpll.rate = vpll; |
| 1220 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1221 | printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1222 | apll, mpll, epll, vpll); |
| 1223 | |
| 1224 | armclk = clk_get_rate(&clk_armclk.clk); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1225 | sclk_dmc = clk_get_rate(&clk_sclk_dmc.clk); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1226 | |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1227 | aclk_200 = clk_get_rate(&clk_aclk_200.clk); |
| 1228 | aclk_100 = clk_get_rate(&clk_aclk_100.clk); |
| 1229 | aclk_160 = clk_get_rate(&clk_aclk_160.clk); |
| 1230 | aclk_133 = clk_get_rate(&clk_aclk_133.clk); |
| 1231 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1232 | printk(KERN_INFO "EXYNOS4: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n" |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1233 | "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n", |
| 1234 | armclk, sclk_dmc, aclk_200, |
| 1235 | aclk_100, aclk_160, aclk_133); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1236 | |
| 1237 | clk_f.rate = armclk; |
| 1238 | clk_h.rate = sclk_dmc; |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1239 | clk_p.rate = aclk_100; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1240 | |
| 1241 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) |
| 1242 | s3c_set_clksrc(&clksrcs[ptr], true); |
| 1243 | } |
| 1244 | |
| 1245 | static struct clk *clks[] __initdata = { |
| 1246 | /* Nothing here yet */ |
| 1247 | }; |
| 1248 | |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 1249 | #ifdef CONFIG_PM_SLEEP |
| 1250 | static int exynos4_clock_suspend(void) |
| 1251 | { |
| 1252 | s3c_pm_do_save(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save)); |
| 1253 | return 0; |
| 1254 | } |
| 1255 | |
| 1256 | static void exynos4_clock_resume(void) |
| 1257 | { |
| 1258 | s3c_pm_do_restore_core(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save)); |
| 1259 | } |
| 1260 | |
| 1261 | #else |
| 1262 | #define exynos4_clock_suspend NULL |
| 1263 | #define exynos4_clock_resume NULL |
| 1264 | #endif |
| 1265 | |
| 1266 | struct syscore_ops exynos4_clock_syscore_ops = { |
| 1267 | .suspend = exynos4_clock_suspend, |
| 1268 | .resume = exynos4_clock_resume, |
| 1269 | }; |
| 1270 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1271 | void __init exynos4_register_clocks(void) |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1272 | { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1273 | int ptr; |
| 1274 | |
Kukjin Kim | 957c461 | 2011-01-04 17:58:22 +0900 | [diff] [blame] | 1275 | s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1276 | |
| 1277 | for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) |
| 1278 | s3c_register_clksrc(sysclks[ptr], 1); |
| 1279 | |
| 1280 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
| 1281 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
| 1282 | |
Kukjin Kim | 957c461 | 2011-01-04 17:58:22 +0900 | [diff] [blame] | 1283 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
| 1284 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1285 | |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 1286 | register_syscore_ops(&exynos4_clock_syscore_ops); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1287 | s3c_pwmclk_init(); |
| 1288 | } |