Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1 | /* |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 2 | * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd. |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 3 | * http://www.samsung.com |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 4 | * |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 5 | * EXYNOS4 - Clock support |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 6 | * |
| 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 Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 15 | #include <linux/syscore_ops.h> |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 16 | |
| 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 Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 23 | #include <plat/pm.h> |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 24 | |
| 25 | #include <mach/map.h> |
| 26 | #include <mach/regs-clock.h> |
| 27 | |
Kukjin Kim | cc511b8 | 2011-12-27 08:18:36 +0100 | [diff] [blame] | 28 | #include "common.h" |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 29 | #include "clock-exynos4.h" |
Kukjin Kim | cc511b8 | 2011-12-27 08:18:36 +0100 | [diff] [blame] | 30 | |
Kukjin Kim | 7cdf04d | 2012-01-27 14:56:17 +0900 | [diff] [blame] | 31 | #ifdef CONFIG_PM_SLEEP |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 32 | static struct sleep_save exynos4_clock_save[] = { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 33 | SAVE_ITEM(EXYNOS4_CLKDIV_LEFTBUS), |
| 34 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_LEFTBUS), |
| 35 | SAVE_ITEM(EXYNOS4_CLKDIV_RIGHTBUS), |
| 36 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_RIGHTBUS), |
| 37 | SAVE_ITEM(EXYNOS4_CLKSRC_TOP0), |
| 38 | SAVE_ITEM(EXYNOS4_CLKSRC_TOP1), |
| 39 | SAVE_ITEM(EXYNOS4_CLKSRC_CAM), |
| 40 | SAVE_ITEM(EXYNOS4_CLKSRC_TV), |
| 41 | SAVE_ITEM(EXYNOS4_CLKSRC_MFC), |
| 42 | SAVE_ITEM(EXYNOS4_CLKSRC_G3D), |
| 43 | SAVE_ITEM(EXYNOS4_CLKSRC_LCD0), |
| 44 | SAVE_ITEM(EXYNOS4_CLKSRC_MAUDIO), |
| 45 | SAVE_ITEM(EXYNOS4_CLKSRC_FSYS), |
| 46 | SAVE_ITEM(EXYNOS4_CLKSRC_PERIL0), |
| 47 | SAVE_ITEM(EXYNOS4_CLKSRC_PERIL1), |
| 48 | SAVE_ITEM(EXYNOS4_CLKDIV_CAM), |
| 49 | SAVE_ITEM(EXYNOS4_CLKDIV_TV), |
| 50 | SAVE_ITEM(EXYNOS4_CLKDIV_MFC), |
| 51 | SAVE_ITEM(EXYNOS4_CLKDIV_G3D), |
| 52 | SAVE_ITEM(EXYNOS4_CLKDIV_LCD0), |
| 53 | SAVE_ITEM(EXYNOS4_CLKDIV_MAUDIO), |
| 54 | SAVE_ITEM(EXYNOS4_CLKDIV_FSYS0), |
| 55 | SAVE_ITEM(EXYNOS4_CLKDIV_FSYS1), |
| 56 | SAVE_ITEM(EXYNOS4_CLKDIV_FSYS2), |
| 57 | SAVE_ITEM(EXYNOS4_CLKDIV_FSYS3), |
| 58 | SAVE_ITEM(EXYNOS4_CLKDIV_PERIL0), |
| 59 | SAVE_ITEM(EXYNOS4_CLKDIV_PERIL1), |
| 60 | SAVE_ITEM(EXYNOS4_CLKDIV_PERIL2), |
| 61 | SAVE_ITEM(EXYNOS4_CLKDIV_PERIL3), |
| 62 | SAVE_ITEM(EXYNOS4_CLKDIV_PERIL4), |
| 63 | SAVE_ITEM(EXYNOS4_CLKDIV_PERIL5), |
| 64 | SAVE_ITEM(EXYNOS4_CLKDIV_TOP), |
| 65 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_TOP), |
| 66 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_CAM), |
| 67 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_TV), |
| 68 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_LCD0), |
| 69 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_MAUDIO), |
| 70 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_FSYS), |
| 71 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_PERIL0), |
| 72 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_PERIL1), |
| 73 | SAVE_ITEM(EXYNOS4_CLKDIV2_RATIO), |
| 74 | SAVE_ITEM(EXYNOS4_CLKGATE_SCLKCAM), |
| 75 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_CAM), |
| 76 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_TV), |
| 77 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_MFC), |
| 78 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_G3D), |
| 79 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_LCD0), |
| 80 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_FSYS), |
| 81 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_GPS), |
| 82 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_PERIL), |
| 83 | SAVE_ITEM(EXYNOS4_CLKGATE_BLOCK), |
| 84 | SAVE_ITEM(EXYNOS4_CLKSRC_MASK_DMC), |
| 85 | SAVE_ITEM(EXYNOS4_CLKSRC_DMC), |
| 86 | SAVE_ITEM(EXYNOS4_CLKDIV_DMC0), |
| 87 | SAVE_ITEM(EXYNOS4_CLKDIV_DMC1), |
| 88 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_DMC), |
| 89 | SAVE_ITEM(EXYNOS4_CLKSRC_CPU), |
| 90 | SAVE_ITEM(EXYNOS4_CLKDIV_CPU), |
| 91 | SAVE_ITEM(EXYNOS4_CLKDIV_CPU + 0x4), |
| 92 | SAVE_ITEM(EXYNOS4_CLKGATE_SCLKCPU), |
| 93 | SAVE_ITEM(EXYNOS4_CLKGATE_IP_CPU), |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 94 | }; |
Kukjin Kim | 7cdf04d | 2012-01-27 14:56:17 +0900 | [diff] [blame] | 95 | #endif |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 96 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 97 | static struct clk exynos4_clk_sclk_hdmi27m = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 98 | .name = "sclk_hdmi27m", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 99 | .rate = 27000000, |
| 100 | }; |
| 101 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 102 | static struct clk exynos4_clk_sclk_hdmiphy = { |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 103 | .name = "sclk_hdmiphy", |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 104 | }; |
| 105 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 106 | static struct clk exynos4_clk_sclk_usbphy0 = { |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 107 | .name = "sclk_usbphy0", |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 108 | .rate = 27000000, |
| 109 | }; |
| 110 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 111 | static struct clk exynos4_clk_sclk_usbphy1 = { |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 112 | .name = "sclk_usbphy1", |
Jongpill Lee | b99380e | 2010-08-18 22:16:45 +0900 | [diff] [blame] | 113 | }; |
| 114 | |
Boojin Kim | bf856fb | 2011-09-02 09:44:36 +0900 | [diff] [blame] | 115 | static struct clk dummy_apb_pclk = { |
| 116 | .name = "apb_pclk", |
| 117 | .id = -1, |
| 118 | }; |
| 119 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 120 | static int exynos4_clksrc_mask_top_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 37e0172 | 2010-08-18 22:33:43 +0900 | [diff] [blame] | 121 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 122 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_TOP, clk, enable); |
Jongpill Lee | 37e0172 | 2010-08-18 22:33:43 +0900 | [diff] [blame] | 123 | } |
| 124 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 125 | static int exynos4_clksrc_mask_cam_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 126 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 127 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_CAM, clk, enable); |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 128 | } |
| 129 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 130 | static int exynos4_clksrc_mask_lcd0_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 131 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 132 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_LCD0, clk, enable); |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 133 | } |
| 134 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 135 | int exynos4_clksrc_mask_fsys_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 136 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 137 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_FSYS, clk, enable); |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 138 | } |
| 139 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 140 | static int exynos4_clksrc_mask_peril0_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 3297c2e | 2010-08-27 17:53:26 +0900 | [diff] [blame] | 141 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 142 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_PERIL0, clk, enable); |
Jongpill Lee | 3297c2e | 2010-08-27 17:53:26 +0900 | [diff] [blame] | 143 | } |
| 144 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 145 | static int exynos4_clksrc_mask_peril1_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 146 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 147 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_PERIL1, clk, enable); |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 148 | } |
| 149 | |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 150 | static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable) |
| 151 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 152 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_MFC, clk, enable); |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 153 | } |
| 154 | |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 155 | static int exynos4_clksrc_mask_tv_ctrl(struct clk *clk, int enable) |
| 156 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 157 | return s5p_gatectrl(EXYNOS4_CLKSRC_MASK_TV, clk, enable); |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 158 | } |
| 159 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 160 | static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 161 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 162 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_CAM, clk, enable); |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 163 | } |
| 164 | |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 165 | static int exynos4_clk_ip_tv_ctrl(struct clk *clk, int enable) |
| 166 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 167 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_TV, clk, enable); |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 168 | } |
| 169 | |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 170 | int exynos4_clk_ip_image_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 171 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 172 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_IMAGE, clk, enable); |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 173 | } |
| 174 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 175 | static int exynos4_clk_ip_lcd0_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 176 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 177 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_LCD0, clk, enable); |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 178 | } |
| 179 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 180 | int exynos4_clk_ip_lcd1_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 181 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 182 | return s5p_gatectrl(EXYNOS4210_CLKGATE_IP_LCD1, clk, enable); |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 183 | } |
| 184 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 185 | int exynos4_clk_ip_fsys_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 186 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 187 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_FSYS, clk, enable); |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 188 | } |
| 189 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 190 | static int exynos4_clk_ip_peril_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 191 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 192 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_PERIL, clk, enable); |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 193 | } |
| 194 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 195 | static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable) |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 196 | { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 197 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_PERIR, clk, enable); |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 198 | } |
| 199 | |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 200 | int exynos4_clk_ip_dmc_ctrl(struct clk *clk, int enable) |
| 201 | { |
| 202 | return s5p_gatectrl(EXYNOS4_CLKGATE_IP_DMC, clk, enable); |
| 203 | } |
| 204 | |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 205 | static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable) |
| 206 | { |
| 207 | return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable); |
| 208 | } |
| 209 | |
| 210 | static int exynos4_clk_dac_ctrl(struct clk *clk, int enable) |
| 211 | { |
| 212 | return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable); |
| 213 | } |
| 214 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 215 | /* Core list of CMU_CPU side */ |
| 216 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 217 | static struct clksrc_clk exynos4_clk_mout_apll = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 218 | .clk = { |
| 219 | .name = "mout_apll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 220 | }, |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 221 | .sources = &clk_src_apll, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 222 | .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 0, .size = 1 }, |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 223 | }; |
| 224 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 225 | static struct clksrc_clk exynos4_clk_sclk_apll = { |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 226 | .clk = { |
| 227 | .name = "sclk_apll", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 228 | .parent = &exynos4_clk_mout_apll.clk, |
Jongpill Lee | 3ff3102 | 2010-08-18 22:20:31 +0900 | [diff] [blame] | 229 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 230 | .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 24, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 231 | }; |
| 232 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 233 | static struct clksrc_clk exynos4_clk_mout_epll = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 234 | .clk = { |
| 235 | .name = "mout_epll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 236 | }, |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 237 | .sources = &clk_src_epll, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 238 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 4, .size = 1 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 239 | }; |
| 240 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 241 | struct clksrc_clk exynos4_clk_mout_mpll = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 242 | .clk = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 243 | .name = "mout_mpll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 244 | }, |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 245 | .sources = &clk_src_mpll, |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 246 | |
| 247 | /* reg_src will be added in each SoCs' clock */ |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 248 | }; |
| 249 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 250 | static struct clk *exynos4_clkset_moutcore_list[] = { |
| 251 | [0] = &exynos4_clk_mout_apll.clk, |
| 252 | [1] = &exynos4_clk_mout_mpll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 253 | }; |
| 254 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 255 | static struct clksrc_sources exynos4_clkset_moutcore = { |
| 256 | .sources = exynos4_clkset_moutcore_list, |
| 257 | .nr_sources = ARRAY_SIZE(exynos4_clkset_moutcore_list), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 258 | }; |
| 259 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 260 | static struct clksrc_clk exynos4_clk_moutcore = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 261 | .clk = { |
| 262 | .name = "moutcore", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 263 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 264 | .sources = &exynos4_clkset_moutcore, |
| 265 | .reg_src = { .reg = EXYNOS4_CLKSRC_CPU, .shift = 16, .size = 1 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 266 | }; |
| 267 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 268 | static struct clksrc_clk exynos4_clk_coreclk = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 269 | .clk = { |
| 270 | .name = "core_clk", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 271 | .parent = &exynos4_clk_moutcore.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 272 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 273 | .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 0, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 274 | }; |
| 275 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 276 | static struct clksrc_clk exynos4_clk_armclk = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 277 | .clk = { |
| 278 | .name = "armclk", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 279 | .parent = &exynos4_clk_coreclk.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 280 | }, |
| 281 | }; |
| 282 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 283 | static struct clksrc_clk exynos4_clk_aclk_corem0 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 284 | .clk = { |
| 285 | .name = "aclk_corem0", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 286 | .parent = &exynos4_clk_coreclk.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 287 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 288 | .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 289 | }; |
| 290 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 291 | static struct clksrc_clk exynos4_clk_aclk_cores = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 292 | .clk = { |
| 293 | .name = "aclk_cores", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 294 | .parent = &exynos4_clk_coreclk.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 295 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 296 | .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 4, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 297 | }; |
| 298 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 299 | static struct clksrc_clk exynos4_clk_aclk_corem1 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 300 | .clk = { |
| 301 | .name = "aclk_corem1", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 302 | .parent = &exynos4_clk_coreclk.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 303 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 304 | .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 8, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 305 | }; |
| 306 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 307 | static struct clksrc_clk exynos4_clk_periphclk = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 308 | .clk = { |
| 309 | .name = "periphclk", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 310 | .parent = &exynos4_clk_coreclk.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 311 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 312 | .reg_div = { .reg = EXYNOS4_CLKDIV_CPU, .shift = 12, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 313 | }; |
| 314 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 315 | /* Core list of CMU_CORE side */ |
| 316 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 317 | static struct clk *exynos4_clkset_corebus_list[] = { |
| 318 | [0] = &exynos4_clk_mout_mpll.clk, |
| 319 | [1] = &exynos4_clk_sclk_apll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 320 | }; |
| 321 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 322 | struct clksrc_sources exynos4_clkset_mout_corebus = { |
| 323 | .sources = exynos4_clkset_corebus_list, |
| 324 | .nr_sources = ARRAY_SIZE(exynos4_clkset_corebus_list), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 325 | }; |
| 326 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 327 | static struct clksrc_clk exynos4_clk_mout_corebus = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 328 | .clk = { |
| 329 | .name = "mout_corebus", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 330 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 331 | .sources = &exynos4_clkset_mout_corebus, |
| 332 | .reg_src = { .reg = EXYNOS4_CLKSRC_DMC, .shift = 4, .size = 1 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 333 | }; |
| 334 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 335 | static struct clksrc_clk exynos4_clk_sclk_dmc = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 336 | .clk = { |
| 337 | .name = "sclk_dmc", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 338 | .parent = &exynos4_clk_mout_corebus.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 339 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 340 | .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 12, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 341 | }; |
| 342 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 343 | static struct clksrc_clk exynos4_clk_aclk_cored = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 344 | .clk = { |
| 345 | .name = "aclk_cored", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 346 | .parent = &exynos4_clk_sclk_dmc.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 347 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 348 | .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 16, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 349 | }; |
| 350 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 351 | static struct clksrc_clk exynos4_clk_aclk_corep = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 352 | .clk = { |
| 353 | .name = "aclk_corep", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 354 | .parent = &exynos4_clk_aclk_cored.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 355 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 356 | .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 20, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 357 | }; |
| 358 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 359 | static struct clksrc_clk exynos4_clk_aclk_acp = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 360 | .clk = { |
| 361 | .name = "aclk_acp", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 362 | .parent = &exynos4_clk_mout_corebus.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 363 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 364 | .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 0, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 365 | }; |
| 366 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 367 | static struct clksrc_clk exynos4_clk_pclk_acp = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 368 | .clk = { |
| 369 | .name = "pclk_acp", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 370 | .parent = &exynos4_clk_aclk_acp.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 371 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 372 | .reg_div = { .reg = EXYNOS4_CLKDIV_DMC0, .shift = 4, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 373 | }; |
| 374 | |
| 375 | /* Core list of CMU_TOP side */ |
| 376 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 377 | struct clk *exynos4_clkset_aclk_top_list[] = { |
| 378 | [0] = &exynos4_clk_mout_mpll.clk, |
| 379 | [1] = &exynos4_clk_sclk_apll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 380 | }; |
| 381 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 382 | static struct clksrc_sources exynos4_clkset_aclk = { |
| 383 | .sources = exynos4_clkset_aclk_top_list, |
| 384 | .nr_sources = ARRAY_SIZE(exynos4_clkset_aclk_top_list), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 385 | }; |
| 386 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 387 | static struct clksrc_clk exynos4_clk_aclk_200 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 388 | .clk = { |
| 389 | .name = "aclk_200", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 390 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 391 | .sources = &exynos4_clkset_aclk, |
| 392 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 12, .size = 1 }, |
| 393 | .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 0, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 394 | }; |
| 395 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 396 | static struct clksrc_clk exynos4_clk_aclk_100 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 397 | .clk = { |
| 398 | .name = "aclk_100", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 399 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 400 | .sources = &exynos4_clkset_aclk, |
| 401 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 16, .size = 1 }, |
| 402 | .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 4, .size = 4 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 403 | }; |
| 404 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 405 | static struct clksrc_clk exynos4_clk_aclk_160 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 406 | .clk = { |
| 407 | .name = "aclk_160", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 408 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 409 | .sources = &exynos4_clkset_aclk, |
| 410 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 20, .size = 1 }, |
| 411 | .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 8, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 412 | }; |
| 413 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 414 | struct clksrc_clk exynos4_clk_aclk_133 = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 415 | .clk = { |
| 416 | .name = "aclk_133", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 417 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 418 | .sources = &exynos4_clkset_aclk, |
| 419 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 24, .size = 1 }, |
| 420 | .reg_div = { .reg = EXYNOS4_CLKDIV_TOP, .shift = 12, .size = 3 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 421 | }; |
| 422 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 423 | static struct clk *exynos4_clkset_vpllsrc_list[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 424 | [0] = &clk_fin_vpll, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 425 | [1] = &exynos4_clk_sclk_hdmi27m, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 426 | }; |
| 427 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 428 | static struct clksrc_sources exynos4_clkset_vpllsrc = { |
| 429 | .sources = exynos4_clkset_vpllsrc_list, |
| 430 | .nr_sources = ARRAY_SIZE(exynos4_clkset_vpllsrc_list), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 431 | }; |
| 432 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 433 | static struct clksrc_clk exynos4_clk_vpllsrc = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 434 | .clk = { |
| 435 | .name = "vpll_src", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 436 | .enable = exynos4_clksrc_mask_top_ctrl, |
Jongpill Lee | 37e0172 | 2010-08-18 22:33:43 +0900 | [diff] [blame] | 437 | .ctrlbit = (1 << 0), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 438 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 439 | .sources = &exynos4_clkset_vpllsrc, |
| 440 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP1, .shift = 0, .size = 1 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 441 | }; |
| 442 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 443 | static struct clk *exynos4_clkset_sclk_vpll_list[] = { |
| 444 | [0] = &exynos4_clk_vpllsrc.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 445 | [1] = &clk_fout_vpll, |
| 446 | }; |
| 447 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 448 | static struct clksrc_sources exynos4_clkset_sclk_vpll = { |
| 449 | .sources = exynos4_clkset_sclk_vpll_list, |
| 450 | .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_vpll_list), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 451 | }; |
| 452 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 453 | static struct clksrc_clk exynos4_clk_sclk_vpll = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 454 | .clk = { |
| 455 | .name = "sclk_vpll", |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 456 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 457 | .sources = &exynos4_clkset_sclk_vpll, |
| 458 | .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 8, .size = 1 }, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 459 | }; |
| 460 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 461 | static struct clk exynos4_init_clocks_off[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 462 | { |
| 463 | .name = "timers", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 464 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 465 | .enable = exynos4_clk_ip_peril_ctrl, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 466 | .ctrlbit = (1<<24), |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 467 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 468 | .name = "csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 469 | .devname = "s5p-mipi-csis.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 470 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 471 | .ctrlbit = (1 << 4), |
| 472 | }, { |
| 473 | .name = "csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 474 | .devname = "s5p-mipi-csis.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 475 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 476 | .ctrlbit = (1 << 5), |
| 477 | }, { |
Arnd Bergmann | 853a023 | 2012-03-15 21:22:00 +0000 | [diff] [blame] | 478 | .name = "jpeg", |
| 479 | .id = 0, |
| 480 | .enable = exynos4_clk_ip_cam_ctrl, |
| 481 | .ctrlbit = (1 << 6), |
| 482 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 483 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 484 | .devname = "exynos4-fimc.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 485 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 486 | .ctrlbit = (1 << 0), |
| 487 | }, { |
| 488 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 489 | .devname = "exynos4-fimc.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 490 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 491 | .ctrlbit = (1 << 1), |
| 492 | }, { |
| 493 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 494 | .devname = "exynos4-fimc.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 495 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 496 | .ctrlbit = (1 << 2), |
| 497 | }, { |
| 498 | .name = "fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 499 | .devname = "exynos4-fimc.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 500 | .enable = exynos4_clk_ip_cam_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 501 | .ctrlbit = (1 << 3), |
| 502 | }, { |
Chander Kashyap | 1f926c4 | 2012-08-28 11:38:18 -0700 | [diff] [blame] | 503 | .name = "tsi", |
| 504 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 505 | .ctrlbit = (1 << 4), |
| 506 | }, { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 507 | .name = "hsmmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 508 | .devname = "exynos4-sdhci.0", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 509 | .parent = &exynos4_clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 510 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 511 | .ctrlbit = (1 << 5), |
| 512 | }, { |
| 513 | .name = "hsmmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 514 | .devname = "exynos4-sdhci.1", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 515 | .parent = &exynos4_clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 516 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 517 | .ctrlbit = (1 << 6), |
| 518 | }, { |
| 519 | .name = "hsmmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 520 | .devname = "exynos4-sdhci.2", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 521 | .parent = &exynos4_clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 522 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 523 | .ctrlbit = (1 << 7), |
| 524 | }, { |
| 525 | .name = "hsmmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 526 | .devname = "exynos4-sdhci.3", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 527 | .parent = &exynos4_clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 528 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 529 | .ctrlbit = (1 << 8), |
| 530 | }, { |
Dongjin Kim | 454696f | 2012-12-18 08:57:06 -0800 | [diff] [blame] | 531 | .name = "biu", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 532 | .parent = &exynos4_clk_aclk_133.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 533 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 534 | .ctrlbit = (1 << 9), |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 535 | }, { |
Chander Kashyap | 1f926c4 | 2012-08-28 11:38:18 -0700 | [diff] [blame] | 536 | .name = "onenand", |
| 537 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 538 | .ctrlbit = (1 << 15), |
| 539 | }, { |
| 540 | .name = "nfcon", |
| 541 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 542 | .ctrlbit = (1 << 16), |
| 543 | }, { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 544 | .name = "dac", |
| 545 | .devname = "s5p-sdo", |
| 546 | .enable = exynos4_clk_ip_tv_ctrl, |
| 547 | .ctrlbit = (1 << 2), |
| 548 | }, { |
| 549 | .name = "mixer", |
| 550 | .devname = "s5p-mixer", |
| 551 | .enable = exynos4_clk_ip_tv_ctrl, |
| 552 | .ctrlbit = (1 << 1), |
| 553 | }, { |
| 554 | .name = "vp", |
| 555 | .devname = "s5p-mixer", |
| 556 | .enable = exynos4_clk_ip_tv_ctrl, |
| 557 | .ctrlbit = (1 << 0), |
| 558 | }, { |
| 559 | .name = "hdmi", |
| 560 | .devname = "exynos4-hdmi", |
| 561 | .enable = exynos4_clk_ip_tv_ctrl, |
| 562 | .ctrlbit = (1 << 3), |
| 563 | }, { |
| 564 | .name = "hdmiphy", |
| 565 | .devname = "exynos4-hdmi", |
| 566 | .enable = exynos4_clk_hdmiphy_ctrl, |
| 567 | .ctrlbit = (1 << 0), |
| 568 | }, { |
| 569 | .name = "dacphy", |
| 570 | .devname = "s5p-sdo", |
| 571 | .enable = exynos4_clk_dac_ctrl, |
| 572 | .ctrlbit = (1 << 0), |
| 573 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 574 | .name = "adc", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 575 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 576 | .ctrlbit = (1 << 15), |
| 577 | }, { |
Amit Daniel Kachhap | 8d4155d | 2012-10-29 21:18:01 +0900 | [diff] [blame] | 578 | .name = "tmu_apbif", |
| 579 | .enable = exynos4_clk_ip_perir_ctrl, |
| 580 | .ctrlbit = (1 << 17), |
| 581 | }, { |
Naveen Krishna Ch | f9d7bcb | 2011-02-22 17:13:42 +0900 | [diff] [blame] | 582 | .name = "keypad", |
Naveen Krishna Ch | f9d7bcb | 2011-02-22 17:13:42 +0900 | [diff] [blame] | 583 | .enable = exynos4_clk_ip_perir_ctrl, |
| 584 | .ctrlbit = (1 << 16), |
| 585 | }, { |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 586 | .name = "rtc", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 587 | .enable = exynos4_clk_ip_perir_ctrl, |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 588 | .ctrlbit = (1 << 15), |
| 589 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 590 | .name = "watchdog", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 591 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 592 | .enable = exynos4_clk_ip_perir_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 593 | .ctrlbit = (1 << 14), |
| 594 | }, { |
| 595 | .name = "usbhost", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 596 | .enable = exynos4_clk_ip_fsys_ctrl , |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 597 | .ctrlbit = (1 << 12), |
| 598 | }, { |
| 599 | .name = "otg", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 600 | .enable = exynos4_clk_ip_fsys_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 601 | .ctrlbit = (1 << 13), |
| 602 | }, { |
| 603 | .name = "spi", |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 604 | .devname = "exynos4210-spi.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 605 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 606 | .ctrlbit = (1 << 16), |
| 607 | }, { |
| 608 | .name = "spi", |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 609 | .devname = "exynos4210-spi.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 610 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 611 | .ctrlbit = (1 << 17), |
| 612 | }, { |
| 613 | .name = "spi", |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 614 | .devname = "exynos4210-spi.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 615 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 616 | .ctrlbit = (1 << 18), |
| 617 | }, { |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 618 | .name = "iis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 619 | .devname = "samsung-i2s.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 620 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 621 | .ctrlbit = (1 << 20), |
| 622 | }, { |
| 623 | .name = "iis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 624 | .devname = "samsung-i2s.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 625 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | 2d27043 | 2010-12-21 09:57:03 +0900 | [diff] [blame] | 626 | .ctrlbit = (1 << 21), |
| 627 | }, { |
Chander Kashyap | 377acfb | 2012-09-21 11:06:00 +0900 | [diff] [blame] | 628 | .name = "pcm", |
| 629 | .devname = "samsung-pcm.1", |
| 630 | .enable = exynos4_clk_ip_peril_ctrl, |
| 631 | .ctrlbit = (1 << 22), |
| 632 | }, { |
| 633 | .name = "pcm", |
| 634 | .devname = "samsung-pcm.2", |
| 635 | .enable = exynos4_clk_ip_peril_ctrl, |
| 636 | .ctrlbit = (1 << 23), |
| 637 | }, { |
| 638 | .name = "slimbus", |
| 639 | .enable = exynos4_clk_ip_peril_ctrl, |
| 640 | .ctrlbit = (1 << 25), |
| 641 | }, { |
| 642 | .name = "spdif", |
| 643 | .devname = "samsung-spdif", |
| 644 | .enable = exynos4_clk_ip_peril_ctrl, |
| 645 | .ctrlbit = (1 << 26), |
| 646 | }, { |
Jassi Brar | aa22755 | 2010-12-21 09:54:57 +0900 | [diff] [blame] | 647 | .name = "ac97", |
Jonghwan Choi | af8a9f6 | 2011-08-12 18:15:42 +0900 | [diff] [blame] | 648 | .devname = "samsung-ac97", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 649 | .enable = exynos4_clk_ip_peril_ctrl, |
Jassi Brar | aa22755 | 2010-12-21 09:54:57 +0900 | [diff] [blame] | 650 | .ctrlbit = (1 << 27), |
| 651 | }, { |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 652 | .name = "mfc", |
| 653 | .devname = "s5p-mfc", |
| 654 | .enable = exynos4_clk_ip_mfc_ctrl, |
| 655 | .ctrlbit = (1 << 0), |
| 656 | }, { |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 657 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 658 | .devname = "s3c2440-i2c.0", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 659 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 660 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 661 | .ctrlbit = (1 << 6), |
| 662 | }, { |
| 663 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 664 | .devname = "s3c2440-i2c.1", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 665 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 666 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 667 | .ctrlbit = (1 << 7), |
| 668 | }, { |
| 669 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 670 | .devname = "s3c2440-i2c.2", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 671 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 672 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 673 | .ctrlbit = (1 << 8), |
| 674 | }, { |
| 675 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 676 | .devname = "s3c2440-i2c.3", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 677 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 678 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 679 | .ctrlbit = (1 << 9), |
| 680 | }, { |
| 681 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 682 | .devname = "s3c2440-i2c.4", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 683 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 684 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 685 | .ctrlbit = (1 << 10), |
| 686 | }, { |
| 687 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 688 | .devname = "s3c2440-i2c.5", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 689 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 690 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 691 | .ctrlbit = (1 << 11), |
| 692 | }, { |
| 693 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 694 | .devname = "s3c2440-i2c.6", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 695 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 696 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 697 | .ctrlbit = (1 << 12), |
| 698 | }, { |
| 699 | .name = "i2c", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 700 | .devname = "s3c2440-i2c.7", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 701 | .parent = &exynos4_clk_aclk_100.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 702 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 82260bf | 2010-08-18 22:49:24 +0900 | [diff] [blame] | 703 | .ctrlbit = (1 << 13), |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 704 | }, { |
Tomasz Stanislawski | c40e7e0 | 2011-09-16 18:44:36 +0900 | [diff] [blame] | 705 | .name = "i2c", |
| 706 | .devname = "s3c2440-hdmiphy-i2c", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 707 | .parent = &exynos4_clk_aclk_100.clk, |
Tomasz Stanislawski | c40e7e0 | 2011-09-16 18:44:36 +0900 | [diff] [blame] | 708 | .enable = exynos4_clk_ip_peril_ctrl, |
| 709 | .ctrlbit = (1 << 14), |
| 710 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 711 | .name = "sysmmu", |
| 712 | .devname = "exynos-sysmmu.0", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 713 | .enable = exynos4_clk_ip_mfc_ctrl, |
| 714 | .ctrlbit = (1 << 1), |
| 715 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 716 | .name = "sysmmu", |
| 717 | .devname = "exynos-sysmmu.1", |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 718 | .enable = exynos4_clk_ip_mfc_ctrl, |
| 719 | .ctrlbit = (1 << 2), |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 720 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 721 | .name = "sysmmu", |
| 722 | .devname = "exynos-sysmmu.2", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 723 | .enable = exynos4_clk_ip_tv_ctrl, |
| 724 | .ctrlbit = (1 << 4), |
| 725 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 726 | .name = "sysmmu", |
| 727 | .devname = "exynos-sysmmu.3", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 728 | .enable = exynos4_clk_ip_cam_ctrl, |
| 729 | .ctrlbit = (1 << 11), |
| 730 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 731 | .name = "sysmmu", |
| 732 | .devname = "exynos-sysmmu.4", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 733 | .enable = exynos4_clk_ip_image_ctrl, |
| 734 | .ctrlbit = (1 << 4), |
| 735 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 736 | .name = "sysmmu", |
| 737 | .devname = "exynos-sysmmu.5", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 738 | .enable = exynos4_clk_ip_cam_ctrl, |
| 739 | .ctrlbit = (1 << 7), |
| 740 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 741 | .name = "sysmmu", |
| 742 | .devname = "exynos-sysmmu.6", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 743 | .enable = exynos4_clk_ip_cam_ctrl, |
| 744 | .ctrlbit = (1 << 8), |
| 745 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 746 | .name = "sysmmu", |
| 747 | .devname = "exynos-sysmmu.7", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 748 | .enable = exynos4_clk_ip_cam_ctrl, |
| 749 | .ctrlbit = (1 << 9), |
| 750 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 751 | .name = "sysmmu", |
| 752 | .devname = "exynos-sysmmu.8", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 753 | .enable = exynos4_clk_ip_cam_ctrl, |
| 754 | .ctrlbit = (1 << 10), |
| 755 | }, { |
Cho KyongHo | 25e9d28 | 2012-12-26 10:54:02 +0900 | [diff] [blame] | 756 | .name = "sysmmu", |
| 757 | .devname = "exynos-sysmmu.10", |
KyongHo Cho | bca10b9 | 2012-04-04 09:23:02 -0700 | [diff] [blame] | 758 | .enable = exynos4_clk_ip_lcd0_ctrl, |
| 759 | .ctrlbit = (1 << 4), |
KyongHo Cho | b0b6ff0 | 2011-03-07 09:10:24 +0900 | [diff] [blame] | 760 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 761 | }; |
| 762 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 763 | static struct clk exynos4_init_clocks_on[] = { |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 764 | { |
| 765 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 766 | .devname = "s5pv210-uart.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 767 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 768 | .ctrlbit = (1 << 0), |
| 769 | }, { |
| 770 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 771 | .devname = "s5pv210-uart.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 772 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 773 | .ctrlbit = (1 << 1), |
| 774 | }, { |
| 775 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 776 | .devname = "s5pv210-uart.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 777 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 778 | .ctrlbit = (1 << 2), |
| 779 | }, { |
| 780 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 781 | .devname = "s5pv210-uart.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 782 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 783 | .ctrlbit = (1 << 3), |
| 784 | }, { |
| 785 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 786 | .devname = "s5pv210-uart.4", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 787 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 788 | .ctrlbit = (1 << 4), |
| 789 | }, { |
| 790 | .name = "uart", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 791 | .devname = "s5pv210-uart.5", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 792 | .enable = exynos4_clk_ip_peril_ctrl, |
Jongpill Lee | 5a847b4 | 2010-08-27 16:50:47 +0900 | [diff] [blame] | 793 | .ctrlbit = (1 << 5), |
| 794 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 795 | }; |
| 796 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 797 | static struct clk exynos4_clk_pdma0 = { |
Thomas Abraham | 66fdb29 | 2011-10-24 14:01:03 +0200 | [diff] [blame] | 798 | .name = "dma", |
| 799 | .devname = "dma-pl330.0", |
| 800 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 801 | .ctrlbit = (1 << 0), |
| 802 | }; |
| 803 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 804 | static struct clk exynos4_clk_pdma1 = { |
Thomas Abraham | 66fdb29 | 2011-10-24 14:01:03 +0200 | [diff] [blame] | 805 | .name = "dma", |
| 806 | .devname = "dma-pl330.1", |
| 807 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 808 | .ctrlbit = (1 << 1), |
| 809 | }; |
| 810 | |
Boojin Kim | 9ed76e0 | 2012-02-15 13:15:12 +0900 | [diff] [blame] | 811 | static struct clk exynos4_clk_mdma1 = { |
| 812 | .name = "dma", |
| 813 | .devname = "dma-pl330.2", |
| 814 | .enable = exynos4_clk_ip_image_ctrl, |
| 815 | .ctrlbit = ((1 << 8) | (1 << 5) | (1 << 2)), |
| 816 | }; |
| 817 | |
Tushar Behera | 7902546 | 2012-03-12 21:17:02 -0700 | [diff] [blame] | 818 | static struct clk exynos4_clk_fimd0 = { |
| 819 | .name = "fimd", |
| 820 | .devname = "exynos4-fb.0", |
| 821 | .enable = exynos4_clk_ip_lcd0_ctrl, |
| 822 | .ctrlbit = (1 << 0), |
| 823 | }; |
| 824 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 825 | struct clk *exynos4_clkset_group_list[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 826 | [0] = &clk_ext_xtal_mux, |
| 827 | [1] = &clk_xusbxti, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 828 | [2] = &exynos4_clk_sclk_hdmi27m, |
| 829 | [3] = &exynos4_clk_sclk_usbphy0, |
| 830 | [4] = &exynos4_clk_sclk_usbphy1, |
| 831 | [5] = &exynos4_clk_sclk_hdmiphy, |
| 832 | [6] = &exynos4_clk_mout_mpll.clk, |
| 833 | [7] = &exynos4_clk_mout_epll.clk, |
| 834 | [8] = &exynos4_clk_sclk_vpll.clk, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 835 | }; |
| 836 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 837 | struct clksrc_sources exynos4_clkset_group = { |
| 838 | .sources = exynos4_clkset_group_list, |
| 839 | .nr_sources = ARRAY_SIZE(exynos4_clkset_group_list), |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 840 | }; |
| 841 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 842 | static struct clk *exynos4_clkset_mout_g2d0_list[] = { |
| 843 | [0] = &exynos4_clk_mout_mpll.clk, |
| 844 | [1] = &exynos4_clk_sclk_apll.clk, |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 845 | }; |
| 846 | |
Sachin Kamat | 8bf5646 | 2012-07-17 07:52:03 +0900 | [diff] [blame] | 847 | struct clksrc_sources exynos4_clkset_mout_g2d0 = { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 848 | .sources = exynos4_clkset_mout_g2d0_list, |
| 849 | .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d0_list), |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 850 | }; |
| 851 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 852 | static struct clk *exynos4_clkset_mout_g2d1_list[] = { |
| 853 | [0] = &exynos4_clk_mout_epll.clk, |
| 854 | [1] = &exynos4_clk_sclk_vpll.clk, |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 855 | }; |
| 856 | |
Sachin Kamat | 8bf5646 | 2012-07-17 07:52:03 +0900 | [diff] [blame] | 857 | struct clksrc_sources exynos4_clkset_mout_g2d1 = { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 858 | .sources = exynos4_clkset_mout_g2d1_list, |
| 859 | .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_g2d1_list), |
Jongpill Lee | 06cba8d | 2010-08-18 22:51:23 +0900 | [diff] [blame] | 860 | }; |
| 861 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 862 | static struct clk *exynos4_clkset_mout_mfc0_list[] = { |
| 863 | [0] = &exynos4_clk_mout_mpll.clk, |
| 864 | [1] = &exynos4_clk_sclk_apll.clk, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 865 | }; |
| 866 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 867 | static struct clksrc_sources exynos4_clkset_mout_mfc0 = { |
| 868 | .sources = exynos4_clkset_mout_mfc0_list, |
| 869 | .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc0_list), |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 870 | }; |
| 871 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 872 | static struct clksrc_clk exynos4_clk_mout_mfc0 = { |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 873 | .clk = { |
| 874 | .name = "mout_mfc0", |
| 875 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 876 | .sources = &exynos4_clkset_mout_mfc0, |
| 877 | .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 0, .size = 1 }, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 878 | }; |
| 879 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 880 | static struct clk *exynos4_clkset_mout_mfc1_list[] = { |
| 881 | [0] = &exynos4_clk_mout_epll.clk, |
| 882 | [1] = &exynos4_clk_sclk_vpll.clk, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 883 | }; |
| 884 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 885 | static struct clksrc_sources exynos4_clkset_mout_mfc1 = { |
| 886 | .sources = exynos4_clkset_mout_mfc1_list, |
| 887 | .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc1_list), |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 888 | }; |
| 889 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 890 | static struct clksrc_clk exynos4_clk_mout_mfc1 = { |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 891 | .clk = { |
| 892 | .name = "mout_mfc1", |
| 893 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 894 | .sources = &exynos4_clkset_mout_mfc1, |
| 895 | .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 4, .size = 1 }, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 896 | }; |
| 897 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 898 | static struct clk *exynos4_clkset_mout_mfc_list[] = { |
| 899 | [0] = &exynos4_clk_mout_mfc0.clk, |
| 900 | [1] = &exynos4_clk_mout_mfc1.clk, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 901 | }; |
| 902 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 903 | static struct clksrc_sources exynos4_clkset_mout_mfc = { |
| 904 | .sources = exynos4_clkset_mout_mfc_list, |
| 905 | .nr_sources = ARRAY_SIZE(exynos4_clkset_mout_mfc_list), |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 906 | }; |
| 907 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 908 | static struct clk *exynos4_clkset_sclk_dac_list[] = { |
| 909 | [0] = &exynos4_clk_sclk_vpll.clk, |
| 910 | [1] = &exynos4_clk_sclk_hdmiphy, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 911 | }; |
| 912 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 913 | static struct clksrc_sources exynos4_clkset_sclk_dac = { |
| 914 | .sources = exynos4_clkset_sclk_dac_list, |
| 915 | .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_dac_list), |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 916 | }; |
| 917 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 918 | static struct clksrc_clk exynos4_clk_sclk_dac = { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 919 | .clk = { |
| 920 | .name = "sclk_dac", |
| 921 | .enable = exynos4_clksrc_mask_tv_ctrl, |
| 922 | .ctrlbit = (1 << 8), |
| 923 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 924 | .sources = &exynos4_clkset_sclk_dac, |
| 925 | .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 8, .size = 1 }, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 926 | }; |
| 927 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 928 | static struct clksrc_clk exynos4_clk_sclk_pixel = { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 929 | .clk = { |
| 930 | .name = "sclk_pixel", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 931 | .parent = &exynos4_clk_sclk_vpll.clk, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 932 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 933 | .reg_div = { .reg = EXYNOS4_CLKDIV_TV, .shift = 0, .size = 4 }, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 934 | }; |
| 935 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 936 | static struct clk *exynos4_clkset_sclk_hdmi_list[] = { |
| 937 | [0] = &exynos4_clk_sclk_pixel.clk, |
| 938 | [1] = &exynos4_clk_sclk_hdmiphy, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 939 | }; |
| 940 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 941 | static struct clksrc_sources exynos4_clkset_sclk_hdmi = { |
| 942 | .sources = exynos4_clkset_sclk_hdmi_list, |
| 943 | .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_hdmi_list), |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 944 | }; |
| 945 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 946 | static struct clksrc_clk exynos4_clk_sclk_hdmi = { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 947 | .clk = { |
| 948 | .name = "sclk_hdmi", |
| 949 | .enable = exynos4_clksrc_mask_tv_ctrl, |
| 950 | .ctrlbit = (1 << 0), |
| 951 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 952 | .sources = &exynos4_clkset_sclk_hdmi, |
| 953 | .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 0, .size = 1 }, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 954 | }; |
| 955 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 956 | static struct clk *exynos4_clkset_sclk_mixer_list[] = { |
| 957 | [0] = &exynos4_clk_sclk_dac.clk, |
| 958 | [1] = &exynos4_clk_sclk_hdmi.clk, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 959 | }; |
| 960 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 961 | static struct clksrc_sources exynos4_clkset_sclk_mixer = { |
| 962 | .sources = exynos4_clkset_sclk_mixer_list, |
| 963 | .nr_sources = ARRAY_SIZE(exynos4_clkset_sclk_mixer_list), |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 964 | }; |
| 965 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 966 | static struct clksrc_clk exynos4_clk_sclk_mixer = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 967 | .clk = { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 968 | .name = "sclk_mixer", |
| 969 | .enable = exynos4_clksrc_mask_tv_ctrl, |
| 970 | .ctrlbit = (1 << 4), |
| 971 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 972 | .sources = &exynos4_clkset_sclk_mixer, |
| 973 | .reg_src = { .reg = EXYNOS4_CLKSRC_TV, .shift = 4, .size = 1 }, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 974 | }; |
| 975 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 976 | static struct clksrc_clk *exynos4_sclk_tv[] = { |
| 977 | &exynos4_clk_sclk_dac, |
| 978 | &exynos4_clk_sclk_pixel, |
| 979 | &exynos4_clk_sclk_hdmi, |
| 980 | &exynos4_clk_sclk_mixer, |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 981 | }; |
| 982 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 983 | static struct clksrc_clk exynos4_clk_dout_mmc0 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 984 | .clk = { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 985 | .name = "dout_mmc0", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 986 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 987 | .sources = &exynos4_clkset_group, |
| 988 | .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 0, .size = 4 }, |
| 989 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 0, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 990 | }; |
| 991 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 992 | static struct clksrc_clk exynos4_clk_dout_mmc1 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 993 | .clk = { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 994 | .name = "dout_mmc1", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 995 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 996 | .sources = &exynos4_clkset_group, |
| 997 | .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 4, .size = 4 }, |
| 998 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 16, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 999 | }; |
| 1000 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1001 | static struct clksrc_clk exynos4_clk_dout_mmc2 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1002 | .clk = { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1003 | .name = "dout_mmc2", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1004 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1005 | .sources = &exynos4_clkset_group, |
| 1006 | .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 8, .size = 4 }, |
| 1007 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 0, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1008 | }; |
| 1009 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1010 | static struct clksrc_clk exynos4_clk_dout_mmc3 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1011 | .clk = { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1012 | .name = "dout_mmc3", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1013 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1014 | .sources = &exynos4_clkset_group, |
| 1015 | .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 12, .size = 4 }, |
| 1016 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 16, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1017 | }; |
| 1018 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1019 | static struct clksrc_clk exynos4_clk_dout_mmc4 = { |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1020 | .clk = { |
| 1021 | .name = "dout_mmc4", |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1022 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1023 | .sources = &exynos4_clkset_group, |
| 1024 | .reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 16, .size = 4 }, |
| 1025 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 0, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1026 | }; |
| 1027 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1028 | static struct clksrc_clk exynos4_clksrcs[] = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1029 | { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1030 | .clk = { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1031 | .name = "sclk_pwm", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1032 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1033 | .ctrlbit = (1 << 24), |
| 1034 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1035 | .sources = &exynos4_clkset_group, |
| 1036 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 24, .size = 4 }, |
| 1037 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL3, .shift = 0, .size = 4 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1038 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1039 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1040 | .name = "sclk_csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1041 | .devname = "s5p-mipi-csis.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1042 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1043 | .ctrlbit = (1 << 24), |
| 1044 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1045 | .sources = &exynos4_clkset_group, |
| 1046 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 24, .size = 4 }, |
| 1047 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 24, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1048 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1049 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1050 | .name = "sclk_csis", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1051 | .devname = "s5p-mipi-csis.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1052 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1053 | .ctrlbit = (1 << 28), |
| 1054 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1055 | .sources = &exynos4_clkset_group, |
| 1056 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 28, .size = 4 }, |
| 1057 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 28, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1058 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1059 | .clk = { |
Sylwester Nawrocki | 00aaad2 | 2011-09-27 07:00:59 +0900 | [diff] [blame] | 1060 | .name = "sclk_cam0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1061 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1062 | .ctrlbit = (1 << 16), |
| 1063 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1064 | .sources = &exynos4_clkset_group, |
| 1065 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 16, .size = 4 }, |
| 1066 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 16, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1067 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1068 | .clk = { |
Sylwester Nawrocki | 00aaad2 | 2011-09-27 07:00:59 +0900 | [diff] [blame] | 1069 | .name = "sclk_cam1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1070 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1071 | .ctrlbit = (1 << 20), |
| 1072 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1073 | .sources = &exynos4_clkset_group, |
| 1074 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 20, .size = 4 }, |
| 1075 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 20, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1076 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1077 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1078 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1079 | .devname = "exynos4-fimc.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1080 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1081 | .ctrlbit = (1 << 0), |
| 1082 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1083 | .sources = &exynos4_clkset_group, |
| 1084 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 0, .size = 4 }, |
| 1085 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 0, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1086 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1087 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1088 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1089 | .devname = "exynos4-fimc.1", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1090 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1091 | .ctrlbit = (1 << 4), |
| 1092 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1093 | .sources = &exynos4_clkset_group, |
| 1094 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 4, .size = 4 }, |
| 1095 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 4, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1096 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1097 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1098 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1099 | .devname = "exynos4-fimc.2", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1100 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1101 | .ctrlbit = (1 << 8), |
| 1102 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1103 | .sources = &exynos4_clkset_group, |
| 1104 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 8, .size = 4 }, |
| 1105 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 8, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1106 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1107 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1108 | .name = "sclk_fimc", |
Thomas Abraham | badc4f2 | 2011-06-14 19:12:27 +0900 | [diff] [blame] | 1109 | .devname = "exynos4-fimc.3", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1110 | .enable = exynos4_clksrc_mask_cam_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1111 | .ctrlbit = (1 << 12), |
| 1112 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1113 | .sources = &exynos4_clkset_group, |
| 1114 | .reg_src = { .reg = EXYNOS4_CLKSRC_CAM, .shift = 12, .size = 4 }, |
| 1115 | .reg_div = { .reg = EXYNOS4_CLKDIV_CAM, .shift = 12, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1116 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1117 | .clk = { |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1118 | .name = "sclk_fimd", |
Jingoo Han | 268a7ef | 2011-07-21 15:42:38 +0900 | [diff] [blame] | 1119 | .devname = "exynos4-fb.0", |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1120 | .enable = exynos4_clksrc_mask_lcd0_ctrl, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1121 | .ctrlbit = (1 << 0), |
| 1122 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1123 | .sources = &exynos4_clkset_group, |
| 1124 | .reg_src = { .reg = EXYNOS4_CLKSRC_LCD0, .shift = 0, .size = 4 }, |
| 1125 | .reg_div = { .reg = EXYNOS4_CLKDIV_LCD0, .shift = 0, .size = 4 }, |
Jongpill Lee | 33f469d | 2010-08-18 22:54:48 +0900 | [diff] [blame] | 1126 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1127 | .clk = { |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 1128 | .name = "sclk_mfc", |
| 1129 | .devname = "s5p-mfc", |
| 1130 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1131 | .sources = &exynos4_clkset_mout_mfc, |
| 1132 | .reg_src = { .reg = EXYNOS4_CLKSRC_MFC, .shift = 8, .size = 1 }, |
| 1133 | .reg_div = { .reg = EXYNOS4_CLKDIV_MFC, .shift = 0, .size = 4 }, |
Kamil Debski | 0f75a96 | 2011-07-21 16:42:30 +0900 | [diff] [blame] | 1134 | }, { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1135 | .clk = { |
Dongjin Kim | 454696f | 2012-12-18 08:57:06 -0800 | [diff] [blame] | 1136 | .name = "ciu", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1137 | .parent = &exynos4_clk_dout_mmc4.clk, |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1138 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1139 | .ctrlbit = (1 << 16), |
| 1140 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1141 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS3, .shift = 8, .size = 8 }, |
Jongpill Lee | 340ea1e | 2010-08-18 22:39:26 +0900 | [diff] [blame] | 1142 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1143 | }; |
| 1144 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1145 | static struct clksrc_clk exynos4_clk_sclk_uart0 = { |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1146 | .clk = { |
| 1147 | .name = "uclk1", |
| 1148 | .devname = "exynos4210-uart.0", |
| 1149 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
| 1150 | .ctrlbit = (1 << 0), |
| 1151 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1152 | .sources = &exynos4_clkset_group, |
| 1153 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 0, .size = 4 }, |
| 1154 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 0, .size = 4 }, |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1155 | }; |
| 1156 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1157 | static struct clksrc_clk exynos4_clk_sclk_uart1 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1158 | .clk = { |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1159 | .name = "uclk1", |
| 1160 | .devname = "exynos4210-uart.1", |
| 1161 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
| 1162 | .ctrlbit = (1 << 4), |
| 1163 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1164 | .sources = &exynos4_clkset_group, |
| 1165 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 4, .size = 4 }, |
| 1166 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 4, .size = 4 }, |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1167 | }; |
| 1168 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1169 | static struct clksrc_clk exynos4_clk_sclk_uart2 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1170 | .clk = { |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1171 | .name = "uclk1", |
| 1172 | .devname = "exynos4210-uart.2", |
| 1173 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
| 1174 | .ctrlbit = (1 << 8), |
| 1175 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1176 | .sources = &exynos4_clkset_group, |
| 1177 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 8, .size = 4 }, |
| 1178 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 8, .size = 4 }, |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1179 | }; |
| 1180 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1181 | static struct clksrc_clk exynos4_clk_sclk_uart3 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1182 | .clk = { |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1183 | .name = "uclk1", |
| 1184 | .devname = "exynos4210-uart.3", |
| 1185 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
| 1186 | .ctrlbit = (1 << 12), |
| 1187 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1188 | .sources = &exynos4_clkset_group, |
| 1189 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL0, .shift = 12, .size = 4 }, |
| 1190 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL0, .shift = 12, .size = 4 }, |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1191 | }; |
| 1192 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1193 | static struct clksrc_clk exynos4_clk_sclk_mmc0 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1194 | .clk = { |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1195 | .name = "sclk_mmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 1196 | .devname = "exynos4-sdhci.0", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1197 | .parent = &exynos4_clk_dout_mmc0.clk, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1198 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1199 | .ctrlbit = (1 << 0), |
| 1200 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1201 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 8, .size = 8 }, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1202 | }; |
| 1203 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1204 | static struct clksrc_clk exynos4_clk_sclk_mmc1 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1205 | .clk = { |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1206 | .name = "sclk_mmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 1207 | .devname = "exynos4-sdhci.1", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1208 | .parent = &exynos4_clk_dout_mmc1.clk, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1209 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1210 | .ctrlbit = (1 << 4), |
| 1211 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1212 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS1, .shift = 24, .size = 8 }, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1213 | }; |
| 1214 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1215 | static struct clksrc_clk exynos4_clk_sclk_mmc2 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1216 | .clk = { |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1217 | .name = "sclk_mmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 1218 | .devname = "exynos4-sdhci.2", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1219 | .parent = &exynos4_clk_dout_mmc2.clk, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1220 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1221 | .ctrlbit = (1 << 8), |
| 1222 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1223 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 8, .size = 8 }, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1224 | }; |
| 1225 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1226 | static struct clksrc_clk exynos4_clk_sclk_mmc3 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1227 | .clk = { |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1228 | .name = "sclk_mmc", |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 1229 | .devname = "exynos4-sdhci.3", |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1230 | .parent = &exynos4_clk_dout_mmc3.clk, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1231 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1232 | .ctrlbit = (1 << 12), |
| 1233 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1234 | .reg_div = { .reg = EXYNOS4_CLKDIV_FSYS2, .shift = 24, .size = 8 }, |
Rajeshwari Shinde | a361d10 | 2011-10-24 17:05:58 +0200 | [diff] [blame] | 1235 | }; |
| 1236 | |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1237 | static struct clksrc_clk exynos4_clk_mdout_spi0 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1238 | .clk = { |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1239 | .name = "mdout_spi", |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 1240 | .devname = "exynos4210-spi.0", |
Padmavathi Venna | 74ac23a | 2011-12-26 16:42:15 +0900 | [diff] [blame] | 1241 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1242 | .sources = &exynos4_clkset_group, |
| 1243 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 16, .size = 4 }, |
| 1244 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 0, .size = 4 }, |
Padmavathi Venna | 74ac23a | 2011-12-26 16:42:15 +0900 | [diff] [blame] | 1245 | }; |
| 1246 | |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1247 | static struct clksrc_clk exynos4_clk_mdout_spi1 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1248 | .clk = { |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1249 | .name = "mdout_spi", |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 1250 | .devname = "exynos4210-spi.1", |
Padmavathi Venna | 74ac23a | 2011-12-26 16:42:15 +0900 | [diff] [blame] | 1251 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1252 | .sources = &exynos4_clkset_group, |
| 1253 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 20, .size = 4 }, |
| 1254 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 16, .size = 4 }, |
Padmavathi Venna | 74ac23a | 2011-12-26 16:42:15 +0900 | [diff] [blame] | 1255 | }; |
| 1256 | |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1257 | static struct clksrc_clk exynos4_clk_mdout_spi2 = { |
Kukjin Kim | ce9c00e | 2012-03-09 13:51:24 -0800 | [diff] [blame] | 1258 | .clk = { |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1259 | .name = "mdout_spi", |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 1260 | .devname = "exynos4210-spi.2", |
Padmavathi Venna | 74ac23a | 2011-12-26 16:42:15 +0900 | [diff] [blame] | 1261 | }, |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1262 | .sources = &exynos4_clkset_group, |
| 1263 | .reg_src = { .reg = EXYNOS4_CLKSRC_PERIL1, .shift = 24, .size = 4 }, |
| 1264 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 0, .size = 4 }, |
Padmavathi Venna | 74ac23a | 2011-12-26 16:42:15 +0900 | [diff] [blame] | 1265 | }; |
| 1266 | |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1267 | static struct clksrc_clk exynos4_clk_sclk_spi0 = { |
| 1268 | .clk = { |
| 1269 | .name = "sclk_spi", |
| 1270 | .devname = "exynos4210-spi.0", |
| 1271 | .parent = &exynos4_clk_mdout_spi0.clk, |
| 1272 | .enable = exynos4_clksrc_mask_peril1_ctrl, |
| 1273 | .ctrlbit = (1 << 16), |
| 1274 | }, |
| 1275 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 8, .size = 8 }, |
| 1276 | }; |
| 1277 | |
| 1278 | static struct clksrc_clk exynos4_clk_sclk_spi1 = { |
| 1279 | .clk = { |
| 1280 | .name = "sclk_spi", |
| 1281 | .devname = "exynos4210-spi.1", |
| 1282 | .parent = &exynos4_clk_mdout_spi1.clk, |
| 1283 | .enable = exynos4_clksrc_mask_peril1_ctrl, |
| 1284 | .ctrlbit = (1 << 20), |
| 1285 | }, |
| 1286 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL1, .shift = 24, .size = 8 }, |
| 1287 | }; |
| 1288 | |
| 1289 | static struct clksrc_clk exynos4_clk_sclk_spi2 = { |
| 1290 | .clk = { |
| 1291 | .name = "sclk_spi", |
| 1292 | .devname = "exynos4210-spi.2", |
| 1293 | .parent = &exynos4_clk_mdout_spi2.clk, |
| 1294 | .enable = exynos4_clksrc_mask_peril1_ctrl, |
| 1295 | .ctrlbit = (1 << 24), |
| 1296 | }, |
| 1297 | .reg_div = { .reg = EXYNOS4_CLKDIV_PERIL2, .shift = 8, .size = 8 }, |
| 1298 | }; |
| 1299 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1300 | /* Clock initialization code */ |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1301 | static struct clksrc_clk *exynos4_sysclks[] = { |
| 1302 | &exynos4_clk_mout_apll, |
| 1303 | &exynos4_clk_sclk_apll, |
| 1304 | &exynos4_clk_mout_epll, |
| 1305 | &exynos4_clk_mout_mpll, |
| 1306 | &exynos4_clk_moutcore, |
| 1307 | &exynos4_clk_coreclk, |
| 1308 | &exynos4_clk_armclk, |
| 1309 | &exynos4_clk_aclk_corem0, |
| 1310 | &exynos4_clk_aclk_cores, |
| 1311 | &exynos4_clk_aclk_corem1, |
| 1312 | &exynos4_clk_periphclk, |
| 1313 | &exynos4_clk_mout_corebus, |
| 1314 | &exynos4_clk_sclk_dmc, |
| 1315 | &exynos4_clk_aclk_cored, |
| 1316 | &exynos4_clk_aclk_corep, |
| 1317 | &exynos4_clk_aclk_acp, |
| 1318 | &exynos4_clk_pclk_acp, |
| 1319 | &exynos4_clk_vpllsrc, |
| 1320 | &exynos4_clk_sclk_vpll, |
| 1321 | &exynos4_clk_aclk_200, |
| 1322 | &exynos4_clk_aclk_100, |
| 1323 | &exynos4_clk_aclk_160, |
| 1324 | &exynos4_clk_aclk_133, |
| 1325 | &exynos4_clk_dout_mmc0, |
| 1326 | &exynos4_clk_dout_mmc1, |
| 1327 | &exynos4_clk_dout_mmc2, |
| 1328 | &exynos4_clk_dout_mmc3, |
| 1329 | &exynos4_clk_dout_mmc4, |
| 1330 | &exynos4_clk_mout_mfc0, |
| 1331 | &exynos4_clk_mout_mfc1, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1332 | }; |
| 1333 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1334 | static struct clk *exynos4_clk_cdev[] = { |
| 1335 | &exynos4_clk_pdma0, |
| 1336 | &exynos4_clk_pdma1, |
Boojin Kim | 9ed76e0 | 2012-02-15 13:15:12 +0900 | [diff] [blame] | 1337 | &exynos4_clk_mdma1, |
Tushar Behera | 7902546 | 2012-03-12 21:17:02 -0700 | [diff] [blame] | 1338 | &exynos4_clk_fimd0, |
Thomas Abraham | 66fdb29 | 2011-10-24 14:01:03 +0200 | [diff] [blame] | 1339 | }; |
| 1340 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1341 | static struct clksrc_clk *exynos4_clksrc_cdev[] = { |
| 1342 | &exynos4_clk_sclk_uart0, |
| 1343 | &exynos4_clk_sclk_uart1, |
| 1344 | &exynos4_clk_sclk_uart2, |
| 1345 | &exynos4_clk_sclk_uart3, |
| 1346 | &exynos4_clk_sclk_mmc0, |
| 1347 | &exynos4_clk_sclk_mmc1, |
| 1348 | &exynos4_clk_sclk_mmc2, |
| 1349 | &exynos4_clk_sclk_mmc3, |
| 1350 | &exynos4_clk_sclk_spi0, |
| 1351 | &exynos4_clk_sclk_spi1, |
| 1352 | &exynos4_clk_sclk_spi2, |
Thomas Abraham | 46fda15 | 2012-07-14 10:53:08 +0900 | [diff] [blame] | 1353 | &exynos4_clk_mdout_spi0, |
| 1354 | &exynos4_clk_mdout_spi1, |
| 1355 | &exynos4_clk_mdout_spi2, |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1356 | }; |
| 1357 | |
| 1358 | static struct clk_lookup exynos4_clk_lookup[] = { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1359 | CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &exynos4_clk_sclk_uart0.clk), |
| 1360 | CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk), |
| 1361 | CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk), |
| 1362 | CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk), |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 1363 | CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk), |
| 1364 | CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk), |
| 1365 | CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk), |
| 1366 | CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk), |
Tushar Behera | 7902546 | 2012-03-12 21:17:02 -0700 | [diff] [blame] | 1367 | CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0), |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1368 | CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0), |
| 1369 | CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1), |
Tushar Behera | 8f7b132 | 2011-12-27 14:42:50 +0900 | [diff] [blame] | 1370 | CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos4_clk_mdma1), |
Thomas Abraham | a5238e3 | 2012-07-13 07:15:14 +0900 | [diff] [blame] | 1371 | CLKDEV_INIT("exynos4210-spi.0", "spi_busclk0", &exynos4_clk_sclk_spi0.clk), |
| 1372 | CLKDEV_INIT("exynos4210-spi.1", "spi_busclk0", &exynos4_clk_sclk_spi1.clk), |
| 1373 | CLKDEV_INIT("exynos4210-spi.2", "spi_busclk0", &exynos4_clk_sclk_spi2.clk), |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1374 | }; |
| 1375 | |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1376 | static int xtal_rate; |
| 1377 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1378 | static unsigned long exynos4_fout_apll_get_rate(struct clk *clk) |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1379 | { |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1380 | if (soc_is_exynos4210()) |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1381 | return s5p_get_pll45xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0), |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1382 | pll_4508); |
Changhwan Youn | b88b1cc | 2011-10-04 17:08:56 +0900 | [diff] [blame] | 1383 | else if (soc_is_exynos4212() || soc_is_exynos4412()) |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1384 | return s5p_get_pll35xx(xtal_rate, __raw_readl(EXYNOS4_APLL_CON0)); |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1385 | else |
| 1386 | return 0; |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1387 | } |
| 1388 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1389 | static struct clk_ops exynos4_fout_apll_ops = { |
| 1390 | .get_rate = exynos4_fout_apll_get_rate, |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1391 | }; |
| 1392 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1393 | static u32 exynos4_vpll_div[][8] = { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1394 | { 54000000, 3, 53, 3, 1024, 0, 17, 0 }, |
| 1395 | { 108000000, 3, 53, 2, 1024, 0, 17, 0 }, |
| 1396 | }; |
| 1397 | |
| 1398 | static unsigned long exynos4_vpll_get_rate(struct clk *clk) |
| 1399 | { |
| 1400 | return clk->rate; |
| 1401 | } |
| 1402 | |
| 1403 | static int exynos4_vpll_set_rate(struct clk *clk, unsigned long rate) |
| 1404 | { |
| 1405 | unsigned int vpll_con0, vpll_con1 = 0; |
| 1406 | unsigned int i; |
| 1407 | |
| 1408 | /* Return if nothing changed */ |
| 1409 | if (clk->rate == rate) |
| 1410 | return 0; |
| 1411 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1412 | vpll_con0 = __raw_readl(EXYNOS4_VPLL_CON0); |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1413 | vpll_con0 &= ~(0x1 << 27 | \ |
| 1414 | PLL90XX_MDIV_MASK << PLL46XX_MDIV_SHIFT | \ |
| 1415 | PLL90XX_PDIV_MASK << PLL46XX_PDIV_SHIFT | \ |
| 1416 | PLL90XX_SDIV_MASK << PLL46XX_SDIV_SHIFT); |
| 1417 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1418 | vpll_con1 = __raw_readl(EXYNOS4_VPLL_CON1); |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1419 | vpll_con1 &= ~(PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT | \ |
| 1420 | PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT | \ |
| 1421 | PLL4650C_KDIV_MASK << PLL46XX_KDIV_SHIFT); |
| 1422 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1423 | for (i = 0; i < ARRAY_SIZE(exynos4_vpll_div); i++) { |
| 1424 | if (exynos4_vpll_div[i][0] == rate) { |
| 1425 | vpll_con0 |= exynos4_vpll_div[i][1] << PLL46XX_PDIV_SHIFT; |
| 1426 | vpll_con0 |= exynos4_vpll_div[i][2] << PLL46XX_MDIV_SHIFT; |
| 1427 | vpll_con0 |= exynos4_vpll_div[i][3] << PLL46XX_SDIV_SHIFT; |
| 1428 | vpll_con1 |= exynos4_vpll_div[i][4] << PLL46XX_KDIV_SHIFT; |
| 1429 | vpll_con1 |= exynos4_vpll_div[i][5] << PLL46XX_MFR_SHIFT; |
| 1430 | vpll_con1 |= exynos4_vpll_div[i][6] << PLL46XX_MRR_SHIFT; |
| 1431 | vpll_con0 |= exynos4_vpll_div[i][7] << 27; |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1432 | break; |
| 1433 | } |
| 1434 | } |
| 1435 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1436 | if (i == ARRAY_SIZE(exynos4_vpll_div)) { |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1437 | printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n", |
| 1438 | __func__); |
| 1439 | return -EINVAL; |
| 1440 | } |
| 1441 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1442 | __raw_writel(vpll_con0, EXYNOS4_VPLL_CON0); |
| 1443 | __raw_writel(vpll_con1, EXYNOS4_VPLL_CON1); |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1444 | |
| 1445 | /* Wait for VPLL lock */ |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1446 | while (!(__raw_readl(EXYNOS4_VPLL_CON0) & (1 << PLL46XX_LOCKED_SHIFT))) |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1447 | continue; |
| 1448 | |
| 1449 | clk->rate = rate; |
| 1450 | return 0; |
| 1451 | } |
| 1452 | |
| 1453 | static struct clk_ops exynos4_vpll_ops = { |
| 1454 | .get_rate = exynos4_vpll_get_rate, |
| 1455 | .set_rate = exynos4_vpll_set_rate, |
| 1456 | }; |
| 1457 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1458 | void __init_or_cpufreq exynos4_setup_clocks(void) |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1459 | { |
| 1460 | struct clk *xtal_clk; |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1461 | unsigned long apll = 0; |
| 1462 | unsigned long mpll = 0; |
| 1463 | unsigned long epll = 0; |
| 1464 | unsigned long vpll = 0; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1465 | unsigned long vpllsrc; |
| 1466 | unsigned long xtal; |
| 1467 | unsigned long armclk; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1468 | unsigned long sclk_dmc; |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1469 | unsigned long aclk_200; |
| 1470 | unsigned long aclk_100; |
| 1471 | unsigned long aclk_160; |
| 1472 | unsigned long aclk_133; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1473 | unsigned int ptr; |
| 1474 | |
| 1475 | printk(KERN_DEBUG "%s: registering clocks\n", __func__); |
| 1476 | |
| 1477 | xtal_clk = clk_get(NULL, "xtal"); |
| 1478 | BUG_ON(IS_ERR(xtal_clk)); |
| 1479 | |
| 1480 | xtal = clk_get_rate(xtal_clk); |
Jaecheol Lee | 877d1b5 | 2010-12-23 14:25:31 +0900 | [diff] [blame] | 1481 | |
| 1482 | xtal_rate = xtal; |
| 1483 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1484 | clk_put(xtal_clk); |
| 1485 | |
| 1486 | printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); |
| 1487 | |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1488 | if (soc_is_exynos4210()) { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1489 | apll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_APLL_CON0), |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1490 | pll_4508); |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1491 | mpll = s5p_get_pll45xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0), |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1492 | pll_4508); |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1493 | epll = s5p_get_pll46xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0), |
| 1494 | __raw_readl(EXYNOS4_EPLL_CON1), pll_4600); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1495 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1496 | vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk); |
| 1497 | vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0), |
| 1498 | __raw_readl(EXYNOS4_VPLL_CON1), pll_4650c); |
Changhwan Youn | b88b1cc | 2011-10-04 17:08:56 +0900 | [diff] [blame] | 1499 | } else if (soc_is_exynos4212() || soc_is_exynos4412()) { |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1500 | apll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_APLL_CON0)); |
| 1501 | mpll = s5p_get_pll35xx(xtal, __raw_readl(EXYNOS4_MPLL_CON0)); |
| 1502 | epll = s5p_get_pll36xx(xtal, __raw_readl(EXYNOS4_EPLL_CON0), |
| 1503 | __raw_readl(EXYNOS4_EPLL_CON1)); |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1504 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1505 | vpllsrc = clk_get_rate(&exynos4_clk_vpllsrc.clk); |
| 1506 | vpll = s5p_get_pll36xx(vpllsrc, __raw_readl(EXYNOS4_VPLL_CON0), |
| 1507 | __raw_readl(EXYNOS4_VPLL_CON1)); |
Kukjin Kim | 2bc02c0 | 2011-08-24 17:25:09 +0900 | [diff] [blame] | 1508 | } else { |
| 1509 | /* nothing */ |
| 1510 | } |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1511 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1512 | clk_fout_apll.ops = &exynos4_fout_apll_ops; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1513 | clk_fout_mpll.rate = mpll; |
| 1514 | clk_fout_epll.rate = epll; |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1515 | clk_fout_vpll.ops = &exynos4_vpll_ops; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1516 | clk_fout_vpll.rate = vpll; |
| 1517 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1518 | 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] | 1519 | apll, mpll, epll, vpll); |
| 1520 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1521 | armclk = clk_get_rate(&exynos4_clk_armclk.clk); |
| 1522 | sclk_dmc = clk_get_rate(&exynos4_clk_sclk_dmc.clk); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1523 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1524 | aclk_200 = clk_get_rate(&exynos4_clk_aclk_200.clk); |
| 1525 | aclk_100 = clk_get_rate(&exynos4_clk_aclk_100.clk); |
| 1526 | aclk_160 = clk_get_rate(&exynos4_clk_aclk_160.clk); |
| 1527 | aclk_133 = clk_get_rate(&exynos4_clk_aclk_133.clk); |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1528 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1529 | printk(KERN_INFO "EXYNOS4: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n" |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1530 | "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n", |
| 1531 | armclk, sclk_dmc, aclk_200, |
| 1532 | aclk_100, aclk_160, aclk_133); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1533 | |
| 1534 | clk_f.rate = armclk; |
| 1535 | clk_h.rate = sclk_dmc; |
Jongpill Lee | 228ef98 | 2010-08-18 22:24:53 +0900 | [diff] [blame] | 1536 | clk_p.rate = aclk_100; |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1537 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1538 | for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrcs); ptr++) |
| 1539 | s3c_set_clksrc(&exynos4_clksrcs[ptr], true); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1540 | } |
| 1541 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1542 | static struct clk *exynos4_clks[] __initdata = { |
| 1543 | &exynos4_clk_sclk_hdmi27m, |
| 1544 | &exynos4_clk_sclk_hdmiphy, |
| 1545 | &exynos4_clk_sclk_usbphy0, |
| 1546 | &exynos4_clk_sclk_usbphy1, |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1547 | }; |
| 1548 | |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 1549 | #ifdef CONFIG_PM_SLEEP |
| 1550 | static int exynos4_clock_suspend(void) |
| 1551 | { |
| 1552 | s3c_pm_do_save(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save)); |
| 1553 | return 0; |
| 1554 | } |
| 1555 | |
| 1556 | static void exynos4_clock_resume(void) |
| 1557 | { |
| 1558 | s3c_pm_do_restore_core(exynos4_clock_save, ARRAY_SIZE(exynos4_clock_save)); |
| 1559 | } |
| 1560 | |
| 1561 | #else |
| 1562 | #define exynos4_clock_suspend NULL |
| 1563 | #define exynos4_clock_resume NULL |
| 1564 | #endif |
| 1565 | |
Kukjin Kim | e745e06 | 2012-01-21 10:47:14 +0900 | [diff] [blame] | 1566 | static struct syscore_ops exynos4_clock_syscore_ops = { |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 1567 | .suspend = exynos4_clock_suspend, |
| 1568 | .resume = exynos4_clock_resume, |
| 1569 | }; |
| 1570 | |
Kukjin Kim | b3ed3a1 | 2011-02-14 16:08:04 +0900 | [diff] [blame] | 1571 | void __init exynos4_register_clocks(void) |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1572 | { |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1573 | int ptr; |
| 1574 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1575 | s3c24xx_register_clocks(exynos4_clks, ARRAY_SIZE(exynos4_clks)); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1576 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1577 | for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sysclks); ptr++) |
| 1578 | s3c_register_clksrc(exynos4_sysclks[ptr], 1); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1579 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1580 | for (ptr = 0; ptr < ARRAY_SIZE(exynos4_sclk_tv); ptr++) |
| 1581 | s3c_register_clksrc(exynos4_sclk_tv[ptr], 1); |
Tomasz Stanislawski | fbf0556 | 2011-09-19 16:44:42 +0900 | [diff] [blame] | 1582 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1583 | for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clksrc_cdev); ptr++) |
| 1584 | s3c_register_clksrc(exynos4_clksrc_cdev[ptr], 1); |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1585 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1586 | s3c_register_clksrc(exynos4_clksrcs, ARRAY_SIZE(exynos4_clksrcs)); |
| 1587 | s3c_register_clocks(exynos4_init_clocks_on, ARRAY_SIZE(exynos4_init_clocks_on)); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1588 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1589 | s3c24xx_register_clocks(exynos4_clk_cdev, ARRAY_SIZE(exynos4_clk_cdev)); |
| 1590 | for (ptr = 0; ptr < ARRAY_SIZE(exynos4_clk_cdev); ptr++) |
| 1591 | s3c_disable_clocks(exynos4_clk_cdev[ptr], 1); |
Thomas Abraham | 66fdb29 | 2011-10-24 14:01:03 +0200 | [diff] [blame] | 1592 | |
Kukjin Kim | a855039 | 2012-03-09 14:19:10 -0800 | [diff] [blame] | 1593 | s3c_register_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off)); |
| 1594 | s3c_disable_clocks(exynos4_init_clocks_off, ARRAY_SIZE(exynos4_init_clocks_off)); |
Thomas Abraham | 0cfb26e | 2011-10-24 12:08:42 +0200 | [diff] [blame] | 1595 | clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup)); |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1596 | |
Jonghwan Choi | acd3561 | 2011-08-24 21:52:45 +0900 | [diff] [blame] | 1597 | register_syscore_ops(&exynos4_clock_syscore_ops); |
Boojin Kim | bf856fb | 2011-09-02 09:44:36 +0900 | [diff] [blame] | 1598 | s3c24xx_register_clock(&dummy_apb_pclk); |
| 1599 | |
Changhwan Youn | c8bef14 | 2010-07-27 17:52:39 +0900 | [diff] [blame] | 1600 | s3c_pwmclk_init(); |
| 1601 | } |