hw/i2c/aspeed: Introduce a new bus pool buffer attribute in AspeedI2Cbus
authorJamin Lin <jamin_lin@aspeedtech.com>
Tue, 3 Sep 2024 08:35:19 +0000 (16:35 +0800)
committerCédric Le Goater <clg@redhat.com>
Mon, 16 Sep 2024 15:44:07 +0000 (17:44 +0200)
commit62c0c65d4fee467050eea52fe5d2e5a7891e9764
tree0bdbe3468fc3d07cb494a57fbd1fa4ff8cbf3c53
parent94500e83eaf4a577ee4ce5ce16be0587ed04a225
hw/i2c/aspeed: Introduce a new bus pool buffer attribute in AspeedI2Cbus

According to the datasheet of ASPEED SOCs,
each I2C bus has their own pool buffer since AST2500.
Only AST2400 utilized a pool buffer share to all I2C bus.
Besides, using a share pool buffer only support
pool buffer memory regions are continuous for all I2C bus.

To make this model more readable and support discontinuous
bus pool buffer memory regions, changes to introduce
a new bus pool buffer attribute in AspeedI2Cbus and
new memops. So, it does not need to calculate
the pool buffer offset for different I2C bus.

Introduce a new has_share_pool class attribute in AspeedI2CClass and
use it to create either a share pool buffer or bus pool buffers
in aspeed_i2c_realize. Update each pull buffer size to 0x10 for AST2500
and 0x20 for AST2600 and AST1030.

Incrementing the version of aspeed_i2c_bus_vmstate to 6.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
hw/i2c/aspeed_i2c.c
include/hw/i2c/aspeed_i2c.h