15 #include "aon_timer_regs.h"
17 static_assert(AON_TIMER_INTR_STATE_WKUP_TIMER_EXPIRED_BIT ==
18 AON_TIMER_INTR_TEST_WKUP_TIMER_EXPIRED_BIT,
19 "Expected IRQ bit offsets to match across STATE/TEST regs.");
20 static_assert(AON_TIMER_INTR_STATE_WDOG_TIMER_BARK_BIT ==
21 AON_TIMER_INTR_TEST_WDOG_TIMER_BARK_BIT,
22 "Expected IRQ bit offsets to match across STATE/TEST regs.");
27 if (aon_timer == NULL) {
38 if (aon_timer == NULL) {
45 alert_idx = AON_TIMER_ALERT_TEST_FATAL_FAULT_BIT;
53 (ptrdiff_t)AON_TIMER_ALERT_TEST_REG_OFFSET,
66 *index_out = AON_TIMER_INTR_STATE_WKUP_TIMER_EXPIRED_BIT;
69 *index_out = AON_TIMER_INTR_STATE_WDOG_TIMER_BARK_BIT;
87 if (aon_timer == NULL || type == NULL ||
92 *type = irq_types[irq];
101 if (aon_timer == NULL || snapshot == NULL) {
105 *snapshot = mmio_region_read32(aon_timer->
base_addr,
106 (ptrdiff_t)AON_TIMER_INTR_STATE_REG_OFFSET);
115 if (aon_timer == NULL) {
119 mmio_region_write32(aon_timer->
base_addr,
120 (ptrdiff_t)AON_TIMER_INTR_STATE_REG_OFFSET, snapshot);
129 if (aon_timer == NULL || is_pending == NULL) {
134 if (!aon_timer_get_irq_bit_index(irq, &index)) {
138 uint32_t intr_state_reg = mmio_region_read32(
139 aon_timer->
base_addr, (ptrdiff_t)AON_TIMER_INTR_STATE_REG_OFFSET);
149 if (aon_timer == NULL) {
154 mmio_region_write32(aon_timer->
base_addr,
155 (ptrdiff_t)AON_TIMER_INTR_STATE_REG_OFFSET, UINT32_MAX);
163 if (aon_timer == NULL) {
168 if (!aon_timer_get_irq_bit_index(irq, &index)) {
174 mmio_region_write32(aon_timer->
base_addr,
175 (ptrdiff_t)AON_TIMER_INTR_STATE_REG_OFFSET,
184 if (aon_timer == NULL) {
189 if (!aon_timer_get_irq_bit_index(irq, &index)) {
194 mmio_region_write32(aon_timer->
base_addr,
195 (ptrdiff_t)AON_TIMER_INTR_TEST_REG_OFFSET, intr_test_reg);