diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-07-05 14:24:24 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-08-21 16:22:43 +0200 |
commit | 26c607b86b7bb90ad75a15bc6172c28aa48c768c (patch) | |
tree | d4465372d044588ab785b3b5dea6daee2d2e41f0 /hw/sd/pl181.c | |
parent | 2762eed1f5534074fcce703bdda8702905dc4c61 (diff) | |
download | qemu-26c607b86b7bb90ad75a15bc6172c28aa48c768c.zip qemu-26c607b86b7bb90ad75a15bc6172c28aa48c768c.tar.gz qemu-26c607b86b7bb90ad75a15bc6172c28aa48c768c.tar.bz2 |
hw/sd/pl181: Do not create SD card within the SD host controller
SD/MMC host controllers provide a SD Bus to plug SD cards,
but don't come with SD card plugged in :) Let the machine/board
model create and plug the SD cards when required.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200705204630.4133-8-f4bug@amsat.org>
Diffstat (limited to 'hw/sd/pl181.c')
-rw-r--r-- | hw/sd/pl181.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index f6de06e..f69488e 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -17,7 +17,6 @@ #include "qemu/module.h" #include "qemu/error-report.h" #include "qapi/error.h" -#include "hw/qdev-properties.h" //#define DEBUG_PL181 1 @@ -518,30 +517,14 @@ static void pl181_init(Object *obj) TYPE_PL181_BUS, dev, "sd-bus"); } -static void pl181_realize(DeviceState *dev, Error **errp) -{ - DeviceState *card; - DriveInfo *dinfo; - - /* FIXME use a qdev drive property instead of drive_get_next() */ - card = qdev_new(TYPE_SD_CARD); - dinfo = drive_get_next(IF_SD); - qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), - &error_fatal); - qdev_realize_and_unref(card, - qdev_get_child_bus(dev, "sd-bus"), - &error_fatal); -} - static void pl181_class_init(ObjectClass *klass, void *data) { DeviceClass *k = DEVICE_CLASS(klass); k->vmsd = &vmstate_pl181; k->reset = pl181_reset; - /* Reason: init() method uses drive_get_next() */ + /* Reason: output IRQs should be wired up */ k->user_creatable = false; - k->realize = pl181_realize; } static const TypeInfo pl181_info = { |