time.h 903 B

12345678910111213141516171819202122232425262728293031323334
  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. #define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
  14. #define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
  15. enum {
  16. T0_BOT,
  17. T0_TOP,
  18. T1_BOT,
  19. T1_TOP,
  20. NUM_TIMERS
  21. };
  22. #define IS_TIMER1(id) (id & 0x2)
  23. #define IS_TIMER0(id) (!IS_TIMER1(id))
  24. #define IS_TIMER_TOP(id) ((id & 0x1))
  25. #define IS_TIMER_BOT(id) (!IS_TIMER_TOP(id))
  26. #define ID_TO_TIMER(id) (IS_TIMER1(id) != 0)
  27. extern struct davinci_timer_instance davinci_timer_instance[];
  28. #endif /* __ARCH_ARM_MACH_DAVINCI_TIME_H */