Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/16748
Change subject: dev, dev-arm: Set/Unset dma coherent mode from python
......................................................................
dev, dev-arm: Set/Unset dma coherent mode from python
With this patch it will be possible to automatically enable/disable the
dma-coherent property for the GenericArmPciHost autogenerated DTB. This
has been done by adding the coherence param in the base PioDevice
SimObject.
Change-Id: I1759fced74e42410462637ca77997a351314a90a
Signed-off-by: Giacomo Travaglini <[email protected]>
---
M src/dev/Device.py
M src/dev/arm/RealView.py
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/dev/Device.py b/src/dev/Device.py
index c137ce6..a92f52f 100644
--- a/src/dev/Device.py
+++ b/src/dev/Device.py
@@ -45,12 +45,17 @@
from m5.objects.MemObject import MemObject
+class DeviceCoherence(ScopedEnum):
+ vals = ["non_coherent", "coherent", "io_coherent"]
+
class PioDevice(MemObject):
type = 'PioDevice'
cxx_header = "dev/io_device.hh"
abstract = True
pio = SlavePort("Programmed I/O port")
system = Param.System(Parent.any, "System this device is part of")
+ coherence = Param.DeviceCoherence('coherent',
+ "Device coherence")
def generateBasicPioDeviceNode(self, state, name, pio_addr,
size, interrupts = None):
diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py
index af19f3b..cfc5360 100644
--- a/src/dev/arm/RealView.py
+++ b/src/dev/arm/RealView.py
@@ -182,7 +182,8 @@
m5.fatal("Unsupported PCI interrupt policy " +
"for Device Tree generation")
- node.append(FdtProperty("dma-coherent"))
+ if self.coherence in ('coherent', 'io_coherent'):
+ node.append(FdtProperty("dma-coherent"))
yield node
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/16748
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I1759fced74e42410462637ca77997a351314a90a
Gerrit-Change-Number: 16748
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev