clock-sh7724.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. /*
  2. * arch/sh/kernel/cpu/sh4a/clock-sh7724.c
  3. *
  4. * SH7724 clock framework support
  5. *
  6. * Copyright (C) 2009 Magnus Damm
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <linux/init.h>
  22. #include <linux/kernel.h>
  23. #include <linux/io.h>
  24. #include <linux/clk.h>
  25. #include <linux/clkdev.h>
  26. #include <linux/sh_clk.h>
  27. #include <asm/clock.h>
  28. #include <cpu/sh7724.h>
  29. /* SH7724 registers */
  30. #define FRQCRA 0xa4150000
  31. #define FRQCRB 0xa4150004
  32. #define VCLKCR 0xa4150048
  33. #define FCLKACR 0xa4150008
  34. #define FCLKBCR 0xa415000c
  35. #define IRDACLKCR 0xa4150018
  36. #define PLLCR 0xa4150024
  37. #define MSTPCR0 0xa4150030
  38. #define MSTPCR1 0xa4150034
  39. #define MSTPCR2 0xa4150038
  40. #define SPUCLKCR 0xa415003c
  41. #define FLLFRQ 0xa4150050
  42. #define LSTATS 0xa4150060
  43. /* Fixed 32 KHz root clock for RTC and Power Management purposes */
  44. static struct clk r_clk = {
  45. .rate = 32768,
  46. };
  47. /*
  48. * Default rate for the root input clock, reset this with clk_set_rate()
  49. * from the platform code.
  50. */
  51. static struct clk extal_clk = {
  52. .rate = 33333333,
  53. };
  54. /* The fll multiplies the 32khz r_clk, may be used instead of extal */
  55. static unsigned long fll_recalc(struct clk *clk)
  56. {
  57. unsigned long mult = 0;
  58. unsigned long div = 1;
  59. if (__raw_readl(PLLCR) & 0x1000)
  60. mult = __raw_readl(FLLFRQ) & 0x3ff;
  61. if (__raw_readl(FLLFRQ) & 0x4000)
  62. div = 2;
  63. return (clk->parent->rate * mult) / div;
  64. }
  65. static struct sh_clk_ops fll_clk_ops = {
  66. .recalc = fll_recalc,
  67. };
  68. static struct clk fll_clk = {
  69. .ops = &fll_clk_ops,
  70. .parent = &r_clk,
  71. .flags = CLK_ENABLE_ON_INIT,
  72. };
  73. static unsigned long pll_recalc(struct clk *clk)
  74. {
  75. unsigned long mult = 1;
  76. if (__raw_readl(PLLCR) & 0x4000)
  77. mult = (((__raw_readl(FRQCRA) >> 24) & 0x3f) + 1) * 2;
  78. return clk->parent->rate * mult;
  79. }
  80. static struct sh_clk_ops pll_clk_ops = {
  81. .recalc = pll_recalc,
  82. };
  83. static struct clk pll_clk = {
  84. .ops = &pll_clk_ops,
  85. .flags = CLK_ENABLE_ON_INIT,
  86. };
  87. /* A fixed divide-by-3 block use by the div6 clocks */
  88. static unsigned long div3_recalc(struct clk *clk)
  89. {
  90. return clk->parent->rate / 3;
  91. }
  92. static struct sh_clk_ops div3_clk_ops = {
  93. .recalc = div3_recalc,
  94. };
  95. static struct clk div3_clk = {
  96. .ops = &div3_clk_ops,
  97. .parent = &pll_clk,
  98. };
  99. /* External input clock (pin name: FSIMCKA/FSIMCKB/DV_CLKI ) */
  100. struct clk sh7724_fsimcka_clk = {
  101. };
  102. struct clk sh7724_fsimckb_clk = {
  103. };
  104. struct clk sh7724_dv_clki = {
  105. };
  106. static struct clk *main_clks[] = {
  107. &r_clk,
  108. &extal_clk,
  109. &fll_clk,
  110. &pll_clk,
  111. &div3_clk,
  112. &sh7724_fsimcka_clk,
  113. &sh7724_fsimckb_clk,
  114. &sh7724_dv_clki,
  115. };
  116. static void div4_kick(struct clk *clk)
  117. {
  118. unsigned long value;
  119. /* set KICK bit in FRQCRA to update hardware setting */
  120. value = __raw_readl(FRQCRA);
  121. value |= (1 << 31);
  122. __raw_writel(value, FRQCRA);
  123. }
  124. static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 };
  125. static struct clk_div_mult_table div4_div_mult_table = {
  126. .divisors = divisors,
  127. .nr_divisors = ARRAY_SIZE(divisors),
  128. };
  129. static struct clk_div4_table div4_table = {
  130. .div_mult_table = &div4_div_mult_table,
  131. .kick = div4_kick,
  132. };
  133. enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR };
  134. #define DIV4(_reg, _bit, _mask, _flags) \
  135. SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
  136. struct clk div4_clks[DIV4_NR] = {
  137. [DIV4_I] = DIV4(FRQCRA, 20, 0x2f7d, CLK_ENABLE_ON_INIT),
  138. [DIV4_SH] = DIV4(FRQCRA, 12, 0x2f7c, CLK_ENABLE_ON_INIT),
  139. [DIV4_B] = DIV4(FRQCRA, 8, 0x2f7c, CLK_ENABLE_ON_INIT),
  140. [DIV4_P] = DIV4(FRQCRA, 0, 0x2f7c, 0),
  141. [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT),
  142. };
  143. enum { DIV6_V, DIV6_I, DIV6_S, DIV6_FA, DIV6_FB, DIV6_NR };
  144. /* Indices are important - they are the actual src selecting values */
  145. static struct clk *common_parent[] = {
  146. [0] = &div3_clk,
  147. [1] = NULL,
  148. };
  149. static struct clk *vclkcr_parent[8] = {
  150. [0] = &div3_clk,
  151. [2] = &sh7724_dv_clki,
  152. [4] = &extal_clk,
  153. };
  154. static struct clk *fclkacr_parent[] = {
  155. [0] = &div3_clk,
  156. [1] = NULL,
  157. [2] = &sh7724_fsimcka_clk,
  158. [3] = NULL,
  159. };
  160. static struct clk *fclkbcr_parent[] = {
  161. [0] = &div3_clk,
  162. [1] = NULL,
  163. [2] = &sh7724_fsimckb_clk,
  164. [3] = NULL,
  165. };
  166. static struct clk div6_clks[DIV6_NR] = {
  167. [DIV6_V] = SH_CLK_DIV6_EXT(VCLKCR, 0,
  168. vclkcr_parent, ARRAY_SIZE(vclkcr_parent), 12, 3),
  169. [DIV6_I] = SH_CLK_DIV6_EXT(IRDACLKCR, 0,
  170. common_parent, ARRAY_SIZE(common_parent), 6, 1),
  171. [DIV6_S] = SH_CLK_DIV6_EXT(SPUCLKCR, CLK_ENABLE_ON_INIT,
  172. common_parent, ARRAY_SIZE(common_parent), 6, 1),
  173. [DIV6_FA] = SH_CLK_DIV6_EXT(FCLKACR, 0,
  174. fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2),
  175. [DIV6_FB] = SH_CLK_DIV6_EXT(FCLKBCR, 0,
  176. fclkbcr_parent, ARRAY_SIZE(fclkbcr_parent), 6, 2),
  177. };
  178. static struct clk mstp_clks[HWBLK_NR] = {
  179. [HWBLK_TLB] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 31, CLK_ENABLE_ON_INIT),
  180. [HWBLK_IC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 30, CLK_ENABLE_ON_INIT),
  181. [HWBLK_OC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 29, CLK_ENABLE_ON_INIT),
  182. [HWBLK_RSMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 28, CLK_ENABLE_ON_INIT),
  183. [HWBLK_ILMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 27, CLK_ENABLE_ON_INIT),
  184. [HWBLK_L2C] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 26, CLK_ENABLE_ON_INIT),
  185. [HWBLK_FPU] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 24, CLK_ENABLE_ON_INIT),
  186. [HWBLK_INTC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 22, CLK_ENABLE_ON_INIT),
  187. [HWBLK_DMAC0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 21, 0),
  188. [HWBLK_SHYWAY] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 20, CLK_ENABLE_ON_INIT),
  189. [HWBLK_HUDI] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 19, 0),
  190. [HWBLK_UBC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 17, 0),
  191. [HWBLK_TMU0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0),
  192. [HWBLK_CMT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 14, 0),
  193. [HWBLK_RWDT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 13, 0),
  194. [HWBLK_DMAC1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 12, 0),
  195. [HWBLK_TMU1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 10, 0),
  196. [HWBLK_SCIF0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 9, 0),
  197. [HWBLK_SCIF1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 8, 0),
  198. [HWBLK_SCIF2] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 7, 0),
  199. [HWBLK_SCIF3] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 6, 0),
  200. [HWBLK_SCIF4] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 5, 0),
  201. [HWBLK_SCIF5] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 4, 0),
  202. [HWBLK_MSIOF0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 2, 0),
  203. [HWBLK_MSIOF1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 1, 0),
  204. [HWBLK_KEYSC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 12, 0),
  205. [HWBLK_RTC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 11, 0),
  206. [HWBLK_IIC0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 9, 0),
  207. [HWBLK_IIC1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 8, 0),
  208. [HWBLK_MMC] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 29, 0),
  209. [HWBLK_ETHER] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 28, 0),
  210. [HWBLK_ATAPI] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 26, 0),
  211. [HWBLK_TPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 25, 0),
  212. [HWBLK_IRDA] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 24, 0),
  213. [HWBLK_TSIF] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 22, 0),
  214. [HWBLK_USB1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 21, 0),
  215. [HWBLK_USB0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 20, 0),
  216. [HWBLK_2DG] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 19, 0),
  217. [HWBLK_SDHI0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 18, 0),
  218. [HWBLK_SDHI1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 17, 0),
  219. [HWBLK_VEU1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 15, 0),
  220. [HWBLK_CEU1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 13, 0),
  221. [HWBLK_BEU1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 12, 0),
  222. [HWBLK_2DDMAC] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR2, 10, 0),
  223. [HWBLK_SPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 9, 0),
  224. [HWBLK_JPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 6, 0),
  225. [HWBLK_VOU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 5, 0),
  226. [HWBLK_BEU0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 4, 0),
  227. [HWBLK_CEU0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 3, 0),
  228. [HWBLK_VEU0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 2, 0),
  229. [HWBLK_VPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 1, 0),
  230. [HWBLK_LCDC] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 0, 0),
  231. };
  232. static struct clk_lookup lookups[] = {
  233. /* main clocks */
  234. CLKDEV_CON_ID("rclk", &r_clk),
  235. CLKDEV_CON_ID("extal", &extal_clk),
  236. CLKDEV_CON_ID("fll_clk", &fll_clk),
  237. CLKDEV_CON_ID("pll_clk", &pll_clk),
  238. CLKDEV_CON_ID("div3_clk", &div3_clk),
  239. /* DIV4 clocks */
  240. CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
  241. CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_SH]),
  242. CLKDEV_CON_ID("bus_clk", &div4_clks[DIV4_B]),
  243. CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
  244. CLKDEV_CON_ID("vpu_clk", &div4_clks[DIV4_M1]),
  245. /* DIV6 clocks */
  246. CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]),
  247. CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]),
  248. CLKDEV_CON_ID("fsib_clk", &div6_clks[DIV6_FB]),
  249. CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]),
  250. CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]),
  251. /* MSTP clocks */
  252. CLKDEV_CON_ID("tlb0", &mstp_clks[HWBLK_TLB]),
  253. CLKDEV_CON_ID("ic0", &mstp_clks[HWBLK_IC]),
  254. CLKDEV_CON_ID("oc0", &mstp_clks[HWBLK_OC]),
  255. CLKDEV_CON_ID("rs0", &mstp_clks[HWBLK_RSMEM]),
  256. CLKDEV_CON_ID("ilmem0", &mstp_clks[HWBLK_ILMEM]),
  257. CLKDEV_CON_ID("l2c0", &mstp_clks[HWBLK_L2C]),
  258. CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]),
  259. CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]),
  260. CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[HWBLK_DMAC0]),
  261. CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
  262. CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
  263. CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
  264. CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
  265. CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
  266. CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
  267. CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
  268. CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
  269. CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
  270. CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
  271. CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
  272. CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[HWBLK_SCIF3]),
  273. CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[HWBLK_SCIF4]),
  274. CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[HWBLK_SCIF5]),
  275. CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[HWBLK_MSIOF0]),
  276. CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[HWBLK_MSIOF1]),
  277. CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[HWBLK_KEYSC]),
  278. CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
  279. CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC0]),
  280. CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[HWBLK_IIC1]),
  281. CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[HWBLK_MMC]),
  282. CLKDEV_DEV_ID("sh7724-ether.0", &mstp_clks[HWBLK_ETHER]),
  283. CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
  284. CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]),
  285. CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]),
  286. CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]),
  287. CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[HWBLK_USB1]),
  288. CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[HWBLK_USB0]),
  289. CLKDEV_CON_ID("usb1", &mstp_clks[HWBLK_USB1]),
  290. CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB0]),
  291. CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
  292. CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI0]),
  293. CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[HWBLK_SDHI1]),
  294. CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU1]),
  295. CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]),
  296. CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
  297. CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
  298. CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]),
  299. CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
  300. CLKDEV_DEV_ID("sh-vou", &mstp_clks[HWBLK_VOU]),
  301. CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
  302. CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU0]),
  303. CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU0]),
  304. CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
  305. CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[HWBLK_LCDC]),
  306. };
  307. int __init arch_clk_init(void)
  308. {
  309. int k, ret = 0;
  310. /* autodetect extal or fll configuration */
  311. if (__raw_readl(PLLCR) & 0x1000)
  312. pll_clk.parent = &fll_clk;
  313. else
  314. pll_clk.parent = &extal_clk;
  315. for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
  316. ret = clk_register(main_clks[k]);
  317. clkdev_add_table(lookups, ARRAY_SIZE(lookups));
  318. if (!ret)
  319. ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
  320. if (!ret)
  321. ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR);
  322. if (!ret)
  323. ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR);
  324. return ret;
  325. }