timer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright 2014 Broadcom Corporation.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __TIMER_H
  7. #define __TIMER_H
  8. #include <linux/types.h>
  9. void timer_systick_init(uint32_t tick_ms);
  10. void timer_global_init(void);
  11. /* ARM A9 Private Timer */
  12. #define TIMER_PVT_LOAD_OFFSET 0x00000000
  13. #define TIMER_PVT_COUNTER_OFFSET 0x00000004
  14. #define TIMER_PVT_CTRL_OFFSET 0x00000008
  15. #define TIMER_PVT_STATUS_OFFSET 0x0000000C
  16. #define TIMER_PVT_TIM_CTRL_TIM_EN 0x00000001
  17. #define TIMER_PVT_TIM_CTRL_AUTO_RELD 0x00000002
  18. #define TIMER_PVT_TIM_CTRL_INT_EN 0x00000004
  19. #define TIMER_PVT_TIM_CTRL_PRESC_MASK 0x0000FF00
  20. #define TIMER_PVT_TIM_INT_STATUS_SET 0x00000001
  21. /* Global timer */
  22. #define TIMER_GLB_LOW_OFFSET 0x00000000
  23. #define TIMER_GLB_HI_OFFSET 0x00000004
  24. #define TIMER_GLB_CTRL_OFFSET 0x00000008
  25. #define TIMER_GLB_TIM_CTRL_TIM_EN 0x00000001
  26. #define TIMER_GLB_TIM_CTRL_COMP_EN 0x00000002
  27. #define TIMER_GLB_TIM_CTRL_INT_EN 0x00000004
  28. #define TIMER_GLB_TIM_CTRL_AUTO_INC 0x00000008
  29. #define TIMER_GLB_TIM_CTRL_PRESC_MASK 0x0000FF00
  30. #define TIMER_GLB_TIM_INT_STATUS_SET 0x00000001
  31. #endif /*__TIMER_H */