aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/timer.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-11 02:49:45 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-11 02:49:45 -0500
commitaac59e3efce3dca787b11e34726001603ce3d161 (patch)
tree855d3f967b102877a179e23382be3c2c7fc8d66c /arch/arm/mach-omap2/timer.c
parent21604cdcdcf9ea8c16b1656f78e2eff097244d66 (diff)
parent005ff5fb077ebf93882bd643932f932a9b402529 (diff)
Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform changes from Olof Johansson: "New and updated SoC support. Among the things new for this release are: - More support for the AM33xx platforms from TI - Tegra 124 support, and some updates to older tegra families as well - imx cleanups and updates across the board - A rename of Broadcom's Mobile platforms which were introduced as ARCH_BCM, and turned out to be too broad a name. New name is ARCH_BCM_MOBILE. - A whole bunch of updates and fixes for integrator, making the platform code more modern and switches over to DT-only booting. - Support for two new Renesas shmobile chipsets. Next up for them is more work on consolidation instead of introduction of new non-multiplatform SoCs, we're all looking forward to that! - Misc cleanups for older Samsung platforms, some Allwinner updates, etc" * tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (159 commits) ARM: bcm281xx: Add ARCH_BCM_MOBILE to bcm config ARM: bcm_defconfig: Run "make savedefconfig" ARM: bcm281xx: Add ARCH Timers to config rename ARCH_BCM to ARCH_BCM_MOBILE (mach-bcm) ARM: vexpress: Enable platform-specific options in defconfig ARM: vexpress: Make defconfig work again ARM: sunxi: remove .init_time hooks ARM: imx: enable suspend for imx6sl ARM: imx: ensure dsm_request signal is not asserted when setting LPM ARM: imx6q: call WB and RBC configuration from imx6q_pm_enter() ARM: imx6q: move low-power code out of clock driver ARM: imx: drop extern with function prototypes in common.h ARM: imx: reset core along with enable/disable operation ARM: imx: do not return from imx_cpu_die() call ARM: imx_v6_v7_defconfig: Select CONFIG_PROVE_LOCKING ARM: imx_v6_v7_defconfig: Enable LEDS_GPIO related options ARM: mxs_defconfig: Turn off CONFIG_DEBUG_GPIO ARM: imx: replace imx6q_restart() with mxc_restart() ARM: mach-imx: mm-imx5: Retrieve iomuxc base address from dt ARM: mach-imx: mm-imx5: Retrieve tzic base address from dt ...
Diffstat (limited to 'arch/arm/mach-omap2/timer.c')
-rw-r--r--arch/arm/mach-omap2/timer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 538e7cda5eea..3ca81e0ada5e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -55,6 +55,7 @@
55#include "soc.h" 55#include "soc.h"
56#include "common.h" 56#include "common.h"
57#include "powerdomain.h" 57#include "powerdomain.h"
58#include "omap-secure.h"
58 59
59#define REALTIME_COUNTER_BASE 0x48243200 60#define REALTIME_COUNTER_BASE 0x48243200
60#define INCREMENTER_NUMERATOR_OFFSET 0x10 61#define INCREMENTER_NUMERATOR_OFFSET 0x10
@@ -66,6 +67,15 @@
66static struct omap_dm_timer clkev; 67static struct omap_dm_timer clkev;
67static struct clock_event_device clockevent_gpt; 68static struct clock_event_device clockevent_gpt;
68 69
70#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
71static unsigned long arch_timer_freq;
72
73void set_cntfreq(void)
74{
75 omap_smc1(OMAP5_DRA7_MON_SET_CNTFRQ_INDEX, arch_timer_freq);
76}
77#endif
78
69static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) 79static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
70{ 80{
71 struct clock_event_device *evt = &clockevent_gpt; 81 struct clock_event_device *evt = &clockevent_gpt;
@@ -515,6 +525,10 @@ static void __init realtime_counter_init(void)
515 num = 8; 525 num = 8;
516 den = 25; 526 den = 25;
517 break; 527 break;
528 case 20000000:
529 num = 192;
530 den = 625;
531 break;
518 case 2600000: 532 case 2600000:
519 num = 384; 533 num = 384;
520 den = 1625; 534 den = 1625;
@@ -542,6 +556,9 @@ static void __init realtime_counter_init(void)
542 reg |= den; 556 reg |= den;
543 __raw_writel(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET); 557 __raw_writel(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
544 558
559 arch_timer_freq = (rate / den) * num;
560 set_cntfreq();
561
545 iounmap(base); 562 iounmap(base);
546} 563}
547#else 564#else