Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85365?usp=email )
Change subject: mb/google/rex/var/kanix: Disable FP_MCU based on fw_config ......................................................................
mb/google/rex/var/kanix: Disable FP_MCU based on fw_config
BUG=b:377377766 TEST=emerge-rex coreboot pass
Change-Id: I087f082c051bc3a97f2514dd121b279e27738022 Signed-off-by: Tyler Wang tyler.wang@quanta.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/85365 Reviewed-by: Kapil Porwal kapilporwal@google.com Reviewed-by: YH Lin yueherngl@google.com Reviewed-by: Dinesh Gehlot digehlot@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/rex/variants/kanix/Makefile.mk A src/mainboard/google/rex/variants/kanix/fw_config.c 2 files changed, 37 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Dinesh Gehlot: Looks good to me, approved YH Lin: Looks good to me, but someone else must approve Kapil Porwal: Looks good to me, approved
diff --git a/src/mainboard/google/rex/variants/kanix/Makefile.mk b/src/mainboard/google/rex/variants/kanix/Makefile.mk index a49954c..2638540 100644 --- a/src/mainboard/google/rex/variants/kanix/Makefile.mk +++ b/src/mainboard/google/rex/variants/kanix/Makefile.mk @@ -1,7 +1,6 @@ ## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += gpio.c - romstage-y += gpio.c - +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += gpio.c diff --git a/src/mainboard/google/rex/variants/kanix/fw_config.c b/src/mainboard/google/rex/variants/kanix/fw_config.c new file mode 100644 index 0000000..23e3e3c --- /dev/null +++ b/src/mainboard/google/rex/variants/kanix/fw_config.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <baseboard/variants.h> +#include <bootstate.h> +#include <console/console.h> +#include <fw_config.h> +#include <gpio.h> + +#define GPIO_PADBASED_OVERRIDE(b, a) gpio_padbased_override(b, a, ARRAY_SIZE(a)) + +static const struct pad_config fp_disable_pads[] = { + /* GPP_B11 : [] ==> EN_FP_PWR */ + PAD_NC(GPP_B11, NONE), + /* GPP_C22 : [] ==> SOC_FP_BOOT0 */ + PAD_NC(GPP_C22, NONE), + /* GPP_C23 : [] ==> SOC_FP_RST_L */ + PAD_NC(GPP_C23, NONE), + /* GPP_E10 : [] ==> SOC_FPMCU_INT_L */ + PAD_NC(GPP_E10, NONE), + /* GPP_F11 : [] ==> GSPI1_SOC_CLK_R */ + PAD_NC(GPP_F11, NONE), + /* GPP_F12 : [] ==> GSPI1_SOC_MOSI_R */ + PAD_NC(GPP_F12, NONE), + /* GPP_F13 : [] ==> GSPI1_SOC_MISO_R */ + PAD_NC(GPP_F13, NONE), + /* GPP_F17 : [] ==> GSPI1_SOC_CS_L_R */ + PAD_NC(GPP_F17, NONE), +}; + +void fw_config_gpio_padbased_override(struct pad_config *padbased_table) +{ + if (fw_config_probe(FW_CONFIG(FP_MCU, FP_MCU_ABSENT))) { + printk(BIOS_INFO, "Configure GPIOs for no FP module.\n"); + GPIO_PADBASED_OVERRIDE(padbased_table, fp_disable_pads); + } +}