arm, dev: Add support for listing DMA ports in new platforms
When using a Ruby memory system, the Ruby configuration scripts expect to get a list of DMA ports to create the necessary DMA sequencers. Add support in the utility functions that wire up devices to append DMA ports to a list instead of connecting them to the IO bus. These functions are currently only used by the VExpress_GEM5_V1 platform. Change-Id: I46059e46b0f69e7be5f267e396811bd3caa3ed63 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Brad Beckmann <brad.beckmann@amd.com>
This commit is contained in:
parent
26dc0017d2
commit
f540f1a230
1 changed files with 17 additions and 12 deletions
|
@ -301,12 +301,18 @@ class RealView(Platform):
|
||||||
|
|
||||||
_off_chip_ranges = []
|
_off_chip_ranges = []
|
||||||
|
|
||||||
def _attach_io(self, devices, bus):
|
def _attach_device(self, device, bus, dma_ports=None):
|
||||||
|
if hasattr(device, "pio"):
|
||||||
|
device.pio = bus.master
|
||||||
|
if hasattr(device, "dma"):
|
||||||
|
if dma_ports is None:
|
||||||
|
device.dma = bus.slave
|
||||||
|
else:
|
||||||
|
dma_ports.append(device.dma)
|
||||||
|
|
||||||
|
def _attach_io(self, devices, *args, **kwargs):
|
||||||
for d in devices:
|
for d in devices:
|
||||||
if hasattr(d, "pio"):
|
self._attach_device(d, *args, **kwargs)
|
||||||
d.pio = bus.master
|
|
||||||
if hasattr(d, "dma"):
|
|
||||||
d.dma = bus.slave
|
|
||||||
|
|
||||||
def _attach_clk(self, devices, clkdomain):
|
def _attach_clk(self, devices, clkdomain):
|
||||||
for d in devices:
|
for d in devices:
|
||||||
|
@ -325,13 +331,13 @@ class RealView(Platform):
|
||||||
def offChipIOClkDomain(self, clkdomain):
|
def offChipIOClkDomain(self, clkdomain):
|
||||||
self._attach_clk(self._off_chip_devices(), clkdomain)
|
self._attach_clk(self._off_chip_devices(), clkdomain)
|
||||||
|
|
||||||
def attachOnChipIO(self, bus, bridge=None):
|
def attachOnChipIO(self, bus, bridge=None, **kwargs):
|
||||||
self._attach_io(self._on_chip_devices(), bus)
|
self._attach_io(self._on_chip_devices(), bus, **kwargs)
|
||||||
if bridge:
|
if bridge:
|
||||||
bridge.ranges = self._off_chip_ranges
|
bridge.ranges = self._off_chip_ranges
|
||||||
|
|
||||||
def attachIO(self, bus):
|
def attachIO(self, *args, **kwargs):
|
||||||
self._attach_io(self._off_chip_devices(), bus)
|
self._attach_io(self._off_chip_devices(), *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def setupBootLoader(self, mem_bus, cur_sys, loc):
|
def setupBootLoader(self, mem_bus, cur_sys, loc):
|
||||||
|
@ -923,10 +929,9 @@ Interrupts:
|
||||||
self.energy_ctrl,
|
self.energy_ctrl,
|
||||||
]
|
]
|
||||||
|
|
||||||
def attachPciDevice(self, device, bus):
|
def attachPciDevice(self, device, *args, **kwargs):
|
||||||
device.host = self.pci_host
|
device.host = self.pci_host
|
||||||
device.pio = bus.master
|
self._attach_device(device, *args, **kwargs)
|
||||||
device.dma = bus.slave
|
|
||||||
|
|
||||||
def setupBootLoader(self, mem_bus, cur_sys, loc):
|
def setupBootLoader(self, mem_bus, cur_sys, loc):
|
||||||
self.nvmem = SimpleMemory(range=AddrRange(0, size='64MB'),
|
self.nvmem = SimpleMemory(range=AddrRange(0, size='64MB'),
|
||||||
|
|
Loading…
Reference in a new issue