From e8450f78a02cf586b0fa453dcfa4d802d637ad9d Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 14 May 2025 14:54:03 +0000 Subject: [PATCH] mb/google/bluey: Make GPIO setups conditional on Kconfig options The `EC_GOOGLE_CHROMEEC_SPI_BUS` Kconfig and the `GPIO_AP_EC_INT` setup in `chromeos.c` are now dependent on `EC_GOOGLE_CHROMEEC`. Similarly, the `MAINBOARD_GPIO_PIN_FOR_GSC_AP_INTERRUPT` Kconfig and the `GPIO_GSC_AP_INT` setup are now dependent on `TPM_GOOGLE_TI50`. This ensures that GPIOs are only configured if their respective features are enabled, preventing potential issues when they are disabled. BUG=b:404985109 TEST=Able to build google/bluey. Change-Id: I44525dd008c42c42aa7e5c4a4f290b09312ed269 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/87674 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/mainboard/google/bluey/Kconfig | 2 ++ src/mainboard/google/bluey/chromeos.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/bluey/Kconfig b/src/mainboard/google/bluey/Kconfig index 87cefb5483..f1e2648af6 100644 --- a/src/mainboard/google/bluey/Kconfig +++ b/src/mainboard/google/bluey/Kconfig @@ -83,10 +83,12 @@ config DRIVER_TPM_I2C_ADDR default 0x50 config EC_GOOGLE_CHROMEEC_SPI_BUS + depends on EC_GOOGLE_CHROMEEC hex default 0xb config MAINBOARD_GPIO_PIN_FOR_GSC_AP_INTERRUPT + depends on TPM_GOOGLE_TI50 int default 34 help diff --git a/src/mainboard/google/bluey/chromeos.c b/src/mainboard/google/bluey/chromeos.c index 5dc73153b4..0f2b7da21f 100644 --- a/src/mainboard/google/bluey/chromeos.c +++ b/src/mainboard/google/bluey/chromeos.c @@ -7,9 +7,11 @@ void setup_chromeos_gpios(void) { - gpio_input_pullup(GPIO_AP_EC_INT); + if (CONFIG(EC_GOOGLE_CHROMEEC)) + gpio_input_pullup(GPIO_AP_EC_INT); - gpio_input_irq(GPIO_GSC_AP_INT, IRQ_TYPE_RISING_EDGE, GPIO_PULL_UP); + if (CONFIG(TPM_GOOGLE_TI50)) + gpio_input_irq(GPIO_GSC_AP_INT, IRQ_TYPE_RISING_EDGE, GPIO_PULL_UP); if (CONFIG(MAINBOARD_HAS_FINGERPRINT)) { gpio_output(GPIO_FP_RST_L, 0); @@ -28,10 +30,14 @@ void fill_lb_gpios(struct lb_gpios *gpios) { /* TODO: Add required GPIO after referring to the schematics */ const struct lb_gpio chromeos_gpios[] = { +#if CONFIG(EC_GOOGLE_CHROMEEC) {GPIO_AP_EC_INT.addr, ACTIVE_LOW, gpio_get(GPIO_AP_EC_INT), "EC interrupt"}, +#endif +#if CONFIG(TPM_GOOGLE_TI50) {GPIO_GSC_AP_INT.addr, ACTIVE_HIGH, gpio_get(GPIO_GSC_AP_INT), "TPM interrupt"}, +#endif {GPIO_SNDW_AMP_0_ENABLE.addr, ACTIVE_HIGH, gpio_get(GPIO_SNDW_AMP_0_ENABLE), "Speaker 0 enable"}, {GPIO_SNDW_AMP_1_ENABLE.addr, ACTIVE_HIGH, gpio_get(GPIO_SNDW_AMP_1_ENABLE),