Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 2 | /* |
Stephen Warren | 8780f22 | 2015-02-16 12:16:14 -0700 | [diff] [blame] | 3 | * (C) Copyright 2012,2015 Stephen Warren |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _BCM2835_TIMER_H |
| 7 | #define _BCM2835_TIMER_H |
| 8 | |
Stephen Warren | 9d5990b | 2016-03-16 21:40:56 -0600 | [diff] [blame] | 9 | #ifndef CONFIG_BCM2835 |
Stephen Warren | 8780f22 | 2015-02-16 12:16:14 -0700 | [diff] [blame] | 10 | #define BCM2835_TIMER_PHYSADDR 0x3f003000 |
| 11 | #else |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 12 | #define BCM2835_TIMER_PHYSADDR 0x20003000 |
Stephen Warren | 8780f22 | 2015-02-16 12:16:14 -0700 | [diff] [blame] | 13 | #endif |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 14 | |
Marek Vasut | 08c5b7e | 2015-05-04 22:54:35 +0200 | [diff] [blame] | 15 | #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 Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 23 | struct 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 Warren | 37c1efa | 2013-03-27 18:43:23 +0000 | [diff] [blame] | 33 | extern ulong get_timer_us(ulong base); |
| 34 | |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 35 | #endif |
Marek Vasut | 08c5b7e | 2015-05-04 22:54:35 +0200 | [diff] [blame] | 36 | |
| 37 | #endif |