[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] extensions to the -m memory option
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [RFC] extensions to the -m memory option |
Date: |
Sat, 30 May 2015 13:20:19 -0700 |
On Sat, May 30, 2015 at 3:32 AM, Paolo Bonzini <address@hidden> wrote:
>
>
> On 30/05/2015 11:55, Peter Crosthwaite wrote:
>> I think the same is true of NOR.
>
> NOR is sized according to the capacity of its backing file, at least in
> the PC case.
>
So that might be the exception to the rule. I assume that is this (pc_sysfw.c):
snprintf(name, sizeof name, "system.flash%d", unit);
system_flash = pflash_cfi01_register(phys_addr, NULL /* qdev */, name,
size, blk, sector_size,
size >> sector_bits,
1 /* width */,
0x0000 /* id0 */,
0x0000 /* id1 */,
0x0000 /* id2 */,
0x0000 /* id3 */,
0 /* be */);
This ID fields are 0'd out and a generic flash is created matching the
blk dev geometry. So this does what you says it does.
A bit of grepping around, there are a good number of embedded boards
(ARM is heavily represented) where the board specifies the flash
specifically. Here is one for versatilepb:
hw/arm/versatilepb.c:#define VERSATILE_FLASH_SIZE (64 * 1024 * 1024)
hw/arm/versatilepb.c: if
(!pflash_cfi01_register(VERSATILE_FLASH_ADDR, NULL, "versatile.flash",
hw/arm/versatilepb.c- VERSATILE_FLASH_SIZE,
hw/arm/versatilepb.c- dinfo ?
blk_by_legacy_dinfo(dinfo) : NULL,
hw/arm/versatilepb.c- VERSATILE_FLASH_SECT_SIZE,
hw/arm/versatilepb.c- VERSATILE_FLASH_SIZE /
VERSATILE_FLASH_SECT_SIZE,
hw/arm/versatilepb.c- 4, 0x0089, 0x0018,
0x0000, 0x0, 0)) {
Vexpress does something very similar but using QOM setters instead.
The IDs are set to something very specific indicating a chosen part
rather than a generic pflash.
Consequently we have the mixed semantic of blk sometimes dictating the
device size and other times not. For ARM, it is generally the not
case.
Regards,
Peter
> Paolo
>
- Re: [Qemu-devel] [RFC] extensions to the -m memory option, (continued)
Re: [Qemu-devel] [RFC] extensions to the -m memory option, Paolo Bonzini, 2015/05/29
Re: [Qemu-devel] [RFC] extensions to the -m memory option, Peter Crosthwaite, 2015/05/30