Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83787?usp=email )
Change subject: mb/google/brox: Control HDMI Hot Plug Detect(HPD) during S0ix ......................................................................
mb/google/brox: Control HDMI Hot Plug Detect(HPD) during S0ix
HDMI is powered by SLP_S0 signal in Brox. Hence during idle suspend, HDMI display loses power and a disconnect event is detected. This causes the suspend to abort. Hence configure the HDMI HPD pad to GPIO mode and disable its RX buffer during S0ix entry and put it back to Native Function Mode during S0ix exit.
BUG=b:351307902 TEST=Build Brox firmware image and boot to OS. Perform suspend/resume cycles with an external HDMI display connected.
Change-Id: I8d95f1d5e1286896c026405ac528dcc084cfa931 Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/mainboard/google/brox/mainboard.c 1 file changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/83787/1
diff --git a/src/mainboard/google/brox/mainboard.c b/src/mainboard/google/brox/mainboard.c index 9285ae2..7ac4f24 100644 --- a/src/mainboard/google/brox/mainboard.c +++ b/src/mainboard/google/brox/mainboard.c @@ -16,6 +16,8 @@ WEAK_DEV_PTR(rp6_wwan); WEAK_DEV_PTR(dgpu);
+#define HDMI_HPD GPP_A18 + static void add_fw_config_oem_string(const struct fw_config *config, void *arg) { struct smbios_type11 *t; @@ -132,6 +134,32 @@ acpigen_emit_namestring(acpi_device_path_join(parent, "PGPR._OFF")); }
+static void mainboard_generate_hdmi_hpd_disable(void) +{ + /* Change pad mode to GPIO control - GPMO(HDMI_HPD, 0); */ + acpigen_emit_namestring("\_SB.PCI0.GPMO"); + acpigen_write_integer(HDMI_HPD); + acpigen_write_integer(0); + + /* Disable RX Buffer - GRXE(HDMI_HPD, 0); */ + acpigen_emit_namestring("\_SB.PCI0.GRXE"); + acpigen_write_integer(HDMI_HPD); + acpigen_write_integer(0); +} + +static void mainboard_generate_hdmi_hpd_enable(void) +{ + /* Enable RX Buffer - GRXE(HDMI_HPD, 1); */ + acpigen_emit_namestring("\_SB.PCI0.GRXE"); + acpigen_write_integer(HDMI_HPD); + acpigen_write_integer(1); + + /* Change pad mode to Native Function 1 - GPMO(HDMI_HPD, 1); */ + acpigen_emit_namestring("\_SB.PCI0.GPMO"); + acpigen_write_integer(HDMI_HPD); + acpigen_write_integer(1); +} + static void mainboard_generate_mpts(void) { const struct device *wwan = DEV_PTR(rp6_wwan); @@ -168,12 +196,14 @@ { if (CONFIG(HAVE_SLP_S0_GATE)) acpigen_soc_clear_tx_gpio(GPIO_SLP_S0_GATE); + mainboard_generate_hdmi_hpd_disable(); variant_generate_s0ix_hook(S0IX_ENTRY); } acpigen_write_else(); { if (CONFIG(HAVE_SLP_S0_GATE)) acpigen_soc_set_tx_gpio(GPIO_SLP_S0_GATE); + mainboard_generate_hdmi_hpd_enable(); variant_generate_s0ix_hook(S0IX_EXIT); } acpigen_write_if_end();