@samitouri / QOSamiQemu / commits / 5fca367b89

hw/i2c/aspeed_i2c: Remove assert

According to the Aspeed datasheet, the RX_BUF_LEN_W1T and TX_BUF_LEN_W1T bits of the A_I2CS_DMA_LEN (0x2c) register allow firmware to program the TX and RX DMA length (TX_BUF_LEN and RX_BUF_LEN fields of the same register) separately without the need to read/modify/write the value. If RX_BUF_LEN_W1T and TX_BUF_LEN_W1T bits are 0, then both TX and RX DMA length will be written. When setting the RX_BUF_LEN field, the TX_BUF_LEN field being set is not an invalid condition. Remove the assert. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3315 Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com> Link: https://lore.kernel.org/qemu-devel/20260323125545.577653-4-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Cédric Le Goater committed Mar 23, 2026 at 13:55 UTC 5fca367b89de2d11631cb27a90a8c5431d004f58
1 file changed -1
hw/i2c/aspeed_i2c.c
-1
@@ -780,7 +780,6 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset,
780 bus->regs[R_I2CS_DMA_RX_ADDR] = value;
781 break;
782 case A_I2CS_DMA_LEN:
783 - assert(FIELD_EX32(value, I2CS_DMA_LEN, TX_BUF_LEN) == 0);
783 if (FIELD_EX32(value, I2CS_DMA_LEN, RX_BUF_LEN_W1T)) {
784 ARRAY_FIELD_DP32(bus->regs, I2CS_DMA_LEN, RX_BUF_LEN,
785 FIELD_EX32(value, I2CS_DMA_LEN, RX_BUF_LEN));