diff options
author | Tom Rini <trini@konsulko.com> | 2017-03-24 08:19:30 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-03-24 08:19:30 -0400 |
commit | 5cf618ee60a752d058a767372ca1ecb8d9c09b16 (patch) | |
tree | 417a20db2bc9bb97bcc54b5d96dc7b1ccd192d6a /arch/arc/lib/timer.c | |
parent | c1daa4077365747d4f85ed8c93ba4d318d96a4af (diff) | |
parent | 3daa7c7b831ddeed0e490a899710a58691ee20c3 (diff) |
Merge git://git.denx.de/u-boot-arc
This replaces legacy arch/arc/lib/timer.c implementation and allows us
to describe ARC Timers in Device Tree. Among other things that way we
may properly inherit Timer's clock from CPU's clock s they really run
synchronously.
Diffstat (limited to 'arch/arc/lib/timer.c')
-rw-r--r-- | arch/arc/lib/timer.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/arch/arc/lib/timer.c b/arch/arc/lib/timer.c deleted file mode 100644 index a0acbbc01a4..00000000000 --- a/arch/arc/lib/timer.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include <asm/arcregs.h> - -#define NH_MODE (1 << 1) /* Disable timer if CPU is halted */ - -int timer_init(void) -{ - write_aux_reg(ARC_AUX_TIMER0_CTRL, NH_MODE); - /* Set max value for counter/timer */ - write_aux_reg(ARC_AUX_TIMER0_LIMIT, 0xffffffff); - /* Set initial count value and restart counter/timer */ - write_aux_reg(ARC_AUX_TIMER0_CNT, 0); - return 0; -} - -unsigned long timer_read_counter(void) -{ - return read_aux_reg(ARC_AUX_TIMER0_CNT); -} |