ps2: Implement the keyboard reset command
authorAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 9 Apr 2018 22:16:13 +0000 (22:16 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 17 Apr 2018 11:16:26 +0000 (11:16 +0000)
Linux tries to reset the PS/2 keyboard at boot.

Change-Id: I727fbf6138b654885d82d85be9d964ee3d3365ef
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/9766
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/dev/ps2/keyboard.cc

index 1f8b5441141c146009f43a6367f2cf60f231273b..c9bc21986061d43b4d972d5f272ed42bbc6af908 100644 (file)
@@ -127,6 +127,12 @@ PS2Keyboard::recv(const std::vector<uint8_t> &data)
         enabled = false;
         sendAck();
         return true;
+      case Reset:
+        DPRINTF(PS2, "Resetting keyboard.\n");
+        sendAck();
+        enabled = true;
+        send(Ps2::SelfTestPass);
+        return true;
       case AllKeysToTypematic:
         panic("Setting all keys to typemantic unimplemented.\n");
       case AllKeysToMakeRelease:
@@ -144,8 +150,6 @@ PS2Keyboard::recv(const std::vector<uint8_t> &data)
         panic("Setting key to make only unimplemented.\n");
       case Resend:
         panic("Keyboard resend unimplemented.\n");
-      case Reset:
-        panic("Keyboard reset unimplemented.\n");
       default:
         panic("Unknown keyboard command %#02x.\n", data[0]);
     }