summaryrefslogtreecommitdiff
path: root/arch/parisc/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/time.c')
-rw-r--r--arch/parisc/kernel/time.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index c17e2249115f..71c9d5426995 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -16,6 +16,7 @@
#include <linux/rtc.h>
#include <linux/platform_device.h>
#include <asm/processor.h>
+#include <asm/pdcpat.h>
static u64 cr16_clock_freq;
static unsigned long clocktick;
@@ -99,6 +100,22 @@ void parisc_clockevent_init(void)
clockevents_config_and_register(cd, cr16_clock_freq, min_delta, max_delta);
}
+static void parisc_find_64bit_counter(void)
+{
+#ifdef CONFIG_64BIT
+ uint64_t *pclock;
+ unsigned long freq, unique;
+ int ret;
+
+ ret = pdc_pat_pd_get_platform_counter(&pclock, &freq, &unique);
+ if (ret == PDC_OK)
+ pr_info("64-bit counter found at %px, freq: %lu, unique: %lu\n",
+ pclock, freq, unique);
+ else
+ pr_info("64-bit counter not found.\n");
+#endif
+}
+
unsigned long notrace profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);
@@ -193,12 +210,9 @@ static struct clocksource clocksource_cr16 = {
.read = read_cr16,
.mask = CLOCKSOURCE_MASK(BITS_PER_LONG),
.flags = CLOCK_SOURCE_IS_CONTINUOUS |
- CLOCK_SOURCE_VALID_FOR_HRES |
- CLOCK_SOURCE_MUST_VERIFY |
- CLOCK_SOURCE_VERIFY_PERCPU,
+ CLOCK_SOURCE_VALID_FOR_HRES,
};
-
/*
* timer interrupt and sched_clock() initialization
*/
@@ -213,6 +227,9 @@ void __init time_init(void)
parisc_clockevent_init();
+ /* check for free-running 64-bit platform counter */
+ parisc_find_64bit_counter();
+
/* register at clocksource framework */
clocksource_register_hz(&clocksource_cr16, cr16_clock_freq);
}