summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.console
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-02-10 16:00:04 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-11 17:19:50 +0000
commit0a36c06ebe9a055b16d3ef6ad46d820cc48f1610 (patch)
tree3cca7cc3e23db624b6b3094ea0e153ff72252862 /zephyr/Kconfig.console
parent5122c6cc12153f848e9b3d4f5aab4ed72dc64e70 (diff)
downloadchrome-ec-0a36c06ebe9a055b16d3ef6ad46d820cc48f1610.tar.gz
zephyr: implement console read/snapshot host commands
Implement an optional console output buffer, and wire it up to the associated host commands. We don't use the EC's uart buffering module for this, as it implements a UART buffer which also is used for transmit buffering (we don't do that, and instead immediately send to printk). We don't use Zephyr's ring buffer structure for this as we need to track multiple heads due to the semantics of snapshots. BUG=b:178033156 BRANCH=none TEST="ectool console" on volteer Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib1d39e32e8bad5b23b98034c33f56534a8c89fcb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685412 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.console')
-rw-r--r--zephyr/Kconfig.console26
1 files changed, 26 insertions, 0 deletions
diff --git a/zephyr/Kconfig.console b/zephyr/Kconfig.console
new file mode 100644
index 0000000000..bdc1dda448
--- /dev/null
+++ b/zephyr/Kconfig.console
@@ -0,0 +1,26 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+menuconfig PLATFORM_EC_HOSTCMD_CONSOLE
+ bool "Console Host Command"
+ depends on PLATFORM_EC_HOSTCMD
+ default y
+ help
+ Enable the EC_CMD_CONSOLE_SNAPSHOT and EC_CMD_CONSOLE_READ
+ host commands, used for reading the EC console from the AP.
+
+if PLATFORM_EC_HOSTCMD_CONSOLE
+
+config PLATFORM_EC_HOSTCMD_CONSOLE_BUF_SIZE
+ int "Console buffer size"
+ default 8192
+ help
+ The EC will use a circular buffer to store bytes outputted
+ to the console for the AP to read. This changes the maximal
+ number of bytes from the console output which can be saved.
+
+ Choosing a power-of-two for this value is optimal, as
+ modular arithmetic is used.
+
+endif # PLATFORM_EC_HOSTCMD_CONSOLE