From b3776e23a7748a8e350f83af4877544a1cf20e4f Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 30 May 2025 21:03:50 +0530 Subject: [PATCH] ec/google/chromeec: Add SPI/I2C EC communication files to bootblock This commit updates `ec/google/chromeec/Makefile.mk` to properly include source files for SPI and I2C Embedded Controller (EC) communication in the bootblock. Previously, essential APIs (e.g., `google_chromeec_command` and `crosec_command_proto`) were missing during EC code compilation in the bootblock, leading to linker errors. This patch resolves these compilation issues by ensuring: * `ec_spi.c` is included when `CONFIG_EC_GOOGLE_CHROMEEC_SPI` is enabled. * `ec_i2c.c` is included when `CONFIG_EC_GOOGLE_CHROMEEC_I2C` is enabled. * `crosec_proto.c` is included if either `CONFIG_EC_GOOGLE_CHROMEEC_SPI` or `CONFIG_EC_GOOGLE_CHROMEEC_I2C` is enabled. This ensures all required EC communication components are part of the bootblock, allowing systems like `google/quenbi` that use the SPI EC interface to build successfully. Change-Id: I1d05f582a1685503118797e1788c9bc2ac191168 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/87904 Reviewed-by: Caveh Jalali Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/ec/google/chromeec/Makefile.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ec/google/chromeec/Makefile.mk b/src/ec/google/chromeec/Makefile.mk index 54d404003e..10b6203e5d 100644 --- a/src/ec/google/chromeec/Makefile.mk +++ b/src/ec/google/chromeec/Makefile.mk @@ -21,7 +21,12 @@ ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SMBIOS) += ec_smbios.c endif bootblock-y += ec.c +bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c +bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_SPI) += ec_spi.c +ifeq ($(CONFIG_EC_GOOGLE_CHROMEEC_SPI)$(CONFIG_EC_GOOGLE_CHROMEEC_I2C),y) +bootblock-y += crosec_proto.c +endif ramstage-y += ec.c crosec_proto.c vstore.c usbc_mux.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c