2 * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
4 * SPDX-License-Identifier: GPL-2.0+
7 #include <asm/arcregs.h>
9 #define NH_MODE (1 << 1) /* Disable timer if CPU is halted */
13 write_aux_reg(ARC_AUX_TIMER0_CTRL, NH_MODE);
14 /* Set max value for counter/timer */
15 write_aux_reg(ARC_AUX_TIMER0_LIMIT, 0xffffffff);
16 /* Set initial count value and restart counter/timer */
17 write_aux_reg(ARC_AUX_TIMER0_CNT, 0);
21 unsigned long timer_read_counter(void)
23 return read_aux_reg(ARC_AUX_TIMER0_CNT);