Add PS2_KEYBOARD_SPINUP option to give certain keyboards more time to
initialize.
Based on report and feedback from: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
default y
help
Support PS2 ports (keyboard and mouse).
+ config PS2_KEYBOARD_SPINUP
+ depends on PS2PORT
+ int "Extra time (in ms) to allow a keyboard to initialize"
+ default 0
+ help
+ Some PS2 keyboards don't respond to commands immediately
+ after powering on. Specify a positive value here to allow
+ additional time for the keyboard to become responsive.
config USB
bool "USB"
/* ------------------- keyboard side ------------------------*/
/* reset keyboard and self test (keyboard side) */
- ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);
- if (ret)
- return;
+ u64 end = calc_future_tsc(CONFIG_PS2_KEYBOARD_SPINUP);
+ for (;;) {
+ ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);
+ if (!ret)
+ break;
+ if (check_tsc(end)) {
+ if (CONFIG_PS2_KEYBOARD_SPINUP)
+ warn_timeout();
+ return;
+ }
+ yield();
+ }
if (param[0] != 0xaa) {
dprintf(1, "keyboard self test failed (got %x not 0xaa)\n", param[0]);
return;