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 _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>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user