112-clk-at91-Fix-the-declaration-of-the-clocks.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. From 5a25e2437af0db535b17da352fb16680a8dfdeda Mon Sep 17 00:00:00 2001
  2. From: Tudor Ambarus <[email protected]>
  3. Date: Wed, 3 Feb 2021 17:43:32 +0200
  4. Subject: [PATCH 112/247] clk: at91: Fix the declaration of the clocks
  5. These are all "early clocks" that require initialization just at
  6. of_clk_init() time. Use CLK_OF_DECLARE() to declare them.
  7. This also fixes a problem that was spotted when fw_devlink was
  8. set to 'on' by default: the boards failed to boot. The reason is
  9. that CLK_OF_DECLARE_DRIVER() clears the OF_POPULATED and causes
  10. the consumers of the clock to be postponed by fw_devlink until
  11. the second initialization routine of the clock has been completed.
  12. One of the consumers of the clock is the timer, which is used as a
  13. clocksource, and needs the clock initialized early. Postponing the
  14. timers caused the fail at boot.
  15. Signed-off-by: Tudor Ambarus <[email protected]>
  16. Link: https://lore.kernel.org/r/[email protected]
  17. Acked-by: Saravana Kannan <[email protected]>
  18. Tested-by: Eugen Hristev <[email protected]>
  19. Acked-by: Nicolas Ferre <[email protected]>
  20. Reviewed-by: Claudiu Beznea <[email protected]>
  21. Signed-off-by: Stephen Boyd <[email protected]>
  22. ---
  23. drivers/clk/at91/at91rm9200.c | 3 +--
  24. drivers/clk/at91/at91sam9260.c | 16 ++++++++--------
  25. drivers/clk/at91/at91sam9g45.c | 3 +--
  26. drivers/clk/at91/at91sam9n12.c | 3 +--
  27. drivers/clk/at91/at91sam9rl.c | 3 ++-
  28. drivers/clk/at91/at91sam9x5.c | 20 ++++++++++----------
  29. drivers/clk/at91/sama5d2.c | 3 ++-
  30. drivers/clk/at91/sama5d3.c | 2 +-
  31. drivers/clk/at91/sama5d4.c | 3 ++-
  32. 9 files changed, 28 insertions(+), 28 deletions(-)
  33. --- a/drivers/clk/at91/at91rm9200.c
  34. +++ b/drivers/clk/at91/at91rm9200.c
  35. @@ -215,5 +215,4 @@ err_free:
  36. * deferring properly. Once this is fixed, this can be switched to a platform
  37. * driver.
  38. */
  39. -CLK_OF_DECLARE_DRIVER(at91rm9200_pmc, "atmel,at91rm9200-pmc",
  40. - at91rm9200_pmc_setup);
  41. +CLK_OF_DECLARE(at91rm9200_pmc, "atmel,at91rm9200-pmc", at91rm9200_pmc_setup);
  42. --- a/drivers/clk/at91/at91sam9260.c
  43. +++ b/drivers/clk/at91/at91sam9260.c
  44. @@ -491,26 +491,26 @@ static void __init at91sam9260_pmc_setup
  45. {
  46. at91sam926x_pmc_setup(np, &at91sam9260_data);
  47. }
  48. -CLK_OF_DECLARE_DRIVER(at91sam9260_pmc, "atmel,at91sam9260-pmc",
  49. - at91sam9260_pmc_setup);
  50. +
  51. +CLK_OF_DECLARE(at91sam9260_pmc, "atmel,at91sam9260-pmc", at91sam9260_pmc_setup);
  52. static void __init at91sam9261_pmc_setup(struct device_node *np)
  53. {
  54. at91sam926x_pmc_setup(np, &at91sam9261_data);
  55. }
  56. -CLK_OF_DECLARE_DRIVER(at91sam9261_pmc, "atmel,at91sam9261-pmc",
  57. - at91sam9261_pmc_setup);
  58. +
  59. +CLK_OF_DECLARE(at91sam9261_pmc, "atmel,at91sam9261-pmc", at91sam9261_pmc_setup);
  60. static void __init at91sam9263_pmc_setup(struct device_node *np)
  61. {
  62. at91sam926x_pmc_setup(np, &at91sam9263_data);
  63. }
  64. -CLK_OF_DECLARE_DRIVER(at91sam9263_pmc, "atmel,at91sam9263-pmc",
  65. - at91sam9263_pmc_setup);
  66. +
  67. +CLK_OF_DECLARE(at91sam9263_pmc, "atmel,at91sam9263-pmc", at91sam9263_pmc_setup);
  68. static void __init at91sam9g20_pmc_setup(struct device_node *np)
  69. {
  70. at91sam926x_pmc_setup(np, &at91sam9g20_data);
  71. }
  72. -CLK_OF_DECLARE_DRIVER(at91sam9g20_pmc, "atmel,at91sam9g20-pmc",
  73. - at91sam9g20_pmc_setup);
  74. +
  75. +CLK_OF_DECLARE(at91sam9g20_pmc, "atmel,at91sam9g20-pmc", at91sam9g20_pmc_setup);
  76. --- a/drivers/clk/at91/at91sam9g45.c
  77. +++ b/drivers/clk/at91/at91sam9g45.c
  78. @@ -228,5 +228,4 @@ err_free:
  79. * The TCB is used as the clocksource so its clock is needed early. This means
  80. * this can't be a platform driver.
  81. */
  82. -CLK_OF_DECLARE_DRIVER(at91sam9g45_pmc, "atmel,at91sam9g45-pmc",
  83. - at91sam9g45_pmc_setup);
  84. +CLK_OF_DECLARE(at91sam9g45_pmc, "atmel,at91sam9g45-pmc", at91sam9g45_pmc_setup);
  85. --- a/drivers/clk/at91/at91sam9n12.c
  86. +++ b/drivers/clk/at91/at91sam9n12.c
  87. @@ -255,5 +255,4 @@ err_free:
  88. * The TCB is used as the clocksource so its clock is needed early. This means
  89. * this can't be a platform driver.
  90. */
  91. -CLK_OF_DECLARE_DRIVER(at91sam9n12_pmc, "atmel,at91sam9n12-pmc",
  92. - at91sam9n12_pmc_setup);
  93. +CLK_OF_DECLARE(at91sam9n12_pmc, "atmel,at91sam9n12-pmc", at91sam9n12_pmc_setup);
  94. --- a/drivers/clk/at91/at91sam9rl.c
  95. +++ b/drivers/clk/at91/at91sam9rl.c
  96. @@ -186,4 +186,5 @@ static void __init at91sam9rl_pmc_setup(
  97. err_free:
  98. kfree(at91sam9rl_pmc);
  99. }
  100. -CLK_OF_DECLARE_DRIVER(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);
  101. +
  102. +CLK_OF_DECLARE(at91sam9rl_pmc, "atmel,at91sam9rl-pmc", at91sam9rl_pmc_setup);
  103. --- a/drivers/clk/at91/at91sam9x5.c
  104. +++ b/drivers/clk/at91/at91sam9x5.c
  105. @@ -302,33 +302,33 @@ static void __init at91sam9g15_pmc_setup
  106. {
  107. at91sam9x5_pmc_setup(np, at91sam9g15_periphck, true);
  108. }
  109. -CLK_OF_DECLARE_DRIVER(at91sam9g15_pmc, "atmel,at91sam9g15-pmc",
  110. - at91sam9g15_pmc_setup);
  111. +
  112. +CLK_OF_DECLARE(at91sam9g15_pmc, "atmel,at91sam9g15-pmc", at91sam9g15_pmc_setup);
  113. static void __init at91sam9g25_pmc_setup(struct device_node *np)
  114. {
  115. at91sam9x5_pmc_setup(np, at91sam9g25_periphck, false);
  116. }
  117. -CLK_OF_DECLARE_DRIVER(at91sam9g25_pmc, "atmel,at91sam9g25-pmc",
  118. - at91sam9g25_pmc_setup);
  119. +
  120. +CLK_OF_DECLARE(at91sam9g25_pmc, "atmel,at91sam9g25-pmc", at91sam9g25_pmc_setup);
  121. static void __init at91sam9g35_pmc_setup(struct device_node *np)
  122. {
  123. at91sam9x5_pmc_setup(np, at91sam9g35_periphck, true);
  124. }
  125. -CLK_OF_DECLARE_DRIVER(at91sam9g35_pmc, "atmel,at91sam9g35-pmc",
  126. - at91sam9g35_pmc_setup);
  127. +
  128. +CLK_OF_DECLARE(at91sam9g35_pmc, "atmel,at91sam9g35-pmc", at91sam9g35_pmc_setup);
  129. static void __init at91sam9x25_pmc_setup(struct device_node *np)
  130. {
  131. at91sam9x5_pmc_setup(np, at91sam9x25_periphck, false);
  132. }
  133. -CLK_OF_DECLARE_DRIVER(at91sam9x25_pmc, "atmel,at91sam9x25-pmc",
  134. - at91sam9x25_pmc_setup);
  135. +
  136. +CLK_OF_DECLARE(at91sam9x25_pmc, "atmel,at91sam9x25-pmc", at91sam9x25_pmc_setup);
  137. static void __init at91sam9x35_pmc_setup(struct device_node *np)
  138. {
  139. at91sam9x5_pmc_setup(np, at91sam9x35_periphck, true);
  140. }
  141. -CLK_OF_DECLARE_DRIVER(at91sam9x35_pmc, "atmel,at91sam9x35-pmc",
  142. - at91sam9x35_pmc_setup);
  143. +
  144. +CLK_OF_DECLARE(at91sam9x35_pmc, "atmel,at91sam9x35-pmc", at91sam9x35_pmc_setup);
  145. --- a/drivers/clk/at91/sama5d2.c
  146. +++ b/drivers/clk/at91/sama5d2.c
  147. @@ -372,4 +372,5 @@ static void __init sama5d2_pmc_setup(str
  148. err_free:
  149. kfree(sama5d2_pmc);
  150. }
  151. -CLK_OF_DECLARE_DRIVER(sama5d2_pmc, "atmel,sama5d2-pmc", sama5d2_pmc_setup);
  152. +
  153. +CLK_OF_DECLARE(sama5d2_pmc, "atmel,sama5d2-pmc", sama5d2_pmc_setup);
  154. --- a/drivers/clk/at91/sama5d3.c
  155. +++ b/drivers/clk/at91/sama5d3.c
  156. @@ -255,4 +255,4 @@ err_free:
  157. * The TCB is used as the clocksource so its clock is needed early. This means
  158. * this can't be a platform driver.
  159. */
  160. -CLK_OF_DECLARE_DRIVER(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);
  161. +CLK_OF_DECLARE(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);
  162. --- a/drivers/clk/at91/sama5d4.c
  163. +++ b/drivers/clk/at91/sama5d4.c
  164. @@ -286,4 +286,5 @@ static void __init sama5d4_pmc_setup(str
  165. err_free:
  166. kfree(sama5d4_pmc);
  167. }
  168. -CLK_OF_DECLARE_DRIVER(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);
  169. +
  170. +CLK_OF_DECLARE(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);