mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-20 02:03:28 +08:00
05a217212b
Our recent trend is to collect SoC files into arch/arm/mach-(SOC). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
25 lines
514 B
C
25 lines
514 B
C
/*
|
|
* Copyright (C) 2012 Altera Corporation <www.altera.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/timer.h>
|
|
|
|
#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;
|
|
}
|