.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2005 Nokia Corporation |
---|
3 | 4 | * Author: Paul Mundt <paul.mundt@nokia.com> |
---|
4 | 5 | * |
---|
5 | | - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
---|
| 6 | + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ |
---|
6 | 7 | * |
---|
7 | 8 | * Modified from the original mach-omap/omap2/board-generic.c did by Paul |
---|
8 | 9 | * 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. |
---|
13 | 10 | */ |
---|
14 | 11 | #include <linux/io.h> |
---|
15 | 12 | #include <linux/of_irq.h> |
---|
16 | 13 | #include <linux/of_platform.h> |
---|
17 | 14 | #include <linux/irqdomain.h> |
---|
| 15 | +#include <linux/clocksource.h> |
---|
| 16 | +#include <linux/clockchips.h> |
---|
18 | 17 | |
---|
19 | 18 | #include <asm/setup.h> |
---|
20 | 19 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
34 | 33 | omap_soc_device_init(); |
---|
35 | 34 | } |
---|
36 | 35 | |
---|
| 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 | + |
---|
37 | 50 | #ifdef CONFIG_SOC_OMAP2420 |
---|
38 | 51 | static const char *const omap242x_boards_compat[] __initconst = { |
---|
39 | 52 | "ti,omap2420", |
---|
.. | .. |
---|
45 | 58 | .map_io = omap242x_map_io, |
---|
46 | 59 | .init_early = omap2420_init_early, |
---|
47 | 60 | .init_machine = omap_generic_init, |
---|
48 | | - .init_time = omap_init_time, |
---|
| 61 | + .init_time = omap_init_time_of, |
---|
49 | 62 | .dt_compat = omap242x_boards_compat, |
---|
50 | 63 | .restart = omap2xxx_restart, |
---|
51 | 64 | MACHINE_END |
---|
.. | .. |
---|
62 | 75 | .map_io = omap243x_map_io, |
---|
63 | 76 | .init_early = omap2430_init_early, |
---|
64 | 77 | .init_machine = omap_generic_init, |
---|
65 | | - .init_time = omap_init_time, |
---|
| 78 | + .init_time = omap_init_time_of, |
---|
66 | 79 | .dt_compat = omap243x_boards_compat, |
---|
67 | 80 | .restart = omap2xxx_restart, |
---|
68 | 81 | MACHINE_END |
---|
.. | .. |
---|
109 | 122 | .init_early = omap3430_init_early, |
---|
110 | 123 | .init_machine = omap_generic_init, |
---|
111 | 124 | .init_late = omap3_init_late, |
---|
112 | | - .init_time = omap_init_time, |
---|
| 125 | + .init_time = omap_init_time_of, |
---|
113 | 126 | .dt_compat = n900_boards_compat, |
---|
114 | 127 | .restart = omap3xxx_restart, |
---|
115 | 128 | MACHINE_END |
---|
.. | .. |
---|
127 | 140 | .init_early = omap3430_init_early, |
---|
128 | 141 | .init_machine = omap_generic_init, |
---|
129 | 142 | .init_late = omap3_init_late, |
---|
130 | | - .init_time = omap_init_time, |
---|
| 143 | + .init_time = omap_init_time_of, |
---|
131 | 144 | .dt_compat = omap3_boards_compat, |
---|
132 | 145 | .restart = omap3xxx_restart, |
---|
133 | 146 | MACHINE_END |
---|
.. | .. |
---|
144 | 157 | .init_early = omap3630_init_early, |
---|
145 | 158 | .init_machine = omap_generic_init, |
---|
146 | 159 | .init_late = omap3_init_late, |
---|
147 | | - .init_time = omap_init_time, |
---|
| 160 | + .init_time = omap_init_time_of, |
---|
148 | 161 | .dt_compat = omap36xx_boards_compat, |
---|
149 | 162 | .restart = omap3xxx_restart, |
---|
150 | 163 | MACHINE_END |
---|
.. | .. |
---|
161 | 174 | .init_early = omap3430_init_early, |
---|
162 | 175 | .init_machine = omap_generic_init, |
---|
163 | 176 | .init_late = omap3_init_late, |
---|
164 | | - .init_time = omap3_secure_sync32k_timer_init, |
---|
| 177 | + .init_time = omap_init_time_of, |
---|
165 | 178 | .dt_compat = omap3_gp_boards_compat, |
---|
166 | 179 | .restart = omap3xxx_restart, |
---|
167 | 180 | MACHINE_END |
---|
.. | .. |
---|
177 | 190 | .init_early = am35xx_init_early, |
---|
178 | 191 | .init_machine = omap_generic_init, |
---|
179 | 192 | .init_late = omap3_init_late, |
---|
180 | | - .init_time = omap3_gptimer_timer_init, |
---|
| 193 | + .init_time = omap_init_time_of, |
---|
181 | 194 | .dt_compat = am3517_boards_compat, |
---|
182 | 195 | .restart = omap3xxx_restart, |
---|
183 | 196 | MACHINE_END |
---|
.. | .. |
---|
196 | 209 | .init_early = ti814x_init_early, |
---|
197 | 210 | .init_machine = omap_generic_init, |
---|
198 | 211 | .init_late = ti81xx_init_late, |
---|
199 | | - .init_time = omap3_gptimer_timer_init, |
---|
| 212 | + .init_time = omap_init_time_of, |
---|
200 | 213 | .dt_compat = ti814x_boards_compat, |
---|
201 | 214 | .restart = ti81xx_restart, |
---|
202 | 215 | MACHINE_END |
---|
.. | .. |
---|
213 | 226 | .init_early = ti816x_init_early, |
---|
214 | 227 | .init_machine = omap_generic_init, |
---|
215 | 228 | .init_late = ti81xx_init_late, |
---|
216 | | - .init_time = omap3_gptimer_timer_init, |
---|
| 229 | + .init_time = omap_init_time_of, |
---|
217 | 230 | .dt_compat = ti816x_boards_compat, |
---|
218 | 231 | .restart = ti81xx_restart, |
---|
219 | 232 | MACHINE_END |
---|
.. | .. |
---|
231 | 244 | .init_early = am33xx_init_early, |
---|
232 | 245 | .init_machine = omap_generic_init, |
---|
233 | 246 | .init_late = am33xx_init_late, |
---|
234 | | - .init_time = omap3_gptimer_timer_init, |
---|
| 247 | + .init_time = omap_init_time_of, |
---|
235 | 248 | .dt_compat = am33xx_boards_compat, |
---|
236 | 249 | .restart = am33xx_restart, |
---|
237 | 250 | MACHINE_END |
---|
.. | .. |
---|
256 | 269 | .init_irq = omap_gic_of_init, |
---|
257 | 270 | .init_machine = omap_generic_init, |
---|
258 | 271 | .init_late = omap4430_init_late, |
---|
259 | | - .init_time = omap4_local_timer_init, |
---|
| 272 | + .init_time = omap_init_time_of, |
---|
260 | 273 | .dt_compat = omap4_boards_compat, |
---|
261 | 274 | .restart = omap44xx_restart, |
---|
262 | 275 | MACHINE_END |
---|
.. | .. |
---|
303 | 316 | .init_late = am43xx_init_late, |
---|
304 | 317 | .init_irq = omap_gic_of_init, |
---|
305 | 318 | .init_machine = omap_generic_init, |
---|
306 | | - .init_time = omap3_gptimer_timer_init, |
---|
| 319 | + .init_time = omap_init_time_of, |
---|
307 | 320 | .dt_compat = am43_boards_compat, |
---|
308 | 321 | .restart = omap44xx_restart, |
---|
309 | 322 | MACHINE_END |
---|