From 02059c2250a658ee04c19b22b7fe856140f7a048 Mon Sep 17 00:00:00 2001 From: Luca Lai Date: Tue, 30 Sep 2025 13:51:59 +0800 Subject: [PATCH] mb/google/trulo/var/pujjoquince: Disable ISH gpio setting by fw_config Because we use dummy ish in pujjoquince, so disable ish related gpio when fw_config TABLET_MODE=TABLET_MODE_DISABLE BUG=b:432649211 TEST=Build and boot to OS, check pujjoquince ish related gpio are closed. Change-Id: Iab43f6d4ce3a6d31358ac0b902535ee3f5dad1e3 Signed-off-by: Luca Lai Reviewed-on: https://review.coreboot.org/c/coreboot/+/89378 Tested-by: build bot (Jenkins) Reviewed-by: Derek Huang Reviewed-by: Kapil Porwal --- .../google/brya/variants/pujjolo/Makefile.mk | 1 + .../google/brya/variants/pujjolo/fw_config.c | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/mainboard/google/brya/variants/pujjolo/fw_config.c diff --git a/src/mainboard/google/brya/variants/pujjolo/Makefile.mk b/src/mainboard/google/brya/variants/pujjolo/Makefile.mk index 4a6700c6ec..d57029b334 100644 --- a/src/mainboard/google/brya/variants/pujjolo/Makefile.mk +++ b/src/mainboard/google/brya/variants/pujjolo/Makefile.mk @@ -8,3 +8,4 @@ ramstage-y += gpio.c ramstage-y += variant.c ramstage-y += ramstage.c ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) += hda_verb.c +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c diff --git a/src/mainboard/google/brya/variants/pujjolo/fw_config.c b/src/mainboard/google/brya/variants/pujjolo/fw_config.c new file mode 100644 index 0000000000..02e159d14d --- /dev/null +++ b/src/mainboard/google/brya/variants/pujjolo/fw_config.c @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include +#include +#include + +static const struct pad_config ish_disable_pads[] = { + /* B3 : ISH_IMU_INT_L */ + PAD_NC_LOCK(GPP_B3, NONE, LOCK_CONFIG), + /* B4 : ISH_ACC_INT_L */ + PAD_NC_LOCK(GPP_B4, NONE, LOCK_CONFIG), + /* B5 : EC_I2C_SENSOR_SDA_SOC */ + PAD_NC_LOCK(GPP_B5, NONE, LOCK_CONFIG), + /* B6 : EC_I2C_SENSOR_SCL_SOC */ + PAD_NC_LOCK(GPP_B6, NONE, LOCK_CONFIG), +}; + +void fw_config_gpio_padbased_override(struct pad_config *padbased_table) +{ + if (fw_config_probe(FW_CONFIG(TABLET_MODE, TABLET_MODE_DISABLE))) { + printk(BIOS_INFO, "Disable ISH-related GPIO pins.\n"); + gpio_padbased_override(padbased_table, ish_disable_pads, + ARRAY_SIZE(ish_disable_pads)); + } +}