hw/i2c/bcm2835_i2c: Correct iomem size
The last valid register is the Clock Stretch Timeout (CLKT) at offset 0x1c. Since it is a 32-bit register, the total memory region size should be 0x1c + 4 = 0x20. Update the size parameter in memory_region_init_io() from 0x24 to 0x20 to accurately reflect the hardware specification. Suggested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: botszhuang <huang.botsz@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-id: 20260804144611.31735-1-huang.botsz@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
botszhuang committed
Aug 11, 2026 at 20:14 UTC
20bf099da7c0dff3494cc36ae43add1ff376be52
1 file changed
+1
-1
hw/i2c/bcm2835_i2c.c
+1
-1
@@ -222,7 +222,7 @@ static void bcm2835_i2c_realize(DeviceState *dev, Error **errp)
222
s->bus = i2c_init_bus(dev, NULL);
223
224
memory_region_init_io(&s->iomem, OBJECT(dev), &bcm2835_i2c_ops, s,
225
- TYPE_BCM2835_I2C, 0x24);
225
+ TYPE_BCM2835_I2C, 0x20);
226
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
227
sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq);
228
}