mtu.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __ASM_ARCH_MTU_H
  2. #define __ASM_ARCH_MTU_H
  3. /*
  4. * The MTU device hosts four different counters, with 4 set of
  5. * registers. These are register names.
  6. */
  7. #define MTU_IMSC 0x00 /* Interrupt mask set/clear */
  8. #define MTU_RIS 0x04 /* Raw interrupt status */
  9. #define MTU_MIS 0x08 /* Masked interrupt status */
  10. #define MTU_ICR 0x0C /* Interrupt clear register */
  11. /* per-timer registers take 0..3 as argument */
  12. #define MTU_LR(x) (0x10 + 0x10 * (x) + 0x00) /* Load value */
  13. #define MTU_VAL(x) (0x10 + 0x10 * (x) + 0x04) /* Current value */
  14. #define MTU_CR(x) (0x10 + 0x10 * (x) + 0x08) /* Control reg */
  15. #define MTU_BGLR(x) (0x10 + 0x10 * (x) + 0x0c) /* At next overflow */
  16. /* bits for the control register */
  17. #define MTU_CRn_ENA 0x80
  18. #define MTU_CRn_PERIODIC 0x40 /* if 0 = free-running */
  19. #define MTU_CRn_PRESCALE_MASK 0x0c
  20. #define MTU_CRn_PRESCALE_1 0x00
  21. #define MTU_CRn_PRESCALE_16 0x04
  22. #define MTU_CRn_PRESCALE_256 0x08
  23. #define MTU_CRn_32BITS 0x02
  24. #define MTU_CRn_ONESHOT 0x01 /* if 0 = wraps reloading from BGLR*/
  25. /* Other registers are usual amba/primecell registers, currently not used */
  26. #define MTU_ITCR 0xff0
  27. #define MTU_ITOP 0xff4
  28. #define MTU_PERIPH_ID0 0xfe0
  29. #define MTU_PERIPH_ID1 0xfe4
  30. #define MTU_PERIPH_ID2 0xfe8
  31. #define MTU_PERIPH_ID3 0xfeC
  32. #define MTU_PCELL0 0xff0
  33. #define MTU_PCELL1 0xff4
  34. #define MTU_PCELL2 0xff8
  35. #define MTU_PCELL3 0xffC
  36. #endif /* __ASM_ARCH_MTU_H */