~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/plat-omap/include/syslink/ipc.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  sysmgr.h
3
 
 *
4
 
 *  Defines for System manager.
5
 
 *
6
 
 *  Copyright(C) 2009 Texas Instruments, Inc.
7
 
 *
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.
11
 
 *
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
15
 
 *  PURPOSE.
16
 
 */
17
 
 
18
 
#ifndef _IPC_H_
19
 
#define _IPC_H_
20
 
 
21
 
 
22
 
/* Module headers */
23
 
#include <multiproc.h>
24
 
#include <gatepeterson.h>
25
 
#include <sharedregion.h>
26
 
#include <notify.h>
27
 
#include <notify_ducatidriver.h>
28
 
#include <heap.h>
29
 
#include <heapbufmp.h>
30
 
#include <heapmemmp.h>
31
 
 
32
 
 
33
 
 
34
 
/* Unique module ID. */
35
 
#define IPC_MODULEID                    (0xF086)
36
 
 
37
 
 
38
 
/* =============================================================================
39
 
 * Module Success and Failure codes
40
 
 * =============================================================================
41
 
 */
42
 
/* The resource is still in use */
43
 
#define IPC_S_BUSY              2
44
 
 
45
 
/* The module has been already setup */
46
 
#define IPC_S_ALREADYSETUP      1
47
 
 
48
 
/* Operation is successful. */
49
 
#define IPC_S_SUCCESS           0
50
 
 
51
 
/* Generic failure. */
52
 
#define IPC_E_FAIL              -1
53
 
 
54
 
/* Argument passed to function is invalid. */
55
 
#define IPC_E_INVALIDARG        -2
56
 
 
57
 
/* Operation resulted in memory failure. */
58
 
#define IPC_E_MEMORY            -3
59
 
 
60
 
/* The specified entity already exists. */
61
 
#define IPC_E_ALREADYEXISTS     -4
62
 
 
63
 
/* Unable to find the specified entity. */
64
 
#define IPC_E_NOTFOUND          -5
65
 
 
66
 
/* Operation timed out. */
67
 
#define IPC_E_TIMEOUT           -6
68
 
 
69
 
/* Module is not initialized. */
70
 
#define IPC_E_INVALIDSTATE      -7
71
 
 
72
 
/* A failure occurred in an OS-specific call */
73
 
#define IPC_E_OSFAILURE         -8
74
 
 
75
 
/* Specified resource is not available */
76
 
#define IPC_E_RESOURCE          -9
77
 
 
78
 
/* Operation was interrupted. Please restart the operation */
79
 
#define IPC_E_RESTART           -10
80
 
 
81
 
 
82
 
/* =============================================================================
83
 
 * Macros
84
 
 * =============================================================================
85
 
 */
86
 
/* IPC_CONTROLCMD_LOADCALLBACK */
87
 
#define IPC_CONTROLCMD_LOADCALLBACK     (0xBABE0000)
88
 
 
89
 
/* IPC_CONTROLCMD_STARTCALLBACK */
90
 
#define IPC_CONTROLCMD_STARTCALLBACK    (0xBABE0001)
91
 
 
92
 
/* IPC_CONTROLCMD_STOPCALLBACK */
93
 
#define IPC_CONTROLCMD_STOPCALLBACK     (0xBABE0002)
94
 
 
95
 
 
96
 
/* =============================================================================
97
 
 * Enums & Structures
98
 
 * =============================================================================
99
 
 */
100
 
/* the different options for processor synchronization */
101
 
enum ipc_proc_sync {
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 */
105
 
};
106
 
 
107
 
/* ipc configuration structure. */
108
 
struct ipc_config {
109
 
        enum ipc_proc_sync proc_sync;
110
 
        /* the different options for processor synchronization */
111
 
};
112
 
 
113
 
/* ipc configuration structure. */
114
 
struct ipc_params {
115
 
        bool setup_messageq;
116
 
        bool setup_notify;
117
 
        bool setup_ipu_pm;
118
 
        bool slave;
119
 
        enum ipc_proc_sync proc_sync;
120
 
};
121
 
 
122
 
/* IPC events. */
123
 
enum {
124
 
        IPC_CLOSE = 0,
125
 
        IPC_START = 1,
126
 
        IPC_STOP = 2,
127
 
};
128
 
 
129
 
/* =============================================================================
130
 
 * APIs
131
 
 * =============================================================================
132
 
 */
133
 
/* Attach to remote processor */
134
 
int ipc_attach(u16 remote_proc_id);
135
 
 
136
 
/* Detach from the remote processor */
137
 
int ipc_detach(u16 remote_proc_id);
138
 
 
139
 
/* Reads the config entry from the config area. */
140
 
int ipc_read_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
141
 
 
142
 
/* Reserves memory, creates default gatemp and heapmemmp */
143
 
int ipc_start(void);
144
 
 
145
 
/* Writes the config entry to the config area. */
146
 
int ipc_write_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
147
 
 
148
 
/* Returns default configuration values for ipc. */
149
 
void ipc_get_config(struct ipc_config *cfg_params);
150
 
 
151
 
/* Sets up ipc for this processor. */
152
 
int ipc_setup(const struct ipc_config *cfg_params);
153
 
 
154
 
/* Destroys ipc for this processor. */
155
 
int ipc_destroy(void);
156
 
 
157
 
/* Creates a ipc. */
158
 
int ipc_create(u16 proc_id, struct ipc_params *params);
159
 
 
160
 
/* Function to control a Ipc instance for a slave */
161
 
int ipc_control(u16 proc_id, u32 cmd_id, void *arg);
162
 
 
163
 
/* Function to read configuration information from ipc module */
164
 
int ipc_read_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
165
 
 
166
 
/* Function to write configuration information to ipc module */
167
 
int ipc_write_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size);
168
 
 
169
 
/* Clears memory, deletes  default gatemp and heapmemmp */
170
 
int ipc_stop(void);
171
 
 
172
 
/* IPC event notifications. */
173
 
int ipc_notify_event(int event, void *data);
174
 
 
175
 
/* Register for IPC events. */
176
 
int ipc_register_notifier(struct notifier_block *nb);
177
 
 
178
 
/* Un-register for IPC events. */
179
 
int ipc_unregister_notifier(struct notifier_block *nb);
180
 
 
181
 
/* check if ipc is in recovery state */
182
 
#ifdef CONFIG_SYSLINK_RECOVERY
183
 
bool ipc_recovering(void);
184
 
#endif
185
 
 
186
 
/* Indicate to schedule the recovery mechanism */
187
 
void ipc_recover_schedule(void);
188
 
 
189
 
#endif /* ifndef _IPC_H_ */