From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGEtA-0006Ff-6Y for qemu-devel@nongnu.org; Wed, 19 Feb 2014 16:41:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGEt2-0007Mn-Ri for qemu-devel@nongnu.org; Wed, 19 Feb 2014 16:41:08 -0500 Received: from s16892447.onlinehome-server.info ([82.165.15.123]:34408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGEt2-0007Mi-Km for qemu-devel@nongnu.org; Wed, 19 Feb 2014 16:41:00 -0500 Message-ID: <5305247D.7060705@ilande.co.uk> Date: Wed, 19 Feb 2014 21:39:09 +0000 From: Mark Cave-Ayland MIME-Version: 1.0 References: <1392800720-2765-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1392800720-2765-2-git-send-email-mark.cave-ayland@ilande.co.uk> <20140219133502.GA20305@dorilex> In-Reply-To: <20140219133502.GA20305@dorilex> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leandro Dorileo Cc: Peter Maydell , qemu-devel@nongnu.org, Blue Swirl , Bob Breuer , Anthony Liguori , Artyom Tarasenko 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. > >> + 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? ATB, Mark.