stm32: Implement keyscan test infrastructure

Support the keyscan test functionality on stm32.

Note: This is enabled by default so that it continues to build. But it
is unlikely that we will want this in a shipping image. I suggest we add
the facility for a dev build.

Secondly, the stack has to be larger due to a printf (which admittedly I
could just remove). Should we make the stack size conditional on the
CONFIG? Seems a bit ugly, on the other hand we don't want to waste IRAM.

BUG=chrome-os-partner:12179
BRANCH=none
TEST=manual for now:
On snow:
./ectool keyscan 20000 key_sequence.txt

See that the test passes.

Change-Id: Ic441ca0bde1be9589a924374605e2f146d16f423
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35118
6 files changed