[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] hw/i386/pc_sysfw: Do not create BIOS region if MTD is presen
|
From: |
Patrick Rudolph |
|
Subject: |
[PATCH 3/3] hw/i386/pc_sysfw: Do not create BIOS region if MTD is present |
|
Date: |
Wed, 18 Oct 2023 13:52:31 +0200 |
The newly introduced ICH9 SPI MTD controller creates the BIOS
region itself as it needs to update the mmaped BIOS region as
well when the MTD device is updated though the SPI controller.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
hw/i386/pc_sysfw.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index c8d9e71b88..b98077422c 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -211,6 +211,12 @@ void pc_system_firmware_init(PCMachineState *pcms,
x86_bios_rom_init(MACHINE(pcms), "bios.bin", rom_memory, true);
return;
}
+ DriveInfo *dinfo = drive_get(IF_MTD, 0, 0);
+ if (dinfo) {
+ /* SPI flash and BIOS will be emulated by MTD controller */
+ pc_system_flash_cleanup_unused(pcms);
+ return;
+ }
/* Map legacy -drive if=pflash to machine properties */
for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) {
--
2.41.0