aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/psp_verstage/timer.c
blob: 04728baf0ce7f9da0adad6c7f10ae1d68b96adbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* SPDX-License-Identifier: GPL-2.0-only */

#include <bl_uapp/bl_syscall_public.h>
#include <stdint.h>
#include <timer.h>

void timer_monotonic_get(struct mono_time *mt)
{
	/* Chrono timer is based on a 25MHz clock */
	uint64_t clk;

	svc_read_timer_val(PSP_TIMER_TYPE_CHRONO, &clk);

	mt->microseconds = clk / 25;
}