1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) Marvell International Ltd. and its affiliates
4 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
6 * Copyright (C) 2015 Stefan Roese <sr@denx.de>
11 #include <asm/arch/soc.h>
13 #define TIMER_LOAD_VAL 0xffffffff
15 static int init_done __attribute__((section(".data"))) = 0;
18 * Timer initialization
22 /* Only init the timer once */
27 /* load value into timer */
28 writel(TIMER_LOAD_VAL, MVEBU_TIMER_BASE + 0x10);
29 writel(TIMER_LOAD_VAL, MVEBU_TIMER_BASE + 0x14);
31 #if defined(CONFIG_ARCH_MVEBU)
32 /* On Armada XP / 38x ..., the 25MHz clock source needs to be enabled */
33 setbits_le32(MVEBU_TIMER_BASE + 0x00, BIT(11));
35 /* enable timer in auto reload mode */
36 setbits_le32(MVEBU_TIMER_BASE + 0x00, 0x3);