14 #include "pwrmgr_regs.h"
36 alert_idx = PWRMGR_ALERT_TEST_FATAL_FAULT_BIT;
44 (ptrdiff_t)PWRMGR_ALERT_TEST_REG_OFFSET, alert_test_reg);
56 *index_out = PWRMGR_INTR_COMMON_WAKEUP_BIT;
77 *type = irq_types[irq];
85 if (pwrmgr == NULL || snapshot == NULL) {
89 *snapshot = mmio_region_read32(pwrmgr->
base_addr,
90 (ptrdiff_t)PWRMGR_INTR_STATE_REG_OFFSET);
103 (ptrdiff_t)PWRMGR_INTR_STATE_REG_OFFSET, snapshot);
111 if (pwrmgr == NULL || is_pending == NULL) {
116 if (!pwrmgr_get_irq_bit_index(irq, &index)) {
120 uint32_t intr_state_reg = mmio_region_read32(
121 pwrmgr->
base_addr, (ptrdiff_t)PWRMGR_INTR_STATE_REG_OFFSET);
130 if (pwrmgr == NULL) {
136 (ptrdiff_t)PWRMGR_INTR_STATE_REG_OFFSET, UINT32_MAX);
144 if (pwrmgr == NULL) {
149 if (!pwrmgr_get_irq_bit_index(irq, &index)) {
156 (ptrdiff_t)PWRMGR_INTR_STATE_REG_OFFSET, intr_state_reg);
164 if (pwrmgr == NULL) {
169 if (!pwrmgr_get_irq_bit_index(irq, &index)) {
174 mmio_region_write32(pwrmgr->
base_addr, (ptrdiff_t)PWRMGR_INTR_TEST_REG_OFFSET,
184 if (pwrmgr == NULL || state == NULL) {
189 if (!pwrmgr_get_irq_bit_index(irq, &index)) {
193 uint32_t intr_enable_reg = mmio_region_read32(
194 pwrmgr->
base_addr, (ptrdiff_t)PWRMGR_INTR_ENABLE_REG_OFFSET);
206 if (pwrmgr == NULL) {
211 if (!pwrmgr_get_irq_bit_index(irq, &index)) {
215 uint32_t intr_enable_reg = mmio_region_read32(
216 pwrmgr->
base_addr, (ptrdiff_t)PWRMGR_INTR_ENABLE_REG_OFFSET);
221 (ptrdiff_t)PWRMGR_INTR_ENABLE_REG_OFFSET,
230 if (pwrmgr == NULL) {
235 if (snapshot != NULL) {
236 *snapshot = mmio_region_read32(pwrmgr->
base_addr,
237 (ptrdiff_t)PWRMGR_INTR_ENABLE_REG_OFFSET);
242 (ptrdiff_t)PWRMGR_INTR_ENABLE_REG_OFFSET, 0u);
251 if (pwrmgr == NULL || snapshot == NULL) {
256 (ptrdiff_t)PWRMGR_INTR_ENABLE_REG_OFFSET, *snapshot);