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