Home | History | Annotate | Download | only in inc
      1 /*
      2  *  Copyright 2001-2008 Texas Instruments - http://www.ti.com/
      3  *
      4  *  Licensed under the Apache License, Version 2.0 (the "License");
      5  *  you may not use this file except in compliance with the License.
      6  *  You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  *  Unless required by applicable law or agreed to in writing, software
     11  *  distributed under the License is distributed on an "AS IS" BASIS,
     12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  *  See the License for the specific language governing permissions and
     14  *  limitations under the License.
     15  */
     16 
     17 
     18 
     19 /*
     20  *  ======== dbdefs.h ========
     21  *  DSP-BIOS Bridge driver support functions for TI OMAP processors.
     22  *  Description:
     23  *      Global definitions and constants for DSP/BIOS Bridge.
     24  *
     25  *! Revision History:
     26  *! ================
     27  *! 19-Apr-2004 sb  Aligned DMM definitions with Symbian
     28  *! 08-Mar-2004 sb  Added MAPATTR & ELEM_SIZE for Dynamic Memory Mapping feature
     29  *! 09-Feb-2004 vp  Added processor ID numbers for DSP and IVA
     30  *! 06-Feb-2003 kc  Removed DSP_POSTMESSAGE. Updated IsValid*Event macros.
     31  *! 22-Nov-2002 gp  Cleaned up comments, formatting.
     32  *!                 Removed unused DSP_ENUMLASTNODE define.
     33  *! 13-Feb-2002 jeh Added uSysStackSize to DSP_NDBPROPS.
     34  *! 23-Jan-2002 ag  Added #define DSP_SHMSEG0.
     35  *! 12-Dec-2001 ag  Added DSP_ESTRMMODE error code.
     36  *! 04-Dec-2001 jeh Added DSP_ENOTCONNECTED error code.
     37  *! 10-Dec-2001 kc: Modified macros and definitions to disable DSP_POSTMESSAGE.
     38  *! 01-Nov-2001 jeh Added DSP_EOVERLAYMEMORY.
     39  *! 18-Oct-2001 ag  Added DSP_STRMMODE type.
     40  *!                 Added DSP_ENOTSHAREDMEM.
     41  *! 21-Sep-2001 ag  Added additional error codes.
     42  *! 07-Jun-2001 sg  Made DSPStream_AllocateBuffer fxn name plural.
     43  *! 11-May-2001 jeh Changed DSP_NODE_MIN_PRIORITY from 0 to 1. Removed hNode
     44  *!                 from DSP_NODEINFO.
     45  *! 02-Apr-2001 sg  Added missing error codes, rearranged codes, switched to
     46  *!             hex offsets, renamed some codes to match API spec.
     47  *! 16-Jan-2001 jeh Added DSP_ESYMBOL, DSP_EUUID.
     48  *! 13-Feb-2001 kc: DSP/BIOS Bridge name updates.
     49  *! 05-Dec-2000 ag: Added DSP_RMSxxx user available message command codes.
     50  *! 09-Nov-2000 rr: Added DSP_PROCEESORRESTART define; Removed DSP_PBUFFER.
     51  *!                 Added DSP_DCD_ENOAUTOREGISTER, DSP_EUSER1-16, DSP_ESTRMFUL
     52  *!                 Removed DSP_EDONE. Macros's modified.
     53  *! 23-Oct-2000 jeh Replaced DSP_STREAMSTATECHANGE with DSP_STREAMDONE.
     54  *! 09-Oct-2000 jeh Updated to version 0.9 DSP Bridge API spec.
     55  *! 29-Sep-2000 kc  Added error codes for DCD and REG to simplify use of
     56  *!                 these codes within the RM module.
     57  *! 27-Sep-2000 jeh Added segid, alignment, uNumBufs to DSP_STREAMATTRIN.
     58  *! 29-Aug-2000 jeh Added DSP_NODETYPE enum, changed DSP_EALREADYATTACHED to
     59  *!                 DSP_EALREADYCONNECTED. Changed scStreamConnection[1]
     60  *!                 to scStreamConnection[16] in DSP_NODEINFO structure.
     61  *!                 Added DSP_NOTIFICATION, DSP_STRMATTR. PSTRING changed
     62  *!                 back to TCHAR * and moved to dbtype.h.
     63  *! 11-Aug-2000 rr: Macros to check valid events and notify masks added.
     64  *! 09-Aug-2000 rr: Changed PSTRING to *CHAR
     65  *! 07-Aug-2000 rr: PROC_IDLE/SYNCINIT/UNKNOWN state removed.
     66  *! 20-Jul-2000 rr: Updated to version 0.8
     67  *! 17-Jul-2000 rr: New PROC states added to the DSP_PROCSTATE.
     68  *! 27-Jun-2000 rr: Created from dspapi.h
     69  */
     70 
     71 #ifndef DBDEFS_
     72 #define DBDEFS_
     73 
     74 #include <dbtype.h>		/* GPP side type definitions           */
     75 #include <std.h>		/* DSP/BIOS type definitions           */
     76 #include <rms_sh.h>		/* Types shared between GPP and DSP    */
     77 
     78 #ifdef __cplusplus
     79 extern "C" {
     80 #endif
     81 
     82 #define PG_SIZE_4K 4096
     83 #define PG_MASK(pg_size) (~((pg_size)-1))
     84 #define PG_ALIGN_LOW(addr, pg_size) ((addr) & PG_MASK(pg_size))
     85 #define PG_ALIGN_HIGH(addr, pg_size) (((addr)+(pg_size)-1) & PG_MASK(pg_size))
     86 
     87 /* API return value and calling convention */
     88 #define DBAPI                       DSP_STATUS CDECL
     89 
     90 /* Infinite time value for the uTimeout parameter to DSPStream_Select() */
     91 #define DSP_FOREVER                 (-1)
     92 
     93 /* Maximum length of node name, used in DSP_NDBPROPS */
     94 #define DSP_MAXNAMELEN              32
     95 
     96 /* uNotifyType values for the RegisterNotify() functions. */
     97 #define DSP_SIGNALEVENT             0x00000001
     98 
     99 /* Types of events for processors */
    100 #define DSP_PROCESSORSTATECHANGE    0x00000001
    101 #define DSP_PROCESSORATTACH         0x00000002
    102 #define DSP_PROCESSORDETACH         0x00000004
    103 #define DSP_PROCESSORRESTART        0x00000008
    104 
    105 /* DSP exception events (DSP/BIOS and DSP MMU fault) */
    106 #define DSP_MMUFAULT                0x00000010
    107 #define DSP_SYSERROR                0x00000020
    108 
    109 /* IVA exception events (IVA MMU fault) */
    110 #define IVA_MMUFAULT                0x00000040
    111 /* Types of events for nodes */
    112 #define DSP_NODESTATECHANGE         0x00000100
    113 #define DSP_NODEMESSAGEREADY        0x00000200
    114 
    115 /* Types of events for streams */
    116 #define DSP_STREAMDONE              0x00001000
    117 #define DSP_STREAMIOCOMPLETION      0x00002000
    118 
    119 /* Handle definition representing the GPP node in DSPNode_Connect() calls */
    120 #define DSP_HGPPNODE                0xFFFFFFFF
    121 
    122 /* Node directions used in DSPNode_Connect() */
    123 #define DSP_TONODE                  1
    124 #define DSP_FROMNODE                2
    125 
    126 /* Define Node Minimum and Maximum Priorities */
    127 #define DSP_NODE_MIN_PRIORITY       1
    128 #define DSP_NODE_MAX_PRIORITY       15
    129 
    130 /* Pre-Defined Message Command Codes available to user: */
    131 #define DSP_RMSUSERCODESTART RMS_USER	/* Start of RMS user cmd codes */
    132 #define DSP_RMSUSERCODEEND RMS_USER + RMS_MAXUSERCODES;	/* end of user codes */
    133 #define DSP_RMSBUFDESC RMS_BUFDESC	/* MSG contains SM buffer description */
    134 
    135 /* Shared memory identifier for MEM segment named "SHMSEG0" */
    136 #define DSP_SHMSEG0     (UINT)(-1)
    137 
    138 /* Processor ID numbers */
    139 #define DSP_UNIT    0
    140 #define IVA_UNIT    1
    141 
    142 #if ! defined (OMAP_2430) && ! defined (OMAP_3430)
    143 #define DSPWORD       SHORT
    144 #else
    145 #define DSPWORD       BYTE
    146 #endif
    147 #define DSPWORDSIZE     sizeof(DSPWORD)
    148 
    149 /* Success & Failure macros  */
    150 #define DSP_SUCCEEDED(Status)      ((INT)(Status) >= 0)
    151 #define DSP_FAILED(Status)         ((INT)(Status) < 0)
    152 
    153 /* Power control enumerations */
    154 #define PROC_PWRCONTROL             0x8070
    155 
    156 #define PROC_PWRMGT_ENABLE          (PROC_PWRCONTROL + 0x3)
    157 #define PROC_PWRMGT_DISABLE         (PROC_PWRCONTROL + 0x4)
    158 
    159 /* Bridge Code Version */
    160 #define BRIDGE_VERSION_CODE         333
    161 
    162 #if defined (OMAP_2430) || defined (OMAP_3430)
    163 #define    MAX_PROFILES     16
    164 #endif
    165 
    166 /* Types defined for 'Bridge API */
    167 	typedef DWORD DSP_STATUS;	/* API return code type         */
    168 
    169 	typedef HANDLE DSP_HNODE;	/* Handle to a DSP Node object  */
    170 	typedef HANDLE DSP_HPROCESSOR;	/* Handle to a Processor object */
    171 	typedef HANDLE DSP_HSTREAM;	/* Handle to a Stream object    */
    172 
    173 	typedef ULONG DSP_PROCFAMILY;	/* Processor family             */
    174 	typedef ULONG DSP_PROCTYPE;	/* Processor type (w/in family) */
    175 	typedef ULONG DSP_RTOSTYPE;	/* Type of DSP RTOS             */
    176 
    177 	typedef ULONG DSP_RESOURCEMASK;	/* Mask for processor resources */
    178 	typedef ULONG DSP_ERRORMASK;	/* Mask for various error types */
    179 
    180 /* Handy Macros */
    181 #define IsValidProcEvent(x)    (((x) == 0) || (((x) & (DSP_PROCESSORSTATECHANGE | \
    182                                     DSP_PROCESSORATTACH | \
    183                                     DSP_PROCESSORDETACH | \
    184                                     DSP_PROCESSORRESTART | \
    185                                     DSP_NODESTATECHANGE | \
    186                                     DSP_STREAMDONE | \
    187                                     DSP_STREAMIOCOMPLETION | \
    188                                     DSP_MMUFAULT | \
    189                                     DSP_SYSERROR)) && \
    190                                 !((x) & ~(DSP_PROCESSORSTATECHANGE | \
    191                                     DSP_PROCESSORATTACH | \
    192                                     DSP_PROCESSORDETACH | \
    193                                     DSP_PROCESSORRESTART | \
    194                                     DSP_NODESTATECHANGE | \
    195                                     DSP_STREAMDONE | \
    196                                     DSP_STREAMIOCOMPLETION | \
    197                                     DSP_MMUFAULT | \
    198                                     DSP_SYSERROR))))
    199 
    200 #define IsValidNodeEvent(x)    (((x) == 0) || (((x) & (DSP_NODESTATECHANGE | \
    201                                 DSP_NODEMESSAGEREADY)) && \
    202                                 !((x) & ~(DSP_NODESTATECHANGE | \
    203                                 DSP_NODEMESSAGEREADY))))
    204 
    205 #define IsValidStrmEvent(x)     (((x) == 0) || (((x) & (DSP_STREAMDONE | \
    206                                 DSP_STREAMIOCOMPLETION)) && \
    207                                 !((x) & ~(DSP_STREAMDONE | \
    208                                 DSP_STREAMIOCOMPLETION))))
    209 
    210 #define IsValidNotifyMask(x)   ((x) & DSP_SIGNALEVENT)
    211 
    212 /* The Node UUID structure */
    213 	struct DSP_UUID {
    214 		ULONG ulData1;
    215 		USHORT usData2;
    216 		USHORT usData3;
    217 		BYTE ucData4;
    218 		BYTE ucData5;
    219 		UCHAR ucData6[6];
    220 	};
    221 	/*DSP_UUID, *DSP_HUUID;*/
    222 
    223 /* DCD types */
    224 	typedef enum {
    225 		DSP_DCDNODETYPE,
    226 		DSP_DCDPROCESSORTYPE,
    227 		DSP_DCDLIBRARYTYPE,
    228 		DSP_DCDCREATELIBTYPE,
    229 		DSP_DCDEXECUTELIBTYPE,
    230 		DSP_DCDDELETELIBTYPE
    231 	} DSP_DCDOBJTYPE;
    232 
    233 /* Processor states */
    234 	typedef enum {
    235 		PROC_STOPPED,
    236 		PROC_LOADED,
    237 		PROC_RUNNING,
    238 		PROC_ERROR
    239 	} DSP_PROCSTATE;
    240 
    241 /* Node types */
    242 	typedef enum {
    243 		NODE_DEVICE,
    244 		NODE_TASK,
    245 		NODE_DAISSOCKET,
    246 		NODE_MESSAGE
    247 	} DSP_NODETYPE;
    248 
    249 /* Node states */
    250 	typedef enum {
    251 		NODE_ALLOCATED,
    252 		NODE_CREATED,
    253 		NODE_RUNNING,
    254 		NODE_PAUSED,
    255 		NODE_DONE
    256 	} DSP_NODESTATE;
    257 
    258 /* Stream states */
    259 	typedef enum {
    260 		STREAM_IDLE,
    261 		STREAM_READY,
    262 		STREAM_PENDING,
    263 		STREAM_DONE
    264 	} DSP_STREAMSTATE;
    265 
    266 /* Stream connect types */
    267 	typedef enum {
    268 		CONNECTTYPE_NODEOUTPUT,
    269 		CONNECTTYPE_GPPOUTPUT,
    270 		CONNECTTYPE_NODEINPUT,
    271 		CONNECTTYPE_GPPINPUT
    272 	} DSP_CONNECTTYPE;
    273 
    274 /* Stream mode types */
    275 	typedef enum {
    276 		STRMMODE_PROCCOPY,	/* Processor(s) copy stream data payloads */
    277 		STRMMODE_ZEROCOPY,	/* Stream buffer pointers swapped, no data copied */
    278 		STRMMODE_LDMA,	/* Local DMA : OMAP's System-DMA device */
    279 		STRMMODE_RDMA	/* Remote DMA: OMAP's DSP-DMA device */
    280 	} DSP_STRMMODE;
    281 
    282 /* Stream DMA priority. Only Low and High supported */
    283 	typedef enum {
    284 		DMAPRI_LOW,
    285 		DMAPRI_HIGH
    286 	} DSP_DMAPRIORITY;
    287 
    288 /* Resource Types */
    289 	typedef enum {
    290 		DSP_RESOURCE_DYNDARAM = 0,
    291 		DSP_RESOURCE_DYNSARAM,
    292 		DSP_RESOURCE_DYNEXTERNAL,
    293 		DSP_RESOURCE_DYNSRAM,
    294 		DSP_RESOURCE_PROCLOAD
    295 	} DSP_RESOURCEINFOTYPE;
    296 
    297 /* Memory Segment Types */
    298 	typedef enum {
    299 		DSP_DYNDARAM = 0,
    300 		DSP_DYNSARAM,
    301 		DSP_DYNEXTERNAL,
    302 		DSP_DYNSRAM
    303 	} DSP_MEMTYPE;
    304 
    305 /* Memory Flush Types */
    306        typedef enum {
    307 		PROC_INVALIDATE_MEM = 0,
    308 		PROC_WRITEBACK_MEM,
    309 		PROC_WRITEBACK_INVALIDATE_MEM,
    310 	} DSP_FLUSHTYPE;
    311 
    312 /* Memory Segment Status Values */
    313 	 struct DSP_MEMSTAT {
    314 		ULONG ulSize;
    315 		ULONG ulTotalFreeSize;
    316 		ULONG ulLenMaxFreeBlock;
    317 		ULONG ulNumFreeBlocks;
    318 		ULONG ulNumAllocBlocks;
    319 	} ;
    320 
    321 /* Processor Load information Values */
    322 	 struct DSP_PROCLOADSTAT {
    323 		ULONG uCurrLoad;
    324 		ULONG uPredictedLoad;
    325 		ULONG uCurrDspFreq;
    326 		ULONG uPredictedFreq;
    327 	} ;
    328 
    329 /* Attributes for STRM connections between nodes */
    330 	struct DSP_STRMATTR {
    331 		UINT uSegid;	/* Memory segment on DSP to allocate buffers */
    332 		UINT uBufsize;	/* Buffer size (DSP words) */
    333 		UINT uNumBufs;	/* Number of buffers */
    334 		UINT uAlignment;	/* Buffer alignment */
    335 		UINT uTimeout;	/* Timeout for blocking STRM calls */
    336 		UINT lMode;	/* mode of stream when opened */
    337 		UINT uDMAChnlId;	/* DMA chnl id if DSP_STRMMODE is LDMA or RDMA */
    338 		UINT uDMAPriority;	/* DMA channel priority 0=lowest, >0=high */
    339 	} ;
    340 
    341 /* The DSP_CBDATA structure */
    342 	struct DSP_CBDATA {
    343 		ULONG cbData;
    344 		BYTE cData[1];
    345 	} ;
    346 	/*DSP_CBDATA, *DSP_HCBDATA;*/
    347 
    348 /* The DSP_MSG structure */
    349 	struct DSP_MSG {
    350 		DWORD dwCmd;
    351 		DWORD dwArg1;
    352 		DWORD dwArg2;
    353 	} ;
    354 	/*DSP_MSG, *DSP_HMSG;*/
    355 
    356 /* The DSP_RESOURCEREQMTS structure for node's resource requirements  */
    357 	struct DSP_RESOURCEREQMTS {
    358 		DWORD cbStruct;
    359 		UINT uStaticDataSize;
    360 		UINT uGlobalDataSize;
    361 		UINT uProgramMemSize;
    362 		UINT uWCExecutionTime;
    363 		UINT uWCPeriod;
    364 		UINT uWCDeadline;
    365 		UINT uAvgExectionTime;
    366 		UINT uMinimumPeriod;
    367 	} ;
    368 	/*DSP_RESOURCEREQMTS, *DSP_HRESOURCEREQMTS;*/
    369 
    370 /*
    371  * The DSP_STREAMCONNECT structure describes a stream connection
    372  * between two nodes, or between a node and the GPP
    373  */
    374 	struct DSP_STREAMCONNECT {
    375 		DWORD cbStruct;
    376 		DSP_CONNECTTYPE lType;
    377 		UINT uThisNodeStreamIndex;
    378 		DSP_HNODE hConnectedNode;
    379 		struct DSP_UUID uiConnectedNodeID;
    380 		UINT uConnectedNodeStreamIndex;
    381 	} ;
    382 	/*DSP_STREAMCONNECT, *DSP_HSTREAMCONNECT;*/
    383 
    384 #if defined (OMAP_2430) || defined (OMAP_3430)
    385 	struct DSP_NODEPROFS {
    386 		UINT ulHeapSize;
    387 	} ;
    388 	/*DSP_NODEPROFS, *DSP_HNODEPROFS;*/
    389 #endif
    390 
    391 /* The DSP_NDBPROPS structure reports the attributes of a node */
    392 	struct DSP_NDBPROPS {
    393 		DWORD cbStruct;
    394 		struct DSP_UUID uiNodeID;
    395 		CHARACTER acName[DSP_MAXNAMELEN];
    396 		DSP_NODETYPE uNodeType;
    397 		UINT bCacheOnGPP;
    398 		struct DSP_RESOURCEREQMTS dspResourceReqmts;
    399 		INT iPriority;
    400 		UINT uStackSize;
    401 		UINT uSysStackSize;
    402 		UINT uStackSeg;
    403 		UINT uMessageDepth;
    404 		UINT uNumInputStreams;
    405 		UINT uNumOutputStreams;
    406 		UINT uTimeout;
    407 #if defined (OMAP_2430) || defined (OMAP_3430)
    408 		UINT uCountProfiles;	/* Number of supported profiles */
    409 		struct DSP_NODEPROFS aProfiles[MAX_PROFILES];	/* Array of profiles */
    410 #endif
    411 		UINT uStackSegName; /* Stack Segment Name */
    412 	} ;
    413 	/*DSP_NDBPROPS, *DSP_HNDBPROPS;*/
    414 
    415     /* The DSP_NODEATTRIN structure describes the attributes of a node client */
    416     struct DSP_NODEATTRIN {
    417             DWORD cbStruct;
    418             INT iPriority;
    419             UINT uTimeout;
    420 #if defined (OMAP_2430) || defined (OMAP_3430)
    421             UINT    uProfileID;
    422 			/* Reserved, for Bridge Internal use only */
    423             UINT    uHeapSize;
    424             PVOID   pGPPVirtAddr; /* Reserved, for Bridge Internal use only */
    425 #endif
    426         } ;
    427 	/*DSP_NODEATTRIN, *DSP_HNODEATTRIN;*/
    428 
    429 /* The DSP_NODEINFO structure is used to retrieve information about a node */
    430 	struct DSP_NODEINFO {
    431 		DWORD cbStruct;
    432 		struct DSP_NDBPROPS nbNodeDatabaseProps;
    433 		UINT uExecutionPriority;
    434 		DSP_NODESTATE nsExecutionState;
    435 		DSP_HNODE hDeviceOwner;
    436 		UINT uNumberStreams;
    437 		struct DSP_STREAMCONNECT scStreamConnection[16];
    438 		UINT uNodeEnv;
    439 	} ;
    440 	/*DSP_NODEINFO, *DSP_HNODEINFO;*/
    441 
    442 /* The DSP_NODEATTR structure describes the attributes of a node */
    443 	struct DSP_NODEATTR {
    444 		DWORD cbStruct;
    445 		struct DSP_NODEATTRIN inNodeAttrIn;
    446 		ULONG uInputs;
    447 		ULONG uOutputs;
    448 		struct DSP_NODEINFO iNodeInfo;
    449 	} ;
    450 	/*DSP_NODEATTR, *DSP_HNODEATTR;*/
    451 
    452 /*
    453  *  Notification type: either the name of an opened event, or an event or
    454  *  window handle.
    455  */
    456 	struct DSP_NOTIFICATION {
    457 		PSTRING psName;
    458 		HANDLE handle;
    459 	} ;
    460 	/*DSP_NOTIFICATION, *DSP_HNOTIFICATION;*/
    461 
    462 /* The DSP_PROCESSORATTRIN structure describes the attributes of a processor */
    463 	struct DSP_PROCESSORATTRIN{
    464 		DWORD cbStruct;
    465 		UINT uTimeout;
    466 	} ;
    467 	/*DSP_PROCESSORATTRIN, *DSP_HPROCESSORATTRIN;*/
    468 
    469 	enum chipTypes {
    470 		DSPTYPE_55 = 6,
    471 		IVA_ARM7 = 0x97,
    472 		DSPTYPE_64 = 0x99
    473 	};
    474 
    475 /*
    476  * The DSP_PROCESSORINFO structure describes basic capabilities of a
    477  * DSP processor
    478  */
    479 	struct DSP_PROCESSORINFO {
    480 		DWORD cbStruct;
    481 		DSP_PROCFAMILY uProcessorFamily;
    482 		DSP_PROCTYPE uProcessorType;
    483 		UINT uClockRate;
    484 		ULONG ulInternalMemSize;
    485 		ULONG ulExternalMemSize;
    486 		UINT uProcessorID;
    487 		DSP_RTOSTYPE tyRunningRTOS;
    488 		INT nNodeMinPriority;
    489 		INT nNodeMaxPriority;
    490 	} ;
    491 	/*DSP_PROCESSORINFO, *DSP_HPROCESSORINFO;*/
    492 
    493 /* Error information of last DSP exception signalled to the GPP */
    494 	struct DSP_ERRORINFO {
    495 		DWORD dwErrMask;
    496 		DWORD dwVal1;
    497 		DWORD dwVal2;
    498 		DWORD dwVal3;
    499 	} ;
    500 	/*DSP_ERRORINFO;*/
    501 
    502 /* The DSP_PROCESSORSTATE structure describes the state of a DSP processor */
    503 	struct DSP_PROCESSORSTATE {
    504 		DWORD cbStruct;
    505 		DSP_PROCSTATE iState;
    506 		struct DSP_ERRORINFO errInfo;
    507 	} ;
    508 	/*DSP_PROCESSORSTATE, *DSP_HPROCESSORSTATE;*/
    509 
    510 /*
    511  * The DSP_RESOURCEINFO structure is used to retrieve information about a
    512  * processor's resources
    513  */
    514 	struct DSP_RESOURCEINFO {
    515 		DWORD cbStruct;
    516 		DSP_RESOURCEINFOTYPE uResourceType;
    517 		union {
    518 			ULONG ulResource;
    519 			struct DSP_MEMSTAT memStat;
    520 			struct DSP_PROCLOADSTAT procLoadStat;
    521 		} result;
    522 	} ;
    523 	/*DSP_RESOURCEINFO, *DSP_HRESOURCEINFO;*/
    524 
    525 /*
    526  * The DSP_STREAMATTRIN structure describes the attributes of a stream,
    527  * including segment and alignment of data buffers allocated with
    528  * DSPStream_AllocateBuffers(), if applicable
    529  */
    530 	struct DSP_STREAMATTRIN {
    531 		DWORD cbStruct;
    532 		UINT uTimeout;
    533 		UINT uSegment;
    534 		UINT uAlignment;
    535 		UINT uNumBufs;
    536 		UINT lMode;
    537 		UINT uDMAChnlId;
    538 		UINT uDMAPriority;
    539 	} ;
    540 	/*DSP_STREAMATTRIN, *DSP_HSTREAMATTRIN;*/
    541 
    542 /* The DSP_BUFFERATTR structure describes the attributes of a data buffer */
    543 	struct DSP_BUFFERATTR {
    544 		DWORD cbStruct;
    545 		UINT uSegment;
    546 		UINT uAlignment;
    547 	} ;
    548 	/*DSP_BUFFERATTR, *DSP_HBUFFERATTR;*/
    549 
    550 /*
    551  *  The DSP_STREAMINFO structure is used to retrieve information
    552  *  about a stream.
    553  */
    554 	struct DSP_STREAMINFO {
    555 		DWORD cbStruct;
    556 		UINT uNumberBufsAllowed;
    557 		UINT uNumberBufsInStream;
    558 		ULONG ulNumberBytes;
    559 		HANDLE hSyncObjectHandle;
    560 		DSP_STREAMSTATE ssStreamState;
    561 	} ;
    562 	/*DSP_STREAMINFO, *DSP_HSTREAMINFO;*/
    563 
    564 /* DMM MAP attributes
    565 It is a bit mask with each bit value indicating a specific attribute
    566 bit 0 - GPP address type (user virtual=0, physical=1)
    567 bit 1 - MMU Endianism (Big Endian=1, Little Endian=0)
    568 bit 2 - MMU mixed page attribute (Mixed/ CPUES=1, TLBES =0)
    569 bit 3 - MMU element size = 8bit (valid only for non mixed page entries)
    570 bit 4 - MMU element size = 16bit (valid only for non mixed page entries)
    571 bit 5 - MMU element size = 32bit (valid only for non mixed page entries)
    572 bit 6 - MMU element size = 64bit (valid only for non mixed page entries)
    573 */
    574 
    575 /* Types of mapping attributes */
    576 
    577 /* MPU address is virtual and needs to be translated to physical addr */
    578 #define DSP_MAPVIRTUALADDR          0x00000000
    579 #define DSP_MAPPHYSICALADDR         0x00000001
    580 
    581 /* Mapped data is big endian */
    582 #define DSP_MAPBIGENDIAN            0x00000002
    583 #define DSP_MAPLITTLEENDIAN         0x00000000
    584 
    585 /* Element size is based on DSP r/w access size */
    586 #define DSP_MAPMIXEDELEMSIZE        0x00000004
    587 
    588 /*
    589  * Element size for MMU mapping (8, 16, 32, or 64 bit)
    590  * Ignored if DSP_MAPMIXEDELEMSIZE enabled
    591  */
    592 #define DSP_MAPELEMSIZE8            0x00000008
    593 #define DSP_MAPELEMSIZE16           0x00000010
    594 #define DSP_MAPELEMSIZE32           0x00000020
    595 #define DSP_MAPELEMSIZE64           0x00000040
    596 
    597 #define DSP_MAPVMALLOCADDR         0x00000080
    598 
    599 #if defined (OMAP_2430) || defined (OMAP_3430)
    600 #define GEM_CACHE_LINE_SIZE     128
    601 #define GEM_L1P_PREFETCH_SIZE   128
    602 #endif
    603 
    604 #ifdef __cplusplus
    605 }
    606 #endif
    607 #endif				/* DBDEFS_ */
    608