summaryrefslogtreecommitdiff
path: root/src/dev/arm/kmi.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2018-04-09 18:42:28 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2018-04-17 12:24:17 +0000
commit74e63a607af58c2df49cd2decbebd71a6d061915 (patch)
treeb5a4060f41089a8a9b8b2b7f82aa0b0b509ceb3f /src/dev/arm/kmi.hh
parent68f99c93808ac4d8e12e39c87acec89d422fd8b4 (diff)
downloadgem5-74e63a607af58c2df49cd2decbebd71a6d061915.tar.xz
dev, arm: Use the PS/2 framework in the Pl050 model
The Pl050 KMI model currently has its own keyboard and mouse models. Use the generic PS/2 interface instead. Change-Id: I6523d26f8e38bcc8ba399d4d1a131723645d36c7 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/9767 Reviewed-by: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/dev/arm/kmi.hh')
-rw-r--r--src/dev/arm/kmi.hh51
1 files changed, 9 insertions, 42 deletions
diff --git a/src/dev/arm/kmi.hh b/src/dev/arm/kmi.hh
index 0593165c0..16a61a181 100644
--- a/src/dev/arm/kmi.hh
+++ b/src/dev/arm/kmi.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2017 ARM Limited
+ * Copyright (c) 2010, 2017-2018 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -54,7 +54,9 @@
#include "dev/arm/amba_device.hh"
#include "params/Pl050.hh"
-class Pl050 : public AmbaIntDevice, public VncKeyboard, public VncMouse
+class PS2Device;
+
+class Pl050 : public AmbaIntDevice
{
protected:
static const int kmiCr = 0x000;
@@ -104,21 +106,6 @@ class Pl050 : public AmbaIntDevice, public VncKeyboard, public VncMouse
/** raw interrupt register (unmasked) */
InterruptReg rawInterrupts;
- /** If the controller should ignore the next data byte and acknowledge it.
- * The driver is attempting to setup some feature we don't care about
- */
- int ackNext;
-
- /** is the shift key currently down */
- bool shiftDown;
-
- /** The vnc server we're connected to (if any) */
- VncInput *vnc;
-
- /** If the linux driver has initialized the device yet and thus can we send
- * mouse data */
- bool driverInitialized;
-
/** Update the status of the interrupt registers and schedule an interrupt
* if required */
void updateIntStatus();
@@ -127,40 +114,20 @@ class Pl050 : public AmbaIntDevice, public VncKeyboard, public VncMouse
void generateInterrupt();
/** Get interrupt value */
- InterruptReg getInterrupt() const {
- InterruptReg tmp_interrupt(0);
- tmp_interrupt.tx = rawInterrupts.tx & control.txint_enable;
- tmp_interrupt.rx = rawInterrupts.rx & control.rxint_enable;
- return tmp_interrupt;
- }
+ InterruptReg getInterrupt() const;
+
/** Wrapper to create an event out of the thing */
EventFunctionWrapper intEvent;
- /** Receive queue. This list contains all the pending commands that
- * need to be sent to the driver
- */
- std::list<uint8_t> rxQueue;
-
- /** Handle a command sent to the kmi and respond appropriately
- */
- void processCommand(uint8_t byte);
+ /** PS2 device connected to this KMI interface */
+ PS2Device *ps2;
public:
- typedef Pl050Params Params;
- const Params *
- params() const
- {
- return dynamic_cast<const Params *>(_params);
- }
-
- Pl050(const Params *p);
+ Pl050(const Pl050Params *p);
Tick read(PacketPtr pkt) override;
Tick write(PacketPtr pkt) override;
- void mouseAt(uint16_t x, uint16_t y, uint8_t buttons) override;
- void keyPress(uint32_t key, bool down) override;
-
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;
};