clk-sunxi.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. /*
  2. * Copyright 2013 Emilio López
  3. *
  4. * Emilio López <emilio@elopez.com.ar>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  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. #include <linux/clk-provider.h>
  17. #include <linux/clkdev.h>
  18. #include <linux/of.h>
  19. #include <linux/of_address.h>
  20. #include "clk-factors.h"
  21. static DEFINE_SPINLOCK(clk_lock);
  22. /**
  23. * sun4i_osc_clk_setup() - Setup function for gatable oscillator
  24. */
  25. #define SUNXI_OSC24M_GATE 0
  26. static void __init sun4i_osc_clk_setup(struct device_node *node)
  27. {
  28. struct clk *clk;
  29. struct clk_fixed_rate *fixed;
  30. struct clk_gate *gate;
  31. const char *clk_name = node->name;
  32. u32 rate;
  33. /* allocate fixed-rate and gate clock structs */
  34. fixed = kzalloc(sizeof(struct clk_fixed_rate), GFP_KERNEL);
  35. if (!fixed)
  36. return;
  37. gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL);
  38. if (!gate) {
  39. kfree(fixed);
  40. return;
  41. }
  42. if (of_property_read_u32(node, "clock-frequency", &rate))
  43. return;
  44. /* set up gate and fixed rate properties */
  45. gate->reg = of_iomap(node, 0);
  46. gate->bit_idx = SUNXI_OSC24M_GATE;
  47. gate->lock = &clk_lock;
  48. fixed->fixed_rate = rate;
  49. clk = clk_register_composite(NULL, clk_name,
  50. NULL, 0,
  51. NULL, NULL,
  52. &fixed->hw, &clk_fixed_rate_ops,
  53. &gate->hw, &clk_gate_ops,
  54. CLK_IS_ROOT);
  55. if (!IS_ERR(clk)) {
  56. of_clk_add_provider(node, of_clk_src_simple_get, clk);
  57. clk_register_clkdev(clk, clk_name, NULL);
  58. }
  59. }
  60. CLK_OF_DECLARE(sun4i_osc, "allwinner,sun4i-osc-clk", sun4i_osc_clk_setup);
  61. /**
  62. * sun4i_get_pll1_factors() - calculates n, k, m, p factors for PLL1
  63. * PLL1 rate is calculated as follows
  64. * rate = (parent_rate * n * (k + 1) >> p) / (m + 1);
  65. * parent_rate is always 24Mhz
  66. */
  67. static void sun4i_get_pll1_factors(u32 *freq, u32 parent_rate,
  68. u8 *n, u8 *k, u8 *m, u8 *p)
  69. {
  70. u8 div;
  71. /* Normalize value to a 6M multiple */
  72. div = *freq / 6000000;
  73. *freq = 6000000 * div;
  74. /* we were called to round the frequency, we can now return */
  75. if (n == NULL)
  76. return;
  77. /* m is always zero for pll1 */
  78. *m = 0;
  79. /* k is 1 only on these cases */
  80. if (*freq >= 768000000 || *freq == 42000000 || *freq == 54000000)
  81. *k = 1;
  82. else
  83. *k = 0;
  84. /* p will be 3 for divs under 10 */
  85. if (div < 10)
  86. *p = 3;
  87. /* p will be 2 for divs between 10 - 20 and odd divs under 32 */
  88. else if (div < 20 || (div < 32 && (div & 1)))
  89. *p = 2;
  90. /* p will be 1 for even divs under 32, divs under 40 and odd pairs
  91. * of divs between 40-62 */
  92. else if (div < 40 || (div < 64 && (div & 2)))
  93. *p = 1;
  94. /* any other entries have p = 0 */
  95. else
  96. *p = 0;
  97. /* calculate a suitable n based on k and p */
  98. div <<= *p;
  99. div /= (*k + 1);
  100. *n = div / 4;
  101. }
  102. /**
  103. * sun6i_a31_get_pll1_factors() - calculates n, k and m factors for PLL1
  104. * PLL1 rate is calculated as follows
  105. * rate = parent_rate * (n + 1) * (k + 1) / (m + 1);
  106. * parent_rate should always be 24MHz
  107. */
  108. static void sun6i_a31_get_pll1_factors(u32 *freq, u32 parent_rate,
  109. u8 *n, u8 *k, u8 *m, u8 *p)
  110. {
  111. /*
  112. * We can operate only on MHz, this will make our life easier
  113. * later.
  114. */
  115. u32 freq_mhz = *freq / 1000000;
  116. u32 parent_freq_mhz = parent_rate / 1000000;
  117. /*
  118. * Round down the frequency to the closest multiple of either
  119. * 6 or 16
  120. */
  121. u32 round_freq_6 = round_down(freq_mhz, 6);
  122. u32 round_freq_16 = round_down(freq_mhz, 16);
  123. if (round_freq_6 > round_freq_16)
  124. freq_mhz = round_freq_6;
  125. else
  126. freq_mhz = round_freq_16;
  127. *freq = freq_mhz * 1000000;
  128. /*
  129. * If the factors pointer are null, we were just called to
  130. * round down the frequency.
  131. * Exit.
  132. */
  133. if (n == NULL)
  134. return;
  135. /* If the frequency is a multiple of 32 MHz, k is always 3 */
  136. if (!(freq_mhz % 32))
  137. *k = 3;
  138. /* If the frequency is a multiple of 9 MHz, k is always 2 */
  139. else if (!(freq_mhz % 9))
  140. *k = 2;
  141. /* If the frequency is a multiple of 8 MHz, k is always 1 */
  142. else if (!(freq_mhz % 8))
  143. *k = 1;
  144. /* Otherwise, we don't use the k factor */
  145. else
  146. *k = 0;
  147. /*
  148. * If the frequency is a multiple of 2 but not a multiple of
  149. * 3, m is 3. This is the first time we use 6 here, yet we
  150. * will use it on several other places.
  151. * We use this number because it's the lowest frequency we can
  152. * generate (with n = 0, k = 0, m = 3), so every other frequency
  153. * somehow relates to this frequency.
  154. */
  155. if ((freq_mhz % 6) == 2 || (freq_mhz % 6) == 4)
  156. *m = 2;
  157. /*
  158. * If the frequency is a multiple of 6MHz, but the factor is
  159. * odd, m will be 3
  160. */
  161. else if ((freq_mhz / 6) & 1)
  162. *m = 3;
  163. /* Otherwise, we end up with m = 1 */
  164. else
  165. *m = 1;
  166. /* Calculate n thanks to the above factors we already got */
  167. *n = freq_mhz * (*m + 1) / ((*k + 1) * parent_freq_mhz) - 1;
  168. /*
  169. * If n end up being outbound, and that we can still decrease
  170. * m, do it.
  171. */
  172. if ((*n + 1) > 31 && (*m + 1) > 1) {
  173. *n = (*n + 1) / 2 - 1;
  174. *m = (*m + 1) / 2 - 1;
  175. }
  176. }
  177. /**
  178. * sun4i_get_apb1_factors() - calculates m, p factors for APB1
  179. * APB1 rate is calculated as follows
  180. * rate = (parent_rate >> p) / (m + 1);
  181. */
  182. static void sun4i_get_apb1_factors(u32 *freq, u32 parent_rate,
  183. u8 *n, u8 *k, u8 *m, u8 *p)
  184. {
  185. u8 calcm, calcp;
  186. if (parent_rate < *freq)
  187. *freq = parent_rate;
  188. parent_rate = (parent_rate + (*freq - 1)) / *freq;
  189. /* Invalid rate! */
  190. if (parent_rate > 32)
  191. return;
  192. if (parent_rate <= 4)
  193. calcp = 0;
  194. else if (parent_rate <= 8)
  195. calcp = 1;
  196. else if (parent_rate <= 16)
  197. calcp = 2;
  198. else
  199. calcp = 3;
  200. calcm = (parent_rate >> calcp) - 1;
  201. *freq = (parent_rate >> calcp) / (calcm + 1);
  202. /* we were called to round the frequency, we can now return */
  203. if (n == NULL)
  204. return;
  205. *m = calcm;
  206. *p = calcp;
  207. }
  208. /**
  209. * sunxi_factors_clk_setup() - Setup function for factor clocks
  210. */
  211. struct factors_data {
  212. struct clk_factors_config *table;
  213. void (*getter) (u32 *rate, u32 parent_rate, u8 *n, u8 *k, u8 *m, u8 *p);
  214. };
  215. static struct clk_factors_config sun4i_pll1_config = {
  216. .nshift = 8,
  217. .nwidth = 5,
  218. .kshift = 4,
  219. .kwidth = 2,
  220. .mshift = 0,
  221. .mwidth = 2,
  222. .pshift = 16,
  223. .pwidth = 2,
  224. };
  225. static struct clk_factors_config sun6i_a31_pll1_config = {
  226. .nshift = 8,
  227. .nwidth = 5,
  228. .kshift = 4,
  229. .kwidth = 2,
  230. .mshift = 0,
  231. .mwidth = 2,
  232. };
  233. static struct clk_factors_config sun4i_apb1_config = {
  234. .mshift = 0,
  235. .mwidth = 5,
  236. .pshift = 16,
  237. .pwidth = 2,
  238. };
  239. static const struct factors_data sun4i_pll1_data __initconst = {
  240. .table = &sun4i_pll1_config,
  241. .getter = sun4i_get_pll1_factors,
  242. };
  243. static const struct factors_data sun6i_a31_pll1_data __initconst = {
  244. .table = &sun6i_a31_pll1_config,
  245. .getter = sun6i_a31_get_pll1_factors,
  246. };
  247. static const struct factors_data sun4i_apb1_data __initconst = {
  248. .table = &sun4i_apb1_config,
  249. .getter = sun4i_get_apb1_factors,
  250. };
  251. static void __init sunxi_factors_clk_setup(struct device_node *node,
  252. struct factors_data *data)
  253. {
  254. struct clk *clk;
  255. const char *clk_name = node->name;
  256. const char *parent;
  257. void *reg;
  258. reg = of_iomap(node, 0);
  259. parent = of_clk_get_parent_name(node, 0);
  260. clk = clk_register_factors(NULL, clk_name, parent, 0, reg,
  261. data->table, data->getter, &clk_lock);
  262. if (!IS_ERR(clk)) {
  263. of_clk_add_provider(node, of_clk_src_simple_get, clk);
  264. clk_register_clkdev(clk, clk_name, NULL);
  265. }
  266. }
  267. /**
  268. * sunxi_mux_clk_setup() - Setup function for muxes
  269. */
  270. #define SUNXI_MUX_GATE_WIDTH 2
  271. struct mux_data {
  272. u8 shift;
  273. };
  274. static const struct mux_data sun4i_cpu_mux_data __initconst = {
  275. .shift = 16,
  276. };
  277. static const struct mux_data sun6i_a31_ahb1_mux_data __initconst = {
  278. .shift = 12,
  279. };
  280. static const struct mux_data sun4i_apb1_mux_data __initconst = {
  281. .shift = 24,
  282. };
  283. static void __init sunxi_mux_clk_setup(struct device_node *node,
  284. struct mux_data *data)
  285. {
  286. struct clk *clk;
  287. const char *clk_name = node->name;
  288. const char *parents[5];
  289. void *reg;
  290. int i = 0;
  291. reg = of_iomap(node, 0);
  292. while (i < 5 && (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
  293. i++;
  294. clk = clk_register_mux(NULL, clk_name, parents, i,
  295. CLK_SET_RATE_NO_REPARENT, reg,
  296. data->shift, SUNXI_MUX_GATE_WIDTH,
  297. 0, &clk_lock);
  298. if (clk) {
  299. of_clk_add_provider(node, of_clk_src_simple_get, clk);
  300. clk_register_clkdev(clk, clk_name, NULL);
  301. }
  302. }
  303. /**
  304. * sunxi_divider_clk_setup() - Setup function for simple divider clocks
  305. */
  306. struct div_data {
  307. u8 shift;
  308. u8 pow;
  309. u8 width;
  310. };
  311. static const struct div_data sun4i_axi_data __initconst = {
  312. .shift = 0,
  313. .pow = 0,
  314. .width = 2,
  315. };
  316. static const struct div_data sun4i_ahb_data __initconst = {
  317. .shift = 4,
  318. .pow = 1,
  319. .width = 2,
  320. };
  321. static const struct div_data sun4i_apb0_data __initconst = {
  322. .shift = 8,
  323. .pow = 1,
  324. .width = 2,
  325. };
  326. static const struct div_data sun6i_a31_apb2_div_data __initconst = {
  327. .shift = 0,
  328. .pow = 0,
  329. .width = 4,
  330. };
  331. static void __init sunxi_divider_clk_setup(struct device_node *node,
  332. struct div_data *data)
  333. {
  334. struct clk *clk;
  335. const char *clk_name = node->name;
  336. const char *clk_parent;
  337. void *reg;
  338. reg = of_iomap(node, 0);
  339. clk_parent = of_clk_get_parent_name(node, 0);
  340. clk = clk_register_divider(NULL, clk_name, clk_parent, 0,
  341. reg, data->shift, data->width,
  342. data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0,
  343. &clk_lock);
  344. if (clk) {
  345. of_clk_add_provider(node, of_clk_src_simple_get, clk);
  346. clk_register_clkdev(clk, clk_name, NULL);
  347. }
  348. }
  349. /**
  350. * sunxi_gates_clk_setup() - Setup function for leaf gates on clocks
  351. */
  352. #define SUNXI_GATES_MAX_SIZE 64
  353. struct gates_data {
  354. DECLARE_BITMAP(mask, SUNXI_GATES_MAX_SIZE);
  355. };
  356. static const struct gates_data sun4i_axi_gates_data __initconst = {
  357. .mask = {1},
  358. };
  359. static const struct gates_data sun4i_ahb_gates_data __initconst = {
  360. .mask = {0x7F77FFF, 0x14FB3F},
  361. };
  362. static const struct gates_data sun5i_a10s_ahb_gates_data __initconst = {
  363. .mask = {0x147667e7, 0x185915},
  364. };
  365. static const struct gates_data sun5i_a13_ahb_gates_data __initconst = {
  366. .mask = {0x107067e7, 0x185111},
  367. };
  368. static const struct gates_data sun6i_a31_ahb1_gates_data __initconst = {
  369. .mask = {0xEDFE7F62, 0x794F931},
  370. };
  371. static const struct gates_data sun7i_a20_ahb_gates_data __initconst = {
  372. .mask = { 0x12f77fff, 0x16ff3f },
  373. };
  374. static const struct gates_data sun4i_apb0_gates_data __initconst = {
  375. .mask = {0x4EF},
  376. };
  377. static const struct gates_data sun5i_a10s_apb0_gates_data __initconst = {
  378. .mask = {0x469},
  379. };
  380. static const struct gates_data sun5i_a13_apb0_gates_data __initconst = {
  381. .mask = {0x61},
  382. };
  383. static const struct gates_data sun7i_a20_apb0_gates_data __initconst = {
  384. .mask = { 0x4ff },
  385. };
  386. static const struct gates_data sun4i_apb1_gates_data __initconst = {
  387. .mask = {0xFF00F7},
  388. };
  389. static const struct gates_data sun5i_a10s_apb1_gates_data __initconst = {
  390. .mask = {0xf0007},
  391. };
  392. static const struct gates_data sun5i_a13_apb1_gates_data __initconst = {
  393. .mask = {0xa0007},
  394. };
  395. static const struct gates_data sun6i_a31_apb1_gates_data __initconst = {
  396. .mask = {0x3031},
  397. };
  398. static const struct gates_data sun6i_a31_apb2_gates_data __initconst = {
  399. .mask = {0x3F000F},
  400. };
  401. static const struct gates_data sun7i_a20_apb1_gates_data __initconst = {
  402. .mask = { 0xff80ff },
  403. };
  404. static void __init sunxi_gates_clk_setup(struct device_node *node,
  405. struct gates_data *data)
  406. {
  407. struct clk_onecell_data *clk_data;
  408. const char *clk_parent;
  409. const char *clk_name;
  410. void *reg;
  411. int qty;
  412. int i = 0;
  413. int j = 0;
  414. int ignore;
  415. reg = of_iomap(node, 0);
  416. clk_parent = of_clk_get_parent_name(node, 0);
  417. /* Worst-case size approximation and memory allocation */
  418. qty = find_last_bit(data->mask, SUNXI_GATES_MAX_SIZE);
  419. clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
  420. if (!clk_data)
  421. return;
  422. clk_data->clks = kzalloc((qty+1) * sizeof(struct clk *), GFP_KERNEL);
  423. if (!clk_data->clks) {
  424. kfree(clk_data);
  425. return;
  426. }
  427. for_each_set_bit(i, data->mask, SUNXI_GATES_MAX_SIZE) {
  428. of_property_read_string_index(node, "clock-output-names",
  429. j, &clk_name);
  430. /* No driver claims this clock, but it should remain gated */
  431. ignore = !strcmp("ahb_sdram", clk_name) ? CLK_IGNORE_UNUSED : 0;
  432. clk_data->clks[i] = clk_register_gate(NULL, clk_name,
  433. clk_parent, ignore,
  434. reg + 4 * (i/32), i % 32,
  435. 0, &clk_lock);
  436. WARN_ON(IS_ERR(clk_data->clks[i]));
  437. j++;
  438. }
  439. /* Adjust to the real max */
  440. clk_data->clk_num = i;
  441. of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
  442. }
  443. /* Matches for factors clocks */
  444. static const struct of_device_id clk_factors_match[] __initconst = {
  445. {.compatible = "allwinner,sun4i-pll1-clk", .data = &sun4i_pll1_data,},
  446. {.compatible = "allwinner,sun6i-a31-pll1-clk", .data = &sun6i_a31_pll1_data,},
  447. {.compatible = "allwinner,sun4i-apb1-clk", .data = &sun4i_apb1_data,},
  448. {}
  449. };
  450. /* Matches for divider clocks */
  451. static const struct of_device_id clk_div_match[] __initconst = {
  452. {.compatible = "allwinner,sun4i-axi-clk", .data = &sun4i_axi_data,},
  453. {.compatible = "allwinner,sun4i-ahb-clk", .data = &sun4i_ahb_data,},
  454. {.compatible = "allwinner,sun4i-apb0-clk", .data = &sun4i_apb0_data,},
  455. {.compatible = "allwinner,sun6i-a31-apb2-div-clk", .data = &sun6i_a31_apb2_div_data,},
  456. {}
  457. };
  458. /* Matches for mux clocks */
  459. static const struct of_device_id clk_mux_match[] __initconst = {
  460. {.compatible = "allwinner,sun4i-cpu-clk", .data = &sun4i_cpu_mux_data,},
  461. {.compatible = "allwinner,sun4i-apb1-mux-clk", .data = &sun4i_apb1_mux_data,},
  462. {.compatible = "allwinner,sun6i-a31-ahb1-mux-clk", .data = &sun6i_a31_ahb1_mux_data,},
  463. {}
  464. };
  465. /* Matches for gate clocks */
  466. static const struct of_device_id clk_gates_match[] __initconst = {
  467. {.compatible = "allwinner,sun4i-axi-gates-clk", .data = &sun4i_axi_gates_data,},
  468. {.compatible = "allwinner,sun4i-ahb-gates-clk", .data = &sun4i_ahb_gates_data,},
  469. {.compatible = "allwinner,sun5i-a10s-ahb-gates-clk", .data = &sun5i_a10s_ahb_gates_data,},
  470. {.compatible = "allwinner,sun5i-a13-ahb-gates-clk", .data = &sun5i_a13_ahb_gates_data,},
  471. {.compatible = "allwinner,sun6i-a31-ahb1-gates-clk", .data = &sun6i_a31_ahb1_gates_data,},
  472. {.compatible = "allwinner,sun7i-a20-ahb-gates-clk", .data = &sun7i_a20_ahb_gates_data,},
  473. {.compatible = "allwinner,sun4i-apb0-gates-clk", .data = &sun4i_apb0_gates_data,},
  474. {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,},
  475. {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,},
  476. {.compatible = "allwinner,sun7i-a20-apb0-gates-clk", .data = &sun7i_a20_apb0_gates_data,},
  477. {.compatible = "allwinner,sun4i-apb1-gates-clk", .data = &sun4i_apb1_gates_data,},
  478. {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,},
  479. {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,},
  480. {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,},
  481. {.compatible = "allwinner,sun7i-a20-apb1-gates-clk", .data = &sun7i_a20_apb1_gates_data,},
  482. {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,},
  483. {}
  484. };
  485. static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_match,
  486. void *function)
  487. {
  488. struct device_node *np;
  489. const struct div_data *data;
  490. const struct of_device_id *match;
  491. void (*setup_function)(struct device_node *, const void *) = function;
  492. for_each_matching_node(np, clk_match) {
  493. match = of_match_node(clk_match, np);
  494. data = match->data;
  495. setup_function(np, data);
  496. }
  497. }
  498. static void __init sunxi_init_clocks(struct device_node *np)
  499. {
  500. /* Register factor clocks */
  501. of_sunxi_table_clock_setup(clk_factors_match, sunxi_factors_clk_setup);
  502. /* Register divider clocks */
  503. of_sunxi_table_clock_setup(clk_div_match, sunxi_divider_clk_setup);
  504. /* Register mux clocks */
  505. of_sunxi_table_clock_setup(clk_mux_match, sunxi_mux_clk_setup);
  506. /* Register gate clocks */
  507. of_sunxi_table_clock_setup(clk_gates_match, sunxi_gates_clk_setup);
  508. }
  509. CLK_OF_DECLARE(sun4i_a10_clk_init, "allwinner,sun4i-a10", sunxi_init_clocks);
  510. CLK_OF_DECLARE(sun5i_a10s_clk_init, "allwinner,sun5i-a10s", sunxi_init_clocks);
  511. CLK_OF_DECLARE(sun5i_a13_clk_init, "allwinner,sun5i-a13", sunxi_init_clocks);
  512. CLK_OF_DECLARE(sun6i_a31_clk_init, "allwinner,sun6i-a31", sunxi_init_clocks);
  513. CLK_OF_DECLARE(sun7i_a20_clk_init, "allwinner,sun7i-a20", sunxi_init_clocks);