summaryrefslogtreecommitdiff
path: root/resources/grub
diff options
context:
space:
mode:
authorRiku Viitanen <riku.viitanen@protonmail.com>2023-04-21 22:04:18 +0300
committerLeah Rowe <leah@libreboot.org>2023-04-21 20:32:46 +0100
commit5657c7d05b0b15dd01866999c9c868f8725b19a0 (patch)
treeba4607c00ac03914212bdf915272bd9fbfe02ca2 /resources/grub
parent560642c585b991a24d626227ff9a6956f74477df (diff)
Add HP EliteBook 2560p
Diffstat (limited to 'resources/grub')
-rw-r--r--resources/grub/patches/0005-at-keyboard-timeout.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/resources/grub/patches/0005-at-keyboard-timeout.patch b/resources/grub/patches/0005-at-keyboard-timeout.patch
new file mode 100644
index 00000000..bdc2955c
--- /dev/null
+++ b/resources/grub/patches/0005-at-keyboard-timeout.patch
@@ -0,0 +1,36 @@
+From 674002256247a01f4969a3795a5aceca68792a55 Mon Sep 17 00:00:00 2001
+From: Riku Viitanen <riku.viitanen@protonmail.com>
+Date: Fri, 21 Apr 2023 21:41:07 +0300
+Subject: [PATCH] at_keyboard.c: add timeout to fix hang on hp elitebooks
+
+This fixes GRUB on Coreboot on HP EliteBooks by implementing
+a 200ms timeout. GRUB used to hang. see: https://ticket.coreboot.org/issues/141
+---
+ grub-core/term/at_keyboard.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
+index 597111077..28d1d0a77 100644
+--- a/grub-core/term/at_keyboard.c
++++ b/grub-core/term/at_keyboard.c
+@@ -42,7 +42,16 @@ keyboard_controller_wait_until_ready (void)
+ {
+ /* 50 us would be enough but our current time resolution is 1ms. */
+ grub_millisleep (1);
+- while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)));
++
++ unsigned i = 200;
++ while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) {
++ grub_millisleep (1);
++
++ /* Timeout */
++ if (! i--) {
++ break;
++ }
++ }
+ }
+
+ static grub_uint8_t
+--
+2.40.0
+