qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leandro Dorileo <l@dorileo.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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, 20 Feb 2014 12:23:48 +0000	[thread overview]
Message-ID: <20140220122348.GA22837@dorilex> (raw)
In-Reply-To: <5305247D.7060705@ilande.co.uk>

On Wed, Feb 19, 2014 at 09:39:09PM +0000, Mark Cave-Ayland wrote:
> 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.


Yes, I just saw his comment in the patch 02...

> 
> >
> >>+    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);
> >
> >
> >What happens if we fail to load the rom file? is the framebuffer supposed to work?
> 
> I guess the framebuffer would still "work" although nothing would be able to
> find its address because the node wouldn't exist in the device tree?
> 

Ok, when we move this code to an instance init op we handle it a bit better.

> 
> ATB,
> 
> Mark.

-- 
Leandro Dorileo

  reply	other threads:[~2014-02-20 12:24 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 [this message]
2014-05-08 14:34       ` Andreas Färber
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=20140220122348.GA22837@dorilex \
    --to=l@dorileo.org \
    --cc=aliguori@amazon.com \
    --cc=atar4qemu@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=breuerr@mc.net \
    --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).