coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
timer.h File Reference
#include <types.h>
Include dependency graph for timer.h:

Go to the source code of this file.

Functions

void watchdog_set (const size_t index, unsigned int timeout_ms)
 Setup the watchdog to expire in timeout_ms milliseconds. More...
 
void watchdog_poke (const size_t index)
 Signal the watchdog that we are still running. More...
 
void watchdog_disable (const size_t index)
 Disable the hardware watchdog. More...
 
int watchdog_is_running (const size_t index)
 Return true if the watchdog is configured and running. More...
 
void soc_timer_init (void)
 

Function Documentation

◆ soc_timer_init()

void soc_timer_init ( void  )

Definition at line 119 of file timer.c.

References tickrate.

Referenced by mainboard_init().

Here is the caller graph for this function:

◆ watchdog_disable()

void watchdog_disable ( const size_t  index)

Disable the hardware watchdog.

Parameters
indexIndex of watchdog to configure.

Definition at line 190 of file timer.c.

References ARRAY_SIZE, assert, BIOS_DEBUG, cn81xx_timer::cwd_wdog, GTI_PF_BAR0, printk, and write64().

Referenced by bdk_watchdog_disable(), and soc_final().

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

◆ watchdog_is_running()

int watchdog_is_running ( const size_t  index)

Return true if the watchdog is configured and running.

Parameters
indexIndex of watchdog to configure.
Returns
Non-zero if watchdog is running.

Definition at line 209 of file timer.c.

References ARRAY_SIZE, assert, cn81xx_timer::cwd_wdog, GTI_CWD_WDOG_MODE_MASK, GTI_CWD_WDOG_MODE_SHIFT, GTI_PF_BAR0, read64(), and val.

Referenced by bdk_watchdog_is_running().

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

◆ watchdog_poke()

void watchdog_poke ( const size_t  index)

Signal the watchdog that we are still running.

Parameters
indexIndex of watchdog to configure.

Definition at line 174 of file timer.c.

References ARRAY_SIZE, assert, cn81xx_timer::cwd_poke, GTI_PF_BAR0, and write64().

Referenced by bdk_watchdog_poke(), bootblock_soc_init(), and platform_romstage_main().

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

◆ watchdog_set()

void watchdog_set ( const size_t  index,
unsigned int  timeout_ms 
)

Setup the watchdog to expire in timeout_ms milliseconds.

When the watchdog expires, the chip three things happen: 1) Expire 1: interrupt that is ignored by the BDK 2) Expire 2: DEL3T interrupt, which is disabled and ignored 3) Expire 3: Soft reset of the chip

Since we want a soft reset, we actually program the watchdog to expire at the timeout / 3.

Parameters
indexIndex of watchdog to configure
timeout_msTimeout in milliseconds.

Definition at line 137 of file timer.c.

References ARRAY_SIZE, assert, BIOS_DEBUG, clrsetbits64, cn81xx_timer::cwd_wdog, GTI_CWD_WDOG_LEN_MASK, GTI_CWD_WDOG_LEN_SHIFT, GTI_CWD_WDOG_MODE_MASK, GTI_CWD_WDOG_MODE_SHIFT, GTI_PF_BAR0, printk, and thunderx_get_io_clock().

Referenced by bdk_watchdog_set(), and bootblock_soc_init().

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