summaryrefslogtreecommitdiff
path: root/drivers/dsp/syslink/procmgr/procmgr_drvdefs.h
blob: fc0015d5882206f30f0f88eeca989fe1bb24597e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
/*
 * procmgr_drvdefs.h
 *
 * Syslink driver support functions for TI OMAP processors.
 *
 * Copyright (C) 2009-2010 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */


#ifndef SYSLINK_PROCMGR_DRVDEFS_H
#define SYSLINK_PROCMGR_DRVDEFS_H

#include <linux/types.h>

/* Module headers */
#include <procmgr.h>


/* =================================
 *  Macros and types
 * =================================
 */
/*
 * Base structure for ProcMgr command args. This needs to be the first
 *  field in all command args structures.
 */
struct proc_mgr_cmd_args {
	int api_status;
	/*Status of the API being called. */
};

/*  --------------------------------------
 *  IOCTL command IDs for ProcMgr
 *  ---------------------------------------
 */
/*
 * Base command ID for ProcMgr
 */
#define PROCMGR_BASE_CMD			0x100

/*
 * Command for ProcMgr_getConfig
 */
#define CMD_PROCMGR_GETCONFIG		(PROCMGR_BASE_CMD + 1)

/*
 * Command for ProcMgr_setup
 */
#define CMD_PROCMGR_SETUP			(PROCMGR_BASE_CMD + 2)

/*
 * Command for ProcMgr_setup
 */
#define CMD_PROCMGR_DESTROY			(PROCMGR_BASE_CMD + 3)

/*
 * Command for ProcMgr_destroy
 */
#define CMD_PROCMGR_PARAMS_INIT		(PROCMGR_BASE_CMD + 4)

/*
 * Command for ProcMgr_create
 */
#define CMD_PROCMGR_CREATE			(PROCMGR_BASE_CMD + 5)

/*
 * Command for ProcMgr_delete
 */
#define CMD_PROCMGR_DELETE			(PROCMGR_BASE_CMD + 6)

/*
 * Command for ProcMgr_open
 */
#define CMD_PROCMGR_OPEN			(PROCMGR_BASE_CMD + 7)

/*
 * Command for ProcMgr_close
 */
#define CMD_PROCMGR_CLOSE			(PROCMGR_BASE_CMD + 8)

/*
 * Command for ProcMgr_getAttachParams
 */
#define CMD_PROCMGR_GETATTACHPARAMS		(PROCMGR_BASE_CMD + 9)

/*
 * Command for ProcMgr_attach
 */
#define CMD_PROCMGR_ATTACH			(PROCMGR_BASE_CMD + 10)

/*
 * Command for ProcMgr_detach
 */
#define CMD_PROCMGR_DETACH			(PROCMGR_BASE_CMD + 11)

/*
 * Command for ProcMgr_load
 */
#define CMD_PROCMGR_LOAD			(PROCMGR_BASE_CMD + 12)

/*
 * Command for ProcMgr_unload
 */
#define CMD_PROCMGR_UNLOAD			(PROCMGR_BASE_CMD + 13)

/*
 * Command for ProcMgr_getStartParams
 */
#define CMD_PROCMGR_GETSTARTPARAMS		(PROCMGR_BASE_CMD + 14)

/*
 * Command for ProcMgr_start
 */
#define CMD_PROCMGR_START			(PROCMGR_BASE_CMD + 15)

/*
 * Command for ProcMgr_stop
 */
#define CMD_PROCMGR_STOP			(PROCMGR_BASE_CMD + 16)

/*
 * Command for ProcMgr_getState
 */
#define CMD_PROCMGR_GETSTATE			(PROCMGR_BASE_CMD + 17)

/*
 * Command for ProcMgr_read
 */
#define CMD_PROCMGR_READ			(PROCMGR_BASE_CMD + 18)

/*
 * Command for ProcMgr_write
 */
#define CMD_PROCMGR_WRITE			(PROCMGR_BASE_CMD + 19)

/*
 * Command for ProcMgr_control
 */
