d3d55834a9fbd3f303e2717e2f4a6ecfb8dd66be
1 /**
2 * @file OMAP5430BenelliProc.h
3 *
4 * @brief Processor interface for OMAP5430Benelli.
5 *
6 *
7 * @ver 02.00.00.44_pre-alpha3
8 *
9 * ============================================================================
10 *
11 * Copyright (c) 2010-2011, Texas Instruments Incorporated
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 *
17 * * Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 *
20 * * Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * * Neither the name of Texas Instruments Incorporated nor the names of
25 * its contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
32 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 * Contact information for paper mail:
40 * Texas Instruments
41 * Post Office Box 655303
42 * Dallas, Texas 75265
43 * Contact information:
44 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
45 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
46 * ============================================================================
47 *
48 */
51 #ifndef OMAP5430BENELLIPROC_H_0xbbed
52 #define OMAP5430BENELLIPROC_H_0xbbed
55 /* Module headers */
56 #include <ti/syslink/ProcMgr.h>
57 #include <ProcDefs.h>
60 #if defined (__cplusplus)
61 extern "C" {
62 #endif
65 /*!
66 * @def OMAP5430BENELLIPROC_MODULEID
67 * @brief Module ID for OMAP5430BENELLI.
68 */
69 #define OMAP5430BENELLIPROC_MODULEID (UInt16) 0xbbec
71 /* =============================================================================
72 * All success and failure codes for the module
73 * =============================================================================
74 */
75 /*!
76 * @def OMAP5430BENELLIPROC_STATUSCODEBASE
77 * @brief Error code base for ProcMgr.
78 */
79 #define OMAP5430BENELLIPROC_STATUSCODEBASE (OMAP5430BENELLIPROC_MODULEID << 12u)
81 /*!
82 * @def OMAP5430BENELLIPROC_MAKE_FAILURE
83 * @brief Macro to make failure code.
84 */
85 #define OMAP5430BENELLIPROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
86 | (OMAP5430BENELLIPROC_STATUSCODEBASE + (x))))
88 /*!
89 * @def OMAP5430BENELLIPROC_MAKE_SUCCESS
90 * @brief Macro to make success code.
91 */
92 #define OMAP5430BENELLIPROC_MAKE_SUCCESS(x) (OMAP5430BENELLIPROC_STATUSCODEBASE + (x))
94 /*!
95 * @def OMAP5430BENELLIPROC_E_MMUENTRYEXISTS
96 * @brief Specified MMU entry already exists.
97 */
98 #define OMAP5430BENELLIPROC_E_MMUENTRYEXISTS OMAP5430BENELLIPROC_MAKE_FAILURE(1)
100 /*!
101 * @def OMAP5430BENELLIPROC_E_ISR
102 * @brief Error occurred during ISR operation.
103 */
104 #define OMAP5430BENELLIPROC_E_ISR OMAP5430BENELLIPROC_MAKE_FAILURE(2)
106 /*!
107 * @def OMAP5430BENELLIPROC_E_MMUCONFIG
108 * @brief Error occurred during MMU configuration
109 */
110 #define OMAP5430BENELLIPROC_E_MMUCONFIG OMAP5430BENELLIPROC_MAKE_FAILURE(3)
112 /*!
113 * @def OMAP5430BENELLIPROC_E_OSFAILURE
114 * @brief Failure in an OS-specific operation.
115 */
116 #define OMAP5430BENELLIPROC_E_OSFAILURE OMAP5430BENELLIPROC_MAKE_FAILURE(4)
118 /*!
119 * @def OMAP5430BENELLIPROC_E_INVALIDARG
120 * @brief Argument passed to a function is invalid.
121 */
122 #define OMAP5430BENELLIPROC_E_INVALIDARG OMAP5430BENELLIPROC_MAKE_FAILURE(5)
124 /*!
125 * @def OMAP5430BENELLIPROC_E_MEMORY
126 * @brief Memory allocation failed.
127 */
128 #define OMAP5430BENELLIPROC_E_MEMORY OMAP5430BENELLIPROC_MAKE_FAILURE(6)
130 /*!
131 * @def OMAP5430BENELLIPROC_E_HANDLE
132 * @brief Invalid object handle specified
133 */
134 #define OMAP5430BENELLIPROC_E_HANDLE OMAP5430BENELLIPROC_MAKE_FAILURE(7)
136 /*!
137 * @def OMAP5430BENELLIPROC_E_ACCESSDENIED
138 * @brief The operation is not permitted in this process.
139 */
140 #define OMAP5430BENELLIPROC_E_ACCESSDENIED OMAP5430BENELLIPROC_MAKE_FAILURE(8)
142 /*!
143 * @def OMAP5430BENELLIPROC_E_FAIL
144 * @brief Generic failure.
145 */
146 #define OMAP5430BENELLIPROC_E_FAIL OMAP5430BENELLIPROC_MAKE_FAILURE(9)
148 /*!
149 * @def OMAP5430BENELLIPROC_SUCCESS
150 * @brief Operation successful.
151 */
152 #define OMAP5430BENELLIPROC_SUCCESS OMAP5430BENELLIPROC_MAKE_SUCCESS(0)
154 /*!
155 * @def OMAP5430BENELLIPROC_S_ALREADYSETUP
156 * @brief The OMAP5430BENELLIPROC module has already been setup in this
157 * process.
158 */
159 #define OMAP5430BENELLIPROC_S_ALREADYSETUP OMAP5430BENELLIPROC_MAKE_SUCCESS(1)
161 /*!
162 * @def OMAP5430BENELLIPROC_S_OPENHANDLE
163 * @brief Other OMAP5430BENELLIPROC clients have still setup the
164 * OMAP5430BENELLIPROC module.
165 */
166 #define OMAP5430BENELLIPROC_S_SETUP OMAP5430BENELLIPROC_MAKE_SUCCESS(2)
168 /*!
169 * @def OMAP5430BENELLIPROC_S_OPENHANDLE
170 * @brief Other OMAP5430BENELLIPROC handles are still open in this process.
171 */
172 #define OMAP5430BENELLIPROC_S_OPENHANDLE OMAP5430BENELLIPROC_MAKE_SUCCESS(3)
174 /*!
175 * @def OMAP5430BENELLIPROC_S_ALREADYEXISTS
176 * @brief The OMAP5430BENELLIPROC instance has already been created/opened in
177 * this process
178 */
179 #define OMAP5430BENELLIPROC_S_ALREADYEXISTS OMAP5430BENELLIPROC_MAKE_SUCCESS(4)
182 /* =============================================================================
183 * Macros and types
184 * =============================================================================
185 */
187 /*!
188 * @brief Enumerations to indicate types of control commands supported.
189 */
190 typedef enum {
191 Omap5430BenelliProc_CtrlCmd_Suspend = 0u,
192 /*!< Suspend the remote proc. */
193 Omap5430BenelliProc_CtrlCmd_Resume = 1u,
194 /*!< Resume the remote proc. */
195 Omap5430BenelliProc_CtrlCmd_EndValue = 2u
196 /*!< End delimiter indicating start of invalid values for this enum */
197 } Omap5430BenelliProc_CtrlCmd ;
199 /*!
200 * @brief Module configuration structure.
201 */
202 typedef struct OMAP5430BENELLIPROC_Config {
203 UInt32 reserved; /*!< Reserved field (not currently required) */
204 } OMAP5430BENELLIPROC_Config;
206 typedef struct OMAP5430TESLAPROC_Config {
207 UInt32 reserved; /*!< Reserved field (not currently required) */
208 } OMAP5430TESLAPROC_Config;
210 /*!
211 * @brief Configuration parameters specific to this processor.
212 */
213 typedef struct OMAP5430BENELLIPROC_Params_tag {
214 UInt32 numMemEntries;
215 /*!< Number of memory regions to be configured. */
216 ProcMgr_AddrInfo memEntries [ProcMgr_MAX_MEMORY_REGIONS];
217 /*!< Array of information structures for memory regions to be configured. */
218 Processor_Handle procHandle;
219 UInt32 carveoutAddr [ProcMgr_MAX_MEMORY_REGIONS];
220 /*!< The address of the carveout for shared mem */
221 UInt32 carveoutSize [ProcMgr_MAX_MEMORY_REGIONS];
222 /*!< The length of the carveout for shared mem */
223 } OMAP5430BENELLIPROC_Params;
225 /*!
226 * @brief Defines OMAP5430BENELLIPROC object handle
227 */
228 /*!
229 * @brief DM740M3VIDEOPROC instance object.
230 */
231 struct OMAP5430BENELLIPROC_Object_tag {
232 OMAP5430BENELLIPROC_Params params;
233 /*!< Instance parameters (configuration values) */
234 Ptr halObject;
235 /*!< Pointer to the Hardware Abstraction Layer object. */
236 ProcMgr_Handle pmHandle;
237 /*!< Handle to proc manager */
238 Processor_Handle procHandle;
239 /*!< Handle to processor */
240 };
242 /* Defines the OMAP5430BENELLIPROC object type. */
243 typedef struct OMAP5430BENELLIPROC_Object_tag OMAP5430BENELLIPROC_Object;
245 typedef struct OMAP5430BENELLIPROC_Object * OMAP5430BENELLIPROC_Handle;
248 /* =============================================================================
249 * APIs
250 * =============================================================================
251 */
253 /* Function to get the default configuration for the OMAP5430BENELLIPROC
254 * module. */
255 Void
256 OMAP5430BENELLIPROC_get_config (OMAP5430BENELLIPROC_Config * cfg, Int ProcType);
258 /* Function to setup the OMAP5430BENELLIPROC module. */
259 Int
260 OMAP5430BENELLIPROC_setup (OMAP5430BENELLIPROC_Config * cfg, Int ProcType);
262 /* Function to destroy the OMAP5430BENELLIPROC module. */
263 Int
264 OMAP5430BENELLIPROC_destroy (Int ProcType);
266 /* Function to initialize the parameters for this processor instance. */
267 Void
268 OMAP5430BENELLIPROC_Params_init (OMAP5430BENELLIPROC_Handle handle,
269 OMAP5430BENELLIPROC_Params * params,
270 Int ProcType);
272 /* Function to create an instance of this processor. */
273 OMAP5430BENELLIPROC_Handle
274 OMAP5430BENELLIPROC_create ( UInt16 procId,
275 const OMAP5430BENELLIPROC_Params * params);
277 /* Function to delete an instance of this processor. */
278 Int
279 OMAP5430BENELLIPROC_delete (OMAP5430BENELLIPROC_Handle * handlePtr);
281 /* Function to open an instance of this processor. */
282 Int
283 OMAP5430BENELLIPROC_open (OMAP5430BENELLIPROC_Handle * handlePtr,
284 UInt16 procId);
286 /* Function to close an instance of this processor. */
287 Int
288 OMAP5430BENELLIPROC_close (OMAP5430BENELLIPROC_Handle * handlePtr);
290 Int
291 OMAP5430BENELLIPROC_attach (Processor_Handle handle,
292 Processor_AttachParams * params);
294 Int
295 OMAP5430BENELLIPROC_detach (Processor_Handle handle);
297 Int
298 OMAP5430BENELLIPROC_start (Processor_Handle handle,
299 UInt32 entryPt,
300 Processor_StartParams * params);
302 Int
303 OMAP5430BENELLIPROC_stop (Processor_Handle handle);
305 Int
306 OMAP5430BENELLIPROC_read (Processor_Handle handle,
307 UInt32 procAddr,
308 UInt32 * numBytes,
309 Ptr buffer);
311 Int
312 OMAP5430BENELLIPROC_write (Processor_Handle handle,
313 UInt32 procAddr,
314 UInt32 * numBytes,
315 Ptr buffer);
317 Int
318 OMAP5430BENELLIPROC_control (Processor_Handle handle, Int32 cmd, Ptr arg);
320 Int
321 OMAP5430BENELLIPROC_map (Processor_Handle handle,
322 UInt32 * dstAddr,
323 UInt32 nSegs,
324 Memory_SGList * sglist);
326 Int
327 OMAP5430BENELLIPROC_unmap (Processor_Handle handle,
328 UInt32 addr,
329 UInt32 size);
331 Int
332 OMAP5430BENELLIPROC_translate (Processor_Handle handle,
333 UInt32 * dstAddr,
334 UInt32 srcAddr);
336 Int
337 OMAP5430BENELLI_virtToPhys (Processor_Handle handle,
338 UInt32 da,
339 UInt32 * mappedEntries,
340 UInt32 numEntries);
342 Int
343 OMAP5430BENELLIPROC_procInfo (Processor_Handle handle,
344 ProcMgr_ProcInfo * procInfo);
346 Int
347 OMAP5430BENELLIPROC_registerNotify (Processor_Handle handle,
348 ProcMgr_CallbackFxn cbFxn,
349 Ptr arg,
350 Int32 timeout,
351 ProcMgr_State state []);
353 Int
354 OMAP5430BENELLIPROC_unregisterNotify (Processor_Handle handle,
355 ProcMgr_CallbackFxn cbFxn,
356 Ptr arg,
357 ProcMgr_State state []);
359 #if defined (__cplusplus)
360 }
361 #endif /* defined (__cplusplus) */
363 #endif /* OMAP5430BENELLIPROC_H_0xbbec */