mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-19 03:08:31 +00:00
23ab7ee0ff
Convert socfpga to use the commmon timer code. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
22 lines
478 B
C
22 lines
478 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>
|
|
|
|
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;
|
|
}
|