From 21bacc4f9270d67fac49a5a04e9f8117d8768269 Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Wed, 12 Feb 2020 10:50:32 +0000 Subject: [PATCH] dev-arm: SMMUv3, single interconnect attachment 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26923 Maintainer: Giacomo Travaglini Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com> --- src/dev/arm/RealView.py | 5 ++++- src/dev/arm/SMMUv3.py | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py index 40ed4684e..0eaeb82f8 100644 --- a/src/dev/arm/RealView.py +++ b/src/dev/arm/RealView.py @@ -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( diff --git a/src/dev/arm/SMMUv3.py b/src/dev/arm/SMMUv3.py index 9d50540b2..5be09de6f 100644 --- a/src/dev/arm/SMMUv3.py +++ b/src/dev/arm/SMMUv3.py @@ -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"): -- 2.30.2