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/timer.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 timer_raw_value (void)
 
void timer_monotonic_get (struct mono_time *mt)
 Get GTI counter value. More...
 
void init_timer (void)
 Init Global System Timers Unit (GTI). More...
 

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 25 of file timer.c.

References timer7_ptr, rk3288_timer::timer_ctrl_reg, rk3288_timer::timer_load_count0, rk3288_timer::timer_load_count1, TIMER_LOAD_VAL, and write32().

Here is the call 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 20 of file timer.c.

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

Here is the call graph for this function:

◆ timer_raw_value()

static uint64_t timer_raw_value ( void  )
static

Definition at line 9 of file timer.c.

References read32(), timer7_ptr, rk3288_timer::timer_curr_value0, and rk3288_timer::timer_curr_value1.

Referenced by timer_monotonic_get().

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