14 #include "kmac_regs.h"
36 alert_idx = KMAC_ALERT_TEST_RECOV_OPERATION_ERR_BIT;
39 alert_idx = KMAC_ALERT_TEST_FATAL_FAULT_ERR_BIT;
46 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_ALERT_TEST_REG_OFFSET,
59 *index_out = KMAC_INTR_COMMON_KMAC_DONE_BIT;
62 *index_out = KMAC_INTR_COMMON_FIFO_EMPTY_BIT;
65 *index_out = KMAC_INTR_COMMON_KMAC_ERR_BIT;
87 *type = irq_types[irq];
95 if (kmac == NULL || snapshot == NULL) {
99 *snapshot = mmio_region_read32(kmac->
base_addr,
100 (ptrdiff_t)KMAC_INTR_STATE_REG_OFFSET);
112 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_STATE_REG_OFFSET,
121 if (kmac == NULL || is_pending == NULL) {
126 if (!kmac_get_irq_bit_index(irq, &index)) {
130 uint32_t intr_state_reg = mmio_region_read32(
131 kmac->
base_addr, (ptrdiff_t)KMAC_INTR_STATE_REG_OFFSET);
145 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_STATE_REG_OFFSET,
159 if (!kmac_get_irq_bit_index(irq, &index)) {
165 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_STATE_REG_OFFSET,
179 if (!kmac_get_irq_bit_index(irq, &index)) {
184 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_TEST_REG_OFFSET,
193 if (kmac == NULL || state == NULL) {
198 if (!kmac_get_irq_bit_index(irq, &index)) {
202 uint32_t intr_enable_reg = mmio_region_read32(
203 kmac->
base_addr, (ptrdiff_t)KMAC_INTR_ENABLE_REG_OFFSET);
219 if (!kmac_get_irq_bit_index(irq, &index)) {
223 uint32_t intr_enable_reg = mmio_region_read32(
224 kmac->
base_addr, (ptrdiff_t)KMAC_INTR_ENABLE_REG_OFFSET);
228 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_ENABLE_REG_OFFSET,
242 if (snapshot != NULL) {
243 *snapshot = mmio_region_read32(kmac->
base_addr,
244 (ptrdiff_t)KMAC_INTR_ENABLE_REG_OFFSET);
248 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_ENABLE_REG_OFFSET,
257 if (kmac == NULL || snapshot == NULL) {
261 mmio_region_write32(kmac->
base_addr, (ptrdiff_t)KMAC_INTR_ENABLE_REG_OFFSET,