diff options
author | Joe Komlodi | 2022-06-13 14:05:48 +0200 |
---|---|---|
committer | Cédric Le Goater | 2022-06-22 09:49:34 +0200 |
commit | 2260fc6ff3ff384bf384118a9be7aa6bec43b45b (patch) | |
tree | 04db9072b015e1e7597ccfe18323cb3e4521b440 /include/hw/i2c/aspeed_i2c.h | |
parent | aspeed: i2c: Migrate to registerfields API (diff) | |
download | qemu-2260fc6ff3ff384bf384118a9be7aa6bec43b45b.tar.gz qemu-2260fc6ff3ff384bf384118a9be7aa6bec43b45b.tar.xz qemu-2260fc6ff3ff384bf384118a9be7aa6bec43b45b.zip |
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>
Diffstat (limited to 'include/hw/i2c/aspeed_i2c.h')
-rw-r--r-- | include/hw/i2c/aspeed_i2c.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index 4b9be09274..8abb013d21 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -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 { |