Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/31935 )

Change subject: dev-arm: Make Pl011 UART use the ArmInterruptPin
......................................................................

dev-arm: Make Pl011 UART use the ArmInterruptPin

Change-Id: I995a424491f087b70b72d2558d96c7a472d4abaa
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M src/dev/arm/RealView.py
M src/dev/arm/pl011.cc
M src/dev/arm/pl011.hh
3 files changed, 15 insertions(+), 16 deletions(-)



diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py
index a22ac4a..b0e8a8e 100644
--- a/src/dev/arm/RealView.py
+++ b/src/dev/arm/RealView.py
@@ -369,14 +369,13 @@
 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 @@
         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 @@
     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())
diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc
index f24cb61..11485b5 100755
--- a/src/dev/arm/pl011.cc
+++ b/src/dev/arm/pl011.cc
@@ -55,7 +55,7 @@
       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 @@
             imsc, rawInt, maskInt());

     if (maskInt()) {
-        gic->sendInt(intNum);
+        interrupt->raise();
         DPRINTF(Uart, " -- Generated\n");
     }
 }
@@ -289,7 +289,7 @@
         if (!intEvent.scheduled())
             schedule(intEvent, curTick() + intDelay);
     } else if (old_ints && !maskInt()) {
-        gic->clearInt(intNum);
+        interrupt->clear();
     }
 }

diff --git a/src/dev/arm/pl011.hh b/src/dev/arm/pl011.hh
index 81181b7..0ecbe13 100755
--- a/src/dev/arm/pl011.hh
+++ b/src/dev/arm/pl011.hh
@@ -171,14 +171,10 @@
     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;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31935
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I995a424491f087b70b72d2558d96c7a472d4abaa
Gerrit-Change-Number: 31935
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to