|
From: | Mark Cave-Ayland |
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 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
On 15/10/13 22:46, Peter Maydell wrote:
On 15 October 2013 21:19, Mark Cave-Ayland <address@hidden> 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.
[Prev in Thread] | Current Thread | [Next in Thread] |