summaryrefslogtreecommitdiffstats
path: root/include/hw
diff options
context:
space:
mode:
authorCédric Le Goater2021-10-12 08:20:08 +0200
committerCédric Le Goater2021-10-12 08:20:08 +0200
commit602610383f1be927830b903275ee02fcd368d6e8 (patch)
tree5963926690cf2bff33d5f9ae8cac6494979af197 /include/hw
parentaspeed/smc: Remove unused attribute 'irqline' (diff)
downloadqemu-602610383f1be927830b903275ee02fcd368d6e8.tar.gz
qemu-602610383f1be927830b903275ee02fcd368d6e8.tar.xz
qemu-602610383f1be927830b903275ee02fcd368d6e8.zip
aspeed/i2c: QOMify AspeedI2CBus
Introduce an AspeedI2CBus SysBusDevice model and attach the associated memory region and IRQ to the newly instantiated objects. Before this change, the I2C bus IRQs were all attached to the SysBusDevice model of the I2C controller. Adapt the AST2600 SoC realize routine to take into account this change. Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/i2c/aspeed_i2c.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index 565f833066..4b9be09274 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -36,7 +36,11 @@ OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C)
struct AspeedI2CState;
-typedef struct AspeedI2CBus {
+#define TYPE_ASPEED_I2C_BUS "aspeed.i2c.bus"
+OBJECT_DECLARE_SIMPLE_TYPE(AspeedI2CBus, ASPEED_I2C_BUS)
+struct AspeedI2CBus {
+ SysBusDevice parent_obj;
+
struct AspeedI2CState *controller;
MemoryRegion mr;
@@ -54,7 +58,7 @@ typedef struct AspeedI2CBus {
uint32_t pool_ctrl;
uint32_t dma_addr;
uint32_t dma_len;
-} AspeedI2CBus;
+};
struct AspeedI2CState {
SysBusDevice parent_obj;