Update from omapzoom 18-Aug-2008
[bridge-dev.git] / 0002-TI-DSP-BRIDGE-Header-files.patch
blob268069918d2efbb76ee8b742dea42502eb011817
1 From ebebee93e4ad693c2f5675ccdf533436d514b02e Mon Sep 17 00:00:00 2001
2 From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
3 Date: Fri, 15 Aug 2008 01:55:54 +0300
4 Subject: [PATCH 02/10] TI DSP BRIDGE: Header files
6 Initial port from omapzoom
7 http://omapzoom.org/gf/project/omapbridge
9 For details,
10 http://omapzoom.org/gf/project/omapbridge/docman/?subdir=3
12 Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
13 ---
14 arch/arm/plat-omap/include/bridge/_chnl_sm.h | 221 ++++
15 arch/arm/plat-omap/include/bridge/_dcd.h | 187 +++
16 arch/arm/plat-omap/include/bridge/brddefs.h | 54 +
17 arch/arm/plat-omap/include/bridge/cfg.h | 339 ++++++
18 arch/arm/plat-omap/include/bridge/cfgdefs.h | 127 +++
19 arch/arm/plat-omap/include/bridge/chnl.h | 537 +++++++++
20 arch/arm/plat-omap/include/bridge/chnl_sm.h | 210 ++++
21 arch/arm/plat-omap/include/bridge/chnldefs.h | 92 ++
22 arch/arm/plat-omap/include/bridge/chnlpriv.h | 136 +++
23 arch/arm/plat-omap/include/bridge/clk.h | 155 +++
24 arch/arm/plat-omap/include/bridge/cmm.h | 420 +++++++
25 arch/arm/plat-omap/include/bridge/cmmdefs.h | 135 +++
26 arch/arm/plat-omap/include/bridge/cod.h | 494 ++++++++
27 arch/arm/plat-omap/include/bridge/csl.h | 269 +++++
28 arch/arm/plat-omap/include/bridge/dbapi.h | 48 +
29 arch/arm/plat-omap/include/bridge/dbc.h | 66 ++
30 arch/arm/plat-omap/include/bridge/dbdcd.h | 388 +++++++
31 arch/arm/plat-omap/include/bridge/dbdcddef.h | 94 ++
32 arch/arm/plat-omap/include/bridge/dbdefs.h | 564 +++++++++
33 arch/arm/plat-omap/include/bridge/dbg.h | 110 ++
34 arch/arm/plat-omap/include/bridge/dbl.h | 354 ++++++
35 arch/arm/plat-omap/include/bridge/dbldefs.h | 519 +++++++++
36 arch/arm/plat-omap/include/bridge/dbll.h | 70 ++
37 arch/arm/plat-omap/include/bridge/dblldefs.h | 513 +++++++++
38 arch/arm/plat-omap/include/bridge/dbof.h | 117 ++
39 arch/arm/plat-omap/include/bridge/dbreg.h | 113 ++
40 arch/arm/plat-omap/include/bridge/dbtype.h | 105 ++
41 arch/arm/plat-omap/include/bridge/ddma_sh.h | 95 ++
42 arch/arm/plat-omap/include/bridge/ddmatypes.h | 36 +
43 arch/arm/plat-omap/include/bridge/dehdefs.h | 42 +
44 arch/arm/plat-omap/include/bridge/dev.h | 804 +++++++++++++
45 arch/arm/plat-omap/include/bridge/devdefs.h | 35 +
46 arch/arm/plat-omap/include/bridge/disp.h | 236 ++++
47 arch/arm/plat-omap/include/bridge/dispdefs.h | 45 +
48 arch/arm/plat-omap/include/bridge/dldr.h | 75 ++
49 arch/arm/plat-omap/include/bridge/dldrdefs.h | 315 ++++++
50 arch/arm/plat-omap/include/bridge/dmm.h | 85 ++
51 arch/arm/plat-omap/include/bridge/dpc.h | 167 +++
52 arch/arm/plat-omap/include/bridge/drv.h | 434 +++++++
53 arch/arm/plat-omap/include/bridge/drvdefs.h | 34 +
54 arch/arm/plat-omap/include/bridge/dspapi.h | 50 +
55 arch/arm/plat-omap/include/bridge/dspdrv.h | 106 ++
56 arch/arm/plat-omap/include/bridge/dynamic_loader.h | 505 +++++++++
57 arch/arm/plat-omap/include/bridge/errbase.h | 509 +++++++++
58 arch/arm/plat-omap/include/bridge/gb.h | 85 ++
59 arch/arm/plat-omap/include/bridge/getsection.h | 121 ++
60 arch/arm/plat-omap/include/bridge/gh.h | 37 +
61 arch/arm/plat-omap/include/bridge/gp.h | 33 +
62 arch/arm/plat-omap/include/bridge/gs.h | 64 ++
63 arch/arm/plat-omap/include/bridge/gt.h | 317 ++++++
64 arch/arm/plat-omap/include/bridge/host_os.h | 80 ++
65 arch/arm/plat-omap/include/bridge/io.h | 132 +++
66 arch/arm/plat-omap/include/bridge/io_sm.h | 330 ++++++
67 arch/arm/plat-omap/include/bridge/iodefs.h | 45 +
68 arch/arm/plat-omap/include/bridge/isr.h | 219 ++++
69 arch/arm/plat-omap/include/bridge/kfile.h | 216 ++++
70 arch/arm/plat-omap/include/bridge/ldr.h | 51 +
71 arch/arm/plat-omap/include/bridge/list.h | 296 +++++
72 arch/arm/plat-omap/include/bridge/mbx_sh.h | 213 ++++
73 arch/arm/plat-omap/include/bridge/mem.h | 340 ++++++
74 arch/arm/plat-omap/include/bridge/memdefs.h | 52 +
75 arch/arm/plat-omap/include/bridge/memry.h | 96 ++
76 arch/arm/plat-omap/include/bridge/mgr.h | 234 ++++
77 arch/arm/plat-omap/include/bridge/mgrpriv.h | 55 +
78 arch/arm/plat-omap/include/bridge/msg.h | 106 ++
79 arch/arm/plat-omap/include/bridge/msgdefs.h | 43 +
80 arch/arm/plat-omap/include/bridge/nldr.h | 81 ++
81 arch/arm/plat-omap/include/bridge/nldrdefs.h | 307 +++++
82 arch/arm/plat-omap/include/bridge/node.h | 619 ++++++++++
83 arch/arm/plat-omap/include/bridge/nodedefs.h | 40 +
84 arch/arm/plat-omap/include/bridge/nodepriv.h | 237 ++++
85 arch/arm/plat-omap/include/bridge/ntfy.h | 146 +++
86 arch/arm/plat-omap/include/bridge/prcs.h | 101 ++
87 arch/arm/plat-omap/include/bridge/proc.h | 648 +++++++++++
88 arch/arm/plat-omap/include/bridge/procpriv.h | 35 +
89 arch/arm/plat-omap/include/bridge/pwr.h | 129 +++
90 arch/arm/plat-omap/include/bridge/pwr_sh.h | 41 +
91 arch/arm/plat-omap/include/bridge/reg.h | 257 +++++
92 .../arm/plat-omap/include/bridge/resourcecleanup.h | 89 ++
93 arch/arm/plat-omap/include/bridge/rmm.h | 199 ++++
94 arch/arm/plat-omap/include/bridge/rms_sh.h | 125 ++
95 arch/arm/plat-omap/include/bridge/rmstypes.h | 41 +
96 arch/arm/plat-omap/include/bridge/services.h | 63 +
97 arch/arm/plat-omap/include/bridge/std.h | 143 +++
98 arch/arm/plat-omap/include/bridge/strm.h | 441 ++++++++
99 arch/arm/plat-omap/include/bridge/strmdefs.h | 57 +
100 arch/arm/plat-omap/include/bridge/sync.h | 339 ++++++
101 arch/arm/plat-omap/include/bridge/util.h | 173 +++
102 arch/arm/plat-omap/include/bridge/utildefs.h | 51 +
103 arch/arm/plat-omap/include/bridge/uuidutil.h | 74 ++
104 arch/arm/plat-omap/include/bridge/wcd.h | 61 +
105 arch/arm/plat-omap/include/bridge/wcdioctl.h | 518 +++++++++
106 arch/arm/plat-omap/include/bridge/wmd.h | 1193 ++++++++++++++++++++
107 arch/arm/plat-omap/include/bridge/wmdchnl.h | 90 ++
108 arch/arm/plat-omap/include/bridge/wmddeh.h | 64 ++
109 arch/arm/plat-omap/include/bridge/wmdio.h | 53 +
110 arch/arm/plat-omap/include/bridge/wmdioctl.h | 91 ++
111 arch/arm/plat-omap/include/bridge/wmdmsg.h | 70 ++
112 98 files changed, 19751 insertions(+), 0 deletions(-)
113 create mode 100644 arch/arm/plat-omap/include/bridge/_chnl_sm.h
114 create mode 100644 arch/arm/plat-omap/include/bridge/_dcd.h
115 create mode 100644 arch/arm/plat-omap/include/bridge/brddefs.h
116 create mode 100644 arch/arm/plat-omap/include/bridge/cfg.h
117 create mode 100644 arch/arm/plat-omap/include/bridge/cfgdefs.h
118 create mode 100644 arch/arm/plat-omap/include/bridge/chnl.h
119 create mode 100644 arch/arm/plat-omap/include/bridge/chnl_sm.h
120 create mode 100644 arch/arm/plat-omap/include/bridge/chnldefs.h
121 create mode 100644 arch/arm/plat-omap/include/bridge/chnlpriv.h
122 create mode 100644 arch/arm/plat-omap/include/bridge/clk.h
123 create mode 100644 arch/arm/plat-omap/include/bridge/cmm.h
124 create mode 100644 arch/arm/plat-omap/include/bridge/cmmdefs.h
125 create mode 100644 arch/arm/plat-omap/include/bridge/cod.h
126 create mode 100644 arch/arm/plat-omap/include/bridge/csl.h
127 create mode 100644 arch/arm/plat-omap/include/bridge/dbapi.h
128 create mode 100644 arch/arm/plat-omap/include/bridge/dbc.h
129 create mode 100644 arch/arm/plat-omap/include/bridge/dbdcd.h
130 create mode 100644 arch/arm/plat-omap/include/bridge/dbdcddef.h
131 create mode 100644 arch/arm/plat-omap/include/bridge/dbdefs.h
132 create mode 100644 arch/arm/plat-omap/include/bridge/dbg.h
133 create mode 100644 arch/arm/plat-omap/include/bridge/dbl.h
134 create mode 100644 arch/arm/plat-omap/include/bridge/dbldefs.h
135 create mode 100644 arch/arm/plat-omap/include/bridge/dbll.h
136 create mode 100644 arch/arm/plat-omap/include/bridge/dblldefs.h
137 create mode 100644 arch/arm/plat-omap/include/bridge/dbof.h
138 create mode 100644 arch/arm/plat-omap/include/bridge/dbreg.h
139 create mode 100644 arch/arm/plat-omap/include/bridge/dbtype.h
140 create mode 100644 arch/arm/plat-omap/include/bridge/ddma_sh.h
141 create mode 100644 arch/arm/plat-omap/include/bridge/ddmatypes.h
142 create mode 100644 arch/arm/plat-omap/include/bridge/dehdefs.h
143 create mode 100644 arch/arm/plat-omap/include/bridge/dev.h
144 create mode 100644 arch/arm/plat-omap/include/bridge/devdefs.h
145 create mode 100644 arch/arm/plat-omap/include/bridge/disp.h
146 create mode 100644 arch/arm/plat-omap/include/bridge/dispdefs.h
147 create mode 100644 arch/arm/plat-omap/include/bridge/dldr.h
148 create mode 100644 arch/arm/plat-omap/include/bridge/dldrdefs.h
149 create mode 100644 arch/arm/plat-omap/include/bridge/dmm.h
150 create mode 100644 arch/arm/plat-omap/include/bridge/dpc.h
151 create mode 100644 arch/arm/plat-omap/include/bridge/drv.h
152 create mode 100644 arch/arm/plat-omap/include/bridge/drvdefs.h
153 create mode 100644 arch/arm/plat-omap/include/bridge/dspapi.h
154 create mode 100644 arch/arm/plat-omap/include/bridge/dspdrv.h
155 create mode 100644 arch/arm/plat-omap/include/bridge/dynamic_loader.h
156 create mode 100644 arch/arm/plat-omap/include/bridge/errbase.h
157 create mode 100644 arch/arm/plat-omap/include/bridge/gb.h
158 create mode 100644 arch/arm/plat-omap/include/bridge/getsection.h
159 create mode 100644 arch/arm/plat-omap/include/bridge/gh.h
160 create mode 100644 arch/arm/plat-omap/include/bridge/gp.h
161 create mode 100644 arch/arm/plat-omap/include/bridge/gs.h
162 create mode 100644 arch/arm/plat-omap/include/bridge/gt.h
163 create mode 100644 arch/arm/plat-omap/include/bridge/host_os.h
164 create mode 100644 arch/arm/plat-omap/include/bridge/io.h
165 create mode 100644 arch/arm/plat-omap/include/bridge/io_sm.h
166 create mode 100644 arch/arm/plat-omap/include/bridge/iodefs.h
167 create mode 100644 arch/arm/plat-omap/include/bridge/isr.h
168 create mode 100644 arch/arm/plat-omap/include/bridge/kfile.h
169 create mode 100644 arch/arm/plat-omap/include/bridge/ldr.h
170 create mode 100644 arch/arm/plat-omap/include/bridge/list.h
171 create mode 100644 arch/arm/plat-omap/include/bridge/mbx_sh.h
172 create mode 100644 arch/arm/plat-omap/include/bridge/mem.h
173 create mode 100644 arch/arm/plat-omap/include/bridge/memdefs.h
174 create mode 100644 arch/arm/plat-omap/include/bridge/memry.h
175 create mode 100644 arch/arm/plat-omap/include/bridge/mgr.h
176 create mode 100644 arch/arm/plat-omap/include/bridge/mgrpriv.h
177 create mode 100644 arch/arm/plat-omap/include/bridge/msg.h
178 create mode 100644 arch/arm/plat-omap/include/bridge/msgdefs.h
179 create mode 100644 arch/arm/plat-omap/include/bridge/nldr.h
180 create mode 100644 arch/arm/plat-omap/include/bridge/nldrdefs.h
181 create mode 100644 arch/arm/plat-omap/include/bridge/node.h
182 create mode 100644 arch/arm/plat-omap/include/bridge/nodedefs.h
183 create mode 100644 arch/arm/plat-omap/include/bridge/nodepriv.h
184 create mode 100644 arch/arm/plat-omap/include/bridge/ntfy.h
185 create mode 100644 arch/arm/plat-omap/include/bridge/prcs.h
186 create mode 100644 arch/arm/plat-omap/include/bridge/proc.h
187 create mode 100644 arch/arm/plat-omap/include/bridge/procpriv.h
188 create mode 100644 arch/arm/plat-omap/include/bridge/pwr.h
189 create mode 100644 arch/arm/plat-omap/include/bridge/pwr_sh.h
190 create mode 100644 arch/arm/plat-omap/include/bridge/reg.h
191 create mode 100644 arch/arm/plat-omap/include/bridge/resourcecleanup.h
192 create mode 100644 arch/arm/plat-omap/include/bridge/rmm.h
193 create mode 100644 arch/arm/plat-omap/include/bridge/rms_sh.h
194 create mode 100644 arch/arm/plat-omap/include/bridge/rmstypes.h
195 create mode 100644 arch/arm/plat-omap/include/bridge/services.h
196 create mode 100644 arch/arm/plat-omap/include/bridge/std.h
197 create mode 100644 arch/arm/plat-omap/include/bridge/strm.h
198 create mode 100644 arch/arm/plat-omap/include/bridge/strmdefs.h
199 create mode 100644 arch/arm/plat-omap/include/bridge/sync.h
200 create mode 100644 arch/arm/plat-omap/include/bridge/util.h
201 create mode 100644 arch/arm/plat-omap/include/bridge/utildefs.h
202 create mode 100644 arch/arm/plat-omap/include/bridge/uuidutil.h
203 create mode 100644 arch/arm/plat-omap/include/bridge/wcd.h
204 create mode 100644 arch/arm/plat-omap/include/bridge/wcdioctl.h
205 create mode 100644 arch/arm/plat-omap/include/bridge/wmd.h
206 create mode 100644 arch/arm/plat-omap/include/bridge/wmdchnl.h
207 create mode 100644 arch/arm/plat-omap/include/bridge/wmddeh.h
208 create mode 100644 arch/arm/plat-omap/include/bridge/wmdio.h
209 create mode 100644 arch/arm/plat-omap/include/bridge/wmdioctl.h
210 create mode 100644 arch/arm/plat-omap/include/bridge/wmdmsg.h
212 Index: lk/arch/arm/plat-omap/include/bridge/_chnl_sm.h
213 ===================================================================
214 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
215 +++ lk/arch/arm/plat-omap/include/bridge/_chnl_sm.h 2008-08-18 10:38:34.000000000 +0300
216 @@ -0,0 +1,221 @@
218 + * arch/arm/plat-omap/include/bridge/_chnl_sm.h
220 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
222 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
224 + * This package is free software; you can redistribute it and/or modify
225 + * it under the terms of the GNU General Public License version 2 as
226 + * published by the Free Software Foundation.
228 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
229 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
230 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
231 + */
235 + * ======== _chnl_sm.h ========
236 + * Description:
237 + * Private header file defining channel manager and channel objects for
238 + * a shared memory channel driver.
240 + * Public Functions:
241 + * None.
243 + * Notes:
244 + * Shared between the modules implementing the shared memory channel class
245 + * library.
247 + *! Revision History:
248 + *! ================
249 + *! 15-Oct-2002 kc Removed legacy PERF code.
250 + *! 12-Jan-2002 ag Removed unused gppReqIO & ddmaChnlId DDMA fields.
251 + *! Added zero-copy chnl descriptor array: zchnldesc.
252 + *! 21-Dec-2001 ag Moved descPaGpp to private chnl obj from chnl descriptor.
253 + *! 20-May-2001 ag/jeh Removed fShmSyms field from CHNL_MGR.
254 + *! 04-Feb-2001 ag DSP-DMA support added.
255 + *! 26-Oct-2000 jeh Added arg and resvd to SHM control structure. Added dwArg
256 + *! to CHNL_IRP.
257 + *! 16-Oct-2000 jeh Removed #ifdef DEBUG from around channel object's cIOCs
258 + *! field, added cIOReqs.
259 + *! 20-Jan-2000 ag: Incorporated code review comments.
260 + *! 05-Jan-2000 ag: Text format cleanup.
261 + *! 03-Nov-1999 ag: Added szEventName[] to CHNL object for name event support.
262 + *! 02-Nov-1999 ag: _SHM_BEG & _END Syms from COFF now used for IO and SM CLASS.
263 + *! 27-Oct-1999 jeh Define SHM structure to work for 16-bit targets.
264 + *! 25-May-1999 jg: Added target side symbol names for share memory buffer
265 + *! 03-Jan-1997 gp: Added fSharedIRQ field.
266 + *! 22-Oct-1996 gp: Made dwProcessID a handle.
267 + *! 09-Sep-1996 gp: Added dwProcessID field to CHNL_OBJECT.
268 + *! 13-Aug-1996 gp: Created.
269 + */
271 +#ifndef _CHNL_SM_
272 +#define _CHNL_SM_
274 +#include <wcd.h>
275 +#include <wmd.h>
276 +#include <isr.h>
277 +#include <dpc.h>
279 +#include <list.h>
280 +#include <ntfy.h>
283 + * These target side symbols define the beginning and ending addresses
284 + * of shared memory buffer. They are defined in the *cfg.cmd file by
285 + * cdb code.
286 + */
287 +#define CHNL_SHARED_BUFFER_BASE_SYM "_SHM_BEG"
288 +#define CHNL_SHARED_BUFFER_LIMIT_SYM "_SHM_END"
289 +#define BRIDGEINIT_BIOSGPTIMER "_BRIDGEINIT_BIOSGPTIMER"
290 +#define BRIDGEINIT_LOADMON_GPTIMER "_BRIDGEINIT_LOADMON_GPTIMER"
292 +#ifndef _CHNL_WORDSIZE
293 +#define _CHNL_WORDSIZE 4 /* default _CHNL_WORDSIZE is 2 bytes/word */
294 +#endif
296 +#ifdef CONFIG_ARCH_OMAP3430
298 +#define MAXOPPS 16
300 +struct oppTableEntry {
301 + u32 voltage;
302 + u32 frequency;
303 + u32 minFreq;
304 + u32 maxFreq;
305 +} ;
307 +struct oppStruct {
308 + u32 currOppPt;
309 + u32 numOppPts;
310 + struct oppTableEntry oppPoint[MAXOPPS];
311 +} ;
313 +/* Request to MPU */
314 +struct oppRqstStruct {
315 + u32 rqstDspFreq;
316 + u32 rqstOppPt;
319 +/* Info to MPU */
320 +struct loadMonStruct {
321 + u32 currDspLoad;
322 + u32 currDspFreq;
323 + u32 predDspLoad;
324 + u32 predDspFreq;
327 +#endif
329 + typedef u32 SMWORD;
331 + enum SHM_DESCTYPE {
332 + SHM_CURROPP = 0,
333 + SHM_OPPINFO = 1,
334 + SHM_GETOPP = 2, /* Get DSP requested OPP info */
335 + } ;
337 +/* Structure in shared between DSP and PC for communication.*/
338 + struct SHM {
339 + u32 dspFreeMask; /* Written by DSP, read by PC. */
340 + u32 hostFreeMask; /* Written by PC, read by DSP */
342 + u32 inputFull; /* Input channel has unread data. */
343 + u32 inputId; /* Channel for which input is available. */
344 + u32 inputSize; /* Size of data block (in DSP words). */
346 + u32 outputFull; /* Output channel has unread data. */
347 + u32 outputId; /* Channel for which output is available. */
348 + u32 outputSize; /* Size of data block (in DSP words). */
350 + u32 arg; /* Arg for Issue/Reclaim (23 bits for 55x). */
351 + u32 resvd; /* Keep structure size even for 32-bit DSPs */
353 +#ifdef CONFIG_ARCH_OMAP3430
354 + /* Operating Point structure */
355 + struct oppStruct oppTableStruct;
356 + /* Operating Point Request structure */
357 + struct oppRqstStruct oppRequest;
358 + /* load monitor information structure*/
359 + struct loadMonStruct loadMonInfo;
360 + char dummy[184]; /* padding to 256 byte boundary */
361 + u32 shm_dbg_var[64]; /* shared memory debug variables */
362 +#endif
363 + } ;
365 + /* Channel Manager: only one created per board: */
366 + struct CHNL_MGR {
367 + u32 dwSignature; /* Used for object validation */
368 + /* Function interface to WMD */
369 + struct WMD_DRV_INTERFACE *pIntfFxns;
370 + struct IO_MGR *hIOMgr; /* IO manager */
371 + /* Device this board represents */
372 + struct DEV_OBJECT *hDevObject;
374 + /* These fields initialized in WMD_CHNL_Create(): */
375 + u32 dwOutputMask; /* Host output channels w/ full buffers */
376 + u32 dwLastOutput; /* Last output channel fired from DPC */
377 + /* Critical section object handle */
378 + struct SYNC_CSOBJECT *hCSObj;
379 + u32 uWordSize; /* Size in bytes of DSP word */
380 + u32 cChannels; /* Total number of channels */
381 + u32 cOpenChannels; /* Total number of open channels */
382 + struct CHNL_OBJECT **apChannel; /* Array of channels */
383 + u32 dwType; /* Type of channel class library */
384 + /* If no SHM syms, return for CHNL_Open */
385 + DSP_STATUS chnlOpenStatus;
386 + } ;
389 + * Channel: up to CHNL_MAXCHANNELS per board or if DSP-DMA supported then
390 + * up to CHNL_MAXCHANNELS + CHNL_MAXDDMACHNLS per board.
391 + */
392 + struct CHNL_OBJECT {
393 + u32 dwSignature; /* Used for object validation */
394 + /* Pointer back to channel manager */
395 + struct CHNL_MGR *pChnlMgr;
396 + u32 uId; /* Channel id */
397 + u32 dwState; /* Current channel state */
398 + u32 uMode; /* Chnl mode and attributes */
399 + /* Chnl I/O completion event (user mode) */
400 + HANDLE hUserEvent;
401 + /* Abstract syncronization object */
402 + struct SYNC_OBJECT *hSyncEvent;
403 + /* Name of Sync event */
404 + char szEventName[SYNC_MAXNAMELENGTH + 1];
405 + HANDLE hProcess; /* Process which created this channel */
406 + u32 pCBArg; /* Argument to use with callback */
407 + struct LST_LIST *pIORequests; /* List of IOR's to driver */
408 + s32 cIOCs; /* Number of IOC's in queue */
409 + s32 cIOReqs; /* Number of IORequests in queue */
410 + s32 cChirps; /* Initial number of free Irps */
411 + /* List of IOC's from driver */
412 + struct LST_LIST *pIOCompletions;
413 + struct LST_LIST *pFreeList; /* List of free Irps */
414 + struct NTFY_OBJECT *hNtfy;
415 + u32 cBytesMoved; /* Total number of bytes transfered */
417 + /* For DSP-DMA */
419 + /* Type of chnl transport:CHNL_[PCPY][DDMA] */
420 + u32 uChnlType;
421 + } ;
423 +/* I/O Request/completion packet: */
424 + struct CHNL_IRP {
425 + struct LST_ELEM link; /* Link to next CHIRP in queue. */
426 + /* Buffer to be filled/emptied. (User) */
427 + u8 *pHostUserBuf;
428 + /* Buffer to be filled/emptied. (System) */
429 + u8 *pHostSysBuf;
430 + u32 dwArg; /* Issue/Reclaim argument. */
431 + u32 uDspAddr; /* Transfer address on DSP side. */
432 + u32 cBytes; /* Bytes transferred. */
433 + u32 cBufSize; /* Actual buffer size when allocated. */
434 + u32 status; /* Status of IO completion. */
435 + } ;
437 +#endif /* _CHNL_SM_ */
438 Index: lk/arch/arm/plat-omap/include/bridge/_dcd.h
439 ===================================================================
440 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
441 +++ lk/arch/arm/plat-omap/include/bridge/_dcd.h 2008-08-18 10:38:34.000000000 +0300
442 @@ -0,0 +1,187 @@
444 + * arch/arm/plat-omap/include/bridge/_dcd.h
446 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
448 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
450 + * This package is free software; you can redistribute it and/or modify
451 + * it under the terms of the GNU General Public License version 2 as
452 + * published by the Free Software Foundation.
454 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
455 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
456 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
457 + */
461 + * ======== _dcd.h ========
462 + * Description:
463 + * Includes the wrapper functions called directly by the
464 + * DeviceIOControl interface.
466 + * Public Functions:
467 + * WCD_CallDevIOCtl
468 + * WCD_Init
469 + * WCD_InitComplete2
470 + * WCD_Exit
471 + * <MOD>WRAP_*
473 + * Notes:
474 + * Compiled with CDECL calling convention.
476 + *! Revision History:
477 + *! ================
478 + *! 19-Apr-2004 sb Aligned DMM definitions with Symbian
479 + *! 08-Mar-2004 sb Added the Dynamic Memory Mapping feature
480 + *! 30-Jan-2002 ag Renamed CMMWRAP_AllocBuf to CMMWRAP_CallocBuf.
481 + *! 22-Nov-2000 kc: Added MGRWRAP_GetPerf_Data to acquire PERF stats.
482 + *! 27-Oct-2000 jeh Added NODEWRAP_AllocMsgBuf, NODEWRAP_FreeMsgBuf. Removed
483 + *! NODEWRAP_GetMessageStream.
484 + *! 10-Oct-2000 ag: Added user CMM wrappers.
485 + *! 04-Aug-2000 rr: MEMWRAP and UTIL_Wrap added.
486 + *! 27-Jul-2000 rr: NODEWRAP, STRMWRAP added.
487 + *! 27-Jun-2000 rr: MGRWRAP fxns added.IFDEF to build for PM or DSP/BIOS Bridge
488 + *! 03-Dec-1999 rr: WCD_InitComplete2 enabled for BRD_AutoStart.
489 + *! 09-Nov-1999 kc: Added MEMRY.
490 + *! 02-Nov-1999 ag: Added CHNL.
491 + *! 08-Oct-1999 rr: Utilwrap_Testdll fxn added
492 + *! 24-Sep-1999 rr: header changed from _wcd.h to _dcd.h
493 + *! 09-Sep-1997 gp: Created.
494 + */
496 +#ifndef _WCD_
497 +#define _WCD_
499 +#include <wcdioctl.h>
502 + * ======== WCD_CallDevIOCtl ========
503 + * Purpose:
504 + * Call the (wrapper) function for the corresponding WCD IOCTL.
505 + * Parameters:
506 + * cmd: IOCTL id, base 0.
507 + * args: Argument structure.
508 + * pResult:
509 + * Returns:
510 + * DSP_SOK if command called; DSP_EINVALIDARG if command not in IOCTL
511 + * table.
512 + * Requires:
513 + * Ensures:
514 + */
515 + extern DSP_STATUS WCD_CallDevIOCtl(unsigned int cmd,
516 + union Trapped_Args *args,
517 + u32 *pResult);
520 + * ======== WCD_Init ========
521 + * Purpose:
522 + * Initialize WCD modules, and export WCD services to WMD's.
523 + * This procedure is called when the class driver is loaded.
524 + * Parameters:
525 + * Returns:
526 + * TRUE if success; FALSE otherwise.
527 + * Requires:
528 + * Ensures:
529 + */
530 + extern bool WCD_Init();
533 + * ======== WCD_InitComplete2 ========
534 + * Purpose:
535 + * Perform any required WCD, and WMD initialization which
536 + * cannot not be performed in WCD_Init() or DEV_StartDevice() due
537 + * to the fact that some services are not yet
538 + * completely initialized.
539 + * Parameters:
540 + * Returns:
541 + * DSP_SOK: Allow this device to load
542 + * DSP_EFAIL: Failure.
543 + * Requires:
544 + * WCD initialized.
545 + * Ensures:
546 + */
547 + extern DSP_STATUS WCD_InitComplete2();
550 + * ======== WCD_Exit ========
551 + * Purpose:
552 + * Exit all modules initialized in WCD_Init().
553 + * This procedure is called when the class driver is unloaded.
554 + * Parameters:
555 + * Returns:
556 + * Requires:
557 + * WCD_Init() was previously called.
558 + * Ensures:
559 + * Resources acquired in WCD_Init() are freed.
560 + */
561 + extern void WCD_Exit();
563 +/* MGR wrapper functions */
564 + extern u32 MGRWRAP_EnumNode_Info(union Trapped_Args *args);
565 + extern u32 MGRWRAP_EnumProc_Info(union Trapped_Args *args);
566 + extern u32 MGRWRAP_RegisterObject(union Trapped_Args *args);
567 + extern u32 MGRWRAP_UnregisterObject(union Trapped_Args *args);
568 + extern u32 MGRWRAP_WaitForBridgeEvents(union Trapped_Args *args);
570 +#ifndef RES_CLEANUP_DISABLE
571 + extern u32 MGRWRAP_GetProcessResourcesInfo(union Trapped_Args *args);
572 +#endif
575 +/* CPRC (Processor) wrapper Functions */
576 + extern u32 PROCWRAP_Attach(union Trapped_Args *args);
577 + extern u32 PROCWRAP_Ctrl(union Trapped_Args *args);
578 + extern u32 PROCWRAP_Detach(union Trapped_Args *args);
579 + extern u32 PROCWRAP_EnumNode_Info(union Trapped_Args *args);
580 + extern u32 PROCWRAP_EnumResources(union Trapped_Args *args);
581 + extern u32 PROCWRAP_GetState(union Trapped_Args *args);
582 + extern u32 PROCWRAP_GetTrace(union Trapped_Args *args);
583 + extern u32 PROCWRAP_Load(union Trapped_Args *args);
584 + extern u32 PROCWRAP_RegisterNotify(union Trapped_Args *args);
585 + extern u32 PROCWRAP_Start(union Trapped_Args *args);
586 + extern u32 PROCWRAP_ReserveMemory(union Trapped_Args *args);
587 + extern u32 PROCWRAP_UnReserveMemory(union Trapped_Args *args);
588 + extern u32 PROCWRAP_Map(union Trapped_Args *args);
589 + extern u32 PROCWRAP_UnMap(union Trapped_Args *args);
590 + extern u32 PROCWRAP_FlushMemory(union Trapped_Args *args);
591 + extern u32 PROCWRAP_Stop(union Trapped_Args *args);
592 + extern u32 PROCWRAP_InvalidateMemory(union Trapped_Args *args);
594 +/* NODE wrapper functions */
595 + extern u32 NODEWRAP_Allocate(union Trapped_Args *args);
596 + extern u32 NODEWRAP_AllocMsgBuf(union Trapped_Args *args);
597 + extern u32 NODEWRAP_ChangePriority(union Trapped_Args *args);
598 + extern u32 NODEWRAP_Connect(union Trapped_Args *args);
599 + extern u32 NODEWRAP_Create(union Trapped_Args *args);
600 + extern u32 NODEWRAP_Delete(union Trapped_Args *args);
601 + extern u32 NODEWRAP_FreeMsgBuf(union Trapped_Args *args);
602 + extern u32 NODEWRAP_GetAttr(union Trapped_Args *args);
603 + extern u32 NODEWRAP_GetMessage(union Trapped_Args *args);
604 + extern u32 NODEWRAP_Pause(union Trapped_Args *args);
605 + extern u32 NODEWRAP_PutMessage(union Trapped_Args *args);
606 + extern u32 NODEWRAP_RegisterNotify(union Trapped_Args *args);
607 + extern u32 NODEWRAP_Run(union Trapped_Args *args);
608 + extern u32 NODEWRAP_Terminate(union Trapped_Args *args);
609 + extern u32 NODEWRAP_GetUUIDProps(union Trapped_Args *args);
611 +/* STRM wrapper functions */
612 + extern u32 STRMWRAP_AllocateBuffer(union Trapped_Args *args);
613 + extern u32 STRMWRAP_Close(union Trapped_Args *args);
614 + extern u32 STRMWRAP_FreeBuffer(union Trapped_Args *args);
615 + extern u32 STRMWRAP_GetEventHandle(union Trapped_Args *args);
616 + extern u32 STRMWRAP_GetInfo(union Trapped_Args *args);
617 + extern u32 STRMWRAP_Idle(union Trapped_Args *args);
618 + extern u32 STRMWRAP_Issue(union Trapped_Args *args);
619 + extern u32 STRMWRAP_Open(union Trapped_Args *args);
620 + extern u32 STRMWRAP_Reclaim(union Trapped_Args *args);
621 + extern u32 STRMWRAP_RegisterNotify(union Trapped_Args *args);
622 + extern u32 STRMWRAP_Select(union Trapped_Args *args);
624 + extern u32 CMMWRAP_CallocBuf(union Trapped_Args *args);
625 + extern u32 CMMWRAP_FreeBuf(union Trapped_Args *args);
626 + extern u32 CMMWRAP_GetHandle(union Trapped_Args *args);
627 + extern u32 CMMWRAP_GetInfo(union Trapped_Args *args);
629 +#endif /* _WCD_ */
630 Index: lk/arch/arm/plat-omap/include/bridge/brddefs.h
631 ===================================================================
632 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
633 +++ lk/arch/arm/plat-omap/include/bridge/brddefs.h 2008-08-18 10:38:34.000000000 +0300
634 @@ -0,0 +1,54 @@
636 + * arch/arm/plat-omap/include/bridge/brddefs.h
638 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
640 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
642 + * This package is free software; you can redistribute it and/or modify
643 + * it under the terms of the GNU General Public License version 2 as
644 + * published by the Free Software Foundation.
646 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
647 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
648 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
649 + */
653 + * ======== brddefs.h ========
654 + * Description:
655 + * Global BRD constants and types, shared between WSX, WCD, and WMD.
657 + *! Revision History:
658 + *! ================
659 + *! 31-Jan-2000 rr: Comment Exec changed to Monitor
660 + *! 22-Jul-1999 jeh Added BRD_LOADED state.
661 + *! 26-Mar-1997 gp: Added BRD_SYNCINIT state.
662 + *! 11-Dec-1996 cr: Added BRD_LASTSTATE definition.
663 + *! 11-Jul-1996 gp: Added missing u32 callback argument to BRD_CALLBACK.
664 + *! 10-Jun-1996 gp: Created from board.h and brd.h.
665 + */
667 +#ifndef BRDDEFS_
668 +#define BRDDEFS_
670 +/* platform status values */
671 +#define BRD_STOPPED 0x0 /* No Monitor Loaded, Not running. */
672 +#define BRD_IDLE 0x1 /* Monitor Loaded, but suspended. */
673 +#define BRD_RUNNING 0x2 /* Monitor loaded, and executing. */
674 +#define BRD_UNKNOWN 0x3 /* Board state is indeterminate. */
675 +#define BRD_SYNCINIT 0x4
676 +#define BRD_LOADED 0x5
677 +#define BRD_LASTSTATE BRD_LOADED /* Set to highest legal board state. */
678 +#define BRD_SLEEP_TRANSITION 0x6 /* Sleep transition in progress */
679 +#define BRD_HIBERNATION 0x7 /* MPU initiated hibernation */
680 +#define BRD_RETENTION 0x8 /* Retention mode */
681 +#define BRD_DSP_HIBERNATION 0x9 /* DSP initiated hibernation */
683 + typedef u32 BRD_STATUS;
685 +/* BRD Object */
686 + struct BRD_OBJECT;
688 +#endif /* BRDDEFS_ */
689 Index: lk/arch/arm/plat-omap/include/bridge/cfg.h
690 ===================================================================
691 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
692 +++ lk/arch/arm/plat-omap/include/bridge/cfg.h 2008-08-18 10:38:34.000000000 +0300
693 @@ -0,0 +1,339 @@
695 + * arch/arm/plat-omap/include/bridge/cfg.h
697 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
699 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
701 + * This package is free software; you can redistribute it and/or modify
702 + * it under the terms of the GNU General Public License version 2 as
703 + * published by the Free Software Foundation.
705 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
706 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
707 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
708 + */
712 + * ======== cfg.h ========
713 + * Purpose:
714 + * PM Configuration module.
716 + * Private Functions:
717 + * CFG_Exit
718 + * CFG_GetAutoStart
719 + * CFG_GetCDVersion
720 + * CFG_GetDevObject
721 + * CFG_GetDSPResources
722 + * CFG_GetExecFile
723 + * CFG_GetHostResources
724 + * CFG_GetObject
725 + * CFG_GetPerfValue
726 + * CFG_GetWMDFileName
727 + * CFG_GetZLFile
728 + * CFG_Init
729 + * CFG_SetDevObject
730 + * CFG_SetObject
732 + *! Revision History:
733 + *! =================
734 + *! 26-Feb-2003 kc Removed unused CFG fxns.
735 + *! 28-Aug-2001 jeh Added CFG_GetLoaderName.
736 + *! 26-Jul-2000 rr: Added CFG_GetDCDName to retrieve the DCD Dll name.
737 + *! 13-Jul-2000 rr: Added CFG_GetObject & CFG_SetObject.
738 + *! 13-Jan-2000 rr: CFG_Get/SetPrivateDword renamed to CFG_Get/SetDevObject.
739 + *! CFG_GetWinBRIDGEDir/Directory,CFG_GetSearchPath removed.
740 + *! 15-Jan-1998 cr: Code review cleanup.
741 + *! 16-Aug-1997 cr: Added explicit cdecl identifiers.
742 + *! 12-Dec-1996 gp: Moved CFG_FindInSearchPath to CSP module.
743 + *! 13-Sep-1996 gp: Added CFG_GetBoardName().
744 + *! 22-Jul-1996 gp: Added CFG_GetTraceStr, to retrieve an initial GT trace.
745 + *! 26-Jun-1996 cr: Added CFG_FindInSearchPath.
746 + *! 25-Jun-1996 cr: Added CFG_GetWinSPOXDir.
747 + *! 17-Jun-1996 cr: Added CFG_GetDevNode.
748 + *! 11-Jun-1996 cr: Cleaned up for code review.
749 + *! 07-Jun-1996 cr: Added CFG_GetExecFile and CFG_GetZLFileName functions.
750 + *! 04-Jun-1996 gp: Added AutoStart regkey and accessor function. Placed
751 + *! OUT parameters in accessor function param. lists at end.
752 + *! 29-May-1996 gp: Moved DEV_HDEVNODE to here and renamed CFG_HDEVNODE.
753 + *! 22-May-1996 cr: Added GetHostResources, GetDSPResources, and
754 + *! GetWMDFileName services.
755 + *! 18-May-1996 gp: Created.
756 + */
758 +#ifndef CFG_
759 +#define CFG_
760 +#include <host_os.h>
761 +#include <cfgdefs.h>
764 + * ======== CFG_Exit ========
765 + * Purpose:
766 + * Discontinue usage of the CFG module.
767 + * Parameters:
768 + * Returns:
769 + * Requires:
770 + * CFG_Init() was previously called.
771 + * Ensures:
772 + * Resources acquired in CFG_Init() are freed.
773 + */
774 + extern void CFG_Exit();
777 + * ======== CFG_GetAutoStart ========
778 + * Purpose:
779 + * Retreive the autostart mask, if any, for this board.
780 + * Parameters:
781 + * hDevNode: Handle to the DevNode who's WMD we are querying.
782 + * pdwAutoStart: Ptr to location for 32 bit autostart mask.
783 + * Returns:
784 + * DSP_SOK: Success.
785 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
786 + * CFG_E_RESOURCENOTAVAIL: Unable to retreive resource.
787 + * Requires:
788 + * CFG initialized.
789 + * Ensures:
790 + * DSP_SOK: *pdwAutoStart contains autostart mask for this devnode.
791 + */
792 + extern DSP_STATUS CFG_GetAutoStart(IN struct CFG_DEVNODE *hDevNode,
793 + OUT u32 *pdwAutoStart);
796 + * ======== CFG_GetCDVersion ========
797 + * Purpose:
798 + * Retrieves the version of the PM Class Driver.
799 + * Parameters:
800 + * pdwVersion: Ptr to u32 to contain version number upon return.
801 + * Returns:
802 + * DSP_SOK: Success. pdwVersion contains Class Driver version in
803 + * the form: 0xAABBCCDD where AABB is Major version and
804 + * CCDD is Minor.
805 + * DSP_EFAIL: Failure.
806 + * Requires:
807 + * CFG initialized.
808 + * Ensures:
809 + * DSP_SOK: Success.
810 + * else: *pdwVersion is NULL.
811 + */
812 + extern DSP_STATUS CFG_GetCDVersion(OUT u32 *pdwVersion);
815 + * ======== CFG_GetDevObject ========
816 + * Purpose:
817 + * Retrieve the Device Object handle for a given devnode.
818 + * Parameters:
819 + * hDevNode: Platform's DevNode handle from which to retrieve value.
820 + * pdwValue: Ptr to location to store the value.
821 + * Returns:
822 + * DSP_SOK: Success.
823 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
824 + * CFG_E_INVALIDPOINTER: phDevObject is invalid.
825 + * CFG_E_RESOURCENOTAVAIL: The resource is not available.
826 + * Requires:
827 + * CFG initialized.
828 + * Ensures:
829 + * DSP_SOK: *pdwValue is set to the retrieved u32.
830 + * else: *pdwValue is set to 0L.
831 + */
832 + extern DSP_STATUS CFG_GetDevObject(IN struct CFG_DEVNODE *hDevNode,
833 + OUT u32 *pdwValue);
836 + * ======== CFG_GetDSPResources ========
837 + * Purpose:
838 + * Get the DSP resources available to a given device.
839 + * Parameters:
840 + * hDevNode: Handle to the DEVNODE who's resources we are querying.
841 + * pDSPResTable: Ptr to a location to store the DSP resource table.
842 + * Returns:
843 + * DSP_SOK: On success.
844 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
845 + * CFG_E_RESOURCENOTAVAIL: The DSP Resource information is not
846 + * available
847 + * Requires:
848 + * CFG initialized.
849 + * Ensures:
850 + * DSP_SOK: pDSPResTable points to a filled table of resources allocated
851 + * for the specified WMD.
852 + */
853 + extern DSP_STATUS CFG_GetDSPResources(IN struct CFG_DEVNODE *hDevNode,
854 + OUT struct CFG_DSPRES *pDSPResTable);
858 + * ======== CFG_GetExecFile ========
859 + * Purpose:
860 + * Retreive the default executable, if any, for this board.
861 + * Parameters:
862 + * hDevNode: Handle to the DevNode who's WMD we are querying.
863 + * cBufSize: Size of buffer.
864 + * pstrExecFile: Ptr to character buf to hold ExecFile.
865 + * Returns:
866 + * DSP_SOK: Success.
867 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
868 + * CFG_E_INVALIDPOINTER: pstrExecFile is invalid.
869 + * CFG_E_RESOURCENOTAVAIL: The resource is not available.
870 + * Requires:
871 + * CFG initialized.
872 + * Ensures:
873 + * DSP_SOK: Not more than cBufSize bytes were copied into pstrExecFile,
874 + * and *pstrExecFile contains default executable for this
875 + * devnode.
876 + */
877 + extern DSP_STATUS CFG_GetExecFile(IN struct CFG_DEVNODE *hDevNode,
878 + IN u32 cBufSize,
879 + OUT char *pstrExecFile);
882 + * ======== CFG_GetHostResources ========
883 + * Purpose:
884 + * Get the Host PC allocated resources assigned to a given device.
885 + * Parameters:
886 + * hDevNode: Handle to the DEVNODE who's resources we are querying.
887 + * pHostResTable: Ptr to a location to store the host resource table.
888 + * Returns:
889 + * DSP_SOK: On success.
890 + * CFG_E_INVALIDPOINTER: pHostResTable is invalid.
891 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
892 + * CFG_E_RESOURCENOTAVAIL: The resource is not available.
893 + * Requires:
894 + * CFG initialized.
895 + * Ensures:
896 + * DSP_SOK: pHostResTable points to a filled table of resources
897 + * allocated for the specified WMD.
899 + */
900 + extern DSP_STATUS CFG_GetHostResources(IN struct CFG_DEVNODE *hDevNode,
901 + OUT struct CFG_HOSTRES *pHostResTable);
904 + * ======== CFG_GetObject ========
905 + * Purpose:
906 + * Retrieve the Driver Object handle From the Registry
907 + * Parameters:
908 + * pdwValue: Ptr to location to store the value.
909 + * dwType Type of Object to Get
910 + * Returns:
911 + * DSP_SOK: Success.
912 + * Requires:
913 + * CFG initialized.
914 + * Ensures:
915 + * DSP_SOK: *pdwValue is set to the retrieved u32(non-Zero).
916 + * else: *pdwValue is set to 0L.
917 + */
918 + extern DSP_STATUS CFG_GetObject(OUT u32 *pdwValue, u32 dwType);
921 + * ======== CFG_GetPerfValue ========
922 + * Purpose:
923 + * Retrieve a flag indicating whether PERF should log statistics for the
924 + * PM class driver.
925 + * Parameters:
926 + * pfEnablePerf: Location to store flag. 0 indicates the key was
927 + * not found, or had a zero value. A nonzero value
928 + * means the key was found and had a nonzero value.
929 + * Returns:
930 + * Requires:
931 + * pfEnablePerf != NULL;
932 + * Ensures:
933 + */
934 + extern void CFG_GetPerfValue(OUT bool *pfEnablePerf);
937 + * ======== CFG_GetWMDFileName ========
938 + * Purpose:
939 + * Get the mini-driver file name for a given device.
940 + * Parameters:
941 + * hDevNode: Handle to the DevNode who's WMD we are querying.
942 + * cBufSize: Size of buffer.
943 + * pWMDFileName: Ptr to a character buffer to hold the WMD filename.
944 + * Returns:
945 + * DSP_SOK: On success.
946 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
947 + * CFG_E_RESOURCENOTAVAIL: The filename is not available.
948 + * Requires:
949 + * CFG initialized.
950 + * Ensures:
951 + * DSP_SOK: Not more than cBufSize bytes were copied
952 + * into pWMDFileName.
954 + */
955 + extern DSP_STATUS CFG_GetWMDFileName(IN struct CFG_DEVNODE *hDevNode,
956 + IN u32 cBufSize,
957 + OUT char *pWMDFileName);
960 + * ======== CFG_GetZLFile ========
961 + * Purpose:
962 + * Retreive the ZLFile, if any, for this board.
963 + * Parameters:
964 + * hDevNode: Handle to the DevNode who's WMD we are querying.
965 + * cBufSize: Size of buffer.
966 + * pstrZLFileName: Ptr to character buf to hold ZLFileName.
967 + * Returns:
968 + * DSP_SOK: Success.
969 + * CFG_E_INVALIDPOINTER: pstrZLFileName is invalid.
970 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
971 + * CFG_E_RESOURCENOTAVAIL: couldn't find the ZLFileName.
972 + * Requires:
973 + * CFG initialized.
974 + * Ensures:
975 + * DSP_SOK: Not more than cBufSize bytes were copied into
976 + * pstrZLFileName, and *pstrZLFileName contains ZLFileName
977 + * for this devnode.
978 + */
979 + extern DSP_STATUS CFG_GetZLFile(IN struct CFG_DEVNODE *hDevNode,
980 + IN u32 cBufSize,
981 + OUT char *pstrZLFileName);
984 + * ======== CFG_Init ========
985 + * Purpose:
986 + * Initialize the CFG module's private state.
987 + * Parameters:
988 + * Returns:
989 + * TRUE if initialized; FALSE if error occured.
990 + * Requires:
991 + * Ensures:
992 + * A requirement for each of the other public CFG functions.
993 + */
994 + extern bool CFG_Init();
997 + * ======== CFG_SetDevObject ========
998 + * Purpose:
999 + * Store the Device Object handle for a given devnode.
1000 + * Parameters:
1001 + * hDevNode: Platform's DevNode handle we are storing value with.
1002 + * dwValue: Arbitrary value to store.
1003 + * Returns:
1004 + * DSP_SOK: Success.
1005 + * CFG_E_INVALIDHDEVNODE: hDevNode is invalid.
1006 + * DSP_EFAIL: Internal Error.
1007 + * Requires:
1008 + * CFG initialized.
1009 + * Ensures:
1010 + * DSP_SOK: The Private u32 was successfully set.
1011 + */
1012 + extern DSP_STATUS CFG_SetDevObject(IN struct CFG_DEVNODE *hDevNode,
1013 + IN u32 dwValue);
1016 + * ======== CFG_SetDrvObject ========
1017 + * Purpose:
1018 + * Store the Driver Object handle.
1019 + * Parameters:
1020 + * dwValue: Arbitrary value to store.
1021 + * dwType Type of Object to Store
1022 + * Returns:
1023 + * DSP_SOK: Success.
1024 + * DSP_EFAIL: Internal Error.
1025 + * Requires:
1026 + * CFG initialized.
1027 + * Ensures:
1028 + * DSP_SOK: The Private u32 was successfully set.
1029 + */
1030 + extern DSP_STATUS CFG_SetObject(IN u32 dwValue, IN u32 dwType);
1032 +#endif /* CFG_ */
1033 Index: lk/arch/arm/plat-omap/include/bridge/cfgdefs.h
1034 ===================================================================
1035 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1036 +++ lk/arch/arm/plat-omap/include/bridge/cfgdefs.h 2008-08-18 10:38:34.000000000 +0300
1037 @@ -0,0 +1,127 @@
1039 + * arch/arm/plat-omap/include/bridge/cfgdefs.h
1041 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
1043 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
1045 + * This package is free software; you can redistribute it and/or modify
1046 + * it under the terms of the GNU General Public License version 2 as
1047 + * published by the Free Software Foundation.
1049 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1050 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1051 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1052 + */
1055 + * ======== cfgdefs.h ========
1056 + * Purpose:
1057 + * Global CFG constants and types, shared between class and mini driver.
1059 + *! Revision History:
1060 + *! ================
1061 + *! 24-Feb-2003 kc Removed wIOPort* in CFG_HOSTRES.
1062 + *! 06-Sep-2000 jeh Added channel info to CFG_HOSTRES.
1063 + *! 09-May-2000 rr: CFG_HOSTRES now support multiple windows for PCI support.
1064 + *! 31-Jan-2000 rr: Comments changed after code review.
1065 + *! 06-Jan-2000 rr: Bus Type included in CFG_HOSTRES.
1066 + *! 12-Nov-1999 rr: CFG_HOSTRES member names changed.
1067 + *! 25-Oct-1999 rr: Modified the CFG_HOSTRES Structure
1068 + *! PCMCIA ISR Register/Unregister fxn removed..
1069 + *! New flag PCCARD introduced during compile time.
1070 + *! 10-Sep-1999 ww: Added PCMCIA ISR Register/Unregister fxn.
1071 + *! 01-Sep-1999 ag: Removed NT/95 specific fields in CFG_HOSTRES
1072 + *! 27-Oct-1997 cr: Updated CFG_HOSTRES struct to support 1+ IRQs per board.
1073 + *! 17-Sep-1997 gp: Tacked some NT config info to end of CFG_HOSTRES structure.
1074 + *! 12-Dec-1996 cr: Cleaned up after code review.
1075 + *! 14-Nov-1996 gp: Renamed from wsxcfg.h
1076 + *! 19-Jun-1996 cr: Created.
1077 + */
1079 +#ifndef CFGDEFS_
1080 +#define CFGDEFS_
1082 +/* Maximum length of module search path. */
1083 +#define CFG_MAXSEARCHPATHLEN 255
1085 +/* Maximum length of general paths. */
1086 +#define CFG_MAXPATH 255
1088 +/* Host Resources: */
1089 +#define CFG_MAXMEMREGISTERS 9
1090 +#define CFG_MAXIOPORTS 20
1091 +#define CFG_MAXIRQS 7
1092 +#define CFG_MAXDMACHANNELS 7
1094 +/* IRQ flag */
1095 +#define CFG_IRQSHARED 0x01 /* IRQ can be shared */
1097 +/* DSP Resources: */
1098 +#define CFG_DSPMAXMEMTYPES 10
1099 +#define CFG_DEFAULT_NUM_WINDOWS 1 /* We support only one window. */
1101 +/* A platform-related device handle: */
1102 + struct CFG_DEVNODE;
1105 + * Host resource structure.
1106 + */
1107 + struct CFG_HOSTRES {
1108 + u32 wNumMemWindows; /* Set to default */
1109 + /* This is the base.memory */
1110 + u32 dwMemBase[CFG_MAXMEMREGISTERS]; /* SHM virtual address */
1111 + u32 dwMemLength[CFG_MAXMEMREGISTERS]; /* Length of the Base */
1112 + u32 dwMemPhys[CFG_MAXMEMREGISTERS]; /* SHM Physical address */
1113 + u8 bIRQRegisters; /* IRQ Number */
1114 + u8 bIRQAttrib; /* IRQ Attribute */
1115 + u32 dwOffsetForMonitor; /* The Shared memory starts from
1116 + * dwMemBase + this offset */
1117 + u32 dwBusType; /* Bus type for this device */
1118 + u32 dwProgBase; /* DSP ProgBase */
1119 + u32 dwProgLength; /* DSP ProgBase Length */
1120 + u32 dwRegBase; /* DSP memory mapped register base */
1121 + u32 dwRegLength; /* DSP Register Base Length */
1122 + u32 ClientHandle; /* Client Handle */
1123 + u32 SocketHandle; /* Socket and Function Pair */
1124 + u32 CardInfo; /* This will be used as a context data in
1125 + * in the CardRequestIRQ */
1126 + /*
1127 + * Info needed by NODE for allocating channels to communicate with RMS:
1128 + * dwChnlOffset: Offset of RMS channels. Lower channels are
1129 + * reserved.
1130 + * dwChnlBufSize: Size of channel buffer to send to RMS
1131 + * dwNumChnls: Total number of channels (including reserved).
1132 + */
1133 + u32 dwChnlOffset;
1134 + u32 dwChnlBufSize;
1135 + u32 dwNumChnls;
1137 +#ifdef CONFIG_ARCH_OMAP3430
1138 + u32 dwPrmBase;
1139 + u32 dwCmBase;
1140 + u32 dwPerBase;
1141 + u32 dwWdTimerDspBase;
1142 + u32 dwMboxBase;
1143 + u32 dwDmmuBase;
1144 + u32 dwDipiBase;
1145 + u32 dwSysCtrlBase;
1146 +#endif
1147 + } ;
1149 + struct CFG_DSPMEMDESC {
1150 + u32 uMemType; /* Type of memory. */
1151 + u32 ulMin; /* Minimum amount of memory of this type. */
1152 + u32 ulMax; /* Maximum amount of memory of this type. */
1153 + } ;
1155 + struct CFG_DSPRES {
1156 + u32 uChipType; /* DSP chip type. */
1157 + u32 uWordSize; /* Number of bytes in a word */
1158 + u32 cChips; /* Number of chips. */
1159 + u32 cMemTypes; /* Types of memory. */
1160 + struct CFG_DSPMEMDESC aMemDesc[CFG_DSPMAXMEMTYPES];
1161 + /* DSP Memory types */
1162 + } ;
1164 +#endif /* CFGDEFS_ */
1165 Index: lk/arch/arm/plat-omap/include/bridge/chnl.h
1166 ===================================================================
1167 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1168 +++ lk/arch/arm/plat-omap/include/bridge/chnl.h 2008-08-18 10:38:34.000000000 +0300
1169 @@ -0,0 +1,537 @@
1171 + * arch/arm/plat-omap/include/bridge/chnl.h
1173 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
1175 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
1177 + * This package is free software; you can redistribute it and/or modify
1178 + * it under the terms of the GNU General Public License version 2 as
1179 + * published by the Free Software Foundation.
1181 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1182 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1183 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1184 + */
1188 + * ======== chnl.h ========
1189 + * Description:
1190 + * WCD channel interface: multiplexes data streams through the single
1191 + * physical link managed by a mini-driver.
1193 + * Public Functions:
1194 + * CHNL_AddIOReq
1195 + * CHNL_AllocBuffer
1196 + * CHNL_CancelIO
1197 + * CHNL_Close
1198 + * CHNL_CloseOrphans
1199 + * CHNL_Create
1200 + * CHNL_Destroy
1201 + * CHNL_Exit
1202 + * CHNL_FlushIO
1203 + * CHNL_FreeBuffer
1204 + * CHNL_GetEventHandle
1205 + * CHNL_GetHandle
1206 + * CHNL_GetIOCompletion
1207 + * CHNL_GetId
1208 + * CHNL_GetMgr
1209 + * CHNL_GetMode
1210 + * CHNL_GetPosition
1211 + * CHNL_GetProcessHandle
1212 + * CHNL_Init
1213 + * CHNL_Open
1215 + * Notes:
1216 + * See DSP API chnl.h for more details.
1218 + *! Revision History:
1219 + *! ================
1220 + *! 14-Jan-1997 gp: Updated based on code review feedback.
1221 + *! 24-Oct-1996 gp: Move CloseOrphans into here from dspsys.
1222 + *! 09-Sep-1996 gp: Added CHNL_GetProcessID() and CHNL_GetHandle().
1223 + *! 10-Jul-1996 gp: Created.
1224 + */
1226 +#ifndef CHNL_
1227 +#define CHNL_
1229 +#include <chnlpriv.h>
1232 + * ======== CHNL_AddIOReq ========
1233 + * Purpose:
1234 + * Enqueue an I/O request for data transfer with the DSP on this channel.
1235 + * The direction (mode) is specified in the channel object.
1236 + * Parameters:
1237 + * hChnl: Channel object handle.
1238 + * pHostBuf: Host buffer address source.
1239 + * cBytes: Number of PC bytes to transfer. A zero value indicates
1240 + * that this buffer is the last in the output channel.
1241 + * A zero value is invalid for an input channel.
1242 + * Returns:
1243 + * DSP_SOK: Success;
1244 + * DSP_EHANDLE: Invalid hChnl.
1245 + * DSP_EPOINTER: pHostBuf is invalid.
1246 + * CHNL_E_NOEOS: User cannot mark EOS on an input channel.
1247 + * CHNL_E_CANCELLED: I/O has been cancelled on this channel. No further
1248 + * I/O is allowed.
1249 + * CHNL_E_EOS: End of stream was already marked on a previous
1250 + * IORequest on this output channel. Not returned for
1251 + * input channels.
1252 + * CHNL_E_NOIORPS: No free IO request packets available for queuing.
1253 + * CHNL_E_BUFSIZE: Buffer submitted to this output channel is larger than
1254 + * the size of the physical shared memory output window.
1255 + * Requires:
1256 + * CHNL_Init() called.
1257 + * pHostBuf points to memory which can be safely accessed at interrupt
1258 + * time without page fault.
1259 + * Ensures:
1260 + * The buffer will be transferred if the channel is ready; otherwise, will
1261 + * be queued for transfer when the channel becomes ready. In any case,
1262 + * notifications of I/O completion are asynchronous.
1263 + * If cBytes is 0 for an output channel, subsequent CHNL_AddIOReq's on
1264 + * this channel will fail with error code CHNL_E_EOS. The corresponding
1265 + * IOC for this I/O request will have its status flag set to
1266 + * CHNL_IOCSTATEOS.
1267 + */
1268 + extern DSP_STATUS CHNL_AddIOReq(struct CHNL_OBJECT *hChnl,
1269 + void *pHostBuf,
1270 + u32 cBytes);
1273 + * ======== CHNL_AllocBuffer ========
1274 + * Purpose:
1275 + * Allocate a zero-initialized buffer to be used in data transfers though
1276 + * a channel managed by this channel manager.
1277 + * Parameters:
1278 + * ppBuf: Location to store buffer pointer.
1279 + * hChnlMgr: Handle to a valid channel manager.
1280 + * cBytes: Size of buffer in bytes. Must be greater than zero.
1281 + * Returns:
1282 + * DSP_SOK: Success.
1283 + * DSP_EPOINTER: ppBuf is invalid.
1284 + * DSP_EHANDLE: hChnlMgr is invalid.
1285 + * DSP_EMEMORY: Insufficient memory to allocate buffer.
1286 + * DSP_EINVALIDARG: Invalid cBytes value.
1287 + * Requires:
1288 + * CHNL_Init() called.
1289 + * Ensures:
1290 + * DSP_SOK: *ppBuf points to memory which can be accessed in
1291 + * any context.
1292 + * else: *ppBuf contains NULL if ppBuf != NULL.
1293 + */
1294 + extern DSP_STATUS CHNL_AllocBuffer(OUT void **ppBuf,
1295 + struct CHNL_MGR *hChnlMgr,
1296 + u32 cBytes);
1299 + * ======== CHNL_CancelIO ========
1300 + * Purpose:
1301 + * Return all I/O requests to the client which have not yet been
1302 + * transferred. The channel's I/O completion object is
1303 + * signalled, and all the I/O requests are queued as IOC's, with the
1304 + * status field set to CHNL_IOCSTATCANCEL.
1305 + * This call is typically used in abort situations, and is a prelude to
1306 + * CHNL_Close();
1307 + * Parameters:
1308 + * hChnl: Channel object handle.
1309 + * Returns:
1310 + * DSP_SOK: Success;
1311 + * DSP_EHANDLE: Invalid hChnl.
1312 + * Requires:
1313 + * CHNL_Init() called.
1314 + * Ensures:
1315 + * Subsequent I/O requests to this channel will not be accepted.
1316 + */
1317 + extern DSP_STATUS CHNL_CancelIO(struct CHNL_OBJECT *hChnl);
1320 + * ======== CHNL_Close ========
1321 + * Purpose:
1322 + * Ensures all pending I/O on this channel is cancelled, discards all
1323 + * queued I/O completion notifications, then frees the resources allocated
1324 + * for this channel, and makes the corresponding logical channel id
1325 + * available for subsequent use.
1326 + * Parameters:
1327 + * hChnl: Channel object handle.
1328 + * Returns:
1329 + * DSP_SOK: Success;
1330 + * DSP_EHANDLE: Invalid hChnl.
1331 + * Requires:
1332 + * CHNL_Init() called.
1333 + * No thread must be blocked on this channel's I/O completion event.
1334 + * Ensures:
1335 + * DSP_SOK: The I/O completion event for this channel is freed.
1336 + * hChnl is no longer valid.
1337 + */
1338 + extern DSP_STATUS CHNL_Close(struct CHNL_OBJECT *hChnl);
1341 + * ======== CHNL_CloseOrphans ========
1342 + * Purpose:
1343 + * Close open channels orphaned by a closing process.
1344 + * Parameters:
1345 + * hChnlMgr: Channel manager holding the channels.
1346 + * hProcess: Kernel mode handle of the process claiming the channels.
1347 + * Returns:
1348 + * DSP_SOK: Success.
1349 + * DSP_SFALSE: No channels were left open by this process.
1350 + * DSP_EHANDLE: Invalid hChnlMgr handle.
1351 + * Requires:
1352 + * CHNL_Init() called.
1353 + * Ensures:
1354 + */
1355 + extern DSP_STATUS CHNL_CloseOrphans(struct CHNL_MGR *hChnlMgr,
1356 + HANDLE hProcess);
1359 + * ======== CHNL_Create ========
1360 + * Purpose:
1361 + * Create a channel manager object, responsible for opening new channels
1362 + * and closing old ones for a given board.
1363 + * Parameters:
1364 + * phChnlMgr: Location to store a channel manager object on output.
1365 + * hDevObject: Handle to a device object.
1366 + * pMgrAttrs: Channel manager attributes.
1367 + * pMgrAttrs->cChannels: Max channels
1368 + * pMgrAttrs->bIRQ: Channel's I/O IRQ number.
1369 + * pMgrAttrs->fShared: TRUE if the IRQ is shareable.
1370 + * pMgrAttrs->uWordSize: DSP Word size in equivalent PC bytes..
1371 + * Returns:
1372 + * DSP_SOK: Success;
1373 + * DSP_EHANDLE: hDevObject is invalid.
1374 + * DSP_EINVALIDARG: cChannels is 0.
1375 + * DSP_EMEMORY: Insufficient memory for requested resources.
1376 + * CHNL_E_ISR: Unable to plug channel ISR for configured IRQ.
1377 + * CHNL_E_MAXCHANNELS: This manager cannot handle this many channels.
1378 + * CHNL_E_INVALIDIRQ: Invalid IRQ number. Must be 0 <= bIRQ <= 15.
1379 + * CHNL_E_INVALIDWORDSIZE: Invalid DSP word size. Must be > 0.
1380 + * CHNL_E_INVALIDMEMBASE: Invalid base address for DSP communications.
1381 + * CHNL_E_MGREXISTS: Channel manager already exists for this device.
1382 + * Requires:
1383 + * CHNL_Init() called.
1384 + * phChnlMgr != NULL.
1385 + * pMgrAttrs != NULL.
1386 + * Ensures:
1387 + * DSP_SOK: Subsequent calls to CHNL_Create() for the same
1388 + * board without an intervening call to
1389 + * CHNL_Destroy() will fail.
1390 + */
1391 + extern DSP_STATUS CHNL_Create(OUT struct CHNL_MGR **phChnlMgr,
1392 + struct DEV_OBJECT *hDevObject,
1393 + IN CONST struct CHNL_MGRATTRS *pMgrAttrs);
1396 + * ======== CHNL_Destroy ========
1397 + * Purpose:
1398 + * Close all open channels, and destroy the channel manager.
1399 + * Parameters:
1400 + * hChnlMgr: Channel manager object.
1401 + * Returns:
1402 + * DSP_SOK: Success.
1403 + * DSP_EHANDLE: hChnlMgr was invalid.
1404 + * Requires:
1405 + * CHNL_Init() called.
1406 + * Ensures:
1407 + * DSP_SOK: Cancels I/O on each open channel.
1408 + * Closes each open channel.
1409 + * CHNL_Create may subsequently be called for the
1410 + * same board.
1411 + */
1412 + extern DSP_STATUS CHNL_Destroy(struct CHNL_MGR *hChnlMgr);
1415 + * ======== CHNL_Exit ========
1416 + * Purpose:
1417 + * Discontinue usage of the CHNL module.
1418 + * Parameters:
1419 + * Returns:
1420 + * Requires:
1421 + * CHNL_Init() previously called.
1422 + * Ensures:
1423 + * Resources, if any acquired in CHNL_Init(), are freed when the last
1424 + * client of CHNL calls CHNL_Exit().
1425 + */
1426 + extern void CHNL_Exit();
1429 + * ======== CHNL_FlushIO ========
1430 + * Purpose:
1431 + * For an output stream (to the DSP), flush all pending IO requests to the
1432 + * output device. This function will wait for IO completion for each of
1433 + * the queued IO requests, up to the specified timeout (per IOR). For
1434 + * input streams (from the DSP), will cancel all pending IO requests.
1435 + * Parameters:
1436 + * hChnl: Channel object handle.
1437 + * dwTimeOut: Timeout in milliseconds to wait for I/O completion.
1438 + * A value of CHNL_IOCINFINITE means to wait indefinitely.
1439 + * The value of CHNL_IOCNOWAIT is not allowed.
1440 + * Returns:
1441 + * DSP_SOK: Success;
1442 + * DSP_EHANDLE: Invalid hChnl.
1443 + * DSP_EINVALIDARG: dwTimeOut value of CHNL_IOCNOWAIT was given.
1444 + * CHNL_E_WAITTIMEOUT: Wait for flush of output stream timed out.
1445 + * Requires:
1446 + * CHNL_Init() called.
1447 + * Ensures:
1448 + * DSP_SOK: No I/O requests will be pending on this channel.
1449 + */
1450 + extern DSP_STATUS CHNL_FlushIO(struct CHNL_OBJECT *hChnl,
1451 + u32 dwTimeOut);
1454 + * ======== CHNL_FreeBuffer ========
1455 + * Purpose:
1456 + * Free a buffer previously allocated using CHNL_AllocBuffer().
1457 + * Parameters:
1458 + * hChnlMgr: Handle to a valid channel manager.
1459 + * cBytes: Size of buffer in bytes.
1460 + * pBuf: Buffer pointer returned by CHNL_FreeBuffer().
1461 + * Returns:
1462 + * DSP_SOK: Success.
1463 + * DSP_EHANDLE: hChnlMgr is invalid.
1464 + * DSP_EINVALIDARG: pBuf is NULL.
1465 + * Requires:
1466 + * CHNL_Init() called.
1467 + * Ensures:
1468 + */
1469 + extern DSP_STATUS CHNL_FreeBuffer(struct CHNL_MGR *hChnlMgr,
1470 + u32 cBytes,
1471 + void *pBuf);
1474 + * ======== CHNL_GetEventHandle ========
1475 + * Purpose:
1476 + * Retrieve this channel's I/O completion auto-reset event.
1477 + * Parameters:
1478 + * hChnl: Handle to a valid channel object.
1479 + * phEvent: Location to store the I/O completion event object.
1480 + * Returns:
1481 + * DSP_SOK: Success;
1482 + * DSP_EHANDLE: Invalid hChnl.
1483 + * DSP_EPOINTER: phEvent is invalid.
1484 + * Requires:
1485 + * CHNL_Init() called.
1487 + */
1488 + extern DSP_STATUS CHNL_GetEventHandle(struct CHNL_OBJECT *hChnl,
1489 + OUT HANDLE *phEvent);
1492 + * ======== CHNL_GetHandle ========
1493 + * Purpose:
1494 + * Retrieve the channel handle given the logical ID and channel manager.
1495 + * Parameters:
1496 + * hChnlMgr: Handle to a valid channel manager, or NULL.
1497 + * uChnlID: Channel ID.
1498 + * phChnl: Location to store channel handle.
1499 + * Returns:
1500 + * DSP_SOK: Success;
1501 + * DSP_EHANDLE: Invalid hChnlMgr.
1502 + * DSP_EPOINTER: phChnl == NULL.
1503 + * CHNL_E_BADCHANID: Invalid channel ID.
1504 + * Requires:
1505 + * CHNL_Init() called.
1506 + * Ensures:
1507 + * DSP_SOK: *phChnl points to a valid channel object,
1508 + * if phChnl != NULL.
1509 + */
1510 + extern DSP_STATUS CHNL_GetHandle(struct CHNL_MGR *hChnlMgr,
1511 + u32 uChnlID,
1512 + OUT struct CHNL_OBJECT **phChnl);
1515 + * ======== CHNL_GetIOCompletion ========
1516 + * Purpose:
1517 + * Optionally wait for I/O completion on a channel. Dequeue an I/O
1518 + * completion record, which contains information about the completed
1519 + * I/O request.
1520 + * Parameters:
1521 + * hChnl: Channel object handle.
1522 + * dwTimeOut: Timeout in milliseconds to wait for completion.
1523 + * A value of CHNL_IOCINFINITE means to wait indefinitely.
1524 + * A value of CHNL_IOCNOWAIT will simply dequeue the
1525 + * first available IOC.
1526 + * pIOC: On output, contains host buffer address, bytes
1527 + * transferred, and status of I/O completion.
1528 + * pIOC->status: I/O Completion status: see chnldefs.h for definitions.
1529 + * Returns:
1530 + * DSP_SOK: Success.
1531 + * DSP_EHANDLE: Invalid hChnl.
1532 + * DSP_EPOINTER: pIOC is invalid.
1533 + * CHNL_E_NOIOC: CHNL_IOCNOWAIT was specified as the dwTimeOut parameter
1534 + * yet no I/O completions were queued.
1535 + * Requires:
1536 + * CHNL_Init() called.
1537 + * Ensures:
1538 + * DSP_SOK: If there are any remaining IOC's queued before this
1539 + * call returns, the channel event object will be left
1540 + * in a signalled state.
1541 + * If the return status is anything other than DSP_EPOINTER or DSP_SOK,
1542 + * then pIOC->pBuf will be set to NULL, pIOC->cBytes will be 0, and
1543 + * pIOC->status will be undefined.
1544 + */
1545 + extern DSP_STATUS CHNL_GetIOCompletion(struct CHNL_OBJECT *hChnl,
1546 + u32 dwTimeOut,
1547 + OUT struct CHNL_IOC *pIOC);
1550 + * ======== CHNL_GetId ========
1551 + * Purpose:
1552 + * Retrieve the channel logical ID of this channel.
1553 + * Parameters:
1554 + * hChnl: Handle to a valid channel object.
1555 + * pdwID: Location to store logical ID.
1556 + * Returns:
1557 + * DSP_SOK: Success;
1558 + * DSP_EHANDLE: Invalid hChnl.
1559 + * DSP_EPOINTER: pdwID is invalid.
1560 + * Requires:
1561 + * CHNL_Init() called.
1562 + * Ensures:
1563 + */
1564 + extern DSP_STATUS CHNL_GetId(struct CHNL_OBJECT *hChnl,
1565 + OUT u32 *pdwID);
1568 + * ======== CHNL_GetMgr ========
1569 + * Purpose:
1570 + * Retrieve a channel manager handle, required for opening new channels
1571 + * and closing old ones on a given board.
1572 + * Parameters:
1573 + * hDevNode: A valid system specific DEVNODE handle.
1574 + * phChnlMgr: Location to store the channel manager handle on output.
1575 + * Returns:
1576 + * DSP_SOK: Success.
1577 + * DSP_EHANDLE: hDevNode is invalid.
1578 + * CHNL_E_NOMGR: No channel manager exists for this board.
1579 + * Requires:
1580 + * CHNL_Init() called.
1581 + * phChnlMgr != NULL.
1582 + * Ensures:
1583 + * DSP_SOK: The DSP board represented by hDevNode was in the RUNNING state
1584 + * before this function returned.
1585 + * else: *phChnlMgr == NULL.
1586 + */
1587 + extern DSP_STATUS CHNL_GetMgr(struct CFG_DEVNODE *hDevNode,
1588 + OUT struct CHNL_MGR **phChnlMgr);
1591 + * ======== CHNL_GetMode ========
1592 + * Purpose:
1593 + * Retrieve the mode flags of this channel.
1594 + * Parameters:
1595 + * hChnl: Handle to a valid channel object.
1596 + * pMode: Location to store mode flags.
1597 + * Returns:
1598 + * DSP_SOK: Success;
1599 + * DSP_EHANDLE: Invalid hChnl.
1600 + * DSP_EPOINTER: pMode is invalid.
1601 + * Requires:
1602 + * CHNL_Init() called.
1603 + * Ensures:
1604 + */
1605 + extern DSP_STATUS CHNL_GetMode(struct CHNL_OBJECT *hChnl,
1606 + OUT CHNL_MODE * pMode);
1609 + * ======== CHNL_GetPosition ========
1610 + * Purpose:
1611 + * Retrieve the total number of bytes transferred on this channel.
1612 + * Parameters:
1613 + * hChnl: Handle to a valid channel object.
1614 + * pcPosition: Location to store number of bytes.
1615 + * Returns:
1616 + * DSP_SOK: Success;
1617 + * DSP_EHANDLE: Invalid hChnl.
1618 + * DSP_EPOINTER: pcPosition is invalid.
1619 + * Requires:
1620 + * CHNL_Init() called.
1621 + * Ensures:
1622 + */
1623 + extern DSP_STATUS CHNL_GetPosition(struct CHNL_OBJECT *hChnl,
1624 + OUT u32 *pcPosition);
1627 + * ======== CHNL_GetProcessHandle ========
1628 + * Purpose:
1629 + * Retrieve the handle of the process owning this channel.
1630 + * Parameters:
1631 + * hChnl: Channel handle.
1632 + * phProcess: Location to store the process handle. A NULL value
1633 + * indicates the channel is either closed or is not
1634 + * owned by any particular process.
1635 + * Returns:
1636 + * DSP_SOK: Success;
1637 + * DSP_EHANDLE: Invalid hChnl.
1638 + * DSP_EPOINTER: phProcess is invalid.
1639 + * Requires:
1640 + * CHNL_Init() called.
1641 + * Ensures:
1642 + */
1643 + extern DSP_STATUS CHNL_GetProcessHandle(struct CHNL_OBJECT *hChnl,
1644 + OUT HANDLE *phProcess);
1647 + * ======== CHNL_Init ========
1648 + * Purpose:
1649 + * Initialize the CHNL module's private state.
1650 + * Parameters:
1651 + * Returns:
1652 + * TRUE if initialized; FALSE if error occurred.
1653 + * Requires:
1654 + * Ensures:
1655 + * A requirement for each of the other public CHNL functions.
1656 + */
1657 + extern bool CHNL_Init();
1660 + * ======== CHNL_Open ========
1661 + * Purpose:
1662 + * Open a new half-duplex channel to the DSP board.
1663 + * Parameters:
1664 + * phChnl: Location to store a channel object handle.
1665 + * hChnlMgr: Handle to channel manager, as returned by CHNL_GetMgr().
1666 + * uMode: One of {CHNL_MODETODSP, CHNL_MODEFROMDSP} specifies
1667 + * direction of data transfer.
1668 + * uChnlId: If CHNL_PICKFREE is specified, the channel manager will
1669 + * select a free channel id (default);
1670 + * otherwise this field specifies the id of the channel.
1671 + * pAttrs: Channel attributes. Attribute fields are as follows:
1672 + * pAttrs->uIOReqs: Specifies the maximum number of I/O requests which can
1673 + * be pending at any given time. All request packets are
1674 + * preallocated when the channel is opened.
1675 + * pAttrs->hEvent: This field allows the user to supply an auto reset
1676 + * event object for channel I/O completion notifications.
1677 + * It is the responsibility of the user to destroy this
1678 + * object AFTER closing the channel.
1679 + * This channel event object can be retrieved using
1680 + * CHNL_GetEventHandle().
1681 + * pAttrs->hReserved: The kernel mode handle of this event object.
1683 + * Returns:
1684 + * DSP_SOK: Success.
1685 + * DSP_EHANDLE: hChnlMgr is invalid.
1686 + * DSP_EMEMORY: Insufficient memory for requested resources.
1687 + * DSP_EINVALIDARG: Invalid number of IOReqs.
1688 + * CHNL_E_BADMODE: Invalid mode argument.
1689 + * CHNL_E_OUTOFSTREAMS: No free channels available.
1690 + * CHNL_E_BADCHANID: Channel ID is out of range.
1691 + * CHNL_E_CHANBUSY: Channel is in use.
1692 + * Requires:
1693 + * CHNL_Init() called.
1694 + * phChnl != NULL.
1695 + * pAttrs != NULL.
1696 + * pAttrs->hEvent is a valid event handle.
1697 + * Ensures:
1698 + * DSP_SOK: *phChnl is a valid channel.
1699 + * else: *phChnl is set to NULL if (phChnl != NULL);
1700 + */
1701 + extern DSP_STATUS CHNL_Open(OUT struct CHNL_OBJECT **phChnl,
1702 + struct CHNL_MGR *hChnlMgr, CHNL_MODE uMode,
1703 + u32 uChnlId,
1704 + CONST IN struct CHNL_ATTRS *pAttrs);
1706 +#endif /* CHNL_ */
1707 Index: lk/arch/arm/plat-omap/include/bridge/chnl_sm.h
1708 ===================================================================
1709 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1710 +++ lk/arch/arm/plat-omap/include/bridge/chnl_sm.h 2008-08-18 10:38:34.000000000 +0300
1711 @@ -0,0 +1,210 @@
1713 + * dspbridge/inc/chnl_sm.h
1715 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
1717 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
1719 + * This package is free software; you can redistribute it and/or modify
1720 + * it under the terms of the GNU General Public License version 2 as
1721 + * published by the Free Software Foundation.
1723 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1724 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1725 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1726 + */
1730 + * ======== chnl_sm.h ========
1731 + * Description:
1732 + * Prototypes for channel lower edge functions for a WinBRIDGE mini driver
1733 + * implementing data transfer via shared memory.
1735 + * Public Functions:
1736 + * CHNLSM_DisableInterrupt;
1737 + * CHNLSM_DPC;
1738 + * CHNLSM_EnableInterrupt;
1739 + * CHNLSM_InterruptDSP;
1740 + * CHNLSM_ISR;
1741 + * CHNLSM_Read;
1742 + * CHNLSM_UpdateSHMLength;
1743 + * CHNLSM_Write;
1745 + * Notes:
1746 + * These lower edge functions must be implemented by the WMD writer.
1747 + * Currently, CHNLSM_Read() and CHNLSM_Write() are not called, but must
1748 + * be defined to link.
1750 + *! Revision History:
1751 + *! ================
1752 + *! 06-Jan-2002 ag: Added CHNLSM_InterruptDSP2 to set Mailbox value.
1753 + *! 05-Nov-2001 kc: Updated CHNLSM_ISR to read value returned by interrupt.
1754 + *! 21-Jan-2000 ag: Updated comments per code review.
1755 + *! 18-Dec-1997 gp: Added CDECL.
1756 + *! 16-Jun-1997 gp: Added function UpdateSHMLength().
1757 + *! 13-Nov-1996 gp: Renamed CHNL_ to CHNLSM_.
1758 + *! 10-Jul-1996 gp: Created.
1759 + */
1761 +#ifndef CHNLSM_
1762 +#define CHNLSM_
1764 +#include <wmd.h>
1767 + * ======== CHNLSM_DisableInterrupt ========
1768 + * Purpose:
1769 + * Disable interrupts from the DSP board to the PC.
1770 + * Parameters:
1771 + * hDevContext: Handle to mini-driver defined device info.
1772 + * Returns:
1773 + * Requires:
1774 + * Ensures:
1775 + */
1776 + extern DSP_STATUS CDECL CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT*
1777 + hDevContext);
1780 + * ======== CHNLSM_DPC ========
1781 + * Purpose:
1782 + * This mini-driver's deferred processing routine. Finishes processing
1783 + * deferred by the WMD's ISR.
1784 + * Parameters:
1785 + * hDevContext: Handle to mini-driver defined device info.
1786 + * Returns:
1787 + * Requires:
1788 + * Must not block.
1789 + * Must not acquire resources.
1790 + * All data objects touched must be locked in memory.
1791 + * Ensures:
1792 + */
1793 + extern void CDECL CHNLSM_DPC(struct WMD_DEV_CONTEXT *hDevContext);
1796 + * ======== CHNLSM_EnableInterrupt ========
1797 + * Purpose:
1798 + * Enable interrupts from the DSP board to the PC.
1799 + * Parameters:
1800 + * hDevContext: Handle to mini-driver defined device info.
1801 + * Returns:
1802 + * Requires:
1803 + * Ensures:
1804 + */
1805 + extern DSP_STATUS CDECL CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT*
1806 + hDevContext);
1809 + * ======== CHNLSM_InterruptDSP ========
1810 + * Purpose:
1811 + * Send an interrupt to the DSP processor(s).
1812 + * Parameters:
1813 + * hDevContext: Handle to mini-driver defined device info.
1814 + * Returns:
1815 + * DSP_SOK: Interrupt sent;
1816 + * else: Unable to send interrupt.
1817 + * Requires:
1818 + * Ensures:
1819 + */
1820 + extern DSP_STATUS CDECL CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT*
1821 + hDevContext);
1824 + * ======== CHNLSM_InterruptDSP2 ========
1825 + * Purpose:
1826 + * Set interrupt value & send an interrupt to the DSP processor(s).
1827 + * This is typicaly used when mailbox interrupt mechanisms allow data
1828 + * to be associated with interrupt such as for OMAP's CMD/DATA regs.
1829 + * Parameters:
1830 + * hDevContext: Handle to mini-driver defined device info.
1831 + * wMbVal: Value associated with interrupt(e.g. mailbox value).
1832 + * Returns:
1833 + * DSP_SOK: Interrupt sent;
1834 + * else: Unable to send interrupt.
1835 + * Requires:
1836 + * Ensures:
1837 + */
1838 + extern DSP_STATUS CDECL CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT*
1839 + hDevContext, u16 wMbVal);
1842 + * ======== CHNLSM_ISR ========
1843 + * Purpose:
1844 + * Mini-driver's ISR, called by WCD when the board interrupts the host.
1845 + * Parameters:
1846 + * hDevContext: Handle to the mini-driver defined device info.
1847 + * pfSchedDPC: Set to TRUE to schedule a deferred procedure call
1848 + * to advance the channel protocol. The channel class
1849 + * library will call the WMD's CHNLSM_DPC routine during
1850 + * its own DPC, before dispatching I/O.
1851 + * The channel class library should ignore *pfSchedDPC when
1852 + * CHNLSM_ISR returns FALSE.
1853 + * pwMBRegVal: Value of mailbox register.
1854 + * Returns:
1855 + * TRUE if this interrupt is was generated by the DSP board.
1856 + * FALSE otherwise.
1857 + * Requires:
1858 + * Interrupts to the host processor are disabled on entry.
1859 + * Must only call functions which are in page locked memory.
1860 + * Must only call asynchronous OS services.
1861 + * The EOI for this interrupt has already been sent to the PIC.
1862 + * Ensures:
1863 + * If the interrupt is *not* shared, this routine must return TRUE.
1864 + */
1865 + extern bool CDECL CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext,
1866 + OUT bool *pfSchedDPC,
1867 + OUT u16 *pwIntrVal);
1870 + * ======== CHNLSM_Read ========
1871 + * Purpose:
1872 + * Read data from DSP board memory into a Host buffer.
1873 + * Parameters:
1874 + * hDevContext: Handle to mini-driver defined device info.
1875 + * pHostBuf: Pointer to host buffer (Destination).
1876 + * dwDSPAddr: Address on DSP board (Source).
1877 + * ulNumBytes: Number of bytes to transfer.
1878 + * Returns:
1879 + * Requires:
1880 + * Ensures:
1881 + */
1882 + extern DSP_STATUS CDECL CHNLSM_Read(struct WMD_DEV_CONTEXT *hDevContext,
1883 + OUT u8 *pHostBuf,
1884 + u32 dwDSPAddr, u32 ulNumBytes);
1887 + * ======== CHNLSM_UpdateSHMLength ========
1888 + * Purpose:
1889 + * Allow the minidriver a chance to override the SHM length as reported
1890 + * to the mini driver (chnl_sm.lib) by Windows Plug and Play.
1891 + * Parameters:
1892 + * hDevContext: Handle to mini-driver defined device info.
1893 + * pSHMLength: Pointer to size of SHM window (in DSP words).
1894 + * Returns:
1895 + * TRUE if pSHMLength updated; FALSE otherwise.
1896 + * Requires:
1897 + * pSHMLength != NULL.
1898 + * Ensures:
1899 + * No more than sizeof(u32) bytes written to *pSHMLength
1900 + */
1901 + extern bool CHNLSM_UpdateSHMLength(struct WMD_DEV_CONTEXT *hDevContext,
1902 + IN OUT u32 *pSHMLength);
1905 + * ======== CHNLSM_Write ========
1906 + * Purpose:
1907 + * Write data from a Host buffer to DSP board memory.
1908 + * Parameters:
1909 + * hDevContext: Handle to mini-driver defined device info.
1910 + * pHostBuf: Pointer to host buffer (Source).
1911 + * dwDSPAddr: Address on DSP board (Destination).
1912 + * ulNumBytes: Number of bytes to transfer.
1913 + * Returns:
1914 + * Requires:
1915 + * Ensures:
1916 + */
1917 + extern DSP_STATUS CDECL CHNLSM_Write(struct WMD_DEV_CONTEXT *hDevContext,
1918 + IN u8 *pHostBuf,
1919 + u32 dwDSPAddr, u32 ulNumBytes);
1921 +#endif /* CHNLSM_ */
1922 Index: lk/arch/arm/plat-omap/include/bridge/chnldefs.h
1923 ===================================================================
1924 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1925 +++ lk/arch/arm/plat-omap/include/bridge/chnldefs.h 2008-08-18 10:38:34.000000000 +0300
1926 @@ -0,0 +1,92 @@
1928 + * arch/arm/plat-omap/include/bridge/chnldefs.h
1930 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
1932 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
1934 + * This package is free software; you can redistribute it and/or modify
1935 + * it under the terms of the GNU General Public License version 2 as
1936 + * published by the Free Software Foundation.
1938 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1939 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1940 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1941 + */
1945 + * ======== chnldefs.h ========
1946 + * Purpose:
1947 + * System-wide channel objects and constants.
1949 + *! Revision History:
1950 + *! ================
1951 + *! 19-Jan-2002 ag Added cBufSize to IOC.
1952 + *! 05-Jan-2000 ag: Text format cleanup.
1953 + *! 02-Dec-1999 ag: Added new chnl attribute pstrEventName.
1954 + *! 12-Nov-1999 kc: Enabled hEvent attribute for tests.
1955 + *! 01-Nov-1999 ag: hEvent attribute not supported(yet).
1956 + *! 16-Jan-1997 gp: Moved private stuff into chnlpriv.h
1957 + *! 14-Jan-1997 gp: Updated based on code review feedback:
1958 + *! Removed CHNL_MODENOWAIT, CHNL_MODEDIRECT,
1959 + *! 03-Jan-1997 gp: Added channel class library types.
1960 + *! 14-Dec-1996 gp: Moved uChnlId field from CHNL_ATTRS to CHNL_Open().
1961 + *! 10-Dec-1996 gp: Added CHNL_IsTimedOut() macro.
1962 + *! 14-Nov-1996 gp: Renamed from wsxchnl.h.
1963 + *! 09-Sep-1996 gp: Added hReserved2 field to CHNL_ATTRS. Updated CHNL_INFO.
1964 + *! 10-Jul-1996 gp: Created from channel.h.
1965 + */
1967 +#ifndef CHNLDEFS_
1968 +#define CHNLDEFS_
1970 +/* Channel id option. */
1971 +#define CHNL_PICKFREE (~0UL) /* Let manager pick a free channel. */
1973 +/* Channel manager limits: */
1974 +#define CHNL_INITIOREQS 4 /* Default # of I/O requests. */
1976 +/* Channel modes */
1977 +#define CHNL_MODETODSP 0x0000 /* Data streaming to the DSP. */
1978 +#define CHNL_MODEFROMDSP 0x0001 /* Data streaming from the DSP. */
1980 +/* GetIOCompletion flags */
1981 +#define CHNL_IOCINFINITE 0xffffffff /* Wait forever for IO completion. */
1982 +#define CHNL_IOCNOWAIT 0x0 /* Dequeue an IOC, if available. */
1984 +/* IO Completion Record status: */
1985 +#define CHNL_IOCSTATCOMPLETE 0x0000 /* IO Completed. */
1986 +#define CHNL_IOCSTATCANCEL 0x0002 /* IO was cancelled */
1987 +#define CHNL_IOCSTATTIMEOUT 0x0008 /* Wait for IOC timed out. */
1988 +#define CHNL_IOCSTATEOS 0x8000 /* End Of Stream reached. */
1990 +/* Macros for checking I/O Completion status: */
1991 +#define CHNL_IsEOS(ioc) (ioc.status & CHNL_IOCSTATEOS)
1992 +#define CHNL_IsIOComplete(ioc) (!(ioc.status & ~CHNL_IOCSTATEOS))
1993 +#define CHNL_IsIOCancelled(ioc) (ioc.status & CHNL_IOCSTATCANCEL)
1994 +#define CHNL_IsTimedOut(ioc) (ioc.status & CHNL_IOCSTATTIMEOUT)
1996 +/* CHNL types: */
1997 + typedef u32 CHNL_MODE; /* Channel transfer mode. */
1999 +/* Channel attributes: */
2000 + struct CHNL_ATTRS {
2001 + u32 uIOReqs; /* Max # of preallocated I/O requests. */
2002 + HANDLE hEvent; /* User supplied auto-reset event object. */
2003 + char *pstrEventName; /* Ptr to name of user event object. */
2004 + HANDLE hReserved1; /* Reserved for future use. */
2005 + u32 hReserved2; /* Reserved for future use. */
2007 + };
2009 +/* I/O completion record: */
2010 + struct CHNL_IOC {
2011 + void *pBuf; /* Buffer to be filled/emptied. */
2012 + u32 cBytes; /* Bytes transferred. */
2013 + u32 cBufSize; /* Actual buffer size in bytes */
2014 + u32 status; /* Status of IO completion. */
2015 + u32 dwArg; /* User argument associated with pBuf. */
2016 + } ;
2018 +#endif /* CHNLDEFS_ */
2019 Index: lk/arch/arm/plat-omap/include/bridge/chnlpriv.h
2020 ===================================================================
2021 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2022 +++ lk/arch/arm/plat-omap/include/bridge/chnlpriv.h 2008-08-18 10:38:34.000000000 +0300
2023 @@ -0,0 +1,136 @@
2025 + * arch/arm/plat-omap/include/bridge/chnlpriv.h
2027 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
2029 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
2031 + * This package is free software; you can redistribute it and/or modify
2032 + * it under the terms of the GNU General Public License version 2 as
2033 + * published by the Free Software Foundation.
2035 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2036 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2037 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2038 + */
2042 + * ======== chnlpriv.h ========
2043 + * Description:
2044 + * Private channel header shared between DSPSYS, WCD and WMD modules.
2046 + * Public Functions:
2047 + * None.
2049 + * Notes:
2051 + *! Revision History:
2052 + *! ================
2053 + *! 05-Jan-2002 ag Added cChannels(total # of chnls) to CHNL_MGRINFO struct.
2054 + *! Added private CHNL_[PCPY][ZCPY][DDMA].
2055 + *! 17-Nov-2000 jeh Removed IRQ, shared memory from CHNL_MGRATTRS, since these
2056 + *! now belong to IO_ATTRS.
2057 + *! 21-Jan-2000 ag: Code review comments added.
2058 + *! 05-Jan-2000 ag: Text format cleanup.
2059 + *! 11-Dec-1999 ag: Added CHNL_MAXLOCKPAGES for CHNL_PrepareBuffer().
2060 + *! 04-Dec-1999 ag: Added CHNL_MAXEVTNAMELEN for i/o compl named event support.
2061 + *! 01-Nov-1999 ag: CHNL_MAXCHANNELS set to 16 for 16-bit DSPs.
2062 + *! 27-Oct-1997 cr: Expanded CHNL_MAXIRQ from 0x0f to 0xff.
2063 + *! 16-Jan-1997 gp: Moved symbols into here from chnldefs.h.
2064 + *! 03-Jan-1997 gp: Added CHNL_MAXIRQ define.
2065 + *! 09-Dec-1996 gp: Removed CHNL_STATEIDLE.
2066 + *! 15-Jul-1996 gp: Created.
2067 + */
2069 +#ifndef CHNLPRIV_
2070 +#define CHNLPRIV_
2072 +#include <chnldefs.h>
2073 +#include <devdefs.h>
2074 +#include <sync.h>
2076 +/* CHNL Object validation signatures: */
2077 +#define CHNL_MGRSIGNATURE 0x52474D43 /* "CMGR" (in reverse). */
2078 +#define CHNL_SIGNATURE 0x4C4E4843 /* "CHNL" (in reverse). */
2080 +/* Channel manager limits: */
2081 +#define CHNL_MAXCHANNELS 32 /* Max channels available per transport */
2085 + * Trans port channel Id definitions:(must match dsp-side).
2087 + * For CHNL_MAXCHANNELS = 16:
2089 + * ChnlIds:
2090 + * 0-15 (PCPY) - transport 0)
2091 + * 16-31 (DDMA) - transport 1)
2092 + * 32-47 (ZCPY) - transport 2)
2093 + */
2094 +#define CHNL_PCPY 0 /* Proc-copy transport 0 */
2096 +#define CHNL_MAXIRQ 0xff /* Arbitrarily large number. */
2098 +/* The following modes are private: */
2099 +#define CHNL_MODEUSEREVENT 0x1000 /* User provided the channel event. */
2100 +#define CHNL_MODEMASK 0x1001
2102 +/* Higher level channel states: */
2103 +#define CHNL_STATEREADY 0x0000 /* Channel ready for I/O. */
2104 +#define CHNL_STATECANCEL 0x0001 /* I/O was cancelled. */
2105 +#define CHNL_STATEEOS 0x0002 /* End Of Stream reached. */
2107 +/* Determine if user supplied an event for this channel: */
2108 +#define CHNL_IsUserEvent(mode) (mode & CHNL_MODEUSEREVENT)
2110 +/* Macros for checking mode: */
2111 +#define CHNL_IsInput(mode) (mode & CHNL_MODEFROMDSP)
2112 +#define CHNL_IsOutput(mode) (!CHNL_IsInput(mode))
2114 +/* Types of channel class libraries: */
2115 +#define CHNL_TYPESM 1 /* Shared memory driver. */
2116 +#define CHNL_TYPEBM 2 /* Bus Mastering driver. */
2118 +/* Max string length of channel I/O completion event name - change if needed */
2119 +#define CHNL_MAXEVTNAMELEN 32
2121 +/* Max memory pages lockable in CHNL_PrepareBuffer() - change if needed */
2122 +#define CHNL_MAXLOCKPAGES 64
2124 +/* Channel info. */
2125 + struct CHNL_INFO {
2126 + struct CHNL_MGR *hChnlMgr; /* Owning channel manager. */
2127 + u32 dwID; /* Channel ID. */
2128 + HANDLE hEvent; /* Channel I/O completion event. */
2129 + /*Abstraction of I/O completion event.*/
2130 + struct SYNC_OBJECT *hSyncEvent;
2131 + u32 dwMode; /* Channel mode. */
2132 + u32 dwState; /* Current channel state. */
2133 + u32 cPosition; /* Total bytes transferred. */
2134 + u32 cIOCs; /* Number of IOCs in queue. */
2135 + u32 cIOReqs; /* Number of IO Requests in queue. */
2136 + HANDLE hProcess; /* Process owning this channel. */
2137 + /*
2138 + * Name of channel I/O completion event. Not required in Linux
2139 + */
2140 + char szEventName[CHNL_MAXEVTNAMELEN + 1];
2141 + } ;
2143 +/* Channel manager info: */
2144 + struct CHNL_MGRINFO {
2145 + u32 dwType; /* Type of channel class library. */
2146 + /* Channel handle, given the channel id. */
2147 + struct CHNL_OBJECT *hChnl;
2148 + u32 cOpenChannels; /* Number of open channels. */
2149 + u32 cChannels; /* total # of chnls supported */
2150 + } ;
2152 +/* Channel Manager Attrs: */
2153 + struct CHNL_MGRATTRS {
2154 + /* Max number of channels this manager can use. */
2155 + u32 cChannels;
2156 + u32 uWordSize; /* DSP Word size. */
2157 + } ;
2159 +#endif /* CHNLPRIV_ */
2160 Index: lk/arch/arm/plat-omap/include/bridge/clk.h
2161 ===================================================================
2162 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2163 +++ lk/arch/arm/plat-omap/include/bridge/clk.h 2008-08-18 10:38:34.000000000 +0300
2164 @@ -0,0 +1,155 @@
2166 + * arch/arm/plat-omap/include/bridge/clk.h
2168 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
2170 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
2172 + * This package is free software; you can redistribute it and/or modify
2173 + * it under the terms of the GNU General Public License version 2 as
2174 + * published by the Free Software Foundation.
2176 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2177 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2178 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2179 + */
2182 + * ======== clk.h ========
2183 + * Purpose: Provides Clock functions.
2185 + *! Revision History:
2186 + *! ================
2187 + *! 08-May-2007 rg: Moved all clock functions from sync module.
2188 + */
2190 +#ifndef _CLK_H
2191 +#define _CLK_H
2193 + /* Generic TIMER object: */
2194 + struct TIMER_OBJECT;
2195 + enum SERVICES_ClkId {
2196 + SERVICESCLK_iva2_ck = 0,
2197 + SERVICESCLK_mailbox_ick,
2198 + SERVICESCLK_gpt5_fck,
2199 + SERVICESCLK_gpt5_ick,
2200 + SERVICESCLK_gpt6_fck,
2201 + SERVICESCLK_gpt6_ick,
2202 + SERVICESCLK_gpt7_fck,
2203 + SERVICESCLK_gpt7_ick,
2204 + SERVICESCLK_gpt8_fck,
2205 + SERVICESCLK_gpt8_ick,
2206 + SERVICESCLK_wdt3_fck,
2207 + SERVICESCLK_wdt3_ick,
2208 + SERVICESCLK_mcbsp1_fck,
2209 + SERVICESCLK_mcbsp1_ick,
2210 + SERVICESCLK_mcbsp2_fck,
2211 + SERVICESCLK_mcbsp2_ick,
2212 + SERVICESCLK_mcbsp3_fck,
2213 + SERVICESCLK_mcbsp3_ick,
2214 + SERVICESCLK_mcbsp4_fck,
2215 + SERVICESCLK_mcbsp4_ick,
2216 + SERVICESCLK_mcbsp5_fck,
2217 + SERVICESCLK_mcbsp5_ick,
2218 + SERVICESCLK_ssi_fck,
2219 + SERVICESCLK_ssi_ick,
2220 + SERVICESCLK_sys_32k_ck,
2221 + SERVICESCLK_sys_ck,
2222 + SERVICESCLK_NOT_DEFINED
2223 + } ;
2226 + * ======== CLK_Exit ========
2227 + * Purpose:
2228 + * Discontinue usage of module; free resources when reference count
2229 + * reaches 0.
2230 + * Parameters:
2231 + * Returns:
2232 + * Requires:
2233 + * CLK initialized.
2234 + * Ensures:
2235 + * Resources used by module are freed when cRef reaches zero.
2236 + */
2237 + extern void CLK_Exit();
2240 + * ======== CLK_Init ========
2241 + * Purpose:
2242 + * Initializes private state of CLK module.
2243 + * Parameters:
2244 + * Returns:
2245 + * TRUE if initialized; FALSE if error occured.
2246 + * Requires:
2247 + * Ensures:
2248 + * CLK initialized.
2249 + */
2250 + extern bool CLK_Init();
2254 + * ======== CLK_Enable ========
2255 + * Purpose:
2256 + * Enables the clock requested.
2257 + * Parameters:
2258 + * Returns:
2259 + * DSP_SOK: Success.
2260 + * DSP_EFAIL: Error occured while enabling the clock.
2261 + * Requires:
2262 + * Ensures:
2263 + */
2264 + extern DSP_STATUS CLK_Enable(IN enum SERVICES_ClkId clk_id);
2267 + * ======== CLK_Disable ========
2268 + * Purpose:
2269 + * Disables the clock requested.
2270 + * Parameters:
2271 + * Returns:
2272 + * DSP_SOK: Success.
2273 + * DSP_EFAIL: Error occured while disabling the clock.
2274 + * Requires:
2275 + * Ensures:
2276 + */
2277 + extern DSP_STATUS CLK_Disable(IN enum SERVICES_ClkId clk_id);
2280 + * ======== CLK_GetRate ========
2281 + * Purpose:
2282 + * Get the clock rate of requested clock.
2283 + * Parameters:
2284 + * Returns:
2285 + * DSP_SOK: Success.
2286 + * DSP_EFAIL: Error occured while Getting the clock rate.
2287 + * Requires:
2288 + * Ensures:
2289 + */
2290 + extern DSP_STATUS CLK_GetRate(IN enum SERVICES_ClkId clk_id,
2291 + u32 *speedMhz);
2293 + * ======== CLK_Set_32KHz ========
2294 + * Purpose:
2295 + * Set the requested clock to 32KHz.
2296 + * Parameters:
2297 + * Returns:
2298 + * DSP_SOK: Success.
2299 + * DSP_EFAIL: Error occured while setting the clock parent to 32KHz.
2300 + * Requires:
2301 + * Ensures:
2302 + */
2303 + extern DSP_STATUS CLK_Set_32KHz(IN enum SERVICES_ClkId clk_id);
2304 + extern void SSI_Clk_Prepare(bool FLAG);
2307 + * ======== CLK_Get_RefCnt ========
2308 + * Purpose:
2309 + * get the reference count for the clock.
2310 + * Parameters:
2311 + * Returns:
2312 + * s32: Reference Count for the clock.
2313 + * DSP_EFAIL: Error occured while getting the reference count of a clock.
2314 + * Requires:
2315 + * Ensures:
2316 + */
2317 + extern s32 CLK_Get_UseCnt(IN enum SERVICES_ClkId clk_id);
2319 +#endif /* _SYNC_H */
2320 Index: lk/arch/arm/plat-omap/include/bridge/cmm.h
2321 ===================================================================
2322 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2323 +++ lk/arch/arm/plat-omap/include/bridge/cmm.h 2008-08-18 10:38:34.000000000 +0300
2324 @@ -0,0 +1,420 @@
2326 + * arch/arm/plat-omap/include/bridge/cmm.h
2328 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
2330 + * Copyright (C) 2008 Texas Instruments, Inc.
2332 + * This package is free software; you can redistribute it and/or modify
2333 + * it under the terms of the GNU General Public License version 2 as
2334 + * published by the Free Software Foundation.
2336 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2337 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2338 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2339 + */
2342 + * ======== cmm.h ========
2343 + * Purpose:
2344 + * The Communication Memory Management(CMM) module provides shared memory
2345 + * management services for DSP/BIOS Bridge data streaming and messaging.
2346 + * Multiple shared memory segments can be registered with CMM. Memory is
2347 + * coelesced back to the appropriate pool when a buffer is freed.
2349 + * The CMM_Xlator[xxx] functions are used for node messaging and data
2350 + * streaming address translation to perform zero-copy inter-processor
2351 + * data transfer(GPP<->DSP). A "translator" object is created for a node or
2352 + * stream object that contains per thread virtual address information. This
2353 + * translator info is used at runtime to perform SM address translation
2354 + * to/from the DSP address space.
2357 + * Public Functions:
2358 + * CMM_CallocBuf
2359 + * CMM_Create
2360 + * CMM_Destroy
2361 + * CMM_Exit
2362 + * CMM_FreeBuf
2363 + * CMM_GetHandle
2364 + * CMM_GetInfo
2365 + * CMM_Init
2366 + * CMM_RegisterGPPSMSeg
2367 + * CMM_UnRegisterGPPSMSeg
2368 + * CMM_XlatorAllocBuf (Note #1 below)
2369 + * CMM_XlatorCreate "
2370 + * CMM_XlatorDelete "
2371 + * CMM_XlatorFreeBuf "
2372 + * CMM_XlatorTranslate "
2375 + * Notes:
2376 + * #1: Used by Node and Stream modules for SM address translation.
2378 + *! Revision History:
2379 + *! ================
2380 + *! 30-Jan-2002 ag Removed unused CMM_Alloc[Free]Desc & CMM_XlatorRegisterPa.
2381 + *! Renamed CMM_AllocBuf() to CMM_CallocBuf().
2382 + *! 29-Aug-2001 ag: Added dsp virt base and size to CMM_RegisterGPPSMSeg().
2383 + *! 12-Aug-2001 ag: Added CMM_UnRegisterGPP[DSP}SMSeg[s]().
2384 + *! 05-Dec-2000 ag: Added param to CMM_XlatorDelete() to force buf cleanup.
2385 + *! 30-Oct-2000 ag: Added conversion factor to CMM_RegisterDSP[GPP]SMSeg().
2386 + *! 12-Oct-2000 ag: Added CMM_Xlator[xxx] functions.
2387 + *! 10-Aug-2000 ag: Created.
2388 + *!
2389 + */
2391 +#ifndef CMM_
2392 +#define CMM_
2394 +#include <devdefs.h>
2396 +#include <cmmdefs.h>
2397 +#include <host_os.h>
2400 + * ======== CMM_CallocBuf ========
2401 + * Purpose:
2402 + * Allocate memory buffers that can be used for data streaming or
2403 + * messaging.
2404 + * Parameters:
2405 + * hCmmMgr: Cmm Mgr handle.
2406 + * uSize: Number of bytes to allocate.
2407 + * pAttr: Attributes of memory to allocate.
2408 + * ppBufVA: Address of where to place VA.
2409 + * Returns:
2410 + * Pointer to a zero'd block of SM memory;
2411 + * NULL if memory couldn't be allocated,
2412 + * or if cBytes == 0,
2413 + * Requires:
2414 + * Valid hCmmMgr.
2415 + * CMM initialized.
2416 + * Ensures:
2417 + * The returned pointer, if not NULL, points to a valid memory block of
2418 + * the size requested.
2420 + */
2421 + extern void *CMM_CallocBuf(struct CMM_OBJECT *hCmmMgr,
2422 + u32 uSize, struct CMM_ATTRS *pAttrs,
2423 + OUT void **ppBufVA);
2426 + * ======== CMM_Create ========
2427 + * Purpose:
2428 + * Create a communication memory manager object.
2429 + * Parameters:
2430 + * phCmmMgr: Location to store a communication manager handle on output.
2431 + * hDevObject: Handle to a device object.
2432 + * pMgrAttrs: Comm mem manager attributes.
2433 + * Returns:
2434 + * DSP_SOK: Success;
2435 + * DSP_EMEMORY: Insufficient memory for requested resources.
2436 + * DSP_EFAIL: Failed to initialize critical sect sync object.
2438 + * Requires:
2439 + * CMM_Init() called.
2440 + * phCmmMgr != NULL.
2441 + * pMgrAttrs->ulMinBlockSize >= 4 bytes.
2442 + * Ensures:
2444 + */
2445 + extern DSP_STATUS CMM_Create(OUT struct CMM_OBJECT **phCmmMgr,
2446 + struct DEV_OBJECT *hDevObject,
2447 + IN CONST struct CMM_MGRATTRS *pMgrAttrs);
2450 + * ======== CMM_Destroy ========
2451 + * Purpose:
2452 + * Destroy the communication memory manager object.
2453 + * Parameters:
2454 + * hCmmMgr: Cmm Mgr handle.
2455 + * bForce: Force deallocation of all cmm memory immediately if set TRUE.
2456 + * If FALSE, and outstanding allocations will return DSP_EFAIL
2457 + * status.
2458 + * Returns:
2459 + * DSP_SOK: CMM object & resources deleted.
2460 + * DSP_EFAIL: Unable to free CMM object due to outstanding allocation.
2461 + * DSP_EHANDLE: Unable to free CMM due to bad handle.
2462 + * Requires:
2463 + * CMM is initialized.
2464 + * hCmmMgr != NULL.
2465 + * Ensures:
2466 + * Memory resources used by Cmm Mgr are freed.
2467 + */
2468 + extern DSP_STATUS CMM_Destroy(struct CMM_OBJECT *hCmmMgr, bool bForce);
2471 + * ======== CMM_Exit ========
2472 + * Purpose:
2473 + * Discontinue usage of module. Cleanup CMM module if CMM cRef reaches zero.
2474 + * Parameters:
2475 + * n/a
2476 + * Returns:
2477 + * n/a
2478 + * Requires:
2479 + * CMM is initialized.
2480 + * Ensures:
2481 + */
2482 + extern void CMM_Exit();
2485 + * ======== CMM_FreeBuf ========
2486 + * Purpose:
2487 + * Free the given buffer.
2488 + * Parameters:
2489 + * hCmmMgr: Cmm Mgr handle.
2490 + * pBuf: Pointer to memory allocated by CMM_CallocBuf().
2491 + * ulSegId: SM segment Id used in CMM_Calloc() attrs.
2492 + * Set to 0 to use default segment.
2493 + * Returns:
2494 + * DSP_SOK
2495 + * DSP_EFAIL
2496 + * Requires:
2497 + * CMM initialized.
2498 + * pBufPA != NULL
2499 + * Ensures:
2501 + */
2502 + extern DSP_STATUS CMM_FreeBuf(struct CMM_OBJECT *hCmmMgr,
2503 + void *pBufPA, u32 ulSegId);
2506 + * ======== CMM_GetHandle ========
2507 + * Purpose:
2508 + * Return the handle to the cmm mgr for the given device obj.
2509 + * Parameters:
2510 + * hProcessor: Handle to a Processor.
2511 + * phCmmMgr: Location to store the shared memory mgr handle on output.
2513 + * Returns:
2514 + * DSP_SOK: Cmm Mgr opaque handle returned.
2515 + * DSP_EHANDLE: Invalid handle.
2516 + * Requires:
2517 + * phCmmMgr != NULL
2518 + * hDevObject != NULL
2519 + * Ensures:
2520 + */
2521 + extern DSP_STATUS CMM_GetHandle(DSP_HPROCESSOR hProcessor,
2522 + OUT struct CMM_OBJECT **phCmmMgr);
2525 + * ======== CMM_GetInfo ========
2526 + * Purpose:
2527 + * Return the current SM and VM utilization information.
2528 + * Parameters:
2529 + * hCmmMgr: Handle to a Cmm Mgr.
2530 + * pCmmInfo: Location to store the Cmm information on output.
2532 + * Returns:
2533 + * DSP_SOK: Success.
2534 + * DSP_EHANDLE: Invalid handle.
2535 + * DSP_EINVALIDARG Invalid input argument.
2536 + * Requires:
2537 + * Ensures:
2539 + */
2540 + extern DSP_STATUS CMM_GetInfo(struct CMM_OBJECT *hCmmMgr,
2541 + OUT struct CMM_INFO *pCmmInfo);
2544 + * ======== CMM_Init ========
2545 + * Purpose:
2546 + * Initializes private state of CMM module.
2547 + * Parameters:
2548 + * Returns:
2549 + * TRUE if initialized; FALSE if error occured.
2550 + * Requires:
2551 + * Ensures:
2552 + * CMM initialized.
2553 + */
2554 + extern bool CMM_Init();
2557 + * ======== CMM_RegisterGPPSMSeg ========
2558 + * Purpose:
2559 + * Register a block of SM with the CMM.
2560 + * Parameters:
2561 + * hCmmMgr: Handle to a Cmm Mgr.
2562 + * lpGPPBasePA: GPP Base Physical address.
2563 + * ulSize: Size in GPP bytes.
2564 + * dwDSPAddrOffset GPP PA to DSP PA Offset.
2565 + * cFactor: Add offset if CMM_ADDTODSPPA, sub if CMM_SUBFROMDSPPA.
2566 + * dwDSPBase: DSP virtual base byte address.
2567 + * ulDSPSize: Size of DSP segment in bytes.
2568 + * pulSegId: Address to store segment Id.
2570 + * Returns:
2571 + * DSP_SOK: Success.
2572 + * DSP_EHANDLE: Invalid hCmmMgr handle.
2573 + * DSP_EINVALIDARG: Invalid input argument.
2574 + * DSP_EFAIL: Unable to register.
2575 + * - On success *pulSegId is a valid SM segment ID.
2576 + * Requires:
2577 + * ulSize > 0
2578 + * pulSegId != NULL
2579 + * dwGPPBasePA != 0
2580 + * cFactor = CMM_ADDTODSPPA || cFactor = CMM_SUBFROMDSPPA
2581 + * Ensures:
2583 + */
2584 + extern DSP_STATUS CMM_RegisterGPPSMSeg(struct CMM_OBJECT *hCmmMgr,
2585 + unsigned int dwGPPBasePA,
2586 + u32 ulSize,
2587 + u32 dwDSPAddrOffset,
2588 + enum CMM_CNVTTYPE cFactor,
2589 + unsigned int dwDSPBase,
2590 + u32 ulDSPSize,
2591 + u32 *pulSegId,
2592 + u32 dwGPPBaseBA);
2595 + * ======== CMM_UnRegisterGPPSMSeg ========
2596 + * Purpose:
2597 + * Unregister the given memory segment that was previously registered
2598 + * by CMM_RegisterGPPSMSeg.
2599 + * Parameters:
2600 + * hCmmMgr: Handle to a Cmm Mgr.
2601 + * ulSegId Segment identifier returned by CMM_RegisterGPPSMSeg.
2602 + * Returns:
2603 + * DSP_SOK: Success.
2604 + * DSP_EHANDLE: Invalid handle.
2605 + * DSP_EINVALIDARG: Invalid ulSegId.
2606 + * DSP_EFAIL: Unable to unregister for unknown reason.
2607 + * Requires:
2608 + * Ensures:
2610 + */
2611 + extern DSP_STATUS CMM_UnRegisterGPPSMSeg(struct CMM_OBJECT *hCmmMgr,
2612 + u32 ulSegId);
2615 + * ======== CMM_XlatorAllocBuf ========
2616 + * Purpose:
2617 + * Allocate the specified SM buffer and create a local memory descriptor.
2618 + * Place on the descriptor on the translator's HaQ (Host Alloc'd Queue).
2619 + * Parameters:
2620 + * hXlator: Handle to a Xlator object.
2621 + * pVaBuf: Virtual address ptr(client context)
2622 + * uPaSize: Size of SM memory to allocate.
2623 + * Returns:
2624 + * Ptr to valid physical address(Pa) of uPaSize bytes, NULL if failed.
2625 + * Requires:
2626 + * pVaBuf != 0.
2627 + * uPaSize != 0.
2628 + * Ensures:
2630 + */
2631 + extern void *CMM_XlatorAllocBuf(struct CMM_XLATOROBJECT *hXlator,
2632 + void *pVaBuf, u32 uPaSize);
2635 + * ======== CMM_XlatorCreate ========
2636 + * Purpose:
2637 + * Create a translator(xlator) object used for process specific Va<->Pa
2638 + * address translation. Node messaging and streams use this to perform
2639 + * inter-processor(GPP<->DSP) zero-copy data transfer.
2640 + * Parameters:
2641 + * phXlator: Address to place handle to a new Xlator handle.
2642 + * hCmmMgr: Handle to Cmm Mgr associated with this translator.
2643 + * pXlatorAttrs: Translator attributes used for the client NODE or STREAM.
2644 + * Returns:
2645 + * DSP_SOK: Success.
2646 + * DSP_EINVALIDARG: Bad input Attrs.
2647 + * DSP_EMEMORY: Insufficient memory(local) for requested resources.
2648 + * Requires:
2649 + * phXlator != NULL
2650 + * hCmmMgr != NULL
2651 + * pXlatorAttrs != NULL
2652 + * Ensures:
2654 + */
2655 + extern DSP_STATUS CMM_XlatorCreate(OUT struct CMM_XLATOROBJECT **phXlator,
2656 + struct CMM_OBJECT *hCmmMgr,
2657 + struct CMM_XLATORATTRS *pXlatorAttrs);
2660 + * ======== CMM_XlatorDelete ========
2661 + * Purpose:
2662 + * Delete translator resources
2663 + * Parameters:
2664 + * hXlator: handle to translator.
2665 + * bForce: bForce = TRUE will free XLators SM buffers/dscriptrs.
2666 + * Returns:
2667 + * DSP_SOK: Success.
2668 + * DSP_EHANDLE: Bad translator handle.
2669 + * DSP_EFAIL: Unable to free translator resources.
2670 + * Requires:
2671 + * cRefs > 0
2672 + * Ensures:
2674 + */
2675 + extern DSP_STATUS CMM_XlatorDelete(struct CMM_XLATOROBJECT *hXlator,
2676 + bool bForce);
2679 + * ======== CMM_XlatorFreeBuf ========
2680 + * Purpose:
2681 + * Free SM buffer and descriptor.
2682 + * Does not free client process VM.
2683 + * Parameters:
2684 + * hXlator: handle to translator.
2685 + * pBufVa Virtual address of PA to free.
2686 + * Returns:
2687 + * DSP_SOK: Success.
2688 + * DSP_EHANDLE: Bad translator handle.
2689 + * Requires:
2690 + * Ensures:
2692 + */
2693 + extern DSP_STATUS CMM_XlatorFreeBuf(struct CMM_XLATOROBJECT *hXlator,
2694 + void *pBufVa);
2697 + * ======== CMM_XlatorInfo ========
2698 + * Purpose:
2699 + * Set/Get process specific "translator" address info.
2700 + * This is used to perform fast virtaul address translation
2701 + * for shared memory buffers between the GPP and DSP.
2702 + * Parameters:
2703 + * hXlator: handle to translator.
2704 + * pAddr: Virtual base address of segment.
2705 + * ulSize: Size in bytes.
2706 + * uSegId: Segment identifier of SM segment(s)
2707 + * bSetInfo Set xlator fields if TRUE, else return base addr
2708 + * Returns:
2709 + * DSP_SOK: Success.
2710 + * DSP_EHANDLE: Bad translator handle.
2711 + * Requires:
2712 + * (cRefs > 0)
2713 + * (pAddr != NULL)
2714 + * (ulSize > 0)
2715 + * Ensures:
2717 + */
2718 + extern DSP_STATUS CMM_XlatorInfo(struct CMM_XLATOROBJECT *hXlator,
2719 + IN OUT u8 **pAddr,
2720 + u32 ulSize, u32 uSegId,
2721 + bool bSetInfo);
2724 + * ======== CMM_XlatorTranslate ========
2725 + * Purpose:
2726 + * Perform address translation VA<->PA for the specified stream or
2727 + * message shared memory buffer.
2728 + * Parameters:
2729 + * hXlator: handle to translator.
2730 + * pAddr address of buffer to translate.
2731 + * xType Type of address xlation. CMM_PA2VA or CMM_VA2PA.
2732 + * Returns:
2733 + * Valid address on success, else NULL.
2734 + * Requires:
2735 + * cRefs > 0
2736 + * pAddr != NULL
2737 + * xType >= CMM_VA2PA) && (xType <= CMM_DSPPA2PA)
2738 + * Ensures:
2740 + */
2741 + extern void *CMM_XlatorTranslate(struct CMM_XLATOROBJECT *hXlator,
2742 + void *pAddr, enum CMM_XLATETYPE xType);
2744 +#endif /* CMM_ */
2745 Index: lk/arch/arm/plat-omap/include/bridge/cmmdefs.h
2746 ===================================================================
2747 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2748 +++ lk/arch/arm/plat-omap/include/bridge/cmmdefs.h 2008-08-18 10:38:34.000000000 +0300
2749 @@ -0,0 +1,135 @@
2751 + * arch/arm/plat-omap/include/bridge/cmmdefs.h
2753 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
2755 + * Copyright (C) 2008 Texas Instruments, Inc.
2757 + * This package is free software; you can redistribute it and/or modify
2758 + * it under the terms of the GNU General Public License version 2 as
2759 + * published by the Free Software Foundation.
2761 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2762 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2763 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2764 + */
2768 + * ======== cmmdefs.h ========
2769 + * Purpose:
2770 + * Global MEM constants and types.
2772 + *! Revision History:
2773 + *! ================
2774 + *! 12-Nov-2001 ag CMM_KERNMAPTYPE added for dsp<->device process addr map'n.
2775 + *! This allows addr conversion from drvr process <-> DSP addr.
2776 + *! 29-Aug-2001 ag Added CMM_ALLSEGMENTS.
2777 + *! 08-Dec-2000 ag Added bus address conversion type CMM_POMAPEMIF2DSPBUS.
2778 + *! 05-Dec-2000 ag Added default CMM_DEFLTCONVFACTOR & CMM_DEFLTDSPADDROFFSET.
2779 + *! 29-Oct-2000 ag Added converstion factor for GPP DSP Pa translation.
2780 + *! 15-Oct-2000 ag Added address translator attributes and defaults.
2781 + *! 12-Jul-2000 ag Created.
2782 + */
2784 +#ifndef CMMDEFS_
2785 +#define CMMDEFS_
2787 +#include <list.h>
2789 +/* Cmm attributes used in CMM_Create() */
2790 + struct CMM_MGRATTRS {
2791 + /* Minimum SM allocation; default 32 bytes. */
2792 + u32 ulMinBlockSize;
2793 + } ;
2795 +/* Attributes for CMM_AllocBuf() & CMM_AllocDesc() */
2796 + struct CMM_ATTRS {
2797 + u32 ulSegId; /* 1,2... are SM segments. 0 is not. */
2798 + u32 ulAlignment; /* 0,1,2,4....ulMinBlockSize */
2799 + } ;
2802 + * DSPPa to GPPPa Conversion Factor.
2804 + * For typical platforms:
2805 + * converted Address = PaDSP + ( cFactor * addressToConvert).
2806 + */
2807 + enum CMM_CNVTTYPE {
2808 + CMM_SUBFROMDSPPA = -1,
2809 + /* PreOMAP is special case: not simple offset */
2810 + CMM_POMAPEMIF2DSPBUS = 0,
2811 + CMM_ADDTODSPPA = 1
2812 + } ;
2814 +#define CMM_DEFLTDSPADDROFFSET 0
2815 +#define CMM_DEFLTCONVFACTOR CMM_POMAPEMIF2DSPBUS /* PreOMAP DSPBUS<->EMIF */
2816 +#define CMM_ALLSEGMENTS 0xFFFFFF /* All SegIds */
2817 +#define CMM_MAXGPPSEGS 1 /* Maximum # of SM segs */
2820 + * SMSEGs are SM segments the DSP allocates from.
2822 + * This info is used by the GPP to xlate DSP allocated PAs.
2823 + */
2825 + struct CMM_SEGINFO {
2826 + u32 dwSegBasePa; /* Start Phys address of SM segment */
2827 + /* Total size in bytes of segment: DSP+GPP */
2828 + u32 ulTotalSegSize;
2829 + u32 dwGPPBasePA; /* Start Phys addr of Gpp SM seg */
2830 + u32 ulGPPSize; /* Size of Gpp SM seg in bytes */
2831 + u32 dwDSPBaseVA; /* DSP virt base byte address */
2832 + u32 ulDSPSize; /* DSP seg size in bytes */
2833 + /* # of current GPP allocations from this segment */
2834 + u32 ulInUseCnt;
2835 + u32 dwSegBaseVa; /* Start Virt address of SM seg */
2837 + } ;
2839 +/* CMM useful information */
2840 + struct CMM_INFO {
2841 + /* # of SM segments registered with this Cmm. */
2842 + u32 ulNumGPPSMSegs;
2843 + /* Total # of allocations outstanding for CMM */
2844 + u32 ulTotalInUseCnt;
2845 + /* Min SM block size allocation from CMM_Create() */
2846 + u32 ulMinBlockSize;
2847 + /* Info per registered SM segment. */
2848 + struct CMM_SEGINFO segInfo[CMM_MAXGPPSEGS];
2849 + } ;
2851 +/* XlatorCreate attributes */
2852 + struct CMM_XLATORATTRS {
2853 + u32 ulSegId; /* segment Id used for SM allocations */
2854 + u32 dwDSPBufs; /* # of DSP-side bufs */
2855 + u32 dwDSPBufSize; /* size of DSP-side bufs in GPP bytes */
2856 + /* Vm base address alloc'd in client process context */
2857 + void *pVmBase;
2858 + /* dwVmSize must be >= (dwMaxNumBufs * dwMaxSize) */
2859 + u32 dwVmSize;
2860 + } ;
2863 + * Cmm translation types. Use to map SM addresses to process context.
2864 + */
2865 + enum CMM_XLATETYPE {
2866 + CMM_VA2PA = 0, /* Virtual to GPP physical address xlation */
2867 + CMM_PA2VA = 1, /* GPP Physical to virtual */
2868 + CMM_VA2DSPPA = 2, /* Va to DSP Pa */
2869 + CMM_PA2DSPPA = 3, /* GPP Pa to DSP Pa */
2870 + CMM_DSPPA2PA = 4, /* DSP Pa to GPP Pa */
2871 + } ;
2874 + * Used to "map" between device process virt addr and dsp addr.
2875 + */
2876 + enum CMM_KERNMAPTYPE {
2877 + CMM_KERNVA2DSP = 0, /* Device process context to dsp address. */
2878 + CMM_DSP2KERNVA = 1, /* Dsp address to device process context. */
2879 + } ;
2881 + struct CMM_OBJECT;
2882 + struct CMM_XLATOROBJECT;
2884 +#endif /* CMMDEFS_ */
2885 Index: lk/arch/arm/plat-omap/include/bridge/cod.h
2886 ===================================================================
2887 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2888 +++ lk/arch/arm/plat-omap/include/bridge/cod.h 2008-08-18 10:38:34.000000000 +0300
2889 @@ -0,0 +1,494 @@
2891 + * arch/arm/plat-omap/include/bridge/cod.h
2893 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
2895 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
2897 + * This package is free software; you can redistribute it and/or modify
2898 + * it under the terms of the GNU General Public License version 2 as
2899 + * published by the Free Software Foundation.
2901 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2902 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2903 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2904 + */
2908 + * ======== cod.h ========
2909 + * Description:
2910 + * Code management module for DSPs. This module provides an interface
2911 + * interface for loading both static and dynamic code objects onto DSP
2912 + * systems.
2914 + * Public Functions:
2915 + * COD_Close
2916 + * COD_Create
2917 + * COD_Delete
2918 + * COD_Exit
2919 + * COD_GetBaseLib
2920 + * COD_GetBaseName
2921 + * COD_GetLoader
2922 + * COD_GetSection
2923 + * COD_GetSymValue
2924 + * COD_Init
2925 + * COD_LoadBase
2926 + * COD_Open
2927 + * COD_OpenBase
2928 + * COD_ReadSection
2929 + * COD_UnloadSection
2931 + * Note:
2932 + * Currently, only static loading is supported.
2934 + *! Revision History
2935 + *! ================
2936 + *! 08-Apr-2003 map: Changed DBL to DBLL
2937 + *! 07-Aug-2002 jeh: Added COD_GetBaseName().
2938 + *! 17-Jul-2002 jeh: Added COD_Open(), COD_Close().
2939 + *! 15-Mar-2002 jeh: Added DBL_Flags param to COD_OpenBase().
2940 + *! 19-Oct-2001 jeh: Added COD_GetBaseLib, COD_GetLoader, (left in
2941 + *! COD_LoadSection(), COD_UnloadSection(), since they
2942 + *! may be needed for BridgeLite).
2943 + *! 07-Sep-2001 jeh: Added COD_LoadSection(), COD_UnloadSection().
2944 + *! 11-Jan-2001 jeh: Added COD_OpenBase.
2945 + *! 29-Sep-2000 kc: Added size param to COD_ReadSection for input buffer
2946 + *! validation.
2947 + *! 02-Aug-2000 kc: Added COD_ReadSection.
2948 + *! 04-Sep-1997 gp: Added CDECL identifier to COD_WRITEFXN (for NT)..
2949 + *! 18-Aug-1997 cr: Added explicit CDECL identifier.
2950 + *! 28-Oct-1996 gp: Added COD_GetSection.
2951 + *! 30-Jul-1996 gp: Added envp[] argument to COD_LoadBase().
2952 + *! 12-Jun-1996 gp: Moved OUT param first in _Create(). Updated _Create()
2953 + *! call to take a ZLFileName. Moved COD_ processor types
2954 + *! to CFG.
2955 + *! 29-May-1996 gp: Changed WCD_STATUS to DSP_STATUS. Removed include's.
2956 + *! 07-May-1996 mg: Created.
2958 + */
2960 +#ifndef COD_
2961 +#define COD_
2963 +#include <dblldefs.h>
2965 +#define COD_MAXPATHLENGTH 255
2966 +#define COD_TRACEBEG "SYS_PUTCBEG"
2967 +#define COD_TRACEEND "SYS_PUTCEND"
2968 +#define COD_TRACESECT "trace"
2969 +#define COD_TRACEBEGOLD "PUTCBEG"
2970 +#define COD_TRACEENDOLD "PUTCEND"
2972 +#define COD_NOLOAD DBLL_NOLOAD
2973 +#define COD_SYMB DBLL_SYMB
2975 +/* Flags passed to COD_Open */
2976 + typedef DBLL_Flags COD_FLAGS;
2978 +/* COD code manager handle */
2979 + struct COD_MANAGER;
2981 +/* COD library handle */
2982 + struct COD_LIBRARYOBJ;
2984 +/* COD attributes */
2985 + struct COD_ATTRS {
2986 + u32 ulReserved;
2987 + } ;
2990 + * Function prototypes for writing memory to a DSP system, allocating
2991 + * and freeing DSP memory.
2992 + */
2993 + typedef u32(CDECL *COD_WRITEFXN) (void *pPrivRef, u32 ulDspAddr,
2994 + void *pBuf, u32 ulNumBytes,
2995 + u32 nMemSpace);
2997 + typedef bool(CDECL *COD_ALLOCFXN) (void *pPrivRef, u32 space,
2998 + u32 ulNumBytes, u32 ulAlign,
2999 + u32 *ulDspAddr, bool fReserved);
3001 + typedef bool(CDECL *COD_FREEFXN) (void *pPrivReg, u32 ulDspAddr,
3002 + u32 space, u32 ulNumBytes,
3003 + bool fReserved);
3006 + * ======== COD_LOADATTRS ========
3008 + * Attributes that specify alloc, free, and write functions when loading
3009 + * or unloading a section.
3010 + */
3011 + struct COD_LOADATTRS {
3012 + void *pWHandle; /* Handle to pass to write fxn */
3013 + void *pAHandle; /* Handle to pass to alloc/free fxns */
3014 + COD_WRITEFXN pfnWrite;
3015 + COD_ALLOCFXN pfnAlloc;
3016 + COD_FREEFXN pfnFree;
3017 + } ;
3020 + * ======== COD_Close ========
3021 + * Purpose:
3022 + * Close a library opened with COD_Open().
3023 + * Parameters:
3024 + * lib - Library handle returned by COD_Open().
3025 + * Returns:
3026 + * None.
3027 + * Requires:
3028 + * COD module initialized.
3029 + * valid lib.
3030 + * Ensures:
3032 + */
3033 + extern void CDECL COD_Close(struct COD_LIBRARYOBJ *lib);
3036 + * ======== COD_Create ========
3037 + * Purpose:
3038 + * Create an object to manage code on a DSP system. This object can be
3039 + * used to load an initial program image with arguments that can later
3040 + * be expanded with dynamically loaded object files.
3041 + * Symbol table information is managed by this object and can be retrieved
3042 + * using the COD_GetSymValue() function.
3043 + * Parameters:
3044 + * phManager: created manager object
3045 + * pstrZLFile: ZL DLL filename, of length < COD_MAXPATHLENGTH.
3046 + * attrs: attributes to be used by this object. A NULL value
3047 + * will cause default attrs to be used.
3048 + * Returns:
3049 + * DSP_SOK: Success.
3050 + * COD_E_NOZLFUNCTIONS: Could not initialize ZL functions.
3051 + * COD_E_ZLCREATEFAILED: ZL_Create failed.
3052 + * DSP_ENOTIMPL: attrs was not NULL. We don't yet support
3053 + * non default values of attrs.
3054 + * Requires:
3055 + * COD module initialized.
3056 + * pstrZLFile != NULL
3057 + * Ensures:
3058 + */
3059 + extern DSP_STATUS CDECL COD_Create(OUT struct COD_MANAGER **phManager,
3060 + char *pstrZLFile,
3061 + IN OPTIONAL CONST struct COD_ATTRS *attrs);
3064 + * ======== COD_Delete ========
3065 + * Purpose:
3066 + * Delete a code manager object.
3067 + * Parameters:
3068 + * hManager: handle of manager to be deleted
3069 + * Returns:
3070 + * None.
3071 + * Requires:
3072 + * COD module initialized.
3073 + * valid hManager.
3074 + * Ensures:
3075 + */
3076 + extern void CDECL COD_Delete(struct COD_MANAGER *hManager);
3079 + * ======== COD_Exit ========
3080 + * Purpose:
3081 + * Discontinue usage of the COD module.
3082 + * Parameters:
3083 + * None.
3084 + * Returns:
3085 + * None.
3086 + * Requires:
3087 + * COD initialized.
3088 + * Ensures:
3089 + * Resources acquired in COD_Init() are freed.
3090 + */
3091 + extern void CDECL COD_Exit();
3094 + * ======== COD_GetBaseLib ========
3095 + * Purpose:
3096 + * Get handle to the base image DBL library.
3097 + * Parameters:
3098 + * hManager: handle of manager to be deleted
3099 + * plib: location to store library handle on output.
3100 + * Returns:
3101 + * DSP_SOK: Success.
3102 + * Requires:
3103 + * COD module initialized.
3104 + * valid hManager.
3105 + * plib != NULL.
3106 + * Ensures:
3107 + */
3108 + extern DSP_STATUS CDECL COD_GetBaseLib(struct COD_MANAGER *hManager,
3109 + struct DBLL_LibraryObj **plib);
3112 + * ======== COD_GetBaseName ========
3113 + * Purpose:
3114 + * Get the name of the base image DBL library.
3115 + * Parameters:
3116 + * hManager: handle of manager to be deleted
3117 + * pszName: location to store library name on output.
3118 + * uSize: size of name buffer.
3119 + * Returns:
3120 + * DSP_SOK: Success.
3121 + * DSP_EFAIL: Buffer too small.
3122 + * Requires:
3123 + * COD module initialized.
3124 + * valid hManager.
3125 + * pszName != NULL.
3126 + * Ensures:
3127 + */
3128 + extern DSP_STATUS CDECL COD_GetBaseName(struct COD_MANAGER *hManager,
3129 + char *pszName, u32 uSize);
3132 + * ======== COD_GetEntry ========
3133 + * Purpose:
3134 + * Retrieve the entry point of a loaded DSP program image
3135 + * Parameters:
3136 + * hManager: handle of manager to be deleted
3137 + * pulEntry: pointer to location for entry point
3138 + * Returns:
3139 + * DSP_SOK: Success.
3140 + * Requires:
3141 + * COD module initialized.
3142 + * valid hManager.
3143 + * pulEntry != NULL.
3144 + * Ensures:
3145 + */
3146 + extern DSP_STATUS CDECL COD_GetEntry(struct COD_MANAGER *hManager,
3147 + u32 *pulEntry);
3150 + * ======== COD_GetLoader ========
3151 + * Purpose:
3152 + * Get handle to the DBL loader.
3153 + * Parameters:
3154 + * hManager: handle of manager to be deleted
3155 + * phLoader: location to store loader handle on output.
3156 + * Returns:
3157 + * DSP_SOK: Success.
3158 + * Requires:
3159 + * COD module initialized.
3160 + * valid hManager.
3161 + * phLoader != NULL.
3162 + * Ensures:
3163 + */
3164 + extern DSP_STATUS CDECL COD_GetLoader(struct COD_MANAGER *hManager,
3165 + struct DBLL_TarObj **phLoader);
3168 + * ======== COD_GetSection ========
3169 + * Purpose:
3170 + * Retrieve the starting address and length of a section in the COFF file
3171 + * given the section name.
3172 + * Parameters:
3173 + * lib Library handle returned from COD_Open().
3174 + * pstrSect: name of the section, with or without leading "."
3175 + * puAddr: Location to store address.
3176 + * puLen: Location to store length.
3177 + * Returns:
3178 + * DSP_SOK: Success
3179 + * COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
3180 + * COD_E_SYMBOLNOTFOUND: The symbol could not be found.
3181 + * Requires:
3182 + * COD module initialized.
3183 + * valid hManager.
3184 + * pstrSect != NULL;
3185 + * puAddr != NULL;
3186 + * puLen != NULL;
3187 + * Ensures:
3188 + * DSP_SOK: *puAddr and *puLen contain the address and length of the
3189 + * section.
3190 + * else: *puAddr == 0 and *puLen == 0;
3192 + */
3193 + extern DSP_STATUS CDECL COD_GetSection(struct COD_LIBRARYOBJ *lib,
3194 + IN char *pstrSect,
3195 + OUT u32 *puAddr,
3196 + OUT u32 *puLen);
3199 + * ======== COD_GetSymValue ========
3200 + * Purpose:
3201 + * Retrieve the value for the specified symbol. The symbol is first
3202 + * searched for literally and then, if not found, searched for as a
3203 + * C symbol.
3204 + * Parameters:
3205 + * lib: library handle returned from COD_Open().
3206 + * pstrSymbol: name of the symbol
3207 + * value: value of the symbol
3208 + * Returns:
3209 + * DSP_SOK: Success.
3210 + * COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
3211 + * COD_E_SYMBOLNOTFOUND: The symbol could not be found.
3212 + * Requires:
3213 + * COD module initialized.
3214 + * Valid hManager.
3215 + * pstrSym != NULL.
3216 + * pulValue != NULL.
3217 + * Ensures:
3218 + */
3219 + extern DSP_STATUS CDECL COD_GetSymValue(struct COD_MANAGER *hManager,
3220 + IN char *pstrSym,
3221 + OUT u32 *pulValue);
3224 + * ======== COD_Init ========
3225 + * Purpose:
3226 + * Initialize the COD module's private state.
3227 + * Parameters:
3228 + * None.
3229 + * Returns:
3230 + * TRUE if initialized; FALSE if error occured.
3231 + * Requires:
3232 + * Ensures:
3233 + * A requirement for each of the other public COD functions.
3234 + */
3235 + extern bool CDECL COD_Init();
3238 + * ======== COD_LoadBase ========
3239 + * Purpose:
3240 + * Load the initial program image, optionally with command-line arguments,
3241 + * on the DSP system managed by the supplied handle. The program to be
3242 + * loaded must be the first element of the args array and must be a fully
3243 + * qualified pathname.
3244 + * Parameters:
3245 + * hMgr: manager to load the code with
3246 + * nArgc: number of arguments in the args array
3247 + * args: array of strings for arguments to DSP program
3248 + * writeFxn: board-specific function to write data to DSP system
3249 + * pArb: arbitrary pointer to be passed as first arg to writeFxn
3250 + * envp: array of environment strings for DSP exec.
3251 + * Returns:
3252 + * DSP_SOK: Success.
3253 + * COD_E_OPENFAILED: Failed to open target code.
3254 + * COD_E_LOADFAILED: Failed to load code onto target.
3255 + * Requires:
3256 + * COD module initialized.
3257 + * hMgr is valid.
3258 + * nArgc > 0.
3259 + * aArgs != NULL.
3260 + * aArgs[0] != NULL.
3261 + * pfnWrite != NULL.
3262 + * Ensures:
3263 + */
3264 + extern DSP_STATUS CDECL COD_LoadBase(struct COD_MANAGER *hManager,
3265 + u32 nArgc, char *aArgs[],
3266 + COD_WRITEFXN pfnWrite, void *pArb,
3267 + char *envp[]);
3270 + * ======== COD_LoadSection ========
3271 + * Purpose:
3272 + * Load a named section in the COFF file. (For overlay support).
3273 + * Parameters:
3274 + * hManager: COD manager.
3275 + * pstrSect: Name of the section, with or without leading "."
3276 + * pAttrs: Specifies alloc, free, and write function.
3277 + * Returns:
3278 + * DSP_SOK: Success
3279 + * DSP_EFWRITE: Failed to write section to target.
3280 + * Requires:
3281 + * COD module initialized.
3282 + * valid hManager.
3283 + * pstrSect != NULL;
3284 + * Ensures:
3286 + */
3287 + extern DSP_STATUS CDECL COD_LoadSection(struct COD_MANAGER *hManager,
3288 + IN char *pstrSect,
3289 + IN struct COD_LOADATTRS *pAttrs);
3292 + * ======== COD_Open ========
3293 + * Purpose:
3294 + * Open a library for reading sections. Does not load or set the base.
3295 + * Parameters:
3296 + * hMgr: manager to load the code with
3297 + * pszCoffPath: Coff file to open.
3298 + * flags: COD_NOLOAD (don't load symbols) or COD_SYMB (load
3299 + * symbols).
3300 + * pLib: Handle returned that can be used in calls to COD_Close
3301 + * and COD_GetSection.
3302 + * Returns:
3303 + * S_OK: Success.
3304 + * COD_E_OPENFAILED: Failed to open target code.
3305 + * Requires:
3306 + * COD module initialized.
3307 + * hMgr is valid.
3308 + * flags == COD_NOLOAD || flags == COD_SYMB.
3309 + * pszCoffPath != NULL.
3310 + * Ensures:
3311 + */
3312 + extern DSP_STATUS COD_Open(struct COD_MANAGER *hMgr,
3313 + IN char *pszCoffPath,
3314 + COD_FLAGS flags,
3315 + OUT struct COD_LIBRARYOBJ **pLib);
3318 + * ======== COD_OpenBase ========
3319 + * Purpose:
3320 + * Open base image for reading sections. Does not load the base.
3321 + * Parameters:
3322 + * hMgr: manager to load the code with
3323 + * pszCoffPath: Coff file to open.
3324 + * flags: Specifies whether to load symbols.
3325 + * Returns:
3326 + * DSP_SOK: Success.
3327 + * COD_E_OPENFAILED: Failed to open target code.
3328 + * Requires:
3329 + * COD module initialized.
3330 + * hMgr is valid.
3331 + * pszCoffPath != NULL.
3332 + * Ensures:
3333 + */
3334 +extern DSP_STATUS COD_OpenBase(struct COD_MANAGER *hMgr, IN char *pszCoffPath,
3335 + DBLL_Flags flags);
3338 + * ======== COD_ReadSection ========
3339 + * Purpose:
3340 + * Retrieve the content of a code section given the section name.
3341 + * Parameters:
3342 + * hManager - manager in which to search for the symbol
3343 + * pstrSect - name of the section, with or without leading "."
3344 + * pstrContent - buffer to store content of the section.
3345 + * Returns:
3346 + * DSP_SOK: on success, error code on failure
3347 + * COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
3348 + * COD_E_READFAILED: Failed to read content of code section.
3349 + * Requires:
3350 + * COD module initialized.
3351 + * valid hManager.
3352 + * pstrSect != NULL;
3353 + * pstrContent != NULL;
3354 + * Ensures:
3355 + * DSP_SOK: *pstrContent stores the content of the named section.
3356 + */
3357 + extern DSP_STATUS CDECL COD_ReadSection(struct COD_LIBRARYOBJ *lib,
3358 + IN char *pstrSect,
3359 + OUT char *pstrContent,
3360 + IN u32 cContentSize);
3363 + * ======== COD_UnloadSection ========
3364 + * Purpose:
3365 + * Unload a named section in the COFF file. (For overlay support).
3366 + * Parameters:
3367 + * hManager: COD manager.
3368 + * pstrSect: name of the section, with or without leading "."
3369 + * pAttrs: Specifies free function.
3370 + * Returns:
3371 + * DSP_SOK: Success.
3372 + * Requires:
3373 + * COD module initialized.
3374 + * valid hManager.
3375 + * pstrSect != NULL;
3376 + * Ensures:
3378 + */
3379 + extern DSP_STATUS CDECL COD_UnloadSection(struct COD_MANAGER *hManager,
3380 + IN char *pstrSect,
3381 + IN struct COD_LOADATTRS *pAttrs);
3383 +#endif /* COD_ */
3384 Index: lk/arch/arm/plat-omap/include/bridge/csl.h
3385 ===================================================================
3386 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3387 +++ lk/arch/arm/plat-omap/include/bridge/csl.h 2008-08-18 10:38:34.000000000 +0300
3388 @@ -0,0 +1,269 @@
3390 + * arch/arm/plat-omap/include/bridge/csl.h
3392 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
3394 + * Copyright (C) 2008 Texas Instruments, Inc.
3396 + * This package is free software; you can redistribute it and/or modify
3397 + * it under the terms of the GNU General Public License version 2 as
3398 + * published by the Free Software Foundation.
3400 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
3401 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
3402 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
3403 + */
3406 + * ======== csl.h ========
3407 + * Purpose:
3408 + * Platform independent C Standard library functions.
3410 + * Public Functions:
3411 + * CSL_AnsiToWchar
3412 + * CSL_Atoi
3413 + * CSL_ByteSwap
3414 + * CSL_Exit
3415 + * CSL_Init
3416 + * CSL_NumToAscii
3417 + * CSL_Strcmp
3418 + * CSL_Strcpyn
3419 + * CSL_Strlen
3420 + * CSL_Strncat
3421 + * CSL_Strncmp
3422 + * CSL_Strtok
3423 + * CSL_Strtokr
3424 + * CSL_WcharToAnsi
3425 + * CSL_Wstrlen
3427 + *! Revision History:
3428 + *! ================
3429 + *! 07-Aug-2002 jeh: Added CSL_Strtokr().
3430 + *! 21-Sep-2001 jeh: Added CSL_Strncmp.
3431 + *! 22-Nov-2000 map: Added CSL_Atoi and CSL_Strtok
3432 + *! 19-Nov-2000 kc: Added CSL_ByteSwap().
3433 + *! 09-Nov-2000 kc: Added CSL_Strncat.
3434 + *! 29-Oct-1999 kc: Added CSL_Wstrlen().
3435 + *! 20-Sep-1999 ag: Added CSL_Wchar2Ansi().
3436 + *! 19-Jan-1998 cr: Code review cleanup (mostly documentation fixes).
3437 + *! 29-Dec-1997 cr: Changed CSL_lowercase to CSL_Uppercase, added
3438 + *! CSL_AnsiToWchar.
3439 + *! 30-Sep-1997 cr: Added explicit cdecl descriptors to fxn definitions.
3440 + *! 25-Jun-1997 cr: Added CSL_strcmp.
3441 + *! 12-Jun-1996 gp: Created.
3442 + */
3444 +#ifndef CSL_
3445 +#define CSL_
3447 +#include <host_os.h>
3449 + * ======== CSL_Atoi ========
3450 + * Purpose:
3451 + * Convert a 1 or 2 digit string number into an integer
3452 + * Parameters:
3453 + * ptstrSrc: pointer to string.
3454 + * Returns:
3455 + * Integer
3456 + * Requires:
3457 + * CSL initialized.
3458 + * ptstrSrc is a valid string pointer.
3459 + * Ensures:
3460 + */
3461 + extern s32 CSL_Atoi(IN CONST char *ptstrSrc);
3464 + * ======== CSL_Exit ========
3465 + * Purpose:
3466 + * Discontinue usage of the CSL module.
3467 + * Parameters:
3468 + * Returns:
3469 + * Requires:
3470 + * CSL initialized.
3471 + * Ensures:
3472 + * Resources acquired in CSL_Init() are freed.
3473 + */
3474 + extern void CSL_Exit();
3477 + * ======== CSL_Init ========
3478 + * Purpose:
3479 + * Initialize the CSL module's private state.
3480 + * Parameters:
3481 + * Returns:
3482 + * TRUE if initialized; FALSE if error occured.
3483 + * Requires:
3484 + * Ensures:
3485 + * A requirement for each of the other public CSL functions.
3486 + */
3487 + extern bool CSL_Init();
3490 + * ======== CSL_NumToAscii ========
3491 + * Purpose:
3492 + * Convert a 1 or 2 digit number to a 2 digit string.
3493 + * Parameters:
3494 + * pstrNumber: Buffer to store converted string.
3495 + * dwNum: Number to convert.
3496 + * Returns:
3497 + * Requires:
3498 + * pstrNumber must be able to hold at least three characters.
3499 + * Ensures:
3500 + * pstrNumber will be null terminated.
3501 + */
3502 + extern void CSL_NumToAscii(OUT char *pstrNumber, IN u32 dwNum);
3505 + * ======== CSL_Strcmp ========
3506 + * Purpose:
3507 + * Compare 2 ASCII strings. Works the same way as stdio's strcmp.
3508 + * Parameters:
3509 + * pstrStr1: char * 1.
3510 + * pstrStr2: char * 2.
3511 + * Returns:
3512 + * A signed value that gives the results of the comparison:
3513 + * Zero: String1 equals String2.
3514 + * < Zero: String1 is less than String2.
3515 + * > Zero: String1 is greater than String2.
3516 + * Requires:
3517 + * CSL initialized.
3518 + * pstrStr1 is valid.
3519 + * pstrStr2 is valid.
3520 + * Ensures:
3521 + */
3522 + extern s32 CSL_Strcmp(IN CONST char *pstrStr1, IN CONST char *pstrStr2);
3525 + * ======== CSL_Strcpyn ========
3526 + * Purpose:
3527 + * Safe strcpy function.
3528 + * Parameters:
3529 + * pstrDest: Ptr to destination buffer.
3530 + * pstrSrc: Ptr to source buffer.
3531 + * cMax: Size of destination buffer.
3532 + * Returns:
3533 + * Ptr to destination buffer; or NULL if error.
3534 + * Requires:
3535 + * CSL initialized.
3536 + * pstrDest is valid.
3537 + * pstrSrc is valid.
3538 + * Ensures:
3539 + * Will not copy more than cMax bytes from pstrSrc into pstrDest.
3540 + * pstrDest will be terminated by a NULL character.
3541 + */
3542 + extern char *CSL_Strcpyn(OUT char *pstrDest, IN CONST char *pstrSrc,
3543 + IN u32 cMax);
3546 + * ======== CSL_Strstr ========
3547 + * Purpose:
3548 + * Find substring in a stringn.
3549 + * Parameters:
3550 + * haystack: Ptr to string1.
3551 + * needle: Ptr to substring to catch.
3552 + * Returns:
3553 + * Ptr to first char matching the substring in the main string.
3554 + * Requires:
3555 + * CSL initialized.
3556 + * haystack is valid.
3557 + * needle is valid.
3558 + * Ensures:
3559 + */
3560 + extern char *CSL_Strstr(IN CONST char *haystack, IN CONST char *needle);
3563 + * ======== CSL_Strlen ========
3564 + * Purpose:
3565 + * Determine the length of a null terminated ASCI string.
3566 + * Parameters:
3567 + * pstrSrc: pointer to string.
3568 + * Returns:
3569 + * String length in bytes.
3570 + * Requires:
3571 + * CSL initialized.
3572 + * pstrSrc is a valid string pointer.
3573 + * Ensures:
3574 + */
3575 + extern u32 CSL_Strlen(IN CONST char *pstrSrc);
3578 + * ======== CSL_Strncat ========
3579 + * Purpose:
3580 + * Concatenate two strings together.
3581 + * Parameters:
3582 + * pszDest: Destination string.
3583 + * pszSrc: Source string.
3584 + * dwSize: Number of characters to copy.
3585 + * Returns:
3586 + * Pointer to destination string.
3587 + * Requires:
3588 + * CSL initialized.
3589 + * pszDest and pszSrc are valid pointers.
3590 + * Ensures:
3591 + */
3592 + extern char *CSL_Strncat(IN char *pszDest,
3593 + IN char *pszSrc, IN u32 dwSize);
3596 + * ======== CSL_Strncmp ========
3597 + * Purpose:
3598 + * Compare at most n characters of two ASCII strings. Works the same
3599 + * way as stdio's strncmp.
3600 + * Parameters:
3601 + * pstrStr1: char * 1.
3602 + * pstrStr2: char * 2.
3603 + * n: Number of characters to compare.
3604 + * Returns:
3605 + * A signed value that gives the results of the comparison:
3606 + * Zero: String1 equals String2.
3607 + * < Zero: String1 is less than String2.
3608 + * > Zero: String1 is greater than String2.
3609 + * Requires:
3610 + * CSL initialized.
3611 + * pstrStr1 is valid.
3612 + * pstrStr2 is valid.
3613 + * Ensures:
3614 + */
3615 + extern s32 CSL_Strncmp(IN CONST char *pstrStr1,
3616 + IN CONST char *pstrStr2, IN u32 n);
3619 + * ======== CSL_Strtok ========
3620 + * Purpose:
3621 + * Tokenize a NULL terminated string
3622 + * Parameters:
3623 + * ptstrSrc: pointer to string.
3624 + * szSeparators: pointer to a string of seperators
3625 + * Returns:
3626 + * char *
3627 + * Requires:
3628 + * CSL initialized.
3629 + * ptstrSrc is a valid string pointer.
3630 + * szSeparators is a valid string pointer.
3631 + * Ensures:
3632 + */
3633 + extern char *CSL_Strtok(IN char *ptstrSrc,
3634 + IN CONST char *szSeparators);
3637 + * ======== CSL_Strtokr ========
3638 + * Purpose:
3639 + * Re-entrant version of strtok.
3640 + * Parameters:
3641 + * pstrSrc: Pointer to string. May be NULL on subsequent calls.
3642 + * szSeparators: Pointer to a string of seperators
3643 + * ppstrCur: Location to store start of string for next call to
3644 + * to CSL_Strtokr.
3645 + * Returns:
3646 + * char * (the token)
3647 + * Requires:
3648 + * CSL initialized.
3649 + * szSeparators != NULL
3650 + * ppstrCur != NULL
3651 + * Ensures:
3652 + */
3653 + extern char *CSL_Strtokr(IN char *pstrSrc,
3654 + IN CONST char *szSeparators,
3655 + OUT char **ppstrCur);
3657 +#endif /* CSL_ */
3658 Index: lk/arch/arm/plat-omap/include/bridge/dbapi.h
3659 ===================================================================
3660 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3661 +++ lk/arch/arm/plat-omap/include/bridge/dbapi.h 2008-08-18 10:38:34.000000000 +0300
3662 @@ -0,0 +1,48 @@
3664 + * arch/arm/plat-omap/include/bridge/dbapi.h
3666 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
3668 + * Copyright (C) 2008 Texas Instruments, Inc.
3670 + * This package is free software; you can redistribute it and/or modify
3671 + * it under the terms of the GNU General Public License version 2 as
3672 + * published by the Free Software Foundation.
3674 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
3675 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
3676 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
3677 + */
3680 + * ======== dbapi.h ========
3681 + * Description:
3682 + * Top level header file for GPP side DSP/BIOS Bridge APIs.
3684 + *! Revision History:
3685 + *! ================
3686 + *! 22-Nov-2002 gp Cleaned up comments, formatting.
3687 + *! 13-Feb-2001 kc: Name changed from ddspapi.h to dbapi.h.
3688 + *! 27-Jun-2000 rr: Name changed to ddspapi.h. Broken into various h files.
3689 + *! 12-May-2000 gp: Removed PROC_UNKNOWN state. Moved OEM DSPProcessor_ fxns
3690 + *! to ddspoem.h. Changed DDSP_MSG to be fixed length;
3691 + *! Changed DDSPStream_Issue/Reclaim to take u32 dwArg.
3692 + *! 11-May-2000 gp: Reformatted; converted tabs to spaces; changed NODEHANDLE
3693 + *! to HNODE; changed GUID to UUID; added "Detail" sections
3694 + *! documenting differences from DDSP API spec. (ver. 0.6);
3695 + *! enhanced comments.
3696 + *! 19-Apr-2000 ww: Updated based on code review.
3697 + *! 12-Apr-2000 ww: Created based on DSP/BIOS Bridge API specification, Ver 0.6.
3698 + */
3700 +#ifndef DBAPI_
3701 +#define DBAPI_
3703 +#include <dbdefs.h> /* DSP/BIOS Bridge global definitions and constants */
3704 +#include <errbase.h> /* DSP/BIOS Bridge status and error codes */
3705 +#include <DSPManager.h> /* DSP/BIOS Bridge Manager APIs */
3706 +#include <DSPProcessor.h> /* DSP/BIOS Bridge Processor APIs */
3707 +#include <DSPNode.h> /* DSP/BIOS Bridge Node APIs */
3708 +#include <DSPStream.h> /* DSP/BIOS Bridge Stream APIs */
3710 +#endif /* DBAPI_ */
3711 Index: lk/arch/arm/plat-omap/include/bridge/dbc.h
3712 ===================================================================
3713 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3714 +++ lk/arch/arm/plat-omap/include/bridge/dbc.h 2008-08-18 10:38:34.000000000 +0300
3715 @@ -0,0 +1,66 @@
3717 + * arch/arm/plat-omap/include/bridge/dbc.h
3719 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
3721 + * Copyright (C) 2008 Texas Instruments, Inc.
3723 + * This package is free software; you can redistribute it and/or modify
3724 + * it under the terms of the GNU General Public License version 2 as
3725 + * published by the Free Software Foundation.
3727 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
3728 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
3729 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
3730 + */
3733 + * ======== dbc.h ========
3734 + * Purpose:
3735 + * "Design by Contract" programming macros.
3737 + * Public Functions:
3738 + * DBC_Assert
3739 + * DBC_Require
3740 + * DBC_Ensure
3742 + * Notes:
3743 + * Requires that the GT->ERROR function has been defaulted to a valid
3744 + * error handler for the given execution environment.
3746 + * Does not require that GT_init() be called.
3748 + *! Revision History:
3749 + *! ================
3750 + *! 11-Aug-2000 ag: Removed include <std.h>
3751 + *! 22-Apr-1996 gp: Created.
3752 + */
3754 +#ifndef DBC_
3755 +#define DBC_
3757 +#ifndef GT_TRACE
3758 +#define GT_TRACE 0 /* 0 = "trace compiled out"; 1 = "trace active" */
3759 +#endif
3761 +/* Assertion Macros: */
3762 +#if GT_TRACE
3764 +#include <gt.h>
3766 +#define DBC_Assert(exp) \
3767 + if (!(exp)) \
3768 + (*GT->ERRORFXN)("%s, line %d: Assertion (" #exp ") failed.\n", \
3769 + __FILE__, __LINE__)
3770 +#define DBC_Require DBC_Assert /* Function Precondition. */
3771 +#define DBC_Ensure DBC_Assert /* Function Postcondition. */
3773 +#else
3775 +#define DBC_Assert(exp)
3776 +#define DBC_Require(exp)
3777 +#define DBC_Ensure(exp)
3779 +#endif /* DEBUG */
3781 +#endif /* DBC_ */
3782 Index: lk/arch/arm/plat-omap/include/bridge/dbdcd.h
3783 ===================================================================
3784 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3785 +++ lk/arch/arm/plat-omap/include/bridge/dbdcd.h 2008-08-18 10:38:34.000000000 +0300
3786 @@ -0,0 +1,388 @@
3788 + * arch/arm/plat-omap/include/bridge/dbdcd.h
3790 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
3792 + * Copyright (C) 2008 Texas Instruments, Inc.
3794 + * This package is free software; you can redistribute it and/or modify
3795 + * it under the terms of the GNU General Public License version 2 as
3796 + * published by the Free Software Foundation.
3798 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
3799 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
3800 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
3801 + */
3804 + * ======== dbdcd.h ========
3805 + * Description:
3806 + * Defines the DSP/BIOS Bridge Configuration Database (DCD) API.
3808 + *! Revision History
3809 + *! ================
3810 + *! 03-Dec-2003 map Changed DCD_OBJTYPE to DSP_DCDOBJTYPE
3811 + *! 24-Feb-2003 kc Updated DCD_AutoUnregister and DCD_GetObjects to simplify
3812 + *! DCD implementation.
3813 + *! 05-Aug-2002 jeh Added DCD_GetObjects().
3814 + *! 11-Jul-2002 jeh Added DCD_GetDepLibs(), DCD_GetNumDepLibs().
3815 + *! 22-Apr-2002 jeh Added DCD_GetLibraryName().
3816 + *! 03-Apr-2001 sg Changed error names to have DCD_E* format.
3817 + *! 13-Feb-2001 kc Name changed from dcdbs.h to dbdcd.h.
3818 + *! 12-Dec-2000 kc Added DCD_AutoUnregister.
3819 + *! 09-Nov-2000 kc Updated usage of DCD_EnumerateObject.
3820 + *! 30-Oct-2000 kc Added DCD_AutoRegister. Updated error DCD error codes.
3821 + *! 29-Sep-2000 kc Incorporated code review comments. See
3822 + *! /src/reviews/dcd_review.txt.
3823 + *! 26-Jul-2000 kc Created.
3824 + *!
3825 + */
3827 +#ifndef DBDCD_
3828 +#define DBDCD_
3830 +#include <dbdcddef.h>
3831 +#include <host_os.h>
3832 +#include <nldrdefs.h>
3835 + * ======== DCD_AutoRegister ========
3836 + * Purpose:
3837 + * This function automatically registers DCD objects specified in a
3838 + * special COFF section called ".dcd_register"
3839 + * Parameters:
3840 + * hDcdMgr: A DCD manager handle.
3841 + * pszCoffPath: Pointer to name of COFF file containing DCD
3842 + * objects to be registered.
3843 + * Returns:
3844 + * DSP_SOK: Success.
3845 + * DSP_EDCDNOAUTOREGISTER: Unable to find auto-registration section.
3846 + * DSP_EDCDREADSECT: Unable to read object code section.
3847 + * DSP_EDCDLOADBASE: Unable to load code base.
3848 + * DSP_EHANDLE: Invalid DCD_HMANAGER handle..
3849 + * Requires:
3850 + * DCD initialized.
3851 + * Ensures:
3852 + * Note:
3853 + * Due to the DCD database construction, it is essential for a DCD-enabled
3854 + * COFF file to contain the right COFF sections, especially
3855 + * ".dcd_register", which is used for auto registration.
3856 + */
3857 + extern DSP_STATUS DCD_AutoRegister(IN struct DCD_MANAGER *hDcdMgr,
3858 + IN char *pszCoffPath);
3861 + * ======== DCD_AutoUnregister ========
3862 + * Purpose:
3863 + * This function automatically unregisters DCD objects specified in a
3864 + * special COFF section called ".dcd_register"
3865 + * Parameters:
3866 + * hDcdMgr: A DCD manager handle.
3867 + * pszCoffPath: Pointer to name of COFF file containing
3868 + * DCD objects to be unregistered.
3869 + * Returns:
3870 + * DSP_SOK: Success.
3871 + * DSP_EDCDNOAUTOREGISTER: Unable to find auto-registration section.
3872 + * DSP_EDCDREADSECT: Unable to read object code section.
3873 + * DSP_EDCDLOADBASE: Unable to load code base.
3874 + * DSP_EHANDLE: Invalid DCD_HMANAGER handle..
3875 + * Requires:
3876 + * DCD initialized.
3877 + * Ensures:
3878 + * Note:
3879 + * Due to the DCD database construction, it is essential for a DCD-enabled
3880 + * COFF file to contain the right COFF sections, especially
3881 + * ".dcd_register", which is used for auto unregistration.
3882 + */
3883 + extern DSP_STATUS DCD_AutoUnregister(IN struct DCD_MANAGER *hDcdMgr,
3884 + IN char *pszCoffPath);
3887 + * ======== DCD_CreateManager ========
3888 + * Purpose:
3889 + * This function creates a DCD module manager.
3890 + * Parameters:
3891 + * pszZlDllName: Pointer to a DLL name string.
3892 + * phDcdMgr: A pointer to a DCD manager handle.
3893 + * Returns:
3894 + * DSP_SOK: Success.
3895 + * DSP_EMEMORY: Unable to allocate memory for DCD manager handle.
3896 + * DSP_EFAIL: General failure.
3897 + * Requires:
3898 + * DCD initialized.
3899 + * pszZlDllName is non-NULL.
3900 + * phDcdMgr is non-NULL.
3901 + * Ensures:
3902 + * A DCD manager handle is created.
3903 + */
3904 + extern DSP_STATUS DCD_CreateManager(IN char *pszZlDllName,
3905 + OUT struct DCD_MANAGER **phDcdMgr);
3908 + * ======== DCD_DestroyManager ========
3909 + * Purpose:
3910 + * This function destroys a DCD module manager.
3911 + * Parameters:
3912 + * hDcdMgr: A DCD manager handle.
3913 + * Returns:
3914 + * DSP_SOK: Success.
3915 + * DSP_EHANDLE: Invalid DCD manager handle.
3916 + * Requires:
3917 + * DCD initialized.
3918 + * Ensures:
3919 + */
3920 + extern DSP_STATUS DCD_DestroyManager(IN struct DCD_MANAGER *hDcdMgr);
3923 + * ======== DCD_EnumerateObject ========
3924 + * Purpose:
3925 + * This function enumerates currently visible DSP/BIOS Bridge objects
3926 + * and returns the UUID and type of each enumerated object.
3927 + * Parameters:
3928 + * cIndex: The object enumeration index.
3929 + * objType: Type of object to enumerate.
3930 + * pUuid: Pointer to a DSP_UUID object.
3931 + * Returns:
3932 + * DSP_SOK: Success.
3933 + * DSP_EFAIL: Unable to enumerate through the DCD database.
3934 + * DSP_SENUMCOMPLETE: Enumeration completed. This is not an error code.
3935 + * Requires:
3936 + * DCD initialized.
3937 + * pUuid is a valid pointer.
3938 + * Ensures:
3939 + * Details:
3940 + * This function can be used in conjunction with DCD_GetObjectDef to
3941 + * retrieve object properties.
3942 + */
3943 + extern DSP_STATUS DCD_EnumerateObject(IN s32 cIndex,
3944 + IN enum DSP_DCDOBJTYPE objType,
3945 + OUT struct DSP_UUID *pUuid);
3948 + * ======== DCD_Exit ========
3949 + * Purpose:
3950 + * This function cleans up the DCD module.
3951 + * Parameters:
3952 + * Returns:
3953 + * Requires:
3954 + * DCD initialized.
3955 + * Ensures:
3956 + */
3957 + extern void DCD_Exit();
3960 + * ======== DCD_GetDepLibs ========
3961 + * Purpose:
3962 + * Given the uuid of a library and size of array of uuids, this function
3963 + * fills the array with the uuids of all dependent libraries of the input
3964 + * library.
3965 + * Parameters:
3966 + * hDcdMgr: A DCD manager handle.
3967 + * pUuid: Pointer to a DSP_UUID for a library.
3968 + * numLibs: Size of uuid array (number of library uuids).
3969 + * pDepLibUuids: Array of dependent library uuids to be filled in.
3970 + * pPersistentDepLibs: Array indicating if corresponding lib is persistent.
3971 + * phase: phase to obtain correct input library
3972 + * Returns:
3973 + * DSP_SOK: Success.
3974 + * DSP_EMEMORY: Memory allocation failure.
3975 + * DSP_EDCDREADSECT: Failure to read section containing library info.
3976 + * DSP_EFAIL: General failure.
3977 + * Requires:
3978 + * DCD initialized.
3979 + * Valid hDcdMgr.
3980 + * pUuid != NULL
3981 + * pDepLibUuids != NULL.
3982 + * Ensures:
3983 + */
3984 + extern DSP_STATUS DCD_GetDepLibs(IN struct DCD_MANAGER *hDcdMgr,
3985 + IN struct DSP_UUID *pUuid,
3986 + u16 numLibs,
3987 + OUT struct DSP_UUID *pDepLibUuids,
3988 + OUT bool *pPersistentDepLibs,
3989 + IN enum NLDR_PHASE phase);
3992 + * ======== DCD_GetNumDepLibs ========
3993 + * Purpose:
3994 + * Given the uuid of a library, determine its number of dependent
3995 + * libraries.
3996 + * Parameters:
3997 + * hDcdMgr: A DCD manager handle.
3998 + * pUuid: Pointer to a DSP_UUID for a library.
3999 + * pNumLibs: Size of uuid array (number of library uuids).
4000 + * pNumPersLibs: number of persistent dependent library.
4001 + * phase: Phase to obtain correct input library
4002 + * Returns:
4003 + * DSP_SOK: Success.
4004 + * DSP_EMEMORY: Memory allocation failure.
4005 + * DSP_EDCDREADSECT: Failure to read section containing library info.
4006 + * DSP_EFAIL: General failure.
4007 + * Requires:
4008 + * DCD initialized.
4009 + * Valid hDcdMgr.
4010 + * pUuid != NULL
4011 + * pNumLibs != NULL.
4012 + * Ensures:
4013 + */
4014 + extern DSP_STATUS DCD_GetNumDepLibs(IN struct DCD_MANAGER *hDcdMgr,
4015 + IN struct DSP_UUID *pUuid,
4016 + OUT u16 *pNumLibs,
4017 + OUT u16 *pNumPersLibs,
4018 + IN enum NLDR_PHASE phase);
4021 + * ======== DCD_GetLibraryName ========
4022 + * Purpose:
4023 + * This function returns the name of a (dynamic) library for a given
4024 + * UUID.
4025 + * Parameters:
4026 + * hDcdMgr: A DCD manager handle.
4027 + * pUuid: Pointer to a DSP_UUID that represents a unique DSP/BIOS
4028 + * Bridge object.
4029 + * pstrLibName: Buffer to hold library name.
4030 + * pdwSize: Contains buffer size. Set to string size on output.
4031 + * phase: Which phase to load
4032 + * fPhaseSplit: Are phases in multiple libraries
4033 + * Returns:
4034 + * DSP_SOK: Success.
4035 + * DSP_EFAIL: General failure.
4036 + * Requires:
4037 + * DCD initialized.
4038 + * Valid hDcdMgr.
4039 + * pstrLibName != NULL.
4040 + * pUuid != NULL
4041 + * pdwSize != NULL.
4042 + * Ensures:
4043 + */
4044 + extern DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
4045 + IN struct DSP_UUID *pUuid,
4046 + IN OUT char *pstrLibName,
4047 + IN OUT u32 *pdwSize,
4048 + IN enum NLDR_PHASE phase,
4049 + OUT bool *fPhaseSplit);
4052 + * ======== DCD_GetObjectDef ========
4053 + * Purpose:
4054 + * This function returns the properties/attributes of a DSP/BIOS Bridge
4055 + * object.
4056 + * Parameters:
4057 + * hDcdMgr: A DCD manager handle.
4058 + * pUuid: Pointer to a DSP_UUID that represents a unique
4059 + * DSP/BIOS Bridge object.
4060 + * objType: The type of DSP/BIOS Bridge object to be
4061 + * referenced (node, processor, etc).
4062 + * pObjDef: Pointer to an object definition structure. A
4063 + * union of various possible DCD object types.
4064 + * Returns:
4065 + * DSP_SOK: Success.
4066 + * DSP_EDCDPARSESECT: Unable to parse content of object code section.
4067 + * DSP_EDCDREADSECT: Unable to read object code section.
4068 + * DSP_EDCDGETSECT: Unable to access object code section.
4069 + * DSP_EDCDLOADBASE: Unable to load code base.
4070 + * DSP_EFAIL: General failure.
4071 + * DSP_EHANDLE: Invalid DCD_HMANAGER handle.
4072 + * Requires:
4073 + * DCD initialized.
4074 + * pObjUuid is non-NULL.
4075 + * pObjDef is non-NULL.
4076 + * Ensures:
4077 + */
4078 + extern DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
4079 + IN struct DSP_UUID *pObjUuid,
4080 + IN enum DSP_DCDOBJTYPE objType,
4081 + OUT struct DCD_GENERICOBJ *pObjDef);
4084 + * ======== DCD_GetObjects ========
4085 + * Purpose:
4086 + * This function finds all DCD objects specified in a special
4087 + * COFF section called ".dcd_register", and for each object,
4088 + * call a "register" function. The "register" function may perform
4089 + * various actions, such as 1) register nodes in the node database, 2)
4090 + * unregister nodes from the node database, and 3) add overlay nodes.
4091 + * Parameters:
4092 + * hDcdMgr: A DCD manager handle.
4093 + * pszCoffPath: Pointer to name of COFF file containing DCD
4094 + * objects.
4095 + * registerFxn: Callback fxn to be applied on each located
4096 + * DCD object.
4097 + * handle: Handle to pass to callback.
4098 + * Returns:
4099 + * DSP_SOK: Success.
4100 + * DSP_EDCDNOAUTOREGISTER: Unable to find .dcd_register section.
4101 + * DSP_EDCDREADSECT: Unable to read object code section.
4102 + * DSP_EDCDLOADBASE: Unable to load code base.
4103 + * DSP_EHANDLE: Invalid DCD_HMANAGER handle..
4104 + * Requires:
4105 + * DCD initialized.
4106 + * Ensures:
4107 + * Note:
4108 + * Due to the DCD database construction, it is essential for a DCD-enabled
4109 + * COFF file to contain the right COFF sections, especially
4110 + * ".dcd_register", which is used for auto registration.
4111 + */
4112 + extern DSP_STATUS DCD_GetObjects(IN struct DCD_MANAGER *hDcdMgr,
4113 + IN char *pszCoffPath,
4114 + DCD_REGISTERFXN registerFxn,
4115 + void *handle);
4118 + * ======== DCD_Init ========
4119 + * Purpose:
4120 + * This function initializes DCD.
4121 + * Parameters:
4122 + * Returns:
4123 + * FALSE: Initialization failed.
4124 + * TRUE: Initialization succeeded.
4125 + * Requires:
4126 + * Ensures:
4127 + * DCD initialized.
4128 + */
4129 + extern bool DCD_Init();
4132 + * ======== DCD_RegisterObject ========
4133 + * Purpose:
4134 + * This function registers a DSP/BIOS Bridge object in the DCD database.
4135 + * Parameters:
4136 + * pUuid: Pointer to a DSP_UUID that identifies a DSP/BIOS
4137 + * Bridge object.
4138 + * objType: Type of object.
4139 + * pszPathName: Path to the object's COFF file.
4140 + * Returns:
4141 + * DSP_SOK: Success.
4142 + * DSP_EFAIL: Failed to register object.
4143 + * Requires:
4144 + * DCD initialized.
4145 + * pUuid and szPathName are non-NULL values.
4146 + * objType is a valid type value.
4147 + * Ensures:
4148 + */
4149 + extern DSP_STATUS DCD_RegisterObject(IN struct DSP_UUID *pUuid,
4150 + IN enum DSP_DCDOBJTYPE objType,
4151 + IN char *pszPathName);
4154 + * ======== DCD_UnregisterObject ========
4155 + * Purpose:
4156 + * This function de-registers a valid DSP/BIOS Bridge object from the DCD
4157 + * database.
4158 + * Parameters:
4159 + * pUuid: Pointer to a DSP_UUID that identifies a DSP/BIOS Bridge
4160 + * object.
4161 + * objType: Type of object.
4162 + * Returns:
4163 + * DSP_SOK: Success.
4164 + * DSP_EFAIL: Unable to de-register the specified object.
4165 + * Requires:
4166 + * DCD initialized.
4167 + * pUuid is a non-NULL value.
4168 + * objType is a valid type value.
4169 + * Ensures:
4170 + */
4171 + extern DSP_STATUS DCD_UnregisterObject(IN struct DSP_UUID *pUuid,
4172 + IN enum DSP_DCDOBJTYPE objType);
4174 +#endif /* _DBDCD_H */
4175 Index: lk/arch/arm/plat-omap/include/bridge/dbdcddef.h
4176 ===================================================================
4177 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4178 +++ lk/arch/arm/plat-omap/include/bridge/dbdcddef.h 2008-08-18 10:38:34.000000000 +0300
4179 @@ -0,0 +1,94 @@
4181 + * arch/arm/plat-omap/include/bridge/dbdcddef.h
4183 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
4185 + * Copyright (C) 2008 Texas Instruments, Inc.
4187 + * This package is free software; you can redistribute it and/or modify
4188 + * it under the terms of the GNU General Public License version 2 as
4189 + * published by the Free Software Foundation.
4191 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
4192 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
4193 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4194 + */
4198 + * ======== dbdcddef.h ========
4199 + * Description:
4200 + * DCD (DSP/BIOS Bridge Configuration Database) constants and types.
4202 + *! Revision History:
4203 + *! ================
4204 + *! 03-Dec-2003 map Moved and renamed DCD_OBJTYPE to DSP_DCDOBJTYPE in dbdefs.h
4205 + *! 05-Dec-2002 map Added DCD_CREATELIBTYPE, DCD_EXECUTELIBTYPE,
4206 + * DCD_DELETELIBTYPE
4207 + *! 24-Feb-2003 kc Updated REG entry names to DspBridge.
4208 + *! 22-Nov-2002 gp Cleaned up comments, formatting.
4209 + *! 05-Aug-2002 jeh Added DCD_REGISTERFXN.
4210 + *! 19-Apr-2002 jeh Added DCD_LIBRARYTYPE to DCD_OBJTYPE, dynamic load
4211 + *! properties to DCD_NODEPROPS.
4212 + *! 29-Jul-2001 ag Added extended procObj.
4213 + *! 13-Feb-2001 kc: Named changed from dcdbsdef.h dbdcddef.h.
4214 + *! 12-Dec-2000 jeh Added DAIS iAlg name to DCD_NODEPROPS.
4215 + *! 30-Oct-2000 kc: Added #defines for DCD_AutoRegister function.
4216 + *! 05-Sep-2000 jeh Added DCD_NODEPROPS.
4217 + *! 12-Aug-2000 kc: Incoroporated the use of types defined in <dspdefs.h>.
4218 + *! 29-Jul-2000 kc: Created.
4219 + */
4221 +#ifndef DBDCDDEF_
4222 +#define DBDCDDEF_
4224 +#include <dbdefs.h>
4225 +#include <mgrpriv.h> /* for MGR_PROCESSOREXTINFO */
4228 + * The following defines are critical elements for the DCD module:
4230 + * - DCD_REGKEY enables DCD functions to locate registered DCD objects.
4231 + * - DCD_REGISTER_SECTION identifies the COFF section where the UUID of
4232 + * registered DCD objects are stored.
4233 + */
4234 +#define DCD_REGKEY "Software\\TexasInstruments\\DspBridge\\DCD"
4235 +#define DCD_REGISTER_SECTION ".dcd_register"
4237 +/* DCD Manager Object */
4238 + struct DCD_MANAGER;
4240 +/* DCD Node Properties */
4241 + struct DCD_NODEPROPS {
4242 + struct DSP_NDBPROPS ndbProps;
4243 + u32 uMsgSegid;
4244 + u32 uMsgNotifyType;
4245 + char *pstrCreatePhaseFxn;
4246 + char *pstrDeletePhaseFxn;
4247 + char *pstrExecutePhaseFxn;
4248 + char *pstrIAlgName;
4250 + /* Dynamic load properties */
4251 + u16 usLoadType; /* Static, dynamic, overlay */
4252 + u32 ulDataMemSegMask; /* Data memory requirements */
4253 + u32 ulCodeMemSegMask; /* Code memory requirements */
4254 + } ;
4256 +/* DCD Generic Object Type */
4257 + struct DCD_GENERICOBJ {
4258 + union dcdObjUnion {
4259 + struct DCD_NODEPROPS nodeObj; /* node object. */
4260 + /* processor object. */
4261 + struct DSP_PROCESSORINFO procObj;
4262 + /* extended proc object (private) */
4263 + struct MGR_PROCESSOREXTINFO extProcObj;
4264 + } objData;
4265 + } ;
4267 +/* DCD Internal Callback Type */
4268 + typedef DSP_STATUS(CDECL *DCD_REGISTERFXN) (IN struct DSP_UUID *pUuid,
4269 + IN enum DSP_DCDOBJTYPE objType,
4270 + IN void *handle);
4272 +#endif /* DBDCDDEF_ */
4274 Index: lk/arch/arm/plat-omap/include/bridge/dbdefs.h
4275 ===================================================================
4276 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4277 +++ lk/arch/arm/plat-omap/include/bridge/dbdefs.h 2008-08-18 10:38:34.000000000 +0300
4278 @@ -0,0 +1,564 @@
4280 + * arch/arm/plat-omap/include/bridge/dbdefs.h
4282 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
4284 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
4286 + * This package is free software; you can redistribute it and/or modify
4287 + * it under the terms of the GNU General Public License version 2 as
4288 + * published by the Free Software Foundation.
4290 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
4291 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
4292 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4293 + */
4296 + * ======== dbdefs.h ========
4297 + * Description:
4298 + * Global definitions and constants for DSP/BIOS Bridge.
4300 + *! Revision History:
4301 + *! ================
4302 + *! 19-Apr-2004 sb Aligned DMM definitions with Symbian
4303 + *! 08-Mar-2004 sb Added MAPATTR & ELEM_SIZE for Dynamic Memory Mapping feature
4304 + *! 09-Feb-2004 vp Added processor ID numbers for DSP and IVA
4305 + *! 06-Feb-2003 kc Removed DSP_POSTMESSAGE. Updated IsValid*Event macros.
4306 + *! 22-Nov-2002 gp Cleaned up comments, formatting.
4307 + *! Removed unused DSP_ENUMLASTNODE define.
4308 + *! 13-Feb-2002 jeh Added uSysStackSize to DSP_NDBPROPS.
4309 + *! 23-Jan-2002 ag Added #define DSP_SHMSEG0.
4310 + *! 12-Dec-2001 ag Added DSP_ESTRMMODE error code.
4311 + *! 04-Dec-2001 jeh Added DSP_ENOTCONNECTED error code.
4312 + *! 10-Dec-2001 kc: Modified macros and definitions to disable DSP_POSTMESSAGE.
4313 + *! 01-Nov-2001 jeh Added DSP_EOVERLAYMEMORY.
4314 + *! 18-Oct-2001 ag Added DSP_STRMMODE type.
4315 + *! Added DSP_ENOTSHAREDMEM.
4316 + *! 21-Sep-2001 ag Added additional error codes.
4317 + *! 07-Jun-2001 sg Made DSPStream_AllocateBuffer fxn name plural.
4318 + *! 11-May-2001 jeh Changed DSP_NODE_MIN_PRIORITY from 0 to 1. Removed hNode
4319 + *! from DSP_NODEINFO.
4320 + *! 02-Apr-2001 sg Added missing error codes, rearranged codes, switched to
4321 + *! hex offsets, renamed some codes to match API spec.
4322 + *! 16-Jan-2001 jeh Added DSP_ESYMBOL, DSP_EUUID.
4323 + *! 13-Feb-2001 kc: DSP/BIOS Bridge name updates.
4324 + *! 05-Dec-2000 ag: Added DSP_RMSxxx user available message command codes.
4325 + *! 09-Nov-2000 rr: Added DSP_PROCEESORRESTART define; Removed DSP_PBUFFER.
4326 + *! Added DSP_DCD_ENOAUTOREGISTER, DSP_EUSER1-16, DSP_ESTRMFUL
4327 + *! Removed DSP_EDONE. Macros's modified.
4328 + *! 23-Oct-2000 jeh Replaced DSP_STREAMSTATECHANGE with DSP_STREAMDONE.
4329 + *! 09-Oct-2000 jeh Updated to version 0.9 DSP Bridge API spec.
4330 + *! 29-Sep-2000 kc Added error codes for DCD and REG to simplify use of
4331 + *! these codes within the RM module.
4332 + *! 27-Sep-2000 jeh Added segid, alignment, uNumBufs to DSP_STREAMATTRIN.
4333 + *! 29-Aug-2000 jeh Added DSP_NODETYPE enum, changed DSP_EALREADYATTACHED to
4334 + *! DSP_EALREADYCONNECTED. Changed scStreamConnection[1]
4335 + *! to scStreamConnection[16] in DSP_NODEINFO structure.
4336 + *! Added DSP_NOTIFICATION, DSP_STRMATTR. PSTRING changed
4337 + *! back to TCHAR * and moved to dbtype.h.
4338 + *! 11-Aug-2000 rr: Macros to check valid events and notify masks added.
4339 + *! 09-Aug-2000 rr: Changed PSTRING to *s8
4340 + *! 07-Aug-2000 rr: PROC_IDLE/SYNCINIT/UNKNOWN state removed.
4341 + *! 20-Jul-2000 rr: Updated to version 0.8
4342 + *! 17-Jul-2000 rr: New PROC states added to the DSP_PROCSTATE.
4343 + *! 27-Jun-2000 rr: Created from dspapi.h
4344 + */
4346 +#ifndef DBDEFS_
4347 +#define DBDEFS_
4349 +#include <linux/types.h>
4351 +#include <dbtype.h> /* GPP side type definitions */
4352 +#include <std.h> /* DSP/BIOS type definitions */
4353 +#include <rms_sh.h> /* Types shared between GPP and DSP */
4355 +#define PG_SIZE_4K 4096
4356 +#define PG_MASK(pg_size) (~((pg_size)-1))
4357 +#define PG_ALIGN_LOW(addr, pg_size) ((addr) & PG_MASK(pg_size))
4358 +#define PG_ALIGN_HIGH(addr, pg_size) (((addr)+(pg_size)-1) & PG_MASK(pg_size))
4360 +/* API return value and calling convention */
4361 +#define DBAPI DSP_STATUS CDECL
4363 +/* Infinite time value for the uTimeout parameter to DSPStream_Select() */
4364 +#define DSP_FOREVER (-1)
4366 +/* Maximum length of node name, used in DSP_NDBPROPS */
4367 +#define DSP_MAXNAMELEN 32
4369 +/* uNotifyType values for the RegisterNotify() functions. */
4370 +#define DSP_SIGNALEVENT 0x00000001
4372 +/* Types of events for processors */
4373 +#define DSP_PROCESSORSTATECHANGE 0x00000001
4374 +#define DSP_PROCESSORATTACH 0x00000002
4375 +#define DSP_PROCESSORDETACH 0x00000004
4376 +#define DSP_PROCESSORRESTART 0x00000008
4378 +/* DSP exception events (DSP/BIOS and DSP MMU fault) */
4379 +#define DSP_MMUFAULT 0x00000010
4380 +#define DSP_SYSERROR 0x00000020
4381 +#define DSP_EXCEPTIONABORT 0x00000300
4383 +/* IVA exception events (IVA MMU fault) */
4384 +#define IVA_MMUFAULT 0x00000040
4385 +/* Types of events for nodes */
4386 +#define DSP_NODESTATECHANGE 0x00000100
4387 +#define DSP_NODEMESSAGEREADY 0x00000200
4389 +/* Types of events for streams */
4390 +#define DSP_STREAMDONE 0x00001000
4391 +#define DSP_STREAMIOCOMPLETION 0x00002000
4393 +/* Handle definition representing the GPP node in DSPNode_Connect() calls */
4394 +#define DSP_HGPPNODE 0xFFFFFFFF
4396 +/* Node directions used in DSPNode_Connect() */
4397 +#define DSP_TONODE 1
4398 +#define DSP_FROMNODE 2
4400 +/* Define Node Minimum and Maximum Priorities */
4401 +#define DSP_NODE_MIN_PRIORITY 1
4402 +#define DSP_NODE_MAX_PRIORITY 15
4404 +/* Pre-Defined Message Command Codes available to user: */
4405 +#define DSP_RMSUSERCODESTART RMS_USER /* Start of RMS user cmd codes */
4406 +/* end of user codes */
4407 +#define DSP_RMSUSERCODEEND (RMS_USER + RMS_MAXUSERCODES);
4408 +#define DSP_RMSBUFDESC RMS_BUFDESC /* MSG contains SM buffer description */
4410 +/* Shared memory identifier for MEM segment named "SHMSEG0" */
4411 +#define DSP_SHMSEG0 (u32)(-1)
4413 +/* Processor ID numbers */
4414 +#define DSP_UNIT 0
4415 +#define IVA_UNIT 1
4417 +#define DSPWORD unsigned char
4418 +#define DSPWORDSIZE sizeof(DSPWORD)
4420 +/* Success & Failure macros */
4421 +#define DSP_SUCCEEDED(Status) likely((s32)(Status) >= 0)
4422 +#define DSP_FAILED(Status) unlikely((s32)(Status) < 0)
4424 +/* Power control enumerations */
4425 +#define PROC_PWRCONTROL 0x8070
4427 +#define PROC_PWRMGT_ENABLE (PROC_PWRCONTROL + 0x3)
4428 +#define PROC_PWRMGT_DISABLE (PROC_PWRCONTROL + 0x4)
4430 +/* Bridge Code Version */
4431 +#define BRIDGE_VERSION_CODE 333
4433 +#define MAX_PROFILES 16
4435 +/* Types defined for 'Bridge API */
4436 + typedef u32 DSP_STATUS; /* API return code type */
4438 + typedef HANDLE DSP_HNODE; /* Handle to a DSP Node object */
4439 + typedef HANDLE DSP_HPROCESSOR; /* Handle to a Processor object */
4440 + typedef HANDLE DSP_HSTREAM; /* Handle to a Stream object */
4442 + typedef u32 DSP_PROCFAMILY; /* Processor family */
4443 + typedef u32 DSP_PROCTYPE; /* Processor type (w/in family) */
4444 + typedef u32 DSP_RTOSTYPE; /* Type of DSP RTOS */
4446 +/* Handy Macros */
4447 +#define IsValidProcEvent(x) (((x) == 0) || (((x) & (DSP_PROCESSORSTATECHANGE | \
4448 + DSP_PROCESSORATTACH | \
4449 + DSP_PROCESSORDETACH | \
4450 + DSP_PROCESSORRESTART | \
4451 + DSP_NODESTATECHANGE | \
4452 + DSP_STREAMDONE | \
4453 + DSP_STREAMIOCOMPLETION | \
4454 + DSP_MMUFAULT | \
4455 + DSP_SYSERROR)) && \
4456 + !((x) & ~(DSP_PROCESSORSTATECHANGE | \
4457 + DSP_PROCESSORATTACH | \
4458 + DSP_PROCESSORDETACH | \
4459 + DSP_PROCESSORRESTART | \
4460 + DSP_NODESTATECHANGE | \
4461 + DSP_STREAMDONE | \
4462 + DSP_STREAMIOCOMPLETION | \
4463 + DSP_MMUFAULT | \
4464 + DSP_SYSERROR))))
4466 +#define IsValidNodeEvent(x) (((x) == 0) || (((x) & (DSP_NODESTATECHANGE | \
4467 + DSP_NODEMESSAGEREADY)) && \
4468 + !((x) & ~(DSP_NODESTATECHANGE | \
4469 + DSP_NODEMESSAGEREADY))))
4471 +#define IsValidStrmEvent(x) (((x) == 0) || (((x) & (DSP_STREAMDONE | \
4472 + DSP_STREAMIOCOMPLETION)) && \
4473 + !((x) & ~(DSP_STREAMDONE | \
4474 + DSP_STREAMIOCOMPLETION))))
4476 +#define IsValidNotifyMask(x) ((x) & DSP_SIGNALEVENT)
4478 +/* The Node UUID structure */
4479 + struct DSP_UUID {
4480 + u32 ulData1;
4481 + u16 usData2;
4482 + u16 usData3;
4483 + u8 ucData4;
4484 + u8 ucData5;
4485 + u8 ucData6[6];
4486 + };
4488 +/* DCD types */
4489 + enum DSP_DCDOBJTYPE {
4490 + DSP_DCDNODETYPE,
4491 + DSP_DCDPROCESSORTYPE,
4492 + DSP_DCDLIBRARYTYPE,
4493 + DSP_DCDCREATELIBTYPE,
4494 + DSP_DCDEXECUTELIBTYPE,
4495 + DSP_DCDDELETELIBTYPE
4496 + } ;
4498 +/* Processor states */
4499 + enum DSP_PROCSTATE {
4500 + PROC_STOPPED,
4501 + PROC_LOADED,
4502 + PROC_RUNNING
4503 + } ;
4505 +/* Node types */
4506 + enum DSP_NODETYPE {
4507 + NODE_DEVICE,
4508 + NODE_TASK,
4509 + NODE_DAISSOCKET,
4510 + NODE_MESSAGE
4511 + } ;
4513 +/* Node states */
4514 + enum DSP_NODESTATE {
4515 + NODE_ALLOCATED,
4516 + NODE_CREATED,
4517 + NODE_RUNNING,
4518 + NODE_PAUSED,
4519 + NODE_DONE
4520 + } ;
4522 +/* Stream states */
4523 + enum DSP_STREAMSTATE {
4524 + STREAM_IDLE,
4525 + STREAM_READY,
4526 + STREAM_PENDING,
4527 + STREAM_DONE
4528 + } ;
4530 +/* Stream connect types */
4531 + enum DSP_CONNECTTYPE {
4532 + CONNECTTYPE_NODEOUTPUT,
4533 + CONNECTTYPE_GPPOUTPUT,
4534 + CONNECTTYPE_NODEINPUT,
4535 + CONNECTTYPE_GPPINPUT
4536 + } ;
4538 +/* Stream mode types */
4539 + enum DSP_STRMMODE {
4540 + STRMMODE_PROCCOPY, /* Processor(s) copy stream data payloads */
4541 + STRMMODE_ZEROCOPY, /* Strm buffer ptrs swapped no data copied */
4542 + STRMMODE_LDMA, /* Local DMA : OMAP's System-DMA device */
4543 + STRMMODE_RDMA /* Remote DMA: OMAP's DSP-DMA device */
4544 + } ;
4546 +/* Resource Types */
4547 + enum DSP_RESOURCEINFOTYPE {
4548 + DSP_RESOURCE_DYNDARAM = 0,
4549 + DSP_RESOURCE_DYNSARAM,
4550 + DSP_RESOURCE_DYNEXTERNAL,
4551 + DSP_RESOURCE_DYNSRAM,
4552 + DSP_RESOURCE_PROCLOAD
4553 + } ;
4555 +/* Memory Segment Types */
4556 + enum DSP_MEMTYPE {
4557 + DSP_DYNDARAM = 0,
4558 + DSP_DYNSARAM,
4559 + DSP_DYNEXTERNAL,
4560 + DSP_DYNSRAM
4561 + } ;
4563 +/* Memory Flush Types */
4564 + enum DSP_FLUSHTYPE {
4565 + PROC_INVALIDATE_MEM = 0,
4566 + PROC_WRITEBACK_MEM,
4567 + PROC_WRITEBACK_INVALIDATE_MEM,
4568 + } ;
4570 +/* Memory Segment Status Values */
4571 + struct DSP_MEMSTAT {
4572 + u32 ulSize;
4573 + u32 ulTotalFreeSize;
4574 + u32 ulLenMaxFreeBlock;
4575 + u32 ulNumFreeBlocks;
4576 + u32 ulNumAllocBlocks;
4577 + } ;
4579 +/* Processor Load information Values */
4580 + struct DSP_PROCLOADSTAT {
4581 + u32 uCurrLoad;
4582 + u32 uPredictedLoad;
4583 + u32 uCurrDspFreq;
4584 + u32 uPredictedFreq;
4585 + } ;
4587 +/* Attributes for STRM connections between nodes */
4588 + struct DSP_STRMATTR {
4589 + u32 uSegid; /* Memory segment on DSP to allocate buffers */
4590 + u32 uBufsize; /* Buffer size (DSP words) */
4591 + u32 uNumBufs; /* Number of buffers */
4592 + u32 uAlignment; /* Buffer alignment */
4593 + u32 uTimeout; /* Timeout for blocking STRM calls */
4594 + enum DSP_STRMMODE lMode; /* mode of stream when opened */
4595 + /* DMA chnl id if DSP_STRMMODE is LDMA or RDMA */
4596 + u32 uDMAChnlId;
4597 + u32 uDMAPriority; /* DMA channel priority 0=lowest, >0=high */
4598 + } ;
4600 +/* The DSP_CBDATA structure */
4601 + struct DSP_CBDATA {
4602 + u32 cbData;
4603 + u8 cData[1];
4604 + } ;
4606 +/* The DSP_MSG structure */
4607 + struct DSP_MSG {
4608 + u32 dwCmd;
4609 + u32 dwArg1;
4610 + u32 dwArg2;
4611 + } ;
4613 +/* The DSP_RESOURCEREQMTS structure for node's resource requirements */
4614 + struct DSP_RESOURCEREQMTS {
4615 + u32 cbStruct;
4616 + u32 uStaticDataSize;
4617 + u32 uGlobalDataSize;
4618 + u32 uProgramMemSize;
4619 + u32 uWCExecutionTime;
4620 + u32 uWCPeriod;
4621 + u32 uWCDeadline;
4622 + u32 uAvgExectionTime;
4623 + u32 uMinimumPeriod;
4624 + } ;
4627 + * The DSP_STREAMCONNECT structure describes a stream connection
4628 + * between two nodes, or between a node and the GPP
4629 + */
4630 + struct DSP_STREAMCONNECT {
4631 + u32 cbStruct;
4632 + enum DSP_CONNECTTYPE lType;
4633 + u32 uThisNodeStreamIndex;
4634 + DSP_HNODE hConnectedNode;
4635 + struct DSP_UUID uiConnectedNodeID;
4636 + u32 uConnectedNodeStreamIndex;
4637 + } ;
4639 +#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
4640 + struct DSP_NODEPROFS {
4641 + u32 ulHeapSize;
4642 + } ;
4643 +#endif
4645 +/* The DSP_NDBPROPS structure reports the attributes of a node */
4646 + struct DSP_NDBPROPS {
4647 + u32 cbStruct;
4648 + struct DSP_UUID uiNodeID;
4649 + char acName[DSP_MAXNAMELEN];
4650 + enum DSP_NODETYPE uNodeType;
4651 + u32 bCacheOnGPP;
4652 + struct DSP_RESOURCEREQMTS dspResourceReqmts;
4653 + s32 iPriority;
4654 + u32 uStackSize;
4655 + u32 uSysStackSize;
4656 + u32 uStackSeg;
4657 + u32 uMessageDepth;
4658 + u32 uNumInputStreams;
4659 + u32 uNumOutputStreams;
4660 + u32 uTimeout;
4661 + u32 uCountProfiles; /* Number of supported profiles */
4662 + /* Array of profiles */
4663 + struct DSP_NODEPROFS aProfiles[MAX_PROFILES];
4664 + u32 uStackSegName; /* Stack Segment Name */
4665 + } ;
4667 + /* The DSP_NODEATTRIN structure describes the attributes of a
4668 + * node client */
4669 + struct DSP_NODEATTRIN {
4670 + u32 cbStruct;
4671 + s32 iPriority;
4672 + u32 uTimeout;
4673 + u32 uProfileID;
4674 + /* Reserved, for Bridge Internal use only */
4675 + u32 uHeapSize;
4676 + void *pGPPVirtAddr; /* Reserved, for Bridge Internal use only */
4677 + } ;
4679 + /* The DSP_NODEINFO structure is used to retrieve information
4680 + * about a node */
4681 + struct DSP_NODEINFO {
4682 + u32 cbStruct;
4683 + struct DSP_NDBPROPS nbNodeDatabaseProps;
4684 + u32 uExecutionPriority;
4685 + enum DSP_NODESTATE nsExecutionState;
4686 + DSP_HNODE hDeviceOwner;
4687 + u32 uNumberStreams;
4688 + struct DSP_STREAMCONNECT scStreamConnection[16];
4689 + u32 uNodeEnv;
4690 + } ;
4692 + /* The DSP_NODEATTR structure describes the attributes of a node */
4693 + struct DSP_NODEATTR {
4694 + u32 cbStruct;
4695 + struct DSP_NODEATTRIN inNodeAttrIn;
4696 + u32 uInputs;
4697 + u32 uOutputs;
4698 + struct DSP_NODEINFO iNodeInfo;
4699 + } ;
4702 + * Notification type: either the name of an opened event, or an event or
4703 + * window handle.
4704 + */
4705 + struct DSP_NOTIFICATION {
4706 + char *psName;
4707 + HANDLE handle;
4708 + } ;
4710 +/* The DSP_PROCESSORATTRIN structure describes the attributes of a processor */
4711 + struct DSP_PROCESSORATTRIN{
4712 + u32 cbStruct;
4713 + u32 uTimeout;
4714 + } ;
4716 + enum chipTypes {
4717 + DSPTYPE_55 = 6,
4718 + IVA_ARM7 = 0x97,
4719 + DSPTYPE_64 = 0x99
4720 + };
4723 + * The DSP_PROCESSORINFO structure describes basic capabilities of a
4724 + * DSP processor
4725 + */
4726 + struct DSP_PROCESSORINFO {
4727 + u32 cbStruct;
4728 + DSP_PROCFAMILY uProcessorFamily;
4729 + DSP_PROCTYPE uProcessorType;
4730 + u32 uClockRate;
4731 + u32 ulInternalMemSize;
4732 + u32 ulExternalMemSize;
4733 + u32 uProcessorID;
4734 + DSP_RTOSTYPE tyRunningRTOS;
4735 + s32 nNodeMinPriority;
4736 + s32 nNodeMaxPriority;
4737 + } ;
4739 +/* Error information of last DSP exception signalled to the GPP */
4740 + struct DSP_ERRORINFO {
4741 + u32 dwErrMask;
4742 + u32 dwVal1;
4743 + u32 dwVal2;
4744 + u32 dwVal3;
4745 + } ;
4747 +/* The DSP_PROCESSORSTATE structure describes the state of a DSP processor */
4748 + struct DSP_PROCESSORSTATE {
4749 + u32 cbStruct;
4750 + enum DSP_PROCSTATE iState;
4751 + struct DSP_ERRORINFO errInfo;
4752 + } ;
4755 + * The DSP_RESOURCEINFO structure is used to retrieve information about a
4756 + * processor's resources
4757 + */
4758 + struct DSP_RESOURCEINFO {
4759 + u32 cbStruct;
4760 + enum DSP_RESOURCEINFOTYPE uResourceType;
4761 + union {
4762 + u32 ulResource;
4763 + struct DSP_MEMSTAT memStat;
4764 + struct DSP_PROCLOADSTAT procLoadStat;
4765 + } result;
4766 + } ;
4769 + * The DSP_STREAMATTRIN structure describes the attributes of a stream,
4770 + * including segment and alignment of data buffers allocated with
4771 + * DSPStream_AllocateBuffers(), if applicable
4772 + */
4773 + struct DSP_STREAMATTRIN {
4774 + u32 cbStruct;
4775 + u32 uTimeout;
4776 + u32 uSegment;
4777 + u32 uAlignment;
4778 + u32 uNumBufs;
4779 + enum DSP_STRMMODE lMode;
4780 + u32 uDMAChnlId;
4781 + u32 uDMAPriority;
4782 + } ;
4784 +/* The DSP_BUFFERATTR structure describes the attributes of a data buffer */
4785 + struct DSP_BUFFERATTR {
4786 + u32 cbStruct;
4787 + u32 uSegment;
4788 + u32 uAlignment;
4789 + } ;
4792 + * The DSP_STREAMINFO structure is used to retrieve information
4793 + * about a stream.
4794 + */
4795 + struct DSP_STREAMINFO {
4796 + u32 cbStruct;
4797 + u32 uNumberBufsAllowed;
4798 + u32 uNumberBufsInStream;
4799 + u32 ulNumberBytes;
4800 + HANDLE hSyncObjectHandle;
4801 + enum DSP_STREAMSTATE ssStreamState;
4802 + } ;
4804 +/* DMM MAP attributes
4805 +It is a bit mask with each bit value indicating a specific attribute
4806 +bit 0 - GPP address type (user virtual=0, physical=1)
4807 +bit 1 - MMU Endianism (Big Endian=1, Little Endian=0)
4808 +bit 2 - MMU mixed page attribute (Mixed/ CPUES=1, TLBES =0)
4809 +bit 3 - MMU element size = 8bit (valid only for non mixed page entries)
4810 +bit 4 - MMU element size = 16bit (valid only for non mixed page entries)
4811 +bit 5 - MMU element size = 32bit (valid only for non mixed page entries)
4812 +bit 6 - MMU element size = 64bit (valid only for non mixed page entries)
4815 +/* Types of mapping attributes */
4817 +/* MPU address is virtual and needs to be translated to physical addr */
4818 +#define DSP_MAPVIRTUALADDR 0x00000000
4819 +#define DSP_MAPPHYSICALADDR 0x00000001
4821 +/* Mapped data is big endian */
4822 +#define DSP_MAPBIGENDIAN 0x00000002
4823 +#define DSP_MAPLITTLEENDIAN 0x00000000
4825 +/* Element size is based on DSP r/w access size */
4826 +#define DSP_MAPMIXEDELEMSIZE 0x00000004
4829 + * Element size for MMU mapping (8, 16, 32, or 64 bit)
4830 + * Ignored if DSP_MAPMIXEDELEMSIZE enabled
4831 + */
4832 +#define DSP_MAPELEMSIZE8 0x00000008
4833 +#define DSP_MAPELEMSIZE16 0x00000010
4834 +#define DSP_MAPELEMSIZE32 0x00000020
4835 +#define DSP_MAPELEMSIZE64 0x00000040
4837 +#define DSP_MAPVMALLOCADDR 0x00000080
4839 +#define GEM_CACHE_LINE_SIZE 128
4840 +#define GEM_L1P_PREFETCH_SIZE 128
4842 +#endif /* DBDEFS_ */
4843 Index: lk/arch/arm/plat-omap/include/bridge/dbg.h
4844 ===================================================================
4845 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4846 +++ lk/arch/arm/plat-omap/include/bridge/dbg.h 2008-08-18 10:38:34.000000000 +0300
4847 @@ -0,0 +1,110 @@
4849 + * arch/arm/plat-omap/include/bridge/dbg.h
4851 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
4853 + * Copyright (C) 2008 Texas Instruments, Inc.
4855 + * This package is free software; you can redistribute it and/or modify
4856 + * it under the terms of the GNU General Public License version 2 as
4857 + * published by the Free Software Foundation.
4859 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
4860 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
4861 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4862 + */
4865 + * ======== dbg.h ========
4866 + * Purpose:
4867 + * Provide debugging services for 'Bridge Mini Drivers.
4869 + * Public Functions:
4870 + * DBG_Exit
4871 + * DBG_Init
4872 + * DBG_Printf
4873 + * DBG_Trace
4875 + * Notes:
4876 + * WMD's must not call DBG_Init or DBG_Exit.
4878 + *! Revision History:
4879 + *! ================
4880 + *! 03-Feb-2000 rr: DBG Levels redefined.
4881 + *! 29-Oct-1999 kc: Cleaned up for code review.
4882 + *! 10-Oct-1997 cr: Added DBG_Printf service.
4883 + *! 29-May-1996 gp: Removed WCD_ prefix.
4884 + *! 15-May-1996 gp: Created.
4885 + */
4887 +#ifndef DBG_
4888 +#define DBG_
4889 +#include <host_os.h>
4890 +#include <linux/types.h>
4892 +/* Levels of trace debug messages: */
4893 +#define DBG_ENTER (u8)(0x01) /* Function entry point. */
4894 +#define DBG_LEVEL1 (u8)(0x02) /* Display debugging state/varibles */
4895 +#define DBG_LEVEL2 (u8)(0x04) /* Display debugging state/varibles */
4896 +#define DBG_LEVEL3 (u8)(0x08) /* Display debugging state/varibles */
4897 +#define DBG_LEVEL4 (u8)(0x10) /* Display debugging state/varibles */
4898 +#define DBG_LEVEL5 (u8)(0x20) /* Module Init, Exit */
4899 +#define DBG_LEVEL6 (u8)(0x40) /* Warn SERVICES Failures */
4900 +#define DBG_LEVEL7 (u8)(0x80) /* Warn Critical Errors */
4902 +#if ((defined DEBUG) || (defined DDSP_DEBUG_PRODUCT)) && GT_TRACE
4905 + * ======== DBG_Exit ========
4906 + * Purpose:
4907 + * Discontinue usage of module; free resources when reference count
4908 + * reaches 0.
4909 + * Parameters:
4910 + * Returns:
4911 + * Requires:
4912 + * DBG initialized.
4913 + * Ensures:
4914 + * Resources used by module are freed when cRef reaches zero.
4915 + */
4916 + extern void DBG_Exit();
4919 + * ======== DBG_Init ========
4920 + * Purpose:
4921 + * Initializes private state of DBG module.
4922 + * Parameters:
4923 + * Returns:
4924 + * TRUE if initialized; FALSE if error occured.
4925 + * Requires:
4926 + * Ensures:
4927 + */
4928 + extern bool DBG_Init();
4931 + * ======== DBG_Trace ========
4932 + * Purpose:
4933 + * Output a trace message to the debugger, if the given trace level
4934 + * is unmasked.
4935 + * Parameters:
4936 + * bLevel: Trace level.
4937 + * pstrFormat: sprintf-style format string.
4938 + * ...: Arguments for format string.
4939 + * Returns:
4940 + * DSP_SOK: Success, or trace level masked.
4941 + * DSP_EFAIL: On Error.
4942 + * Requires:
4943 + * DBG initialized.
4944 + * Ensures:
4945 + * Debug message is printed to debugger output window, if trace level
4946 + * is unmasked.
4947 + */
4948 + extern DSP_STATUS DBG_Trace(IN u8 bLevel, IN char *pstrFormat, ...);
4949 +#else
4951 +#define DBG_Exit()
4952 +#define DBG_Init() true
4953 +#define DBG_Trace(bLevel, pstrFormat, args...)
4955 +#endif /* ((defined DEBUG) || (defined DDSP_DEBUG_PRODUCT)) && GT_TRACE */
4957 +#endif /* DBG_ */
4958 Index: lk/arch/arm/plat-omap/include/bridge/dbl.h
4959 ===================================================================
4960 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4961 +++ lk/arch/arm/plat-omap/include/bridge/dbl.h 2008-08-18 10:38:34.000000000 +0300
4962 @@ -0,0 +1,354 @@
4964 + * arch/arm/plat-omap/include/bridge/dbl.h
4966 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
4968 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
4970 + * This package is free software; you can redistribute it and/or modify
4971 + * it under the terms of the GNU General Public License version 2 as
4972 + * published by the Free Software Foundation.
4974 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
4975 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
4976 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4977 + */
4981 + * ======== dbl.h ========
4983 + *! Revision History
4984 + *! ================
4985 + *! 19-Mar-2002 jeh Pass DBL_Symbol pointer to DBL_getAddr, DBL_getCAddr
4986 + *! to accomodate dynamic loader library.
4987 + *! 20-Nov-2001 jeh Removed DBL_loadArgs().
4988 + *! 24-Sep-2001 jeh Code review changes.
4989 + *! 07-Sep-2001 jeh Added DBL_LoadSect(), DBL_UnloadSect().
4990 + *! 05-Jun-2001 jeh Created based on zl.h.
4991 + */
4993 +#ifndef DBL_
4994 +#define DBL_
4996 +#include <dbdefs.h>
4997 +#include <dbldefs.h>
5000 + * ======== DBL_close ========
5001 + * Close library opened with DBL_open.
5002 + * Parameters:
5003 + * lib - Handle returned from DBL_open().
5004 + * Returns:
5005 + * Requires:
5006 + * DBL initialized.
5007 + * Valid lib.
5008 + * Ensures:
5009 + */
5010 + extern void DBL_close(struct DBL_LibraryObj *lib);
5013 + * ======== DBL_create ========
5014 + * Create a target object by specifying the alloc, free, and write
5015 + * functions for the target.
5016 + * Parameters:
5017 + * pTarget - Location to store target handle on output.
5018 + * pAttrs - Attributes.
5019 + * Returns:
5020 + * DSP_SOK: Success.
5021 + * DSP_EMEMORY: Memory allocation failed.
5022 + * Requires:
5023 + * DBL initialized.
5024 + * pAttrs != NULL.
5025 + * pTarget != NULL;
5026 + * Ensures:
5027 + * Success: *pTarget != NULL.
5028 + * Failure: *pTarget == NULL.
5029 + */
5030 + extern DSP_STATUS DBL_create(struct DBL_TargetObj **pTarget,
5031 + struct DBL_Attrs *pAttrs);
5034 + * ======== DBL_delete ========
5035 + * Delete target object and free resources for any loaded libraries.
5036 + * Parameters:
5037 + * target - Handle returned from DBL_Create().
5038 + * Returns:
5039 + * Requires:
5040 + * DBL initialized.
5041 + * Valid target.
5042 + * Ensures:
5043 + */
5044 + extern void DBL_delete(struct DBL_TargetObj *target);
5047 + * ======== DBL_exit ========
5048 + * Discontinue use of DBL module.
5049 + * Parameters:
5050 + * Returns:
5051 + * Requires:
5052 + * cRefs > 0.
5053 + * Ensures:
5054 + * cRefs >= 0.
5055 + */
5056 + extern void DBL_exit(void);
5059 + * ======== DBL_getAddr ========
5060 + * Get address of name in the specified library.
5061 + * Parameters:
5062 + * lib - Handle returned from DBL_open().
5063 + * name - Name of symbol
5064 + * ppSym - Location to store symbol address on output.
5065 + * Returns:
5066 + * TRUE: Success.
5067 + * FALSE: Symbol not found.
5068 + * Requires:
5069 + * DBL initialized.
5070 + * Valid lib.
5071 + * name != NULL.
5072 + * pAddr != NULL.
5073 + * Ensures:
5074 + */
5075 + extern bool DBL_getAddr(struct DBL_LibraryObj *lib, char *name,
5076 + struct DBL_Symbol **ppSym);
5079 + * ======== DBL_getAttrs ========
5080 + * Retrieve the attributes of the target.
5081 + * Parameters:
5082 + * target - Handle returned from DBL_Create().
5083 + * pAttrs - Location to store attributes on output.
5084 + * Returns:
5085 + * Requires:
5086 + * DBL initialized.
5087 + * Valid target.
5088 + * pAttrs != NULL.
5089 + * Ensures:
5090 + */
5091 + extern void DBL_getAttrs(struct DBL_TargetObj *target,
5092 + struct DBL_Attrs *pAttrs);
5095 + * ======== DBL_getCAddr ========
5096 + * Get address of "C" name in the specified library.
5097 + * Parameters:
5098 + * lib - Handle returned from DBL_open().
5099 + * name - Name of symbol
5100 + * ppSym - Location to store symbol address on output.
5101 + * Returns:
5102 + * TRUE: Success.
5103 + * FALSE: Symbol not found.
5104 + * Requires:
5105 + * DBL initialized.
5106 + * Valid lib.
5107 + * name != NULL.
5108 + * pAddr != NULL.
5109 + * Ensures:
5110 + */
5111 + extern bool DBL_getCAddr(struct DBL_LibraryObj *lib, char *name,
5112 + struct DBL_Symbol **ppSym);
5115 + * ======== DBL_getEntry ========
5116 + * Get program entry point.
5118 + * Parameters:
5119 + * lib - Handle returned from DBL_open().
5120 + * pEntry - Location to store entry address on output.
5121 + * Returns:
5122 + * TRUE: Success.
5123 + * FALSE: Failure.
5124 + * Requires:
5125 + * DBL initialized.
5126 + * Valid lib.
5127 + * pEntry != NULL.
5128 + * Ensures:
5129 + */
5130 + extern bool DBL_getEntry(struct DBL_LibraryObj *lib, u32 *pEntry);
5133 + * ======== DBL_getSect ========
5134 + * Get address and size of a named section.
5135 + * Parameters:
5136 + * lib - Library handle returned from DBL_open().
5137 + * name - Name of section.
5138 + * pAddr - Location to store section address on output.
5139 + * pSize - Location to store section size on output.
5140 + * Returns:
5141 + * DSP_SOK: Success.
5142 + * DSP_ENOSECT: Section not found.
5143 + * Requires:
5144 + * DBL initialized.
5145 + * Valid lib.
5146 + * name != NULL.
5147 + * pAddr != NULL;
5148 + * pSize != NULL.
5149 + * Ensures:
5150 + */
5151 + extern DSP_STATUS DBL_getSect(struct DBL_LibraryObj *lib, char *name,
5152 + u32 *pAddr, u32 *pSize);
5155 + * ======== DBL_init ========
5156 + * Initialize DBL module.
5157 + * Parameters:
5158 + * Returns:
5159 + * TRUE: Success.
5160 + * FALSE: Failure.
5161 + * Requires:
5162 + * cRefs >= 0.
5163 + * Ensures:
5164 + * Success: cRefs > 0.
5165 + * Failure: cRefs >= 0.
5166 + */
5167 + extern bool DBL_init(void);
5170 + * ======== DBL_load ========
5171 + * Add symbols/code/data defined in file to that already present on
5172 + * the target.
5174 + * Parameters:
5175 + * lib - Library handle returned from DBL_open().
5176 + * flags - Specifies whether loading code, data, and/or symbols.
5177 + * attrs - May contain write, alloc, and free functions.
5178 + * pulEntry - Location to store program entry on output.
5179 + * Returns:
5180 + * DSP_SOK: Success.
5181 + * DSP_EFREAD: File read failed.
5182 + * DSP_EFWRITE: Write to target failed.
5183 + * Requires:
5184 + * DBL initialized.
5185 + * Valid lib.
5186 + * pEntry != NULL.
5187 + * Ensures:
5188 + */
5189 + extern DSP_STATUS DBL_load(struct DBL_LibraryObj *lib, DBL_Flags flags,
5190 + struct DBL_Attrs *attrs, u32 *pEntry);
5193 + * ======== DBL_loadSect ========
5194 + * Load a named section from an library (for overlay support).
5195 + * Parameters:
5196 + * lib - Handle returned from DBL_open().
5197 + * sectName - Name of section to load.
5198 + * attrs - Contains write function and handle to pass to it.
5199 + * Returns:
5200 + * DSP_SOK: Success.
5201 + * DSP_ENOSECT: Section not found.
5202 + * DSP_EFWRITE: Write function failed.
5203 + * Requires:
5204 + * Valid lib.
5205 + * sectName != NULL.
5206 + * attrs != NULL.
5207 + * attrs->write != NULL.
5208 + * Ensures:
5209 + */
5210 + extern DSP_STATUS DBL_loadSect(struct DBL_LibraryObj *lib,
5211 + char *sectName,
5212 + struct DBL_Attrs *attrs);
5215 + * ======== DBL_open ========
5216 + * DBL_open() returns a library handle that can be used to load/unload
5217 + * the symbols/code/data via DBL_load()/DBL_unload().
5218 + * Parameters:
5219 + * target - Handle returned from DBL_create().
5220 + * file - Name of file to open.
5221 + * flags - Specifies whether to load symbols now.
5222 + * pLib - Location to store library handle on output.
5223 + * Returns:
5224 + * DSP_SOK: Success.
5225 + * DSP_EMEMORY: Memory allocation failure.
5226 + * DSP_EFOPEN: File open failure.
5227 + * DSP_EFREAD: File read failure.
5228 + * DSP_ECORRUPTFILE: Unable to determine target type.
5229 + * Requires:
5230 + * DBL initialized.
5231 + * Valid target.
5232 + * file != NULL.
5233 + * pLib != NULL.
5234 + * struct DBL_Attrs fopen function non-NULL.
5235 + * Ensures:
5236 + * Success: Valid *pLib.
5237 + * Failure: *pLib == NULL.
5238 + */
5239 + extern DSP_STATUS DBL_open(struct DBL_TargetObj *target, char *file,
5240 + DBL_Flags flags,
5241 + struct DBL_LibraryObj **pLib);
5244 + * ======== DBL_readSect ========
5245 + * Read COFF section into a character buffer.
5246 + * Parameters:
5247 + * lib - Library handle returned from DBL_open().
5248 + * name - Name of section.
5249 + * pBuf - Buffer to write section contents into.
5250 + * size - Buffer size
5251 + * Returns:
5252 + * DSP_SOK: Success.
5253 + * DSP_ENOSECT: Named section does not exists.
5254 + * Requires:
5255 + * DBL initialized.
5256 + * Valid lib.
5257 + * name != NULL.
5258 + * pBuf != NULL.
5259 + * size != 0.
5260 + * Ensures:
5261 + */
5262 + extern DSP_STATUS DBL_readSect(struct DBL_LibraryObj *lib, char *name,
5263 + char *pBuf, u32 size);
5266 + * ======== DBL_setAttrs ========
5267 + * Set the attributes of the target.
5268 + * Parameters:
5269 + * target - Handle returned from DBL_create().
5270 + * pAttrs - New attributes.
5271 + * Returns:
5272 + * Requires:
5273 + * DBL initialized.
5274 + * Valid target.
5275 + * pAttrs != NULL.
5276 + * Ensures:
5277 + */
5278 + extern void DBL_setAttrs(struct DBL_TargetObj *target,
5279 + struct DBL_Attrs *pAttrs);
5282 + * ======== DBL_unload ========
5283 + * Remove the symbols/code/data corresponding to the library lib.
5284 + * Parameters:
5285 + * lib - Handle returned from DBL_open().
5286 + * attrs - Contains free() function and handle to pass to it.
5287 + * Returns:
5288 + * Requires:
5289 + * DBL initialized.
5290 + * Valid lib.
5291 + * Ensures:
5292 + */
5293 + extern void DBL_unload(struct DBL_LibraryObj *lib,
5294 + struct DBL_Attrs *attrs);
5297 + * ======== DBL_unloadSect ========
5298 + * Unload a named section from an library (for overlay support).
5299 + * Parameters:
5300 + * lib - Handle returned from DBL_open().
5301 + * sectName - Name of section to load.
5302 + * attrs - Contains free() function and handle to pass to it.
5303 + * Returns:
5304 + * DSP_SOK: Success.
5305 + * DSP_ENOSECT: Named section not found.
5306 + * Requires:
5307 + * DBL initialized.
5308 + * Valid lib.
5309 + * sectName != NULL.
5310 + * Ensures:
5311 + */
5312 + extern DSP_STATUS DBL_unloadSect(struct DBL_LibraryObj *lib,
5313 + char *sectName,
5314 + struct DBL_Attrs *attrs);
5316 +#endif /* DBL_ */
5317 Index: lk/arch/arm/plat-omap/include/bridge/dbldefs.h
5318 ===================================================================
5319 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
5320 +++ lk/arch/arm/plat-omap/include/bridge/dbldefs.h 2008-08-18 10:38:34.000000000 +0300
5321 @@ -0,0 +1,519 @@
5323 + * arch/arm/plat-omap/include/bridge/dbldefs.h
5325 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5327 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
5329 + * This package is free software; you can redistribute it and/or modify
5330 + * it under the terms of the GNU General Public License version 2 as
5331 + * published by the Free Software Foundation.
5333 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
5334 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
5335 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
5336 + */
5340 + * ======== dbldefs.h ========
5342 + *! Revision History
5343 + *! ================
5344 + *! 19-Mar-2002 jeh Added DBL_Fxns type (to make it easier to switch
5345 + *! between different loaders).
5346 + *! 28-Sep-2001 jeh Created from zl.h.
5347 + */
5348 +#ifndef DBLDEFS_
5349 +#define DBLDEFS_
5352 + * Bit masks for DBL_Flags.
5353 + */
5354 +#define DBL_NOLOAD 0x0 /* Don't load symbols, code, or data */
5355 +#define DBL_SYMB 0x1 /* load symbols */
5356 +#define DBL_CODE 0x2 /* load code */
5357 +#define DBL_DATA 0x4 /* load data */
5358 +#define DBL_DYNAMIC 0x8 /* dynamic load */
5359 +#define DBL_BSS 0x20 /* Unitialized section */
5361 +#define DBL_MAXPATHLENGTH 255
5363 +#ifndef _SIZE_T /* Linux sets _SIZE_T on defining size_t */
5364 +typedef unsigned int size_t;
5365 +#define _SIZE_T
5366 +#endif
5369 + * ======== DBL_Flags ========
5370 + * Specifies whether to load code, data, or symbols
5371 + */
5372 +typedef s32 DBL_Flags;
5375 + * ======== DBL_SectInfo ========
5376 + * For collecting info on overlay sections
5377 + */
5378 +struct DBL_SectInfo {
5379 + const char *name; /* name of section */
5380 + u32 runAddr; /* run address of section */
5381 + u32 loadAddr; /* load address of section */
5382 + u32 size; /* size of section (target MAUs) */
5383 + DBL_Flags type; /* Code, data, or BSS */
5384 +} ;
5387 + * ======== DBL_Symbol ========
5388 + * (Needed for dynamic load library)
5389 + */
5390 +struct DBL_Symbol {
5391 + u32 value;
5395 + * ======== DBL_AllocFxn ========
5396 + * Allocate memory function. Allocate or reserve (if reserved == TRUE)
5397 + * "size" bytes of memory from segment "space" and return the address in
5398 + * *dspAddr (or starting at *dspAddr if reserve == TRUE). Returns 0 on
5399 + * success, or an error code on failure.
5400 + */
5401 +typedef s32(*DBL_AllocFxn) (void *hdl, s32 space, u32 size, u32 align,
5402 + u32 *dspAddr, s32 segId, s32 req, bool reserved);
5405 + * ======== DBL_CinitFxn ========
5406 + * Process .cinit records.
5407 + * Parameters:
5408 + * hdl - Opaque handle
5409 + * dspAddress - DSP address of .cinit section
5410 + * buf - Buffer containing .cinit section
5411 + * nBytes - Size of .cinit section (host bytes)
5412 + * mtype - Page? (does not need to be used)
5414 + * Returns:
5415 + * nBytes - Success
5416 + * < nBytes - Failure
5418 + * Note: Cinit processing can either be done by the DSP, in which case
5419 + * the .cinit section must have already been written, or on the host,
5420 + * in which case we need to use the data in buf.
5421 + */
5422 +typedef s32(*DBL_CinitFxn) (void *hdl, u32 dspAddr, void *buf,
5423 + u32 nBytes, s32 mtype);
5426 + * ======== DBL_CloseFxn ========
5427 + */
5428 +typedef s32(*DBL_FCloseFxn) (void *);
5431 + * ======== DBL_FreeFxn ========
5432 + * Free memory function. Free, or unreserve (if reserved == TRUE) "size"
5433 + * bytes of memory from segment "space"
5434 + */
5435 +typedef bool(*DBL_FreeFxn) (void *hdl, u32 addr, s32 space, u32 size,
5436 + bool reserved);
5439 + * ======== DBL_FOpenFxn ========
5440 + */
5441 +typedef void *(*DBL_FOpenFxn) (const char *, const char *);
5444 + * ======== DBL_LogWriteFxn ========
5445 + * Function to call when writing data from a section, to log the info.
5446 + * Can be NULL if no logging is required.
5447 + */
5448 +typedef DSP_STATUS(*DBL_LogWriteFxn) (void *handle, struct DBL_SectInfo *sect,
5449 + u32 addr, u32 nBytes);
5452 + * ======== DBL_ReadFxn ========
5453 + */
5454 +typedef s32(*DBL_ReadFxn) (void *, size_t, size_t, void *);
5457 + * ======== DBL_SeekFxn ========
5458 + */
5459 +typedef s32(*DBL_SeekFxn) (void *, long, int);
5462 + * ======== DBL_SymLookup ========
5463 + * Symbol lookup function - Find the symbol name and return its value.
5465 + * Parameters:
5466 + * handle - Opaque handle
5467 + * pArg - Opaque argument.
5468 + * name - Name of symbol to lookup.
5469 + * sym - Location to store address of symbol structure.
5471 + * Returns:
5472 + * TRUE: Success (symbol was found).
5473 + * FALSE: Failed to find symbol.
5474 + */
5475 +typedef bool(*DBL_SymLookup) (void *handle, void *pArg, void *rmmHandle,
5476 + const char *name, struct DBL_Symbol **sym);
5479 + * ======== DBL_TellFxn ========
5480 + */
5481 +typedef s32(*DBL_TellFxn) (void *);
5484 + * ======== DBL_WriteFxn ========
5485 + * Write memory function. Write "n" HOST bytes of memory to segment "mtype"
5486 + * starting at address "dspAddr" from the buffer "buf". The buffer is
5487 + * formatted as an array of words appropriate for the DSP.
5488 + */
5489 +typedef s32(*DBL_WriteFxn) (void *hdl, u32 dspAddr, void *buf,
5490 + u32 n, s32 mtype);
5493 + * ======== DBL_Attrs ========
5494 + */
5495 +struct DBL_Attrs {
5496 + DBL_AllocFxn alloc;
5497 + DBL_FreeFxn free;
5498 + void *rmmHandle; /* Handle to pass to alloc, free functions */
5499 + DBL_WriteFxn write;
5500 + void *wHandle; /* Handle to pass to write, cinit function */
5502 + DBL_LogWriteFxn logWrite;
5503 + void *logWriteHandle;
5505 + /* Symbol matching function and handle to pass to it */
5506 + DBL_SymLookup symLookup;
5507 + void *symHandle;
5508 + void *symArg;
5510 + /*
5511 + * These file manipulation functions should be compatible with the
5512 + * "C" run time library functions of the same name.
5513 + */
5514 + s32(*fread) (void *, size_t, size_t, void *);
5515 + s32(*fseek) (void *, long, int);
5516 + s32(*ftell) (void *);
5517 + s32(*fclose) (void *);
5518 + void *(*fopen) (const char *, const char *);
5519 +} ;
5522 + * ======== DBL_close ========
5523 + * Close library opened with DBL_open.
5524 + * Parameters:
5525 + * lib - Handle returned from DBL_open().
5526 + * Returns:
5527 + * Requires:
5528 + * DBL initialized.
5529 + * Valid lib.
5530 + * Ensures:
5531 + */
5532 +typedef void(*DBL_CloseFxn) (struct DBL_LibraryObj *library);
5535 + * ======== DBL_create ========
5536 + * Create a target object, specifying the alloc, free, and write functions.
5537 + * Parameters:
5538 + * pTarget - Location to store target handle on output.
5539 + * pAttrs - Attributes.
5540 + * Returns:
5541 + * DSP_SOK: Success.
5542 + * DSP_EMEMORY: Memory allocation failed.
5543 + * Requires:
5544 + * DBL initialized.
5545 + * pAttrs != NULL.
5546 + * pTarget != NULL;
5547 + * Ensures:
5548 + * Success: *pTarget != NULL.
5549 + * Failure: *pTarget == NULL.
5550 + */
5551 +typedef DSP_STATUS(*DBL_CreateFxn) (struct DBL_TargetObj **pTarget,
5552 + struct DBL_Attrs *attrs);
5555 + * ======== DBL_delete ========
5556 + * Delete target object and free resources for any loaded libraries.
5557 + * Parameters:
5558 + * target - Handle returned from DBL_Create().
5559 + * Returns:
5560 + * Requires:
5561 + * DBL initialized.
5562 + * Valid target.
5563 + * Ensures:
5564 + */
5565 +typedef void(*DBL_DeleteFxn) (struct DBL_TargetObj *target);
5568 + * ======== DBL_exit ========
5569 + * Discontinue use of DBL module.
5570 + * Parameters:
5571 + * Returns:
5572 + * Requires:
5573 + * cRefs > 0.
5574 + * Ensures:
5575 + * cRefs >= 0.
5576 + */
5577 +typedef void(*DBL_ExitFxn) (void);
5580 + * ======== DBL_getAddr ========
5581 + * Get address of name in the specified library.
5582 + * Parameters:
5583 + * lib - Handle returned from DBL_open().
5584 + * name - Name of symbol
5585 + * ppSym - Location to store symbol address on output.
5586 + * Returns:
5587 + * TRUE: Success.
5588 + * FALSE: Symbol not found.
5589 + * Requires:
5590 + * DBL initialized.
5591 + * Valid library.
5592 + * name != NULL.
5593 + * ppSym != NULL.
5594 + * Ensures:
5595 + */
5596 +typedef bool(*DBL_GetAddrFxn) (struct DBL_LibraryObj *lib, char *name,
5597 + struct DBL_Symbol **ppSym);
5600 + * ======== DBL_getAttrs ========
5601 + * Retrieve the attributes of the target.
5602 + * Parameters:
5603 + * target - Handle returned from DBL_Create().
5604 + * pAttrs - Location to store attributes on output.
5605 + * Returns:
5606 + * Requires:
5607 + * DBL initialized.
5608 + * Valid target.
5609 + * pAttrs != NULL.
5610 + * Ensures:
5611 + */
5612 +typedef void(*DBL_GetAttrsFxn) (struct DBL_TargetObj *target,
5613 + struct DBL_Attrs *attrs);
5616 + * ======== DBL_getCAddr ========
5617 + * Get address of "C" name on the specified library.
5618 + * Parameters:
5619 + * lib - Handle returned from DBL_open().
5620 + * name - Name of symbol
5621 + * ppSym - Location to store symbol address on output.
5622 + * Returns:
5623 + * TRUE: Success.
5624 + * FALSE: Symbol not found.
5625 + * Requires:
5626 + * DBL initialized.
5627 + * Valid target.
5628 + * name != NULL.
5629 + * ppSym != NULL.
5630 + * Ensures:
5631 + */
5632 +typedef bool(*DBL_GetCAddrFxn) (struct DBL_LibraryObj *lib, char *name,
5633 + struct DBL_Symbol **ppSym);
5636 + * ======== DBL_getSect ========
5637 + * Get address and size of a named section.
5638 + * Parameters:
5639 + * lib - Library handle returned from DBL_open().
5640 + * name - Name of section.
5641 + * pAddr - Location to store section address on output.
5642 + * pSize - Location to store section size on output.
5643 + * Returns:
5644 + * DSP_SOK: Success.
5645 + * DSP_ENOSECT: Section not found.
5646 + * Requires:
5647 + * DBL initialized.
5648 + * Valid lib.
5649 + * name != NULL.
5650 + * pAddr != NULL;
5651 + * pSize != NULL.
5652 + * Ensures:
5653 + */
5654 +typedef DSP_STATUS(*DBL_GetSectFxn) (struct DBL_LibraryObj *lib, char *name,
5655 + u32 *addr, u32 *size);
5658 + * ======== DBL_init ========
5659 + * Initialize DBL module.
5660 + * Parameters:
5661 + * Returns:
5662 + * TRUE: Success.
5663 + * FALSE: Failure.
5664 + * Requires:
5665 + * cRefs >= 0.
5666 + * Ensures:
5667 + * Success: cRefs > 0.
5668 + * Failure: cRefs >= 0.
5669 + */
5670 +typedef bool(*DBL_InitFxn) (void);
5673 + * ======== DBL_load ========
5674 + * Load library onto the target.
5676 + * Parameters:
5677 + * lib - Library handle returned from DBL_open().
5678 + * flags - Load code, data and/or symbols.
5679 + * attrs - May contain alloc, free, and write function.
5680 + * pulEntry - Location to store program entry on output.
5681 + * Returns:
5682 + * DSP_SOK: Success.
5683 + * DSP_EFREAD: File read failed.
5684 + * DSP_EFWRITE: Write to target failed.
5685 + * DSP_EDYNLOAD: Failure in dynamic loader library.
5686 + * Requires:
5687 + * DBL initialized.
5688 + * Valid lib.
5689 + * pEntry != NULL.
5690 + * Ensures:
5691 + */
5692 +typedef DSP_STATUS(*DBL_LoadFxn) (struct DBL_LibraryObj *lib, DBL_Flags flags,
5693 + struct DBL_Attrs *attrs, u32 *entry);
5696 + * ======== DBL_loadSect ========
5697 + * Load a named section from an library (for overlay support).
5698 + * Parameters:
5699 + * lib - Handle returned from DBL_open().
5700 + * sectName - Name of section to load.
5701 + * attrs - Contains write function and handle to pass to it.
5702 + * Returns:
5703 + * DSP_SOK: Success.
5704 + * DSP_ENOSECT: Section not found.
5705 + * DSP_EFWRITE: Write function failed.
5706 + * DSP_ENOTIMPL: Function not implemented.
5707 + * Requires:
5708 + * Valid lib.
5709 + * sectName != NULL.
5710 + * attrs != NULL.
5711 + * attrs->write != NULL.
5712 + * Ensures:
5713 + */
5714 +typedef DSP_STATUS(*DBL_LoadSectFxn) (struct DBL_LibraryObj *lib,
5715 + char *pszSectName,
5716 + struct DBL_Attrs *attrs);
5719 + * ======== DBL_open ========
5720 + * DBL_open() returns a library handle that can be used to load/unload
5721 + * the symbols/code/data via DBL_load()/DBL_unload().
5722 + * Parameters:
5723 + * target - Handle returned from DBL_create().
5724 + * file - Name of file to open.
5725 + * flags - If flags & DBL_SYMB, load symbols.
5726 + * pLib - Location to store library handle on output.
5727 + * Returns:
5728 + * DSP_SOK: Success.
5729 + * DSP_EMEMORY: Memory allocation failure.
5730 + * DSP_EFOPEN: File open failure.
5731 + * DSP_EFREAD: File read failure.
5732 + * DSP_ECORRUPTFILE: Unable to determine target type.
5733 + * Requires:
5734 + * DBL initialized.
5735 + * Valid target.
5736 + * file != NULL.
5737 + * pLib != NULL.
5738 + * DBL_Attrs fopen function non-NULL.
5739 + * Ensures:
5740 + * Success: Valid *pLib.
5741 + * Failure: *pLib == NULL.
5742 + */
5743 +typedef DSP_STATUS(*DBL_OpenFxn) (struct DBL_TargetObj *target, char *file,
5744 + DBL_Flags flags,
5745 + struct DBL_LibraryObj **pLib);
5748 + * ======== DBL_readSect ========
5749 + * Read COFF section into a character buffer.
5750 + * Parameters:
5751 + * lib - Library handle returned from DBL_open().
5752 + * name - Name of section.
5753 + * pBuf - Buffer to write section contents into.
5754 + * size - Buffer size
5755 + * Returns:
5756 + * DSP_SOK: Success.
5757 + * DSP_ENOSECT: Named section does not exists.
5758 + * Requires:
5759 + * DBL initialized.
5760 + * Valid lib.
5761 + * name != NULL.
5762 + * pBuf != NULL.
5763 + * size != 0.
5764 + * Ensures:
5765 + */
5766 +typedef DSP_STATUS(*DBL_ReadSectFxn) (struct DBL_LibraryObj *lib, char *name,
5767 + char *content, u32 uContentSize);
5770 + * ======== DBL_setAttrs ========
5771 + * Set the attributes of the target.
5772 + * Parameters:
5773 + * target - Handle returned from DBL_create().
5774 + * pAttrs - New attributes.
5775 + * Returns:
5776 + * Requires:
5777 + * DBL initialized.
5778 + * Valid target.
5779 + * pAttrs != NULL.
5780 + * Ensures:
5781 + */
5782 +typedef void(*DBL_SetAttrsFxn) (struct DBL_TargetObj *target,
5783 + struct DBL_Attrs *attrs);
5786 + * ======== DBL_unload ========
5787 + * Unload library loaded with DBL_load().
5788 + * Parameters:
5789 + * lib - Handle returned from DBL_open().
5790 + * attrs - Contains free() function and handle to pass to it.
5791 + * Returns:
5792 + * Requires:
5793 + * DBL initialized.
5794 + * Valid lib.
5795 + * Ensures:
5796 + */
5797 +typedef void(*DBL_UnloadFxn) (struct DBL_LibraryObj *library,
5798 + struct DBL_Attrs *attrs);
5801 + * ======== DBL_unloadSect ========
5802 + * Unload a named section from an library (for overlay support).
5803 + * Parameters:
5804 + * lib - Handle returned from DBL_open().
5805 + * sectName - Name of section to load.
5806 + * attrs - Contains free() function and handle to pass to it.
5807 + * Returns:
5808 + * DSP_SOK: Success.
5809 + * DSP_ENOSECT: Named section not found.
5810 + * DSP_ENOTIMPL
5811 + * Requires:
5812 + * DBL initialized.
5813 + * Valid lib.
5814 + * sectName != NULL.
5815 + * Ensures:
5816 + */
5817 +typedef DSP_STATUS(*DBL_UnloadSectFxn) (struct DBL_LibraryObj *lib,
5818 + char *pszSectName,
5819 + struct DBL_Attrs *attrs);
5821 +struct DBL_Fxns {
5822 + DBL_CloseFxn closeFxn;
5823 + DBL_CreateFxn createFxn;
5824 + DBL_DeleteFxn deleteFxn;
5825 + DBL_ExitFxn exitFxn;
5826 + DBL_GetAttrsFxn getAttrsFxn;
5827 + DBL_GetAddrFxn getAddrFxn;
5828 + DBL_GetCAddrFxn getCAddrFxn;
5829 + DBL_GetSectFxn getSectFxn;
5830 + DBL_InitFxn initFxn;
5831 + DBL_LoadFxn loadFxn;
5832 + DBL_LoadSectFxn loadSectFxn;
5833 + DBL_OpenFxn openFxn;
5834 + DBL_ReadSectFxn readSectFxn;
5835 + DBL_SetAttrsFxn setAttrsFxn;
5836 + DBL_UnloadFxn unloadFxn;
5837 + DBL_UnloadSectFxn unloadSectFxn;
5840 +#endif /* DBLDEFS_ */
5841 Index: lk/arch/arm/plat-omap/include/bridge/dbll.h
5842 ===================================================================
5843 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
5844 +++ lk/arch/arm/plat-omap/include/bridge/dbll.h 2008-08-18 10:38:34.000000000 +0300
5845 @@ -0,0 +1,70 @@
5847 + * arch/arm/plat-omap/include/bridge/dbll.h
5849 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5851 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
5853 + * This package is free software; you can redistribute it and/or modify
5854 + * it under the terms of the GNU General Public License version 2 as
5855 + * published by the Free Software Foundation.
5857 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
5858 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
5859 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
5860 + */
5864 + * ======== dbll.h ========
5865 + * DSP/BIOS Bridge Dynamic load library module interface. Function header
5866 + * comments are in the file dblldefs.h.
5868 + *! Revision History
5869 + *! ================
5870 + *! 31-Jul-2002 jeh Removed function comments (now in dblldefs.h).
5871 + *! 17-Apr-2002 jeh Created based on zl.h.
5872 + */
5874 +#ifndef DBLL_
5875 +#define DBLL_
5877 +#include <dbdefs.h>
5878 +#include <dblldefs.h>
5880 + extern void DBLL_close(struct DBLL_LibraryObj *lib);
5881 + extern DSP_STATUS DBLL_create(struct DBLL_TarObj **pTarget,
5882 + struct DBLL_Attrs *pAttrs);
5883 + extern void DBLL_delete(struct DBLL_TarObj *target);
5884 + extern void DBLL_exit(void);
5885 + extern bool DBLL_getAddr(struct DBLL_LibraryObj *lib, char *name,
5886 + struct DBLL_Symbol **ppSym);
5887 + extern void DBLL_getAttrs(struct DBLL_TarObj *target,
5888 + struct DBLL_Attrs *pAttrs);
5889 + extern bool DBLL_getCAddr(struct DBLL_LibraryObj *lib, char *name,
5890 + struct DBLL_Symbol **ppSym);
5891 + extern DSP_STATUS DBLL_getSect(struct DBLL_LibraryObj *lib, char *name,
5892 + u32 *pAddr, u32 *pSize);
5893 + extern bool DBLL_init(void);
5894 + extern DSP_STATUS DBLL_load(struct DBLL_LibraryObj *lib,
5895 + DBLL_Flags flags,
5896 + struct DBLL_Attrs *attrs, u32 *pEntry);
5897 + extern DSP_STATUS DBLL_loadSect(struct DBLL_LibraryObj *lib,
5898 + char *sectName,
5899 + struct DBLL_Attrs *attrs);
5900 + extern DSP_STATUS DBLL_open(struct DBLL_TarObj *target, char *file,
5901 + DBLL_Flags flags,
5902 + struct DBLL_LibraryObj **pLib);
5903 + extern DSP_STATUS DBLL_readSect(struct DBLL_LibraryObj *lib,
5904 + char *name,
5905 + char *pBuf, u32 size);
5906 + extern void DBLL_setAttrs(struct DBLL_TarObj *target,
5907 + struct DBLL_Attrs *pAttrs);
5908 + extern void DBLL_unload(struct DBLL_LibraryObj *lib,
5909 + struct DBLL_Attrs *attrs);
5910 + extern DSP_STATUS DBLL_unloadSect(struct DBLL_LibraryObj *lib,
5911 + char *sectName,
5912 + struct DBLL_Attrs *attrs);
5914 +#endif /* DBLL_ */
5916 Index: lk/arch/arm/plat-omap/include/bridge/dblldefs.h
5917 ===================================================================
5918 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
5919 +++ lk/arch/arm/plat-omap/include/bridge/dblldefs.h 2008-08-18 10:38:34.000000000 +0300
5920 @@ -0,0 +1,513 @@
5922 + * arch/arm/plat-omap/include/bridge/dblldefs.h
5924 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5926 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
5928 + * This package is free software; you can redistribute it and/or modify
5929 + * it under the terms of the GNU General Public License version 2 as
5930 + * published by the Free Software Foundation.
5932 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
5933 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
5934 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
5935 + */
5939 + * ======== dblldefs.h ========
5941 + *! Revision History
5942 + *! ================
5943 + *! 08-Apr-2003 map Consolidated DBL into DBLL name
5944 + *! 19-Mar-2002 jeh Added DBL_Fxns type (to make it easier to switch
5945 + *! between different loaders).
5946 + *! 28-Sep-2001 jeh Created from zl.h.
5947 + */
5948 +#ifndef DBLLDEFS_
5949 +#define DBLLDEFS_
5952 + * Bit masks for DBL_Flags.
5953 + */
5954 +#define DBLL_NOLOAD 0x0 /* Don't load symbols, code, or data */
5955 +#define DBLL_SYMB 0x1 /* load symbols */
5956 +#define DBLL_CODE 0x2 /* load code */
5957 +#define DBLL_DATA 0x4 /* load data */
5958 +#define DBLL_DYNAMIC 0x8 /* dynamic load */
5959 +#define DBLL_BSS 0x20 /* Unitialized section */
5961 +#define DBLL_MAXPATHLENGTH 255
5963 +#ifndef _SIZE_T
5964 +typedef unsigned int size_t;
5965 +#define _SIZE_T
5966 +#endif
5969 + * ======== DBLL_Target ========
5971 + */
5972 +struct DBLL_TarObj;
5975 + * ======== DBLL_Flags ========
5976 + * Specifies whether to load code, data, or symbols
5977 + */
5978 +typedef s32 DBLL_Flags;
5981 + * ======== DBLL_Library ========
5983 + */
5984 +struct DBLL_LibraryObj;
5987 + * ======== DBLL_SectInfo ========
5988 + * For collecting info on overlay sections
5989 + */
5990 +struct DBLL_SectInfo {
5991 + const char *name; /* name of section */
5992 + u32 runAddr; /* run address of section */
5993 + u32 loadAddr; /* load address of section */
5994 + u32 size; /* size of section (target MAUs) */
5995 + DBLL_Flags type; /* Code, data, or BSS */
5996 +} ;
5999 + * ======== DBLL_Symbol ========
6000 + * (Needed for dynamic load library)
6001 + */
6002 +struct DBLL_Symbol {
6003 + u32 value;
6007 + * ======== DBLL_AllocFxn ========
6008 + * Allocate memory function. Allocate or reserve (if reserved == TRUE)
6009 + * "size" bytes of memory from segment "space" and return the address in
6010 + * *dspAddr (or starting at *dspAddr if reserve == TRUE). Returns 0 on
6011 + * success, or an error code on failure.
6012 + */
6013 +typedef s32(*DBLL_AllocFxn) (void *hdl, s32 space, u32 size, u32 align,
6014 + u32 *dspAddr, s32 segId, s32 req,
6015 + bool reserved);
6018 + * ======== DBLL_CloseFxn ========
6019 + */
6020 +typedef s32(*DBLL_FCloseFxn) (void *);
6023 + * ======== DBLL_FreeFxn ========
6024 + * Free memory function. Free, or unreserve (if reserved == TRUE) "size"
6025 + * bytes of memory from segment "space"
6026 + */
6027 +typedef bool(*DBLL_FreeFxn) (void *hdl, u32 addr, s32 space, u32 size,
6028 + bool reserved);
6031 + * ======== DBLL_FOpenFxn ========
6032 + */
6033 +typedef void *(*DBLL_FOpenFxn) (const char *, const char *);
6036 + * ======== DBLL_LogWriteFxn ========
6037 + * Function to call when writing data from a section, to log the info.
6038 + * Can be NULL if no logging is required.
6039 + */
6040 +typedef DSP_STATUS(*DBLL_LogWriteFxn)(void *handle, struct DBLL_SectInfo *sect,
6041 + u32 addr, u32 nBytes);
6044 + * ======== DBLL_ReadFxn ========
6045 + */
6046 +typedef s32(*DBLL_ReadFxn) (void *, size_t, size_t, void *);
6049 + * ======== DBLL_SeekFxn ========
6050 + */
6051 +typedef s32(*DBLL_SeekFxn) (void *, long, int);
6054 + * ======== DBLL_SymLookup ========
6055 + * Symbol lookup function - Find the symbol name and return its value.
6057 + * Parameters:
6058 + * handle - Opaque handle
6059 + * pArg - Opaque argument.
6060 + * name - Name of symbol to lookup.
6061 + * sym - Location to store address of symbol structure.
6063 + * Returns:
6064 + * TRUE: Success (symbol was found).
6065 + * FALSE: Failed to find symbol.
6066 + */
6067 +typedef bool(*DBLL_SymLookup) (void *handle, void *pArg, void *rmmHandle,
6068 + const char *name, struct DBLL_Symbol **sym);
6071 + * ======== DBLL_TellFxn ========
6072 + */
6073 +typedef s32(*DBLL_TellFxn) (void *);
6076 + * ======== DBLL_WriteFxn ========
6077 + * Write memory function. Write "n" HOST bytes of memory to segment "mtype"
6078 + * starting at address "dspAddr" from the buffer "buf". The buffer is
6079 + * formatted as an array of words appropriate for the DSP.
6080 + */
6081 +typedef s32(*DBLL_WriteFxn) (void *hdl, u32 dspAddr, void *buf,
6082 + u32 n, s32 mtype);
6085 + * ======== DBLL_Attrs ========
6086 + */
6087 +struct DBLL_Attrs {
6088 + DBLL_AllocFxn alloc;
6089 + DBLL_FreeFxn free;
6090 + void *rmmHandle; /* Handle to pass to alloc, free functions */
6091 + DBLL_WriteFxn write;
6092 + void *wHandle; /* Handle to pass to write, cinit function */
6093 + bool baseImage;
6094 + DBLL_LogWriteFxn logWrite;
6095 + void *logWriteHandle;
6097 + /* Symbol matching function and handle to pass to it */
6098 + DBLL_SymLookup symLookup;
6099 + void *symHandle;
6100 + void *symArg;
6102 + /*
6103 + * These file manipulation functions should be compatible with the
6104 + * "C" run time library functions of the same name.
6105 + */
6106 + s32(*fread) (void *, size_t, size_t, void *);
6107 + s32(*fseek) (void *, long, int);
6108 + s32(*ftell) (void *);
6109 + s32(*fclose) (void *);
6110 + void *(*fopen) (const char *, const char *);
6111 +} ;
6114 + * ======== DBLL_close ========
6115 + * Close library opened with DBLL_open.
6116 + * Parameters:
6117 + * lib - Handle returned from DBLL_open().
6118 + * Returns:
6119 + * Requires:
6120 + * DBL initialized.
6121 + * Valid lib.
6122 + * Ensures:
6123 + */
6124 +typedef void(*DBLL_CloseFxn) (struct DBLL_LibraryObj *library);
6127 + * ======== DBLL_create ========
6128 + * Create a target object, specifying the alloc, free, and write functions.
6129 + * Parameters:
6130 + * pTarget - Location to store target handle on output.
6131 + * pAttrs - Attributes.
6132 + * Returns:
6133 + * DSP_SOK: Success.
6134 + * DSP_EMEMORY: Memory allocation failed.
6135 + * Requires:
6136 + * DBL initialized.
6137 + * pAttrs != NULL.
6138 + * pTarget != NULL;
6139 + * Ensures:
6140 + * Success: *pTarget != NULL.
6141 + * Failure: *pTarget == NULL.
6142 + */
6143 +typedef DSP_STATUS(*DBLL_CreateFxn)(struct DBLL_TarObj **pTarget,
6144 + struct DBLL_Attrs *attrs);
6147 + * ======== DBLL_delete ========
6148 + * Delete target object and free resources for any loaded libraries.
6149 + * Parameters:
6150 + * target - Handle returned from DBLL_Create().
6151 + * Returns:
6152 + * Requires:
6153 + * DBL initialized.
6154 + * Valid target.
6155 + * Ensures:
6156 + */
6157 +typedef void(*DBLL_DeleteFxn) (struct DBLL_TarObj *target);
6160 + * ======== DBLL_exit ========
6161 + * Discontinue use of DBL module.
6162 + * Parameters:
6163 + * Returns:
6164 + * Requires:
6165 + * cRefs > 0.
6166 + * Ensures:
6167 + * cRefs >= 0.
6168 + */
6169 +typedef void(*DBLL_ExitFxn) (void);
6172 + * ======== DBLL_getAddr ========
6173 + * Get address of name in the specified library.
6174 + * Parameters:
6175 + * lib - Handle returned from DBLL_open().
6176 + * name - Name of symbol
6177 + * ppSym - Location to store symbol address on output.
6178 + * Returns:
6179 + * TRUE: Success.
6180 + * FALSE: Symbol not found.
6181 + * Requires:
6182 + * DBL initialized.
6183 + * Valid library.
6184 + * name != NULL.
6185 + * ppSym != NULL.
6186 + * Ensures:
6187 + */
6188 +typedef bool(*DBLL_GetAddrFxn) (struct DBLL_LibraryObj *lib, char *name,
6189 + struct DBLL_Symbol **ppSym);
6192 + * ======== DBLL_getAttrs ========
6193 + * Retrieve the attributes of the target.
6194 + * Parameters:
6195 + * target - Handle returned from DBLL_Create().
6196 + * pAttrs - Location to store attributes on output.
6197 + * Returns:
6198 + * Requires:
6199 + * DBL initialized.
6200 + * Valid target.
6201 + * pAttrs != NULL.
6202 + * Ensures:
6203 + */
6204 +typedef void(*DBLL_GetAttrsFxn) (struct DBLL_TarObj *target,
6205 + struct DBLL_Attrs *attrs);
6208 + * ======== DBLL_getCAddr ========
6209 + * Get address of "C" name on the specified library.
6210 + * Parameters:
6211 + * lib - Handle returned from DBLL_open().
6212 + * name - Name of symbol
6213 + * ppSym - Location to store symbol address on output.
6214 + * Returns:
6215 + * TRUE: Success.
6216 + * FALSE: Symbol not found.
6217 + * Requires:
6218 + * DBL initialized.
6219 + * Valid target.
6220 + * name != NULL.
6221 + * ppSym != NULL.
6222 + * Ensures:
6223 + */
6224 +typedef bool(*DBLL_GetCAddrFxn) (struct DBLL_LibraryObj *lib, char *name,
6225 + struct DBLL_Symbol **ppSym);
6228 + * ======== DBLL_getSect ========
6229 + * Get address and size of a named section.
6230 + * Parameters:
6231 + * lib - Library handle returned from DBLL_open().
6232 + * name - Name of section.
6233 + * pAddr - Location to store section address on output.
6234 + * pSize - Location to store section size on output.
6235 + * Returns:
6236 + * DSP_SOK: Success.
6237 + * DSP_ENOSECT: Section not found.
6238 + * Requires:
6239 + * DBL initialized.
6240 + * Valid lib.
6241 + * name != NULL.
6242 + * pAddr != NULL;
6243 + * pSize != NULL.
6244 + * Ensures:
6245 + */
6246 +typedef DSP_STATUS(*DBLL_GetSectFxn) (struct DBLL_LibraryObj *lib, char *name,
6247 + u32 *addr, u32 *size);
6250 + * ======== DBLL_init ========
6251 + * Initialize DBL module.
6252 + * Parameters:
6253 + * Returns:
6254 + * TRUE: Success.
6255 + * FALSE: Failure.
6256 + * Requires:
6257 + * cRefs >= 0.
6258 + * Ensures:
6259 + * Success: cRefs > 0.
6260 + * Failure: cRefs >= 0.
6261 + */
6262 +typedef bool(*DBLL_InitFxn) (void);
6265 + * ======== DBLL_load ========
6266 + * Load library onto the target.
6268 + * Parameters:
6269 + * lib - Library handle returned from DBLL_open().
6270 + * flags - Load code, data and/or symbols.
6271 + * attrs - May contain alloc, free, and write function.
6272 + * pulEntry - Location to store program entry on output.
6273 + * Returns:
6274 + * DSP_SOK: Success.
6275 + * DSP_EFREAD: File read failed.
6276 + * DSP_EFWRITE: Write to target failed.
6277 + * DSP_EDYNLOAD: Failure in dynamic loader library.
6278 + * Requires:
6279 + * DBL initialized.
6280 + * Valid lib.
6281 + * pEntry != NULL.
6282 + * Ensures:
6283 + */
6284 +typedef DSP_STATUS(*DBLL_LoadFxn) (struct DBLL_LibraryObj *lib,
6285 + DBLL_Flags flags,
6286 + struct DBLL_Attrs *attrs, u32 *entry);
6289 + * ======== DBLL_loadSect ========
6290 + * Load a named section from an library (for overlay support).
6291 + * Parameters:
6292 + * lib - Handle returned from DBLL_open().
6293 + * sectName - Name of section to load.
6294 + * attrs - Contains write function and handle to pass to it.
6295 + * Returns:
6296 + * DSP_SOK: Success.
6297 + * DSP_ENOSECT: Section not found.
6298 + * DSP_EFWRITE: Write function failed.
6299 + * DSP_ENOTIMPL: Function not implemented.
6300 + * Requires:
6301 + * Valid lib.
6302 + * sectName != NULL.
6303 + * attrs != NULL.
6304 + * attrs->write != NULL.
6305 + * Ensures:
6306 + */
6307 +typedef DSP_STATUS(*DBLL_LoadSectFxn) (struct DBLL_LibraryObj *lib,
6308 + char *pszSectName,
6309 + struct DBLL_Attrs *attrs);
6312 + * ======== DBLL_open ========
6313 + * DBLL_open() returns a library handle that can be used to load/unload
6314 + * the symbols/code/data via DBLL_load()/DBLL_unload().
6315 + * Parameters:
6316 + * target - Handle returned from DBLL_create().
6317 + * file - Name of file to open.
6318 + * flags - If flags & DBLL_SYMB, load symbols.
6319 + * pLib - Location to store library handle on output.
6320 + * Returns:
6321 + * DSP_SOK: Success.
6322 + * DSP_EMEMORY: Memory allocation failure.
6323 + * DSP_EFOPEN: File open failure.
6324 + * DSP_EFREAD: File read failure.
6325 + * DSP_ECORRUPTFILE: Unable to determine target type.
6326 + * Requires:
6327 + * DBL initialized.
6328 + * Valid target.
6329 + * file != NULL.
6330 + * pLib != NULL.
6331 + * DBLL_Attrs fopen function non-NULL.
6332 + * Ensures:
6333 + * Success: Valid *pLib.
6334 + * Failure: *pLib == NULL.
6335 + */
6336 +typedef DSP_STATUS(*DBLL_OpenFxn) (struct DBLL_TarObj *target, char *file,
6337 + DBLL_Flags flags,
6338 + struct DBLL_LibraryObj **pLib);
6341 + * ======== DBLL_readSect ========
6342 + * Read COFF section into a character buffer.
6343 + * Parameters:
6344 + * lib - Library handle returned from DBLL_open().
6345 + * name - Name of section.
6346 + * pBuf - Buffer to write section contents into.
6347 + * size - Buffer size
6348 + * Returns:
6349 + * DSP_SOK: Success.
6350 + * DSP_ENOSECT: Named section does not exists.
6351 + * Requires:
6352 + * DBL initialized.
6353 + * Valid lib.
6354 + * name != NULL.
6355 + * pBuf != NULL.
6356 + * size != 0.
6357 + * Ensures:
6358 + */
6359 +typedef DSP_STATUS(*DBLL_ReadSectFxn) (struct DBLL_LibraryObj *lib, char *name,
6360 + char *content, u32 uContentSize);
6363 + * ======== DBLL_setAttrs ========
6364 + * Set the attributes of the target.
6365 + * Parameters:
6366 + * target - Handle returned from DBLL_create().
6367 + * pAttrs - New attributes.
6368 + * Returns:
6369 + * Requires:
6370 + * DBL initialized.
6371 + * Valid target.
6372 + * pAttrs != NULL.
6373 + * Ensures:
6374 + */
6375 +typedef void(*DBLL_SetAttrsFxn)(struct DBLL_TarObj *target,
6376 + struct DBLL_Attrs *attrs);
6379 + * ======== DBLL_unload ========
6380 + * Unload library loaded with DBLL_load().
6381 + * Parameters:
6382 + * lib - Handle returned from DBLL_open().
6383 + * attrs - Contains free() function and handle to pass to it.
6384 + * Returns:
6385 + * Requires:
6386 + * DBL initialized.
6387 + * Valid lib.
6388 + * Ensures:
6389 + */
6390 +typedef void(*DBLL_UnloadFxn) (struct DBLL_LibraryObj *library,
6391 + struct DBLL_Attrs *attrs);
6394 + * ======== DBLL_unloadSect ========
6395 + * Unload a named section from an library (for overlay support).
6396 + * Parameters:
6397 + * lib - Handle returned from DBLL_open().
6398 + * sectName - Name of section to load.
6399 + * attrs - Contains free() function and handle to pass to it.
6400 + * Returns:
6401 + * DSP_SOK: Success.
6402 + * DSP_ENOSECT: Named section not found.
6403 + * DSP_ENOTIMPL
6404 + * Requires:
6405 + * DBL initialized.
6406 + * Valid lib.
6407 + * sectName != NULL.
6408 + * Ensures:
6409 + */
6410 +typedef DSP_STATUS(*DBLL_UnloadSectFxn) (struct DBLL_LibraryObj *lib,
6411 + char *pszSectName,
6412 + struct DBLL_Attrs *attrs);
6414 +struct DBLL_Fxns {
6415 + DBLL_CloseFxn closeFxn;
6416 + DBLL_CreateFxn createFxn;
6417 + DBLL_DeleteFxn deleteFxn;
6418 + DBLL_ExitFxn exitFxn;
6419 + DBLL_GetAttrsFxn getAttrsFxn;
6420 + DBLL_GetAddrFxn getAddrFxn;
6421 + DBLL_GetCAddrFxn getCAddrFxn;
6422 + DBLL_GetSectFxn getSectFxn;
6423 + DBLL_InitFxn initFxn;
6424 + DBLL_LoadFxn loadFxn;
6425 + DBLL_LoadSectFxn loadSectFxn;
6426 + DBLL_OpenFxn openFxn;
6427 + DBLL_ReadSectFxn readSectFxn;
6428 + DBLL_SetAttrsFxn setAttrsFxn;
6429 + DBLL_UnloadFxn unloadFxn;
6430 + DBLL_UnloadSectFxn unloadSectFxn;
6431 +} ;
6433 +#endif /* DBLDEFS_ */
6434 Index: lk/arch/arm/plat-omap/include/bridge/dbof.h
6435 ===================================================================
6436 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6437 +++ lk/arch/arm/plat-omap/include/bridge/dbof.h 2008-08-18 10:38:34.000000000 +0300
6438 @@ -0,0 +1,117 @@
6440 + * arch/arm/plat-omap/include/bridge/dbof.h
6442 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6444 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
6446 + * This package is free software; you can redistribute it and/or modify
6447 + * it under the terms of the GNU General Public License version 2 as
6448 + * published by the Free Software Foundation.
6450 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6451 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6452 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6453 + */
6457 + * ======== dbof.h ========
6458 + * Description:
6459 + * Defines and typedefs for DSP/BIOS Bridge Object File Format (DBOF).
6461 + *! Revision History
6462 + *! ================
6463 + *! 12-Jul-2002 jeh Added defines for DBOF_SectHdr page.
6464 + *! 12-Oct-2001 jeh Converted to std.h format.
6465 + *! 07-Sep-2001 jeh Added overlay support.
6466 + *! 06-Jul-2001 jeh Created.
6467 + */
6469 +#ifndef DBOF_
6470 +#define DBOF_
6472 +/* Enough to hold DCD section names: 32 digit ID + underscores */
6473 +#define DBOF_DCDSECTNAMELEN 40
6475 +/* Values for DBOF_SectHdr page field. */
6476 +#define DBOF_PROGRAM 0
6477 +#define DBOF_DATA 1
6478 +#define DBOF_CINIT 2
6481 + * ======== DBOF_FileHdr ========
6482 + */
6483 + struct DBOF_FileHdr {
6484 + u32 magic; /* COFF magic number */
6485 + u32 entry; /* Program entry point */
6486 + u16 numSymbols; /* Number of bridge symbols */
6487 + u16 numDCDSects; /* Number of DCD sections */
6488 + u16 numSects; /* Number of sections to load */
6489 + u16 numOvlySects; /* Number of overlay sections */
6490 + u32 symOffset; /* Offset in file to symbols */
6491 + u32 dcdSectOffset; /* Offset to DCD sections */
6492 + u32 loadSectOffset; /* Offset to loadable sections */
6493 + u32 ovlySectOffset; /* Offset to overlay data */
6494 + u16 version; /* DBOF version number */
6495 + u16 resvd; /* Reserved for future use */
6496 + } ;
6499 + * ======== DBOF_DCDSectHdr ========
6500 + */
6501 + struct DBOF_DCDSectHdr {
6502 + u32 size; /* Sect size (target MAUs) */
6503 + char name[DBOF_DCDSECTNAMELEN]; /* DCD section name */
6504 + } ;
6507 + * ======== DBOF_OvlySectHdr ========
6508 + */
6509 + struct DBOF_OvlySectHdr {
6510 + u16 nameLen; /* Length of section name */
6511 + u16 numCreateSects; /* # of sects loaded for create phase */
6512 + u16 numDeleteSects; /* # of sects loaded for delete phase */
6513 + u16 numExecuteSects; /* # of sects loaded for execute phase */
6515 + /*
6516 + * Number of sections where load/unload phase is not specified.
6517 + * These sections will be loaded when create phase sects are
6518 + * loaded, and unloaded when the delete phase is unloaded.
6519 + */
6520 + u16 numOtherSects;
6521 + u16 resvd; /* Reserved for future use */
6522 + };
6525 + * ======== DBOF_OvlySectData ========
6526 + */
6527 + struct DBOF_OvlySectData {
6528 + u32 loadAddr; /* Section load address */
6529 + u32 runAddr; /* Section run address */
6530 + u32 size; /* Section size (target MAUs) */
6531 + u16 page; /* Memory page number */
6532 + u16 resvd; /* Reserved */
6533 + } ;
6536 + * ======== DBOF_SectHdr ========
6537 + */
6538 + struct DBOF_SectHdr {
6539 + u32 addr; /* Section address */
6540 + u32 size; /* Section size (target MAUs) */
6541 + u16 page; /* Page number */
6542 + u16 resvd; /* Reserved for future use */
6543 + } ;
6546 + * ======== DBOF_SymbolHdr ========
6547 + */
6548 + struct DBOF_SymbolHdr {
6549 + u32 value; /* Symbol value */
6550 + u16 nameLen; /* Length of symbol name */
6551 + u16 resvd; /* Reserved for future use */
6552 + } ;
6554 +#endif /* DBOF_ */
6556 Index: lk/arch/arm/plat-omap/include/bridge/dbreg.h
6557 ===================================================================
6558 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6559 +++ lk/arch/arm/plat-omap/include/bridge/dbreg.h 2008-08-18 10:38:34.000000000 +0300
6560 @@ -0,0 +1,113 @@
6562 + * arch/arm/plat-omap/include/bridge/dbreg.h
6564 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6566 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
6568 + * This package is free software; you can redistribute it and/or modify
6569 + * it under the terms of the GNU General Public License version 2 as
6570 + * published by the Free Software Foundation.
6572 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6573 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6574 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6575 + */
6579 + * ======== dbreg.h ========
6580 + * Purpose:
6581 + * Registry keys for use in Linux. This is the clearinghouse for
6582 + * registry definitions, hopefully eliminating overlapping between
6583 + * modules.
6585 + *! Revision History:
6586 + *! ================
6587 + *! 10-Apr-2003 vp: Added macro for subkey TCWORDSWAP.
6588 + *! 21-Mar-2003 sb: Added macro for subkey SHMSize
6589 + *! 27-Aug-2001 jeh Added WSXREG_LOADERFILENAME.
6590 + *! 13-Feb-2001 kc: DSP/BIOS Bridge name updates.
6591 + *! 29-Nov-2000 rr: Added WSXREG_DSPTYPE_55 as 6.
6592 + *! 06-Sep-2000 jeh: Added WSXREG_CHNLOFFSET, WSXREG_NUMCHNLS,
6593 + *! WSXREG_CHNLBUFSIZE.
6594 + *! 26-Aug-2000 rr: MEMBASE expanded to 9 entries.
6595 + *! 26-Jul-2000 rr: Added WSXREG_DCDNAME for the DCD Dll name. It will
6596 + *! live under WSXREG_WINSPOXCONFIG.
6597 + *! 17-Jul-2000 rr: REG_MGR_OBJECT and REG_DRV_OBJECT defined. They
6598 + *! are stored in the Registrty under WSXREG_WINSPOXCONFIG
6599 + *! when they are created in DSP_Init. WSXREG_DEVOBJECT
6600 + *! and WSXREG_MGROBJECT defined.
6601 + *! 11-Dec-1999 ag: Renamed Isa to IsaBus due to conflict with ceddk.h.
6602 + *! 12-Nov-1999 rr: New Registry Defnitions.
6603 + *! 15-Oct-1999 rr: New entry for DevObject created. WSXREG_DEVOBJECT
6604 + *! under WSXREG_DDSPDRIVERPATH
6605 + *! 10-Nov-1997 cr: Added WSXREG_INFPATH, WSXREG_WINDEVICEPATH,
6606 + *! WSXREG_WINCURVERSION
6607 + *! 21-Oct-1997 cr: Added WSXREG_BUSTYPE.
6608 + *! 08-Sep-1997 cr: Added WSXREG_SERVICES, WSXREG_SERVICENAME and
6609 + *! WSXREG_CLASSINDEX.
6610 + *! 30-Aug-1997 cr: Added WSXREG_SOFTWAREPATHNT & WSXREG_WBCLASSGUID.
6611 + *! 24-Mar-1997 gp: Added MAXCHIPINFOSUBKEY def.
6612 + *! 18-Feb-1997 cr: Changed Version1.1 -> Version1.0
6613 + *! 12-Feb-1997 cr: Changed WinSPOX -> WinBRIDGE.
6614 + *! 11-Dec-1996 gp: Added Perf key name in WinSPOX Config.
6615 + *! 22-Jul-1996 gp: Added Trace key name.
6616 + *! 30-May-1996 cr: Created.
6617 + */
6619 +#ifndef DBREG_
6620 +#define DBREG_ 1 /* Defined as "1" so InstallShield programs compile. */
6622 +#define REG_MGR_OBJECT 1
6623 +#define REG_DRV_OBJECT 2
6624 +/* general registry definitions */
6625 +#define MAXREGPATHLENGTH 255 /* Max registry path length. Also the
6626 + max registry value length. */
6627 +#define DSPTYPE_55 6 /* This is the DSP Chip type for 55 */
6628 +#define DSPTYPE_64 0x99
6629 +#define IVA_ARM7 0x97 /* This is the DSP Chip type for IVA/ARM7 */
6631 +#define DSPPROCTYPE_C55 5510
6632 +#define DSPPROCTYPE_C64 6410
6633 +#define IVAPROCTYPE_ARM7 470
6634 +/* registry */
6635 +#define DEVNODESTRING "DevNode" /* u32 devnode */
6636 +#define CONFIG "Software\\TexasInstruments\\DirectDSP\\Config"
6637 +#define DRVOBJECT "DrvObject"
6638 +#define MGROBJECT "MgrObject"
6639 +#define CLASS "Device" /* device class */
6640 +#define TRACE "Trace" /* GT Trace settings. */
6641 +#define PERFR "Perf" /* Enable perf bool. */
6642 +#define ROOT "Root" /* root dir */
6644 +/* MiniDriver related definitions */
6645 +/* The following definitions are under "Drivers\\DirectDSP\\Device\\XXX "
6646 + * Where XXX is the device or board name */
6648 +#define WMDFILENAME "MiniDriver" /* WMD entry name */
6649 +#define CHIPTYPE "ChipType" /* Chip type */
6650 +#define CHIPNUM "NumChips" /* Number of chips */
6651 +#define NUMPROCS "NumOfProcessors" /* Number of processors */
6652 +#define DEFEXEC "DefaultExecutable" /* Default executable */
6653 +#define AUTOSTART "AutoStart" /* Statically load flag */
6654 +#define IVAAUTOSTART "IvaAutoStart" /* Statically load flag */
6655 +#define BOARDNAME "BoardName" /* Name of the Board */
6656 +#define UNITNUMBER "UnitNumber" /* Unit # of the Board */
6657 +#define BUSTYPE "BusType" /* Bus type board is on */
6658 +#define BUSNUMBER "BusNumber" /* Bus number board is on */
6659 +#define CURRENTCONFIG "CurrentConfig" /* Current resources */
6660 +#define PCIVENDEVID "VendorDeviceId" /* The board's id */
6661 +#define INFPATH "InfPath" /* wmd's inf filename */
6662 +#define DEVOBJECT "DevObject"
6663 +#define ZLFILENAME "ZLFileName" /* Name of ZL file */
6664 +#define WORDSIZE "WordSize" /* NumBytes in DSP Word */
6665 +#define SHMSIZE "SHMSize" /* Size of SHM reservd on MPU */
6666 +#define IVAEXTMEMSIZE "IVAEXTMEMSize" /* IVA External Memeory size */
6667 +#define TCWORDSWAP "TCWordSwap" /* Traffic Contoller Word Swap */
6668 +#define DSPRESOURCES "DspTMSResources" /* C55 DSP resurces on OMAP */
6669 +#define IVA1RESOURCES "ARM7IvaResources" /* ARM7 IVA resurces on OMAP */
6670 +#define PHYSMEMPOOLBASE "PhysicalMemBase" /* Physical mem passed to driver */
6671 +#define PHYSMEMPOOLSIZE "PhysicalMemSize" /* Physical mem passed to driver */
6673 +#endif /* DBREG_ */
6674 Index: lk/arch/arm/plat-omap/include/bridge/dbtype.h
6675 ===================================================================
6676 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6677 +++ lk/arch/arm/plat-omap/include/bridge/dbtype.h 2008-08-18 10:38:34.000000000 +0300
6678 @@ -0,0 +1,105 @@
6680 + * arch/arm/plat-omap/include/bridge/dbtype.h
6682 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6684 + * Copyright (C) 2008 Texas Instruments, Inc.
6686 + * This package is free software; you can redistribute it and/or modify
6687 + * it under the terms of the GNU General Public License version 2 as
6688 + * published by the Free Software Foundation.
6690 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6691 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6692 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6693 + */
6696 + * ======== dbtype.h ========
6697 + * Description:
6698 + * This header defines data types for DSP/BIOS Bridge APIs and device
6699 + * driver modules. It also defines the Hungarian
6700 + * prefix to use for each base type.
6703 + *! Revision History:
6704 + *! =================
6705 + *! 23-Nov-2002 gp: Purpose -> Description in file header.
6706 + *! 13-Feb-2001 kc: Name changed from ddsptype.h dbtype.h.
6707 + *! 09-Oct-2000 jeh Added CHARACTER.
6708 + *! 11-Aug-2000 ag: Added 'typedef void void'.
6709 + *! 08-Apr-2000 ww: Cloned.
6710 + */
6712 +#ifndef DBTYPE_
6713 +#define DBTYPE_
6715 +/*============================================================================*/
6716 +/* Argument specification syntax */
6717 +/*============================================================================*/
6719 +#ifndef IN
6720 +#define IN /* Following parameter is for input. */
6721 +#endif
6723 +#ifndef OUT
6724 +#define OUT /* Following parameter is for output. */
6725 +#endif
6727 +#ifndef OPTIONAL
6728 +#define OPTIONAL /* Function may optionally use previous parameter. */
6729 +#endif
6731 +#ifndef CONST
6732 +#define CONST const
6733 +#endif
6735 +/*============================================================================*/
6736 +/* Boolean constants */
6737 +/*============================================================================*/
6739 +#ifndef FALSE
6740 +#define FALSE 0
6741 +#endif
6742 +#ifndef TRUE
6743 +#define TRUE 1
6744 +#endif
6746 +/*============================================================================*/
6747 +/* NULL (Definition is language specific) */
6748 +/*============================================================================*/
6750 +#ifndef NULL
6751 +#define NULL ((void *)0) /* Null pointer. */
6752 +#endif
6754 +/*============================================================================*/
6755 +/* NULL character (normally used for string termination) */
6756 +/*============================================================================*/
6758 +#ifndef NULL_CHAR
6759 +#define NULL_CHAR '\0' /* Null character. */
6760 +#endif
6762 +/*============================================================================*/
6763 +/* Basic Type definitions (with Prefixes for Hungarian notation) */
6764 +/*============================================================================*/
6766 +#ifndef OMAPBRIDGE_TYPES
6767 +#define OMAPBRIDGE_TYPES
6768 +typedef volatile unsigned short REG_UWORD16;
6769 +#endif
6771 +typedef void *HANDLE; /* h */
6773 +#define TEXT(x) x
6775 +#define CDECL
6777 +#define DLLIMPORT
6778 +#define DLLEXPORT
6780 +/* Define DSPAPIDLL correctly in dspapi.h */
6781 +#define _DSPSYSDLL32_
6783 +#endif /* DBTYPE_ */
6784 Index: lk/arch/arm/plat-omap/include/bridge/ddma_sh.h
6785 ===================================================================
6786 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6787 +++ lk/arch/arm/plat-omap/include/bridge/ddma_sh.h 2008-08-18 10:38:34.000000000 +0300
6788 @@ -0,0 +1,95 @@
6790 + * arch/arm/plat-omap/include/bridge/ddma_sh.h
6792 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6794 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
6796 + * This package is free software; you can redistribute it and/or modify
6797 + * it under the terms of the GNU General Public License version 2 as
6798 + * published by the Free Software Foundation.
6800 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6801 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6802 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6803 + */
6807 + * ======== ddma_sh.h ========
6809 + * DSP/BIOS Bridge DSP-DMA(DDMA) shared definitions.
6810 + * (used on both GPP and DSP sides).
6813 + *! Revision History
6814 + *! ================
6815 + *! 12-Jan-2001 ag Added Zero-copy channel descriptor
6816 + *! and #ifdef CHNL_DDMA for GPP-side build.
6817 + *! 05-Jan-2002 ag Made chnl buf desc ndxs private.
6818 + *! 07-Dec-2001 ag DDMA_DSPDESCDONE value changed.
6819 + *! 24-Jan-2001 ag Initial.
6820 + */
6822 +#ifndef DDMA_SH_
6823 +#define DDMA_SH_
6825 +#include <ddmatypes.h>
6827 +/* Max # of DDSP DMA channels allowed */
6828 +#define DDMA_MAXZCPYCHNLS 16
6829 +#define DDMA_MAXDDMACHNLS 16
6831 +/* descriptor status */
6832 +#define DDMA_SOK 0x0 /* transfer ok */
6833 +#define DDMA_SCANCELED 0x1 /* I/O request canceled */
6834 +#define DDMA_SBUFMISMATCH 0x2 /* Src Buf larger than dst. Data clipped */
6836 +/* descriptor errors */
6837 +#define DDMA_ERRDMA 0x8000 /* DMA error(s) occured */
6838 +#define DDMA_ERRILLDESC 0x800 /* Illegal desc format */
6839 +#define DDMA_ERRTIMEOUT 0x400 /* DMA timeout occured on this descriptor */
6840 +#define DDMA_ERRALIGN 0x200 /* Bad SM buffer alignment */
6842 +/* cmd codes (workReq field)*/
6843 +#define DDMA_WORKREQ 1 /* Channel work requested by Gpp */
6844 +#define DDMA_WORKREQCLEAR 2 /* Work requested Cleared by Dsp */
6845 +#define DDMA_DSPDESCDONE 2 /* DSP completed DDMA descr proc'ing */
6848 + * DSP-DMA GPP<->DSP structures
6849 + */
6851 +/* SM buffer descriptor structure */
6852 +struct DDMA_BUFDESC {
6853 + DDMA_DWORD workReq; /* Requesting work(DSP-DMA) to be performed */
6854 + DDMA_DWORD status; /* Desc completion status */
6855 + DDMA_DWORD bufPaDsp; /* DSP address of SM buffer. */
6856 + DDMA_DWORD xferSize; /* Size of transfer request in Gpp bytes */
6857 + DDMA_DWORD bufArg; /* Optional argument associated with buffer */
6858 +} ;
6860 +/* bridge channel descriptor ctrl */
6861 +struct DDMA_CHNLDESC {
6862 + DDMA_WORD numBufDesc; /* # of SM buf descriptors for this channel */
6863 + DDMA_DWORD descPaDsp; /* DSP address of base SM descriptor. */
6864 +} ;
6867 + * Zero-copy channel descriptor(SM buffer swap)
6868 + */
6869 +struct DDMA_ZCPYCHNLDESC {
6870 + /* DSP-Side */
6871 + DDMA_DWORD inBuf; /* address of input buffer */
6872 + DDMA_DWORD inDataSize; /* Data size of inBuf (DSP MAUs) */
6873 + DDMA_DWORD inBufSize; /* Actual buffer size of inBuf (DSP MAUs) */
6874 + DDMA_DWORD inUserArg; /* Optional in user argument */
6876 + DDMA_DWORD outBuf; /* address of output buffer */
6877 + DDMA_DWORD outDataSize; /* Data size of outBuf (DSP MAUs) */
6878 + DDMA_DWORD outBufSize; /* Actual buffer size of outBuf (DSP MAUs) */
6879 + DDMA_DWORD outUserArg; /* Optional out user argument */
6880 + } ;
6882 +#endif /* DDMA_SH_ */
6884 Index: lk/arch/arm/plat-omap/include/bridge/ddmatypes.h
6885 ===================================================================
6886 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6887 +++ lk/arch/arm/plat-omap/include/bridge/ddmatypes.h 2008-08-18 10:38:34.000000000 +0300
6888 @@ -0,0 +1,36 @@
6890 + * arch/arm/plat-omap/include/bridge/ddmatypes.h
6892 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6894 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
6896 + * This package is free software; you can redistribute it and/or modify
6897 + * it under the terms of the GNU General Public License version 2 as
6898 + * published by the Free Software Foundation.
6900 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6901 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6902 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6903 + */
6907 + * ======== ddmatypes.h ========
6908 + * Description:
6909 + * DSP/BIOS Bridge DSP-DMA(DDMA) shared data type definitions.
6911 + *! Revision History
6912 + *! ================
6913 + *! 24-Jan-2001 ag Initial.
6914 + */
6916 +#ifndef DDMATYPES_
6917 +#define DDMATYPES_
6919 +/* DSP-side definitions */
6920 +typedef u32 DDMA_DWORD;
6921 +typedef u32 DDMA_WORD;
6922 +typedef u32 DDMA_STATUS;
6924 +#endif /* DDMATYPES_ */
6925 Index: lk/arch/arm/plat-omap/include/bridge/dehdefs.h
6926 ===================================================================
6927 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6928 +++ lk/arch/arm/plat-omap/include/bridge/dehdefs.h 2008-08-18 10:38:34.000000000 +0300
6929 @@ -0,0 +1,42 @@
6931 + * arch/arm/plat-omap/include/bridge/dehdefs.h
6933 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6935 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
6937 + * This package is free software; you can redistribute it and/or modify
6938 + * it under the terms of the GNU General Public License version 2 as
6939 + * published by the Free Software Foundation.
6941 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6942 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6943 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6944 + */
6947 + * ======== dehdefs.h ========
6948 + * Purpose:
6949 + * Definition for mini-driver module DEH.
6951 + *! Revision History:
6952 + *! ================
6953 + *! 17-Dec-2001 ag: added #include <mbx_sh.h> for shared mailbox codes.
6954 + *! 10-Dec-2001 kc: added DEH error base value and error max value.
6955 + *! 11-Sep-2001 kc: created.
6956 + */
6958 +#ifndef DEHDEFS_
6959 +#define DEHDEFS_
6961 +#include <mbx_sh.h> /* shared mailbox codes */
6963 +/* DEH object manager */
6964 + struct DEH_MGR;
6966 +/* Magic code used to determine if DSP signaled exception. */
6967 +#define DEH_BASE MBX_DEH_BASE
6968 +#define DEH_USERS_BASE MBX_DEH_USERS_BASE
6969 +#define DEH_LIMIT MBX_DEH_LIMIT
6971 +#endif /* _DEHDEFS_H */
6972 Index: lk/arch/arm/plat-omap/include/bridge/dev.h
6973 ===================================================================
6974 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
6975 +++ lk/arch/arm/plat-omap/include/bridge/dev.h 2008-08-18 10:38:34.000000000 +0300
6976 @@ -0,0 +1,804 @@
6978 + * arch/arm/plat-omap/include/bridge/dev.h
6980 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6982 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
6984 + * This package is free software; you can redistribute it and/or modify
6985 + * it under the terms of the GNU General Public License version 2 as
6986 + * published by the Free Software Foundation.
6988 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
6989 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
6990 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6991 + */
6995 + * ======== dev.h ========
6996 + * Description:
6997 + * 'Bridge Mini-driver device operations.
6999 + * Public Functions:
7000 + * DEV_BrdWriteFxn
7001 + * DEV_CreateDevice
7002 + * DEV_Create2
7003 + * DEV_Destroy2
7004 + * DEV_DestroyDevice
7005 + * DEV_GetChnlMgr
7006 + * DEV_GetCmmMgr
7007 + * DEV_GetCodMgr
7008 + * DEV_GetDehMgr
7009 + * DEV_GetDevNode
7010 + * DEV_GetDSPWordSize
7011 + * DEV_GetFirst
7012 + * DEV_GetIntfFxns
7013 + * DEV_GetIOMgr
7014 + * DEV_GetMsgMgr
7015 + * DEV_GetNext
7016 + * DEV_GetNodeManager
7017 + * DEV_GetSymbol
7018 + * DEV_GetWMDContext
7019 + * DEV_Exit
7020 + * DEV_Init
7021 + * DEV_InsertProcObject
7022 + * DEV_IsLocked
7023 + * DEV_NotifyClient
7024 + * DEV_RegisterNotify
7025 + * DEV_ReleaseCodMgr
7026 + * DEV_RemoveDevice
7027 + * DEV_RemoveProcObject
7028 + * DEV_SetChnlMgr
7029 + * DEV_SetMsgMgr
7030 + * DEV_SetLockOwner
7031 + * DEV_StartDevice
7033 + *! Revision History:
7034 + *! ================
7035 + *! 08-Mar-2004 sb Added the Dynamic Memory Mapping feature - Dev_GetDmmMgr
7036 + *! 09-Feb-2004 vp Added functions required for IVA
7037 + *! 25-Feb-2003 swa PMGR Code Review changes incorporated
7038 + *! 05-Nov-2001 kc: Added DEV_GetDehMgr.
7039 + *! 05-Dec-2000 jeh Added DEV_SetMsgMgr.
7040 + *! 29-Nov-2000 rr: Incorporated code review changes.
7041 + *! 17-Nov-2000 jeh Added DEV_GetMsgMgr.
7042 + *! 05-Oct-2000 rr: DEV_Create2 & DEV_Destroy2 Added.
7043 + *! 02-Oct-2000 rr: Added DEV_GetNodeManager.
7044 + *! 11-Aug-2000 ag: Added DEV_GetCmmMgr() for shared memory management.
7045 + *! 10-Aug-2000 rr: DEV_InsertProcObject/RemoveProcObject added.
7046 + *! 06-Jun-2000 jeh Added DEV_GetSymbol().
7047 + *! 05-Nov-1999 kc: Updated function prototypes.
7048 + *! 08-Oct-1997 cr: Added explicit CDECL function identifiers.
7049 + *! 07-Nov-1996 gp: Updated for code review.
7050 + *! 22-Oct-1996 gp: Added DEV_CleanupProcessState().
7051 + *! 29-May-1996 gp: Changed DEV_HDEVNODE --> CFG_HDEVNODE.
7052 + *! 18-May-1996 gp: Created.
7053 + */
7055 +#ifndef DEV_
7056 +#define DEV_
7058 +/* ----------------------------------- Module Dependent Headers */
7059 +#include <chnldefs.h>
7060 +#include <cmm.h>
7061 +#include <cod.h>
7062 +#include <dehdefs.h>
7063 +#include <nodedefs.h>
7064 +#include <dispdefs.h>
7065 +#include <wmd.h>
7066 +#include <dmm.h>
7067 +#include <host_os.h>
7069 +/* ----------------------------------- This */
7070 +#include <devdefs.h>
7072 +/* Notification callback for DEV clients BRD and CHNL */
7073 + typedef void(CDECL *DEV_CALLBACK) (void *pArb, u32 ulStatus);
7076 + * ======== DEV_BrdWriteFxn ========
7077 + * Purpose:
7078 + * Exported function to be used as the COD write function. This function
7079 + * is passed a handle to a DEV_hObject by ZL in pArb, then calls the
7080 + * device's WMD_BRD_Write() function.
7081 + * Parameters:
7082 + * pArb: Handle to a Device Object.
7083 + * hDevContext: Handle to mini-driver defined device info.
7084 + * dwDSPAddr: Address on DSP board (Destination).
7085 + * pHostBuf: Pointer to host buffer (Source).
7086 + * ulNumBytes: Number of bytes to transfer.
7087 + * ulMemType: Memory space on DSP to which to transfer.
7088 + * Returns:
7089 + * Number of bytes written. Returns 0 if the DEV_hObject passed in via
7090 + * pArb is invalid.
7091 + * Requires:
7092 + * DEV Initialized.
7093 + * pHostBuf != NULL
7094 + * Ensures:
7095 + */
7096 + extern u32 CDECL DEV_BrdWriteFxn(void *pArb,
7097 + u32 ulDspAddr,
7098 + void *pHostBuf,
7099 + u32 ulNumBytes, u32 nMemSpace);
7102 + * ======== DEV_CreateDevice ========
7103 + * Purpose:
7104 + * Called by the operating system to load the 'Bridge Mini Driver for a
7105 + * 'Bridge device.
7106 + * Parameters:
7107 + * phDevObject: Ptr to location to receive the device object handle.
7108 + * pstrWMDFileName: Name of WMD PE DLL file to load. If the absolute
7109 + * path is not provided, the file is loaded through
7110 + * 'Bridge's module search path.
7111 + * pHostConfig: Host configuration information, to be passed down
7112 + * to the WMD when WMD_DEV_Create() is called.
7113 + * pDspConfig: DSP resources, to be passed down to the WMD when
7114 + * WMD_DEV_Create() is called.
7115 + * hDevNode: Platform (Windows) specific device node.
7116 + * Returns:
7117 + * DSP_SOK: Module is loaded, device object has been created
7118 + * DSP_EMEMORY: Insufficient memory to create needed resources.
7119 + * DEV_E_NEWWMD: The WMD was compiled for a newer version of WCD.
7120 + * DEV_E_NULLWMDINTF: WMD passed back a NULL Fxn Interface Struct Ptr
7121 + * DEV_E_NOCODMODULE: No ZL file name was specified in the registry
7122 + * for this hDevNode.
7123 + * LDR_E_FILEUNABLETOOPEN: Unable to open the specified WMD.
7124 + * LDR_E_NOMEMORY: PELDR is out of resources.
7125 + * DSP_EFAIL: Unable to find WMD entry point function.
7126 + * COD_E_NOZLFUNCTIONS: One or more ZL functions exports not found.
7127 + * COD_E_ZLCREATEFAILED: Unable to load ZL DLL.
7128 + * Requires:
7129 + * DEV Initialized.
7130 + * phDevObject != NULL.
7131 + * pstrWMDFileName != NULL.
7132 + * pHostConfig != NULL.
7133 + * pDspConfig != NULL.
7134 + * Ensures:
7135 + * DSP_SOK: *phDevObject will contain handle to the new device object.
7136 + * Otherwise, does not create the device object, ensures the WMD module is
7137 + * unloaded, and sets *phDevObject to NULL.
7138 + */
7139 + extern DSP_STATUS CDECL DEV_CreateDevice(OUT struct DEV_OBJECT
7140 + **phDevObject,
7141 + IN CONST char *pstrWMDFileName,
7142 + IN CONST struct CFG_HOSTRES
7143 + *pHostConfig,
7144 + IN CONST struct CFG_DSPRES
7145 + *pDspConfig,
7146 + struct CFG_DEVNODE *hDevNode);
7149 + * ======== DEV_CreateIVADevice ========
7150 + * Purpose:
7151 + * Called by the operating system to load the 'Bridge Mini Driver for IVA.
7152 + * Parameters:
7153 + * phDevObject: Ptr to location to receive the device object handle.
7154 + * pstrWMDFileName: Name of WMD PE DLL file to load. If the absolute
7155 + * path is not provided, the file is loaded through
7156 + * 'Bridge's module search path.
7157 + * pHostConfig: Host configuration information, to be passed down
7158 + * to the WMD when WMD_DEV_Create() is called.
7159 + * pDspConfig: DSP resources, to be passed down to the WMD when
7160 + * WMD_DEV_Create() is called.
7161 + * hDevNode: Platform (Windows) specific device node.
7162 + * Returns:
7163 + * DSP_SOK: Module is loaded, device object has been created
7164 + * DSP_EMEMORY: Insufficient memory to create needed resources.
7165 + * DEV_E_NEWWMD: The WMD was compiled for a newer version of WCD.
7166 + * DEV_E_NULLWMDINTF: WMD passed back a NULL Fxn Interface Struct Ptr
7167 + * DEV_E_NOCODMODULE: No ZL file name was specified in the registry
7168 + * for this hDevNode.
7169 + * LDR_E_FILEUNABLETOOPEN: Unable to open the specified WMD.
7170 + * LDR_E_NOMEMORY: PELDR is out of resources.
7171 + * DSP_EFAIL: Unable to find WMD entry point function.
7172 + * COD_E_NOZLFUNCTIONS: One or more ZL functions exports not found.
7173 + * COD_E_ZLCREATEFAILED: Unable to load ZL DLL.
7174 + * Requires:
7175 + * DEV Initialized.
7176 + * phDevObject != NULL.
7177 + * pstrWMDFileName != NULL.
7178 + * pHostConfig != NULL.
7179 + * pDspConfig != NULL.
7180 + * Ensures:
7181 + * DSP_SOK: *phDevObject will contain handle to the new device object.
7182 + * Otherwise, does not create the device object, ensures the WMD module is
7183 + * unloaded, and sets *phDevObject to NULL.
7184 + */
7185 + extern DSP_STATUS CDECL DEV_CreateIVADevice(OUT struct DEV_OBJECT
7186 + **phDevObject,
7187 + IN CONST char *pstrWMDFileName,
7188 + IN CONST struct CFG_HOSTRES *pHostConfig,
7189 + IN CONST struct CFG_DSPRES *pDspConfig,
7190 + struct CFG_DEVNODE *hDevNode);
7193 + * ======== DEV_Create2 ========
7194 + * Purpose:
7195 + * After successful loading of the image from WCD_InitComplete2
7196 + * (PROC Auto_Start) or PROC_Load this fxn is called. This creates
7197 + * the Node Manager and updates the DEV Object.
7198 + * Parameters:
7199 + * hDevObject: Handle to device object created with DEV_CreateDevice().
7200 + * Returns:
7201 + * DSP_SOK: Successful Creation of Node Manager
7202 + * DSP_EFAIL: Some Error Occurred.
7203 + * Requires:
7204 + * DEV Initialized
7205 + * Valid hDevObject
7206 + * Ensures:
7207 + * DSP_SOK and hDevObject->hNodeMgr != NULL
7208 + * else hDevObject->hNodeMgr == NULL
7209 + */
7210 + extern DSP_STATUS CDECL DEV_Create2(IN struct DEV_OBJECT *hDevObject);
7213 + * ======== DEV_Destroy2 ========
7214 + * Purpose:
7215 + * Destroys the Node manager for this device.
7216 + * Parameters:
7217 + * hDevObject: Handle to device object created with DEV_CreateDevice().
7218 + * Returns:
7219 + * DSP_SOK: Successful Creation of Node Manager
7220 + * DSP_EFAIL: Some Error Occurred.
7221 + * Requires:
7222 + * DEV Initialized
7223 + * Valid hDevObject
7224 + * Ensures:
7225 + * DSP_SOK and hDevObject->hNodeMgr == NULL
7226 + * else DSP_EFAIL.
7227 + */
7228 + extern DSP_STATUS CDECL DEV_Destroy2(IN struct DEV_OBJECT *hDevObject);
7231 + * ======== DEV_DestroyDevice ========
7232 + * Purpose:
7233 + * Destroys the channel manager for this device, if any, calls
7234 + * WMD_DEV_Destroy(), and then attempts to unload the WMD module.
7235 + * Parameters:
7236 + * hDevObject: Handle to device object created with
7237 + * DEV_CreateDevice().
7238 + * Returns:
7239 + * DSP_SOK: Success.
7240 + * DSP_EHANDLE: Invalid hDevObject.
7241 + * DSP_EFAIL: The WMD failed it's WMD_DEV_Destroy() function.
7242 + * Requires:
7243 + * DEV Initialized.
7244 + * Ensures:
7245 + */
7246 + extern DSP_STATUS CDECL DEV_DestroyDevice(struct DEV_OBJECT
7247 + *hDevObject);
7250 + * ======== DEV_GetChnlMgr ========
7251 + * Purpose:
7252 + * Retrieve the handle to the channel manager created for this device.
7253 + * Parameters:
7254 + * hDevObject: Handle to device object created with
7255 + * DEV_CreateDevice().
7256 + * *phMgr: Ptr to location to store handle.
7257 + * Returns:
7258 + * DSP_SOK: Success.
7259 + * DSP_EHANDLE: Invalid hDevObject.
7260 + * Requires:
7261 + * phMgr != NULL.
7262 + * DEV Initialized.
7263 + * Ensures:
7264 + * DSP_SOK: *phMgr contains a handle to a channel manager object,
7265 + * or NULL.
7266 + * else: *phMgr is NULL.
7267 + */
7268 + extern DSP_STATUS CDECL DEV_GetChnlMgr(struct DEV_OBJECT *hDevObject,
7269 + OUT struct CHNL_MGR **phMgr);
7272 + * ======== DEV_GetCmmMgr ========
7273 + * Purpose:
7274 + * Retrieve the handle to the shared memory manager created for this
7275 + * device.
7276 + * Parameters:
7277 + * hDevObject: Handle to device object created with
7278 + * DEV_CreateDevice().
7279 + * *phMgr: Ptr to location to store handle.
7280 + * Returns:
7281 + * DSP_SOK: Success.
7282 + * DSP_EHANDLE: Invalid hDevObject.
7283 + * Requires:
7284 + * phMgr != NULL.
7285 + * DEV Initialized.
7286 + * Ensures:
7287 + * DSP_SOK: *phMgr contains a handle to a channel manager object,
7288 + * or NULL.
7289 + * else: *phMgr is NULL.
7290 + */
7291 + extern DSP_STATUS CDECL DEV_GetCmmMgr(struct DEV_OBJECT *hDevObject,
7292 + OUT struct CMM_OBJECT **phMgr);
7295 + * ======== DEV_GetDmmMgr ========
7296 + * Purpose:
7297 + * Retrieve the handle to the dynamic memory manager created for this
7298 + * device.
7299 + * Parameters:
7300 + * hDevObject: Handle to device object created with
7301 + * DEV_CreateDevice().
7302 + * *phMgr: Ptr to location to store handle.
7303 + * Returns:
7304 + * DSP_SOK: Success.
7305 + * DSP_EHANDLE: Invalid hDevObject.
7306 + * Requires:
7307 + * phMgr != NULL.
7308 + * DEV Initialized.
7309 + * Ensures:
7310 + * DSP_SOK: *phMgr contains a handle to a channel manager object,
7311 + * or NULL.
7312 + * else: *phMgr is NULL.
7313 + */
7314 + extern DSP_STATUS CDECL DEV_GetDmmMgr(struct DEV_OBJECT *hDevObject,
7315 + OUT struct DMM_OBJECT **phMgr);
7318 + * ======== DEV_GetCodMgr ========
7319 + * Purpose:
7320 + * Retrieve the COD manager create for this device.
7321 + * Parameters:
7322 + * hDevObject: Handle to device object created with
7323 + * DEV_CreateDevice().
7324 + * *phCodMgr: Ptr to location to store handle.
7325 + * Returns:
7326 + * DSP_SOK: Success.
7327 + * DSP_EHANDLE: Invalid hDevObject.
7328 + * Requires:
7329 + * phCodMgr != NULL.
7330 + * DEV Initialized.
7331 + * Ensures:
7332 + * DSP_SOK: *phCodMgr contains a handle to a COD manager object.
7333 + * else: *phCodMgr is NULL.
7334 + */
7335 + extern DSP_STATUS CDECL DEV_GetCodMgr(struct DEV_OBJECT *hDevObject,
7336 + OUT struct COD_MANAGER **phCodMgr);
7339 + * ======== DEV_GetDehMgr ========
7340 + * Purpose:
7341 + * Retrieve the DEH manager created for this device.
7342 + * Parameters:
7343 + * hDevObject: Handle to device object created with DEV_CreateDevice().
7344 + * *phDehMgr: Ptr to location to store handle.
7345 + * Returns:
7346 + * DSP_SOK: Success.
7347 + * DSP_EHANDLE: Invalid hDevObject.
7348 + * Requires:
7349 + * phDehMgr != NULL.
7350 + * DEH Initialized.
7351 + * Ensures:
7352 + * DSP_SOK: *phDehMgr contains a handle to a DEH manager object.
7353 + * else: *phDehMgr is NULL.
7354 + */
7355 + extern DSP_STATUS CDECL DEV_GetDehMgr(struct DEV_OBJECT *hDevObject,
7356 + OUT struct DEH_MGR **phDehMgr);
7359 + * ======== DEV_GetDevNode ========
7360 + * Purpose:
7361 + * Retrieve the platform specific device ID for this device.
7362 + * Parameters:
7363 + * hDevObject: Handle to device object created with
7364 + * DEV_CreateDevice().
7365 + * phDevNode: Ptr to location to get the device node handle.
7366 + * Returns:
7367 + * DSP_SOK: In Win95, returns a DEVNODE in *hDevNode; In NT, ???
7368 + * DSP_EHANDLE: Invalid hDevObject.
7369 + * Requires:
7370 + * phDevNode != NULL.
7371 + * DEV Initialized.
7372 + * Ensures:
7373 + * DSP_SOK: *phDevNode contains a platform specific device ID;
7374 + * else: *phDevNode is NULL.
7375 + */
7376 + extern DSP_STATUS CDECL DEV_GetDevNode(struct DEV_OBJECT *hDevObject,
7377 + OUT struct CFG_DEVNODE **phDevNode);
7380 + * ======== DEV_GetDevType ========
7381 + * Purpose:
7382 + * Retrieve the platform specific device ID for this device.
7383 + * Parameters:
7384 + * hDevObject: Handle to device object created with
7385 + * DEV_CreateDevice().
7386 + * phDevNode: Ptr to location to get the device node handle.
7387 + * Returns:
7388 + * DSP_SOK: Success
7389 + * DSP_EHANDLE: Invalid hDevObject.
7390 + * Requires:
7391 + * phDevNode != NULL.
7392 + * DEV Initialized.
7393 + * Ensures:
7394 + * DSP_SOK: *phDevNode contains a platform specific device ID;
7395 + * else: *phDevNode is NULL.
7396 + */
7397 + extern DSP_STATUS CDECL DEV_GetDevType(struct DEV_OBJECT *hdevObject,
7398 + u32 *devType);
7401 + * ======== DEV_GetFirst ========
7402 + * Purpose:
7403 + * Retrieve the first Device Object handle from an internal linked list of
7404 + * of DEV_OBJECTs maintained by DEV.
7405 + * Parameters:
7406 + * Returns:
7407 + * NULL if there are no device objects stored; else
7408 + * a valid DEV_HOBJECT.
7409 + * Requires:
7410 + * No calls to DEV_CreateDevice or DEV_DestroyDevice (which my modify the
7411 + * internal device object list) may occur between calls to DEV_GetFirst
7412 + * and DEV_GetNext.
7413 + * Ensures:
7414 + * The DEV_HOBJECT returned is valid.
7415 + * A subsequent call to DEV_GetNext will return the next device object in
7416 + * the list.
7417 + */
7418 + extern struct DEV_OBJECT *CDECL DEV_GetFirst();
7421 + * ======== DEV_GetIntfFxns ========
7422 + * Purpose:
7423 + * Retrieve the WMD interface function structure for the loaded WMD.
7424 + * Parameters:
7425 + * hDevObject: Handle to device object created with
7426 + * DEV_CreateDevice().
7427 + * *ppIntfFxns: Ptr to location to store fxn interface.
7428 + * Returns:
7429 + * DSP_SOK: Success.
7430 + * DSP_EHANDLE: Invalid hDevObject.
7431 + * Requires:
7432 + * ppIntfFxns != NULL.
7433 + * DEV Initialized.
7434 + * Ensures:
7435 + * DSP_SOK: *ppIntfFxns contains a pointer to the WMD interface;
7436 + * else: *ppIntfFxns is NULL.
7437 + */
7438 + extern DSP_STATUS CDECL DEV_GetIntfFxns(struct DEV_OBJECT *hDevObject,
7439 + OUT struct WMD_DRV_INTERFACE **ppIntfFxns);
7442 + * ======== DEV_GetIOMgr ========
7443 + * Purpose:
7444 + * Retrieve the handle to the IO manager created for this device.
7445 + * Parameters:
7446 + * hDevObject: Handle to device object created with
7447 + * DEV_CreateDevice().
7448 + * *phMgr: Ptr to location to store handle.
7449 + * Returns:
7450 + * DSP_SOK: Success.
7451 + * DSP_EHANDLE: Invalid hDevObject.
7452 + * Requires:
7453 + * phMgr != NULL.
7454 + * DEV Initialized.
7455 + * Ensures:
7456 + * DSP_SOK: *phMgr contains a handle to an IO manager object.
7457 + * else: *phMgr is NULL.
7458 + */
7459 + extern DSP_STATUS CDECL DEV_GetIOMgr(struct DEV_OBJECT *hDevObject,
7460 + OUT struct IO_MGR **phMgr);
7463 + * ======== DEV_GetNext ========
7464 + * Purpose:
7465 + * Retrieve the next Device Object handle from an internal linked list of
7466 + * of DEV_OBJECTs maintained by DEV, after having previously called
7467 + * DEV_GetFirst() and zero or more DEV_GetNext
7468 + * Parameters:
7469 + * hDevObject: Handle to the device object returned from a previous
7470 + * call to DEV_GetFirst() or DEV_GetNext().
7471 + * Returns:
7472 + * NULL if there are no further device objects on the list or hDevObject
7473 + * was invalid;
7474 + * else the next valid DEV_HOBJECT in the list.
7475 + * Requires:
7476 + * No calls to DEV_CreateDevice or DEV_DestroyDevice (which my modify the
7477 + * internal device object list) may occur between calls to DEV_GetFirst
7478 + * and DEV_GetNext.
7479 + * Ensures:
7480 + * The DEV_HOBJECT returned is valid.
7481 + * A subsequent call to DEV_GetNext will return the next device object in
7482 + * the list.
7483 + */
7484 + extern struct DEV_OBJECT *CDECL DEV_GetNext(struct DEV_OBJECT
7485 + *hDevObject);
7488 + * ========= DEV_GetMsgMgr ========
7489 + * Purpose:
7490 + * Retrieve the MSG Manager Handle from the DevObject.
7491 + * Parameters:
7492 + * hDevObject: Handle to the Dev Object
7493 + * phMsgMgr: Location where MSG Manager handle will be returned.
7494 + * Returns:
7495 + * Requires:
7496 + * DEV Initialized.
7497 + * Valid hDevObject.
7498 + * phNodeMgr != NULL.
7499 + * Ensures:
7500 + */
7501 + extern void CDECL DEV_GetMsgMgr(struct DEV_OBJECT *hDevObject,
7502 + OUT struct MSG_MGR **phMsgMgr);
7505 + * ========= DEV_GetNodeManager ========
7506 + * Purpose:
7507 + * Retrieve the Node Manager Handle from the DevObject. It is an
7508 + * accessor function
7509 + * Parameters:
7510 + * hDevObject: Handle to the Dev Object
7511 + * phNodeMgr: Location where Handle to the Node Manager will be
7512 + * returned..
7513 + * Returns:
7514 + * DSP_SOK: Success
7515 + * DSP_EHANDLE: Invalid Dev Object handle.
7516 + * Requires:
7517 + * DEV Initialized.
7518 + * phNodeMgr is not null
7519 + * Ensures:
7520 + * DSP_SOK: *phNodeMgr contains a handle to a Node manager object.
7521 + * else: *phNodeMgr is NULL.
7522 + */
7523 + extern DSP_STATUS CDECL DEV_GetNodeManager(struct DEV_OBJECT
7524 + *hDevObject,
7525 + OUT struct NODE_MGR **phNodeMgr);
7528 + * ======== DEV_GetSymbol ========
7529 + * Purpose:
7530 + * Get the value of a symbol in the currently loaded program.
7531 + * Parameters:
7532 + * hDevObject: Handle to device object created with
7533 + * DEV_CreateDevice().
7534 + * pstrSym: Name of symbol to look up.
7535 + * pulValue: Ptr to symbol value.
7536 + * Returns:
7537 + * DSP_SOK: Success.
7538 + * DSP_EHANDLE: Invalid hDevObject.
7539 + * COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
7540 + * COD_E_SYMBOLNOTFOUND: The symbol could not be found.
7541 + * Requires:
7542 + * pstrSym != NULL.
7543 + * pulValue != NULL.
7544 + * DEV Initialized.
7545 + * Ensures:
7546 + * DSP_SOK: *pulValue contains the symbol value;
7547 + */
7548 + extern DSP_STATUS CDECL DEV_GetSymbol(struct DEV_OBJECT *hDevObject,
7549 + IN CONST char *pstrSym,
7550 + OUT u32 *pulValue);
7553 + * ======== DEV_GetWMDContext ========
7554 + * Purpose:
7555 + * Retrieve the WMD Context handle, as returned by the WMD_Create fxn.
7556 + * Parameters:
7557 + * hDevObject: Handle to device object created with DEV_CreateDevice()
7558 + * *phWmdContext: Ptr to location to store context handle.
7559 + * Returns:
7560 + * DSP_SOK: Success.
7561 + * DSP_EHANDLE: Invalid hDevObject.
7562 + * Requires:
7563 + * phWmdContext != NULL.
7564 + * DEV Initialized.
7565 + * Ensures:
7566 + * DSP_SOK: *phWmdContext contains context handle;
7567 + * else: *phWmdContext is NULL;
7568 + */
7569 + extern DSP_STATUS CDECL DEV_GetWMDContext(struct DEV_OBJECT *hDevObject,
7570 + OUT struct WMD_DEV_CONTEXT **phWmdContext);
7573 + * ======== DEV_Exit ========
7574 + * Purpose:
7575 + * Decrement reference count, and free resources when reference count is
7576 + * 0.
7577 + * Parameters:
7578 + * Returns:
7579 + * Requires:
7580 + * DEV is initialized.
7581 + * Ensures:
7582 + * When reference count == 0, DEV's private resources are freed.
7583 + */
7584 + extern void CDECL DEV_Exit();
7587 + * ======== DEV_Init ========
7588 + * Purpose:
7589 + * Initialize DEV's private state, keeping a reference count on each call.
7590 + * Parameters:
7591 + * Returns:
7592 + * TRUE if initialized; FALSE if error occured.
7593 + * Requires:
7594 + * Ensures:
7595 + * TRUE: A requirement for the other public DEV functions.
7596 + */
7597 + extern bool CDECL DEV_Init();
7600 + * ======== DEV_IsLocked ========
7601 + * Purpose:
7602 + * Predicate function to determine if the device has been
7603 + * locked by a client for exclusive access.
7604 + * Parameters:
7605 + * hDevObject: Handle to device object created with
7606 + * DEV_CreateDevice().
7607 + * Returns:
7608 + * DSP_SOK: TRUE: device has been locked.
7609 + * DSP_SFALSE: FALSE: device not locked.
7610 + * DSP_EHANDLE: hDevObject was invalid.
7611 + * Requires:
7612 + * DEV Initialized.
7613 + * Ensures:
7614 + */
7615 + extern DSP_STATUS CDECL DEV_IsLocked(IN struct DEV_OBJECT *hDevObject);
7618 + * ======== DEV_InsertProcObject ========
7619 + * Purpose:
7620 + * Inserts the Processor Object into the List of PROC Objects
7621 + * kept in the DEV Object
7622 + * Parameters:
7623 + * hProcObject: Handle to the Proc Object
7624 + * hDevObject Handle to the Dev Object
7625 + * bAttachedNew Specifies if there are already processors attached
7626 + * Returns:
7627 + * DSP_SOK: Successfully inserted into the list
7628 + * Requires:
7629 + * hProcObject is not NULL
7630 + * hDevObject is a valid handle to the DEV.
7631 + * DEV Initialized.
7632 + * List(of Proc object in Dev) Exists.
7633 + * Ensures:
7634 + * DSP_SOK & the PROC Object is inserted and the list is not empty
7635 + * Details:
7636 + * If the List of Proc Object is empty bAttachedNew is TRUE, it indicated
7637 + * this is the first Processor attaching.
7638 + * If it is False, there are already processors attached.
7639 + */
7640 + extern DSP_STATUS CDECL DEV_InsertProcObject(IN struct DEV_OBJECT
7641 + *hDevObject,
7642 + IN u32 hProcObject,
7643 + OUT bool *
7644 + pbAlreadyAttached);
7647 + * ======== DEV_RemoveProcObject ========
7648 + * Purpose:
7649 + * Search for and remove a Proc object from the given list maintained
7650 + * by the DEV
7651 + * Parameters:
7652 + * pProcObject: Ptr to ProcObject to insert.
7653 + * pDevObject: Ptr to Dev Object where the list is.
7654 + * pbAlreadyAttached: Ptr to return the bool
7655 + * Returns:
7656 + * DSP_SOK: If successful.
7657 + * DSP_EFAIL Failure to Remove the PROC Object from the list
7658 + * Requires:
7659 + * DevObject is Valid
7660 + * hProcObject != 0
7661 + * pDevObject->procList != NULL
7662 + * !LST_IsEmpty(pDevObject->procList)
7663 + * pbAlreadyAttached !=NULL
7664 + * Ensures:
7665 + * Details:
7666 + * List will be deleted when the DEV is destroyed.
7668 + */
7669 + extern DSP_STATUS CDECL DEV_RemoveProcObject(struct DEV_OBJECT
7670 + *hDevObject,
7671 + u32 hProcObject);
7674 + * ======== DEV_NotifyClients ========
7675 + * Purpose:
7676 + * Notify all clients of this device of a change in device status.
7677 + * Clients may include multiple users of BRD, as well as CHNL.
7678 + * This function is asychronous, and may be called by a timer event
7679 + * set up by a watchdog timer.
7680 + * Parameters:
7681 + * hDevObject: Handle to device object created with DEV_CreateDevice().
7682 + * ulStatus: A status word, most likely a BRD_STATUS.
7683 + * Returns:
7684 + * DSP_SOK: All registered clients were asynchronously notified.
7685 + * DSP_EINVALIDARG: Invalid hDevObject.
7686 + * Requires:
7687 + * DEV Initialized.
7688 + * Ensures:
7689 + * DSP_SOK: Notifications are queued by the operating system to be
7690 + * delivered to clients. This function does not ensure that
7691 + * the notifications will ever be delivered.
7692 + */
7693 + extern DSP_STATUS CDECL DEV_NotifyClients(struct DEV_OBJECT *hDevObject,
7694 + u32 ulStatus);
7697 + * ======== DEV_RegisterNotify ========
7698 + * Purpose:
7699 + * Register a callback function and callback argument for DEV to call
7700 + * when a change in device status occurs.
7701 + * Parameters:
7702 + * hDevObject: Handle to device object created with DEV_CreateDevice().
7703 + * Returns:
7704 + * DSP_SOK: Success.
7705 + * DSP_EHANDLE: Invalid Dev Object handle.
7706 + * Requires:
7707 + * DEV Initialized.
7708 + * Ensures:
7709 + */
7710 + extern DSP_STATUS CDECL DEV_RegisterNotify(struct DEV_OBJECT
7711 + *hDevObject,
7712 + void *pArb,
7713 + DEV_CALLBACK lpCallback);
7716 + * ======== DEV_RemoveDevice ========
7717 + * Purpose:
7718 + * Destroys the Device Object created by DEV_StartDevice.
7719 + * Parameters:
7720 + * hDevNode: Device node as it is know to OS.
7721 + * Returns:
7722 + * DSP_SOK: If success;
7723 + * <error code> Otherwise.
7724 + * Requires:
7725 + * Ensures:
7726 + */
7727 + extern DSP_STATUS CDECL DEV_RemoveDevice(struct CFG_DEVNODE *hDevNode);
7730 + * ======== DEV_SetChnlMgr ========
7731 + * Purpose:
7732 + * Set the channel manager for this device.
7733 + * Parameters:
7734 + * hDevObject: Handle to device object created with
7735 + * DEV_CreateDevice().
7736 + * hMgr: Handle to a channel manager, or NULL.
7737 + * Returns:
7738 + * DSP_SOK: Success.
7739 + * DSP_EHANDLE: Invalid hDevObject.
7740 + * Requires:
7741 + * DEV Initialized.
7742 + * Ensures:
7743 + */
7744 + extern DSP_STATUS CDECL DEV_SetChnlMgr(struct DEV_OBJECT *hDevObject,
7745 + struct CHNL_MGR *hMgr);
7748 + * ======== DEV_SetMsgMgr ========
7749 + * Purpose:
7750 + * Set the Message manager for this device.
7751 + * Parameters:
7752 + * hDevObject: Handle to device object created with DEV_CreateDevice().
7753 + * hMgr: Handle to a message manager, or NULL.
7754 + * Returns:
7755 + * Requires:
7756 + * DEV Initialized.
7757 + * Ensures:
7758 + */
7759 + extern void CDECL DEV_SetMsgMgr(struct DEV_OBJECT *hDevObject,
7760 + struct MSG_MGR *hMgr);
7763 + * ======== DEV_StartDevice ========
7764 + * Purpose:
7765 + * Initializes the new device with the WinBRIDGE environment. This
7766 + * involves querying CM for allocated resources, querying the registry
7767 + * for necessary dsp resources (requested in the INF file), and using
7768 + * this information to create a WinBRIDGE device object.
7769 + * Parameters:
7770 + * hDevNode: Device node as it is know to OS.
7771 + * Returns:
7772 + * DSP_SOK: If success;
7773 + * <error code> Otherwise.
7774 + * Requires:
7775 + * DEV initialized.
7776 + * Ensures:
7777 + */
7778 + extern DSP_STATUS CDECL DEV_StartDevice(struct CFG_DEVNODE *hDevNode);
7780 +#endif /* DEV_ */
7781 Index: lk/arch/arm/plat-omap/include/bridge/devdefs.h
7782 ===================================================================
7783 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
7784 +++ lk/arch/arm/plat-omap/include/bridge/devdefs.h 2008-08-18 10:38:34.000000000 +0300
7785 @@ -0,0 +1,35 @@
7787 + * arch/arm/plat-omap/include/bridge/devdefs.h
7789 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
7791 + * Copyright (C) 2008 Texas Instruments, Inc.
7793 + * This package is free software; you can redistribute it and/or modify
7794 + * it under the terms of the GNU General Public License version 2 as
7795 + * published by the Free Software Foundation.
7797 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
7798 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
7799 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
7800 + */
7803 + * ======== devdefs.h ========
7804 + * Purpose:
7805 + * Definition of common include typedef between wmd.h and dev.h. Required
7806 + * to break circular dependency between WMD and DEV include files.
7808 + *! Revision History:
7809 + *! ================
7810 + *! 12-Nov-1996 gp: Renamed from dev1.h.
7811 + *! 30-May-1996 gp: Broke out from dev.h
7812 + */
7814 +#ifndef DEVDEFS_
7815 +#define DEVDEFS_
7817 +/* WCD Device Object */
7818 + struct DEV_OBJECT;
7820 +#endif /* DEVDEFS_ */
7821 Index: lk/arch/arm/plat-omap/include/bridge/disp.h
7822 ===================================================================
7823 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
7824 +++ lk/arch/arm/plat-omap/include/bridge/disp.h 2008-08-18 10:38:34.000000000 +0300
7825 @@ -0,0 +1,236 @@
7827 + * arch/arm/plat-omap/include/bridge/disp.h
7829 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
7831 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
7833 + * This package is free software; you can redistribute it and/or modify
7834 + * it under the terms of the GNU General Public License version 2 as
7835 + * published by the Free Software Foundation.
7837 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
7838 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
7839 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
7840 + */
7844 + * ======== disp.h ========
7846 + * Description:
7847 + * DSP/BIOS Bridge Node Dispatcher.
7849 + * Public Functions:
7850 + * DISP_Create
7851 + * DISP_Delete
7852 + * DISP_Exit
7853 + * DISP_Init
7854 + * DISP_NodeChangePriority
7855 + * DISP_NodeCreate
7856 + * DISP_NodeDelete
7857 + * DISP_NodeRun
7859 + *! Revision History:
7860 + *! =================
7861 + *! 28-Jan-2003 map Removed DISP_DoCinit().
7862 + *! 15-May-2002 jeh Added DISP_DoCinit().
7863 + *! 24-Apr-2002 jeh Added DISP_MemWrite().
7864 + *! 07-Sep-2001 jeh Added DISP_MemCopy().
7865 + *! 10-May-2001 jeh Code review cleanup.
7866 + *! 08-Aug-2000 jeh Removed DISP_NodeTerminate since it no longer uses RMS.
7867 + *! 17-Jul-2000 jeh Updates to function headers.
7868 + *! 19-Jun-2000 jeh Created.
7869 + */
7871 +#ifndef DISP_
7872 +#define DISP_
7874 +#include <dbdefs.h>
7875 +#include <nodedefs.h>
7876 +#include <nodepriv.h>
7877 +#include <dispdefs.h>
7880 + * ======== DISP_Create ========
7881 + * Create a NODE Dispatcher object. This object handles the creation,
7882 + * deletion, and execution of nodes on the DSP target, through communication
7883 + * with the Resource Manager Server running on the target. Each NODE
7884 + * Manager object should have exactly one NODE Dispatcher.
7886 + * Parameters:
7887 + * phDispObject: Location to store node dispatcher object on output.
7888 + * hDevObject: Device for this processor.
7889 + * pDispAttrs: Node dispatcher attributes.
7890 + * Returns:
7891 + * DSP_SOK: Success;
7892 + * DSP_EMEMORY: Insufficient memory for requested resources.
7893 + * DSP_EFAIL: Unable to create dispatcher.
7894 + * Requires:
7895 + * DISP_Init() called.
7896 + * pDispAttrs != NULL.
7897 + * hDevObject != NULL.
7898 + * phDispObject != NULL.
7899 + * Ensures:
7900 + * DSP_SOK: IsValid(*phDispObject).
7901 + * error: *phDispObject == NULL.
7902 + */
7903 + extern DSP_STATUS DISP_Create(OUT struct DISP_OBJECT **phDispObject,
7904 + struct DEV_OBJECT *hDevObject,
7905 + IN CONST struct DISP_ATTRS *pDispAttrs);
7908 + * ======== DISP_Delete ========
7909 + * Delete the NODE Dispatcher.
7911 + * Parameters:
7912 + * hDispObject: Node Dispatcher object.
7913 + * Returns:
7914 + * Requires:
7915 + * DISP_Init() called.
7916 + * Valid hDispObject.
7917 + * Ensures:
7918 + * hDispObject is invalid.
7919 + */
7920 + extern void DISP_Delete(struct DISP_OBJECT *hDispObject);
7923 + * ======== DISP_Exit ========
7924 + * Discontinue usage of DISP module.
7926 + * Parameters:
7927 + * Returns:
7928 + * Requires:
7929 + * DISP_Init() previously called.
7930 + * Ensures:
7931 + * Any resources acquired in DISP_Init() will be freed when last DISP
7932 + * client calls DISP_Exit().
7933 + */
7934 + extern void DISP_Exit();
7937 + * ======== DISP_Init ========
7938 + * Initialize the DISP module.
7940 + * Parameters:
7941 + * Returns:
7942 + * TRUE if initialization succeeded, FALSE otherwise.
7943 + * Ensures:
7944 + */
7945 + extern bool DISP_Init();
7948 + * ======== DISP_NodeChangePriority ========
7949 + * Change the priority of a node currently running on the target.
7951 + * Parameters:
7952 + * hDispObject: Node Dispatcher object.
7953 + * hNode: Node object representing a node currently
7954 + * allocated or running on the DSP.
7955 + * ulFxnAddress: Address of RMS function for changing priority.
7956 + * nodeEnv: Address of node's environment structure.
7957 + * nPriority: New priority level to set node's priority to.
7958 + * Returns:
7959 + * DSP_SOK: Success.
7960 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
7961 + * Requires:
7962 + * DISP_Init() called.
7963 + * Valid hDispObject.
7964 + * hNode != NULL.
7965 + * Ensures:
7966 + */
7967 + extern DSP_STATUS DISP_NodeChangePriority(struct DISP_OBJECT
7968 + *hDispObject,
7969 + struct NODE_OBJECT *hNode,
7970 + u32 ulFxnAddr,
7971 + NODE_ENV nodeEnv,
7972 + s32 nPriority);
7975 + * ======== DISP_NodeCreate ========
7976 + * Create a node on the DSP by remotely calling the node's create function.
7978 + * Parameters:
7979 + * hDispObject: Node Dispatcher object.
7980 + * hNode: Node handle obtained from NODE_Allocate().
7981 + * ulFxnAddr: Address or RMS create node function.
7982 + * ulCreateFxn: Address of node's create function.
7983 + * pArgs: Arguments to pass to RMS node create function.
7984 + * pNodeEnv: Location to store node environment pointer on
7985 + * output.
7986 + * Returns:
7987 + * DSP_SOK: Success.
7988 + * DSP_ETASK: Unable to create the node's task or process on the DSP.
7989 + * DSP_ESTREAM: Stream creation failure on the DSP.
7990 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
7991 + * DSP_EUSER: A user-defined failure occurred.
7992 + * DSP_EFAIL: A failure occurred, unable to create node.
7993 + * Requires:
7994 + * DISP_Init() called.
7995 + * Valid hDispObject.
7996 + * pArgs != NULL.
7997 + * hNode != NULL.
7998 + * pNodeEnv != NULL.
7999 + * NODE_GetType(hNode) != NODE_DEVICE.
8000 + * Ensures:
8001 + */
8002 + extern DSP_STATUS DISP_NodeCreate(struct DISP_OBJECT *hDispObject,
8003 + struct NODE_OBJECT *hNode,
8004 + u32 ulFxnAddr,
8005 + u32 ulCreateFxn,
8006 + IN CONST struct NODE_CREATEARGS
8007 + *pArgs,
8008 + OUT NODE_ENV *pNodeEnv);
8011 + * ======== DISP_NodeDelete ========
8012 + * Delete a node on the DSP by remotely calling the node's delete function.
8014 + * Parameters:
8015 + * hDispObject: Node Dispatcher object.
8016 + * hNode: Node object representing a node currently
8017 + * loaded on the DSP.
8018 + * ulFxnAddr: Address or RMS delete node function.
8019 + * ulDeleteFxn: Address of node's delete function.
8020 + * nodeEnv: Address of node's environment structure.
8021 + * Returns:
8022 + * DSP_SOK: Success.
8023 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
8024 + * Requires:
8025 + * DISP_Init() called.
8026 + * Valid hDispObject.
8027 + * hNode != NULL.
8028 + * Ensures:
8029 + */
8030 + extern DSP_STATUS DISP_NodeDelete(struct DISP_OBJECT *hDispObject,
8031 + struct NODE_OBJECT *hNode,
8032 + u32 ulFxnAddr,
8033 + u32 ulDeleteFxn, NODE_ENV nodeEnv);
8036 + * ======== DISP_NodeRun ========
8037 + * Start execution of a node's execute phase, or resume execution of a node
8038 + * that has been suspended (via DISP_NodePause()) on the DSP.
8040 + * Parameters:
8041 + * hDispObject: Node Dispatcher object.
8042 + * hNode: Node object representing a node to be executed
8043 + * on the DSP.
8044 + * ulFxnAddr: Address or RMS node execute function.
8045 + * ulExecuteFxn: Address of node's execute function.
8046 + * nodeEnv: Address of node's environment structure.
8047 + * Returns:
8048 + * DSP_SOK: Success.
8049 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
8050 + * Requires:
8051 + * DISP_Init() called.
8052 + * Valid hDispObject.
8053 + * hNode != NULL.
8054 + * Ensures:
8055 + */
8056 + extern DSP_STATUS DISP_NodeRun(struct DISP_OBJECT *hDispObject,
8057 + struct NODE_OBJECT *hNode,
8058 + u32 ulFxnAddr,
8059 + u32 ulExecuteFxn, NODE_ENV nodeEnv);
8061 +#endif /* DISP_ */
8062 Index: lk/arch/arm/plat-omap/include/bridge/dispdefs.h
8063 ===================================================================
8064 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
8065 +++ lk/arch/arm/plat-omap/include/bridge/dispdefs.h 2008-08-18 10:38:34.000000000 +0300
8066 @@ -0,0 +1,45 @@
8068 + * arch/arm/plat-omap/include/bridge/dispdefs.h
8070 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
8072 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
8074 + * This package is free software; you can redistribute it and/or modify
8075 + * it under the terms of the GNU General Public License version 2 as
8076 + * published by the Free Software Foundation.
8078 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8079 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8080 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8081 + */
8085 + * ======== dispdefs.h ========
8086 + * Description:
8087 + * Global DISP constants and types, shared by PROCESSOR, NODE, and DISP.
8089 + *! Revision History
8090 + *! ================
8091 + *! 08-Aug-2000 jeh Added fields to DISP_ATTRS.
8092 + *! 06-Jul-2000 jeh Created.
8093 + */
8095 +#ifndef DISPDEFS_
8096 +#define DISPDEFS_
8098 + struct DISP_OBJECT;
8100 +/* Node Dispatcher attributes */
8101 + struct DISP_ATTRS {
8102 + u32 ulChnlOffset; /* Offset of channel ids reserved for RMS */
8103 + /* Size of buffer for sending data to RMS */
8104 + u32 ulChnlBufSize;
8105 + DSP_PROCFAMILY procFamily; /* eg, 5000 */
8106 + DSP_PROCTYPE procType; /* eg, 5510 */
8107 + HANDLE hReserved1; /* Reserved for future use. */
8108 + u32 hReserved2; /* Reserved for future use. */
8109 + } ;
8111 +#endif /* DISPDEFS_ */
8112 Index: lk/arch/arm/plat-omap/include/bridge/dldr.h
8113 ===================================================================
8114 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
8115 +++ lk/arch/arm/plat-omap/include/bridge/dldr.h 2008-08-18 10:38:34.000000000 +0300
8116 @@ -0,0 +1,75 @@
8118 + * bridge/inc/dldr.h
8120 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
8122 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
8124 + * This package is free software; you can redistribute it and/or modify
8125 + * it under the terms of the GNU General Public License version 2 as
8126 + * published by the Free Software Foundation.
8128 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8129 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8130 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8131 + */
8135 + * ======== dldr.h ========
8137 + * Description:
8138 + * DSP/BIOS Bridge dynamic loader interface. See the file dldrdefs.h
8139 + * for a description of these functions.
8141 + * Public Functions:
8142 + * DLDR_Allocate
8143 + * DLDR_Create
8144 + * DLDR_Delete
8145 + * DLDR_Exit
8146 + * DLDR_Free
8147 + * DLDR_GetFxnAddr
8148 + * DLDR_Init
8149 + * DLDR_Load
8150 + * DLDR_Unload
8152 + * Notes:
8154 + *! Revision History
8155 + *! ================
8156 + *! 31-Jul-2002 jeh Removed function header comments.
8157 + *! 17-Apr-2002 jeh Created.
8158 + */
8160 +#include <dbdefs.h>
8161 +#include <dbdcddef.h>
8162 +#include <dldrdefs.h>
8164 +#ifndef DLDR_
8165 +#define DLDR_
8167 + extern DSP_STATUS DLDR_Allocate(struct DLDR_OBJECT *hDldr,
8168 + void *pPrivRef,
8169 + IN CONST struct DCD_NODEPROPS
8170 + *pNodeProps,
8171 + OUT struct DLDR_NODEOBJECT
8172 + **phDldrNode);
8174 + extern DSP_STATUS DLDR_Create(OUT struct DLDR_OBJECT **phDldr,
8175 + struct DEV_OBJECT *hDevObject,
8176 + IN CONST struct DLDR_ATTRS *pAttrs);
8178 + extern void DLDR_Delete(struct DLDR_OBJECT *hDldr);
8179 + extern void DLDR_Exit();
8180 + extern void DLDR_Free(struct DLDR_NODEOBJECT *hDldrNode);
8182 + extern DSP_STATUS DLDR_GetFxnAddr(struct DLDR_NODEOBJECT *hDldrNode,
8183 + char *pstrFxn, u32 *pulAddr);
8185 + extern bool DLDR_Init();
8186 + extern DSP_STATUS DLDR_Load(struct DLDR_NODEOBJECT *hDldrNode,
8187 + enum DLDR_PHASE phase);
8188 + extern DSP_STATUS DLDR_Unload(struct DLDR_NODEOBJECT *hDldrNode,
8189 + enum DLDR_PHASE phase);
8191 +#endif /* DLDR_ */
8192 Index: lk/arch/arm/plat-omap/include/bridge/dldrdefs.h
8193 ===================================================================
8194 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
8195 +++ lk/arch/arm/plat-omap/include/bridge/dldrdefs.h 2008-08-18 10:38:34.000000000 +0300
8196 @@ -0,0 +1,315 @@
8198 + * bridge/inc/dldrdefs.h
8200 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
8202 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
8204 + * This package is free software; you can redistribute it and/or modify
8205 + * it under the terms of the GNU General Public License version 2 as
8206 + * published by the Free Software Foundation.
8208 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8209 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8210 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8211 + */
8215 + * ======== dldrdefs.h ========
8217 + * Description:
8218 + * DSP/BIOS Bridge loader interface. This is the interface shared by
8219 + * all loaders (eg, static loader and dynamic loader). This interface will
8220 + * be used by NODE.
8222 + *! Revision History
8223 + *! ================
8224 + *! 16-Sep-2002 map Updated with code review changes
8225 + *! 24-Apr-2002 jeh Added DLDR_WRITEFXN.
8226 + *! 05-Nov-2001 jeh Changed some function error return codes.
8227 + *! 17-Sep-2001 jeh Added function typedefs.
8228 + *! 22-Aug-2001 jeh Created.
8229 + */
8231 +#ifndef DLDRDEFS_
8232 +#define DLDRDEFS_
8234 +#include <dbdcddef.h>
8235 +#include <dev.h>
8237 +#define DLDR_MAXPATHLENGTH 255
8239 +/* DLDR Objects: */
8240 + struct DLDR_OBJECT;
8241 + struct DLDR_NODEOBJECT;
8244 + * ======== DLDR_LOADTYPE ========
8245 + * Load types for a node. Must match values in node.h55.
8246 + */
8247 + enum DLDR_LOADTYPE {
8248 + DLDR_STATICLOAD, /* Linked in base image, not overlay */
8249 + DLDR_DYNAMICLOAD, /* Dynamically loaded node */
8250 + DLDR_OVLYLOAD /* Linked in base image, overlay node */
8251 + } ;
8254 + * ======== DLDR_OVLYFXN ========
8255 + * Causes code or data to be copied from load address to run address. This
8256 + * is the "COD_WRITEFXN" that gets passed to the DBL_Library and is used as
8257 + * the ZL write function.
8259 + * Parameters:
8260 + * pPrivRef: Handle to identify the node.
8261 + * ulDspRunAddr: Run address of code or data.
8262 + * ulDspLoadAddr: Load address of code or data.
8263 + * ulNumBytes: Number of (GPP) bytes to copy.
8264 + * nMemSpace: RMS_CODE or RMS_DATA.
8265 + * Returns:
8266 + * ulNumBytes: Success.
8267 + * 0: Failure.
8268 + * Requires:
8269 + * Ensures:
8270 + */
8271 + typedef u32(CDECL *DLDR_OVLYFXN) (void *pPrivRef, u32 ulDspRunAddr,
8272 + u32 ulDspLoadAddr,
8273 + u32 ulNumBytes, u32 nMemSpace);
8276 + * ======== DLDR_WRITEFXN ========
8277 + * Write memory function. Used for dynamic load writes.
8278 + * Parameters:
8279 + * pPrivRef: Handle to identify the node.
8280 + * ulDspAddr: Address of code or data.
8281 + * pBuf: Code or data to be written
8282 + * ulNumBytes: Number of (GPP) bytes to write.
8283 + * nMemSpace: DBL_DATA or DBL_CODE.
8284 + * Returns:
8285 + * ulNumBytes: Success.
8286 + * 0: Failure.
8287 + * Requires:
8288 + * Ensures:
8289 + */
8290 + typedef u32(CDECL *DLDR_WRITEFXN) (void *pPrivRef,
8291 + u32 ulDspAddr,
8292 + void *pBuf,
8293 + u32 ulNumBytes, u32 nMemSpace);
8296 + * ======== DLDR_ATTRS ========
8297 + * Attributes passed to DLDR_Create function.
8298 + */
8299 + struct DLDR_ATTRS {
8300 + DLDR_OVLYFXN pfnOvly;
8301 + DLDR_WRITEFXN pfnWrite;
8302 + u16 usDSPWordSize;
8303 + u16 usDSPMauSize;
8304 + } ;
8307 + * ======== DLDR_PHASE ========
8308 + * Indicates node create, delete, or execute phase function.
8309 + */
8310 + enum DLDR_PHASE {
8311 + DLDR_CREATE,
8312 + DLDR_DELETE,
8313 + DLDR_EXECUTE,
8314 + DLDR_NOPHASE
8315 + } ;
8318 + * Typedefs of loader functions imported from a DLL, or defined in a
8319 + * function table.
8320 + */
8323 + * ======== DLDR_Allocate ========
8324 + * Allocate resources to manage the loading of a node on the DSP.
8326 + * Parameters:
8327 + * hDldr: Handle of loader that will load the node.
8328 + * pPrivRef: Handle to identify the node.
8329 + * pNodeProps: Pointer to a DCD_NODEPROPS for the node.
8330 + * phDldrNode: Location to store node handle on output. This handle
8331 + * will be passed to DLDR_Load/DLDR_Unload.
8332 + * pfPhaseSplit: pointer to boolean variable referenced in node.c
8333 + * Returns:
8334 + * DSP_SOK: Success.
8335 + * DSP_EMEMORY: Insufficient memory on GPP.
8336 + * Requires:
8337 + * DLDR_Init() called.
8338 + * Valid hDldr.
8339 + * pNodeProps != NULL.
8340 + * phDldrNode != NULL.
8341 + * Ensures:
8342 + * DSP_SOK: IsValidNode(*phDldrNode).
8343 + * error: *phDldrNode == NULL.
8344 + */
8345 + typedef DSP_STATUS(*DLDR_ALLOCATEFXN) (struct DLDR_OBJECT *hDldr,
8346 + void *pPrivRef,
8347 + IN CONST struct DCD_NODEPROPS *
8348 + pNodeProps,
8349 + OUT struct DLDR_NODEOBJECT
8350 + **phDldrNode,
8351 + OUT bool *pfPhaseSplit);
8354 + * ======== DLDR_Create ========
8355 + * Create a loader object. This object handles the loading and unloading of
8356 + * create, delete, and execute phase functions of nodes on the DSP target.
8358 + * Parameters:
8359 + * phDldr: Location to store loader handle on output.
8360 + * hDevObject: Device for this processor.
8361 + * pAttrs: Loader attributes.
8362 + * Returns:
8363 + * DSP_SOK: Success;
8364 + * DSP_EMEMORY: Insufficient memory for requested resources.
8365 + * Requires:
8366 + * DLDR_Init() called.
8367 + * phDldr != NULL.
8368 + * hDevObject != NULL.
8369 + * pAttrs != NULL.
8370 + * Ensures:
8371 + * DSP_SOK: Valid *phDldr.
8372 + * error: *phDldr == NULL.
8373 + */
8374 + typedef DSP_STATUS(*DLDR_CREATEFXN) (OUT struct DLDR_OBJECT **phDldr,
8375 + struct DEV_OBJECT *hDevObject,
8376 + IN CONST struct DLDR_ATTRS
8377 + *pAttrs);
8380 + * ======== DLDR_Delete ========
8381 + * Delete the DLDR loader.
8383 + * Parameters:
8384 + * hDldr: Node manager object.
8385 + * Returns:
8386 + * Requires:
8387 + * DLDR_Init() called.
8388 + * Valid hDldr.
8389 + * Ensures:
8390 + * hDldr invalid
8391 + */
8392 + typedef void(*DLDR_DELETEFXN) (struct DLDR_OBJECT *hDldr);
8395 + * ======== DLDR_Exit ========
8396 + * Discontinue usage of DLDR module.
8398 + * Parameters:
8399 + * Returns:
8400 + * Requires:
8401 + * DLDR_Init() successfully called before.
8402 + * Ensures:
8403 + * Any resources acquired in DLDR_Init() will be freed when last DLDR
8404 + * client calls DLDR_Exit().
8405 + */
8406 + typedef void(*DLDR_EXITFXN) ();
8409 + * ======== DLDR_Free ========
8410 + * Free resources allocated in DLDR_Allocate.
8412 + * Parameters:
8413 + * hDldrNode: Handle returned from DLDR_Allocate().
8414 + * Returns:
8415 + * Requires:
8416 + * DLDR_Init() called.
8417 + * Valid hDldrNode.
8418 + * Ensures:
8419 + */
8420 + typedef void(*DLDR_FREEFXN) (struct DLDR_NODEOBJECT *hDldrNode);
8423 + * ======== DLDR_GetFxnAddr ========
8424 + * Get address of create, delete, or execute phase function of a node on
8425 + * the DSP.
8427 + * Parameters:
8428 + * hDldrNode: Handle returned from DLDR_Allocate().
8429 + * pstrFxn: Name of function.
8430 + * pulAddr: Location to store function address.
8431 + * Returns:
8432 + * DSP_SOK: Success.
8433 + * DSP_ESYMBOL: Address of function not found.
8434 + * Requires:
8435 + * DLDR_Init() called.
8436 + * Valid hDldrNode.
8437 + * pulAddr != NULL;
8438 + * pstrFxn != NULL;
8439 + * Ensures:
8440 + */
8441 + typedef DSP_STATUS(*DLDR_GETFXNADDRFXN) (struct DLDR_NODEOBJECT
8442 + *hDldrNode,
8443 + char *pstrFxn, u32 *pulAddr);
8446 + * ======== DLDR_Init ========
8447 + * Initialize the DLDR module.
8449 + * Parameters:
8450 + * Returns:
8451 + * TRUE if initialization succeeded, FALSE otherwise.
8452 + * Ensures:
8453 + */
8454 + typedef bool(*DLDR_INITFXN) ();
8457 + * ======== DLDR_Load ========
8458 + * Load create, delete, or execute phase function of a node on the DSP.
8460 + * Parameters:
8461 + * hDldrNode: Handle returned from DLDR_Allocate().
8462 + * phase: Type of function to load (create, delete, or execute).
8463 + * Returns:
8464 + * DSP_SOK: Success.
8465 + * DSP_EMEMORY: Insufficient memory on GPP.
8466 + * DSP_EOVERLAYMEMORY: Can't overlay phase because overlay memory
8467 + * is already in use.
8468 + * DSP_EDYNLOAD: Failure in dynamic loader library.
8469 + * DSP_EFWRITE: Failed to write phase's code or date to target.
8470 + * Requires:
8471 + * DLDR_Init() called.
8472 + * Valid hDldrNode.
8473 + * Ensures:
8474 + */
8475 + typedef DSP_STATUS(*DLDR_LOADFXN) (struct DLDR_NODEOBJECT *hDldrNode,
8476 + enum DLDR_PHASE phase);
8479 + * ======== DLDR_Unload ========
8480 + * Unload create, delete, or execute phase function of a node on the DSP.
8482 + * Parameters:
8483 + * hDldrNode: Handle returned from DLDR_Allocate().
8484 + * phase: Node function to unload (create, delete, or execute).
8485 + * Returns:
8486 + * DSP_SOK: Success.
8487 + * DSP_EMEMORY: Insufficient memory on GPP.
8488 + * Requires:
8489 + * DLDR_Init() called.
8490 + * Valid hDldrNode.
8491 + * Ensures:
8492 + */
8493 + typedef DSP_STATUS(*DLDR_UNLOADFXN) (struct DLDR_NODEOBJECT *hDldrNode,
8494 + enum DLDR_PHASE phase);
8497 + * ======== DLDR_FXNS ========
8498 + */
8499 + struct DLDR_FXNS {
8500 + DLDR_ALLOCATEFXN pfnAllocate;
8501 + DLDR_CREATEFXN pfnCreate;
8502 + DLDR_DELETEFXN pfnDelete;
8503 + DLDR_EXITFXN pfnExit;
8504 + DLDR_FREEFXN pfnFree;
8505 + DLDR_GETFXNADDRFXN pfnGetFxnAddr;
8506 + DLDR_INITFXN pfnInit;
8507 + DLDR_LOADFXN pfnLoad;
8508 + DLDR_UNLOADFXN pfnUnload;
8509 + } ;
8511 +#endif /* DLDRDEFS_ */
8512 Index: lk/arch/arm/plat-omap/include/bridge/dmm.h
8513 ===================================================================
8514 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
8515 +++ lk/arch/arm/plat-omap/include/bridge/dmm.h 2008-08-18 10:38:34.000000000 +0300
8516 @@ -0,0 +1,85 @@
8518 + * bridge/inc/dmm.h
8520 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
8522 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
8524 + * This package is free software; you can redistribute it and/or modify
8525 + * it under the terms of the GNU General Public License version 2 as
8526 + * published by the Free Software Foundation.
8528 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8529 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8530 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8531 + */
8535 + * ======== dmm.h ========
8536 + * Purpose:
8537 + * The Dynamic Memory Mapping(DMM) module manages the DSP Virtual address
8538 + * space that can be directly mapped to any MPU buffer or memory region
8540 + * Public Functions:
8542 + *! Revision History:
8543 + *! ================
8544 + *! 20-Feb-2004 sb: Created.
8545 + *!
8546 + */
8548 +#ifndef DMM_
8549 +#define DMM_
8551 +#include <dbdefs.h>
8553 + struct DMM_OBJECT;
8555 +/* DMM attributes used in DMM_Create() */
8556 + struct DMM_MGRATTRS {
8557 + u32 reserved;
8558 + } ;
8560 +#define DMMPOOLSIZE 0x4000000
8563 + * ======== DMM_GetHandle ========
8564 + * Purpose:
8565 + * Return the dynamic memory manager object for this device.
8566 + * This is typically called from the client process.
8567 + */
8569 + extern DSP_STATUS DMM_GetHandle(DSP_HPROCESSOR hProcessor,
8570 + OUT struct DMM_OBJECT **phDmmMgr);
8572 + extern DSP_STATUS DMM_ReserveMemory(struct DMM_OBJECT *hDmmMgr,
8573 + u32 size,
8574 + u32 *pRsvAddr);
8576 + extern DSP_STATUS DMM_UnReserveMemory(struct DMM_OBJECT *hDmmMgr,
8577 + u32 rsvAddr);
8579 + extern DSP_STATUS DMM_MapMemory(struct DMM_OBJECT *hDmmMgr, u32 addr,
8580 + u32 size);
8582 + extern DSP_STATUS DMM_UnMapMemory(struct DMM_OBJECT *hDmmMgr,
8583 + u32 addr,
8584 + u32 *pSize);
8586 + extern DSP_STATUS DMM_Destroy(struct DMM_OBJECT *hDmmMgr);
8588 + extern DSP_STATUS DMM_DeleteTables(struct DMM_OBJECT *hDmmMgr);
8590 + extern DSP_STATUS DMM_Create(OUT struct DMM_OBJECT **phDmmMgr,
8591 + struct DEV_OBJECT *hDevObject,
8592 + IN CONST struct DMM_MGRATTRS *pMgrAttrs);
8594 + extern bool DMM_Init();
8596 + extern void DMM_Exit();
8598 + extern DSP_STATUS DMM_CreateTables(struct DMM_OBJECT *hDmmMgr,
8599 + u32 addr, u32 size);
8600 + extern u32 *DMM_GetPhysicalAddrTable(void);
8601 +#endif /* DMM_ */
8602 Index: lk/arch/arm/plat-omap/include/bridge/dpc.h
8603 ===================================================================
8604 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
8605 +++ lk/arch/arm/plat-omap/include/bridge/dpc.h 2008-08-18 10:38:34.000000000 +0300
8606 @@ -0,0 +1,167 @@
8608 + * bridge/inc/dpc.h
8610 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
8612 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
8614 + * This package is free software; you can redistribute it and/or modify
8615 + * it under the terms of the GNU General Public License version 2 as
8616 + * published by the Free Software Foundation.
8618 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8619 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8620 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8621 + */
8625 + * ======== dpc.h ========
8626 + * Purpose:
8627 + * Deferred Procedure Call(DPC) Services.
8629 + * Public Functions:
8630 + * DPC_Cancel
8631 + * DPC_Create
8632 + * DPC_Destroy
8633 + * DPC_Exit
8634 + * DPC_Init
8635 + * DPC_Schedule
8637 + *! Revision History:
8638 + *! ================
8639 + *! 31-Jan-2000 rr: DPC_Destroy ensures Suceess and DPC Object is NULL.
8640 + *! 21-Jan-2000 ag: Updated comments per code review.
8641 + *! 06-Jan-2000 ag: Removed DPC_[Lower|Raise]IRQL[From|To]DispatchLevel.
8642 + *! 14-Jan-1998 gp: Added DPC_[Lower|Raise]IRQL[From|To]DispatchLevel.
8643 + *! 18-Aug-1997 cr: Added explicit CDECL identifiers.
8644 + *! 28-Jul-1996 gp: Created.
8645 + */
8647 +#ifndef DPC_
8648 +#define DPC_
8650 + struct DPC_OBJECT;
8653 + * ======== DPC_PROC ========
8654 + * Purpose:
8655 + * Deferred processing routine. Typically scheduled from an ISR to
8656 + * complete I/O processing.
8657 + * Parameters:
8658 + * pRefData: Ptr to user data: passed in via ISR_ScheduleDPC.
8659 + * Returns:
8660 + * Requires:
8661 + * The DPC should not block, or otherwise acquire resources.
8662 + * Interrupts to the processor are enabled.
8663 + * DPC_PROC executes in a critical section.
8664 + * Ensures:
8665 + * This DPC will not be reenterred on the same thread.
8666 + * However, the DPC may take hardware interrupts during execution.
8667 + * Interrupts to the processor are enabled.
8668 + */
8669 + typedef void(CDECL *DPC_PROC) (void *pRefData);
8672 + * ======== DPC_Cancel ========
8673 + * Purpose:
8674 + * Cancel a DPC previously scheduled by DPC_Schedule.
8675 + * Parameters:
8676 + * hDPC: A DPC object handle created in DPC_Create().
8677 + * Returns:
8678 + * DSP_SOK: Scheduled DPC, if any, is cancelled.
8679 + * DSP_SFALSE: No DPC is currently scheduled for execution.
8680 + * DSP_EHANDLE: Invalid hDPC.
8681 + * Requires:
8682 + * Ensures:
8683 + * If the DPC has already executed, is executing, or was not yet
8684 + * scheduled, this function will have no effect.
8685 + */
8686 + extern DSP_STATUS CDECL DPC_Cancel(IN struct DPC_OBJECT *hDPC);
8689 + * ======== DPC_Create ========
8690 + * Purpose:
8691 + * Create a DPC object, allowing a client's own DPC procedure to be
8692 + * scheduled for a call with client reference data.
8693 + * Parameters:
8694 + * phDPC: Pointer to location to store DPC object.
8695 + * pfnDPC: Client's DPC procedure.
8696 + * pRefData: Pointer to user-defined reference data.
8697 + * Returns:
8698 + * DSP_SOK: DPC object created.
8699 + * DSP_EPOINTER: phDPC == NULL or pfnDPC == NULL.
8700 + * DSP_EMEMORY: Insufficient memory.
8701 + * Requires:
8702 + * Must not be called at interrupt time.
8703 + * Ensures:
8704 + * DSP_SOK: DPC object is created;
8705 + * else: *phDPC is set to NULL.
8706 + */
8707 + extern DSP_STATUS CDECL DPC_Create(OUT struct DPC_OBJECT **phDPC,
8708 + IN DPC_PROC pfnDPC,
8709 + IN void *pRefData);
8712 + * ======== DPC_Destroy ========
8713 + * Purpose:
8714 + * Cancel the last scheduled DPC, and deallocate a DPC object previously
8715 + * allocated with DPC_Create().Frees the Object only if the thread and
8716 + * the events are terminated successfuly.
8717 + * Parameters:
8718 + * hDPC: A DPC object handle created in DPC_Create().
8719 + * Returns:
8720 + * DSP_SOK: Success.
8721 + * DSP_EHANDLE: Invalid hDPC.
8722 + * Requires:
8723 + * All DPC's scheduled for the DPC object must have completed their
8724 + * processing.
8725 + * Ensures:
8726 + * (SUCCESS && hDPC is NULL) or DSP_EFAILED status
8727 + */
8728 + extern DSP_STATUS CDECL DPC_Destroy(IN struct DPC_OBJECT *hDPC);
8731 + * ======== DPC_Exit ========
8732 + * Purpose:
8733 + * Discontinue usage of the DPC module.
8734 + * Parameters:
8735 + * Returns:
8736 + * Requires:
8737 + * DPC_Init() was previously called.
8738 + * Ensures:
8739 + * Resources acquired in DPC_Init() are freed.
8740 + */
8741 + extern void CDECL DPC_Exit();
8744 + * ======== DPC_Init ========
8745 + * Purpose:
8746 + * Initialize the DPC module's private state.
8747 + * Parameters:
8748 + * Returns:
8749 + * TRUE if initialized; FALSE if error occured.
8750 + * Requires:
8751 + * Ensures:
8752 + * A requirement for each of the other public DPC functions.
8753 + */
8754 + extern bool CDECL DPC_Init();
8757 + * ======== DPC_Schedule ========
8758 + * Purpose:
8759 + * Schedule a deferred procedure call to be executed at a later time.
8760 + * Latency and order of DPC execution is platform specific.
8761 + * Parameters:
8762 + * hDPC: A DPC object handle created in DPC_Create().
8763 + * Returns:
8764 + * DSP_SOK: An event is scheduled for deferred processing.
8765 + * DSP_EHANDLE: Invalid hDPC.
8766 + * Requires:
8767 + * See requirements for DPC_PROC.
8768 + * Ensures:
8769 + * DSP_SOK: The DPC will not be called before this function returns.
8770 + */
8771 + extern DSP_STATUS CDECL DPC_Schedule(IN struct DPC_OBJECT *hDPC);
8773 +#endif /* DPC_ */
8774 Index: lk/arch/arm/plat-omap/include/bridge/drv.h
8775 ===================================================================
8776 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
8777 +++ lk/arch/arm/plat-omap/include/bridge/drv.h 2008-08-18 10:38:34.000000000 +0300
8778 @@ -0,0 +1,434 @@
8780 + * bridge/inc/drv.h
8782 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
8784 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
8786 + * This package is free software; you can redistribute it and/or modify
8787 + * it under the terms of the GNU General Public License version 2 as
8788 + * published by the Free Software Foundation.
8790 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8791 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8792 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8793 + */
8797 + * ======== drv.h ========
8798 + * Purpose:
8799 + * DRV Resource allocation module. Driver Object gets Created
8800 + * at the time of Loading. It holds the List of Device Objects
8801 + * in the Syste,
8803 + * Public Functions:
8804 + * DRV_Create
8805 + * DRV_Destroy
8806 + * DRV_Exit
8807 + * DRV_GetDevObject
8808 + * DRV_GetDevExtension
8809 + * DRV_GetFirstDevObject
8810 + * DRV_GetNextDevObject
8811 + * DRV_GetNextDevExtension
8812 + * DRV_Init
8813 + * DRV_InsertDevObject
8814 + * DRV_RemoveDevObject
8815 + * DRV_RequestResources
8816 + * DRV_ReleaseResources
8818 + *! Revision History
8819 + *! ================
8820 + *! 10-Feb-2004 vp: Added OMAP24xx specific definitions.
8821 + *! 14-Aug-2000 rr: Cleaned up.
8822 + *! 27-Jul-2000 rr: DRV_RequestResources split into two(Request and Release)
8823 + *! Device extension created to hold the DevNodeString.
8824 + *! 17-Jul-2000 rr: Driver Object holds the list of Device Objects.
8825 + *! Added DRV_Create, DRV_Destroy, DRV_GetDevObject,
8826 + *! DRV_GetFirst/NextDevObject, DRV_Insert/RemoveDevObject.
8827 + *! 12-Nov-1999 rr: New Flag defines for DRV_ASSIGN and DRV_RELEASE
8828 + *! 25-Oct-1999 rr: Resource Structure removed.
8829 + *! 15-Oct-1999 rr: New Resource structure created.
8830 + *! 05-Oct-1999 rr: Added DRV_RequestResources
8831 + *! Removed fxn'sDRV_RegisterMiniDriver(),
8832 + *! DRV_UnRegisterMiniDriver()
8833 + *! Removed Structures DSP_DRIVER & DRV_EXTENSION.
8834 + *!
8835 + *! 24-Sep-1999 rr: Added DRV_EXTENSION and DSP_DRIVER structures.
8836 + *!
8837 + */
8839 +#ifndef DRV_
8840 +#define DRV_
8842 +#include <devdefs.h>
8844 +#include <drvdefs.h>
8846 +#define DRV_ASSIGN 1
8847 +#define DRV_RELEASE 0
8849 +#ifdef CONFIG_ARCH_OMAP3430
8851 +/* Provide the DSP Internal memory windows that can be accessed from L3 address
8852 + * space */
8854 +#define OMAP_GEM_BASE 0x107F8000
8855 +#define OMAP_DSP_SIZE 0x00720000
8857 +/* MEM1 is L2 RAM + L2 Cache space */
8858 +#define OMAP_DSP_MEM1_BASE 0x5C7F8000
8859 +#define OMAP_DSP_MEM1_SIZE 0x18000
8860 +#define OMAP_DSP_GEM1_BASE 0x107F8000
8863 +/* MEM2 is L1P RAM/CACHE space */
8864 +#define OMAP_DSP_MEM2_BASE 0x5CE00000
8865 +#define OMAP_DSP_MEM2_SIZE 0x8000
8866 +#define OMAP_DSP_GEM2_BASE 0x10E00000
8868 +/* MEM3 is L1D RAM/CACHE space */
8869 +#define OMAP_DSP_MEM3_BASE 0x5CF04000
8870 +#define OMAP_DSP_MEM3_SIZE 0x14000
8871 +#define OMAP_DSP_GEM3_BASE 0x10F04000
8874 +#define OMAP_IVA2_PRM_BASE 0x48306000
8875 +#define OMAP_IVA2_PRM_SIZE 0x1000
8877 +#define OMAP_IVA2_CM_BASE 0x48004000
8878 +#define OMAP_IVA2_CM_SIZE 0x1000
8880 +#define OMAP_PER_CM_BASE 0x48005000
8881 +#define OMAP_PER_CM_SIZE 0x1000
8883 +#define OMAP_SYSC_BASE 0x48002000
8884 +#define OMAP_SYSC_SIZE 0x1000
8886 +#define OMAP_MBOX_BASE 0x48094000
8887 +#define OMAP_MBOX_SIZE 0x1000
8889 +#define OMAP_DMMU_BASE 0x5D000000
8890 +#define OMAP_DMMU_SIZE 0x1000
8892 +#define OMAP_PRCM_VDD1_DOMAIN 1
8893 +#define OMAP_PRCM_VDD2_DOMAIN 2
8895 +#endif
8897 +#ifndef RES_CLEANUP_DISABLE
8899 +/* GPP PROCESS CLEANUP Data structures */
8901 +/* New structure (member of process context) abstracts NODE resource info */
8902 +struct NODE_RES_OBJECT {
8903 + DSP_HNODE hNode;
8904 + s32 nodeAllocated; /* Node status */
8905 + s32 heapAllocated; /* Heap status */
8906 + s32 streamsAllocated; /* Streams status */
8907 + struct NODE_RES_OBJECT *next;
8908 +} ;
8910 +/* New structure (member of process context) abstracts DMM resource info */
8911 +struct DMM_RES_OBJECT {
8912 + s32 dmmAllocated; /* DMM status */
8913 + u32 ulMpuAddr;
8914 + u32 ulDSPAddr;
8915 + u32 ulDSPResAddr;
8916 + u32 dmmSize;
8917 + HANDLE hProcessor;
8918 + struct DMM_RES_OBJECT *next;
8919 +} ;
8921 +/* New structure (member of process context) abstracts DMM resource info */
8922 +struct DSPHEAP_RES_OBJECT {
8923 + s32 heapAllocated; /* DMM status */
8924 + u32 ulMpuAddr;
8925 + u32 ulDSPAddr;
8926 + u32 ulDSPResAddr;
8927 + u32 heapSize;
8928 + HANDLE hProcessor;
8929 + struct DSPHEAP_RES_OBJECT *next;
8930 +} ;
8932 +/* New structure (member of process context) abstracts stream resource info */
8933 +struct STRM_RES_OBJECT {
8934 + s32 streamAllocated; /* Stream status */
8935 + DSP_HSTREAM hStream;
8936 + u32 uNumBufs;
8937 + u32 uDir;
8938 + struct STRM_RES_OBJECT *next;
8939 +} ;
8941 +/* Overall Bridge process resource usage state */
8942 +enum GPP_PROC_RES_STATE {
8943 + PROC_RES_ALLOCATED,
8944 + PROC_RES_FREED
8945 +} ;
8947 +/* Process Context */
8948 +struct PROCESS_CONTEXT{
8949 + /* Process State */
8950 + enum GPP_PROC_RES_STATE resState;
8952 + /* Process ID (Same as UNIX process ID) */
8953 + u32 pid;
8955 + /* Pointer to next process context
8956 + * (To maintain a linked list of process contexts) */
8957 + struct PROCESS_CONTEXT *next;
8959 + /* Processor info to which the process is related */
8960 + DSP_HPROCESSOR hProcessor;
8962 + /* DSP Node resources */
8963 + struct NODE_RES_OBJECT *pNodeList;
8965 + /* DMM resources */
8966 + struct DMM_RES_OBJECT *pDMMList;
8968 + /* DSP Heap resources */
8969 + struct DSPHEAP_RES_OBJECT *pDSPHEAPList;
8971 + /* Stream resources */
8972 + struct STRM_RES_OBJECT *pSTRMList;
8973 +} ;
8974 +#endif
8977 + * ======== DRV_Create ========
8978 + * Purpose:
8979 + * Creates the Driver Object. This is done during the driver loading.
8980 + * There is only one Driver Object in the DSP/BIOS Bridge.
8981 + * Parameters:
8982 + * phDrvObject: Location to store created DRV Object handle.
8983 + * Returns:
8984 + * DSP_SOK: Sucess
8985 + * DSP_EMEMORY: Failed in Memory allocation
8986 + * DSP_EFAIL: General Failure
8987 + * Requires:
8988 + * DRV Initialized (cRefs > 0 )
8989 + * phDrvObject != NULL.
8990 + * Ensures:
8991 + * DSP_SOK: - *phDrvObject is a valid DRV interface to the device.
8992 + * - List of DevObject Created and Initialized.
8993 + * - List of DevNode String created and intialized.
8994 + * - Registry is updated with the DRV Object.
8995 + * !DSP_SOK: DRV Object not created
8996 + * Details:
8997 + * There is one Driver Object for the Driver representing
8998 + * the driver itself. It contains the list of device
8999 + * Objects and the list of Device Extensions in the system.
9000 + * Also it can hold other neccessary
9001 + * information in its storage area.
9002 + */
9003 + extern DSP_STATUS DRV_Create(struct DRV_OBJECT **phDrvObject);
9006 + * ======== DRV_Destroy ========
9007 + * Purpose:
9008 + * destroys the Dev Object list, DrvExt list
9009 + * and destroy the DRV object
9010 + * Called upon driver unLoading.or unsuccesful loading of the driver.
9011 + * Parameters:
9012 + * hDrvObject: Handle to Driver object .
9013 + * Returns:
9014 + * DSP_SOK: Success.
9015 + * DSP_EFAIL: Failed to destroy DRV Object
9016 + * Requires:
9017 + * DRV Initialized (cRegs > 0 )
9018 + * hDrvObject is not NULL and a valid DRV handle .
9019 + * List of DevObject is Empty.
9020 + * List of DrvExt is Empty
9021 + * Ensures:
9022 + * DSP_SOK: - DRV Object destroyed and hDrvObject is not a valid
9023 + * DRV handle.
9024 + * - Registry is updated with "0" as the DRV Object.
9025 + */
9026 + extern DSP_STATUS DRV_Destroy(struct DRV_OBJECT *hDrvObject);
9029 + * ======== DRV_Exit ========
9030 + * Purpose:
9031 + * Exit the DRV module, freeing any modules initialized in DRV_Init.
9032 + * Parameters:
9033 + * Returns:
9034 + * Requires:
9035 + * Ensures:
9036 + */
9037 + extern void DRV_Exit();
9040 + * ======== DRV_GetFirstDevObject ========
9041 + * Purpose:
9042 + * Returns the Ptr to the FirstDev Object in the List
9043 + * Parameters:
9044 + * Requires:
9045 + * DRV Initialized
9046 + * Returns:
9047 + * dwDevObject: Ptr to the First Dev Object as a u32
9048 + * 0 if it fails to retrieve the First Dev Object
9049 + * Ensures:
9050 + */
9051 + extern u32 DRV_GetFirstDevObject();
9054 + * ======== DRV_GetFirstDevExtension ========
9055 + * Purpose:
9056 + * Returns the Ptr to the First Device Extension in the List
9057 + * Parameters:
9058 + * Requires:
9059 + * DRV Initialized
9060 + * Returns:
9061 + * dwDevExtension: Ptr to the First Device Extension as a u32
9062 + * 0: Failed to Get the Device Extension
9063 + * Ensures:
9064 + */
9065 + extern u32 DRV_GetFirstDevExtension();
9068 + * ======== DRV_GetDevObject ========
9069 + * Purpose:
9070 + * Given a index, returns a handle to DevObject from the list
9071 + * Parameters:
9072 + * hDrvObject: Handle to the Manager
9073 + * phDevObject: Location to store the Dev Handle
9074 + * Requires:
9075 + * DRV Initialized
9076 + * uIndex >= 0
9077 + * hDrvObject is not NULL and Valid DRV Object
9078 + * phDevObject is not NULL
9079 + * Device Object List not Empty
9080 + * Returns:
9081 + * DSP_SOK: Success
9082 + * DSP_EFAIL: Failed to Get the Dev Object
9083 + * Ensures:
9084 + * DSP_SOK: *phDevObject != NULL
9085 + * DSP_EFAIL: *phDevObject = NULL
9086 + */
9087 + extern DSP_STATUS DRV_GetDevObject(u32 uIndex,
9088 + struct DRV_OBJECT *hDrvObject,
9089 + struct DEV_OBJECT **phDevObject);
9092 + * ======== DRV_GetNextDevObject ========
9093 + * Purpose:
9094 + * Returns the Ptr to the Next Device Object from the the List
9095 + * Parameters:
9096 + * hDevObject: Handle to the Device Object
9097 + * Requires:
9098 + * DRV Initialized
9099 + * hDevObject != 0
9100 + * Returns:
9101 + * dwDevObject: Ptr to the Next Dev Object as a u32
9102 + * 0: If it fail to get the next Dev Object.
9103 + * Ensures:
9104 + */
9105 + extern u32 DRV_GetNextDevObject(u32 hDevObject);
9108 + * ======== DRV_GetNextDevExtension ========
9109 + * Purpose:
9110 + * Returns the Ptr to the Next Device Extension from the the List
9111 + * Parameters:
9112 + * hDevExtension: Handle to the Device Extension
9113 + * Requires:
9114 + * DRV Initialized
9115 + * hDevExtension != 0.
9116 + * Returns:
9117 + * dwDevExtension: Ptr to the Next Dev Extension
9118 + * 0: If it fail to Get the next Dev Extension
9119 + * Ensures:
9120 + */
9121 + extern u32 DRV_GetNextDevExtension(u32 hDevExtension);
9124 + * ======== DRV_Init ========
9125 + * Purpose:
9126 + * Initialize the DRV module.
9127 + * Parameters:
9128 + * Returns:
9129 + * TRUE if success; FALSE otherwise.
9130 + * Requires:
9131 + * Ensures:
9132 + */
9133 + extern DSP_STATUS DRV_Init();
9136 + * ======== DRV_InsertDevObject ========
9137 + * Purpose:
9138 + * Insert a DeviceObject into the list of Driver object.
9139 + * Parameters:
9140 + * hDrvObject: Handle to DrvObject
9141 + * hDevObject: Handle to DeviceObject to insert.
9142 + * Returns:
9143 + * DSP_SOK: If successful.
9144 + * DSP_EFAIL: General Failure:
9145 + * Requires:
9146 + * hDrvObject != NULL and Valid DRV Handle.
9147 + * hDevObject != NULL.
9148 + * Ensures:
9149 + * DSP_SOK: Device Object is inserted and the List is not empty.
9150 + */
9151 + extern DSP_STATUS DRV_InsertDevObject(struct DRV_OBJECT *hDrvObject,
9152 + struct DEV_OBJECT *hDevObject);
9155 + * ======== DRV_RemoveDevObject ========
9156 + * Purpose:
9157 + * Search for and remove a Device object from the given list of Device Obj
9158 + * objects.
9159 + * Parameters:
9160 + * hDrvObject: Handle to DrvObject
9161 + * hDevObject: Handle to DevObject to Remove
9162 + * Returns:
9163 + * DSP_SOK: Success.
9164 + * DSP_EFAIL: Unable to find pDevObject.
9165 + * Requires:
9166 + * hDrvObject != NULL and a Valid DRV Handle.
9167 + * hDevObject != NULL.
9168 + * List exists and is not empty.
9169 + * Ensures:
9170 + * List either does not exist (NULL), or is not empty if it does exist.
9172 + extern DSP_STATUS DRV_RemoveDevObject(struct DRV_OBJECT *hDrvObject,
9173 + struct DEV_OBJECT *hDevObject);
9176 + * ======== DRV_RequestResources ========
9177 + * Purpose:
9178 + * Assigns the Resources or Releases them.
9179 + * Parameters:
9180 + * dwContext: Path to the driver Registry Key.
9181 + * pDevNodeString: Ptr to DevNode String stored in the Device Ext.
9182 + * Returns:
9183 + * TRUE if success; FALSE otherwise.
9184 + * Requires:
9185 + * Ensures:
9186 + * The Resources are assigned based on Bus type.
9187 + * The hardware is initialized. Resource information is
9188 + * gathered from the Registry(ISA, PCMCIA)or scanned(PCI)
9189 + * Resource structure is stored in the registry which will be
9190 + * later used by the CFG module.
9191 + */
9192 + extern DSP_STATUS DRV_RequestResources(IN u32 dwContext,
9193 + OUT u32 *pDevNodeString);
9196 + * ======== DRV_ReleaseResources ========
9197 + * Purpose:
9198 + * Assigns the Resources or Releases them.
9199 + * Parameters:
9200 + * dwContext: Path to the driver Registry Key.
9201 + * hDrvObject: Handle to the Driver Object.
9202 + * Returns:
9203 + * TRUE if success; FALSE otherwise.
9204 + * Requires:
9205 + * Ensures:
9206 + * The Resources are released based on Bus type.
9207 + * Resource structure is deleted from the registry
9208 + */
9209 + extern DSP_STATUS DRV_ReleaseResources(IN u32 dwContext,
9210 + struct DRV_OBJECT *hDrvObject);
9212 +#endif /* DRV_ */
9213 Index: lk/arch/arm/plat-omap/include/bridge/drvdefs.h
9214 ===================================================================
9215 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
9216 +++ lk/arch/arm/plat-omap/include/bridge/drvdefs.h 2008-08-18 10:38:34.000000000 +0300
9217 @@ -0,0 +1,34 @@
9219 + * bridge/inc/drvdefs.h
9221 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
9223 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
9225 + * This package is free software; you can redistribute it and/or modify
9226 + * it under the terms of the GNU General Public License version 2 as
9227 + * published by the Free Software Foundation.
9229 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9230 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
9231 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
9232 + */
9236 + * ======== drvdefs.h ========
9237 + * Purpose:
9238 + * Definition of common include typedef between wmd.h and drv.h.
9240 + *! Revision History:
9241 + *! ================
9242 + *! 17-Jul-2000 rr: Created
9243 + */
9245 +#ifndef DRVDEFS_
9246 +#define DRVDEFS_
9248 +/* WCD Driver Object */
9249 + struct DRV_OBJECT;
9251 +#endif /* DRVDEFS_ */
9252 Index: lk/arch/arm/plat-omap/include/bridge/dspapi.h
9253 ===================================================================
9254 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
9255 +++ lk/arch/arm/plat-omap/include/bridge/dspapi.h 2008-08-18 10:38:34.000000000 +0300
9256 @@ -0,0 +1,50 @@
9258 + * bridge/inc/dspapi.h
9260 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
9262 + * Copyright (C) 2008 Texas Instruments, Inc.
9264 + * This package is free software; you can redistribute it and/or modify
9265 + * it under the terms of the GNU General Public License version 2 as
9266 + * published by the Free Software Foundation.
9268 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9269 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
9270 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
9271 + */
9275 + * ======== dspapi.h ========
9276 + * Purpose:
9277 + * Defines function type modifiers used in all DSPSYS public header
9278 + * files.
9280 + * Notes:
9281 + * Provides __stdcall (required by VB 4.0) and __declspec(dllimport)
9282 + * function modifiers for fast dyna-linking.
9284 + *! Revision History:
9285 + *! =================
9286 + *! 23-Dec-1997 cr: Added WBKERNEL_API definition.
9287 + *! 11-Oct-1996 gp: Created.
9288 + */
9290 +#ifndef DSPAPI_
9291 +#define DSPAPI_
9293 +/* Define API decoration for direct importing of DLL references. */
9294 +#if !defined(_DSPSYSDLL32_)
9295 +#define DSPAPIDLL __declspec(dllimport)
9296 +#else
9297 +#define DSPAPIDLL
9298 +#endif
9300 +/* Full export modifier: */
9301 +#define DSPAPI DSPAPIDLL DSP_STATUS WINAPI
9303 +/* Explicitly define class driver calling conventions */
9304 +#define WBKERNEL_API CDECL
9306 +#endif /* DSPAPI_ */
9307 Index: lk/arch/arm/plat-omap/include/bridge/dspdrv.h
9308 ===================================================================
9309 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
9310 +++ lk/arch/arm/plat-omap/include/bridge/dspdrv.h 2008-08-18 10:38:34.000000000 +0300
9311 @@ -0,0 +1,106 @@
9313 + * bridge/inc/dspdrv.h
9315 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
9317 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
9319 + * This package is free software; you can redistribute it and/or modify
9320 + * it under the terms of the GNU General Public License version 2 as
9321 + * published by the Free Software Foundation.
9323 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9324 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
9325 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
9326 + */
9330 + * ======== dspdrv.h ========
9331 + * Purpose:
9332 + * This is the Stream Interface for the DDSP Class driver.
9333 + * All Device operations are performed via DeviceIOControl.
9334 + * Read, Seek and Write not used.
9336 + * Public Functions
9337 + * DSP_Close
9338 + * DSP_Deinit
9339 + * DSP_Init
9340 + * DSP_IOControl
9341 + * DSP_Open
9342 + * DSP_PowerUp
9343 + * DSP_PowerDown
9345 + *! Revision History
9346 + *! ================
9347 + *! 28-Jan-2000 rr: Type void changed to Void.
9348 + *! 02-Dec-1999 rr: MAX_DEV define moved from wcdce.c file.Code cleaned up.
9349 + *! 12-Nov-1999 rr: "#include<wncnxerr.h> removed.
9350 + *! 05-Oct-1999 rr Renamed the file name to wcdce.h Removed Bus Specific
9351 + *! code and #defines to PCCARD.h.
9352 + *! 24-Sep-1999 rr Changed the DSP_COMMON_WINDOW_SIZE to 0x4000(16k) for the
9353 + *! Memory windows.
9354 + *! 16-Jul-1999 ag Adapted from rkw's CAC Bullet driver.
9355 + *!
9356 + */
9358 +#if !defined __DSPDRV_h__
9359 +#define __DSPDRV_h__
9361 +#define MAX_DEV 10 /* Max support of 10 devices */
9364 + * ======== DSP_Close ========
9365 + * Purpose:
9366 + * Called when the client application/driver unloads the DDSP DLL. Upon
9367 + * unloading, the DDSP DLL will call CloseFile().
9368 + * Parameters:
9369 + * dwDeviceContext: Handle returned by XXX_Open used to identify
9370 + * the open context of the device
9371 + * Returns:
9372 + * TRUE indicates the device is successfully closed. FALSE indicates
9373 + * otherwise.
9374 + * Requires:
9375 + * dwOpenContext!= NULL.
9376 + * Ensures:The Application instance owned objects are cleaned up.
9377 + */
9378 +extern bool DSP_Close(u32 dwDeviceContext);
9381 + * ======== DSP_Deinit ========
9382 + * Purpose:
9383 + * This function is called by Device Manager to de-initialize a device.
9384 + * This function is not called by applications.
9385 + * Parameters:
9386 + * dwDeviceContext:Handle to the device context. The XXX_Init function
9387 + * creates and returns this identifier.
9388 + * Returns:
9389 + * TRUE indicates the device successfully de-initialized. Otherwise it
9390 + * returns FALSE.
9391 + * Requires:
9392 + * dwDeviceContext!= NULL. For a built in device this should never
9393 + * get called.
9394 + * Ensures:
9395 + */
9396 +extern bool DSP_Deinit(u32 dwDeviceContext);
9399 + * ======== DSP_Init ========
9400 + * Purpose:
9401 + * This function is called by Device Manager to initialize a device.
9402 + * This function is not called by applications
9403 + * Parameters:
9404 + * dwContext: Specifies a pointer to a string containing the registry
9405 + * path to the active key for the stream interface driver.
9406 + * HKEY_LOCAL_MACHINE\Drivers\Active
9407 + * Returns:
9408 + * Returns a handle to the device context created. This is the our actual
9409 + * Device Object representing the DSP Device instance.
9410 + * Requires:
9411 + * Ensures:
9412 + * Succeeded: device context > 0
9413 + * Failed: device Context = 0
9414 + */
9415 +extern u32 DSP_Init(OUT u32 *initStatus);
9417 +#endif
9418 Index: lk/arch/arm/plat-omap/include/bridge/dynamic_loader.h
9419 ===================================================================
9420 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
9421 +++ lk/arch/arm/plat-omap/include/bridge/dynamic_loader.h 2008-08-18 10:38:34.000000000 +0300
9422 @@ -0,0 +1,505 @@
9424 + * bridge/inc/dynamic_loader.h
9426 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
9428 + * Copyright (C) 2008 Texas Instruments, Inc.
9430 + * This package is free software; you can redistribute it and/or modify
9431 + * it under the terms of the GNU General Public License version 2 as
9432 + * published by the Free Software Foundation.
9434 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9435 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
9436 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
9437 + */
9441 +#ifndef _DYNAMIC_LOADER_H_
9442 +#define _DYNAMIC_LOADER_H_
9443 +#include <linux/kernel.h>
9444 +#include <linux/types.h>
9447 + * Dynamic Loader
9449 + * The function of the dynamic loader is to load a "module" containing
9450 + * instructions for a "target" processor into that processor. In the process
9451 + * it assigns memory for the module, resolves symbol references made by the
9452 + * module, and remembers symbols defined by the module.
9454 + * The dynamic loader is parameterized for a particular system by 4 classes
9455 + * that supply the module and system specific functions it requires
9456 + */
9457 + /* The read functions for the module image to be loaded */
9458 + struct Dynamic_Loader_Stream;
9460 + /* This class defines "host" symbol and support functions */
9461 + struct Dynamic_Loader_Sym;
9463 + /* This class defines the allocator for "target" memory */
9464 + struct Dynamic_Loader_Allocate;
9466 + /* This class defines the copy-into-target-memory functions */
9467 + struct Dynamic_Loader_Initialize;
9470 + * Option flags to modify the behavior of module loading
9471 + */
9472 +#define DLOAD_INITBSS 0x1 /* initialize BSS sections to zero */
9473 +#define DLOAD_BIGEND 0x2 /* require big-endian load module */
9474 +#define DLOAD_LITTLE 0x4 /* require little-endian load module */
9476 + typedef void *DLOAD_mhandle; /* module handle for loaded modules */
9478 +/*****************************************************************************
9479 + * Procedure Dynamic_Load_Module
9481 + * Parameters:
9482 + * module The input stream that supplies the module image
9483 + * syms Host-side symbol table and malloc/free functions
9484 + * alloc Target-side memory allocation
9485 + * init Target-side memory initialization, or NULL for symbol read only
9486 + * options Option flags DLOAD_*
9487 + * mhandle A module handle for use with Dynamic_Unload
9489 + * Effect:
9490 + * The module image is read using *module. Target storage for the new image is
9491 + * obtained from *alloc. Symbols defined and referenced by the module are
9492 + * managed using *syms. The image is then relocated and references resolved
9493 + * as necessary, and the resulting executable bits are placed into target memory
9494 + * using *init.
9496 + * Returns:
9497 + * On a successful load, a module handle is placed in *mhandle, and zero is
9498 + * returned. On error, the number of errors detected is returned. Individual
9499 + * errors are reported during the load process using syms->Error_Report().
9500 + *****************************************************************************/
9501 + extern int Dynamic_Load_Module(
9502 + /* the source for the module image*/
9503 + struct Dynamic_Loader_Stream *module,
9504 + /* host support for symbols and storage*/
9505 + struct Dynamic_Loader_Sym *syms,
9506 + /* the target memory allocator*/
9507 + struct Dynamic_Loader_Allocate *alloc,
9508 + /* the target memory initializer*/
9509 + struct Dynamic_Loader_Initialize *init,
9510 + unsigned options, /* option flags*/
9511 + /* the returned module handle*/
9512 + DLOAD_mhandle *mhandle
9513 + );
9515 +/*****************************************************************************
9516 + * Procedure Dynamic_Open_Module
9518 + * Parameters:
9519 + * module The input stream that supplies the module image
9520 + * syms Host-side symbol table and malloc/free functions
9521 + * alloc Target-side memory allocation
9522 + * init Target-side memory initialization, or NULL for symbol read only
9523 + * options Option flags DLOAD_*
9524 + * mhandle A module handle for use with Dynamic_Unload
9526 + * Effect:
9527 + * The module image is read using *module. Target storage for the new image is
9528 + * obtained from *alloc. Symbols defined and referenced by the module are
9529 + * managed using *syms. The image is then relocated and references resolved
9530 + * as necessary, and the resulting executable bits are placed into target memory
9531 + * using *init.
9533 + * Returns:
9534 + * On a successful load, a module handle is placed in *mhandle, and zero is
9535 + * returned. On error, the number of errors detected is returned. Individual
9536 + * errors are reported during the load process using syms->Error_Report().
9537 + *****************************************************************************/
9538 + extern int Dynamic_Open_Module(
9539 + /* the source for the module image */
9540 + struct Dynamic_Loader_Stream *module,
9541 + /* host support for symbols and storage */
9542 + struct Dynamic_Loader_Sym *syms,
9543 + /* the target memory allocator */
9544 + struct Dynamic_Loader_Allocate *alloc,
9545 + /* the target memory initializer */
9546 + struct Dynamic_Loader_Initialize *init,
9547 + unsigned options, /* option flags */
9548 + /* the returned module handle */
9549 + DLOAD_mhandle *mhandle
9550 + );
9552 +/*****************************************************************************
9553 + * Procedure Dynamic_Unload_Module
9555 + * Parameters:
9556 + * mhandle A module handle from Dynamic_Load_Module
9557 + * syms Host-side symbol table and malloc/free functions
9558 + * alloc Target-side memory allocation
9560 + * Effect:
9561 + * The module specified by mhandle is unloaded. Unloading causes all
9562 + * target memory to be deallocated, all symbols defined by the module to
9563 + * be purged, and any host-side storage used by the dynamic loader for
9564 + * this module to be released.
9566 + * Returns:
9567 + * Zero for success. On error, the number of errors detected is returned.
9568 + * Individual errors are reported using syms->Error_Report().
9569 + *****************************************************************************/
9570 + extern int Dynamic_Unload_Module(DLOAD_mhandle mhandle, /* the module
9571 + * handle*/
9572 + /* host support for symbols and
9573 + * storage */
9574 + struct Dynamic_Loader_Sym *syms,
9575 + /* the target memory allocator*/
9576 + struct Dynamic_Loader_Allocate *alloc,
9577 + /* the target memory initializer*/
9578 + struct Dynamic_Loader_Initialize *init
9579 + );
9581 +/*****************************************************************************
9582 + *****************************************************************************
9583 + * A class used by the dynamic loader for input of the module image
9584 + *****************************************************************************
9585 + *****************************************************************************/
9586 + struct Dynamic_Loader_Stream {
9587 +/* public: */
9588 + /*************************************************************************
9589 + * read_buffer
9591 + * PARAMETERS :
9592 + * buffer Pointer to the buffer to fill
9593 + * bufsiz Amount of data desired in sizeof() units
9595 + * EFFECT :
9596 + * Reads the specified amount of data from the module input stream
9597 + * into the specified buffer. Returns the amount of data read in sizeof()
9598 + * units (which if less than the specification, represents an error).
9600 + * NOTES:
9601 + * In release 1 increments the file position by the number of bytes read
9603 + *************************************************************************/
9604 + int (*read_buffer) (struct Dynamic_Loader_Stream *thisptr,
9605 + void *buffer, unsigned bufsiz);
9607 + /*************************************************************************
9608 + * set_file_posn (release 1 only)
9610 + * PARAMETERS :
9611 + * posn Desired file position relative to start of file in sizeof() units.
9613 + * EFFECT :
9614 + * Adjusts the internal state of the stream object so that the next
9615 + * read_buffer call will begin to read at the specified offset from
9616 + * the beginning of the input module. Returns 0 for success, non-zero
9617 + * for failure.
9619 + *************************************************************************/
9620 + int (*set_file_posn) (struct Dynamic_Loader_Stream *thisptr,
9621 + /* to be eliminated in release 2*/
9622 + unsigned int posn);
9624 + };
9626 +/*****************************************************************************
9627 + *****************************************************************************
9628 + * A class used by the dynamic loader for symbol table support and
9629 + * miscellaneous host-side functions
9630 + *****************************************************************************
9631 + *****************************************************************************/
9633 + typedef u32 LDR_ADDR;
9636 + * the structure of a symbol known to the dynamic loader
9637 + */
9638 + struct dynload_symbol {
9639 + LDR_ADDR value;
9640 + } ;
9642 + struct Dynamic_Loader_Sym {
9643 +/* public: */
9644 + /*************************************************************************
9645 + * Find_Matching_Symbol
9647 + * PARAMETERS :
9648 + * name The name of the desired symbol
9650 + * EFFECT :
9651 + * Locates a symbol matching the name specified. A pointer to the
9652 + * symbol is returned if it exists; 0 is returned if no such symbol is
9653 + * found.
9655 + *************************************************************************/
9656 + struct dynload_symbol *(*Find_Matching_Symbol)
9657 + (struct Dynamic_Loader_Sym *
9658 + thisptr,
9659 + const char *name);
9661 + /*************************************************************************
9662 + * Add_To_Symbol_Table
9664 + * PARAMETERS :
9665 + * nname Pointer to the name of the new symbol
9666 + * moduleid An opaque module id assigned by the dynamic loader
9668 + * EFFECT :
9669 + * The new symbol is added to the table. A pointer to the symbol is
9670 + * returned, or NULL is returned for failure.
9672 + * NOTES:
9673 + * It is permissible for this function to return NULL; the effect is that
9674 + * the named symbol will not be available to resolve references in
9675 + * subsequent loads. Returning NULL will not cause the current load
9676 + * to fail.
9677 + *************************************************************************/
9678 + struct dynload_symbol *(*Add_To_Symbol_Table)
9679 + (struct Dynamic_Loader_Sym *
9680 + thisptr,
9681 + const char *nname,
9682 + unsigned moduleid);
9684 + /*************************************************************************
9685 + * Purge_Symbol_Table
9687 + * PARAMETERS :
9688 + * moduleid An opaque module id assigned by the dynamic loader
9690 + * EFFECT :
9691 + * Each symbol in the symbol table whose moduleid matches the argument
9692 + * is removed from the table.
9693 + *************************************************************************/
9694 + void (*Purge_Symbol_Table) (struct Dynamic_Loader_Sym *thisptr,
9695 + unsigned moduleid);
9697 + /*************************************************************************
9698 + * Allocate
9700 + * PARAMETERS :
9701 + * memsiz size of desired memory in sizeof() units
9703 + * EFFECT :
9704 + * Returns a pointer to some "host" memory for use by the dynamic
9705 + * loader, or NULL for failure.
9706 + * This function is serves as a replaceable form of "malloc" to
9707 + * allow the user to configure the memory usage of the dynamic loader.
9708 + *************************************************************************/
9709 + void *(*Allocate) (struct Dynamic_Loader_Sym *thisptr,
9710 + unsigned memsiz);
9712 + /*************************************************************************
9713 + * Deallocate
9715 + * PARAMETERS :
9716 + * memptr pointer to previously allocated memory
9718 + * EFFECT :
9719 + * Releases the previously allocated "host" memory.
9720 + *************************************************************************/
9721 + void (*Deallocate) (struct Dynamic_Loader_Sym *thisptr,
9722 + void *memptr);
9724 + /*************************************************************************
9725 + * Error_Report
9727 + * PARAMETERS :
9728 + * errstr pointer to an error string
9729 + * args additional arguments
9731 + * EFFECT :
9732 + * This function provides an error reporting interface for the dynamic
9733 + * loader. The error string and arguments are designed as for the
9734 + * library function vprintf.
9735 + *************************************************************************/
9736 + void (*Error_Report) (struct Dynamic_Loader_Sym *thisptr,
9737 + const char *errstr, va_list args);
9739 + }; /* class Dynamic_Loader_Sym */
9741 +/*****************************************************************************
9742 + *****************************************************************************
9743 + * A class used by the dynamic loader to allocate and deallocate target memory.
9744 + *****************************************************************************
9745 + *****************************************************************************/
9747 + struct LDR_SECTION_INFO {
9748 + /* Name of the memory section assigned at build time */
9749 + const char *name;
9750 + LDR_ADDR run_addr; /* execution address of the section */
9751 + LDR_ADDR load_addr; /* load address of the section */
9752 + LDR_ADDR size; /* size of the section in addressable units */
9753 +#ifndef _BIG_ENDIAN
9754 + u16 page; /* memory page or view */
9755 + u16 type; /* one of the section types below */
9756 +#else
9757 + u16 type; /* one of the section types below */
9758 + u16 page; /* memory page or view */
9759 +#endif
9760 + /* a context field for use by Dynamic_Loader_Allocate;
9761 + * ignored but maintained by the dynamic loader */
9762 + u32 context;
9763 + } ;
9765 +/* use this macro to extract type of section from LDR_SECTION_INFO.type field */
9766 +#define DLOAD_SECTION_TYPE(typeinfo) (typeinfo & 0xF)
9768 +/* type of section to be allocated */
9769 +#define DLOAD_TEXT 0
9770 +#define DLOAD_DATA 1
9771 +#define DLOAD_BSS 2
9772 + /* internal use only, run-time cinit will be of type DLOAD_DATA */
9773 +#define DLOAD_CINIT 3
9775 + struct Dynamic_Loader_Allocate {
9776 +/* public: */
9778 + /*************************************************************************
9779 + * Function allocate
9781 + * Parameters:
9782 + * info A pointer to an information block for the section
9783 + * align The alignment of the storage in target AUs
9785 + * Effect:
9786 + * Allocates target memory for the specified section and fills in the
9787 + * load_addr and run_addr fields of the section info structure. Returns TRUE
9788 + * for success, FALSE for failure.
9790 + * Notes:
9791 + * Frequently load_addr and run_addr are the same, but if they are not
9792 + * load_addr is used with Dynamic_Loader_Initialize, and run_addr is
9793 + * used for almost all relocations. This function should always initialize
9794 + * both fields.
9795 + *************************************************************************/
9796 + int (*Allocate) (struct Dynamic_Loader_Allocate *thisptr,
9797 + struct LDR_SECTION_INFO *info, unsigned align);
9799 + /*************************************************************************
9800 + * Function deallocate
9802 + * Parameters:
9803 + * info A pointer to an information block for the section
9805 + * Effect:
9806 + * Releases the target memory previously allocated.
9808 + * Notes:
9809 + * The content of the info->name field is undefined on call to this function.
9810 + *************************************************************************/
9811 + void (*Deallocate) (struct Dynamic_Loader_Allocate *thisptr,
9812 + struct LDR_SECTION_INFO *info);
9814 + }; /* class Dynamic_Loader_Allocate */
9816 +/*****************************************************************************
9817 + *****************************************************************************
9818 + * A class used by the dynamic loader to load data into a target. This class
9819 + * provides the interface-specific functions needed to load data.
9820 + *****************************************************************************
9821 + *****************************************************************************/
9823 + struct Dynamic_Loader_Initialize {
9824 +/* public: */
9825 + /*************************************************************************
9826 + * Function connect
9828 + * Parameters:
9829 + * none
9831 + * Effect:
9832 + * Connect to the initialization interface. Returns TRUE for success,
9833 + * FALSE for failure.
9835 + * Notes:
9836 + * This function is called prior to use of any other functions in
9837 + * this interface.
9838 + *************************************************************************/
9839 + int (*connect) (struct Dynamic_Loader_Initialize *thisptr);
9841 + /*************************************************************************
9842 + * Function readmem
9844 + * Parameters:
9845 + * bufr Pointer to a word-aligned buffer for the result
9846 + * locn Target address of first data element
9847 + * info Section info for the section in which the address resides
9848 + * bytsiz Size of the data to be read in sizeof() units
9850 + * Effect:
9851 + * Fills the specified buffer with data from the target. Returns TRUE for
9852 + * success, FALSE for failure.
9853 + *************************************************************************/
9854 + int (*readmem) (struct Dynamic_Loader_Initialize *thisptr,
9855 + void *bufr,
9856 + LDR_ADDR locn,
9857 + struct LDR_SECTION_INFO *info,
9858 + unsigned bytsiz);
9860 + /*************************************************************************
9861 + * Function writemem
9863 + * Parameters:
9864 + * bufr Pointer to a word-aligned buffer of data
9865 + * locn Target address of first data element to be written
9866 + * info Section info for the section in which the address resides
9867 + * bytsiz Size of the data to be written in sizeof() units
9869 + * Effect:
9870 + * Writes the specified buffer to the target. Returns TRUE for success,
9871 + * FALSE for failure.
9872 + *************************************************************************/
9873 + int (*writemem) (struct Dynamic_Loader_Initialize *thisptr,
9874 + void *bufr,
9875 + LDR_ADDR locn,
9876 + struct LDR_SECTION_INFO *info,
9877 + unsigned bytsiz);
9879 + /*************************************************************************
9880 + * Function fillmem
9882 + * Parameters:
9883 + * locn Target address of first data element to be written
9884 + * info Section info for the section in which the address resides
9885 + * bytsiz Size of the data to be written in sizeof() units
9886 + * val Value to be written in each byte
9887 + * Effect:
9888 + * Fills the specified area of target memory. Returns TRUE for success,
9889 + * FALSE for failure.
9890 + *************************************************************************/
9891 + int (*fillmem) (struct Dynamic_Loader_Initialize *thisptr,
9892 + LDR_ADDR locn, struct LDR_SECTION_INFO *info,
9893 + unsigned bytsiz, unsigned val);
9895 + /*************************************************************************
9896 + * Function execute
9898 + * Parameters:
9899 + * start Starting address
9901 + * Effect:
9902 + * The target code at the specified starting address is executed.
9904 + * Notes:
9905 + * This function is called at the end of the dynamic load process
9906 + * if the input module has specified a starting address.
9907 + *************************************************************************/
9908 + int (*execute) (struct Dynamic_Loader_Initialize *thisptr,
9909 + LDR_ADDR start);
9911 + /*************************************************************************
9912 + * Function release
9914 + * Parameters:
9915 + * none
9917 + * Effect:
9918 + * Releases the connection to the load interface.
9920 + * Notes:
9921 + * This function is called at the end of the dynamic load process.
9922 + *************************************************************************/
9923 + void (*release) (struct Dynamic_Loader_Initialize *thisptr);
9925 + }; /* class Dynamic_Loader_Initialize */
9927 +#endif /* _DYNAMIC_LOADER_H_ */
9928 Index: lk/arch/arm/plat-omap/include/bridge/errbase.h
9929 ===================================================================
9930 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
9931 +++ lk/arch/arm/plat-omap/include/bridge/errbase.h 2008-08-18 10:38:34.000000000 +0300
9932 @@ -0,0 +1,509 @@
9934 + * bridge/inc/errbase.h
9936 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
9938 + * Copyright (C) 2008 Texas Instruments, Inc.
9940 + * This package is free software; you can redistribute it and/or modify
9941 + * it under the terms of the GNU General Public License version 2 as
9942 + * published by the Free Software Foundation.
9944 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9945 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
9946 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
9947 + */
9950 + * ======== errbase.h ========
9951 + * Description:
9952 + * Central repository for DSP/BIOS Bridge error and status code.
9954 + * Error codes are of the form:
9955 + * [<MODULE>]_E<ERRORCODE>
9957 + * Success codes are of the form:
9958 + * [<MODULE>]_S<SUCCESSCODE>
9960 + *! Revision History:
9961 + *! ================
9962 + *! 24-Jan-2003 map Added DSP_SALREADYLOADED for persistent library checking
9963 + *! 23-Nov-2002 gp: Minor comment cleanup.
9964 + *! 13-May-2002 sg Added DSP_SALREADYASLEEP and DSP_SALREADYWAKE.
9965 + *! 18-Feb-2002 mk: Added DSP_EOVERLAYMEMORY, EFWRITE, ENOSECT.
9966 + *! 31-Jan-2002 mk: Added definitions of DSP_STRUE and DSP_SFALSE.
9967 + *! 29-Jan-2002 mk: Added definition of CFG_E_INSUFFICIENTBUFSIZE.
9968 + *! 24-Oct-2001 sp: Consolidated all the error codes into this file.
9969 + *! 24-Jul-2001 mk: Type-casted all definitions of WSX_STATUS types for
9970 + *! removal of compile warnings.
9971 + *! 22-Nov-1999 kc: Changes from code review.
9972 + *! 18-Aug-1999 rr: Ported From WSX.
9973 + *! 29-May-1996 gp: Removed WCD_ and WMD_ error ranges. Redefined format of
9974 + *! error codes.
9975 + *! 10-May-1996 gp: Created.
9976 + */
9978 +#ifndef ERRBASE_
9979 +#define ERRBASE_
9981 +/* Base of generic errors and component errors */
9982 +#define DSP_SBASE (DSP_STATUS)0x00008000
9983 +#define DSP_EBASE (DSP_STATUS)0x80008000
9985 +#define DSP_COMP_EBASE (DSP_STATUS)0x80040200
9986 +#define DSP_COMP_ELAST (DSP_STATUS)0x80047fff
9988 +/* SUCCESS Codes */
9990 +/* Generic success code */
9991 +#define DSP_SOK (DSP_SBASE + 0)
9993 +/* GPP is already attached to this DSP processor */
9994 +#define DSP_SALREADYATTACHED (DSP_SBASE + 1)
9996 +/* This is the last object available for enumeration. */
9997 +#define DSP_SENUMCOMPLETE (DSP_SBASE + 2)
9999 +/* The DSP is already asleep. */
10000 +#define DSP_SALREADYASLEEP (DSP_SBASE + 3)
10002 +/* The DSP is already awake. */
10003 +#define DSP_SALREADYAWAKE (DSP_SBASE + 4)
10005 +/* TRUE */
10006 +#define DSP_STRUE (DSP_SBASE + 5)
10008 +/* FALSE */
10009 +#define DSP_SFALSE (DSP_SBASE + 6)
10011 +/* A library contains no dependent library references */
10012 +#define DSP_SNODEPENDENTLIBS (DSP_SBASE + 7)
10014 +/* A persistent library is already loaded by the dynamic loader */
10015 +#define DSP_SALREADYLOADED (DSP_SBASE + 8)
10017 +/* Some error occured, but it is OK to continue */
10018 +#define DSP_OKTO_CONTINUE (DSP_SBASE + 9)
10020 +/* FAILURE Codes */
10022 +/* The caller does not have access privileges to call this function */
10023 +#define DSP_EACCESSDENIED (DSP_EBASE + 0)
10025 +/* The Specified Connection already exists */
10026 +#define DSP_EALREADYCONNECTED (DSP_EBASE + 1)
10028 +/* The GPP must be detached from the DSP before this function is called */
10029 +#define DSP_EATTACHED (DSP_EBASE + 2)
10031 +/* During enumeration a change in the number or properties of the objects
10032 + * has occurred. */
10033 +#define DSP_ECHANGEDURINGENUM (DSP_EBASE + 3)
10035 +/* An error occurred while parsing the DSP executable file */
10036 +#define DSP_ECORRUPTFILE (DSP_EBASE + 4)
10038 +/* A failure occurred during a delete operation */
10039 +#define DSP_EDELETE (DSP_EBASE + 5)
10041 +/* The specified direction is invalid */
10042 +#define DSP_EDIRECTION (DSP_EBASE + 6)
10044 +/* A stream has been issued the maximum number of buffers allowed in the
10045 + * stream at once ; buffers must be reclaimed from the stream before any
10046 + * more can be issued. */
10047 +#define DSP_ESTREAMFULL (DSP_EBASE + 7)
10049 +/* A general failure occurred */
10050 +#define DSP_EFAIL (DSP_EBASE + 8)
10052 +/* The specified executable file could not be found. */
10053 +#define DSP_EFILE (DSP_EBASE + 9)
10055 +/* The specified handle is invalid. */
10056 +#define DSP_EHANDLE (DSP_EBASE + 0xa)
10058 +/* An invalid argument was specified. */
10059 +#define DSP_EINVALIDARG (DSP_EBASE + 0xb)
10061 +/* A memory allocation failure occurred. */
10062 +#define DSP_EMEMORY (DSP_EBASE + 0xc)
10064 +/* The requested operation is invalid for this node type. */
10065 +#define DSP_ENODETYPE (DSP_EBASE + 0xd)
10067 +/* No error text was found for the specified error code. */
10068 +#define DSP_ENOERRTEXT (DSP_EBASE + 0xe)
10070 +/* No more connections can be made for this node. */
10071 +#define DSP_ENOMORECONNECTIONS (DSP_EBASE + 0xf)
10073 +/* The indicated operation is not supported. */
10074 +#define DSP_ENOTIMPL (DSP_EBASE + 0x10)
10076 +/* I/O is currently pending. */
10077 +#define DSP_EPENDING (DSP_EBASE + 0x11)
10079 +/* An invalid pointer was specified. */
10080 +#define DSP_EPOINTER (DSP_EBASE + 0x12)
10082 +/* A parameter is specified outside its valid range. */
10083 +#define DSP_ERANGE (DSP_EBASE + 0x13)
10085 +/* An invalid size parameter was specified. */
10086 +#define DSP_ESIZE (DSP_EBASE + 0x14)
10088 +/* A stream creation failure occurred on the DSP. */
10089 +#define DSP_ESTREAM (DSP_EBASE + 0x15)
10091 +/* A task creation failure occurred on the DSP. */
10092 +#define DSP_ETASK (DSP_EBASE + 0x16)
10094 +/* A timeout occurred before the requested operation could complete. */
10096 +#define DSP_ETIMEOUT (DSP_EBASE + 0x17)
10098 +/* A data truncation occurred, e.g., when requesting a descriptive error
10099 + * string, not enough space was allocated for the complete error message. */
10101 +#define DSP_ETRUNCATED (DSP_EBASE + 0x18)
10103 +/* A parameter is invalid. */
10104 +#define DSP_EVALUE (DSP_EBASE + 0x1a)
10106 +/* The state of the specified object is incorrect for the requested
10107 + * operation. */
10108 +#define DSP_EWRONGSTATE (DSP_EBASE + 0x1b)
10110 +/* Symbol not found in the COFF file. DSPNode_Create will return this if
10111 + * the iAlg function table for an xDAIS socket is not found in the COFF file.
10112 + * In this case, force the symbol to be linked into the COFF file.
10113 + * DSPNode_Create, DSPNode_Execute, and DSPNode_Delete will return this if
10114 + * the create, execute, or delete phase function, respectively, could not be
10115 + * found in the COFF file. */
10116 +#define DSP_ESYMBOL (DSP_EBASE + 0x1c)
10118 +/* UUID not found in registry. */
10119 +#define DSP_EUUID (DSP_EBASE + 0x1d)
10121 +/* Unable to read content of DCD data section ; this is typically caused by
10122 + * improperly configured nodes. */
10123 +#define DSP_EDCDREADSECT (DSP_EBASE + 0x1e)
10125 +/* Unable to decode DCD data section content ; this is typically caused by
10126 + * changes to DSP/BIOS Bridge data structures. */
10127 +#define DSP_EDCDPARSESECT (DSP_EBASE + 0x1f)
10129 +/* Unable to get pointer to DCD data section ; this is typically caused by
10130 + * improperly configured UUIDs. */
10131 +#define DSP_EDCDGETSECT (DSP_EBASE + 0x20)
10133 +/* Unable to load file containing DCD data section ; this is typically
10134 + * caused by a missing COFF file. */
10135 +#define DSP_EDCDLOADBASE (DSP_EBASE + 0x21)
10137 +/* The specified COFF file does not contain a valid node registration
10138 + * section. */
10139 +#define DSP_EDCDNOAUTOREGISTER (DSP_EBASE + 0x22)
10141 +/* A requested resource is not available. */
10142 +#define DSP_ERESOURCE (DSP_EBASE + 0x28)
10144 +/* A critical error has occurred, and the DSP is being re-started. */
10145 +#define DSP_ERESTART (DSP_EBASE + 0x29)
10147 +/* A DSP memory free operation failed. */
10148 +#define DSP_EFREE (DSP_EBASE + 0x2a)
10150 +/* A DSP I/O free operation failed. */
10151 +#define DSP_EIOFREE (DSP_EBASE + 0x2b)
10153 +/* Multiple instances are not allowed. */
10154 +#define DSP_EMULINST (DSP_EBASE + 0x2c)
10156 +/* A specified entity was not found. */
10157 +#define DSP_ENOTFOUND (DSP_EBASE + 0x2d)
10159 +/* A DSP I/O resource is not available. */
10160 +#define DSP_EOUTOFIO (DSP_EBASE + 0x2e)
10162 +/* A shared memory buffer contained in a message or stream could not be
10163 + * mapped to the GPP client process's virtual space. */
10164 +#define DSP_ETRANSLATE (DSP_EBASE + 0x2f)
10166 +/* File or section load write function failed to write to DSP */
10167 +#define DSP_EFWRITE (DSP_EBASE + 0x31)
10169 +/* Unable to find a named section in DSP executable */
10170 +#define DSP_ENOSECT (DSP_EBASE + 0x32)
10172 +/* Unable to open file */
10173 +#define DSP_EFOPEN (DSP_EBASE + 0x33)
10175 +/* Unable to read file */
10176 +#define DSP_EFREAD (DSP_EBASE + 0x34)
10178 +/* A non-existent memory segment identifier was specified */
10179 +#define DSP_EOVERLAYMEMORY (DSP_EBASE + 0x37)
10181 +/* Invalid segment ID */
10182 +#define DSP_EBADSEGID (DSP_EBASE + 0x38)
10184 +/* Invalid alignment */
10185 +#define DSP_EALIGNMENT (DSP_EBASE + 0x39)
10187 +/* Invalid stream mode */
10188 +#define DSP_ESTRMMODE (DSP_EBASE + 0x3a)
10190 +/* Nodes not connected */
10191 +#define DSP_ENOTCONNECTED (DSP_EBASE + 0x3b)
10193 +/* Not shared memory */
10194 +#define DSP_ENOTSHAREDMEM (DSP_EBASE + 0x3c)
10196 +/* Error occurred in a dynamic loader library function */
10197 +#define DSP_EDYNLOAD (DSP_EBASE + 0x3d)
10199 +/* Device in 'sleep/suspend' mode due to DPM */
10200 +#define DSP_EDPMSUSPEND (DSP_EBASE + 0x3e)
10202 +/* A node-specific error has occurred. */
10203 +#define DSP_EUSER1 (DSP_EBASE + 0x40)
10204 +#define DSP_EUSER2 (DSP_EBASE + 0x41)
10205 +#define DSP_EUSER3 (DSP_EBASE + 0x42)
10206 +#define DSP_EUSER4 (DSP_EBASE + 0x43)
10207 +#define DSP_EUSER5 (DSP_EBASE + 0x44)
10208 +#define DSP_EUSER6 (DSP_EBASE + 0x45)
10209 +#define DSP_EUSER7 (DSP_EBASE + 0x46)
10210 +#define DSP_EUSER8 (DSP_EBASE + 0x47)
10211 +#define DSP_EUSER9 (DSP_EBASE + 0x48)
10212 +#define DSP_EUSER10 (DSP_EBASE + 0x49)
10213 +#define DSP_EUSER11 (DSP_EBASE + 0x4a)
10214 +#define DSP_EUSER12 (DSP_EBASE + 0x4b)
10215 +#define DSP_EUSER13 (DSP_EBASE + 0x4c)
10216 +#define DSP_EUSER14 (DSP_EBASE + 0x4d)
10217 +#define DSP_EUSER15 (DSP_EBASE + 0x4e)
10218 +#define DSP_EUSER16 (DSP_EBASE + 0x4f)
10220 +/* FAILURE Codes : DEV */
10221 +#define DEV_EBASE (DSP_COMP_EBASE + 0x000)
10223 +/* The mini-driver expected a newer version of the class driver. */
10224 +#define DEV_E_NEWWMD (DEV_EBASE + 0x00)
10226 +/* WMD_DRV_Entry function returned a NULL function interface table. */
10227 +#define DEV_E_NULLWMDINTF (DEV_EBASE + 0x01)
10229 +/* FAILURE Codes : LDR */
10230 +#define LDR_EBASE (DSP_COMP_EBASE + 0x100)
10232 +/* Insufficient memory to export class driver services. */
10233 +#define LDR_E_NOMEMORY (LDR_EBASE + 0x00)
10235 +/* Unable to find WMD file in system directory. */
10236 +#define LDR_E_FILEUNABLETOOPEN (LDR_EBASE + 0x01)
10238 +/* FAILURE Codes : CFG */
10239 +#define CFG_EBASE (DSP_COMP_EBASE + 0x200)
10241 +/* Invalid pointer passed into a configuration module function */
10242 +#define CFG_E_INVALIDPOINTER (CFG_EBASE + 0x00)
10244 +/* Invalid device node handle passed into a configuration module function. */
10245 +#define CFG_E_INVALIDHDEVNODE (CFG_EBASE + 0x01)
10247 +/* Unable to retrieve resource information from the registry. */
10248 +#define CFG_E_RESOURCENOTAVAIL (CFG_EBASE + 0x02)
10250 +/* Unable to find board name key in registry. */
10251 +#define CFG_E_INVALIDBOARDNAME (CFG_EBASE + 0x03)
10253 +/* Unable to find a device node in registry with given unit number. */
10254 +#define CFG_E_INVALIDUNITNUM (CFG_EBASE + 0x04)
10256 +/* Insufficient buffer size */
10257 +#define CFG_E_INSUFFICIENTBUFSIZE (CFG_EBASE + 0x05)
10259 +/* FAILURE Codes : BRD */
10260 +#define BRD_EBASE (DSP_COMP_EBASE + 0x300)
10262 +/* Board client does not have sufficient access rights for this operation. */
10263 +#define BRD_E_ACCESSDENIED (BRD_EBASE + 0x00)
10265 +/* Unable to find trace buffer symbols in the DSP executable COFF file. */
10266 +#define BRD_E_NOTRACEBUFFER (BRD_EBASE + 0x01)
10268 +/* Attempted to auto-start board, but no default DSP executable configured. */
10269 +#define BRD_E_NOEXEC (BRD_EBASE + 0x02)
10271 +/* The operation failed because it was started from a wrong state */
10272 +#define BRD_E_WRONGSTATE (BRD_EBASE + 0x03)
10274 +/* FAILURE Codes : COD */
10275 +#define COD_EBASE (DSP_COMP_EBASE + 0x400)
10277 +/* No symbol table is loaded for this board. */
10278 +#define COD_E_NOSYMBOLSLOADED (COD_EBASE + 0x00)
10280 +/* Symbol not found in for this board. */
10281 +#define COD_E_SYMBOLNOTFOUND (COD_EBASE + 0x01)
10283 +/* ZL DLL module is not exporting the correct function interface. */
10284 +#define COD_E_NOZLFUNCTIONS (COD_EBASE + 0x02)
10286 +/* Unable to initialize the ZL COFF parsing module. */
10287 +#define COD_E_ZLCREATEFAILED (COD_EBASE + 0x03)
10289 +/* Unable to open DSP executable COFF file. */
10290 +#define COD_E_OPENFAILED (COD_EBASE + 0x04)
10292 +/* Unable to parse DSP executable COFF file. */
10293 +#define COD_E_LOADFAILED (COD_EBASE + 0x05)
10295 +/* Unable to read DSP executable COFF file. */
10296 +#define COD_E_READFAILED (COD_EBASE + 0x06)
10298 +/* FAILURE Codes : CHNL */
10299 +#define CHNL_EBASE (DSP_COMP_EBASE + 0x500)
10301 +/* Attempt to created channel manager with too many channels. */
10302 +#define CHNL_E_MAXCHANNELS (CHNL_EBASE + 0x00)
10304 +/* No channel manager exists for this mini-driver. */
10305 +#define CHNL_E_NOMGR (CHNL_EBASE + 0x01)
10307 +/* No free channels are available. */
10308 +#define CHNL_E_OUTOFSTREAMS (CHNL_EBASE + 0x02)
10310 +/* Channel ID is out of range. */
10311 +#define CHNL_E_BADCHANID (CHNL_EBASE + 0x03)
10313 +/* Channel is already in use. */
10314 +#define CHNL_E_CHANBUSY (CHNL_EBASE + 0x04)
10316 +/* Invalid channel mode argument. */
10317 +#define CHNL_E_BADMODE (CHNL_EBASE + 0x05)
10319 +/* dwTimeOut parameter was CHNL_IOCNOWAIT, yet no I/O completions were
10320 + * queued. */
10321 +#define CHNL_E_NOIOC (CHNL_EBASE + 0x06)
10323 +/* I/O has been cancelled on this channel. */
10324 +#define CHNL_E_CANCELLED (CHNL_EBASE + 0x07)
10326 +/* End of stream was already requested on this output channel. */
10327 +#define CHNL_E_EOS (CHNL_EBASE + 0x09)
10329 +/* Unable to create the channel event object. */
10330 +#define CHNL_E_CREATEEVENT (CHNL_EBASE + 0x0A)
10332 +/* Board name and unit number do not identify a valid board name. */
10333 +#define CHNL_E_BRDID (CHNL_EBASE + 0x0B)
10335 +/* Invalid IRQ configured for this WMD for this system. */
10336 +#define CHNL_E_INVALIDIRQ (CHNL_EBASE + 0x0C)
10338 +/* DSP word size of zero configured for this device. */
10339 +#define CHNL_E_INVALIDWORDSIZE (CHNL_EBASE + 0x0D)
10341 +/* A zero length memory base was specified for a shared memory class driver. */
10342 +#define CHNL_E_INVALIDMEMBASE (CHNL_EBASE + 0x0E)
10344 +/* Memory map is not configured, or unable to map physical to linear
10345 + * address. */
10346 +#define CHNL_E_NOMEMMAP (CHNL_EBASE + 0x0F)
10348 +/* Attempted to create a channel manager when one already exists. */
10349 +#define CHNL_E_MGREXISTS (CHNL_EBASE + 0x10)
10351 +/* Unable to plug channel ISR for configured IRQ. */
10352 +#define CHNL_E_ISR (CHNL_EBASE + 0x11)
10354 +/* No free I/O request packets are available. */
10355 +#define CHNL_E_NOIORPS (CHNL_EBASE + 0x12)
10357 +/* Buffer size is larger than the size of physical channel. */
10358 +#define CHNL_E_BUFSIZE (CHNL_EBASE + 0x13)
10360 +/* User cannot mark end of stream on an input channel. */
10361 +#define CHNL_E_NOEOS (CHNL_EBASE + 0x14)
10363 +/* Wait for flush operation on an output channel timed out. */
10364 +#define CHNL_E_WAITTIMEOUT (CHNL_EBASE + 0x15)
10366 +/* User supplied hEvent must be specified with pstrEventName attribute */
10367 +#define CHNL_E_BADUSEREVENT (CHNL_EBASE + 0x16)
10369 +/* Illegal user event name specified */
10370 +#define CHNL_E_USEREVENTNAME (CHNL_EBASE + 0x17)
10372 +/* Unable to prepare buffer specified */
10373 +#define CHNL_E_PREPFAILED (CHNL_EBASE + 0x18)
10375 +/* Unable to Unprepare buffer specified */
10376 +#define CHNL_E_UNPREPFAILED (CHNL_EBASE + 0x19)
10378 +/* FAILURE Codes : SYNC */
10379 +#define SYNC_EBASE (DSP_COMP_EBASE + 0x600)
10381 +/* Wait on a kernel event failed. */
10382 +#define SYNC_E_FAIL (SYNC_EBASE + 0x00)
10384 +/* Timeout expired while waiting for event to be signalled. */
10385 +#define SYNC_E_TIMEOUT (SYNC_EBASE + 0x01)
10387 +/* FAILURE Codes : WMD */
10388 +#define WMD_EBASE (DSP_COMP_EBASE + 0x700)
10390 +/* A test of hardware assumptions or integrity failed. */
10391 +#define WMD_E_HARDWARE (WMD_EBASE + 0x00)
10393 +/* One or more configuration parameters violated WMD hardware assumptions. */
10394 +#define WMD_E_BADCONFIG (WMD_EBASE + 0x01)
10396 +/* Timeout occurred waiting for a response from the hardware. */
10397 +#define WMD_E_TIMEOUT (WMD_EBASE + 0x02)
10399 +/* FAILURE Codes : REG */
10400 +#define REG_EBASE (DSP_COMP_EBASE + 0x800)
10402 +/* Invalid subkey parameter. */
10403 +#define REG_E_INVALIDSUBKEY (REG_EBASE + 0x00)
10405 +/* Invalid entry parameter. */
10406 +#define REG_E_INVALIDENTRY (REG_EBASE + 0x01)
10408 +/* No more registry values. */
10409 +#define REG_E_NOMOREITEMS (REG_EBASE + 0x02)
10411 +/* Insufficient space to hold data in registry value. */
10412 +#define REG_E_MOREDATA (REG_EBASE + 0x03)
10414 +/* FAILURE Codes : KFILE */
10415 +#define KFILE_EBASE (DSP_COMP_EBASE + 0x900)
10417 +/* Invalid file handle. */
10418 +#define E_KFILE_INVALIDHANDLE (KFILE_EBASE + 0x01)
10420 +/* Bad file name. */
10421 +#define E_KFILE_BADFILENAME (KFILE_EBASE + 0x02)
10423 +/* Invalid file mode. */
10424 +#define E_KFILE_INVALIDMODE (KFILE_EBASE + 0x03)
10426 +/* No resources available. */
10427 +#define E_KFILE_NORESOURCES (KFILE_EBASE + 0x04)
10429 +/* Invalid file buffer . */
10430 +#define E_KFILE_INVALIDBUFFER (KFILE_EBASE + 0x05)
10432 +/* Bad origin argument. */
10433 +#define E_KFILE_BADORIGINFLAG (KFILE_EBASE + 0x06)
10435 +/* Invalid file offset value. */
10436 +#define E_KFILE_INVALIDOFFSET (KFILE_EBASE + 0x07)
10438 +/* General KFILE error condition */
10439 +#define E_KFILE_ERROR (KFILE_EBASE + 0x08)
10441 +#endif /* ERRBASE_ */
10442 Index: lk/arch/arm/plat-omap/include/bridge/gb.h
10443 ===================================================================
10444 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
10445 +++ lk/arch/arm/plat-omap/include/bridge/gb.h 2008-08-18 10:38:34.000000000 +0300
10446 @@ -0,0 +1,85 @@
10448 + * bridge/inc/gb.h
10450 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
10452 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
10454 + * This package is free software; you can redistribute it and/or modify
10455 + * it under the terms of the GNU General Public License version 2 as
10456 + * published by the Free Software Foundation.
10458 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10459 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10460 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10461 + */
10464 + * ======== gb.h ========
10465 + * Generic bitmap manager.
10467 + *! Revision History
10468 + *! ================
10469 + */
10471 +#ifndef GB_
10472 +#define GB_
10474 +#define GB_NOBITS (~0)
10475 +#include <host_os.h>
10476 +typedef s32 GB_BitNum;
10477 +struct GB_TMap;
10480 + * ======== GB_clear ========
10481 + * Clear the bit in position bitn in the bitmap map. Bit positions are
10482 + * zero based.
10483 + */
10485 +extern void GB_clear(struct GB_TMap *map, GB_BitNum bitn);
10488 + * ======== GB_create ========
10489 + * Create a bit map with len bits. Initially all bits are cleared.
10490 + */
10492 +extern struct GB_TMap *GB_create(GB_BitNum len);
10495 + * ======== GB_delete ========
10496 + * Delete previously created bit map
10497 + */
10499 +extern void GB_delete(struct GB_TMap *map);
10502 + * ======== GB_findandset ========
10503 + * Finds a clear bit, sets it, and returns the position
10504 + */
10506 +extern GB_BitNum GB_findandset(struct GB_TMap *map);
10509 + * ======== GB_minclear ========
10510 + * GB_minclear returns the minimum clear bit position. If no bit is
10511 + * clear, GB_minclear returns -1.
10512 + */
10513 +extern GB_BitNum GB_minclear(struct GB_TMap *map);
10516 + * ======== GB_set ========
10517 + * Set the bit in position bitn in the bitmap map. Bit positions are
10518 + * zero based.
10519 + */
10521 +extern void GB_set(struct GB_TMap *map, GB_BitNum bitn);
10524 + * ======== GB_test ========
10525 + * Returns TRUE if the bit in position bitn is set in map; otherwise
10526 + * GB_test returns FALSE. Bit positions are zero based.
10527 + */
10529 +extern bool GB_test(struct GB_TMap *map, GB_BitNum bitn);
10531 +#endif /*GB_ */
10532 Index: lk/arch/arm/plat-omap/include/bridge/getsection.h
10533 ===================================================================
10534 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
10535 +++ lk/arch/arm/plat-omap/include/bridge/getsection.h 2008-08-18 10:38:34.000000000 +0300
10536 @@ -0,0 +1,121 @@
10538 + * bridge/inc/getsection.h
10540 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
10542 + * Copyright (C) 2008 Texas Instruments, Inc.
10544 + * This package is free software; you can redistribute it and/or modify
10545 + * it under the terms of the GNU General Public License version 2 as
10546 + * published by the Free Software Foundation.
10548 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10549 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10550 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10551 + */
10554 +#ifndef _GETSECTION_H_
10555 +#define _GETSECTION_H_
10557 +#ifndef _SIZE_T /* Linux sets _SIZE_T on defining size_t */
10558 +typedef unsigned int size_t;
10559 +#define _SIZE_T
10560 +#endif
10561 +#include "dynamic_loader.h"
10564 + * Get Section Information
10566 + * This file provides an API add-on to the dynamic loader that allows the user
10567 + * to query section information and extract section data from dynamic load
10568 + * modules.
10570 + * NOTE:
10571 + * Functions in this API assume that the supplied Dynamic_Loader_Stream object
10572 + * supports the set_file_posn method.
10573 + */
10575 + /* opaque handle for module information */
10576 + typedef void *DLOAD_module_info;
10579 + * Procedure DLOAD_module_open
10581 + * Parameters:
10582 + * module The input stream that supplies the module image
10583 + * syms Host-side malloc/free and error reporting functions.
10584 + * Other methods are unused.
10586 + * Effect:
10587 + * Reads header information from a dynamic loader module using the specified
10588 + * stream object, and returns a handle for the module information. This
10589 + * handle may be used in subsequent query calls to obtain information
10590 + * contained in the module.
10592 + * Returns:
10593 + * NULL if an error is encountered, otherwise a module handle for use
10594 + * in subsequent operations.
10595 + */
10596 + extern DLOAD_module_info DLOAD_module_open(struct Dynamic_Loader_Stream
10597 + *module,
10598 + struct Dynamic_Loader_Sym
10599 + *syms);
10602 + * Procedure DLOAD_GetSectionInfo
10604 + * Parameters:
10605 + * minfo Handle from DLOAD_module_open for this module
10606 + * sectionName Pointer to the string name of the section desired
10607 + * sectionInfo Address of a section info structure pointer to be initialized
10609 + * Effect:
10610 + * Finds the specified section in the module information, and fills in
10611 + * the provided LDR_SECTION_INFO structure.
10613 + * Returns:
10614 + * TRUE for success, FALSE for section not found
10615 + */
10616 + extern int DLOAD_GetSectionInfo(DLOAD_module_info minfo,
10617 + const char *sectionName,
10618 + const struct LDR_SECTION_INFO
10619 + ** const sectionInfo);
10622 + * Procedure DLOAD_GetSection
10624 + * Parameters:
10625 + * minfo Handle from DLOAD_module_open for this module
10626 + * sectionInfo Pointer to a section info structure for the desired section
10627 + * sectionData Buffer to contain the section initialized data
10629 + * Effect:
10630 + * Copies the initialized data for the specified section into the
10631 + * supplied buffer.
10633 + * Returns:
10634 + * TRUE for success, FALSE for section not found
10635 + */
10636 + extern int DLOAD_GetSection(DLOAD_module_info minfo,
10637 + const struct LDR_SECTION_INFO *sectionInfo,
10638 + void *sectionData);
10641 + * Procedure DLOAD_module_close
10643 + * Parameters:
10644 + * minfo Handle from DLOAD_module_open for this module
10646 + * Effect:
10647 + * Releases any storage associated with the module handle. On return,
10648 + * the module handle is invalid.
10650 + * Returns:
10651 + * Zero for success. On error, the number of errors detected is returned.
10652 + * Individual errors are reported using syms->Error_Report(), where syms was
10653 + * an argument to DLOAD_module_open
10654 + */
10655 + extern void DLOAD_module_close(DLOAD_module_info minfo);
10657 +#endif /* _GETSECTION_H_ */
10658 Index: lk/arch/arm/plat-omap/include/bridge/gh.h
10659 ===================================================================
10660 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
10661 +++ lk/arch/arm/plat-omap/include/bridge/gh.h 2008-08-18 10:38:34.000000000 +0300
10662 @@ -0,0 +1,37 @@
10664 + * bridge/inc/gh.h
10666 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
10668 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
10670 + * This package is free software; you can redistribute it and/or modify
10671 + * it under the terms of the GNU General Public License version 2 as
10672 + * published by the Free Software Foundation.
10674 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10675 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10676 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10677 + */
10681 + * ======== gh.h ========
10683 + *! Revision History
10684 + *! ================
10685 + */
10687 +#ifndef GH_
10688 +#define GH_
10689 +#include <host_os.h>
10691 +extern struct GH_THashTab *GH_create(u16 maxBucket, u16 valSize,
10692 + u16(*hash) (void *, u16), bool(*match) (void *, void *),
10693 + void(*delete) (void *));
10694 +extern void GH_delete(struct GH_THashTab *hashTab);
10695 +extern void GH_exit(void);
10696 +extern void *GH_find(struct GH_THashTab *hashTab, void *key);
10697 +extern void GH_init(void);
10698 +extern void *GH_insert(struct GH_THashTab *hashTab, void *key, void *value);
10699 +#endif /* GH_ */
10700 Index: lk/arch/arm/plat-omap/include/bridge/gp.h
10701 ===================================================================
10702 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
10703 +++ lk/arch/arm/plat-omap/include/bridge/gp.h 2008-08-18 10:38:34.000000000 +0300
10704 @@ -0,0 +1,33 @@
10706 + * bridge/inc/gp.h
10708 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
10710 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
10712 + * This package is free software; you can redistribute it and/or modify
10713 + * it under the terms of the GNU General Public License version 2 as
10714 + * published by the Free Software Foundation.
10716 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10717 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10718 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10719 + */
10722 + * ======== gp.h ========
10723 + *! Revision History
10724 + *! ================
10725 + */
10727 +#ifndef GP_
10728 +#define GP_
10730 +#include <stdarg.h>
10733 + * ======== GP_snprintf ========
10734 + */
10735 +#define GP_snprintf snprintf
10737 +#endif
10738 Index: lk/arch/arm/plat-omap/include/bridge/gs.h
10739 ===================================================================
10740 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
10741 +++ lk/arch/arm/plat-omap/include/bridge/gs.h 2008-08-18 10:38:34.000000000 +0300
10742 @@ -0,0 +1,64 @@
10744 + * bridge/inc/gs.h
10746 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
10748 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
10750 + * This package is free software; you can redistribute it and/or modify
10751 + * it under the terms of the GNU General Public License version 2 as
10752 + * published by the Free Software Foundation.
10754 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10755 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10756 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10757 + */
10760 + * ======== gs.h ========
10761 + * Memory allocation/release wrappers. This module allows clients to
10762 + * avoid OS spacific issues related to memory allocation. It also provides
10763 + * simple diagnostic capabilities to assist in the detection of memory
10764 + * leaks.
10765 + *! Revision History
10766 + *! ================
10767 + */
10769 +#ifndef GS_
10770 +#define GS_
10773 + * ======== GS_alloc ========
10774 + * Alloc size bytes of space. Returns pointer to space
10775 + * allocated, otherwise NULL.
10776 + */
10777 +extern void *GS_alloc(u32 size);
10780 + * ======== GS_exit ========
10781 + * Module exit. Do not change to "#define GS_init()"; in
10782 + * some environments this operation must actually do some work!
10783 + */
10784 +extern void GS_exit(void);
10787 + * ======== GS_free ========
10788 + * Free space allocated by GS_alloc() or GS_calloc().
10789 + */
10790 +extern void GS_free(void *ptr);
10793 + * ======== GS_frees ========
10794 + * Free space allocated by GS_alloc() or GS_calloc() and assert that
10795 + * the size of the allocation is size bytes.
10796 + */
10797 +extern void GS_frees(void *ptr, u32 size);
10800 + * ======== GS_init ========
10801 + * Module initialization. Do not change to "#define GS_init()"; in
10802 + * some environments this operation must actually do some work!
10803 + */
10804 +extern void GS_init(void);
10806 +#endif /*GS_ */
10807 Index: lk/arch/arm/plat-omap/include/bridge/gt.h
10808 ===================================================================
10809 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
10810 +++ lk/arch/arm/plat-omap/include/bridge/gt.h 2008-08-18 10:38:34.000000000 +0300
10811 @@ -0,0 +1,317 @@
10813 + * bridge/inc/gt.h
10815 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
10817 + * Copyright (C) 2008 Texas Instruments, Inc.
10819 + * This package is free software; you can redistribute it and/or modify
10820 + * it under the terms of the GNU General Public License version 2 as
10821 + * published by the Free Software Foundation.
10823 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10824 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10825 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10826 + */
10830 + * ======== gt.h ========
10831 + * Purpose:
10832 + * There are two definitions that affect which portions of trace
10833 + * are acutally compiled into the client: GT_TRACE and GT_ASSERT. If
10834 + * GT_TRACE is set to 0 then all trace statements (except for assertions)
10835 + * will be compiled out of the client. If GT_ASSERT is set to 0 then
10836 + * assertions will be compiled out of the client. GT_ASSERT can not be
10837 + * set to 0 unless GT_TRACE is also set to 0 (i.e. GT_TRACE == 1 implies
10838 + * GT_ASSERT == 1).
10840 + *! Revision History
10841 + *! ================
10842 + *! 02-Feb-2000 rr: Renamed this file to gtce.h. GT CLASS and trace definitions
10843 + *! are WinCE Specific.
10844 + *! 03-Jan-1997 ge Replaced "GT_" prefix to GT_Config structure members
10845 + *! to eliminate preprocessor confusion with other macros.
10846 + */
10847 +#include <linux/types.h>
10848 +#ifndef GT_
10849 +#define GT_
10851 +#ifndef GT_TRACE
10852 +#define GT_TRACE 0 /* 0 = "trace compiled out"; 1 = "trace active" */
10853 +#endif
10855 +#include <host_os.h>
10857 +#if !defined(GT_ASSERT) || GT_TRACE
10858 +#define GT_ASSERT 1
10859 +#endif
10861 +struct GT_Config {
10862 + Fxn PRINTFXN;
10863 + Fxn PIDFXN;
10864 + Fxn TIDFXN;
10865 + Fxn ERRORFXN;
10868 +extern struct GT_Config *GT;
10870 +struct GT_Mask {
10871 + char *modName;
10872 + u8 *flags;
10873 +} ;
10876 + * New GT Class defenitions.
10878 + * The following are the explanations and how it could be used in the code
10880 + * - GT_ENTER On Entry to Functions
10882 + * - GT_1CLASS Display level of debugging status- Object/Automatic
10883 + * variables
10884 + * - GT_2CLASS ---- do ----
10886 + * - GT_3CLASS ---- do ---- + It can be used(recommended) for debug
10887 + * status in the ISR, IST
10888 + * - GT_4CLASS ---- do ----
10890 + * - GT_5CLASS Display entry for module init/exit functions
10892 + * - GT_6CLASS Warn whenever SERVICES function fails
10894 + * - GT_7CLASS Warn failure of Critical failures
10896 + */
10898 +#define GT_ENTER ((u8)0x01)
10899 +#define GT_1CLASS ((u8)0x02)
10900 +#define GT_2CLASS ((u8)0x04)
10901 +#define GT_3CLASS ((u8)0x08)
10902 +#define GT_4CLASS ((u8)0x10)
10903 +#define GT_5CLASS ((u8)0x20)
10904 +#define GT_6CLASS ((u8)0x40)
10905 +#define GT_7CLASS ((u8)0x80)
10907 +#ifdef _LINT_
10909 +/* LINTLIBRARY */
10912 + * ======== GT_assert ========
10913 + */
10914 +/* ARGSUSED */
10915 +void GT_assert(struct GT_Mask mask, s32 expr)
10920 + * ======== GT_config ========
10921 + */
10922 +/* ARGSUSED */
10923 +void GT_config(struct GT_Config config)
10928 + * ======== GT_create ========
10929 + */
10930 +/* ARGSUSED */
10931 +void GT_create(struct GT_Mask *mask, char *modName)
10936 + * ======== GT_curLine ========
10937 + * Purpose:
10938 + * Returns the current source code line number. Is useful for performing
10939 + * branch testing using trace. For example,
10941 + * GT_1trace(curTrace, GT_1CLASS,
10942 + * "in module XX_mod, executing line %u\n", GT_curLine());
10943 + */
10944 +/* ARGSUSED */
10945 +u16 GT_curLine(void)
10947 + return (u16)NULL;
10951 + * ======== GT_exit ========
10952 + */
10953 +/* ARGSUSED */
10954 +void GT_exit(void)
10959 + * ======== GT_init ========
10960 + */
10961 +/* ARGSUSED */
10962 +void GT_init(void)
10967 + * ======== GT_query ========
10968 + */
10969 +/* ARGSUSED */
10970 +bool GT_query(struct GT_Mask mask, u8 class)
10972 + return false;
10976 + * ======== GT_set ========
10977 + * sets trace mask according to settings
10978 + */
10980 +/* ARGSUSED */
10981 +void GT_set(char *settings)
10986 + * ======== GT_setprintf ========
10987 + * sets printf function
10988 + */
10990 +/* ARGSUSED */
10991 +void GT_setprintf(Fxn fxn)
10995 +/* ARGSUSED */
10996 +void GT_0trace(struct GT_Mask mask, u8 class, char *format)
11000 +/* ARGSUSED */
11001 +void GT_1trace(struct GT_Mask mask, u8 class, char *format, ...)
11005 +/* ARGSUSED */
11006 +void GT_2trace(struct GT_Mask mask, u8 class, char *format, ...)
11010 +/* ARGSUSED */
11011 +void GT_3trace(struct GT_Mask mask, u8 class, char *format, ...)
11015 +/* ARGSUSED */
11016 +void GT_4trace(struct GT_Mask mask, u8 class, char *format, ...)
11020 +/* ARGSUSED */
11021 +void GT_5trace(struct GT_Mask mask, u8 class, char *format, ...)
11025 +/* ARGSUSED */
11026 +void GT_6trace(struct GT_Mask mask, u8 class, char *format, ...)
11030 +#else
11032 +#define GT_BOUND 26 /* 26 letters in alphabet */
11034 +extern void _GT_create(struct GT_Mask *mask, char *modName);
11036 +#define GT_exit()
11038 +extern void GT_init(void);
11039 +extern void _GT_set(char *str);
11040 +extern s32 _GT_trace(struct GT_Mask *mask, char *format, ...);
11042 +#if GT_ASSERT == 0
11044 +#define GT_assert(mask, expr)
11045 +#define GT_config(config)
11046 +#define GT_configInit(config)
11047 +#define GT_seterror(fxn)
11049 +#else
11051 +extern struct GT_Config _GT_params;
11053 +#define GT_assert(mask, expr) \
11054 + (!(expr) ? \
11055 + (*GT->ERRORFXN)("assertion violation: %s, line %d\n", \
11056 + __FILE__, __LINE__), NULL : NULL)
11058 +#define GT_config(config) (_GT_params = *(config))
11059 +#define GT_configInit(config) (*(config) = _GT_params)
11060 +#define GT_seterror(fxn) (_GT_params.ERRORFXN = (Fxn)(fxn))
11062 +#endif
11064 +#if GT_TRACE == 0
11066 +#define GT_curLine() ((u16)__LINE__)
11067 +#define GT_create(mask, modName)
11068 +#define GT_exit()
11069 +#define GT_init()
11070 +#define GT_set(settings)
11071 +#define GT_setprintf(fxn)
11073 +#define GT_query(mask, class) false
11075 +#define GT_0trace(mask, class, format)
11076 +#define GT_1trace(mask, class, format, arg1)
11077 +#define GT_2trace(mask, class, format, arg1, arg2)
11078 +#define GT_3trace(mask, class, format, arg1, arg2, arg3)
11079 +#define GT_4trace(mask, class, format, arg1, arg2, arg3, arg4)
11080 +#define GT_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5)
11081 +#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6)
11083 +#else /* GT_TRACE == 1 */
11085 +extern char *GT_format;
11086 +extern u8 *GT_tMask[GT_BOUND];
11088 +#define GT_create(mask, modName) _GT_create((mask), (modName))
11089 +#define GT_curLine() ((u16)__LINE__)
11090 +#define GT_set(settings) _GT_set(settings)
11091 +#define GT_setprintf(fxn) (_GT_params.PRINTFXN = (Fxn)(fxn))
11093 +#define GT_query(mask, class) ((*(mask).flags & (class)))
11095 +#define GT_0trace(mask, class, format) \
11096 + ((*(mask).flags & (class)) ? \
11097 + _GT_trace(&(mask), (format)) : 0)
11099 +#define GT_1trace(mask, class, format, arg1) \
11100 + ((*(mask).flags & (class)) ? \
11101 + _GT_trace(&(mask), (format), (arg1)) : 0)
11103 +#define GT_2trace(mask, class, format, arg1, arg2) \
11104 + ((*(mask).flags & (class)) ? \
11105 + _GT_trace(&(mask), (format), (arg1), (arg2)) : 0)
11107 +#define GT_3trace(mask, class, format, arg1, arg2, arg3) \
11108 + ((*(mask).flags & (class)) ? \
11109 + _GT_trace(&(mask), (format), (arg1), (arg2), (arg3)) : 0)
11111 +#define GT_4trace(mask, class, format, arg1, arg2, arg3, arg4) \
11112 + ((*(mask).flags & (class)) ? \
11113 + _GT_trace(&(mask), (format), (arg1), (arg2), (arg3), (arg4)) : 0)
11115 +#define GT_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5) \
11116 + ((*(mask).flags & (class)) ? \
11117 + _GT_trace(&(mask), (format), (arg1), (arg2), (arg3), (arg4), (arg5)) : 0)
11119 +#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6) \
11120 + ((*(mask).flags & (class)) ? \
11121 + _GT_trace(&(mask), (format), (arg1), (arg2), (arg3), (arg4), (arg5), \
11122 + (arg6)) : 0)
11124 +#endif /* GT_TRACE */
11126 +#endif /* _LINT_ */
11128 +#endif /* GTCE_ */
11129 Index: lk/arch/arm/plat-omap/include/bridge/host_os.h
11130 ===================================================================
11131 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11132 +++ lk/arch/arm/plat-omap/include/bridge/host_os.h 2008-08-18 10:38:34.000000000 +0300
11133 @@ -0,0 +1,80 @@
11135 + * bridge/inc/host_os.h
11137 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
11139 + * Copyright (C) 2008 Texas Instruments, Inc.
11141 + * This package is free software; you can redistribute it and/or modify
11142 + * it under the terms of the GNU General Public License version 2 as
11143 + * published by the Free Software Foundation.
11145 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11146 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11147 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11148 + */
11152 + * ======== windows.h ========
11154 + *! Revision History
11155 + *! ================
11156 + *! 08-Mar-2004 sb Added cacheflush.h to support Dynamic Memory Mapping feature
11157 + *! 16-Feb-2004 sb Added headers required for consistent_alloc
11158 + */
11160 +#ifndef _HOST_OS_H_
11161 +#define _HOST_OS_H_
11163 +#include <linux/autoconf.h>
11164 +#include <asm/system.h>
11165 +#include <asm/atomic.h>
11166 +#include <asm/uaccess.h>
11167 +#include <asm/irq.h>
11168 +#include <asm/io.h>
11169 +#include <linux/syscalls.h>
11170 +#include <linux/version.h>
11171 +#include <linux/kernel.h>
11172 +#include <linux/string.h>
11173 +#include <linux/stddef.h>
11174 +#include <linux/types.h>
11175 +#include <linux/interrupt.h>
11176 +#include <linux/spinlock.h>
11177 +#include <linux/sched.h>
11178 +#include <linux/fs.h>
11179 +#include <linux/file.h>
11180 +#include <linux/slab.h>
11181 +#include <linux/delay.h>
11182 +#include <linux/ctype.h>
11183 +#include <linux/mm.h>
11184 +#include <linux/device.h>
11185 +#include <linux/vmalloc.h>
11186 +#include <linux/ioport.h>
11187 +#include <linux/platform_device.h>
11188 +#include <dbtype.h>
11190 +#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
11191 +#include <mach/clock.h>
11192 +#ifdef CONFIG_ARCH_OMAP3430
11193 +#include <linux/clk.h>
11194 +#endif
11195 +#endif
11197 +#include <linux/pagemap.h>
11198 +#include <asm/cacheflush.h>
11199 +#include <linux/dma-mapping.h>
11201 +/* ----------------------------------- Macros */
11203 +#define SEEK_SET 0 /* Seek from beginning of file. */
11204 +#define SEEK_CUR 1 /* Seek from current position. */
11205 +#define SEEK_END 2 /* Seek from end of file. */
11207 +/* TODO -- Remove, once BP defines them */
11208 +#ifdef CONFIG_ARCH_OMAP3430
11209 +#define INT_MAIL_MPU_IRQ 26
11210 +#define INT_DSP_MMU_IRQ 28
11211 +#endif
11213 +#endif
11214 Index: lk/arch/arm/plat-omap/include/bridge/io.h
11215 ===================================================================
11216 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11217 +++ lk/arch/arm/plat-omap/include/bridge/io.h 2008-08-18 10:38:34.000000000 +0300
11218 @@ -0,0 +1,132 @@
11220 + * bridge/inc/io.h
11222 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
11224 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
11226 + * This package is free software; you can redistribute it and/or modify
11227 + * it under the terms of the GNU General Public License version 2 as
11228 + * published by the Free Software Foundation.
11230 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11231 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11232 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11233 + */
11237 + * ======== io.h ========
11238 + * Description:
11239 + * The io module manages IO between CHNL and MSG.
11241 + * Public Functions:
11242 + * IO_Create
11243 + * IO_Destroy
11244 + * IO_Exit
11245 + * IO_Init
11246 + * IO_OnLoaded
11249 + *! Revision History:
11250 + *! ================
11251 + *! 07-Nov-2000 jeh Created.
11252 + */
11254 +#ifndef IO_
11255 +#define IO_
11257 +#include <cfgdefs.h>
11258 +#include <devdefs.h>
11260 +#include <iodefs.h>
11263 + * ======== IO_Create ========
11264 + * Purpose:
11265 + * Create an IO manager object, responsible for managing IO between
11266 + * CHNL and MSG.
11267 + * Parameters:
11268 + * phChnlMgr: Location to store a channel manager object on
11269 + * output.
11270 + * hDevObject: Handle to a device object.
11271 + * pMgrAttrs: IO manager attributes.
11272 + * pMgrAttrs->bIRQ: I/O IRQ number.
11273 + * pMgrAttrs->fShared: TRUE if the IRQ is shareable.
11274 + * pMgrAttrs->uWordSize: DSP Word size in equivalent PC bytes..
11275 + * Returns:
11276 + * DSP_SOK: Success;
11277 + * DSP_EMEMORY: Insufficient memory for requested resources.
11278 + * CHNL_E_ISR: Unable to plug channel ISR for configured IRQ.
11279 + * CHNL_E_INVALIDIRQ: Invalid IRQ number. Must be 0 <= bIRQ <= 15.
11280 + * CHNL_E_INVALIDWORDSIZE: Invalid DSP word size. Must be > 0.
11281 + * CHNL_E_INVALIDMEMBASE: Invalid base address for DSP communications.
11282 + * Requires:
11283 + * IO_Init() called.
11284 + * phIOMgr != NULL.
11285 + * pMgrAttrs != NULL.
11286 + * Ensures:
11287 + */
11288 + extern DSP_STATUS IO_Create(OUT struct IO_MGR **phIOMgr,
11289 + struct DEV_OBJECT *hDevObject,
11290 + IN CONST struct IO_ATTRS *pMgrAttrs);
11293 + * ======== IO_Destroy ========
11294 + * Purpose:
11295 + * Destroy the IO manager.
11296 + * Parameters:
11297 + * hIOMgr: IOmanager object.
11298 + * Returns:
11299 + * DSP_SOK: Success.
11300 + * DSP_EHANDLE: hIOMgr was invalid.
11301 + * Requires:
11302 + * IO_Init() called.
11303 + * Ensures:
11304 + */
11305 + extern DSP_STATUS IO_Destroy(struct IO_MGR *hIOMgr);
11308 + * ======== IO_Exit ========
11309 + * Purpose:
11310 + * Discontinue usage of the IO module.
11311 + * Parameters:
11312 + * Returns:
11313 + * Requires:
11314 + * IO_Init() previously called.
11315 + * Ensures:
11316 + * Resources, if any acquired in IO_Init(), are freed when the last
11317 + * client of IO calls IO_Exit().
11318 + */
11319 + extern void IO_Exit();
11322 + * ======== IO_Init ========
11323 + * Purpose:
11324 + * Initialize the IO module's private state.
11325 + * Parameters:
11326 + * Returns:
11327 + * TRUE if initialized; FALSE if error occurred.
11328 + * Requires:
11329 + * Ensures:
11330 + * A requirement for each of the other public CHNL functions.
11331 + */
11332 + extern bool IO_Init();
11335 + * ======== IO_OnLoaded ========
11336 + * Purpose:
11337 + * Called when a program is loaded so IO manager can update its
11338 + * internal state.
11339 + * Parameters:
11340 + * hIOMgr: IOmanager object.
11341 + * Returns:
11342 + * DSP_SOK: Success.
11343 + * DSP_EHANDLE: hIOMgr was invalid.
11344 + * Requires:
11345 + * IO_Init() called.
11346 + * Ensures:
11347 + */
11348 + extern DSP_STATUS IO_OnLoaded(struct IO_MGR *hIOMgr);
11350 +#endif /* CHNL_ */
11351 Index: lk/arch/arm/plat-omap/include/bridge/io_sm.h
11352 ===================================================================
11353 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11354 +++ lk/arch/arm/plat-omap/include/bridge/io_sm.h 2008-08-18 10:38:34.000000000 +0300
11355 @@ -0,0 +1,330 @@
11357 + * bridge/inc/io_sm.h
11359 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
11361 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
11363 + * This package is free software; you can redistribute it and/or modify
11364 + * it under the terms of the GNU General Public License version 2 as
11365 + * published by the Free Software Foundation.
11367 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11368 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11369 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11370 + */
11374 + * ======== io_sm.h ========
11375 + * Description:
11376 + * IO dispatcher for a shared memory channel driver.
11377 + * Also, includes macros to simulate SHM via port io calls.
11379 + * Public Functions:
11380 + * IO_Dispatch
11381 + * IO_DPC
11382 + * IO_ISR
11383 + * IO_RequestChnl
11385 + * Notes:
11387 + *! Revision History:
11388 + *! ================
11389 + *! 01-Mar-2004 vp: Added IVA releated functions.
11390 + *! 23-Apr-2003 sb: Fixed mailbox deadlock
11391 + *! 06-Feb-2003 kc Added IO_DDMAClearChnlDesc and IO_DDZCClearChnlDesc.
11392 + *! 21-Dec-2001 ag Removed unused param in IO_DDMAInitChnlDesc().
11393 + * Updated comments. Removed #ifdef CHNL_NOIPCINTR.
11394 + *! 05-Nov-2001 kc Updated IO_CALLISR macro.
11395 + *! 01-May-2001 jeh Removed IO_RequestMsg.
11396 + *! 29-Mar-2001 ag Added #ifdef CHNL_NOIPCINTR.
11397 + *! 04-Dec-2000 jeh Added IO_RequestMsg.
11398 + *! 26-Oct-2000 jeh Added IO_GetLong, IO_SetLong, IO_ReadValueLong, and
11399 + *! IO_WriteValueLong, for passing arg in SHM structure.
11400 + *! 20-Jan-2000 ag: Updated header comments per code review.
11401 + *! 05-Jan-2000 ag: Text format clean-up.
11402 + *! 02-Nov-1999 ag: Updated header descriptions.
11403 + *! 25-May-1999 jg: Removed assumption of 4 bytes / word.
11404 + *! 12-Aug-1996 gp: Created.
11405 + */
11407 +#ifndef IOSM_
11408 +#define IOSM_
11410 +#include <_chnl_sm.h>
11411 +#include <host_os.h>
11413 +#include <iodefs.h>
11415 +#define IO_INPUT 0
11416 +#define IO_OUTPUT 1
11417 +#define IO_SERVICE 2
11418 +#define IO_MAXSERVICE IO_SERVICE
11420 +#define IO_MGRSIGNATURE 0x494f4D43 /* "IOGR" */
11422 +#define DSPFieldAddr(type, field, base, wordsize) \
11423 + ((((s32)&(((type *)0)->field)) / wordsize) + (u32)base)
11425 +/* Access can be different SM access word size (e.g. 16/32 bit words) */
11426 +#define IO_SetValue(pContext, type, base, field, value) (base->field = value)
11427 +#define IO_GetValue(pContext, type, base, field) (base->field)
11428 +#define IO_OrValue(pContext, type, base, field, value) (base->field |= value)
11429 +#define IO_AndValue(pContext, type, base, field, value) (base->field &= value)
11430 +#define IO_SetLong(pContext, type, base, field, value) (base->field = value)
11431 +#define IO_GetLong(pContext, type, base, field) (base->field)
11433 +#define IO_DisableInterrupt(h) CHNLSM_DisableInterrupt(h)
11434 +#define IO_EnableInterrupt(h) CHNLSM_EnableInterrupt(h)
11435 +#define IO_InterruptDSP(h) CHNLSM_InterruptDSP(h)
11436 +#define IO_InterruptDSP2(h, v) CHNLSM_InterruptDSP2(h, v)
11437 +#define IO_CALLDPC(h) CHNLSM_DPC(h)
11438 +#define IO_CALLISR(h, pFlag, pwMBRegVal) CHNLSM_ISR(h, pFlag, pwMBRegVal)
11441 + * ======== IO_CancelChnl ========
11442 + * Purpose:
11443 + * Cancel IO on a given channel.
11444 + * Parameters:
11445 + * hIOMgr: IO Manager.
11446 + * ulChnl: Index of channel to cancel IO on.
11447 + * Returns:
11448 + * Requires:
11449 + * Valid hIOMgr.
11450 + * Ensures:
11451 + */
11452 + extern void IO_CancelChnl(struct IO_MGR *hIOMgr, u32 ulChnl);
11455 + * ======== IO_DPC ========
11456 + * Purpose:
11457 + * Deferred procedure call for shared memory channel driver ISR. Carries
11458 + * out the dispatch of I/O.
11459 + * Parameters:
11460 + * pRefData: Pointer to reference data registered via a call to
11461 + * DPC_Create().
11462 + * Returns:
11463 + * Requires:
11464 + * Must not block.
11465 + * Must not acquire resources.
11466 + * All data touched must be locked in memory if running in kernel mode.
11467 + * Ensures:
11468 + * Non-preemptible (but interruptible).
11469 + */
11470 + extern void IO_DPC(IN OUT void *pRefData);
11473 + * ======== IO_ISR ========
11474 + * Purpose:
11475 + * Main interrupt handler for the shared memory WMD channel manager.
11476 + * Calls the WMD's CHNLSM_ISR to determine if this interrupt is ours, then
11477 + * schedules a DPC to dispatch I/O..
11478 + * Parameters:
11479 + * pRefData: Pointer to the channel manager object for this board.
11480 + * Set in an initial call to ISR_Install().
11481 + * Returns:
11482 + * TRUE if interrupt handled; FALSE otherwise.
11483 + * Requires:
11484 + * Must be in locked memory if executing in kernel mode.
11485 + * Must only call functions which are in locked memory if Kernel mode.
11486 + * Must only call asynchronous services.
11487 + * Interrupts are disabled and EOI for this interrupt has been sent.
11488 + * Ensures:
11489 + */
11490 + extern bool IO_ISR(IN void *pRefData);
11493 + * ======== IO_RequestChnl ========
11494 + * Purpose:
11495 + * Request I/O from the DSP. Sets flags in shared memory, then interrupts
11496 + * the DSP.
11497 + * Parameters:
11498 + * hIOMgr: IO manager handle.
11499 + * pChnl: Ptr to the channel requesting I/O.
11500 + * iMode: Mode of channel: {IO_INPUT | IO_OUTPUT}.
11501 + * Returns:
11502 + * Requires:
11503 + * pChnl != NULL
11504 + * Ensures:
11505 + */
11506 + extern void IO_RequestChnl(struct IO_MGR *hIOMgr,
11507 + struct CHNL_OBJECT *pChnl,
11508 + u32 iMode, OUT u16 *pwMbVal);
11511 + * ======== IO_Schedule ========
11512 + * Purpose:
11513 + * Schedule DPC for IO.
11514 + * Parameters:
11515 + * pIOMgr: Ptr to a I/O manager.
11516 + * Returns:
11517 + * Requires:
11518 + * pChnl != NULL
11519 + * Ensures:
11520 + */
11521 + extern void IO_Schedule(struct IO_MGR *hIOMgr);
11524 + * DSP-DMA IO functions
11525 + */
11528 + * ======== IO_DDMAInitChnlDesc ========
11529 + * Purpose:
11530 + * Initialize DSP DMA channel descriptor.
11531 + * Parameters:
11532 + * hIOMgr: Handle to a I/O manager.
11533 + * uDDMAChnlId: DDMA channel identifier.
11534 + * uNumDesc: Number of buffer descriptors(equals # of IOReqs &
11535 + * Chirps)
11536 + * pDsp: Dsp address;
11537 + * Returns:
11538 + * Requires:
11539 + * uDDMAChnlId < DDMA_MAXDDMACHNLS
11540 + * uNumDesc > 0
11541 + * pVa != NULL
11542 + * pDspPa != NULL
11544 + * Ensures:
11545 + */
11546 + extern void IO_DDMAInitChnlDesc(struct IO_MGR *hIOMgr, u32 uDDMAChnlId,
11547 + u32 uNumDesc, void *pDsp);
11550 + * ======== IO_DDMAClearChnlDesc ========
11551 + * Purpose:
11552 + * Clear DSP DMA channel descriptor.
11553 + * Parameters:
11554 + * hIOMgr: Handle to a I/O manager.
11555 + * uDDMAChnlId: DDMA channel identifier.
11556 + * Returns:
11557 + * Requires:
11558 + * uDDMAChnlId < DDMA_MAXDDMACHNLS
11559 + * Ensures:
11560 + */
11561 + extern void IO_DDMAClearChnlDesc(struct IO_MGR *hIOMgr,
11562 + u32 uDDMAChnlId);
11565 + * ======== IO_DDMARequestChnl ========
11566 + * Purpose:
11567 + * Request channel DSP-DMA from the DSP. Sets up SM descriptors and
11568 + * control fields in shared memory.
11569 + * Parameters:
11570 + * hIOMgr: Handle to a I/O manager.
11571 + * pChnl: Ptr to channel object
11572 + * pChirp: Ptr to channel i/o request packet.
11573 + * Returns:
11574 + * Requires:
11575 + * pChnl != NULL
11576 + * pChnl->cIOReqs > 0
11577 + * pChirp != NULL
11578 + * Ensures:
11579 + */
11580 + extern void IO_DDMARequestChnl(struct IO_MGR *hIOMgr,
11581 + struct CHNL_OBJECT *pChnl,
11582 + struct CHNL_IRP *pChirp,
11583 + OUT u16 *pwMbVal);
11586 + * Zero-copy IO functions
11587 + */
11590 + * ======== IO_DDZCInitChnlDesc ========
11591 + * Purpose:
11592 + * Initialize ZCPY channel descriptor.
11593 + * Parameters:
11594 + * hIOMgr: Handle to a I/O manager.
11595 + * uZId: zero-copy channel identifier.
11596 + * Returns:
11597 + * Requires:
11598 + * uDDMAChnlId < DDMA_MAXZCPYCHNLS
11599 + * hIOMgr != Null
11600 + * Ensures:
11601 + */
11602 + extern void IO_DDZCInitChnlDesc(struct IO_MGR *hIOMgr, u32 uZId);
11605 + * ======== IO_DDZCClearChnlDesc ========
11606 + * Purpose:
11607 + * Clear DSP ZC channel descriptor.
11608 + * Parameters:
11609 + * hIOMgr: Handle to a I/O manager.
11610 + * uChnlId: ZC channel identifier.
11611 + * Returns:
11612 + * Requires:
11613 + * hIOMgr is valid
11614 + * uChnlId < DDMA_MAXZCPYCHNLS
11615 + * Ensures:
11616 + */
11617 + extern void IO_DDZCClearChnlDesc(struct IO_MGR *hIOMgr, u32 uChnlId);
11620 + * ======== IO_DDZCRequestChnl ========
11621 + * Purpose:
11622 + * Request zero-copy channel transfer. Sets up SM descriptors and
11623 + * control fields in shared memory.
11624 + * Parameters:
11625 + * hIOMgr: Handle to a I/O manager.
11626 + * pChnl: Ptr to channel object
11627 + * pChirp: Ptr to channel i/o request packet.
11628 + * Returns:
11629 + * Requires:
11630 + * pChnl != NULL
11631 + * pChnl->cIOReqs > 0
11632 + * pChirp != NULL
11633 + * Ensures:
11634 + */
11635 + extern void IO_DDZCRequestChnl(struct IO_MGR *hIOMgr,
11636 + struct CHNL_OBJECT *pChnl,
11637 + struct CHNL_IRP *pChirp,
11638 + OUT u16 *pwMbVal);
11641 + * ======== IO_SHMsetting ========
11642 + * Purpose:
11643 + * Sets the shared memory setting
11644 + * Parameters:
11645 + * hIOMgr: Handle to a I/O manager.
11646 + * desc: Shared memory type
11647 + * pArgs: Ptr to SHM setting
11648 + * Returns:
11649 + * Requires:
11650 + * hIOMgr != NULL
11651 + * pArgs != NULL
11652 + * Ensures:
11653 + */
11654 + extern DSP_STATUS IO_SHMsetting(IN struct IO_MGR *hIOMgr,
11655 + IN enum SHM_DESCTYPE desc,
11656 + IN void *pArgs);
11659 + * Misc functions for the CHNL_IO shared memory library:
11660 + */
11662 +/* Maximum channel bufsize that can be used. */
11663 + extern u32 IO_BufSize(struct IO_MGR *hIOMgr);
11665 + extern u32 IO_ReadValue(struct WMD_DEV_CONTEXT *hDevContext,
11666 + u32 dwDSPAddr);
11668 + extern void IO_WriteValue(struct WMD_DEV_CONTEXT *hDevContext,
11669 + u32 dwDSPAddr, u32 dwValue);
11671 + extern u32 IO_ReadValueLong(struct WMD_DEV_CONTEXT *hDevContext,
11672 + u32 dwDSPAddr);
11674 + extern void IO_WriteValueLong(struct WMD_DEV_CONTEXT *hDevContext,
11675 + u32 dwDSPAddr, u32 dwValue);
11677 + extern void IO_OrSetValue(struct WMD_DEV_CONTEXT *hDevContext,
11678 + u32 dwDSPAddr, u32 dwValue);
11680 + extern void IO_AndSetValue(struct WMD_DEV_CONTEXT *hDevContext,
11681 + u32 dwDSPAddr, u32 dwValue);
11683 + extern void IO_IntrDSP2(IN struct IO_MGR *pIOMgr, IN u16 wMbVal);
11685 +#endif /* IOSM_ */
11686 Index: lk/arch/arm/plat-omap/include/bridge/iodefs.h
11687 ===================================================================
11688 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11689 +++ lk/arch/arm/plat-omap/include/bridge/iodefs.h 2008-08-18 10:38:34.000000000 +0300
11690 @@ -0,0 +1,45 @@
11692 + * bridge/inc/iodefs.h
11694 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
11696 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
11698 + * This package is free software; you can redistribute it and/or modify
11699 + * it under the terms of the GNU General Public License version 2 as
11700 + * published by the Free Software Foundation.
11702 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11703 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11704 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11705 + */
11709 + * ======== iodefs.h ========
11710 + * Description:
11711 + * System-wide channel objects and constants.
11713 + *! Revision History:
11714 + *! ================
11715 + *! 07-Nov-2000 jeh Created.
11716 + */
11718 +#ifndef IODEFS_
11719 +#define IODEFS_
11721 +#define IO_MAXIRQ 0xff /* Arbitrarily large number. */
11723 +/* IO Objects: */
11724 + struct IO_MGR;
11726 +/* IO manager attributes: */
11727 + struct IO_ATTRS {
11728 + u8 bIRQ; /* Channel's I/O IRQ number. */
11729 + bool fShared; /* TRUE if the IRQ is shareable. */
11730 + u32 uWordSize; /* DSP Word size. */
11731 + u32 dwSMBase; /* Physical base address of shared memory. */
11732 + u32 uSMLength; /* Size (in bytes) of shared memory. */
11733 + } ;
11735 +#endif /* IODEFS_ */
11736 Index: lk/arch/arm/plat-omap/include/bridge/isr.h
11737 ===================================================================
11738 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11739 +++ lk/arch/arm/plat-omap/include/bridge/isr.h 2008-08-18 10:38:34.000000000 +0300
11740 @@ -0,0 +1,219 @@
11742 + * bridge/inc/isr.h
11744 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
11746 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
11748 + * This package is free software; you can redistribute it and/or modify
11749 + * it under the terms of the GNU General Public License version 2 as
11750 + * published by the Free Software Foundation.
11752 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11753 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11754 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11755 + */
11759 + * ======== isr.h ========
11760 + * Purpose:
11761 + * Interrupt services.
11763 + * Public Functions:
11764 + * ISR_Disable
11765 + * ISR_Exit
11766 + * ISR_GetStatus
11767 + * ISR_Init
11768 + * ISR_Install
11769 + * ISR_Restore
11770 + * ISR_SimulateInt
11771 + * ISR_Uninstall
11773 + * Notes:
11775 + *! Revision History:
11776 + *! ================
11777 + *! 01-Mar-2004 vp: Added IVA related functions.
11778 + *! 06-Feb-2003 kc: Added ISR_MAILBOX1 (renamed from DSP_MAILBOX1).
11779 + *! 05-Nov-2001 kc: Added interrupt type param to ISR_Install.
11780 + *! 31-Jan-2000 rr: Comments modified after code review.
11781 + *! 29-Oct-1999 kc: Moved header files to within ifdefed 'extern "C"'.
11782 + *! 17-Sep-1997 gp: Added CFG_HOSTRES struct as argument to ISR_Install, thus
11783 + *! breaking backward compatibility with Ver. 1.0 mini drivers.
11784 + *! 18-Aug-1997 cr: Added explicit CDECL identifiers.
11785 + *! 03-Feb-1996 gp: Changed behaviour of ISR_SimulateInt.
11786 + *! 24-Jul-1996 gp: Created.
11787 + */
11789 +#ifndef ISR_
11790 +#define ISR_
11791 +#include <host_os.h>
11792 +#include <cfg.h>
11794 +/* Interrupt Object handle: */
11795 + struct ISR_IRQ;
11797 +/* ISR install type (private) */
11798 +#define ISR_MAILBOX1 0x00000080 /* Arbitrary value */
11799 +#define ISR_MAILBOX2 0x00000081
11801 +/* Temporary until the baseport defines it */
11802 +#define MAIL_U3_MPU_IRQ 34
11804 + * ======== ISR_PROC ========
11805 + * Purpose:
11806 + * Routine to service an interrupt.
11807 + * Parameters:
11808 + * pRefData: Ptr to user data: passed in via ISR_Install.
11809 + * Returns:
11810 + * TRUE if the interrupt was handled; FALSE otherwise.
11811 + * Requires:
11812 + * ISR code must be in locked memory.
11813 + * All data touched must be locked.
11814 + * No resources should be acquired within the ISR.
11815 + * May only call asynchrounous services.
11816 + * Ensures:
11817 + * This routine must not affect the state of the physical PIC.
11818 + * (i.e.; don't send an EOI).
11819 + */
11820 + typedef bool (CDECL *ISR_PROC) (void *pRefData);
11823 + * ======== ISR_Disable ========
11824 + * Purpose:
11825 + * Turns off interrupts to begin a critical section of code.
11826 + * Not implemented in CE
11827 + * Parameters:
11828 + * pFlags: Location to store flags.
11829 + * Returns:
11830 + * Requires:
11831 + * Ensures:
11832 + */
11833 + extern void CDECL ISR_Disable(OUT u32 *pFlags);
11836 + * ======== ISR_Exit ========
11837 + * Purpose:
11838 + * Discontinue usage of the ISR module.
11839 + * Parameters:
11840 + * Returns:
11841 + * Requires:
11842 + * ISR_Init() was previously called.
11843 + * Ensures:
11844 + * Resources acquired in ISR_Init() are freed.
11845 + */
11846 + extern void CDECL ISR_Exit();
11849 + * ======== ISR_GetStatus ========
11850 + * Purpose:
11851 + * Return platform specific status flags containing information about
11852 + * a virtualized IRQ. Used by clients for debugging only.
11853 + * Not implemented.
11854 + * Parameters:
11855 + * hIRQ: Interrupt object handle as returned by ISR_Install().
11856 + * pdwFlags: Location to store status flags on output.
11857 + * Returns:
11858 + * DSP_SOK: Success;
11859 + * DSP_ENOTIMPL: Not implemented
11860 + * Requires:
11861 + * pdwFlags != NULL.
11862 + * Ensures:
11863 + */
11864 + extern DSP_STATUS CDECL ISR_GetStatus(IN struct ISR_IRQ *hIRQ,
11865 + OUT u32 *pdwFlags);
11868 + * ======== ISR_Init ========
11869 + * Purpose:
11870 + * Initialize the ISR module's private state.
11871 + * Parameters:
11872 + * Returns:
11873 + * TRUE if initialized; FALSE if error occured.
11874 + * Requires:
11875 + * Ensures:
11876 + * A requirement for each of the other public ISR functions.
11877 + */
11878 + extern bool CDECL ISR_Init();
11881 + * ======== ISR_Install ========
11882 + * Purpose:
11883 + * Register an ISR for a given IRQ with the system's interrupt manager.
11884 + * Parameters:
11885 + * phIRQ: Ptr to store a handle to an interrupt object.
11886 + * pHostConfig: Ptr to a host resource structure, containing both
11887 + * interrupt and bus info.
11888 + * pfnISR: ISR function. See definition of ISR_PROC.
11889 + * dwIntrType: Type of interrupt.
11890 + * pRefData: Pointer to user-defined reference data.
11891 + * Returns:
11892 + * DSP_SOK: ISR installed.
11893 + * DSP_EPOINTER: phIRQ == NULL.
11894 + * DSP_EMEMORY: Insufficient memory.
11895 + * DSP_EFAIL: Error registering the ISR for the IRQ.
11896 + * Requires:
11897 + * pHostConfig is a valid pointer to assigned host resources;
11898 + * iIRQ number is valid for this (host) processor.
11899 + * See requirements for ISR_PROC.
11900 + * Ensures:
11901 + * DSP_SOK: ISR is installed, and the IRQ is unmasked. The ISR can be
11902 + * called at any time until ISR_Uninstall() is called for this
11903 + * IRQ.
11904 + * else: *phIRQ is set to NULL.
11905 + */
11906 + extern DSP_STATUS CDECL ISR_Install(OUT struct ISR_IRQ **phIRQ,
11907 + IN CONST struct CFG_HOSTRES
11908 + *pHostConfig,
11909 + IN ISR_PROC pfnISR,
11910 + IN u32 dwIntrType,
11911 + IN void *pRefData);
11914 + * ======== ISR_Restore ========
11915 + * Purpose:
11916 + * In CE, the client should use ISR_Install to restore the interrupt.
11917 + * Parameters:
11918 + * saveFlags: To save or not to save.
11919 + * Returns:
11920 + * Requires:
11921 + * Ensures:
11922 + */
11923 + extern void CDECL ISR_Restore(IN u32 saveFlags);
11926 + * ======== ISR_SimulateInt ========
11927 + * Purpose:
11928 + * Simulate a hardware interrupt.
11929 + * Parameters:
11930 + * hIRQ: Interrupt object handle as returned by ISR_Install().
11931 + * Returns:
11932 + * DSP_SOK: Success;
11933 + * DSP_ENOTIMPL: Not yet implemented.
11934 + * DSP_EHANDLE: Invalid hIRQ.
11935 + * Requires:
11936 + * DSP_SOK: An interrupt handler must have been previously installed
11937 + * with ISR_Install().
11938 + * Ensures:
11939 + * DSP_SOK: The ISR installed by ISR_Install() will be called, before
11940 + * or after this function returns.
11941 + */
11942 + extern DSP_STATUS CDECL ISR_SimulateInt(IN struct ISR_IRQ *hIRQ);
11945 + * ======== ISR_Uninstall ========
11946 + * Purpose:
11947 + * Deregister the ISR previously installed by ISR_Install().
11948 + * Parameters:
11949 + * hIRQ: Handle to an IRQ object returned from ISR_Install().
11950 + * Returns:
11951 + * DSP_SOK: Success.
11952 + * DSP_EHANDLE: Invalid hIRQ.
11953 + * Requires:
11954 + * Ensures:
11955 + * (SUCCESS && hDPC is NULL) or DSP_EFAILED status
11956 + */
11957 + extern DSP_STATUS CDECL ISR_Uninstall(IN struct ISR_IRQ *hIRQ);
11959 +#endif /* ISR_ */
11960 Index: lk/arch/arm/plat-omap/include/bridge/kfile.h
11961 ===================================================================
11962 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11963 +++ lk/arch/arm/plat-omap/include/bridge/kfile.h 2008-08-18 10:38:34.000000000 +0300
11964 @@ -0,0 +1,216 @@
11966 + * bridge/inc/kfile.h
11968 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
11970 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
11972 + * This package is free software; you can redistribute it and/or modify
11973 + * it under the terms of the GNU General Public License version 2 as
11974 + * published by the Free Software Foundation.
11976 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11977 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11978 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11979 + */
11983 + * ======== kfile.h ========
11984 + * Purpose:
11985 + * Provide file I/O management capabilities.
11987 + * Public Functions:
11988 + * KFILE_Close
11989 + * KFILE_Exit
11990 + * KFILE_Init
11991 + * KFILE_Open
11992 + * KFILE_Read
11993 + * KFILE_Seek
11994 + * KFILE_Tell
11995 + * KFILE_Write
11997 + * Notes:
11998 + * The KFILE module is not like most of the other DSP/BIOS Bridge modules
11999 + * in that it doesn't return WSX_STATUS type values. Rather, it's
12000 + * prototypes are meant to match the stdio file prototypes
12001 + * (ie, fopen, fclose, etc.).
12003 + *! Revision History
12004 + *! ================
12005 + *! 29-Oct-1999 kc: Clean up for code review.
12006 + *! 07-Jan-1998 cr: Clean up for code review.
12007 + *! 15-Aug-1997 cr: Added E_KFILE_ERROR for general error condition.
12008 + *! 04-Aug-1997 cr: Added explicit CDECL descriptions.
12009 + *! 11-Nov-1996 cr: Implemented changes based on code review.
12010 + *! 05-Nov-1996 cr: Cleaned up for code review.
12011 + *! 29-May-1996 gp: Added requirement that size != 0 in _Write() and _Read().
12012 + *! 28-May-1996 mg: Changed return values for Read/Write.
12013 + *! 14-Dec-1995 cr: Created.
12014 + */
12016 +#ifndef KFILE_
12017 +#define KFILE_
12020 + * Constants for KFILE_Seek. Note that these MUST be the same definitions as
12021 + * those defined for fseek.
12022 + */
12023 +#define KFILE_SEEK_SET 0x00 /* seek from beginning of file */
12024 +#define KFILE_SEEK_CUR 0x01 /* seek from current position */
12025 +#define KFILE_SEEK_END 0x02 /* seek from end of file */
12027 + struct KFILE_FileObj;
12030 + * ======== KFILE_Close ========
12031 + * Purpose:
12032 + * This function closes a file's stream.
12033 + * Parameters:
12034 + * hFile: Handle of the file stream returned by KFILE_Open.
12035 + * Returns:
12036 + * E_KFILE_INVALIDHANDLE: bad handle.
12037 + * 0: success.
12038 + * E_KFILE_ERROR: unable to close specified handle.
12039 + * Requires:
12040 + * KFILE initialized.
12041 + * Ensures:
12042 + */
12043 + extern s32 KFILE_Close(IN struct KFILE_FileObj *hFile);
12046 + * ======== KFILE_Exit ========
12047 + * Purpose:
12048 + * Discontinue usage of module; free resources when reference count
12049 + * reaches 0.
12050 + * Parameters:
12051 + * Returns:
12052 + * Requires:
12053 + * KFILE initialized.
12054 + * Ensures:
12055 + * Resources used by module are freed when cRef reaches zero.
12056 + */
12057 + extern void KFILE_Exit();
12060 + * ======== KFILE_Init ========
12061 + * Purpose:
12062 + * Initializes private state of KFILE module.
12063 + * Parameters:
12064 + * Returns:
12065 + * TRUE if success, else FALSE.
12066 + * Requires:
12067 + * Ensures:
12068 + * KFILE initialized.
12069 + */
12070 + extern bool KFILE_Init();
12073 + * ======== KFILE_Open ========
12074 + * Purpose:
12075 + * Opens a file for use.
12076 + * Parameters:
12077 + * pszFileName: Full path to name of the file to open.
12078 + * pszMode: String containing open status. Only the first
12079 + * character of the string is examined, for either
12080 + * "r" (read) or "w" (write) mode.
12081 + * Returns:
12082 + * A valid file handle if success, else NULL.
12083 + * Requires:
12084 + * - KFILE initialized.
12085 + * - pszMode != NULL.
12086 + * - pszFileName != NULL.
12087 + * Ensures:
12088 + */
12089 + extern struct KFILE_FileObj *KFILE_Open(IN CONST char *filename,
12090 + IN CONST char *mode);
12093 + * ======== KFILE_Read ========
12094 + * Purpose:
12095 + * This function reads a specified number of bytes into a buffer.
12096 + * Parameters:
12097 + * pBuffer: Array to which the file data is copied.
12098 + * cSize: Number of characters in each object.
12099 + * cCount: Number of objects to read in.
12100 + * hFile: Handle of the file stream returned by KFILE_Open.
12101 + * Returns:
12102 + * E_KFILE_INVALIDHANDLE: bad file handle.
12103 + * E_KFILE_ERROR: general failure.
12104 + * > 0: success; # of objects read from file.
12105 + * Requires:
12106 + * KFILE initialized.
12107 + * pBuffer is a valid pointer.
12108 + * Ensures:
12109 + */
12110 + extern s32 KFILE_Read(OUT void *buffer,
12111 + IN s32 size, IN s32 count,
12112 + IN struct KFILE_FileObj *hFile);
12115 + * ======== KFILE_Seek ========
12116 + * Purpose:
12117 + * This function sets the file position indicator. NOTE: we don't
12118 + * support seeking beyond the boundaries of a file.
12119 + * Parameters:
12120 + * hFile: Handle of the file stream returned by KFILE_Open.
12121 + * offset: Number of bytes from the origin to move.
12122 + * origin: File reference point, one of the following values:
12123 + * KFILE_SEEK_SET: Seek from beginning of file.
12124 + * KFILE_SEEK_CUR: Seek from current position.
12125 + * KFILE_SEEK_END: Seek from end of file.
12126 + * Returns:
12127 + * 0: success.
12128 + * E_KFILE_INVALIDHANDLE: bad handle.
12129 + * E_KFILE_BADORIGIN: invalid origin paramater.
12130 + * E_KFILE_ERROR: general failure.
12131 + * Requires:
12132 + * KFILE initialized.
12133 + * Ensures:
12134 + */
12135 + extern s32 KFILE_Seek(IN struct KFILE_FileObj *hFile,
12136 + IN s32 offset, IN s32 origin);
12139 + * ======== KFILE_Tell ========
12140 + * Purpose:
12141 + * This function reports the current value of the position indicator.
12142 + * Parameters:
12143 + * hFile: Handle of the file stream returned by KFILE_Open.
12144 + * Return value:
12145 + * > 0: success; returns # of bytes the position indicator is from
12146 + * beginning of file.
12147 + * E_KFILE_ERROR: general failure.
12148 + * E_KFILE_INVALIDHANDLE: bad file handle.
12149 + * Requires:
12150 + * KFILE initialized.
12151 + * Ensures:
12152 + */
12153 + extern s32 KFILE_Tell(IN struct KFILE_FileObj *hFile);
12156 + * ======== KFILE_Write ========
12157 + * Purpose:
12158 + * This function writes a number of objects to the stream.
12159 + * Parameters:
12160 + * pBuffer: Array from which the file data is written.
12161 + * cSize: Number of characters in each object.
12162 + * cCount: Number of objects to write out.
12163 + * hFile: Handle of the file stream returned by KFILE_Open.
12164 + * Returns:
12165 + * E_KFILE_INVALIDHANDLE: bad file handle.
12166 + * E_KFILE_ERROR: general failure.
12167 + * > 0: success; # of objects written to file.
12168 + * Requires:
12169 + * KFILE initialized.
12170 + * pBuffer != NULL.
12171 + * Postcondition:
12172 + * The file position indicator is advanced by the number of
12173 + * characters written.
12174 + */
12175 + extern s32 KFILE_Write(OUT void *buffer,
12176 + IN s32 size,
12177 + IN s32 count,
12178 + IN struct KFILE_FileObj *hFile);
12180 +#endif /* KFILE_ */
12181 Index: lk/arch/arm/plat-omap/include/bridge/ldr.h
12182 ===================================================================
12183 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
12184 +++ lk/arch/arm/plat-omap/include/bridge/ldr.h 2008-08-18 10:38:34.000000000 +0300
12185 @@ -0,0 +1,51 @@
12187 + * bridge/inc/ldr.h
12189 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
12191 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
12193 + * This package is free software; you can redistribute it and/or modify
12194 + * it under the terms of the GNU General Public License version 2 as
12195 + * published by the Free Software Foundation.
12197 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
12198 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12199 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12200 + */
12204 + * ======== ldr.h ========
12205 + * Purpose:
12206 + * Provide module loading services and symbol export services.
12208 + * Public Functions:
12209 + * LDR_Exit
12210 + * LDR_FreeModule
12211 + * LDR_GetProcAddress
12212 + * LDR_Init
12213 + * LDR_LoadModule
12215 + * Notes:
12216 + * This service is meant to be used by modules of the DSP/BIOS Bridge
12217 + * class driver.
12219 + *! Revision History:
12220 + *! ================
12221 + *! 22-Nov-1999 kc: Changes from code review.
12222 + *! 12-Nov-1999 kc: Removed declaration of unused loader object.
12223 + *! 29-Oct-1999 kc: Cleaned up for code review.
12224 + *! 12-Jan-1998 cr: Cleaned up for code review.
12225 + *! 04-Aug-1997 cr: Added explicit CDECL identifiers.
12226 + *! 11-Nov-1996 cr: Cleaned up for code review.
12227 + *! 16-May-1996 gp: Created.
12228 + */
12230 +#ifndef LDR_
12231 +#define LDR_
12233 +/* Loader objects: */
12234 + struct LDR_MODULE;
12236 +#endif /* LDR_ */
12237 Index: lk/arch/arm/plat-omap/include/bridge/list.h
12238 ===================================================================
12239 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
12240 +++ lk/arch/arm/plat-omap/include/bridge/list.h 2008-08-18 10:38:34.000000000 +0300
12241 @@ -0,0 +1,296 @@
12243 + * bridge/inc/list.h
12245 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
12247 + * Copyright (C) 2008 Texas Instruments, Inc.
12249 + * This package is free software; you can redistribute it and/or modify
12250 + * it under the terms of the GNU General Public License version 2 as
12251 + * published by the Free Software Foundation.
12253 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
12254 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12255 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12256 + */
12260 + * ======== list.h ========
12261 + * Purpose:
12262 + * Declarations of list management control structures and definitions
12263 + * of inline list management functions.
12265 + * Public Functions:
12266 + * LST_Create
12267 + * LST_Delete
12268 + * LST_Exit
12269 + * LST_First
12270 + * LST_GetHead
12271 + * LST_InitElem
12272 + * LST_Init
12273 + * LST_InsertBefore
12274 + * LST_IsEmpty
12275 + * LST_Next
12276 + * LST_PutTail
12277 + * LST_RemoveElem
12279 + * Notes:
12281 + *! Revision History
12282 + *! ================
12283 + *! 10-Aug-2000 ag: Added LST_InsertBefore().
12284 + *! 29-Oct-1999 kc: Cleaned up for code review.
12285 + *! 16-Aug-1997 cr: added explicit identifiers.
12286 + *! 10-Aug-1996 gp: Acquired from SMM for WinSPOX v.1.1; renamed identifiers.
12287 + *! 21-Oct-1994 dh4: Cleaned / commented for code review.
12288 + *! 08-Jun-1994 dh4: Converted to SPM (added extern "C").
12289 + */
12291 +#ifndef LIST_
12292 +#define LIST_
12294 +#include <host_os.h>
12296 +#define LST_IsEmpty(l) (((l)->head.next == &(l)->head))
12298 + struct LST_ELEM {
12299 + struct LST_ELEM *next;
12300 + struct LST_ELEM *prev;
12301 + struct LST_ELEM *self;
12302 + } ;
12304 + struct LST_LIST {
12305 + struct LST_ELEM head;
12306 + } ;
12309 + * ======== LST_Create ========
12310 + * Purpose:
12311 + * Allocates and initializes a circular list.
12312 + * Details:
12313 + * Uses portable MEM_Calloc() function to allocate a list containing
12314 + * a single element and initializes that element to indicate that it
12315 + * is the "end of the list" (i.e., the list is empty).
12316 + * An empty list is indicated by the "next" pointer in the element
12317 + * at the head of the list pointing to the head of the list, itself.
12318 + * Parameters:
12319 + * Returns:
12320 + * Pointer to beginning of created list (success)
12321 + * NULL --> Allocation failed
12322 + * Requires:
12323 + * LST initialized.
12324 + * Ensures:
12325 + * Notes:
12326 + * The created list contains a single element. This element is the
12327 + * "empty" element, because its "next" and "prev" pointers point at
12328 + * the same location (the element itself).
12329 + */
12330 + extern struct LST_LIST *LST_Create();
12333 + * ======== LST_Delete ========
12334 + * Purpose:
12335 + * Removes a list by freeing its control structure's memory space.
12336 + * Details:
12337 + * Uses portable MEM_Free() function to deallocate the memory
12338 + * block pointed at by the input parameter.
12339 + * Parameters:
12340 + * pList: Pointer to list control structure of list to be deleted
12341 + * Returns:
12342 + * Void
12343 + * Requires:
12344 + * - LST initialized.
12345 + * - pList != NULL.
12346 + * Ensures:
12347 + * Notes:
12348 + * Must ONLY be used for empty lists, because it does not walk the
12349 + * chain of list elements. Calling this function on a non-empty list
12350 + * will cause a memory leak.
12351 + */
12352 + extern void LST_Delete(IN struct LST_LIST *pList);
12355 + * ======== LST_Exit ========
12356 + * Purpose:
12357 + * Discontinue usage of module; free resources when reference count
12358 + * reaches 0.
12359 + * Parameters:
12360 + * Returns:
12361 + * Requires:
12362 + * LST initialized.
12363 + * Ensures:
12364 + * Resources used by module are freed when cRef reaches zero.
12365 + */
12366 + extern void LST_Exit();
12369 + * ======== LST_First ========
12370 + * Purpose:
12371 + * Returns a pointer to the first element of the list, or NULL if the list
12372 + * is empty.
12373 + * Parameters:
12374 + * pList: Pointer to list control structure.
12375 + * Returns:
12376 + * Pointer to first list element, or NULL.
12377 + * Requires:
12378 + * - LST initialized.
12379 + * - pList != NULL.
12380 + * Ensures:
12381 + */
12382 + extern struct LST_ELEM *LST_First(IN struct LST_LIST *pList);
12385 + * ======== LST_GetHead ========
12386 + * Purpose:
12387 + * Pops the head off the list and returns a pointer to it.
12388 + * Details:
12389 + * If the list is empty, returns NULL.
12390 + * Else, removes the element at the head of the list, making the next
12391 + * element the head of the list.
12392 + * The head is removed by making the tail element of the list point its
12393 + * "next" pointer at the next element after the head, and by making the
12394 + * "prev" pointer of the next element after the head point at the tail
12395 + * element. So the next element after the head becomes the new head of
12396 + * the list.
12397 + * Parameters:
12398 + * pList: Pointer to list control structure of list whose head
12399 + * element is to be removed
12400 + * Returns:
12401 + * Pointer to element that was at the head of the list (success)
12402 + * NULL No elements in list
12403 + * Requires:
12404 + * - head.self must be correctly set to &head.
12405 + * - LST initialized.
12406 + * - pList != NULL.
12407 + * Ensures:
12408 + * Notes:
12409 + * Because the tail of the list points forward (its "next" pointer) to
12410 + * the head of the list, and the head of the list points backward (its
12411 + * "prev" pointer) to the tail of the list, this list is circular.
12412 + */
12413 + extern struct LST_ELEM *LST_GetHead(IN struct LST_LIST *pList);
12416 + * ======== LST_Init ========
12417 + * Purpose:
12418 + * Initializes private state of LST module.
12419 + * Parameters:
12420 + * Returns:
12421 + * TRUE if initialized; FALSE otherwise.
12422 + * Requires:
12423 + * Ensures:
12424 + * LST initialized.
12425 + */
12426 + extern bool LST_Init();
12429 + * ======== LST_InitElem ========
12430 + * Purpose:
12431 + * Initializes a list element to default (cleared) values
12432 + * Details:
12433 + * Parameters:
12434 + * pElem: Pointer to list element to be reset
12435 + * Returns:
12436 + * Requires:
12437 + * LST initialized.
12438 + * Ensures:
12439 + * Notes:
12440 + * This function must not be called to "reset" an element in the middle
12441 + * of a list chain -- that would break the chain.
12443 + */
12444 + extern void LST_InitElem(IN struct LST_ELEM *pListElem);
12447 + * ======== LST_InsertBefore ========
12448 + * Purpose:
12449 + * Insert the element before the existing element.
12450 + * Parameters:
12451 + * pList: Pointer to list control structure.
12452 + * pElem: Pointer to element in list to insert.
12453 + * pElemExisting: Pointer to existing list element.
12454 + * Returns:
12455 + * Requires:
12456 + * - LST initialized.
12457 + * - pList != NULL.
12458 + * - pElem != NULL.
12459 + * - pElemExisting != NULL.
12460 + * Ensures:
12461 + */
12462 + extern void LST_InsertBefore(IN struct LST_LIST *pList,
12463 + IN struct LST_ELEM *pElem,
12464 + IN struct LST_ELEM *pElemExisting);
12467 + * ======== LST_Next ========
12468 + * Purpose:
12469 + * Returns a pointer to the next element of the list, or NULL if the next
12470 + * element is the head of the list or the list is empty.
12471 + * Parameters:
12472 + * pList: Pointer to list control structure.
12473 + * pCurElem: Pointer to element in list to remove.
12474 + * Returns:
12475 + * Pointer to list element, or NULL.
12476 + * Requires:
12477 + * - LST initialized.
12478 + * - pList != NULL.
12479 + * - pCurElem != NULL.
12480 + * Ensures:
12481 + */
12482 + extern struct LST_ELEM *LST_Next(IN struct LST_LIST *pList,
12483 + IN struct LST_ELEM *pCurElem);
12486 + * ======== LST_PutTail ========
12487 + * Purpose:
12488 + * Adds the specified element to the tail of the list
12489 + * Details:
12490 + * Sets new element's "prev" pointer to the address previously held by
12491 + * the head element's prev pointer. This is the previous tail member of
12492 + * the list.
12493 + * Sets the new head's prev pointer to the address of the element.
12494 + * Sets next pointer of the previous tail member of the list to point to
12495 + * the new element (rather than the head, which it had been pointing at).
12496 + * Sets new element's next pointer to the address of the head element.
12497 + * Sets head's prev pointer to the address of the new element.
12498 + * Parameters:
12499 + * pList: Pointer to list control structure to which *pElem will be
12500 + * added
12501 + * pElem: Pointer to list element to be added
12502 + * Returns:
12503 + * Void
12504 + * Requires:
12505 + * *pElem and *pList must both exist.
12506 + * pElem->self = pElem before pElem is passed to this function.
12507 + * LST initialized.
12508 + * Ensures:
12509 + * Notes:
12510 + * Because the tail is always "just before" the head of the list (the
12511 + * tail's "next" pointer points at the head of the list, and the head's
12512 + * "prev" pointer points at the tail of the list), the list is circular.
12513 + * Warning: if pElem->self is not set beforehand, LST_GetHead() will
12514 + * return an erroneous pointer when it is called for this element.
12515 + */
12516 + extern void LST_PutTail(IN struct LST_LIST *pList,
12517 + IN struct LST_ELEM *pListElem);
12520 + * ======== LST_RemoveElem ========
12521 + * Purpose:
12522 + * Removes (unlinks) the given element from the list, if the list is not
12523 + * empty. Does not free the list element.
12524 + * Parameters:
12525 + * pList: Pointer to list control structure.
12526 + * pCurElem: Pointer to element in list to remove.
12527 + * Returns:
12528 + * Requires:
12529 + * - LST initialized.
12530 + * - pList != NULL.
12531 + * - pCurElem != NULL.
12532 + * Ensures:
12533 + */
12534 +extern void LST_RemoveElem(IN struct LST_LIST *pList,
12535 + IN struct LST_ELEM *pCurElem);
12537 +#endif /* LIST_ */
12538 Index: lk/arch/arm/plat-omap/include/bridge/mbx_sh.h
12539 ===================================================================
12540 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
12541 +++ lk/arch/arm/plat-omap/include/bridge/mbx_sh.h 2008-08-18 10:38:34.000000000 +0300
12542 @@ -0,0 +1,213 @@
12544 + * bridge/inc/mbx_sh.h
12546 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
12548 + * Copyright (C) 2008 Texas Instruments, Inc.
12550 + * This package is free software; you can redistribute it and/or modify
12551 + * it under the terms of the GNU General Public License version 2 as
12552 + * published by the Free Software Foundation.
12554 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
12555 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12556 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12557 + */
12561 + * ======== mbx_sh.h ========
12562 + * Definitions for shared mailbox cmd/data values.(used on both
12563 + * the GPP and DSP sides).
12565 + * Bridge usage of OMAP mailbox 1 is determined by the "class" of the
12566 + * mailbox interrupt's cmd value received. The class value are defined
12567 + * as a bit (10 thru 15) being set.
12569 + * Note: Only 16 bits of each is used. Other 16 bit data reg available.
12571 + * 16 bit Mbx bit defns:
12573 + * A). Exception/Error handling (Module DEH) : class = 0.
12575 + * 15 10 0
12576 + * ---------------------------------
12577 + * |0|0|0|0|0|0|x|x|x|x|x|x|x|x|x|x|
12578 + * ---------------------------------
12579 + * | (class) | (module specific) |
12583 + * B: DSP-DMA link driver channels (DDMA) : class = 1.
12585 + * 15 10 0
12586 + * ---------------------------------
12587 + * |0|0|0|0|0|1|b|b|b|b|b|c|c|c|c|c|
12588 + * ---------------------------------
12589 + * | (class) | (module specific) |
12591 + * where b -> buffer index (32 DDMA buffers/chnl max)
12592 + * c -> channel Id (32 DDMA chnls max)
12597 + * C: Proc-copy link driver channels (PCPY) : class = 2.
12599 + * 15 10 0
12600 + * ---------------------------------
12601 + * |0|0|0|0|1|0|x|x|x|x|x|x|x|x|x|x|
12602 + * ---------------------------------
12603 + * | (class) | (module specific) |
12606 + * D: Zero-copy link driver channels (DDZC) : class = 4.
12608 + * 15 10 0
12609 + * ---------------------------------
12610 + * |0|0|0|1|0|0|x|x|x|x|x|c|c|c|c|c|
12611 + * ---------------------------------
12612 + * | (class) | (module specific) |
12614 + * where x -> not used
12615 + * c -> channel Id (32 ZCPY chnls max)
12618 + * E: Power management : class = 8.
12620 + * 15 10 0
12621 + * ---------------------------------
12622 + * |0|0|1|0|0|0|x|x|x|x|x|c|c|c|c|c|
12624 + * 0010 00xx xxxc cccc
12625 + * 0010 00nn pppp qqqq
12626 + * nn:
12627 + * 00 = reserved
12628 + * 01 = pwr state change
12629 + * 10 = opp pre-change
12630 + * 11 = opp post-change
12632 + * if nn = pwr state change:
12633 + * pppp = don't care
12634 + * qqqq:
12635 + * 0010 = hibernate
12636 + * 0010 0001 0000 0010
12637 + * 0110 = retention
12638 + * 0010 0001 0000 0110
12639 + * others reserved
12641 + * if nn = opp pre-change:
12642 + * pppp = current opp
12643 + * qqqq = next opp
12645 + * if nn = opp post-change:
12646 + * pppp = prev opp
12647 + * qqqq = current opp
12649 + * ---------------------------------
12650 + * | (class) | (module specific) |
12652 + * where x -> not used
12653 + * c -> Power management command
12657 + *! Revision History:
12658 + *! ================
12659 + *! 19-Sep-2002 mr Added DEH reset const
12660 + *! 24-Apr-2002 sg Added more PM commands.
12661 + *! 04-Mar-2002 gv Added MBX_PM_CLASS
12662 + *! 22-Jan-2002 ag Bug fix in MBX_SETZCPYVAL(x) macro.
12663 + *! 21-Dec-2001 ag Added bit masks defns.
12664 + *! 17-Dec-2001 ag: created.
12665 + */
12667 +#ifndef _MBX_SH_H
12668 +#define _MBX_SH_H
12670 +#define MBX_CLASS_MSK 0xFC00 /* Class bits are 10 thru 15 */
12671 +#define MBX_VALUE_MSK 0x03FF /* Value is 0 thru 9 */
12673 +#define MBX_DEH_CLASS 0x0000 /* DEH owns Mbx INTR */
12674 +#define MBX_DDMA_CLASS 0x0400 /* DSP-DMA link drvr chnls owns INTR */
12675 +#define MBX_PCPY_CLASS 0x0800 /* PROC-COPY " */
12676 +#define MBX_ZCPY_CLASS 0x1000 /* ZERO-COPY " */
12677 +#define MBX_PM_CLASS 0x2000 /* Power Management */
12678 +#define MBX_DBG_CLASS 0x4000 /* For debugging purpose */
12681 + * Exception Handler codes
12682 + * Magic code used to determine if DSP signaled exception.
12683 + */
12684 +#define MBX_DEH_BASE 0x0
12685 +#define MBX_DEH_USERS_BASE 0x100 /* 256 */
12686 +#define MBX_DEH_LIMIT 0x3FF /* 1023 */
12687 +#define MBX_DEH_RESET 0x101 /* DSP RESET (DEH) */
12688 +#define MBX_DEH_EMMU 0X103 /*DSP MMU FAULT RECOVERY*/
12691 + * Link driver command/status codes.
12692 + */
12693 +/* DSP-DMA */
12694 +#define MBX_DDMA_NUMCHNLBITS 5 /* # chnl Id: # bits available */
12695 +#define MBX_DDMA_CHNLSHIFT 0 /* # of bits to shift */
12696 +#define MBX_DDMA_CHNLMSK 0x01F /* bits 0 thru 4 */
12698 +#define MBX_DDMA_NUMBUFBITS 5 /* buffer index: # of bits avail */
12699 +#define MBX_DDMA_BUFSHIFT (MBX_DDMA_NUMCHNLBITS + MBX_DDMA_CHNLSHIFT)
12700 +#define MBX_DDMA_BUFMSK 0x3E0 /* bits 5 thru 9 */
12702 +/* Zero-Copy */
12703 +#define MBX_ZCPY_NUMCHNLBITS 5 /* # chnl Id: # bits available */
12704 +#define MBX_ZCPY_CHNLSHIFT 0 /* # of bits to shift */
12705 +#define MBX_ZCPY_CHNLMSK 0x01F /* bits 0 thru 4 */
12707 +/* Power Management Commands */
12708 +#define MBX_PM_DSPIDLE (MBX_PM_CLASS + 0x0)
12709 +#define MBX_PM_DSPWAKEUP (MBX_PM_CLASS + 0x1)
12710 +#define MBX_PM_EMERGENCYSLEEP (MBX_PM_CLASS + 0x2)
12711 +#define MBX_PM_SLEEPUNTILRESTART (MBX_PM_CLASS + 0x3)
12712 +#define MBX_PM_DSPGLOBALIDLE_OFF (MBX_PM_CLASS + 0x4)
12713 +#define MBX_PM_DSPGLOBALIDLE_ON (MBX_PM_CLASS + 0x5)
12714 +#define MBX_PM_SETPOINT_PRENOTIFY (MBX_PM_CLASS + 0x6)
12715 +#define MBX_PM_SETPOINT_POSTNOTIFY (MBX_PM_CLASS + 0x7)
12716 +#define MBX_PM_DSPRETN (MBX_PM_CLASS + 0x8)
12717 +#define MBX_PM_DSPRETENTION (MBX_PM_CLASS + 0x8)
12718 +#define MBX_PM_DSPHIBERNATE (MBX_PM_CLASS + 0x9)
12719 +#define MBX_PM_HIBERNATE_EN (MBX_PM_CLASS + 0xA)
12720 +#define MBX_PM_OPP_REQ (MBX_PM_CLASS + 0xB)
12721 +#define MBX_PM_OPP_CHG (MBX_PM_CLASS + 0xC)
12723 +#define MBX_PM_TYPE_MASK 0x0300
12724 +#define MBX_PM_TYPE_PWR_CHNG 0x0100
12725 +#define MBX_PM_TYPE_OPP_PRECHNG 0x0200
12726 +#define MBX_PM_TYPE_OPP_POSTCHNG 0x0300
12727 +#define MBX_PM_TYPE_OPP_MASK 0x0300
12728 +#define MBX_PM_OPP_PRECHNG (MBX_PM_CLASS | MBX_PM_TYPE_OPP_PRECHNG)
12729 +/* DSP to MPU */
12730 +#define MBX_PM_OPP_CHNG(OPP) (MBX_PM_CLASS | MBX_PM_TYPE_OPP_PRECHNG | (OPP))
12731 +#define MBX_PM_RET (MBX_PM_CLASS | MBX_PM_TYPE_PWR_CHNG | 0x0006)
12732 +#define MBX_PM_HIB (MBX_PM_CLASS | MBX_PM_TYPE_PWR_CHNG | 0x0002)
12733 +#define MBX_PM_OPP_1 0
12734 +#define MBX_PM_OPP_2 1
12735 +#define MBX_PM_OPP_3 2
12736 +#define MBX_PM_OPP_4 3
12737 +#define MBX_OLDOPP_EXTRACT(OPPMSG) ((0x00F0 & (OPPMSG)) >> 4)
12738 +#define MBX_NEWOPP_EXTRACT(OPPMSG) (0x000F & (OPPMSG))
12739 +#define MBX_PREVOPP_EXTRACT(OPPMSG) ((0x00F0 & (OPPMSG)) >> 4)
12740 +#define MBX_CUROPP_EXTRACT(OPPMSG) (0x000F & (OPPMSG))
12742 +/* Bridge Debug Commands */
12743 +#define MBX_DBG_SYSPRINTF (MBX_DBG_CLASS + 0x0)
12746 + * Useful macros
12747 + */
12748 +/* DSP-DMA channel */
12749 +#define MBX_SETDDMAVAL(x, y) (MBX_DDMA_CLASS | (x << MBX_DDMA_BUFSHIFT) | \
12750 + (y << MBX_DDMA_CHNLSHIFT))
12752 +/* Zero-Copy channel */
12753 +#define MBX_SETZCPYVAL(x) (MBX_ZCPY_CLASS | (x << MBX_ZCPY_CHNLSHIFT))
12755 +#endif /* _MBX_SH_H */
12756 Index: lk/arch/arm/plat-omap/include/bridge/mem.h
12757 ===================================================================
12758 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
12759 +++ lk/arch/arm/plat-omap/include/bridge/mem.h 2008-08-18 10:38:34.000000000 +0300
12760 @@ -0,0 +1,340 @@
12762 + * bridge/inc/mem.h
12764 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
12766 + * Copyright (C) 2008 Texas Instruments, Inc.
12768 + * This package is free software; you can redistribute it and/or modify
12769 + * it under the terms of the GNU General Public License version 2 as
12770 + * published by the Free Software Foundation.
12772 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
12773 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12774 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12775 + */
12779 + * ======== mem.h ========
12780 + * Purpose:
12781 + * Memory management and address mapping services for the DSP/BIOS Bridge
12782 + * class driver and mini-driver.
12784 + * Public Functions:
12785 + * MEM_Alloc
12786 + * MEM_AllocObject
12787 + * MEM_AllocPhysMem
12788 + * MEM_Calloc
12789 + * MEM_Exit
12790 + * MEM_FlushCache
12791 + * MEM_Free
12792 + * MEM_FreeObject
12793 + * MEM_FreePhysMem
12794 + * MEM_GetNumPages
12795 + * MEM_Init
12796 + * MEM_IsValidHandle
12797 + * MEM_LinearAddress
12798 + * MEM_PageLock
12799 + * MEM_PageUnlock
12800 + * MEM_UnMapLinearAddress
12801 + * MEM_VirtualToPhysical
12803 + * Notes:
12805 + *! Revision History:
12806 + *! ================
12807 + *! 19-Apr-2004 sb: Added Alloc/Free PhysMem, FlushCache, VirtualToPhysical
12808 + *! 01-Sep-2001 ag: Cleaned up notes for MEM_LinearAddress() does not
12809 + *! require phys address to be page aligned!
12810 + *! 02-Dec-1999 rr: stdwin.h included for retail build
12811 + *! 12-Nov-1999 kc: Added warning about use of MEM_LinearAddress.
12812 + *! 29-Oct-1999 kc: Cleaned up for code review.
12813 + *! 10-Aug-1999 kc: Based on wsx-c18.
12814 + *! 07-Jan-1998 gp: Added MEM_AllocUMB and MEM_UMBFree for User Mapped Buffers
12815 + *! used by WMD_CHNL.
12816 + *! 23-Dec-1997 cr: Code review cleanup, removed dead Ring 3 code.
12817 + *! 04-Aug-1997 cr: Added explicit CDECL identifiers.
12818 + *! 01-Nov-1996 gp: Updated based on code review.
12819 + *! 04-Sep-1996 gp: Added MEM_PageLock() and MEM_PageUnlock() services.
12820 + *! 14-Aug-1996 mg: Added MEM_GetPhysAddr() and MEM_GetNumPages()
12821 + *! 25-Jul-1996 gp: Added MEM_IsValidHandle() macro.
12822 + *! 10-May-1996 gp: Added MEM_Calloc().
12823 + *! 25-Apr-1996 gp: Added MEM_PhysicalAddress()
12824 + *! 17-Apr-1996 gp: Added MEM_Exit function; updated to latest naming standard.
12825 + *! 08-Apr-1996 gp: Created.
12826 + */
12828 +#ifndef MEM_
12829 +#define MEM_
12831 +#include <host_os.h>
12832 +#include <memdefs.h>
12835 + * ======== MEM_Alloc ========
12836 + * Purpose:
12837 + * Allocate memory from the paged or non-paged pools.
12838 + * Parameters:
12839 + * cBytes: Number of bytes to allocate.
12840 + * type: Type of memory to allocate; one of:
12841 + * MEM_PAGED: Allocate from pageable memory.
12842 + * MEM_NONPAGED: Allocate from page locked memory.
12843 + * Returns:
12844 + * Pointer to a block of memory;
12845 + * NULL if memory couldn't be allocated, if cBytes == 0, or if type is
12846 + * not one of MEM_PAGED or MEM_NONPAGED.
12847 + * Requires:
12848 + * MEM initialized.
12849 + * Ensures:
12850 + * The returned pointer, if not NULL, points to a valid memory block of
12851 + * the size requested.
12852 + */
12853 + extern void *MEM_Alloc(IN u32 cBytes, IN enum MEM_POOLATTRS type);
12856 + * ======== MEM_AllocObject ========
12857 + * Purpose:
12858 + * Allocate an object, and set it's signature.
12859 + * Parameters:
12860 + * pObj: Pointer to the new object.
12861 + * Obj: Type of the object to allocate.
12862 + * Signature: Magic field value. Must be non-zero.
12863 + * Returns:
12864 + * Requires:
12865 + * Same requirements as MEM_Calloc(); and
12866 + * The object structure has a dwSignature field. The compiler ensures
12867 + * this requirement.
12868 + * Ensures:
12869 + * A subsequent call to MEM_IsValidHandle() will succeed for this object.
12870 + */
12871 +#define MEM_AllocObject(pObj, Obj, Signature) \
12872 +{ \
12873 + pObj = MEM_Calloc(sizeof(Obj), MEM_NONPAGED); \
12874 + if (pObj) { \
12875 + pObj->dwSignature = Signature; \
12876 + } \
12879 +/* ======== MEM_AllocPhysMem ========
12880 + * Purpose:
12881 + * Allocate physically contiguous, uncached memory
12882 + * Parameters:
12883 + * cBytes: Number of bytes to allocate.
12884 + * ulAlign: Alignment Mask.
12885 + * pPhysicalAddress: Physical address of allocated memory.
12886 + * Returns:
12887 + * Pointer to a block of memory;
12888 + * NULL if memory couldn't be allocated, or if cBytes == 0.
12889 + * Requires:
12890 + * MEM initialized.
12891 + * Ensures:
12892 + * The returned pointer, if not NULL, points to a valid memory block of
12893 + * the size requested. Returned physical address refers to physical
12894 + * location of memory.
12895 + */
12896 + extern void *MEM_AllocPhysMem(IN u32 cBytes,
12897 + IN u32 ulAlign,
12898 + OUT u32 *pPhysicalAddress);
12901 + * ======== MEM_Calloc ========
12902 + * Purpose:
12903 + * Allocate zero-initialized memory from the paged or non-paged pools.
12904 + * Parameters:
12905 + * cBytes: Number of bytes to allocate.
12906 + * type: Type of memory to allocate; one of:
12907 + * MEM_PAGED: Allocate from pageable memory.
12908 + * MEM_NONPAGED: Allocate from page locked memory.
12909 + * Returns:
12910 + * Pointer to a block of zeroed memory;
12911 + * NULL if memory couldn't be allocated, if cBytes == 0, or if type is
12912 + * not one of MEM_PAGED or MEM_NONPAGED.
12913 + * Requires:
12914 + * MEM initialized.
12915 + * Ensures:
12916 + * The returned pointer, if not NULL, points to a valid memory block
12917 + * of the size requested.
12918 + */
12919 + extern void *MEM_Calloc(IN u32 cBytes, IN enum MEM_POOLATTRS type);
12922 + * ======== MEM_Exit ========
12923 + * Purpose:
12924 + * Discontinue usage of module; free resources when reference count
12925 + * reaches 0.
12926 + * Parameters:
12927 + * Returns:
12928 + * Requires:
12929 + * MEM is initialized.
12930 + * Ensures:
12931 + * Resources used by module are freed when cRef reaches zero.
12932 + */
12933 + extern void MEM_Exit();
12936 + * ======== MEM_FlushCache ========
12937 + * Purpose:
12938 + * Performs system cache sync with discard
12939 + * Parameters:
12940 + * pMemBuf: Pointer to memory region to be flushed.
12941 + * pMemBuf: Size of the memory region to be flushed.
12942 + * Returns:
12943 + * Requires:
12944 + * MEM is initialized.
12945 + * Ensures:
12946 + * Cache is synchronized
12947 + */
12948 + extern void MEM_FlushCache(void *pMemBuf, u32 cBytes, s32 FlushType);
12951 + * ======== MEM_Free ========
12952 + * Purpose:
12953 + * Free the given block of system memory.
12954 + * Parameters:
12955 + * pMemBuf: Pointer to memory allocated by MEM_Calloc/Alloc().
12956 + * Returns:
12957 + * Requires:
12958 + * MEM initialized.
12959 + * pMemBuf is a valid memory address returned by MEM_Calloc/Alloc().
12960 + * Ensures:
12961 + * pMemBuf is no longer a valid pointer to memory.
12962 + */
12963 + extern void MEM_Free(IN void *pMemBuf);
12966 + * ======== MEM_FreePhysMem ========
12967 + * Purpose:
12968 + * Free the given block of physically contiguous memory.
12969 + * Parameters:
12970 + * pVirtualAddress: Pointer to virtual memory region allocated
12971 + * by MEM_AllocPhysMem().
12972 + * pPhysicalAddress: Pointer to physical memory region allocated
12973 + * by MEM_AllocPhysMem().
12974 + * cBytes: Size of the memory region allocated by MEM_AllocPhysMem().
12975 + * Returns:
12976 + * Requires:
12977 + * MEM initialized.
12978 + * pVirtualAddress is a valid memory address returned by
12979 + * MEM_AllocPhysMem()
12980 + * Ensures:
12981 + * pVirtualAddress is no longer a valid pointer to memory.
12982 + */
12983 + extern void MEM_FreePhysMem(void *pVirtualAddress,
12984 + u32 pPhysicalAddress, u32 cBytes);
12987 + * ======== MEM_FreeObject ========
12988 + * Purpose:
12989 + * Utility macro to invalidate an object's signature, and deallocate it.
12990 + * Parameters:
12991 + * pObj: Pointer to the object to free.
12992 + * Returns:
12993 + * Requires:
12994 + * Same requirements as MEM_Free().
12995 + * Ensures:
12996 + * A subsequent call to MEM_IsValidHandle() will fail for this object.
12997 + */
12998 +#define MEM_FreeObject(pObj) \
12999 +{ \
13000 + pObj->dwSignature = 0x00; \
13001 + MEM_Free(pObj); \
13005 + * ======== MEM_GetNumPages ========
13006 + * Purpose:
13007 + * Calculate the number of pages corresponding to the supplied buffer.
13008 + * Parameters:
13009 + * pAddr: Linear (virtual) address of the buffer.
13010 + * cBytes: Number of bytes in the buffer.
13011 + * Returns:
13012 + * Number of pages.
13013 + * Requires:
13014 + * MEM initialized.
13015 + * Ensures:
13016 + * If cBytes > 0, number of pages returned > 0.
13017 + */
13018 + extern s32 MEM_GetNumPages(IN void *pAddr, IN u32 cBytes);
13021 + * ======== MEM_Init ========
13022 + * Purpose:
13023 + * Initializes private state of MEM module.
13024 + * Parameters:
13025 + * Returns:
13026 + * TRUE if initialized; FALSE if error occured.
13027 + * Requires:
13028 + * Ensures:
13029 + * MEM initialized.
13030 + */
13031 + extern bool MEM_Init();
13034 + * ======== MEM_IsValidHandle ========
13035 + * Purpose:
13036 + * Validate the object handle.
13037 + * Parameters:
13038 + * hObj: Handle to object created with MEM_AllocObject().
13039 + * Sig: Expected signature u32.
13040 + * Returns:
13041 + * TRUE if handle is valid; FALSE otherwise.
13042 + * Requires:
13043 + * The object structure has a dwSignature field. Ensured by compiler.
13044 + * Ensures:
13045 + */
13046 +#define MEM_IsValidHandle(hObj, Sig) \
13047 + ((hObj != NULL) && (hObj->dwSignature == Sig))
13050 + * ======== MEM_LinearAddress ========
13051 + * Purpose:
13052 + * Get the linear address corresponding to the given physical address.
13053 + * Parameters:
13054 + * pPhysAddr: Physical address to be mapped.
13055 + * cBytes: Number of bytes in physical range to map.
13056 + * Returns:
13057 + * The corresponding linear address, or NULL if unsuccessful.
13058 + * Requires:
13059 + * MEM initialized.
13060 + * Ensures:
13061 + * Notes:
13062 + * If valid linear address is returned, be sure to call
13063 + * MEM_UnmapLinearAddress().
13064 + */
13065 +#define MEM_LinearAddress(pPhyAddr, cBytes) pPhyAddr
13068 + * ======== MEM_UnmapLinearAddress ========
13069 + * Purpose:
13070 + * Unmap the linear address mapped in MEM_LinearAddress.
13071 + * Parameters:
13072 + * pBaseAddr: Ptr to mapped memory (as returned by MEM_LinearAddress()).
13073 + * Returns:
13074 + * Requires:
13075 + * - MEM initialized.
13076 + * - pBaseAddr is a valid linear address mapped in MEM_LinearAddress.
13077 + * Ensures:
13078 + * - pBaseAddr no longer points to a valid linear address.
13079 + */
13080 +#define MEM_UnmapLinearAddress(pBaseAddr)
13083 + * ======== MEM_ExtPhysPoolInit ========
13084 + * Purpose:
13085 + * Uses the physical memory chunk passed for internal consitent memory
13086 + * allocations.
13087 + * physical address based on the page frame address.
13088 + * Parameters:
13089 + * poolPhysBase starting address of the physical memory pool.
13090 + * poolSize size of the physical memory pool.
13091 + * Returns:
13092 + * none.
13093 + * Requires:
13094 + * - MEM initialized.
13095 + * - valid physical address for the base and size > 0
13096 + */
13097 + extern void MEM_ExtPhysPoolInit(IN u32 poolPhysBase,
13098 + IN u32 poolSize);
13100 +#endif /* MEM_ */
13101 Index: lk/arch/arm/plat-omap/include/bridge/memdefs.h
13102 ===================================================================
13103 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13104 +++ lk/arch/arm/plat-omap/include/bridge/memdefs.h 2008-08-18 10:38:34.000000000 +0300
13105 @@ -0,0 +1,52 @@
13107 + * bridge/inc/memdefs.h
13109 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13111 + * Copyright (C) 2008 Texas Instruments, Inc.
13113 + * This package is free software; you can redistribute it and/or modify
13114 + * it under the terms of the GNU General Public License version 2 as
13115 + * published by the Free Software Foundation.
13117 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13118 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13119 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13120 + */
13124 + * ======== memdefs.h ========
13125 + * Purpose:
13126 + * Global MEM constants and types, shared between WSX, WCD, and WMD.
13128 + *! Revision History:
13129 + *! ================
13130 + *! 28-Aug-2001 ag: Added MEM_[SET][GET]VIRTUALSEGID.
13131 + *! 10-Aug-1999 kc: Based on wsx-c18.
13132 + *! 15-Nov-1996 gp: Renamed from wsxmem.h and moved to kwinos.
13133 + *! 21-Aug-1996 cr: Created from mem.h.
13134 + */
13136 +#ifndef MEMDEFS_
13137 +#define MEMDEFS_
13139 +/* Memory Pool Attributes: */
13140 + enum MEM_POOLATTRS {
13141 + MEM_PAGED = 0,
13142 + MEM_NONPAGED = 1,
13143 + MEM_LARGEVIRTMEM = 2
13144 + } ;
13147 + * MEM_VIRTUALSEGID is used by Node & Strm to access virtual address space in
13148 + * the correct client process context.
13149 + */
13150 +#define MEM_SETVIRTUALSEGID 0x10000000
13151 +#define MEM_GETVIRTUALSEGID 0x20000000
13152 +#define MEM_MASKVIRTUALSEGID (MEM_SETVIRTUALSEGID | MEM_GETVIRTUALSEGID)
13154 +#define TO_VIRTUAL_UNCACHED(x) x
13155 +#define INTREG_TO_VIRTUAL_UNCACHED(x) x
13157 +#endif /* MEMDEFS_ */
13158 Index: lk/arch/arm/plat-omap/include/bridge/memry.h
13159 ===================================================================
13160 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13161 +++ lk/arch/arm/plat-omap/include/bridge/memry.h 2008-08-18 10:38:34.000000000 +0300
13162 @@ -0,0 +1,96 @@
13164 + * dspbridge/mp_driver/inc/memry.h
13166 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13168 + * Copyright (C) 2008 Texas Instruments, Inc.
13170 + * This package is free software; you can redistribute it and/or modify
13171 + * it under the terms of the GNU General Public License version 2 as
13172 + * published by the Free Software Foundation.
13174 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13175 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13176 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13177 + */
13180 + * ======== memry.h ========
13181 + * Purpose:
13182 + * Functional interface for the memory manager, exported by the DSP
13183 + * system API DLL. This interface is not publicly documented.
13185 + * Public Functions:
13186 + * MEMRY_Alloc
13187 + * MEMRY_BindMem
13188 + * MEMRY_Calloc
13189 + * MEMRY_Free
13190 + * MEMRY_FreeVM
13191 + * MEMRY_LinearAddress
13192 + * MEMRY_ReserveVM
13193 + * MEMRY_PageLock
13194 + * MEMRY_PageUnlock
13195 + * MEMRY_UnMapLinearAddress
13197 + *! Revision History:
13198 + *! ================
13199 + *! 01-Sep-2001 ag: Added MEMRY_[UnMap]LinearAddress.
13200 + *! 11-Oct-2000 ag: Added MEMRY_Reserve[Free]VM() & MEMRY_BindMem().
13201 + *! 12-Nov-1999 kc: Updated for WinCE.
13202 + *!
13203 + */
13205 +#ifndef MEMRY_
13206 +#define MEMRY_
13208 +#include <dspapi.h>
13210 +#include <memdefs.h>
13213 + * MEMRY_[GET]SET]VIRTUALSEGID is used by Node & Strm to access virtual
13214 + * address space in the correct client process context. The virtual to
13215 + * physical mapping is done in the client process context.
13216 + */
13217 +#define MEMRY_SETVIRTUALSEGID MEM_SETVIRTUALSEGID
13218 +#define MEMRY_GETVIRTUALSEGID MEM_GETVIRTUALSEGID
13219 +#define MEMRY_MASKVIRTUALSEGID MEM_MASKVIRTUALSEGID
13222 + * ======== MEMRY_LinearAddress ========
13223 + * Purpose:
13224 + * Get the linear address corresponding to the given physical address.
13225 + * Parameters:
13226 + * pPhysAddr: Physical address to be mapped.
13227 + * cBytes: Number of bytes in physical range to map.
13228 + * Returns:
13229 + * The corresponding linear address, or NULL if unsuccessful.
13230 + * Requires:
13231 + * PhysAddr != 0
13232 + * Ensures:
13233 + * Notes:
13234 + * If valid linear address is returned, be sure to call
13235 + * MEMRY_UnMapLinearAddress().
13236 + */
13237 + extern inline void *MEMRY_LinearAddress(void *pPhyAddr, u32 cBytes)
13239 + return pPhyAddr;
13243 + * ======== MEMRY_UnMapLinearAddress ========
13244 + * Purpose:
13245 + * Unmap the linear address mapped in MEMRY_LinearAddress.
13246 + * Parameters:
13247 + * pBaseAddr: Ptr to mapped memory (as returned by MEMRY_LinearAddress()).
13248 + * Returns:
13249 + * Requires:
13250 + * - pBaseAddr is a valid linear address mapped in MEMRY_LinearAddress.
13251 + * Ensures:
13252 + * - pBaseAddr no longer points to a valid linear address.
13253 + */
13254 + extern inline void MEMRY_UnMapLinearAddress(void *pBaseAddr)
13258 +#endif /* MEMRY_ */
13259 Index: lk/arch/arm/plat-omap/include/bridge/mgr.h
13260 ===================================================================
13261 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13262 +++ lk/arch/arm/plat-omap/include/bridge/mgr.h 2008-08-18 10:38:34.000000000 +0300
13263 @@ -0,0 +1,234 @@
13265 + * bridge/inc/mgr.h
13267 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13269 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
13271 + * This package is free software; you can redistribute it and/or modify
13272 + * it under the terms of the GNU General Public License version 2 as
13273 + * published by the Free Software Foundation.
13275 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13276 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13277 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13278 + */
13282 + * ======== mgr.h ========
13283 + * Description:
13284 + * This is the Class driver RM module interface.
13286 + * Public Functions:
13287 + * MGR_Create
13288 + * MGR_Destroy
13289 + * MGR_EnumNodeInfo
13290 + * MGR_EnumProcessorInfo
13291 + * MGR_Exit
13292 + * MGR_GetDCDHandle
13293 + * MGR_Init
13295 + * Notes:
13297 + *! Revision History:
13298 + *! ================
13299 + *! 15-Oct-2002 kc: Removed legacy PERF definitions.
13300 + *! 11-Jul-2001 jeh Added CFG_HDEVNODE parameter to MGR_Create().
13301 + *! 22-Nov-2000 kc: Added MGR_GetPerfData for acquiring PERF stats.
13302 + *! 03-Nov-2000 rr: Added MGR_GetDCDHandle. Modified after code review.
13303 + *! 25-Sep-2000 rr: Updated to Version 0.9
13304 + *! 14-Aug-2000 rr: Cleaned up.
13305 + *! 07-Aug-2000 rr: MGR_Create does the job of Loading DCD Dll.
13306 + *! 27-Jul-2000 rr: Updated to ver 0.8 of DSPAPI(types).
13307 + *! 20-Jun-2000 rr: Created.
13308 + */
13310 +#ifndef MGR_
13311 +#define MGR_
13313 +#include <mgrpriv.h>
13315 +#define MAX_EVENTS 32
13318 + * ======== MGR_WaitForBridgeEvents ========
13319 + * Purpose:
13320 + * Block on any Bridge event(s)
13321 + * Parameters:
13322 + * aNotifications : array of pointers to notification objects.
13323 + * uCount : number of elements in above array
13324 + * puIndex : index of signaled event object
13325 + * uTimeout : timeout interval in milliseocnds
13326 + * Returns:
13327 + * DSP_SOK : Success.
13328 + * DSP_ETIMEOUT : Wait timed out. *puIndex is undetermined.
13329 + * Details:
13330 + */
13332 + DSP_STATUS MGR_WaitForBridgeEvents(struct DSP_NOTIFICATION
13333 + **aNotifications,
13334 + u32 uCount, OUT u32 *puIndex,
13335 + u32 uTimeout);
13338 + * ======== MGR_Create ========
13339 + * Purpose:
13340 + * Creates the Manager Object. This is done during the driver loading.
13341 + * There is only one Manager Object in the DSP/BIOS Bridge.
13342 + * Parameters:
13343 + * phMgrObject: Location to store created MGR Object handle.
13344 + * hDevNode: Device object as known to Windows system.
13345 + * Returns:
13346 + * DSP_SOK: Success
13347 + * DSP_EMEMORY: Failed to Create the Object
13348 + * DSP_EFAIL: General Failure
13349 + * Requires:
13350 + * MGR Initialized (cRefs > 0 )
13351 + * phMgrObject != NULL.
13352 + * Ensures:
13353 + * DSP_SOK: *phMgrObject is a valid MGR interface to the device.
13354 + * MGR Object stores the DCD Manager Handle.
13355 + * MGR Object stored in the Regsitry.
13356 + * !DSP_SOK: MGR Object not created
13357 + * Details:
13358 + * DCD Dll is loaded and MGR Object stores the handle of the DLL.
13359 + */
13360 + extern DSP_STATUS MGR_Create(OUT struct MGR_OBJECT **hMgrObject,
13361 + struct CFG_DEVNODE *hDevNode);
13364 + * ======== MGR_Destroy ========
13365 + * Purpose:
13366 + * Destroys the MGR object. Called upon driver unloading.
13367 + * Parameters:
13368 + * hMgrObject: Handle to Manager object .
13369 + * Returns:
13370 + * DSP_SOK: Success.
13371 + * DCD Manager freed; MGR Object destroyed;
13372 + * MGR Object deleted from the Registry.
13373 + * DSP_EFAIL: Failed to destroy MGR Object
13374 + * Requires:
13375 + * MGR Initialized (cRefs > 0 )
13376 + * hMgrObject is a valid MGR handle .
13377 + * Ensures:
13378 + * DSP_SOK: MGR Object destroyed and hMgrObject is Invalid MGR
13379 + * Handle.
13380 + */
13381 + extern DSP_STATUS MGR_Destroy(struct MGR_OBJECT *hMgrObject);
13384 + * ======== MGR_EnumNodeInfo ========
13385 + * Purpose:
13386 + * Enumerate and get configuration information about nodes configured
13387 + * in the node database.
13388 + * Parameters:
13389 + * uNode: The node index (base 0).
13390 + * pNDBProps: Ptr to the DSP_NDBPROPS structure for output.
13391 + * uNDBPropsSize: Size of the DSP_NDBPROPS structure.
13392 + * puNumNodes: Location where the number of nodes configured
13393 + * in the database will be returned.
13394 + * Returns:
13395 + * DSP_SOK: Success.
13396 + * DSP_EINVALIDARG: Parameter uNode is > than the number of nodes.
13397 + * configutred in the system
13398 + * DSP_ECHANGEDURINGENUM: During Enumeration there has been a change in
13399 + * the number of nodes configured or in the
13400 + * the properties of the enumerated nodes.
13401 + * DSP_EFAIL: Failed to querry the Node Data Base
13402 + * Requires:
13403 + * pNDBPROPS is not null
13404 + * uNDBPropsSize >= sizeof(DSP_NDBPROPS)
13405 + * puNumNodes is not null
13406 + * MGR Initialized (cRefs > 0 )
13407 + * Ensures:
13408 + * SUCCESS on successful retreival of data and *puNumNodes > 0 OR
13409 + * DSP_FAILED && *puNumNodes == 0.
13410 + * Details:
13411 + */
13412 + extern DSP_STATUS MGR_EnumNodeInfo(u32 uNode,
13413 + OUT struct DSP_NDBPROPS *pNDBProps,
13414 + u32 uNDBPropsSize,
13415 + OUT u32 *puNumNodes);
13418 + * ======== MGR_EnumProcessorInfo ========
13419 + * Purpose:
13420 + * Enumerate and get configuration information about available DSP
13421 + * processors
13422 + * Parameters:
13423 + * uProcessor: The processor index (zero-based).
13424 + * pProcessorInfo: Ptr to the DSP_PROCESSORINFO structure .
13425 + * uProcessorInfoSize: Size of DSP_PROCESSORINFO structure.
13426 + * puNumProcs: Location where the number of DSPs configured
13427 + * in the database will be returned
13428 + * Returns:
13429 + * DSP_SOK: Success.
13430 + * DSP_EINVALIDARG: Parameter uProcessor is > than the number of
13431 + * DSP Processors in the system.
13432 + * DSP_EFAIL: Failed to querry the Node Data Base
13433 + * Requires:
13434 + * pProcessorInfo is not null
13435 + * puNumProcs is not null
13436 + * uProcessorInfoSize >= sizeof(DSP_PROCESSORINFO)
13437 + * MGR Initialized (cRefs > 0 )
13438 + * Ensures:
13439 + * SUCCESS on successful retreival of data and *puNumProcs > 0 OR
13440 + * DSP_FAILED && *puNumProcs == 0.
13441 + * Details:
13442 + */
13443 + extern DSP_STATUS MGR_EnumProcessorInfo(u32 uProcessor,
13444 + OUT struct DSP_PROCESSORINFO *
13445 + pProcessorInfo,
13446 + u32 uProcessorInfoSize,
13447 + OUT u32 *puNumProcs);
13449 + * ======== MGR_Exit ========
13450 + * Purpose:
13451 + * Decrement reference count, and free resources when reference count is
13452 + * 0.
13453 + * Parameters:
13454 + * Returns:
13455 + * Requires:
13456 + * MGR is initialized.
13457 + * Ensures:
13458 + * When reference count == 0, MGR's private resources are freed.
13459 + */
13460 + extern void CDECL MGR_Exit();
13463 + * ======== MGR_GetDCDHandle ========
13464 + * Purpose:
13465 + * Retrieves the MGR handle. Accessor Function
13466 + * Parameters:
13467 + * hMGRHandle: Handle to the Manager Object
13468 + * phDCDHandle: Ptr to receive the DCD Handle.
13469 + * Returns:
13470 + * DSP_SOK: Sucess
13471 + * DSP_EFAIL: Failure to get the Handle
13472 + * Requires:
13473 + * MGR is initialized.
13474 + * phDCDHandle != NULL
13475 + * Ensures:
13476 + * DSP_SOK and *phDCDHandle != NULL ||
13477 + * DSP_EFAIL and *phDCDHandle == NULL
13478 + */
13479 + extern DSP_STATUS CDECL MGR_GetDCDHandle(IN struct MGR_OBJECT
13480 + *hMGRHandle,
13481 + OUT u32 *phDCDHandle);
13484 + * ======== MGR_Init ========
13485 + * Purpose:
13486 + * Initialize MGR's private state, keeping a reference count on each
13487 + * call. Intializes the DCD.
13488 + * Parameters:
13489 + * Returns:
13490 + * TRUE if initialized; FALSE if error occured.
13491 + * Requires:
13492 + * Ensures:
13493 + * TRUE: A requirement for the other public MGR functions.
13494 + */
13495 + extern bool CDECL MGR_Init();
13497 +#endif /* MGR_ */
13498 Index: lk/arch/arm/plat-omap/include/bridge/mgrpriv.h
13499 ===================================================================
13500 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13501 +++ lk/arch/arm/plat-omap/include/bridge/mgrpriv.h 2008-08-18 10:38:34.000000000 +0300
13502 @@ -0,0 +1,55 @@
13504 + * bridge/inc/mgrpriv.h
13506 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13508 + * Copyright (C) 2008 Texas Instruments, Inc.
13510 + * This package is free software; you can redistribute it and/or modify
13511 + * it under the terms of the GNU General Public License version 2 as
13512 + * published by the Free Software Foundation.
13514 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13515 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13516 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13517 + */
13521 + * ======== mgrpriv.h ========
13522 + * Description:
13523 + * Global MGR constants and types, shared by PROC, MGR, and WCD.
13525 + *! Revision History:
13526 + *! ================
13527 + *! 29-July-2001 ag: added MGR_PROCESSOREXTINFO.
13528 + *! 05-July-2000 rr: Created
13529 + */
13531 +#ifndef MGRPRIV_
13532 +#define MGRPRIV_
13535 + * OMAP1510 specific
13536 + */
13537 +#define MGR_MAXTLBENTRIES 32
13539 +/* RM MGR Object */
13540 + struct MGR_OBJECT;
13542 + struct MGR_TLBENTRY {
13543 + u32 ulDspVirt; /* DSP virtual address */
13544 + u32 ulGppPhys; /* GPP physical address */
13545 + } ;
13548 + * The DSP_PROCESSOREXTINFO structure describes additional extended
13549 + * capabilities of a DSP processor not exposed to user.
13550 + */
13551 + struct MGR_PROCESSOREXTINFO {
13552 + struct DSP_PROCESSORINFO tyBasic; /* user processor info */
13553 + /* private dsp mmu entries */
13554 + struct MGR_TLBENTRY tyTlb[MGR_MAXTLBENTRIES];
13555 + } ;
13557 +#endif /* MGRPRIV_ */
13558 Index: lk/arch/arm/plat-omap/include/bridge/msg.h
13559 ===================================================================
13560 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13561 +++ lk/arch/arm/plat-omap/include/bridge/msg.h 2008-08-18 10:38:34.000000000 +0300
13562 @@ -0,0 +1,106 @@
13564 + * bridge/inc/msg.h
13566 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13568 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
13570 + * This package is free software; you can redistribute it and/or modify
13571 + * it under the terms of the GNU General Public License version 2 as
13572 + * published by the Free Software Foundation.
13574 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13575 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13576 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13577 + */
13581 + * ======== msg.h ========
13582 + * Description:
13583 + * DSP/BIOS Bridge MSG Module.
13585 + * Public Functions:
13586 + * MSG_Create
13587 + * MSG_Delete
13588 + * MSG_Exit
13589 + * MSG_Init
13591 + * Notes:
13593 + *! Revision History:
13594 + *! =================
13595 + *! 17-Nov-2000 jeh Removed MSG_Get, MSG_Put, MSG_CreateQueue,
13596 + *! MSG_DeleteQueue, and MSG_RegisterNotify, since these
13597 + *! are now part of mini-driver.
13598 + *! 12-Sep-2000 jeh Created.
13599 + */
13601 +#ifndef MSG_
13602 +#define MSG_
13604 +#include <devdefs.h>
13605 +#include <msgdefs.h>
13608 + * ======== MSG_Create ========
13609 + * Purpose:
13610 + * Create an object to manage message queues. Only one of these objects
13611 + * can exist per device object. The MSG manager must be created before
13612 + * the IO Manager.
13613 + * Parameters:
13614 + * phMsgMgr: Location to store MSG manager handle on output.
13615 + * hDevObject: The device object.
13616 + * msgCallback: Called whenever an RMS_EXIT message is received.
13617 + * Returns:
13618 + * Requires:
13619 + * MSG_Init() called.
13620 + * phMsgMgr != NULL.
13621 + * hDevObject != NULL.
13622 + * msgCallback != NULL.
13623 + * Ensures:
13624 + */
13625 + extern DSP_STATUS MSG_Create(OUT struct MSG_MGR **phMsgMgr,
13626 + struct DEV_OBJECT *hDevObject,
13627 + MSG_ONEXIT msgCallback);
13630 + * ======== MSG_Delete ========
13631 + * Purpose:
13632 + * Delete a MSG manager allocated in MSG_Create().
13633 + * Parameters:
13634 + * hMsgMgr: Handle returned from MSG_Create().
13635 + * Returns:
13636 + * Requires:
13637 + * MSG_Init() called.
13638 + * Valid hMsgMgr.
13639 + * Ensures:
13640 + */
13641 + extern void MSG_Delete(struct MSG_MGR *hMsgMgr);
13644 + * ======== MSG_Exit ========
13645 + * Purpose:
13646 + * Discontinue usage of MSG module.
13647 + * Parameters:
13648 + * Returns:
13649 + * Requires:
13650 + * MSG_Init() successfully called before.
13651 + * Ensures:
13652 + * Any resources acquired in MSG_Init() will be freed when last MSG
13653 + * client calls MSG_Exit().
13654 + */
13655 + extern void MSG_Exit();
13658 + * ======== MSG_Init ========
13659 + * Purpose:
13660 + * Initialize the MSG module.
13661 + * Parameters:
13662 + * Returns:
13663 + * TRUE if initialization succeeded, FALSE otherwise.
13664 + * Ensures:
13665 + */
13666 + extern bool MSG_Init();
13668 +#endif /* MSG_ */
13669 Index: lk/arch/arm/plat-omap/include/bridge/msgdefs.h
13670 ===================================================================
13671 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13672 +++ lk/arch/arm/plat-omap/include/bridge/msgdefs.h 2008-08-18 10:38:34.000000000 +0300
13673 @@ -0,0 +1,43 @@
13675 + * bridge/inc/msgdefs.h
13677 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13679 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
13681 + * This package is free software; you can redistribute it and/or modify
13682 + * it under the terms of the GNU General Public License version 2 as
13683 + * published by the Free Software Foundation.
13685 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13686 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13687 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13688 + */
13692 + * ======== msgdefs.h ========
13693 + * Description:
13694 + * Global MSG constants and types.
13696 + *! Revision History
13697 + *! ================
13698 + *! 09-May-2001 jeh Removed MSG_TODSP, MSG_FROMDSP.
13699 + *! 17-Nov-2000 jeh Added MSGMGR_SIGNATURE.
13700 + *! 12-Sep-2000 jeh Created.
13701 + */
13703 +#ifndef MSGDEFS_
13704 +#define MSGDEFS_
13706 +#define MSGMGR_SIGNATURE 0x4d47534d /* "MGSM" */
13708 +/* MSG Objects: */
13709 + struct MSG_MGR;
13710 + struct MSG_QUEUE;
13712 +/* Function prototype for callback to be called on RMS_EXIT message received */
13713 + typedef void(CDECL *MSG_ONEXIT) (HANDLE h, s32 nStatus);
13715 +#endif /* MSGDEFS_ */
13717 Index: lk/arch/arm/plat-omap/include/bridge/nldr.h
13718 ===================================================================
13719 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13720 +++ lk/arch/arm/plat-omap/include/bridge/nldr.h 2008-08-18 10:38:34.000000000 +0300
13721 @@ -0,0 +1,81 @@
13723 + * bridge/inc/nldr.h
13725 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13727 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
13729 + * This package is free software; you can redistribute it and/or modify
13730 + * it under the terms of the GNU General Public License version 2 as
13731 + * published by the Free Software Foundation.
13733 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13734 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13735 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13736 + */
13740 + * ======== nldr.h ========
13742 + * Description:
13743 + * DSP/BIOS Bridge dynamic loader interface. See the file dldrdefs.h
13744 + * for a description of these functions.
13746 + * Public Functions:
13747 + * NLDR_Allocate
13748 + * NLDR_Create
13749 + * NLDR_Delete
13750 + * NLDR_Exit
13751 + * NLDR_Free
13752 + * NLDR_GetFxnAddr
13753 + * NLDR_Init
13754 + * NLDR_Load
13755 + * NLDR_Unload
13757 + * Notes:
13759 + *! Revision History
13760 + *! ================
13761 + *! 31-Jul-2002 jeh Removed function header comments.
13762 + *! 17-Apr-2002 jeh Created.
13763 + */
13765 +#include <dbdefs.h>
13766 +#include <dbdcddef.h>
13767 +#include <dev.h>
13768 +#include <rmm.h>
13769 +#include <nldrdefs.h>
13771 +#ifndef NLDR_
13772 +#define NLDR_
13774 + extern DSP_STATUS NLDR_Allocate(struct NLDR_OBJECT *hNldr,
13775 + void *pPrivRef,
13776 + IN CONST struct DCD_NODEPROPS
13777 + *pNodeProps,
13778 + OUT struct NLDR_NODEOBJECT **phNldrNode,
13779 + IN bool *pfPhaseSplit);
13781 + extern DSP_STATUS NLDR_Create(OUT struct NLDR_OBJECT **phNldr,
13782 + struct DEV_OBJECT *hDevObject,
13783 + IN CONST struct NLDR_ATTRS *pAttrs);
13785 + extern void NLDR_Delete(struct NLDR_OBJECT *hNldr);
13786 + extern void NLDR_Exit(void);
13787 + extern void NLDR_Free(struct NLDR_NODEOBJECT *hNldrNode);
13789 + extern DSP_STATUS NLDR_GetFxnAddr(struct NLDR_NODEOBJECT *hNldrNode,
13790 + char *pstrFxn, u32 *pulAddr);
13792 + extern DSP_STATUS NLDR_GetRmmManager(struct NLDR_OBJECT *hNldrObject,
13793 + OUT struct RMM_TargetObj
13794 + **phRmmMgr);
13796 + extern bool NLDR_Init(void);
13797 + extern DSP_STATUS NLDR_Load(struct NLDR_NODEOBJECT *hNldrNode,
13798 + enum NLDR_PHASE phase);
13799 + extern DSP_STATUS NLDR_Unload(struct NLDR_NODEOBJECT *hNldrNode,
13800 + enum NLDR_PHASE phase);
13802 +#endif /* NLDR_ */
13803 Index: lk/arch/arm/plat-omap/include/bridge/nldrdefs.h
13804 ===================================================================
13805 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
13806 +++ lk/arch/arm/plat-omap/include/bridge/nldrdefs.h 2008-08-18 10:38:34.000000000 +0300
13807 @@ -0,0 +1,307 @@
13809 + * bridge/inc/nldrdefs.h
13811 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
13813 + * Copyright (C) 2008 Texas Instruments, Inc.
13815 + * This package is free software; you can redistribute it and/or modify
13816 + * it under the terms of the GNU General Public License version 2 as
13817 + * published by the Free Software Foundation.
13819 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13820 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13821 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13822 + */
13826 + * ======== nldrdefs.h ========
13827 + * Description:
13828 + * Global Dynamic + static/overlay Node loader (NLDR) constants and types.
13830 + *! Revision History
13831 + *! ================
13832 + *! 07-Apr-2003 map Consolidated dldrdefs.h into nldrdefs.h
13833 + *! 05-Aug-2002 jeh Created.
13834 + */
13836 +#ifndef NLDRDEFS_
13837 +#define NLDRDEFS_
13839 +#include <dbdcddef.h>
13840 +#include <devdefs.h>
13842 +#define NLDR_MAXPATHLENGTH 255
13843 +/* NLDR Objects: */
13844 + struct NLDR_OBJECT;
13845 + struct NLDR_NODEOBJECT;
13848 + * ======== NLDR_LOADTYPE ========
13849 + * Load types for a node. Must match values in node.h55.
13850 + */
13851 + enum NLDR_LOADTYPE {
13852 + NLDR_STATICLOAD, /* Linked in base image, not overlay */
13853 + NLDR_DYNAMICLOAD, /* Dynamically loaded node */
13854 + NLDR_OVLYLOAD /* Linked in base image, overlay node */
13855 + } ;
13858 + * ======== NLDR_OVLYFXN ========
13859 + * Causes code or data to be copied from load address to run address. This
13860 + * is the "COD_WRITEFXN" that gets passed to the DBLL_Library and is used as
13861 + * the ZL write function.
13863 + * Parameters:
13864 + * pPrivRef: Handle to identify the node.
13865 + * ulDspRunAddr: Run address of code or data.
13866 + * ulDspLoadAddr: Load address of code or data.
13867 + * ulNumBytes: Number of (GPP) bytes to copy.
13868 + * nMemSpace: RMS_CODE or RMS_DATA.
13869 + * Returns:
13870 + * ulNumBytes: Success.
13871 + * 0: Failure.
13872 + * Requires:
13873 + * Ensures:
13874 + */
13875 + typedef u32(CDECL *NLDR_OVLYFXN) (void *pPrivRef, u32 ulDspRunAddr,
13876 + u32 ulDspLoadAddr,
13877 + u32 ulNumBytes, u32 nMemSpace);
13880 + * ======== NLDR_WRITEFXN ========
13881 + * Write memory function. Used for dynamic load writes.
13882 + * Parameters:
13883 + * pPrivRef: Handle to identify the node.
13884 + * ulDspAddr: Address of code or data.
13885 + * pBuf: Code or data to be written
13886 + * ulNumBytes: Number of (GPP) bytes to write.
13887 + * nMemSpace: DBLL_DATA or DBLL_CODE.
13888 + * Returns:
13889 + * ulNumBytes: Success.
13890 + * 0: Failure.
13891 + * Requires:
13892 + * Ensures:
13893 + */
13894 + typedef u32(CDECL *NLDR_WRITEFXN) (void *pPrivRef,
13895 + u32 ulDspAddr, void *pBuf,
13896 + u32 ulNumBytes, u32 nMemSpace);
13899 + * ======== NLDR_ATTRS ========
13900 + * Attributes passed to NLDR_Create function.
13901 + */
13902 + struct NLDR_ATTRS {
13903 + NLDR_OVLYFXN pfnOvly;
13904 + NLDR_WRITEFXN pfnWrite;
13905 + u16 usDSPWordSize;
13906 + u16 usDSPMauSize;
13907 + } ;
13910 + * ======== NLDR_PHASE ========
13911 + * Indicates node create, delete, or execute phase function.
13912 + */
13913 + enum NLDR_PHASE {
13914 + NLDR_CREATE,
13915 + NLDR_DELETE,
13916 + NLDR_EXECUTE,
13917 + NLDR_NOPHASE
13918 + } ;
13921 + * Typedefs of loader functions imported from a DLL, or defined in a
13922 + * function table.
13923 + */
13926 + * ======== NLDR_Allocate ========
13927 + * Allocate resources to manage the loading of a node on the DSP.
13929 + * Parameters:
13930 + * hNldr: Handle of loader that will load the node.
13931 + * pPrivRef: Handle to identify the node.
13932 + * pNodeProps: Pointer to a DCD_NODEPROPS for the node.
13933 + * phNldrNode: Location to store node handle on output. This handle
13934 + * will be passed to NLDR_Load/NLDR_Unload.
13935 + * pfPhaseSplit: pointer to boolean variable referenced in node.c
13936 + * Returns:
13937 + * DSP_SOK: Success.
13938 + * DSP_EMEMORY: Insufficient memory on GPP.
13939 + * Requires:
13940 + * NLDR_Init() called.
13941 + * Valid hNldr.
13942 + * pNodeProps != NULL.
13943 + * phNldrNode != NULL.
13944 + * Ensures:
13945 + * DSP_SOK: IsValidNode(*phNldrNode).
13946 + * error: *phNldrNode == NULL.
13947 + */
13948 + typedef DSP_STATUS(*NLDR_ALLOCATEFXN) (struct NLDR_OBJECT *hNldr,
13949 + void *pPrivRef,
13950 + IN CONST struct DCD_NODEPROPS
13951 + *pNodeProps,
13952 + OUT struct NLDR_NODEOBJECT
13953 + **phNldrNode,
13954 + OUT bool *pfPhaseSplit);
13957 + * ======== NLDR_Create ========
13958 + * Create a loader object. This object handles the loading and unloading of
13959 + * create, delete, and execute phase functions of nodes on the DSP target.
13961 + * Parameters:
13962 + * phNldr: Location to store loader handle on output.
13963 + * hDevObject: Device for this processor.
13964 + * pAttrs: Loader attributes.
13965 + * Returns:
13966 + * DSP_SOK: Success;
13967 + * DSP_EMEMORY: Insufficient memory for requested resources.
13968 + * Requires:
13969 + * NLDR_Init() called.
13970 + * phNldr != NULL.
13971 + * hDevObject != NULL.
13972 + * pAttrs != NULL.
13973 + * Ensures:
13974 + * DSP_SOK: Valid *phNldr.
13975 + * error: *phNldr == NULL.
13976 + */
13977 + typedef DSP_STATUS(*NLDR_CREATEFXN) (OUT struct NLDR_OBJECT **phNldr,
13978 + struct DEV_OBJECT *hDevObject,
13979 + IN CONST struct NLDR_ATTRS
13980 + *pAttrs);
13983 + * ======== NLDR_Delete ========
13984 + * Delete the NLDR loader.
13986 + * Parameters:
13987 + * hNldr: Node manager object.
13988 + * Returns:
13989 + * Requires:
13990 + * NLDR_Init() called.
13991 + * Valid hNldr.
13992 + * Ensures:
13993 + * hNldr invalid
13994 + */
13995 + typedef void(*NLDR_DELETEFXN) (struct NLDR_OBJECT *hNldr);
13998 + * ======== NLDR_Exit ========
13999 + * Discontinue usage of NLDR module.
14001 + * Parameters:
14002 + * Returns:
14003 + * Requires:
14004 + * NLDR_Init() successfully called before.
14005 + * Ensures:
14006 + * Any resources acquired in NLDR_Init() will be freed when last NLDR
14007 + * client calls NLDR_Exit().
14008 + */
14009 + typedef void(*NLDR_EXITFXN) ();
14012 + * ======== NLDR_Free ========
14013 + * Free resources allocated in NLDR_Allocate.
14015 + * Parameters:
14016 + * hNldrNode: Handle returned from NLDR_Allocate().
14017 + * Returns:
14018 + * Requires:
14019 + * NLDR_Init() called.
14020 + * Valid hNldrNode.
14021 + * Ensures:
14022 + */
14023 + typedef void(*NLDR_FREEFXN) (struct NLDR_NODEOBJECT *hNldrNode);
14026 + * ======== NLDR_GetFxnAddr ========
14027 + * Get address of create, delete, or execute phase function of a node on
14028 + * the DSP.
14030 + * Parameters:
14031 + * hNldrNode: Handle returned from NLDR_Allocate().
14032 + * pstrFxn: Name of function.
14033 + * pulAddr: Location to store function address.
14034 + * Returns:
14035 + * DSP_SOK: Success.
14036 + * DSP_ESYMBOL: Address of function not found.
14037 + * Requires:
14038 + * NLDR_Init() called.
14039 + * Valid hNldrNode.
14040 + * pulAddr != NULL;
14041 + * pstrFxn != NULL;
14042 + * Ensures:
14043 + */
14044 + typedef DSP_STATUS(*NLDR_GETFXNADDRFXN) (struct NLDR_NODEOBJECT
14045 + *hNldrNode,
14046 + char *pstrFxn, u32 *pulAddr);
14049 + * ======== NLDR_Init ========
14050 + * Initialize the NLDR module.
14052 + * Parameters:
14053 + * Returns:
14054 + * TRUE if initialization succeeded, FALSE otherwise.
14055 + * Ensures:
14056 + */
14057 + typedef bool(*NLDR_INITFXN) ();
14060 + * ======== NLDR_Load ========
14061 + * Load create, delete, or execute phase function of a node on the DSP.
14063 + * Parameters:
14064 + * hNldrNode: Handle returned from NLDR_Allocate().
14065 + * phase: Type of function to load (create, delete, or execute).
14066 + * Returns:
14067 + * DSP_SOK: Success.
14068 + * DSP_EMEMORY: Insufficient memory on GPP.
14069 + * DSP_EOVERLAYMEMORY: Can't overlay phase because overlay memory
14070 + * is already in use.
14071 + * DSP_EDYNLOAD: Failure in dynamic loader library.
14072 + * DSP_EFWRITE: Failed to write phase's code or date to target.
14073 + * Requires:
14074 + * NLDR_Init() called.
14075 + * Valid hNldrNode.
14076 + * Ensures:
14077 + */
14078 + typedef DSP_STATUS(*NLDR_LOADFXN) (struct NLDR_NODEOBJECT *hNldrNode,
14079 + enum NLDR_PHASE phase);
14082 + * ======== NLDR_Unload ========
14083 + * Unload create, delete, or execute phase function of a node on the DSP.
14085 + * Parameters:
14086 + * hNldrNode: Handle returned from NLDR_Allocate().
14087 + * phase: Node function to unload (create, delete, or execute).
14088 + * Returns:
14089 + * DSP_SOK: Success.
14090 + * DSP_EMEMORY: Insufficient memory on GPP.
14091 + * Requires:
14092 + * NLDR_Init() called.
14093 + * Valid hNldrNode.
14094 + * Ensures:
14095 + */
14096 + typedef DSP_STATUS(*NLDR_UNLOADFXN) (struct NLDR_NODEOBJECT *hNldrNode,
14097 + enum NLDR_PHASE phase);
14100 + * ======== NLDR_FXNS ========
14101 + */
14102 + struct NLDR_FXNS {
14103 + NLDR_ALLOCATEFXN pfnAllocate;
14104 + NLDR_CREATEFXN pfnCreate;
14105 + NLDR_DELETEFXN pfnDelete;
14106 + NLDR_EXITFXN pfnExit;
14107 + NLDR_FREEFXN pfnFree;
14108 + NLDR_GETFXNADDRFXN pfnGetFxnAddr;
14109 + NLDR_INITFXN pfnInit;
14110 + NLDR_LOADFXN pfnLoad;
14111 + NLDR_UNLOADFXN pfnUnload;
14112 + } ;
14114 +#endif /* NLDRDEFS_ */
14115 Index: lk/arch/arm/plat-omap/include/bridge/node.h
14116 ===================================================================
14117 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
14118 +++ lk/arch/arm/plat-omap/include/bridge/node.h 2008-08-18 10:38:34.000000000 +0300
14119 @@ -0,0 +1,619 @@
14121 + * bridge/inc/node.h
14123 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
14125 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
14127 + * This package is free software; you can redistribute it and/or modify
14128 + * it under the terms of the GNU General Public License version 2 as
14129 + * published by the Free Software Foundation.
14131 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14132 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14133 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14134 + */
14138 + * ======== node.h ========
14139 + * Description:
14140 + * DSP/BIOS Bridge Node Manager.
14142 + * Public Functions:
14143 + * NODE_Allocate
14144 + * NODE_AllocMsgBuf
14145 + * NODE_ChangePriority
14146 + * NODE_Connect
14147 + * NODE_Create
14148 + * NODE_CreateMgr
14149 + * NODE_Delete
14150 + * NODE_DeleteMgr
14151 + * NODE_EnumNodes
14152 + * NODE_Exit
14153 + * NODE_FreeMsgBuf
14154 + * NODE_GetAttr
14155 + * NODE_GetMessage
14156 + * NODE_GetProcessor
14157 + * NODE_Init
14158 + * NODE_OnExit
14159 + * NODE_Pause
14160 + * NODE_PutMessage
14161 + * NODE_RegisterNotify
14162 + * NODE_Run
14163 + * NODE_Terminate
14165 + * Notes:
14167 + *! Revision History:
14168 + *! =================
14169 + *! 23-Apr-2001 jeh Updated with code review changes.
14170 + *! 16-Jan-2001 jeh Added DSP_ESYMBOL, DSP_EUUID to return codes.
14171 + *! 17-Nov-2000 jeh Added NODE_OnExit().
14172 + *! 27-Oct-2000 jeh Added timeouts to NODE_GetMessage, NODE_PutMessage.
14173 + *! 12-Oct-2000 jeh Changed NODE_EnumNodeInfo to NODE_EnumNodes. Removed
14174 + *! NODE_RegisterAllNodes().
14175 + *! 07-Sep-2000 jeh Changed type HANDLE in NODE_RegisterNotify to
14176 + *! DSP_HNOTIFICATION. Added DSP_STRMATTR param to
14177 + *! NODE_Connect(). Removed NODE_GetMessageStream().
14178 + *! 17-Jul-2000 jeh Updated function header descriptions.
14179 + *! 19-Jun-2000 jeh Created.
14180 + */
14182 +#ifndef NODE_
14183 +#define NODE_
14185 +#include <procpriv.h>
14187 +#include <nodedefs.h>
14188 +#include <dispdefs.h>
14189 +#include <nldrdefs.h>
14192 + * ======== NODE_Allocate ========
14193 + * Purpose:
14194 + * Allocate GPP resources to manage a node on the DSP.
14195 + * Parameters:
14196 + * hProcessor: Handle of processor that is allocating the node.
14197 + * pNodeId: Pointer to a DSP_UUID for the node.
14198 + * pArgs: Optional arguments to be passed to the node.
14199 + * pAttrIn: Optional pointer to node attributes (priority,
14200 + * timeout...)
14201 + * phNode: Location to store node handle on output.
14202 + * Returns:
14203 + * DSP_SOK: Success.
14204 + * DSP_EMEMORY: Insufficient memory on GPP.
14205 + * DSP_EUUID: Node UUID has not been registered.
14206 + * DSP_ESYMBOL: iAlg functions not found for a DAIS node.
14207 + * DSP_ERANGE: pAttrIn != NULL and pAttrIn->iPriority out of
14208 + * range.
14209 + * DSP_EFAIL: A failure occured, unable to allocate node.
14210 + * DSP_EWRONGSTATE: Proccessor is not in the running state.
14211 + * Requires:
14212 + * NODE_Init() called.
14213 + * hProcessor != NULL.
14214 + * pNodeId != NULL.
14215 + * phNode != NULL.
14216 + * Ensures:
14217 + * DSP_SOK: IsValidNode(*phNode).
14218 + * error: *phNode == NULL.
14219 + */
14220 + extern DSP_STATUS NODE_Allocate(struct PROC_OBJECT *hProcessor,
14221 + IN CONST struct DSP_UUID *pNodeId,
14222 + OPTIONAL IN CONST struct DSP_CBDATA
14223 + *pArgs,
14224 + OPTIONAL IN CONST struct DSP_NODEATTRIN
14225 + *pAttrIn,
14226 + OUT struct NODE_OBJECT **phNode);
14229 + * ======== NODE_AllocMsgBuf ========
14230 + * Purpose:
14231 + * Allocate and Prepare a buffer whose descriptor will be passed to a
14232 + * Node within a (DSP_MSG)message
14233 + * Parameters:
14234 + * hNode: The node handle.
14235 + * uSize: The size of the buffer to be allocated.
14236 + * pAttr: Pointer to a DSP_BUFFERATTR structure.
14237 + * pBuffer: Location to store the address of the allocated
14238 + * buffer on output.
14239 + * Returns:
14240 + * DSP_SOK: Success.
14241 + * DSP_EHANDLE: Invalid node handle.
14242 + * DSP_EMEMORY: Insufficent memory.
14243 + * DSP_EFAIL: General Failure.
14244 + * DSP_ESIZE: Invalid Size.
14245 + * Requires:
14246 + * NODE_Init() called.
14247 + * pBuffer != NULL.
14248 + * Ensures:
14249 + */
14250 + extern DSP_STATUS NODE_AllocMsgBuf(struct NODE_OBJECT *hNode,
14251 + u32 uSize,
14252 + OPTIONAL struct DSP_BUFFERATTR
14253 + *pAttr,
14254 + OUT u8 **pBuffer);
14257 + * ======== NODE_ChangePriority ========
14258 + * Purpose:
14259 + * Change the priority of an allocated node.
14260 + * Parameters:
14261 + * hNode: Node handle returned from NODE_Allocate.
14262 + * nPriority: New priority level to set node's priority to.
14263 + * Returns:
14264 + * DSP_SOK: Success.
14265 + * DSP_EHANDLE: Invalid hNode.
14266 + * DSP_ERANGE: nPriority is out of range.
14267 + * DSP_ENODETYPE: The specified node is not a task node.
14268 + * DSP_EWRONGSTATE: Node is not in the NODE_ALLOCATED, NODE_PAUSED,
14269 + * or NODE_RUNNING state.
14270 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
14271 + * DSP_ERESTART: A critical error has occurred and the DSP is
14272 + * being restarted.
14273 + * DSP_EFAIL: Unable to change node's runtime priority level.
14274 + * Requires:
14275 + * NODE_Init() called.
14276 + * Ensures:
14277 + * DSP_SOK && (Node's current priority == nPriority)
14278 + */
14279 + extern DSP_STATUS NODE_ChangePriority(struct NODE_OBJECT *hNode,
14280 + s32 nPriority);
14283 + * ======== NODE_CloseOrphans ========
14284 + * Purpose:
14285 + * Delete all nodes whose owning processor is being destroyed.
14286 + * Parameters:
14287 + * hNodeMgr: Node manager object.
14288 + * hProc: Handle to processor object being destroyed.
14289 + * Returns:
14290 + * DSP_SOK: Success.
14291 + * DSP_EFAIL: Unable to delete all nodes belonging to hProc.
14292 + * Requires:
14293 + * Valid hNodeMgr.
14294 + * hProc != NULL.
14295 + * Ensures:
14296 + */
14297 + extern DSP_STATUS NODE_CloseOrphans(struct NODE_MGR *hNodeMgr,
14298 + struct PROC_OBJECT *hProc);
14301 + * ======== NODE_Connect ========
14302 + * Purpose:
14303 + * Connect two nodes on the DSP, or a node on the DSP to the GPP. In the
14304 + * case that the connnection is being made between a node on the DSP and
14305 + * the GPP, one of the node handles (either hNode1 or hNode2) must be
14306 + * the constant NODE_HGPPNODE.
14307 + * Parameters:
14308 + * hNode1: Handle of first node to connect to second node. If
14309 + * this is a connection from the GPP to hNode2, hNode1
14310 + * must be the constant NODE_HGPPNODE. Otherwise, hNode1
14311 + * must be a node handle returned from a successful call
14312 + * to Node_Allocate().
14313 + * hNode2: Handle of second node. Must be either NODE_HGPPNODE
14314 + * if this is a connection from DSP node to GPP, or a
14315 + * node handle returned from a successful call to
14316 + * NODE_Allocate().
14317 + * uStream1: Output stream index on first node, to be connected
14318 + * to second node's input stream. Value must range from
14319 + * 0 <= uStream1 < number of output streams.
14320 + * uStream2: Input stream index on second node. Value must range
14321 + * from 0 <= uStream2 < number of input streams.
14322 + * pAttrs: Stream attributes (NULL ==> use defaults).
14323 + * pConnParam: A pointer to a DSP_CBDATA structure that defines
14324 + * connection parameter for device nodes to pass to DSP
14325 + * side.
14326 + * If the value of this parameter is NULL, then this API
14327 + * behaves like DSPNode_Connect. This parameter will have
14328 + * length of the string and the null terminated string in
14329 + * DSP_CBDATA struct. This can be extended in future tp
14330 + * pass binary data.
14331 + * Returns:
14332 + * DSP_SOK: Success.
14333 + * DSP_EHANDLE: Invalid hNode1 or hNode2.
14334 + * DSP_EMEMORY: Insufficient host memory.
14335 + * DSP_EVALUE: A stream index parameter is invalid.
14336 + * DSP_EALREADYCONNECTED: A connection already exists for one of the
14337 + * indices uStream1 or uStream2.
14338 + * DSP_EWRONGSTATE: Either hNode1 or hNode2 is not in the
14339 + * NODE_ALLOCATED state.
14340 + * DSP_ENOMORECONNECTIONS: No more connections available.
14341 + * DSP_EFAIL: Attempt to make an illegal connection (eg,
14342 + * Device node to device node, or device node to
14343 + * GPP), the two nodes are on different DSPs.
14344 + * Requires:
14345 + * NODE_Init() called.
14346 + * Ensures:
14347 + */
14348 + extern DSP_STATUS NODE_Connect(struct NODE_OBJECT *hNode1,
14349 + u32 uStream1,
14350 + struct NODE_OBJECT *hNode2,
14351 + u32 uStream2,
14352 + OPTIONAL IN struct DSP_STRMATTR *pAttrs,
14353 + OPTIONAL IN struct DSP_CBDATA
14354 + *pConnParam);
14357 + * ======== NODE_Create ========
14358 + * Purpose:
14359 + * Create a node on the DSP by remotely calling the node's create
14360 + * function. If necessary, load code that contains the node's create
14361 + * function.
14362 + * Parameters:
14363 + * hNode: Node handle returned from NODE_Allocate().
14364 + * Returns:
14365 + * DSP_SOK: Success.
14366 + * DSP_EHANDLE: Invalid hNode.
14367 + * DSP_ESYMBOL: Create function not found in the COFF file.
14368 + * DSP_EWRONGSTATE: Node is not in the NODE_ALLOCATED state.
14369 + * DSP_EMEMORY: Memory allocation failure on the DSP.
14370 + * DSP_ETASK: Unable to create node's task or process on the DSP.
14371 + * DSP_ESTREAM: Stream creation failure on the DSP.
14372 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
14373 + * DSP_EUSER1-16: A user-defined failure occurred on the DSP.
14374 + * DSP_EFAIL: A failure occurred, unable to create node.
14375 + * Requires:
14376 + * NODE_Init() called.
14377 + * Ensures:
14378 + */
14379 + extern DSP_STATUS NODE_Create(struct NODE_OBJECT *hNode);
14382 + * ======== NODE_CreateMgr ========
14383 + * Purpose:
14384 + * Create a NODE Manager object. This object handles the creation,
14385 + * deletion, and execution of nodes on the DSP target. The NODE Manager
14386 + * also maintains a pipe map of used and available node connections.
14387 + * Each DEV object should have exactly one NODE Manager object.
14389 + * Parameters:
14390 + * phNodeMgr: Location to store node manager handle on output.
14391 + * hDevObject: Device for this processor.
14392 + * Returns:
14393 + * DSP_SOK: Success;
14394 + * DSP_EMEMORY: Insufficient memory for requested resources.
14395 + * DSP_EFAIL: General failure.
14396 + * Requires:
14397 + * NODE_Init() called.
14398 + * phNodeMgr != NULL.
14399 + * hDevObject != NULL.
14400 + * Ensures:
14401 + * DSP_SOK: Valide *phNodeMgr.
14402 + * error: *phNodeMgr == NULL.
14403 + */
14404 + extern DSP_STATUS NODE_CreateMgr(OUT struct NODE_MGR **phNodeMgr,
14405 + struct DEV_OBJECT *hDevObject);
14408 + * ======== NODE_Delete ========
14409 + * Purpose:
14410 + * Delete resources allocated in NODE_Allocate(). If the node was
14411 + * created, delete the node on the DSP by remotely calling the node's
14412 + * delete function. Loads the node's delete function if necessary.
14413 + * GPP side resources are freed after node's delete function returns.
14414 + * Parameters:
14415 + * hNode: Node handle returned from NODE_Allocate().
14416 + * Returns:
14417 + * DSP_SOK: Success.
14418 + * DSP_EHANDLE: Invalid hNode.
14419 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
14420 + * DSP_EDELETE: A deletion failure occurred.
14421 + * DSP_EUSER1-16: Node specific failure occurred on the DSP.
14422 + * DSP_EFAIL: A failure occurred in deleting the node.
14423 + * DSP_ESYMBOL: Delete function not found in the COFF file.
14424 + * Requires:
14425 + * NODE_Init() called.
14426 + * Ensures:
14427 + * DSP_SOK: hNode is invalid.
14428 + */
14429 + extern DSP_STATUS NODE_Delete(struct NODE_OBJECT *hNode);
14432 + * ======== NODE_DeleteMgr ========
14433 + * Purpose:
14434 + * Delete the NODE Manager.
14435 + * Parameters:
14436 + * hNodeMgr: Node manager object.
14437 + * Returns:
14438 + * DSP_SOK: Success.
14439 + * Requires:
14440 + * NODE_Init() called.
14441 + * Valid hNodeMgr.
14442 + * Ensures:
14443 + */
14444 + extern DSP_STATUS NODE_DeleteMgr(struct NODE_MGR *hNodeMgr);
14447 + * ======== NODE_EnumNodes ========
14448 + * Purpose:
14449 + * Enumerate the nodes currently allocated for the DSP.
14450 + * Parameters:
14451 + * hNodeMgr: Node manager returned from NODE_CreateMgr().
14452 + * aNodeTab: Array to copy node handles into.
14453 + * uNodeTabSize: Number of handles that can be written to aNodeTab.
14454 + * puNumNodes: Location where number of node handles written to
14455 + * aNodeTab will be written.
14456 + * puAllocated: Location to write total number of allocated nodes.
14457 + * Returns:
14458 + * DSP_SOK: Success.
14459 + * DSP_ESIZE: aNodeTab is too small to hold all node handles.
14460 + * Requires:
14461 + * Valid hNodeMgr.
14462 + * aNodeTab != NULL || uNodeTabSize == 0.
14463 + * puNumNodes != NULL.
14464 + * puAllocated != NULL.
14465 + * Ensures:
14466 + * - (DSP_ESIZE && *puNumNodes == 0)
14467 + * - || (DSP_SOK && *puNumNodes <= uNodeTabSize) &&
14468 + * (*puAllocated == *puNumNodes)
14469 + */
14470 + extern DSP_STATUS NODE_EnumNodes(struct NODE_MGR *hNodeMgr,
14471 + IN DSP_HNODE *aNodeTab,
14472 + u32 uNodeTabSize,
14473 + OUT u32 *puNumNodes,
14474 + OUT u32 *puAllocated);
14477 + * ======== NODE_Exit ========
14478 + * Purpose:
14479 + * Discontinue usage of NODE module.
14480 + * Parameters:
14481 + * Returns:
14482 + * Requires:
14483 + * NODE_Init() successfully called before.
14484 + * Ensures:
14485 + * Any resources acquired in NODE_Init() will be freed when last NODE
14486 + * client calls NODE_Exit().
14487 + */
14488 + extern void NODE_Exit();
14491 + * ======== NODE_FreeMsgBuf ========
14492 + * Purpose:
14493 + * Free a message buffer previously allocated with NODE_AllocMsgBuf.
14494 + * Parameters:
14495 + * hNode: The node handle.
14496 + * pBuffer: (Address) Buffer allocated by NODE_AllocMsgBuf.
14497 + * pAttr: Same buffer attributes passed to NODE_AllocMsgBuf.
14498 + * Returns:
14499 + * DSP_SOK: Success.
14500 + * DSP_EHANDLE: Invalid node handle.
14501 + * DSP_EFAIL: Failure to free the buffer.
14502 + * Requires:
14503 + * NODE_Init() called.
14504 + * pBuffer != NULL.
14505 + * Ensures:
14506 + */
14507 + extern DSP_STATUS NODE_FreeMsgBuf(struct NODE_OBJECT *hNode,
14508 + IN u8 *pBuffer,
14509 + OPTIONAL struct DSP_BUFFERATTR
14510 + *pAttr);
14513 + * ======== NODE_GetAttr ========
14514 + * Purpose:
14515 + * Copy the current attributes of the specified node into a DSP_NODEATTR
14516 + * structure.
14517 + * Parameters:
14518 + * hNode: Node object allocated from NODE_Allocate().
14519 + * pAttr: Pointer to DSP_NODEATTR structure to copy node's
14520 + * attributes.
14521 + * uAttrSize: Size of pAttr.
14522 + * Returns:
14523 + * DSP_SOK: Success.
14524 + * DSP_EHANDLE: Invalid hNode.
14525 + * Requires:
14526 + * NODE_Init() called.
14527 + * pAttr != NULL.
14528 + * Ensures:
14529 + * DSP_SOK: *pAttrs contains the node's current attributes.
14530 + */
14531 + extern DSP_STATUS NODE_GetAttr(struct NODE_OBJECT *hNode,
14532 + OUT struct DSP_NODEATTR *pAttr,
14533 + u32 uAttrSize);
14536 + * ======== NODE_GetMessage ========
14537 + * Purpose:
14538 + * Retrieve a message from a node on the DSP. The node must be either a
14539 + * message node, task node, or XDAIS socket node.
14540 + * If a message is not available, this function will block until a
14541 + * message is available, or the node's timeout value is reached.
14542 + * Parameters:
14543 + * hNode: Node handle returned from NODE_Allocate().
14544 + * pMessage: Pointer to DSP_MSG structure to copy the
14545 + * message into.
14546 + * uTimeout: Timeout in milliseconds to wait for message.
14547 + * Returns:
14548 + * DSP_SOK: Success.
14549 + * DSP_EHANDLE: Invalid hNode.
14550 + * DSP_ENODETYPE: Cannot retrieve messages from this type of node.
14551 + * DSP_ETIMEOUT: Timeout occurred and no message is available.
14552 + * DSP_EFAIL: Error occurred while trying to retrieve a message.
14553 + * Requires:
14554 + * NODE_Init() called.
14555 + * pMessage != NULL.
14556 + * Ensures:
14557 + */
14558 + extern DSP_STATUS NODE_GetMessage(struct NODE_OBJECT *hNode,
14559 + OUT struct DSP_MSG *pMessage,
14560 + u32 uTimeout);
14563 + * ======== NODE_GetNldrObj ========
14564 + * Purpose:
14565 + * Retrieve the Nldr manager
14566 + * Parameters:
14567 + * hNodeMgr: Node Manager
14568 + * phNldrObj: Pointer to a Nldr manager handle
14569 + * Returns:
14570 + * DSP_SOK: Success.
14571 + * DSP_EHANDLE: Invalid hNode.
14572 + * Ensures:
14573 + */
14574 + extern DSP_STATUS NODE_GetNldrObj(struct NODE_MGR *hNodeMgr,
14575 + OUT struct NLDR_OBJECT **phNldrObj);
14578 + * ======== NODE_Init ========
14579 + * Purpose:
14580 + * Initialize the NODE module.
14581 + * Parameters:
14582 + * Returns:
14583 + * TRUE if initialization succeeded, FALSE otherwise.
14584 + * Ensures:
14585 + */
14586 + extern bool NODE_Init();
14589 + * ======== NODE_OnExit ========
14590 + * Purpose:
14591 + * Gets called when RMS_EXIT is received for a node. PROC needs to pass
14592 + * this function as a parameter to MSG_Create(). This function then gets
14593 + * called by the mini-driver when an exit message for a node is received.
14594 + * Parameters:
14595 + * hNode: Handle of the node that the exit message is for.
14596 + * nStatus: Return status of the node's execute phase.
14597 + * Returns:
14598 + * Ensures:
14599 + */
14600 + void NODE_OnExit(struct NODE_OBJECT *hNode, s32 nStatus);
14603 + * ======== NODE_Pause ========
14604 + * Purpose:
14605 + * Suspend execution of a node currently running on the DSP.
14606 + * Parameters:
14607 + * hNode: Node object representing a node currently
14608 + * running on the DSP.
14609 + * Returns:
14610 + * DSP_SOK: Success.
14611 + * DSP_EHANDLE: Invalid hNode.
14612 + * DSP_ENODETYPE: Node is not a task or socket node.
14613 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
14614 + * DSP_EWRONGSTSATE: Node is not in NODE_RUNNING state.
14615 + * DSP_EFAIL: Failed to pause node.
14616 + * Requires:
14617 + * NODE_Init() called.
14618 + * Ensures:
14619 + */
14620 + extern DSP_STATUS NODE_Pause(struct NODE_OBJECT *hNode);
14623 + * ======== NODE_PutMessage ========
14624 + * Purpose:
14625 + * Send a message to a message node, task node, or XDAIS socket node.
14626 + * This function will block until the message stream can accommodate
14627 + * the message, or a timeout occurs. The message will be copied, so Msg
14628 + * can be re-used immediately after return.
14629 + * Parameters:
14630 + * hNode: Node handle returned by NODE_Allocate().
14631 + * pMsg: Location of message to be sent to the node.
14632 + * uTimeout: Timeout in msecs to wait.
14633 + * Returns:
14634 + * DSP_SOK: Success.
14635 + * DSP_EHANDLE: Invalid hNode.
14636 + * DSP_ENODETYPE: Messages can't be sent to this type of node.
14637 + * DSP_ETIMEOUT: Timeout occurred before message could be set.
14638 + * DSP_EWRONGSTATE: Node is in invalid state for sending messages.
14639 + * DSP_EFAIL: Unable to send message.
14640 + * Requires:
14641 + * NODE_Init() called.
14642 + * pMsg != NULL.
14643 + * Ensures:
14644 + */
14645 + extern DSP_STATUS NODE_PutMessage(struct NODE_OBJECT *hNode,
14646 + IN CONST struct DSP_MSG *pMsg,
14647 + u32 uTimeout);
14650 + * ======== NODE_RegisterNotify ========
14651 + * Purpose:
14652 + * Register to be notified on specific events for this node.
14653 + * Parameters:
14654 + * hNode: Node handle returned by NODE_Allocate().
14655 + * uEventMask: Mask of types of events to be notified about.
14656 + * uNotifyType: Type of notification to be sent.
14657 + * hNotification: Handle to be used for notification.
14658 + * Returns:
14659 + * DSP_SOK: Success.
14660 + * DSP_EHANDLE: Invalid hNode.
14661 + * DSP_EMEMORY: Insufficient memory on GPP.
14662 + * DSP_EVALUE: uEventMask is invalid.
14663 + * DSP_ENOTIMPL: Notification type specified by uNotifyType is not
14664 + * supported.
14665 + * Requires:
14666 + * NODE_Init() called.
14667 + * hNotification != NULL.
14668 + * Ensures:
14669 + */
14670 + extern DSP_STATUS NODE_RegisterNotify(struct NODE_OBJECT *hNode,
14671 + u32 uEventMask, u32 uNotifyType,
14672 + struct DSP_NOTIFICATION
14673 + *hNotification);
14676 + * ======== NODE_Run ========
14677 + * Purpose:
14678 + * Start execution of a node's execute phase, or resume execution of
14679 + * a node that has been suspended (via NODE_Pause()) on the DSP. Load
14680 + * the node's execute function if necessary.
14681 + * Parameters:
14682 + * hNode: Node object representing a node currently
14683 + * running on the DSP.
14684 + * Returns:
14685 + * DSP_SOK: Success.
14686 + * DSP_EHANDLE: Invalid hNode.
14687 + * DSP_ENODETYPE: hNode doesn't represent a message, task or dais
14688 + * socket node.
14689 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
14690 + * DSP_EWRONGSTSATE: Node is not in NODE_PAUSED or NODE_CREATED state.
14691 + * DSP_EFAIL: Unable to start or resume execution.
14692 + * DSP_ESYMBOL: Execute function not found in the COFF file.
14693 + * Requires:
14694 + * NODE_Init() called.
14695 + * Ensures:
14696 + */
14697 + extern DSP_STATUS NODE_Run(struct NODE_OBJECT *hNode);
14700 + * ======== NODE_Terminate ========
14701 + * Purpose:
14702 + * Signal a node running on the DSP that it should exit its execute
14703 + * phase function.
14704 + * Parameters:
14705 + * hNode: Node object representing a node currently
14706 + * running on the DSP.
14707 + * pStatus: Location to store execute-phase function return
14708 + * value (DSP_EUSER1-16).
14709 + * Returns:
14710 + * DSP_SOK: Success.
14711 + * DSP_EHANDLE: Invalid hNode.
14712 + * DSP_ETIMEOUT: A timeout occurred before the DSP responded.
14713 + * DSP_ENODETYPE: Type of node specified cannot be terminated.
14714 + * DSP_EWRONGSTATE: Operation not valid for the current node state.
14715 + * DSP_EFAIL: Unable to terminate the node.
14716 + * Requires:
14717 + * NODE_Init() called.
14718 + * pStatus != NULL.
14719 + * Ensures:
14720 + */
14721 + extern DSP_STATUS NODE_Terminate(struct NODE_OBJECT *hNode,
14722 + OUT DSP_STATUS *pStatus);
14727 + * ======== NODE_GetUUIDProps ========
14728 + * Purpose:
14729 + * Fetch Node properties given the UUID
14730 + * Parameters:
14732 + */
14733 + extern DSP_STATUS NODE_GetUUIDProps(DSP_HPROCESSOR hProcessor,
14734 + IN CONST struct DSP_UUID *pNodeId,
14735 + OUT struct DSP_NDBPROPS
14736 + *pNodeProps);
14738 +#endif /* NODE_ */
14739 Index: lk/arch/arm/plat-omap/include/bridge/nodedefs.h
14740 ===================================================================
14741 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
14742 +++ lk/arch/arm/plat-omap/include/bridge/nodedefs.h 2008-08-18 10:38:34.000000000 +0300
14743 @@ -0,0 +1,40 @@
14745 + * bridge/inc/nodedefs.h
14747 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
14749 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
14751 + * This package is free software; you can redistribute it and/or modify
14752 + * it under the terms of the GNU General Public License version 2 as
14753 + * published by the Free Software Foundation.
14755 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14756 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14757 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14758 + */
14762 + * ======== nodedefs.h ========
14763 + * Description:
14764 + * Global NODE constants and types, shared by PROCESSOR, NODE, and DISP.
14766 + *! Revision History
14767 + *! ================
14768 + *! 23-Apr-2001 jeh Removed NODE_MGRATTRS.
14769 + *! 21-Sep-2000 jeh Removed NODE_TYPE enum.
14770 + *! 17-Jul-2000 jeh Changed order of node types to match rms_sh.h.
14771 + *! 20-Jun-2000 jeh Created.
14772 + */
14774 +#ifndef NODEDEFS_
14775 +#define NODEDEFS_
14777 +#define NODE_SUSPENDEDPRI -1
14779 +/* NODE Objects: */
14780 + struct NODE_MGR;
14781 + struct NODE_OBJECT;
14783 +#endif /* NODEDEFS_ */
14784 Index: lk/arch/arm/plat-omap/include/bridge/nodepriv.h
14785 ===================================================================
14786 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
14787 +++ lk/arch/arm/plat-omap/include/bridge/nodepriv.h 2008-08-18 10:38:34.000000000 +0300
14788 @@ -0,0 +1,237 @@
14790 + * bridge/inc/nodepriv.h
14792 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
14794 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
14796 + * This package is free software; you can redistribute it and/or modify
14797 + * it under the terms of the GNU General Public License version 2 as
14798 + * published by the Free Software Foundation.
14800 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14801 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14802 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14803 + */
14806 + * ======== nodepriv.h ========
14807 + * Description:
14808 + * Private node header shared by NODE and DISP.
14810 + * Public Functions:
14811 + * NODE_GetChannelId
14812 + * NODE_GetStrmMgr
14813 + * NODE_GetTimeout
14814 + * NODE_GetType
14815 + * NODE_GetLoadType
14817 + *! Revision History
14818 + *! ================
14819 + *! 19-Nov-2002 map Added NODE_GetLoadType
14820 + *! 13-Feb-2002 jeh Added uSysStackSize to NODE_TASKARGS.
14821 + *! 23-Apr-2001 jeh Removed unused typedefs, defines.
14822 + *! 10-Oct-2000 jeh Added alignment to NODE_STRMDEF.
14823 + *! 20-Jun-2000 jeh Created.
14824 + */
14826 +#ifndef NODEPRIV_
14827 +#define NODEPRIV_
14829 +#include <strmdefs.h>
14830 +#include <nodedefs.h>
14831 +#include <nldrdefs.h>
14833 +/* DSP address of node environment structure */
14834 + typedef u32 NODE_ENV;
14837 + * Node create structures
14838 + */
14840 +/* Message node */
14841 + struct NODE_MSGARGS {
14842 + u32 uMaxMessages; /* Max # of simultaneous messages for node */
14843 + u32 uSegid; /* Segment for allocating message buffers */
14844 + u32 uNotifyType; /* Notify type (SEM_post, SWI_post, etc.) */
14845 + u32 uArgLength; /* Length in 32-bit words of arg data block */
14846 + u8 *pData; /* Argument data for node */
14847 + } ;
14849 + struct NODE_STRMDEF {
14850 + u32 uBufsize; /* Size of buffers for SIO stream */
14851 + u32 uNumBufs; /* max # of buffers in SIO stream at once */
14852 + u32 uSegid; /* Memory segment id to allocate buffers */
14853 + u32 uTimeout; /* Timeout for blocking SIO calls */
14854 + u32 uAlignment; /* Buffer alignment */
14855 + char *szDevice; /* Device name for stream */
14856 + } ;
14858 +/* Task node */
14859 + struct NODE_TASKARGS {
14860 + struct NODE_MSGARGS msgArgs;
14861 + s32 nPriority;
14862 + u32 uStackSize;
14863 + u32 uSysStackSize;
14864 + u32 uStackSeg;
14865 + u32 uDSPHeapResAddr; /* DSP virtual heap address */
14866 + u32 uDSPHeapAddr; /* DSP virtual heap address */
14867 + u32 uHeapSize; /* Heap size */
14868 + u32 uGPPHeapAddr; /* GPP virtual heap address */
14869 + u32 uProfileID; /* Profile ID */
14870 + u32 uNumInputs;
14871 + u32 uNumOutputs;
14872 + u32 ulDaisArg; /* Address of iAlg object */
14873 + struct NODE_STRMDEF *strmInDef;
14874 + struct NODE_STRMDEF *strmOutDef;
14875 + } ;
14878 + * ======== NODE_CREATEARGS ========
14879 + */
14880 + struct NODE_CREATEARGS {
14881 + union {
14882 + struct NODE_MSGARGS msgArgs;
14883 + struct NODE_TASKARGS taskArgs;
14884 + } asa;
14885 + } ;
14888 + * Node types: Message node, task node, xDAIS socket node, and
14889 + * device node. _NODE_GPP is used when defining a stream connection
14890 + * between a task or socket node and the GPP.
14892 + * ~~~~~~~~~~~~~~
14893 + * TO DO:
14894 + * Clean up when Node Manager uses only one critical section.
14895 + * ~~~~~~~~~~~~~~
14896 + */
14897 + enum NODE_TYPE {
14898 + _NODE_DEVICE = NODE_DEVICE,
14899 + _NODE_TASK = NODE_TASK,
14900 + _NODE_DAISSOCKET = NODE_DAISSOCKET,
14901 + _NODE_MESSAGE = NODE_MESSAGE,
14902 + NODE_GPP
14903 + } ;
14906 + * ======== NODE_STATE ========
14907 + * Internal node states.
14908 + */
14909 + enum NODE_STATE {
14910 + _NODE_ALLOCATED = NODE_ALLOCATED,
14911 + _NODE_CREATED = NODE_CREATED,
14912 + _NODE_RUNNING = NODE_RUNNING,
14913 + _NODE_PAUSED = NODE_PAUSED,
14914 + _NODE_DONE = NODE_DONE,
14915 + NODE_CREATING,
14916 + NODE_STARTING,
14917 + NODE_PAUSING,
14918 + NODE_TERMINATING,
14919 + NODE_DELETING,
14920 + } ;
14923 + * ======== NODE_GetChannelId ========
14924 + * Purpose:
14925 + * Get the channel index reserved for a stream connection between the
14926 + * host and a node. This index is reserved when NODE_Connect() is called
14927 + * to connect the node with the host. This index should be passed to
14928 + * the CHNL_Open function when the stream is actually opened.
14929 + * Parameters:
14930 + * hNode: Node object allocated from NODE_Allocate().
14931 + * uDir: Input (DSP_TONODE) or output (DSP_FROMNODE).
14932 + * uIndex: Stream index.
14933 + * pulId: Location to store channel index.
14934 + * Returns:
14935 + * DSP_SOK: Success.
14936 + * DSP_EHANDLE: Invalid hNode.
14937 + * DSP_ENODETYPE: Not a task or DAIS socket node.
14938 + * DSP_EVALUE: The node's stream corresponding to uIndex and uDir
14939 + * is not a stream to or from the host.
14940 + * Requires:
14941 + * NODE_Init() called.
14942 + * Valid uDir.
14943 + * pulId != NULL.
14944 + * Ensures:
14945 + */
14946 + extern DSP_STATUS NODE_GetChannelId(struct NODE_OBJECT *hNode,
14947 + u32 uDir,
14948 + u32 uIndex, OUT u32 *pulId);
14951 + * ======== NODE_GetStrmMgr ========
14952 + * Purpose:
14953 + * Get the STRM manager for a node.
14954 + * Parameters:
14955 + * hNode: Node allocated with NODE_Allocate().
14956 + * phStrmMgr: Location to store STRM manager on output.
14957 + * Returns:
14958 + * DSP_SOK: Success.
14959 + * DSP_EHANDLE: Invalid hNode.
14960 + * Requires:
14961 + * phStrmMgr != NULL.
14962 + * Ensures:
14963 + */
14964 + extern DSP_STATUS NODE_GetStrmMgr(struct NODE_OBJECT *hNode,
14965 + struct STRM_MGR **phStrmMgr);
14968 + * ======== NODE_GetTimeout ========
14969 + * Purpose:
14970 + * Get the timeout value of a node.
14971 + * Parameters:
14972 + * hNode: Node allocated with NODE_Allocate(), or DSP_HGPPNODE.
14973 + * Returns:
14974 + * Node's timeout value.
14975 + * Requires:
14976 + * Valid hNode.
14977 + * Ensures:
14978 + */
14979 + extern u32 NODE_GetTimeout(struct NODE_OBJECT *hNode);
14982 + * ======== NODE_GetType ========
14983 + * Purpose:
14984 + * Get the type (device, message, task, or XDAIS socket) of a node.
14985 + * Parameters:
14986 + * hNode: Node allocated with NODE_Allocate(), or DSP_HGPPNODE.
14987 + * Returns:
14988 + * Node type: NODE_DEVICE, NODE_TASK, NODE_XDAIS, or NODE_GPP.
14989 + * Requires:
14990 + * Valid hNode.
14991 + * Ensures:
14992 + */
14993 + extern enum NODE_TYPE NODE_GetType(struct NODE_OBJECT *hNode);
14996 + * ======== GetNodeInfo ========
14997 + * Purpose:
14998 + * Get node information without holding semaphore.
14999 + * Parameters:
15000 + * hNode: Node allocated with NODE_Allocate(), or DSP_HGPPNODE.
15001 + * Returns:
15002 + * Node info: priority, device owner, no. of streams, execution state
15003 + * NDB properties.
15004 + * Requires:
15005 + * Valid hNode.
15006 + * Ensures:
15007 + */
15008 + extern void GetNodeInfo(struct NODE_OBJECT *hNode,
15009 + struct DSP_NODEINFO *pNodeInfo);
15012 + * ======== NODE_GetLoadType ========
15013 + * Purpose:
15014 + * Get the load type (dynamic, overlay, static) of a node.
15015 + * Parameters:
15016 + * hNode: Node allocated with NODE_Allocate(), or DSP_HGPPNODE.
15017 + * Returns:
15018 + * Node type: NLDR_DYNAMICLOAD, NLDR_OVLYLOAD, NLDR_STATICLOAD
15019 + * Requires:
15020 + * Valid hNode.
15021 + * Ensures:
15022 + */
15023 + extern enum NLDR_LOADTYPE NODE_GetLoadType(struct NODE_OBJECT *hNode);
15025 +#endif /* NODEPRIV_ */
15026 Index: lk/arch/arm/plat-omap/include/bridge/ntfy.h
15027 ===================================================================
15028 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
15029 +++ lk/arch/arm/plat-omap/include/bridge/ntfy.h 2008-08-18 10:38:34.000000000 +0300
15030 @@ -0,0 +1,146 @@
15032 + * bridge/inc/ntfy.h
15034 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
15036 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
15038 + * This package is free software; you can redistribute it and/or modify
15039 + * it under the terms of the GNU General Public License version 2 as
15040 + * published by the Free Software Foundation.
15042 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15043 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15044 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15045 + */
15049 + * ======== ntfy.h ========
15050 + * Purpose:
15051 + * Manage lists of notification events.
15053 + * Public Functions:
15054 + * NTFY_Create
15055 + * NTFY_Delete
15056 + * NTFY_Exit
15057 + * NTFY_Init
15058 + * NTFY_Notify
15059 + * NTFY_Register
15061 + *! Revision History:
15062 + *! =================
15063 + *! 05-Nov-2001 kc: Updated NTFY_Register.
15064 + *! 07-Sep-2000 jeh Created.
15065 + */
15067 +#ifndef NTFY_
15068 +#define NTFY_
15070 + struct NTFY_OBJECT;
15073 + * ======== NTFY_Create ========
15074 + * Purpose:
15075 + * Create an empty list of notifications.
15076 + * Parameters:
15077 + * phNtfy: Location to store handle on output.
15078 + * Returns:
15079 + * DSP_SOK: Success.
15080 + * DSP_EMEMORY: Memory allocation failure.
15081 + * Requires:
15082 + * NTFY_Init() called.
15083 + * phNtfy != NULL.
15084 + * Ensures:
15085 + * DSP_SUCCEEDED(status) <==> IsValid(*phNtfy).
15086 + */
15087 + extern DSP_STATUS NTFY_Create(OUT struct NTFY_OBJECT **phNtfy);
15090 + * ======== NTFY_Delete ========
15091 + * Purpose:
15092 + * Free resources allocated in NTFY_Create.
15093 + * Parameters:
15094 + * hNtfy: Handle returned from NTFY_Create().
15095 + * Returns:
15096 + * Requires:
15097 + * NTFY_Init() called.
15098 + * IsValid(hNtfy).
15099 + * Ensures:
15100 + */
15101 + extern void NTFY_Delete(IN struct NTFY_OBJECT *hNtfy);
15104 + * ======== NTFY_Exit ========
15105 + * Purpose:
15106 + * Discontinue usage of NTFY module.
15107 + * Parameters:
15108 + * Returns:
15109 + * Requires:
15110 + * NTFY_Init() successfully called before.
15111 + * Ensures:
15112 + */
15113 + extern void NTFY_Exit();
15116 + * ======== NTFY_Init ========
15117 + * Purpose:
15118 + * Initialize the NTFY module.
15119 + * Parameters:
15120 + * Returns:
15121 + * TRUE if initialization succeeded, FALSE otherwise.
15122 + * Ensures:
15123 + */
15124 + extern bool NTFY_Init();
15127 + * ======== NTFY_Notify ========
15128 + * Purpose:
15129 + * Execute notify function (signal event or post message) for every
15130 + * element in the notification list that is to be notified about the
15131 + * event specified in uEventMask.
15132 + * Parameters:
15133 + * hNtfy: Handle returned from NTFY_Create().
15134 + * uEventMask: The type of event that has occurred.
15135 + * Returns:
15136 + * Requires:
15137 + * NTFY_Init() called.
15138 + * IsValid(hNtfy).
15139 + * Ensures:
15140 + */
15141 + extern void NTFY_Notify(IN struct NTFY_OBJECT *hNtfy,
15142 + IN u32 uEventMask);
15145 + * ======== NTFY_Register ========
15146 + * Purpose:
15147 + * Add a notification element to the list. If the notification is already
15148 + * registered, and uEventMask != 0, the notification will get posted for
15149 + * events specified in the new event mask. If the notification is already
15150 + * registered and uEventMask == 0, the notification will be unregistered.
15151 + * Parameters:
15152 + * hNtfy: Handle returned from NTFY_Create().
15153 + * hNotification: Handle to a DSP_NOTIFICATION object.
15154 + * uEventMask: Events to be notified about.
15155 + * uNotifyType: Type of notification: DSP_SIGNALEVENT.
15156 + * Returns:
15157 + * DSP_SOK: Success.
15158 + * DSP_EMEMORY: Insufficient memory.
15159 + * DSP_EVALUE: uEventMask is 0 and hNotification was not
15160 + * previously registered.
15161 + * DSP_EHANDLE: NULL hNotification, hNotification event name
15162 + * too long, or hNotification event name NULL.
15163 + * Requires:
15164 + * NTFY_Init() called.
15165 + * IsValid(hNtfy).
15166 + * hNotification != NULL.
15167 + * uNotifyType is DSP_SIGNALEVENT
15168 + * Ensures:
15169 + */
15170 + extern DSP_STATUS NTFY_Register(IN struct NTFY_OBJECT *hNtfy,
15171 + IN struct DSP_NOTIFICATION
15172 + *hNotification,
15173 + IN u32 uEventMask,
15174 + IN u32 uNotifyType);
15176 +#endif /* NTFY_ */
15177 Index: lk/arch/arm/plat-omap/include/bridge/prcs.h
15178 ===================================================================
15179 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
15180 +++ lk/arch/arm/plat-omap/include/bridge/prcs.h 2008-08-18 10:38:34.000000000 +0300
15181 @@ -0,0 +1,101 @@
15183 + * bridge/inc/prcs.h
15185 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
15187 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
15189 + * This package is free software; you can redistribute it and/or modify
15190 + * it under the terms of the GNU General Public License version 2 as
15191 + * published by the Free Software Foundation.
15193 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15194 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15195 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15196 + */
15200 + * ======== prcs.h ========
15201 + * Purpose:
15202 + * Return process and thread information.
15204 + * Public Functions:
15205 + * PRCS_Exit
15206 + * PRCS_GetCurrentHandle
15207 + * PRCS_GetCurThreadHandle
15208 + * PRCS_Init
15210 + *! Revision History:
15211 + *! ================
15212 + *! 18-Dec-2000 rr: PRCS_GetCurrentProcesshandle's DBC_Ensure class
15213 + *! removed. See the foot node.
15214 + *! 06-Jul-2000 rr: Name changed to PRCS to accomodate RM PROC.
15215 + *! 29-Oct-1999 kc: Cleaned up for code review.
15216 + *! 22-Oct-1996 gp: Created.
15217 + */
15219 +#ifndef _PRCS_H
15220 +#define _PRCS_H
15223 + * ======== PRCS_Exit ========
15224 + * Purpose:
15225 + * Discontinue usage of module; free resources when reference count
15226 + * reaches 0.
15227 + * Parameters:
15228 + * Returns:
15229 + * Requires:
15230 + * PRCS initialized.
15231 + * Ensures:
15232 + * Resources used by module are freed when cRef reaches zero.
15233 + */
15234 + extern void PRCS_Exit();
15237 + * ======== PRCS_GetCurrentHandle ========
15238 + * Purpose:
15239 + * Retrieve the handle of the calling process.
15240 + * Parameters:
15241 + * phProcess: Location to store the current process handle.
15242 + * Returns:
15243 + * DSP_SOK: Success.
15244 + * DSP_EPOINTER: Invalid argument.
15245 + * Requires:
15246 + * - PRCS initialized.
15247 + * - phProcess != NULL.
15248 + * Ensures:
15250 + */
15251 + extern DSP_STATUS PRCS_GetCurrentHandle(OUT HANDLE *phProcess);
15254 + * ======== PRCS_GetCurThreadHandle ========
15255 + * Purpose:
15256 + * Retrieve the current thread handle
15257 + * Parameters:
15258 + * phThread: Location to store the current thread handle.
15259 + * Returns:
15260 + * DSP_SOK: Success.
15261 + * DSP_EPOINTER: Invalid argument.
15262 + * Requires:
15263 + * PRCS initialized.
15264 + * Ensures:
15265 + * If returned DSP_SOK, phThread is a valid pseudo thread handle.
15266 + */
15267 + extern DSP_STATUS PRCS_GetCurThreadHandle(OUT HANDLE *phThread);
15270 + * ======== PRCS_Init ========
15271 + * Purpose:
15272 + * Initializes private state of PROC module.
15273 + * Parameters:
15274 + * Returns:
15275 + * TRUE if initialized; FALSE if error occured.
15276 + * Requires:
15277 + * Ensures:
15278 + * PRCS initialized.
15279 + */
15280 + extern bool PRCS_Init();
15282 +#endif /* _PRCS_H */
15283 Index: lk/arch/arm/plat-omap/include/bridge/proc.h
15284 ===================================================================
15285 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
15286 +++ lk/arch/arm/plat-omap/include/bridge/proc.h 2008-08-18 10:38:34.000000000 +0300
15287 @@ -0,0 +1,648 @@
15289 + * bridge/inc/proc.h
15291 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
15293 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
15295 + * This package is free software; you can redistribute it and/or modify
15296 + * it under the terms of the GNU General Public License version 2 as
15297 + * published by the Free Software Foundation.
15299 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15300 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15301 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15302 + */
15306 + * ======== proc.h ========
15307 + * Description:
15308 + * This is the Class driver RM module interface.
15310 + * Public Functions:
15311 + * PROC_Attach
15312 + * PROC_Create
15313 + * PROC_Ctrl (OEM-function)
15314 + * PROC_Destroy
15315 + * PROC_Detach
15316 + * PROC_EnumNodes
15317 + * PROC_Exit
15318 + * PROC_FlushMemory
15319 + * PROC_GetDevObject (OEM-function)
15320 + * PROC_GetResourceInfo
15321 + * PROC_GetState
15322 + * PROC_GetProcessorId
15323 + * PROC_GetTrace (OEM-function)
15324 + * PROC_Init
15325 + * PROC_Load (OEM-function)
15326 + * PROC_Map
15327 + * PROC_NotifyAllclients
15328 + * PROC_NotifyClients (OEM-function)
15329 + * PROC_RegisterNotify
15330 + * PROC_ReserveMemory
15331 + * PROC_Start (OEM-function)
15332 + * PROC_UnMap
15333 + * PROC_UnReserveMemory
15335 + * Notes:
15337 + *! Revision History:
15338 + *! ================
15339 + *! 19-Apr-2004 sb Aligned DMM definitions with Symbian
15340 + *! 08-Mar-2004 sb Added the Dynamic Memory Mapping APIs
15341 + *! 09-Feb-2003 vp: Added PROC_GetProcessorID function
15342 + *! 29-Nov-2000 rr: Incorporated code review changes.
15343 + *! 28-Sep-2000 rr: Updated to Version 0.9.
15344 + *! 10-Aug-2000 rr: PROC_NotifyClients, PROC_GetProcessorHandle Added
15345 + *! 27-Jul-2000 rr: Updated to ver 0.8 of DSPAPI(types). GetTrace added.
15346 + *! 27-Jun-2000 rr: Created from dspapi.h
15347 + */
15349 +#ifndef PROC_
15350 +#define PROC_
15352 +#include <cfgdefs.h>
15353 +#include <devdefs.h>
15356 + * ======== PROC_Attach ========
15357 + * Purpose:
15358 + * Prepare for communication with a particular DSP processor, and return
15359 + * a handle to the processor object. The PROC Object gets created
15360 + * Parameters:
15361 + * uProcessor : The processor index (zero-based).
15362 + * hMgrObject : Handle to the Manager Object
15363 + * pAttrIn : Ptr to the DSP_PROCESSORATTRIN structure.
15364 + * A NULL value means use default values.
15365 + * phProcessor : Ptr to location to store processor handle.
15366 + * Returns:
15367 + * DSP_SOK : Success.
15368 + * DSP_EFAIL : General failure.
15369 + * DSP_EHANDLE : Invalid processor handle.
15370 + * DSP_SALREADYATTACHED: Success; Processor already attached.
15371 + * Requires:
15372 + * phProcessor != NULL.
15373 + * PROC Initialized.
15374 + * Ensures:
15375 + * DSP_EFAIL, and *phProcessor == NULL, OR
15376 + * Success and *phProcessor is a Valid Processor handle OR
15377 + * DSP_SALREADYATTACHED and *phProcessor is a Valid Processor.
15378 + * Details:
15379 + * When pAttrIn is NULL, the default timeout value is 10 seconds.
15380 + */
15381 + extern DSP_STATUS PROC_Attach(u32 uProcessor,
15382 + OPTIONAL CONST struct DSP_PROCESSORATTRIN
15383 + *pAttrIn,
15384 + OUT DSP_HPROCESSOR *phProcessor);
15387 + * ======== PROC_AutoStart =========
15388 + * Purpose:
15389 + * A Particular device gets loaded with the default image
15390 + * if the AutoStart flag is set.
15391 + * Parameters:
15392 + * hDevObject : Handle to the Device
15393 + * Returns:
15394 + * DSP_SOK : On Successful Loading
15395 + * DSP_EFILE : No DSP exec file found.
15396 + * DSP_EFAIL : General Failure
15397 + * Requires:
15398 + * hDevObject != NULL.
15399 + * hDevNode != NULL.
15400 + * PROC Initialized.
15401 + * Ensures:
15402 + */
15403 + extern DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
15404 + struct DEV_OBJECT *hDevObject);
15407 + * ======== PROC_Ctrl ========
15408 + * Purpose:
15409 + * Pass control information to the GPP device driver managing the DSP
15410 + * processor. This will be an OEM-only function, and not part of the
15411 + * 'Bridge application developer's API.
15412 + * Parameters:
15413 + * hProcessor : The processor handle.
15414 + * dwCmd : Private driver IOCTL cmd ID.
15415 + * pArgs : Ptr to an driver defined argument structure.
15416 + * Returns:
15417 + * DSP_SOK : SUCCESS
15418 + * DSP_EHANDLE : Invalid processor handle.
15419 + * DSP_ETIMEOUT: A Timeout Occured before the Control information
15420 + * could be sent.
15421 + * DSP_EACCESSDENIED: Client does not have the access rights required
15422 + * to call this function.
15423 + * DSP_ERESTART: A Critical error has occured and the DSP is being
15424 + * restarted.
15425 + * DSP_EFAIL : General Failure.
15426 + * Requires:
15427 + * PROC Initialized.
15428 + * Ensures
15429 + * Details:
15430 + * This function Calls WMD_BRD_Ioctl.
15431 + */
15432 + extern DSP_STATUS PROC_Ctrl(DSP_HPROCESSOR hProcessor,
15433 + u32 dwCmd, IN struct DSP_CBDATA *pArgs);
15436 + * ======== PROC_Detach ========
15437 + * Purpose:
15438 + * Close a DSP processor and de-allocate all (GPP) resources reserved
15439 + * for it. The Processor Object is deleted.
15440 + * Parameters:
15441 + * hProcessor : The processor handle.
15442 + * Returns:
15443 + * DSP_SOK : Success.
15444 + * DSP_EHANDLE : InValid Handle.
15445 + * DSP_EFAIL : General failure.
15446 + * Requires:
15447 + * PROC Initialized.
15448 + * Ensures:
15449 + * PROC Object is destroyed.
15450 + */
15451 + extern DSP_STATUS PROC_Detach(DSP_HPROCESSOR hProcessor);
15454 + * ======== PROC_EnumNodes ========
15455 + * Purpose:
15456 + * Enumerate the nodes currently allocated on a processor.
15457 + * Parameters:
15458 + * hProcessor : The processor handle.
15459 + * aNodeTab : The first Location of an array allocated for node
15460 + * handles.
15461 + * uNodeTabSize: The number of (DSP_HNODE) handles that can be held
15462 + * to the memory the client has allocated for aNodeTab
15463 + * puNumNodes : Location where DSPProcessor_EnumNodes will return
15464 + * the number of valid handles written to aNodeTab
15465 + * puAllocated : Location where DSPProcessor_EnumNodes will return
15466 + * the number of nodes that are allocated on the DSP.
15467 + * Returns:
15468 + * DSP_SOK : Success.
15469 + * DSP_EHANDLE : Invalid processor handle.
15470 + * DSP_ESIZE : The amount of memory allocated for aNodeTab is
15471 + * insufficent. That is the number of nodes actually
15472 + * allocated on the DSP is greater than the value
15473 + * specified for uNodeTabSize.
15474 + * DSP_EFAIL : Unable to get Resource Information.
15475 + * Details:
15476 + * Requires
15477 + * puNumNodes is not NULL.
15478 + * puAllocated is not NULL.
15479 + * aNodeTab is not NULL.
15480 + * PROC Initialized.
15481 + * Ensures:
15482 + * Details:
15483 + */
15484 + extern DSP_STATUS PROC_EnumNodes(DSP_HPROCESSOR hProcessor,
15485 + IN DSP_HNODE *aNodeTab,
15486 + IN u32 uNodeTabSize,
15487 + OUT u32 *puNumNodes,
15488 + OUT u32 *puAllocated);
15491 + * ======== PROC_GetResourceInfo ========
15492 + * Purpose:
15493 + * Enumerate the resources currently available on a processor.
15494 + * Parameters:
15495 + * hProcessor : The processor handle.
15496 + * uResourceType: Type of resource .
15497 + * pResourceInfo: Ptr to the DSP_RESOURCEINFO structure.
15498 + * uResourceInfoSize: Size of the structure.
15499 + * Returns:
15500 + * DSP_SOK : Success.
15501 + * DSP_EHANDLE : Invalid processor handle.
15502 + * DSP_EWRONGSTATE: The processor is not in the PROC_RUNNING state.
15503 + * DSP_ETIMEOUT: A timeout occured before the DSP responded to the
15504 + * querry.
15505 + * DSP_ERESTART: A Critical error has occured and the DSP is being
15506 + * restarted.
15507 + * DSP_EFAIL : Unable to get Resource Information
15508 + * Requires:
15509 + * pResourceInfo is not NULL.
15510 + * Parameter uResourceType is Valid.[TBD]
15511 + * uResourceInfoSize is >= sizeof DSP_RESOURCEINFO struct.
15512 + * PROC Initialized.
15513 + * Ensures:
15514 + * Details:
15515 + * This function currently returns
15516 + * DSP_ENOTIMPL, and does not write any data to the pResourceInfo struct.
15517 + */
15518 + extern DSP_STATUS PROC_GetResourceInfo(DSP_HPROCESSOR hProcessor,
15519 + u32 uResourceType,
15520 + OUT struct DSP_RESOURCEINFO *
15521 + pResourceInfo,
15522 + u32 uResourceInfoSize);
15525 + * ======== PROC_Exit ========
15526 + * Purpose:
15527 + * Decrement reference count, and free resources when reference count is
15528 + * 0.
15529 + * Parameters:
15530 + * Returns:
15531 + * Requires:
15532 + * PROC is initialized.
15533 + * Ensures:
15534 + * When reference count == 0, PROC's private resources are freed.
15535 + */
15536 + extern void CDECL PROC_Exit();
15539 + * ======== PROC_GetDevObject =========
15540 + * Purpose:
15541 + * Returns the DEV Hanlde for a given Processor handle
15542 + * Parameters:
15543 + * hProcessor : Processor Handle
15544 + * phDevObject : Location to store the DEV Handle.
15545 + * Returns:
15546 + * DSP_SOK : Success; *phDevObject has Dev handle
15547 + * DSP_EFAIL : Failure; *phDevObject is zero.
15548 + * Requires:
15549 + * phDevObject is not NULL
15550 + * PROC Initialized.
15551 + * Ensures:
15552 + * DSP_SOK : *phDevObject is not NULL
15553 + * DSP_EFAIL : *phDevObject is NULL.
15554 + */
15555 + extern DSP_STATUS PROC_GetDevObject(DSP_HPROCESSOR hProcessor,
15556 + struct DEV_OBJECT **phDevObject);
15559 + * ======== PROC_Init ========
15560 + * Purpose:
15561 + * Initialize PROC's private state, keeping a reference count on each
15562 + * call.
15563 + * Parameters:
15564 + * Returns:
15565 + * TRUE if initialized; FALSE if error occured.
15566 + * Requires:
15567 + * Ensures:
15568 + * TRUE: A requirement for the other public PROC functions.
15569 + */
15570 + extern bool CDECL PROC_Init();
15573 + * ======== PROC_GetState ========
15574 + * Purpose:
15575 + * Report the state of the specified DSP processor.
15576 + * Parameters:
15577 + * hProcessor : The processor handle.
15578 + * pProcStatus : Ptr to location to store the DSP_PROCESSORSTATE
15579 + * structure.
15580 + * uStateInfoSize: Size of DSP_PROCESSORSTATE.
15581 + * Returns:
15582 + * DSP_SOK : Success.
15583 + * DSP_EHANDLE : Invalid processor handle.
15584 + * DSP_EFAIL : General failure while querying processor state.
15585 + * Requires:
15586 + * pProcStatus is not NULL
15587 + * uStateInfoSize is >= than the size of DSP_PROCESSORSTATE structure.
15588 + * PROC Initialized.
15589 + * Ensures:
15590 + * Details:
15591 + */
15592 + extern DSP_STATUS PROC_GetState(DSP_HPROCESSOR hProcessor,
15593 + OUT struct DSP_PROCESSORSTATE
15594 + *pProcStatus,
15595 + u32 uStateInfoSize);
15598 + * ======== PROC_GetProcessorID ========
15599 + * Purpose:
15600 + * Report the state of the specified DSP processor.
15601 + * Parameters:
15602 + * hProcessor : The processor handle.
15603 + * procID : Processor ID
15605 + * Returns:
15606 + * DSP_SOK : Success.
15607 + * DSP_EHANDLE : Invalid processor handle.
15608 + * DSP_EFAIL : General failure while querying processor state.
15609 + * Requires:
15610 + * pProcStatus is not NULL
15611 + * uStateInfoSize is >= than the size of DSP_PROCESSORSTATE structure.
15612 + * PROC Initialized.
15613 + * Ensures:
15614 + * Details:
15615 + */
15616 + extern DSP_STATUS PROC_GetProcessorId(DSP_HPROCESSOR hProcessor,
15617 + u32 *procID);
15620 + * ======== PROC_GetTrace ========
15621 + * Purpose:
15622 + * Retrieve the trace buffer from the specified DSP processor.
15623 + * Parameters:
15624 + * hProcessor : The processor handle.
15625 + * pBuf : Ptr to buffer to hold trace output.
15626 + * uMaxSize : Maximum size of the output buffer.
15627 + * Returns:
15628 + * DSP_SOK : Success.
15629 + * DSP_EHANDLE : Invalid processor handle.
15630 + * DSP_EFAIL : General failure while retireving processor trace
15631 + * Buffer.
15632 + * Requires:
15633 + * pBuf is not NULL
15634 + * uMaxSize is > 0.
15635 + * PROC Initialized.
15636 + * Ensures:
15637 + * Details:
15638 + */
15639 + extern DSP_STATUS PROC_GetTrace(DSP_HPROCESSOR hProcessor, u8 *pBuf,
15640 + u32 uMaxSize);
15643 + * ======== PROC_Load ========
15644 + * Purpose:
15645 + * Reset a processor and load a new base program image.
15646 + * This will be an OEM-only function.
15647 + * Parameters:
15648 + * hProcessor : The processor handle.
15649 + * iArgc : The number of Arguments(strings)in the aArgV[]
15650 + * aArgv : An Array of Arguments(Unicode Strings)
15651 + * aEnvp : An Array of Environment settings(Unicode Strings)
15652 + * Returns:
15653 + * DSP_SOK : Success.
15654 + * DSP_EFILE : The DSP Execuetable was not found.
15655 + * DSP_EHANDLE : Invalid processor handle.
15656 + * DSP_ECORRUTFILE: Unable to Parse the DSP Execuetable
15657 + * DSP_EATTACHED: Abort because a GPP Client is attached to the
15658 + * specified Processor
15659 + * DSP_EACCESSDENIED: Client does not have the required access rights
15660 + * to reset and load the Processor
15661 + * DSP_EFAIL : Unable to Load the Processor
15662 + * Requires:
15663 + * aArgv is not NULL
15664 + * iArgc is > 0
15665 + * PROC Initialized.
15666 + * Ensures:
15667 + * Success and ProcState == PROC_LOADED
15668 + * or DSP_FAILED status.
15669 + * Details:
15670 + * Does not implement access rights to control which GPP application
15671 + * can load the processor.
15672 + */
15673 + extern DSP_STATUS PROC_Load(DSP_HPROCESSOR hProcessor,
15674 + IN CONST s32 iArgc, IN CONST char **aArgv,
15675 + IN CONST char **aEnvp);
15678 + * ======== PROC_RegisterNotify ========
15679 + * Purpose:
15680 + * Register to be notified of specific processor events
15681 + * Parameters:
15682 + * hProcessor : The processor handle.
15683 + * uEventMask : Mask of types of events to be notified about.
15684 + * uNotifyType : Type of notification to be sent.
15685 + * hNotification: Handle to be used for notification.
15686 + * Returns:
15687 + * DSP_SOK : Success.
15688 + * DSP_EHANDLE : Invalid processor handle or hNotification.
15689 + * DSP_EVALUE : Parameter uEventMask is Invalid
15690 + * DSP_ENOTIMP : The notification type specified in uNotifyMask
15691 + * is not supported.
15692 + * DSP_EFAIL : Unable to register for notification.
15693 + * Requires:
15694 + * hNotification is not NULL
15695 + * PROC Initialized.
15696 + * Ensures:
15697 + * Details:
15698 + */
15699 + extern DSP_STATUS PROC_RegisterNotify(DSP_HPROCESSOR hProcessor,
15700 + u32 uEventMask, u32 uNotifyType,
15701 + struct DSP_NOTIFICATION
15702 + *hNotification);
15705 + * ======== PROC_NotifyClients ========
15706 + * Purpose:
15707 + * Notify the Processor Clients
15708 + * Parameters:
15709 + * hProc : The processor handle.
15710 + * uEvents : Event to be notified about.
15711 + * Returns:
15712 + * DSP_SOK : Success.
15713 + * DSP_EHANDLE : Invalid processor handle.
15714 + * DSP_EFAIL : Failure to Set or Reset the Event
15715 + * Requires:
15716 + * uEvents is Supported or Valid type of Event
15717 + * hProc is a valid handle
15718 + * PROC Initialized.
15719 + * Ensures:
15720 + */
15721 + extern DSP_STATUS PROC_NotifyClients(DSP_HPROCESSOR hProc,
15722 + u32 uEvents);
15725 + * ======== PROC_NotifyAllClients ========
15726 + * Purpose:
15727 + * Notify the Processor Clients
15728 + * Parameters:
15729 + * hProc : The processor handle.
15730 + * uEvents : Event to be notified about.
15731 + * Returns:
15732 + * DSP_SOK : Success.
15733 + * DSP_EHANDLE : Invalid processor handle.
15734 + * DSP_EFAIL : Failure to Set or Reset the Event
15735 + * Requires:
15736 + * uEvents is Supported or Valid type of Event
15737 + * hProc is a valid handle
15738 + * PROC Initialized.
15739 + * Ensures:
15740 + * Details:
15741 + * NODE And STRM would use this function to notify their clients
15742 + * about the state changes in NODE or STRM.
15743 + */
15744 + extern DSP_STATUS PROC_NotifyAllClients(DSP_HPROCESSOR hProc,
15745 + u32 uEvents);
15748 + * ======== PROC_Start ========
15749 + * Purpose:
15750 + * Start a processor running.
15751 + * Processor must be in PROC_LOADED state.
15752 + * This will be an OEM-only function, and not part of the 'Bridge
15753 + * application developer's API.
15754 + * Parameters:
15755 + * hProcessor : The processor handle.
15756 + * Returns:
15757 + * DSP_SOK : Success.
15758 + * DSP_EHANDLE : Invalid processor handle.
15759 + * DSP_EWRONGSTATE: Processor is not in PROC_LOADED state.
15760 + * DSP_EFAIL : Unable to start the processor.
15761 + * Requires:
15762 + * PROC Initialized.
15763 + * Ensures:
15764 + * Success and ProcState == PROC_RUNNING or DSP_FAILED status.
15765 + * Details:
15766 + */
15767 + extern DSP_STATUS PROC_Start(DSP_HPROCESSOR hProcessor);
15770 + * ======== PROC_Stop ========
15771 + * Purpose:
15772 + * Start a processor running.
15773 + * Processor must be in PROC_LOADED state.
15774 + * This will be an OEM-only function, and not part of the 'Bridge
15775 + * application developer's API.
15776 + * Parameters:
15777 + * hProcessor : The processor handle.
15778 + * Returns:
15779 + * DSP_SOK : Success.
15780 + * DSP_EHANDLE : Invalid processor handle.
15781 + * DSP_EWRONGSTATE: Processor is not in PROC_LOADED state.
15782 + * DSP_EFAIL : Unable to start the processor.
15783 + * Requires:
15784 + * PROC Initialized.
15785 + * Ensures:
15786 + * Success and ProcState == PROC_RUNNING or DSP_FAILED status.
15787 + * Details:
15788 + */
15789 + extern DSP_STATUS PROC_Stop(DSP_HPROCESSOR hProcessor);
15792 + * ======== PROC_FlushMemory ========
15793 + * Purpose:
15794 + * Flushes a buffer from the MPU data cache.
15795 + * Parameters:
15796 + * hProcessor : The processor handle.
15797 + * pMpuAddr : Buffer start address
15798 + * ulSize : Buffer size
15799 + * ulFlags : Reserved.
15800 + * Returns:
15801 + * DSP_SOK : Success.
15802 + * DSP_EHANDLE : Invalid processor handle.
15803 + * DSP_EFAIL : General failure.
15804 + * Requires:
15805 + * PROC Initialized.
15806 + * Ensures:
15807 + * Details:
15808 + * All the arguments are currently ignored.
15809 + */
15810 + extern DSP_STATUS PROC_FlushMemory(DSP_HPROCESSOR hProcessor,
15811 + void *pMpuAddr,
15812 + u32 ulSize, u32 ulFlags);
15816 + * ======== PROC_InvalidateMemory ========
15817 + * Purpose:
15818 + * Invalidates a buffer from the MPU data cache.
15819 + * Parameters:
15820 + * hProcessor : The processor handle.
15821 + * pMpuAddr : Buffer start address
15822 + * ulSize : Buffer size
15823 + * Returns:
15824 + * DSP_SOK : Success.
15825 + * DSP_EHANDLE : Invalid processor handle.
15826 + * DSP_EFAIL : General failure.
15827 + * Requires:
15828 + * PROC Initialized.
15829 + * Ensures:
15830 + * Details:
15831 + * All the arguments are currently ignored.
15832 + */
15833 + extern DSP_STATUS PROC_InvalidateMemory(DSP_HPROCESSOR hProcessor,
15834 + void *pMpuAddr,
15835 + u32 ulSize);
15838 + * ======== PROC_Map ========
15839 + * Purpose:
15840 + * Maps a MPU buffer to DSP address space.
15841 + * Parameters:
15842 + * hProcessor : The processor handle.
15843 + * pMpuAddr : Starting address of the memory region to map.
15844 + * ulSize : Size of the memory region to map.
15845 + * pReqAddr : Requested DSP start address. Offset-adjusted actual
15846 + * mapped address is in the last argument.
15847 + * ppMapAddr : Ptr to DSP side mapped u8 address.
15848 + * ulMapAttr : Optional endianness attributes, virt to phys flag.
15849 + * Returns:
15850 + * DSP_SOK : Success.
15851 + * DSP_EHANDLE : Invalid processor handle.
15852 + * DSP_EFAIL : General failure.
15853 + * DSP_EMEMORY : MPU side memory allocation error.
15854 + * DSP_ENOTFOUND : Cannot find a reserved region starting with this
15855 + * : address.
15856 + * Requires:
15857 + * pMpuAddr is not NULL
15858 + * ulSize is not zero
15859 + * ppMapAddr is not NULL
15860 + * PROC Initialized.
15861 + * Ensures:
15862 + * Details:
15863 + */
15864 + extern DSP_STATUS PROC_Map(DSP_HPROCESSOR hProcessor,
15865 + void *pMpuAddr,
15866 + u32 ulSize,
15867 + void *pReqAddr,
15868 + void **ppMapAddr, u32 ulMapAttr);
15871 + * ======== PROC_ReserveMemory ========
15872 + * Purpose:
15873 + * Reserve a virtually contiguous region of DSP address space.
15874 + * Parameters:
15875 + * hProcessor : The processor handle.
15876 + * ulSize : Size of the address space to reserve.
15877 + * ppRsvAddr : Ptr to DSP side reserved u8 address.
15878 + * Returns:
15879 + * DSP_SOK : Success.
15880 + * DSP_EHANDLE : Invalid processor handle.
15881 + * DSP_EFAIL : General failure.
15882 + * DSP_EMEMORY : Cannot reserve chunk of this size.
15883 + * Requires:
15884 + * ppRsvAddr is not NULL
15885 + * PROC Initialized.
15886 + * Ensures:
15887 + * Details:
15888 + */
15889 + extern DSP_STATUS PROC_ReserveMemory(DSP_HPROCESSOR hProcessor,
15890 + u32 ulSize, void **ppRsvAddr);
15893 + * ======== PROC_UnMap ========
15894 + * Purpose:
15895 + * Removes a MPU buffer mapping from the DSP address space.
15896 + * Parameters:
15897 + * hProcessor : The processor handle.
15898 + * pMapAddr : Starting address of the mapped memory region.
15899 + * Returns:
15900 + * DSP_SOK : Success.
15901 + * DSP_EHANDLE : Invalid processor handle.
15902 + * DSP_EFAIL : General failure.
15903 + * DSP_ENOTFOUND : Cannot find a mapped region starting with this
15904 + * : address.
15905 + * Requires:
15906 + * pMapAddr is not NULL
15907 + * PROC Initialized.
15908 + * Ensures:
15909 + * Details:
15910 + */
15911 + extern DSP_STATUS PROC_UnMap(DSP_HPROCESSOR hProcessor, void *pMapAddr);
15914 + * ======== PROC_UnReserveMemory ========
15915 + * Purpose:
15916 + * Frees a previously reserved region of DSP address space.
15917 + * Parameters:
15918 + * hProcessor : The processor handle.
15919 + * pRsvAddr : Ptr to DSP side reservedBYTE address.
15920 + * Returns:
15921 + * DSP_SOK : Success.
15922 + * DSP_EHANDLE : Invalid processor handle.
15923 + * DSP_EFAIL : General failure.
15924 + * DSP_ENOTFOUND : Cannot find a reserved region starting with this
15925 + * : address.
15926 + * Requires:
15927 + * pRsvAddr is not NULL
15928 + * PROC Initialized.
15929 + * Ensures:
15930 + * Details:
15931 + */
15932 + extern DSP_STATUS PROC_UnReserveMemory(DSP_HPROCESSOR hProcessor,
15933 + void *pRsvAddr);
15935 +#endif /* PROC_ */
15936 Index: lk/arch/arm/plat-omap/include/bridge/procpriv.h
15937 ===================================================================
15938 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
15939 +++ lk/arch/arm/plat-omap/include/bridge/procpriv.h 2008-08-18 10:38:34.000000000 +0300
15940 @@ -0,0 +1,35 @@
15942 + * arch/arm/plat-omap/include/bridge/procpriv.h
15944 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
15946 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
15948 + * This package is free software; you can redistribute it and/or modify
15949 + * it under the terms of the GNU General Public License version 2 as
15950 + * published by the Free Software Foundation.
15952 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15953 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15954 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15955 + */
15959 + * ======== procpriv.h ========
15960 + * Description:
15961 + * Global PROC constants and types, shared by PROC, MGR, and WCD.
15963 + *! Revision History:
15964 + *! ================
15965 + *! 05-July-2000 rr: Created
15966 + */
15968 +#ifndef PROCPRIV_
15969 +#define PROCPRIV_
15971 +/* RM PROC Object */
15972 + struct PROC_OBJECT;
15974 +#endif /* PROCPRIV_ */
15976 Index: lk/arch/arm/plat-omap/include/bridge/pwr.h
15977 ===================================================================
15978 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
15979 +++ lk/arch/arm/plat-omap/include/bridge/pwr.h 2008-08-18 10:38:34.000000000 +0300
15980 @@ -0,0 +1,129 @@
15982 + * arch/arm/plat-omap/include/bridge/pwr.h
15984 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
15986 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
15988 + * This package is free software; you can redistribute it and/or modify
15989 + * it under the terms of the GNU General Public License version 2 as
15990 + * published by the Free Software Foundation.
15992 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15993 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15994 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15995 + */
15999 + * ======== pwr.h ========
16001 + * Public Functions:
16003 + * PWR_SleepDSP
16004 + * PWR_WakeDSP
16006 + * Notes:
16008 + *! Revision History:
16009 + *! ================
16010 + *! 06-Jun-2002 sg Replaced dspdefs.h with includes of dbdefs.h and errbase.h.
16011 + *! 13-May-2002 sg Added DSP_SAREADYASLEEP and DSP_SALREADYAWAKE.
16012 + *! 09-May-2002 sg Updated, added timeouts.
16013 + *! 02-May-2002 sg Initial.
16014 + */
16016 +#ifndef PWR_
16017 +#define PWR_
16019 +#include <dbdefs.h>
16020 +#include <errbase.h>
16021 +#include <pwr_sh.h>
16024 + * ======== PWR_SleepDSP ========
16025 + * Signal the DSP to go to sleep.
16027 + * Parameters:
16028 + * sleepCode: New sleep state for DSP. (Initially, valid codes
16029 + * are PWR_DEEPSLEEP or PWR_EMERGENCYDEEPSLEEP; both of
16030 + * these codes will simply put the DSP in deep sleep.)
16032 + * timeout: Maximum time (msec) that PWR should wait for
16033 + * confirmation that the DSP sleep state has been
16034 + * reached. If PWR should simply send the command to
16035 + * the DSP to go to sleep and then return (i.e.,
16036 + * asynchrounous sleep), the timeout should be
16037 + * specified as zero.
16039 + * Returns:
16040 + * DSP_SOK: Success.
16041 + * DSP_SALREADYASLEEP: Success, but the DSP was already asleep.
16042 + * DSP_EINVALIDARG: The specified sleepCode is not supported.
16043 + * DSP_ETIMEOUT: A timeout occured while waiting for DSP sleep
16044 + * confirmation.
16045 + * DSP_EFAIL: General failure, unable to send sleep command to
16046 + * the DSP.
16047 + */
16048 + extern DSP_STATUS PWR_SleepDSP(IN CONST u32 sleepCode,
16049 + IN CONST u32 timeout);
16052 + * ======== PWR_WakeDSP ========
16053 + * Signal the DSP to wake from sleep.
16055 + * Parameters:
16056 + * timeout: Maximum time (msec) that PWR should wait for
16057 + * confirmation that the DSP is awake. If PWR should
16058 + * simply send a command to the DSP to wake and then
16059 + * return (i.e., asynchrounous wake), timeout should
16060 + * be specified as zero.
16062 + * Returns:
16063 + * DSP_SOK: Success.
16064 + * DSP_SALREADYAWAKE: Success, but the DSP was already awake.
16065 + * DSP_ETIMEOUT: A timeout occured while waiting for wake
16066 + * confirmation.
16067 + * DSP_EFAIL: General failure, unable to send wake command to
16068 + * the DSP.
16069 + */
16070 + extern DSP_STATUS PWR_WakeDSP(IN CONST u32 timeout);
16073 + * ======== PWR_PM_PreScale ========
16074 + * Prescale notification to DSP.
16076 + * Parameters:
16077 + * voltage_domain: The voltage domain for which notification is sent
16078 + * level: The level of voltage domain
16080 + * Returns:
16081 + * DSP_SOK: Success.
16082 + * DSP_SALREADYAWAKE: Success, but the DSP was already awake.
16083 + * DSP_ETIMEOUT: A timeout occured while waiting for wake
16084 + * confirmation.
16085 + * DSP_EFAIL: General failure, unable to send wake command to
16086 + * the DSP.
16087 + */
16088 + extern DSP_STATUS PWR_PM_PreScale(IN u16 voltage_domain, u32 level);
16091 + * ======== PWR_PM_PostScale ========
16092 + * PostScale notification to DSP.
16094 + * Parameters:
16095 + * voltage_domain: The voltage domain for which notification is sent
16096 + * level: The level of voltage domain
16098 + * Returns:
16099 + * DSP_SOK: Success.
16100 + * DSP_SALREADYAWAKE: Success, but the DSP was already awake.
16101 + * DSP_ETIMEOUT: A timeout occured while waiting for wake
16102 + * confirmation.
16103 + * DSP_EFAIL: General failure, unable to send wake command to
16104 + * the DSP.
16105 + */
16106 + extern DSP_STATUS PWR_PM_PostScale(IN u16 voltage_domain,
16107 + u32 level);
16109 +#endif /* PWR_ */
16110 Index: lk/arch/arm/plat-omap/include/bridge/pwr_sh.h
16111 ===================================================================
16112 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16113 +++ lk/arch/arm/plat-omap/include/bridge/pwr_sh.h 2008-08-18 10:38:34.000000000 +0300
16114 @@ -0,0 +1,41 @@
16116 + * arch/arm/plat-omap/include/bridge/pwr_sh.h
16118 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16120 + * Copyright (C) 2008 Texas Instruments, Inc.
16122 + * This package is free software; you can redistribute it and/or modify
16123 + * it under the terms of the GNU General Public License version 2 as
16124 + * published by the Free Software Foundation.
16126 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16127 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16128 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16129 + */
16132 + * ======== pwr_sh.h ========
16134 + * Power Manager shared definitions (used on both GPP and DSP sides).
16136 + *! Revision History
16137 + *! ================
16138 + *! 17-Apr-2002 sg: Initial.
16139 + */
16141 +#ifndef PWR_SH_
16142 +#define PWR_SH_
16144 +#include <mbx_sh.h>
16146 +/* valid sleep command codes that can be sent by GPP via mailbox: */
16147 +#define PWR_DEEPSLEEP MBX_PM_DSPIDLE
16148 +#define PWR_EMERGENCYDEEPSLEEP MBX_PM_EMERGENCYSLEEP
16149 +#define PWR_SLEEPUNTILRESTART MBX_PM_SLEEPUNTILRESTART
16150 +#define PWR_WAKEUP MBX_PM_DSPWAKEUP
16151 +#define PWR_AUTOENABLE MBX_PM_PWRENABLE
16152 +#define PWR_AUTODISABLE MBX_PM_PWRDISABLE
16153 +#define PWR_RETENTION MBX_PM_DSPRETN
16155 +#endif /* PWR_SH_ */
16156 Index: lk/arch/arm/plat-omap/include/bridge/reg.h
16157 ===================================================================
16158 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16159 +++ lk/arch/arm/plat-omap/include/bridge/reg.h 2008-08-18 10:38:34.000000000 +0300
16160 @@ -0,0 +1,257 @@
16162 + * arch/arm/plat-omap/include/bridge/reg.h
16164 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16166 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
16168 + * This package is free software; you can redistribute it and/or modify
16169 + * it under the terms of the GNU General Public License version 2 as
16170 + * published by the Free Software Foundation.
16172 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16173 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16174 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16175 + */
16179 + * ======== reg.h ========
16180 + * Purpose:
16181 + * Provide registry functions.
16183 + * Public Functions:
16184 + * REG_DeleteValue
16185 + * REG_EnumKey
16186 + * REG_EnumValue
16187 + * REG_Exit
16188 + * REG_GetValue
16189 + * REG_Init
16190 + * REG_SetValue
16192 + *! Revision History:
16193 + *! =================
16194 + *! 30-Oct-2000 kc: Updated REG_SetValue & REG_GetValue; renamed
16195 + *! REG_DeleteEntry to REG_DeleteValue.
16196 + *! 29-Sep-2000 kc: Updated a REG functions for code review.
16197 + *! 12-Aug-2000 kc: Renamed REG_EnumValue to REG_EnumKey. Re-implemented
16198 + *! REG_EnumValue.
16199 + *! 03-Feb-2000 rr: REG_EnumValue Fxn Added
16200 + *! 13-Dec-1999 rr: windows.h removed
16201 + *! 02-Dec-1999 rr: windows.h included for retail build
16202 + *! 22-Nov-1999 kc: Changes from code review.
16203 + *! 29-Dec-1997 cr: Changes from code review.
16204 + *! 27-Oct-1997 cr: Added REG_DeleteValue.
16205 + *! 20-Oct-1997 cr: Added ability to pass bValue = NULL to REG_GetValue
16206 + *! and return size of reg entry in pdwValueSize.
16207 + *! 29-Sep-1997 cr: Added REG_SetValue
16208 + *! 29-Aug-1997 cr: Created.
16209 + */
16211 +#ifndef _REG_H
16212 +#define _REG_H
16214 +#include <linux/types.h>
16216 +/* ------------------------- Defines, Data Structures, Typedefs for Linux */
16217 +#ifndef UNDER_CE
16219 +#ifndef REG_SZ
16220 +#define REG_SZ 1
16221 +#endif
16223 +#ifndef REG_BINARY
16224 +#define REG_BINARY 3
16225 +#endif
16227 +#ifndef REG_DWORD
16228 +#define REG_DWORD 4
16229 +#endif
16231 +#endif /* UNDER_CE */
16233 +#define REG_MAXREGPATHLENGTH 255
16236 + * ======== REG_DeleteValue ========
16237 + * Purpose:
16238 + * Deletes a registry entry. NOTE: A registry entry is not the same as
16239 + * a registry key.
16240 + * Parameters:
16241 + * phKey: Currently reserved; must be NULL.
16242 + * pstrSubkey: Path to key to open.
16243 + * pstrValue: Name of entry to delete.
16244 + * Returns:
16245 + * DSP_SOK: Success.
16246 + * DSP_EFAIL: General failure.
16247 + * Requires:
16248 + * - REG initialized.
16249 + * - pstrSubkey & pstrValue are non-NULL values.
16250 + * - phKey is NULL.
16251 + * - length of pstrSubkey < REG_MAXREGPATHLENGTH.
16252 + * - length of pstrValue < REG_MAXREGPATHLENGTH.
16253 + * Ensures:
16254 + * Details:
16255 + */
16256 + extern DSP_STATUS REG_DeleteValue(OPTIONAL IN HANDLE *phKey,
16257 + IN CONST char *pstrSubkey,
16258 + IN CONST char *pstrValue);
16261 + * ======== REG_EnumKey ========
16262 + * Purpose:
16263 + * Enumerates subkeys of the specified path to the registry key
16264 + * Retrieves the name of the subkey(given the index) and
16265 + * appends with the orignal path to form the full path.
16266 + * Parameters:
16267 + * phKey: Currently reserved; must be NULL.
16268 + * pstrKey The name of the registry key to be enumerated.
16269 + * dwIndex Specifies the index of the subkey to retrieve.
16270 + * pstrSubkey: Pointer to buffer that receives full path name of the
16271 + * specified key + the sub-key
16272 + * pdwValueSize: Specifies bytes of memory pstrSubkey points to on input,
16273 + * on output, specifies actual memory bytes written into.
16274 + * If there is no sub key,pdwValueSize returns NULL.
16275 + * Returns:
16276 + * DSP_SOK: Success.
16277 + * DSP_EFAIL: General failure.
16278 + * Requires:
16279 + * - REG initialized.
16280 + * - pstrKey is non-NULL value.
16281 + * - pdwValueSize is a valid pointer.
16282 + * - phKey is NULL.
16283 + * - length of pstrKey < REG_MAXREGPATHLENGTH.
16284 + * Ensures:
16285 + * - CSL_Strlen(pstrSubkey) is > CSL_Strlen(pstrKey) &&
16286 + * - CSL_Strlen(pstrSubkey) is < REG_MAXREGPATHLENGTH
16287 + */
16288 + extern DSP_STATUS REG_EnumKey(OPTIONAL IN HANDLE *phKey,
16289 + IN u32 dwIndex, IN CONST char *pstrKey,
16290 + IN OUT char *pstrSubkey,
16291 + IN OUT u32 *pdwValueSize);
16294 + * ======== REG_EnumValue ========
16295 + * Purpose:
16296 + * Enumerates values of a specified key. Retrieves each value name and
16297 + * the data associated with the value.
16298 + * Parameters:
16299 + * phKey: Currently reserved; must be NULL.
16300 + * dwIndex: Specifies the index of the value to retrieve.
16301 + * pstrKey: The name of the registry key to be enumerated.
16302 + * pstrValue: Pointer to buffer that receives the name of the value.
16303 + * pdwValueSize: Specifies bytes of memory pstrValue points to on input,
16304 + * On output, specifies actual memory bytes written into.
16305 + * If there is no value, pdwValueSize returns NULL
16306 + * pstrData: Pointer to buffer that receives the data of a value.
16307 + * pdwDataSize: Specifies bytes of memory in pstrData on input and
16308 + * bytes of memory written into pstrData on output.
16309 + * If there is no data, pdwDataSize returns NULL.
16310 + * Returns:
16311 + * DSP_SOK: Success.
16312 + * DSP_EFAIL: General failure.
16313 + * Requires:
16314 + * REG initialized.
16315 + * phKey is NULL.
16316 + * pstrKey is a non-NULL value.
16317 + * pstrValue, pstrData, pdwValueSize and pdwDataSize are valid pointers.
16318 + * Length of pstrKey is less than REG_MAXREGPATHLENGTH.
16319 + * Ensures:
16320 + */
16321 + extern DSP_STATUS REG_EnumValue(IN HANDLE *phKey,
16322 + IN u32 dwIndex,
16323 + IN CONST char *pstrKey,
16324 + IN OUT char *pstrValue,
16325 + IN OUT u32 *pdwValueSize,
16326 + IN OUT char *pstrData,
16327 + IN OUT u32 *pdwDataSize);
16330 + * ======== REG_Exit ========
16331 + * Purpose:
16332 + * Discontinue usage of module; free resources when reference count
16333 + * reaches 0.
16334 + * Parameters:
16335 + * Returns:
16336 + * Requires:
16337 + * REG initialized.
16338 + * Ensures:
16339 + * Resources used by module are freed when cRef reaches zero.
16340 + */
16341 + extern void REG_Exit();
16344 + * ======== REG_GetValue ========
16345 + * Purpose:
16346 + * Retrieve a value from the registry.
16347 + * Parameters:
16348 + * phKey: Currently reserved; must be NULL.
16349 + * pstrSubkey: Path to key to open.
16350 + * pstrEntry: Name of entry to retrieve.
16351 + * pbValue: Upon return, points to retrieved value.
16352 + * pdwValueSize: Specifies bytes of memory pbValue points to on input,
16353 + * on output, specifies actual memory bytes written into.
16354 + * If pbValue is NULL, pdwValueSize reports the size of
16355 + * the entry in pstrEntry.
16356 + * Returns:
16357 + * DSP_SOK: Success.
16358 + * DSP_EFAIL: General failure.
16359 + * Requires:
16360 + * - REG initialized.
16361 + * - pstrSubkey & pstrEntry are non-NULL values.
16362 + * - pbValue is a valid pointer.
16363 + * - phKey is NULL.
16364 + * - length of pstrSubkey < REG_MAXREGPATHLENGTH.
16365 + * - length of pstrEntry < REG_MAXREGPATHLENGTH.
16366 + * Ensures:
16367 + */
16368 + extern DSP_STATUS REG_GetValue(OPTIONAL IN HANDLE *phKey,
16369 + IN CONST char *pstrSubkey,
16370 + IN CONST char *pstrEntry,
16371 + OUT u8 *pbValue,
16372 + IN OUT u32 *pdwValueSize);
16375 + * ======== REG_Init ========
16376 + * Purpose:
16377 + * Initializes private state of REG module.
16378 + * Parameters:
16379 + * Returns:
16380 + * TRUE if initialized; FALSE if error occured.
16381 + * Requires:
16382 + * Ensures:
16383 + * REG initialized.
16384 + */
16385 + extern bool REG_Init();
16388 + * ======== REG_SetValue ========
16389 + * Purpose:
16390 + * Set a value in the registry.
16391 + * Parameters:
16392 + * phKey: Handle to open reg key, or NULL if pSubkey is full path.
16393 + * pstrSubkey: Path to key to open, could be based on phKey.
16394 + * pstrEntry: Name of entry to set.
16395 + * dwType: Data type of new registry value.
16396 + * pbValue: Points to buffer containing new data.
16397 + * dwValueSize: Specifies bytes of memory bValue points to.
16398 + * Returns:
16399 + * DSP_SOK: Success.
16400 + * DSP_EFAIL: General failure.
16401 + * Requires:
16402 + * - REG initialized.
16403 + * - pstrSubkey & pstrEntry are non-NULL values.
16404 + * - pbValue is a valid pointer.
16405 + * - phKey is NULL.
16406 + * - dwValuSize > 0.
16407 + * - length of pstrSubkey < REG_MAXREGPATHLENGTH.
16408 + * - length of pstrEntry < REG_MAXREGPATHLENGTH.
16409 + * Ensures:
16410 + */
16411 + extern DSP_STATUS REG_SetValue(OPTIONAL IN HANDLE *phKey,
16412 + IN CONST char *pstrSubKey,
16413 + IN CONST char *pstrEntry,
16414 + IN CONST u32 dwType,
16415 + IN u8 *pbValue, IN u32 dwValueSize);
16417 +#endif /* _REG_H */
16418 Index: lk/arch/arm/plat-omap/include/bridge/resourcecleanup.h
16419 ===================================================================
16420 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16421 +++ lk/arch/arm/plat-omap/include/bridge/resourcecleanup.h 2008-08-18 10:38:34.000000000 +0300
16422 @@ -0,0 +1,89 @@
16424 + * arch/arm/plat-omap/include/bridge/resourcecleanup.h
16426 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16428 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
16430 + * This package is free software; you can redistribute it and/or modify
16431 + * it under the terms of the GNU General Public License version 2 as
16432 + * published by the Free Software Foundation.
16434 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16435 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16436 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16437 + */
16439 +#ifndef RES_CLEANUP_DISABLE
16441 +#include <nodepriv.h>
16442 +#include <drv.h>
16445 +extern DSP_STATUS DRV_DisplayProcContext(HANDLE hDrvObject);
16447 +extern DSP_STATUS DRV_GetProcCtxtList(HANDLE pPctxt, HANDLE hDrvObject);
16449 +extern DSP_STATUS DRV_InsertProcContext(HANDLE hDrvObject, HANDLE pPctxt);
16451 +extern DSP_STATUS DRV_RemoveAllDMMResElements(HANDLE pCtxt);
16453 +extern DSP_STATUS DRV_RemoveAllNodeResElements(HANDLE pCtxt);
16455 +extern DSP_STATUS DRV_ProcUpdatestate(HANDLE pCtxt,
16456 + enum GPP_PROC_RES_STATE resState);
16458 +extern DSP_STATUS DRV_ProcSetPID(HANDLE pCtxt, s32 hProcess);
16460 +extern DSP_STATUS DRV_GetProcContext(HANDLE phProcess, HANDLE hDrvObject,
16461 + HANDLE pCtxt, DSP_HNODE hNode,
16462 + u32 pMapAddr);
16464 +extern DSP_STATUS DRV_RemoveAllResources(HANDLE pPctxt);
16466 +extern DSP_STATUS DRV_RemoveProcContext(HANDLE hDRVObject, HANDLE hPCtxt,
16467 + HANDLE hProcess);
16469 +extern DSP_STATUS DRV_GetNodeResElement(HANDLE hNode, HANDLE nodeRes,
16470 + HANDLE pCtxt);
16472 +extern DSP_STATUS DRV_InsertNodeResElement(HANDLE hNode, HANDLE nodeRes,
16473 + HANDLE pCtxt);
16475 +extern DSP_STATUS DRV_ProcNodeUpdateHeapStatus(HANDLE nodeRes, int status);
16477 +extern DSP_STATUS DRV_ProcNodeUpdateStreamStatus(HANDLE nodeRes, int status);
16479 +extern DSP_STATUS DRV_RemoveNodeResElement(HANDLE nodeRes, HANDLE status);
16481 +extern DSP_STATUS DRV_ProcNodeUpdateStatus(HANDLE nodeRes, int status);
16483 +extern DSP_STATUS DRV_UpdateDMMResElement(HANDLE dmmRes, u32 pMpuAddr,
16484 + u32 ulSize, u32 pReqAddr,
16485 + u32 ppMapAddr, HANDLE hProcesso);
16487 +extern DSP_STATUS DRV_InsertDMMResElement(HANDLE dmmRes, HANDLE pCtxt);
16489 +extern DSP_STATUS DRV_GetDMMResElement(u32 pMapAddr, HANDLE dmmRes,
16490 + HANDLE pCtxt);
16492 +extern DSP_STATUS DRV_RemoveDMMResElement(HANDLE dmmRes, HANDLE pCtxt);
16494 +extern DSP_STATUS DRV_ProcUpdateSTRMRes(u32 uNumBufs, HANDLE STRMRes,
16495 + HANDLE pCtxt);
16497 +extern DSP_STATUS DRV_ProcInsertSTRMResElement(HANDLE hStrm, HANDLE STRMRes,
16498 + HANDLE pPctxt);
16500 +extern DSP_STATUS DRV_GetSTRMResElement(HANDLE hStrm, HANDLE STRMRes,
16501 + HANDLE pCtxt);
16503 +extern DSP_STATUS DRV_ProcRemoveSTRMResElement(HANDLE STRMRes, HANDLE pCtxt);
16505 +extern DSP_STATUS DRV_RemoveAllSTRMResElements(HANDLE pCtxt);
16507 +extern DSP_STATUS DRV_ProcDisplayResInfo(u8 *pBuf, u32 *pSize);
16509 +extern enum NODE_STATE NODE_GetState(HANDLE hNode);
16511 +#endif
16512 Index: lk/arch/arm/plat-omap/include/bridge/rmm.h
16513 ===================================================================
16514 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16515 +++ lk/arch/arm/plat-omap/include/bridge/rmm.h 2008-08-18 10:38:34.000000000 +0300
16516 @@ -0,0 +1,199 @@
16518 + * arch/arm/plat-omap/include/bridge/rmm.h
16520 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16522 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
16524 + * This package is free software; you can redistribute it and/or modify
16525 + * it under the terms of the GNU General Public License version 2 as
16526 + * published by the Free Software Foundation.
16528 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16529 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16530 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16531 + */
16535 + * ======== rmm.h ========
16537 + * This memory manager provides general heap management and arbitrary
16538 + * alignment for any number of memory segments, and management of overlay
16539 + * memory.
16541 + * Public functions:
16542 + * RMM_alloc
16543 + * RMM_create
16544 + * RMM_delete
16545 + * RMM_exit
16546 + * RMM_free
16547 + * RMM_init
16549 + *! Revision History
16550 + *! ================
16551 + *! 25-Jun-2002 jeh Added RMM_Addr. Removed RMM_reserve, RMM_stat.
16552 + *! 15-Oct-2001 jeh Based on rm.h in gen tree.
16553 + */
16555 +#ifndef RMM_
16556 +#define RMM_
16559 + * ======== RMM_Addr ========
16560 + * DSP address + segid
16561 + */
16562 +struct RMM_Addr {
16563 + u32 addr;
16564 + s32 segid;
16565 +} ;
16568 + * ======== RMM_Segment ========
16569 + * Memory segment on the DSP available for remote allocations.
16570 + */
16571 +struct RMM_Segment {
16572 + u32 base; /* Base of the segment */
16573 + u32 length; /* Size of the segment (target MAUs) */
16574 + s32 space; /* Code or data */
16575 + u32 number; /* Number of Allocated Blocks */
16576 +} ;
16579 + * ======== RMM_Target ========
16580 + */
16581 +struct RMM_TargetObj;
16584 + * ======== RMM_alloc ========
16586 + * RMM_alloc is used to remotely allocate or reserve memory on the DSP.
16588 + * Parameters:
16589 + * target - Target returned from RMM_create().
16590 + * segid - Memory segment to allocate from.
16591 + * size - Size (target MAUS) to allocate.
16592 + * align - alignment.
16593 + * dspAddr - If reserve is FALSE, the location to store allocated
16594 + * address on output, otherwise, the DSP address to
16595 + * reserve.
16596 + * reserve - If TRUE, reserve the memory specified by dspAddr.
16597 + * Returns:
16598 + * DSP_SOK: Success.
16599 + * DSP_EMEMORY: Memory allocation on GPP failed.
16600 + * DSP_EOVERLAYMEMORY: Cannot "allocate" overlay memory because it's
16601 + * already in use.
16602 + * Requires:
16603 + * RMM initialized.
16604 + * Valid target.
16605 + * dspAddr != NULL.
16606 + * size > 0
16607 + * reserve || target->numSegs > 0.
16608 + * Ensures:
16609 + */
16610 +extern DSP_STATUS RMM_alloc(struct RMM_TargetObj *target, u32 segid, u32 size,
16611 + u32 align, u32 *dspAdr, bool reserve);
16614 + * ======== RMM_create ========
16615 + * Create a target object with memory segments for remote allocation. If
16616 + * segTab == NULL or numSegs == 0, memory can only be reserved through
16617 + * RMM_alloc().
16619 + * Parameters:
16620 + * pTarget: - Location to store target on output.
16621 + * segTab: - Table of memory segments.
16622 + * numSegs: - Number of memory segments.
16623 + * Returns:
16624 + * DSP_SOK: Success.
16625 + * DSP_EMEMORY: Memory allocation failed.
16626 + * Requires:
16627 + * RMM initialized.
16628 + * pTarget != NULL.
16629 + * numSegs == 0 || segTab != NULL.
16630 + * Ensures:
16631 + * Success: Valid *pTarget.
16632 + * Failure: *pTarget == NULL.
16633 + */
16634 +extern DSP_STATUS RMM_create(struct RMM_TargetObj **pTarget,
16635 + struct RMM_Segment segTab[], u32 numSegs);
16638 + * ======== RMM_delete ========
16639 + * Delete target allocated in RMM_create().
16641 + * Parameters:
16642 + * target - Target returned from RMM_create().
16643 + * Returns:
16644 + * Requires:
16645 + * RMM initialized.
16646 + * Valid target.
16647 + * Ensures:
16648 + */
16649 +extern void RMM_delete(struct RMM_TargetObj *target);
16652 + * ======== RMM_exit ========
16653 + * Exit the RMM module
16655 + * Parameters:
16656 + * Returns:
16657 + * Requires:
16658 + * RMM_init successfully called.
16659 + * Ensures:
16660 + */
16661 +extern void RMM_exit(void);
16664 + * ======== RMM_free ========
16665 + * Free or unreserve memory allocated through RMM_alloc().
16667 + * Parameters:
16668 + * target: - Target returned from RMM_create().
16669 + * segid: - Segment of memory to free.
16670 + * dspAddr: - Address to free or unreserve.
16671 + * size: - Size of memory to free or unreserve.
16672 + * reserved: - TRUE if memory was reserved only, otherwise FALSE.
16673 + * Returns:
16674 + * Requires:
16675 + * RMM initialized.
16676 + * Valid target.
16677 + * reserved || segid < target->numSegs.
16678 + * reserve || [dspAddr, dspAddr + size] is a valid memory range.
16679 + * Ensures:
16680 + */
16681 +extern bool RMM_free(struct RMM_TargetObj *target, u32 segid, u32 dspAddr,
16682 + u32 size, bool reserved);
16685 + * ======== RMM_init ========
16686 + * Initialize the RMM module
16688 + * Parameters:
16689 + * Returns:
16690 + * TRUE: Success.
16691 + * FALSE: Failure.
16692 + * Requires:
16693 + * Ensures:
16694 + */
16695 +extern bool RMM_init(void);
16698 + * ======== RMM_stat ========
16699 + * Obtain memory segment status
16701 + * Parameters:
16702 + * segid: Segment ID of the dynamic loading segment.
16703 + * pMemStatBuf: Pointer to allocated buffer into which memory stats are
16704 + * placed.
16705 + * Returns:
16706 + * TRUE: Success.
16707 + * FALSE: Failure.
16708 + * Requires:
16709 + * segid < target->numSegs
16710 + * Ensures:
16711 + */
16712 +extern bool RMM_stat(struct RMM_TargetObj *target, enum DSP_MEMTYPE segid,
16713 + struct DSP_MEMSTAT *pMemStatBuf);
16715 +#endif /* RMM_ */
16716 Index: lk/arch/arm/plat-omap/include/bridge/rms_sh.h
16717 ===================================================================
16718 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16719 +++ lk/arch/arm/plat-omap/include/bridge/rms_sh.h 2008-08-18 10:38:34.000000000 +0300
16720 @@ -0,0 +1,125 @@
16722 + * arch/arm/plat-omap/include/bridge/rms_sh.h
16724 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16726 + * Copyright (C) 2008 Texas Instruments, Inc.
16728 + * This package is free software; you can redistribute it and/or modify
16729 + * it under the terms of the GNU General Public License version 2 as
16730 + * published by the Free Software Foundation.
16732 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16733 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16734 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16735 + */
16739 + * ======== rms_sh.h ========
16741 + * DSP/BIOS Bridge Resource Manager Server shared definitions (used on both
16742 + * GPP and DSP sides).
16744 + *! Revision History
16745 + *! ================
16746 + *! 24-Mar-2003 vp Merged updates required for CCS2.2 transition.
16747 + *! 24-Feb-2003 kc Rearranged order of node types to temporarily support
16748 + *! legacy message node code
16749 + *! 23-Nov-2002 gp Converted tabs -> spaces, to fix formatting.
16750 + *! 13-Feb-2002 jeh Added sysstacksize element to RMS_MoreTaskArgs.
16751 + *! 11-Dec-2000 sg Added 'misc' element to RMS_MoreTaskArgs.
16752 + *! 04-Dec-2000 ag Added RMS_BUFDESC command code.
16753 + *! C/R code value changed to allow ORing of system/user codes.
16754 + *! 10-Oct-2000 sg Added 'align' field to RMS_StrmDef.
16755 + *! 09-Oct-2000 sg Moved pre-defined message codes here from rmsdefs.h.
16756 + *! 02-Oct-2000 sg Changed ticks to msec.
16757 + *! 24-Aug-2000 sg Moved definitions that will be exposed to app developers
16758 + *! to a separate file, rmsdefs.h.
16759 + *! 10-Aug-2000 sg Added RMS_COMMANDBUFSIZE and RMS_RESPONSEBUFSIZE; added
16760 + *! pre-defined command/response codes; more comments.
16761 + *! 09-Aug-2000 sg Added RMS_ETASK.
16762 + *! 08-Aug-2000 jeh Define RMS_WORD for GPP, rename DSP_MSG to RMS_DSPMSG.
16763 + *! Added RMS_MsgArgs, RMS_MoreTaskArgs.
16764 + *! 25-Jul-2000 sg: Changed SIO to STRM.
16765 + *! 30-Jun-2000 sg: Initial.
16766 + */
16768 +#ifndef RMS_SH_
16769 +#define RMS_SH_
16771 +#include <rmstypes.h>
16773 +/* Node Types: */
16774 +#define RMS_TASK 1 /* Task node */
16775 +#define RMS_DAIS 2 /* xDAIS socket node */
16776 +#define RMS_MSG 3 /* Message node */
16778 +/* Memory Types: */
16779 +#define RMS_CODE 0 /* Program space */
16780 +#define RMS_DATA 1 /* Data space */
16781 +#define RMS_IO 2 /* I/O space */
16783 +/* RM Server Command and Response Buffer Sizes: */
16784 +#define RMS_COMMANDBUFSIZE 256 /* Size of command buffer */
16785 +#define RMS_RESPONSEBUFSIZE 16 /* Size of response buffer */
16787 +/* Pre-Defined Command/Response Codes: */
16788 +#define RMS_EXIT 0x80000000 /* GPP->Node: shutdown */
16789 +#define RMS_EXITACK 0x40000000 /* Node->GPP: ack shutdown */
16790 +#define RMS_BUFDESC 0x20000000 /* Arg1 SM buf, Arg2 is SM size */
16791 +#define RMS_KILLTASK 0x10000000 /* GPP->Node: Kill Task */
16792 +#define RMS_USER 0x0 /* Start of user-defined msg codes */
16793 +#define RMS_MAXUSERCODES 0xfff /* Maximum user defined C/R Codes */
16796 +/* RM Server RPC Command Structure: */
16797 + struct RMS_Command {
16798 + RMS_WORD fxn; /* Server function address */
16799 + RMS_WORD arg1; /* First argument */
16800 + RMS_WORD arg2; /* Second argument */
16801 + RMS_WORD data; /* Function-specific data array */
16802 + } ;
16805 + * The RMS_StrmDef structure defines the parameters for both input and output
16806 + * streams, and is passed to a node's create function.
16807 + */
16808 + struct RMS_StrmDef {
16809 + RMS_WORD bufsize; /* Buffer size (in DSP words) */
16810 + RMS_WORD nbufs; /* Max number of bufs in stream */
16811 + RMS_WORD segid; /* Segment to allocate buffers */
16812 + RMS_WORD align; /* Alignment for allocated buffers */
16813 + RMS_WORD timeout; /* Timeout (msec) for blocking calls */
16814 + RMS_CHAR name[1]; /* Device Name (terminated by '\0') */
16815 + } ;
16817 +/* Message node create args structure: */
16818 + struct RMS_MsgArgs {
16819 + RMS_WORD maxMessages; /* Max # simultaneous msgs to node */
16820 + RMS_WORD segid; /* Mem segment for NODE_allocMsgBuf */
16821 + RMS_WORD notifyType; /* Type of message notification */
16822 + RMS_WORD argLength; /* Length (in DSP chars) of arg data */
16823 + RMS_WORD argData; /* Arg data for node */
16824 + } ;
16826 +/* Partial task create args structure */
16827 + struct RMS_MoreTaskArgs {
16828 + RMS_WORD priority; /* Task's runtime priority level */
16829 + RMS_WORD stackSize; /* Task's stack size */
16830 + RMS_WORD sysstackSize; /* Task's system stack size (55x) */
16831 + RMS_WORD stackSeg; /* Memory segment for task's stack */
16832 + RMS_WORD heapAddr; /* base address of the node memory heap in
16833 + * external memory (DSP virtual address) */
16834 + RMS_WORD heapSize; /* size in MAUs of the node memory heap in
16835 + * external memory */
16836 + RMS_WORD misc; /* Misc field. Not used for 'normal'
16837 + * task nodes; for xDAIS socket nodes
16838 + * specifies the IALG_Fxn pointer.
16839 + */
16840 + /* # input STRM definition structures */
16841 + RMS_WORD numInputStreams;
16842 + } ;
16844 +#endif /* RMS_SH_ */
16846 Index: lk/arch/arm/plat-omap/include/bridge/rmstypes.h
16847 ===================================================================
16848 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16849 +++ lk/arch/arm/plat-omap/include/bridge/rmstypes.h 2008-08-18 10:38:34.000000000 +0300
16850 @@ -0,0 +1,41 @@
16852 + * arch/arm/plat-omap/include/bridge/rmstypes.h
16854 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16856 + * Copyright (C) 2008 Texas Instruments, Inc.
16858 + * This package is free software; you can redistribute it and/or modify
16859 + * it under the terms of the GNU General Public License version 2 as
16860 + * published by the Free Software Foundation.
16862 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16863 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16864 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16865 + */
16868 + * ======== rmstypes.h ========
16870 + * DSP/BIOS Bridge Resource Manager Server shared data type definitions.
16872 + *! Revision History
16873 + *! ================
16874 + *! 06-Oct-2000 sg Added LgFxn type.
16875 + *! 05-Oct-2000 sg Changed RMS_STATUS to LgUns.
16876 + *! 31-Aug-2000 sg Added RMS_DSPMSG.
16877 + *! 25-Aug-2000 sg Initial.
16878 + */
16880 +#ifndef RMSTYPES_
16881 +#define RMSTYPES_
16882 +#include <linux/types.h>
16884 + * DSP-side definitions.
16885 + */
16886 +#include <std.h>
16887 +typedef u32 RMS_WORD;
16888 +typedef char RMS_CHAR;
16889 +typedef u32 RMS_STATUS;
16891 +#endif /* RMSTYPES_ */
16892 Index: lk/arch/arm/plat-omap/include/bridge/services.h
16893 ===================================================================
16894 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16895 +++ lk/arch/arm/plat-omap/include/bridge/services.h 2008-08-18 10:38:34.000000000 +0300
16896 @@ -0,0 +1,63 @@
16898 + * arch/arm/plat-omap/include/bridge/services.h
16900 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16902 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
16904 + * This package is free software; you can redistribute it and/or modify
16905 + * it under the terms of the GNU General Public License version 2 as
16906 + * published by the Free Software Foundation.
16908 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16909 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16910 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16911 + */
16915 + * ======== services.h ========
16916 + * Purpose:
16917 + * Provide loading and unloading of SERVICES modules.
16919 + * Public Functions:
16920 + * SERVICES_Exit()
16921 + * SERVICES_Init()
16923 + *! Revision History:
16924 + *! ================
16925 + *! 01-Feb-2000 kc: Created.
16926 + */
16928 +#ifndef SERVICES_
16929 +#define SERVICES_
16931 +#include <host_os.h>
16933 + * ======== SERVICES_Exit ========
16934 + * Purpose:
16935 + * Discontinue usage of module; free resources when reference count
16936 + * reaches 0.
16937 + * Parameters:
16938 + * Returns:
16939 + * Requires:
16940 + * SERVICES initialized.
16941 + * Ensures:
16942 + * Resources used by module are freed when cRef reaches zero.
16943 + */
16944 + extern void SERVICES_Exit();
16947 + * ======== SERVICES_Init ========
16948 + * Purpose:
16949 + * Initializes SERVICES modules.
16950 + * Parameters:
16951 + * Returns:
16952 + * TRUE if all modules initialized; otherwise FALSE.
16953 + * Requires:
16954 + * Ensures:
16955 + * SERVICES modules initialized.
16956 + */
16957 + extern bool SERVICES_Init();
16959 +#endif /* SERVICES_ */
16960 Index: lk/arch/arm/plat-omap/include/bridge/std.h
16961 ===================================================================
16962 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
16963 +++ lk/arch/arm/plat-omap/include/bridge/std.h 2008-08-18 10:38:34.000000000 +0300
16964 @@ -0,0 +1,143 @@
16966 + * arch/arm/plat-omap/include/bridge/std.h
16968 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
16970 + * Copyright (C) 2008 Texas Instruments, Inc.
16972 + * This package is free software; you can redistribute it and/or modify
16973 + * it under the terms of the GNU General Public License version 2 as
16974 + * published by the Free Software Foundation.
16976 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16977 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16978 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16979 + */
16982 + * ======== std.h ========
16984 + *! Revision History
16985 + *! ================
16986 + *! 16-Feb-2004 vp GNU compiler 3.x defines inline keyword. Added
16987 + *! appropriate macros not to redefine inline keyword in
16988 + *! this file.
16989 + *! 24-Oct-2002 ashu defined _TI_ and _FIXED_ symbols for 28x.
16990 + *! 24-Oct-2002 ashu defined _TI_ for 24x.
16991 + *! 01-Mar-2002 kln changed LARGE_MODEL and Arg definition for 28x
16992 + *! 01-Feb-2002 kln added definitions for 28x
16993 + *! 08-Dec-2000 kw: added 'ArgToInt' and 'ArgToPtr' macros
16994 + *! 30-Nov-2000 mf: Added _64_, _6x_; removed _7d_
16995 + *! 30-May-2000 srid: Added __TMS320C55X__ for 55x; Arg is void * for 55 .
16996 + *! 18-Jun-1999 dr: Added '_TI_', fixed __inline for SUN4, added inline
16997 + *! 10-Feb-1999 rt: Added '55' support, changed 54's symbol to _TMS320C5XX
16998 + *! 29-Aug-1998 mf: fixed typo, removed obsolete targets
16999 + *! 08-Jun-1998 mf: _67_ is synonym for _7d_
17000 + *! 10-Oct-1997 rt; added _7d_ for Raytheon C7DSP triggered by _TMS320C6700
17001 + *! 04-Aug-1997 cc: added _29_ for _TMS320C2XX
17002 + *! 11-Jul-1997 dlr: _5t_, and STD_SPOXTASK keyword for Tasking
17003 + *! 12-Jun-1997 mf: _TMS320C60 -> _TMS320C6200
17004 + *! 13-Feb-1997 mf: _62_, with 32-bit LgInt
17005 + *! 26-Nov-1996 kw: merged bios-c00's and wsx-a27's <std.h> changes
17006 + *! *and* revision history
17007 + *! 12-Sep-1996 kw: added C54x #ifdef's
17008 + *! 21-Aug-1996 mf: removed #define main smain for _21_
17009 + *! 14-May-1996 gp: def'd out INT, FLOAT, and COMPLEX defines for WSX.
17010 + *! 11-Apr-1996 kw: define _W32_ based on _WIN32 (defined by MS compiler)
17011 + *! 07-Mar-1996 mg: added Win32 support
17012 + *! 06-Sep-1995 dh: added _77_ dynamic stack support via fxns77.h
17013 + *! 27-Jun-1995 dh: added _77_ support
17014 + *! 16-Mar-1995 mf: for _21_: #define main smain
17015 + *! 01-Mar-1995 mf: set _20_ and _60_ (as well as _21_ for both)
17016 + *! 22-Feb-1995 mf: Float is float for _SUN_ and _80_
17017 + *! 22-Dec-1994 mf: Added _80_ definition, for PP or MP.
17018 + *! 09-Dec-1994 mf: Added _53_ definition.
17019 + *! Added definitions of _30_, etc.
17020 + *! 23-Aug-1994 dh removed _21_ special case (kw)
17021 + *! 17-Aug-1994 dh added _51_ support
17022 + *! 03-Aug-1994 kw updated _80_ support
17023 + *! 30-Jun-1994 kw added _80_ support
17024 + *! 05-Apr-1994 kw: Added _SUN_ to _FLOAT_ definition
17025 + *! 01-Mar-1994 kw: Made Bool an int (was u16) for _56_ (more efficient).
17026 + *! Added _53_ support.
17027 + */
17029 +#ifndef STD_
17030 +#define STD_
17032 +#include <linux/types.h>
17035 + * ======== _TI_ ========
17036 + * _TI_ is defined for all TI targets
17037 + */
17038 +#if defined(_29_) || defined(_30_) || defined(_40_) || defined(_50_) || \
17039 + defined(_54_) || defined(_55_) || defined(_6x_) || defined(_80_) || \
17040 + defined(_28_) || defined(_24_)
17041 +#define _TI_ 1
17042 +#endif
17045 + * ======== _FLOAT_ ========
17046 + * _FLOAT_ is defined for all targets that natively support floating point
17047 + */
17048 +#if defined(_SUN_) || defined(_30_) || defined(_40_) || defined(_67_) || \
17049 + defined(_80_)
17050 +#define _FLOAT_ 1
17051 +#endif
17054 + * ======== _FIXED_ ========
17055 + * _FIXED_ is defined for all fixed point target architectures
17056 + */
17057 +#if defined(_29_) || defined(_50_) || defined(_54_) || defined(_55_) || \
17058 + defined(_62_) || defined(_64_) || defined(_28_)
17059 +#define _FIXED_ 1
17060 +#endif
17063 + * ======== _TARGET_ ========
17064 + * _TARGET_ is defined for all target architectures (as opposed to
17065 + * host-side software)
17066 + */
17067 +#if defined(_FIXED_) || defined(_FLOAT_)
17068 +#define _TARGET_ 1
17069 +#endif
17072 + * 8, 16, 32-bit type definitions
17074 + * Sm* - 8-bit type
17075 + * Md* - 16-bit type
17076 + * Lg* - 32-bit type
17078 + * *s32 - signed type
17079 + * *u32 - unsigned type
17080 + * *Bits - unsigned type (bit-maps)
17081 + */
17084 + * Aliases for standard C types
17085 + */
17087 +typedef s32(*Fxn) (); /* generic function type */
17089 +#ifndef NULL
17090 +#define NULL 0
17091 +#endif
17095 + * These macros are used to cast 'Arg' types to 's32' or 'Ptr'.
17096 + * These macros were added for the 55x since Arg is not the same
17097 + * size as s32 and Ptr in 55x large model.
17098 + */
17099 +#if defined(_28l_) || defined(_55l_)
17100 +#define ArgToInt(A) ((s32)((long)(A) & 0xffff))
17101 +#define ArgToPtr(A) ((Ptr)(A))
17102 +#else
17103 +#define ArgToInt(A) ((s32)(A))
17104 +#define ArgToPtr(A) ((Ptr)(A))
17105 +#endif
17107 +#endif /* STD_ */
17108 Index: lk/arch/arm/plat-omap/include/bridge/strm.h
17109 ===================================================================
17110 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
17111 +++ lk/arch/arm/plat-omap/include/bridge/strm.h 2008-08-18 10:38:34.000000000 +0300
17112 @@ -0,0 +1,441 @@
17114 + * arch/arm/plat-omap/include/bridge/strm.h
17116 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
17118 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
17120 + * This package is free software; you can redistribute it and/or modify
17121 + * it under the terms of the GNU General Public License version 2 as
17122 + * published by the Free Software Foundation.
17124 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17125 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17126 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17127 + */
17131 + * ======== strm.h ========
17132 + * Description:
17133 + * DSPBridge Stream Manager.
17135 + * Public Functions:
17136 + * STRM_AllocateBuffer
17137 + * STRM_Close
17138 + * STRM_Create
17139 + * STRM_Delete
17140 + * STRM_Exit
17141 + * STRM_FreeBuffer
17142 + * STRM_GetEventHandle
17143 + * STRM_GetInfo
17144 + * STRM_Idle
17145 + * STRM_Init
17146 + * STRM_Issue
17147 + * STRM_Open
17148 + * STRM_PrepareBuffer
17149 + * STRM_Reclaim
17150 + * STRM_RegisterNotify
17151 + * STRM_Select
17152 + * STRM_UnprepareBuffer
17154 + * Notes:
17156 + *! Revision History:
17157 + *! =================
17158 + *! 15-Nov-2001 ag Changed DSP_STREAMINFO to STRM_INFO in STRM_GetInfo().
17159 + *! Added DSP_ESIZE error to STRM_AllocateBuffer().
17160 + *! 07-Jun-2001 sg Made DSPStream_AllocateBuffer fxn name plural.
17161 + *! 10-May-2001 jeh Code review cleanup.
17162 + *! 13-Feb-2001 kc DSP/BIOS Bridge name updates.
17163 + *! 06-Feb-2001 kc Updated DBC_Ensure for STRM_Select().
17164 + *! 23-Oct-2000 jeh Allow NULL STRM_ATTRS passed to STRM_Open().
17165 + *! 25-Sep-2000 jeh Created.
17166 + */
17168 +#ifndef STRM_
17169 +#define STRM_
17171 +#include <dev.h>
17173 +#include <strmdefs.h>
17176 + * ======== STRM_AllocateBuffer ========
17177 + * Purpose:
17178 + * Allocate data buffer(s) for use with a stream.
17179 + * Parameter:
17180 + * hStrm: Stream handle returned from STRM_Open().
17181 + * uSize: Size (GPP bytes) of the buffer(s).
17182 + * uNumBufs: Number of buffers to allocate.
17183 + * apBuffer: Array to hold buffer addresses.
17184 + * Returns:
17185 + * DSP_SOK: Success.
17186 + * DSP_EHANDLE: Invalid hStrm.
17187 + * DSP_EMEMORY: Insufficient memory.
17188 + * DSP_EFAIL: Failure occurred, unable to allocate buffers.
17189 + * DSP_ESIZE: uSize must be > 0 bytes.
17190 + * Requires:
17191 + * STRM_Init() called.
17192 + * apBuffer != NULL.
17193 + * Ensures:
17194 + */
17195 + extern DSP_STATUS STRM_AllocateBuffer(struct STRM_OBJECT *hStrm,
17196 + u32 uSize,
17197 + OUT u8 **apBuffer,
17198 + u32 uNumBufs);
17201 + * ======== STRM_Close ========
17202 + * Purpose:
17203 + * Close a stream opened with STRM_Open().
17204 + * Parameter:
17205 + * hStrm: Stream handle returned from STRM_Open().
17206 + * Returns:
17207 + * DSP_SOK: Success.
17208 + * DSP_EHANDLE: Invalid hStrm.
17209 + * DSP_EPENDING: Some data buffers issued to the stream have not
17210 + * been reclaimed.
17211 + * DSP_EFAIL: Failure to close stream.
17212 + * Requires:
17213 + * STRM_Init() called.
17214 + * Ensures:
17215 + */
17216 + extern DSP_STATUS STRM_Close(struct STRM_OBJECT *hStrm);
17219 + * ======== STRM_Create ========
17220 + * Purpose:
17221 + * Create a STRM manager object. This object holds information about the
17222 + * device needed to open streams.
17223 + * Parameters:
17224 + * phStrmMgr: Location to store handle to STRM manager object on
17225 + * output.
17226 + * hDev: Device for this processor.
17227 + * Returns:
17228 + * DSP_SOK: Success;
17229 + * DSP_EMEMORY: Insufficient memory for requested resources.
17230 + * DSP_EFAIL: General failure.
17231 + * Requires:
17232 + * STRM_Init() called.
17233 + * phStrmMgr != NULL.
17234 + * hDev != NULL.
17235 + * Ensures:
17236 + * DSP_SOK: Valid *phStrmMgr.
17237 + * error: *phStrmMgr == NULL.
17238 + */
17239 + extern DSP_STATUS STRM_Create(OUT struct STRM_MGR **phStrmMgr,
17240 + struct DEV_OBJECT *hDev);
17243 + * ======== STRM_Delete ========
17244 + * Purpose:
17245 + * Delete the STRM Object.
17246 + * Parameters:
17247 + * hStrmMgr: Handle to STRM manager object from STRM_Create.
17248 + * Returns:
17249 + * Requires:
17250 + * STRM_Init() called.
17251 + * Valid hStrmMgr.
17252 + * Ensures:
17253 + * hStrmMgr is not valid.
17254 + */
17255 + extern void STRM_Delete(struct STRM_MGR *hStrmMgr);
17258 + * ======== STRM_Exit ========
17259 + * Purpose:
17260 + * Discontinue usage of STRM module.
17261 + * Parameters:
17262 + * Returns:
17263 + * Requires:
17264 + * STRM_Init() successfully called before.
17265 + * Ensures:
17266 + */
17267 + extern void STRM_Exit();
17270 + * ======== STRM_FreeBuffer ========
17271 + * Purpose:
17272 + * Free buffer(s) allocated with STRM_AllocateBuffer.
17273 + * Parameter:
17274 + * hStrm: Stream handle returned from STRM_Open().
17275 + * apBuffer: Array containing buffer addresses.
17276 + * uNumBufs: Number of buffers to be freed.
17277 + * Returns:
17278 + * DSP_SOK: Success.
17279 + * DSP_EHANDLE: Invalid stream handle.
17280 + * DSP_EFAIL: Failure occurred, unable to free buffers.
17281 + * Requires:
17282 + * STRM_Init() called.
17283 + * apBuffer != NULL.
17284 + * Ensures:
17285 + */
17286 + extern DSP_STATUS STRM_FreeBuffer(struct STRM_OBJECT *hStrm,
17287 + u8 **apBuffer, u32 uNumBufs);
17290 + * ======== STRM_GetEventHandle ========
17291 + * Purpose:
17292 + * Get stream's user event handle. This function is used when closing
17293 + * a stream, so the event can be closed.
17294 + * Parameter:
17295 + * hStrm: Stream handle returned from STRM_Open().
17296 + * phEvent: Location to store event handle on output.
17297 + * Returns:
17298 + * DSP_SOK: Success.
17299 + * DSP_EHANDLE: Invalid hStrm.
17300 + * Requires:
17301 + * STRM_Init() called.
17302 + * phEvent != NULL.
17303 + * Ensures:
17304 + */
17305 + extern DSP_STATUS STRM_GetEventHandle(struct STRM_OBJECT *hStrm,
17306 + OUT HANDLE *phEvent);
17309 + * ======== STRM_GetInfo ========
17310 + * Purpose:
17311 + * Get information about a stream. User's DSP_STREAMINFO is contained
17312 + * in STRM_INFO struct. STRM_INFO also contains Bridge private info.
17313 + * Parameters:
17314 + * hStrm: Stream handle returned from STRM_Open().
17315 + * pStreamInfo: Location to store stream info on output.
17316 + * uSteamInfoSize: Size of user's DSP_STREAMINFO structure.
17317 + * Returns:
17318 + * DSP_SOK: Success.
17319 + * DSP_EHANDLE: Invalid hStrm.
17320 + * DSP_ESIZE: uStreamInfoSize < sizeof(DSP_STREAMINFO).
17321 + * DSP_EFAIL: Unable to get stream info.
17322 + * Requires:
17323 + * STRM_Init() called.
17324 + * pStreamInfo != NULL.
17325 + * Ensures:
17326 + */
17327 + extern DSP_STATUS STRM_GetInfo(struct STRM_OBJECT *hStrm,
17328 + OUT struct STRM_INFO *pStreamInfo,
17329 + u32 uStreamInfoSize);
17332 + * ======== STRM_Idle ========
17333 + * Purpose:
17334 + * Idle a stream and optionally flush output data buffers.
17335 + * If this is an output stream and fFlush is TRUE, all data currently
17336 + * enqueued will be discarded.
17337 + * If this is an output stream and fFlush is FALSE, this function
17338 + * will block until all currently buffered data is output, or the timeout
17339 + * specified has been reached.
17340 + * After a successful call to STRM_Idle(), all buffers can immediately
17341 + * be reclaimed.
17342 + * Parameters:
17343 + * hStrm: Stream handle returned from STRM_Open().
17344 + * fFlush: If TRUE, discard output buffers.
17345 + * Returns:
17346 + * DSP_SOK: Success.
17347 + * DSP_EHANDLE: Invalid hStrm.
17348 + * DSP_ETIMEOUT: A timeout occurred before the stream could be idled.
17349 + * DSP_ERESTART: A critical error occurred, DSP is being restarted.
17350 + * DSP_EFAIL: Unable to idle stream.
17351 + * Requires:
17352 + * STRM_Init() called.
17353 + * Ensures:
17354 + */
17355 + extern DSP_STATUS STRM_Idle(struct STRM_OBJECT *hStrm, bool fFlush);
17358 + * ======== STRM_Init ========
17359 + * Purpose:
17360 + * Initialize the STRM module.
17361 + * Parameters:
17362 + * Returns:
17363 + * TRUE if initialization succeeded, FALSE otherwise.
17364 + * Requires:
17365 + * Ensures:
17366 + */
17367 + extern bool STRM_Init();
17370 + * ======== STRM_Issue ========
17371 + * Purpose:
17372 + * Send a buffer of data to a stream.
17373 + * Parameters:
17374 + * hStrm: Stream handle returned from STRM_Open().
17375 + * pBuf: Pointer to buffer of data to be sent to the stream.
17376 + * ulBytes: Number of bytes of data in the buffer.
17377 + * ulBufSize: Actual buffer size in bytes.
17378 + * dwArg: A user argument that travels with the buffer.
17379 + * Returns:
17380 + * DSP_SOK: Success.
17381 + * DSP_EHANDLE: Invalid hStrm.
17382 + * DSP_ESTREAMFULL: The stream is full.
17383 + * DSP_EFAIL: Failure occurred, unable to issue buffer.
17384 + * Requires:
17385 + * STRM_Init() called.
17386 + * pBuf != NULL.
17387 + * Ensures:
17388 + */
17389 + extern DSP_STATUS STRM_Issue(struct STRM_OBJECT *hStrm, IN u8 *pBuf,
17390 + u32 ulBytes, u32 ulBufSize,
17391 + IN u32 dwArg);
17394 + * ======== STRM_Open ========
17395 + * Purpose:
17396 + * Open a stream for sending/receiving data buffers to/from a task of
17397 + * DAIS socket node on the DSP.
17398 + * Parameters:
17399 + * hNode: Node handle returned from NODE_Allocate().
17400 + * uDir: DSP_TONODE or DSP_FROMNODE.
17401 + * uIndex: Stream index.
17402 + * pAttr: Pointer to structure containing attributes to be
17403 + * applied to stream. Cannot be NULL.
17404 + * phStrm: Location to store stream handle on output.
17405 + * Returns:
17406 + * DSP_SOK: Success.
17407 + * DSP_EHANDLE: Invalid hNode.
17408 + * DSP_EDIRECTION: Invalid uDir.
17409 + * DSP_EVALUE: Invalid uIndex.
17410 + * DSP_ENODETYPE: hNode is not a task or DAIS socket node.
17411 + * DSP_EFAIL: Unable to open stream.
17412 + * Requires:
17413 + * STRM_Init() called.
17414 + * phStrm != NULL.
17415 + * pAttr != NULL.
17416 + * Ensures:
17417 + * DSP_SOK: *phStrm is valid.
17418 + * error: *phStrm == NULL.
17419 + */
17420 + extern DSP_STATUS STRM_Open(struct NODE_OBJECT *hNode, u32 uDir,
17421 + u32 uIndex, IN struct STRM_ATTR *pAttr,
17422 + OUT struct STRM_OBJECT **phStrm);
17425 + * ======== STRM_PrepareBuffer ========
17426 + * Purpose:
17427 + * Prepare a data buffer not allocated by DSPStream_AllocateBuffers()
17428 + * for use with a stream.
17429 + * Parameter:
17430 + * hStrm: Stream handle returned from STRM_Open().
17431 + * uSize: Size (GPP bytes) of the buffer.
17432 + * pBuffer: Buffer address.
17433 + * Returns:
17434 + * DSP_SOK: Success.
17435 + * DSP_EHANDLE: Invalid hStrm.
17436 + * DSP_EFAIL: Failure occurred, unable to prepare buffer.
17437 + * Requires:
17438 + * STRM_Init() called.
17439 + * pBuffer != NULL.
17440 + * Ensures:
17441 + */
17442 + extern DSP_STATUS STRM_PrepareBuffer(struct STRM_OBJECT *hStrm,
17443 + u32 uSize,
17444 + u8 *pBuffer);
17447 + * ======== STRM_Reclaim ========
17448 + * Purpose:
17449 + * Request a buffer back from a stream.
17450 + * Parameters:
17451 + * hStrm: Stream handle returned from STRM_Open().
17452 + * pBufPtr: Location to store pointer to reclaimed buffer.
17453 + * pulBytes: Location where number of bytes of data in the
17454 + * buffer will be written.
17455 + * pulBufSize: Location where actual buffer size will be written.
17456 + * pdwArg: Location where user argument that travels with
17457 + * the buffer will be written.
17458 + * Returns:
17459 + * DSP_SOK: Success.
17460 + * DSP_EHANDLE: Invalid hStrm.
17461 + * DSP_ETIMEOUT: A timeout occurred before a buffer could be
17462 + * retrieved.
17463 + * DSP_EFAIL: Failure occurred, unable to reclaim buffer.
17464 + * Requires:
17465 + * STRM_Init() called.
17466 + * pBufPtr != NULL.
17467 + * pulBytes != NULL.
17468 + * pdwArg != NULL.
17469 + * Ensures:
17470 + */
17471 + extern DSP_STATUS STRM_Reclaim(struct STRM_OBJECT *hStrm,
17472 + OUT u8 **pBufPtr, u32 *pulBytes,
17473 + u32 *pulBufSize, u32 *pdwArg);
17476 + * ======== STRM_RegisterNotify ========
17477 + * Purpose:
17478 + * Register to be notified on specific events for this stream.
17479 + * Parameters:
17480 + * hStrm: Stream handle returned by STRM_Open().
17481 + * uEventMask: Mask of types of events to be notified about.
17482 + * uNotifyType: Type of notification to be sent.
17483 + * hNotification: Handle to be used for notification.
17484 + * Returns:
17485 + * DSP_SOK: Success.
17486 + * DSP_EHANDLE: Invalid hStrm.
17487 + * DSP_EMEMORY: Insufficient memory on GPP.
17488 + * DSP_EVALUE: uEventMask is invalid.
17489 + * DSP_ENOTIMPL: Notification type specified by uNotifyType is not
17490 + * supported.
17491 + * Requires:
17492 + * STRM_Init() called.
17493 + * hNotification != NULL.
17494 + * Ensures:
17495 + */
17496 + extern DSP_STATUS STRM_RegisterNotify(struct STRM_OBJECT *hStrm,
17497 + u32 uEventMask, u32 uNotifyType,
17498 + struct DSP_NOTIFICATION
17499 + *hNotification);
17502 + * ======== STRM_Select ========
17503 + * Purpose:
17504 + * Select a ready stream.
17505 + * Parameters:
17506 + * aStrmTab: Array of stream handles returned from STRM_Open().
17507 + * nStrms: Number of stream handles in array.
17508 + * pMask: Location to store mask of ready streams on output.
17509 + * uTimeout: Timeout value (milliseconds).
17510 + * Returns:
17511 + * DSP_SOK: Success.
17512 + * DSP_ERANGE: nStrms out of range.
17514 + * DSP_EHANDLE: Invalid stream handle in array.
17515 + * DSP_ETIMEOUT: A timeout occurred before a stream became ready.
17516 + * DSP_EFAIL: Failure occurred, unable to select a stream.
17517 + * Requires:
17518 + * STRM_Init() called.
17519 + * aStrmTab != NULL.
17520 + * nStrms > 0.
17521 + * pMask != NULL.
17522 + * Ensures:
17523 + * DSP_SOK: *pMask != 0 || uTimeout == 0.
17524 + * Error: *pMask == 0.
17525 + */
17526 + extern DSP_STATUS STRM_Select(IN struct STRM_OBJECT **aStrmTab,
17527 + u32 nStrms,
17528 + OUT u32 *pMask, u32 uTimeout);
17531 + * ======== STRM_UnprepareBuffer ========
17532 + * Purpose:
17533 + * Unprepare a data buffer that was previously prepared for a stream
17534 + * with DSPStream_PrepareBuffer(), and that will no longer be used with
17535 + * the stream.
17536 + * Parameter:
17537 + * hStrm: Stream handle returned from STRM_Open().
17538 + * uSize: Size (GPP bytes) of the buffer.
17539 + * pBuffer: Buffer address.
17540 + * Returns:
17541 + * DSP_SOK: Success.
17542 + * DSP_EHANDLE: Invalid hStrm.
17543 + * DSP_EFAIL: Failure occurred, unable to unprepare buffer.
17544 + * Requires:
17545 + * STRM_Init() called.
17546 + * pBuffer != NULL.
17547 + * Ensures:
17548 + */
17549 + extern DSP_STATUS STRM_UnprepareBuffer(struct STRM_OBJECT *hStrm,
17550 + u32 uSize,
17551 + u8 *pBuffer);
17553 +#endif /* STRM_ */
17554 Index: lk/arch/arm/plat-omap/include/bridge/strmdefs.h
17555 ===================================================================
17556 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
17557 +++ lk/arch/arm/plat-omap/include/bridge/strmdefs.h 2008-08-18 10:38:34.000000000 +0300
17558 @@ -0,0 +1,57 @@
17560 + * arch/arm/plat-omap/include/bridge/strmdefs.h
17562 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
17564 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
17566 + * This package is free software; you can redistribute it and/or modify
17567 + * it under the terms of the GNU General Public License version 2 as
17568 + * published by the Free Software Foundation.
17570 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17571 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17572 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17573 + */
17577 + * ======== strmdefs.h ========
17578 + * Purpose:
17579 + * Global STRM constants and types.
17581 + *! Revision History
17582 + *! ================
17583 + *! 19-Nov-2001 ag Added STRM_INFO..
17584 + *! 25-Sep-2000 jeh Created.
17585 + */
17587 +#ifndef STRMDEFS_
17588 +#define STRMDEFS_
17590 +#define STRM_MAXEVTNAMELEN 32
17592 + struct STRM_MGR;
17594 + struct STRM_OBJECT;
17596 + struct STRM_ATTR {
17597 + HANDLE hUserEvent;
17598 + char *pstrEventName;
17599 + void *pVirtBase; /* Process virtual base address of
17600 + * mapped SM */
17601 + u32 ulVirtSize; /* Size of virtual space in bytes */
17602 + struct DSP_STREAMATTRIN *pStreamAttrIn;
17603 + } ;
17605 + struct STRM_INFO {
17606 + enum DSP_STRMMODE lMode; /* transport mode of
17607 + * stream(DMA, ZEROCOPY..) */
17608 + u32 uSegment; /* Segment strm allocs from. 0 is local mem */
17609 + void *pVirtBase; /* " " Stream'process virt base */
17610 + struct DSP_STREAMINFO *pUser; /* User's stream information
17611 + * returned */
17612 + } ;
17614 +#endif /* STRMDEFS_ */
17616 Index: lk/arch/arm/plat-omap/include/bridge/sync.h
17617 ===================================================================
17618 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
17619 +++ lk/arch/arm/plat-omap/include/bridge/sync.h 2008-08-18 10:38:34.000000000 +0300
17620 @@ -0,0 +1,339 @@
17622 + * arch/arm/plat-omap/include/bridge/sync.h
17624 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
17626 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
17628 + * This package is free software; you can redistribute it and/or modify
17629 + * it under the terms of the GNU General Public License version 2 as
17630 + * published by the Free Software Foundation.
17632 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17633 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17634 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17635 + */
17638 + * ======== sync.h ========
17639 + * Purpose:
17640 + * Provide synchronization services.
17642 + * Public Functions:
17643 + * SYNC_CloseEvent
17644 + * SYNC_DeleteCS
17645 + * SYNC_EnterCS
17646 + * SYNC_Exit
17647 + * SYNC_Init
17648 + * SYNC_InitializeCS
17649 + * SYNC_LeaveCS
17650 + * SYNC_OpenEvent
17651 + * SYNC_PostMessage
17652 + * SYNC_ResetEvent
17653 + * SYNC_SetEvent
17654 + * SYNC_WaitOnEvent
17655 + * SYNC_WaitOnMultipleEvents
17657 + *! Revision History:
17658 + *! ================
17659 + *! 05-Oct-2000 jeh Added SYNC_WaitOnMultipleEvents().
17660 + *! 01-Dec-1999 ag: Added #define SYNC_MAXNAMELENGTH.
17661 + *! 04-Nov-1999 kc: Added critical section functions and objects to SYNC.
17662 + *! 29-Oct-1999 kc: Cleaned up for code review.
17663 + *! 24-Sep-1999 kc: Added WinCE notes.
17664 + *! 20-Oct-1997 gp: Removed unused SYNC_ critical section and must complete fxns
17665 + *! Added SYNC_HOBJECT, SYNC_ATTRS, and object validation, and
17666 + *! merged SYNC_DestroyEvent into SYNC_CloseEvent, and merged
17667 + *! SYNC_CreateEvent into SYNC_OpenEvent.
17668 + *! 07-Oct-1997 gp: Added SYNC_Create/DestroyEvent (for NT testing).
17669 + *! 06-Oct-1997 gp: Added SYNC_OpenEvent.
17670 + *! 03-Jun-1997 gp: Added SYNC_{Begin|End}CritSection() functions.
17671 + *! 03-Jan-1997 gp: Added SYNC_INFINITE define.
17672 + *! 05-Aug-1996 gp: Created.
17673 + */
17675 +#ifndef _SYNC_H
17676 +#define _SYNC_H
17678 +/* Special timeout value indicating an infinite wait: */
17679 +#define SYNC_INFINITE 0xffffffff
17681 +/* Maximum string length of a named event */
17682 +#define SYNC_MAXNAMELENGTH 32
17684 +/* Generic SYNC object: */
17685 + struct SYNC_OBJECT;
17686 + /*typedef struct SYNC_OBJECT *SYNC_HOBJECT;*/
17688 +/* Generic SYNC CS object: */
17689 + struct SYNC_CSOBJECT;
17690 + /*typedef struct SYNC_CSOBJECT *SYNC_HCSOBJECT;*/
17692 +/* Used SYNC_CSOBJECT instead of SYNC_DPCCSOBJECT to avoid warnings */
17693 + /*typedef struct SYNC_CSOBJECT *SYNC_HDPCCSOBJECT;*/
17695 +/* SYNC object attributes: */
17696 + struct SYNC_ATTRS {
17697 + HANDLE hUserEvent; /* Platform's User Mode synch. object. */
17698 + HANDLE hKernelEvent; /* Platform's Kernel Mode sync. object. */
17699 + u32 dwReserved1; /* For future expansion. */
17700 + u32 dwReserved2; /* For future expansion. */
17701 + } ;
17704 + * ======== SYNC_CloseEvent ========
17705 + * Purpose:
17706 + * Close this event handle, freeing resources allocated in SYNC_OpenEvent
17707 + * if necessary.
17708 + * Parameters:
17709 + * hEvent: Handle to a synchronization event, created/opened in
17710 + * SYNC_OpenEvent.
17711 + * Returns:
17712 + * DSP_SOK: Success;
17713 + * DSP_EFAIL: Failed to close event handle.
17714 + * DSP_EHANDLE: Invalid handle.
17715 + * Requires:
17716 + * SYNC initialized.
17717 + * Ensures:
17718 + * Any subsequent usage of hEvent would be invalid.
17719 + */
17720 + extern DSP_STATUS SYNC_CloseEvent(IN struct SYNC_OBJECT *hEvent);
17723 + * ======== SYNC_DeleteCS ========
17724 + * Purpose:
17725 + * Delete a critical section.
17726 + * Parameters:
17727 + * hCSObj: critical section handle.
17728 + * Returns:
17729 + * DSP_SOK: Success.
17730 + * DSP_EHANDLE: Invalid handle.
17731 + * Requires:
17732 + * Ensures:
17733 + */
17734 + extern DSP_STATUS SYNC_DeleteCS(IN struct SYNC_CSOBJECT *hCSObj);
17737 + * ======== SYNC_EnterCS ========
17738 + * Purpose:
17739 + * Enter the critical section.
17740 + * Parameters:
17741 + * hCSObj: critical section handle.
17742 + * Returns:
17743 + * DSP_SOK: Success.
17744 + * DSP_EHANDLE: Invalid handle.
17745 + * Requires:
17746 + * Ensures:
17747 + */
17748 + extern DSP_STATUS SYNC_EnterCS(IN struct SYNC_CSOBJECT *hCSObj);
17751 + * ======== SYNC_Exit ========
17752 + * Purpose:
17753 + * Discontinue usage of module; free resources when reference count
17754 + * reaches 0.
17755 + * Parameters:
17756 + * Returns:
17757 + * Requires:
17758 + * SYNC initialized.
17759 + * Ensures:
17760 + * Resources used by module are freed when cRef reaches zero.
17761 + */
17762 + extern void SYNC_Exit();
17765 + * ======== SYNC_Init ========
17766 + * Purpose:
17767 + * Initializes private state of SYNC module.
17768 + * Parameters:
17769 + * Returns:
17770 + * TRUE if initialized; FALSE if error occured.
17771 + * Requires:
17772 + * Ensures:
17773 + * SYNC initialized.
17774 + */
17775 + extern bool SYNC_Init();
17778 + * ======== SYNC_InitializeCS ========
17779 + * Purpose:
17780 + * Initialize the critical section.
17781 + * Parameters:
17782 + * hCSObj: critical section handle.
17783 + * Returns:
17784 + * DSP_SOK: Success.
17785 + * DSP_EMEMORY: Out of memory.
17786 + * Requires:
17787 + * Ensures:
17788 + */
17789 + extern DSP_STATUS SYNC_InitializeCS(OUT struct SYNC_CSOBJECT **phCSObj);
17792 + * ======== SYNC_InitializeDPCCS ========
17793 + * Purpose:
17794 + * Initialize the critical section between process context and DPC.
17795 + * Parameters:
17796 + * hCSObj: critical section handle.
17797 + * Returns:
17798 + * DSP_SOK: Success.
17799 + * DSP_EMEMORY: Out of memory.
17800 + * Requires:
17801 + * Ensures:
17802 + */
17803 + extern DSP_STATUS SYNC_InitializeDPCCS(OUT struct SYNC_CSOBJECT
17804 + **phCSObj);
17807 + * ======== SYNC_LeaveCS ========
17808 + * Purpose:
17809 + * Leave the critical section.
17810 + * Parameters:
17811 + * hCSObj: critical section handle.
17812 + * Returns:
17813 + * DSP_SOK: Success.
17814 + * DSP_EHANDLE: Invalid handle.
17815 + * Requires:
17816 + * Ensures:
17817 + */
17818 + extern DSP_STATUS SYNC_LeaveCS(IN struct SYNC_CSOBJECT *hCSObj);
17821 + * ======== SYNC_OpenEvent ========
17822 + * Purpose:
17823 + * Create/open and initialize an event object for thread synchronization,
17824 + * which is initially in the non-signalled state.
17825 + * Parameters:
17826 + * phEvent: Pointer to location to receive the event object handle.
17827 + * pAttrs: Pointer to SYNC_ATTRS object containing initial SYNC
17828 + * SYNC_OBJECT attributes. If this pointer is NULL, then
17829 + * SYNC_OpenEvent will create and manage an OS specific
17830 + * syncronization object.
17831 + * pAttrs->hUserEvent: Platform's User Mode synchronization object.
17833 + * The behaviour of the SYNC methods depend on the value of
17834 + * the hUserEvent attr:
17836 + * 1. (hUserEvent == NULL):
17837 + * A user mode event is created.
17838 + * 2. (hUserEvent != NULL):
17839 + * A user mode event is supplied by the caller of SYNC_OpenEvent().
17840 + * Returns:
17841 + * DSP_SOK: Success.
17842 + * DSP_EFAIL: Unable to create user mode event.
17843 + * DSP_EMEMORY: Insufficient memory.
17844 + * DSP_EINVALIDARG SYNC_ATTRS values are invalid.
17845 + * Requires:
17846 + * - SYNC initialized.
17847 + * - phEvent != NULL.
17848 + * Ensures:
17849 + * If function succeeded, pEvent->hEvent must be a valid event handle.
17850 + */
17851 + extern DSP_STATUS SYNC_OpenEvent(OUT struct SYNC_OBJECT **phEvent,
17852 + IN OPTIONAL struct SYNC_ATTRS
17853 + *pAttrs);
17856 + * ========= SYNC_PostMessage ========
17857 + * Purpose:
17858 + * To post a windows message
17859 + * Parameters:
17860 + * hWindow: Handle to the window
17861 + * uMsg: Message to be posted
17862 + * Returns:
17863 + * DSP_SOK: Success
17864 + * DSP_EFAIL: Post message failed
17865 + * DSP_EHANDLE: Invalid Window handle
17866 + * Requires:
17867 + * SYNC initialized
17868 + * Ensures
17869 + */
17870 + extern DSP_STATUS SYNC_PostMessage(IN HANDLE hWindow, IN u32 uMsg);
17873 + * ======== SYNC_ResetEvent ========
17874 + * Purpose:
17875 + * Reset a syncronization event object state to non-signalled.
17876 + * Parameters:
17877 + * hEvent: Handle to a sync event.
17878 + * Returns:
17879 + * DSP_SOK: Success;
17880 + * DSP_EFAIL: Failed to reset event.
17881 + * DSP_EHANDLE: Invalid handle.
17882 + * Requires:
17883 + * SYNC initialized.
17884 + * Ensures:
17885 + */
17886 + extern DSP_STATUS SYNC_ResetEvent(IN struct SYNC_OBJECT *hEvent);
17889 + * ======== SYNC_SetEvent ========
17890 + * Purpose:
17891 + * Signal the event. Will unblock one waiting thread.
17892 + * Parameters:
17893 + * hEvent: Handle to an event object.
17894 + * Returns:
17895 + * DSP_SOK: Success.
17896 + * DSP_EFAIL: Failed to signal event.
17897 + * DSP_EHANDLE: Invalid handle.
17898 + * Requires:
17899 + * SYNC initialized.
17900 + * Ensures:
17901 + */
17902 + extern DSP_STATUS SYNC_SetEvent(IN struct SYNC_OBJECT *hEvent);
17905 + * ======== SYNC_WaitOnEvent ========
17906 + * Purpose:
17907 + * Wait for an event to be signalled, up to the specified timeout.
17908 + * Parameters:
17909 + * hEvent: Handle to an event object.
17910 + * dwTimeOut: The time-out interval, in milliseconds.
17911 + * The function returns if the interval elapses, even if
17912 + * the object's state is nonsignaled.
17913 + * If zero, the function tests the object's state and
17914 + * returns immediately.
17915 + * If SYNC_INFINITE, the function's time-out interval
17916 + * never elapses.
17917 + * Returns:
17918 + * DSP_SOK: The object was signalled.
17919 + * DSP_EHANDLE: Invalid handle.
17920 + * SYNC_E_FAIL: Wait failed, possibly because the process terminated.
17921 + * SYNC_E_TIMEOUT: Timeout expired while waiting for event to be signalled.
17922 + * Requires:
17923 + * Ensures:
17924 + */
17925 + extern DSP_STATUS SYNC_WaitOnEvent(IN struct SYNC_OBJECT *hEvent,
17926 + IN u32 dwTimeOut);
17929 + * ======== SYNC_WaitOnMultipleEvents ========
17930 + * Purpose:
17931 + * Wait for any of an array of events to be signalled, up to the
17932 + * specified timeout.
17933 + * Note: dwTimeOut must be SYNC_INFINITE to signal infinite wait.
17934 + * Parameters:
17935 + * hSyncEvents: Array of handles to event objects.
17936 + * uCount: Number of event handles.
17937 + * dwTimeOut: The time-out interval, in milliseconds.
17938 + * The function returns if the interval elapses, even if
17939 + * no event is signalled.
17940 + * If zero, the function tests the object's state and
17941 + * returns immediately.
17942 + * If SYNC_INFINITE, the function's time-out interval
17943 + * never elapses.
17944 + * puIndex: Location to store index of event that was signalled.
17945 + * Returns:
17946 + * DSP_SOK: The object was signalled.
17947 + * SYNC_E_FAIL: Wait failed, possibly because the process terminated.
17948 + * SYNC_E_TIMEOUT: Timeout expired before event was signalled.
17949 + * DSP_EMEMORY: Memory allocation failed.
17950 + * Requires:
17951 + * Ensures:
17952 + */
17953 + extern DSP_STATUS SYNC_WaitOnMultipleEvents(IN struct SYNC_OBJECT
17954 + **hSyncEvents,
17955 + IN u32 uCount,
17956 + IN u32 dwTimeout,
17957 + OUT u32 *puIndex);
17959 +#endif /* _SYNC_H */
17960 Index: lk/arch/arm/plat-omap/include/bridge/util.h
17961 ===================================================================
17962 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
17963 +++ lk/arch/arm/plat-omap/include/bridge/util.h 2008-08-18 10:38:34.000000000 +0300
17964 @@ -0,0 +1,173 @@
17966 + * arch/arm/plat-omap/include/bridge/util.h
17968 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
17970 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
17972 + * This package is free software; you can redistribute it and/or modify
17973 + * it under the terms of the GNU General Public License version 2 as
17974 + * published by the Free Software Foundation.
17976 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17977 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17978 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17979 + */
17983 + * ======== util.h ========
17984 + * Purpose:
17985 + * Provide general purpose utility functions.
17987 + * Public Functions:
17988 + * UTIL_CDTestDll
17989 + * UTIL_CmdLineToArgs
17990 + * UTIL_Exit
17991 + * UTIL_GetSysInfo
17992 + * UTIL_Init
17993 + * UTIL_Wait
17995 + * Private Functions:
17996 + * isspace
17998 + * Notes:
18000 + *! Revision History
18001 + *! ================
18002 + *! 12-Aug-2000 ag: Added UTIL_GetSysInfo().
18003 + *! 31-Jan-2000 rr: Comments modifed for UTIL_Wait fxn.
18004 + *! 17-Jan-2000 rr: UTIL_Wait fxn added. Busy waits x number of micro seconds.
18005 + *! 12-Nov-1999 kc: Modified UTIL_CmdLineToArgs for use by different tests.
18006 + *! 02-Nov-1999 kc: Removed parameter from UTIL_CDTestDll.
18007 + *! 29-Oct-1999 kc: Cleaned up for code review.
18008 + *! 08-Oct-1999 kc: Renamed UTIL_TestDllExec to UTIL_CDTestDll; added
18009 + *! UTIL_CmdLineToArgs(); added isspace private func.
18010 + *! 26-Dec-1996 cr: Created from misc pieces of wcd95.c, ktest.c.
18012 + */
18014 +#ifndef _UTIL_H
18015 +#define _UTIL_H
18017 +#include <linux/delay.h>
18018 +#include <linux/sched.h>
18020 +#include <utildefs.h>
18023 + * ======== UTIL_CDTestDll ========
18024 + * Purpose:
18025 + * Provides test entry point in class driver context.
18026 + * Parameters:
18027 + * cArgc: test module command line input count.
18028 + * ppArgv: test module command line args.
18029 + * Returns:
18030 + * 0 if successful, a negative value otherwise.
18031 + * Requires:
18032 + * UTIL initialized.
18033 + * Ensures:
18034 + */
18035 + extern u32 UTIL_CDTestDll(IN s32 cArgc, IN char **ppArgv);
18038 + * ======== UTIL_CmdLineToArgs ========
18039 + * Purpose:
18040 + * This function re-creates C-style cmd line argc & argv from WinMain()
18041 + * cmd line args.
18042 + * Parameters:
18043 + * s8 *pszProgName - The name of the program currently being executed.
18044 + * s8 *argv[] - The argument vector.
18045 + * s8 *pCmdLine - The pointer to the command line.
18046 + * bool fHasProgName - Indicats whether a program name is supplied.
18047 + * Returns:
18048 + * Returns the number of arguments found.
18049 + * Requires:
18050 + * UTIL initialized.
18051 + * Ensures:
18052 + */
18053 + extern s32 UTIL_CmdLineToArgs(IN char *pszProgName,
18054 + IN char *argv[UTIL_MAXARGVS],
18055 + IN char *pCmdLine, IN bool fHasProgName);
18058 + * ======== UTIL_Exit ========
18059 + * Purpose:
18060 + * Discontinue usage of module; free resources when reference count
18061 + * reaches 0.
18062 + * Parameters:
18063 + * Returns:
18064 + * Requires:
18065 + * UTIL initialized.
18066 + * Ensures:
18067 + * Resources used by module are freed when cRef reaches zero.
18068 + */
18069 + extern inline void UTIL_Exit(void)
18073 + * ======== UTIL_GetSysInfo ========
18074 + * Purpose:
18075 + * This function return platform specific system information.
18077 + * Parameters:
18078 + * pSysInfo - address to store the system information.
18079 + * Returns:
18080 + * DSP_SOK
18081 + * S_FAIL
18082 + * Requires:
18083 + * UTIL initialized.
18084 + * pSysInfo != NULL
18085 + * Ensures:
18086 + */
18087 + extern DSP_STATUS UTIL_GetSysInfo(OUT struct UTIL_SYSINFO *pSysInfo);
18090 + * ======== UTIL_Init ========
18091 + * Purpose:
18092 + * Initializes private state of UTIL module.
18093 + * Parameters:
18094 + * Returns:
18095 + * TRUE if success, else FALSE.
18096 + * Requires:
18097 + * Ensures:
18098 + * UTIL initialized.
18099 + */
18100 + extern inline bool UTIL_Init(void)
18102 + return true;
18106 + * ======== UTIL_Wait ========
18107 + * Purpose:
18108 + * This fucntion busy waits given a certain number of micro seconds
18109 + * independent of the processor speed. This is acheived by the
18110 + * OEM functions QueryPerformanceCounter and QueryPerformanceFrequency.
18111 + * Parameters:
18112 + * u32 Number of Micro seconds to busy wait
18113 + * Returns:
18114 + * Nothing
18115 + * Requires:
18116 + * UTIL_Initalized.
18117 + * Ensures:
18118 + * Busy waits x Micro seconds or Sleeps X milli seconds; in that
18119 + * case, it is a blocking call there will be a context switching
18120 + * hence it may not represent the absolute busy wait time.
18121 + */
18122 + extern inline void UTIL_Wait(IN u32 dwMicroSeconds)
18124 + if (dwMicroSeconds / 1000 <= 1) {
18125 + /* <= 1 millisecond delay */
18126 + udelay(dwMicroSeconds);
18127 + } else if (dwMicroSeconds * HZ / 1000000 <= 1) {
18128 + /* <= 10 millisecond delay */
18129 + mdelay(dwMicroSeconds / 1000);
18130 + } else {
18131 + /* > 10 millisecond delay */
18132 + set_current_state(TASK_INTERRUPTIBLE);
18133 + schedule_timeout(dwMicroSeconds * HZ / 1000000);
18137 +#endif /* _UTIL_H */
18138 Index: lk/arch/arm/plat-omap/include/bridge/utildefs.h
18139 ===================================================================
18140 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
18141 +++ lk/arch/arm/plat-omap/include/bridge/utildefs.h 2008-08-18 10:38:34.000000000 +0300
18142 @@ -0,0 +1,51 @@
18144 + * arch/arm/plat-omap/include/bridge/utildefs.h
18146 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
18148 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
18150 + * This package is free software; you can redistribute it and/or modify
18151 + * it under the terms of the GNU General Public License version 2 as
18152 + * published by the Free Software Foundation.
18154 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18155 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18156 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18157 + */
18161 + * ======== utildefs.h ========
18162 + * Purpose:
18163 + * Global UTIL constants and types, shared between WCD and DSPSYS.
18165 + *! Revision History:
18166 + *! ================
18167 + *! 24-Feb-2003 kc Removed wIOPort* entries from UTIL_HOSTCONFIG.
18168 + *! 12-Aug-2000 ag Added UTIL_SYSINFO typedef.
18169 + *! 08-Oct-1999 rr Adopted for WinCE where test fxns will be added in util.h
18170 + *! 26-Dec-1996 cr Created.
18171 + */
18173 +#ifndef UTILDEFS_
18174 +#define UTILDEFS_
18176 +/* constants taken from configmg.h */
18177 +#define UTIL_MAXMEMREGS 9
18178 +#define UTIL_MAXIOPORTS 20
18179 +#define UTIL_MAXIRQS 7
18180 +#define UTIL_MAXDMACHNLS 7
18182 +/* misc. constants */
18183 +#define UTIL_MAXARGVS 10
18185 +/* Platform specific important info */
18186 + struct UTIL_SYSINFO {
18187 + /* Granularity of page protection; usually 1k or 4k */
18188 + u32 dwPageSize;
18189 + u32 dwAllocationGranularity; /* VM granularity, usually 64K */
18190 + u32 dwNumberOfProcessors; /* Used as sanity check */
18191 + } ;
18193 +#endif /* UTILDEFS_ */
18194 Index: lk/arch/arm/plat-omap/include/bridge/uuidutil.h
18195 ===================================================================
18196 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
18197 +++ lk/arch/arm/plat-omap/include/bridge/uuidutil.h 2008-08-18 10:38:34.000000000 +0300
18198 @@ -0,0 +1,74 @@
18200 + * arch/arm/plat-omap/include/bridge/uuidutil.h
18202 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
18204 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
18206 + * This package is free software; you can redistribute it and/or modify
18207 + * it under the terms of the GNU General Public License version 2 as
18208 + * published by the Free Software Foundation.
18210 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18211 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18212 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18213 + */
18217 + * ======== uuidutil.h ========
18218 + * Description:
18219 + * This file contains the specification of UUID helper functions.
18221 + *! Revision History
18222 + *! ================
18223 + *! 09-Nov-2000 kc: Modified description of UUID utility functions.
18224 + *! 29-Sep-2000 kc: Appended "UUID_" prefix to UUID helper functions.
18225 + *! 10-Aug-2000 kc: Created.
18226 + *!
18227 + */
18229 +#ifndef UUIDUTIL_
18230 +#define UUIDUTIL_
18232 +#define MAXUUIDLEN 37
18235 + * ======== UUID_UuidToString ========
18236 + * Purpose:
18237 + * Converts a DSP_UUID to an ANSI string.
18238 + * Parameters:
18239 + * pUuid: Pointer to a DSP_UUID object.
18240 + * pszUuid: Pointer to a buffer to receive a NULL-terminated UUID
18241 + * string.
18242 + * size: Maximum size of the pszUuid string.
18243 + * Returns:
18244 + * Requires:
18245 + * pUuid & pszUuid are non-NULL values.
18246 + * Ensures:
18247 + * Lenghth of pszUuid is less than MAXUUIDLEN.
18248 + * Details:
18249 + * UUID string limit currently set at MAXUUIDLEN.
18250 + */
18251 + void UUID_UuidToString(IN struct DSP_UUID *pUuid, OUT char *pszUuid,
18252 + s32 size);
18255 + * ======== UUID_UuidFromString ========
18256 + * Purpose:
18257 + * Converts an ANSI string to a DSP_UUID.
18258 + * Parameters:
18259 + * pszUuid: Pointer to a string that represents a DSP_UUID object.
18260 + * pUuid: Pointer to a DSP_UUID object.
18261 + * Returns:
18262 + * Requires:
18263 + * pUuid & pszUuid are non-NULL values.
18264 + * Ensures:
18265 + * Details:
18266 + * We assume the string representation of a UUID has the following format:
18267 + * "12345678_1234_1234_1234_123456789abc".
18268 + */
18269 + extern void UUID_UuidFromString(IN char *pszUuid,
18270 + OUT struct DSP_UUID *pUuid);
18272 +#endif /* UUIDUTIL_ */
18273 Index: lk/arch/arm/plat-omap/include/bridge/wcd.h
18274 ===================================================================
18275 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
18276 +++ lk/arch/arm/plat-omap/include/bridge/wcd.h 2008-08-18 10:38:34.000000000 +0300
18277 @@ -0,0 +1,61 @@
18279 + * arch/arm/plat-omap/include/bridge/wcd.h
18281 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
18283 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
18285 + * This package is free software; you can redistribute it and/or modify
18286 + * it under the terms of the GNU General Public License version 2 as
18287 + * published by the Free Software Foundation.
18289 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18290 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18291 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18292 + */
18296 + * ======== wcd.h ========
18297 + * Description:
18298 + * 'Bridge class driver library functions, object definitions, and
18299 + * return error/status codes. To be included by 'Bridge mini drivers.
18301 + * Public Functions:
18302 + * See mem.h and dbg.h.
18304 + * Notes:
18305 + * 'Bridge Class Driver services exported to WMD's are initialized by the
18306 + * WCD on behalf of the WMD. WMD's must not call module Init/Exit
18307 + * functions.
18309 + * To ensure WMD binary compatibility across different platforms,
18310 + * for the same processor, a WMD must restrict its usage of system
18311 + * services to those exported by the 'Bridge class library.
18313 + *! Revision History:
18314 + *! ================
18315 + *! 07-Jun-2000 jeh Added dev.h
18316 + *! 01-Nov-1999 ag: #WINCE# WCD_MAJOR_VERSION=8 & WCD_MINOR_VERSION=0 to match
18317 + *! dll stamps.
18318 + *! 0.80 - 0.89 Alpha, 0.90 - 0.99 Beta, 1.00 - 1.10 FCS.
18319 + *! 17-Sep-1997 gp: Changed size of CFG_HOSTRES structure; and ISR_Install API;
18320 + *! Changed WCD_MINOR_VERSION 3 -> 4.
18321 + *! 15-Sep-1997 gp: Moved WCD_(Un)registerMinidriver to drv.
18322 + *! 25-Jul-1997 cr: Added WCD_UnregisterMinidriver.
18323 + *! 22-Jul-1997 cr: Added WCD_RegisterMinidriver, WCD_MINOR_VERSION 2 -> 3.
18324 + *! 12-Nov-1996 gp: Defined port io macros.
18325 + *! 07-Nov-1996 gp: Updated for code review.
18326 + *! 16-Jul-1996 gp: Added CHNL fxns; updated WCD lib version to 2.
18327 + *! 10-May-1996 gp: Separated WMD def.s' into wmd.h.
18328 + *! 03-May-1996 gp: Created.
18329 + */
18331 +#ifndef WCD_
18332 +#define WCD_
18334 +/* This WCD Library Version: */
18335 +#define WCD_MAJOR_VERSION (u32)8 /* .8x - Alpha, .9x - Beta, 1.x FCS */
18336 +#define WCD_MINOR_VERSION (u32)0
18338 +#endif /* WCD_ */
18339 Index: lk/arch/arm/plat-omap/include/bridge/wcdioctl.h
18340 ===================================================================
18341 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
18342 +++ lk/arch/arm/plat-omap/include/bridge/wcdioctl.h 2008-08-18 10:38:34.000000000 +0300
18343 @@ -0,0 +1,518 @@
18345 + * arch/arm/plat-omap/include/bridge/wcdioctl.h
18347 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
18349 + * Copyright (C) 2008 Texas Instruments, Inc.
18351 + * This package is free software; you can redistribute it and/or modify
18352 + * it under the terms of the GNU General Public License version 2 as
18353 + * published by the Free Software Foundation.
18355 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18356 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18357 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18358 + */
18362 + * ======== wcdioctl.h ========
18363 + * Purpose:
18364 + * Contains structures and commands that are used for interaction
18365 + * between the DDSP API and class driver.
18367 + *! Revision History
18368 + *! ================
18369 + *! 19-Apr-2004 sb Aligned DMM definitions with Symbian
18370 + *! 08-Mar-2004 sb Added the Dynamic Memory Mapping structs & offsets
18371 + *! 15-Oct-2002 kc Updated definitions for private PERF module.
18372 + *! 16-Aug-2002 map Added ARGS_MGR_REGISTEROBJECT & ARGS_MGR_UNREGISTEROBJECT
18373 + *! Added CMD_MGR_REGISTEROBJECT_OFFSET &
18374 + *! CMD_MGR_UNREGISTEROBJECT_OFFSET
18375 + *! 15-Jan-2002 ag Added actaul bufSize to ARGS_STRM_[RECLAIM][ISSUE].
18376 + *! 15-Nov-2001 ag change to STRMINFO in ARGS_STRM_GETINFO.
18377 + *! 11-Sep-2001 ag ARGS_CMM_GETHANDLE defn uses DSP_HPROCESSOR.
18378 + *! 23-Apr-2001 jeh Added pStatus to NODE_TERMINATE args.
18379 + *! 13-Feb-2001 kc DSP/BIOS Bridge name updates.
18380 + *! 22-Nov-2000 kc: Added CMD_MGR_GETPERF_DATA_OFFSET for acquiring PERF stats.
18381 + *! 27-Oct-2000 jeh Added timeouts to NODE_GETMESSAGE, NODE_PUTMESSAGE args.
18382 + *! Removed NODE_GETMESSAGESTRM args.
18383 + *! 11-Oct-2000 ag: Added SM mgr(CMM) args.
18384 + *! 27-Sep-2000 jeh Removed struct DSP_BUFFERATTR param from
18385 + *! ARGS_STRM_ALLOCATEBUFFER.
18386 + *! 25-Sep-2000 rr: Updated to Version 0.9
18387 + *! 07-Sep-2000 jeh Changed HANDLE to DSP_HNOTIFICATION in RegisterNotify args.
18388 + *! Added DSP_STRMATTR to DSPNode_Connect args.
18389 + *! 04-Aug-2000 rr: MEM and UTIL added to RM.
18390 + *! 27-Jul-2000 rr: NODE, MGR,STRM and PROC added
18391 + *! 27-Jun-2000 rr: Modifed to Use either PM or DSP/BIOS Bridge
18392 + *! IFDEF to build for PM or DSP/BIOS Bridge
18393 + *! 28-Jan-2000 rr: NT_CMD_FROM_OFFSET moved out to dsptrap.h
18394 + *! 24-Jan-2000 rr: Merged with Scott's code.
18395 + *! 21-Jan-2000 sg: In ARGS_CHNL_GETMODE changed mode to be u32 to be
18396 + *! consistent with chnldefs.h.
18397 + *! 11-Jan-2000 rr: CMD_CFG_GETCDVERSION_OFFSET added.
18398 + *! 12-Nov-1999 rr: CMD_BRD_MONITOR_OFFSET added
18399 + *! 09-Nov-1999 kc: Added MEMRY and enabled CMD_BRD_IOCTL_OFFSET.
18400 + *! 05-Nov-1999 ag: Added CHNL.
18401 + *! 02-Nov-1999 kc: Removed field from ARGS_UTIL_TESTDLL.
18402 + *! 29-Oct-1999 kc: Cleaned up for code review.
18403 + *! 08-Oct-1999 rr: Util control offsets added.
18404 + *! 13-Sep-1999 kc: Added ARGS_UTIL_TESTDLL for PM test infrastructure.
18405 + *! 19-Aug-1999 rr: Created from WSX. Minimal Implementaion of BRD_Start and BRD
18406 + *! and BRD_Stop. IOCTL Offsets and CTRL Code.
18407 + */
18409 +#ifndef WCDIOCTL_
18410 +#define WCDIOCTL_
18412 +#include <mem.h>
18413 +#include <cmm.h>
18414 +#include <strmdefs.h>
18415 +#include <dbdcd.h>
18417 +union Trapped_Args {
18419 + /* MGR Module */
18420 + struct {
18421 + u32 uNode;
18422 + struct DSP_NDBPROPS *pNDBProps;
18423 + u32 uNDBPropsSize;
18424 + u32 *puNumNodes;
18425 + } ARGS_MGR_ENUMNODE_INFO;
18427 + struct {
18428 + u32 uProcessor;
18429 + struct DSP_PROCESSORINFO *pProcessorInfo;
18430 + u32 uProcessorInfoSize;
18431 + u32 *puNumProcs;
18432 + } ARGS_MGR_ENUMPROC_INFO;
18434 + struct {
18435 + struct DSP_UUID *pUuid;
18436 + enum DSP_DCDOBJTYPE objType;
18437 + char *pszPathName;
18438 + } ARGS_MGR_REGISTEROBJECT;
18440 + struct {
18441 + struct DSP_UUID *pUuid;
18442 + enum DSP_DCDOBJTYPE objType;
18443 + } ARGS_MGR_UNREGISTEROBJECT;
18445 + struct {
18446 + struct DSP_NOTIFICATION **aNotifications;
18447 + u32 uCount;
18448 + u32 *puIndex;
18449 + u32 uTimeout;
18450 + } ARGS_MGR_WAIT;
18452 + /* PROC Module */
18453 + struct {
18454 + u32 uProcessor;
18455 + struct DSP_PROCESSORATTRIN *pAttrIn;
18456 + DSP_HPROCESSOR *phProcessor;
18457 + } ARGS_PROC_ATTACH;
18459 + struct {
18460 + DSP_HPROCESSOR hProcessor;
18461 + u32 dwCmd;
18462 + struct DSP_CBDATA *pArgs;
18463 + } ARGS_PROC_CTRL;
18465 + struct {
18466 + DSP_HPROCESSOR hProcessor;
18467 + } ARGS_PROC_DETACH;
18469 + struct {
18470 + DSP_HPROCESSOR hProcessor;
18471 + DSP_HNODE *aNodeTab;
18472 + u32 uNodeTabSize;
18473 + u32 *puNumNodes;
18474 + u32 *puAllocated;
18475 + } ARGS_PROC_ENUMNODE_INFO;
18477 + struct {
18478 + DSP_HPROCESSOR hProcessor;
18479 + u32 uResourceType;
18480 + struct DSP_RESOURCEINFO *pResourceInfo;
18481 + u32 uResourceInfoSize;
18482 + } ARGS_PROC_ENUMRESOURCES;
18484 + struct {
18485 + DSP_HPROCESSOR hProcessor;
18486 + struct DSP_PROCESSORSTATE *pProcStatus;
18487 + u32 uStateInfoSize;
18488 + } ARGS_PROC_GETSTATE;
18490 + struct {
18491 + DSP_HPROCESSOR hProcessor;
18492 + u8 *pBuf;
18494 + #ifndef RES_CLEANUP_DISABLE
18495 + u8 *pSize;
18496 + #endif
18497 + u32 uMaxSize;
18498 + } ARGS_PROC_GETTRACE;
18500 + struct {
18501 + DSP_HPROCESSOR hProcessor;
18502 + s32 iArgc;
18503 + char **aArgv;
18504 + char **aEnvp;
18505 + } ARGS_PROC_LOAD;
18507 + struct {
18508 + DSP_HPROCESSOR hProcessor;
18509 + u32 uEventMask;
18510 + u32 uNotifyType;
18511 + struct DSP_NOTIFICATION *hNotification;
18512 + } ARGS_PROC_REGISTER_NOTIFY;
18514 + struct {
18515 + DSP_HPROCESSOR hProcessor;
18516 + } ARGS_PROC_START;
18518 + struct {
18519 + DSP_HPROCESSOR hProcessor;
18520 + u32 ulSize;
18521 + void **ppRsvAddr;
18522 + } ARGS_PROC_RSVMEM;
18524 + struct {
18525 + DSP_HPROCESSOR hProcessor;
18526 + u32 ulSize;
18527 + void *pRsvAddr;
18528 + } ARGS_PROC_UNRSVMEM;
18530 + struct {
18531 + DSP_HPROCESSOR hProcessor;
18532 + void *pMpuAddr;
18533 + u32 ulSize;
18534 + void *pReqAddr;
18535 + void **ppMapAddr;
18536 + u32 ulMapAttr;
18537 + } ARGS_PROC_MAPMEM;
18539 + struct {
18540 + DSP_HPROCESSOR hProcessor;
18541 + u32 ulSize;
18542 + void *pMapAddr;
18543 + } ARGS_PROC_UNMAPMEM;
18545 + struct {
18546 + DSP_HPROCESSOR hProcessor;
18547 + void *pMpuAddr;
18548 + u32 ulSize;
18549 + u32 ulFlags;
18550 + } ARGS_PROC_FLUSHMEMORY;
18552 + struct {
18553 + DSP_HPROCESSOR hProcessor;
18554 + } ARGS_PROC_STOP;
18556 + struct {
18557 + DSP_HPROCESSOR hProcessor;
18558 + void *pMpuAddr;
18559 + u32 ulSize;
18560 + } ARGS_PROC_INVALIDATEMEMORY;
18563 + /* NODE Module */
18564 + struct {
18565 + DSP_HPROCESSOR hProcessor;
18566 + struct DSP_UUID *pNodeID;
18567 + struct DSP_CBDATA *pArgs;
18568 + struct DSP_NODEATTRIN *pAttrIn;
18569 + DSP_HNODE *phNode;
18570 + } ARGS_NODE_ALLOCATE;
18572 + struct {
18573 + DSP_HNODE hNode;
18574 + u32 uSize;
18575 + struct DSP_BUFFERATTR *pAttr;
18576 + u8 **pBuffer;
18577 + } ARGS_NODE_ALLOCMSGBUF;
18579 + struct {
18580 + DSP_HNODE hNode;
18581 + s32 iPriority;
18582 + } ARGS_NODE_CHANGEPRIORITY;
18584 + struct {
18585 + DSP_HNODE hNode;
18586 + u32 uStream;
18587 + DSP_HNODE hOtherNode;
18588 + u32 uOtherStream;
18589 + struct DSP_STRMATTR *pAttrs;
18590 + struct DSP_CBDATA *pConnParam;
18591 + } ARGS_NODE_CONNECT;
18593 + struct {
18594 + DSP_HNODE hNode;
18595 + } ARGS_NODE_CREATE;
18597 + struct {
18598 + DSP_HNODE hNode;
18599 + } ARGS_NODE_DELETE;
18601 + struct {
18602 + DSP_HNODE hNode;
18603 + struct DSP_BUFFERATTR *pAttr;
18604 + u8 *pBuffer;
18605 + } ARGS_NODE_FREEMSGBUF;
18607 + struct {
18608 + DSP_HNODE hNode;
18609 + struct DSP_NODEATTR *pAttr;
18610 + u32 uAttrSize;
18611 + } ARGS_NODE_GETATTR;
18613 + struct {
18614 + DSP_HNODE hNode;
18615 + struct DSP_MSG *pMessage;
18616 + u32 uTimeout;
18617 + } ARGS_NODE_GETMESSAGE;
18619 + struct {
18620 + DSP_HNODE hNode;
18621 + } ARGS_NODE_PAUSE;
18623 + struct {
18624 + DSP_HNODE hNode;
18625 + struct DSP_MSG *pMessage;
18626 + u32 uTimeout;
18627 + } ARGS_NODE_PUTMESSAGE;
18629 + struct {
18630 + DSP_HNODE hNode;
18631 + u32 uEventMask;
18632 + u32 uNotifyType;
18633 + struct DSP_NOTIFICATION *hNotification;
18634 + } ARGS_NODE_REGISTERNOTIFY;
18636 + struct {
18637 + DSP_HNODE hNode;
18638 + } ARGS_NODE_RUN;
18640 + struct {
18641 + DSP_HNODE hNode;
18642 + DSP_STATUS *pStatus;
18643 + } ARGS_NODE_TERMINATE;
18645 + struct {
18646 + DSP_HPROCESSOR hProcessor;
18647 + struct DSP_UUID *pNodeID;
18648 + struct DSP_NDBPROPS *pNodeProps;
18649 + } ARGS_NODE_GETUUIDPROPS;
18651 + /* STRM module */
18653 + struct {
18654 + DSP_HSTREAM hStream;
18655 + u32 uSize;
18656 + u8 **apBuffer;
18657 + u32 uNumBufs;
18658 + } ARGS_STRM_ALLOCATEBUFFER;
18660 + struct {
18661 + DSP_HSTREAM hStream;
18662 + } ARGS_STRM_CLOSE;
18664 + struct {
18665 + DSP_HSTREAM hStream;
18666 + u8 **apBuffer;
18667 + u32 uNumBufs;
18668 + } ARGS_STRM_FREEBUFFER;
18670 + struct {
18671 + DSP_HSTREAM hStream;
18672 + HANDLE *phEvent;
18673 + } ARGS_STRM_GETEVENTHANDLE;
18675 + struct {
18676 + DSP_HSTREAM hStream;
18677 + struct STRM_INFO *pStreamInfo;
18678 + u32 uStreamInfoSize;
18679 + } ARGS_STRM_GETINFO;
18681 + struct {
18682 + DSP_HSTREAM hStream;
18683 + bool bFlush;
18684 + } ARGS_STRM_IDLE;
18686 + struct {
18687 + DSP_HSTREAM hStream;
18688 + u8 *pBuffer;
18689 + u32 dwBytes;
18690 + u32 dwBufSize;
18691 + u32 dwArg;
18692 + } ARGS_STRM_ISSUE;
18694 + struct {
18695 + DSP_HNODE hNode;
18696 + u32 uDirection;
18697 + u32 uIndex;
18698 + struct STRM_ATTR *pAttrIn;
18699 + DSP_HSTREAM *phStream;
18700 + } ARGS_STRM_OPEN;
18702 + struct {
18703 + DSP_HSTREAM hStream;
18704 + u8 **pBufPtr;
18705 + u32 *pBytes;
18706 + u32 *pBufSize;
18707 + u32 *pdwArg;
18708 + } ARGS_STRM_RECLAIM;
18710 + struct {
18711 + DSP_HSTREAM hStream;
18712 + u32 uEventMask;
18713 + u32 uNotifyType;
18714 + struct DSP_NOTIFICATION *hNotification;
18715 + } ARGS_STRM_REGISTERNOTIFY;
18717 + struct {
18718 + DSP_HSTREAM *aStreamTab;
18719 + u32 nStreams;
18720 + u32 *pMask;
18721 + u32 uTimeout;
18722 + } ARGS_STRM_SELECT;
18724 + /* CMM Module */
18725 + struct {
18726 + struct CMM_OBJECT *hCmmMgr;
18727 + u32 uSize;
18728 + struct CMM_ATTRS *pAttrs;
18729 + OUT void **ppBufVA;
18730 + } ARGS_CMM_ALLOCBUF;
18732 + struct {
18733 + struct CMM_OBJECT *hCmmMgr;
18734 + void *pBufPA;
18735 + u32 ulSegId;
18736 + } ARGS_CMM_FREEBUF;
18738 + struct {
18739 + DSP_HPROCESSOR hProcessor;
18740 + struct CMM_OBJECT **phCmmMgr;
18741 + } ARGS_CMM_GETHANDLE;
18743 + struct {
18744 + struct CMM_OBJECT *hCmmMgr;
18745 + struct CMM_INFO *pCmmInfo;
18746 + } ARGS_CMM_GETINFO;
18748 + /* MEM Module */
18749 + struct {
18750 + u32 cBytes;
18751 + enum MEM_POOLATTRS type;
18752 + void *pMem;
18753 + } ARGS_MEM_ALLOC;
18755 + struct {
18756 + u32 cBytes;
18757 + enum MEM_POOLATTRS type;
18758 + void *pMem;
18759 + } ARGS_MEM_CALLOC;
18761 + struct {
18762 + void *pMem;
18763 + } ARGS_MEM_FREE;
18765 + struct {
18766 + void *pBuffer;
18767 + u32 cSize;
18768 + void *pLockedBuffer;
18769 + } ARGS_MEM_PAGELOCK;
18771 + struct {
18772 + void *pBuffer;
18773 + u32 cSize;
18774 + } ARGS_MEM_PAGEUNLOCK;
18776 + /* UTIL module */
18777 + struct {
18778 + s32 cArgc;
18779 + char **ppArgv;
18780 + } ARGS_UTIL_TESTDLL;
18781 +} ;
18783 +#define CMD_BASE 1
18785 +/* MGR module offsets */
18786 +#define CMD_MGR_BASE_OFFSET CMD_BASE
18787 +#define CMD_MGR_ENUMNODE_INFO_OFFSET (CMD_MGR_BASE_OFFSET + 0)
18788 +#define CMD_MGR_ENUMPROC_INFO_OFFSET (CMD_MGR_BASE_OFFSET + 1)
18789 +#define CMD_MGR_REGISTEROBJECT_OFFSET (CMD_MGR_BASE_OFFSET + 2)
18790 +#define CMD_MGR_UNREGISTEROBJECT_OFFSET (CMD_MGR_BASE_OFFSET + 3)
18791 +#define CMD_MGR_WAIT_OFFSET (CMD_MGR_BASE_OFFSET + 4)
18793 +#ifndef RES_CLEANUP_DISABLE
18794 +#define CMD_MGR_RESOUCES_OFFSET (CMD_MGR_BASE_OFFSET + 5)
18795 +#define CMD_MGR_END_OFFSET CMD_MGR_RESOUCES_OFFSET
18796 +#else
18797 +#define CMD_MGR_END_OFFSET CMD_MGR_WAIT_OFFSET
18798 +#endif
18800 +#define CMD_PROC_BASE_OFFSET (CMD_MGR_END_OFFSET + 1)
18801 +#define CMD_PROC_ATTACH_OFFSET (CMD_PROC_BASE_OFFSET + 0)
18802 +#define CMD_PROC_CTRL_OFFSET (CMD_PROC_BASE_OFFSET + 1)
18803 +#define CMD_PROC_DETACH_OFFSET (CMD_PROC_BASE_OFFSET + 2)
18804 +#define CMD_PROC_ENUMNODE_OFFSET (CMD_PROC_BASE_OFFSET + 3)
18805 +#define CMD_PROC_ENUMRESOURCES_OFFSET (CMD_PROC_BASE_OFFSET + 4)
18806 +#define CMD_PROC_GETSTATE_OFFSET (CMD_PROC_BASE_OFFSET + 5)
18807 +#define CMD_PROC_GETTRACE_OFFSET (CMD_PROC_BASE_OFFSET + 6)
18808 +#define CMD_PROC_LOAD_OFFSET (CMD_PROC_BASE_OFFSET + 7)
18809 +#define CMD_PROC_REGISTERNOTIFY_OFFSET (CMD_PROC_BASE_OFFSET + 8)
18810 +#define CMD_PROC_START_OFFSET (CMD_PROC_BASE_OFFSET + 9)
18811 +#define CMD_PROC_RSVMEM_OFFSET (CMD_PROC_BASE_OFFSET + 10)
18812 +#define CMD_PROC_UNRSVMEM_OFFSET (CMD_PROC_BASE_OFFSET + 11)
18813 +#define CMD_PROC_MAPMEM_OFFSET (CMD_PROC_BASE_OFFSET + 12)
18814 +#define CMD_PROC_UNMAPMEM_OFFSET (CMD_PROC_BASE_OFFSET + 13)
18815 +#define CMD_PROC_FLUSHMEMORY_OFFSET (CMD_PROC_BASE_OFFSET + 14)
18816 +#define CMD_PROC_STOP_OFFSET (CMD_PROC_BASE_OFFSET + 15)
18817 +#define CMD_PROC_INVALIDATEMEMORY_OFFSET (CMD_PROC_BASE_OFFSET + 16)
18818 +#define CMD_PROC_END_OFFSET CMD_PROC_INVALIDATEMEMORY_OFFSET
18821 +#define CMD_NODE_BASE_OFFSET (CMD_PROC_END_OFFSET + 1)
18822 +#define CMD_NODE_ALLOCATE_OFFSET (CMD_NODE_BASE_OFFSET + 0)
18823 +#define CMD_NODE_ALLOCMSGBUF_OFFSET (CMD_NODE_BASE_OFFSET + 1)
18824 +#define CMD_NODE_CHANGEPRIORITY_OFFSET (CMD_NODE_BASE_OFFSET + 2)
18825 +#define CMD_NODE_CONNECT_OFFSET (CMD_NODE_BASE_OFFSET + 3)
18826 +#define CMD_NODE_CREATE_OFFSET (CMD_NODE_BASE_OFFSET + 4)
18827 +#define CMD_NODE_DELETE_OFFSET (CMD_NODE_BASE_OFFSET + 5)
18828 +#define CMD_NODE_FREEMSGBUF_OFFSET (CMD_NODE_BASE_OFFSET + 6)
18829 +#define CMD_NODE_GETATTR_OFFSET (CMD_NODE_BASE_OFFSET + 7)
18830 +#define CMD_NODE_GETMESSAGE_OFFSET (CMD_NODE_BASE_OFFSET + 8)
18831 +#define CMD_NODE_PAUSE_OFFSET (CMD_NODE_BASE_OFFSET + 9)
18832 +#define CMD_NODE_PUTMESSAGE_OFFSET (CMD_NODE_BASE_OFFSET + 10)
18833 +#define CMD_NODE_REGISTERNOTIFY_OFFSET (CMD_NODE_BASE_OFFSET + 11)
18834 +#define CMD_NODE_RUN_OFFSET (CMD_NODE_BASE_OFFSET + 12)
18835 +#define CMD_NODE_TERMINATE_OFFSET (CMD_NODE_BASE_OFFSET + 13)
18836 +#define CMD_NODE_GETUUIDPROPS_OFFSET (CMD_NODE_BASE_OFFSET + 14)
18837 +#define CMD_NODE_END_OFFSET CMD_NODE_GETUUIDPROPS_OFFSET
18839 +#define CMD_STRM_BASE_OFFSET (CMD_NODE_END_OFFSET + 1)
18840 +#define CMD_STRM_ALLOCATEBUFFER_OFFSET (CMD_STRM_BASE_OFFSET + 0)
18841 +#define CMD_STRM_CLOSE_OFFSET (CMD_STRM_BASE_OFFSET + 1)
18842 +#define CMD_STRM_FREEBUFFER_OFFSET (CMD_STRM_BASE_OFFSET + 2)
18843 +#define CMD_STRM_GETEVENTHANDLE_OFFSET (CMD_STRM_BASE_OFFSET + 3)
18844 +#define CMD_STRM_GETINFO_OFFSET (CMD_STRM_BASE_OFFSET + 4)
18845 +#define CMD_STRM_IDLE_OFFSET (CMD_STRM_BASE_OFFSET + 5)
18846 +#define CMD_STRM_ISSUE_OFFSET (CMD_STRM_BASE_OFFSET + 6)
18847 +#define CMD_STRM_OPEN_OFFSET (CMD_STRM_BASE_OFFSET + 7)
18848 +#define CMD_STRM_RECLAIM_OFFSET (CMD_STRM_BASE_OFFSET + 8)
18849 +#define CMD_STRM_REGISTERNOTIFY_OFFSET (CMD_STRM_BASE_OFFSET + 9)
18850 +#define CMD_STRM_SELECT_OFFSET (CMD_STRM_BASE_OFFSET + 10)
18851 +#define CMD_STRM_END_OFFSET CMD_STRM_SELECT_OFFSET
18853 +/* Communication Memory Manager (UCMM) */
18854 +#define CMD_CMM_BASE_OFFSET (CMD_STRM_END_OFFSET + 1)
18855 +#define CMD_CMM_ALLOCBUF_OFFSET (CMD_CMM_BASE_OFFSET + 0)
18856 +#define CMD_CMM_FREEBUF_OFFSET (CMD_CMM_BASE_OFFSET + 1)
18857 +#define CMD_CMM_GETHANDLE_OFFSET (CMD_CMM_BASE_OFFSET + 2)
18858 +#define CMD_CMM_GETINFO_OFFSET (CMD_CMM_BASE_OFFSET + 3)
18859 +#define CMD_CMM_END_OFFSET CMD_CMM_GETINFO_OFFSET
18861 +#endif /* WCDIOCTL_ */
18862 Index: lk/arch/arm/plat-omap/include/bridge/wmd.h
18863 ===================================================================
18864 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
18865 +++ lk/arch/arm/plat-omap/include/bridge/wmd.h 2008-08-18 10:38:34.000000000 +0300
18866 @@ -0,0 +1,1193 @@
18868 + * arch/arm/plat-omap/include/bridge/wmd.h
18870 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
18872 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
18874 + * This package is free software; you can redistribute it and/or modify
18875 + * it under the terms of the GNU General Public License version 2 as
18876 + * published by the Free Software Foundation.
18878 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18879 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18880 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18881 + */
18885 + * ======== wmd.h ========
18886 + * Purpose:
18887 + * 'Bridge mini driver entry point and interface function declarations.
18889 + * Public Functions:
18890 + * WMD_DRV_Entry
18892 + * Notes:
18893 + * The 'Bridge class driver obtains it's function interface to
18894 + * the 'Bridge mini driver via a call to WMD_DRV_Entry().
18896 + * 'Bridge Class Driver services exported to WMD's are initialized by the
18897 + * WCD on behalf of the WMD.
18899 + * WMD function DBC Requires and Ensures are also made by the WCD on
18900 + * behalf of the WMD, to simplify the WMD code.
18902 + *! Revision History:
18903 + *! ================
18904 + *! 19-Apr-2004 sb Aligned DMM definitions with Symbian
18905 + *! 08-Mar-2004 sb Added the Dynamic Memory Mapping APIs - WMD_BRD_MemMap/UnMap
18906 + *! 01-Mar-2004 vp Added filename argument to WMD_DRV_Entry function.
18907 + *! 29-Aug-2002 map Added WMD_BRD_MemWrite()
18908 + *! 26-Aug-2002 map Added WMD_BRD_MemCopy()
18909 + *! 07-Jan-2002 ag Added cBufSize to WMD_CHNL_AddIOReq().
18910 + *! 05-Nov-2001 kc: Added error handling DEH functions.
18911 + *! 06-Dec-2000 jeh Added uEventMask to WMD_MSG_RegisterNotify().
18912 + *! 17-Nov-2000 jeh Added WMD_MSG and WMD_IO definitions.
18913 + *! 01-Nov-2000 jeh Added more error codes to WMD_CHNL_RegisterNotify().
18914 + *! 13-Oct-2000 jeh Added dwArg to WMD_CHNL_AddIOReq(), added WMD_CHNL_IDLE
18915 + *! and WMD_CHNL_RegisterNotify for DSPStream support.
18916 + *! 17-Jan-2000 rr: WMD_BRD_SETSTATE Added.
18917 + *! 30-Jul-1997 gp: Split wmd IOCTL space into reserved and private.
18918 + *! 07-Nov-1996 gp: Updated for code review.
18919 + *! 18-Oct-1996 gp: Added WMD_E_HARDWARE return code from WMD_BRD_Monitor.
18920 + *! 09-Sep-1996 gp: Subtly altered the semantics of WMD_CHNL_GetInfo().
18921 + *! 02-Aug-1996 gp: Ensured on BRD_Start that interrupts to the PC are enabled.
18922 + *! 11-Jul-1996 gp: Added CHNL interface. Note stronger DBC_Require conditions.
18923 + *! 29-May-1996 gp: Removed WCD_ prefix from functions imported from WCD.LIB.
18924 + *! 29-May-1996 gp: Made OUT param first in WMD_DEV_Create().
18925 + *! 09-May-1996 gp: Created.
18926 + */
18928 +#ifndef WMD_
18929 +#define WMD_
18931 +#include <brddefs.h>
18932 +#include <cfgdefs.h>
18933 +#include <chnlpriv.h>
18934 +#include <dehdefs.h>
18935 +#include <devdefs.h>
18936 +#include <iodefs.h>
18937 +#include <msgdefs.h>
18940 + * Any IOCTLS at or above this value are reserved for standard WMD
18941 + * interfaces.
18942 + */
18943 +#define WMD_RESERVEDIOCTLBASE 0x8000
18945 +/* Handle to mini-driver's private device context. */
18946 + struct WMD_DEV_CONTEXT;
18948 +/*---------------------------------------------------------------------------*/
18949 +/* 'Bridge MINI DRIVER FUNCTION TYPES */
18950 +/*---------------------------------------------------------------------------*/
18953 + * ======== WMD_BRD_Monitor ========
18954 + * Purpose:
18955 + * Bring the board to the BRD_IDLE (monitor) state.
18956 + * Parameters:
18957 + * hDevContext: Handle to mini-driver defined device context.
18958 + * Returns:
18959 + * DSP_SOK: Success.
18960 + * WMD_E_HARDWARE: A test of hardware assumptions/integrity failed.
18961 + * WMD_E_TIMEOUT: Timeout occured waiting for a response from hardware.
18962 + * DSP_EFAIL: Other, unspecified error.
18963 + * Requires:
18964 + * hDevContext != NULL
18965 + * Ensures:
18966 + * DSP_SOK: Board is in BRD_IDLE state;
18967 + * else: Board state is indeterminate.
18968 + */
18969 + typedef DSP_STATUS(CDECL
18970 + *WMD_BRD_MONITOR) (struct WMD_DEV_CONTEXT
18971 + *hDevContext);
18974 + * ======== WMD_BRD_SETSTATE ========
18975 + * Purpose:
18976 + * Sets the Mini driver state
18977 + * Parameters:
18978 + * hDevContext: Handle to mini-driver defined device info.
18979 + * ulBrdState: Board state
18980 + * Returns:
18981 + * DSP_SOK: Success.
18982 + * DSP_EFAIL: Other, unspecified error.
18983 + * Requires:
18984 + * hDevContext != NULL;
18985 + * ulBrdState <= BRD_LASTSTATE.
18986 + * Ensures:
18987 + * ulBrdState <= BRD_LASTSTATE.
18988 + * Update the Board state to the specified state.
18989 + */
18990 + typedef DSP_STATUS(CDECL
18991 + *WMD_BRD_SETSTATE) (struct WMD_DEV_CONTEXT
18992 + *hDevContext, u32 ulBrdState);
18995 + * ======== WMD_BRD_Start ========
18996 + * Purpose:
18997 + * Bring board to the BRD_RUNNING (start) state.
18998 + * Parameters:
18999 + * hDevContext: Handle to mini-driver defined device context.
19000 + * dwDSPAddr: DSP address at which to start execution.
19001 + * Returns:
19002 + * DSP_SOK: Success.
19003 + * WMD_E_TIMEOUT: Timeout occured waiting for a response from hardware.
19004 + * DSP_EFAIL: Other, unspecified error.
19005 + * Requires:
19006 + * hDevContext != NULL
19007 + * Board is in monitor (BRD_IDLE) state.
19008 + * Ensures:
19009 + * DSP_SOK: Board is in BRD_RUNNING state.
19010 + * Interrupts to the PC are enabled.
19011 + * else: Board state is indeterminate.
19012 + */
19013 + typedef DSP_STATUS(CDECL *WMD_BRD_START) (struct WMD_DEV_CONTEXT
19014 + *hDevContext, u32 dwDSPAddr);
19017 + * ======== WMD_BRD_MemCopy ========
19018 + * Purpose:
19019 + * Copy memory from one DSP address to another
19020 + * Parameters:
19021 + * pDevContext: Pointer to context handle
19022 + * ulDspDestAddr: DSP address to copy to
19023 + * ulDspSrcAddr: DSP address to copy from
19024 + * ulNumBytes: Number of bytes to copy
19025 + * ulMemType: What section of memory to copy to
19026 + * Returns:
19027 + * DSP_SOK: Success.
19028 + * DSP_EFAIL: Other, unspecified error.
19029 + * Requires:
19030 + * pDevContext != NULL
19031 + * Ensures:
19032 + * DSP_SOK: Board is in BRD_RUNNING state.
19033 + * Interrupts to the PC are enabled.
19034 + * else: Board state is indeterminate.
19035 + */
19036 + typedef DSP_STATUS(CDECL *WMD_BRD_MEMCOPY) (struct WMD_DEV_CONTEXT
19037 + *hDevContext,
19038 + u32 ulDspDestAddr,
19039 + u32 ulDspSrcAddr,
19040 + u32 ulNumBytes, u32 ulMemType);
19042 + * ======== WMD_BRD_MemWrite ========
19043 + * Purpose:
19044 + * Write a block of host memory into a DSP address, into a given memory
19045 + * space. Unlike WMD_BRD_Write, this API does reset the DSP
19046 + * Parameters:
19047 + * hDevContext: Handle to mini-driver defined device info.
19048 + * dwDSPAddr: Address on DSP board (Destination).
19049 + * pHostBuf: Pointer to host buffer (Source).
19050 + * ulNumBytes: Number of bytes to transfer.
19051 + * ulMemType: Memory space on DSP to which to transfer.
19052 + * Returns:
19053 + * DSP_SOK: Success.
19054 + * WMD_E_TIMEOUT: Timeout occured waiting for a response from hardware.
19055 + * DSP_EFAIL: Other, unspecified error.
19056 + * Requires:
19057 + * hDevContext != NULL;
19058 + * pHostBuf != NULL.
19059 + * Ensures:
19060 + */
19061 + typedef DSP_STATUS(CDECL *WMD_BRD_MEMWRITE) (struct WMD_DEV_CONTEXT
19062 + *hDevContext,
19063 + IN u8 *pHostBuf,
19064 + u32 dwDSPAddr, u32 ulNumBytes,
19065 + u32 ulMemType);
19068 + * ======== WMD_BRD_MemMap ========
19069 + * Purpose:
19070 + * Map a MPU memory region to a DSP/IVA memory space
19071 + * Parameters:
19072 + * hDevContext: Handle to mini-driver defined device info.
19073 + * ulMpuAddr: MPU memory region start address.
19074 + * ulVirtAddr: DSP/IVA memory region u8 address.
19075 + * ulNumBytes: Number of bytes to map.
19076 + * mapAttrs: Mapping attributes (e.g. endianness).
19077 + * Returns:
19078 + * DSP_SOK: Success.
19079 + * DSP_EFAIL: Other, unspecified error.
19080 + * Requires:
19081 + * hDevContext != NULL;
19082 + * Ensures:
19083 + */
19084 + typedef DSP_STATUS(CDECL *WMD_BRD_MEMMAP) (struct WMD_DEV_CONTEXT
19085 + *hDevContext, u32 ulMpuAddr,
19086 + u32 ulVirtAddr, u32 ulNumBytes,
19087 + u32 ulMapAttrs);
19090 + * ======== WMD_BRD_MemUnMap ========
19091 + * Purpose:
19092 + * UnMap an MPU memory region from DSP/IVA memory space
19093 + * Parameters:
19094 + * hDevContext: Handle to mini-driver defined device info.
19095 + * ulVirtAddr: DSP/IVA memory region u8 address.
19096 + * ulNumBytes: Number of bytes to unmap.
19097 + * Returns:
19098 + * DSP_SOK: Success.
19099 + * DSP_EFAIL: Other, unspecified error.
19100 + * Requires:
19101 + * hDevContext != NULL;
19102 + * Ensures:
19103 + */
19104 + typedef DSP_STATUS(CDECL *WMD_BRD_MEMUNMAP) (struct WMD_DEV_CONTEXT
19105 + *hDevContext,
19106 + u32 ulVirtAddr,
19107 + u32 ulNumBytes);
19110 + * ======== WMD_BRD_Stop ========
19111 + * Purpose:
19112 + * Bring board to the BRD_STOPPED state.
19113 + * Parameters:
19114 + * hDevContext: Handle to mini-driver defined device context.
19115 + * Returns:
19116 + * DSP_SOK: Success.
19117 + * WMD_E_TIMEOUT: Timeout occured waiting for a response from hardware.
19118 + * DSP_EFAIL: Other, unspecified error.
19119 + * Requires:
19120 + * hDevContext != NULL
19121 + * Ensures:
19122 + * DSP_SOK: Board is in BRD_STOPPED (stop) state;
19123 + * Interrupts to the PC are disabled.
19124 + * else: Board state is indeterminate.
19125 + */
19126 + typedef DSP_STATUS(CDECL *WMD_BRD_STOP) (struct WMD_DEV_CONTEXT
19127 + *hDevContext);
19130 + * ======== WMD_BRD_Status ========
19131 + * Purpose:
19132 + * Report the current state of the board.
19133 + * Parameters:
19134 + * hDevContext: Handle to mini-driver defined device context.
19135 + * pdwState: Ptr to BRD status variable.
19136 + * Returns:
19137 + * DSP_SOK:
19138 + * Requires:
19139 + * pdwState != NULL;
19140 + * hDevContext != NULL
19141 + * Ensures:
19142 + * *pdwState is one of {BRD_STOPPED, BRD_IDLE, BRD_RUNNING, BRD_UNKNOWN};
19143 + */
19144 + typedef DSP_STATUS(CDECL *
19145 + WMD_BRD_STATUS) (struct WMD_DEV_CONTEXT *hDevContext,
19146 + OUT BRD_STATUS * pdwState);
19149 + * ======== WMD_BRD_Read ========
19150 + * Purpose:
19151 + * Read a block of DSP memory, from a given memory space, into a host
19152 + * buffer.
19153 + * Parameters:
19154 + * hDevContext: Handle to mini-driver defined device info.
19155 + * pHostBuf: Pointer to host buffer (Destination).
19156 + * dwDSPAddr: Address on DSP board (Source).
19157 + * ulNumBytes: Number of bytes to transfer.
19158 + * ulMemType: Memory space on DSP from which to transfer.
19159 + * Returns:
19160 + * DSP_SOK: Success.
19161 + * WMD_E_TIMEOUT: Timeout occured waiting for a response from hardware.
19162 + * DSP_EFAIL: Other, unspecified error.
19163 + * Requires:
19164 + * hDevContext != NULL;
19165 + * pHostBuf != NULL.
19166 + * Ensures:
19167 + * Will not write more than ulNumBytes bytes into pHostBuf.
19168 + */
19169 +typedef DSP_STATUS(CDECL *WMD_BRD_READ) (struct WMD_DEV_CONTEXT *hDevContext,
19170 + OUT u8 *pHostBuf,
19171 + u32 dwDSPAddr,
19172 + u32 ulNumBytes,
19173 + u32 ulMemType);
19176 + * ======== WMD_BRD_Write ========
19177 + * Purpose:
19178 + * Write a block of host memory into a DSP address, into a given memory
19179 + * space.
19180 + * Parameters:
19181 + * hDevContext: Handle to mini-driver defined device info.
19182 + * dwDSPAddr: Address on DSP board (Destination).
19183 + * pHostBuf: Pointer to host buffer (Source).
19184 + * ulNumBytes: Number of bytes to transfer.
19185 + * ulMemType: Memory space on DSP to which to transfer.
19186 + * Returns:
19187 + * DSP_SOK: Success.
19188 + * WMD_E_TIMEOUT: Timeout occured waiting for a response from hardware.
19189 + * DSP_EFAIL: Other, unspecified error.
19190 + * Requires:
19191 + * hDevContext != NULL;
19192 + * pHostBuf != NULL.
19193 + * Ensures:
19194 + */
19195 +typedef DSP_STATUS(CDECL *WMD_BRD_WRITE)(struct WMD_DEV_CONTEXT *hDevContext,
19196 + IN u8 *pHostBuf,
19197 + u32 dwDSPAddr,
19198 + u32 ulNumBytes,
19199 + u32 ulMemType);
19202 + * ======== WMD_CHNL_Create ========
19203 + * Purpose:
19204 + * Create a channel manager object, responsible for opening new channels
19205 + * and closing old ones for a given 'Bridge board.
19206 + * Parameters:
19207 + * phChnlMgr: Location to store a channel manager object on output.
19208 + * hDevObject: Handle to a device object.
19209 + * pMgrAttrs: Channel manager attributes.
19210 + * pMgrAttrs->cChannels: Max channels
19211 + * pMgrAttrs->bIRQ: Channel's I/O IRQ number.
19212 + * pMgrAttrs->fShared: TRUE if the IRQ is shareable.
19213 + * pMgrAttrs->uWordSize: DSP Word size in equivalent PC bytes..
19214 + * pMgrAttrs->dwSMBase: Base physical address of shared memory, if any.
19215 + * pMgrAttrs->uSMLength: Bytes of shared memory block.
19216 + * Returns:
19217 + * DSP_SOK: Success;
19218 + * DSP_EMEMORY: Insufficient memory for requested resources.
19219 + * CHNL_E_ISR: Unable to plug ISR for given IRQ.
19220 + * CHNL_E_NOMEMMAP: Couldn't map physical address to a virtual one.
19221 + * Requires:
19222 + * phChnlMgr != NULL.
19223 + * pMgrAttrs != NULL
19224 + * pMgrAttrs field are all valid:
19225 + * 0 < cChannels <= CHNL_MAXCHANNELS.
19226 + * bIRQ <= 15.
19227 + * uWordSize > 0.
19228 + * IsValidHandle(hDevObject)
19229 + * No channel manager exists for this board.
19230 + * Ensures:
19231 + */
19232 + typedef DSP_STATUS(CDECL *WMD_CHNL_CREATE)(OUT struct CHNL_MGR
19233 + **phChnlMgr,
19234 + struct DEV_OBJECT
19235 + *hDevObject,
19236 + IN CONST struct
19237 + CHNL_MGRATTRS *pMgrAttrs);
19240 + * ======== WMD_CHNL_Destroy ========
19241 + * Purpose:
19242 + * Close all open channels, and destroy the channel manager.
19243 + * Parameters:
19244 + * hChnlMgr: Channel manager object.
19245 + * Returns:
19246 + * DSP_SOK: Success.
19247 + * DSP_EHANDLE: hChnlMgr was invalid.
19248 + * Requires:
19249 + * Ensures:
19250 + * DSP_SOK: Cancels I/O on each open channel. Closes each open channel.
19251 + * CHNL_Create may subsequently be called for the same device.
19252 + */
19253 + typedef DSP_STATUS(CDECL *WMD_CHNL_DESTROY) (struct CHNL_MGR
19254 + *hChnlMgr);
19256 + * ======== WMD_DEH_Notify ========
19257 + * Purpose:
19258 + * When notified of DSP error, take appropriate action.
19259 + * Parameters:
19260 + * hDehMgr: Handle to DEH manager object.
19261 + * ulEventMask: Indicate the type of exception
19262 + * dwErrInfo: Error information
19263 + * Returns:
19265 + * Requires:
19266 + * hDehMgr != NULL;
19267 + * ulEventMask with a valid exception
19268 + * Ensures:
19269 + */
19270 + typedef void (CDECL *WMD_DEH_NOTIFY)(struct DEH_MGR *hDehMgr,
19271 + u32 ulEventMask, u32 dwErrInfo);
19275 + * ======== WMD_CHNL_Open ========
19276 + * Purpose:
19277 + * Open a new half-duplex channel to the DSP board.
19278 + * Parameters:
19279 + * phChnl: Location to store a channel object handle.
19280 + * hChnlMgr: Handle to channel manager, as returned by CHNL_GetMgr().
19281 + * uMode: One of {CHNL_MODETODSP, CHNL_MODEFROMDSP} specifies
19282 + * direction of data transfer.
19283 + * uChnlId: If CHNL_PICKFREE is specified, the channel manager will
19284 + * select a free channel id (default);
19285 + * otherwise this field specifies the id of the channel.
19286 + * pAttrs: Channel attributes. Attribute fields are as follows:
19287 + * pAttrs->uIOReqs: Specifies the maximum number of I/O requests which can
19288 + * be pending at any given time. All request packets are
19289 + * preallocated when the channel is opened.
19290 + * pAttrs->hEvent: This field allows the user to supply an auto reset
19291 + * event object for channel I/O completion notifications.
19292 + * It is the responsibility of the user to destroy this
19293 + * object AFTER closing the channel.
19294 + * This channel event object can be retrieved using
19295 + * CHNL_GetEventHandle().
19296 + * pAttrs->hReserved: The kernel mode handle of this event object.
19298 + * Returns:
19299 + * DSP_SOK: Success.
19300 + * DSP_EHANDLE: hChnlMgr is invalid.
19301 + * DSP_EMEMORY: Insufficient memory for requested resources.
19302 + * DSP_EINVALIDARG: Invalid number of IOReqs.
19303 + * CHNL_E_OUTOFSTREAMS: No free channels available.
19304 + * CHNL_E_BADCHANID: Channel ID is out of range.
19305 + * CHNL_E_CHANBUSY: Channel is in use.
19306 + * CHNL_E_NOIORPS: No free IO request packets available for
19307 + * queuing.
19308 + * Requires:
19309 + * phChnl != NULL.
19310 + * pAttrs != NULL.
19311 + * pAttrs->hEvent is a valid event handle.
19312 + * pAttrs->hReserved is the kernel mode handle for pAttrs->hEvent.
19313 + * Ensures:
19314 + * DSP_SOK: *phChnl is a valid channel.
19315 + * else: *phChnl is set to NULL if (phChnl != NULL);
19316 + */
19317 + typedef DSP_STATUS(CDECL *WMD_CHNL_OPEN) (OUT struct CHNL_OBJECT
19318 + **phChnl,
19319 + struct CHNL_MGR *hChnlMgr,
19320 + CHNL_MODE uMode,
19321 + u32 uChnlId,
19322 + CONST IN OPTIONAL struct
19323 + CHNL_ATTRS *pAttrs);
19326 + * ======== WMD_CHNL_Close ========
19327 + * Purpose:
19328 + * Ensures all pending I/O on this channel is cancelled, discards all
19329 + * queued I/O completion notifications, then frees the resources allocated
19330 + * for this channel, and makes the corresponding logical channel id
19331 + * available for subsequent use.
19332 + * Parameters:
19333 + * hChnl: Handle to a channel object.
19334 + * Returns:
19335 + * DSP_SOK: Success;
19336 + * DSP_EHANDLE: Invalid hChnl.
19337 + * Requires:
19338 + * No thread must be blocked on this channel's I/O completion event.
19339 + * Ensures:
19340 + * DSP_SOK: hChnl is no longer valid.
19341 + */
19342 + typedef DSP_STATUS(CDECL *WMD_CHNL_CLOSE) (struct CHNL_OBJECT *hChnl);
19345 + * ======== WMD_CHNL_AddIOReq ========
19346 + * Purpose:
19347 + * Enqueue an I/O request for data transfer on a channel to the DSP.
19348 + * The direction (mode) is specified in the channel object. Note the DSP
19349 + * address is specified for channels opened in direct I/O mode.
19350 + * Parameters:
19351 + * hChnl: Channel object handle.
19352 + * pHostBuf: Host buffer address source.
19353 + * cBytes: Number of PC bytes to transfer. A zero value indicates
19354 + * that this buffer is the last in the output channel.
19355 + * A zero value is invalid for an input channel.
19356 + *! cBufSize: Actual buffer size in host bytes.
19357 + * dwDspAddr: DSP address for transfer. (Currently ignored).
19358 + * dwArg: A user argument that travels with the buffer.
19359 + * Returns:
19360 + * DSP_SOK: Success;
19361 + * DSP_EHANDLE: Invalid hChnl.
19362 + * DSP_EPOINTER: pHostBuf is invalid.
19363 + * CHNL_E_NOEOS: User cannot mark EOS on an input channel.
19364 + * CHNL_E_CANCELLED: I/O has been cancelled on this channel. No further
19365 + * I/O is allowed.
19366 + * CHNL_E_EOS: End of stream was already marked on a previous
19367 + * IORequest on this channel. No further I/O is expected.
19368 + * CHNL_E_BUFSIZE: Buffer submitted to this output channel is larger than
19369 + * the size of the physical shared memory output window.
19370 + * Requires:
19371 + * Ensures:
19372 + * DSP_SOK: The buffer will be transferred if the channel is ready;
19373 + * otherwise, will be queued for transfer when the channel becomes
19374 + * ready. In any case, notifications of I/O completion are
19375 + * asynchronous.
19376 + * If cBytes is 0 for an output channel, subsequent CHNL_AddIOReq's
19377 + * on this channel will fail with error code CHNL_E_EOS. The
19378 + * corresponding IOC for this I/O request will have its status flag
19379 + * set to CHNL_IOCSTATEOS.
19380 + */
19381 + typedef DSP_STATUS(CDECL *WMD_CHNL_ADDIOREQ) (struct CHNL_OBJECT
19382 + *hChnl,
19383 + void *pHostBuf,
19384 + u32 cBytes,
19385 + u32 cBufSize,
19386 + OPTIONAL u32 dwDspAddr,
19387 + u32 dwArg);
19390 + * ======== WMD_CHNL_GetIOC ========
19391 + * Purpose:
19392 + * Dequeue an I/O completion record, which contains information about the
19393 + * completed I/O request.
19394 + * Parameters:
19395 + * hChnl: Channel object handle.
19396 + * dwTimeOut: A value of CHNL_IOCNOWAIT will simply dequeue the
19397 + * first available IOC.
19398 + * pIOC: On output, contains host buffer address, bytes
19399 + * transferred, and status of I/O completion.
19400 + * pIOC->status: See chnldefs.h.
19401 + * Returns:
19402 + * DSP_SOK: Success.
19403 + * DSP_EHANDLE: Invalid hChnl.
19404 + * DSP_EPOINTER: pIOC is invalid.
19405 + * CHNL_E_NOIOC: CHNL_IOCNOWAIT was specified as the dwTimeOut parameter
19406 + * yet no I/O completions were queued.
19407 + * Requires:
19408 + * dwTimeOut == CHNL_IOCNOWAIT.
19409 + * Ensures:
19410 + * DSP_SOK: if there are any remaining IOC's queued before this call
19411 + * returns, the channel event object will be left in a signalled
19412 + * state.
19413 + */
19414 + typedef DSP_STATUS(CDECL *WMD_CHNL_GETIOC) (struct CHNL_OBJECT *hChnl,
19415 + u32 dwTimeOut,
19416 + OUT struct CHNL_IOC *pIOC);
19419 + * ======== WMD_CHNL_CancelIO ========
19420 + * Purpose:
19421 + * Return all I/O requests to the client which have not yet been
19422 + * transferred. The channel's I/O completion object is
19423 + * signalled, and all the I/O requests are queued as IOC's, with the
19424 + * status field set to CHNL_IOCSTATCANCEL.
19425 + * This call is typically used in abort situations, and is a prelude to
19426 + * CHNL_Close();
19427 + * Parameters:
19428 + * hChnl: Channel object handle.
19429 + * Returns:
19430 + * DSP_SOK: Success;
19431 + * DSP_EHANDLE: Invalid hChnl.
19432 + * Requires:
19433 + * Ensures:
19434 + * Subsequent I/O requests to this channel will not be accepted.
19435 + */
19436 + typedef DSP_STATUS(CDECL *WMD_CHNL_CANCELIO) (struct CHNL_OBJECT
19437 + *hChnl);
19440 + * ======== WMD_CHNL_FlushIO ========
19441 + * Purpose:
19442 + * For an output stream (to the DSP), indicates if any IO requests are in
19443 + * the output request queue. For input streams (from the DSP), will
19444 + * cancel all pending IO requests.
19445 + * Parameters:
19446 + * hChnl: Channel object handle.
19447 + * dwTimeOut: Timeout value for flush operation.
19448 + * Returns:
19449 + * DSP_SOK: Success;
19450 + * S_CHNLIOREQUEST: Returned if any IORequests are in the output queue.
19451 + * DSP_EHANDLE: Invalid hChnl.
19452 + * Requires:
19453 + * Ensures:
19454 + * DSP_SOK: No I/O requests will be pending on this channel.
19455 + */
19456 + typedef DSP_STATUS(CDECL *WMD_CHNL_FLUSHIO) (struct CHNL_OBJECT *hChnl,
19457 + u32 dwTimeOut);
19460 + * ======== WMD_CHNL_GetInfo ========
19461 + * Purpose:
19462 + * Retrieve information related to a channel.
19463 + * Parameters:
19464 + * hChnl: Handle to a valid channel object, or NULL.
19465 + * pInfo: Location to store channel info.
19466 + * Returns:
19467 + * DSP_SOK: Success;
19468 + * DSP_EHANDLE: Invalid hChnl.
19469 + * DSP_EPOINTER: pInfo == NULL.
19470 + * Requires:
19471 + * Ensures:
19472 + * DSP_SOK: pInfo points to a filled in CHNL_INFO struct,
19473 + * if (pInfo != NULL).
19474 + */
19475 + typedef DSP_STATUS(CDECL *WMD_CHNL_GETINFO) (struct CHNL_OBJECT *hChnl,
19476 + OUT struct CHNL_INFO
19477 + *pChnlInfo);
19480 + * ======== WMD_CHNL_GetMgrInfo ========
19481 + * Purpose:
19482 + * Retrieve information related to the channel manager.
19483 + * Parameters:
19484 + * hChnlMgr: Handle to a valid channel manager, or NULL.
19485 + * uChnlID: Channel ID.
19486 + * pMgrInfo: Location to store channel manager info.
19487 + * Returns:
19488 + * DSP_SOK: Success;
19489 + * DSP_EHANDLE: Invalid hChnlMgr.
19490 + * DSP_EPOINTER: pMgrInfo == NULL.
19491 + * CHNL_E_BADCHANID: Invalid channel ID.
19492 + * Requires:
19493 + * Ensures:
19494 + * DSP_SOK: pMgrInfo points to a filled in CHNL_MGRINFO
19495 + * struct, if (pMgrInfo != NULL).
19496 + */
19497 + typedef DSP_STATUS(CDECL *WMD_CHNL_GETMGRINFO) (struct CHNL_MGR
19498 + *hChnlMgr,
19499 + u32 uChnlID,
19500 + OUT struct CHNL_MGRINFO
19501 + *pMgrInfo);
19504 + * ======== WMD_CHNL_Idle ========
19505 + * Purpose:
19506 + * Idle a channel. If this is an input channel, or if this is an output
19507 + * channel and fFlush is TRUE, all currently enqueued buffers will be
19508 + * dequeued (data discarded for output channel).
19509 + * If this is an output channel and fFlush is FALSE, this function
19510 + * will block until all currently buffered data is output, or the timeout
19511 + * specified has been reached.
19513 + * Parameters:
19514 + * hChnl: Channel object handle.
19515 + * dwTimeOut: If output channel and fFlush is FALSE, timeout value
19516 + * to wait for buffers to be output. (Not used for
19517 + * input channel).
19518 + * fFlush: If output channel and fFlush is TRUE, discard any
19519 + * currently buffered data. If FALSE, wait for currently
19520 + * buffered data to be output, or timeout, whichever
19521 + * occurs first. fFlush is ignored for input channel.
19522 + * Returns:
19523 + * DSP_SOK: Success;
19524 + * DSP_EHANDLE: Invalid hChnl.
19525 + * CHNL_E_WAITTIMEOUT: Timeout occured before channel could be idled.
19526 + * Requires:
19527 + * Ensures:
19528 + */
19529 + typedef DSP_STATUS(CDECL *WMD_CHNL_IDLE) (struct CHNL_OBJECT *hChnl,
19530 + u32 dwTimeOut,
19531 + bool fFlush);
19534 + * ======== WMD_CHNL_RegisterNotify ========
19535 + * Purpose:
19536 + * Register for notification of events on a channel.
19537 + * Parameters:
19538 + * hChnl: Channel object handle.
19539 + * uEventMask: Type of events to be notified about: IO completion
19540 + * (DSP_STREAMIOCOMPLETION) or end of stream
19541 + * (DSP_STREAMDONE).
19542 + * uNotifyType: DSP_SIGNALEVENT.
19543 + * hNotification: Handle of a DSP_NOTIFICATION object.
19544 + * Returns:
19545 + * DSP_SOK: Success.
19546 + * DSP_EMEMORY: Insufficient memory.
19547 + * DSP_EVALUE: uEventMask is 0 and hNotification was not
19548 + * previously registered.
19549 + * DSP_EHANDLE: NULL hNotification, hNotification event name
19550 + * too long, or hNotification event name NULL.
19551 + * Requires:
19552 + * Valid hChnl.
19553 + * hNotification != NULL.
19554 + * (uEventMask & ~(DSP_STREAMIOCOMPLETION | DSP_STREAMDONE)) == 0.
19555 + * uNotifyType == DSP_SIGNALEVENT.
19556 + * Ensures:
19557 + */
19558 + typedef DSP_STATUS(CDECL *WMD_CHNL_REGISTERNOTIFY)
19559 + (struct CHNL_OBJECT *hChnl,
19560 + u32 uEventMask,
19561 + u32 uNotifyType,
19562 + struct DSP_NOTIFICATION *hNotification);
19565 + * ======== WMD_DEV_Create ========
19566 + * Purpose:
19567 + * Complete creation of the device object for this board.
19568 + * Parameters:
19569 + * phDevContext: Ptr to location to store a WMD device context.
19570 + * hDevObject: Handle to a Device Object, created and managed by WCD.
19571 + * pConfig: Ptr to configuration parameters provided by the Windows
19572 + * Configuration Manager during device loading.
19573 + * pDspConfig: DSP resources, as specified in the registry key for this
19574 + * device.
19575 + * Returns:
19576 + * DSP_SOK: Success.
19577 + * DSP_EMEMORY: Unable to allocate memory for device context.
19578 + * WMD_E_BADCONFIG: One or more of the host or DSP configuration
19579 + * parameters did not satisfy hardware assumptions
19580 + * made by this WMD.
19581 + * Requires:
19582 + * phDevContext != NULL;
19583 + * hDevObject != NULL;
19584 + * pConfig != NULL;
19585 + * pDspConfig != NULL;
19586 + * Fields in pConfig and pDspConfig contain valid values.
19587 + * Ensures:
19588 + * DSP_SOK: All mini-driver specific DSP resource and other
19589 + * board context has been allocated.
19590 + * DSP_EMEMORY: WMD failed to allocate resources.
19591 + * Any acquired resources have been freed. The WCD will
19592 + * not call WMD_DEV_Destroy() if WMD_DEV_Create() fails.
19593 + * Details:
19594 + * Called during the CONFIGMG's Device_Init phase. Based on host and
19595 + * DSP configuration information, create a board context, a handle to
19596 + * which is passed into other WMD BRD and CHNL functions. The
19597 + * board context contains state information for the device. Since the
19598 + * addresses of all IN pointer parameters may be invalid when this
19599 + * function returns, they must not be stored into the device context
19600 + * structure.
19601 + */
19602 + typedef DSP_STATUS(CDECL *WMD_DEV_CREATE) (OUT struct WMD_DEV_CONTEXT
19603 + **phDevContext,
19604 + struct DEV_OBJECT
19605 + *hDevObject,
19606 + IN CONST struct CFG_HOSTRES
19607 + *pConfig,
19608 + IN CONST struct CFG_DSPRES
19609 + *pDspConfig);
19612 + * ======== WMD_DEV_Ctrl ========
19613 + * Purpose:
19614 + * Mini-driver specific interface.
19615 + * Parameters:
19616 + * hDevContext: Handle to mini-driver defined device info.
19617 + * dwCmd: WMD defined command code.
19618 + * pArgs: Pointer to an arbitrary argument structure.
19619 + * Returns:
19620 + * DSP_SOK or DSP_EFAIL. Actual command error codes should be passed back
19621 + * in the pArgs structure, and are defined by the WMD implementor.
19622 + * Requires:
19623 + * All calls are currently assumed to be synchronous. There are no
19624 + * IOCTL completion routines provided.
19625 + * Ensures:
19626 + */
19627 +typedef DSP_STATUS(CDECL *WMD_DEV_CTRL)(struct WMD_DEV_CONTEXT *hDevContext,
19628 + u32 dwCmd,
19629 + IN OUT void *pArgs);
19632 + * ======== WMD_DEV_Destroy ========
19633 + * Purpose:
19634 + * Deallocate WMD device extension structures and all other resources
19635 + * acquired by the mini-driver.
19636 + * No calls to other mini driver functions may subsequently
19637 + * occur, except for WMD_DEV_Create().
19638 + * Parameters:
19639 + * hDevContext: Handle to mini-driver defined device information.
19640 + * Returns:
19641 + * DSP_SOK: Success.
19642 + * DSP_EFAIL: Failed to release a resource previously acquired.
19643 + * Requires:
19644 + * hDevContext != NULL;
19645 + * Ensures:
19646 + * DSP_SOK: Device context is freed.
19647 + */
19648 + typedef DSP_STATUS(CDECL *WMD_DEV_DESTROY) (struct WMD_DEV_CONTEXT
19649 + *hDevContext);
19652 + * ======== WMD_DEH_Create ========
19653 + * Purpose:
19654 + * Create an object that manages DSP exceptions from the GPP.
19655 + * Parameters:
19656 + * phDehMgr: Location to store DEH manager on output.
19657 + * hDevObject: Handle to DEV object.
19658 + * Returns:
19659 + * DSP_SOK: Success.
19660 + * DSP_EMEMORY: Memory allocation failure.
19661 + * DSP_EFAIL: Creation failed.
19662 + * Requires:
19663 + * hDevObject != NULL;
19664 + * phDehMgr != NULL;
19665 + * Ensures:
19666 + */
19667 + typedef DSP_STATUS(CDECL *WMD_DEH_CREATE) (OUT struct DEH_MGR
19668 + **phDehMgr,
19669 + struct DEV_OBJECT
19670 + *hDevObject);
19673 + * ======== WMD_DEH_Destroy ========
19674 + * Purpose:
19675 + * Destroy the DEH object.
19676 + * Parameters:
19677 + * hDehMgr: Handle to DEH manager object.
19678 + * Returns:
19679 + * DSP_SOK: Success.
19680 + * DSP_EFAIL: Destroy failed.
19681 + * Requires:
19682 + * hDehMgr != NULL;
19683 + * Ensures:
19684 + */
19685 + typedef DSP_STATUS(CDECL *WMD_DEH_DESTROY) (struct DEH_MGR *hDehMgr);
19688 + * ======== WMD_DEH_RegisterNotify ========
19689 + * Purpose:
19690 + * Register for DEH event notification.
19691 + * Parameters:
19692 + * hDehMgr: Handle to DEH manager object.
19693 + * Returns:
19694 + * DSP_SOK: Success.
19695 + * DSP_EFAIL: Destroy failed.
19696 + * Requires:
19697 + * hDehMgr != NULL;
19698 + * Ensures:
19699 + */
19700 + typedef DSP_STATUS(CDECL *WMD_DEH_REGISTERNOTIFY)
19701 + (struct DEH_MGR *hDehMgr,
19702 + u32 uEventMask, u32 uNotifyType,
19703 + struct DSP_NOTIFICATION *hNotification);
19706 + * ======== WMD_DEH_GetInfo ========
19707 + * Purpose:
19708 + * Get DSP exception info.
19709 + * Parameters:
19710 + * phDehMgr: Location to store DEH manager on output.
19711 + * pErrInfo: Ptr to error info structure.
19712 + * Returns:
19713 + * DSP_SOK: Success.
19714 + * DSP_EFAIL: Creation failed.
19715 + * Requires:
19716 + * phDehMgr != NULL;
19717 + * pErrorInfo != NULL;
19718 + * Ensures:
19719 + */
19720 + typedef DSP_STATUS(CDECL *WMD_DEH_GETINFO) (struct DEH_MGR *phDehMgr,
19721 + struct DSP_ERRORINFO *pErrInfo);
19724 + * ======== WMD_IO_Create ========
19725 + * Purpose:
19726 + * Create an object that manages I/O between CHNL and MSG.
19727 + * Parameters:
19728 + * phIOMgr: Location to store IO manager on output.
19729 + * hChnlMgr: Handle to channel manager.
19730 + * hMsgMgr: Handle to message manager.
19731 + * Returns:
19732 + * DSP_SOK: Success.
19733 + * DSP_EMEMORY: Memory allocation failure.
19734 + * DSP_EFAIL: Creation failed.
19735 + * Requires:
19736 + * hDevObject != NULL;
19737 + * Channel manager already created;
19738 + * Message manager already created;
19739 + * pMgrAttrs != NULL;
19740 + * phIOMgr != NULL;
19741 + * Ensures:
19742 + */
19743 + typedef DSP_STATUS(CDECL *WMD_IO_CREATE) (OUT struct IO_MGR **phIOMgr,
19744 + struct DEV_OBJECT *hDevObject,
19745 + IN CONST struct IO_ATTRS *pMgrAttrs);
19748 + * ======== WMD_IO_Destroy ========
19749 + * Purpose:
19750 + * Destroy object created in WMD_IO_Create.
19751 + * Parameters:
19752 + * hIOMgr: IO Manager.
19753 + * Returns:
19754 + * DSP_SOK: Success.
19755 + * DSP_EMEMORY: Memory allocation failure.
19756 + * DSP_EFAIL: Creation failed.
19757 + * Requires:
19758 + * Valid hIOMgr;
19759 + * Ensures:
19760 + */
19761 + typedef DSP_STATUS(CDECL *WMD_IO_DESTROY) (struct IO_MGR *hIOMgr);
19764 + * ======== WMD_IO_OnLoaded ========
19765 + * Purpose:
19766 + * Called whenever a program is loaded to update internal data. For
19767 + * example, if shared memory is used, this function would update the
19768 + * shared memory location and address.
19769 + * Parameters:
19770 + * hIOMgr: IO Manager.
19771 + * Returns:
19772 + * DSP_SOK: Success.
19773 + * DSP_EFAIL: Internal failure occurred.
19774 + * Requires:
19775 + * Valid hIOMgr;
19776 + * Ensures:
19777 + */
19778 + typedef DSP_STATUS(CDECL *WMD_IO_ONLOADED) (struct IO_MGR *hIOMgr);
19781 + * ======== WMD_IO_GETPROCLOAD ========
19782 + * Purpose:
19783 + * Called to get the Processor's current and predicted load
19784 + * Parameters:
19785 + * hIOMgr: IO Manager.
19786 + * pProcLoadStat Processor Load statistics
19787 + * Returns:
19788 + * DSP_SOK: Success.
19789 + * DSP_EFAIL: Internal failure occurred.
19790 + * Requires:
19791 + * Valid hIOMgr;
19792 + * Ensures:
19793 + */
19794 + typedef DSP_STATUS(CDECL *WMD_IO_GETPROCLOAD)(struct IO_MGR *hIOMgr,
19795 + struct DSP_PROCLOADSTAT *pProcLoadStat);
19798 + * ======== WMD_MSG_Create ========
19799 + * Purpose:
19800 + * Create an object to manage message queues. Only one of these objects
19801 + * can exist per device object.
19802 + * Parameters:
19803 + * phMsgMgr: Location to store MSG manager on output.
19804 + * hDevObject: Handle to a device object.
19805 + * msgCallback: Called whenever an RMS_EXIT message is received.
19806 + * Returns:
19807 + * DSP_SOK: Success.
19808 + * DSP_EMEMORY: Insufficient memory.
19809 + * Requires:
19810 + * phMsgMgr != NULL.
19811 + * msgCallback != NULL.
19812 + * hDevObject != NULL.
19813 + * Ensures:
19814 + */
19815 + typedef DSP_STATUS(CDECL *WMD_MSG_CREATE)
19816 + (OUT struct MSG_MGR **phMsgMgr,
19817 + struct DEV_OBJECT *hDevObject,
19818 + MSG_ONEXIT msgCallback);
19821 + * ======== WMD_MSG_CreateQueue ========
19822 + * Purpose:
19823 + * Create a MSG queue for sending or receiving messages from a Message
19824 + * node on the DSP.
19825 + * Parameters:
19826 + * hMsgMgr: MSG queue manager handle returned from
19827 + * WMD_MSG_Create.
19828 + * phMsgQueue: Location to store MSG queue on output.
19829 + * dwId: Identifier for messages (node environment pointer).
19830 + * uMaxMsgs: Max number of simultaneous messages for the node.
19831 + * h: Handle passed to hMsgMgr->msgCallback().
19832 + * Returns:
19833 + * DSP_SOK: Success.
19834 + * DSP_EMEMORY: Insufficient memory.
19835 + * Requires:
19836 + * phMsgQueue != NULL.
19837 + * h != NULL.
19838 + * uMaxMsgs > 0.
19839 + * Ensures:
19840 + * phMsgQueue !=NULL <==> DSP_SOK.
19841 + */
19842 + typedef DSP_STATUS(CDECL *WMD_MSG_CREATEQUEUE)
19843 + (struct MSG_MGR *hMsgMgr,
19844 + OUT struct MSG_QUEUE **phMsgQueue,
19845 + u32 dwId, u32 uMaxMsgs, HANDLE h);
19848 + * ======== WMD_MSG_Delete ========
19849 + * Purpose:
19850 + * Delete a MSG manager allocated in WMD_MSG_Create().
19851 + * Parameters:
19852 + * hMsgMgr: Handle returned from WMD_MSG_Create().
19853 + * Returns:
19854 + * Requires:
19855 + * Valid hMsgMgr.
19856 + * Ensures:
19857 + */
19858 + typedef void(CDECL *WMD_MSG_DELETE) (struct MSG_MGR *hMsgMgr);
19861 + * ======== WMD_MSG_DeleteQueue ========
19862 + * Purpose:
19863 + * Delete a MSG queue allocated in WMD_MSG_CreateQueue.
19864 + * Parameters:
19865 + * hMsgQueue: Handle to MSG queue returned from
19866 + * WMD_MSG_CreateQueue.
19867 + * Returns:
19868 + * Requires:
19869 + * Valid hMsgQueue.
19870 + * Ensures:
19871 + */
19872 + typedef void(CDECL *WMD_MSG_DELETEQUEUE) (struct MSG_QUEUE *hMsgQueue);
19875 + * ======== WMD_MSG_Get ========
19876 + * Purpose:
19877 + * Get a message from a MSG queue.
19878 + * Parameters:
19879 + * hMsgQueue: Handle to MSG queue returned from
19880 + * WMD_MSG_CreateQueue.
19881 + * pMsg: Location to copy message into.
19882 + * uTimeout: Timeout to wait for a message.
19883 + * Returns:
19884 + * DSP_SOK: Success.
19885 + * DSP_ETIMEOUT: Timeout occurred.
19886 + * DSP_EFAIL: No frames available for message (uMaxMessages too
19887 + * small).
19888 + * Requires:
19889 + * Valid hMsgQueue.
19890 + * pMsg != NULL.
19891 + * Ensures:
19892 + */
19893 + typedef DSP_STATUS(CDECL *WMD_MSG_GET) (struct MSG_QUEUE *hMsgQueue,
19894 + struct DSP_MSG *pMsg,
19895 + u32 uTimeout);
19898 + * ======== WMD_MSG_Put ========
19899 + * Purpose:
19900 + * Put a message onto a MSG queue.
19901 + * Parameters:
19902 + * hMsgQueue: Handle to MSG queue returned from
19903 + * WMD_MSG_CreateQueue.
19904 + * pMsg: Pointer to message.
19905 + * uTimeout: Timeout to wait for a message.
19906 + * Returns:
19907 + * DSP_SOK: Success.
19908 + * DSP_ETIMEOUT: Timeout occurred.
19909 + * DSP_EFAIL: No frames available for message (uMaxMessages too
19910 + * small).
19911 + * Requires:
19912 + * Valid hMsgQueue.
19913 + * pMsg != NULL.
19914 + * Ensures:
19915 + */
19916 + typedef DSP_STATUS(CDECL *WMD_MSG_PUT) (struct MSG_QUEUE *hMsgQueue,
19917 + IN CONST struct DSP_MSG *pMsg,
19918 + u32 uTimeout);
19921 + * ======== WMD_MSG_RegisterNotify ========
19922 + * Purpose:
19923 + * Register notification for when a message is ready.
19924 + * Parameters:
19925 + * hMsgQueue: Handle to MSG queue returned from
19926 + * WMD_MSG_CreateQueue.
19927 + * uEventMask: Type of events to be notified about: Must be
19928 + * DSP_NODEMESSAGEREADY, or 0 to unregister.
19929 + * uNotifyType: DSP_SIGNALEVENT.
19930 + * hNotification: Handle of notification object.
19931 + * Returns:
19932 + * DSP_SOK: Success.
19933 + * DSP_EMEMORY: Insufficient memory.
19934 + * Requires:
19935 + * Valid hMsgQueue.
19936 + * hNotification != NULL.
19937 + * uNotifyType == DSP_SIGNALEVENT.
19938 + * uEventMask == DSP_NODEMESSAGEREADY || uEventMask == 0.
19939 + * Ensures:
19940 + */
19941 + typedef DSP_STATUS(CDECL *WMD_MSG_REGISTERNOTIFY)
19942 + (struct MSG_QUEUE *hMsgQueue,
19943 + u32 uEventMask, u32 uNotifyType,
19944 + struct DSP_NOTIFICATION *hNotification);
19947 + * ======== WMD_MSG_SetQueueId ========
19948 + * Purpose:
19949 + * Set message queue id to node environment. Allows WMD_MSG_CreateQueue
19950 + * to be called in NODE_Allocate, before the node environment is known.
19951 + * Parameters:
19952 + * hMsgQueue: Handle to MSG queue returned from
19953 + * WMD_MSG_CreateQueue.
19954 + * dwId: Node environment pointer.
19955 + * Returns:
19956 + * Requires:
19957 + * Valid hMsgQueue.
19958 + * dwId != 0.
19959 + * Ensures:
19960 + */
19961 + typedef void(CDECL *WMD_MSG_SETQUEUEID) (struct MSG_QUEUE *hMsgQueue,
19962 + u32 dwId);
19965 + * 'Bridge Mini Driver (WMD) interface function table.
19967 + * The information in this table is filled in by the specific mini-driver,
19968 + * and copied into the 'Bridge class driver's own space. If any interface
19969 + * function field is set to a value of NULL, then the class driver will
19970 + * consider that function not implemented, and return the error code
19971 + * DSP_ENOTIMPL when a WMD client attempts to call that function.
19973 + * This function table contains WCD version numbers, which are used by the
19974 + * WMD loader to help ensure backwards compatility between older WMD's and a
19975 + * newer 'Bridge Class Driver. These must be set to WCD_MAJOR_VERSION
19976 + * and WCD_MINOR_VERSION, respectively.
19978 + * A mini-driver need not export a CHNL interface. In this case, *all* of
19979 + * the WMD_CHNL_* entries must be set to NULL.
19980 + */
19981 + struct WMD_DRV_INTERFACE {
19982 + u32 dwWCDMajorVersion; /* Set to WCD_MAJOR_VERSION. */
19983 + u32 dwWCDMinorVersion; /* Set to WCD_MINOR_VERSION. */
19984 + WMD_DEV_CREATE pfnDevCreate; /* Create device context */
19985 + WMD_DEV_DESTROY pfnDevDestroy; /* Destroy device context */
19986 + WMD_DEV_CTRL pfnDevCntrl; /* Optional vendor interface */
19987 + WMD_BRD_MONITOR pfnBrdMonitor; /* Load and/or start monitor */
19988 + WMD_BRD_START pfnBrdStart; /* Start DSP program. */
19989 + WMD_BRD_STOP pfnBrdStop; /* Stop/reset board. */
19990 + WMD_BRD_STATUS pfnBrdStatus; /* Get current board status. */
19991 + WMD_BRD_READ pfnBrdRead; /* Read board memory */
19992 + WMD_BRD_WRITE pfnBrdWrite; /* Write board memory. */
19993 + WMD_BRD_SETSTATE pfnBrdSetState; /* Sets the Board State */
19994 + WMD_BRD_MEMCOPY pfnBrdMemCopy; /* Copies DSP Memory */
19995 + WMD_BRD_MEMWRITE pfnBrdMemWrite; /* Write DSP Memory w/o halt */
19996 + WMD_BRD_MEMMAP pfnBrdMemMap; /* Maps MPU mem to DSP mem */
19997 + WMD_BRD_MEMUNMAP pfnBrdMemUnMap; /* Unmaps MPU mem to DSP mem */
19998 + WMD_CHNL_CREATE pfnChnlCreate; /* Create channel manager. */
19999 + WMD_CHNL_DESTROY pfnChnlDestroy; /* Destroy channel manager. */
20000 + WMD_CHNL_OPEN pfnChnlOpen; /* Create a new channel. */
20001 + WMD_CHNL_CLOSE pfnChnlClose; /* Close a channel. */
20002 + WMD_CHNL_ADDIOREQ pfnChnlAddIOReq; /* Req I/O on a channel. */
20003 + WMD_CHNL_GETIOC pfnChnlGetIOC; /* Wait for I/O completion. */
20004 + WMD_CHNL_CANCELIO pfnChnlCancelIO; /* Cancl I/O on a channel. */
20005 + WMD_CHNL_FLUSHIO pfnChnlFlushIO; /* Flush I/O. */
20006 + WMD_CHNL_GETINFO pfnChnlGetInfo; /* Get channel specific info */
20007 + /* Get channel manager info. */
20008 + WMD_CHNL_GETMGRINFO pfnChnlGetMgrInfo;
20009 + WMD_CHNL_IDLE pfnChnlIdle; /* Idle the channel */
20010 + /* Register for notif. */
20011 + WMD_CHNL_REGISTERNOTIFY pfnChnlRegisterNotify;
20012 + WMD_DEH_CREATE pfnDehCreate; /* Create DEH manager */
20013 + WMD_DEH_DESTROY pfnDehDestroy; /* Destroy DEH manager */
20014 + WMD_DEH_NOTIFY pfnDehNotify; /* Notify of DSP error */
20015 + /* register for deh notif. */
20016 + WMD_DEH_REGISTERNOTIFY pfnDehRegisterNotify;
20017 + WMD_DEH_GETINFO pfnDehGetInfo; /* register for deh notif. */
20018 + WMD_IO_CREATE pfnIOCreate; /* Create IO manager */
20019 + WMD_IO_DESTROY pfnIODestroy; /* Destroy IO manager */
20020 + WMD_IO_ONLOADED pfnIOOnLoaded; /* Notify of program loaded */
20021 + /* Get Processor's current and predicted load */
20022 + WMD_IO_GETPROCLOAD pfnIOGetProcLoad;
20023 + WMD_MSG_CREATE pfnMsgCreate; /* Create message manager */
20024 + /* Create message queue */
20025 + WMD_MSG_CREATEQUEUE pfnMsgCreateQueue;
20026 + WMD_MSG_DELETE pfnMsgDelete; /* Delete message manager */
20027 + /* Delete message queue */
20028 + WMD_MSG_DELETEQUEUE pfnMsgDeleteQueue;
20029 + WMD_MSG_GET pfnMsgGet; /* Get a message */
20030 + WMD_MSG_PUT pfnMsgPut; /* Send a message */
20031 + /* Register for notif. */
20032 + WMD_MSG_REGISTERNOTIFY pfnMsgRegisterNotify;
20033 + /* Set message queue id */
20034 + WMD_MSG_SETQUEUEID pfnMsgSetQueueId;
20035 + } ;
20038 + * ======== WMD_DRV_Entry ========
20039 + * Purpose:
20040 + * Registers WMD functions with the class driver. Called only once
20041 + * by the WCD. The caller will first check WCD version compatibility, and
20042 + * then copy the interface functions into its own memory space.
20043 + * Parameters:
20044 + * ppDrvInterface Pointer to a location to receive a pointer to the
20045 + * mini driver interface.
20046 + * Returns:
20047 + * Requires:
20048 + * The code segment this function resides in must expect to be discarded
20049 + * after completion.
20050 + * Ensures:
20051 + * ppDrvInterface pointer initialized to WMD's function interface.
20052 + * No system resources are acquired by this function.
20053 + * Details:
20054 + * Win95: Called during the Device_Init phase.
20055 + */
20056 + void CDECL WMD_DRV_Entry(OUT struct WMD_DRV_INTERFACE **ppDrvInterface,
20057 + IN CONST char *pstrWMDFileName);
20059 +#endif /* WMD_ */
20060 Index: lk/arch/arm/plat-omap/include/bridge/wmdchnl.h
20061 ===================================================================
20062 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
20063 +++ lk/arch/arm/plat-omap/include/bridge/wmdchnl.h 2008-08-18 10:38:34.000000000 +0300
20064 @@ -0,0 +1,90 @@
20066 + * arch/arm/plat-omap/include/bridge/wmdchnl.h
20068 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
20070 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
20072 + * This package is free software; you can redistribute it and/or modify
20073 + * it under the terms of the GNU General Public License version 2 as
20074 + * published by the Free Software Foundation.
20076 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20077 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20078 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20079 + */
20083 + * ======== wmdchnl.h ========
20084 + * Description:
20085 + * Declares the upper edge channel class library functions required by
20086 + * all WMD / WCD driver interface tables. These functions are implemented
20087 + * by every class of WMD channel library.
20089 + * Public Functions:
20091 + * Notes:
20092 + * The function comment headers reside with the function typedefs in wmd.h.
20094 + *! Revision History:
20095 + *! ================
20096 + *! 07-Jan-2002 ag Added cBufSize to WMD_CHNL_AddIOReq().
20097 + *! 13-Oct-2000 jeh Added dwArg parameter to WMD_CHNL_AddIOReq(), added
20098 + *! WMD_CHNL_Idle and WMD_CHNL_RegisterNotify for DSPStream
20099 + *! support.
20100 + *! 11-Jul-1996 gp: Created.
20101 + */
20103 +#ifndef WMDCHNL_
20104 +#define WMDCHNL_
20106 + extern DSP_STATUS WMD_CHNL_Create(OUT struct CHNL_MGR **phChnlMgr,
20107 + struct DEV_OBJECT *hDevObject,
20108 + IN CONST struct CHNL_MGRATTRS
20109 + *pMgrAttrs);
20111 + extern DSP_STATUS WMD_CHNL_Destroy(struct CHNL_MGR *hChnlMgr);
20113 + extern DSP_STATUS WMD_CHNL_Open(OUT struct CHNL_OBJECT **phChnl,
20114 + struct CHNL_MGR *hChnlMgr,
20115 + CHNL_MODE uMode,
20116 + u32 uChnlId,
20117 + CONST IN OPTIONAL struct CHNL_ATTRS
20118 + *pAttrs);
20120 + extern DSP_STATUS WMD_CHNL_Close(struct CHNL_OBJECT *hChnl);
20122 + extern DSP_STATUS WMD_CHNL_AddIOReq(struct CHNL_OBJECT *hChnl,
20123 + void *pHostBuf,
20124 + u32 cBytes, u32 cBufSize,
20125 + OPTIONAL u32 dwDspAddr,
20126 + u32 dwArg);
20128 + extern DSP_STATUS WMD_CHNL_GetIOC(struct CHNL_OBJECT *hChnl,
20129 + u32 dwTimeOut,
20130 + OUT struct CHNL_IOC *pIOC);
20132 + extern DSP_STATUS WMD_CHNL_CancelIO(struct CHNL_OBJECT *hChnl);
20134 + extern DSP_STATUS WMD_CHNL_FlushIO(struct CHNL_OBJECT *hChnl,
20135 + u32 dwTimeOut);
20137 + extern DSP_STATUS WMD_CHNL_GetInfo(struct CHNL_OBJECT *hChnl,
20138 + OUT struct CHNL_INFO *pInfo);
20140 + extern DSP_STATUS WMD_CHNL_GetMgrInfo(struct CHNL_MGR *hChnlMgr,
20141 + u32 uChnlID,
20142 + OUT struct CHNL_MGRINFO
20143 + *pMgrInfo);
20145 + extern DSP_STATUS WMD_CHNL_Idle(struct CHNL_OBJECT *hChnl,
20146 + u32 dwTimeOut, bool fFlush);
20148 + extern DSP_STATUS WMD_CHNL_RegisterNotify(struct CHNL_OBJECT *hChnl,
20149 + u32 uEventMask,
20150 + u32 uNotifyType,
20151 + struct DSP_NOTIFICATION
20152 + *hNotification);
20154 +#endif /* WMDCHNL_ */
20155 Index: lk/arch/arm/plat-omap/include/bridge/wmddeh.h
20156 ===================================================================
20157 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
20158 +++ lk/arch/arm/plat-omap/include/bridge/wmddeh.h 2008-08-18 10:38:34.000000000 +0300
20159 @@ -0,0 +1,64 @@
20161 + * arch/arm/plat-omap/include/bridge/wmddeh.h
20163 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
20165 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
20167 + * This package is free software; you can redistribute it and/or modify
20168 + * it under the terms of the GNU General Public License version 2 as
20169 + * published by the Free Software Foundation.
20171 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20172 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20173 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20174 + */
20178 + * ======== wmddeh.h ========
20179 + * Description:
20180 + * Defines upper edge DEH functions required by all WMD/WCD driver
20181 + * interface tables.
20183 + * Public Functions:
20184 + * WMD_DEH_Create
20185 + * IVA_DEH_Create
20186 + * WMD_DEH_Destroy
20187 + * WMD_DEH_GetInfo
20188 + * WMD_DEH_RegisterNotify
20189 + * WMD_DEH_Notify
20191 + * Notes:
20192 + * Function comment headers reside with the function typedefs in wmd.h.
20194 + *! Revision History:
20195 + *! ================
20196 + *! 26-Dec-2004 hn: added IVA_DEH_Create.
20197 + *! 13-Sep-2001 kc: created.
20198 + */
20200 +#ifndef WMDDEH_
20201 +#define WMDDEH_
20203 +#include <devdefs.h>
20205 +#include <dehdefs.h>
20207 + extern DSP_STATUS WMD_DEH_Create(OUT struct DEH_MGR **phDehMgr,
20208 + struct DEV_OBJECT *hDevObject);
20210 + extern DSP_STATUS WMD_DEH_Destroy(struct DEH_MGR *hDehMgr);
20212 + extern DSP_STATUS WMD_DEH_GetInfo(struct DEH_MGR *hDehMgr,
20213 + struct DSP_ERRORINFO *pErrInfo);
20215 + extern DSP_STATUS WMD_DEH_RegisterNotify(struct DEH_MGR *hDehMgr,
20216 + u32 uEventMask,
20217 + u32 uNotifyType,
20218 + struct DSP_NOTIFICATION
20219 + *hNotification);
20221 + extern void WMD_DEH_Notify(struct DEH_MGR *hDehMgr,
20222 + u32 ulEventMask, u32 dwErrInfo);
20223 +#endif /* WMDDEH_ */
20224 Index: lk/arch/arm/plat-omap/include/bridge/wmdio.h
20225 ===================================================================
20226 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
20227 +++ lk/arch/arm/plat-omap/include/bridge/wmdio.h 2008-08-18 10:38:34.000000000 +0300
20228 @@ -0,0 +1,53 @@
20230 + * arch/arm/plat-omap/include/bridge/wmdio.h
20232 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
20234 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
20236 + * This package is free software; you can redistribute it and/or modify
20237 + * it under the terms of the GNU General Public License version 2 as
20238 + * published by the Free Software Foundation.
20240 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20241 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20242 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20243 + */
20247 + * ======== wmdio.h ========
20248 + * Description:
20249 + * Declares the upper edge IO functions required by
20250 + * all WMD / WCD driver interface tables.
20252 + * Public Functions:
20254 + * Notes:
20255 + * Function comment headers reside with the function typedefs in wmd.h.
20257 + *! Revision History:
20258 + *! ================
20259 + *! 27-Feb-2004 vp Added IVA releated function.
20260 + *! 06-Nov-2000 jeh Created.
20261 + */
20263 +#ifndef WMDIO_
20264 +#define WMDIO_
20266 +#include <devdefs.h>
20267 +#include <iodefs.h>
20269 + extern DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
20270 + struct DEV_OBJECT *hDevObject,
20271 + IN CONST struct IO_ATTRS *pMgrAttrs);
20273 + extern DSP_STATUS WMD_IO_Destroy(struct IO_MGR *hIOMgr);
20275 + extern DSP_STATUS WMD_IO_OnLoaded(struct IO_MGR *hIOMgr);
20277 + extern DSP_STATUS IVA_IO_OnLoaded(struct IO_MGR *hIOMgr);
20278 + extern DSP_STATUS WMD_IO_GetProcLoad(IN struct IO_MGR *hIOMgr,
20279 + OUT struct DSP_PROCLOADSTAT *pProcStat);
20281 +#endif /* WMDIO_ */
20282 Index: lk/arch/arm/plat-omap/include/bridge/wmdioctl.h
20283 ===================================================================
20284 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
20285 +++ lk/arch/arm/plat-omap/include/bridge/wmdioctl.h 2008-08-18 10:38:34.000000000 +0300
20286 @@ -0,0 +1,91 @@
20288 + * arch/arm/plat-omap/include/bridge/wmdioctl.h
20290 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
20292 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
20294 + * This package is free software; you can redistribute it and/or modify
20295 + * it under the terms of the GNU General Public License version 2 as
20296 + * published by the Free Software Foundation.
20298 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20299 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20300 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20301 + */
20305 + * ======== wmdioctl.h ========
20306 + * Description:
20307 + * BRIDGE Minidriver BRD_IOCtl reserved command definitions.
20309 + *! Revision History
20310 + *! ================
20311 + *! 19-Apr-2004 sb Updated HW typedefs
20312 + *! 16-Feb-2004 vp Added MMU endianness attributes to WMDIOCTL_EXTPROC
20313 + *! 21-Mar-2003 sb Changed WMDIOCTL_NUMOFMMUTLB from 7 to 32
20314 + *! 14-May-2001 sg Added codes for PWR.
20315 + *! 10-Aug-2001 ag Added _SETMMUCONFIG ioctl used for DSP-MMU init.
20316 + *! 16-Nov-1999 rajesh ?
20317 + *! 18-Jun-1998 ag Moved EMIF, SDRAM_C, & CE space init to ENBLEXTMEM ioctl.
20318 + *! Added ENBLEXTMEM, RESETDSP, UNRESETDSP & ASSERTSIG ioctls.
20319 + *! 07-Jun-1998 ag Added JTAG_SELECT, MAP_TBC, GET_CONFIGURATION ioctls.
20320 + *! 26-Jan-1998 jeh: Added START, RECV, and SEND ioctls.
20321 + *! 07-Nov-1997 nn: Added command to interrupt DSP for interrupt test.
20322 + *! 20-Oct-1997 nn: Added commands for getting and resetting interrupt count.
20323 + *! 17-Oct-1997 gp: Moved to src/wmd. Standardized prefix.
20324 + *! 08-Oct-1997 nn: Created.
20325 + */
20327 +#ifndef WMDIOCTL_
20328 +#define WMDIOCTL_
20330 +/* ------------------------------------ Hardware Abstraction Layer */
20331 +#include <hw_defs.h>
20332 +#include <hw_mmu.h>
20334 +/* Any IOCTLS at or above this value are reserved for standard WMD interfaces.*/
20335 +#define WMDIOCTL_RESERVEDBASE 0x8000
20337 +#define WMDIOCTL_CHNLREAD (WMDIOCTL_RESERVEDBASE + 0x10)
20338 +#define WMDIOCTL_CHNLWRITE (WMDIOCTL_RESERVEDBASE + 0x20)
20339 +#define WMDIOCTL_GETINTRCOUNT (WMDIOCTL_RESERVEDBASE + 0x30)
20340 +#define WMDIOCTL_RESETINTRCOUNT (WMDIOCTL_RESERVEDBASE + 0x40)
20341 +#define WMDIOCTL_INTERRUPTDSP (WMDIOCTL_RESERVEDBASE + 0x50)
20342 +#define WMDIOCTL_SETMMUCONFIG (WMDIOCTL_RESERVEDBASE + 0x60) /* DMMU */
20343 +#define WMDIOCTL_PWRCONTROL (WMDIOCTL_RESERVEDBASE + 0x70) /* PWR */
20345 +/* attention, modifiers:
20346 + * Some of these control enumerations are made visible to user for power
20347 + * control, so any changes to this list, should also be updated in the user
20348 + * header file 'dbdefs.h' ***/
20349 +/* These ioctls are reserved for PWR power commands for the DSP */
20350 +#define WMDIOCTL_DEEPSLEEP (WMDIOCTL_PWRCONTROL + 0x0)
20351 +#define WMDIOCTL_EMERGENCYSLEEP (WMDIOCTL_PWRCONTROL + 0x1)
20352 +#define WMDIOCTL_WAKEUP (WMDIOCTL_PWRCONTROL + 0x2)
20353 +#define WMDIOCTL_PWRENABLE (WMDIOCTL_PWRCONTROL + 0x3)
20354 +#define WMDIOCTL_PWRDISABLE (WMDIOCTL_PWRCONTROL + 0x4)
20355 +#define WMDIOCTL_CLK_CTRL (WMDIOCTL_PWRCONTROL + 0x7)
20356 +#define WMDIOCTL_PWR_HIBERNATE (WMDIOCTL_PWRCONTROL + 0x8) /*DSP Initiated
20357 + * Hibernate*/
20358 +#define WMDIOCTL_PRESCALE_NOTIFY (WMDIOCTL_PWRCONTROL + 0x9)
20359 +#define WMDIOCTL_POSTSCALE_NOTIFY (WMDIOCTL_PWRCONTROL + 0xA)
20360 +#define WMDIOCTL_CONSTRAINT_REQUEST (WMDIOCTL_PWRCONTROL + 0xB)
20362 +/* Number of actual DSP-MMU TLB entrries */
20363 +#define WMDIOCTL_NUMOFMMUTLB 32
20365 +struct WMDIOCTL_EXTPROC {
20366 + u32 ulDspVa; /* DSP virtual address */
20367 + u32 ulGppPa; /* GPP physical address */
20368 + /* GPP virtual address. __va does not work for ioremapped addresses */
20369 + u32 ulGppVa;
20370 + u32 ulSize; /* Size of the mapped memory in bytes */
20371 + enum HW_Endianism_t endianism;
20372 + enum HW_MMUMixedSize_t mixedMode;
20373 + enum HW_ElementSize_t elemSize;
20376 +#endif /* WMDIOCTL_ */
20378 Index: lk/arch/arm/plat-omap/include/bridge/wmdmsg.h
20379 ===================================================================
20380 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
20381 +++ lk/arch/arm/plat-omap/include/bridge/wmdmsg.h 2008-08-18 10:38:34.000000000 +0300
20382 @@ -0,0 +1,70 @@
20384 + * arch/arm/plat-omap/include/bridge/wmdmsg.h
20386 + * DSP-BIOS Bridge driver support functions for TI OMAP processors.
20388 + * Copyright (C) 2005-2006 Texas Instruments, Inc.
20390 + * This package is free software; you can redistribute it and/or modify
20391 + * it under the terms of the GNU General Public License version 2 as
20392 + * published by the Free Software Foundation.
20394 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20395 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20396 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20397 + */
20401 + * ======== wmdmsg.h ========
20402 + * Description:
20403 + * Declares the upper edge message class library functions required by
20404 + * all WMD / WCD driver interface tables. These functions are
20405 + * implemented by every class of WMD channel library.
20407 + * Public Functions:
20409 + * Notes:
20410 + * Function comment headers reside with the function typedefs in wmd.h.
20412 + *! Revision History:
20413 + *! ================
20414 + *! 06-Dec-2000 jeh Added uEventMask to WMD_MSG_RegisterNotify(). Added
20415 + *! WMD_MSG_SetQueueId().
20416 + *! 17-Nov-2000 jeh Created.
20417 + */
20419 +#ifndef WMDMSG_
20420 +#define WMDMSG_
20422 +#include <msgdefs.h>
20424 + extern DSP_STATUS WMD_MSG_Create(OUT struct MSG_MGR **phMsgMgr,
20425 + struct DEV_OBJECT *hDevObject,
20426 + MSG_ONEXIT msgCallback);
20428 + extern DSP_STATUS WMD_MSG_CreateQueue(struct MSG_MGR *hMsgMgr,
20429 + OUT struct MSG_QUEUE **phMsgQueue,
20430 + u32 dwId, u32 uMaxMsgs,
20431 + HANDLE h);
20433 + extern void WMD_MSG_Delete(struct MSG_MGR *hMsgMgr);
20435 + extern void WMD_MSG_DeleteQueue(struct MSG_QUEUE *hMsgQueue);
20437 + extern DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue,
20438 + struct DSP_MSG *pMsg, u32 uTimeout);
20440 + extern DSP_STATUS WMD_MSG_Put(struct MSG_QUEUE *hMsgQueue,
20441 + IN CONST struct DSP_MSG *pMsg,
20442 + u32 uTimeout);
20444 + extern DSP_STATUS WMD_MSG_RegisterNotify(struct MSG_QUEUE *hMsgQueue,
20445 + u32 uEventMask,
20446 + u32 uNotifyType,
20447 + struct DSP_NOTIFICATION
20448 + *hNotification);
20450 + extern void WMD_MSG_SetQueueId(struct MSG_QUEUE *hMsgQueue, u32 dwId);
20452 +#endif /* WMDMSG_ */