1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the GNU General Public License version 2. Note that NO WARRANTY is provided. 8 * See "LICENSE_GPLv2.txt" for details. 9 * 10 * @TAG(DATA61_GPL) 11 */ 12 13#ifndef __ARCH_MACHINE_PRIV_TIMER_H_ 14#define __ARCH_MACHINE_PRIV_TIMER_H_ 15 16#define TIMER_CLOCK_HZ 400000000ULL 17#define TMR_INTS_EVENT BIT(0) 18 19/* 32 bit down counter */ 20struct timer { 21 uint32_t load; 22 uint32_t count; 23 uint32_t ctrl; 24 uint32_t ints; 25}; 26typedef volatile struct timer timer_t; 27extern timer_t * const priv_timer; 28 29static inline void resetTimer(void) 30{ 31 priv_timer->ints = TMR_INTS_EVENT; 32} 33 34#endif /* __ARCH_MACHINE_PRIV_TIMER_H_ */ 35