summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86c1d55)
raw | patch | inline | side by side (parent: 86c1d55)
author | Wendy Liang <jliang@xilinx.com> | |
Tue, 28 Jun 2016 23:08:47 +0000 (16:08 -0700) | ||
committer | Wendy Liang <jliang@xilinx.com> | |
Thu, 13 Oct 2016 05:01:43 +0000 (22:01 -0700) |
Add parameter to rpmsg_init() to allow caller to specify
whether to initialize environment in the function.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
whether to initialize environment in the function.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/rpmsg.h | patch | blob | history | |
lib/remoteproc/remoteproc.c | patch | blob | history | |
lib/rpmsg/rpmsg.c | patch | blob | history |
index 1230f6b35b4be5a2daed7a7fe26b8072bdd366d5..8bf92981c81aeefd9d75031187f981f1e30b6e54 100644 (file)
* @param channel_destroyed - callback function for channel deletion
* @default_cb - default callback for channel
* @param role - role of the other device, Master or Remote
+ * @param init_env - 1 to initialize env, 0 not to
* @return - status of function execution
*
*/
int rpmsg_init(int dev_id, struct remote_device **rdev,
rpmsg_chnl_cb_t channel_created,
rpmsg_chnl_cb_t channel_destroyed,
- rpmsg_rx_cb_t default_cb, int role);
+ rpmsg_rx_cb_t default_cb, int role,
+ int init_env);
/**
* rpmsg_deinit
index 56fb333cfdb11206ebb113f8a38111e4b1d1a630..cf51ee51168d9038e1f9c43a55ab08cdf90245f3 100644 (file)
rpmsg_init(rproc->proc->cpu_id,
&rproc->rdev, channel_created,
channel_destroyed, default_cb,
- RPMSG_MASTER);
+ RPMSG_MASTER, 0);
} else {
status = RPROC_ERR_NO_RSC_TABLE;
}
&rproc->rdev,
rproc->channel_created,
rproc->channel_destroyed,
- rproc->default_cb, RPMSG_MASTER);
+ rproc->default_cb, RPMSG_MASTER, 0);
#else
status =
rpmsg_init(rproc->proc->cpu_id,
&rproc->rdev,
rproc->channel_created,
rproc->channel_destroyed,
- rproc->default_cb, RPMSG_REMOTE);
+ rproc->default_cb, RPMSG_REMOTE, 0);
#endif
}
} else {
diff --git a/lib/rpmsg/rpmsg.c b/lib/rpmsg/rpmsg.c
index 9a3549643e8026425803ec7687ffe4e749469783..0497ff82f8738aa9d3ae01834f5b7d682bae1e70 100644 (file)
--- a/lib/rpmsg/rpmsg.c
+++ b/lib/rpmsg/rpmsg.c
* @param channel_destroyed - callback function for channel deletion
* @param default_cb - default callback for channel I/O
* @param role - role of the other device, Master or Remote
+ * @param init_env - 1 to initialize env, 0 not to
*
* @return - status of function execution
*
int rpmsg_init(int dev_id, struct remote_device **rdev,
rpmsg_chnl_cb_t channel_created,
rpmsg_chnl_cb_t channel_destroyed,
- rpmsg_rx_cb_t default_cb, int role)
+ rpmsg_rx_cb_t default_cb, int role,
+ int init_env)
{
int status;
- /* Initialize IPC environment */
- struct metal_init_params init_params = METAL_INIT_DEFAULTS;
- status = metal_init(&init_params);
+ if (init_env) {
+ /* Initialize IPC environment */
+ struct metal_init_params init_params = METAL_INIT_DEFAULTS;
+ status = metal_init(&init_params);
+ if (status != RPMSG_SUCCESS)
+ return status;
+ }
+
+ /* Initialize the remote device for given cpu id */
+ status = rpmsg_rdev_init(rdev, dev_id, role, channel_created,
+ channel_destroyed, default_cb);
if (status == RPMSG_SUCCESS) {
- /* Initialize the remote device for given cpu id */
- status = rpmsg_rdev_init(rdev, dev_id, role, channel_created,
- channel_destroyed, default_cb);
- if (status == RPMSG_SUCCESS) {
- /* Kick off IPC with the remote device */
- status = rpmsg_start_ipc(*rdev);
- }
+ /* Kick off IPC with the remote device */
+ status = rpmsg_start_ipc(*rdev);
}
/* Deinit system in case of error */