00001 /* 00002 * Copyright (c) 2010, 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 */ 00033 /* 00034 * ======== idma.h ======== 00035 * Declaration of the IDMA interface. 00036 */ 00037 #ifndef IDMA_ 00038 #define IDMA_ 00039 00040 #include "ialg.h" 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 /* 00047 * ======== IDMA_Handle ======== 00048 * Handle to "logical" DMA channel. 00049 */ 00050 typedef struct IDMA_Obj *IDMA_Handle; 00051 00052 /* 00053 * ======== IDMA_ElementSize ======== 00054 * 8, 16 or 32-bit aligned transfer. 00055 */ 00056 typedef enum IDMA_ElementSize { 00057 IDMA_ELEM8, /* 8-bit data element */ 00058 IDMA_ELEM16, /* 16-bit data element */ 00059 IDMA_ELEM32 /* 32-bit data element */ 00060 } IDMA_ElementSize; 00061 00062 /* 00063 * ======== IDMA_TransferType ======== 00064 * Type of the DMA transfer. 00065 */ 00066 typedef enum IDMA_TransferType { 00067 IDMA_1D1D, /* 1-dimensional to 1-dimensional transfer */ 00068 IDMA_1D2D, /* 1-dimensional to 2-dimensional transfer */ 00069 IDMA_2D1D, /* 2-dimensional to 1-dimensional transfer */ 00070 IDMA_2D2D /* 2-dimensional to 2-dimensional transfer */ 00071 } IDMA_TransferType; 00072 00073 /* 00074 * ======== IDMA_Params ======== 00075 * DMA transfer specific parameters. Defines the configuration of a 00076 * logical channel. 00077 */ 00078 typedef struct IDMA_Params { 00079 IDMA_TransferType xType; /* 1D1D, 1D2D, 2D1D or 2D2D */ 00080 IDMA_ElementSize elemSize; /* Element transfer size */ 00081 Int numFrames; /* Num of frames for 2D transfers */ 00082 Int stride; /* Jump in elemSize for 2D transfers */ 00083 } IDMA_Params; 00084 00085 /* 00086 * ======== IDMA_ChannelRec ======== 00087 * DMA record used to describe the logical channels. 00088 */ 00089 typedef struct IDMA_ChannelRec { 00090 Int depth; /* Num max (concurrent) queued transfers */ 00091 Bool dimensions; /* 0 = only 1D transfers, 2D otherwise */ 00092 IDMA_Handle handle; /* Handle to logical DMA channel */ 00093 } IDMA_ChannelRec; 00094 00095 /* 00096 * ======== IDMA_Fxns ======== 00097 * These fxns are used to query/grant the DMA resources requested by 00098 * the algorithm at initialization time, and to change these resources 00099 * at runtime. All these fxns are implemented by the algorithm, and 00100 * called by the client of the algorithm. 00101 * 00102 * implementationId - unique pointer that identifies the module 00103 * implementing this interface. 00104 * dmaChangeChannels() - apps call this whenever the logical channels 00105 * are moved at runtime. 00106 * dmaGetChannelCnt() - apps call this to query algorithm about max 00107 * number of logical dma channel requested. 00108 * dmaGetChannels() - apps call this to query algorithm about its 00109 * dma channel requests at init time, or to get 00110 * the current channel holdings. 00111 * dmaInit() - apps call this to grant dma handle(s) to the 00112 * algorithm at initialization. Algorithm initializes 00113 * the instance object. 00114 */ 00115 typedef struct IDMA_Fxns { 00116 Void *implementationId; 00117 Void (*dmaChangeChannels)(IALG_Handle, IDMA_ChannelRec *); 00118 Int (*dmaGetChannelCnt)(Void); 00119 Int (*dmaGetChannels)(IALG_Handle, IDMA_ChannelRec *); 00120 Int (*dmaInit)(IALG_Handle, IDMA_ChannelRec *); 00121 } IDMA_Fxns; 00122 00123 #ifdef __cplusplus 00124 } 00125 #endif 00126 00127 #endif /* IDMA_ */ 00128 00129 /* 00130 * @(#) ti.xdais; 1, 2.0, 1,243; 5-4-2010 08:43:56; /db/wtree/library/trees/dais/dais-q11x/src/ 00131 */ 00132