11 #include <soc/clock.h>
12 #include <soc/timer.h>
15 #include <soc/addressmap.h>
54 #define GTI_CC_CNTCR_EN (1 << 0)
55 #define GTI_CC_CNTCR_HDBG (1 << 1)
56 #define GTI_CC_CNTCR_FCREQ (1 << 8)
58 #define GTI_CC_CNTSR_DBGH (1 << 1)
59 #define GTI_CC_CNTSR_FCACK (1 << 8)
61 #define GTI_CWD_WDOG_MODE_SHIFT 0
62 #define GTI_CWD_WDOG_MODE_MASK 0x3
63 #define GTI_CWD_WDOG_STATE_SHIFT 2
64 #define GTI_CWD_WDOG_STATE_MASK 0x3
65 #define GTI_CWD_WDOG_LEN_SHIFT 4
66 #define GTI_CWD_WDOG_LEN_MASK 0xffff
67 #define GTI_CWD_WDOG_CNT_SHIFT 20
68 #define GTI_CWD_WDOG_CNT_MASK 0xffffff
69 #define GTI_CWD_WDOC_DSTOP (1 << 44)
70 #define GTI_CWD_WDOC_GSTOP (1 << 45)
140 uint64_t timeout_sclk = sclk * timeout_ms / 1000;
153 uint64_t timeout_wdog = timeout_sclk >> 10;
155 timeout_wdog = (timeout_wdog + 0xff) >> 8;
157 if (timeout_wdog >= 0x10000)
158 timeout_wdog = 0xffff;
static void write32(void *addr, uint32_t val)
void write64(void *addr, uint64_t val)
uint64_t read64(const void *addr)
#define assert(statement)
#define printk(level,...)
#define setbits32(addr, set)
#define clrsetbits64(addr, clear, set)
static void mono_time_set_usecs(struct mono_time *mt, long us)
__weak void init_timer(void)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
void timer_monotonic_get(struct mono_time *mt)
u64 thunderx_get_io_clock(void)
Returns the I/O clock speed in Hz.
#define GTI_CWD_WDOG_LEN_MASK
void watchdog_disable(const size_t index)
Disable the hardware watchdog.
check_member(cn81xx_timer, cc_imp_ctl, 0x100)
#define GTI_CWD_WDOG_MODE_MASK
void watchdog_poke(const size_t index)
Signal the watchdog that we are still running.
void watchdog_set(const size_t index, unsigned int timeout_ms)
Setup the watchdog to expire in timeout_ms milliseconds.
static const size_t tickrate
static uint64_t timer_raw_value(void)
#define GTI_CWD_WDOG_MODE_SHIFT
#define GTI_CWD_WDOG_LEN_SHIFT
int watchdog_is_running(const size_t index)
Return true if the watchdog is configured and running.
void soc_timer_init(void)
unsigned long long uint64_t