mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-05 14:31:31 +00:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user