term/at_keyboard: Add timeout to fix hang on HP EliteBooks
This fixes the GRUB on Coreboot on HP EliteBooks by implementing a 200 ms timeout. The GRUB used to hang. Fixes: https://ticket.coreboot.org/issues/141 Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
e67a551a48
commit
830456a6e3
@ -40,9 +40,19 @@ grub_keyboard_controller_init (void);
|
||||
static void
|
||||
keyboard_controller_wait_until_ready (void)
|
||||
{
|
||||
unsigned int i = 200;
|
||||
|
||||
/* 50 us would be enough but our current time resolution is 1ms. */
|
||||
grub_millisleep (1);
|
||||
while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)));
|
||||
|
||||
while (!KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
|
||||
{
|
||||
grub_millisleep (1);
|
||||
|
||||
/* Timeout. */
|
||||
if (!i--)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static grub_uint8_t
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user