nxp_timer.h 761 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright 2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #
  8. #ifndef NXP_TIMER_H
  9. #define NXP_TIMER_H
  10. /* System Counter Offset and Bit Mask */
  11. #define SYS_COUNTER_CNTCR_OFFSET 0x0
  12. #define SYS_COUNTER_CNTCR_EN 0x00000001
  13. #define CNTCR_EN_MASK 0x1
  14. #ifndef __ASSEMBLER__
  15. uint64_t get_timer_val(uint64_t start);
  16. #ifdef IMAGE_BL31
  17. void ls_configure_sys_timer(uintptr_t ls_sys_timctl_base,
  18. uint8_t ls_config_cntacr,
  19. uint8_t plat_ls_ns_timer_frame_id);
  20. void enable_init_timer(void);
  21. #endif
  22. /*
  23. * Initialise the nxp on-chip free rolling usec counter as the delay
  24. * timer.
  25. */
  26. void delay_timer_init(uintptr_t nxp_timer_addr);
  27. void ls_bl31_timer_init(uintptr_t nxp_timer_addr);
  28. #endif /* __ASSEMBLER__ */
  29. #endif /* NXP_TIMER_H */