Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Local header file for DaVinci time code. |
| 3 | * |
| 4 | * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> |
| 5 | * |
| 6 | * 2007 (c) MontaVista Software, Inc. This file is licensed under |
| 7 | * the terms of the GNU General Public License version 2. This program |
| 8 | * is licensed "as is" without any warranty of any kind, whether express |
| 9 | * or implied. |
| 10 | */ |
| 11 | #ifndef __ARCH_ARM_MACH_DAVINCI_TIME_H |
| 12 | #define __ARCH_ARM_MACH_DAVINCI_TIME_H |
| 13 | |
| 14 | #define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400) |
| 15 | #define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800) |
Mark A. Greer | 951d6f6 | 2009-04-15 12:40:21 -0700 | [diff] [blame] | 16 | #define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00) |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 17 | |
| 18 | enum { |
| 19 | T0_BOT, |
| 20 | T0_TOP, |
| 21 | T1_BOT, |
| 22 | T1_TOP, |
| 23 | NUM_TIMERS |
| 24 | }; |
| 25 | |
| 26 | #define IS_TIMER1(id) (id & 0x2) |
| 27 | #define IS_TIMER0(id) (!IS_TIMER1(id)) |
| 28 | #define IS_TIMER_TOP(id) ((id & 0x1)) |
| 29 | #define IS_TIMER_BOT(id) (!IS_TIMER_TOP(id)) |
| 30 | |
| 31 | #define ID_TO_TIMER(id) (IS_TIMER1(id) != 0) |
| 32 | |
| 33 | extern struct davinci_timer_instance davinci_timer_instance[]; |
| 34 | |
| 35 | #endif /* __ARCH_ARM_MACH_DAVINCI_TIME_H */ |