[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH 2/6] hw/sd/milkymist-memcard: split realize() out

From: Michael Walle
Subject: Re: [Qemu-arm] [PATCH 2/6] hw/sd/milkymist-memcard: split realize() out of SysBusDevice init()
Date: Wed, 10 Jan 2018 10:41:24 +0100
User-agent: Roundcube Webmail/1.2.3

Hi Philippe,

Am 2018-01-09 19:16, schrieb Philippe Mathieu-Daudé:
Hi Michael,

Am 2018-01-03 17:23, schrieb Philippe Mathieu-Daudé:

Create the SDCard in the realize() function.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
 hw/sd/milkymist-memcard.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index 5de3e00e2f..5df3a0f815 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -255,24 +255,29 @@ static void milkymist_memcard_reset(DeviceState *d)
 static int milkymist_memcard_init(SysBusDevice *dev)
     MilkymistMemcardState *s = MILKYMIST_MEMCARD(dev);
-    DriveInfo *dinfo;
+ memory_region_init_io(&s->regs_region, OBJECT(s), &memcard_mmio_ops,
+            "milkymist-memcard", R_MAX * 4);
+    sysbus_init_mmio(dev, &s->regs_region);
+    return 0;

Creating the device (milkymist_memcard_create()) fails with an assertion: sysbus_mmio_map_common: Assertion `n >= 0 && n < dev->num_mmio' failed.

Thanks for trying this.

Odd 'make check-qtest-lm32' didn't catch this...

because dev->num_mmio is still 0. Seems that sysbus_init_mmio() hasn't been
called yet. Do we have to move the milkymist_memcard_init() to

Your patch seems correct :)

Do you have some milky one prebuilt image that I can use for testing?

You can use this one:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]