diff options
author | Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com> | 2021-05-11 17:50:42 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-05-18 10:03:59 +0000 |
commit | 1e0f77fa03f286d49fbbdfaa51f6f9e2b253b737 (patch) | |
tree | e08e86691b04c6ebc6c23c197be3fe126296fbc0 /src/mainboard/google/dedede/variants | |
parent | 2b97ea153a4f7fa0d495d65c9c1f8e84896ee586 (diff) |
mb/google/dedede/var/cret: Enable/disable LTE function based on FW_CONFIG
Enable/disable LTE function based on LTE bit of FW_CONFIG.
The LTE function settings are included GPIO settings, USB port settings and
power off sequence.
BUG=b:187797408
BRANCH=dedede
TEST=Build and test the change on cret.
Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Change-Id: Ib926e99aaf9df433a7cff71180ee55431d69f718
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54057
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/mainboard/google/dedede/variants')
3 files changed, 25 insertions, 2 deletions
diff --git a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb index f33995c66b..954e573f85 100644 --- a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb @@ -17,6 +17,10 @@ fw_config option RT1015_I2C 2 option RT1015P_AUTO 3 end + field LTE 11 + option LTE_ABSENT 0 + option LTE_PRESENT 1 + end end chip soc/intel/jasperlake diff --git a/src/mainboard/google/dedede/variants/cret/gpio.c b/src/mainboard/google/dedede/variants/cret/gpio.c index 3dd15efaa8..5acef69648 100644 --- a/src/mainboard/google/dedede/variants/cret/gpio.c +++ b/src/mainboard/google/dedede/variants/cret/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 override_gpio_table[] = { @@ -59,8 +61,21 @@ static const struct pad_config override_gpio_table[] = { PAD_NC(GPP_G7, NONE), }; +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(override_gpio_table); return override_gpio_table; } + +static void fw_config_handle(void *unused) +{ + if (!fw_config_probe(FW_CONFIG(LTE, LTE_PRESENT))) + 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/cret/overridetree.cb b/src/mainboard/google/dedede/variants/cret/overridetree.cb index 512a956f59..258632204b 100644 --- a/src/mainboard/google/dedede/variants/cret/overridetree.cb +++ b/src/mainboard/google/dedede/variants/cret/overridetree.cb @@ -57,7 +57,9 @@ chip soc/intel/jasperlake chip drivers/usb/acpi register "desc" = ""LTE"" register "type" = "UPC_TYPE_INTERNAL" - device usb 2.3 on end + device usb 2.3 on + probe LTE LTE_PRESENT + end end chip drivers/usb/acpi register "desc" = ""Camera (UFC)"" @@ -82,7 +84,9 @@ chip soc/intel/jasperlake 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 LTE LTE_PRESENT + end end end end |