From 05a217212b41c6342fc1c6be0fe49ce28c9afe40 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 21 Apr 2015 20:38:21 +0900 Subject: ARM: socfpga: move SoC sources to mach-socfpga Our recent trend is to collect SoC files into arch/arm/mach-(SOC). Signed-off-by: Masahiro Yamada --- arch/arm/mach-socfpga/timer.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 arch/arm/mach-socfpga/timer.c (limited to 'arch/arm/mach-socfpga/timer.c') diff --git a/arch/arm/mach-socfpga/timer.c b/arch/arm/mach-socfpga/timer.c new file mode 100644 index 00000000000..253cde39d11 --- /dev/null +++ b/arch/arm/mach-socfpga/timer.c @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 Altera Corporation + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +#define TIMER_LOAD_VAL 0xFFFFFFFF + +static const struct socfpga_timer *timer_base = (void *)CONFIG_SYS_TIMERBASE; + +/* + * Timer initialization + */ +int timer_init(void) +{ + writel(TIMER_LOAD_VAL, &timer_base->load_val); + writel(TIMER_LOAD_VAL, &timer_base->curr_val); + writel(readl(&timer_base->ctrl) | 0x3, &timer_base->ctrl); + return 0; +} -- cgit v1.2.3