hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/arm/kernel/smp_twd.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/kernel/smp_twd.c
34 *
45 * Copyright (C) 2002 ARM Ltd.
56 * All Rights Reserved
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118 #include <linux/init.h>
129 #include <linux/kernel.h>
....@@ -100,8 +97,6 @@
10097 disable_percpu_irq(clk->irq);
10198 }
10299
103
-#ifdef CONFIG_COMMON_CLK
104
-
105100 /*
106101 * Updates clockevent frequency when the cpu frequency changes.
107102 * Called on the cpu that is changing frequency with interrupts disabled.
....@@ -142,54 +137,6 @@
142137 return 0;
143138 }
144139 core_initcall(twd_clk_init);
145
-
146
-#elif defined (CONFIG_CPU_FREQ)
147
-
148
-#include <linux/cpufreq.h>
149
-
150
-/*
151
- * Updates clockevent frequency when the cpu frequency changes.
152
- * Called on the cpu that is changing frequency with interrupts disabled.
153
- */
154
-static void twd_update_frequency(void *data)
155
-{
156
- twd_timer_rate = clk_get_rate(twd_clk);
157
-
158
- clockevents_update_freq(raw_cpu_ptr(twd_evt), twd_timer_rate);
159
-}
160
-
161
-static int twd_cpufreq_transition(struct notifier_block *nb,
162
- unsigned long state, void *data)
163
-{
164
- struct cpufreq_freqs *freqs = data;
165
-
166
- /*
167
- * The twd clock events must be reprogrammed to account for the new
168
- * frequency. The timer is local to a cpu, so cross-call to the
169
- * changing cpu.
170
- */
171
- if (state == CPUFREQ_POSTCHANGE)
172
- smp_call_function_single(freqs->cpu, twd_update_frequency,
173
- NULL, 1);
174
-
175
- return NOTIFY_OK;
176
-}
177
-
178
-static struct notifier_block twd_cpufreq_nb = {
179
- .notifier_call = twd_cpufreq_transition,
180
-};
181
-
182
-static int twd_cpufreq_init(void)
183
-{
184
- if (twd_evt && raw_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
185
- return cpufreq_register_notifier(&twd_cpufreq_nb,
186
- CPUFREQ_TRANSITION_NOTIFIER);
187
-
188
- return 0;
189
-}
190
-core_initcall(twd_cpufreq_init);
191
-
192
-#endif
193140
194141 static void twd_calibrate_rate(void)
195142 {
....@@ -366,21 +313,6 @@
366313 return err;
367314 }
368315
369
-int __init twd_local_timer_register(struct twd_local_timer *tlt)
370
-{
371
- if (twd_base || twd_evt)
372
- return -EBUSY;
373
-
374
- twd_ppi = tlt->res[1].start;
375
-
376
- twd_base = ioremap(tlt->res[0].start, resource_size(&tlt->res[0]));
377
- if (!twd_base)
378
- return -ENOMEM;
379
-
380
- return twd_local_timer_common_register(NULL);
381
-}
382
-
383
-#ifdef CONFIG_OF
384316 static int __init twd_local_timer_of_register(struct device_node *np)
385317 {
386318 int err;
....@@ -406,4 +338,3 @@
406338 TIMER_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
407339 TIMER_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
408340 TIMER_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);
409
-#endif