From: "Andreas Färber" <afaerber@suse.de>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Leandro Dorileo <l@dorileo.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, Blue Swirl <blauwirbel@gmail.com>,
Bob Breuer <breuerr@mc.net>,
Anthony Liguori <aliguori@amazon.com>,
Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM
Date: Thu, 08 May 2014 16:34:12 +0200 [thread overview]
Message-ID: <536B95E4.5020009@suse.de> (raw)
In-Reply-To: <5305247D.7060705@ilande.co.uk>
Hi,
Am 19.02.2014 22:39, schrieb Mark Cave-Ayland:
> On 19/02/14 13:35, Leandro Dorileo wrote:
>
> Hi Leandro,
>
>>> +static void cg3_realizefn(DeviceState *dev, Error **errp)
>>> +{
>>> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>>> + CG3State *s = CG3(dev);
>>> + int ret;
>>> + char *fcode_filename;
>>> +
>>> + /* FCode ROM */
>>> + memory_region_init_ram(&s->rom, NULL, "cg3.prom",
>>> FCODE_MAX_ROM_SIZE);
>>> + vmstate_register_ram_global(&s->rom);
>>> + memory_region_set_readonly(&s->rom, true);
>>> + sysbus_init_mmio(sbd,&s->rom);
>>> +
>>
>>
>> I think this initialization code could be done in a SysBusDeviceClass
>> init operation,
>> don't you think?
>
> I think it's possible since these MemoryRegions don't depend upon
> properties, but I leave that to Andres who seems reasonably happy with
> the patchset in its current form.
Just seeing this...
memory_region_init_ram() and sysbus_init_mmio() could indeed be moved to
an .instance_init function, given that FCODE_MAX_ROM_SIZE is constant.
The others no. It makes a difference when considering reentrancy of the
property code via qom-set (just posted a patchset that makes playing
with that easier), although there's probably more corner cases to
consider. Could either of you follow up with a cleanup?
Regards,
Andreas
>>> + fcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, CG3_ROM_FILE);
>>> + if (fcode_filename) {
>>> + ret = load_image_targphys(fcode_filename, s->prom_addr,
>>> + FCODE_MAX_ROM_SIZE);
>>> + if (ret< 0 || ret> FCODE_MAX_ROM_SIZE) {
>>> + error_report("cg3: could not load prom '%s'",
>>> CG3_ROM_FILE);
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2014-05-08 14:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 9:05 [Qemu-devel] [PATCHv3 0/2] sun4m: Implement Sun CG3 framebuffer for QEMU Mark Cave-Ayland
2014-02-19 9:05 ` [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM Mark Cave-Ayland
2014-02-19 13:35 ` Leandro Dorileo
2014-02-19 21:39 ` Mark Cave-Ayland
2014-02-20 12:23 ` Leandro Dorileo
2014-05-08 14:34 ` Andreas Färber [this message]
2014-05-19 13:03 ` Mark Cave-Ayland
2014-05-19 17:09 ` Andreas Färber
2014-03-05 10:05 ` Paolo Bonzini
2014-05-07 19:56 ` Paolo Bonzini
2014-05-08 14:44 ` Mark Cave-Ayland
2014-05-08 14:49 ` Paolo Bonzini
2014-02-19 9:05 ` [Qemu-devel] [PATCHv3 2/2] sun4m: Add Sun CG3 framebuffer initialisation function Mark Cave-Ayland
2014-02-19 13:01 ` [Qemu-devel] [PATCHv3 0/2] sun4m: Implement Sun CG3 framebuffer for QEMU Andreas Färber
2014-02-19 21:35 ` Mark Cave-Ayland
2014-02-23 17:42 ` Mark Cave-Ayland
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=536B95E4.5020009@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=atar4qemu@gmail.com \
--cc=blauwirbel@gmail.com \
--cc=breuerr@mc.net \
--cc=l@dorileo.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).