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