David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/plat-versatile/sched-clock.c |
| 4 | * |
| 5 | * Copyright (C) 1999 - 2003 ARM Limited |
| 6 | * Copyright (C) 2000 Deep Blue Solutions Ltd |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 7 | */ |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/io.h> |
| 10 | #include <linux/sched_clock.h> |
| 11 | |
| 12 | #include <plat/sched_clock.h> |
| 13 | |
| 14 | static void __iomem *ctr; |
| 15 | |
| 16 | static u64 notrace versatile_read_sched_clock(void) |
| 17 | { |
| 18 | if (ctr) |
| 19 | return readl(ctr); |
| 20 | |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | void __init versatile_sched_clock_init(void __iomem *reg, unsigned long rate) |
| 25 | { |
| 26 | ctr = reg; |
| 27 | sched_clock_register(versatile_read_sched_clock, 32, rate); |
| 28 | } |