summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-04-29 11:50:35 -0700
committerChromeBot <chrome-bot@google.com>2013-04-30 12:40:44 -0700
commit23c8a5b7224dcc05a0793f409d16e695c04a5388 (patch)
tree08c3919b4551e1e6d0e616858298ba928c6f04f7
parentc947ec8b21339b6f40ab1691983d2c9522616f02 (diff)
downloadchrome-ec-23c8a5b7224dcc05a0793f409d16e695c04a5388.tar.gz
add option to de-activate EC console input when WP is on
With a Toad cable, the user can access the EC serial console through the micro-B connector. We probably need to de-activate the input on the EC serial console when the Write-Protect is on, since we have fairly "powerful" commands on the EC command-line. Add a new CONFIG_CONSOLE_RESTRICTED_INPUT on platforms with externally accessible EC serial port. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=spring BUG=chrome-os-partner:18716 TEST=on Spring with CONFIG_CONSOLE_RESTRICTED_INPUT set, try with and without write-protect, use successfully the EC console in the former case, and see "Console is DISABLED" in the latter case. Original-Change-Id: Ic9646d5468183f4d8f94b5e5e1d2a727941d7bbe Reviewed-on: https://gerrit.chromium.org/gerrit/49537 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 980df549794785ebadd2f4c26323e3f1bf3d3b02) Change-Id: I2c0c26eda540232f442c1d676ad311b8e29778f5 Reviewed-on: https://gerrit.chromium.org/gerrit/49637 Reviewed-by: Vic Yang <victoryang@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/console.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index f25e9ec469..e7b4564dcb 100644
--- a/common/console.c
+++ b/common/console.c
@@ -7,6 +7,7 @@
#include "console.h"
#include "link_defs.h"
+#include "system.h"
#include "task.h"
#include "uart.h"
#include "util.h"
@@ -164,6 +165,15 @@ void console_has_input(void)
void console_task(void)
{
+#ifdef CONFIG_CONSOLE_RESTRICTED_INPUT
+ /* the console is not available due to security restrictions */
+ if (system_is_locked()) {
+ ccprintf("Console is DISABLED (WP is ON).\n");
+ while (1)
+ task_wait_event(-1);
+ }
+#endif
+
console_init();
while (1) {