Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 1 | /* |
| 2 | * R8A7740 processor support |
| 3 | * |
| 4 | * Copyright (C) 2011 Renesas Solutions Corp. |
| 5 | * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| 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 as published by |
| 9 | * the Free Software Foundation; either version 2 of the License |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | #include <linux/init.h> |
| 21 | #include <linux/kernel.h> |
| 22 | #include <linux/io.h> |
| 23 | #include <linux/sh_clk.h> |
| 24 | #include <linux/clkdev.h> |
| 25 | #include <mach/common.h> |
| 26 | #include <mach/r8a7740.h> |
| 27 | |
| 28 | /* |
| 29 | * | MDx | XTAL1/EXTAL1 | System | EXTALR | |
| 30 | * Clock |-------+-----------------+ clock | 32.768 | RCLK |
| 31 | * Mode | 2/1/0 | src MHz | source | KHz | source |
| 32 | * -------+-------+-----------------+-----------+--------+---------- |
| 33 | * 0 | 0 0 0 | External 20~50 | XTAL1 | O | EXTALR |
| 34 | * 1 | 0 0 1 | Crystal 20~30 | XTAL1 | O | EXTALR |
| 35 | * 2 | 0 1 0 | External 40~50 | XTAL1 / 2 | O | EXTALR |
| 36 | * 3 | 0 1 1 | Crystal 40~50 | XTAL1 / 2 | O | EXTALR |
| 37 | * 4 | 1 0 0 | External 20~50 | XTAL1 | x | XTAL1 / 1024 |
| 38 | * 5 | 1 0 1 | Crystal 20~30 | XTAL1 | x | XTAL1 / 1024 |
| 39 | * 6 | 1 1 0 | External 40~50 | XTAL1 / 2 | x | XTAL1 / 2048 |
| 40 | * 7 | 1 1 1 | Crystal 40~50 | XTAL1 / 2 | x | XTAL1 / 2048 |
| 41 | */ |
| 42 | |
| 43 | /* CPG registers */ |
Arnd Bergmann | 0a4b04d | 2012-09-14 20:08:08 +0000 | [diff] [blame] | 44 | #define FRQCRA IOMEM(0xe6150000) |
| 45 | #define FRQCRB IOMEM(0xe6150004) |
| 46 | #define VCLKCR1 IOMEM(0xE6150008) |
| 47 | #define VCLKCR2 IOMEM(0xE615000c) |
| 48 | #define FRQCRC IOMEM(0xe61500e0) |
| 49 | #define FSIACKCR IOMEM(0xe6150018) |
| 50 | #define PLLC01CR IOMEM(0xe6150028) |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 51 | |
Arnd Bergmann | 0a4b04d | 2012-09-14 20:08:08 +0000 | [diff] [blame] | 52 | #define SUBCKCR IOMEM(0xe6150080) |
| 53 | #define USBCKCR IOMEM(0xe615008c) |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 54 | |
Arnd Bergmann | 0a4b04d | 2012-09-14 20:08:08 +0000 | [diff] [blame] | 55 | #define MSTPSR0 IOMEM(0xe6150030) |
| 56 | #define MSTPSR1 IOMEM(0xe6150038) |
| 57 | #define MSTPSR2 IOMEM(0xe6150040) |
| 58 | #define MSTPSR3 IOMEM(0xe6150048) |
| 59 | #define MSTPSR4 IOMEM(0xe615004c) |
| 60 | #define FSIBCKCR IOMEM(0xe6150090) |
| 61 | #define HDMICKCR IOMEM(0xe6150094) |
| 62 | #define SMSTPCR0 IOMEM(0xe6150130) |
| 63 | #define SMSTPCR1 IOMEM(0xe6150134) |
| 64 | #define SMSTPCR2 IOMEM(0xe6150138) |
| 65 | #define SMSTPCR3 IOMEM(0xe615013c) |
| 66 | #define SMSTPCR4 IOMEM(0xe6150140) |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 67 | |
| 68 | /* Fixed 32 KHz root clock from EXTALR pin */ |
| 69 | static struct clk extalr_clk = { |
| 70 | .rate = 32768, |
| 71 | }; |
| 72 | |
| 73 | /* |
| 74 | * 25MHz default rate for the EXTAL1 root input clock. |
| 75 | * If needed, reset this with clk_set_rate() from the platform code. |
| 76 | */ |
| 77 | static struct clk extal1_clk = { |
| 78 | .rate = 25000000, |
| 79 | }; |
| 80 | |
| 81 | /* |
| 82 | * 48MHz default rate for the EXTAL2 root input clock. |
| 83 | * If needed, reset this with clk_set_rate() from the platform code. |
| 84 | */ |
| 85 | static struct clk extal2_clk = { |
| 86 | .rate = 48000000, |
| 87 | }; |
| 88 | |
| 89 | /* |
| 90 | * 27MHz default rate for the DV_CLKI root input clock. |
| 91 | * If needed, reset this with clk_set_rate() from the platform code. |
| 92 | */ |
| 93 | static struct clk dv_clk = { |
| 94 | .rate = 27000000, |
| 95 | }; |
| 96 | |
| 97 | static unsigned long div_recalc(struct clk *clk) |
| 98 | { |
| 99 | return clk->parent->rate / (int)(clk->priv); |
| 100 | } |
| 101 | |
Magnus Damm | d9f8670 | 2012-02-29 22:17:00 +0900 | [diff] [blame] | 102 | static struct sh_clk_ops div_clk_ops = { |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 103 | .recalc = div_recalc, |
| 104 | }; |
| 105 | |
| 106 | /* extal1 / 2 */ |
| 107 | static struct clk extal1_div2_clk = { |
| 108 | .ops = &div_clk_ops, |
| 109 | .priv = (void *)2, |
| 110 | .parent = &extal1_clk, |
| 111 | }; |
| 112 | |
| 113 | /* extal1 / 1024 */ |
| 114 | static struct clk extal1_div1024_clk = { |
| 115 | .ops = &div_clk_ops, |
| 116 | .priv = (void *)1024, |
| 117 | .parent = &extal1_clk, |
| 118 | }; |
| 119 | |
| 120 | /* extal1 / 2 / 1024 */ |
| 121 | static struct clk extal1_div2048_clk = { |
| 122 | .ops = &div_clk_ops, |
| 123 | .priv = (void *)1024, |
| 124 | .parent = &extal1_div2_clk, |
| 125 | }; |
| 126 | |
| 127 | /* extal2 / 2 */ |
| 128 | static struct clk extal2_div2_clk = { |
| 129 | .ops = &div_clk_ops, |
| 130 | .priv = (void *)2, |
| 131 | .parent = &extal2_clk, |
| 132 | }; |
| 133 | |
Magnus Damm | d9f8670 | 2012-02-29 22:17:00 +0900 | [diff] [blame] | 134 | static struct sh_clk_ops followparent_clk_ops = { |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 135 | .recalc = followparent_recalc, |
| 136 | }; |
| 137 | |
| 138 | /* Main clock */ |
| 139 | static struct clk system_clk = { |
| 140 | .ops = &followparent_clk_ops, |
| 141 | }; |
| 142 | |
| 143 | static struct clk system_div2_clk = { |
| 144 | .ops = &div_clk_ops, |
| 145 | .priv = (void *)2, |
| 146 | .parent = &system_clk, |
| 147 | }; |
| 148 | |
| 149 | /* r_clk */ |
| 150 | static struct clk r_clk = { |
| 151 | .ops = &followparent_clk_ops, |
| 152 | }; |
| 153 | |
| 154 | /* PLLC0/PLLC1 */ |
| 155 | static unsigned long pllc01_recalc(struct clk *clk) |
| 156 | { |
| 157 | unsigned long mult = 1; |
| 158 | |
| 159 | if (__raw_readl(PLLC01CR) & (1 << 14)) |
| 160 | mult = ((__raw_readl(clk->enable_reg) >> 24) & 0x7f) + 1; |
| 161 | |
| 162 | return clk->parent->rate * mult; |
| 163 | } |
| 164 | |
Magnus Damm | d9f8670 | 2012-02-29 22:17:00 +0900 | [diff] [blame] | 165 | static struct sh_clk_ops pllc01_clk_ops = { |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 166 | .recalc = pllc01_recalc, |
| 167 | }; |
| 168 | |
| 169 | static struct clk pllc0_clk = { |
| 170 | .ops = &pllc01_clk_ops, |
| 171 | .flags = CLK_ENABLE_ON_INIT, |
| 172 | .parent = &system_clk, |
| 173 | .enable_reg = (void __iomem *)FRQCRC, |
| 174 | }; |
| 175 | |
| 176 | static struct clk pllc1_clk = { |
| 177 | .ops = &pllc01_clk_ops, |
| 178 | .flags = CLK_ENABLE_ON_INIT, |
| 179 | .parent = &system_div2_clk, |
| 180 | .enable_reg = (void __iomem *)FRQCRA, |
| 181 | }; |
| 182 | |
| 183 | /* PLLC1 / 2 */ |
| 184 | static struct clk pllc1_div2_clk = { |
| 185 | .ops = &div_clk_ops, |
| 186 | .priv = (void *)2, |
| 187 | .parent = &pllc1_clk, |
| 188 | }; |
| 189 | |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 190 | /* USB clock */ |
Kuninori Morimoto | 0a38429 | 2012-10-29 01:14:41 -0700 | [diff] [blame^] | 191 | /* |
| 192 | * USBCKCR is controlling usb24 clock |
| 193 | * bit[7] : parent clock |
| 194 | * bit[6] : clock divide rate |
| 195 | * And this bit[7] is used as a "usb24s" from other devices. |
| 196 | * (Video clock / Sub clock / SPU clock) |
| 197 | * You can controll this clock as a below. |
| 198 | * |
| 199 | * struct clk *usb24 = clk_get(dev, "usb24"); |
| 200 | * struct clk *usb24s = clk_get(NULL, "usb24s"); |
| 201 | * struct clk *system = clk_get(NULL, "system_clk"); |
| 202 | * int rate = clk_get_rate(system); |
| 203 | * |
| 204 | * clk_set_parent(usb24s, system); // for bit[7] |
| 205 | * clk_set_rate(usb24, rate / 2); // for bit[6] |
| 206 | */ |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 207 | static struct clk *usb24s_parents[] = { |
| 208 | [0] = &system_clk, |
| 209 | [1] = &extal2_clk |
| 210 | }; |
| 211 | |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 212 | static int usb24s_enable(struct clk *clk) |
| 213 | { |
| 214 | __raw_writel(__raw_readl(USBCKCR) & ~(1 << 8), USBCKCR); |
| 215 | |
| 216 | return 0; |
| 217 | } |
| 218 | |
| 219 | static void usb24s_disable(struct clk *clk) |
| 220 | { |
| 221 | __raw_writel(__raw_readl(USBCKCR) | (1 << 8), USBCKCR); |
| 222 | } |
| 223 | |
| 224 | static int usb24s_set_parent(struct clk *clk, struct clk *parent) |
| 225 | { |
| 226 | int i, ret; |
| 227 | u32 val; |
| 228 | |
| 229 | if (!clk->parent_table || !clk->parent_num) |
| 230 | return -EINVAL; |
| 231 | |
| 232 | /* Search the parent */ |
| 233 | for (i = 0; i < clk->parent_num; i++) |
| 234 | if (clk->parent_table[i] == parent) |
| 235 | break; |
| 236 | |
| 237 | if (i == clk->parent_num) |
| 238 | return -ENODEV; |
| 239 | |
| 240 | ret = clk_reparent(clk, parent); |
| 241 | if (ret < 0) |
| 242 | return ret; |
| 243 | |
| 244 | val = __raw_readl(USBCKCR); |
| 245 | val &= ~(1 << 7); |
| 246 | val |= i << 7; |
| 247 | __raw_writel(val, USBCKCR); |
| 248 | |
| 249 | return 0; |
| 250 | } |
| 251 | |
| 252 | static struct sh_clk_ops usb24s_clk_ops = { |
Kuninori Morimoto | c824108 | 2012-05-06 18:12:41 -0700 | [diff] [blame] | 253 | .recalc = followparent_recalc, |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 254 | .enable = usb24s_enable, |
| 255 | .disable = usb24s_disable, |
| 256 | .set_parent = usb24s_set_parent, |
| 257 | }; |
| 258 | |
| 259 | static struct clk usb24s_clk = { |
| 260 | .ops = &usb24s_clk_ops, |
| 261 | .parent_table = usb24s_parents, |
| 262 | .parent_num = ARRAY_SIZE(usb24s_parents), |
| 263 | .parent = &system_clk, |
| 264 | }; |
| 265 | |
| 266 | static unsigned long usb24_recalc(struct clk *clk) |
| 267 | { |
| 268 | return clk->parent->rate / |
| 269 | ((__raw_readl(USBCKCR) & (1 << 6)) ? 1 : 2); |
| 270 | }; |
| 271 | |
| 272 | static int usb24_set_rate(struct clk *clk, unsigned long rate) |
| 273 | { |
| 274 | u32 val; |
| 275 | |
| 276 | /* closer to which ? parent->rate or parent->rate/2 */ |
| 277 | val = __raw_readl(USBCKCR); |
| 278 | val &= ~(1 << 6); |
| 279 | val |= (rate > (clk->parent->rate / 4) * 3) << 6; |
| 280 | __raw_writel(val, USBCKCR); |
| 281 | |
| 282 | return 0; |
| 283 | } |
| 284 | |
| 285 | static struct sh_clk_ops usb24_clk_ops = { |
| 286 | .recalc = usb24_recalc, |
| 287 | .set_rate = usb24_set_rate, |
| 288 | }; |
| 289 | |
| 290 | static struct clk usb24_clk = { |
| 291 | .ops = &usb24_clk_ops, |
| 292 | .parent = &usb24s_clk, |
| 293 | }; |
| 294 | |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 295 | /* External FSIACK/FSIBCK clock */ |
| 296 | static struct clk fsiack_clk = { |
| 297 | }; |
| 298 | |
| 299 | static struct clk fsibck_clk = { |
| 300 | }; |
| 301 | |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 302 | struct clk *main_clks[] = { |
| 303 | &extalr_clk, |
| 304 | &extal1_clk, |
| 305 | &extal2_clk, |
| 306 | &extal1_div2_clk, |
| 307 | &extal1_div1024_clk, |
| 308 | &extal1_div2048_clk, |
| 309 | &extal2_div2_clk, |
| 310 | &dv_clk, |
| 311 | &system_clk, |
| 312 | &system_div2_clk, |
| 313 | &r_clk, |
| 314 | &pllc0_clk, |
| 315 | &pllc1_clk, |
| 316 | &pllc1_div2_clk, |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 317 | &usb24s_clk, |
| 318 | &usb24_clk, |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 319 | &fsiack_clk, |
| 320 | &fsibck_clk, |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 321 | }; |
| 322 | |
| 323 | static void div4_kick(struct clk *clk) |
| 324 | { |
| 325 | unsigned long value; |
| 326 | |
| 327 | /* set KICK bit in FRQCRB to update hardware setting */ |
| 328 | value = __raw_readl(FRQCRB); |
| 329 | value |= (1 << 31); |
| 330 | __raw_writel(value, FRQCRB); |
| 331 | } |
| 332 | |
| 333 | static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, |
| 334 | 24, 32, 36, 48, 0, 72, 96, 0 }; |
| 335 | |
| 336 | static struct clk_div_mult_table div4_div_mult_table = { |
| 337 | .divisors = divisors, |
| 338 | .nr_divisors = ARRAY_SIZE(divisors), |
| 339 | }; |
| 340 | |
| 341 | static struct clk_div4_table div4_table = { |
| 342 | .div_mult_table = &div4_div_mult_table, |
| 343 | .kick = div4_kick, |
| 344 | }; |
| 345 | |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 346 | /* DIV6 reparent */ |
| 347 | enum { |
| 348 | DIV6_HDMI, |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 349 | DIV6_VCLK1, DIV6_VCLK2, |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 350 | DIV6_FSIA, DIV6_FSIB, |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 351 | DIV6_REPARENT_NR, |
| 352 | }; |
| 353 | |
| 354 | static struct clk *hdmi_parent[] = { |
| 355 | [0] = &pllc1_div2_clk, |
| 356 | [1] = &system_clk, |
| 357 | [2] = &dv_clk |
| 358 | }; |
| 359 | |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 360 | static struct clk *vclk_parents[8] = { |
| 361 | [0] = &pllc1_div2_clk, |
| 362 | [2] = &dv_clk, |
| 363 | [3] = &usb24s_clk, |
| 364 | [4] = &extal1_div2_clk, |
| 365 | [5] = &extalr_clk, |
| 366 | }; |
| 367 | |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 368 | static struct clk *fsia_parents[] = { |
| 369 | [0] = &pllc1_div2_clk, |
| 370 | [1] = &fsiack_clk, /* external clock */ |
| 371 | }; |
| 372 | |
| 373 | static struct clk *fsib_parents[] = { |
| 374 | [0] = &pllc1_div2_clk, |
| 375 | [1] = &fsibck_clk, /* external clock */ |
| 376 | }; |
| 377 | |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 378 | static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { |
| 379 | [DIV6_HDMI] = SH_CLK_DIV6_EXT(HDMICKCR, 0, |
| 380 | hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2), |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 381 | [DIV6_VCLK1] = SH_CLK_DIV6_EXT(VCLKCR1, 0, |
| 382 | vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3), |
| 383 | [DIV6_VCLK2] = SH_CLK_DIV6_EXT(VCLKCR2, 0, |
| 384 | vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3), |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 385 | [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0, |
| 386 | fsia_parents, ARRAY_SIZE(fsia_parents), 6, 2), |
| 387 | [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0, |
| 388 | fsib_parents, ARRAY_SIZE(fsib_parents), 6, 2), |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 389 | }; |
| 390 | |
| 391 | /* HDMI1/2 clock */ |
| 392 | static unsigned long hdmi12_recalc(struct clk *clk) |
| 393 | { |
| 394 | u32 val = __raw_readl(HDMICKCR); |
| 395 | int shift = (int)clk->priv; |
| 396 | |
| 397 | val >>= shift; |
| 398 | val &= 0x3; |
| 399 | |
| 400 | return clk->parent->rate / (1 << val); |
| 401 | }; |
| 402 | |
| 403 | static int hdmi12_set_rate(struct clk *clk, unsigned long rate) |
| 404 | { |
| 405 | u32 val, mask; |
| 406 | int i, shift; |
| 407 | |
| 408 | for (i = 0; i < 3; i++) |
| 409 | if (rate == clk->parent->rate / (1 << i)) |
| 410 | goto find; |
| 411 | return -ENODEV; |
| 412 | |
| 413 | find: |
| 414 | shift = (int)clk->priv; |
| 415 | |
| 416 | val = __raw_readl(HDMICKCR); |
| 417 | mask = ~(0x3 << shift); |
| 418 | val = (val & mask) | i << shift; |
| 419 | __raw_writel(val, HDMICKCR); |
| 420 | |
| 421 | return 0; |
| 422 | }; |
| 423 | |
| 424 | static struct sh_clk_ops hdmi12_clk_ops = { |
| 425 | .recalc = hdmi12_recalc, |
| 426 | .set_rate = hdmi12_set_rate, |
| 427 | }; |
| 428 | |
| 429 | static struct clk hdmi1_clk = { |
| 430 | .ops = &hdmi12_clk_ops, |
| 431 | .priv = (void *)9, |
| 432 | .parent = &div6_reparent_clks[DIV6_HDMI], /* late install */ |
| 433 | }; |
| 434 | |
| 435 | static struct clk hdmi2_clk = { |
| 436 | .ops = &hdmi12_clk_ops, |
| 437 | .priv = (void *)11, |
| 438 | .parent = &div6_reparent_clks[DIV6_HDMI], /* late install */ |
| 439 | }; |
| 440 | |
| 441 | static struct clk *late_main_clks[] = { |
| 442 | &hdmi1_clk, |
| 443 | &hdmi2_clk, |
| 444 | }; |
| 445 | |
| 446 | /* MSTP */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 447 | enum { |
| 448 | DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP, |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 449 | DIV4_HPP, DIV4_USBP, DIV4_S, DIV4_ZB, DIV4_M3, DIV4_CP, |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 450 | DIV4_NR |
| 451 | }; |
| 452 | |
| 453 | struct clk div4_clks[DIV4_NR] = { |
| 454 | [DIV4_I] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT), |
| 455 | [DIV4_ZG] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT), |
| 456 | [DIV4_B] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT), |
| 457 | [DIV4_M1] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 4, 0x6fff, CLK_ENABLE_ON_INIT), |
| 458 | [DIV4_HP] = SH_CLK_DIV4(&pllc1_clk, FRQCRB, 4, 0x6fff, 0), |
| 459 | [DIV4_HPP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 20, 0x6fff, 0), |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 460 | [DIV4_USBP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 16, 0x6fff, 0), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 461 | [DIV4_S] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 12, 0x6fff, 0), |
| 462 | [DIV4_ZB] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 8, 0x6fff, 0), |
| 463 | [DIV4_M3] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 4, 0x6fff, 0), |
| 464 | [DIV4_CP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 0, 0x6fff, 0), |
| 465 | }; |
| 466 | |
| 467 | enum { |
| 468 | DIV6_SUB, |
| 469 | DIV6_NR |
| 470 | }; |
| 471 | |
| 472 | static struct clk div6_clks[DIV6_NR] = { |
| 473 | [DIV6_SUB] = SH_CLK_DIV6(&pllc1_div2_clk, SUBCKCR, 0), |
| 474 | }; |
| 475 | |
| 476 | enum { |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 477 | MSTP128, MSTP127, MSTP125, |
Kuninori Morimoto | 665ccfa | 2011-11-10 18:47:16 -0800 | [diff] [blame] | 478 | MSTP116, MSTP111, MSTP100, MSTP117, |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 479 | |
| 480 | MSTP230, |
| 481 | MSTP222, |
Kuninori Morimoto | dbf382e | 2012-06-25 03:37:10 -0700 | [diff] [blame] | 482 | MSTP218, MSTP217, MSTP216, MSTP214, |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 483 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
| 484 | |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 485 | MSTP329, MSTP328, MSTP323, MSTP320, |
Kuninori Morimoto | f2c2d7e | 2012-04-24 02:08:29 -0700 | [diff] [blame] | 486 | MSTP314, MSTP313, MSTP312, |
Kuninori Morimoto | 9c18f23 | 2012-05-06 22:58:41 -0700 | [diff] [blame] | 487 | MSTP309, |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 488 | |
Kuninori Morimoto | 19ad322 | 2012-04-24 02:08:11 -0700 | [diff] [blame] | 489 | MSTP416, MSTP415, MSTP407, MSTP406, |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 490 | |
| 491 | MSTP_NR |
| 492 | }; |
| 493 | |
| 494 | static struct clk mstp_clks[MSTP_NR] = { |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 495 | [MSTP128] = SH_CLK_MSTP32(&div4_clks[DIV4_S], SMSTPCR1, 28, 0), /* CEU21 */ |
| 496 | [MSTP127] = SH_CLK_MSTP32(&div4_clks[DIV4_S], SMSTPCR1, 27, 0), /* CEU20 */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 497 | [MSTP125] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ |
Kuninori Morimoto | 665ccfa | 2011-11-10 18:47:16 -0800 | [diff] [blame] | 498 | [MSTP117] = SH_CLK_MSTP32(&div4_clks[DIV4_B], SMSTPCR1, 17, 0), /* LCDC1 */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 499 | [MSTP116] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */ |
| 500 | [MSTP111] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 11, 0), /* TMU1 */ |
Kuninori Morimoto | 665ccfa | 2011-11-10 18:47:16 -0800 | [diff] [blame] | 501 | [MSTP100] = SH_CLK_MSTP32(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 502 | |
| 503 | [MSTP230] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 30, 0), /* SCIFA6 */ |
| 504 | [MSTP222] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 22, 0), /* SCIFA7 */ |
Kuninori Morimoto | 643c330 | 2012-06-25 03:36:49 -0700 | [diff] [blame] | 505 | [MSTP218] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ |
| 506 | [MSTP217] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ |
| 507 | [MSTP216] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ |
Kuninori Morimoto | dbf382e | 2012-06-25 03:37:10 -0700 | [diff] [blame] | 508 | [MSTP214] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 509 | [MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
| 510 | [MSTP206] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ |
| 511 | [MSTP204] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ |
| 512 | [MSTP203] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ |
| 513 | [MSTP202] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ |
| 514 | [MSTP201] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ |
| 515 | [MSTP200] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ |
| 516 | |
| 517 | [MSTP329] = SH_CLK_MSTP32(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ |
Kuninori Morimoto | 7ee8948 | 2012-04-01 18:46:09 -0700 | [diff] [blame] | 518 | [MSTP328] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /* FSI */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 519 | [MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 520 | [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 20, 0), /* USBF */ |
Kuninori Morimoto | 19ad322 | 2012-04-24 02:08:11 -0700 | [diff] [blame] | 521 | [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */ |
| 522 | [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */ |
Kuninori Morimoto | f2c2d7e | 2012-04-24 02:08:29 -0700 | [diff] [blame] | 523 | [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */ |
Kuninori Morimoto | 9c18f23 | 2012-05-06 22:58:41 -0700 | [diff] [blame] | 524 | [MSTP309] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 9, 0), /* GEther */ |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 525 | |
| 526 | [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */ |
Kuninori Morimoto | 19ad322 | 2012-04-24 02:08:11 -0700 | [diff] [blame] | 527 | [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */ |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 528 | [MSTP407] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-Func */ |
| 529 | [MSTP406] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 6, 0), /* USB Phy */ |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 530 | }; |
| 531 | |
| 532 | static struct clk_lookup lookups[] = { |
| 533 | /* main clocks */ |
| 534 | CLKDEV_CON_ID("extalr", &extalr_clk), |
| 535 | CLKDEV_CON_ID("extal1", &extal1_clk), |
| 536 | CLKDEV_CON_ID("extal2", &extal2_clk), |
| 537 | CLKDEV_CON_ID("extal1_div2", &extal1_div2_clk), |
| 538 | CLKDEV_CON_ID("extal1_div1024", &extal1_div1024_clk), |
| 539 | CLKDEV_CON_ID("extal1_div2048", &extal1_div2048_clk), |
| 540 | CLKDEV_CON_ID("extal2_div2", &extal2_div2_clk), |
| 541 | CLKDEV_CON_ID("dv_clk", &dv_clk), |
| 542 | CLKDEV_CON_ID("system_clk", &system_clk), |
| 543 | CLKDEV_CON_ID("system_div2_clk", &system_div2_clk), |
| 544 | CLKDEV_CON_ID("r_clk", &r_clk), |
| 545 | CLKDEV_CON_ID("pllc0_clk", &pllc0_clk), |
| 546 | CLKDEV_CON_ID("pllc1_clk", &pllc1_clk), |
| 547 | CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk), |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 548 | CLKDEV_CON_ID("usb24s", &usb24s_clk), |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 549 | CLKDEV_CON_ID("hdmi1", &hdmi1_clk), |
| 550 | CLKDEV_CON_ID("hdmi2", &hdmi2_clk), |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 551 | CLKDEV_CON_ID("video1", &div6_reparent_clks[DIV6_VCLK1]), |
| 552 | CLKDEV_CON_ID("video2", &div6_reparent_clks[DIV6_VCLK2]), |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 553 | CLKDEV_CON_ID("fsiack", &fsiack_clk), |
| 554 | CLKDEV_CON_ID("fsibck", &fsibck_clk), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 555 | |
| 556 | /* DIV4 clocks */ |
| 557 | CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]), |
| 558 | CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]), |
| 559 | CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]), |
| 560 | CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]), |
| 561 | CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]), |
| 562 | CLKDEV_CON_ID("hpp_clk", &div4_clks[DIV4_HPP]), |
| 563 | CLKDEV_CON_ID("s_clk", &div4_clks[DIV4_S]), |
| 564 | CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]), |
| 565 | CLKDEV_CON_ID("m3_clk", &div4_clks[DIV4_M3]), |
| 566 | CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]), |
| 567 | |
| 568 | /* DIV6 clocks */ |
| 569 | CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]), |
| 570 | |
| 571 | /* MSTP32 clocks */ |
Kuninori Morimoto | 665ccfa | 2011-11-10 18:47:16 -0800 | [diff] [blame] | 572 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 573 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP111]), |
| 574 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), |
Kuninori Morimoto | 665ccfa | 2011-11-10 18:47:16 -0800 | [diff] [blame] | 575 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 576 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), |
Kuninori Morimoto | ad9f172 | 2012-06-12 02:36:39 -0700 | [diff] [blame] | 577 | CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), |
| 578 | CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 579 | |
| 580 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), |
| 581 | CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), |
| 582 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), |
| 583 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), |
| 584 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), |
| 585 | CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), |
| 586 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), |
Kuninori Morimoto | dbf382e | 2012-06-25 03:37:10 -0700 | [diff] [blame] | 587 | CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), |
Kuninori Morimoto | 643c330 | 2012-06-25 03:36:49 -0700 | [diff] [blame] | 588 | CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), |
| 589 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), |
| 590 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 591 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP222]), |
| 592 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]), |
| 593 | |
| 594 | CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), |
Kuninori Morimoto | 7ee8948 | 2012-04-01 18:46:09 -0700 | [diff] [blame] | 595 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 596 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 597 | CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]), |
Kuninori Morimoto | 19ad322 | 2012-04-24 02:08:11 -0700 | [diff] [blame] | 598 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), |
| 599 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), |
Kuninori Morimoto | f2c2d7e | 2012-04-24 02:08:29 -0700 | [diff] [blame] | 600 | CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), |
Kuninori Morimoto | 9c18f23 | 2012-05-06 22:58:41 -0700 | [diff] [blame] | 601 | CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP309]), |
Kuninori Morimoto | 19ad322 | 2012-04-24 02:08:11 -0700 | [diff] [blame] | 602 | |
| 603 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), |
Kuninori Morimoto | fcca3f0 | 2012-04-24 02:07:47 -0700 | [diff] [blame] | 604 | |
| 605 | /* ICK */ |
| 606 | CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]), |
| 607 | CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]), |
| 608 | CLKDEV_ICK_ID("phy", "renesas_usbhs", &mstp_clks[MSTP406]), |
| 609 | CLKDEV_ICK_ID("pci", "renesas_usbhs", &div4_clks[DIV4_USBP]), |
| 610 | CLKDEV_ICK_ID("usb24", "renesas_usbhs", &usb24_clk), |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 611 | CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), |
Kuninori Morimoto | 69efac9 | 2012-06-12 02:36:58 -0700 | [diff] [blame] | 612 | |
| 613 | CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), |
| 614 | CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 615 | }; |
| 616 | |
| 617 | void __init r8a7740_clock_init(u8 md_ck) |
| 618 | { |
| 619 | int k, ret = 0; |
| 620 | |
| 621 | /* detect system clock parent */ |
| 622 | if (md_ck & MD_CK1) |
| 623 | system_clk.parent = &extal1_div2_clk; |
| 624 | else |
| 625 | system_clk.parent = &extal1_clk; |
| 626 | |
| 627 | /* detect RCLK parent */ |
| 628 | switch (md_ck & (MD_CK2 | MD_CK1)) { |
| 629 | case MD_CK2 | MD_CK1: |
| 630 | r_clk.parent = &extal1_div2048_clk; |
| 631 | break; |
| 632 | case MD_CK2: |
| 633 | r_clk.parent = &extal1_div1024_clk; |
| 634 | break; |
| 635 | case MD_CK1: |
| 636 | default: |
| 637 | r_clk.parent = &extalr_clk; |
| 638 | break; |
| 639 | } |
| 640 | |
| 641 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) |
| 642 | ret = clk_register(main_clks[k]); |
| 643 | |
| 644 | if (!ret) |
| 645 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); |
| 646 | |
| 647 | if (!ret) |
| 648 | ret = sh_clk_div6_register(div6_clks, DIV6_NR); |
| 649 | |
| 650 | if (!ret) |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 651 | ret = sh_clk_div6_reparent_register(div6_reparent_clks, |
| 652 | DIV6_REPARENT_NR); |
| 653 | |
| 654 | if (!ret) |
Nobuhiro Iwamatsu | 64e9de2 | 2012-06-27 09:59:00 +0900 | [diff] [blame] | 655 | ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 656 | |
Kuninori Morimoto | c6750ac | 2012-06-12 02:35:36 -0700 | [diff] [blame] | 657 | for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++) |
| 658 | ret = clk_register(late_main_clks[k]); |
| 659 | |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 660 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 661 | |
| 662 | if (!ret) |
Magnus Damm | 6b6a4c0 | 2012-02-29 21:41:30 +0900 | [diff] [blame] | 663 | shmobile_clk_init(); |
Kuninori Morimoto | 6c01ba4 | 2011-11-10 18:45:52 -0800 | [diff] [blame] | 664 | else |
| 665 | panic("failed to setup r8a7740 clocks\n"); |
| 666 | } |