Attention is currently required from: Krystian Hebel, Michał Kopeć, Michał Żygowski, Patrick Rudolph, Sergii Dmytruk.
Hello Michał Kopeć, Michał Żygowski, Patrick Rudolph, Sergii Dmytruk, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/82555?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed: Code-Review+2 by Patrick Rudolph, Verified+1 by build bot (Jenkins)
Change subject: mb/qemu-{i440fx,q35}/rom_media.c: add code for writable flash ......................................................................
mb/qemu-{i440fx,q35}/rom_media.c: add code for writable flash
Depending on how firmware image was passed to QEMU, it may behave as: - ROM - memory mapped reads, writes are ignored (FW image mounted with '-bios'); - RAM - memory mapped reads and writes (FW image mounted with e.g. '-device loader'); - flash - memory mapped reads, write and erase possible through commands. Contrary to physical flash devices erase is not required before writing, but it also doesn't hurt. Flash may be split into read-only and read-write parts, like OVMF_CODE.fd and OVMF_VARS.fd. Combined size of system firmware must not exceed 8 MiB (FW image(s) mounted with '-drive if=pflash').
This function detects which of the above applies and fills region_device_ops accordingly.
Tested by starting QEMU with firmware passed as '-drive if=pflash', '-drive if=pflash,readonly=on' and '-bios'. When started with firmware passed through '-device loader', coreboot complains about corrupted FMAP, but this is the same behavior as without this change:
[ERROR] Invalid FMAP at 0x40000 [EMERG] Cannot locate primary CBFS
Writable pflash support was added about 17 years ago, so it should be supported by all QEMU versions currently in use.
Change-Id: I3ab9f22c6165064a769881d4be5eab13a0a2f519 Signed-off-by: Krystian Hebel krystian.hebel@3mdeb.com --- M src/mainboard/emulation/qemu-i440fx/Kconfig M src/mainboard/emulation/qemu-i440fx/Makefile.mk A src/mainboard/emulation/qemu-i440fx/rom_media.c M src/mainboard/emulation/qemu-q35/Kconfig M src/mainboard/emulation/qemu-q35/Makefile.mk 5 files changed, 204 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/82555/4