summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2023-02-02 17:28:32 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-16 18:47:43 +0000
commit2b46c0135d4e7c51bf648da476c442d8e6398b8b (patch)
tree49d8aac9f72e823555022547a38aba9714482913 /power
parent35159ec25d0dbb7b4dad8bb11d97808c5a016be0 (diff)
downloadchrome-ec-2b46c0135d4e7c51bf648da476c442d8e6398b8b.tar.gz
power/amd_x86: Add support for STB dumping
Skyrim supports dumping the contents of the SoCs smart-trace buffer when triggered externally. The contents of the STB can be useful in debugging S0i3 suspend failures. Add support for triggering an STB dump when the SoC hangs during S0i3 entry/exit. BRANCH=none BUG=b:246770811 TEST=Ran on skyrim DUT Change-Id: Ie18c6072a77f6dd306a46d7f76bd345b4f9e75a7 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4220248 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/amd_x86.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/power/amd_x86.c b/power/amd_x86.c
index 7a215a3e21..7b77508429 100644
--- a/power/amd_x86.c
+++ b/power/amd_x86.c
@@ -8,6 +8,7 @@
#include "chipset.h"
#include "common.h"
#include "console.h"
+#include "driver/amd_stb.h"
#include "ec_commands.h"
#include "gpio.h"
#include "hooks.h"
@@ -74,6 +75,12 @@ void chipset_reset(enum chipset_shutdown_reason reason)
return;
}
+ if (IS_ENABLED(CONFIG_PLATFORM_EC_AMD_STB_DUMP) &&
+ amd_stb_dump_in_progress()) {
+ CPRINTS("STB dump still in progress during reset");
+ amd_stb_dump_finish();
+ }
+
report_ap_reset(reason);
/*
* Send a pulse to SYS_RST to trigger a warm reset.
@@ -269,6 +276,9 @@ __override void power_chipset_handle_sleep_hang(enum sleep_hang_type hang_type)
lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, sleep_wake_mask);
}
+ if (IS_ENABLED(CONFIG_PLATFORM_EC_AMD_STB_DUMP))
+ amd_stb_dump_trigger();
+
CPRINTS("Warning: Detected sleep hang! Waking host up!");
host_set_single_event(EC_HOST_EVENT_HANG_DETECT);
}