dev-arm: Use recurseDeviceTree instead of custom in platform
authorAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 5 Jun 2018 16:13:31 +0000 (17:13 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Thu, 21 Jun 2018 14:21:44 +0000 (14:21 +0000)
The platform code uses a custom mechanism to traverse the object
hierarchy when generating device trees. This is highly undesirable
since this breaks for common cases such as when SimObjects are stored
in a list.

Change-Id: I1b968e5fa1db62f1456e3c0ac3de47ab1299e58d
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/10781
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
src/dev/arm/RealView.py

index a28720bdb86dc75cae23ddad4033dabe26a8c5a7..60b6780803c5cf4d53f0633b9c3717dfd39cf4d6 100644 (file)
@@ -598,10 +598,8 @@ class RealView(Platform):
         node.append(FdtPropertyWords("interrupt-parent",
                                      state.phandle(self.gic)))
 
-        for device in [getattr(self, c) for c in self._children]:
-            if issubclass(type(device), SimObject):
-                subnode = device.generateDeviceTree(state)
-                node.append(subnode)
+        for subnode in self.recurseDeviceTree(state):
+            node.append(subnode)
 
         yield node