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