14 #include "keymgr_dpe_regs.h"
19 if (keymgr_dpe == NULL) {
30 if (keymgr_dpe == NULL) {
37 alert_idx = KEYMGR_DPE_ALERT_TEST_RECOV_OPERATION_ERR_BIT;
40 alert_idx = KEYMGR_DPE_ALERT_TEST_FATAL_FAULT_ERR_BIT;
47 mmio_region_write32(keymgr_dpe->
base_addr,
48 (ptrdiff_t)KEYMGR_DPE_ALERT_TEST_REG_OFFSET,
61 *index_out = KEYMGR_DPE_INTR_COMMON_OP_DONE_BIT;
78 if (keymgr_dpe == NULL || type == NULL || irq < 0 ||
83 *type = irq_types[irq];
92 if (keymgr_dpe == NULL || snapshot == NULL) {
96 *snapshot = mmio_region_read32(keymgr_dpe->
base_addr,
97 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET);
106 if (keymgr_dpe == NULL) {
110 mmio_region_write32(keymgr_dpe->
base_addr,
111 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET, snapshot);
120 if (keymgr_dpe == NULL || is_pending == NULL) {
125 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
129 uint32_t intr_state_reg = mmio_region_read32(
130 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET);
140 if (keymgr_dpe == NULL) {
145 mmio_region_write32(keymgr_dpe->
base_addr,
146 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET, UINT32_MAX);
154 if (keymgr_dpe == NULL) {
159 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
165 mmio_region_write32(keymgr_dpe->
base_addr,
166 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET,
176 if (keymgr_dpe == NULL) {
181 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
186 mmio_region_write32(keymgr_dpe->
base_addr,
187 (ptrdiff_t)KEYMGR_DPE_INTR_TEST_REG_OFFSET,
197 if (keymgr_dpe == NULL || state == NULL) {
202 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
206 uint32_t intr_enable_reg = mmio_region_read32(
207 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET);
219 if (keymgr_dpe == NULL) {
224 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
228 uint32_t intr_enable_reg = mmio_region_read32(
229 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET);
233 mmio_region_write32(keymgr_dpe->
base_addr,
234 (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET,
244 if (keymgr_dpe == NULL) {
249 if (snapshot != NULL) {
250 *snapshot = mmio_region_read32(
251 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET);
255 mmio_region_write32(keymgr_dpe->
base_addr,
256 (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET, 0u);
265 if (keymgr_dpe == NULL || snapshot == NULL) {
269 mmio_region_write32(keymgr_dpe->
base_addr,
270 (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET, *snapshot);