gp_timers.h 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * arch/arm/mach-l7200/include/mach/gp_timers.h
  3. *
  4. * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
  5. *
  6. * Changelog:
  7. * 07-28-2000 SJH Created file
  8. * 08-02-2000 SJH Used structure for registers
  9. */
  10. #ifndef _ASM_ARCH_GPTIMERS_H
  11. #define _ASM_ARCH_GPTIMERS_H
  12. #include <mach/hardware.h>
  13. /*
  14. * Layout of L7200 general purpose timer registers
  15. */
  16. struct GPT_Regs {
  17. unsigned int TIMERLOAD;
  18. unsigned int TIMERVALUE;
  19. unsigned int TIMERCONTROL;
  20. unsigned int TIMERCLEAR;
  21. };
  22. #define GPT_BASE (IO_BASE_2 + 0x3000)
  23. #define l7200_timer1_regs ((volatile struct GPT_Regs *) (GPT_BASE))
  24. #define l7200_timer2_regs ((volatile struct GPT_Regs *) (GPT_BASE + 0x20))
  25. /*
  26. * General register values
  27. */
  28. #define GPT_PRESCALE_1 0x00000000
  29. #define GPT_PRESCALE_16 0x00000004
  30. #define GPT_PRESCALE_256 0x00000008
  31. #define GPT_MODE_FREERUN 0x00000000
  32. #define GPT_MODE_PERIODIC 0x00000040
  33. #define GPT_ENABLE 0x00000080
  34. #define GPT_BZTOG 0x00000100
  35. #define GPT_BZMOD 0x00000200
  36. #define GPT_LOAD_MASK 0x0000ffff
  37. #endif