summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2022-09-16 09:38:08 +0100
committerAngel Pons <th3fanbus@gmail.com>2022-10-15 22:34:06 +0000
commitbed947368cf196c4e0452b5214d5528f47789995 (patch)
tree118e2d78b685abd12adc33af9ca4db3deeccf40f
parentd9ef02ce1d26767c3ddc36499223a91d77962bbb (diff)
mb/starlabs/lite: Reset XHCI before entering S5
Reset the XHCI controller prior to S5 to avoid XHCI preventing shutdown. Linux needs to put the XHCI into D3 before shutting down but the powerstate commands do not perform a reset. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I3be70443eb85a7dff8055c9de0ca2fd89f4fc88d Reviewed-on: https://review.coreboot.org/c/coreboot/+/67678 Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/starlabs/lite/smihandler.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mainboard/starlabs/lite/smihandler.c b/src/mainboard/starlabs/lite/smihandler.c
new file mode 100644
index 0000000000..75e84c76e2
--- /dev/null
+++ b/src/mainboard/starlabs/lite/smihandler.c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <acpi/acpi.h>
+#include <cpu/x86/smm.h>
+#include <intelblocks/xhci.h>
+
+void mainboard_smi_sleep(u8 slp_typ)
+{
+ /*
+ * Workaround: Reset the XHCI controller prior to S5 to avoid
+ * XHCI preventing shutdown. Linux needs to put the XHCI into D3
+ * before shutting down but the powerstate commands do not
+ * perform a reset.
+ */
+ if (slp_typ == ACPI_S5)
+ xhci_host_reset();
+}