2
0

811-clock-support-layerscape.patch 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. From a00c035c7b82f51716a1a30637b1bd276dee3c5a Mon Sep 17 00:00:00 2001
  2. From: Biwen Li <[email protected]>
  3. Date: Wed, 17 Apr 2019 18:58:17 +0800
  4. Subject: [PATCH] clock: support layerscape
  5. This is an integrated patch of clock for layerscape
  6. Signed-off-by: Biwen Li <[email protected]>
  7. Signed-off-by: Tang Yuantian <[email protected]>
  8. Signed-off-by: Vabhav Sharma <[email protected]>
  9. Signed-off-by: Yogesh Gaur <[email protected]>
  10. ---
  11. drivers/clk/clk-qoriq.c | 25 ++++++++++++++++++++++---
  12. drivers/cpufreq/qoriq-cpufreq.c | 1 +
  13. 2 files changed, 23 insertions(+), 3 deletions(-)
  14. --- a/drivers/clk/clk-qoriq.c
  15. +++ b/drivers/clk/clk-qoriq.c
  16. @@ -41,7 +41,7 @@ struct clockgen_pll_div {
  17. };
  18. struct clockgen_pll {
  19. - struct clockgen_pll_div div[4];
  20. + struct clockgen_pll_div div[8];
  21. };
  22. #define CLKSEL_VALID 1
  23. @@ -79,7 +79,7 @@ struct clockgen_chipinfo {
  24. const struct clockgen_muxinfo *cmux_groups[2];
  25. const struct clockgen_muxinfo *hwaccel[NUM_HWACCEL];
  26. void (*init_periph)(struct clockgen *cg);
  27. - int cmux_to_group[NUM_CMUX]; /* -1 terminates if fewer than NUM_CMUX */
  28. + int cmux_to_group[NUM_CMUX+1]; /* array should be -1 terminated */
  29. u32 pll_mask; /* 1 << n bit set if PLL n is valid */
  30. u32 flags; /* CG_xxx */
  31. };
  32. @@ -570,6 +570,17 @@ static const struct clockgen_chipinfo ch
  33. .flags = CG_VER3 | CG_LITTLE_ENDIAN,
  34. },
  35. {
  36. + .compat = "fsl,lx2160a-clockgen",
  37. + .cmux_groups = {
  38. + &clockgen2_cmux_cga12, &clockgen2_cmux_cgb
  39. + },
  40. + .cmux_to_group = {
  41. + 0, 0, 0, 0, 1, 1, 1, 1, -1
  42. + },
  43. + .pll_mask = 0x37,
  44. + .flags = CG_VER3 | CG_LITTLE_ENDIAN,
  45. + },
  46. + {
  47. .compat = "fsl,p2041-clockgen",
  48. .guts_compat = "fsl,qoriq-device-config-1.0",
  49. .init_periph = p2041_init_periph,
  50. @@ -601,7 +612,7 @@ static const struct clockgen_chipinfo ch
  51. &p4080_cmux_grp1, &p4080_cmux_grp2
  52. },
  53. .cmux_to_group = {
  54. - 0, 0, 0, 0, 1, 1, 1, 1
  55. + 0, 0, 0, 0, 1, 1, 1, 1, -1
  56. },
  57. .pll_mask = 0x1f,
  58. },
  59. @@ -1127,6 +1138,13 @@ static void __init create_one_pll(struct
  60. struct clk *clk;
  61. int ret;
  62. + /*
  63. + * For platform PLL, there are 8 divider clocks.
  64. + * For core PLL, there are 4 divider clocks at most.
  65. + */
  66. + if (idx != 0 && i >= 4)
  67. + break;
  68. +
  69. snprintf(pll->div[i].name, sizeof(pll->div[i].name),
  70. "cg-pll%d-div%d", idx, i + 1);
  71. @@ -1417,6 +1435,7 @@ CLK_OF_DECLARE(qoriq_clockgen_ls1043a, "
  72. CLK_OF_DECLARE(qoriq_clockgen_ls1046a, "fsl,ls1046a-clockgen", clockgen_init);
  73. CLK_OF_DECLARE(qoriq_clockgen_ls1088a, "fsl,ls1088a-clockgen", clockgen_init);
  74. CLK_OF_DECLARE(qoriq_clockgen_ls2080a, "fsl,ls2080a-clockgen", clockgen_init);
  75. +CLK_OF_DECLARE(qoriq_clockgen_lx2160a, "fsl,lx2160a-clockgen", clockgen_init);
  76. /* Legacy nodes */
  77. CLK_OF_DECLARE(qoriq_sysclk_1, "fsl,qoriq-sysclk-1.0", sysclk_init);
  78. --- a/drivers/cpufreq/qoriq-cpufreq.c
  79. +++ b/drivers/cpufreq/qoriq-cpufreq.c
  80. @@ -320,6 +320,7 @@ static const struct of_device_id node_ma
  81. { .compatible = "fsl,ls1046a-clockgen", },
  82. { .compatible = "fsl,ls1088a-clockgen", },
  83. { .compatible = "fsl,ls2080a-clockgen", },
  84. + { .compatible = "fsl,lx2160a-clockgen", },
  85. { .compatible = "fsl,p4080-clockgen", },
  86. { .compatible = "fsl,qoriq-clockgen-1.0", },
  87. { .compatible = "fsl,qoriq-clockgen-2.0", },