summary refs log tree commit diff stats
path: root/include/hw/arm/omap.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2025-01-28 10:45:09 +0000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-31 19:36:44 +0100
commit4cadcb6b5f90bf0e9d0d23ad7552a0857dc593e7 (patch)
treec7b1476d09ddb99b3372ebbedb9bbeb1b46d48c6 /include/hw/arm/omap.h
parentadc1a4a26a9e060c76f213e2b5bf275519844068 (diff)
downloadfocaccia-qemu-4cadcb6b5f90bf0e9d0d23ad7552a0857dc593e7.tar.gz
focaccia-qemu-4cadcb6b5f90bf0e9d0d23ad7552a0857dc593e7.zip
hw/sd/omap_mmc: Do a minimal conversion to QDev
Do a minimal conversion of the omap_mmc device model to QDev.

In this commit we do the bare minimum to produce a working device:
 * add the SysBusDevice parent_obj and the usual type boilerplate
 * omap_mmc_init() now returns a DeviceState*
 * reset is handled by sysbus reset, so the SoC reset function
   doesn't need to call omap_mmc_reset() any more
 * code that should obviously be in init/realize is moved there
   from omap_mmc_init()

We leave various pieces of cleanup to later commits:
 * rationalizing 'struct omap_mmc_s *' to 'OMAPMMCState *'
 * using gpio lines rather than having omap_mmc_init() directly
   set s->irq, s->dma
 * switching away from the legacy SD API and instead having
   the SD card plugged into a bus

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250128104519.3981448-2-peter.maydell@linaro.org>
[PMD: Do not add omap_mmc_realize()]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'include/hw/arm/omap.h')
-rw-r--r--include/hw/arm/omap.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h
index 420ed1d573..6339c5a581 100644
--- a/include/hw/arm/omap.h
+++ b/include/hw/arm/omap.h
@@ -529,12 +529,13 @@ struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem,
                                         omap_clk clk);
 
 /* omap_mmc.c */
-struct omap_mmc_s;
-struct omap_mmc_s *omap_mmc_init(hwaddr base,
-                MemoryRegion *sysmem,
-                BlockBackend *blk,
-                qemu_irq irq, qemu_irq dma[], omap_clk clk);
-void omap_mmc_reset(struct omap_mmc_s *s);
+#define TYPE_OMAP_MMC "omap-mmc"
+OBJECT_DECLARE_SIMPLE_TYPE(omap_mmc_s, OMAP_MMC)
+
+DeviceState *omap_mmc_init(hwaddr base,
+                           MemoryRegion *sysmem,
+                           BlockBackend *blk,
+                           qemu_irq irq, qemu_irq dma[], omap_clk clk);
 
 /* omap_i2c.c */
 I2CBus *omap_i2c_bus(DeviceState *omap_i2c);
@@ -601,7 +602,7 @@ struct omap_mpu_state_s {
     /* MPU public TIPB peripherals */
     struct omap_32khz_timer_s *os_timer;
 
-    struct omap_mmc_s *mmc;
+    DeviceState *mmc;
 
     struct omap_mpuio_s *mpuio;