[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/21] aspeed/i2c: Enable SLAVE_ADDR_RX_MATCH always
From: |
Cédric Le Goater |
Subject: |
[PATCH 19/21] aspeed/i2c: Enable SLAVE_ADDR_RX_MATCH always |
Date: |
Mon, 6 Jun 2022 17:07:30 +0200 |
There is no 'slave match interrupt' enable bit in the Interrupt
Control Register. Consider it is always enabled and extend the mask
value 'bus->regs[intr_ctrl_reg]' with the SLAVE_ADDR_RX_MATCH bit when
the interrupt is raised.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/i2c/aspeed_i2c.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 59245079002b..f30098bebbab 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -32,11 +32,16 @@
#include "hw/registerfields.h"
#include "trace.h"
+/* Enable SLAVE_ADDR_RX_MATCH always */
+#define R_I2CD_INTR_STS_ALWAYS_ENABLE R_I2CD_INTR_STS_SLAVE_ADDR_RX_MATCH_MASK
+
static inline void aspeed_i2c_bus_raise_interrupt(AspeedI2CBus *bus)
{
AspeedI2CClass *aic = ASPEED_I2C_GET_CLASS(bus->controller);
uint32_t reg_intr_sts = aspeed_i2c_bus_intr_sts_offset(bus);
uint32_t intr_ctrl_reg = aspeed_i2c_bus_intr_ctrl_offset(bus);
+ uint32_t intr_ctrl_mask = bus->regs[intr_ctrl_reg] |
+ R_I2CD_INTR_STS_ALWAYS_ENABLE;
bool raise_irq;
if (trace_event_get_state_backends(TRACE_ASPEED_I2C_BUS_RAISE_INTERRUPT)) {
@@ -60,11 +65,11 @@ static inline void
aspeed_i2c_bus_raise_interrupt(AspeedI2CBus *bus)
trace_aspeed_i2c_bus_raise_interrupt(bus->regs[reg_intr_sts], buf);
}
- raise_irq = bus->regs[reg_intr_sts] & bus->regs[intr_ctrl_reg];
+ raise_irq = bus->regs[reg_intr_sts] & intr_ctrl_mask ;
/* In packet mode we don't mask off INTR_STS */
if (!aspeed_i2c_bus_pkt_mode_en(bus)) {
- bus->regs[reg_intr_sts] &= bus->regs[intr_ctrl_reg];
+ bus->regs[reg_intr_sts] &= intr_ctrl_mask;
}
if (raise_irq) {
--
2.35.3
- [PATCH 12/21] aspeed/i2c: Add ast1030 controller models, (continued)
- [PATCH 12/21] aspeed/i2c: Add ast1030 controller models, Cédric Le Goater, 2022/06/06
- [PATCH 13/21] aspeed: Add I2C buses to AST1030 model, Cédric Le Goater, 2022/06/06
- [PATCH 14/21] hw/i2c/aspeed: rework raise interrupt trace event, Cédric Le Goater, 2022/06/06
- [PATCH 15/21] hw/i2c/aspeed: add DEV_ADDR in old register mode, Cédric Le Goater, 2022/06/06
- [PATCH 16/21] hw/i2c: support multiple masters, Cédric Le Goater, 2022/06/06
- [PATCH 17/21] hw/i2c: add asynchronous send, Cédric Le Goater, 2022/06/06
- [PATCH 18/21] hw/i2c/aspeed: add slave device in old register mode, Cédric Le Goater, 2022/06/06
- [PATCH 19/21] aspeed/i2c: Enable SLAVE_ADDR_RX_MATCH always,
Cédric Le Goater <=
- [PATCH 20/21] hw/misc: add a toy i2c echo device [DO NOT PULL], Cédric Le Goater, 2022/06/06
- [PATCH 21/21] test/avocado/machine_aspeed.py: Add I2C slave tests, Cédric Le Goater, 2022/06/06
- Re: [PATCH 00/21] aspeed: Extend ast2600 I2C model with new mode, Cédric Le Goater, 2022/06/19