From: Michael Walle <michael@walle.cc>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Alistair Francis <alistair.francis@xilinx.com>,
Peter Maydell <peter.maydell@linaro.org>,
Xiaoqiang Zhao <zxq_yx_007@163.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
qemu-arm <qemu-arm@nongnu.org>,
philippe.mathieu.daude@gmail.com
Subject: Re: [Qemu-devel] [PATCH 2/6] hw/sd/milkymist-memcard: split realize() out of SysBusDevice init()
Date: Wed, 10 Jan 2018 10:41:24 +0100 [thread overview]
Message-ID: <a06fcf38a03e63ffda2baa50f01e0769@walle.cc> (raw)
In-Reply-To: <CAAdtpL7bno=1yrRYK6zt4pgDsa8N-8d291pzX0rhNBVqgkKi4g@mail.gmail.com>
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é <f4bug@amsat.org>
>>> ---
>>> 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,
>>> s,
>>> + "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
>> .instance_init?
>
> Your patch seems correct :)
>
> Do you have some milky one prebuilt image that I can use for testing?
You can use this one:
http://milkymist.walle.cc/updates/2012-03-01/flickernoise
http://milkymist.walle.cc/README.qemu
-michael
next prev parent reply other threads:[~2018-01-10 9:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 16:23 [Qemu-devel] [PATCH 0/6] SDHCI: convert legacy devices to the SDBus API Philippe Mathieu-Daudé
2018-01-03 16:23 ` [Qemu-devel] [PATCH 1/6] hw/sd/milkymist-memcard: use qemu_log_mask() Philippe Mathieu-Daudé
2018-01-03 21:51 ` Alistair Francis
2018-01-05 12:34 ` Philippe Mathieu-Daudé
2018-01-03 16:23 ` [Qemu-devel] [PATCH 2/6] hw/sd/milkymist-memcard: split realize() out of SysBusDevice init() Philippe Mathieu-Daudé
2018-01-06 2:25 ` Alistair Francis
2018-01-09 16:54 ` Michael Walle
2018-01-09 18:16 ` Philippe Mathieu-Daudé
2018-01-09 18:24 ` Philippe Mathieu-Daudé
2018-01-10 9:41 ` Michael Walle [this message]
2018-01-03 16:23 ` [Qemu-devel] [PATCH 3/6] hw/sd/milkymist-memcard: expose a SDBus and connect the SDCard to it Philippe Mathieu-Daudé
2018-01-08 21:36 ` Alistair Francis
2018-01-03 16:23 ` [Qemu-devel] [PATCH 4/6] hw/sd/pl181: " Philippe Mathieu-Daudé
2018-01-08 21:38 ` Alistair Francis
2018-01-03 16:23 ` [Qemu-devel] [PATCH 5/6] hw/sd/ssi-sd: " Philippe Mathieu-Daudé
2018-01-08 21:39 ` Alistair Francis
2018-01-03 16:24 ` [Qemu-devel] [PATCH 6/6] hw/sd: move sdcard legacy API to "hw/sd/sdcard_legacy.h" Philippe Mathieu-Daudé
2018-01-06 2:26 ` Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a06fcf38a03e63ffda2baa50f01e0769@walle.cc \
--to=michael@walle.cc \
--cc=alistair.francis@xilinx.com \
--cc=edgar.iglesias@xilinx.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=philippe.mathieu.daude@gmail.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=zxq_yx_007@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).