mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
1802d0beec
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38 lines
802 B
C
38 lines
802 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
*
|
|
* Copyright (C) 2014 ARM Limited
|
|
*/
|
|
|
|
#include <linux/clocksource.h>
|
|
#include <linux/io.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/sched_clock.h>
|
|
|
|
#define SYS_24MHZ 0x05c
|
|
|
|
static void __iomem *versatile_sys_24mhz;
|
|
|
|
static u64 notrace versatile_sys_24mhz_read(void)
|
|
{
|
|
return readl(versatile_sys_24mhz);
|
|
}
|
|
|
|
static int __init versatile_sched_clock_init(struct device_node *node)
|
|
{
|
|
void __iomem *base = of_iomap(node, 0);
|
|
|
|
if (!base)
|
|
return -ENXIO;
|
|
|
|
versatile_sys_24mhz = base + SYS_24MHZ;
|
|
|
|
sched_clock_register(versatile_sys_24mhz_read, 32, 24000000);
|
|
|
|
return 0;
|
|
}
|
|
TIMER_OF_DECLARE(vexpress, "arm,vexpress-sysreg",
|
|
versatile_sched_clock_init);
|
|
TIMER_OF_DECLARE(versatile, "arm,versatile-sysreg",
|
|
versatile_sched_clock_init);
|