dman3.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2012, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  * 
00032  */
00054 #ifndef ti_sdo_fc_dman3_DMAN3_
00055 #define ti_sdo_fc_dman3_DMAN3_
00056 
00059 
00060 
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 #include <xdc/std.h>
00066 #include <xdc/runtime/IHeap.h>
00067 
00068 #include <ti/xdais/ialg.h>
00069 #include <ti/xdais/idma3.h>
00070 
00071 
00080 #define DMAN3_MODNAME  "ti.sdo.fc.dman3"
00081 
00082 #define DMAN3_GTNAME "ti.sdo.fc.dman3"  
00084 #define DMAN3_MAXGROUPS      20  
00093 #define DMAN3_SOK             0  
00094 #define DMAN3_EOUTOFMEMORY   -1  
00097 #define DMAN3_EFAIL          -2  
00098 #define DMAN3_EFREE          -3  
00100 #define DMAN3_EOUTOFTCCS     -4  
00103 #define DMAN3_EOUTOFPARAMS   -5  
00106 #define DMAN3_ETCCCONFIG     -6  
00112 #define DMAN3_EPARAMCONFIG   -7  
00119 
00120 
00129 typedef Bool (*DMAN3_ScratchAllocFxn)(IALG_Handle alg, Int mutexId,
00130         IALG_MemRec *memTab, Int numRecs);
00131 
00137 typedef Void (*DMAN3_ScratchFreeFxn)(Int mutexId, Void *addr, Uns size);
00138 
00139 
00150 typedef struct DMAN3_Params {
00157     Uns    *qdmaPaRamBase;
00158 
00165     Uns     maxPaRamEntries;
00166 
00176     Uns     paRamBaseIndex;
00177 
00185     Uns     numPaRamEntries;
00186 
00193     Uns     maxQdmaChannels;
00194 
00201     Uns     numQdmaChannels;
00202 
00210     Uns    *qdmaChannels;
00211 
00225     Uns     tccAllocationMaskH;
00226 
00240     Uns     tccAllocationMaskL;
00241 
00252     xdc_runtime_IHeap_Handle heapInternal;
00253 
00265     xdc_runtime_IHeap_Handle heapExternal;
00266 
00275     unsigned char numTccGroup[DMAN3_MAXGROUPS];    
00285     unsigned short numPaRamGroup[DMAN3_MAXGROUPS];  
00296     Bool          idma3Internal;
00297 
00310     DMAN3_ScratchAllocFxn scratchAllocFxn;
00311 
00323     DMAN3_ScratchFreeFxn scratchFreeFxn;
00324 
00331     Uns nullPaRamIndex;
00332 
00337     Uns     maxTCs;  
00338 
00346     Uns   *qdmaQueueMap; 
00347 
00352     Uns   *queueTCMap;
00353 
00358     Uns   *queuePri;
00359 
00387     Bool allowUnshared;
00388 } DMAN3_Params;
00389 
00390 
00394 extern DMAN3_Params DMAN3_PARAMS;
00395 
00400 extern Uns ti_sdo_fc_dman3_DMAN3_numQdmaGroup[DMAN3_MAXGROUPS + 1];
00401 
00405 extern Bool ti_sdo_fc_dman3_DMAN3_useCustomDma;
00406 
00450 extern Int DMAN3_grantDmaChannels(Int groupId, IALG_Handle algHandle[],
00451         IDMA3_Fxns *dmaFxns[], Int numAlgs);
00452 
00456 extern Void DMAN3_exit(Void);
00457 
00499 extern Int DMAN3_createChannels(Int groupId, IDMA3_ChannelRec dmaTab[],
00500         Int numChans);
00501 
00502 
00510 extern Void DMAN3_init(Void);
00511 
00512 
00534 extern Int  DMAN3_releaseDmaChannels(IALG_Handle algHandle[],
00535     IDMA3_Fxns *dmaFxns[], Int numAlgs);
00536 
00537 
00553 extern Int DMAN3_freeChannels(IDMA3_Handle channelTab[], Int numChans);
00554 
00555 
00556 #ifdef __cplusplus
00557 }
00558 #endif /* extern "C" */
00559 
00560 
00563 #endif
00564 /*
00565  *  @(#) ti.sdo.fc.dman3; 1, 0, 4,3; 4-16-2012 00:00:07; /db/atree/library/trees/fc/fc-q08/src/ xlibrary
00566 
00567  */
00568 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Copyright 2012, Texas Instruments Incorporated