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 | |
Matthias Brugger | 2c68dee | 2019-11-19 16:01:03 +0100 | [diff] [blame] | 9 | #ifndef __ASSEMBLY__ |
| 10 | #include <asm/arch/base.h> |
Simon Glass | c06c1be | 2020-05-10 11:40:08 -0600 | [diff] [blame] | 11 | #include <linux/bug.h> |
Matthias Brugger | 2c68dee | 2019-11-19 16:01:03 +0100 | [diff] [blame] | 12 | #endif |
| 13 | |
| 14 | #define BCM2835_TIMER_PHYSADDR ({ BUG_ON(!rpi_bcm283x_base); \ |
| 15 | rpi_bcm283x_base + 0x00003000; }) |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 16 | |
Marek Vasut | 08c5b7e | 2015-05-04 22:54:35 +0200 | [diff] [blame] | 17 | #define BCM2835_TIMER_CS_M3 (1 << 3) |
| 18 | #define BCM2835_TIMER_CS_M2 (1 << 2) |
| 19 | #define BCM2835_TIMER_CS_M1 (1 << 1) |
| 20 | #define BCM2835_TIMER_CS_M0 (1 << 0) |
| 21 | |
| 22 | #ifndef __ASSEMBLY__ |
| 23 | #include <linux/types.h> |
| 24 | |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 25 | struct bcm2835_timer_regs { |
| 26 | u32 cs; |
| 27 | u32 clo; |
| 28 | u32 chi; |
| 29 | u32 c0; |
| 30 | u32 c1; |
| 31 | u32 c2; |
| 32 | u32 c3; |
| 33 | }; |
Stephen Warren | 45b8ae6 | 2012-08-05 16:07:21 +0000 | [diff] [blame] | 34 | #endif |
Marek Vasut | 08c5b7e | 2015-05-04 22:54:35 +0200 | [diff] [blame] | 35 | |
| 36 | #endif |