700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. From 2fbb18f85826a9ba308fedb2cf90d3a661a39fd7 Mon Sep 17 00:00:00 2001
  2. From: Stephen Boyd <sboyd@codeaurora.org>
  3. Date: Fri, 27 Mar 2015 00:16:14 -0700
  4. Subject: [PATCH] clk: qcom: Add support for NSS/GMAC clocks and resets
  5. Add the NSS/GMAC clocks and the TCM clock and NSS resets.
  6. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  7. ---
  8. drivers/clk/qcom/gcc-ipq806x.c | 594 ++++++++++++++++++++++++++-
  9. drivers/clk/qcom/gcc-ipq806x.c.rej | 50 +++
  10. include/dt-bindings/clock/qcom,gcc-ipq806x.h | 2 +
  11. include/dt-bindings/reset/qcom,gcc-ipq806x.h | 43 ++
  12. 4 files changed, 688 insertions(+), 1 deletion(-)
  13. create mode 100644 drivers/clk/qcom/gcc-ipq806x.c.rej
  14. --- a/drivers/clk/qcom/gcc-ipq806x.c
  15. +++ b/drivers/clk/qcom/gcc-ipq806x.c
  16. @@ -209,11 +209,46 @@ static struct clk_regmap pll14_vote = {
  17. },
  18. };
  19. +#define NSS_PLL_RATE(f, _l, _m, _n, i) \
  20. + { \
  21. + .freq = f, \
  22. + .l = _l, \
  23. + .m = _m, \
  24. + .n = _n, \
  25. + .ibits = i, \
  26. + }
  27. +
  28. +static struct pll_freq_tbl pll18_freq_tbl[] = {
  29. + NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
  30. + NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
  31. +};
  32. +
  33. +static struct clk_pll pll18 = {
  34. + .l_reg = 0x31a4,
  35. + .m_reg = 0x31a8,
  36. + .n_reg = 0x31ac,
  37. + .config_reg = 0x31b4,
  38. + .mode_reg = 0x31a0,
  39. + .status_reg = 0x31b8,
  40. + .status_bit = 16,
  41. + .post_div_shift = 16,
  42. + .post_div_width = 1,
  43. + .freq_tbl = pll18_freq_tbl,
  44. + .clkr.hw.init = &(struct clk_init_data){
  45. + .name = "pll18",
  46. + .parent_names = (const char *[]){ "pxo" },
  47. + .num_parents = 1,
  48. + .ops = &clk_pll_ops,
  49. + },
  50. +};
  51. +
  52. #define P_PXO 0
  53. #define P_PLL8 1
  54. #define P_PLL3 1
  55. #define P_PLL0 2
  56. #define P_CXO 2
  57. +#define P_PLL14 3
  58. +#define P_PLL18 4
  59. static const u8 gcc_pxo_pll8_map[] = {
  60. [P_PXO] = 0,
  61. @@ -264,6 +299,22 @@ static const char *gcc_pxo_pll8_pll0_map
  62. "pll0_vote",
  63. };
  64. +static const u8 gcc_pxo_pll8_pll14_pll18_pll0_map[] = {
  65. + [P_PXO] = 0 ,
  66. + [P_PLL8] = 4,
  67. + [P_PLL0] = 2,
  68. + [P_PLL14] = 5,
  69. + [P_PLL18] = 1,
  70. +};
  71. +
  72. +static const char *gcc_pxo_pll8_pll14_pll18_pll0[] = {
  73. + "pxo",
  74. + "pll8_vote",
  75. + "pll0_vote",
  76. + "pll14",
  77. + "pll18",
  78. +};
  79. +
  80. static struct freq_tbl clk_tbl_gsbi_uart[] = {
  81. { 1843200, P_PLL8, 2, 6, 625 },
  82. { 3686400, P_PLL8, 2, 12, 625 },
  83. @@ -2269,6 +2320,472 @@ static struct clk_branch ebi2_aon_clk =
  84. },
  85. };
  86. +static const struct freq_tbl clk_tbl_gmac[] = {
  87. + { 133000000, P_PLL0, 1, 50, 301 },
  88. + { 266000000, P_PLL0, 1, 127, 382 },
  89. + { }
  90. +};
  91. +
  92. +static struct clk_dyn_rcg gmac_core1_src = {
  93. + .ns_reg[0] = 0x3cac,
  94. + .ns_reg[1] = 0x3cb0,
  95. + .md_reg[0] = 0x3ca4,
  96. + .md_reg[1] = 0x3ca8,
  97. + .bank_reg = 0x3ca0,
  98. + .mn[0] = {
  99. + .mnctr_en_bit = 8,
  100. + .mnctr_reset_bit = 7,
  101. + .mnctr_mode_shift = 5,
  102. + .n_val_shift = 16,
  103. + .m_val_shift = 16,
  104. + .width = 8,
  105. + },
  106. + .mn[1] = {
  107. + .mnctr_en_bit = 8,
  108. + .mnctr_reset_bit = 7,
  109. + .mnctr_mode_shift = 5,
  110. + .n_val_shift = 16,
  111. + .m_val_shift = 16,
  112. + .width = 8,
  113. + },
  114. + .s[0] = {
  115. + .src_sel_shift = 0,
  116. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  117. + },
  118. + .s[1] = {
  119. + .src_sel_shift = 0,
  120. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  121. + },
  122. + .p[0] = {
  123. + .pre_div_shift = 3,
  124. + .pre_div_width = 2,
  125. + },
  126. + .p[1] = {
  127. + .pre_div_shift = 3,
  128. + .pre_div_width = 2,
  129. + },
  130. + .mux_sel_bit = 0,
  131. + .freq_tbl = clk_tbl_gmac,
  132. + .clkr = {
  133. + .enable_reg = 0x3ca0,
  134. + .enable_mask = BIT(1),
  135. + .hw.init = &(struct clk_init_data){
  136. + .name = "gmac_core1_src",
  137. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  138. + .num_parents = 5,
  139. + .ops = &clk_dyn_rcg_ops,
  140. + },
  141. + },
  142. +};
  143. +
  144. +static struct clk_branch gmac_core1_clk = {
  145. + .halt_reg = 0x3c20,
  146. + .halt_bit = 4,
  147. + .hwcg_reg = 0x3cb4,
  148. + .hwcg_bit = 6,
  149. + .clkr = {
  150. + .enable_reg = 0x3cb4,
  151. + .enable_mask = BIT(4),
  152. + .hw.init = &(struct clk_init_data){
  153. + .name = "gmac_core1_clk",
  154. + .parent_names = (const char *[]){
  155. + "gmac_core1_src",
  156. + },
  157. + .num_parents = 1,
  158. + .ops = &clk_branch_ops,
  159. + .flags = CLK_SET_RATE_PARENT,
  160. + },
  161. + },
  162. +};
  163. +
  164. +static struct clk_dyn_rcg gmac_core2_src = {
  165. + .ns_reg[0] = 0x3ccc,
  166. + .ns_reg[1] = 0x3cd0,
  167. + .md_reg[0] = 0x3cc4,
  168. + .md_reg[1] = 0x3cc8,
  169. + .bank_reg = 0x3ca0,
  170. + .mn[0] = {
  171. + .mnctr_en_bit = 8,
  172. + .mnctr_reset_bit = 7,
  173. + .mnctr_mode_shift = 5,
  174. + .n_val_shift = 16,
  175. + .m_val_shift = 16,
  176. + .width = 8,
  177. + },
  178. + .mn[1] = {
  179. + .mnctr_en_bit = 8,
  180. + .mnctr_reset_bit = 7,
  181. + .mnctr_mode_shift = 5,
  182. + .n_val_shift = 16,
  183. + .m_val_shift = 16,
  184. + .width = 8,
  185. + },
  186. + .s[0] = {
  187. + .src_sel_shift = 0,
  188. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  189. + },
  190. + .s[1] = {
  191. + .src_sel_shift = 0,
  192. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  193. + },
  194. + .p[0] = {
  195. + .pre_div_shift = 3,
  196. + .pre_div_width = 2,
  197. + },
  198. + .p[1] = {
  199. + .pre_div_shift = 3,
  200. + .pre_div_width = 2,
  201. + },
  202. + .mux_sel_bit = 0,
  203. + .freq_tbl = clk_tbl_gmac,
  204. + .clkr = {
  205. + .enable_reg = 0x3cc0,
  206. + .enable_mask = BIT(1),
  207. + .hw.init = &(struct clk_init_data){
  208. + .name = "gmac_core2_src",
  209. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  210. + .num_parents = 5,
  211. + .ops = &clk_dyn_rcg_ops,
  212. + },
  213. + },
  214. +};
  215. +
  216. +static struct clk_branch gmac_core2_clk = {
  217. + .halt_reg = 0x3c20,
  218. + .halt_bit = 5,
  219. + .hwcg_reg = 0x3cd4,
  220. + .hwcg_bit = 6,
  221. + .clkr = {
  222. + .enable_reg = 0x3cd4,
  223. + .enable_mask = BIT(4),
  224. + .hw.init = &(struct clk_init_data){
  225. + .name = "gmac_core2_clk",
  226. + .parent_names = (const char *[]){
  227. + "gmac_core2_src",
  228. + },
  229. + .num_parents = 1,
  230. + .ops = &clk_branch_ops,
  231. + .flags = CLK_SET_RATE_PARENT,
  232. + },
  233. + },
  234. +};
  235. +
  236. +static struct clk_dyn_rcg gmac_core3_src = {
  237. + .ns_reg[0] = 0x3cec,
  238. + .ns_reg[1] = 0x3cf0,
  239. + .md_reg[0] = 0x3ce4,
  240. + .md_reg[1] = 0x3ce8,
  241. + .bank_reg = 0x3ce0,
  242. + .mn[0] = {
  243. + .mnctr_en_bit = 8,
  244. + .mnctr_reset_bit = 7,
  245. + .mnctr_mode_shift = 5,
  246. + .n_val_shift = 16,
  247. + .m_val_shift = 16,
  248. + .width = 8,
  249. + },
  250. + .mn[1] = {
  251. + .mnctr_en_bit = 8,
  252. + .mnctr_reset_bit = 7,
  253. + .mnctr_mode_shift = 5,
  254. + .n_val_shift = 16,
  255. + .m_val_shift = 16,
  256. + .width = 8,
  257. + },
  258. + .s[0] = {
  259. + .src_sel_shift = 0,
  260. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  261. + },
  262. + .s[1] = {
  263. + .src_sel_shift = 0,
  264. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  265. + },
  266. + .p[0] = {
  267. + .pre_div_shift = 3,
  268. + .pre_div_width = 2,
  269. + },
  270. + .p[1] = {
  271. + .pre_div_shift = 3,
  272. + .pre_div_width = 2,
  273. + },
  274. + .mux_sel_bit = 0,
  275. + .freq_tbl = clk_tbl_gmac,
  276. + .clkr = {
  277. + .enable_reg = 0x3ce0,
  278. + .enable_mask = BIT(1),
  279. + .hw.init = &(struct clk_init_data){
  280. + .name = "gmac_core3_src",
  281. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  282. + .num_parents = 5,
  283. + .ops = &clk_dyn_rcg_ops,
  284. + },
  285. + },
  286. +};
  287. +
  288. +static struct clk_branch gmac_core3_clk = {
  289. + .halt_reg = 0x3c20,
  290. + .halt_bit = 6,
  291. + .hwcg_reg = 0x3cf4,
  292. + .hwcg_bit = 6,
  293. + .clkr = {
  294. + .enable_reg = 0x3cf4,
  295. + .enable_mask = BIT(4),
  296. + .hw.init = &(struct clk_init_data){
  297. + .name = "gmac_core3_clk",
  298. + .parent_names = (const char *[]){
  299. + "gmac_core3_src",
  300. + },
  301. + .num_parents = 1,
  302. + .ops = &clk_branch_ops,
  303. + .flags = CLK_SET_RATE_PARENT,
  304. + },
  305. + },
  306. +};
  307. +
  308. +static struct clk_dyn_rcg gmac_core4_src = {
  309. + .ns_reg[0] = 0x3d0c,
  310. + .ns_reg[1] = 0x3d10,
  311. + .md_reg[0] = 0x3d04,
  312. + .md_reg[1] = 0x3d08,
  313. + .bank_reg = 0x3d00,
  314. + .mn[0] = {
  315. + .mnctr_en_bit = 8,
  316. + .mnctr_reset_bit = 7,
  317. + .mnctr_mode_shift = 5,
  318. + .n_val_shift = 16,
  319. + .m_val_shift = 16,
  320. + .width = 8,
  321. + },
  322. + .mn[1] = {
  323. + .mnctr_en_bit = 8,
  324. + .mnctr_reset_bit = 7,
  325. + .mnctr_mode_shift = 5,
  326. + .n_val_shift = 16,
  327. + .m_val_shift = 16,
  328. + .width = 8,
  329. + },
  330. + .s[0] = {
  331. + .src_sel_shift = 0,
  332. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  333. + },
  334. + .s[1] = {
  335. + .src_sel_shift = 0,
  336. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  337. + },
  338. + .p[0] = {
  339. + .pre_div_shift = 3,
  340. + .pre_div_width = 2,
  341. + },
  342. + .p[1] = {
  343. + .pre_div_shift = 3,
  344. + .pre_div_width = 2,
  345. + },
  346. + .mux_sel_bit = 0,
  347. + .freq_tbl = clk_tbl_gmac,
  348. + .clkr = {
  349. + .enable_reg = 0x3d00,
  350. + .enable_mask = BIT(1),
  351. + .hw.init = &(struct clk_init_data){
  352. + .name = "gmac_core4_src",
  353. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  354. + .num_parents = 5,
  355. + .ops = &clk_dyn_rcg_ops,
  356. + },
  357. + },
  358. +};
  359. +
  360. +static struct clk_branch gmac_core4_clk = {
  361. + .halt_reg = 0x3c20,
  362. + .halt_bit = 7,
  363. + .hwcg_reg = 0x3d14,
  364. + .hwcg_bit = 6,
  365. + .clkr = {
  366. + .enable_reg = 0x3d14,
  367. + .enable_mask = BIT(4),
  368. + .hw.init = &(struct clk_init_data){
  369. + .name = "gmac_core4_clk",
  370. + .parent_names = (const char *[]){
  371. + "gmac_core4_src",
  372. + },
  373. + .num_parents = 1,
  374. + .ops = &clk_branch_ops,
  375. + .flags = CLK_SET_RATE_PARENT,
  376. + },
  377. + },
  378. +};
  379. +
  380. +static const struct freq_tbl clk_tbl_nss_tcm[] = {
  381. + { 266000000, P_PLL0, 3, 0, 0 },
  382. + { 400000000, P_PLL0, 2, 0, 0 },
  383. + { }
  384. +};
  385. +
  386. +static struct clk_dyn_rcg nss_tcm_src = {
  387. + .ns_reg[0] = 0x3dc4,
  388. + .ns_reg[1] = 0x3dc8,
  389. + .bank_reg = 0x3dc0,
  390. + .s[0] = {
  391. + .src_sel_shift = 0,
  392. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  393. + },
  394. + .s[1] = {
  395. + .src_sel_shift = 0,
  396. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  397. + },
  398. + .p[0] = {
  399. + .pre_div_shift = 3,
  400. + .pre_div_width = 4,
  401. + },
  402. + .p[1] = {
  403. + .pre_div_shift = 3,
  404. + .pre_div_width = 4,
  405. + },
  406. + .mux_sel_bit = 0,
  407. + .freq_tbl = clk_tbl_nss_tcm,
  408. + .clkr = {
  409. + .enable_reg = 0x3dc0,
  410. + .enable_mask = BIT(1),
  411. + .hw.init = &(struct clk_init_data){
  412. + .name = "nss_tcm_src",
  413. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  414. + .num_parents = 5,
  415. + .ops = &clk_dyn_rcg_ops,
  416. + },
  417. + },
  418. +};
  419. +
  420. +static struct clk_branch nss_tcm_clk = {
  421. + .halt_reg = 0x3c20,
  422. + .halt_bit = 14,
  423. + .clkr = {
  424. + .enable_reg = 0x3dd0,
  425. + .enable_mask = BIT(6) | BIT(4),
  426. + .hw.init = &(struct clk_init_data){
  427. + .name = "nss_tcm_clk",
  428. + .parent_names = (const char *[]){
  429. + "nss_tcm_src",
  430. + },
  431. + .num_parents = 1,
  432. + .ops = &clk_branch_ops,
  433. + .flags = CLK_SET_RATE_PARENT,
  434. + },
  435. + },
  436. +};
  437. +
  438. +static const struct freq_tbl clk_tbl_nss[] = {
  439. + { 110000000, P_PLL18, 1, 1, 5 },
  440. + { 275000000, P_PLL18, 2, 0, 0 },
  441. + { 550000000, P_PLL18, 1, 0, 0 },
  442. + { 733000000, P_PLL18, 1, 0, 0 },
  443. + { }
  444. +};
  445. +
  446. +static struct clk_dyn_rcg ubi32_core1_src_clk = {
  447. + .ns_reg[0] = 0x3d2c,
  448. + .ns_reg[1] = 0x3d30,
  449. + .md_reg[0] = 0x3d24,
  450. + .md_reg[1] = 0x3d28,
  451. + .bank_reg = 0x3d20,
  452. + .mn[0] = {
  453. + .mnctr_en_bit = 8,
  454. + .mnctr_reset_bit = 7,
  455. + .mnctr_mode_shift = 5,
  456. + .n_val_shift = 16,
  457. + .m_val_shift = 16,
  458. + .width = 8,
  459. + },
  460. + .mn[1] = {
  461. + .mnctr_en_bit = 8,
  462. + .mnctr_reset_bit = 7,
  463. + .mnctr_mode_shift = 5,
  464. + .n_val_shift = 16,
  465. + .m_val_shift = 16,
  466. + .width = 8,
  467. + },
  468. + .s[0] = {
  469. + .src_sel_shift = 0,
  470. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  471. + },
  472. + .s[1] = {
  473. + .src_sel_shift = 0,
  474. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  475. + },
  476. + .p[0] = {
  477. + .pre_div_shift = 3,
  478. + .pre_div_width = 2,
  479. + },
  480. + .p[1] = {
  481. + .pre_div_shift = 3,
  482. + .pre_div_width = 2,
  483. + },
  484. + .mux_sel_bit = 0,
  485. + .freq_tbl = clk_tbl_nss,
  486. + .clkr = {
  487. + .enable_reg = 0x3d20,
  488. + .enable_mask = BIT(1),
  489. + .hw.init = &(struct clk_init_data){
  490. + .name = "ubi32_core1_src_clk",
  491. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  492. + .num_parents = 5,
  493. + .ops = &clk_dyn_rcg_ops,
  494. + .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
  495. + },
  496. + },
  497. +};
  498. +
  499. +static struct clk_dyn_rcg ubi32_core2_src_clk = {
  500. + .ns_reg[0] = 0x3d4c,
  501. + .ns_reg[1] = 0x3d50,
  502. + .md_reg[0] = 0x3d44,
  503. + .md_reg[1] = 0x3d48,
  504. + .bank_reg = 0x3d40,
  505. + .mn[0] = {
  506. + .mnctr_en_bit = 8,
  507. + .mnctr_reset_bit = 7,
  508. + .mnctr_mode_shift = 5,
  509. + .n_val_shift = 16,
  510. + .m_val_shift = 16,
  511. + .width = 8,
  512. + },
  513. + .mn[1] = {
  514. + .mnctr_en_bit = 8,
  515. + .mnctr_reset_bit = 7,
  516. + .mnctr_mode_shift = 5,
  517. + .n_val_shift = 16,
  518. + .m_val_shift = 16,
  519. + .width = 8,
  520. + },
  521. + .s[0] = {
  522. + .src_sel_shift = 0,
  523. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  524. + },
  525. + .s[1] = {
  526. + .src_sel_shift = 0,
  527. + .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
  528. + },
  529. + .p[0] = {
  530. + .pre_div_shift = 3,
  531. + .pre_div_width = 2,
  532. + },
  533. + .p[1] = {
  534. + .pre_div_shift = 3,
  535. + .pre_div_width = 2,
  536. + },
  537. + .mux_sel_bit = 0,
  538. + .freq_tbl = clk_tbl_nss,
  539. + .clkr = {
  540. + .enable_reg = 0x3d40,
  541. + .enable_mask = BIT(1),
  542. + .hw.init = &(struct clk_init_data){
  543. + .name = "ubi32_core2_src_clk",
  544. + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
  545. + .num_parents = 5,
  546. + .ops = &clk_dyn_rcg_ops,
  547. + .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
  548. + },
  549. + },
  550. +};
  551. +
  552. static struct clk_regmap *gcc_ipq806x_clks[] = {
  553. [PLL0] = &pll0.clkr,
  554. [PLL0_VOTE] = &pll0_vote,
  555. @@ -2277,6 +2794,7 @@ static struct clk_regmap *gcc_ipq806x_cl
  556. [PLL8_VOTE] = &pll8_vote,
  557. [PLL14] = &pll14.clkr,
  558. [PLL14_VOTE] = &pll14_vote,
  559. + [PLL18] = &pll18.clkr,
  560. [GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
  561. [GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
  562. [GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
  563. @@ -2376,6 +2894,18 @@ static struct clk_regmap *gcc_ipq806x_cl
  564. [PLL9] = &hfpll0.clkr,
  565. [PLL10] = &hfpll1.clkr,
  566. [PLL12] = &hfpll_l2.clkr,
  567. + [GMAC_CORE1_CLK_SRC] = &gmac_core1_src.clkr,
  568. + [GMAC_CORE1_CLK] = &gmac_core1_clk.clkr,
  569. + [GMAC_CORE2_CLK_SRC] = &gmac_core2_src.clkr,
  570. + [GMAC_CORE2_CLK] = &gmac_core2_clk.clkr,
  571. + [GMAC_CORE3_CLK_SRC] = &gmac_core3_src.clkr,
  572. + [GMAC_CORE3_CLK] = &gmac_core3_clk.clkr,
  573. + [GMAC_CORE4_CLK_SRC] = &gmac_core4_src.clkr,
  574. + [GMAC_CORE4_CLK] = &gmac_core4_clk.clkr,
  575. + [UBI32_CORE1_CLK_SRC] = &ubi32_core1_src_clk.clkr,
  576. + [UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr,
  577. + [NSSTCM_CLK_SRC] = &nss_tcm_src.clkr,
  578. + [NSSTCM_CLK] = &nss_tcm_clk.clkr,
  579. };
  580. static const struct qcom_reset_map gcc_ipq806x_resets[] = {
  581. @@ -2494,6 +3024,48 @@ static const struct qcom_reset_map gcc_i
  582. [USB30_1_PHY_RESET] = { 0x3b58, 0 },
  583. [NSSFB0_RESET] = { 0x3b60, 6 },
  584. [NSSFB1_RESET] = { 0x3b60, 7 },
  585. + [UBI32_CORE1_CLKRST_CLAMP_RESET] = { 0x3d3c, 3},
  586. + [UBI32_CORE1_CLAMP_RESET] = { 0x3d3c, 2 },
  587. + [UBI32_CORE1_AHB_RESET] = { 0x3d3c, 1 },
  588. + [UBI32_CORE1_AXI_RESET] = { 0x3d3c, 0 },
  589. + [UBI32_CORE2_CLKRST_CLAMP_RESET] = { 0x3d5c, 3 },
  590. + [UBI32_CORE2_CLAMP_RESET] = { 0x3d5c, 2 },
  591. + [UBI32_CORE2_AHB_RESET] = { 0x3d5c, 1 },
  592. + [UBI32_CORE2_AXI_RESET] = { 0x3d5c, 0 },
  593. + [GMAC_CORE1_RESET] = { 0x3cbc, 0 },
  594. + [GMAC_CORE2_RESET] = { 0x3cdc, 0 },
  595. + [GMAC_CORE3_RESET] = { 0x3cfc, 0 },
  596. + [GMAC_CORE4_RESET] = { 0x3d1c, 0 },
  597. + [GMAC_AHB_RESET] = { 0x3e24, 0 },
  598. + [NSS_CH0_RST_RX_CLK_N_RESET] = { 0x3b60, 0 },
  599. + [NSS_CH0_RST_TX_CLK_N_RESET] = { 0x3b60, 1 },
  600. + [NSS_CH0_RST_RX_125M_N_RESET] = { 0x3b60, 2 },
  601. + [NSS_CH0_HW_RST_RX_125M_N_RESET] = { 0x3b60, 3 },
  602. + [NSS_CH0_RST_TX_125M_N_RESET] = { 0x3b60, 4 },
  603. + [NSS_CH1_RST_RX_CLK_N_RESET] = { 0x3b60, 5 },
  604. + [NSS_CH1_RST_TX_CLK_N_RESET] = { 0x3b60, 6 },
  605. + [NSS_CH1_RST_RX_125M_N_RESET] = { 0x3b60, 7 },
  606. + [NSS_CH1_HW_RST_RX_125M_N_RESET] = { 0x3b60, 8 },
  607. + [NSS_CH1_RST_TX_125M_N_RESET] = { 0x3b60, 9 },
  608. + [NSS_CH2_RST_RX_CLK_N_RESET] = { 0x3b60, 10 },
  609. + [NSS_CH2_RST_TX_CLK_N_RESET] = { 0x3b60, 11 },
  610. + [NSS_CH2_RST_RX_125M_N_RESET] = { 0x3b60, 12 },
  611. + [NSS_CH2_HW_RST_RX_125M_N_RESET] = { 0x3b60, 13 },
  612. + [NSS_CH2_RST_TX_125M_N_RESET] = { 0x3b60, 14 },
  613. + [NSS_CH3_RST_RX_CLK_N_RESET] = { 0x3b60, 15 },
  614. + [NSS_CH3_RST_TX_CLK_N_RESET] = { 0x3b60, 16 },
  615. + [NSS_CH3_RST_RX_125M_N_RESET] = { 0x3b60, 17 },
  616. + [NSS_CH3_HW_RST_RX_125M_N_RESET] = { 0x3b60, 18 },
  617. + [NSS_CH3_RST_TX_125M_N_RESET] = { 0x3b60, 19 },
  618. + [NSS_RST_RX_250M_125M_N_RESET] = { 0x3b60, 20 },
  619. + [NSS_RST_TX_250M_125M_N_RESET] = { 0x3b60, 21 },
  620. + [NSS_QSGMII_TXPI_RST_N_RESET] = { 0x3b60, 22 },
  621. + [NSS_QSGMII_CDR_RST_N_RESET] = { 0x3b60, 23 },
  622. + [NSS_SGMII2_CDR_RST_N_RESET] = { 0x3b60, 24 },
  623. + [NSS_SGMII3_CDR_RST_N_RESET] = { 0x3b60, 25 },
  624. + [NSS_CAL_PRBS_RST_N_RESET] = { 0x3b60, 26 },
  625. + [NSS_LCKDT_RST_N_RESET] = { 0x3b60, 27 },
  626. + [NSS_SRDS_N_RESET] = { 0x3b60, 28 },
  627. };
  628. static const struct regmap_config gcc_ipq806x_regmap_config = {
  629. @@ -2522,6 +3094,8 @@ static int gcc_ipq806x_probe(struct plat
  630. {
  631. struct clk *clk;
  632. struct device *dev = &pdev->dev;
  633. + struct regmap *regmap;
  634. + int ret;
  635. /* Temporary until RPM clocks supported */
  636. clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000);
  637. @@ -2532,7 +3106,25 @@ static int gcc_ipq806x_probe(struct plat
  638. if (IS_ERR(clk))
  639. return PTR_ERR(clk);
  640. - return qcom_cc_probe(pdev, &gcc_ipq806x_desc);
  641. + ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
  642. + if (ret)
  643. + return ret;
  644. +
  645. + regmap = dev_get_regmap(dev, NULL);
  646. + if (!regmap)
  647. + return -ENODEV;
  648. +
  649. + /* Setup PLL18 static bits */
  650. + regmap_update_bits(regmap, 0x31a4, 0xffffffc0, 0x40000400);
  651. + regmap_write(regmap, 0x31b0, 0x3080);
  652. +
  653. + /* Set GMAC footswitch sleep/wakeup values */
  654. + regmap_write(regmap, 0x3cb8, 8);
  655. + regmap_write(regmap, 0x3cd8, 8);
  656. + regmap_write(regmap, 0x3cf8, 8);
  657. + regmap_write(regmap, 0x3d18, 8);
  658. +
  659. + return 0;
  660. }
  661. static int gcc_ipq806x_remove(struct platform_device *pdev)
  662. --- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h
  663. +++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h
  664. @@ -290,5 +290,7 @@
  665. #define UBI32_CORE1_CLK 279
  666. #define UBI32_CORE2_CLK 280
  667. #define EBI2_AON_CLK 281
  668. +#define NSSTCM_CLK_SRC 282
  669. +#define NSSTCM_CLK 283
  670. #endif
  671. --- a/include/dt-bindings/reset/qcom,gcc-ipq806x.h
  672. +++ b/include/dt-bindings/reset/qcom,gcc-ipq806x.h
  673. @@ -129,4 +129,47 @@
  674. #define USB30_1_PHY_RESET 112
  675. #define NSSFB0_RESET 113
  676. #define NSSFB1_RESET 114
  677. +#define UBI32_CORE1_CLKRST_CLAMP_RESET 115
  678. +#define UBI32_CORE1_CLAMP_RESET 116
  679. +#define UBI32_CORE1_AHB_RESET 117
  680. +#define UBI32_CORE1_AXI_RESET 118
  681. +#define UBI32_CORE2_CLKRST_CLAMP_RESET 119
  682. +#define UBI32_CORE2_CLAMP_RESET 120
  683. +#define UBI32_CORE2_AHB_RESET 121
  684. +#define UBI32_CORE2_AXI_RESET 122
  685. +#define GMAC_CORE1_RESET 123
  686. +#define GMAC_CORE2_RESET 124
  687. +#define GMAC_CORE3_RESET 125
  688. +#define GMAC_CORE4_RESET 126
  689. +#define GMAC_AHB_RESET 127
  690. +#define NSS_CH0_RST_RX_CLK_N_RESET 128
  691. +#define NSS_CH0_RST_TX_CLK_N_RESET 129
  692. +#define NSS_CH0_RST_RX_125M_N_RESET 130
  693. +#define NSS_CH0_HW_RST_RX_125M_N_RESET 131
  694. +#define NSS_CH0_RST_TX_125M_N_RESET 132
  695. +#define NSS_CH1_RST_RX_CLK_N_RESET 133
  696. +#define NSS_CH1_RST_TX_CLK_N_RESET 134
  697. +#define NSS_CH1_RST_RX_125M_N_RESET 135
  698. +#define NSS_CH1_HW_RST_RX_125M_N_RESET 136
  699. +#define NSS_CH1_RST_TX_125M_N_RESET 137
  700. +#define NSS_CH2_RST_RX_CLK_N_RESET 138
  701. +#define NSS_CH2_RST_TX_CLK_N_RESET 139
  702. +#define NSS_CH2_RST_RX_125M_N_RESET 140
  703. +#define NSS_CH2_HW_RST_RX_125M_N_RESET 141
  704. +#define NSS_CH2_RST_TX_125M_N_RESET 142
  705. +#define NSS_CH3_RST_RX_CLK_N_RESET 143
  706. +#define NSS_CH3_RST_TX_CLK_N_RESET 144
  707. +#define NSS_CH3_RST_RX_125M_N_RESET 145
  708. +#define NSS_CH3_HW_RST_RX_125M_N_RESET 146
  709. +#define NSS_CH3_RST_TX_125M_N_RESET 147
  710. +#define NSS_RST_RX_250M_125M_N_RESET 148
  711. +#define NSS_RST_TX_250M_125M_N_RESET 149
  712. +#define NSS_QSGMII_TXPI_RST_N_RESET 150
  713. +#define NSS_QSGMII_CDR_RST_N_RESET 151
  714. +#define NSS_SGMII2_CDR_RST_N_RESET 152
  715. +#define NSS_SGMII3_CDR_RST_N_RESET 153
  716. +#define NSS_CAL_PRBS_RST_N_RESET 154
  717. +#define NSS_LCKDT_RST_N_RESET 155
  718. +#define NSS_SRDS_N_RESET 156
  719. +
  720. #endif