diff options
author | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-04-18 13:53:37 +0800 |
---|---|---|
committer | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-04-18 13:57:11 +0800 |
commit | a77d59b19aeef8ba56739be5656608111cc58283 (patch) | |
tree | 42f34c452c0c557eb5ceda02fd9ecb6798a6f4d5 /common/keyboard.c | |
parent | 755a767c2bac52522595ceb9fec5e651244d0449 (diff) | |
download | chrome-ec-a77d59b19aeef8ba56739be5656608111cc58283.tar.gz |
Fixe the bug in keyboard state restore.
For legacy issue, the keyboard controller defaults to turn on XLATE
(translate) bit (which means EC generates scan codeset 1 althought
it internally supports codeset 2). In normal case, the BIOS/OS would clear
the XLATE bit to ask EC to generate codeset 2.
However, when EC jumps happens, the internal keyboard state doesn't know
this and always reset XLATE as on. This makes the EC generate garbage to OS.
So, this patch fixes would clear the XLATE if the EC reboot is a warmboot
based on the assumption that moderm OSes clear the XLATE bit.
BUG=chrome-os-partner:9102
TEST=on link
% ectool reboot_ec A (from r438 to r438)
Expect keyboard is hang (r438 is still buggy)
% chromeos-firmwareupdater --mode=recovery
Expect fail at gec_need_2nd_pass()
% ectool reboot_ec RO
Keyboard is still working! Bug fixed!
% ectool reboot_ec RO
Again. Still working.
Change-Id: If47bd8d7bbbb03b810d3b464ba3d92f8ff548237
Diffstat (limited to 'common/keyboard.c')
-rw-r--r-- | common/keyboard.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/keyboard.c b/common/keyboard.c index 84d1a64d81..183cae329b 100644 --- a/common/keyboard.c +++ b/common/keyboard.c @@ -805,12 +805,13 @@ DECLARE_CONSOLE_COMMAND(kbpress, command_keyboard_press); int keyboard_init(void) { /* If the host is still alive during the EC resets (ex. reboot_ec), - * we should enable keyboard so that the user can type. */ + * we should restore keyboard states so that the user can type. */ enum system_reset_cause_t reset_cause = system_get_reset_cause(); if (reset_cause == SYSTEM_RESET_SOFT_WARM || reset_cause == SYSTEM_RESET_WATCHDOG || reset_cause == SYSTEM_RESET_SOFT_COLD ) { i8042_enable_keyboard_irq(); + controller_ram[0] &= ~I8042_XLATE; } return 0; |