From 3698517d82df048c2a2b2c901b3aa1b790f8bdc0 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 23 Apr 2025 12:06:07 +0200 Subject: [PATCH] mb/amd: Use mec152x tool Instead of providing an EC_SIG binary blob, generate it at build time using the mec152x tool. Allows to move the EC_BODY in the fmap without the need to generate a new EC_SIG. TEST=Booted on amd/birman_plus without EC_SIG blob. Change-Id: I2d7a791820d905b088194b290853509f10689fc6 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/87429 Reviewed-by: Maximilian Brune Tested-by: build bot (Jenkins) --- src/mainboard/amd/birman/Kconfig | 9 --------- src/mainboard/amd/birman/Makefile.mk | 7 ++++--- src/mainboard/amd/birman_plus/Kconfig | 9 --------- src/mainboard/amd/birman_plus/Makefile.mk | 7 ++++--- src/mainboard/amd/crater/Kconfig | 8 -------- src/mainboard/amd/crater/Makefile.mk | 7 ++++--- 6 files changed, 12 insertions(+), 35 deletions(-) diff --git a/src/mainboard/amd/birman/Kconfig b/src/mainboard/amd/birman/Kconfig index 3a9ffc77f1..f690e5e67a 100644 --- a/src/mainboard/amd/birman/Kconfig +++ b/src/mainboard/amd/birman/Kconfig @@ -52,15 +52,6 @@ config BIRMAN_HAVE_MCHP_FW bool "Have Microchip EC firmware?" default n -config BIRMAN_MCHP_SIG_FILE - string "Microchip EC signature file" - depends on BIRMAN_HAVE_MCHP_FW - default "3rdparty/blobs/mainboard/amd/birman/EC_birman_sig.bin" - help - The EC sig blob is the first 4kBytes of the firmware image. - The first 4 bytes form a pointer (with CRC) to where the EC firmware - is located - config AMD_SOC_CONSOLE_UART default y if !SOC_AMD_COMMON_BLOCK_SIMNOW_BUILD diff --git a/src/mainboard/amd/birman/Makefile.mk b/src/mainboard/amd/birman/Makefile.mk index a784d1a7fa..aa26adb4fe 100644 --- a/src/mainboard/amd/birman/Makefile.mk +++ b/src/mainboard/amd/birman/Makefile.mk @@ -23,10 +23,11 @@ show_notices:: warn_no_apcb endif ifeq ($(CONFIG_BIRMAN_HAVE_MCHP_FW),y) -$(call add_intermediate, add_mchp_fw) - $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_SIG -f $(CONFIG_BIRMAN_MCHP_SIG_FILE) --fill-upward - $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_BODY -f $(CONFIG_BIRMAN_MCHP_FW_FILE) --fill-upward +subdirs-y += ../../../../util/mec152x +$(call add_intermediate, add_mchp_fw, $(objutil)/mec152x/mec152xtool) + $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_BODY -f $(CONFIG_BIRMAN_MCHP_FW_FILE) --fill-upward + $(objutil)/mec152x/mec152xtool $(obj)/coreboot.pre GEN_ECFW_PTR -f EC_BODY else show_notices:: warn_no_mchp endif # CONFIG_BIRMAN_HAVE_MCHP_FW diff --git a/src/mainboard/amd/birman_plus/Kconfig b/src/mainboard/amd/birman_plus/Kconfig index 62d5c29141..a5291a495c 100644 --- a/src/mainboard/amd/birman_plus/Kconfig +++ b/src/mainboard/amd/birman_plus/Kconfig @@ -48,15 +48,6 @@ config BIRMANPLUS_HAVE_MCHP_FW bool "Have Microchip EC firmware?" default n -config BIRMANPLUS_MCHP_SIG_FILE - string "Microchip EC signature file" - depends on BIRMANPLUS_HAVE_MCHP_FW - default "3rdparty/blobs/mainboard/amd/birman_plus/EC_birmanplus_sig.bin" - help - The EC sig blob is the first 4kBytes of the firmware image. - The first 4 bytes form a pointer (with CRC) to where the EC firmware - is located - config AMD_SOC_CONSOLE_UART default y if !SOC_AMD_COMMON_BLOCK_SIMNOW_BUILD diff --git a/src/mainboard/amd/birman_plus/Makefile.mk b/src/mainboard/amd/birman_plus/Makefile.mk index 5ef9ed92e3..c025591115 100644 --- a/src/mainboard/amd/birman_plus/Makefile.mk +++ b/src/mainboard/amd/birman_plus/Makefile.mk @@ -20,10 +20,11 @@ show_notices:: warn_no_apcb endif ifeq ($(CONFIG_BIRMANPLUS_HAVE_MCHP_FW),y) -$(call add_intermediate, add_mchp_fw) - $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_SIG -f $(CONFIG_BIRMANPLUS_MCHP_SIG_FILE) --fill-upward - $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_BODY -f $(CONFIG_BIRMANPLUS_MCHP_FW_FILE) --fill-upward +subdirs-y += ../../../../util/mec152x +$(call add_intermediate, add_mchp_fw, $(objutil)/mec152x/mec152xtool) + $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_BODY -f $(CONFIG_BIRMANPLUS_MCHP_FW_FILE) --fill-upward + $(objutil)/mec152x/mec152xtool $(obj)/coreboot.pre GEN_ECFW_PTR -f EC_BODY else show_notices:: warn_no_mchp endif # CONFIG_BIRMAN_HAVE_MCHP_FW diff --git a/src/mainboard/amd/crater/Kconfig b/src/mainboard/amd/crater/Kconfig index 11bd6b9cf7..136d1b834c 100644 --- a/src/mainboard/amd/crater/Kconfig +++ b/src/mainboard/amd/crater/Kconfig @@ -42,14 +42,6 @@ config CRATER_HAVE_MCHP_FW bool "Have Microchip EC firmware?" default n -config CRATER_MCHP_SIG_FILE - string "Microchip EC signature file" - depends on CRATER_HAVE_MCHP_FW - help - The EC sig blob is the first 4kBytes of the firmware image. - The first 4 bytes form a pointer (with CRC) to where the EC firmware - is located - config AMD_SOC_CONSOLE_UART default y if !SOC_AMD_COMMON_BLOCK_SIMNOW_BUILD diff --git a/src/mainboard/amd/crater/Makefile.mk b/src/mainboard/amd/crater/Makefile.mk index dc169f1969..3207c59c5c 100644 --- a/src/mainboard/amd/crater/Makefile.mk +++ b/src/mainboard/amd/crater/Makefile.mk @@ -18,10 +18,11 @@ show_notices:: warn_no_apcb endif ifeq ($(CONFIG_CRATER_HAVE_MCHP_FW),y) -$(call add_intermediate, add_mchp_fw) - $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_SIG -f $(CONFIG_CRATER_MCHP_SIG_FILE) --fill-upward - $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_BODY -f $(CONFIG_CRATER_MCHP_FW_FILE) --fill-upward +subdirs-y += ../../../../util/mec152x +$(call add_intermediate, add_mchp_fw, $(objutil)/mec152x/mec152xtool) + $(CBFSTOOL) $(obj)/coreboot.pre write -r EC_BODY -f $(CONFIG_CRATER_MCHP_FW_FILE) --fill-upward + $(objutil)/mec152x/mec152xtool $(obj)/coreboot.pre GEN_ECFW_PTR -f EC_BODY else show_notices:: warn_no_mchp endif