14 #include "hmac_regs.h"
22 hmac->base_addr = base_addr;
36 alert_idx = HMAC_ALERT_TEST_FATAL_FAULT_BIT;
43 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_ALERT_TEST_REG_OFFSET,
56 *index_out = HMAC_INTR_COMMON_HMAC_DONE_BIT;
59 *index_out = HMAC_INTR_COMMON_FIFO_EMPTY_BIT;
62 *index_out = HMAC_INTR_COMMON_HMAC_ERR_BIT;
84 *type = irq_types[irq];
92 if (hmac == NULL || snapshot == NULL) {
96 *snapshot = mmio_region_read32(hmac->base_addr,
97 (ptrdiff_t)HMAC_INTR_STATE_REG_OFFSET);
109 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_STATE_REG_OFFSET,
118 if (hmac == NULL || is_pending == NULL) {
123 if (!hmac_get_irq_bit_index(irq, &index)) {
127 uint32_t intr_state_reg = mmio_region_read32(
128 hmac->base_addr, (ptrdiff_t)HMAC_INTR_STATE_REG_OFFSET);
142 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_STATE_REG_OFFSET,
156 if (!hmac_get_irq_bit_index(irq, &index)) {
162 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_STATE_REG_OFFSET,
176 if (!hmac_get_irq_bit_index(irq, &index)) {
181 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_TEST_REG_OFFSET,
190 if (hmac == NULL || state == NULL) {
195 if (!hmac_get_irq_bit_index(irq, &index)) {
199 uint32_t intr_enable_reg = mmio_region_read32(
200 hmac->base_addr, (ptrdiff_t)HMAC_INTR_ENABLE_REG_OFFSET);
216 if (!hmac_get_irq_bit_index(irq, &index)) {
220 uint32_t intr_enable_reg = mmio_region_read32(
221 hmac->base_addr, (ptrdiff_t)HMAC_INTR_ENABLE_REG_OFFSET);
225 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_ENABLE_REG_OFFSET,
239 if (snapshot != NULL) {
240 *snapshot = mmio_region_read32(hmac->base_addr,
241 (ptrdiff_t)HMAC_INTR_ENABLE_REG_OFFSET);
245 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_ENABLE_REG_OFFSET,
254 if (hmac == NULL || snapshot == NULL) {
258 mmio_region_write32(hmac->base_addr, (ptrdiff_t)HMAC_INTR_ENABLE_REG_OFFSET,