0031-MIPS-ath79-drop-OF-clock-code.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. From 00e4313da4609074fff134e61dd9ffe3fd37474d Mon Sep 17 00:00:00 2001
  2. From: John Crispin <john@phrozen.org>
  3. Date: Sun, 24 Jun 2018 09:39:41 +0200
  4. Subject: [PATCH 31/33] MIPS: ath79: drop !OF clock code
  5. With the target now being fully OF based, we can drop the legacy clock
  6. registration code. All clocks are now probed via devicetree.
  7. Signed-off-by: John Crispin <john@phrozen.org>
  8. ---
  9. arch/mips/ath79/clock.c | 56 ------------------------------------------------
  10. arch/mips/ath79/common.h | 3 ---
  11. 2 files changed, 59 deletions(-)
  12. --- a/arch/mips/ath79/clock.c
  13. +++ b/arch/mips/ath79/clock.c
  14. @@ -617,60 +617,6 @@ static void __init qca956x_clocks_init(v
  15. ath79_set_clk(ATH79_CLK_AHB, ahb_rate);
  16. }
  17. -void __init ath79_clocks_init(void)
  18. -{
  19. - const char *wdt;
  20. - const char *uart;
  21. -
  22. - if (soc_is_ar71xx())
  23. - ar71xx_clocks_init(ath79_pll_base);
  24. - else if (soc_is_ar724x() || soc_is_ar913x())
  25. - ar724x_clocks_init(ath79_pll_base);
  26. - else if (soc_is_ar933x())
  27. - ar933x_clocks_init(ath79_pll_base);
  28. - else if (soc_is_ar934x())
  29. - ar934x_clocks_init(ath79_pll_base);
  30. - else if (soc_is_qca953x())
  31. - qca953x_clocks_init(ath79_pll_base);
  32. - else if (soc_is_qca955x())
  33. - qca955x_clocks_init(ath79_pll_base);
  34. - else if (soc_is_qca956x() || soc_is_tp9343())
  35. - qca956x_clocks_init(ath79_pll_base);
  36. - else
  37. - BUG();
  38. -
  39. - if (soc_is_ar71xx() || soc_is_ar724x() || soc_is_ar913x()) {
  40. - wdt = "ahb";
  41. - uart = "ahb";
  42. - } else if (soc_is_ar933x()) {
  43. - wdt = "ahb";
  44. - uart = "ref";
  45. - } else {
  46. - wdt = "ref";
  47. - uart = "ref";
  48. - }
  49. -
  50. - clk_add_alias("wdt", NULL, wdt, NULL);
  51. - clk_add_alias("uart", NULL, uart, NULL);
  52. -}
  53. -
  54. -unsigned long __init
  55. -ath79_get_sys_clk_rate(const char *id)
  56. -{
  57. - struct clk *clk;
  58. - unsigned long rate;
  59. -
  60. - clk = clk_get(NULL, id);
  61. - if (IS_ERR(clk))
  62. - panic("unable to get %s clock, err=%d", id, (int) PTR_ERR(clk));
  63. -
  64. - rate = clk_get_rate(clk);
  65. - clk_put(clk);
  66. -
  67. - return rate;
  68. -}
  69. -
  70. -#ifdef CONFIG_OF
  71. static void __init ath79_clocks_init_dt(struct device_node *np)
  72. {
  73. struct clk *ref_clk;
  74. @@ -727,5 +673,3 @@ CLK_OF_DECLARE(ar9340_clk, "qca,ar9340-p
  75. CLK_OF_DECLARE(ar9530_clk, "qca,qca9530-pll", ath79_clocks_init_dt);
  76. CLK_OF_DECLARE(ar9550_clk, "qca,qca9550-pll", ath79_clocks_init_dt);
  77. CLK_OF_DECLARE(ar9560_clk, "qca,qca9560-pll", ath79_clocks_init_dt);
  78. -
  79. -#endif
  80. --- a/arch/mips/ath79/common.h
  81. +++ b/arch/mips/ath79/common.h
  82. @@ -19,9 +19,6 @@
  83. #define ATH79_MEM_SIZE_MIN (2 * 1024 * 1024)
  84. #define ATH79_MEM_SIZE_MAX (256 * 1024 * 1024)
  85. -void ath79_clocks_init(void);
  86. -unsigned long ath79_get_sys_clk_rate(const char *id);
  87. -
  88. void ath79_ddr_ctrl_init(void);
  89. #endif /* __ATH79_COMMON_H */