mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
aspeed: i2c: Use reg array instead of individual vars
Using a register array will allow us to represent old-mode and new-mode I2C registers by using the same underlying register array, instead of adding an entire new set of variables to represent new mode. As part of this, we also do additional cleanup to use ARRAY_FIELD_ macros instead of FIELD_ macros on registers. Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: Ib94996b17c361b8490c042b43c99d8abc69332e3 [ clg: use of memset in aspeed_i2c_bus_reset() ] Message-Id: <20220331043248.2237838-5-komlodi@google.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
committed by
Cédric Le Goater
parent
3be3d6ccf2
commit
2260fc6ff3
+124
-153
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@ OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C)
|
||||
|
||||
#define ASPEED_I2C_NR_BUSSES 16
|
||||
#define ASPEED_I2C_MAX_POOL_SIZE 0x800
|
||||
#define ASPEED_I2C_OLD_NUM_REG 11
|
||||
|
||||
struct AspeedI2CState;
|
||||
|
||||
@@ -49,15 +50,7 @@ struct AspeedI2CBus {
|
||||
uint8_t id;
|
||||
qemu_irq irq;
|
||||
|
||||
uint32_t ctrl;
|
||||
uint32_t timing[2];
|
||||
uint32_t intr_ctrl;
|
||||
uint32_t intr_status;
|
||||
uint32_t cmd;
|
||||
uint32_t buf;
|
||||
uint32_t pool_ctrl;
|
||||
uint32_t dma_addr;
|
||||
uint32_t dma_len;
|
||||
uint32_t regs[ASPEED_I2C_OLD_NUM_REG];
|
||||
};
|
||||
|
||||
struct AspeedI2CState {
|
||||
|
||||
Reference in New Issue
Block a user