summaryrefslogtreecommitdiffstats
path: root/hw/sd/milkymist-memcard.c
diff options
context:
space:
mode:
authorPeter Maydell2018-01-16 14:28:12 +0100
committerPeter Maydell2018-01-16 14:28:12 +0100
commit16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38 (patch)
tree914a78ba06714ea65c7c50db78ce00dbaf9964e3 /hw/sd/milkymist-memcard.c
parenthw/sd/pl181: Reset SD card on controller reset (diff)
downloadqemu-16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38.tar.gz
qemu-16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38.tar.xz
qemu-16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38.zip
hw/sd/milkymist-memcard: Reset SD card on controller reset
Since milkymist-memcard is still using the legacy SD card API, the SD card created by sd_init() is not plugged into any bus. This means that the controller has to reset it manually. Failing to do this mostly didn't affect the guest since the guest typically does a programmed SD card reset as part of its SD controller driver initialization, but meant that migration failed because it's only in sd_reset() that we set up the wpgrps_size field. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 1515506513-31961-3-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/sd/milkymist-memcard.c')
-rw-r--r--hw/sd/milkymist-memcard.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index 4008c81002..341da88552 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -248,6 +248,10 @@ static void milkymist_memcard_reset(DeviceState *d)
for (i = 0; i < R_MAX; i++) {
s->regs[i] = 0;
}
+ /* Since we're still using the legacy SD API the card is not plugged
+ * into any bus, and we must reset it manually.
+ */
+ device_reset(DEVICE(s->card));
}
static int milkymist_memcard_init(SysBusDevice *dev)