@@ -51,6 +51,8 @@
#define OMAP5_MON_AMBA_IF_INDEX 0x108
+#define OMAP5_DRA7_MON_SET_CNTFRQ_INDEX 0x109
+
/* Secure PPA(Primary Protected Application) APIs */
#define OMAP4_PPA_L2_POR_INDEX 0x23
#define OMAP4_PPA_CPU_ACTRL_SMP_INDEX 0x25
@@ -41,6 +41,8 @@
u16 pm44xx_errata;
+extern unsigned long arch_timer_freq;
+
/* SCU base address */
static void __iomem *scu_base;
@@ -66,6 +68,13 @@ static void __cpuinit omap4_secondary_init(unsigned int cpu)
4, 0, 0, 0, 0, 0);
/*
+ * Configure the CNTFRQ register for the secondary cpu's which
+ * indicates the frequency of the cpu local timers.
+ */
+ if (soc_is_omap54xx() || soc_is_dra7xx())
+ omap_smc1(OMAP5_DRA7_MON_SET_CNTFRQ_INDEX, arch_timer_freq);
+
+ /*
* Synchronise with the boot thread.
*/
spin_lock(&boot_lock);
@@ -55,6 +55,7 @@
#include "soc.h"
#include "common.h"
#include "powerdomain.h"
+#include "omap-secure.h"
#define REALTIME_COUNTER_BASE 0x48243200
#define INCREMENTER_NUMERATOR_OFFSET 0x10
@@ -65,6 +66,7 @@
static struct omap_dm_timer clkev;
static struct clock_event_device clockevent_gpt;
+unsigned long arch_timer_freq;
static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
{
@@ -546,7 +548,11 @@ static void __init realtime_counter_init(void)
reg |= den;
__raw_writel(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
+ arch_timer_freq = (rate / den) * num;
+
iounmap(base);
+
+ omap_smc1(OMAP5_DRA7_MON_SET_CNTFRQ_INDEX, arch_timer_freq);
}
#else
static inline void __init realtime_counter_init(void)