4
* Defines for System manager.
6
* Copyright(C) 2009 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
23
#include <multiproc.h>
24
#include <gatepeterson.h>
25
#include <sharedregion.h>
27
#include <notify_ducatidriver.h>
29
#include <heapbufmp.h>
30
#include <heapmemmp.h>
34
/* Unique module ID. */
35
#define IPC_MODULEID (0xF086)
38
/* =============================================================================
39
* Module Success and Failure codes
40
* =============================================================================
42
/* The resource is still in use */
45
/* The module has been already setup */
46
#define IPC_S_ALREADYSETUP 1
48
/* Operation is successful. */
49
#define IPC_S_SUCCESS 0
51
/* Generic failure. */
54
/* Argument passed to function is invalid. */
55
#define IPC_E_INVALIDARG -2
57
/* Operation resulted in memory failure. */
58
#define IPC_E_MEMORY -3
60
/* The specified entity already exists. */
61
#define IPC_E_ALREADYEXISTS -4
63
/* Unable to find the specified entity. */
64
#define IPC_E_NOTFOUND -5
66
/* Operation timed out. */
67
#define IPC_E_TIMEOUT -6
69
/* Module is not initialized. */
70
#define IPC_E_INVALIDSTATE -7
72
/* A failure occurred in an OS-specific call */
73
#define IPC_E_OSFAILURE -8
75
/* Specified resource is not available */
76
#define IPC_E_RESOURCE -9
78
/* Operation was interrupted. Please restart the operation */
79
#define IPC_E_RESTART -10
82
/* =============================================================================
84
* =============================================================================
86
/* IPC_CONTROLCMD_LOADCALLBACK */
87
#define IPC_CONTROLCMD_LOADCALLBACK (0xBABE0000)
89
/* IPC_CONTROLCMD_STARTCALLBACK */
90
#define IPC_CONTROLCMD_STARTCALLBACK (0xBABE0001)
92
/* IPC_CONTROLCMD_STOPCALLBACK */
93
#define IPC_CONTROLCMD_STOPCALLBACK (0xBABE0002)
96
/* =============================================================================
98
* =============================================================================
100
/* the different options for processor synchronization */
102
IPC_PROCSYNC_NONE, /* don't do any processor sync */
103
IPC_PROCSYNC_PAIR, /* sync pair of processors in ipc_attach */
104
IPC_PROCSYNC_ALL /* sync all processors, done in ipc_start */
107
/* ipc configuration structure. */
109
enum ipc_proc_sync proc_sync;
110
/* the different options for processor synchronization */
113
/* ipc configuration structure. */
119
enum ipc_proc_sync proc_sync;
129
/* =============================================================================
131
* =============================================================================
133
/* Attach to remote processor */
134
int ipc_attach(u16 remote_proc_id);
136
/* Detach from the remote processor */
137
int ipc_detach(u16 remote_proc_id);
139
/* Reads the config entry from the config area. */
140
int ipc_read_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
142
/* Reserves memory, creates default gatemp and heapmemmp */
145
/* Writes the config entry to the config area. */
146
int ipc_write_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
148
/* Returns default configuration values for ipc. */
149
void ipc_get_config(struct ipc_config *cfg_params);
151
/* Sets up ipc for this processor. */
152
int ipc_setup(const struct ipc_config *cfg_params);
154
/* Destroys ipc for this processor. */
155
int ipc_destroy(void);
158
int ipc_create(u16 proc_id, struct ipc_params *params);
160
/* Function to control a Ipc instance for a slave */
161
int ipc_control(u16 proc_id, u32 cmd_id, void *arg);
163
/* Function to read configuration information from ipc module */
164
int ipc_read_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
166
/* Function to write configuration information to ipc module */
167
int ipc_write_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
169
/* Clears memory, deletes default gatemp and heapmemmp */
172
/* IPC event notifications. */
173
int ipc_notify_event(int event, void *data);
175
/* Register for IPC events. */
176
int ipc_register_notifier(struct notifier_block *nb);
178
/* Un-register for IPC events. */
179
int ipc_unregister_notifier(struct notifier_block *nb);
181
/* check if ipc is in recovery state */
182
#ifdef CONFIG_SYSLINK_RECOVERY
183
bool ipc_recovering(void);
186
/* Indicate to schedule the recovery mechanism */
187
void ipc_recover_schedule(void);
189
#endif /* ifndef _IPC_H_ */