microblaze_timer.h 846 B

1234567891011121314151617181920212223242526
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2007 Michal Simek
  4. *
  5. * Michal SIMEK <monstr@monstr.cz>
  6. */
  7. #define TIMER_ENABLE_ALL 0x400 /* ENALL */
  8. #define TIMER_PWM 0x200 /* PWMA0 */
  9. #define TIMER_INTERRUPT 0x100 /* T0INT */
  10. #define TIMER_ENABLE 0x080 /* ENT0 */
  11. #define TIMER_ENABLE_INTR 0x040 /* ENIT0 */
  12. #define TIMER_RESET 0x020 /* LOAD0 */
  13. #define TIMER_RELOAD 0x010 /* ARHT0 */
  14. #define TIMER_EXT_CAPTURE 0x008 /* CAPT0 */
  15. #define TIMER_EXT_COMPARE 0x004 /* GENT0 */
  16. #define TIMER_DOWN_COUNT 0x002 /* UDT0 */
  17. #define TIMER_CAPTURE_MODE 0x001 /* MDT0 */
  18. typedef volatile struct microblaze_timer_t {
  19. int control; /* control/statuc register TCSR */
  20. int loadreg; /* load register TLR */
  21. int counter; /* timer/counter register */
  22. } microblaze_timer_t;
  23. int timer_init(void);