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;
82 *type = irq_types[irq];
91 if (keymgr_dpe == NULL || snapshot == NULL) {
95 *snapshot = mmio_region_read32(keymgr_dpe->
base_addr,
96 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET);
105 if (keymgr_dpe == NULL) {
109 mmio_region_write32(keymgr_dpe->
base_addr,
110 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET, snapshot);
119 if (keymgr_dpe == NULL || is_pending == NULL) {
124 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
128 uint32_t intr_state_reg = mmio_region_read32(
129 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET);
139 if (keymgr_dpe == NULL) {
144 mmio_region_write32(keymgr_dpe->
base_addr,
145 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET, UINT32_MAX);
153 if (keymgr_dpe == NULL) {
158 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
164 mmio_region_write32(keymgr_dpe->
base_addr,
165 (ptrdiff_t)KEYMGR_DPE_INTR_STATE_REG_OFFSET,
175 if (keymgr_dpe == NULL) {
180 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
185 mmio_region_write32(keymgr_dpe->
base_addr,
186 (ptrdiff_t)KEYMGR_DPE_INTR_TEST_REG_OFFSET,
196 if (keymgr_dpe == NULL || state == NULL) {
201 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
205 uint32_t intr_enable_reg = mmio_region_read32(
206 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET);
218 if (keymgr_dpe == NULL) {
223 if (!keymgr_dpe_get_irq_bit_index(irq, &index)) {
227 uint32_t intr_enable_reg = mmio_region_read32(
228 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET);
232 mmio_region_write32(keymgr_dpe->
base_addr,
233 (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET,
243 if (keymgr_dpe == NULL) {
248 if (snapshot != NULL) {
249 *snapshot = mmio_region_read32(
250 keymgr_dpe->
base_addr, (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET);
254 mmio_region_write32(keymgr_dpe->
base_addr,
255 (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET, 0u);
264 if (keymgr_dpe == NULL || snapshot == NULL) {
268 mmio_region_write32(keymgr_dpe->
base_addr,
269 (ptrdiff_t)KEYMGR_DPE_INTR_ENABLE_REG_OFFSET, *snapshot);