blob: 56b0c356bb47bd111227e2fbdc6df06768a5b839 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Stephen Warren45b8ae62012-08-05 16:07:21 +00002/*
Stephen Warren8780f222015-02-16 12:16:14 -07003 * (C) Copyright 2012,2015 Stephen Warren
Stephen Warren45b8ae62012-08-05 16:07:21 +00004 */
5
6#ifndef _BCM2835_TIMER_H
7#define _BCM2835_TIMER_H
8
Stephen Warren9d5990b2016-03-16 21:40:56 -06009#ifndef CONFIG_BCM2835
Stephen Warren8780f222015-02-16 12:16:14 -070010#define BCM2835_TIMER_PHYSADDR 0x3f003000
11#else
Stephen Warren45b8ae62012-08-05 16:07:21 +000012#define BCM2835_TIMER_PHYSADDR 0x20003000
Stephen Warren8780f222015-02-16 12:16:14 -070013#endif
Stephen Warren45b8ae62012-08-05 16:07:21 +000014
Marek Vasut08c5b7e2015-05-04 22:54:35 +020015#define BCM2835_TIMER_CS_M3 (1 << 3)
16#define BCM2835_TIMER_CS_M2 (1 << 2)
17#define BCM2835_TIMER_CS_M1 (1 << 1)
18#define BCM2835_TIMER_CS_M0 (1 << 0)
19
20#ifndef __ASSEMBLY__
21#include <linux/types.h>
22
Stephen Warren45b8ae62012-08-05 16:07:21 +000023struct bcm2835_timer_regs {
24 u32 cs;
25 u32 clo;
26 u32 chi;
27 u32 c0;
28 u32 c1;
29 u32 c2;
30 u32 c3;
31};
32
Stephen Warren37c1efa2013-03-27 18:43:23 +000033extern ulong get_timer_us(ulong base);
34
Stephen Warren45b8ae62012-08-05 16:07:21 +000035#endif
Marek Vasut08c5b7e2015-05-04 22:54:35 +020036
37#endif