#define CMD_PROCMGR_CONTROL			(PROCMGR_BASE_CMD + 20)

/*
 * Command for ProcMgr_translateAddr
 */
#define CMD_PROCMGR_TRANSLATEADDR		(PROCMGR_BASE_CMD + 22)

/*
 * Command for ProcMgr_getSymbolAddress
 */
#define CMD_PROCMGR_GETSYMBOLADDRESS		(PROCMGR_BASE_CMD + 23)

/*
 * Command for ProcMgr_map
 */
#define CMD_PROCMGR_MAP				(PROCMGR_BASE_CMD + 24)

/*
 * Command for ProcMgr_registerNotify
 */
#define CMD_PROCMGR_REGISTERNOTIFY		(PROCMGR_BASE_CMD + 25)

/*
 * Command for ProcMgr_getProcInfo
 */
#define CMD_PROCMGR_GETPROCINFO			(PROCMGR_BASE_CMD + 26)

/*
 * Command for ProcMgr_unmap
 */
#define CMD_PROCMGR_UNMAP			(PROCMGR_BASE_CMD + 27)

/*
 * Command for ProcMgr_getVirtToPhysPages
 */
#define CMD_PROCMGR_GETVIRTTOPHYS		(PROCMGR_BASE_CMD + 28)


/*
 * Command to get Board revision
 */
#define CMD_PROCMGR_GETBOARDREV			(PROCMGR_BASE_CMD + 31)



/*  ----------------------------------------------------------------------------
 *  Command arguments for ProcMgr
 *  ----------------------------------------------------------------------------
 */
/*
 * Command arguments for ProcMgr_getConfig
 */
struct proc_mgr_cmd_args_get_config {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	struct proc_mgr_config *cfg;
	/*Pointer to the ProcMgr module configuration structure in which the
	 default config is to be returned. */
};

/*
 * Command arguments for ProcMgr_setup
 */
struct proc_mgr_cmd_args_setup {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	struct proc_mgr_config *cfg;
	/*Optional ProcMgr module configuration. If provided as NULL, default
	 configuration is used. */
};

/*
 * Command arguments for ProcMgr_destroy
 */
struct proc_mgr_cmd_args_destroy {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
};

/*
 * Command arguments for ProcMgr_Params_init
 */
struct proc_mgr_cmd_args_params_init {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object. */
	struct proc_mgr_params *params;
	/*Pointer to the ProcMgr instance params structure in which the default
	 params is to be returned. */
};

/*
 * Command arguments for ProcMgr_create
 */
struct proc_mgr_cmd_args_create {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	u16 proc_id;
	/*Processor ID represented by this ProcMgr instance */
	struct proc_mgr_params  params;
	/*ProcMgr instance configuration parameters. */
	void *handle;
	/*Handle to the created ProcMgr object */
};

/*
 * Command arguments for ProcMgr_delete
 */
struct proc_mgr_cmd_args_delete{
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Pointer to Handle to the ProcMgr object */
};

/*
 * Command arguments for ProcMgr_open
 */
struct proc_mgr_cmd_args_open {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	u16 proc_id;
	/*Processor ID represented by this ProcMgr instance */
	void *handle;
	/*Handle to the opened ProcMgr object. */
	struct proc_mgr_proc_info proc_info;
	/*Processor information.  */
};

/*
 * Command arguments for ProcMgr_close
 */
struct proc_mgr_cmd_args_close{
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	struct proc_mgr_proc_info proc_info;
	/*Processor information.  */
};

/*
 * Command arguments for ProcMgr_getAttachParams
 */
struct proc_mgr_cmd_args_get_attach_params{
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object. */
	struct proc_mgr_attach_params *params;
	/*Pointer to the ProcMgr attach params structure in which the default
	 params is to be returned. */
};

/*
 * Command arguments for ProcMgr_attach
 */
struct proc_mgr_cmd_args_attach {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object. */
	struct proc_mgr_attach_params *params;
	/*Optional ProcMgr attach parameters.  */
	struct proc_mgr_proc_info proc_info;
	/*Processor information.  */
};

