4
* Syslink driver support functions for TI OMAP processors.
6
* Copyright (C) 2009-2010 Texas Instruments, Inc.
8
* This package is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License version 2 as
10
* published by the Free Software Foundation.
12
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
#ifndef SYSLINK_PROCMGR_DRVDEFS_H
19
#define SYSLINK_PROCMGR_DRVDEFS_H
21
#include <linux/types.h>
27
/* =================================
29
* =================================
32
* Base structure for ProcMgr command args. This needs to be the first
33
* field in all command args structures.
35
struct proc_mgr_cmd_args {
37
/*Status of the API being called. */
40
/* --------------------------------------
41
* IOCTL command IDs for ProcMgr
42
* ---------------------------------------
45
* Base command ID for ProcMgr
47
#define PROCMGR_BASE_CMD 0x100
50
* Command for ProcMgr_getConfig
52
#define CMD_PROCMGR_GETCONFIG (PROCMGR_BASE_CMD + 1)
55
* Command for ProcMgr_setup
57
#define CMD_PROCMGR_SETUP (PROCMGR_BASE_CMD + 2)
60
* Command for ProcMgr_setup
62
#define CMD_PROCMGR_DESTROY (PROCMGR_BASE_CMD + 3)
65
* Command for ProcMgr_destroy
67
#define CMD_PROCMGR_PARAMS_INIT (PROCMGR_BASE_CMD + 4)
70
* Command for ProcMgr_create
72
#define CMD_PROCMGR_CREATE (PROCMGR_BASE_CMD + 5)
75
* Command for ProcMgr_delete
77
#define CMD_PROCMGR_DELETE (PROCMGR_BASE_CMD + 6)
80
* Command for ProcMgr_open
82
#define CMD_PROCMGR_OPEN (PROCMGR_BASE_CMD + 7)
85
* Command for ProcMgr_close
87
#define CMD_PROCMGR_CLOSE (PROCMGR_BASE_CMD + 8)
90
* Command for ProcMgr_getAttachParams
92
#define CMD_PROCMGR_GETATTACHPARAMS (PROCMGR_BASE_CMD + 9)
95
* Command for ProcMgr_attach
97
#define CMD_PROCMGR_ATTACH (PROCMGR_BASE_CMD + 10)
100
* Command for ProcMgr_detach
102
#define CMD_PROCMGR_DETACH (PROCMGR_BASE_CMD + 11)
105
* Command for ProcMgr_load
107
#define CMD_PROCMGR_LOAD (PROCMGR_BASE_CMD + 12)
110
* Command for ProcMgr_unload
112
#define CMD_PROCMGR_UNLOAD (PROCMGR_BASE_CMD + 13)
115
* Command for ProcMgr_getStartParams
117
#define CMD_PROCMGR_GETSTARTPARAMS (PROCMGR_BASE_CMD + 14)
120
* Command for ProcMgr_start
122
#define CMD_PROCMGR_START (PROCMGR_BASE_CMD + 15)
125
* Command for ProcMgr_stop
127
#define CMD_PROCMGR_STOP (PROCMGR_BASE_CMD + 16)
130
* Command for ProcMgr_getState
132
#define CMD_PROCMGR_GETSTATE (PROCMGR_BASE_CMD + 17)
135
* Command for ProcMgr_read
137
#define CMD_PROCMGR_READ (PROCMGR_BASE_CMD + 18)
140
* Command for ProcMgr_write
142
#define CMD_PROCMGR_WRITE (PROCMGR_BASE_CMD + 19)
145
* Command for ProcMgr_control
147
#define CMD_PROCMGR_CONTROL (PROCMGR_BASE_CMD + 20)
150
* Command for ProcMgr_translateAddr
152
#define CMD_PROCMGR_TRANSLATEADDR (PROCMGR_BASE_CMD + 22)
155
* Command for ProcMgr_getSymbolAddress
157
#define CMD_PROCMGR_GETSYMBOLADDRESS (PROCMGR_BASE_CMD + 23)
160
* Command for ProcMgr_map
162
#define CMD_PROCMGR_MAP (PROCMGR_BASE_CMD + 24)
165
* Command for ProcMgr_registerNotify
167
#define CMD_PROCMGR_REGISTERNOTIFY (PROCMGR_BASE_CMD + 25)
170
* Command for ProcMgr_getProcInfo
172
#define CMD_PROCMGR_GETPROCINFO (PROCMGR_BASE_CMD + 26)
175
* Command for ProcMgr_unmap
177
#define CMD_PROCMGR_UNMAP (PROCMGR_BASE_CMD + 27)
180
* Command for ProcMgr_getVirtToPhysPages
182
#define CMD_PROCMGR_GETVIRTTOPHYS (PROCMGR_BASE_CMD + 28)
186
* Command to get Board revision
188
#define CMD_PROCMGR_GETBOARDREV (PROCMGR_BASE_CMD + 31)
192
/* ----------------------------------------------------------------------------
193
* Command arguments for ProcMgr
194
* ----------------------------------------------------------------------------
197
* Command arguments for ProcMgr_getConfig
199
struct proc_mgr_cmd_args_get_config {
200
struct proc_mgr_cmd_args commond_args;
201
/*Common command args */
202
struct proc_mgr_config *cfg;
203
/*Pointer to the ProcMgr module configuration structure in which the
204
default config is to be returned. */
208
* Command arguments for ProcMgr_setup
210
struct proc_mgr_cmd_args_setup {
211
struct proc_mgr_cmd_args commond_args;
212
/*Common command args */
213
struct proc_mgr_config *cfg;
214
/*Optional ProcMgr module configuration. If provided as NULL, default
215
configuration is used. */
219
* Command arguments for ProcMgr_destroy
221
struct proc_mgr_cmd_args_destroy {
222
struct proc_mgr_cmd_args commond_args;
223
/*Common command args */
227
* Command arguments for ProcMgr_Params_init
229
struct proc_mgr_cmd_args_params_init {
230
struct proc_mgr_cmd_args commond_args;
231
/*Common command args */
233
/*Handle to the ProcMgr object. */
234
struct proc_mgr_params *params;
235
/*Pointer to the ProcMgr instance params structure in which the default
236
params is to be returned. */
240
* Command arguments for ProcMgr_create
242
struct proc_mgr_cmd_args_create {
243
struct proc_mgr_cmd_args commond_args;
244
/*Common command args */
246
/*Processor ID represented by this ProcMgr instance */
247
struct proc_mgr_params params;
248
/*ProcMgr instance configuration parameters. */
250
/*Handle to the created ProcMgr object */
254
* Command arguments for ProcMgr_delete
256
struct proc_mgr_cmd_args_delete{
257
struct proc_mgr_cmd_args commond_args;
258
/*Common command args */
260
/*Pointer to Handle to the ProcMgr object */
264
* Command arguments for ProcMgr_open
266
struct proc_mgr_cmd_args_open {
267
struct proc_mgr_cmd_args commond_args;
268
/*Common command args */
270
/*Processor ID represented by this ProcMgr instance */
272
/*Handle to the opened ProcMgr object. */
273
struct proc_mgr_proc_info proc_info;
274
/*Processor information. */
278
* Command arguments for ProcMgr_close
280
struct proc_mgr_cmd_args_close{
281
struct proc_mgr_cmd_args commond_args;
282
/*Common command args */
284
/*Handle to the ProcMgr object */
285
struct proc_mgr_proc_info proc_info;
286
/*Processor information. */
290
* Command arguments for ProcMgr_getAttachParams
292
struct proc_mgr_cmd_args_get_attach_params{
293
struct proc_mgr_cmd_args commond_args;
294
/*Common command args */
296
/*Handle to the ProcMgr object. */
297
struct proc_mgr_attach_params *params;
298
/*Pointer to the ProcMgr attach params structure in which the default
299
params is to be returned. */
303
* Command arguments for ProcMgr_attach
305
struct proc_mgr_cmd_args_attach {
306
struct proc_mgr_cmd_args commond_args;
307
/*Common command args */
309
/*Handle to the ProcMgr object. */
310
struct proc_mgr_attach_params *params;
311
/*Optional ProcMgr attach parameters. */
312
struct proc_mgr_proc_info proc_info;
313
/*Processor information. */
317
* Command arguments for ProcMgr_detach
319
struct proc_mgr_cmd_args_detach {
320
struct proc_mgr_cmd_args commond_args;
321
/*Common command args */
323
/*Handle to the ProcMgr object */
324
struct proc_mgr_proc_info proc_info;
325
/*Processor information. */
330
* Command arguments for ProcMgr_getStartParams
332
struct proc_mgr_cmd_args_get_start_params {
333
struct proc_mgr_cmd_args commond_args;
334
/*Common command args */
336
/*Entry point for the image*/
338
/*Handle to the ProcMgr object */
339
struct proc_mgr_start_params *params;
340
/*Pointer to the ProcMgr start params structure in which the default
341
params is to be returned. */
345
* Command arguments for ProcMgr_getState
347
struct proc_mgr_cmd_args_get_state {
348
struct proc_mgr_cmd_args commond_args;
349
/*Common command args */
351
/* Handle to the ProcMgr object */
352
enum proc_mgr_state proc_mgr_state;
353
/*Current state of the ProcMgr object. */
357
* Command arguments for ProcMgr_read
359
struct proc_mgr_cmd_args_read {
360
struct proc_mgr_cmd_args commond_args;
361
/*Common command args */
363
/*Handle to the ProcMgr object */
365
/*Address in space processor's address space of the memory region to
368
/*IN/OUT parameter. As an IN-parameter, it takes in the number of bytes
369
to be read. When the function returns, this parameter contains the
370
number of bytes actually read. */
372
/*User-provided buffer in which the slave processor's memory contents
377
* Command arguments for ProcMgr_write
379
struct proc_mgr_cmd_args_write {
380
struct proc_mgr_cmd_args commond_args;
381
/*Common command args */
383
/*Handle to the ProcMgr object */
385
/*Address in space processor's address space of the memory region to
388
/*IN/OUT parameter. As an IN-parameter, it takes in the number of bytes
389
to be written. When the function returns, this parameter contains the
390
number of bytes actually written. */
392
/*User-provided buffer from which the data is to be written into the
393
slave processor's memory. */
397
* Command arguments for ProcMgr_control
399
struct proc_mgr_cmd_args_control {
400
struct proc_mgr_cmd_args commond_args;
401
/*Common command args */
403
/*Handle to the ProcMgr object */
405
/*Device specific processor command */
407
/*Arguments specific to the type of command. */
411
* Command arguments for ProcMgr_translateAddr
413
struct proc_mgr_cmd_args_translate_addr {
414
struct proc_mgr_cmd_args commond_args;
415
/*Common command args */
417
/*Handle to the ProcMgr object */
419
/*Return parameter: Pointer to receive the translated address. */
420
enum proc_mgr_addr_type dst_addr_type;
421
/*Destination address type requested */
423
/*Source address in the source address space */
424
enum proc_mgr_addr_type src_addr_type;
425
/*Source address type */
429
* Command arguments for ProcMgr_getSymbolAddress
431
struct proc_mgr_cmd_args_get_symbol_address {
432
struct proc_mgr_cmd_args commond_args;
433
/*Common command args */
435
/*Handle to the ProcMgr object */
437
/*ID of the file received from the load function */
439
/*Name of the symbol */
441
/*Return parameter: Symbol address */
445
* Command arguments for ProcMgr_registerNotify
447
struct proc_mgr_cmd_args_register_notify {
448
struct proc_mgr_cmd_args commond_args;
449
/*Common command args */
451
/*Handle to the ProcMgr object */
452
int (*callback_fxn)(u16 proc_id, void *handle,
453
enum proc_mgr_state from_state, enum proc_mgr_state to_state);
454
/*Handling function to be registered. */
456
/*Optional arguments associated with the handler fxn. */
457
enum proc_mgr_state state[];
458
/*Array of target states for which registration is required. */
462
* Command arguments for ProcMgr_getProcInfo
464
struct proc_mgr_cmd_args_get_proc_info {
465
struct proc_mgr_cmd_args commond_args;
466
/*Common command args */
468
/*Handle to the ProcMgr object */
469
struct proc_mgr_proc_info *proc_info;
470
/*Pointer to the ProcInfo object to be populated. */
474
* Command arguments for ProcMgr_virtToPhys
476
struct proc_mgr_cmd_args_get_virt_to_phys {
477
struct proc_mgr_cmd_args commond_args;
478
/*Common command args */
481
/* mem entries buffer */
483
/* number of entries */
487
struct proc_mgr_cmd_args_cpurev {
488
struct proc_mgr_cmd_args commond_args;