![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <types.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) |
Definition at line 119 of file timer.c.
References tickrate.
Referenced by mainboard_init().
Disable the hardware watchdog.
index | Index 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().
int watchdog_is_running | ( | const size_t | index | ) |
Return true if the watchdog is configured and running.
index | Index of watchdog to configure. |
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().
Signal the watchdog that we are still running.
index | Index 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().
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.
index | Index of watchdog to configure |
timeout_ms | Timeout 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().