diff options
author | Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com> | 2021-10-19 15:26:54 +0900 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-10-21 01:56:58 +0000 |
commit | 0c39cd7dab5e7444c61d078968722124e1bfba48 (patch) | |
tree | 20841f3c817b08d52af0461d159e958a7816d7e5 | |
parent | a8772dbb1ba4a8204c80a8ebf066e4107a7f7f7e (diff) |
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 <sh_.kim@samsung.corp-partner.google.com>
Change-Id: I8363f8e7052ff9cfa423063a7e8f5a0f9ce1df2c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58442
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Henry Sun <henrysun@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
-rw-r--r-- | src/mainboard/google/dedede/variants/bugzzy/gpio.c | 16 | ||||
-rw-r--r-- | src/mainboard/google/dedede/variants/bugzzy/overridetree.cb | 4 |
2 files changed, 19 insertions, 1 deletions
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 <baseboard/gpio.h> #include <baseboard/variants.h> +#include <bootstate.h> +#include <fw_config.h> /* 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 |