mbox series

[00/11] hw/sd: QOMify omap-mmc, remove legacy APIs

Message ID 20250128104519.3981448-1-peter.maydell@linaro.org
Headers show
Series hw/sd: QOMify omap-mmc, remove legacy APIs | expand

Message

Peter Maydell Jan. 28, 2025, 10:45 a.m. UTC
This series QOMifies the omap-mmc device. The main reason for
this is that this device is now the only remaining in-tree
user of the legacy SD APIs defined in sdcard_legacy.h.
The first 8 patches QOMify the device and do some minor
cleanup on it. Patches 9 to 11 then remove the unused
legacy APIs, deleting sdcard_legacy.h entirely. This includes
letting us get rid of the me_no_qdev_me_kill_mammoth_with_rocks
codepaths in sd.c.

thanks
-- PMM

Peter Maydell (11):
  hw/sd/omap_mmc: Do a minimal conversion to QDev
  hw/sd/omap_mmc: Convert remaining 'struct omap_mmc_s' uses to
    OMAPMMCState
  hw/sd/omap_mmc: Convert output qemu_irqs to gpio and sysbus IRQ APIs
  hw/sd/omap_mmc: Convert to SDBus API
  hw/sd/omap_mmc: Use similar API for "wire up omap_clk" to other OMAP
    devices
  hw/arm/omap1: Inline creation of MMC
  hw/sd/omap_mmc: Remove unused coverswitch qemu_irq
  hw/sd/omap_mmc: Untabify
  hw/sd: Remove unused 'enable' method from SDCardClass
  hw/sd: Remove unused legacy functions, stop killing mammoths
  hw/sd: Remove unused SDState::enable

 include/hw/arm/omap.h         |  17 ++-
 include/hw/sd/sd.h            |   1 -
 include/hw/sd/sdcard_legacy.h |  50 -------
 hw/arm/omap1.c                |  26 +++-
 hw/sd/omap_mmc.c              | 256 +++++++++++++++++++---------------
 hw/sd/sd.c                    |  94 +++----------
 6 files changed, 190 insertions(+), 254 deletions(-)
 delete mode 100644 include/hw/sd/sdcard_legacy.h

Comments

Philippe Mathieu-Daudé Jan. 31, 2025, 5:01 p.m. UTC | #1
On 28/1/25 11:45, Peter Maydell wrote:
> This series QOMifies the omap-mmc device. The main reason for
> this is that this device is now the only remaining in-tree
> user of the legacy SD APIs defined in sdcard_legacy.h.
> The first 8 patches QOMify the device and do some minor
> cleanup on it. Patches 9 to 11 then remove the unused
> legacy APIs, deleting sdcard_legacy.h entirely. This includes
> letting us get rid of the me_no_qdev_me_kill_mammoth_with_rocks
> codepaths in sd.c.

Thanks for this long due cleanup!

Series queued squashing:

-- >8 --
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index d31456ad236..bbe7b971bbe 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -71,3 +71,2 @@ typedef struct OMAPMMCState {
      int cdet_enable;
-    int cdet_state;
      qemu_irq cdet;
@@ -611,9 +610,4 @@ static void omap_mmc_initfn(Object *obj)
      qdev_init_gpio_out_named(DEVICE(obj), &s->dma_rx_gpio, "dma-rx", 1);
-}

-static void omap_mmc_realize(DeviceState *dev, Error **errp)
-{
-    OMAPMMCState *s = OMAP_MMC(dev);
-
-    qbus_init(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS, dev, "sd-bus");
+    qbus_init(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS, DEVICE(obj), 
"sd-bus");
  }
@@ -622,3 +616,2 @@ static void omap_mmc_class_init(ObjectClass *oc, 
void *data)
  {
-    DeviceClass *dc = DEVICE_CLASS(oc);
      ResettableClass *rc = RESETTABLE_CLASS(oc);
@@ -626,3 +619,2 @@ static void omap_mmc_class_init(ObjectClass *oc, 
void *data)
      rc->phases.hold = omap_mmc_reset_hold;
-    dc->realize = omap_mmc_realize;
  }
---