From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Blue Swirl <blauwirbel@gmail.com>, Bob Breuer <breuerr@mc.net>,
QEMU Developers <qemu-devel@nongnu.org>,
Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM
Date: Thu, 17 Oct 2013 13:31:38 +0100 [thread overview]
Message-ID: <525FD8AA.2030306@ilande.co.uk> (raw)
In-Reply-To: <CAFEAcA8H9Q10uMaM1bBLxJNXMfb97f8Kz0K_ZxDJBig-J93ddg@mail.gmail.com>
On 15/10/13 22:46, Peter Maydell wrote:
> On 15 October 2013 21:19, Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>> + /* 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(dev,&s->rom);
>> +
>> + 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);
>> + }
>
> Ideally we would have a 'load image into RAM memory region' function,
> and then we wouldn't need to pass the device the address of its own
> memory region. Oh well...
Yes, definitely the ROM image code is lacking from post-MemoryRegion
love. For example load_image_targphys() indirectly creates a
MemoryRegion to hold the loaded ROM contents, but it only becomes
visible (presumably because of SysBus) when another RAM MemoryRegion is
installed at the same address. Hence you actually end up having to claim
twice the memory requirement of your original ROM.
ATB,
Mark.
next prev parent reply other threads:[~2013-10-17 12:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 20:19 [Qemu-devel] [PATCH 0/2] sun4m: Implement Sun CG3 framebuffer for QEMU Mark Cave-Ayland
2013-10-15 20:19 ` [Qemu-devel] [PATCH 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM Mark Cave-Ayland
2013-10-15 21:46 ` Peter Maydell
2013-10-17 12:31 ` Mark Cave-Ayland [this message]
2013-10-15 20:19 ` [Qemu-devel] [PATCH 2/2] sun4m: Add Sun CG3 framebuffer initialisation function Mark Cave-Ayland
2013-10-26 8:53 ` [Qemu-devel] [PATCH 0/2] sun4m: Implement Sun CG3 framebuffer for QEMU Mark Cave-Ayland
-- strict thread matches above, loose matches on Subject: below --
2013-12-13 18:27 Mark Cave-Ayland
2013-12-13 18:27 ` [Qemu-devel] [PATCH 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM 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=525FD8AA.2030306@ilande.co.uk \
--to=mark.cave-ayland@ilande.co.uk \
--cc=atar4qemu@gmail.com \
--cc=blauwirbel@gmail.com \
--cc=breuerr@mc.net \
--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).