dev-arm: Make Pl011 UART use the ArmInterruptPin
Change-Id: I995a424491f087b70b72d2558d96c7a472d4abaa Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31935 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -369,14 +369,13 @@ class FixedClock(SrcClockDomain):
|
||||
class Pl011(Uart):
|
||||
type = 'Pl011'
|
||||
cxx_header = "dev/arm/pl011.hh"
|
||||
gic = Param.BaseGic(Parent.any, "Gic to use for interrupting")
|
||||
int_num = Param.UInt32("Interrupt number that connects to GIC")
|
||||
interrupt = Param.ArmInterruptPin("Interrupt that connects to GIC")
|
||||
end_on_eot = Param.Bool(False, "End the simulation when a EOT is received on the UART")
|
||||
int_delay = Param.Latency("100ns", "Time between action and interrupt generation by UART")
|
||||
|
||||
def generateDeviceTree(self, state):
|
||||
node = self.generateBasicPioDeviceNode(state, 'uart', self.pio_addr,
|
||||
0x1000, [int(self.int_num)])
|
||||
0x1000, [int(self.interrupt.num)])
|
||||
node.appendCompatible(["arm,pl011", "arm,primecell"])
|
||||
|
||||
# Hardcoded reference to the realview platform clocks, because the
|
||||
@@ -700,7 +699,7 @@ class VExpress_EMM(RealView):
|
||||
return memories
|
||||
|
||||
### Off-chip devices ###
|
||||
uart = Pl011(pio_addr=0x1c090000, int_num=37)
|
||||
uart = Pl011(pio_addr=0x1c090000, interrupt=ArmSPI(num=37))
|
||||
pci_host = GenericPciHost(
|
||||
conf_base=0x30000000, conf_size='256MB', conf_device_bits=16,
|
||||
pci_pio_base=0)
|
||||
@@ -1012,10 +1011,14 @@ Interrupts:
|
||||
clock24MHz = SrcClockDomain(clock="24MHz")
|
||||
|
||||
uart = [
|
||||
Pl011(pio_addr=0x1c090000, int_num=37),
|
||||
Pl011(pio_addr=0x1c0a0000, int_num=38, device=Terminal()),
|
||||
Pl011(pio_addr=0x1c0b0000, int_num=39, device=Terminal()),
|
||||
Pl011(pio_addr=0x1c0c0000, int_num=40, device=Terminal())
|
||||
Pl011(pio_addr=0x1c090000,
|
||||
interrupt=ArmSPI(num=37)),
|
||||
Pl011(pio_addr=0x1c0a0000,
|
||||
interrupt=ArmSPI(num=38), device=Terminal()),
|
||||
Pl011(pio_addr=0x1c0b0000,
|
||||
interrupt=ArmSPI(num=39), device=Terminal()),
|
||||
Pl011(pio_addr=0x1c0c0000,
|
||||
interrupt=ArmSPI(num=40), device=Terminal())
|
||||
]
|
||||
|
||||
kmi0 = Pl050(pio_addr=0x1c060000, int_num=44, ps2=PS2Keyboard())
|
||||
|
||||
@@ -55,7 +55,7 @@ Pl011::Pl011(const Pl011Params *p)
|
||||
intEvent([this]{ generateInterrupt(); }, name()),
|
||||
control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12),
|
||||
imsc(0), rawInt(0),
|
||||
gic(p->gic), endOnEOT(p->end_on_eot), intNum(p->int_num),
|
||||
endOnEOT(p->end_on_eot), interrupt(p->interrupt->get()),
|
||||
intDelay(p->int_delay)
|
||||
{
|
||||
}
|
||||
@@ -272,7 +272,7 @@ Pl011::generateInterrupt()
|
||||
imsc, rawInt, maskInt());
|
||||
|
||||
if (maskInt()) {
|
||||
gic->sendInt(intNum);
|
||||
interrupt->raise();
|
||||
DPRINTF(Uart, " -- Generated\n");
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ Pl011::setInterrupts(uint16_t ints, uint16_t mask)
|
||||
if (!intEvent.scheduled())
|
||||
schedule(intEvent, curTick() + intDelay);
|
||||
} else if (old_ints && !maskInt()) {
|
||||
gic->clearInt(intNum);
|
||||
interrupt->clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,14 +171,10 @@ class Pl011 : public Uart, public AmbaDevice
|
||||
uint16_t rawInt;
|
||||
|
||||
protected: // Configuration
|
||||
/** Gic to use for interrupting */
|
||||
BaseGic * const gic;
|
||||
|
||||
/** Should the simulation end on an EOT */
|
||||
const bool endOnEOT;
|
||||
|
||||
/** Interrupt number to generate */
|
||||
const int intNum;
|
||||
ArmInterruptPin* const interrupt;
|
||||
|
||||
/** Delay before interrupting */
|
||||
const Tick intDelay;
|
||||
|
||||
Reference in New Issue
Block a user