blob: 210709d3b81dd286361c6fb7c8805d632deeeaa2 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenkc0218802003-03-27 12:09:35 +00002/*
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
wdenkc0218802003-03-27 12:09:35 +00005 */
6
Simon Glass049f8d62019-12-28 10:44:59 -07007#include <time.h>
Shinya Kuribayashic7e38e42008-06-05 22:28:59 +09008#include <asm/mipsregs.h>
wdenkc0218802003-03-27 12:09:35 +00009
Thomas Langera18a4772015-01-14 18:44:00 +000010unsigned long notrace timer_read_counter(void)
wdenkc0218802003-03-27 12:09:35 +000011{
Thomas Langera18a4772015-01-14 18:44:00 +000012 return read_c0_count();
wdenkc0218802003-03-27 12:09:35 +000013}
14
Stefan Roesea4142812020-05-14 11:59:05 +020015#if defined(CONFIG_SYS_MIPS_TIMER_FREQ)
Alex Nemirovsky47a19332019-12-23 20:53:56 +000016ulong notrace __weak get_tbclk(void)
wdenkc0218802003-03-27 12:09:35 +000017{
Thomas Langera18a4772015-01-14 18:44:00 +000018 return CONFIG_SYS_MIPS_TIMER_FREQ;
wdenkc0218802003-03-27 12:09:35 +000019}
Stefan Roesea4142812020-05-14 11:59:05 +020020#endif