diff options
| author | Olof Johansson <olof@lixom.net> | 2013-04-17 13:10:01 -0400 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2013-04-17 13:10:01 -0400 |
| commit | c3e0c873d0653e6e7628b5a8a9fcb3745444ca9e (patch) | |
| tree | dd7448d5515c56604cd8e57f3d6399f5640d57a3 /drivers/clocksource | |
| parent | 228e3023eb0430b4b9ed0736f8f87c96a6cd9c7a (diff) | |
| parent | 69a517b2471bcd1c5a175aad82647c1e2c24f08b (diff) | |
Merge tag 'clksrc-cleanup-for-3.10-part2' of git://sources.calxeda.com/kernel/linux into late/clksrc
This is the 2nd part of ARM timer clean-ups for 3.10. This series has
the following changes:
- Add sched_clock selection logic to select the highest frequency clock
- Use full 64-bit arch timer counter for sched_clock
- Convert arch timer, sp804 and integrator-cp timers to CLKSRC_OF and
adapt all users to use clocksource_of_init
* tag 'clksrc-cleanup-for-3.10-part2' of git://sources.calxeda.com/kernel/linux:
devtree: add binding documentation for sp804
ARM: integrator-cp: convert use CLKSRC_OF for timer init
ARM: versatile: use OF init for sp804 timer
ARM: versatile: add versatile dtbs to dtbs target
ARM: vexpress: remove extra timer-sp control register clearing
ARM: dts: vexpress: disable CA9 core tile sp804 timer
ARM: vexpress: remove sp804 OF init
ARM: highbank: use OF init for sp804 timer
ARM: timer-sp: convert to use CLKSRC_OF init
OF: add empty of_device_is_available for !OF
ARM: convert arm/arm64 arch timer to use CLKSRC_OF init
ARM: make machine_desc->init_time default to clocksource_of_init
ARM: arch_timer: use full 64-bit counter for sched_clock
ARM: make sched_clock just call a function pointer
ARM: sched_clock: allow changing to higher frequency counter
Signed-off-by: Olof Johansson <olof@lixom.net>
This has a nasty set of conflicts with the exynos MCT code, which was
moved in a separate branch, and then fixed up when merged in, but still
conflicts a bit here. It should have been sorted out by this merge though.
Diffstat (limited to 'drivers/clocksource')
| -rw-r--r-- | drivers/clocksource/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/clocksource/arm_arch_timer.c | 23 | ||||
| -rw-r--r-- | drivers/clocksource/exynos_mct.c | 1 |
3 files changed, 10 insertions, 15 deletions
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 73fcddb8314d..29ba35e6a143 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
| @@ -65,6 +65,7 @@ config CLKSRC_DBX500_PRCMU_SCHED_CLOCK | |||
| 65 | 65 | ||
| 66 | config ARM_ARCH_TIMER | 66 | config ARM_ARCH_TIMER |
| 67 | bool | 67 | bool |
| 68 | select CLKSRC_OF if OF | ||
| 68 | 69 | ||
| 69 | config CLKSRC_METAG_GENERIC | 70 | config CLKSRC_METAG_GENERIC |
| 70 | def_bool y if METAG | 71 | def_bool y if METAG |
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index d7ad425ab9b3..122ff05628b5 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c | |||
| @@ -337,22 +337,14 @@ out: | |||
| 337 | return err; | 337 | return err; |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | static const struct of_device_id arch_timer_of_match[] __initconst = { | 340 | static void __init arch_timer_init(struct device_node *np) |
| 341 | { .compatible = "arm,armv7-timer", }, | ||
| 342 | { .compatible = "arm,armv8-timer", }, | ||
| 343 | {}, | ||
| 344 | }; | ||
| 345 | |||
| 346 | int __init arch_timer_init(void) | ||
| 347 | { | 341 | { |
| 348 | struct device_node *np; | ||
| 349 | u32 freq; | 342 | u32 freq; |
| 350 | int i; | 343 | int i; |
| 351 | 344 | ||
| 352 | np = of_find_matching_node(NULL, arch_timer_of_match); | 345 | if (arch_timer_get_rate()) { |
| 353 | if (!np) { | 346 | pr_warn("arch_timer: multiple nodes in dt, skipping\n"); |
| 354 | pr_err("arch_timer: can't find DT node\n"); | 347 | return; |
| 355 | return -ENODEV; | ||
| 356 | } | 348 | } |
| 357 | 349 | ||
| 358 | /* Try to determine the frequency from the device tree or CNTFRQ */ | 350 | /* Try to determine the frequency from the device tree or CNTFRQ */ |
| @@ -378,7 +370,7 @@ int __init arch_timer_init(void) | |||
| 378 | if (!arch_timer_ppi[PHYS_SECURE_PPI] || | 370 | if (!arch_timer_ppi[PHYS_SECURE_PPI] || |
| 379 | !arch_timer_ppi[PHYS_NONSECURE_PPI]) { | 371 | !arch_timer_ppi[PHYS_NONSECURE_PPI]) { |
| 380 | pr_warn("arch_timer: No interrupt available, giving up\n"); | 372 | pr_warn("arch_timer: No interrupt available, giving up\n"); |
| 381 | return -EINVAL; | 373 | return; |
| 382 | } | 374 | } |
| 383 | } | 375 | } |
| 384 | 376 | ||
| @@ -387,5 +379,8 @@ int __init arch_timer_init(void) | |||
| 387 | else | 379 | else |
| 388 | arch_timer_read_counter = arch_counter_get_cntpct; | 380 | arch_timer_read_counter = arch_counter_get_cntpct; |
| 389 | 381 | ||
| 390 | return arch_timer_register(); | 382 | arch_timer_register(); |
| 383 | arch_timer_arch_init(); | ||
| 391 | } | 384 | } |
| 385 | CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_init); | ||
| 386 | CLOCKSOURCE_OF_DECLARE(armv8_arch_timer, "arm,armv8-timer", arch_timer_init); | ||
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 957af8636c9d..b078d7cbc930 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <linux/of_address.h> | 24 | #include <linux/of_address.h> |
| 25 | #include <linux/clocksource.h> | 25 | #include <linux/clocksource.h> |
| 26 | 26 | ||
| 27 | #include <asm/arch_timer.h> | ||
| 28 | #include <asm/localtimer.h> | 27 | #include <asm/localtimer.h> |
| 29 | 28 | ||
| 30 | #include <plat/cpu.h> | 29 | #include <plat/cpu.h> |
