This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DMA API?


>>>>> "Frank" == Frank Pagliughi <fpagliughi@mindspring.com> writes:

    Frank> Is there a genralized API for DMA controllers in eCos? I'm
    Frank> writing a device driver for a communications chip. So far,
    Frank> the driver is fairly portable across platforms, but I need
    Frank> to add DMA support, and worry that will break the
    Frank> portability.

There is no such API at present, and I am not sure a generalized DMA
API is really feasible. DMA engines vary widely in their
functionality, e.g. what you can DMA to and from, transfer widths,
interaction with the interrupt subsystem, interaction with the cache,
etc.

One possibility is to leave this part of the driver to the appropriate
HAL package. Exactly how DMA is implemented is typically a property of
the platform or the processor, making a HAL package the appropriate
place for making decisions such as which DMA channel to allocate to
each driver. The device driver would #include <cyg/hal/hal_io.h> or
a similar header, and that would export various macros or functions
which provide the functionality needed by the device driver. Porting
the driver to new hardware then involves extending the appropriate HAL
with these macros or functions.

Note that this is only one approach. It may or may not be appropriate
for the specific problem you are trying to solve.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]