arm_arch_timer.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_INCLUDE_DRIVERS_TIMER_ARM_ARCH_TIMER_H_
  7. #define ZEPHYR_INCLUDE_DRIVERS_TIMER_ARM_ARCH_TIMER_H_
  8. #include <dt-bindings/interrupt-controller/arm-gic.h>
  9. #include <zephyr/types.h>
  10. #define ARM_TIMER_NODE DT_INST(0, arm_armv8_timer)
  11. #define ARM_TIMER_SECURE_IRQ DT_IRQ_BY_IDX(ARM_TIMER_NODE, 0, irq)
  12. #define ARM_TIMER_NON_SECURE_IRQ DT_IRQ_BY_IDX(ARM_TIMER_NODE, 1, irq)
  13. #define ARM_TIMER_VIRTUAL_IRQ DT_IRQ_BY_IDX(ARM_TIMER_NODE, 2, irq)
  14. #define ARM_TIMER_HYP_IRQ DT_IRQ_BY_IDX(ARM_TIMER_NODE, 3, irq)
  15. #define ARM_TIMER_SECURE_PRIO DT_IRQ_BY_IDX(ARM_TIMER_NODE, 0,\
  16. priority)
  17. #define ARM_TIMER_NON_SECURE_PRIO DT_IRQ_BY_IDX(ARM_TIMER_NODE, 1,\
  18. priority)
  19. #define ARM_TIMER_VIRTUAL_PRIO DT_IRQ_BY_IDX(ARM_TIMER_NODE, 2,\
  20. priority)
  21. #define ARM_TIMER_HYP_PRIO DT_IRQ_BY_IDX(ARM_TIMER_NODE, 3,\
  22. priority)
  23. #define ARM_TIMER_SECURE_FLAGS DT_IRQ_BY_IDX(ARM_TIMER_NODE, 0, flags)
  24. #define ARM_TIMER_NON_SECURE_FLAGS DT_IRQ_BY_IDX(ARM_TIMER_NODE, 1, flags)
  25. #define ARM_TIMER_VIRTUAL_FLAGS DT_IRQ_BY_IDX(ARM_TIMER_NODE, 2, flags)
  26. #define ARM_TIMER_HYP_FLAGS DT_IRQ_BY_IDX(ARM_TIMER_NODE, 3, flags)
  27. #endif /* ZEPHYR_INCLUDE_DRIVERS_TIMER_ARM_ARCH_TIMER_H_ */