14 #include "otbn_regs.h"
36 alert_idx = OTBN_ALERT_TEST_FATAL_BIT;
39 alert_idx = OTBN_ALERT_TEST_RECOV_BIT;
46 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_ALERT_TEST_REG_OFFSET,
59 *index_out = OTBN_INTR_COMMON_DONE_BIT;
79 *type = irq_types[irq];
87 if (otbn == NULL || snapshot == NULL) {
91 *snapshot = mmio_region_read32(otbn->
base_addr,
92 (ptrdiff_t)OTBN_INTR_STATE_REG_OFFSET);
104 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_STATE_REG_OFFSET,
113 if (otbn == NULL || is_pending == NULL) {
118 if (!otbn_get_irq_bit_index(irq, &index)) {
122 uint32_t intr_state_reg = mmio_region_read32(
123 otbn->
base_addr, (ptrdiff_t)OTBN_INTR_STATE_REG_OFFSET);
137 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_STATE_REG_OFFSET,
151 if (!otbn_get_irq_bit_index(irq, &index)) {
157 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_STATE_REG_OFFSET,
171 if (!otbn_get_irq_bit_index(irq, &index)) {
176 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_TEST_REG_OFFSET,
185 if (otbn == NULL || state == NULL) {
190 if (!otbn_get_irq_bit_index(irq, &index)) {
194 uint32_t intr_enable_reg = mmio_region_read32(
195 otbn->
base_addr, (ptrdiff_t)OTBN_INTR_ENABLE_REG_OFFSET);
211 if (!otbn_get_irq_bit_index(irq, &index)) {
215 uint32_t intr_enable_reg = mmio_region_read32(
216 otbn->
base_addr, (ptrdiff_t)OTBN_INTR_ENABLE_REG_OFFSET);
220 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_ENABLE_REG_OFFSET,
234 if (snapshot != NULL) {
235 *snapshot = mmio_region_read32(otbn->
base_addr,
236 (ptrdiff_t)OTBN_INTR_ENABLE_REG_OFFSET);
240 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_ENABLE_REG_OFFSET,
249 if (otbn == NULL || snapshot == NULL) {
253 mmio_region_write32(otbn->
base_addr, (ptrdiff_t)OTBN_INTR_ENABLE_REG_OFFSET,