| .. | .. |
|---|
| 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> |
|---|
| 18 | 16 | |
|---|
| 19 | 17 | #include <asm/setup.h> |
|---|
| 20 | 18 | #include <asm/mach/arch.h> |
|---|
| .. | .. |
|---|
| 34 | 32 | omap_soc_device_init(); |
|---|
| 35 | 33 | } |
|---|
| 36 | 34 | |
|---|
| 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 | + |
|---|
| 37 | 49 | #ifdef CONFIG_SOC_OMAP2420 |
|---|
| 38 | 50 | static const char *const omap242x_boards_compat[] __initconst = { |
|---|
| 39 | 51 | "ti,omap2420", |
|---|
| .. | .. |
|---|
| 45 | 57 | .map_io = omap242x_map_io, |
|---|
| 46 | 58 | .init_early = omap2420_init_early, |
|---|
| 47 | 59 | .init_machine = omap_generic_init, |
|---|
| 48 | | - .init_time = omap_init_time, |
|---|
| 60 | + .init_time = omap_init_time_of, |
|---|
| 49 | 61 | .dt_compat = omap242x_boards_compat, |
|---|
| 50 | 62 | .restart = omap2xxx_restart, |
|---|
| 51 | 63 | MACHINE_END |
|---|
| .. | .. |
|---|
| 62 | 74 | .map_io = omap243x_map_io, |
|---|
| 63 | 75 | .init_early = omap2430_init_early, |
|---|
| 64 | 76 | .init_machine = omap_generic_init, |
|---|
| 65 | | - .init_time = omap_init_time, |
|---|
| 77 | + .init_time = omap_init_time_of, |
|---|
| 66 | 78 | .dt_compat = omap243x_boards_compat, |
|---|
| 67 | 79 | .restart = omap2xxx_restart, |
|---|
| 68 | 80 | MACHINE_END |
|---|
| .. | .. |
|---|
| 109 | 121 | .init_early = omap3430_init_early, |
|---|
| 110 | 122 | .init_machine = omap_generic_init, |
|---|
| 111 | 123 | .init_late = omap3_init_late, |
|---|
| 112 | | - .init_time = omap_init_time, |
|---|
| 124 | + .init_time = omap_init_time_of, |
|---|
| 113 | 125 | .dt_compat = n900_boards_compat, |
|---|
| 114 | 126 | .restart = omap3xxx_restart, |
|---|
| 115 | 127 | MACHINE_END |
|---|
| .. | .. |
|---|
| 127 | 139 | .init_early = omap3430_init_early, |
|---|
| 128 | 140 | .init_machine = omap_generic_init, |
|---|
| 129 | 141 | .init_late = omap3_init_late, |
|---|
| 130 | | - .init_time = omap_init_time, |
|---|
| 142 | + .init_time = omap_init_time_of, |
|---|
| 131 | 143 | .dt_compat = omap3_boards_compat, |
|---|
| 132 | 144 | .restart = omap3xxx_restart, |
|---|
| 133 | 145 | MACHINE_END |
|---|
| .. | .. |
|---|
| 144 | 156 | .init_early = omap3630_init_early, |
|---|
| 145 | 157 | .init_machine = omap_generic_init, |
|---|
| 146 | 158 | .init_late = omap3_init_late, |
|---|
| 147 | | - .init_time = omap_init_time, |
|---|
| 159 | + .init_time = omap_init_time_of, |
|---|
| 148 | 160 | .dt_compat = omap36xx_boards_compat, |
|---|
| 149 | 161 | .restart = omap3xxx_restart, |
|---|
| 150 | 162 | MACHINE_END |
|---|
| .. | .. |
|---|
| 161 | 173 | .init_early = omap3430_init_early, |
|---|
| 162 | 174 | .init_machine = omap_generic_init, |
|---|
| 163 | 175 | .init_late = omap3_init_late, |
|---|
| 164 | | - .init_time = omap3_secure_sync32k_timer_init, |
|---|
| 176 | + .init_time = omap_init_time_of, |
|---|
| 165 | 177 | .dt_compat = omap3_gp_boards_compat, |
|---|
| 166 | 178 | .restart = omap3xxx_restart, |
|---|
| 167 | 179 | MACHINE_END |
|---|
| .. | .. |
|---|
| 177 | 189 | .init_early = am35xx_init_early, |
|---|
| 178 | 190 | .init_machine = omap_generic_init, |
|---|
| 179 | 191 | .init_late = omap3_init_late, |
|---|
| 180 | | - .init_time = omap3_gptimer_timer_init, |
|---|
| 192 | + .init_time = omap_init_time_of, |
|---|
| 181 | 193 | .dt_compat = am3517_boards_compat, |
|---|
| 182 | 194 | .restart = omap3xxx_restart, |
|---|
| 183 | 195 | MACHINE_END |
|---|
| .. | .. |
|---|
| 196 | 208 | .init_early = ti814x_init_early, |
|---|
| 197 | 209 | .init_machine = omap_generic_init, |
|---|
| 198 | 210 | .init_late = ti81xx_init_late, |
|---|
| 199 | | - .init_time = omap3_gptimer_timer_init, |
|---|
| 211 | + .init_time = omap_init_time_of, |
|---|
| 200 | 212 | .dt_compat = ti814x_boards_compat, |
|---|
| 201 | 213 | .restart = ti81xx_restart, |
|---|
| 202 | 214 | MACHINE_END |
|---|
| .. | .. |
|---|
| 213 | 225 | .init_early = ti816x_init_early, |
|---|
| 214 | 226 | .init_machine = omap_generic_init, |
|---|
| 215 | 227 | .init_late = ti81xx_init_late, |
|---|
| 216 | | - .init_time = omap3_gptimer_timer_init, |
|---|
| 228 | + .init_time = omap_init_time_of, |
|---|
| 217 | 229 | .dt_compat = ti816x_boards_compat, |
|---|
| 218 | 230 | .restart = ti81xx_restart, |
|---|
| 219 | 231 | MACHINE_END |
|---|
| .. | .. |
|---|
| 231 | 243 | .init_early = am33xx_init_early, |
|---|
| 232 | 244 | .init_machine = omap_generic_init, |
|---|
| 233 | 245 | .init_late = am33xx_init_late, |
|---|
| 234 | | - .init_time = omap3_gptimer_timer_init, |
|---|
| 246 | + .init_time = omap_init_time_of, |
|---|
| 235 | 247 | .dt_compat = am33xx_boards_compat, |
|---|
| 236 | 248 | .restart = am33xx_restart, |
|---|
| 237 | 249 | MACHINE_END |
|---|
| .. | .. |
|---|
| 256 | 268 | .init_irq = omap_gic_of_init, |
|---|
| 257 | 269 | .init_machine = omap_generic_init, |
|---|
| 258 | 270 | .init_late = omap4430_init_late, |
|---|
| 259 | | - .init_time = omap4_local_timer_init, |
|---|
| 271 | + .init_time = omap_init_time_of, |
|---|
| 260 | 272 | .dt_compat = omap4_boards_compat, |
|---|
| 261 | 273 | .restart = omap44xx_restart, |
|---|
| 262 | 274 | MACHINE_END |
|---|
| .. | .. |
|---|
| 303 | 315 | .init_late = am43xx_init_late, |
|---|
| 304 | 316 | .init_irq = omap_gic_of_init, |
|---|
| 305 | 317 | .init_machine = omap_generic_init, |
|---|
| 306 | | - .init_time = omap3_gptimer_timer_init, |
|---|
| 318 | + .init_time = omap_init_time_of, |
|---|
| 307 | 319 | .dt_compat = am43_boards_compat, |
|---|
| 308 | 320 | .restart = omap44xx_restart, |
|---|
| 309 | 321 | MACHINE_END |
|---|