dev-arm: Gicv3 ITS device tree autogen
authorAdrian Herrera <adrian.herrera@arm.com>
Thu, 22 Aug 2019 13:20:36 +0000 (14:20 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 6 Sep 2019 08:32:04 +0000 (08:32 +0000)
This patch adds device tree automatic generation for Gicv3 ITS.

Change-Id: Ic01500ffa691b331f527c5c2c785ff715660b0c2
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20609
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/Gic.py

index e1a8a78dbdfe8064534a61ec8315cdba4926cb43..eec6e95c2266ffe768a7057742014c2c2112a42d 100644 (file)
@@ -187,6 +187,15 @@ class Gicv3Its(BasicPioDevice):
     # ID_bits [12:8] = 0b11111: ITS supports 31 EventID bits
     gits_typer = Param.UInt64(0x30023F01, "GITS_TYPER RO value")
 
+    def generateDeviceTree(self, state):
+        node = self.generateBasicPioDeviceNode(state, "gic-its", self.pio_addr,
+                                               self.pio_size)
+        node.appendCompatible(["arm,gic-v3-its"])
+        node.append(FdtProperty("msi-controller"))
+        node.append(FdtPropertyWords("#msi-cells", [1]))
+
+        return node
+
 class Gicv3(BaseGic):
     type = 'Gicv3'
     cxx_header = "dev/arm/gic_v3.hh"
@@ -254,4 +263,7 @@ class Gicv3(BaseGic):
 
         node.appendPhandle(self)
 
+        # Generate the ITS device tree
+        node.append(self.its.generateDeviceTree(self._state))
+
         yield node