45#include "debug/Pl050.hh"
73 DPRINTF(
Pl050,
"Read Commmand: %#x\n", (uint32_t)control);
105 warn(
"Tried to read PL050 at offset %#x that doesn't exist\n", daddr);
124 "PL050: Unexpected write size "
125 "(offset: %#x, data: %#x, size: %u)\n",
150 warn(
"PL050: Unhandled write of %#x to offset %#x\n",
data, daddr);
161 InterruptReg ints = rawInterrupts;
163 ints.tx = value ? 1 : 0;
171 InterruptReg ints = rawInterrupts;
183 rawInterrupts = ints;
186 if (!old_pending && new_pending) {
187 DPRINTF(
Pl050,
"Generate interrupt: rawInt=%#x ctrl=%#x int=%#x\n",
190 }
else if (old_pending && !new_pending) {
191 DPRINTF(
Pl050,
"Clear interrupt: rawInt=%#x ctrl=%#x int=%#x\n",
200 InterruptReg tmp_interrupt(0);
202 tmp_interrupt.tx = rawInterrupts.tx & control.txint_enable;
203 tmp_interrupt.rx = rawInterrupts.rx & control.rxint_enable;
205 return tmp_interrupt;
214 paramOut(cp,
"raw_ints", rawInterrupts);
220 paramIn(cp,
"ctrlreg", control);
223 paramIn(cp,
"raw_ints", rawInterrupts);
This is a base class for AMBA devices that have to respond to Device and Implementer ID calls.
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
ArmInterruptPin *const interrupt
virtual void clear()=0
Clear a signalled interrupt.
virtual void raise()=0
Signal an interrupt.
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
Addr pioSize
Size that the device's address range.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
void makeAtomicResponse()
void setControl(ControlReg ctrl)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
static const int kmiClkDiv
uint8_t clkdiv
clock divisor register This register is just kept around to satisfy reads after driver does writes.
Pl050(const Pl050Params &p)
void updateRxInt()
Update the RX interrupt using PS/2 device state.
void setInterrupts(InterruptReg ints)
InterruptReg getInterrupt() const
Get current interrupt value.
void setTxInt(bool value)
Set or clear the TX interrupt.
ps2::Device * ps2Device
PS2 device connected to this KMI interface.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void updateIntCtrl(InterruptReg ints, ControlReg ctrl)
Update the status of the interrupt and control registers and deliver an interrupt if required.
uint8_t hostRead()
Read a character from the device.
void hostRegDataAvailable(const std::function< void()> &c)
Register a data available callback into the PS/2 interface.
void hostWrite(uint8_t c)
Transmit a character from the host interface to the device.
bool hostDataAvailable() const
Check if there is pending data from the PS/2 device.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Implementiation of a PL050 KMI.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
uint64_t Tick
Tick count type.
Declaration of the Packet class.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)