From 6e4501661095af7857a8784c708b02135aff2e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Thu, 9 Oct 2025 12:34:45 +0200 Subject: [PATCH] intel soc,southbridge: Add Kconfig to set TSBS in IFD during build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To modify the Top Swap Block Size in the FD (if provided and CONFIG_HAVE_IFD_BIN=y), set the following Kconfig variables: - CONFIG_INTEL_HAS_TOP_SWAP - CONFIG_INTEL_ADD_TOP_SWAP_BOOTBLOCK - CONFIG_INTEL_TOP_SWAP_BOOTBLOCK_SIZE - CONFIG_INTEL_IFD_SET_TOP_SWAP_BOOTBLOCK_SIZE Needed for the bootblock redundancy feature suggested at https://mail.coreboot.org/archives/list/coreboot@coreboot.org/thread/C6JN2PB7K7D67EG7OIKB6BBERZU5YV35/ TEST=build VP66xx with custom Kconfig, check if TSBS is modified in FD Change-Id: I94d3d3e2511a7e56392a9e34f845ae91602ce7f1 Signed-off-by: Filip Gołaś Reviewed-on: https://review.coreboot.org/c/coreboot/+/89493 Reviewed-by: Sergii Dmytruk Tested-by: build bot (Jenkins) --- src/soc/intel/common/Kconfig.common | 14 +++++++++++++- src/southbridge/intel/common/firmware/Makefile.mk | 13 +++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/common/Kconfig.common b/src/soc/intel/common/Kconfig.common index 7cd57438be..d52bc1a0fa 100644 --- a/src/soc/intel/common/Kconfig.common +++ b/src/soc/intel/common/Kconfig.common @@ -23,7 +23,19 @@ config INTEL_TOP_SWAP_BOOTBLOCK_SIZE default 0x10000 help Set this config to a supported topswap size. - Valid sizes: 0x10000 0x20000 0x40000 0x80000 0x100000 + Valid sizes: 0x10000/0x20000/0x40000/0x80000/0x100000/ + 0x200000/0x400000/0x800000. The maximum size + varies depending on the platform. + +config INTEL_IFD_SET_TOP_SWAP_BOOTBLOCK_SIZE + bool "Replace the TSBS value with INTEL_TOP_SWAP_BOOTBLOCK_SIZE" + default n + depends on HAVE_IFD_BIN + help + Set to use ifdtool to replace the Top Swap Block Size + PCH strap value in the Intel Firmware Descriptor + with INTEL_TOP_SWAP_BOOTBLOCK_SIZE + config INTEL_TOP_SWAP_FIT_ENTRY_FMAP_REG string diff --git a/src/southbridge/intel/common/firmware/Makefile.mk b/src/southbridge/intel/common/firmware/Makefile.mk index a4f0e2e1a9..41ccca41d9 100644 --- a/src/southbridge/intel/common/firmware/Makefile.mk +++ b/src/southbridge/intel/common/firmware/Makefile.mk @@ -47,9 +47,22 @@ ifeq ($(CONFIG_HAVE_EC_BIN),y) add_intel_firmware: $(call strip_quotes,$(CONFIG_EC_BIN_PATH)) endif add_intel_firmware: $(obj)/coreboot.pre $(IFDTOOL) +ifeq ($(INTEL_IFD_SET_TOP_SWAP_BOOTBLOCK_SIZE),y) + printf " IFDTOOL Modifying top swap PCH strap in IFD\n" + printf " $(IFDTOOL_USE_CHIPSET)" + $(objutil)/ifdtool/ifdtool \ + $(IFDTOOL_USE_CHIPSET) \ + -T $(CONFIG_INTEL_TOP_SWAP_BOOTBLOCK_SIZE) \ + -O $(obj)/ifd_custom_tsbs \ + $(IFD_BIN_PATH) + printf " DD Adding Intel Firmware Descriptor\n" + dd if=$(obj)/ifd_custom_tsbs\ + of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1 +else printf " DD Adding Intel Firmware Descriptor\n" dd if=$(IFD_BIN_PATH) \ of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1 +endif ifeq ($(CONFIG_VALIDATE_INTEL_DESCRIPTOR),y) printf " IFDTOOL validate IFD against FMAP\n" $(objutil)/ifdtool/ifdtool \