debugcc-niobe.c 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #define pr_fmt(fmt) "clk: %s: " fmt, __func__
  6. #include <linux/clk.h>
  7. #include <linux/clk-provider.h>
  8. #include <linux/err.h>
  9. #include <linux/kernel.h>
  10. #include <linux/mfd/syscon.h>
  11. #include <linux/module.h>
  12. #include <linux/of.h>
  13. #include <linux/of_device.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/regmap.h>
  16. #include "clk-debug.h"
  17. #include "common.h"
  18. static struct measure_clk_data debug_mux_priv = {
  19. .ctl_reg = 0x62048,
  20. .status_reg = 0x6204C,
  21. .xo_div4_cbcr = 0x62008,
  22. };
  23. static const char *const apss_cc_debug_mux_parent_names[] = {
  24. "measure_only_apcs_gold_post_acd_clk",
  25. "measure_only_apcs_gold_pre_acd_clk",
  26. "measure_only_apcs_goldplus_post_acd_clk",
  27. "measure_only_apcs_goldplus_pre_acd_clk",
  28. "measure_only_apcs_l3_post_acd_clk",
  29. "measure_only_apcs_l3_pre_acd_clk",
  30. };
  31. static int apss_cc_debug_mux_sels[] = {
  32. 0x21, /* measure_only_apcs_gold_post_acd_clk */
  33. 0x44, /* measure_only_apcs_gold_pre_acd_clk */
  34. 0x25, /* measure_only_apcs_goldplus_post_acd_clk */
  35. 0x45, /* measure_only_apcs_goldplus_pre_acd_clk */
  36. 0x41, /* measure_only_apcs_l3_post_acd_clk */
  37. 0x46, /* measure_only_apcs_l3_pre_acd_clk */
  38. };
  39. static int apss_cc_debug_mux_pre_divs[] = {
  40. 0x8, /* measure_only_apcs_gold_post_acd_clk */
  41. 0x10, /* measure_only_apcs_gold_pre_acd_clk */
  42. 0x8, /* measure_only_apcs_goldplus_post_acd_clk */
  43. 0x10, /* measure_only_apcs_goldplus_pre_acd_clk */
  44. 0x4, /* measure_only_apcs_l3_post_acd_clk */
  45. 0x10, /* measure_only_apcs_l3_pre_acd_clk */
  46. };
  47. static struct clk_debug_mux apss_cc_debug_mux = {
  48. .priv = &debug_mux_priv,
  49. .debug_offset = 0x18,
  50. .post_div_offset = 0x18,
  51. .cbcr_offset = 0x0,
  52. .src_sel_mask = 0x7F0,
  53. .src_sel_shift = 4,
  54. .post_div_mask = 0x7800,
  55. .post_div_shift = 11,
  56. .post_div_val = 1,
  57. .mux_sels = apss_cc_debug_mux_sels,
  58. .num_mux_sels = ARRAY_SIZE(apss_cc_debug_mux_sels),
  59. .pre_div_vals = apss_cc_debug_mux_pre_divs,
  60. .hw.init = &(const struct clk_init_data){
  61. .name = "apss_cc_debug_mux",
  62. .ops = &clk_debug_mux_ops,
  63. .parent_names = apss_cc_debug_mux_parent_names,
  64. .num_parents = ARRAY_SIZE(apss_cc_debug_mux_parent_names),
  65. },
  66. };
  67. static const char *const cam_cc_debug_mux_parent_names[] = {
  68. "cam_cc_bps_ahb_clk",
  69. "cam_cc_bps_clk",
  70. "cam_cc_bps_fast_ahb_clk",
  71. "cam_cc_bps_shift_clk",
  72. "cam_cc_camnoc_ahb_clk",
  73. "cam_cc_camnoc_axi_nrt_clk",
  74. "cam_cc_camnoc_axi_rt_clk",
  75. "cam_cc_camnoc_dcd_xo_clk",
  76. "cam_cc_camnoc_xo_clk",
  77. "cam_cc_cci_0_clk",
  78. "cam_cc_cci_1_clk",
  79. "cam_cc_cci_2_clk",
  80. "cam_cc_cci_3_clk",
  81. "cam_cc_cci_4_clk",
  82. "cam_cc_cci_5_clk",
  83. "cam_cc_core_ahb_clk",
  84. "cam_cc_cpas_ahb_clk",
  85. "cam_cc_cpas_bps_clk",
  86. "cam_cc_cpas_fast_ahb_clk",
  87. "cam_cc_cpas_ife_0_clk",
  88. "cam_cc_cpas_ife_1_clk",
  89. "cam_cc_cpas_ife_lite_clk",
  90. "cam_cc_cpas_ipe_nps_clk",
  91. "cam_cc_csi0phytimer_clk",
  92. "cam_cc_csi1phytimer_clk",
  93. "cam_cc_csi2phytimer_clk",
  94. "cam_cc_csi3phytimer_clk",
  95. "cam_cc_csi4phytimer_clk",
  96. "cam_cc_csi5phytimer_clk",
  97. "cam_cc_csi6phytimer_clk",
  98. "cam_cc_csid_clk",
  99. "cam_cc_csid_csiphy_rx_clk",
  100. "cam_cc_csiphy0_clk",
  101. "cam_cc_csiphy1_clk",
  102. "cam_cc_csiphy2_clk",
  103. "cam_cc_csiphy3_clk",
  104. "cam_cc_csiphy4_clk",
  105. "cam_cc_csiphy5_clk",
  106. "cam_cc_csiphy6_clk",
  107. "cam_cc_icp_ahb_clk",
  108. "cam_cc_icp_clk",
  109. "cam_cc_ife_0_clk",
  110. "cam_cc_ife_0_fast_ahb_clk",
  111. "cam_cc_ife_0_shift_clk",
  112. "cam_cc_ife_1_clk",
  113. "cam_cc_ife_1_fast_ahb_clk",
  114. "cam_cc_ife_1_shift_clk",
  115. "cam_cc_ife_lite_ahb_clk",
  116. "cam_cc_ife_lite_clk",
  117. "cam_cc_ife_lite_cphy_rx_clk",
  118. "cam_cc_ife_lite_csid_clk",
  119. "cam_cc_ipe_nps_ahb_clk",
  120. "cam_cc_ipe_nps_clk",
  121. "cam_cc_ipe_nps_fast_ahb_clk",
  122. "cam_cc_ipe_pps_clk",
  123. "cam_cc_ipe_pps_fast_ahb_clk",
  124. "cam_cc_ipe_shift_clk",
  125. "cam_cc_jpeg_1_clk",
  126. "cam_cc_jpeg_2_clk",
  127. "cam_cc_jpeg_clk",
  128. "cam_cc_mclk0_clk",
  129. "cam_cc_mclk10_clk",
  130. "cam_cc_mclk11_clk",
  131. "cam_cc_mclk1_clk",
  132. "cam_cc_mclk2_clk",
  133. "cam_cc_mclk3_clk",
  134. "cam_cc_mclk4_clk",
  135. "cam_cc_mclk5_clk",
  136. "cam_cc_mclk6_clk",
  137. "cam_cc_mclk7_clk",
  138. "cam_cc_mclk8_clk",
  139. "cam_cc_mclk9_clk",
  140. "cam_cc_qdss_debug_clk",
  141. "cam_cc_qdss_debug_xo_clk",
  142. "cam_cc_titan_top_shift_clk",
  143. "measure_only_cam_cc_drv_ahb_clk",
  144. "measure_only_cam_cc_drv_xo_clk",
  145. "measure_only_cam_cc_gdsc_clk",
  146. "measure_only_cam_cc_sleep_clk",
  147. };
  148. static int cam_cc_debug_mux_sels[] = {
  149. 0x17, /* cam_cc_bps_ahb_clk */
  150. 0x18, /* cam_cc_bps_clk */
  151. 0x16, /* cam_cc_bps_fast_ahb_clk */
  152. 0x7B, /* cam_cc_bps_shift_clk */
  153. 0x78, /* cam_cc_camnoc_ahb_clk */
  154. 0x57, /* cam_cc_camnoc_axi_nrt_clk */
  155. 0x49, /* cam_cc_camnoc_axi_rt_clk */
  156. 0x4A, /* cam_cc_camnoc_dcd_xo_clk */
  157. 0x60, /* cam_cc_camnoc_xo_clk */
  158. 0x44, /* cam_cc_cci_0_clk */
  159. 0x45, /* cam_cc_cci_1_clk */
  160. 0x61, /* cam_cc_cci_2_clk */
  161. 0x77, /* cam_cc_cci_3_clk */
  162. 0x68, /* cam_cc_cci_4_clk */
  163. 0x6B, /* cam_cc_cci_5_clk */
  164. 0x4D, /* cam_cc_core_ahb_clk */
  165. 0x46, /* cam_cc_cpas_ahb_clk */
  166. 0x19, /* cam_cc_cpas_bps_clk */
  167. 0x47, /* cam_cc_cpas_fast_ahb_clk */
  168. 0x25, /* cam_cc_cpas_ife_0_clk */
  169. 0x2A, /* cam_cc_cpas_ife_1_clk */
  170. 0x34, /* cam_cc_cpas_ife_lite_clk */
  171. 0x1B, /* cam_cc_cpas_ipe_nps_clk */
  172. 0x9, /* cam_cc_csi0phytimer_clk */
  173. 0xC, /* cam_cc_csi1phytimer_clk */
  174. 0xE, /* cam_cc_csi2phytimer_clk */
  175. 0x10, /* cam_cc_csi3phytimer_clk */
  176. 0x12, /* cam_cc_csi4phytimer_clk */
  177. 0x14, /* cam_cc_csi5phytimer_clk */
  178. 0x21, /* cam_cc_csi6phytimer_clk */
  179. 0x48, /* cam_cc_csid_clk */
  180. 0xB, /* cam_cc_csid_csiphy_rx_clk */
  181. 0xA, /* cam_cc_csiphy0_clk */
  182. 0xD, /* cam_cc_csiphy1_clk */
  183. 0xF, /* cam_cc_csiphy2_clk */
  184. 0x11, /* cam_cc_csiphy3_clk */
  185. 0x13, /* cam_cc_csiphy4_clk */
  186. 0x15, /* cam_cc_csiphy5_clk */
  187. 0x22, /* cam_cc_csiphy6_clk */
  188. 0x43, /* cam_cc_icp_ahb_clk */
  189. 0x42, /* cam_cc_icp_clk */
  190. 0x24, /* cam_cc_ife_0_clk */
  191. 0x28, /* cam_cc_ife_0_fast_ahb_clk */
  192. 0x7D, /* cam_cc_ife_0_shift_clk */
  193. 0x29, /* cam_cc_ife_1_clk */
  194. 0x2D, /* cam_cc_ife_1_fast_ahb_clk */
  195. 0x7E, /* cam_cc_ife_1_shift_clk */
  196. 0x37, /* cam_cc_ife_lite_ahb_clk */
  197. 0x33, /* cam_cc_ife_lite_clk */
  198. 0x36, /* cam_cc_ife_lite_cphy_rx_clk */
  199. 0x35, /* cam_cc_ife_lite_csid_clk */
  200. 0x1E, /* cam_cc_ipe_nps_ahb_clk */
  201. 0x1A, /* cam_cc_ipe_nps_clk */
  202. 0x1F, /* cam_cc_ipe_nps_fast_ahb_clk */
  203. 0x1C, /* cam_cc_ipe_pps_clk */
  204. 0x20, /* cam_cc_ipe_pps_fast_ahb_clk */
  205. 0x7C, /* cam_cc_ipe_shift_clk */
  206. 0x5F, /* cam_cc_jpeg_1_clk */
  207. 0x75, /* cam_cc_jpeg_2_clk */
  208. 0x40, /* cam_cc_jpeg_clk */
  209. 0x1, /* cam_cc_mclk0_clk */
  210. 0x3A, /* cam_cc_mclk10_clk */
  211. 0x3B, /* cam_cc_mclk11_clk */
  212. 0x2, /* cam_cc_mclk1_clk */
  213. 0x3, /* cam_cc_mclk2_clk */
  214. 0x4, /* cam_cc_mclk3_clk */
  215. 0x5, /* cam_cc_mclk4_clk */
  216. 0x6, /* cam_cc_mclk5_clk */
  217. 0x7, /* cam_cc_mclk6_clk */
  218. 0x8, /* cam_cc_mclk7_clk */
  219. 0x38, /* cam_cc_mclk8_clk */
  220. 0x39, /* cam_cc_mclk9_clk */
  221. 0x4B, /* cam_cc_qdss_debug_clk */
  222. 0x4C, /* cam_cc_qdss_debug_xo_clk */
  223. 0x7F, /* cam_cc_titan_top_shift_clk */
  224. 0x79, /* measure_only_cam_cc_drv_ahb_clk */
  225. 0x74, /* measure_only_cam_cc_drv_xo_clk */
  226. 0x4E, /* measure_only_cam_cc_gdsc_clk */
  227. 0x4F, /* measure_only_cam_cc_sleep_clk */
  228. };
  229. static struct clk_debug_mux cam_cc_debug_mux = {
  230. .priv = &debug_mux_priv,
  231. .debug_offset = 0x16000,
  232. .post_div_offset = 0x14088,
  233. .cbcr_offset = 0x1408C,
  234. .src_sel_mask = 0xFF,
  235. .src_sel_shift = 0,
  236. .post_div_mask = 0xF,
  237. .post_div_shift = 0,
  238. .post_div_val = 4,
  239. .mux_sels = cam_cc_debug_mux_sels,
  240. .num_mux_sels = ARRAY_SIZE(cam_cc_debug_mux_sels),
  241. .hw.init = &(const struct clk_init_data){
  242. .name = "cam_cc_debug_mux",
  243. .ops = &clk_debug_mux_ops,
  244. .parent_names = cam_cc_debug_mux_parent_names,
  245. .num_parents = ARRAY_SIZE(cam_cc_debug_mux_parent_names),
  246. },
  247. };
  248. static const char *const disp_cc_0_debug_mux_parent_names[] = {
  249. "mdss_0_disp_cc_mdss_accu_clk",
  250. "mdss_0_disp_cc_mdss_ahb1_clk",
  251. "mdss_0_disp_cc_mdss_ahb_clk",
  252. "mdss_0_disp_cc_mdss_byte0_clk",
  253. "mdss_0_disp_cc_mdss_byte0_intf_clk",
  254. "mdss_0_disp_cc_mdss_byte1_clk",
  255. "mdss_0_disp_cc_mdss_byte1_intf_clk",
  256. "mdss_0_disp_cc_mdss_dptx0_aux_clk",
  257. "mdss_0_disp_cc_mdss_dptx0_crypto_clk",
  258. "mdss_0_disp_cc_mdss_dptx0_link_clk",
  259. "mdss_0_disp_cc_mdss_dptx0_link_intf_clk",
  260. "mdss_0_disp_cc_mdss_dptx0_pixel0_clk",
  261. "mdss_0_disp_cc_mdss_dptx0_pixel1_clk",
  262. "mdss_0_disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  263. "mdss_0_disp_cc_mdss_dptx1_aux_clk",
  264. "mdss_0_disp_cc_mdss_dptx1_crypto_clk",
  265. "mdss_0_disp_cc_mdss_dptx1_link_clk",
  266. "mdss_0_disp_cc_mdss_dptx1_link_intf_clk",
  267. "mdss_0_disp_cc_mdss_dptx1_pixel0_clk",
  268. "mdss_0_disp_cc_mdss_dptx1_pixel1_clk",
  269. "mdss_0_disp_cc_mdss_dptx1_usb_router_link_intf_clk",
  270. "mdss_0_disp_cc_mdss_dptx2_aux_clk",
  271. "mdss_0_disp_cc_mdss_dptx2_crypto_clk",
  272. "mdss_0_disp_cc_mdss_dptx2_link_clk",
  273. "mdss_0_disp_cc_mdss_dptx2_link_intf_clk",
  274. "mdss_0_disp_cc_mdss_dptx2_pixel0_clk",
  275. "mdss_0_disp_cc_mdss_dptx2_pixel1_clk",
  276. "mdss_0_disp_cc_mdss_dptx3_aux_clk",
  277. "mdss_0_disp_cc_mdss_dptx3_crypto_clk",
  278. "mdss_0_disp_cc_mdss_dptx3_link_clk",
  279. "mdss_0_disp_cc_mdss_dptx3_link_intf_clk",
  280. "mdss_0_disp_cc_mdss_dptx3_pixel0_clk",
  281. "mdss_0_disp_cc_mdss_esc0_clk",
  282. "mdss_0_disp_cc_mdss_esc1_clk",
  283. "mdss_0_disp_cc_mdss_mdp1_clk",
  284. "mdss_0_disp_cc_mdss_mdp_clk",
  285. "mdss_0_disp_cc_mdss_mdp_lut1_clk",
  286. "mdss_0_disp_cc_mdss_mdp_lut_clk",
  287. "mdss_0_disp_cc_mdss_non_gdsc_ahb_clk",
  288. "mdss_0_disp_cc_mdss_pclk0_clk",
  289. "mdss_0_disp_cc_mdss_pclk1_clk",
  290. "mdss_0_disp_cc_mdss_rscc_ahb_clk",
  291. "mdss_0_disp_cc_mdss_rscc_vsync_clk",
  292. "mdss_0_disp_cc_mdss_vsync1_clk",
  293. "mdss_0_disp_cc_mdss_vsync_clk",
  294. "measure_only_mdss_0_disp_cc_sleep_clk",
  295. "measure_only_mdss_0_disp_cc_xo_clk",
  296. };
  297. static int disp_cc_0_debug_mux_sels[] = {
  298. 0x70, /* mdss_0_disp_cc_mdss_accu_clk */
  299. 0x5D, /* mdss_0_disp_cc_mdss_ahb1_clk */
  300. 0x5A, /* mdss_0_disp_cc_mdss_ahb_clk */
  301. 0x20, /* mdss_0_disp_cc_mdss_byte0_clk */
  302. 0x21, /* mdss_0_disp_cc_mdss_byte0_intf_clk */
  303. 0x22, /* mdss_0_disp_cc_mdss_byte1_clk */
  304. 0x23, /* mdss_0_disp_cc_mdss_byte1_intf_clk */
  305. 0x51, /* mdss_0_disp_cc_mdss_dptx0_aux_clk */
  306. 0x33, /* mdss_0_disp_cc_mdss_dptx0_crypto_clk */
  307. 0x30, /* mdss_0_disp_cc_mdss_dptx0_link_clk */
  308. 0x32, /* mdss_0_disp_cc_mdss_dptx0_link_intf_clk */
  309. 0x3C, /* mdss_0_disp_cc_mdss_dptx0_pixel0_clk */
  310. 0x3D, /* mdss_0_disp_cc_mdss_dptx0_pixel1_clk */
  311. 0x31, /* mdss_0_disp_cc_mdss_dptx0_usb_router_link_intf_clk */
  312. 0x52, /* mdss_0_disp_cc_mdss_dptx1_aux_clk */
  313. 0x37, /* mdss_0_disp_cc_mdss_dptx1_crypto_clk */
  314. 0x34, /* mdss_0_disp_cc_mdss_dptx1_link_clk */
  315. 0x36, /* mdss_0_disp_cc_mdss_dptx1_link_intf_clk */
  316. 0x3E, /* mdss_0_disp_cc_mdss_dptx1_pixel0_clk */
  317. 0x3F, /* mdss_0_disp_cc_mdss_dptx1_pixel1_clk */
  318. 0x35, /* mdss_0_disp_cc_mdss_dptx1_usb_router_link_intf_clk */
  319. 0x53, /* mdss_0_disp_cc_mdss_dptx2_aux_clk */
  320. 0x44, /* mdss_0_disp_cc_mdss_dptx2_crypto_clk */
  321. 0x42, /* mdss_0_disp_cc_mdss_dptx2_link_clk */
  322. 0x43, /* mdss_0_disp_cc_mdss_dptx2_link_intf_clk */
  323. 0x40, /* mdss_0_disp_cc_mdss_dptx2_pixel0_clk */
  324. 0x41, /* mdss_0_disp_cc_mdss_dptx2_pixel1_clk */
  325. 0x54, /* mdss_0_disp_cc_mdss_dptx3_aux_clk */
  326. 0x4B, /* mdss_0_disp_cc_mdss_dptx3_crypto_clk */
  327. 0x49, /* mdss_0_disp_cc_mdss_dptx3_link_clk */
  328. 0x4A, /* mdss_0_disp_cc_mdss_dptx3_link_intf_clk */
  329. 0x48, /* mdss_0_disp_cc_mdss_dptx3_pixel0_clk */
  330. 0x28, /* mdss_0_disp_cc_mdss_esc0_clk */
  331. 0x29, /* mdss_0_disp_cc_mdss_esc1_clk */
  332. 0x5B, /* mdss_0_disp_cc_mdss_mdp1_clk */
  333. 0x58, /* mdss_0_disp_cc_mdss_mdp_clk */
  334. 0x5C, /* mdss_0_disp_cc_mdss_mdp_lut1_clk */
  335. 0x59, /* mdss_0_disp_cc_mdss_mdp_lut_clk */
  336. 0x5E, /* mdss_0_disp_cc_mdss_non_gdsc_ahb_clk */
  337. 0x24, /* mdss_0_disp_cc_mdss_pclk0_clk */
  338. 0x25, /* mdss_0_disp_cc_mdss_pclk1_clk */
  339. 0x5F, /* mdss_0_disp_cc_mdss_rscc_ahb_clk */
  340. 0x56, /* mdss_0_disp_cc_mdss_rscc_vsync_clk */
  341. 0x55, /* mdss_0_disp_cc_mdss_vsync1_clk */
  342. 0x50, /* mdss_0_disp_cc_mdss_vsync_clk */
  343. 0x67, /* measure_only_mdss_0_disp_cc_sleep_clk */
  344. 0x57, /* measure_only_mdss_0_disp_cc_xo_clk */
  345. };
  346. static struct clk_debug_mux disp_cc_0_debug_mux = {
  347. .priv = &debug_mux_priv,
  348. .debug_offset = 0x11000,
  349. .post_div_offset = 0xD000,
  350. .cbcr_offset = 0xD004,
  351. .src_sel_mask = 0x1FF,
  352. .src_sel_shift = 0,
  353. .post_div_mask = 0xF,
  354. .post_div_shift = 0,
  355. .post_div_val = 4,
  356. .mux_sels = disp_cc_0_debug_mux_sels,
  357. .num_mux_sels = ARRAY_SIZE(disp_cc_0_debug_mux_sels),
  358. .hw.init = &(const struct clk_init_data){
  359. .name = "disp_cc_0_debug_mux",
  360. .ops = &clk_debug_mux_ops,
  361. .parent_names = disp_cc_0_debug_mux_parent_names,
  362. .num_parents = ARRAY_SIZE(disp_cc_0_debug_mux_parent_names),
  363. },
  364. };
  365. static const char *const disp_cc_1_debug_mux_parent_names[] = {
  366. "mdss_1_disp_cc_mdss_accu_clk",
  367. "mdss_1_disp_cc_mdss_ahb1_clk",
  368. "mdss_1_disp_cc_mdss_ahb_clk",
  369. "mdss_1_disp_cc_mdss_byte0_clk",
  370. "mdss_1_disp_cc_mdss_byte0_intf_clk",
  371. "mdss_1_disp_cc_mdss_byte1_clk",
  372. "mdss_1_disp_cc_mdss_byte1_intf_clk",
  373. "mdss_1_disp_cc_mdss_dptx0_aux_clk",
  374. "mdss_1_disp_cc_mdss_dptx0_crypto_clk",
  375. "mdss_1_disp_cc_mdss_dptx0_link_clk",
  376. "mdss_1_disp_cc_mdss_dptx0_link_intf_clk",
  377. "mdss_1_disp_cc_mdss_dptx0_pixel0_clk",
  378. "mdss_1_disp_cc_mdss_dptx0_pixel1_clk",
  379. "mdss_1_disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  380. "mdss_1_disp_cc_mdss_dptx1_aux_clk",
  381. "mdss_1_disp_cc_mdss_dptx1_crypto_clk",
  382. "mdss_1_disp_cc_mdss_dptx1_link_clk",
  383. "mdss_1_disp_cc_mdss_dptx1_link_intf_clk",
  384. "mdss_1_disp_cc_mdss_dptx1_pixel0_clk",
  385. "mdss_1_disp_cc_mdss_dptx1_pixel1_clk",
  386. "mdss_1_disp_cc_mdss_dptx1_usb_router_link_intf_clk",
  387. "mdss_1_disp_cc_mdss_dptx2_aux_clk",
  388. "mdss_1_disp_cc_mdss_dptx2_crypto_clk",
  389. "mdss_1_disp_cc_mdss_dptx2_link_clk",
  390. "mdss_1_disp_cc_mdss_dptx2_link_intf_clk",
  391. "mdss_1_disp_cc_mdss_dptx2_pixel0_clk",
  392. "mdss_1_disp_cc_mdss_dptx2_pixel1_clk",
  393. "mdss_1_disp_cc_mdss_dptx3_aux_clk",
  394. "mdss_1_disp_cc_mdss_dptx3_crypto_clk",
  395. "mdss_1_disp_cc_mdss_dptx3_link_clk",
  396. "mdss_1_disp_cc_mdss_dptx3_link_intf_clk",
  397. "mdss_1_disp_cc_mdss_dptx3_pixel0_clk",
  398. "mdss_1_disp_cc_mdss_esc0_clk",
  399. "mdss_1_disp_cc_mdss_esc1_clk",
  400. "mdss_1_disp_cc_mdss_mdp1_clk",
  401. "mdss_1_disp_cc_mdss_mdp_clk",
  402. "mdss_1_disp_cc_mdss_mdp_lut1_clk",
  403. "mdss_1_disp_cc_mdss_mdp_lut_clk",
  404. "mdss_1_disp_cc_mdss_non_gdsc_ahb_clk",
  405. "mdss_1_disp_cc_mdss_pclk0_clk",
  406. "mdss_1_disp_cc_mdss_pclk1_clk",
  407. "mdss_1_disp_cc_mdss_rscc_ahb_clk",
  408. "mdss_1_disp_cc_mdss_rscc_vsync_clk",
  409. "mdss_1_disp_cc_mdss_vsync1_clk",
  410. "mdss_1_disp_cc_mdss_vsync_clk",
  411. "measure_only_mdss_1_disp_cc_sleep_clk",
  412. "measure_only_mdss_1_disp_cc_xo_clk",
  413. };
  414. static int disp_cc_1_debug_mux_sels[] = {
  415. 0x70, /* mdss_1_disp_cc_mdss_accu_clk */
  416. 0x5D, /* mdss_1_disp_cc_mdss_ahb1_clk */
  417. 0x5A, /* mdss_1_disp_cc_mdss_ahb_clk */
  418. 0x20, /* mdss_1_disp_cc_mdss_byte0_clk */
  419. 0x21, /* mdss_1_disp_cc_mdss_byte0_intf_clk */
  420. 0x22, /* mdss_1_disp_cc_mdss_byte1_clk */
  421. 0x23, /* mdss_1_disp_cc_mdss_byte1_intf_clk */
  422. 0x51, /* mdss_1_disp_cc_mdss_dptx0_aux_clk */
  423. 0x33, /* mdss_1_disp_cc_mdss_dptx0_crypto_clk */
  424. 0x30, /* mdss_1_disp_cc_mdss_dptx0_link_clk */
  425. 0x32, /* mdss_1_disp_cc_mdss_dptx0_link_intf_clk */
  426. 0x3C, /* mdss_1_disp_cc_mdss_dptx0_pixel0_clk */
  427. 0x3D, /* mdss_1_disp_cc_mdss_dptx0_pixel1_clk */
  428. 0x31, /* mdss_1_disp_cc_mdss_dptx0_usb_router_link_intf_clk */
  429. 0x52, /* mdss_1_disp_cc_mdss_dptx1_aux_clk */
  430. 0x37, /* mdss_1_disp_cc_mdss_dptx1_crypto_clk */
  431. 0x34, /* mdss_1_disp_cc_mdss_dptx1_link_clk */
  432. 0x36, /* mdss_1_disp_cc_mdss_dptx1_link_intf_clk */
  433. 0x3E, /* mdss_1_disp_cc_mdss_dptx1_pixel0_clk */
  434. 0x3F, /* mdss_1_disp_cc_mdss_dptx1_pixel1_clk */
  435. 0x35, /* mdss_1_disp_cc_mdss_dptx1_usb_router_link_intf_clk */
  436. 0x53, /* mdss_1_disp_cc_mdss_dptx2_aux_clk */
  437. 0x44, /* mdss_1_disp_cc_mdss_dptx2_crypto_clk */
  438. 0x42, /* mdss_1_disp_cc_mdss_dptx2_link_clk */
  439. 0x43, /* mdss_1_disp_cc_mdss_dptx2_link_intf_clk */
  440. 0x40, /* mdss_1_disp_cc_mdss_dptx2_pixel0_clk */
  441. 0x41, /* mdss_1_disp_cc_mdss_dptx2_pixel1_clk */
  442. 0x54, /* mdss_1_disp_cc_mdss_dptx3_aux_clk */
  443. 0x4B, /* mdss_1_disp_cc_mdss_dptx3_crypto_clk */
  444. 0x49, /* mdss_1_disp_cc_mdss_dptx3_link_clk */
  445. 0x4A, /* mdss_1_disp_cc_mdss_dptx3_link_intf_clk */
  446. 0x48, /* mdss_1_disp_cc_mdss_dptx3_pixel0_clk */
  447. 0x28, /* mdss_1_disp_cc_mdss_esc0_clk */
  448. 0x29, /* mdss_1_disp_cc_mdss_esc1_clk */
  449. 0x5B, /* mdss_1_disp_cc_mdss_mdp1_clk */
  450. 0x58, /* mdss_1_disp_cc_mdss_mdp_clk */
  451. 0x5C, /* mdss_1_disp_cc_mdss_mdp_lut1_clk */
  452. 0x59, /* mdss_1_disp_cc_mdss_mdp_lut_clk */
  453. 0x5E, /* mdss_1_disp_cc_mdss_non_gdsc_ahb_clk */
  454. 0x24, /* mdss_1_disp_cc_mdss_pclk0_clk */
  455. 0x25, /* mdss_1_disp_cc_mdss_pclk1_clk */
  456. 0x5F, /* mdss_1_disp_cc_mdss_rscc_ahb_clk */
  457. 0x56, /* mdss_1_disp_cc_mdss_rscc_vsync_clk */
  458. 0x55, /* mdss_1_disp_cc_mdss_vsync1_clk */
  459. 0x50, /* mdss_1_disp_cc_mdss_vsync_clk */
  460. 0x67, /* measure_only_mdss_1_disp_cc_sleep_clk */
  461. 0x57, /* measure_only_mdss_1_disp_cc_xo_clk */
  462. };
  463. static struct clk_debug_mux disp_cc_1_debug_mux = {
  464. .priv = &debug_mux_priv,
  465. .debug_offset = 0x11000,
  466. .post_div_offset = 0xD000,
  467. .cbcr_offset = 0xD004,
  468. .src_sel_mask = 0x1FF,
  469. .src_sel_shift = 0,
  470. .post_div_mask = 0xF,
  471. .post_div_shift = 0,
  472. .post_div_val = 4,
  473. .mux_sels = disp_cc_1_debug_mux_sels,
  474. .num_mux_sels = ARRAY_SIZE(disp_cc_1_debug_mux_sels),
  475. .hw.init = &(const struct clk_init_data){
  476. .name = "disp_cc_1_debug_mux",
  477. .ops = &clk_debug_mux_ops,
  478. .parent_names = disp_cc_1_debug_mux_parent_names,
  479. .num_parents = ARRAY_SIZE(disp_cc_1_debug_mux_parent_names),
  480. },
  481. };
  482. static const char *const gcc_debug_mux_parent_names[] = {
  483. "apss_cc_debug_mux",
  484. "cam_cc_debug_mux",
  485. "disp_cc_0_debug_mux",
  486. "disp_cc_1_debug_mux",
  487. "gcc_aggre_noc_pcie_axi_clk",
  488. "gcc_aggre_ufs_phy_axi_clk",
  489. "gcc_aggre_usb3_prim_axi_clk",
  490. "gcc_aggre_usb3_sec_axi_clk",
  491. "gcc_boot_rom_ahb_clk",
  492. "gcc_camera_hf_axi_clk",
  493. "gcc_camera_sf_axi_clk",
  494. "gcc_cfg_noc_pcie_anoc_ahb_clk",
  495. "gcc_cfg_noc_usb3_prim_axi_clk",
  496. "gcc_cfg_noc_usb3_sec_axi_clk",
  497. "gcc_cnoc_pcie_sf_axi_clk",
  498. "gcc_ddrss_gpu_axi_clk",
  499. "gcc_ddrss_pcie_sf_qtb_clk",
  500. "gcc_disp_0_hf_axi_clk",
  501. "gcc_disp_1_hf_axi_clk",
  502. "gcc_gp10_clk",
  503. "gcc_gp11_clk",
  504. "gcc_gp1_clk",
  505. "gcc_gp2_clk",
  506. "gcc_gp3_clk",
  507. "gcc_gp4_clk",
  508. "gcc_gp5_clk",
  509. "gcc_gp6_clk",
  510. "gcc_gp7_clk",
  511. "gcc_gp8_clk",
  512. "gcc_gp9_clk",
  513. "gcc_gpu_gpll0_clk_src",
  514. "gcc_gpu_gpll0_div_clk_src",
  515. "gcc_gpu_memnoc_gfx_clk",
  516. "gcc_pcie_0_aux_clk",
  517. "gcc_pcie_0_cfg_ahb_clk",
  518. "gcc_pcie_0_mstr_axi_clk",
  519. "gcc_pcie_0_phy_rchng_clk",
  520. "gcc_pcie_0_pipe_clk",
  521. "gcc_pcie_0_pipe_div2_clk",
  522. "gcc_pcie_0_slv_axi_clk",
  523. "gcc_pcie_0_slv_q2a_axi_clk",
  524. "gcc_pcie_1_aux_clk",
  525. "gcc_pcie_1_cfg_ahb_clk",
  526. "gcc_pcie_1_mstr_axi_clk",
  527. "gcc_pcie_1_phy_aux_clk",
  528. "gcc_pcie_1_phy_rchng_clk",
  529. "gcc_pcie_1_pipe_clk",
  530. "gcc_pcie_1_pipe_div2_clk",
  531. "gcc_pcie_1_slv_axi_clk",
  532. "gcc_pcie_1_slv_q2a_axi_clk",
  533. "gcc_pcie_2_aux_clk",
  534. "gcc_pcie_2_cfg_ahb_clk",
  535. "gcc_pcie_2_mstr_axi_clk",
  536. "gcc_pcie_2_phy_aux_clk",
  537. "gcc_pcie_2_phy_rchng_clk",
  538. "gcc_pcie_2_pipe_clk",
  539. "gcc_pcie_2_pipe_div2_clk",
  540. "gcc_pcie_2_slv_axi_clk",
  541. "gcc_pcie_2_slv_q2a_axi_clk",
  542. "gcc_pcie_rscc_cfg_ahb_clk",
  543. "gcc_pdm2_clk",
  544. "gcc_pdm_ahb_clk",
  545. "gcc_pdm_xo4_clk",
  546. "gcc_pwm0_xo512_clk",
  547. "gcc_qmip_camera_nrt_ahb_clk",
  548. "gcc_qmip_camera_rt_ahb_clk",
  549. "gcc_qmip_disp_ahb_clk",
  550. "gcc_qmip_gpu_ahb_clk",
  551. "gcc_qmip_pcie_ahb_clk",
  552. "gcc_qmip_video_cv_cpu_ahb_clk",
  553. "gcc_qmip_video_cvp_ahb_clk",
  554. "gcc_qmip_video_v_cpu_ahb_clk",
  555. "gcc_qmip_video_vcodec_ahb_clk",
  556. "gcc_qupv3_wrap1_core_2x_clk",
  557. "gcc_qupv3_wrap1_core_clk",
  558. "gcc_qupv3_wrap1_qspi_ref_clk",
  559. "gcc_qupv3_wrap1_s0_clk",
  560. "gcc_qupv3_wrap1_s1_clk",
  561. "gcc_qupv3_wrap1_s2_clk",
  562. "gcc_qupv3_wrap1_s3_clk",
  563. "gcc_qupv3_wrap2_core_2x_clk",
  564. "gcc_qupv3_wrap2_core_clk",
  565. "gcc_qupv3_wrap2_qspi_ref_clk",
  566. "gcc_qupv3_wrap2_s0_clk",
  567. "gcc_qupv3_wrap2_s1_clk",
  568. "gcc_qupv3_wrap2_s2_clk",
  569. "gcc_qupv3_wrap2_s3_clk",
  570. "gcc_qupv3_wrap2_s4_clk",
  571. "gcc_qupv3_wrap2_s5_clk",
  572. "gcc_qupv3_wrap2_s6_clk",
  573. "gcc_qupv3_wrap2_s7_clk",
  574. "gcc_qupv3_wrap3_core_2x_clk",
  575. "gcc_qupv3_wrap3_core_clk",
  576. "gcc_qupv3_wrap3_qspi_ref_clk",
  577. "gcc_qupv3_wrap3_s0_clk",
  578. "gcc_qupv3_wrap3_s1_clk",
  579. "gcc_qupv3_wrap3_s2_clk",
  580. "gcc_qupv3_wrap3_s3_clk",
  581. "gcc_qupv3_wrap_1_m_ahb_clk",
  582. "gcc_qupv3_wrap_1_s_ahb_clk",
  583. "gcc_qupv3_wrap_2_m_ahb_clk",
  584. "gcc_qupv3_wrap_2_s_ahb_clk",
  585. "gcc_qupv3_wrap_3_m_ahb_clk",
  586. "gcc_qupv3_wrap_3_s_ahb_clk",
  587. "gcc_sdcc2_ahb_clk",
  588. "gcc_sdcc2_apps_clk",
  589. "gcc_ufs_phy_ahb_clk",
  590. "gcc_ufs_phy_axi_clk",
  591. "gcc_ufs_phy_ice_core_clk",
  592. "gcc_ufs_phy_phy_aux_clk",
  593. "gcc_ufs_phy_rx_symbol_0_clk",
  594. "gcc_ufs_phy_rx_symbol_1_clk",
  595. "gcc_ufs_phy_tx_symbol_0_clk",
  596. "gcc_ufs_phy_unipro_core_clk",
  597. "gcc_usb30_prim_atb_clk",
  598. "gcc_usb30_prim_master_clk",
  599. "gcc_usb30_prim_mock_utmi_clk",
  600. "gcc_usb30_prim_sleep_clk",
  601. "gcc_usb30_sec_master_clk",
  602. "gcc_usb30_sec_mock_utmi_clk",
  603. "gcc_usb30_sec_sleep_clk",
  604. "gcc_usb3_prim_phy_aux_clk",
  605. "gcc_usb3_prim_phy_com_aux_clk",
  606. "gcc_usb3_prim_phy_pipe_clk",
  607. "gcc_usb3_sec_phy_aux_clk",
  608. "gcc_usb3_sec_phy_com_aux_clk",
  609. "gcc_usb3_sec_phy_pipe_clk",
  610. "gcc_video_axi0_clk",
  611. "gcc_video_axi1_clk",
  612. "gpu_cc_debug_mux",
  613. "mc_cc_debug_mux",
  614. "measure_only_cnoc_clk",
  615. "measure_only_gcc_camera_ahb_clk",
  616. "measure_only_gcc_camera_xo_clk",
  617. "measure_only_gcc_disp_0_ahb_clk",
  618. "measure_only_gcc_disp_0_xo_clk",
  619. "measure_only_gcc_disp_1_ahb_clk",
  620. "measure_only_gcc_disp_1_xo_clk",
  621. "measure_only_gcc_gpu_cfg_ahb_clk",
  622. "measure_only_gcc_pcie_rscc_xo_clk",
  623. "measure_only_gcc_video_ahb_clk",
  624. "measure_only_gcc_video_xo_clk",
  625. "measure_only_ipa_2x_clk",
  626. "measure_only_memnoc_clk",
  627. "measure_only_pcie_0_pipe_clk",
  628. "measure_only_pcie_1_phy_aux_clk",
  629. "measure_only_pcie_1_pipe_clk",
  630. "measure_only_pcie_2_phy_aux_clk",
  631. "measure_only_pcie_2_pipe_clk",
  632. "measure_only_snoc_clk",
  633. "measure_only_ufs_phy_rx_symbol_0_clk",
  634. "measure_only_ufs_phy_rx_symbol_1_clk",
  635. "measure_only_ufs_phy_tx_symbol_0_clk",
  636. "measure_only_usb3_phy_wrapper_gcc_usb30_pipe_clk",
  637. "measure_only_usb3_sec_phy_wrapper_gcc_usb30_pipe_clk",
  638. "video_cc_debug_mux",
  639. };
  640. static int gcc_debug_mux_sels[] = {
  641. 0x15C, /* apss_cc_debug_mux */
  642. 0x88, /* cam_cc_debug_mux */
  643. 0x8E, /* disp_cc_0_debug_mux */
  644. 0x93, /* disp_cc_1_debug_mux */
  645. 0x4F, /* gcc_aggre_noc_pcie_axi_clk */
  646. 0x52, /* gcc_aggre_ufs_phy_axi_clk */
  647. 0x50, /* gcc_aggre_usb3_prim_axi_clk */
  648. 0x51, /* gcc_aggre_usb3_sec_axi_clk */
  649. 0x10E, /* gcc_boot_rom_ahb_clk */
  650. 0x84, /* gcc_camera_hf_axi_clk */
  651. 0x85, /* gcc_camera_sf_axi_clk */
  652. 0x3B, /* gcc_cfg_noc_pcie_anoc_ahb_clk */
  653. 0x21, /* gcc_cfg_noc_usb3_prim_axi_clk */
  654. 0x22, /* gcc_cfg_noc_usb3_sec_axi_clk */
  655. 0x19, /* gcc_cnoc_pcie_sf_axi_clk */
  656. 0x129, /* gcc_ddrss_gpu_axi_clk */
  657. 0x12A, /* gcc_ddrss_pcie_sf_qtb_clk */
  658. 0x8B, /* gcc_disp_0_hf_axi_clk */
  659. 0x90, /* gcc_disp_1_hf_axi_clk */
  660. 0x178, /* gcc_gp10_clk */
  661. 0x179, /* gcc_gp11_clk */
  662. 0x16F, /* gcc_gp1_clk */
  663. 0x170, /* gcc_gp2_clk */
  664. 0x171, /* gcc_gp3_clk */
  665. 0x172, /* gcc_gp4_clk */
  666. 0x173, /* gcc_gp5_clk */
  667. 0x174, /* gcc_gp6_clk */
  668. 0x175, /* gcc_gp7_clk */
  669. 0x176, /* gcc_gp8_clk */
  670. 0x177, /* gcc_gp9_clk */
  671. 0x1CA, /* gcc_gpu_gpll0_clk_src */
  672. 0x1CB, /* gcc_gpu_gpll0_div_clk_src */
  673. 0x1C8, /* gcc_gpu_memnoc_gfx_clk */
  674. 0x17F, /* gcc_pcie_0_aux_clk */
  675. 0x17E, /* gcc_pcie_0_cfg_ahb_clk */
  676. 0x17D, /* gcc_pcie_0_mstr_axi_clk */
  677. 0x182, /* gcc_pcie_0_phy_rchng_clk */
  678. 0x180, /* gcc_pcie_0_pipe_clk */
  679. 0x181, /* gcc_pcie_0_pipe_div2_clk */
  680. 0x17C, /* gcc_pcie_0_slv_axi_clk */
  681. 0x17B, /* gcc_pcie_0_slv_q2a_axi_clk */
  682. 0x189, /* gcc_pcie_1_aux_clk */
  683. 0x188, /* gcc_pcie_1_cfg_ahb_clk */
  684. 0x187, /* gcc_pcie_1_mstr_axi_clk */
  685. 0x190, /* gcc_pcie_1_phy_aux_clk */
  686. 0x18C, /* gcc_pcie_1_phy_rchng_clk */
  687. 0x18A, /* gcc_pcie_1_pipe_clk */
  688. 0x18B, /* gcc_pcie_1_pipe_div2_clk */
  689. 0x186, /* gcc_pcie_1_slv_axi_clk */
  690. 0x185, /* gcc_pcie_1_slv_q2a_axi_clk */
  691. 0x195, /* gcc_pcie_2_aux_clk */
  692. 0x194, /* gcc_pcie_2_cfg_ahb_clk */
  693. 0x193, /* gcc_pcie_2_mstr_axi_clk */
  694. 0x196, /* gcc_pcie_2_phy_aux_clk */
  695. 0x199, /* gcc_pcie_2_phy_rchng_clk */
  696. 0x197, /* gcc_pcie_2_pipe_clk */
  697. 0x198, /* gcc_pcie_2_pipe_div2_clk */
  698. 0x192, /* gcc_pcie_2_slv_axi_clk */
  699. 0x191, /* gcc_pcie_2_slv_q2a_axi_clk */
  700. 0x1E7, /* gcc_pcie_rscc_cfg_ahb_clk */
  701. 0xFD, /* gcc_pdm2_clk */
  702. 0xFB, /* gcc_pdm_ahb_clk */
  703. 0xFC, /* gcc_pdm_xo4_clk */
  704. 0xFE, /* gcc_pwm0_xo512_clk */
  705. 0x82, /* gcc_qmip_camera_nrt_ahb_clk */
  706. 0x83, /* gcc_qmip_camera_rt_ahb_clk */
  707. 0x8A, /* gcc_qmip_disp_ahb_clk */
  708. 0x1C5, /* gcc_qmip_gpu_ahb_clk */
  709. 0x17A, /* gcc_qmip_pcie_ahb_clk */
  710. 0x98, /* gcc_qmip_video_cv_cpu_ahb_clk */
  711. 0x95, /* gcc_qmip_video_cvp_ahb_clk */
  712. 0x97, /* gcc_qmip_video_v_cpu_ahb_clk */
  713. 0x96, /* gcc_qmip_video_vcodec_ahb_clk */
  714. 0xDF, /* gcc_qupv3_wrap1_core_2x_clk */
  715. 0xDE, /* gcc_qupv3_wrap1_core_clk */
  716. 0xE4, /* gcc_qupv3_wrap1_qspi_ref_clk */
  717. 0xE0, /* gcc_qupv3_wrap1_s0_clk */
  718. 0xE1, /* gcc_qupv3_wrap1_s1_clk */
  719. 0xE2, /* gcc_qupv3_wrap1_s2_clk */
  720. 0xE3, /* gcc_qupv3_wrap1_s3_clk */
  721. 0xE8, /* gcc_qupv3_wrap2_core_2x_clk */
  722. 0xE7, /* gcc_qupv3_wrap2_core_clk */
  723. 0xF1, /* gcc_qupv3_wrap2_qspi_ref_clk */
  724. 0xE9, /* gcc_qupv3_wrap2_s0_clk */
  725. 0xEA, /* gcc_qupv3_wrap2_s1_clk */
  726. 0xEB, /* gcc_qupv3_wrap2_s2_clk */
  727. 0xEC, /* gcc_qupv3_wrap2_s3_clk */
  728. 0xED, /* gcc_qupv3_wrap2_s4_clk */
  729. 0xEE, /* gcc_qupv3_wrap2_s5_clk */
  730. 0xEF, /* gcc_qupv3_wrap2_s6_clk */
  731. 0xF0, /* gcc_qupv3_wrap2_s7_clk */
  732. 0xF5, /* gcc_qupv3_wrap3_core_2x_clk */
  733. 0xF4, /* gcc_qupv3_wrap3_core_clk */
  734. 0xFA, /* gcc_qupv3_wrap3_qspi_ref_clk */
  735. 0xF6, /* gcc_qupv3_wrap3_s0_clk */
  736. 0xF7, /* gcc_qupv3_wrap3_s1_clk */
  737. 0xF8, /* gcc_qupv3_wrap3_s2_clk */
  738. 0xF9, /* gcc_qupv3_wrap3_s3_clk */
  739. 0xDC, /* gcc_qupv3_wrap_1_m_ahb_clk */
  740. 0xDD, /* gcc_qupv3_wrap_1_s_ahb_clk */
  741. 0xE5, /* gcc_qupv3_wrap_2_m_ahb_clk */
  742. 0xE6, /* gcc_qupv3_wrap_2_s_ahb_clk */
  743. 0xF2, /* gcc_qupv3_wrap_3_m_ahb_clk */
  744. 0xF3, /* gcc_qupv3_wrap_3_s_ahb_clk */
  745. 0xDA, /* gcc_sdcc2_ahb_clk */
  746. 0xD9, /* gcc_sdcc2_apps_clk */
  747. 0x19E, /* gcc_ufs_phy_ahb_clk */
  748. 0x19D, /* gcc_ufs_phy_axi_clk */
  749. 0x1A4, /* gcc_ufs_phy_ice_core_clk */
  750. 0x1A5, /* gcc_ufs_phy_phy_aux_clk */
  751. 0x1A0, /* gcc_ufs_phy_rx_symbol_0_clk */
  752. 0x1A6, /* gcc_ufs_phy_rx_symbol_1_clk */
  753. 0x19F, /* gcc_ufs_phy_tx_symbol_0_clk */
  754. 0x1A3, /* gcc_ufs_phy_unipro_core_clk */
  755. 0xCB, /* gcc_usb30_prim_atb_clk */
  756. 0xC2, /* gcc_usb30_prim_master_clk */
  757. 0xC4, /* gcc_usb30_prim_mock_utmi_clk */
  758. 0xC3, /* gcc_usb30_prim_sleep_clk */
  759. 0xCF, /* gcc_usb30_sec_master_clk */
  760. 0xD1, /* gcc_usb30_sec_mock_utmi_clk */
  761. 0xD0, /* gcc_usb30_sec_sleep_clk */
  762. 0xC5, /* gcc_usb3_prim_phy_aux_clk */
  763. 0xC6, /* gcc_usb3_prim_phy_com_aux_clk */
  764. 0xC7, /* gcc_usb3_prim_phy_pipe_clk */
  765. 0xD2, /* gcc_usb3_sec_phy_aux_clk */
  766. 0xD3, /* gcc_usb3_sec_phy_com_aux_clk */
  767. 0xD4, /* gcc_usb3_sec_phy_pipe_clk */
  768. 0x99, /* gcc_video_axi0_clk */
  769. 0x9B, /* gcc_video_axi1_clk */
  770. 0x1C7, /* gpu_cc_debug_mux */
  771. 0x135, /* mc_cc_debug_mux */
  772. 0x16, /* measure_only_cnoc_clk */
  773. 0x81, /* measure_only_gcc_camera_ahb_clk */
  774. 0x87, /* measure_only_gcc_camera_xo_clk */
  775. 0x89, /* measure_only_gcc_disp_0_ahb_clk */
  776. 0x8C, /* measure_only_gcc_disp_0_xo_clk */
  777. 0x8F, /* measure_only_gcc_disp_1_ahb_clk */
  778. 0x91, /* measure_only_gcc_disp_1_xo_clk */
  779. 0x1C4, /* measure_only_gcc_gpu_cfg_ahb_clk */
  780. 0x1E8, /* measure_only_gcc_pcie_rscc_xo_clk */
  781. 0x94, /* measure_only_gcc_video_ahb_clk */
  782. 0x9D, /* measure_only_gcc_video_xo_clk */
  783. 0x1BB, /* measure_only_ipa_2x_clk */
  784. 0x12E, /* measure_only_memnoc_clk */
  785. 0x183, /* measure_only_pcie_0_pipe_clk */
  786. 0x18F, /* measure_only_pcie_1_phy_aux_clk */
  787. 0x18D, /* measure_only_pcie_1_pipe_clk */
  788. 0x19B, /* measure_only_pcie_2_phy_aux_clk */
  789. 0x19A, /* measure_only_pcie_2_pipe_clk */
  790. 0xB, /* measure_only_snoc_clk */
  791. 0x1A2, /* measure_only_ufs_phy_rx_symbol_0_clk */
  792. 0x1A8, /* measure_only_ufs_phy_rx_symbol_1_clk */
  793. 0x1A1, /* measure_only_ufs_phy_tx_symbol_0_clk */
  794. 0xCC, /* measure_only_usb3_phy_wrapper_gcc_usb30_pipe_clk */
  795. 0xD6, /* measure_only_usb3_sec_phy_wrapper_gcc_usb30_pipe_clk */
  796. 0x9E, /* video_cc_debug_mux */
  797. };
  798. static struct clk_debug_mux gcc_debug_mux = {
  799. .priv = &debug_mux_priv,
  800. .debug_offset = 0x62024,
  801. .post_div_offset = 0x62000,
  802. .cbcr_offset = 0x62004,
  803. .src_sel_mask = 0x3FF,
  804. .src_sel_shift = 0,
  805. .post_div_mask = 0xF,
  806. .post_div_shift = 0,
  807. .post_div_val = 2,
  808. .mux_sels = gcc_debug_mux_sels,
  809. .num_mux_sels = ARRAY_SIZE(gcc_debug_mux_sels),
  810. .hw.init = &(const struct clk_init_data){
  811. .name = "gcc_debug_mux",
  812. .ops = &clk_debug_mux_ops,
  813. .parent_names = gcc_debug_mux_parent_names,
  814. .num_parents = ARRAY_SIZE(gcc_debug_mux_parent_names),
  815. },
  816. };
  817. static const char *const gpu_cc_debug_mux_parent_names[] = {
  818. "gpu_cc_ahb_clk",
  819. "gpu_cc_cx_accu_shift_clk",
  820. "gpu_cc_cx_ff_clk",
  821. "gpu_cc_cx_gmu_clk",
  822. "gpu_cc_cxo_clk",
  823. "gpu_cc_freq_measure_clk",
  824. "gpu_cc_gx_accu_shift_clk",
  825. "gpu_cc_gx_acd_ahb_ff_clk",
  826. "gpu_cc_gx_gmu_clk",
  827. "gpu_cc_gx_rcg_ahb_ff_clk",
  828. "gpu_cc_hub_aon_clk",
  829. "gpu_cc_hub_cx_int_clk",
  830. "gpu_cc_memnoc_gfx_clk",
  831. "gx_clkctl_debug_mux",
  832. "measure_only_gpu_cc_cb_clk",
  833. "measure_only_gpu_cc_cxo_aon_clk",
  834. "measure_only_gpu_cc_demet_clk",
  835. "measure_only_gpu_cc_gx_ahb_ff_clk",
  836. "measure_only_gpu_cc_rscc_hub_aon_clk",
  837. "measure_only_gpu_cc_rscc_xo_aon_clk",
  838. "measure_only_gpu_cc_sleep_clk",
  839. };
  840. static int gpu_cc_debug_mux_sels[] = {
  841. 0x17, /* gpu_cc_ahb_clk */
  842. 0x24, /* gpu_cc_cx_accu_shift_clk */
  843. 0x20, /* gpu_cc_cx_ff_clk */
  844. 0x1D, /* gpu_cc_cx_gmu_clk */
  845. 0x1E, /* gpu_cc_cxo_clk */
  846. 0xF, /* gpu_cc_freq_measure_clk */
  847. 0x15, /* gpu_cc_gx_accu_shift_clk */
  848. 0x13, /* gpu_cc_gx_acd_ahb_ff_clk */
  849. 0x11, /* gpu_cc_gx_gmu_clk */
  850. 0x14, /* gpu_cc_gx_rcg_ahb_ff_clk */
  851. 0x2A, /* gpu_cc_hub_aon_clk */
  852. 0x1F, /* gpu_cc_hub_cx_int_clk */
  853. 0x21, /* gpu_cc_memnoc_gfx_clk */
  854. 0xB, /* gx_clkctl_debug_mux */
  855. 0x28, /* measure_only_gpu_cc_cb_clk */
  856. 0xE, /* measure_only_gpu_cc_cxo_aon_clk */
  857. 0x10, /* measure_only_gpu_cc_demet_clk */
  858. 0x12, /* measure_only_gpu_cc_gx_ahb_ff_clk */
  859. 0x29, /* measure_only_gpu_cc_rscc_hub_aon_clk */
  860. 0xD, /* measure_only_gpu_cc_rscc_xo_aon_clk */
  861. 0x1B, /* measure_only_gpu_cc_sleep_clk */
  862. };
  863. static struct clk_debug_mux gpu_cc_debug_mux = {
  864. .priv = &debug_mux_priv,
  865. .debug_offset = 0x9564,
  866. .post_div_offset = 0x9270,
  867. .cbcr_offset = 0x9274,
  868. .src_sel_mask = 0xFF,
  869. .src_sel_shift = 0,
  870. .post_div_mask = 0xF,
  871. .post_div_shift = 0,
  872. .post_div_val = 2,
  873. .mux_sels = gpu_cc_debug_mux_sels,
  874. .num_mux_sels = ARRAY_SIZE(gpu_cc_debug_mux_sels),
  875. .hw.init = &(const struct clk_init_data){
  876. .name = "gpu_cc_debug_mux",
  877. .ops = &clk_debug_mux_ops,
  878. .parent_names = gpu_cc_debug_mux_parent_names,
  879. .num_parents = ARRAY_SIZE(gpu_cc_debug_mux_parent_names),
  880. },
  881. };
  882. static const char *const gx_clkctl_debug_mux_parent_names[] = {
  883. "measure_only_acd_gfx3d_clk",
  884. "measure_only_gx_accu_clk",
  885. "measure_only_gx_clkctl_demet_clk",
  886. "measure_only_gx_gfx3d_clk",
  887. "measure_only_gx_gfx3d_rdvm_clk",
  888. "measure_only_mnd1x_gfx3d_clk",
  889. };
  890. static int gx_clkctl_debug_mux_sels[] = {
  891. 0x8, /* measure_only_acd_gfx3d_clk */
  892. 0xA, /* measure_only_gx_accu_clk */
  893. 0x2, /* measure_only_gx_clkctl_demet_clk */
  894. 0x3, /* measure_only_gx_gfx3d_clk */
  895. 0x6, /* measure_only_gx_gfx3d_rdvm_clk */
  896. 0x7, /* measure_only_mnd1x_gfx3d_clk */
  897. };
  898. static struct clk_debug_mux gx_clkctl_debug_mux = {
  899. .priv = &debug_mux_priv,
  900. .debug_offset = 0x4144,
  901. .post_div_offset = U32_MAX,
  902. .cbcr_offset = 0x4088,
  903. .src_sel_mask = 0xFF,
  904. .src_sel_shift = 0,
  905. .post_div_mask = 0x1,
  906. .post_div_shift = 0,
  907. .post_div_val = 1,
  908. .mux_sels = gx_clkctl_debug_mux_sels,
  909. .num_mux_sels = ARRAY_SIZE(gx_clkctl_debug_mux_sels),
  910. .hw.init = &(const struct clk_init_data){
  911. .name = "gx_clkctl_debug_mux",
  912. .ops = &clk_debug_mux_ops,
  913. .parent_names = gx_clkctl_debug_mux_parent_names,
  914. .num_parents = ARRAY_SIZE(gx_clkctl_debug_mux_parent_names),
  915. },
  916. };
  917. static const char *const video_cc_debug_mux_parent_names[] = {
  918. "measure_only_video_cc_ahb_clk",
  919. "measure_only_video_cc_sleep_clk",
  920. "measure_only_video_cc_xo_clk",
  921. "video_cc_mvs0_clk",
  922. "video_cc_mvs0_shift_clk",
  923. "video_cc_mvs0c_clk",
  924. "video_cc_mvs0c_shift_clk",
  925. "video_cc_mvs1_clk",
  926. "video_cc_mvs1_shift_clk",
  927. "video_cc_mvs1c_clk",
  928. "video_cc_mvs1c_shift_clk",
  929. };
  930. static int video_cc_debug_mux_sels[] = {
  931. 0x7, /* measure_only_video_cc_ahb_clk */
  932. 0xC, /* measure_only_video_cc_sleep_clk */
  933. 0xB, /* measure_only_video_cc_xo_clk */
  934. 0x3, /* video_cc_mvs0_clk */
  935. 0xD, /* video_cc_mvs0_shift_clk */
  936. 0x1, /* video_cc_mvs0c_clk */
  937. 0xE, /* video_cc_mvs0c_shift_clk */
  938. 0x5, /* video_cc_mvs1_clk */
  939. 0xF, /* video_cc_mvs1_shift_clk */
  940. 0x9, /* video_cc_mvs1c_clk */
  941. 0x10, /* video_cc_mvs1c_shift_clk */
  942. };
  943. static struct clk_debug_mux video_cc_debug_mux = {
  944. .priv = &debug_mux_priv,
  945. .debug_offset = 0x9A4C,
  946. .post_div_offset = 0x80F8,
  947. .cbcr_offset = 0x80FC,
  948. .src_sel_mask = 0x3F,
  949. .src_sel_shift = 0,
  950. .post_div_mask = 0xF,
  951. .post_div_shift = 0,
  952. .post_div_val = 3,
  953. .mux_sels = video_cc_debug_mux_sels,
  954. .num_mux_sels = ARRAY_SIZE(video_cc_debug_mux_sels),
  955. .hw.init = &(const struct clk_init_data){
  956. .name = "video_cc_debug_mux",
  957. .ops = &clk_debug_mux_ops,
  958. .parent_names = video_cc_debug_mux_parent_names,
  959. .num_parents = ARRAY_SIZE(video_cc_debug_mux_parent_names),
  960. },
  961. };
  962. static const char *const mc_cc_debug_mux_parent_names[] = {
  963. "measure_only_mccc_clk",
  964. };
  965. static struct clk_debug_mux mc_cc_debug_mux = {
  966. .period_offset = 0x50,
  967. .hw.init = &(struct clk_init_data){
  968. .name = "mc_cc_debug_mux",
  969. .ops = &clk_debug_mux_ops,
  970. .parent_names = mc_cc_debug_mux_parent_names,
  971. .num_parents = ARRAY_SIZE(mc_cc_debug_mux_parent_names),
  972. },
  973. };
  974. static struct mux_regmap_names mux_list[] = {
  975. { .mux = &mc_cc_debug_mux, .regmap_name = "qcom,mccc" },
  976. { .mux = &video_cc_debug_mux, .regmap_name = "qcom,videocc" },
  977. { .mux = &gx_clkctl_debug_mux, .regmap_name = "qcom,gxclkctl" },
  978. { .mux = &gpu_cc_debug_mux, .regmap_name = "qcom,gpucc" },
  979. { .mux = &disp_cc_1_debug_mux, .regmap_name = "qcom,dispcc1" },
  980. { .mux = &disp_cc_0_debug_mux, .regmap_name = "qcom,dispcc0" },
  981. { .mux = &cam_cc_debug_mux, .regmap_name = "qcom,camcc" },
  982. { .mux = &apss_cc_debug_mux, .regmap_name = "qcom,apsscc" },
  983. { .mux = &gcc_debug_mux, .regmap_name = "qcom,gcc" },
  984. };
  985. static struct clk_dummy measure_only_acd_gfx3d_clk = {
  986. .rrate = 1000,
  987. .hw.init = &(const struct clk_init_data){
  988. .name = "measure_only_acd_gfx3d_clk",
  989. .ops = &clk_dummy_ops,
  990. },
  991. };
  992. static struct clk_dummy measure_only_apcs_gold_post_acd_clk = {
  993. .rrate = 1000,
  994. .hw.init = &(const struct clk_init_data){
  995. .name = "measure_only_apcs_gold_post_acd_clk",
  996. .ops = &clk_dummy_ops,
  997. },
  998. };
  999. static struct clk_dummy measure_only_apcs_gold_pre_acd_clk = {
  1000. .rrate = 1000,
  1001. .hw.init = &(const struct clk_init_data){
  1002. .name = "measure_only_apcs_gold_pre_acd_clk",
  1003. .ops = &clk_dummy_ops,
  1004. },
  1005. };
  1006. static struct clk_dummy measure_only_apcs_goldplus_post_acd_clk = {
  1007. .rrate = 1000,
  1008. .hw.init = &(const struct clk_init_data){
  1009. .name = "measure_only_apcs_goldplus_post_acd_clk",
  1010. .ops = &clk_dummy_ops,
  1011. },
  1012. };
  1013. static struct clk_dummy measure_only_apcs_goldplus_pre_acd_clk = {
  1014. .rrate = 1000,
  1015. .hw.init = &(const struct clk_init_data){
  1016. .name = "measure_only_apcs_goldplus_pre_acd_clk",
  1017. .ops = &clk_dummy_ops,
  1018. },
  1019. };
  1020. static struct clk_dummy measure_only_apcs_l3_post_acd_clk = {
  1021. .rrate = 1000,
  1022. .hw.init = &(const struct clk_init_data){
  1023. .name = "measure_only_apcs_l3_post_acd_clk",
  1024. .ops = &clk_dummy_ops,
  1025. },
  1026. };
  1027. static struct clk_dummy measure_only_apcs_l3_pre_acd_clk = {
  1028. .rrate = 1000,
  1029. .hw.init = &(const struct clk_init_data){
  1030. .name = "measure_only_apcs_l3_pre_acd_clk",
  1031. .ops = &clk_dummy_ops,
  1032. },
  1033. };
  1034. static struct clk_dummy measure_only_cam_cc_drv_ahb_clk = {
  1035. .rrate = 1000,
  1036. .hw.init = &(const struct clk_init_data){
  1037. .name = "measure_only_cam_cc_drv_ahb_clk",
  1038. .ops = &clk_dummy_ops,
  1039. },
  1040. };
  1041. static struct clk_dummy measure_only_cam_cc_drv_xo_clk = {
  1042. .rrate = 1000,
  1043. .hw.init = &(const struct clk_init_data){
  1044. .name = "measure_only_cam_cc_drv_xo_clk",
  1045. .ops = &clk_dummy_ops,
  1046. },
  1047. };
  1048. static struct clk_dummy measure_only_cam_cc_gdsc_clk = {
  1049. .rrate = 1000,
  1050. .hw.init = &(const struct clk_init_data){
  1051. .name = "measure_only_cam_cc_gdsc_clk",
  1052. .ops = &clk_dummy_ops,
  1053. },
  1054. };
  1055. static struct clk_dummy measure_only_cam_cc_sleep_clk = {
  1056. .rrate = 1000,
  1057. .hw.init = &(const struct clk_init_data){
  1058. .name = "measure_only_cam_cc_sleep_clk",
  1059. .ops = &clk_dummy_ops,
  1060. },
  1061. };
  1062. static struct clk_dummy measure_only_cnoc_clk = {
  1063. .rrate = 1000,
  1064. .hw.init = &(const struct clk_init_data){
  1065. .name = "measure_only_cnoc_clk",
  1066. .ops = &clk_dummy_ops,
  1067. },
  1068. };
  1069. static struct clk_dummy measure_only_gcc_camera_ahb_clk = {
  1070. .rrate = 1000,
  1071. .hw.init = &(const struct clk_init_data){
  1072. .name = "measure_only_gcc_camera_ahb_clk",
  1073. .ops = &clk_dummy_ops,
  1074. },
  1075. };
  1076. static struct clk_dummy measure_only_gcc_camera_xo_clk = {
  1077. .rrate = 1000,
  1078. .hw.init = &(const struct clk_init_data){
  1079. .name = "measure_only_gcc_camera_xo_clk",
  1080. .ops = &clk_dummy_ops,
  1081. },
  1082. };
  1083. static struct clk_dummy measure_only_gcc_disp_0_ahb_clk = {
  1084. .rrate = 1000,
  1085. .hw.init = &(const struct clk_init_data){
  1086. .name = "measure_only_gcc_disp_0_ahb_clk",
  1087. .ops = &clk_dummy_ops,
  1088. },
  1089. };
  1090. static struct clk_dummy measure_only_gcc_disp_0_xo_clk = {
  1091. .rrate = 1000,
  1092. .hw.init = &(const struct clk_init_data){
  1093. .name = "measure_only_gcc_disp_0_xo_clk",
  1094. .ops = &clk_dummy_ops,
  1095. },
  1096. };
  1097. static struct clk_dummy measure_only_gcc_disp_1_ahb_clk = {
  1098. .rrate = 1000,
  1099. .hw.init = &(const struct clk_init_data){
  1100. .name = "measure_only_gcc_disp_1_ahb_clk",
  1101. .ops = &clk_dummy_ops,
  1102. },
  1103. };
  1104. static struct clk_dummy measure_only_gcc_disp_1_xo_clk = {
  1105. .rrate = 1000,
  1106. .hw.init = &(const struct clk_init_data){
  1107. .name = "measure_only_gcc_disp_1_xo_clk",
  1108. .ops = &clk_dummy_ops,
  1109. },
  1110. };
  1111. static struct clk_dummy measure_only_gcc_gpu_cfg_ahb_clk = {
  1112. .rrate = 1000,
  1113. .hw.init = &(const struct clk_init_data){
  1114. .name = "measure_only_gcc_gpu_cfg_ahb_clk",
  1115. .ops = &clk_dummy_ops,
  1116. },
  1117. };
  1118. static struct clk_dummy measure_only_gcc_pcie_rscc_xo_clk = {
  1119. .rrate = 1000,
  1120. .hw.init = &(const struct clk_init_data){
  1121. .name = "measure_only_gcc_pcie_rscc_xo_clk",
  1122. .ops = &clk_dummy_ops,
  1123. },
  1124. };
  1125. static struct clk_dummy measure_only_gcc_video_ahb_clk = {
  1126. .rrate = 1000,
  1127. .hw.init = &(const struct clk_init_data){
  1128. .name = "measure_only_gcc_video_ahb_clk",
  1129. .ops = &clk_dummy_ops,
  1130. },
  1131. };
  1132. static struct clk_dummy measure_only_gcc_video_xo_clk = {
  1133. .rrate = 1000,
  1134. .hw.init = &(const struct clk_init_data){
  1135. .name = "measure_only_gcc_video_xo_clk",
  1136. .ops = &clk_dummy_ops,
  1137. },
  1138. };
  1139. static struct clk_dummy measure_only_gpu_cc_cb_clk = {
  1140. .rrate = 1000,
  1141. .hw.init = &(const struct clk_init_data){
  1142. .name = "measure_only_gpu_cc_cb_clk",
  1143. .ops = &clk_dummy_ops,
  1144. },
  1145. };
  1146. static struct clk_dummy measure_only_gpu_cc_cxo_aon_clk = {
  1147. .rrate = 1000,
  1148. .hw.init = &(const struct clk_init_data){
  1149. .name = "measure_only_gpu_cc_cxo_aon_clk",
  1150. .ops = &clk_dummy_ops,
  1151. },
  1152. };
  1153. static struct clk_dummy measure_only_gpu_cc_demet_clk = {
  1154. .rrate = 1000,
  1155. .hw.init = &(const struct clk_init_data){
  1156. .name = "measure_only_gpu_cc_demet_clk",
  1157. .ops = &clk_dummy_ops,
  1158. },
  1159. };
  1160. static struct clk_dummy measure_only_gpu_cc_gx_ahb_ff_clk = {
  1161. .rrate = 1000,
  1162. .hw.init = &(const struct clk_init_data){
  1163. .name = "measure_only_gpu_cc_gx_ahb_ff_clk",
  1164. .ops = &clk_dummy_ops,
  1165. },
  1166. };
  1167. static struct clk_dummy measure_only_gpu_cc_rscc_hub_aon_clk = {
  1168. .rrate = 1000,
  1169. .hw.init = &(const struct clk_init_data){
  1170. .name = "measure_only_gpu_cc_rscc_hub_aon_clk",
  1171. .ops = &clk_dummy_ops,
  1172. },
  1173. };
  1174. static struct clk_dummy measure_only_gpu_cc_rscc_xo_aon_clk = {
  1175. .rrate = 1000,
  1176. .hw.init = &(const struct clk_init_data){
  1177. .name = "measure_only_gpu_cc_rscc_xo_aon_clk",
  1178. .ops = &clk_dummy_ops,
  1179. },
  1180. };
  1181. static struct clk_dummy measure_only_gpu_cc_sleep_clk = {
  1182. .rrate = 1000,
  1183. .hw.init = &(const struct clk_init_data){
  1184. .name = "measure_only_gpu_cc_sleep_clk",
  1185. .ops = &clk_dummy_ops,
  1186. },
  1187. };
  1188. static struct clk_dummy measure_only_gx_accu_clk = {
  1189. .rrate = 1000,
  1190. .hw.init = &(const struct clk_init_data){
  1191. .name = "measure_only_gx_accu_clk",
  1192. .ops = &clk_dummy_ops,
  1193. },
  1194. };
  1195. static struct clk_dummy measure_only_gx_clkctl_demet_clk = {
  1196. .rrate = 1000,
  1197. .hw.init = &(const struct clk_init_data){
  1198. .name = "measure_only_gx_clkctl_demet_clk",
  1199. .ops = &clk_dummy_ops,
  1200. },
  1201. };
  1202. static struct clk_dummy measure_only_gx_gfx3d_clk = {
  1203. .rrate = 1000,
  1204. .hw.init = &(const struct clk_init_data){
  1205. .name = "measure_only_gx_gfx3d_clk",
  1206. .ops = &clk_dummy_ops,
  1207. },
  1208. };
  1209. static struct clk_dummy measure_only_gx_gfx3d_rdvm_clk = {
  1210. .rrate = 1000,
  1211. .hw.init = &(const struct clk_init_data){
  1212. .name = "measure_only_gx_gfx3d_rdvm_clk",
  1213. .ops = &clk_dummy_ops,
  1214. },
  1215. };
  1216. static struct clk_dummy measure_only_ipa_2x_clk = {
  1217. .rrate = 1000,
  1218. .hw.init = &(const struct clk_init_data){
  1219. .name = "measure_only_ipa_2x_clk",
  1220. .ops = &clk_dummy_ops,
  1221. },
  1222. };
  1223. static struct clk_dummy measure_only_mccc_clk = {
  1224. .rrate = 1000,
  1225. .hw.init = &(const struct clk_init_data){
  1226. .name = "measure_only_mccc_clk",
  1227. .ops = &clk_dummy_ops,
  1228. },
  1229. };
  1230. static struct clk_dummy measure_only_mdss_0_disp_cc_sleep_clk = {
  1231. .rrate = 1000,
  1232. .hw.init = &(const struct clk_init_data){
  1233. .name = "measure_only_mdss_0_disp_cc_sleep_clk",
  1234. .ops = &clk_dummy_ops,
  1235. },
  1236. };
  1237. static struct clk_dummy measure_only_mdss_0_disp_cc_xo_clk = {
  1238. .rrate = 1000,
  1239. .hw.init = &(const struct clk_init_data){
  1240. .name = "measure_only_mdss_0_disp_cc_xo_clk",
  1241. .ops = &clk_dummy_ops,
  1242. },
  1243. };
  1244. static struct clk_dummy measure_only_mdss_1_disp_cc_sleep_clk = {
  1245. .rrate = 1000,
  1246. .hw.init = &(const struct clk_init_data){
  1247. .name = "measure_only_mdss_1_disp_cc_sleep_clk",
  1248. .ops = &clk_dummy_ops,
  1249. },
  1250. };
  1251. static struct clk_dummy measure_only_mdss_1_disp_cc_xo_clk = {
  1252. .rrate = 1000,
  1253. .hw.init = &(const struct clk_init_data){
  1254. .name = "measure_only_mdss_1_disp_cc_xo_clk",
  1255. .ops = &clk_dummy_ops,
  1256. },
  1257. };
  1258. static struct clk_dummy measure_only_memnoc_clk = {
  1259. .rrate = 1000,
  1260. .hw.init = &(const struct clk_init_data){
  1261. .name = "measure_only_memnoc_clk",
  1262. .ops = &clk_dummy_ops,
  1263. },
  1264. };
  1265. static struct clk_dummy measure_only_mnd1x_gfx3d_clk = {
  1266. .rrate = 1000,
  1267. .hw.init = &(const struct clk_init_data){
  1268. .name = "measure_only_mnd1x_gfx3d_clk",
  1269. .ops = &clk_dummy_ops,
  1270. },
  1271. };
  1272. static struct clk_dummy measure_only_pcie_0_pipe_clk = {
  1273. .rrate = 1000,
  1274. .hw.init = &(const struct clk_init_data){
  1275. .name = "measure_only_pcie_0_pipe_clk",
  1276. .ops = &clk_dummy_ops,
  1277. },
  1278. };
  1279. static struct clk_dummy measure_only_pcie_1_phy_aux_clk = {
  1280. .rrate = 1000,
  1281. .hw.init = &(const struct clk_init_data){
  1282. .name = "measure_only_pcie_1_phy_aux_clk",
  1283. .ops = &clk_dummy_ops,
  1284. },
  1285. };
  1286. static struct clk_dummy measure_only_pcie_1_pipe_clk = {
  1287. .rrate = 1000,
  1288. .hw.init = &(const struct clk_init_data){
  1289. .name = "measure_only_pcie_1_pipe_clk",
  1290. .ops = &clk_dummy_ops,
  1291. },
  1292. };
  1293. static struct clk_dummy measure_only_pcie_2_phy_aux_clk = {
  1294. .rrate = 1000,
  1295. .hw.init = &(const struct clk_init_data){
  1296. .name = "measure_only_pcie_2_phy_aux_clk",
  1297. .ops = &clk_dummy_ops,
  1298. },
  1299. };
  1300. static struct clk_dummy measure_only_pcie_2_pipe_clk = {
  1301. .rrate = 1000,
  1302. .hw.init = &(const struct clk_init_data){
  1303. .name = "measure_only_pcie_2_pipe_clk",
  1304. .ops = &clk_dummy_ops,
  1305. },
  1306. };
  1307. static struct clk_dummy measure_only_snoc_clk = {
  1308. .rrate = 1000,
  1309. .hw.init = &(const struct clk_init_data){
  1310. .name = "measure_only_snoc_clk",
  1311. .ops = &clk_dummy_ops,
  1312. },
  1313. };
  1314. static struct clk_dummy measure_only_ufs_phy_rx_symbol_0_clk = {
  1315. .rrate = 1000,
  1316. .hw.init = &(const struct clk_init_data){
  1317. .name = "measure_only_ufs_phy_rx_symbol_0_clk",
  1318. .ops = &clk_dummy_ops,
  1319. },
  1320. };
  1321. static struct clk_dummy measure_only_ufs_phy_rx_symbol_1_clk = {
  1322. .rrate = 1000,
  1323. .hw.init = &(const struct clk_init_data){
  1324. .name = "measure_only_ufs_phy_rx_symbol_1_clk",
  1325. .ops = &clk_dummy_ops,
  1326. },
  1327. };
  1328. static struct clk_dummy measure_only_ufs_phy_tx_symbol_0_clk = {
  1329. .rrate = 1000,
  1330. .hw.init = &(const struct clk_init_data){
  1331. .name = "measure_only_ufs_phy_tx_symbol_0_clk",
  1332. .ops = &clk_dummy_ops,
  1333. },
  1334. };
  1335. static struct clk_dummy measure_only_usb3_phy_wrapper_gcc_usb30_pipe_clk = {
  1336. .rrate = 1000,
  1337. .hw.init = &(const struct clk_init_data){
  1338. .name = "measure_only_usb3_phy_wrapper_gcc_usb30_pipe_clk",
  1339. .ops = &clk_dummy_ops,
  1340. },
  1341. };
  1342. static struct clk_dummy measure_only_usb3_sec_phy_wrapper_gcc_usb30_pipe_clk = {
  1343. .rrate = 1000,
  1344. .hw.init = &(const struct clk_init_data){
  1345. .name = "measure_only_usb3_sec_phy_wrapper_gcc_usb30_pipe_clk",
  1346. .ops = &clk_dummy_ops,
  1347. },
  1348. };
  1349. static struct clk_dummy measure_only_video_cc_ahb_clk = {
  1350. .rrate = 1000,
  1351. .hw.init = &(const struct clk_init_data){
  1352. .name = "measure_only_video_cc_ahb_clk",
  1353. .ops = &clk_dummy_ops,
  1354. },
  1355. };
  1356. static struct clk_dummy measure_only_video_cc_sleep_clk = {
  1357. .rrate = 1000,
  1358. .hw.init = &(const struct clk_init_data){
  1359. .name = "measure_only_video_cc_sleep_clk",
  1360. .ops = &clk_dummy_ops,
  1361. },
  1362. };
  1363. static struct clk_dummy measure_only_video_cc_xo_clk = {
  1364. .rrate = 1000,
  1365. .hw.init = &(const struct clk_init_data){
  1366. .name = "measure_only_video_cc_xo_clk",
  1367. .ops = &clk_dummy_ops,
  1368. },
  1369. };
  1370. static struct clk_hw *debugcc_niobe_hws[] = {
  1371. &measure_only_acd_gfx3d_clk.hw,
  1372. &measure_only_apcs_gold_post_acd_clk.hw,
  1373. &measure_only_apcs_gold_pre_acd_clk.hw,
  1374. &measure_only_apcs_goldplus_post_acd_clk.hw,
  1375. &measure_only_apcs_goldplus_pre_acd_clk.hw,
  1376. &measure_only_apcs_l3_post_acd_clk.hw,
  1377. &measure_only_apcs_l3_pre_acd_clk.hw,
  1378. &measure_only_cam_cc_drv_ahb_clk.hw,
  1379. &measure_only_cam_cc_drv_xo_clk.hw,
  1380. &measure_only_cam_cc_gdsc_clk.hw,
  1381. &measure_only_cam_cc_sleep_clk.hw,
  1382. &measure_only_cnoc_clk.hw,
  1383. &measure_only_gcc_camera_ahb_clk.hw,
  1384. &measure_only_gcc_camera_xo_clk.hw,
  1385. &measure_only_gcc_disp_0_ahb_clk.hw,
  1386. &measure_only_gcc_disp_0_xo_clk.hw,
  1387. &measure_only_gcc_disp_1_ahb_clk.hw,
  1388. &measure_only_gcc_disp_1_xo_clk.hw,
  1389. &measure_only_gcc_gpu_cfg_ahb_clk.hw,
  1390. &measure_only_gcc_pcie_rscc_xo_clk.hw,
  1391. &measure_only_gcc_video_ahb_clk.hw,
  1392. &measure_only_gcc_video_xo_clk.hw,
  1393. &measure_only_gpu_cc_cb_clk.hw,
  1394. &measure_only_gpu_cc_cxo_aon_clk.hw,
  1395. &measure_only_gpu_cc_demet_clk.hw,
  1396. &measure_only_gpu_cc_gx_ahb_ff_clk.hw,
  1397. &measure_only_gpu_cc_rscc_hub_aon_clk.hw,
  1398. &measure_only_gpu_cc_rscc_xo_aon_clk.hw,
  1399. &measure_only_gpu_cc_sleep_clk.hw,
  1400. &measure_only_gx_accu_clk.hw,
  1401. &measure_only_gx_clkctl_demet_clk.hw,
  1402. &measure_only_gx_gfx3d_clk.hw,
  1403. &measure_only_gx_gfx3d_rdvm_clk.hw,
  1404. &measure_only_ipa_2x_clk.hw,
  1405. &measure_only_mccc_clk.hw,
  1406. &measure_only_mdss_0_disp_cc_sleep_clk.hw,
  1407. &measure_only_mdss_0_disp_cc_xo_clk.hw,
  1408. &measure_only_mdss_1_disp_cc_sleep_clk.hw,
  1409. &measure_only_mdss_1_disp_cc_xo_clk.hw,
  1410. &measure_only_memnoc_clk.hw,
  1411. &measure_only_mnd1x_gfx3d_clk.hw,
  1412. &measure_only_pcie_0_pipe_clk.hw,
  1413. &measure_only_pcie_1_phy_aux_clk.hw,
  1414. &measure_only_pcie_1_pipe_clk.hw,
  1415. &measure_only_pcie_2_phy_aux_clk.hw,
  1416. &measure_only_pcie_2_pipe_clk.hw,
  1417. &measure_only_snoc_clk.hw,
  1418. &measure_only_ufs_phy_rx_symbol_0_clk.hw,
  1419. &measure_only_ufs_phy_rx_symbol_1_clk.hw,
  1420. &measure_only_ufs_phy_tx_symbol_0_clk.hw,
  1421. &measure_only_usb3_phy_wrapper_gcc_usb30_pipe_clk.hw,
  1422. &measure_only_usb3_sec_phy_wrapper_gcc_usb30_pipe_clk.hw,
  1423. &measure_only_video_cc_ahb_clk.hw,
  1424. &measure_only_video_cc_sleep_clk.hw,
  1425. &measure_only_video_cc_xo_clk.hw,
  1426. };
  1427. static const struct of_device_id clk_debug_match_table[] = {
  1428. { .compatible = "qcom,niobe-debugcc" },
  1429. { }
  1430. };
  1431. static int clk_debug_niobe_probe(struct platform_device *pdev)
  1432. {
  1433. struct clk *clk;
  1434. int ret = 0, i;
  1435. BUILD_BUG_ON(ARRAY_SIZE(apss_cc_debug_mux_parent_names) !=
  1436. ARRAY_SIZE(apss_cc_debug_mux_sels));
  1437. BUILD_BUG_ON(ARRAY_SIZE(cam_cc_debug_mux_parent_names) !=
  1438. ARRAY_SIZE(cam_cc_debug_mux_sels));
  1439. BUILD_BUG_ON(ARRAY_SIZE(disp_cc_0_debug_mux_parent_names) !=
  1440. ARRAY_SIZE(disp_cc_0_debug_mux_sels));
  1441. BUILD_BUG_ON(ARRAY_SIZE(disp_cc_1_debug_mux_parent_names) !=
  1442. ARRAY_SIZE(disp_cc_1_debug_mux_sels));
  1443. BUILD_BUG_ON(ARRAY_SIZE(gcc_debug_mux_parent_names) != ARRAY_SIZE(gcc_debug_mux_sels));
  1444. BUILD_BUG_ON(ARRAY_SIZE(gpu_cc_debug_mux_parent_names) !=
  1445. ARRAY_SIZE(gpu_cc_debug_mux_sels));
  1446. BUILD_BUG_ON(ARRAY_SIZE(gx_clkctl_debug_mux_parent_names) !=
  1447. ARRAY_SIZE(gx_clkctl_debug_mux_sels));
  1448. BUILD_BUG_ON(ARRAY_SIZE(video_cc_debug_mux_parent_names) !=
  1449. ARRAY_SIZE(video_cc_debug_mux_sels));
  1450. clk = devm_clk_get(&pdev->dev, "xo_clk_src");
  1451. if (IS_ERR(clk)) {
  1452. if (PTR_ERR(clk) != -EPROBE_DEFER)
  1453. dev_err(&pdev->dev, "Unable to get xo clock\n");
  1454. return PTR_ERR(clk);
  1455. }
  1456. debug_mux_priv.cxo = clk;
  1457. for (i = 0; i < ARRAY_SIZE(mux_list); i++) {
  1458. if (IS_ERR_OR_NULL(mux_list[i].mux->regmap)) {
  1459. ret = map_debug_bases(pdev, mux_list[i].regmap_name,
  1460. mux_list[i].mux);
  1461. if (ret == -EBADR)
  1462. continue;
  1463. else if (ret)
  1464. return ret;
  1465. }
  1466. }
  1467. for (i = 0; i < ARRAY_SIZE(debugcc_niobe_hws); i++) {
  1468. clk = devm_clk_register(&pdev->dev, debugcc_niobe_hws[i]);
  1469. if (IS_ERR(clk)) {
  1470. dev_err(&pdev->dev, "Unable to register %s, err:(%ld)\n",
  1471. qcom_clk_hw_get_name(debugcc_niobe_hws[i]),
  1472. PTR_ERR(clk));
  1473. return PTR_ERR(clk);
  1474. }
  1475. }
  1476. for (i = 0; i < ARRAY_SIZE(mux_list); i++) {
  1477. ret = devm_clk_register_debug_mux(&pdev->dev, mux_list[i].mux);
  1478. if (ret) {
  1479. dev_err(&pdev->dev, "Unable to register mux clk %s, err:(%d)\n",
  1480. qcom_clk_hw_get_name(&mux_list[i].mux->hw),
  1481. ret);
  1482. return ret;
  1483. }
  1484. }
  1485. ret = clk_debug_measure_register(&gcc_debug_mux.hw);
  1486. if (ret) {
  1487. dev_err(&pdev->dev, "Could not register Measure clocks\n");
  1488. return ret;
  1489. }
  1490. dev_info(&pdev->dev, "Registered debug measure clocks\n");
  1491. return ret;
  1492. }
  1493. static struct platform_driver clk_debug_driver = {
  1494. .probe = clk_debug_niobe_probe,
  1495. .driver = {
  1496. .name = "niobe-debugcc",
  1497. .of_match_table = clk_debug_match_table,
  1498. },
  1499. };
  1500. static int __init clk_debug_niobe_init(void)
  1501. {
  1502. return platform_driver_register(&clk_debug_driver);
  1503. }
  1504. fs_initcall(clk_debug_niobe_init);
  1505. MODULE_DESCRIPTION("QTI DEBUG CC NIOBE Driver");
  1506. MODULE_LICENSE("GPL");