blob: 5e7a7144d02766f80b92870ebef5c3c32bca11be [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenkbb1b8262003-03-27 12:09:35 +00002/*
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
wdenkbb1b8262003-03-27 12:09:35 +00005 */
6
7#include <common.h>
Simon Glassa9dc0682019-12-28 10:44:59 -07008#include <time.h>
Shinya Kuribayashi5fcf6d32008-06-05 22:28:59 +09009#include <asm/mipsregs.h>
wdenkbb1b8262003-03-27 12:09:35 +000010
Thomas Langerc37c9802015-01-14 18:44:00 +000011unsigned long notrace timer_read_counter(void)
wdenkbb1b8262003-03-27 12:09:35 +000012{
Thomas Langerc37c9802015-01-14 18:44:00 +000013 return read_c0_count();
wdenkbb1b8262003-03-27 12:09:35 +000014}
15
Stefan Roese56a43812020-05-14 11:59:05 +020016#if defined(CONFIG_SYS_MIPS_TIMER_FREQ)
Alex Nemirovskyf5364382019-12-23 20:53:56 +000017ulong notrace __weak get_tbclk(void)
wdenkbb1b8262003-03-27 12:09:35 +000018{
Thomas Langerc37c9802015-01-14 18:44:00 +000019 return CONFIG_SYS_MIPS_TIMER_FREQ;
wdenkbb1b8262003-03-27 12:09:35 +000020}
Stefan Roese56a43812020-05-14 11:59:05 +020021#endif