Project

General

Profile

Actions

Support #515

open

CONFIG_DRIVERS_PS2_KEYBOARD=y doesn't fixate detected keyboard to AT Translated 2 between cold/warm boot

Added by Thierry Laurion about 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
11/20/2023
Due date:
% Done:

0%

Estimated time:
Affected versions:
Needs backport to:
Affected hardware:
Affected OS:

Description

This is a long term issue under QubesOS for x230t/x220t and now x230 users as an be seen https://github.com/QubesOS/qubes-issues/issues/3306

The reason is unclear since it is not a generalized behavior.
Is it because of EC firmware version variation, keyboard SKU?
User reports don't clarify this enough.

What is known (Heads linux payload of coreboot here).
If coreboot doesn't do anything for ps2 keyboard, linux does what it can to initialize ps2 and then determine mode of comms, which varies across cold boot/warm boot and sometimes falls back to Raw 2 Translated, which OSes behavior for keyboard cause issues with Backspace, | and \ keys.

This is short version of https://github.com/QubesOS/qubes-issues/issues/3306


cbmem -1 filtered output:

Coldboot with/without CONFIG_DRIVERS_PS2_KEYBOARD=y
not normal

Warm boot:
normal


When applying ugly hack on pc80 coreboot driver:

coldboot issue resolved by removing exit 0 from patch above:
signal-2023-11-18-05-49-02-251-1.jpg

So it seems that we could force AT Translated 2 for keyboards that need it.

Linux i8042.debug output given by user under https://github.com/linuxboot/heads/pull/1525 (i8042.notimeout, i8042.debug andcoreboot CONFIG_DRIVERS_PS2_KEYBOARD=y on):


Other solutions attempted:

  • Forcing coreboot-> linux i8042 options through COMMAND_LINE without success: i8042.translate=1:kbd, i8042.reset + i8042.notimeout and others without success. Coldboot still shows Raw Translated 2

Other possibilities suggested by chat:

  • adapt pc80 or borrow fixes from libpayload/unifying pc80 code.
Actions #1

Updated by Thierry Laurion about 1 year ago

Analysis of i8042 debug output from https://github.com/linuxboot/heads/pull/1525#issuecomment-1816501783 (copy paste)

  • In the "fail" debug output, the command byte that is read from the i8042 controller is 0x20, which means that the bit 6 is 0 and the translation mode is disabled. In the "success" debug output, the command byte that is read from the i8042 controller is 0x65, which means that the bit 6 is 1 and the translation mode is enabled. This is the main difference that affects the keyboard detection.
  • In the "fail" debug output, the keyboard identification code that is returned by the keyboard after the 0xf2 command is 0xab 0x84, which means that the keyboard is using the AT Raw Set 2 protocol. In the"success" debug output, the keyboard identification code that is returned by the keyboard after the 0xf2 command is 0xab 0x54, which means that the keyboard is using the AT Translated Set 2 protocol. This is the result of the translation mode being enabled or disabled.
  • In the "failed" debug output, the input device name that is created by the i8042 driver for the keyboard is AT Raw Set 2 keyboard, which means that the keyboard is using the raw protocol and not the standard input event interface. In the "success" debug output, the input device name that is created by the i8042 driver for the keyboard is AT Translated Set 2 keyboard, which means that the keyboard is using the translated protocol and the standard input event interface. This is the consequence of the keyboard identification code being different.
Actions

Also available in: Atom PDF