summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian J. Nemec <bnemec@chromium.org>2019-10-25 11:54:22 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-07 22:21:27 +0000
commitdc38d9bbb22f826b8122d371b74e7f338dc3aba4 (patch)
tree73d457f22e7d4cc7aeaad0b2a78335397289f642
parente18c87761b40ef1aabc6d7c0fda3fd1c64f343f4 (diff)
downloadchrome-ec-2.4.0.tar.gz
servo: Adds logging of panic info to USB consolev2.4.0
There is a console command to log the panic info data to the UART console. This change modifies it so after printing data to UART, it will also pass it to the USB console so the data can be easily logged by servod. BUG=chromium:1018008 BRANCH=servo TEST=Manual testing on Sweetberry, ServoV4, and ServoMicro 1) Unplug device to clean panic info, plug device in to USB 2) Request 'panicinfo' from the console interface 3) Response 'No saved panic data available.' 4) Trigger crash using commands like 'sysjump 0x100' or 'crash assert' 5) Reconnect console 6) Request 'panicinfo'. Fault registers are returned over USB console and UART console. The values match the correct addresses which is easily verified in the sysjump case. Change-Id: I5b0bb102296f5fcc967519bb3a59af49644e6f4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1880579 Tested-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> (cherry picked from commit 27220c0776a906201d5c49a244b56508643c03b0) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2044708 Reviewed-by: Brian Nemec <bnemec@google.com> Commit-Queue: Brian Nemec <bnemec@google.com> Tested-by: Brian Nemec <bnemec@google.com>
-rw-r--r--common/panic_output.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/panic_output.c b/common/panic_output.c
index 4c70b06679..1e8a602bd3 100644
--- a/common/panic_output.c
+++ b/common/panic_output.c
@@ -15,6 +15,7 @@
#include "task.h"
#include "timer.h"
#include "uart.h"
+#include "usb_console.h"
#include "util.h"
/* Panic data goes at the end of RAM. */
@@ -89,7 +90,13 @@ void panic_printf(const char *format, ...)
uart_flush_output();
va_start(args, format);
+ /* Send the message to the UART console */
vfnprintf(panic_txchar, NULL, format, args);
+#if defined(CONFIG_USB_CONSOLE) || defined(CONFIG_USB_CONSOLE_STREAM)
+ /* Send the message to the USB console on platforms which support it. */
+ usb_vprintf(format, args);
+#endif
+
va_end(args);
/* Flush the transmit FIFO */