Jason Lowe-Power has submitted this change and it was merged. ( https://gem5-review.googlesource.com/7301 )

Change subject: dev: Fix i8042 device errors
......................................................................

dev: Fix i8042 device errors

The patch that added M5_FALLTHROUGH (5c41076bd7610 misc: Updates for gcc7.2
for x86) incorrectly added breaks to the i8042 device without implementing
the correct functions. This patch implements keyboard writes, but ignores
output writes.

Information on the PS2 controller can be found at
https://wiki.osdev.org/%228042%22_PS/2_Controller

Note: Without this patch Linux 4.14 won't boot.

Change-Id: I7de137b46cef00e6c1f1c14335cb52107cd7fe5b
Signed-off-by: Jason Lowe-Power <ja...@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/7301
Reviewed-by: Gabe Black <gabebl...@google.com>
Maintainer: Gabe Black <gabebl...@google.com>
---
M src/dev/x86/i8042.cc
1 file changed, 16 insertions(+), 3 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved



diff --git a/src/dev/x86/i8042.cc b/src/dev/x86/i8042.cc
index 279c520..c884f71 100644
--- a/src/dev/x86/i8042.cc
+++ b/src/dev/x86/i8042.cc
@@ -35,6 +35,11 @@
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"

+/**
+ * Note: For details on the implementation see
+ * https://wiki.osdev.org/%228042%22_PS/2_Controller
+ */
+
 // The 8042 has a whopping 32 bytes of internal RAM.
 const uint8_t RamSize = 32;
 const uint8_t NumOutputBits = 14;
@@ -382,6 +387,17 @@
                     "mouse output buffer\" command.\n", data);
             writeData(data, true);
             break;
+          case WriteKeyboardOutputBuff:
+            DPRINTF(I8042, "Got data %#02x for \"Write "
+                    "keyboad output buffer\" command.\n", data);
+            writeData(data, false);
+            break;
+          case WriteOutputPort:
+            DPRINTF(I8042, "Got data %#02x for \"Write "
+                    "output port\" command.\n", data);
+            panic_if(bits(data, 0) != 1, "Reset bit should be 1");
+            // Safe to ignore otherwise
+            break;
           default:
             panic("Data written for unrecognized "
                     "command %#02x\n", lastCommand);
@@ -453,12 +469,9 @@
           case ReadOutputPort:
             panic("i8042 \"Read output port\" command not implemented.\n");
           case WriteOutputPort:
-            warn("i8042 \"Write output port\" command not implemented.\n");
             lastCommand = WriteOutputPort;
             break;
           case WriteKeyboardOutputBuff:
-            warn("i8042 \"Write keyboard output buffer\" "
-                    "command not implemented.\n");
             lastCommand = WriteKeyboardOutputBuff;
             break;
           case WriteMouseOutputBuff:

--
To view, visit https://gem5-review.googlesource.com/7301
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7de137b46cef00e6c1f1c14335cb52107cd7fe5b
Gerrit-Change-Number: 7301
Gerrit-PatchSet: 7
Gerrit-Owner: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to