311-add-rpmcc-for-ipq806x.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.txt
  2. +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.txt
  3. @@ -12,6 +12,7 @@ Required properties :
  4. "qcom,rpmcc-msm8916", "qcom,rpmcc"
  5. "qcom,rpmcc-apq8064", "qcom,rpmcc"
  6. + "qcom,rpmcc-ipq806x", "qcom,rpmcc"
  7. - #clock-cells : shall contain 1
  8. --- a/drivers/clk/qcom/clk-rpm.c
  9. +++ b/drivers/clk/qcom/clk-rpm.c
  10. @@ -359,6 +359,16 @@ DEFINE_CLK_RPM(apq8064, sfab_clk, sfab_a
  11. DEFINE_CLK_RPM(apq8064, sfpb_clk, sfpb_a_clk, QCOM_RPM_SFPB_CLK);
  12. DEFINE_CLK_RPM(apq8064, qdss_clk, qdss_a_clk, QCOM_RPM_QDSS_CLK);
  13. +/* ipq806x */
  14. +DEFINE_CLK_RPM(ipq806x, afab_clk, afab_a_clk, QCOM_RPM_APPS_FABRIC_CLK);
  15. +DEFINE_CLK_RPM(ipq806x, cfpb_clk, cfpb_a_clk, QCOM_RPM_CFPB_CLK);
  16. +DEFINE_CLK_RPM(ipq806x, daytona_clk, daytona_a_clk, QCOM_RPM_DAYTONA_FABRIC_CLK);
  17. +DEFINE_CLK_RPM(ipq806x, ebi1_clk, ebi1_a_clk, QCOM_RPM_EBI1_CLK);
  18. +DEFINE_CLK_RPM(ipq806x, sfab_clk, sfab_a_clk, QCOM_RPM_SYS_FABRIC_CLK);
  19. +DEFINE_CLK_RPM(ipq806x, sfpb_clk, sfpb_a_clk, QCOM_RPM_SFPB_CLK);
  20. +DEFINE_CLK_RPM(ipq806x, nss_fabric_0_clk, nss_fabric_0_a_clk, QCOM_RPM_NSS_FABRIC_0_CLK);
  21. +DEFINE_CLK_RPM(ipq806x, nss_fabric_1_clk, nss_fabric_1_a_clk, QCOM_RPM_NSS_FABRIC_1_CLK);
  22. +
  23. static struct clk_rpm *apq8064_clks[] = {
  24. [RPM_APPS_FABRIC_CLK] = &apq8064_afab_clk,
  25. [RPM_APPS_FABRIC_A_CLK] = &apq8064_afab_a_clk,
  26. @@ -380,13 +390,38 @@ static struct clk_rpm *apq8064_clks[] =
  27. [RPM_QDSS_A_CLK] = &apq8064_qdss_a_clk,
  28. };
  29. +static struct clk_rpm *ipq806x_clks[] = {
  30. + [RPM_APPS_FABRIC_CLK] = &ipq806x_afab_clk,
  31. + [RPM_APPS_FABRIC_A_CLK] = &ipq806x_afab_a_clk,
  32. + [RPM_CFPB_CLK] = &ipq806x_cfpb_clk,
  33. + [RPM_CFPB_A_CLK] = &ipq806x_cfpb_a_clk,
  34. + [RPM_DAYTONA_FABRIC_CLK] = &ipq806x_daytona_clk,
  35. + [RPM_DAYTONA_FABRIC_A_CLK] = &ipq806x_daytona_a_clk,
  36. + [RPM_EBI1_CLK] = &ipq806x_ebi1_clk,
  37. + [RPM_EBI1_A_CLK] = &ipq806x_ebi1_a_clk,
  38. + [RPM_SYS_FABRIC_CLK] = &ipq806x_sfab_clk,
  39. + [RPM_SYS_FABRIC_A_CLK] = &ipq806x_sfab_a_clk,
  40. + [RPM_SFPB_CLK] = &ipq806x_sfpb_clk,
  41. + [RPM_SFPB_A_CLK] = &ipq806x_sfpb_a_clk,
  42. + [RPM_NSS_FABRIC_0_CLK] = &ipq806x_nss_fabric_0_clk,
  43. + [RPM_NSS_FABRIC_0_A_CLK] = &ipq806x_nss_fabric_0_a_clk,
  44. + [RPM_NSS_FABRIC_1_CLK] = &ipq806x_nss_fabric_1_clk,
  45. + [RPM_NSS_FABRIC_1_A_CLK] = &ipq806x_nss_fabric_1_a_clk,
  46. +};
  47. +
  48. static const struct rpm_clk_desc rpm_clk_apq8064 = {
  49. .clks = apq8064_clks,
  50. .num_clks = ARRAY_SIZE(apq8064_clks),
  51. };
  52. +static const struct rpm_clk_desc rpm_clk_ipq806x = {
  53. + .clks = ipq806x_clks,
  54. + .num_clks = ARRAY_SIZE(ipq806x_clks),
  55. +};
  56. +
  57. static const struct of_device_id rpm_clk_match_table[] = {
  58. { .compatible = "qcom,rpmcc-apq8064", .data = &rpm_clk_apq8064 },
  59. + { .compatible = "qcom,rpmcc-ipq806x", .data = &rpm_clk_ipq806x },
  60. { }
  61. };
  62. MODULE_DEVICE_TABLE(of, rpm_clk_match_table);
  63. --- a/include/dt-bindings/clock/qcom,rpmcc.h
  64. +++ b/include/dt-bindings/clock/qcom,rpmcc.h
  65. @@ -37,6 +37,10 @@
  66. #define RPM_SYS_FABRIC_A_CLK 19
  67. #define RPM_SFPB_CLK 20
  68. #define RPM_SFPB_A_CLK 21
  69. +#define RPM_NSS_FABRIC_0_CLK 22
  70. +#define RPM_NSS_FABRIC_0_A_CLK 23
  71. +#define RPM_NSS_FABRIC_1_CLK 24
  72. +#define RPM_NSS_FABRIC_1_A_CLK 25
  73. /* msm8916 */
  74. #define RPM_SMD_XO_CLK_SRC 0