hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/arm/mach-omap2/board-generic.c
....@@ -1,20 +1,19 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2005 Nokia Corporation
34 * Author: Paul Mundt <paul.mundt@nokia.com>
45 *
5
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
6
+ * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/
67 *
78 * Modified from the original mach-omap/omap2/board-generic.c did by Paul
89 * to support the OMAP2+ device tree boards with an unique board file.
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
1310 */
1411 #include <linux/io.h>
1512 #include <linux/of_irq.h>
1613 #include <linux/of_platform.h>
1714 #include <linux/irqdomain.h>
15
+#include <linux/clocksource.h>
16
+#include <linux/clockchips.h>
1817
1918 #include <asm/setup.h>
2019 #include <asm/mach/arch.h>
....@@ -34,6 +33,20 @@
3433 omap_soc_device_init();
3534 }
3635
36
+/* Clocks are needed early, see drivers/clocksource for the rest */
37
+static void __init __maybe_unused omap_init_time_of(void)
38
+{
39
+ omap_clk_init();
40
+ timer_probe();
41
+}
42
+
43
+/* Used by am437x for ARM timer in non-SMP configurations */
44
+#if !defined(CONFIG_SMP) && defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
45
+void tick_broadcast(const struct cpumask *mask)
46
+{
47
+}
48
+#endif
49
+
3750 #ifdef CONFIG_SOC_OMAP2420
3851 static const char *const omap242x_boards_compat[] __initconst = {
3952 "ti,omap2420",
....@@ -45,7 +58,7 @@
4558 .map_io = omap242x_map_io,
4659 .init_early = omap2420_init_early,
4760 .init_machine = omap_generic_init,
48
- .init_time = omap_init_time,
61
+ .init_time = omap_init_time_of,
4962 .dt_compat = omap242x_boards_compat,
5063 .restart = omap2xxx_restart,
5164 MACHINE_END
....@@ -62,7 +75,7 @@
6275 .map_io = omap243x_map_io,
6376 .init_early = omap2430_init_early,
6477 .init_machine = omap_generic_init,
65
- .init_time = omap_init_time,
78
+ .init_time = omap_init_time_of,
6679 .dt_compat = omap243x_boards_compat,
6780 .restart = omap2xxx_restart,
6881 MACHINE_END
....@@ -109,7 +122,7 @@
109122 .init_early = omap3430_init_early,
110123 .init_machine = omap_generic_init,
111124 .init_late = omap3_init_late,
112
- .init_time = omap_init_time,
125
+ .init_time = omap_init_time_of,
113126 .dt_compat = n900_boards_compat,
114127 .restart = omap3xxx_restart,
115128 MACHINE_END
....@@ -127,7 +140,7 @@
127140 .init_early = omap3430_init_early,
128141 .init_machine = omap_generic_init,
129142 .init_late = omap3_init_late,
130
- .init_time = omap_init_time,
143
+ .init_time = omap_init_time_of,
131144 .dt_compat = omap3_boards_compat,
132145 .restart = omap3xxx_restart,
133146 MACHINE_END
....@@ -144,7 +157,7 @@
144157 .init_early = omap3630_init_early,
145158 .init_machine = omap_generic_init,
146159 .init_late = omap3_init_late,
147
- .init_time = omap_init_time,
160
+ .init_time = omap_init_time_of,
148161 .dt_compat = omap36xx_boards_compat,
149162 .restart = omap3xxx_restart,
150163 MACHINE_END
....@@ -161,7 +174,7 @@
161174 .init_early = omap3430_init_early,
162175 .init_machine = omap_generic_init,
163176 .init_late = omap3_init_late,
164
- .init_time = omap3_secure_sync32k_timer_init,
177
+ .init_time = omap_init_time_of,
165178 .dt_compat = omap3_gp_boards_compat,
166179 .restart = omap3xxx_restart,
167180 MACHINE_END
....@@ -177,7 +190,7 @@
177190 .init_early = am35xx_init_early,
178191 .init_machine = omap_generic_init,
179192 .init_late = omap3_init_late,
180
- .init_time = omap3_gptimer_timer_init,
193
+ .init_time = omap_init_time_of,
181194 .dt_compat = am3517_boards_compat,
182195 .restart = omap3xxx_restart,
183196 MACHINE_END
....@@ -196,7 +209,7 @@
196209 .init_early = ti814x_init_early,
197210 .init_machine = omap_generic_init,
198211 .init_late = ti81xx_init_late,
199
- .init_time = omap3_gptimer_timer_init,
212
+ .init_time = omap_init_time_of,
200213 .dt_compat = ti814x_boards_compat,
201214 .restart = ti81xx_restart,
202215 MACHINE_END
....@@ -213,7 +226,7 @@
213226 .init_early = ti816x_init_early,
214227 .init_machine = omap_generic_init,
215228 .init_late = ti81xx_init_late,
216
- .init_time = omap3_gptimer_timer_init,
229
+ .init_time = omap_init_time_of,
217230 .dt_compat = ti816x_boards_compat,
218231 .restart = ti81xx_restart,
219232 MACHINE_END
....@@ -231,7 +244,7 @@
231244 .init_early = am33xx_init_early,
232245 .init_machine = omap_generic_init,
233246 .init_late = am33xx_init_late,
234
- .init_time = omap3_gptimer_timer_init,
247
+ .init_time = omap_init_time_of,
235248 .dt_compat = am33xx_boards_compat,
236249 .restart = am33xx_restart,
237250 MACHINE_END
....@@ -256,7 +269,7 @@
256269 .init_irq = omap_gic_of_init,
257270 .init_machine = omap_generic_init,
258271 .init_late = omap4430_init_late,
259
- .init_time = omap4_local_timer_init,
272
+ .init_time = omap_init_time_of,
260273 .dt_compat = omap4_boards_compat,
261274 .restart = omap44xx_restart,
262275 MACHINE_END
....@@ -303,7 +316,7 @@
303316 .init_late = am43xx_init_late,
304317 .init_irq = omap_gic_of_init,
305318 .init_machine = omap_generic_init,
306
- .init_time = omap3_gptimer_timer_init,
319
+ .init_time = omap_init_time_of,
307320 .dt_compat = am43_boards_compat,
308321 .restart = omap44xx_restart,
309322 MACHINE_END