From 0c39cd7dab5e7444c61d078968722124e1bfba48 Mon Sep 17 00:00:00 2001 From: Seunghwan Kim Date: Tue, 19 Oct 2021 15:26:54 +0900 Subject: [PATCH] mb/google/dedede/var/bugzzy: Enable/disable LTE function based on FW_CONFIG Enable/disable LTE function based on DB_PORTS field of FW_CONFIG. - GPIO control - USB port setting BUG=None BRANCH=dedede TEST=FW_NAME=bugzzy emerge-dedede coreboot Signed-off-by: Seunghwan Kim Change-Id: I8363f8e7052ff9cfa423063a7e8f5a0f9ce1df2c Reviewed-on: https://review.coreboot.org/c/coreboot/+/58442 Tested-by: build bot (Jenkins) Reviewed-by: Henry Sun Reviewed-by: Karthik Ramasubramanian --- .../google/dedede/variants/bugzzy/gpio.c | 16 ++++++++++++++++ .../dedede/variants/bugzzy/overridetree.cb | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/dedede/variants/bugzzy/gpio.c b/src/mainboard/google/dedede/variants/bugzzy/gpio.c index d089162db3..a218c5ee5a 100644 --- a/src/mainboard/google/dedede/variants/bugzzy/gpio.c +++ b/src/mainboard/google/dedede/variants/bugzzy/gpio.c @@ -2,6 +2,8 @@ #include #include +#include +#include /* Pad configuration in ramstage*/ static const struct pad_config gpio_table[] = { @@ -53,8 +55,22 @@ static const struct pad_config gpio_table[] = { PAD_CFG_GPO(GPP_H17, 0, PLTRST), }; +static const struct pad_config lte_disable_pads[] = { + PAD_NC(GPP_A10, NONE), + PAD_NC(GPP_D0, NONE), + PAD_NC(GPP_H17, NONE), +}; + const struct pad_config *variant_override_gpio_table(size_t *num) { *num = ARRAY_SIZE(gpio_table); return gpio_table; } + +static void fw_config_handle(void *unused) +{ + if (!fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1C_1A_LTE))) + gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads)); +} + +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); diff --git a/src/mainboard/google/dedede/variants/bugzzy/overridetree.cb b/src/mainboard/google/dedede/variants/bugzzy/overridetree.cb index 92a0497189..453d8c3f52 100644 --- a/src/mainboard/google/dedede/variants/bugzzy/overridetree.cb +++ b/src/mainboard/google/dedede/variants/bugzzy/overridetree.cb @@ -155,7 +155,9 @@ chip soc/intel/jasperlake register "reset_off_delay_ms" = "20" register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A10)" register "enable_delay_ms" = "20" - device usb 3.3 on end + device usb 3.3 on + probe DB_PORTS DB_PORTS_1C_1A_LTE + end end end end