About IO server settings for DMA in L4Linux
adam at os.inf.tu-dresden.de
Fri Dec 9 23:47:45 CET 2016
On Fri Dec 09, 2016 at 09:21:37 +0000, Jesse-SC Chou (©P®Ñ¥¿) wrote:
> I'm a newbie of L4 micro-kernel. The Fiasco/L4/L4Linux is really a good design for system architecture in the future.
> I'm trying to porting the L4 system to my target then evaluate.
> On my target, there is an DMA controller, which moves data to flash.
> Originally, Native-Linux uses dma_alloc_coherent() to allocate a DMA-dedicated memory.
> CPU copies data to that DMA-dedicated memory, then DMA controller moves data from DMA-dedicated memory to flash.
> In L4Linux, I guess there should be some settings of DMA in I/O server configuration files.
> I'm searching for an example of configuring DMA-related settings.
> I use the snapshot ¡§l4re-snapshot-2016082114¡¨. In my current configuration, "DEVICE1" is the DMA controller, "DEVICE2" is the flash,
> and "DMAMEM" is the DMA-dedicated memory. However, it generates some DMA-related error in boot messages.
> Such as:
> IO | no 'iommu' capability found use CPU-phys for DMA
> IO | warning: inconsistent fixed resource @ device: /System Bus/
> error: failed to get physical address for 2000000.
> And so on.
> The first thing I want to do is to make the boot message correct and I have the following questions:
> 1. Is the "DMAMEM" device needed to be configured? If needed, how to specify this to be a DMA memory?
> 2. Will dma_alloc_coherent() use the "DMAMEM" or other memory? Can I use dma_alloc_coherent() as Native-Linux?
> 3. I've also found a flag "Property.flags = Io.Hw_device_DF_dma_supported;". I'm not sure its usage. I just add this flag to DEVICE1(DMA controller) and DEVICE2(flash), is it correct?
> 4. Is my l4linux-io.devs and l4linux-io.io correct or need other modification for DMA?
> 5. I¡¦ve found ¡§IO | DMADOM [00000000000000-00000000000000 1] non-pref (32bit) (align=0 flags=6)¡¨ in the boot message. What the ¡§DMADOM¡¨ means?
> Any suggestion is very appreciated. Thanks.
I think you're thinking too complicated. In case all of the devices
(including the DMA engine) are driven from within L4Linux it should just
work. Your description sounds as this is the case.
L4Linux makes sure the proper physical addresses are used. Just specify
the MMIO regions and IRQs of the devices in the IO config (and in the
device tree) so that L4Linux is able to access them. Do not use any
flags in the IO config.
Adam adam at os.inf.tu-dresden.de
More information about the l4-hackers