dev: Use generateFdtProperty in the PioDevice
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 28 Sep 2020 16:48:58 +0000 (17:48 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Sat, 17 Oct 2020 10:21:08 +0000 (10:21 +0000)
Change-Id: I2126bf84e0648fe76570f9645179f90bdf79eb41
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35398
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/dev/Device.py

index d9f351da36a22647b9adcafb30ef5d15064c2cbe..af495042f36b4dddb5231af2e0d6011caecefd08 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2012-2016,2019 ARM Limited
+# Copyright (c) 2012-2016,2019-2020 ARM Limited
 # All rights reserved.
 #
 # The license below extends only to copyright in the software and shall
@@ -61,10 +61,10 @@ class PioDevice(ClockedObject):
                 raise(("Interrupt number smaller than 32 "+
                        " in PioDevice %s") % name)
 
-            # subtracting 32 because Linux assumes that SPIs start at 0, while
-            # gem5 uses the internal GIC numbering (SPIs start at 32)
+            gic = self._parent.unproxy(self).gic
+
             node.append(FdtPropertyWords("interrupts", sum(
-                [[0, i.num  - 32, 4] for i in interrupts], []) ))
+                [ i.generateFdtProperty(gic) for i in interrupts], []) ))
 
         return node