mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 05:50:17 +00:00 
			
		
		
		
	As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			526 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			526 B
		
	
	
	
		
			C
		
	
	
	
	
	
// SPDX-License-Identifier: GPL-2.0+
 | 
						|
/*
 | 
						|
 *  Copyright (C) 2012 Altera Corporation <www.altera.com>
 | 
						|
 */
 | 
						|
 | 
						|
#include <config.h>
 | 
						|
#include <init.h>
 | 
						|
#include <asm/io.h>
 | 
						|
#include <asm/arch/timer.h>
 | 
						|
 | 
						|
#define TIMER_LOAD_VAL		0xFFFFFFFF
 | 
						|
 | 
						|
static const struct socfpga_timer *timer_base = (void *)CFG_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;
 | 
						|
}
 |