33#include "debug/I8042.hh"
55 fatal_if(!
mouse,
"The i8042 model requires a mouse instance");
64 for (
int i = 0;
i <
p.port_keyboard_int_pin_connection_count;
i++) {
68 for (
int i = 0;
i <
p.port_mouse_int_pin_connection_count;
i++) {
114 if (
keyboard->hostDataAvailable()) {
116 }
else if (
mouse->hostDataAvailable()) {
135 panic(
"Read from unrecognized port %#x.\n",
addr);
157 if (
mouse->hostDataAvailable())
163 "command byte\" command.\n",
data);
168 "mouse output buffer\" command.\n",
data);
173 "keyboad output buffer\" command.\n",
data);
178 "output port\" command.\n",
data);
183 panic(
"Data written for unrecognized "
194 panic(
"Attempted to use i8042 read controller RAM command to "
198 panic(
"Attempted to use i8042 write controller RAM command to "
202 panic(
"Attempted to use i8042 pulse output bit command to "
215 panic(
"i8042 \"Check for password\" command not implemented.\n");
217 panic(
"i8042 \"Load password\" command not implemented.\n");
219 panic(
"i8042 \"Check password\" command not implemented.\n");
250 panic(
"i8042 \"Diagnostic dump\" command not implemented.\n");
260 panic(
"i8042 \"Read input port\" command not implemented.\n");
262 panic(
"i8042 \"Continuous poll low\" command not implemented.\n");
264 panic(
"i8042 \"Continuous poll high\" command not implemented.\n");
266 panic(
"i8042 \"Read output port\" command not implemented.\n");
274 DPRINTF(
I8042,
"Got command to write to mouse output buffer.\n");
282 panic(
"i8042 \"Disable A20\" command not implemented.\n");
284 panic(
"i8042 \"Enable A20\" command not implemented.\n");
286 panic(
"i8042 \"Read test inputs\" command not implemented.\n");
288 panic(
"i8042 \"System reset\" command not implemented.\n");
290 warn(
"Write to unknown i8042 "
291 "(keyboard controller) command port.\n");
294 panic(
"Write to unrecognized port %#x.\n",
addr);
virtual std::string name() const
void setLE(T v)
Set the value in the data pointer to v as little endian.
void makeAtomicResponse()
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
PioDevice(const Params &p)
@ WriteKeyboardOutputBuff
void writeData(uint8_t newData, bool mouse=false)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
static const uint16_t NoCommand
std::vector< IntSourcePin< I8042 > * > keyboardIntPin
std::vector< IntSourcePin< I8042 > * > mouseIntPin
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void serialize(CheckpointOut &cp) const override
Serialize an object.
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
AddrRange RangeSize(Addr start, Addr size)
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define panic(...)
This implements a cprintf based panic() function.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Copyright (c) 2024 Arm Limited All rights reserved.
IntSourcePinBase IntSourcePin
const uint8_t NumOutputBits
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
Declaration of the Packet class.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)