dev-arm: Set/Unset dma coherent mode from python
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 25 Feb 2019 17:05:09 +0000 (17:05 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 26 Mar 2019 12:53:44 +0000 (12:53 +0000)
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 _dma_coherent param.

Change-Id: I1759fced74e42410462637ca77997a351314a90a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16748
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/dev/arm/RealView.py

index af19f3bbd401aef5d64b37370ce86b02ac01bac0..35bc862274b7f64cb4fc65bf253ca47d557f9ec8 100644 (file)
@@ -121,6 +121,10 @@ class GenericArmPciHost(GenericPciHost):
     int_base = Param.Unsigned("PCI interrupt base")
     int_count = Param.Unsigned("Maximum number of interrupts used by this host")
 
+    # This python parameter can be used in configuration scripts to turn
+    # on/off the fdt dma-coherent flag when doing dtb autogeneration
+    _dma_coherent = True
+
     def generateDeviceTree(self, state):
         local_state = FdtState(addr_cells=3, size_cells=2, cpu_cells=1)
         intterrupt_cells = 1
@@ -182,7 +186,8 @@ class GenericArmPciHost(GenericPciHost):
             m5.fatal("Unsupported PCI interrupt policy " +
                      "for Device Tree generation")
 
-        node.append(FdtProperty("dma-coherent"))
+        if self._dma_coherent:
+            node.append(FdtProperty("dma-coherent"))
 
         yield node