summaryrefslogtreecommitdiff
path: root/resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch
diff options
context:
space:
mode:
authorNicholas Chin <nic.c3.14@gmail.com>2023-04-19 22:15:06 -0600
committerNicholas Chin <nic.c3.14@gmail.com>2023-04-19 22:15:06 -0600
commit1497ae045104145de677fd151da4de6e92be4e5a (patch)
tree21d155eb6b284eb343c8a37a41400f14c3359f33 /resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch
parenteb32e4932738cb2901a5118c9e511c0191382388 (diff)
Fix GRUB handling of the E6400 keyboard
This introduces a patch to grub which disables the coreboot specific handling, allowing PS/2 keyboards to be handled the same as i386-pc. However this alone breaks the keyboard in Linux, requiring coreboot to perform PS/2 initialization. I think GRUB may be restoring the original configuration of the PS/2 controller once it exits, and if coreboot doesn't initialize the controller then it's restored to the default state which Linux doesn't seem to like. I think the emulated keyboard interface provided by the EC on the E6400 behaves in a non-standard way that is incompatible with the old coreboot specific handling.
Diffstat (limited to 'resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch')
-rw-r--r--resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch b/resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch
new file mode 100644
index 00000000..33605840
--- /dev/null
+++ b/resources/grub/patches/0005-Fix-PS-2-scancode-set-inconsistency.patch
@@ -0,0 +1,39 @@
+From 14090113f9e0fd67e46de33dad609c1406373ff0 Mon Sep 17 00:00:00 2001
+From: Nicholas Chin <nic.c3.14@gmail.com>
+Date: Wed, 19 Apr 2023 13:59:38 -0600
+Subject: [PATCH] Fix PS/2 scancode set inconsistency
+
+GRUB seems to be expecting set 2 scancodes when built as a coreboot
+payload, but PS/2 controllers outputting using set 1 will lead to an
+unusable keyboard. Disable the coreboot specific logic which hard codes
+the translated set 2 keyboard configuration and let GRUB handle
+keyboard init the same way as i386-pc, which did not have this issue.
+---
+ grub-core/term/at_keyboard.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
+index 597111077..bb251e222 100644
+--- a/grub-core/term/at_keyboard.c
++++ b/grub-core/term/at_keyboard.c
+@@ -87,7 +87,7 @@ grub_keyboard_controller_write (grub_uint8_t c)
+ grub_outb (c, KEYBOARD_REG_DATA);
+ }
+
+-#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
++#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
+ #define USE_SCANCODE_SET 1
+ #else
+ #define USE_SCANCODE_SET 0
+@@ -260,7 +260,7 @@ grub_keyboard_controller_init (void)
+ #if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
+ grub_keyboard_controller_orig = 0;
+ grub_keyboard_orig_set = 2;
+-#elif defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_COREBOOT)
++#elif defined (GRUB_MACHINE_QEMU)
+ /* *BSD relies on those settings. */
+ grub_keyboard_controller_orig = KEYBOARD_AT_TRANSLATE;
+ grub_keyboard_orig_set = 2;
+--
+2.40.0
+