From 19efdf9eebaf60038f652e870f58aea4b1f14b6d Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 3 Sep 2023 19:55:58 +0100
Subject: ich9m mainboards: use pre-assembled ifd/gbe files

This cuts down on build time, and it will allow libreboot
to remove large chunks of code.

these ifd/gbe configs are just binary-encoded config files,
in a format well-understood. they can easily be opened up
and displayed, using ich9show or ifdtool, and manipulated
by these tools; bincfg can generate them from scratch, and
nvmutil can change mac addresses, for example.

so, do this and remove from lbmk the following:

* ich9utils (which contains ich9gen) - not needed anymore
* code in lbmk for handling ich9gen and insertions; the
  coreboot build system is now used, for this same purpose,
  so remove such code from lbmk

this results in a massive code size reduction (thousands of
lines) in lbmk; smaller when only looking at the build
system, but much larger when you consider that ich9utils
is also removed (about 3k sloc)

Signed-off-by: Leah Rowe <leah@libreboot.org>
---
 resources/coreboot/x200_8mb/config/libgfxinit_corebootfb | 12 +++++++++++-
 resources/coreboot/x200_8mb/config/libgfxinit_txtmode    | 12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

(limited to 'resources/coreboot/x200_8mb')

diff --git a/resources/coreboot/x200_8mb/config/libgfxinit_corebootfb b/resources/coreboot/x200_8mb/config/libgfxinit_corebootfb
index 6bb657a9..9f0ca5e0 100644
--- a/resources/coreboot/x200_8mb/config/libgfxinit_corebootfb
+++ b/resources/coreboot/x200_8mb/config/libgfxinit_corebootfb
@@ -147,12 +147,14 @@ CONFIG_HAVE_INTEL_FIRMWARE=y
 CONFIG_SPI_FLASH_INCLUDE_ALL_DRIVERS=y
 CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_DRIVERS_INTEL_WIFI is not set
+CONFIG_IFD_BIN_PATH="../../blobs/ich9m/8_ifd.bin"
+CONFIG_GBE_BIN_PATH="../../blobs/ich9m/gbe.bin"
 CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000
 CONFIG_CARDBUS_PLUGIN_SUPPORT=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="ThinkPad X200"
-# CONFIG_HAVE_IFD_BIN is not set
+CONFIG_HAVE_IFD_BIN=y
 CONFIG_PCIEXP_HOTPLUG_BUSES=8
 CONFIG_PCIEXP_HOTPLUG_MEM=0x800000
 CONFIG_PCIEXP_HOTPLUG_PREFETCH_MEM=0x10000000
@@ -349,7 +351,13 @@ CONFIG_EC_LENOVO_PMH7=y
 #
 # Intel Firmware
 #
+# CONFIG_HAVE_ME_BIN is not set
+# CONFIG_ME_REGION_ALLOW_CPU_READ_ACCESS is not set
 CONFIG_MAINBOARD_USES_IFD_GBE_REGION=y
+CONFIG_HAVE_GBE_BIN=y
+# CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION is not set
+# CONFIG_LOCK_MANAGEMENT_ENGINE is not set
+CONFIG_UNLOCK_FLASH_REGIONS=y
 CONFIG_ARCH_X86=y
 CONFIG_ARCH_BOOTBLOCK_X86_32=y
 CONFIG_ARCH_VERSTAGE_X86_32=y
@@ -606,6 +614,8 @@ CONFIG_HAVE_DEBUG_SMBUS=y
 # CONFIG_DEBUG_SPI_FLASH is not set
 # CONFIG_DEBUG_BOOT_STATE is not set
 # CONFIG_DEBUG_ADA_CODE is not set
+CONFIG_HAVE_EM100_SUPPORT=y
+# CONFIG_EM100 is not set
 # CONFIG_DEBUG_ACPICA_COMPATIBLE is not set
 # end of Debugging
 
diff --git a/resources/coreboot/x200_8mb/config/libgfxinit_txtmode b/resources/coreboot/x200_8mb/config/libgfxinit_txtmode
index 05094a9b..1ff87a95 100644
--- a/resources/coreboot/x200_8mb/config/libgfxinit_txtmode
+++ b/resources/coreboot/x200_8mb/config/libgfxinit_txtmode
@@ -145,12 +145,14 @@ CONFIG_HAVE_INTEL_FIRMWARE=y
 CONFIG_SPI_FLASH_INCLUDE_ALL_DRIVERS=y
 CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_DRIVERS_INTEL_WIFI is not set
+CONFIG_IFD_BIN_PATH="../../blobs/ich9m/8_ifd.bin"
+CONFIG_GBE_BIN_PATH="../../blobs/ich9m/gbe.bin"
 CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000
 CONFIG_CARDBUS_PLUGIN_SUPPORT=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="ThinkPad X200"
-# CONFIG_HAVE_IFD_BIN is not set
+CONFIG_HAVE_IFD_BIN=y
 CONFIG_PCIEXP_HOTPLUG_BUSES=8
 CONFIG_PCIEXP_HOTPLUG_MEM=0x800000
 CONFIG_PCIEXP_HOTPLUG_PREFETCH_MEM=0x10000000
@@ -347,7 +349,13 @@ CONFIG_EC_LENOVO_PMH7=y
 #
 # Intel Firmware
 #
+# CONFIG_HAVE_ME_BIN is not set
+# CONFIG_ME_REGION_ALLOW_CPU_READ_ACCESS is not set
 CONFIG_MAINBOARD_USES_IFD_GBE_REGION=y
+CONFIG_HAVE_GBE_BIN=y
+# CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION is not set
+# CONFIG_LOCK_MANAGEMENT_ENGINE is not set
+CONFIG_UNLOCK_FLASH_REGIONS=y
 CONFIG_ARCH_X86=y
 CONFIG_ARCH_BOOTBLOCK_X86_32=y
 CONFIG_ARCH_VERSTAGE_X86_32=y
@@ -602,6 +610,8 @@ CONFIG_HAVE_DEBUG_SMBUS=y
 # CONFIG_DEBUG_SPI_FLASH is not set
 # CONFIG_DEBUG_BOOT_STATE is not set
 # CONFIG_DEBUG_ADA_CODE is not set
+CONFIG_HAVE_EM100_SUPPORT=y
+# CONFIG_EM100 is not set
 # CONFIG_DEBUG_ACPICA_COMPATIBLE is not set
 # end of Debugging
 
-- 
cgit v1.2.1