• David Brownell's avatar
    EDMA: split channel/slot resource management · 62ef2b07
    David Brownell authored
    EDMA interface update for channel and parameter RAM slot alloc/free.
    This is the biggest of these changes, since it's non-cosmetic.
    
     - Stop talking about "master" and "slave"!  Instead, use the notions
       exposed by the hardware:  a DMA "channel", and a PaRAM slot.  This
       is a general doc/comment update, and affects calling conventions.
    
     - Split davinci_request_dma() into two simpler routines:
         * edma_alloc_channel() with three fewer parameters
         * edma_alloc_slot() with just one parameter (may be a wildcard)
       The test for successful returns is "value < 0", not "value != 0";
       non-negative values are the returned channel or slot number.
    
     - Split davinci_free_dma() into two routines, both of which update
       the now-free parameter RAM slot to hold a dummy transfer.
         * void edma_free_channel(unsigned channel)
         * void edma_free_slot(unsigned slot);
    
     - Fill all PaRAM slots with dummy transfers when they're not in use.
    
     - Change the channel and slot numbers to "unsigned" in some cases so
       we can avoid some tests for invalid parameters.
    
    A key notion here is to *stop* fuzzing distinctions between DMA channels
    and parameter RAM slots.  This makes it easier to match these calls to
    hardware docs, and harder to get confused by differences; channels are
    (potentially) active, while slots are always passive.
    
    Transfer Completion Code (TCC) values are no longer supported except
    through the calls which manipulate entire parameter RAM sets.  This
    means that completion IRQ setup (for audio) is a bit different.
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
    62ef2b07
edma.h 7.8 KB