mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
parisc: Detect 64-bit free running platform counter
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
@@ -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);
|
||||
@@ -213,6 +230,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user