tegra30_clocks_data.c 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369
  1. /*
  2. * arch/arm/mach-tegra/tegra30_clocks.c
  3. *
  4. * Copyright (c) 2010-2012 NVIDIA CORPORATION. All rights reserved.
  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; version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. *
  19. */
  20. #include <linux/clk-private.h>
  21. #include <linux/kernel.h>
  22. #include <linux/module.h>
  23. #include <linux/list.h>
  24. #include <linux/spinlock.h>
  25. #include <linux/delay.h>
  26. #include <linux/err.h>
  27. #include <linux/io.h>
  28. #include <linux/clk.h>
  29. #include <linux/cpufreq.h>
  30. #include "clock.h"
  31. #include "fuse.h"
  32. #include "tegra30_clocks.h"
  33. #define DEFINE_CLK_TEGRA(_name, _rate, _ops, _flags, \
  34. _parent_names, _parents, _parent) \
  35. static struct clk tegra_##_name = { \
  36. .hw = &tegra_##_name##_hw.hw, \
  37. .name = #_name, \
  38. .rate = _rate, \
  39. .ops = _ops, \
  40. .flags = _flags, \
  41. .parent_names = _parent_names, \
  42. .parents = _parents, \
  43. .num_parents = ARRAY_SIZE(_parent_names), \
  44. .parent = _parent, \
  45. };
  46. static struct clk tegra_clk_32k;
  47. static struct clk_tegra tegra_clk_32k_hw = {
  48. .hw = {
  49. .clk = &tegra_clk_32k,
  50. },
  51. .fixed_rate = 32768,
  52. };
  53. static struct clk tegra_clk_32k = {
  54. .name = "clk_32k",
  55. .hw = &tegra_clk_32k_hw.hw,
  56. .ops = &tegra30_clk_32k_ops,
  57. .flags = CLK_IS_ROOT,
  58. };
  59. static struct clk tegra_clk_m;
  60. static struct clk_tegra tegra_clk_m_hw = {
  61. .hw = {
  62. .clk = &tegra_clk_m,
  63. },
  64. .flags = ENABLE_ON_INIT,
  65. .reg = 0x1fc,
  66. .reg_shift = 28,
  67. .max_rate = 48000000,
  68. };
  69. static struct clk tegra_clk_m = {
  70. .name = "clk_m",
  71. .hw = &tegra_clk_m_hw.hw,
  72. .ops = &tegra30_clk_m_ops,
  73. .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
  74. };
  75. static const char *clk_m_div_parent_names[] = {
  76. "clk_m",
  77. };
  78. static struct clk *clk_m_div_parents[] = {
  79. &tegra_clk_m,
  80. };
  81. static struct clk tegra_clk_m_div2;
  82. static struct clk_tegra tegra_clk_m_div2_hw = {
  83. .hw = {
  84. .clk = &tegra_clk_m_div2,
  85. },
  86. .mul = 1,
  87. .div = 2,
  88. .max_rate = 24000000,
  89. };
  90. DEFINE_CLK_TEGRA(clk_m_div2, 0, &tegra_clk_m_div_ops, 0,
  91. clk_m_div_parent_names, clk_m_div_parents, &tegra_clk_m);
  92. static struct clk tegra_clk_m_div4;
  93. static struct clk_tegra tegra_clk_m_div4_hw = {
  94. .hw = {
  95. .clk = &tegra_clk_m_div4,
  96. },
  97. .mul = 1,
  98. .div = 4,
  99. .max_rate = 12000000,
  100. };
  101. DEFINE_CLK_TEGRA(clk_m_div4, 0, &tegra_clk_m_div_ops, 0,
  102. clk_m_div_parent_names, clk_m_div_parents, &tegra_clk_m);
  103. static struct clk tegra_pll_ref;
  104. static struct clk_tegra tegra_pll_ref_hw = {
  105. .hw = {
  106. .clk = &tegra_pll_ref,
  107. },
  108. .flags = ENABLE_ON_INIT,
  109. .max_rate = 26000000,
  110. };
  111. DEFINE_CLK_TEGRA(pll_ref, 0, &tegra_pll_ref_ops, 0, clk_m_div_parent_names,
  112. clk_m_div_parents, &tegra_clk_m);
  113. #define DEFINE_PLL(_name, _flags, _reg, _max_rate, _input_min, \
  114. _input_max, _cf_min, _cf_max, _vco_min, \
  115. _vco_max, _freq_table, _lock_delay, _ops, \
  116. _fixed_rate, _clk_cfg_ex, _parent) \
  117. static struct clk tegra_##_name; \
  118. static const char *_name##_parent_names[] = { \
  119. #_parent, \
  120. }; \
  121. static struct clk *_name##_parents[] = { \
  122. &tegra_##_parent, \
  123. }; \
  124. static struct clk_tegra tegra_##_name##_hw = { \
  125. .hw = { \
  126. .clk = &tegra_##_name, \
  127. }, \
  128. .flags = _flags, \
  129. .reg = _reg, \
  130. .max_rate = _max_rate, \
  131. .u.pll = { \
  132. .input_min = _input_min, \
  133. .input_max = _input_max, \
  134. .cf_min = _cf_min, \
  135. .cf_max = _cf_max, \
  136. .vco_min = _vco_min, \
  137. .vco_max = _vco_max, \
  138. .freq_table = _freq_table, \
  139. .lock_delay = _lock_delay, \
  140. .fixed_rate = _fixed_rate, \
  141. }, \
  142. .clk_cfg_ex = _clk_cfg_ex, \
  143. }; \
  144. DEFINE_CLK_TEGRA(_name, 0, &_ops, CLK_IGNORE_UNUSED, \
  145. _name##_parent_names, _name##_parents, \
  146. &tegra_##_parent);
  147. #define DEFINE_PLL_OUT(_name, _flags, _reg, _reg_shift, \
  148. _max_rate, _ops, _parent, _clk_flags) \
  149. static const char *_name##_parent_names[] = { \
  150. #_parent, \
  151. }; \
  152. static struct clk *_name##_parents[] = { \
  153. &tegra_##_parent, \
  154. }; \
  155. static struct clk tegra_##_name; \
  156. static struct clk_tegra tegra_##_name##_hw = { \
  157. .hw = { \
  158. .clk = &tegra_##_name, \
  159. }, \
  160. .flags = _flags, \
  161. .reg = _reg, \
  162. .max_rate = _max_rate, \
  163. .reg_shift = _reg_shift, \
  164. }; \
  165. DEFINE_CLK_TEGRA(_name, 0, &tegra30_pll_div_ops, \
  166. _clk_flags, _name##_parent_names, \
  167. _name##_parents, &tegra_##_parent);
  168. static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
  169. { 12000000, 1040000000, 520, 6, 1, 8},
  170. { 13000000, 1040000000, 480, 6, 1, 8},
  171. { 16800000, 1040000000, 495, 8, 1, 8}, /* actual: 1039.5 MHz */
  172. { 19200000, 1040000000, 325, 6, 1, 6},
  173. { 26000000, 1040000000, 520, 13, 1, 8},
  174. { 12000000, 832000000, 416, 6, 1, 8},
  175. { 13000000, 832000000, 832, 13, 1, 8},
  176. { 16800000, 832000000, 396, 8, 1, 8}, /* actual: 831.6 MHz */
  177. { 19200000, 832000000, 260, 6, 1, 8},
  178. { 26000000, 832000000, 416, 13, 1, 8},
  179. { 12000000, 624000000, 624, 12, 1, 8},
  180. { 13000000, 624000000, 624, 13, 1, 8},
  181. { 16800000, 600000000, 520, 14, 1, 8},
  182. { 19200000, 624000000, 520, 16, 1, 8},
  183. { 26000000, 624000000, 624, 26, 1, 8},
  184. { 12000000, 600000000, 600, 12, 1, 8},
  185. { 13000000, 600000000, 600, 13, 1, 8},
  186. { 16800000, 600000000, 500, 14, 1, 8},
  187. { 19200000, 600000000, 375, 12, 1, 6},
  188. { 26000000, 600000000, 600, 26, 1, 8},
  189. { 12000000, 520000000, 520, 12, 1, 8},
  190. { 13000000, 520000000, 520, 13, 1, 8},
  191. { 16800000, 520000000, 495, 16, 1, 8}, /* actual: 519.75 MHz */
  192. { 19200000, 520000000, 325, 12, 1, 6},
  193. { 26000000, 520000000, 520, 26, 1, 8},
  194. { 12000000, 416000000, 416, 12, 1, 8},
  195. { 13000000, 416000000, 416, 13, 1, 8},
  196. { 16800000, 416000000, 396, 16, 1, 8}, /* actual: 415.8 MHz */
  197. { 19200000, 416000000, 260, 12, 1, 6},
  198. { 26000000, 416000000, 416, 26, 1, 8},
  199. { 0, 0, 0, 0, 0, 0 },
  200. };
  201. DEFINE_PLL(pll_c, PLL_HAS_CPCON, 0x80, 1400000000, 2000000, 31000000, 1000000,
  202. 6000000, 20000000, 1400000000, tegra_pll_c_freq_table, 300,
  203. tegra30_pll_ops, 0, NULL, pll_ref);
  204. DEFINE_PLL_OUT(pll_c_out1, DIV_U71, 0x84, 0, 700000000,
  205. tegra30_pll_div_ops, pll_c, CLK_IGNORE_UNUSED);
  206. static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
  207. { 12000000, 666000000, 666, 12, 1, 8},
  208. { 13000000, 666000000, 666, 13, 1, 8},
  209. { 16800000, 666000000, 555, 14, 1, 8},
  210. { 19200000, 666000000, 555, 16, 1, 8},
  211. { 26000000, 666000000, 666, 26, 1, 8},
  212. { 12000000, 600000000, 600, 12, 1, 8},
  213. { 13000000, 600000000, 600, 13, 1, 8},
  214. { 16800000, 600000000, 500, 14, 1, 8},
  215. { 19200000, 600000000, 375, 12, 1, 6},
  216. { 26000000, 600000000, 600, 26, 1, 8},
  217. { 0, 0, 0, 0, 0, 0 },
  218. };
  219. DEFINE_PLL(pll_m, PLL_HAS_CPCON | PLLM, 0x90, 800000000, 2000000, 31000000,
  220. 1000000, 6000000, 20000000, 1200000000, tegra_pll_m_freq_table,
  221. 300, tegra30_pll_ops, 0, NULL, pll_ref);
  222. DEFINE_PLL_OUT(pll_m_out1, DIV_U71, 0x94, 0, 600000000,
  223. tegra30_pll_div_ops, pll_m, CLK_IGNORE_UNUSED);
  224. static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
  225. { 12000000, 216000000, 432, 12, 2, 8},
  226. { 13000000, 216000000, 432, 13, 2, 8},
  227. { 16800000, 216000000, 360, 14, 2, 8},
  228. { 19200000, 216000000, 360, 16, 2, 8},
  229. { 26000000, 216000000, 432, 26, 2, 8},
  230. { 0, 0, 0, 0, 0, 0 },
  231. };
  232. DEFINE_PLL(pll_p, ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON, 0xa0, 432000000,
  233. 2000000, 31000000, 1000000, 6000000, 20000000, 1400000000,
  234. tegra_pll_p_freq_table, 300, tegra30_pll_ops, 408000000, NULL,
  235. pll_ref);
  236. DEFINE_PLL_OUT(pll_p_out1, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4,
  237. 0, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
  238. DEFINE_PLL_OUT(pll_p_out2, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4,
  239. 16, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
  240. DEFINE_PLL_OUT(pll_p_out3, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8,
  241. 0, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
  242. DEFINE_PLL_OUT(pll_p_out4, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8,
  243. 16, 432000000, tegra30_pll_div_ops, pll_p, CLK_IGNORE_UNUSED);
  244. static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
  245. { 9600000, 564480000, 294, 5, 1, 4},
  246. { 9600000, 552960000, 288, 5, 1, 4},
  247. { 9600000, 24000000, 5, 2, 1, 1},
  248. { 28800000, 56448000, 49, 25, 1, 1},
  249. { 28800000, 73728000, 64, 25, 1, 1},
  250. { 28800000, 24000000, 5, 6, 1, 1},
  251. { 0, 0, 0, 0, 0, 0 },
  252. };
  253. DEFINE_PLL(pll_a, PLL_HAS_CPCON, 0xb0, 700000000, 2000000, 31000000, 1000000,
  254. 6000000, 20000000, 1400000000, tegra_pll_a_freq_table,
  255. 300, tegra30_pll_ops, 0, NULL, pll_p_out1);
  256. DEFINE_PLL_OUT(pll_a_out0, DIV_U71, 0xb4, 0, 100000000, tegra30_pll_div_ops,
  257. pll_a, CLK_IGNORE_UNUSED);
  258. static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
  259. { 12000000, 216000000, 216, 12, 1, 4},
  260. { 13000000, 216000000, 216, 13, 1, 4},
  261. { 16800000, 216000000, 180, 14, 1, 4},
  262. { 19200000, 216000000, 180, 16, 1, 4},
  263. { 26000000, 216000000, 216, 26, 1, 4},
  264. { 12000000, 594000000, 594, 12, 1, 8},
  265. { 13000000, 594000000, 594, 13, 1, 8},
  266. { 16800000, 594000000, 495, 14, 1, 8},
  267. { 19200000, 594000000, 495, 16, 1, 8},
  268. { 26000000, 594000000, 594, 26, 1, 8},
  269. { 12000000, 1000000000, 1000, 12, 1, 12},
  270. { 13000000, 1000000000, 1000, 13, 1, 12},
  271. { 19200000, 1000000000, 625, 12, 1, 8},
  272. { 26000000, 1000000000, 1000, 26, 1, 12},
  273. { 0, 0, 0, 0, 0, 0 },
  274. };
  275. DEFINE_PLL(pll_d, PLL_HAS_CPCON | PLLD, 0xd0, 1000000000, 2000000, 40000000,
  276. 1000000, 6000000, 40000000, 1000000000, tegra_pll_d_freq_table,
  277. 1000, tegra30_pll_ops, 0, tegra30_plld_clk_cfg_ex, pll_ref);
  278. DEFINE_PLL_OUT(pll_d_out0, DIV_2 | PLLD, 0, 0, 500000000, tegra30_pll_div_ops,
  279. pll_d, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED);
  280. DEFINE_PLL(pll_d2, PLL_HAS_CPCON | PLL_ALT_MISC_REG | PLLD, 0x4b8, 1000000000,
  281. 2000000, 40000000, 1000000, 6000000, 40000000, 1000000000,
  282. tegra_pll_d_freq_table, 1000, tegra30_pll_ops, 0, NULL,
  283. pll_ref);
  284. DEFINE_PLL_OUT(pll_d2_out0, DIV_2 | PLLD, 0, 0, 500000000, tegra30_pll_div_ops,
  285. pll_d2, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED);
  286. static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
  287. { 12000000, 480000000, 960, 12, 2, 12},
  288. { 13000000, 480000000, 960, 13, 2, 12},
  289. { 16800000, 480000000, 400, 7, 2, 5},
  290. { 19200000, 480000000, 200, 4, 2, 3},
  291. { 26000000, 480000000, 960, 26, 2, 12},
  292. { 0, 0, 0, 0, 0, 0 },
  293. };
  294. DEFINE_PLL(pll_u, PLL_HAS_CPCON | PLLU, 0xc0, 480000000, 2000000, 40000000,
  295. 1000000, 6000000, 48000000, 960000000, tegra_pll_u_freq_table,
  296. 1000, tegra30_pll_ops, 0, NULL, pll_ref);
  297. static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
  298. /* 1.7 GHz */
  299. { 12000000, 1700000000, 850, 6, 1, 8},
  300. { 13000000, 1700000000, 915, 7, 1, 8}, /* actual: 1699.2 MHz */
  301. { 16800000, 1700000000, 708, 7, 1, 8}, /* actual: 1699.2 MHz */
  302. { 19200000, 1700000000, 885, 10, 1, 8}, /* actual: 1699.2 MHz */
  303. { 26000000, 1700000000, 850, 13, 1, 8},
  304. /* 1.6 GHz */
  305. { 12000000, 1600000000, 800, 6, 1, 8},
  306. { 13000000, 1600000000, 738, 6, 1, 8}, /* actual: 1599.0 MHz */
  307. { 16800000, 1600000000, 857, 9, 1, 8}, /* actual: 1599.7 MHz */
  308. { 19200000, 1600000000, 500, 6, 1, 8},
  309. { 26000000, 1600000000, 800, 13, 1, 8},
  310. /* 1.5 GHz */
  311. { 12000000, 1500000000, 750, 6, 1, 8},
  312. { 13000000, 1500000000, 923, 8, 1, 8}, /* actual: 1499.8 MHz */
  313. { 16800000, 1500000000, 625, 7, 1, 8},
  314. { 19200000, 1500000000, 625, 8, 1, 8},
  315. { 26000000, 1500000000, 750, 13, 1, 8},
  316. /* 1.4 GHz */
  317. { 12000000, 1400000000, 700, 6, 1, 8},
  318. { 13000000, 1400000000, 969, 9, 1, 8}, /* actual: 1399.7 MHz */
  319. { 16800000, 1400000000, 1000, 12, 1, 8},
  320. { 19200000, 1400000000, 875, 12, 1, 8},
  321. { 26000000, 1400000000, 700, 13, 1, 8},
  322. /* 1.3 GHz */
  323. { 12000000, 1300000000, 975, 9, 1, 8},
  324. { 13000000, 1300000000, 1000, 10, 1, 8},
  325. { 16800000, 1300000000, 928, 12, 1, 8}, /* actual: 1299.2 MHz */
  326. { 19200000, 1300000000, 812, 12, 1, 8}, /* actual: 1299.2 MHz */
  327. { 26000000, 1300000000, 650, 13, 1, 8},
  328. /* 1.2 GHz */
  329. { 12000000, 1200000000, 1000, 10, 1, 8},
  330. { 13000000, 1200000000, 923, 10, 1, 8}, /* actual: 1199.9 MHz */
  331. { 16800000, 1200000000, 1000, 14, 1, 8},
  332. { 19200000, 1200000000, 1000, 16, 1, 8},
  333. { 26000000, 1200000000, 600, 13, 1, 8},
  334. /* 1.1 GHz */
  335. { 12000000, 1100000000, 825, 9, 1, 8},
  336. { 13000000, 1100000000, 846, 10, 1, 8}, /* actual: 1099.8 MHz */
  337. { 16800000, 1100000000, 982, 15, 1, 8}, /* actual: 1099.8 MHz */
  338. { 19200000, 1100000000, 859, 15, 1, 8}, /* actual: 1099.5 MHz */
  339. { 26000000, 1100000000, 550, 13, 1, 8},
  340. /* 1 GHz */
  341. { 12000000, 1000000000, 1000, 12, 1, 8},
  342. { 13000000, 1000000000, 1000, 13, 1, 8},
  343. { 16800000, 1000000000, 833, 14, 1, 8}, /* actual: 999.6 MHz */
  344. { 19200000, 1000000000, 625, 12, 1, 8},
  345. { 26000000, 1000000000, 1000, 26, 1, 8},
  346. { 0, 0, 0, 0, 0, 0 },
  347. };
  348. DEFINE_PLL(pll_x, PLL_HAS_CPCON | PLL_ALT_MISC_REG | PLLX, 0xe0, 1700000000,
  349. 2000000, 31000000, 1000000, 6000000, 20000000, 1700000000,
  350. tegra_pll_x_freq_table, 300, tegra30_pll_ops, 0, NULL, pll_ref);
  351. DEFINE_PLL_OUT(pll_x_out0, DIV_2 | PLLX, 0, 0, 850000000, tegra30_pll_div_ops,
  352. pll_x, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED);
  353. static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
  354. /* PLLE special case: use cpcon field to store cml divider value */
  355. { 12000000, 100000000, 150, 1, 18, 11},
  356. { 216000000, 100000000, 200, 18, 24, 13},
  357. { 0, 0, 0, 0, 0, 0 },
  358. };
  359. DEFINE_PLL(pll_e, PLL_ALT_MISC_REG, 0xe8, 100000000, 2000000, 216000000,
  360. 12000000, 12000000, 1200000000, 2400000000U,
  361. tegra_pll_e_freq_table, 300, tegra30_plle_ops, 100000000, NULL,
  362. pll_ref);
  363. static const char *mux_plle[] = {
  364. "pll_e",
  365. };
  366. static struct clk *mux_plle_p[] = {
  367. &tegra_pll_e,
  368. };
  369. static struct clk tegra_cml0;
  370. static struct clk_tegra tegra_cml0_hw = {
  371. .hw = {
  372. .clk = &tegra_cml0,
  373. },
  374. .reg = 0x48c,
  375. .fixed_rate = 100000000,
  376. .u.periph = {
  377. .clk_num = 0,
  378. },
  379. };
  380. DEFINE_CLK_TEGRA(cml0, 0, &tegra_cml_clk_ops, 0, mux_plle,
  381. mux_plle_p, &tegra_pll_e);
  382. static struct clk tegra_cml1;
  383. static struct clk_tegra tegra_cml1_hw = {
  384. .hw = {
  385. .clk = &tegra_cml1,
  386. },
  387. .reg = 0x48c,
  388. .fixed_rate = 100000000,
  389. .u.periph = {
  390. .clk_num = 1,
  391. },
  392. };
  393. DEFINE_CLK_TEGRA(cml1, 0, &tegra_cml_clk_ops, 0, mux_plle,
  394. mux_plle_p, &tegra_pll_e);
  395. static struct clk tegra_pciex;
  396. static struct clk_tegra tegra_pciex_hw = {
  397. .hw = {
  398. .clk = &tegra_pciex,
  399. },
  400. .reg = 0x48c,
  401. .fixed_rate = 100000000,
  402. .reset = tegra30_periph_clk_reset,
  403. .u.periph = {
  404. .clk_num = 74,
  405. },
  406. };
  407. DEFINE_CLK_TEGRA(pciex, 0, &tegra_pciex_clk_ops, 0, mux_plle,
  408. mux_plle_p, &tegra_pll_e);
  409. #define SYNC_SOURCE(_name) \
  410. static struct clk tegra_##_name##_sync; \
  411. static struct clk_tegra tegra_##_name##_sync_hw = { \
  412. .hw = { \
  413. .clk = &tegra_##_name##_sync, \
  414. }, \
  415. .max_rate = 24000000, \
  416. .fixed_rate = 24000000, \
  417. }; \
  418. static struct clk tegra_##_name##_sync = { \
  419. .name = #_name "_sync", \
  420. .hw = &tegra_##_name##_sync_hw.hw, \
  421. .ops = &tegra_sync_source_ops, \
  422. .flags = CLK_IS_ROOT, \
  423. };
  424. SYNC_SOURCE(spdif_in);
  425. SYNC_SOURCE(i2s0);
  426. SYNC_SOURCE(i2s1);
  427. SYNC_SOURCE(i2s2);
  428. SYNC_SOURCE(i2s3);
  429. SYNC_SOURCE(i2s4);
  430. SYNC_SOURCE(vimclk);
  431. static struct clk *tegra_sync_source_list[] = {
  432. &tegra_spdif_in_sync,
  433. &tegra_i2s0_sync,
  434. &tegra_i2s1_sync,
  435. &tegra_i2s2_sync,
  436. &tegra_i2s3_sync,
  437. &tegra_i2s4_sync,
  438. &tegra_vimclk_sync,
  439. };
  440. static const char *mux_audio_sync_clk[] = {
  441. "spdif_in_sync",
  442. "i2s0_sync",
  443. "i2s1_sync",
  444. "i2s2_sync",
  445. "i2s3_sync",
  446. "i2s4_sync",
  447. "vimclk_sync",
  448. };
  449. #define AUDIO_SYNC_CLK(_name, _index) \
  450. static struct clk tegra_##_name; \
  451. static struct clk_tegra tegra_##_name##_hw = { \
  452. .hw = { \
  453. .clk = &tegra_##_name, \
  454. }, \
  455. .max_rate = 24000000, \
  456. .reg = 0x4A0 + (_index) * 4, \
  457. }; \
  458. static struct clk tegra_##_name = { \
  459. .name = #_name, \
  460. .ops = &tegra30_audio_sync_clk_ops, \
  461. .hw = &tegra_##_name##_hw.hw, \
  462. .parent_names = mux_audio_sync_clk, \
  463. .parents = tegra_sync_source_list, \
  464. .num_parents = ARRAY_SIZE(mux_audio_sync_clk), \
  465. };
  466. AUDIO_SYNC_CLK(audio0, 0);
  467. AUDIO_SYNC_CLK(audio1, 1);
  468. AUDIO_SYNC_CLK(audio2, 2);
  469. AUDIO_SYNC_CLK(audio3, 3);
  470. AUDIO_SYNC_CLK(audio4, 4);
  471. AUDIO_SYNC_CLK(audio5, 5);
  472. static struct clk *tegra_clk_audio_list[] = {
  473. &tegra_audio0,
  474. &tegra_audio1,
  475. &tegra_audio2,
  476. &tegra_audio3,
  477. &tegra_audio4,
  478. &tegra_audio5, /* SPDIF */
  479. };
  480. #define AUDIO_SYNC_2X_CLK(_name, _index) \
  481. static const char *_name##_parent_names[] = { \
  482. "tegra_" #_name, \
  483. }; \
  484. static struct clk *_name##_parents[] = { \
  485. &tegra_##_name, \
  486. }; \
  487. static struct clk tegra_##_name##_2x; \
  488. static struct clk_tegra tegra_##_name##_2x_hw = { \
  489. .hw = { \
  490. .clk = &tegra_##_name##_2x, \
  491. }, \
  492. .flags = PERIPH_NO_RESET, \
  493. .max_rate = 48000000, \
  494. .reg = 0x49C, \
  495. .reg_shift = 24 + (_index), \
  496. .u.periph = { \
  497. .clk_num = 113 + (_index), \
  498. }, \
  499. }; \
  500. static struct clk tegra_##_name##_2x = { \
  501. .name = #_name "_2x", \
  502. .ops = &tegra30_clk_double_ops, \
  503. .hw = &tegra_##_name##_2x_hw.hw, \
  504. .parent_names = _name##_parent_names, \
  505. .parents = _name##_parents, \
  506. .parent = &tegra_##_name, \
  507. .num_parents = 1, \
  508. };
  509. AUDIO_SYNC_2X_CLK(audio0, 0);
  510. AUDIO_SYNC_2X_CLK(audio1, 1);
  511. AUDIO_SYNC_2X_CLK(audio2, 2);
  512. AUDIO_SYNC_2X_CLK(audio3, 3);
  513. AUDIO_SYNC_2X_CLK(audio4, 4);
  514. AUDIO_SYNC_2X_CLK(audio5, 5); /* SPDIF */
  515. static struct clk *tegra_clk_audio_2x_list[] = {
  516. &tegra_audio0_2x,
  517. &tegra_audio1_2x,
  518. &tegra_audio2_2x,
  519. &tegra_audio3_2x,
  520. &tegra_audio4_2x,
  521. &tegra_audio5_2x, /* SPDIF */
  522. };
  523. #define MUX_I2S_SPDIF(_id) \
  524. static const char *mux_pllaout0_##_id##_2x_pllp_clkm[] = { \
  525. "pll_a_out0", \
  526. #_id "_2x", \
  527. "pll_p", \
  528. "clk_m", \
  529. }; \
  530. static struct clk *mux_pllaout0_##_id##_2x_pllp_clkm_p[] = { \
  531. &tegra_pll_a_out0, \
  532. &tegra_##_id##_2x, \
  533. &tegra_pll_p, \
  534. &tegra_clk_m, \
  535. };
  536. MUX_I2S_SPDIF(audio0);
  537. MUX_I2S_SPDIF(audio1);
  538. MUX_I2S_SPDIF(audio2);
  539. MUX_I2S_SPDIF(audio3);
  540. MUX_I2S_SPDIF(audio4);
  541. MUX_I2S_SPDIF(audio5); /* SPDIF */
  542. static struct clk tegra_extern1;
  543. static struct clk tegra_extern2;
  544. static struct clk tegra_extern3;
  545. /* External clock outputs (through PMC) */
  546. #define MUX_EXTERN_OUT(_id) \
  547. static const char *mux_clkm_clkm2_clkm4_extern##_id[] = { \
  548. "clk_m", \
  549. "clk_m_div2", \
  550. "clk_m_div4", \
  551. "extern" #_id, \
  552. }; \
  553. static struct clk *mux_clkm_clkm2_clkm4_extern##_id##_p[] = { \
  554. &tegra_clk_m, \
  555. &tegra_clk_m_div2, \
  556. &tegra_clk_m_div4, \
  557. &tegra_extern##_id, \
  558. };
  559. MUX_EXTERN_OUT(1);
  560. MUX_EXTERN_OUT(2);
  561. MUX_EXTERN_OUT(3);
  562. #define CLK_OUT_CLK(_name, _index) \
  563. static struct clk tegra_##_name; \
  564. static struct clk_tegra tegra_##_name##_hw = { \
  565. .hw = { \
  566. .clk = &tegra_##_name, \
  567. }, \
  568. .lookup = { \
  569. .dev_id = #_name, \
  570. .con_id = "extern" #_index, \
  571. }, \
  572. .flags = MUX_CLK_OUT, \
  573. .fixed_rate = 216000000, \
  574. .reg = 0x1a8, \
  575. .u.periph = { \
  576. .clk_num = (_index - 1) * 8 + 2, \
  577. }, \
  578. }; \
  579. static struct clk tegra_##_name = { \
  580. .name = #_name, \
  581. .ops = &tegra_clk_out_ops, \
  582. .hw = &tegra_##_name##_hw.hw, \
  583. .parent_names = mux_clkm_clkm2_clkm4_extern##_index, \
  584. .parents = mux_clkm_clkm2_clkm4_extern##_index##_p, \
  585. .num_parents = ARRAY_SIZE(mux_clkm_clkm2_clkm4_extern##_index),\
  586. };
  587. CLK_OUT_CLK(clk_out_1, 1);
  588. CLK_OUT_CLK(clk_out_2, 2);
  589. CLK_OUT_CLK(clk_out_3, 3);
  590. static struct clk *tegra_clk_out_list[] = {
  591. &tegra_clk_out_1,
  592. &tegra_clk_out_2,
  593. &tegra_clk_out_3,
  594. };
  595. static const char *mux_sclk[] = {
  596. "clk_m",
  597. "pll_c_out1",
  598. "pll_p_out4",
  599. "pll_p_out3",
  600. "pll_p_out2",
  601. "dummy",
  602. "clk_32k",
  603. "pll_m_out1",
  604. };
  605. static struct clk *mux_sclk_p[] = {
  606. &tegra_clk_m,
  607. &tegra_pll_c_out1,
  608. &tegra_pll_p_out4,
  609. &tegra_pll_p_out3,
  610. &tegra_pll_p_out2,
  611. NULL,
  612. &tegra_clk_32k,
  613. &tegra_pll_m_out1,
  614. };
  615. static struct clk tegra_clk_sclk;
  616. static struct clk_tegra tegra_clk_sclk_hw = {
  617. .hw = {
  618. .clk = &tegra_clk_sclk,
  619. },
  620. .reg = 0x28,
  621. .max_rate = 334000000,
  622. .min_rate = 40000000,
  623. };
  624. static struct clk tegra_clk_sclk = {
  625. .name = "sclk",
  626. .ops = &tegra30_super_ops,
  627. .hw = &tegra_clk_sclk_hw.hw,
  628. .parent_names = mux_sclk,
  629. .parents = mux_sclk_p,
  630. .num_parents = ARRAY_SIZE(mux_sclk),
  631. };
  632. static const char *mux_blink[] = {
  633. "clk_32k",
  634. };
  635. static struct clk *mux_blink_p[] = {
  636. &tegra_clk_32k,
  637. };
  638. static struct clk tegra_clk_blink;
  639. static struct clk_tegra tegra_clk_blink_hw = {
  640. .hw = {
  641. .clk = &tegra_clk_blink,
  642. },
  643. .reg = 0x40,
  644. .max_rate = 32768,
  645. };
  646. static struct clk tegra_clk_blink = {
  647. .name = "blink",
  648. .ops = &tegra30_blink_clk_ops,
  649. .hw = &tegra_clk_blink_hw.hw,
  650. .parent = &tegra_clk_32k,
  651. .parent_names = mux_blink,
  652. .parents = mux_blink_p,
  653. .num_parents = ARRAY_SIZE(mux_blink),
  654. };
  655. static const char *mux_pllm_pllc_pllp_plla[] = {
  656. "pll_m",
  657. "pll_c",
  658. "pll_p",
  659. "pll_a_out0",
  660. };
  661. static const char *mux_pllp_pllc_pllm_clkm[] = {
  662. "pll_p",
  663. "pll_c",
  664. "pll_m",
  665. "clk_m",
  666. };
  667. static const char *mux_pllp_clkm[] = {
  668. "pll_p",
  669. "dummy",
  670. "dummy",
  671. "clk_m",
  672. };
  673. static const char *mux_pllp_plld_pllc_clkm[] = {
  674. "pll_p",
  675. "pll_d_out0",
  676. "pll_c",
  677. "clk_m",
  678. };
  679. static const char *mux_pllp_pllm_plld_plla_pllc_plld2_clkm[] = {
  680. "pll_p",
  681. "pll_m",
  682. "pll_d_out0",
  683. "pll_a_out0",
  684. "pll_c",
  685. "pll_d2_out0",
  686. "clk_m",
  687. };
  688. static const char *mux_plla_pllc_pllp_clkm[] = {
  689. "pll_a_out0",
  690. "dummy",
  691. "pll_p",
  692. "clk_m"
  693. };
  694. static const char *mux_pllp_pllc_clk32_clkm[] = {
  695. "pll_p",
  696. "pll_c",
  697. "clk_32k",
  698. "clk_m",
  699. };
  700. static const char *mux_pllp_pllc_clkm_clk32[] = {
  701. "pll_p",
  702. "pll_c",
  703. "clk_m",
  704. "clk_32k",
  705. };
  706. static const char *mux_pllp_pllc_pllm[] = {
  707. "pll_p",
  708. "pll_c",
  709. "pll_m",
  710. };
  711. static const char *mux_clk_m[] = {
  712. "clk_m",
  713. };
  714. static const char *mux_pllp_out3[] = {
  715. "pll_p_out3",
  716. };
  717. static const char *mux_plld_out0[] = {
  718. "pll_d_out0",
  719. };
  720. static const char *mux_plld_out0_plld2_out0[] = {
  721. "pll_d_out0",
  722. "pll_d2_out0",
  723. };
  724. static const char *mux_clk_32k[] = {
  725. "clk_32k",
  726. };
  727. static const char *mux_plla_clk32_pllp_clkm_plle[] = {
  728. "pll_a_out0",
  729. "clk_32k",
  730. "pll_p",
  731. "clk_m",
  732. "pll_e",
  733. };
  734. static const char *mux_cclk_g[] = {
  735. "clk_m",
  736. "pll_c",
  737. "clk_32k",
  738. "pll_m",
  739. "pll_p",
  740. "pll_p_out4",
  741. "pll_p_out3",
  742. "dummy",
  743. "pll_x",
  744. };
  745. static struct clk *mux_pllm_pllc_pllp_plla_p[] = {
  746. &tegra_pll_m,
  747. &tegra_pll_c,
  748. &tegra_pll_p,
  749. &tegra_pll_a_out0,
  750. };
  751. static struct clk *mux_pllp_pllc_pllm_clkm_p[] = {
  752. &tegra_pll_p,
  753. &tegra_pll_c,
  754. &tegra_pll_m,
  755. &tegra_clk_m,
  756. };
  757. static struct clk *mux_pllp_clkm_p[] = {
  758. &tegra_pll_p,
  759. NULL,
  760. NULL,
  761. &tegra_clk_m,
  762. };
  763. static struct clk *mux_pllp_plld_pllc_clkm_p[] = {
  764. &tegra_pll_p,
  765. &tegra_pll_d_out0,
  766. &tegra_pll_c,
  767. &tegra_clk_m,
  768. };
  769. static struct clk *mux_pllp_pllm_plld_plla_pllc_plld2_clkm_p[] = {
  770. &tegra_pll_p,
  771. &tegra_pll_m,
  772. &tegra_pll_d_out0,
  773. &tegra_pll_a_out0,
  774. &tegra_pll_c,
  775. &tegra_pll_d2_out0,
  776. &tegra_clk_m,
  777. };
  778. static struct clk *mux_plla_pllc_pllp_clkm_p[] = {
  779. &tegra_pll_a_out0,
  780. NULL,
  781. &tegra_pll_p,
  782. &tegra_clk_m,
  783. };
  784. static struct clk *mux_pllp_pllc_clk32_clkm_p[] = {
  785. &tegra_pll_p,
  786. &tegra_pll_c,
  787. &tegra_clk_32k,
  788. &tegra_clk_m,
  789. };
  790. static struct clk *mux_pllp_pllc_clkm_clk32_p[] = {
  791. &tegra_pll_p,
  792. &tegra_pll_c,
  793. &tegra_clk_m,
  794. &tegra_clk_32k,
  795. };
  796. static struct clk *mux_pllp_pllc_pllm_p[] = {
  797. &tegra_pll_p,
  798. &tegra_pll_c,
  799. &tegra_pll_m,
  800. };
  801. static struct clk *mux_clk_m_p[] = {
  802. &tegra_clk_m,
  803. };
  804. static struct clk *mux_pllp_out3_p[] = {
  805. &tegra_pll_p_out3,
  806. };
  807. static struct clk *mux_plld_out0_p[] = {
  808. &tegra_pll_d_out0,
  809. };
  810. static struct clk *mux_plld_out0_plld2_out0_p[] = {
  811. &tegra_pll_d_out0,
  812. &tegra_pll_d2_out0,
  813. };
  814. static struct clk *mux_clk_32k_p[] = {
  815. &tegra_clk_32k,
  816. };
  817. static struct clk *mux_plla_clk32_pllp_clkm_plle_p[] = {
  818. &tegra_pll_a_out0,
  819. &tegra_clk_32k,
  820. &tegra_pll_p,
  821. &tegra_clk_m,
  822. &tegra_pll_e,
  823. };
  824. static struct clk *mux_cclk_g_p[] = {
  825. &tegra_clk_m,
  826. &tegra_pll_c,
  827. &tegra_clk_32k,
  828. &tegra_pll_m,
  829. &tegra_pll_p,
  830. &tegra_pll_p_out4,
  831. &tegra_pll_p_out3,
  832. NULL,
  833. &tegra_pll_x,
  834. };
  835. static struct clk tegra_clk_cclk_g;
  836. static struct clk_tegra tegra_clk_cclk_g_hw = {
  837. .hw = {
  838. .clk = &tegra_clk_cclk_g,
  839. },
  840. .flags = DIV_U71 | DIV_U71_INT,
  841. .reg = 0x368,
  842. .max_rate = 1700000000,
  843. };
  844. static struct clk tegra_clk_cclk_g = {
  845. .name = "cclk_g",
  846. .ops = &tegra30_super_ops,
  847. .hw = &tegra_clk_cclk_g_hw.hw,
  848. .parent_names = mux_cclk_g,
  849. .parents = mux_cclk_g_p,
  850. .num_parents = ARRAY_SIZE(mux_cclk_g),
  851. };
  852. static const char *mux_twd[] = {
  853. "cclk_g",
  854. };
  855. static struct clk *mux_twd_p[] = {
  856. &tegra_clk_cclk_g,
  857. };
  858. static struct clk tegra30_clk_twd;
  859. static struct clk_tegra tegra30_clk_twd_hw = {
  860. .hw = {
  861. .clk = &tegra30_clk_twd,
  862. },
  863. .max_rate = 1400000000,
  864. .mul = 1,
  865. .div = 2,
  866. };
  867. static struct clk tegra30_clk_twd = {
  868. .name = "twd",
  869. .ops = &tegra30_twd_ops,
  870. .hw = &tegra30_clk_twd_hw.hw,
  871. .parent = &tegra_clk_cclk_g,
  872. .parent_names = mux_twd,
  873. .parents = mux_twd_p,
  874. .num_parents = ARRAY_SIZE(mux_twd),
  875. };
  876. #define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, \
  877. _max, _inputs, _flags) \
  878. static struct clk tegra_##_name; \
  879. static struct clk_tegra tegra_##_name##_hw = { \
  880. .hw = { \
  881. .clk = &tegra_##_name, \
  882. }, \
  883. .lookup = { \
  884. .dev_id = _dev, \
  885. .con_id = _con, \
  886. }, \
  887. .reg = _reg, \
  888. .flags = _flags, \
  889. .max_rate = _max, \
  890. .u.periph = { \
  891. .clk_num = _clk_num, \
  892. }, \
  893. .reset = &tegra30_periph_clk_reset, \
  894. }; \
  895. static struct clk tegra_##_name = { \
  896. .name = #_name, \
  897. .ops = &tegra30_periph_clk_ops, \
  898. .hw = &tegra_##_name##_hw.hw, \
  899. .parent_names = _inputs, \
  900. .parents = _inputs##_p, \
  901. .num_parents = ARRAY_SIZE(_inputs), \
  902. };
  903. PERIPH_CLK(apbdma, "tegra-apbdma", NULL, 34, 0, 26000000, mux_clk_m, 0);
  904. PERIPH_CLK(rtc, "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB);
  905. PERIPH_CLK(kbc, "tegra-kbc", NULL, 36, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB);
  906. PERIPH_CLK(timer, "timer", NULL, 5, 0, 26000000, mux_clk_m, 0);
  907. PERIPH_CLK(kfuse, "kfuse-tegra", NULL, 40, 0, 26000000, mux_clk_m, 0);
  908. PERIPH_CLK(fuse, "fuse-tegra", "fuse", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB);
  909. PERIPH_CLK(fuse_burn, "fuse-tegra", "fuse_burn", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB);
  910. PERIPH_CLK(apbif, "tegra30-ahub", "apbif", 107, 0, 26000000, mux_clk_m, 0);
  911. PERIPH_CLK(i2s0, "tegra30-i2s.0", NULL, 30, 0x1d8, 26000000, mux_pllaout0_audio0_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  912. PERIPH_CLK(i2s1, "tegra30-i2s.1", NULL, 11, 0x100, 26000000, mux_pllaout0_audio1_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  913. PERIPH_CLK(i2s2, "tegra30-i2s.2", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  914. PERIPH_CLK(i2s3, "tegra30-i2s.3", NULL, 101, 0x3bc, 26000000, mux_pllaout0_audio3_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  915. PERIPH_CLK(i2s4, "tegra30-i2s.4", NULL, 102, 0x3c0, 26000000, mux_pllaout0_audio4_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  916. PERIPH_CLK(spdif_out, "tegra30-spdif", "spdif_out", 10, 0x108, 100000000, mux_pllaout0_audio5_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  917. PERIPH_CLK(spdif_in, "tegra30-spdif", "spdif_in", 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71 | PERIPH_ON_APB);
  918. PERIPH_CLK(pwm, "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_clk32_clkm, MUX | MUX_PWM | DIV_U71 | PERIPH_ON_APB);
  919. PERIPH_CLK(d_audio, "tegra30-ahub", "d_audio", 106, 0x3d0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
  920. PERIPH_CLK(dam0, "tegra30-dam.0", NULL, 108, 0x3d8, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
  921. PERIPH_CLK(dam1, "tegra30-dam.1", NULL, 109, 0x3dc, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
  922. PERIPH_CLK(dam2, "tegra30-dam.2", NULL, 110, 0x3e0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
  923. PERIPH_CLK(hda, "tegra30-hda", "hda", 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  924. PERIPH_CLK(hda2codec_2x, "tegra30-hda", "hda2codec", 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  925. PERIPH_CLK(hda2hdmi, "tegra30-hda", "hda2hdmi", 128, 0, 48000000, mux_clk_m, 0);
  926. PERIPH_CLK(sbc1, "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  927. PERIPH_CLK(sbc2, "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  928. PERIPH_CLK(sbc3, "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  929. PERIPH_CLK(sbc4, "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  930. PERIPH_CLK(sbc5, "spi_tegra.4", NULL, 104, 0x3c8, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  931. PERIPH_CLK(sbc6, "spi_tegra.5", NULL, 105, 0x3cc, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  932. PERIPH_CLK(sata_oob, "tegra_sata_oob", NULL, 123, 0x420, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  933. PERIPH_CLK(sata, "tegra_sata", NULL, 124, 0x424, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  934. PERIPH_CLK(sata_cold, "tegra_sata_cold", NULL, 129, 0, 48000000, mux_clk_m, 0);
  935. PERIPH_CLK(ndflash, "tegra_nand", NULL, 13, 0x160, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  936. PERIPH_CLK(ndspeed, "tegra_nand_speed", NULL, 80, 0x3f8, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  937. PERIPH_CLK(vfir, "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  938. PERIPH_CLK(sdmmc1, "sdhci-tegra.0", NULL, 14, 0x150, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
  939. PERIPH_CLK(sdmmc2, "sdhci-tegra.1", NULL, 9, 0x154, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
  940. PERIPH_CLK(sdmmc3, "sdhci-tegra.2", NULL, 69, 0x1bc, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
  941. PERIPH_CLK(sdmmc4, "sdhci-tegra.3", NULL, 15, 0x164, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
  942. PERIPH_CLK(vcp, "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0);
  943. PERIPH_CLK(bsea, "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0);
  944. PERIPH_CLK(bsev, "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0);
  945. PERIPH_CLK(vde, "vde", NULL, 61, 0x1c8, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT);
  946. PERIPH_CLK(csite, "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* max rate ??? */
  947. PERIPH_CLK(la, "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
  948. PERIPH_CLK(owr, "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  949. PERIPH_CLK(nor, "nor", NULL, 42, 0x1d0, 127000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
  950. PERIPH_CLK(mipi, "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB); /* scales with voltage */
  951. PERIPH_CLK(i2c1, "tegra-i2c.0", NULL, 12, 0x124, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
  952. PERIPH_CLK(i2c2, "tegra-i2c.1", NULL, 54, 0x198, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
  953. PERIPH_CLK(i2c3, "tegra-i2c.2", NULL, 67, 0x1b8, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
  954. PERIPH_CLK(i2c4, "tegra-i2c.3", NULL, 103, 0x3c4, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
  955. PERIPH_CLK(i2c5, "tegra-i2c.4", NULL, 47, 0x128, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
  956. PERIPH_CLK(uarta, "tegra-uart.0", NULL, 6, 0x178, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
  957. PERIPH_CLK(uartb, "tegra-uart.1", NULL, 7, 0x17c, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
  958. PERIPH_CLK(uartc, "tegra-uart.2", NULL, 55, 0x1a0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
  959. PERIPH_CLK(uartd, "tegra-uart.3", NULL, 65, 0x1c0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
  960. PERIPH_CLK(uarte, "tegra-uart.4", NULL, 66, 0x1c4, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
  961. PERIPH_CLK(vi, "tegra_camera", "vi", 20, 0x148, 425000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
  962. PERIPH_CLK(3d, "3d", NULL, 24, 0x158, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET);
  963. PERIPH_CLK(3d2, "3d2", NULL, 98, 0x3b0, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET);
  964. PERIPH_CLK(2d, "2d", NULL, 21, 0x15c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE);
  965. PERIPH_CLK(vi_sensor, "tegra_camera", "vi_sensor", 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET);
  966. PERIPH_CLK(epp, "epp", NULL, 19, 0x16c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
  967. PERIPH_CLK(mpe, "mpe", NULL, 60, 0x170, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
  968. PERIPH_CLK(host1x, "host1x", NULL, 28, 0x180, 260000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
  969. PERIPH_CLK(cve, "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
  970. PERIPH_CLK(tvo, "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
  971. PERIPH_CLK(dtv, "dtv", NULL, 79, 0x1dc, 250000000, mux_clk_m, 0);
  972. PERIPH_CLK(hdmi, "hdmi", NULL, 51, 0x18c, 148500000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8 | DIV_U71);
  973. PERIPH_CLK(tvdac, "tvdac", NULL, 53, 0x194, 220000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
  974. PERIPH_CLK(disp1, "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8);
  975. PERIPH_CLK(disp2, "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8);
  976. PERIPH_CLK(usbd, "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
  977. PERIPH_CLK(usb2, "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
  978. PERIPH_CLK(usb3, "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
  979. PERIPH_CLK(dsia, "tegradc.0", "dsia", 48, 0, 500000000, mux_plld_out0, 0);
  980. PERIPH_CLK(csi, "tegra_camera", "csi", 52, 0, 102000000, mux_pllp_out3, 0);
  981. PERIPH_CLK(isp, "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0); /* same frequency as VI */
  982. PERIPH_CLK(csus, "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET);
  983. PERIPH_CLK(tsensor, "tegra-tsensor", NULL, 100, 0x3b8, 216000000, mux_pllp_pllc_clkm_clk32, MUX | DIV_U71);
  984. PERIPH_CLK(actmon, "actmon", NULL, 119, 0x3e8, 216000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71);
  985. PERIPH_CLK(extern1, "extern1", NULL, 120, 0x3ec, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
  986. PERIPH_CLK(extern2, "extern2", NULL, 121, 0x3f0, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
  987. PERIPH_CLK(extern3, "extern3", NULL, 122, 0x3f4, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
  988. PERIPH_CLK(i2cslow, "i2cslow", NULL, 81, 0x3fc, 26000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
  989. PERIPH_CLK(pcie, "tegra-pcie", "pcie", 70, 0, 250000000, mux_clk_m, 0);
  990. PERIPH_CLK(afi, "tegra-pcie", "afi", 72, 0, 250000000, mux_clk_m, 0);
  991. PERIPH_CLK(se, "se", NULL, 127, 0x42c, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT);
  992. static struct clk tegra_dsib;
  993. static struct clk_tegra tegra_dsib_hw = {
  994. .hw = {
  995. .clk = &tegra_dsib,
  996. },
  997. .lookup = {
  998. .dev_id = "tegradc.1",
  999. .con_id = "dsib",
  1000. },
  1001. .reg = 0xd0,
  1002. .flags = MUX | PLLD,
  1003. .max_rate = 500000000,
  1004. .u.periph = {
  1005. .clk_num = 82,
  1006. },
  1007. .reset = &tegra30_periph_clk_reset,
  1008. };
  1009. static struct clk tegra_dsib = {
  1010. .name = "dsib",
  1011. .ops = &tegra30_dsib_clk_ops,
  1012. .hw = &tegra_dsib_hw.hw,
  1013. .parent_names = mux_plld_out0_plld2_out0,
  1014. .parents = mux_plld_out0_plld2_out0_p,
  1015. .num_parents = ARRAY_SIZE(mux_plld_out0_plld2_out0),
  1016. };
  1017. struct clk *tegra_list_clks[] = {
  1018. &tegra_apbdma,
  1019. &tegra_rtc,
  1020. &tegra_kbc,
  1021. &tegra_kfuse,
  1022. &tegra_fuse,
  1023. &tegra_fuse_burn,
  1024. &tegra_apbif,
  1025. &tegra_i2s0,
  1026. &tegra_i2s1,
  1027. &tegra_i2s2,
  1028. &tegra_i2s3,
  1029. &tegra_i2s4,
  1030. &tegra_spdif_out,
  1031. &tegra_spdif_in,
  1032. &tegra_pwm,
  1033. &tegra_d_audio,
  1034. &tegra_dam0,
  1035. &tegra_dam1,
  1036. &tegra_dam2,
  1037. &tegra_hda,
  1038. &tegra_hda2codec_2x,
  1039. &tegra_hda2hdmi,
  1040. &tegra_sbc1,
  1041. &tegra_sbc2,
  1042. &tegra_sbc3,
  1043. &tegra_sbc4,
  1044. &tegra_sbc5,
  1045. &tegra_sbc6,
  1046. &tegra_sata_oob,
  1047. &tegra_sata,
  1048. &tegra_sata_cold,
  1049. &tegra_ndflash,
  1050. &tegra_ndspeed,
  1051. &tegra_vfir,
  1052. &tegra_sdmmc1,
  1053. &tegra_sdmmc2,
  1054. &tegra_sdmmc3,
  1055. &tegra_sdmmc4,
  1056. &tegra_vcp,
  1057. &tegra_bsea,
  1058. &tegra_bsev,
  1059. &tegra_vde,
  1060. &tegra_csite,
  1061. &tegra_la,
  1062. &tegra_owr,
  1063. &tegra_nor,
  1064. &tegra_mipi,
  1065. &tegra_i2c1,
  1066. &tegra_i2c2,
  1067. &tegra_i2c3,
  1068. &tegra_i2c4,
  1069. &tegra_i2c5,
  1070. &tegra_uarta,
  1071. &tegra_uartb,
  1072. &tegra_uartc,
  1073. &tegra_uartd,
  1074. &tegra_uarte,
  1075. &tegra_vi,
  1076. &tegra_3d,
  1077. &tegra_3d2,
  1078. &tegra_2d,
  1079. &tegra_vi_sensor,
  1080. &tegra_epp,
  1081. &tegra_mpe,
  1082. &tegra_host1x,
  1083. &tegra_cve,
  1084. &tegra_tvo,
  1085. &tegra_dtv,
  1086. &tegra_hdmi,
  1087. &tegra_tvdac,
  1088. &tegra_disp1,
  1089. &tegra_disp2,
  1090. &tegra_usbd,
  1091. &tegra_usb2,
  1092. &tegra_usb3,
  1093. &tegra_dsia,
  1094. &tegra_dsib,
  1095. &tegra_csi,
  1096. &tegra_isp,
  1097. &tegra_csus,
  1098. &tegra_tsensor,
  1099. &tegra_actmon,
  1100. &tegra_extern1,
  1101. &tegra_extern2,
  1102. &tegra_extern3,
  1103. &tegra_i2cslow,
  1104. &tegra_pcie,
  1105. &tegra_afi,
  1106. &tegra_se,
  1107. };
  1108. #define CLK_DUPLICATE(_name, _dev, _con) \
  1109. { \
  1110. .name = _name, \
  1111. .lookup = { \
  1112. .dev_id = _dev, \
  1113. .con_id = _con, \
  1114. }, \
  1115. }
  1116. /* Some clocks may be used by different drivers depending on the board
  1117. * configuration. List those here to register them twice in the clock lookup
  1118. * table under two names.
  1119. */
  1120. struct clk_duplicate tegra_clk_duplicates[] = {
  1121. CLK_DUPLICATE("uarta", "serial8250.0", NULL),
  1122. CLK_DUPLICATE("uartb", "serial8250.1", NULL),
  1123. CLK_DUPLICATE("uartc", "serial8250.2", NULL),
  1124. CLK_DUPLICATE("uartd", "serial8250.3", NULL),
  1125. CLK_DUPLICATE("uarte", "serial8250.4", NULL),
  1126. CLK_DUPLICATE("usbd", "utmip-pad", NULL),
  1127. CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
  1128. CLK_DUPLICATE("usbd", "tegra-otg", NULL),
  1129. CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
  1130. CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
  1131. CLK_DUPLICATE("dsib", "tegradc.0", "dsib"),
  1132. CLK_DUPLICATE("dsia", "tegradc.1", "dsia"),
  1133. CLK_DUPLICATE("bsev", "tegra-avp", "bsev"),
  1134. CLK_DUPLICATE("bsev", "nvavp", "bsev"),
  1135. CLK_DUPLICATE("vde", "tegra-aes", "vde"),
  1136. CLK_DUPLICATE("bsea", "tegra-aes", "bsea"),
  1137. CLK_DUPLICATE("bsea", "nvavp", "bsea"),
  1138. CLK_DUPLICATE("cml1", "tegra_sata_cml", NULL),
  1139. CLK_DUPLICATE("cml0", "tegra_pcie", "cml"),
  1140. CLK_DUPLICATE("pciex", "tegra_pcie", "pciex"),
  1141. CLK_DUPLICATE("i2c1", "tegra-i2c-slave.0", NULL),
  1142. CLK_DUPLICATE("i2c2", "tegra-i2c-slave.1", NULL),
  1143. CLK_DUPLICATE("i2c3", "tegra-i2c-slave.2", NULL),
  1144. CLK_DUPLICATE("i2c4", "tegra-i2c-slave.3", NULL),
  1145. CLK_DUPLICATE("i2c5", "tegra-i2c-slave.4", NULL),
  1146. CLK_DUPLICATE("sbc1", "spi_slave_tegra.0", NULL),
  1147. CLK_DUPLICATE("sbc2", "spi_slave_tegra.1", NULL),
  1148. CLK_DUPLICATE("sbc3", "spi_slave_tegra.2", NULL),
  1149. CLK_DUPLICATE("sbc4", "spi_slave_tegra.3", NULL),
  1150. CLK_DUPLICATE("sbc5", "spi_slave_tegra.4", NULL),
  1151. CLK_DUPLICATE("sbc6", "spi_slave_tegra.5", NULL),
  1152. CLK_DUPLICATE("twd", "smp_twd", NULL),
  1153. CLK_DUPLICATE("vcp", "nvavp", "vcp"),
  1154. CLK_DUPLICATE("i2s0", NULL, "i2s0"),
  1155. CLK_DUPLICATE("i2s1", NULL, "i2s1"),
  1156. CLK_DUPLICATE("i2s2", NULL, "i2s2"),
  1157. CLK_DUPLICATE("i2s3", NULL, "i2s3"),
  1158. CLK_DUPLICATE("i2s4", NULL, "i2s4"),
  1159. CLK_DUPLICATE("dam0", NULL, "dam0"),
  1160. CLK_DUPLICATE("dam1", NULL, "dam1"),
  1161. CLK_DUPLICATE("dam2", NULL, "dam2"),
  1162. CLK_DUPLICATE("spdif_in", NULL, "spdif_in"),
  1163. };
  1164. struct clk *tegra_ptr_clks[] = {
  1165. &tegra_clk_32k,
  1166. &tegra_clk_m,
  1167. &tegra_clk_m_div2,
  1168. &tegra_clk_m_div4,
  1169. &tegra_pll_ref,
  1170. &tegra_pll_m,
  1171. &tegra_pll_m_out1,
  1172. &tegra_pll_c,
  1173. &tegra_pll_c_out1,
  1174. &tegra_pll_p,
  1175. &tegra_pll_p_out1,
  1176. &tegra_pll_p_out2,
  1177. &tegra_pll_p_out3,
  1178. &tegra_pll_p_out4,
  1179. &tegra_pll_a,
  1180. &tegra_pll_a_out0,
  1181. &tegra_pll_d,
  1182. &tegra_pll_d_out0,
  1183. &tegra_pll_d2,
  1184. &tegra_pll_d2_out0,
  1185. &tegra_pll_u,
  1186. &tegra_pll_x,
  1187. &tegra_pll_x_out0,
  1188. &tegra_pll_e,
  1189. &tegra_clk_cclk_g,
  1190. &tegra_cml0,
  1191. &tegra_cml1,
  1192. &tegra_pciex,
  1193. &tegra_clk_sclk,
  1194. &tegra_clk_blink,
  1195. &tegra30_clk_twd,
  1196. };
  1197. static void tegra30_init_one_clock(struct clk *c)
  1198. {
  1199. struct clk_tegra *clk = to_clk_tegra(c->hw);
  1200. __clk_init(NULL, c);
  1201. INIT_LIST_HEAD(&clk->shared_bus_list);
  1202. if (!clk->lookup.dev_id && !clk->lookup.con_id)
  1203. clk->lookup.con_id = c->name;
  1204. clk->lookup.clk = c;
  1205. clkdev_add(&clk->lookup);
  1206. tegra_clk_add(c);
  1207. }
  1208. void __init tegra30_init_clocks(void)
  1209. {
  1210. int i;
  1211. struct clk *c;
  1212. for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
  1213. tegra30_init_one_clock(tegra_ptr_clks[i]);
  1214. for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
  1215. tegra30_init_one_clock(tegra_list_clks[i]);
  1216. for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
  1217. c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
  1218. if (!c) {
  1219. pr_err("%s: Unknown duplicate clock %s\n", __func__,
  1220. tegra_clk_duplicates[i].name);
  1221. continue;
  1222. }
  1223. tegra_clk_duplicates[i].lookup.clk = c;
  1224. clkdev_add(&tegra_clk_duplicates[i].lookup);
  1225. }
  1226. for (i = 0; i < ARRAY_SIZE(tegra_sync_source_list); i++)
  1227. tegra30_init_one_clock(tegra_sync_source_list[i]);
  1228. for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_list); i++)
  1229. tegra30_init_one_clock(tegra_clk_audio_list[i]);
  1230. for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_2x_list); i++)
  1231. tegra30_init_one_clock(tegra_clk_audio_2x_list[i]);
  1232. for (i = 0; i < ARRAY_SIZE(tegra_clk_out_list); i++)
  1233. tegra30_init_one_clock(tegra_clk_out_list[i]);
  1234. }