35 alert_idx = I2C_ALERT_TEST_FATAL_FAULT_BIT;
42 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_ALERT_TEST_REG_OFFSET,
55 *index_out = I2C_INTR_COMMON_FMT_THRESHOLD_BIT;
58 *index_out = I2C_INTR_COMMON_RX_THRESHOLD_BIT;
61 *index_out = I2C_INTR_COMMON_ACQ_THRESHOLD_BIT;
64 *index_out = I2C_INTR_COMMON_RX_OVERFLOW_BIT;
67 *index_out = I2C_INTR_COMMON_CONTROLLER_HALT_BIT;
70 *index_out = I2C_INTR_COMMON_SCL_INTERFERENCE_BIT;
73 *index_out = I2C_INTR_COMMON_SDA_INTERFERENCE_BIT;
76 *index_out = I2C_INTR_COMMON_STRETCH_TIMEOUT_BIT;
79 *index_out = I2C_INTR_COMMON_SDA_UNSTABLE_BIT;
82 *index_out = I2C_INTR_COMMON_CMD_COMPLETE_BIT;
85 *index_out = I2C_INTR_COMMON_TX_STRETCH_BIT;
88 *index_out = I2C_INTR_COMMON_TX_THRESHOLD_BIT;
91 *index_out = I2C_INTR_COMMON_ACQ_STRETCH_BIT;
94 *index_out = I2C_INTR_COMMON_UNEXP_STOP_BIT;
97 *index_out = I2C_INTR_COMMON_HOST_TIMEOUT_BIT;
120 *type = irq_types[irq];
128 if (i2c == NULL || snapshot == NULL) {
133 mmio_region_read32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_STATE_REG_OFFSET);
145 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_STATE_REG_OFFSET,
154 if (i2c == NULL || is_pending == NULL) {
159 if (!i2c_get_irq_bit_index(irq, &index)) {
163 uint32_t intr_state_reg =
164 mmio_region_read32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_STATE_REG_OFFSET);
178 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_STATE_REG_OFFSET,
191 if (!i2c_get_irq_bit_index(irq, &index)) {
197 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_STATE_REG_OFFSET,
211 if (!i2c_get_irq_bit_index(irq, &index)) {
216 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_TEST_REG_OFFSET,
225 if (i2c == NULL || state == NULL) {
230 if (!i2c_get_irq_bit_index(irq, &index)) {
234 uint32_t intr_enable_reg =
235 mmio_region_read32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_ENABLE_REG_OFFSET);
251 if (!i2c_get_irq_bit_index(irq, &index)) {
255 uint32_t intr_enable_reg =
256 mmio_region_read32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_ENABLE_REG_OFFSET);
260 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_ENABLE_REG_OFFSET,
274 if (snapshot != NULL) {
275 *snapshot = mmio_region_read32(i2c->
base_addr,
276 (ptrdiff_t)I2C_INTR_ENABLE_REG_OFFSET);
280 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_ENABLE_REG_OFFSET,
289 if (i2c == NULL || snapshot == NULL) {
293 mmio_region_write32(i2c->
base_addr, (ptrdiff_t)I2C_INTR_ENABLE_REG_OFFSET,