Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2003 | ||||
4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | ||||
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 5 | */ |
6 | |||||
7 | #include <common.h> | ||||
Simon Glass | a9dc068 | 2019-12-28 10:44:59 -0700 | [diff] [blame] | 8 | #include <time.h> |
Shinya Kuribayashi | 5fcf6d3 | 2008-06-05 22:28:59 +0900 | [diff] [blame] | 9 | #include <asm/mipsregs.h> |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 10 | |
Thomas Langer | c37c980 | 2015-01-14 18:44:00 +0000 | [diff] [blame] | 11 | unsigned long notrace timer_read_counter(void) |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 12 | { |
Thomas Langer | c37c980 | 2015-01-14 18:44:00 +0000 | [diff] [blame] | 13 | return read_c0_count(); |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 14 | } |
15 | |||||
Stefan Roese | 56a4381 | 2020-05-14 11:59:05 +0200 | [diff] [blame] | 16 | #if defined(CONFIG_SYS_MIPS_TIMER_FREQ) |
Alex Nemirovsky | f536438 | 2019-12-23 20:53:56 +0000 | [diff] [blame] | 17 | ulong notrace __weak get_tbclk(void) |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 18 | { |
Thomas Langer | c37c980 | 2015-01-14 18:44:00 +0000 | [diff] [blame] | 19 | return CONFIG_SYS_MIPS_TIMER_FREQ; |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 20 | } |
Stefan Roese | 56a4381 | 2020-05-14 11:59:05 +0200 | [diff] [blame] | 21 | #endif |