John Su has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86255?usp=email )
Change subject: mb/google/trulo/var/uldrenite: Add fw_config probe for Cellular ......................................................................
mb/google/trulo/var/uldrenite: Add fw_config probe for Cellular
Use fw_config to probe Cellular.
BUG=b:392040004 BRANCH=firmware-trulo-15217.771.B TEST=emerge-nissa coreboot chromeos-bootimage
Change-Id: Ib664f543c6012b44a0a604d0943416519d92a057 Signed-off-by: John Su john_su@compal.corp-partner.google.com --- M src/mainboard/google/brya/variants/uldrenite/overridetree.cb M src/mainboard/google/brya/variants/uldrenite/variant.c 2 files changed, 32 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/86255/1
diff --git a/src/mainboard/google/brya/variants/uldrenite/overridetree.cb b/src/mainboard/google/brya/variants/uldrenite/overridetree.cb index 3c06750..82ebc72 100644 --- a/src/mainboard/google/brya/variants/uldrenite/overridetree.cb +++ b/src/mainboard/google/brya/variants/uldrenite/overridetree.cb @@ -1,4 +1,8 @@ fw_config + field DB_Cellular 1 2 + option Cellular_ABSENT 0 + option Cellular_RW350R 1 + end field TOUCHSCREEN 4 4 option TOUCHSCREEN_UNKNOWN 0 option TOUCHSCREEN_NONE 1 diff --git a/src/mainboard/google/brya/variants/uldrenite/variant.c b/src/mainboard/google/brya/variants/uldrenite/variant.c index 96b2291..cb01f82 100644 --- a/src/mainboard/google/brya/variants/uldrenite/variant.c +++ b/src/mainboard/google/brya/variants/uldrenite/variant.c @@ -37,6 +37,17 @@ PAD_NC(GPP_E17, NONE), };
+static const struct pad_config lte_disable_pads[] = { + /* A8 : WWAN_RF_DISABLE_ODL */ + PAD_NC(GPP_A8, NONE), + /* F12 : WWAN_RST_L */ + PAD_NC_LOCK(GPP_F12, NONE, LOCK_CONFIG), + /* F13 : PLTRST_WWAN# */ + PAD_NC(GPP_F13, NONE), + /* H23 : WWAN_EN */ + PAD_NC(GPP_H23, NONE), +}; + void fw_config_gpio_padbased_override(struct pad_config *padbased_table) { if (fw_config_probe(FW_CONFIG(TOUCHSCREEN, TOUCHSCREEN_NONE))) { @@ -44,18 +55,25 @@ gpio_padbased_override(padbased_table, touchscreen_disable_pads, ARRAY_SIZE(touchscreen_disable_pads)); } + if (fw_config_probe(FW_CONFIG(DB_Cellular, Cellular_ABSENT))) { + printk(BIOS_INFO, "Disable Cellular GPIO pins.\n"); + gpio_padbased_override(padbased_table, lte_disable_pads, + ARRAY_SIZE(lte_disable_pads)); + } }
void variant_init(void) { - /* - * RW350R power on seuqence: - * De-assert WWAN_EN -> 20ms -> de-assert WWAN_RST -> 30ms -> - * de-assert WWAN_PERST - */ - gpio_configure_pads(rw350r_en_pad, ARRAY_SIZE(rw350r_en_pad)); - mdelay(RW350R_RST_DELAY_MS); - gpio_configure_pads(rw350r_rst_pad, ARRAY_SIZE(rw350r_rst_pad)); - mdelay(RW350R_PERST_DELAY_MS); - gpio_configure_pads(rw350r_perst_pad, ARRAY_SIZE(rw350r_perst_pad)); + if (fw_config_probe(FW_CONFIG(DB_Cellular, Cellular_RW350R))) { + /* + * RW350R power on seuqence: + * De-assert WWAN_EN -> 20ms -> de-assert WWAN_RST -> 30ms -> + * de-assert WWAN_PERST + */ + gpio_configure_pads(rw350r_en_pad, ARRAY_SIZE(rw350r_en_pad)); + mdelay(RW350R_RST_DELAY_MS); + gpio_configure_pads(rw350r_rst_pad, ARRAY_SIZE(rw350r_rst_pad)); + mdelay(RW350R_PERST_DELAY_MS); + gpio_configure_pads(rw350r_perst_pad, ARRAY_SIZE(rw350r_perst_pad)); + } }