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

Change subject: arch-arm: Implement ArmPMU DTB generation
......................................................................

arch-arm: Implement ArmPMU DTB generation

This has been implemented by following Linux documentation:

Documentation/devicetree/bindings/arm/pmu.txt

Change-Id: I22583eed3792d5828f9c260e952ec5e8cf9e118b
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M src/arch/arm/ArmPMU.py
1 file changed, 16 insertions(+), 1 deletion(-)



diff --git a/src/arch/arm/ArmPMU.py b/src/arch/arm/ArmPMU.py
index 047e908..1416e72 100644
--- a/src/arch/arm/ArmPMU.py
+++ b/src/arch/arm/ArmPMU.py
@@ -39,7 +39,8 @@
 from m5.params import *
 from m5.params import isNullPointer
 from m5.proxy import *
-from m5.objects.Gic import ArmInterruptPin
+from m5.objects.Gic import ArmInterruptPin, ArmPPI
+from m5.util.fdthelper import *

 class ProbeEvent(object):
     def __init__(self, pmu, _eventId, obj, *listOfNames):
@@ -168,6 +169,20 @@
         # 0x2F: L2D_TLB
         # 0x30: L2I_TLB

+    def generateDeviceTree(self, state):
+        # For simplicity we just support PPIs for DTB autogen otherwise
+        # it would be difficult to construct a ordered list of SPIs
+        assert isinstance(self.interrupt, ArmPPI)
+
+        node = FdtNode("pmu")
+        node.appendCompatible("arm,armv8-pmuv3")
+
+        node.append(
+            FdtPropertyWords("interrupts",
+                self.interrupt.generateFdtProperty()))
+
+        yield node
+
     cycleEventId = Param.Int(ARCH_EVENT_CORE_CYCLES, "Cycle event id")
platform = Param.Platform(Parent.any, "Platform this device is part of.")
     eventCounters = Param.Int(31, "Number of supported PMU counters")

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35476
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: I22583eed3792d5828f9c260e952ec5e8cf9e118b
Gerrit-Change-Number: 35476
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