Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 1 | /* |
Stephen Warren | 8780f22 | 2015-02-16 12:16:14 -0700 | [diff] [blame] | 2 | * (C) Copyright 2012,2015 Stephen Warren |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 3 | * |
Stephen Warren | 29e494c | 2015-02-16 12:16:13 -0700 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0 |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _BCM2835_TIMER_H |
| 8 | #define _BCM2835_TIMER_H |
| 9 | |
Stephen Warren | 8780f22 | 2015-02-16 12:16:14 -0700 | [diff] [blame] | 10 | #ifdef CONFIG_BCM2836 |
| 11 | #define BCM2835_TIMER_PHYSADDR 0x3f003000 |
| 12 | #else |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 13 | #define BCM2835_TIMER_PHYSADDR 0x20003000 |
Stephen Warren | 8780f22 | 2015-02-16 12:16:14 -0700 | [diff] [blame] | 14 | #endif |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 15 | |
| 16 | struct bcm2835_timer_regs { |
| 17 | u32 cs; |
| 18 | u32 clo; |
| 19 | u32 chi; |
| 20 | u32 c0; |
| 21 | u32 c1; |
| 22 | u32 c2; |
| 23 | u32 c3; |
| 24 | }; |
| 25 | |
| 26 | #define BCM2835_TIMER_CS_M3 (1 << 3) |
| 27 | #define BCM2835_TIMER_CS_M2 (1 << 2) |
| 28 | #define BCM2835_TIMER_CS_M1 (1 << 1) |
| 29 | #define BCM2835_TIMER_CS_M0 (1 << 0) |
| 30 | |
Stephen Warren | 37c1efa | 2013-03-27 18:43:23 +0000 | [diff] [blame] | 31 | extern ulong get_timer_us(ulong base); |
| 32 | |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 33 | #endif |