coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
timer.c File Reference
#include <device/mmio.h>
#include <delay.h>
#include <soc/clk.h>
#include <stdint.h>
#include <timer.h>
Include dependency graph for timer.c:

Go to the source code of this file.

Functions

static uint64_t mct_raw_value (void)
 
void init_timer (void)
 Init Global System Timers Unit (GTI). More...
 
void timer_monotonic_get (struct mono_time *mt)
 Get GTI counter value. More...
 

Variables

static const uint32_t clocks_per_usec = MCT_HZ/1000000
 

Function Documentation

◆ init_timer()

void init_timer ( void  )

Init Global System Timers Unit (GTI).

Configure timer to run at 1MHz tick-rate.

Init Global System Timers Unit (GTI).

Definition at line 19 of file timer.c.

References exynos_mct, exynos5_mct::g_tcon, read32(), and write32().

Here is the call graph for this function:

◆ mct_raw_value()

static uint64_t mct_raw_value ( void  )
static

Definition at line 11 of file timer.c.

References exynos_mct, exynos5_mct::g_cnt_l, exynos5_mct::g_cnt_u, and read32().

Referenced by timer_monotonic_get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timer_monotonic_get()

void timer_monotonic_get ( struct mono_time mt)

Get GTI counter value.

Parameters
mtStructure to fill

Definition at line 24 of file timer.c.

References clocks_per_usec, mct_raw_value(), and mono_time_set_usecs().

Here is the call graph for this function:

Variable Documentation

◆ clocks_per_usec

const uint32_t clocks_per_usec = MCT_HZ/1000000
static

Definition at line 9 of file timer.c.

Referenced by timer_monotonic_get().