From 42c8ae73a3e9bea2d050b05f00a2639ebd21a61a Mon Sep 17 00:00:00 2001 From: Krystian Hebel Date: Fri, 24 May 2024 14:07:07 +0200 Subject: mb/qemu-{i440fx,q35}: reduce default ROM size to 8 MiB By default, QEMU bails when trying to use bigger images mounted with '-drive if=pflash', which is required to make use of writable flash introduced in CB:82555. This changes both default size in Kconfig as well as FMAP layouts. Since QEMU 5.0.0 it is possible to change the limit of firmware size with `max-fw-size` machine configuration option, up to 16 MiB, as bigger sizes would overlap with IO APIC memory range. Default is still 8 MiB, so it makes sense to have identical default in coreboot. Error thrown by QEMU when trying to use too big ROM: qemu-system-x86_64: combined size of system firmware exceeds 8388608 bytes Change-Id: If36cb754a8e75e23bce49ff568dd88e5db279bb8 Signed-off-by: Krystian Hebel Reviewed-on: https://review.coreboot.org/c/coreboot/+/82639 Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) Reviewed-by: Maciej Pijanowski Reviewed-by: Maximilian Brune --- src/mainboard/emulation/qemu-i440fx/Kconfig | 4 ++-- .../emulation/qemu-i440fx/vboot-rwa-16M.fmd | 19 --------------- .../emulation/qemu-i440fx/vboot-rwa-8M.fmd | 19 +++++++++++++++ src/mainboard/emulation/qemu-q35/Kconfig | 6 ++--- src/mainboard/emulation/qemu-q35/vboot-rwa-16M.fmd | 19 --------------- src/mainboard/emulation/qemu-q35/vboot-rwa-8M.fmd | 19 +++++++++++++++ .../emulation/qemu-q35/vboot-rwab-16M.fmd | 28 ---------------------- src/mainboard/emulation/qemu-q35/vboot-rwab-8M.fmd | 28 ++++++++++++++++++++++ 8 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 src/mainboard/emulation/qemu-i440fx/vboot-rwa-16M.fmd create mode 100644 src/mainboard/emulation/qemu-i440fx/vboot-rwa-8M.fmd delete mode 100644 src/mainboard/emulation/qemu-q35/vboot-rwa-16M.fmd create mode 100644 src/mainboard/emulation/qemu-q35/vboot-rwa-8M.fmd delete mode 100644 src/mainboard/emulation/qemu-q35/vboot-rwab-16M.fmd create mode 100644 src/mainboard/emulation/qemu-q35/vboot-rwab-8M.fmd diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig index 842c053185..6d6181c5bb 100644 --- a/src/mainboard/emulation/qemu-i440fx/Kconfig +++ b/src/mainboard/emulation/qemu-i440fx/Kconfig @@ -12,7 +12,7 @@ config BOARD_SPECIFIC_OPTIONS select HAVE_PIRQ_TABLE select HAVE_ACPI_TABLES select BOARD_ROMSIZE_KB_4096 if !VBOOT - select BOARD_ROMSIZE_KB_16384 if VBOOT + select BOARD_ROMSIZE_KB_8192 if VBOOT select MAINBOARD_HAS_NATIVE_VGA_INIT select MAINBOARD_FORCE_NATIVE_VGA_INIT select HAVE_ASAN_IN_ROMSTAGE @@ -52,7 +52,7 @@ config VBOOT_SLOTS_RW_A endif config FMDFILE - default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwa-16M.fmd" if VBOOT_SLOTS_RW_A + default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwa-8M.fmd" if VBOOT_SLOTS_RW_A config VBOOT_VBNV_OFFSET hex diff --git a/src/mainboard/emulation/qemu-i440fx/vboot-rwa-16M.fmd b/src/mainboard/emulation/qemu-i440fx/vboot-rwa-16M.fmd deleted file mode 100644 index 0d2c9da297..0000000000 --- a/src/mainboard/emulation/qemu-i440fx/vboot-rwa-16M.fmd +++ /dev/null @@ -1,19 +0,0 @@ -FLASH@0xff000000 0x1000000 { - SI_BIOS 0x1000000 { - RW_SECTION_A 0x7c0000 { - VBLOCK_A 0x10000 - FW_MAIN_A(CBFS) 0x74ffc0 - RW_FWID_A 0x40 - } - RW_VPD(PRESERVE) 0x1000 - - WP_RO { - FMAP 0x800 - RO_FRID 0x40 - RO_PADDING 0x7c0 - RO_VPD(PRESERVE) 0x1000 - GBB 0x1e000 - COREBOOT(CBFS) - } - } -} diff --git a/src/mainboard/emulation/qemu-i440fx/vboot-rwa-8M.fmd b/src/mainboard/emulation/qemu-i440fx/vboot-rwa-8M.fmd new file mode 100644 index 0000000000..55a38b79a9 --- /dev/null +++ b/src/mainboard/emulation/qemu-i440fx/vboot-rwa-8M.fmd @@ -0,0 +1,19 @@ +FLASH@0xff800000 0x800000 { + SI_BIOS 0x800000 { + RW_SECTION_A 0x3c0000 { + VBLOCK_A 0x10000 + FW_MAIN_A(CBFS) + RW_FWID_A 0x40 + } + RW_VPD(PRESERVE) 0x1000 + + WP_RO { + FMAP 0x800 + RO_FRID 0x40 + RO_PADDING 0x7c0 + RO_VPD(PRESERVE) 0x1000 + GBB 0x1e000 + COREBOOT(CBFS) + } + } +} diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig index 2fb180b7ec..70a7437fc8 100644 --- a/src/mainboard/emulation/qemu-q35/Kconfig +++ b/src/mainboard/emulation/qemu-q35/Kconfig @@ -10,7 +10,7 @@ config BOARD_SPECIFIC_OPTIONS select HAVE_OPTION_TABLE # select HAVE_PIRQ_TABLE select HAVE_ACPI_TABLES - select BOARD_ROMSIZE_KB_16384 + select BOARD_ROMSIZE_KB_8192 select MAINBOARD_HAS_NATIVE_VGA_INIT select MAINBOARD_FORCE_NATIVE_VGA_INIT if !CHROMEOS select MEMORY_MAPPED_TPM @@ -29,8 +29,8 @@ config VBOOT select GBB_FLAG_DISABLE_FWMP config FMDFILE - default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwa-16M.fmd" if VBOOT_SLOTS_RW_A && !VBOOT_SLOTS_RW_AB - default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwab-16M.fmd" if VBOOT_SLOTS_RW_AB + default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwa-8M.fmd" if VBOOT_SLOTS_RW_A && !VBOOT_SLOTS_RW_AB + default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwab-8M.fmd" if VBOOT_SLOTS_RW_AB if ARCH_BOOTBLOCK_X86_64 diff --git a/src/mainboard/emulation/qemu-q35/vboot-rwa-16M.fmd b/src/mainboard/emulation/qemu-q35/vboot-rwa-16M.fmd deleted file mode 100644 index 0d2c9da297..0000000000 --- a/src/mainboard/emulation/qemu-q35/vboot-rwa-16M.fmd +++ /dev/null @@ -1,19 +0,0 @@ -FLASH@0xff000000 0x1000000 { - SI_BIOS 0x1000000 { - RW_SECTION_A 0x7c0000 { - VBLOCK_A 0x10000 - FW_MAIN_A(CBFS) 0x74ffc0 - RW_FWID_A 0x40 - } - RW_VPD(PRESERVE) 0x1000 - - WP_RO { - FMAP 0x800 - RO_FRID 0x40 - RO_PADDING 0x7c0 - RO_VPD(PRESERVE) 0x1000 - GBB 0x1e000 - COREBOOT(CBFS) - } - } -} diff --git a/src/mainboard/emulation/qemu-q35/vboot-rwa-8M.fmd b/src/mainboard/emulation/qemu-q35/vboot-rwa-8M.fmd new file mode 100644 index 0000000000..55a38b79a9 --- /dev/null +++ b/src/mainboard/emulation/qemu-q35/vboot-rwa-8M.fmd @@ -0,0 +1,19 @@ +FLASH@0xff800000 0x800000 { + SI_BIOS 0x800000 { + RW_SECTION_A 0x3c0000 { + VBLOCK_A 0x10000 + FW_MAIN_A(CBFS) + RW_FWID_A 0x40 + } + RW_VPD(PRESERVE) 0x1000 + + WP_RO { + FMAP 0x800 + RO_FRID 0x40 + RO_PADDING 0x7c0 + RO_VPD(PRESERVE) 0x1000 + GBB 0x1e000 + COREBOOT(CBFS) + } + } +} diff --git a/src/mainboard/emulation/qemu-q35/vboot-rwab-16M.fmd b/src/mainboard/emulation/qemu-q35/vboot-rwab-16M.fmd deleted file mode 100644 index fcbfa95b69..0000000000 --- a/src/mainboard/emulation/qemu-q35/vboot-rwab-16M.fmd +++ /dev/null @@ -1,28 +0,0 @@ -FLASH@0xff000000 0x1000000 { - SI_BIOS 0x1000000 { - RW_SECTION_A 0x1c0000 { - VBLOCK_A 0x10000 - FW_MAIN_A(CBFS) - RW_FWID_A 0x40 - } - RW_SECTION_B 0x1c0000 { - VBLOCK_B 0x10000 - FW_MAIN_B(CBFS) - RW_FWID_B 0x40 - } - RW_SHARED 0x4000 { - SHARED_DATA 0x2000 - VBLOCK_DEV 0x2000 - } - RW_VPD(PRESERVE) 0x1000 - RW_LEGACY(CBFS) 0x10000 - WP_RO { - FMAP 0x800 - RO_FRID 0x40 - RO_PADDING 0x7c0 - RO_VPD(PRESERVE) 0x1000 - GBB 0x1e000 - COREBOOT(CBFS) - } - } -} diff --git a/src/mainboard/emulation/qemu-q35/vboot-rwab-8M.fmd b/src/mainboard/emulation/qemu-q35/vboot-rwab-8M.fmd new file mode 100644 index 0000000000..8064fdfeaf --- /dev/null +++ b/src/mainboard/emulation/qemu-q35/vboot-rwab-8M.fmd @@ -0,0 +1,28 @@ +FLASH@0xff800000 0x800000 { + SI_BIOS 0x800000 { + RW_SECTION_A 0x1c0000 { + VBLOCK_A 0x10000 + FW_MAIN_A(CBFS) + RW_FWID_A 0x40 + } + RW_SECTION_B 0x1c0000 { + VBLOCK_B 0x10000 + FW_MAIN_B(CBFS) + RW_FWID_B 0x40 + } + RW_SHARED 0x4000 { + SHARED_DATA 0x2000 + VBLOCK_DEV 0x2000 + } + RW_VPD(PRESERVE) 0x1000 + RW_LEGACY(CBFS) 0x10000 + WP_RO { + FMAP 0x800 + RO_FRID 0x40 + RO_PADDING 0x7c0 + RO_VPD(PRESERVE) 0x1000 + GBB 0x1e000 + COREBOOT(CBFS) + } + } +} -- cgit v1.2.3