mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
94500e83ea
commit
62c0c65d4f
2 changed files with 117 additions and 18 deletions
|
@ -35,6 +35,7 @@ OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C)
|
|||
|
||||
#define ASPEED_I2C_NR_BUSSES 16
|
||||
#define ASPEED_I2C_SHARE_POOL_SIZE 0x800
|
||||
#define ASPEED_I2C_BUS_POOL_SIZE 0x20
|
||||
#define ASPEED_I2C_OLD_NUM_REG 11
|
||||
#define ASPEED_I2C_NEW_NUM_REG 22
|
||||
|
||||
|
@ -239,12 +240,14 @@ struct AspeedI2CBus {
|
|||
I2CSlave *slave;
|
||||
|
||||
MemoryRegion mr;
|
||||
MemoryRegion mr_pool;
|
||||
|
||||
I2CBus *bus;
|
||||
uint8_t id;
|
||||
qemu_irq irq;
|
||||
|
||||
uint32_t regs[ASPEED_I2C_NEW_NUM_REG];
|
||||
uint8_t pool[ASPEED_I2C_BUS_POOL_SIZE];
|
||||
};
|
||||
|
||||
struct AspeedI2CState {
|
||||
|
@ -284,6 +287,7 @@ struct AspeedI2CClass {
|
|||
uint8_t *(*bus_pool_base)(AspeedI2CBus *);
|
||||
bool check_sram;
|
||||
bool has_dma;
|
||||
bool has_share_pool;
|
||||
uint64_t mem_size;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue