dev-arm: SMMUv3, single interconnect attachment
authorAdrian Herrera <adrian.herrera@arm.com>
Wed, 12 Feb 2020 10:50:32 +0000 (10:50 +0000)
committerAdrian Herrera <adrian.herrera@arm.com>
Thu, 19 Mar 2020 18:18:41 +0000 (18:18 +0000)
The attachment (port binding) of the SMMUv3 master and control
ports is independent of the connection of device masters to it.

This behaviour is now moved from SMMUv3::connect to
RealView::attachSmmu, as it is a responsibility of the Platform
designer.

This fixes crashes when connecting multiple device masters.

Change-Id: If1e8f55d51876fe761f881e3044ffec637c21b09
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26923
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
src/dev/arm/RealView.py
src/dev/arm/SMMUv3.py

index 40ed4684ec4c2cc1fb3d1a34b023ac1e35dfd415..0eaeb82f822b06679b8238fcdb42f16da6190c4f 100644 (file)
@@ -1075,10 +1075,13 @@ Interrupts:
 
         self.smmu = SMMUv3(reg_map=AddrRange(0x2b400000, size=0x00020000))
 
+        self.smmu.master = bus.slave
+        self.smmu.control = bus.master
+
         dma_ports = []
         for dev in devices:
             self._attach_device(dev, bus, dma_ports)
-            self.smmu.connect(dev, bus)
+            self.smmu.connect(dev)
 
     def setupBootLoader(self, cur_sys, boot_loader):
         super(VExpress_GEM5_Base, self).setupBootLoader(
index 9d50540b2cfe97293cfdd1502fa82f10cc101f91..5be09de6f1c21c0021e0eadf05d670dba9c168b8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, 2018-2019 ARM Limited
+# Copyright (c) 2013, 2018-2020 ARM Limited
 # All rights reserved
 #
 # The license below extends only to copyright in the software and shall
@@ -182,7 +182,7 @@ class SMMUv3(ClockedObject):
         node.appendPhandle(self)
         yield node
 
-    def connect(self, device, bus):
+    def connect(self, device):
         """
         Helper method used to connect the SMMU. The master could
         be either a dma port (if the SMMU is attached directly to a
@@ -190,9 +190,6 @@ class SMMUv3(ClockedObject):
         is attached to a bridge).
         """
 
-        self.master = bus.slave
-        self.control = bus.master
-
         slave_interface = SMMUv3SlaveInterface()
 
         if hasattr(device, "master"):