forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/arm/mach-omap2/board-generic.c
....@@ -1,20 +1,18 @@
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>
1816
1917 #include <asm/setup.h>
2018 #include <asm/mach/arch.h>
....@@ -34,6 +32,20 @@
3432 omap_soc_device_init();
3533 }
3634
35
+/* Clocks are needed early, see drivers/clocksource for the rest */
36
+static void __init __maybe_unused omap_init_time_of(void)
37
+{
38
+ omap_clk_init();
39
+ timer_probe();
40
+}
41
+
42
+/* Used by am437x for ARM timer in non-SMP configurations */
43
+#if !defined(CONFIG_SMP) && defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
44
+void tick_broadcast(const struct cpumask *mask)
45
+{
46
+}
47
+#endif
48
+
3749 #ifdef CONFIG_SOC_OMAP2420
3850 static const char *const omap242x_boards_compat[] __initconst = {
3951 "ti,omap2420",
....@@ -45,7 +57,7 @@
4557 .map_io = omap242x_map_io,
4658 .init_early = omap2420_init_early,
4759 .init_machine = omap_generic_init,
48
- .init_time = omap_init_time,
60
+ .init_time = omap_init_time_of,
4961 .dt_compat = omap242x_boards_compat,
5062 .restart = omap2xxx_restart,
5163 MACHINE_END
....@@ -62,7 +74,7 @@
6274 .map_io = omap243x_map_io,
6375 .init_early = omap2430_init_early,
6476 .init_machine = omap_generic_init,
65
- .init_time = omap_init_time,
77
+ .init_time = omap_init_time_of,
6678 .dt_compat = omap243x_boards_compat,
6779 .restart = omap2xxx_restart,
6880 MACHINE_END
....@@ -109,7 +121,7 @@
109121 .init_early = omap3430_init_early,
110122 .init_machine = omap_generic_init,
111123 .init_late = omap3_init_late,
112
- .init_time = omap_init_time,
124
+ .init_time = omap_init_time_of,
113125 .dt_compat = n900_boards_compat,
114126 .restart = omap3xxx_restart,
115127 MACHINE_END
....@@ -127,7 +139,7 @@
127139 .init_early = omap3430_init_early,
128140 .init_machine = omap_generic_init,
129141 .init_late = omap3_init_late,
130
- .init_time = omap_init_time,
142
+ .init_time = omap_init_time_of,
131143 .dt_compat = omap3_boards_compat,
132144 .restart = omap3xxx_restart,
133145 MACHINE_END
....@@ -144,7 +156,7 @@
144156 .init_early = omap3630_init_early,
145157 .init_machine = omap_generic_init,
146158 .init_late = omap3_init_late,
147
- .init_time = omap_init_time,
159
+ .init_time = omap_init_time_of,
148160 .dt_compat = omap36xx_boards_compat,
149161 .restart = omap3xxx_restart,
150162 MACHINE_END
....@@ -161,7 +173,7 @@
161173 .init_early = omap3430_init_early,
162174 .init_machine = omap_generic_init,
163175 .init_late = omap3_init_late,
164
- .init_time = omap3_secure_sync32k_timer_init,
176
+ .init_time = omap_init_time_of,
165177 .dt_compat = omap3_gp_boards_compat,
166178 .restart = omap3xxx_restart,
167179 MACHINE_END
....@@ -177,7 +189,7 @@
177189 .init_early = am35xx_init_early,
178190 .init_machine = omap_generic_init,
179191 .init_late = omap3_init_late,
180
- .init_time = omap3_gptimer_timer_init,
192
+ .init_time = omap_init_time_of,
181193 .dt_compat = am3517_boards_compat,
182194 .restart = omap3xxx_restart,
183195 MACHINE_END
....@@ -196,7 +208,7 @@
196208 .init_early = ti814x_init_early,
197209 .init_machine = omap_generic_init,
198210 .init_late = ti81xx_init_late,
199
- .init_time = omap3_gptimer_timer_init,
211
+ .init_time = omap_init_time_of,
200212 .dt_compat = ti814x_boards_compat,
201213 .restart = ti81xx_restart,
202214 MACHINE_END
....@@ -213,7 +225,7 @@
213225 .init_early = ti816x_init_early,
214226 .init_machine = omap_generic_init,
215227 .init_late = ti81xx_init_late,
216
- .init_time = omap3_gptimer_timer_init,
228
+ .init_time = omap_init_time_of,
217229 .dt_compat = ti816x_boards_compat,
218230 .restart = ti81xx_restart,
219231 MACHINE_END
....@@ -231,7 +243,7 @@
231243 .init_early = am33xx_init_early,
232244 .init_machine = omap_generic_init,
233245 .init_late = am33xx_init_late,
234
- .init_time = omap3_gptimer_timer_init,
246
+ .init_time = omap_init_time_of,
235247 .dt_compat = am33xx_boards_compat,
236248 .restart = am33xx_restart,
237249 MACHINE_END
....@@ -256,7 +268,7 @@
256268 .init_irq = omap_gic_of_init,
257269 .init_machine = omap_generic_init,
258270 .init_late = omap4430_init_late,
259
- .init_time = omap4_local_timer_init,
271
+ .init_time = omap_init_time_of,
260272 .dt_compat = omap4_boards_compat,
261273 .restart = omap44xx_restart,
262274 MACHINE_END
....@@ -303,7 +315,7 @@
303315 .init_late = am43xx_init_late,
304316 .init_irq = omap_gic_of_init,
305317 .init_machine = omap_generic_init,
306
- .init_time = omap3_gptimer_timer_init,
318
+ .init_time = omap_init_time_of,
307319 .dt_compat = am43_boards_compat,
308320 .restart = omap44xx_restart,
309321 MACHINE_END