blob: 004c24be365a4721c8952e0cf542c013191b6bbf [file] [log] [blame]
Stephen Warren45b8ae62012-08-05 16:07:21 +00001/*
Stephen Warren8780f222015-02-16 12:16:14 -07002 * (C) Copyright 2012,2015 Stephen Warren
Stephen Warren45b8ae62012-08-05 16:07:21 +00003 *
Stephen Warren29e494c2015-02-16 12:16:13 -07004 * SPDX-License-Identifier: GPL-2.0
Stephen Warren45b8ae62012-08-05 16:07:21 +00005 */
6
7#ifndef _BCM2835_TIMER_H
8#define _BCM2835_TIMER_H
9
Stephen Warren8780f222015-02-16 12:16:14 -070010#ifdef CONFIG_BCM2836
11#define BCM2835_TIMER_PHYSADDR 0x3f003000
12#else
Stephen Warren45b8ae62012-08-05 16:07:21 +000013#define BCM2835_TIMER_PHYSADDR 0x20003000
Stephen Warren8780f222015-02-16 12:16:14 -070014#endif
Stephen Warren45b8ae62012-08-05 16:07:21 +000015
Marek Vasut08c5b7e2015-05-04 22:54:35 +020016#define BCM2835_TIMER_CS_M3 (1 << 3)
17#define BCM2835_TIMER_CS_M2 (1 << 2)
18#define BCM2835_TIMER_CS_M1 (1 << 1)
19#define BCM2835_TIMER_CS_M0 (1 << 0)
20
21#ifndef __ASSEMBLY__
22#include <linux/types.h>
23
Stephen Warren45b8ae62012-08-05 16:07:21 +000024struct bcm2835_timer_regs {
25 u32 cs;
26 u32 clo;
27 u32 chi;
28 u32 c0;
29 u32 c1;
30 u32 c2;
31 u32 c3;
32};
33
Stephen Warren37c1efa2013-03-27 18:43:23 +000034extern ulong get_timer_us(ulong base);
35
Stephen Warren45b8ae62012-08-05 16:07:21 +000036#endif
Marek Vasut08c5b7e2015-05-04 22:54:35 +020037
38#endif