]>
git.ipfire.org Git - people/ms/u-boot.git/blob - arch/arm/mach-mvebu/timer.c
2 * Copyright (C) Marvell International Ltd. and its affiliates
3 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
5 * Copyright (C) 2015 Stefan Roese <sr@denx.de>
7 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/soc.h>
14 DECLARE_GLOBAL_DATA_PTR
;
16 #define TIMER_LOAD_VAL 0xffffffff
18 static int init_done
__attribute__((section(".data"))) = 0;
21 * Timer initialization
25 /* Only init the timer once */
30 /* load value into timer */
31 writel(TIMER_LOAD_VAL
, MVEBU_TIMER_BASE
+ 0x10);
32 writel(TIMER_LOAD_VAL
, MVEBU_TIMER_BASE
+ 0x14);
34 #if defined(CONFIG_ARCH_MVEBU)
35 /* On Armada XP / 38x ..., the 25MHz clock source needs to be enabled */
36 setbits_le32(MVEBU_TIMER_BASE
+ 0x00, BIT(11));
38 /* enable timer in auto reload mode */
39 setbits_le32(MVEBU_TIMER_BASE
+ 0x00, 0x3);