14 #include "keymgr_regs.h"
36 alert_idx = KEYMGR_ALERT_TEST_RECOV_OPERATION_ERR_BIT;
39 alert_idx = KEYMGR_ALERT_TEST_FATAL_FAULT_ERR_BIT;
47 (ptrdiff_t)KEYMGR_ALERT_TEST_REG_OFFSET, alert_test_reg);
59 *index_out = KEYMGR_INTR_COMMON_OP_DONE_BIT;
80 *type = irq_types[irq];
88 if (keymgr == NULL || snapshot == NULL) {
92 *snapshot = mmio_region_read32(keymgr->
base_addr,
93 (ptrdiff_t)KEYMGR_INTR_STATE_REG_OFFSET);
101 if (keymgr == NULL) {
106 (ptrdiff_t)KEYMGR_INTR_STATE_REG_OFFSET, snapshot);
114 if (keymgr == NULL || is_pending == NULL) {
119 if (!keymgr_get_irq_bit_index(irq, &index)) {
123 uint32_t intr_state_reg = mmio_region_read32(
124 keymgr->
base_addr, (ptrdiff_t)KEYMGR_INTR_STATE_REG_OFFSET);
133 if (keymgr == NULL) {
139 (ptrdiff_t)KEYMGR_INTR_STATE_REG_OFFSET, UINT32_MAX);
147 if (keymgr == NULL) {
152 if (!keymgr_get_irq_bit_index(irq, &index)) {
159 (ptrdiff_t)KEYMGR_INTR_STATE_REG_OFFSET, intr_state_reg);
167 if (keymgr == NULL) {
172 if (!keymgr_get_irq_bit_index(irq, &index)) {
177 mmio_region_write32(keymgr->
base_addr, (ptrdiff_t)KEYMGR_INTR_TEST_REG_OFFSET,
187 if (keymgr == NULL || state == NULL) {
192 if (!keymgr_get_irq_bit_index(irq, &index)) {
196 uint32_t intr_enable_reg = mmio_region_read32(
197 keymgr->
base_addr, (ptrdiff_t)KEYMGR_INTR_ENABLE_REG_OFFSET);
209 if (keymgr == NULL) {
214 if (!keymgr_get_irq_bit_index(irq, &index)) {
218 uint32_t intr_enable_reg = mmio_region_read32(
219 keymgr->
base_addr, (ptrdiff_t)KEYMGR_INTR_ENABLE_REG_OFFSET);
224 (ptrdiff_t)KEYMGR_INTR_ENABLE_REG_OFFSET,
233 if (keymgr == NULL) {
238 if (snapshot != NULL) {
239 *snapshot = mmio_region_read32(keymgr->
base_addr,
240 (ptrdiff_t)KEYMGR_INTR_ENABLE_REG_OFFSET);
245 (ptrdiff_t)KEYMGR_INTR_ENABLE_REG_OFFSET, 0u);
254 if (keymgr == NULL || snapshot == NULL) {
259 (ptrdiff_t)KEYMGR_INTR_ENABLE_REG_OFFSET, *snapshot);