Cr50: Enable restricted console commands

This enables restricted console commands, meaning that only the
"help" command would be available when the Cr50 console is locked.

To get out of (or into) the locked state, this also adds a "lock"
command. Of course, it will be available in locked mode.

For now, the lock state is disabled, so all commands continue to
work as before. Even after enabling the lock, it's trivial to
disable it again. Future CLs will build on this framework.

BUG=chrome-os-partner:55322,chrome-os-partner:55510
BRANCH=none
TEST=make buildall, test on Cr50 hardware

Try these commands:

  lock
  help
  gpioget
  lock enable
  help
  gpioget
  lock disable
  help
  gpioget

Change-Id: I42c9bd63e17612dcff78c9f45054e53d96adcd5b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/376187
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2 files changed