blob: 44810c863acfa28c663ffb0bd000bf87db00ed0a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Scott Branden5653a822014-08-11 13:58:22 -07002/*
3 * Copyright 2014 Broadcom Corporation.
Scott Branden5653a822014-08-11 13:58:22 -07004 */
5
6#ifndef __TIMER_H
7#define __TIMER_H
8
9#include <linux/types.h>
10
11void timer_systick_init(uint32_t tick_ms);
12void timer_global_init(void);
13
14/* ARM A9 Private Timer */
15#define TIMER_PVT_LOAD_OFFSET 0x00000000
16#define TIMER_PVT_COUNTER_OFFSET 0x00000004
17#define TIMER_PVT_CTRL_OFFSET 0x00000008
18#define TIMER_PVT_STATUS_OFFSET 0x0000000C
19#define TIMER_PVT_TIM_CTRL_TIM_EN 0x00000001
20#define TIMER_PVT_TIM_CTRL_AUTO_RELD 0x00000002
21#define TIMER_PVT_TIM_CTRL_INT_EN 0x00000004
22#define TIMER_PVT_TIM_CTRL_PRESC_MASK 0x0000FF00
23#define TIMER_PVT_TIM_INT_STATUS_SET 0x00000001
24
25/* Global timer */
26#define TIMER_GLB_LOW_OFFSET 0x00000000
27#define TIMER_GLB_HI_OFFSET 0x00000004
28#define TIMER_GLB_CTRL_OFFSET 0x00000008
29#define TIMER_GLB_TIM_CTRL_TIM_EN 0x00000001
30#define TIMER_GLB_TIM_CTRL_COMP_EN 0x00000002
31#define TIMER_GLB_TIM_CTRL_INT_EN 0x00000004
32#define TIMER_GLB_TIM_CTRL_AUTO_INC 0x00000008
33#define TIMER_GLB_TIM_CTRL_PRESC_MASK 0x0000FF00
34#define TIMER_GLB_TIM_INT_STATUS_SET 0x00000001
35
36#endif /*__TIMER_H */