/*
 * Command arguments for ProcMgr_detach
 */
struct proc_mgr_cmd_args_detach {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	struct proc_mgr_proc_info proc_info;
	/*Processor information.  */
};


/*
 * Command arguments for ProcMgr_getStartParams
 */
struct proc_mgr_cmd_args_get_start_params {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Entry point for the image*/
	u32 entry_point;
	/*Handle to the ProcMgr object */
	struct proc_mgr_start_params *params;
	/*Pointer to the ProcMgr start params structure in which the default
	 params is to be returned. */
};

/*
 * Command arguments for ProcMgr_getState
 */
struct proc_mgr_cmd_args_get_state {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/* Handle to the ProcMgr object */
	enum proc_mgr_state proc_mgr_state;
	/*Current state of the ProcMgr object. */
};

/*
 * Command arguments for ProcMgr_read
 */
struct proc_mgr_cmd_args_read {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	u32 proc_addr;
	/*Address in space processor's address space of the memory region to
	 read from. */
	u32 num_bytes;
	/*IN/OUT parameter. As an IN-parameter, it takes in the number of bytes
	 to be read. When the function returns, this parameter contains the
	 number of bytes actually read. */
	void *buffer;
	/*User-provided buffer in which the slave processor's memory contents
	 are to be copied. */
};

/*
 * Command arguments for ProcMgr_write
 */
struct proc_mgr_cmd_args_write {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	u32 proc_addr;
	/*Address in space processor's address space of the memory region to
	 write into. */
	u32 num_bytes;
	/*IN/OUT parameter. As an IN-parameter, it takes in the number of bytes
	 to be written. When the function returns, this parameter contains the
	 number of bytes actually written. */
	void *buffer;
	/*User-provided buffer from which the data is to be written into the
	 slave processor's memory. */
};

/*
 * Command arguments for ProcMgr_control
 */
struct proc_mgr_cmd_args_control {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	int cmd;
	/*Device specific processor command */
	void *arg;
	/*Arguments specific to the type of command. */
};

/*
 * Command arguments for ProcMgr_translateAddr
 */
struct proc_mgr_cmd_args_translate_addr {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	void *dst_addr;
	/*Return parameter: Pointer to receive the translated address. */
	enum proc_mgr_addr_type dst_addr_type;
	/*Destination address type requested */
	void *src_addr;
	/*Source address in the source address space */
	enum proc_mgr_addr_type src_addr_type;
	/*Source address type */
};

/*
 * Command arguments for ProcMgr_getSymbolAddress
 */
struct proc_mgr_cmd_args_get_symbol_address {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	u32 file_id;
	/*ID of the file received from the load function */
	char *symbol_name;
	/*Name of the symbol */
	u32 sym_value;
	/*Return parameter: Symbol address */
};

/*
 * Command arguments for ProcMgr_registerNotify
 */
struct proc_mgr_cmd_args_register_notify {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	int (*callback_fxn)(u16 proc_id, void *handle,
		enum proc_mgr_state from_state, enum proc_mgr_state to_state);
	/*Handling function to be registered. */
	void *args;
	/*Optional arguments associated with the handler fxn. */
	enum proc_mgr_state state[];
	/*Array of target states for which registration is required. */
};

/*
 * Command arguments for ProcMgr_getProcInfo
 */
struct proc_mgr_cmd_args_get_proc_info {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	/*Handle to the ProcMgr object */
	struct proc_mgr_proc_info *proc_info;
	/*Pointer to the ProcInfo object to be populated. */
};

/*
 * Command arguments for ProcMgr_virtToPhys
 */
struct proc_mgr_cmd_args_get_virt_to_phys {
	struct proc_mgr_cmd_args commond_args;
	/*Common command args */
	void *handle;
	u32 da;
	/* mem entries buffer */
	u32 *mem_entries;
	/* number of entries */
	u32 num_of_entries;
};

struct proc_mgr_cmd_args_cpurev {
	struct proc_mgr_cmd_args commond_args;
	u32 *cpu_rev;
};
#endif